mis-crystal-design-system 18.1.8 → 18.1.9

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Pipe, input, output, signal, Component, NgModule } from '@angular/core';
2
+ import { Pipe, input, output, signal, computed, effect, Component, NgModule } from '@angular/core';
3
3
  import * as i2 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i4 from '@angular/forms';
@@ -61,6 +61,7 @@ class HasValuePipe {
61
61
  }]
62
62
  }], null, null); })();
63
63
 
64
+ const _c0 = () => [];
64
65
  function FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_3_Template(rf, ctx) { if (rf & 1) {
65
66
  const _r3 = i0.ɵɵgetCurrentView();
66
67
  i0.ɵɵelementContainerStart(0);
@@ -69,10 +70,11 @@ function FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_3_Template
69
70
  i0.ɵɵelementEnd()();
70
71
  i0.ɵɵelementContainerEnd();
71
72
  } if (rf & 2) {
73
+ let tmp_7_0;
72
74
  const filter_r4 = i0.ɵɵnextContext(2).$implicit;
73
75
  const ctx_r1 = i0.ɵɵnextContext(2);
74
76
  i0.ɵɵadvance(2);
75
- i0.ɵɵproperty("label", filter_r4.placeholder || "Select")("selectedItems", ctx_r1.filterForm.get(filter_r4.key).value)("data", filter_r4.options)("searchEnabled", true)("showSelectedCount", true)("enableSelectAll", true)("hideApplyButton", false);
77
+ i0.ɵɵproperty("label", filter_r4.placeholder || "Select")("selectedItems", ((tmp_7_0 = ctx_r1.filterForm.get(filter_r4.key)) == null ? null : tmp_7_0.value) || i0.ɵɵpureFunction0(7, _c0))("data", filter_r4.options)("searchEnabled", true)("showSelectedCount", true)("enableSelectAll", true)("hideApplyButton", false);
76
78
  } }
77
79
  function FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_4_Template(rf, ctx) { if (rf & 1) {
78
80
  const _r5 = i0.ɵɵgetCurrentView();
@@ -82,10 +84,11 @@ function FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_4_Template
82
84
  i0.ɵɵelementEnd()();
83
85
  i0.ɵɵelementContainerEnd();
84
86
  } if (rf & 2) {
87
+ let tmp_8_0;
85
88
  const filter_r4 = i0.ɵɵnextContext(2).$implicit;
86
89
  const ctx_r1 = i0.ɵɵnextContext(2);
87
90
  i0.ɵɵadvance(2);
88
- i0.ɵɵproperty("data", filter_r4.options)("searchEnabled", true)("selectedItem", ctx_r1.filterForm.get(filter_r4.key).value);
91
+ i0.ɵɵproperty("data", filter_r4.options)("searchEnabled", true)("selectedItem", (tmp_8_0 = ctx_r1.filterForm.get(filter_r4.key)) == null ? null : tmp_8_0.value);
89
92
  } }
90
93
  function FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_5_div_2_Template(rf, ctx) { if (rf & 1) {
91
94
  const _r6 = i0.ɵɵgetCurrentView();
@@ -101,7 +104,7 @@ function FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_5_div_2_Te
101
104
  const filter_r4 = i0.ɵɵnextContext(3).$implicit;
102
105
  const ctx_r1 = i0.ɵɵnextContext(2);
103
106
  i0.ɵɵadvance();
104
- i0.ɵɵproperty("type", "Default")("checked", (tmp_9_0 = ctx_r1.filterForm.get(filter_r4.key).value) == null ? null : tmp_9_0.includes(option_r7.value));
107
+ i0.ɵɵproperty("type", "Default")("checked", (tmp_9_0 = ctx_r1.filterForm.get(filter_r4.key)) == null ? null : tmp_9_0.value == null ? null : tmp_9_0.value.includes(option_r7.value));
105
108
  i0.ɵɵadvance(2);
106
109
  i0.ɵɵtextInterpolate(option_r7.label);
107
110
  } }
@@ -119,18 +122,18 @@ function FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_5_Template
119
122
  function FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_6_Template(rf, ctx) { if (rf & 1) {
120
123
  const _r8 = i0.ɵɵgetCurrentView();
121
124
  i0.ɵɵelementContainerStart(0);
122
- i0.ɵɵtext(1);
123
- i0.ɵɵelementStart(2, "mis-input", 25)(3, "input", 26);
124
- i0.ɵɵlistener("dateChange", function FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_6_Template_input_dateChange_3_listener($event) { i0.ɵɵrestoreView(_r8); const filter_r4 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onDateChange($event, filter_r4.key, filter_r4)); });
125
+ i0.ɵɵelementStart(1, "mis-input", 25)(2, "input", 26);
126
+ i0.ɵɵlistener("dateChange", function FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_6_Template_input_dateChange_2_listener($event) { i0.ɵɵrestoreView(_r8); const filter_r4 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onDateChange($event, filter_r4.key, filter_r4)); });
125
127
  i0.ɵɵelementEnd()();
126
128
  i0.ɵɵelementContainerEnd();
127
129
  } if (rf & 2) {
130
+ let tmp_7_0;
131
+ let tmp_8_0;
132
+ let tmp_9_0;
128
133
  const filter_r4 = i0.ɵɵnextContext(2).$implicit;
129
134
  const ctx_r1 = i0.ɵɵnextContext(2);
130
- i0.ɵɵadvance();
131
- i0.ɵɵtextInterpolate1(" ", filter_r4.placeholder, " ");
132
135
  i0.ɵɵadvance(2);
133
- i0.ɵɵproperty("dpConfig", filter_r4.datepickerConfig)("placeholder", ctx_r1.filterForm.get(filter_r4.key).value ? ctx_r1.filterForm.get(filter_r4.key).value : filter_r4.placeholder || "Select")("value", ctx_r1.filterForm.get(filter_r4.key).value ? ctx_r1.filterForm.get(filter_r4.key).value : filter_r4.placeholder || "Select")("selectedDate", ctx_r1.filterForm.get(filter_r4.key).value)("positionX", "end")("offsetX", -10);
136
+ i0.ɵɵproperty("dpConfig", filter_r4.datePickerConfig)("placeholder", ((tmp_7_0 = ctx_r1.filterForm.get(filter_r4.key)) == null ? null : tmp_7_0.value) || filter_r4.placeholder || "Select")("value", ((tmp_8_0 = ctx_r1.filterForm.get(filter_r4.key)) == null ? null : tmp_8_0.value) || filter_r4.placeholder || "Select")("selectedDate", (tmp_9_0 = ctx_r1.filterForm.get(filter_r4.key)) == null ? null : tmp_9_0.value)("positionX", "end")("offsetX", -10);
134
137
  } }
135
138
  function FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_7_Template(rf, ctx) { if (rf & 1) {
136
139
  const _r9 = i0.ɵɵgetCurrentView();
@@ -193,7 +196,7 @@ function FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_10_Templat
193
196
  i0.ɵɵadvance(3);
194
197
  i0.ɵɵtextInterpolate((filter_r4 == null ? null : filter_r4.options == null ? null : filter_r4.options[1] == null ? null : filter_r4.options[1].label) || "Max");
195
198
  i0.ɵɵadvance();
196
- i0.ɵɵproperty("placeholder", filter_r4.placeholder || "Type here")("min", (ctx_r1.filterForm.get == null ? null : (tmp_11_0 = ctx_r1.filterForm.get(filter_r4.key)) == null ? null : (tmp_11_0 = tmp_11_0.get("min")) == null ? null : tmp_11_0.value) || 0);
199
+ i0.ɵɵproperty("placeholder", filter_r4.placeholder || "Type here")("min", ((tmp_11_0 = ctx_r1.filterForm.get(filter_r4.key)) == null ? null : (tmp_11_0 = tmp_11_0.get("min")) == null ? null : tmp_11_0.value) || 0);
197
200
  } }
198
201
  function FilterPanelComponent_div_0_ng_container_9_div_1_div_11_Template(rf, ctx) { if (rf & 1) {
199
202
  i0.ɵɵelement(0, "div", 34);
@@ -202,7 +205,7 @@ function FilterPanelComponent_div_0_ng_container_9_div_1_Template(rf, ctx) { if
202
205
  i0.ɵɵelementStart(0, "div", 13)(1, "span", 14);
203
206
  i0.ɵɵtext(2);
204
207
  i0.ɵɵelementEnd();
205
- i0.ɵɵtemplate(3, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_3_Template, 3, 7, "ng-container", 15)(4, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_4_Template, 3, 3, "ng-container", 15)(5, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_5_Template, 3, 1, "ng-container", 15)(6, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_6_Template, 4, 7, "ng-container", 15)(7, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_7_Template, 3, 6, "ng-container", 15)(8, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_8_Template, 3, 2, "ng-container", 15)(9, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_9_Template, 3, 2, "ng-container", 15)(10, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_10_Template, 10, 6, "ng-container", 15)(11, FilterPanelComponent_div_0_ng_container_9_div_1_div_11_Template, 1, 0, "div", 16);
208
+ i0.ɵɵtemplate(3, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_3_Template, 3, 8, "ng-container", 15)(4, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_4_Template, 3, 3, "ng-container", 15)(5, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_5_Template, 3, 1, "ng-container", 15)(6, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_6_Template, 3, 6, "ng-container", 15)(7, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_7_Template, 3, 6, "ng-container", 15)(8, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_8_Template, 3, 2, "ng-container", 15)(9, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_9_Template, 3, 2, "ng-container", 15)(10, FilterPanelComponent_div_0_ng_container_9_div_1_ng_container_10_Template, 10, 6, "ng-container", 15)(11, FilterPanelComponent_div_0_ng_container_9_div_1_div_11_Template, 1, 0, "div", 16);
206
209
  i0.ɵɵelementEnd();
207
210
  } if (rf & 2) {
208
211
  const ctx_r9 = i0.ɵɵnextContext();
@@ -275,92 +278,161 @@ function FilterPanelComponent_div_0_Template(rf, ctx) { if (rf & 1) {
275
278
  class FilterPanelComponent {
276
279
  constructor(hasValue) {
277
280
  this.hasValue = hasValue;
278
- // Signal inputs replacing @Input()
281
+ this.isInitialized = false;
282
+ /* --- signal-based Inputs / Outputs --- */
279
283
  this.show = input(false);
280
284
  this.config = input.required();
281
285
  this.emitFiltersAfterSettingNewValues = input(false);
282
- // Signal outputs replacing @Output()
283
286
  this.onClose = output();
284
287
  this.onApply = output();
288
+ /* --- form + internal state --- */
285
289
  this.filterForm = new FormGroup({});
290
+ // keep a signal snapshot of form value so computed can react
291
+ this._formValueSignal = signal({});
292
+ // last applied snapshot (signal so template/logic can read reliably)
293
+ this.lastAppliedData = signal(null);
294
+ // date range readable for template
286
295
  this.dateRangeSelectedDates = signal({
287
296
  startDate: '',
288
- endDate: '',
297
+ endDate: ''
289
298
  });
290
- }
291
- // Method to calculate filter count (not a computed signal because form values aren't reactive)
292
- getFilterCount() {
293
- let count = 0;
294
- const formValue = this.filterForm.value;
295
- this.config().forEach((filter) => {
296
- const value = formValue[filter.key];
297
- // Special handling for range type - only count if at least one value is set
298
- if (filter.type === 'range') {
299
- if (value && (value.min !== null || value.max !== null)) {
299
+ /* computed filterCount */
300
+ this.filterCount = computed(() => {
301
+ const formValue = this._formValueSignal();
302
+ const cfg = this.config();
303
+ let count = 0;
304
+ for (const filter of cfg) {
305
+ const value = formValue[filter.key];
306
+ if (filter.type === 'range') {
307
+ if (value && (value.min !== null || value.max !== null)) {
308
+ count++;
309
+ }
310
+ continue;
311
+ }
312
+ if (filter.type === 'multiSelect' || filter.type === 'checkbox') {
313
+ if (Array.isArray(value) && value.length > 0) {
314
+ count++;
315
+ }
316
+ continue;
317
+ }
318
+ if (this.hasValue.transform(value)) {
300
319
  count++;
301
320
  }
302
- return;
303
321
  }
304
- // Special handling for multiSelect/checkbox - check array length directly
305
- if (filter.type === 'multiSelect' || filter.type === 'checkbox') {
306
- if (Array.isArray(value) && value.length > 0) {
307
- count++;
322
+ return count;
323
+ });
324
+ // Effect to react to config changes - must allow signal writes since we update internal signals
325
+ effect(() => {
326
+ try {
327
+ const cfg = this.config();
328
+ if (cfg && Array.isArray(cfg) && cfg.length > 0) {
329
+ // Only initialize form if not already done, or if config structure changed
330
+ if (!this.isInitialized || this.hasConfigChanged(cfg)) {
331
+ this.initializeFormControls(cfg);
332
+ this.isInitialized = true;
333
+ }
334
+ // Always check for selectedValue changes
335
+ this.setFilterValue(cfg);
308
336
  }
309
- return;
310
337
  }
311
- // For other types, use hasValue pipe
312
- if (this.hasValue.transform(value)) {
313
- count++;
338
+ catch (error) {
339
+ console.warn('FilterPanel: Error in config effect', error);
314
340
  }
315
- });
316
- return count;
341
+ }, { allowSignalWrites: true });
317
342
  }
343
+ /* --- Lifecycle --- */
318
344
  ngOnInit() {
319
- // Access the config signal value by calling it like a function
320
- this.initializeFormControls(this.config());
345
+ // subscribe form changes so computed/filterCount update
346
+ this.subscribeFormChanges();
347
+ }
348
+ ngOnDestroy() {
349
+ this.formSubscription?.unsubscribe();
321
350
  }
351
+ /* --- Form init & helpers --- */
322
352
  initializeFormControls(config) {
323
- this.filterForm = new FormGroup({});
324
- config.forEach((filter) => {
325
- let control;
326
- if (filter.type === 'range') {
327
- control = new FormGroup({
328
- min: new FormControl(null),
329
- max: new FormControl(null),
330
- }, {
331
- validators: (group) => {
332
- const min = group.get('min').value;
333
- const max = group.get('max').value;
334
- if (min !== null && max !== null && min > max) {
335
- return { rangeError: 'Min value should be less than max value' };
336
- }
337
- return null;
338
- }
339
- });
340
- }
341
- else if (filter.type === 'multiSelect' || filter.type === 'checkbox') {
342
- control = new FormControl([]);
353
+ // build a fresh form to match config
354
+ const newForm = new FormGroup({});
355
+ const rangeValidator = (group) => {
356
+ const min = group.get('min')?.value;
357
+ const max = group.get('max')?.value;
358
+ if (min !== null && max !== null && min > max) {
359
+ return { rangeError: 'Min value should be less than max value' };
343
360
  }
344
- else if (filter.type === 'select') {
345
- control = new FormControl('');
346
- }
347
- else {
348
- control = new FormControl(null);
361
+ return null;
362
+ };
363
+ for (const filter of config) {
364
+ let control;
365
+ switch (filter.type) {
366
+ case 'range':
367
+ control = new FormGroup({
368
+ min: new FormControl(null),
369
+ max: new FormControl(null)
370
+ }, { validators: rangeValidator });
371
+ break;
372
+ case 'multiSelect':
373
+ case 'checkbox':
374
+ control = new FormControl(Array.isArray(filter.defaultValue) ? filter.defaultValue : []);
375
+ break;
376
+ case 'select':
377
+ control = new FormControl(filter.defaultValue ?? '');
378
+ break;
379
+ default:
380
+ control = new FormControl(filter.defaultValue ?? null);
349
381
  }
350
382
  if (this.hasValue.transform(filter.defaultValue)) {
351
383
  control.setValue(filter.defaultValue);
352
384
  }
353
- this.filterForm.addControl(filter.key, control);
385
+ newForm.addControl(filter.key, control);
386
+ }
387
+ // replace form safely
388
+ // preserve subscription so valueChanges continues to update _formValueSignal
389
+ this.filterForm = newForm;
390
+ // update signal snapshot immediately
391
+ this._formValueSignal.set({ ...this.filterForm.value });
392
+ // re-subscribe to new form's valueChanges
393
+ this.subscribeFormChanges();
394
+ }
395
+ subscribeFormChanges() {
396
+ // unsubscribe previous subscription if any
397
+ this.formSubscription?.unsubscribe();
398
+ // subscribe to valueChanges; set snapshot signal
399
+ this.formSubscription = this.filterForm.valueChanges?.subscribe((value) => {
400
+ this._formValueSignal.set({ ...value });
354
401
  });
402
+ // also set initial snapshot in case valueChanges doesn't emit immediately
403
+ this._formValueSignal.set({ ...this.filterForm.value });
355
404
  }
405
+ getControl(key) {
406
+ return this.filterForm.get(key);
407
+ }
408
+ /**
409
+ * Check if config structure has changed (new keys or removed keys)
410
+ * Used to determine if form needs to be rebuilt
411
+ */
412
+ hasConfigChanged(newConfig) {
413
+ const currentKeys = Object.keys(this.filterForm.controls).sort();
414
+ const newKeys = newConfig.map(f => f.key).sort();
415
+ if (currentKeys.length !== newKeys.length) {
416
+ return true;
417
+ }
418
+ return currentKeys.some((key, index) => key !== newKeys[index]);
419
+ }
420
+ /* --- Actions / UI handlers --- */
356
421
  closePanel() {
357
- if (this.lastAppliedData) {
358
- this.filterForm.setValue(this.lastAppliedData);
422
+ const last = this.lastAppliedData();
423
+ if (last) {
424
+ try {
425
+ // prefer setValue (ensures shape matches); fallback to patchValue
426
+ this.filterForm.setValue(last);
427
+ }
428
+ catch {
429
+ this.filterForm.patchValue(last);
430
+ }
359
431
  }
360
432
  else {
361
433
  this.clearFormValues();
362
434
  }
363
- // Emit the close event using the signal output
435
+ // emit close event
364
436
  this.onClose.emit();
365
437
  }
366
438
  applyFilters() {
@@ -368,70 +440,102 @@ class FilterPanelComponent {
368
440
  this.filterForm.markAllAsTouched();
369
441
  return;
370
442
  }
371
- this.lastAppliedData = { ...this.filterForm.value };
372
- // Emit the apply event with the filter data using the signal output
443
+ const snapshot = { ...this.filterForm.value };
444
+ this.lastAppliedData.set(snapshot);
373
445
  this.onApply.emit({
374
- filterData: this.filterForm.value,
375
- filterCount: this.getFilterCount()
446
+ filterData: snapshot,
447
+ filterCount: this.filterCount()
376
448
  });
449
+ // consistent behavior with earlier implementation:
450
+ // hide panel (parent should read show() to close) and restore form state via closePanel
451
+ // Note: we don't mutate show() here; parent owns show signal
377
452
  this.closePanel();
378
453
  }
454
+ resetFilters() {
455
+ this.clearFormValues();
456
+ // call applyFilters to maintain previous behavior (validation + emit)
457
+ this.applyFilters();
458
+ }
459
+ /* --- Value setters --- */
379
460
  handleSelect(event, filterKey, filter) {
380
- this.filterForm.get(filterKey).setValue(event);
461
+ const ctrl = this.getControl(filterKey);
462
+ // For multiSelect, extract values from array of objects (if needed)
463
+ let valueToSet = event;
464
+ if (filter.type === 'multiSelect' && Array.isArray(event)) {
465
+ // Check if it's an array of objects with 'value' property
466
+ if (event.length > 0 && typeof event[0] === 'object' && 'value' in event[0]) {
467
+ valueToSet = event.map((item) => item.value || item);
468
+ }
469
+ }
470
+ ctrl?.setValue(valueToSet);
381
471
  if (filter.onChange) {
472
+ // keep same callback contract: pass event, config and form snapshot
382
473
  filter.onChange(event, this.config(), this.filterForm.value);
383
474
  }
384
475
  }
385
- onDateChange(event, filterKey, filter) {
386
- this.filterForm.get(filterKey).setValue(event);
387
- if (typeof event === 'object') {
388
- this.dateRangeSelectedDates.set({
389
- startDate: event.startDate,
390
- endDate: event.endDate,
391
- });
392
- }
393
- }
394
476
  handleCheckbox(event, filterKey, checkboxValue, filter) {
395
- const currentValues = this.filterForm.get(filterKey).value;
396
- if (event.value) {
397
- this.filterForm.get(filterKey).setValue([...currentValues, checkboxValue]);
477
+ const ctrl = this.getControl(filterKey);
478
+ const current = Array.isArray(ctrl?.value) ? [...ctrl.value] : [];
479
+ if (event?.value) {
480
+ ctrl?.setValue([...current, checkboxValue]);
398
481
  }
399
482
  else {
400
- this.filterForm.get(filterKey).setValue(currentValues.filter((value) => value !== checkboxValue));
483
+ ctrl?.setValue(current.filter((v) => v !== checkboxValue));
401
484
  }
402
485
  if (filter.onChange) {
403
486
  filter.onChange(event, this.config(), this.filterForm.value);
404
487
  }
405
488
  }
489
+ onDateChange(event, filterKey, filter) {
490
+ const ctrl = this.getControl(filterKey);
491
+ ctrl?.setValue(event);
492
+ if (event && typeof event === 'object' && 'startDate' in event && 'endDate' in event) {
493
+ this.dateRangeSelectedDates.set({
494
+ startDate: event.startDate,
495
+ endDate: event.endDate
496
+ });
497
+ }
498
+ }
499
+ /* --- Clear / Set values helpers --- */
406
500
  clearFormValues() {
407
- const resetValues = {};
408
- this.config().forEach((filter) => {
409
- let defaultValue = filter.defaultValue || null;
501
+ const resets = {};
502
+ for (const filter of this.config()) {
503
+ let defaultValue = filter.defaultValue ?? null;
410
504
  if (filter.type === 'multiSelect' || filter.type === 'checkbox') {
411
- defaultValue = filter.defaultValue || [];
505
+ defaultValue = filter.defaultValue ?? [];
412
506
  }
413
507
  if (filter.type === 'range') {
414
- defaultValue = filter.defaultValue || { min: null, max: null };
508
+ defaultValue = filter.defaultValue ?? { min: null, max: null };
415
509
  }
416
- resetValues[filter.key] = defaultValue;
417
- });
418
- this.filterForm.patchValue(resetValues);
419
- }
420
- resetFilters() {
421
- this.clearFormValues();
422
- this.applyFilters();
510
+ resets[filter.key] = defaultValue;
511
+ }
512
+ // patch to avoid shape mismatch errors
513
+ this.filterForm.patchValue(resets);
514
+ this._formValueSignal.set({ ...this.filterForm.value });
423
515
  }
516
+ /**
517
+ * Applies filter.selectedValue when parent provides selectedValue.
518
+ * Called by the config effect (so runs on initial load and on config changes).
519
+ */
424
520
  setFilterValue(config) {
425
521
  let anyValueSet = false;
426
522
  for (const filter of config) {
427
- if (filter?.selectedValue) {
428
- this.filterForm.get(filter.key).setValue(filter.selectedValue);
429
- anyValueSet = true;
523
+ if (this.hasValue.transform(filter?.selectedValue)) {
524
+ const ctrl = this.getControl(filter.key);
525
+ if (ctrl) {
526
+ ctrl.setValue(filter.selectedValue);
527
+ anyValueSet = true;
528
+ }
430
529
  }
431
530
  }
432
531
  if (anyValueSet && this.emitFiltersAfterSettingNewValues()) {
532
+ // respect the parent flag — apply and emit
433
533
  this.applyFilters();
434
534
  }
535
+ else {
536
+ // make sure our snapshot signal is fresh
537
+ this._formValueSignal.set({ ...this.filterForm.value });
538
+ }
435
539
  }
436
540
  static { this.ɵfac = function FilterPanelComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FilterPanelComponent)(i0.ɵɵdirectiveInject(HasValuePipe)); }; }
437
541
  static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FilterPanelComponent, selectors: [["mis-filter-panel"]], inputs: { show: [1, "show"], config: [1, "config"], emitFiltersAfterSettingNewValues: [1, "emitFiltersAfterSettingNewValues"] }, outputs: { onClose: "onClose", onApply: "onApply" }, decls: 1, vars: 1, consts: [["class", "filter-panel-container", 4, "ngIf"], [1, "filter-panel-container"], [1, "panel-header"], ["width", "25", "height", "25", "viewBox", "0 0 25 25", "fill", "none", "xmlns", "http://www.w3.org/2000/svg", 1, "close-icon", 3, "click"], ["id", "ic-navigation-cancel-24"], ["id", "Union", "fill-rule", "evenodd", "clip-rule", "evenodd", "d", "M8.60468 6.64355C8.09036 6.12923 7.25649 6.12923 6.74218 6.64355C6.22787 7.15786 6.22787 7.99173 6.74218 8.50604L10.4938 12.2576L6.7431 16.0083C6.22879 16.5226 6.22879 17.3564 6.7431 17.8708C7.25742 18.3851 8.09129 18.3851 8.60560 17.8708L12.3562 14.1201L16.1068 17.8707C16.6211 18.3850 17.4550 18.3850 17.9693 17.8707C18.4836 17.3564 18.4836 16.5225 17.9693 16.0082L14.2187 12.2576L17.9702 8.50613C18.4845 7.99181 18.4845 7.15794 17.9702 6.64363C17.4559 6.12932 16.6220 6.12932 16.1077 6.64363L12.3562 10.3951L8.60468 6.64355Z", "fill", "#181F33"], [1, "horizontal-divider", "first"], [1, "filters", 3, "formGroup"], [4, "ngFor", "ngForOf"], [1, "actions"], [3, "click", "name", "size", "type"], [3, "click", "name", "size", "type", "disabled"], ["class", "filter", 4, "ngIf"], [1, "filter"], [1, "filter-title"], [4, "ngIf"], ["class", "horizontal-divider", 4, "ngIf"], [1, "multiselect-filter"], ["width", "100%", "height", "44px", 1, "no-padding", 3, "onChange", "label", "selectedItems", "data", "searchEnabled", "showSelectedCount", "enableSelectAll", "hideApplyButton"], ["width", "100%", "height", "44px", 3, "onChange", "data", "searchEnabled", "selectedItem"], [1, "checkbox-row"], ["class", "checkbox-container", 4, "ngFor", "ngForOf"], [1, "checkbox-container"], [3, "valueChange", "type", "checked"], [1, "checkbox-label"], ["type", "rounded"], ["misTzDp", "", "misInput", "", "type", "text", "readonly", "", 1, "mis-input", 3, "dateChange", "dpConfig", "placeholder", "value", "selectedDate", "positionX", "offsetX"], ["misTzDrp", "", "misInput", "", "type", "text", "readonly", "", 1, "mis-input", 3, "dateChange", "placeholder", "value", "positionX", "positionY", "selectedDates", "dpConfig"], ["misInput", "", "type", "text", 1, "input", 3, "placeholder", "formControlName"], ["misInput", "", "type", "number", 1, "input", 3, "placeholder", "formControlName"], [1, "range-container", 3, "formGroup"], [1, "range-inner-container"], ["misInput", "", "type", "number", "formControlName", "min", 1, "input", 3, "placeholder"], ["misInput", "", "type", "number", "formControlName", "max", 1, "input", 3, "placeholder", "min"], [1, "horizontal-divider"]], template: function FilterPanelComponent_Template(rf, ctx) { if (rf & 1) {
@@ -442,7 +546,7 @@ class FilterPanelComponent {
442
546
  }
443
547
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FilterPanelComponent, [{
444
548
  type: Component,
445
- args: [{ selector: 'mis-filter-panel', animations: [slideFromRight], template: "<div class=\"filter-panel-container\" *ngIf=\"show()\" @slideFromRight>\n <div class=\"panel-header\">\n <span>Filters</span>\n <svg class=\"close-icon\" (click)=\"closePanel()\" width=\"25\" height=\"25\" viewBox=\"0 0 25 25\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"ic-navigation-cancel-24\">\n <path id=\"Union\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8.60468 6.64355C8.09036 6.12923 7.25649 6.12923 6.74218 6.64355C6.22787 7.15786 6.22787 7.99173 6.74218 8.50604L10.4938 12.2576L6.7431 16.0083C6.22879 16.5226 6.22879 17.3564 6.7431 17.8708C7.25742 18.3851 8.09129 18.3851 8.60560 17.8708L12.3562 14.1201L16.1068 17.8707C16.6211 18.3850 17.4550 18.3850 17.9693 17.8707C18.4836 17.3564 18.4836 16.5225 17.9693 16.0082L14.2187 12.2576L17.9702 8.50613C18.4845 7.99181 18.4845 7.15794 17.9702 6.64363C17.4559 6.12932 16.6220 6.12932 16.1077 6.64363L12.3562 10.3951L8.60468 6.64355Z\" fill=\"#181F33\" />\n </g>\n </svg>\n </div>\n\n <div class=\"horizontal-divider first\"></div>\n\n <div class=\"filters\" [formGroup]=\"filterForm\">\n <ng-container *ngFor=\"let filter of config(); let last = last\">\n <div class=\"filter\" *ngIf=\"!filter.hidden\">\n <span class=\"filter-title\">{{filter.title}}</span>\n <ng-container *ngIf=\"filter.type === 'multiSelect'\">\n <div class=\"multiselect-filter\">\n <mis-multi-select-dropdown class=\"no-padding\" [label]=\"filter.placeholder || 'Select'\" [selectedItems]=\"filterForm.get(filter.key).value\" (onChange)=\"handleSelect($event, filter.key, filter)\" [data]=\"filter.options\" [searchEnabled]=\"true\"\n [showSelectedCount]=\"true\" [enableSelectAll]=\"true\"\n [hideApplyButton]=\"false\" width=\"100%\" height=\"44px\"></mis-multi-select-dropdown>\n </div>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'select'\">\n <div class=\"multiselect-filter\">\n <mis-dropdown [data]=\"filter.options\" [searchEnabled]=\"true\" width=\"100%\" height=\"44px\"\n (onChange)=\"handleSelect($event, filter.key, filter)\" [selectedItem]=\"filterForm.get(filter.key).value\">\n </mis-dropdown>\n </div>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'checkbox'\">\n <div class=\"checkbox-row\">\n <div *ngFor=\"let option of filter.options\" class=\"checkbox-container\">\n <mis-checkbox [type]=\"'Default'\" [checked]=\"filterForm.get(filter.key).value?.includes(option.value)\" (valueChange)=\"handleCheckbox($event, filter.key, option.value, filter)\"></mis-checkbox>\n <span class=\"checkbox-label\">{{option.label}}</span>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'datePicker'\">\n {{filter.placeholder}}\n <mis-input type=\"rounded\">\n <input misTzDp misInput type=\"text\" readonly class=\"mis-input\" [dpConfig]=\"filter.datepickerConfig\" [placeholder]=\"filterForm.get(filter.key).value ? filterForm.get(filter.key).value : (filter.placeholder || 'Select')\" [value]=\"filterForm.get(filter.key).value ? filterForm.get(filter.key).value : (filter.placeholder || 'Select')\" (dateChange)=\"onDateChange($event, filter.key, filter)\" [selectedDate]=\"filterForm.get(filter.key).value\" [positionX]=\"'end'\" [offsetX]=\"-10\">\n </mis-input>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'dateRangePicker'\">\n <mis-input type=\"rounded\">\n <input misTzDrp misInput type=\"text\" class=\"mis-input\" readonly\n [placeholder]=\"(!dateRangeSelectedDates().startDate && !dateRangeSelectedDates().endDate) ? (filter.placeholder || 'Select') : dateRangeSelectedDates().startDate + ' - ' + dateRangeSelectedDates().endDate\"\n [value]=\"(!dateRangeSelectedDates().startDate && !dateRangeSelectedDates().endDate) ? (filter.placeholder || 'Select') : dateRangeSelectedDates().startDate + ' - ' + dateRangeSelectedDates().endDate\" [positionX]=\"'start'\"\n [positionY]=\"'top'\" [selectedDates]=\"dateRangeSelectedDates()\" (dateChange)=\"onDateChange($event, filter.key, filter)\"\n [dpConfig]=\"filter.dateRangePickerConfig\" />\n </mis-input>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'text'\">\n <mis-input type=\"rounded\">\n <input misInput type=\"text\" class=\"input\" [placeholder]=\"filter.placeholder || 'Type here'\" [formControlName]=\"filter.key\">\n </mis-input>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'number'\">\n <mis-input type=\"rounded\">\n <input misInput type=\"number\" class=\"input\" [placeholder]=\"filter.placeholder || 'Type here'\" [formControlName]=\"filter.key\">\n </mis-input>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'range'\">\n <div class=\"range-container\" [formGroup]=\"filterForm.get(filter.key)\">\n <div class=\"range-inner-container\">\n <span>{{ filter?.options?.[0]?.label || 'Min' }}</span>\n <input\n misInput\n type=\"number\"\n class=\"input\"\n [placeholder]=\"filter.placeholder || 'Type here'\"\n formControlName=\"min\"\n />\n </div>\n <div class=\"range-inner-container\">\n <span>{{ filter?.options?.[1]?.label || 'Max' }}</span>\n <input\n misInput\n type=\"number\"\n class=\"input\"\n [placeholder]=\"filter.placeholder || 'Type here'\"\n formControlName=\"max\"\n [min]=\"filterForm.get?.(filter.key)?.get('min')?.value || 0\"\n />\n </div>\n </div>\n </ng-container>\n <div class=\"horizontal-divider\" *ngIf=\"!last\"></div>\n </div>\n </ng-container>\n </div>\n\n <div class=\"actions\">\n <mis-button [name]=\"'Clear All'\" [size]=\"'Small'\" [type]=\"'Text'\" (click)=\"resetFilters()\"></mis-button>\n <mis-button [name]=\"'Apply'\" [size]=\"'Small'\" [type]=\"'Solid'\" (click)=\"applyFilters()\" [disabled]=\"filterForm.invalid\"></mis-button>\n </div>\n</div>\n\n", styles: [":root{--pmry-200: #99BAF7;--pmry-100: #CBDDFB;--pmry-500: #0937B2;--pmry-400: #3C68D0;--pmry-600: #062A99;--pmry-700: #041F80;--pmry-300: #638FE7;--pmry-800: #021567;--pmry-900: #010F55;--sec-d-purple: #40447F;--sec-maroon: #6B034E;--sec-mud-red: #B23600;--sec-orange: #ED711C;--sec-purple: #815FD5;--sec-teal: #10ADAE;--sec-yellow: #D4900C;--sec-green: #547F40;--sec-bright-green: #27D22E;--sec-dark-teal: #035F6B;--sec-chocolate: #7C2F33;--sec-rube-pink: #C13D6D;--sec-cerulean: #0087B2;--sem-error: #B00020;--sem-info: #0091FF;--sem-warning: #FF9D00;--sem-success: #38AF49;--grey-bg-1: #FAFAFA;--grey-bg: #F5F5F5;--grey-seperators: #E0E0E0;--grey-disabled: #C8CDD3;--grey-hover: #F5F7FC;--grey-pressed: #E6EBF7;--grey-row: #F5F7FC;--dec-light-yellow: #F4E7C3;--dec-light-purple: #DACFF9;--dec-light-green: #E4F5E9;--dec-light-green2: #F1FFF3;--dec-light-pink: #FAE1EA;--dec-: #F4CBC1;--dec-lt-orange: #FAEFED;--dec-light-blue: #CFECF9;--dec-row-selection: #F1FDF8;--dec-row-selection2: #F2FBFF;--dec-row-lines: #D3E1E9;--text-white: #FFFFFF;--text-muted: #6A737D;--text-black: #181F33;--MR-solid-blue2:#C8D5F6;--MR-solid-purple:#C9C3FB;--MR-solid-orange:#EEAC9F;--MR-solid-green:#ACDADA;--MR-solid-brown:#E8C8AF;--MR-solid-yellow:#FFEFC7;--MR-solid-blue:#BBE6FF;--MR-solid-pink:#FFC6F2;--tr-hover:#F0F3FA;--tr-pressed:#DAE1F3;--brand-primary: #0937B2;--brand-primary-light: #3C68D0;--brand-primary-dark: #062A99;--brand-primary-darker: #041F80;--brand-primary-lighter: #638FE7;--brand-primary-lightest: #CBDDFB;--brand-primary-hover: #F0F3FA;--brand-primary-active: #DAE1F3;--brand-secondary: #ED711C;--brand-secondary-light: #F09E65;--brand-secondary-dark: #B23600;--brand-secondary-lighter: #FFC6F2;--brand-accent: #10ADAE;--brand-accent-light: #16CBBC;--brand-accent-dark: #035F6B;--brand-accent-lighter: #ACDADA;--brand-success: #38AF49;--brand-success-light: #4CAF50;--brand-success-dark: #216531;--brand-success-lighter: #E4F5E9;--brand-success-lightest: #F1FFF3;--brand-error: #B00020;--brand-error-light: #F04E4E;--brand-error-dark: #A60060;--brand-error-lighter: #FAE1EA;--brand-error-lightest: #FDF2F2;--brand-warning: #FF9D00;--brand-warning-light: #D4900C;--brand-warning-dark: #624000;--brand-warning-lighter: #F4E7C3;--brand-warning-lightest: #FAEFED;--brand-info: #0091FF;--brand-info-light: #35A1FF;--brand-info-dark: #0087B2;--brand-info-lighter: #CFECF9;--text-primary: #181F33;--text-secondary: #6A737D;--text-tertiary: #929DAB;--text-disabled: #929DAB;--text-primary-87: rgba(24, 31, 51, .87);--text-primary-60: rgba(24, 31, 51, .6);--text-primary-38: rgba(24, 31, 51, .38);--text-primary-12: rgba(24, 31, 51, .12);--bg-primary: #FFFFFF;--bg-secondary: #FAFAFA;--bg-tertiary: #F5F5F5;--bg-overlay: rgba(0, 0, 0, .32);--bg-overlay-light: rgba(0, 0, 0, .12);--bg-overlay-lighter: rgba(0, 0, 0, .08);--bg-overlay-lightest: rgba(0, 0, 0, .04);--border-primary: #E0E0E0;--border-secondary: #D6DCE2;--border-tertiary: #C8CDD3;--border-light: #F1F4F8;--border-primary-12: rgba(0, 0, 0, .12);--border-primary-08: rgba(0, 0, 0, .08);--border-primary-06: rgba(0, 0, 0, .06);--shadow-primary: rgba(0, 0, 0, .12);--shadow-secondary: rgba(0, 0, 0, .08);--shadow-tertiary: rgba(0, 0, 0, .04);--shadow-light: rgba(0, 0, 0, .06);--status-available: #929DAB;--status-unavailable: #CCD3DA;--status-hotseat: #857BFF;--status-multiteam: #10ADAE;--status-selected: #10ADAE;--status-upcoming: #D4900C;--status-room: #38AF49;--status-room-booked: #B23600;--status-room-unavailable: #181F33;--team-color-1: #F8C52E;--team-color-2: #FA8E20;--team-color-3: #987CDD;--team-color-4: #16CBBC;--team-color-5: #E65010;--team-color-6: #A60060;--team-color-7: #ED323B;--team-color-8: #35A1FF;--team-color-9: #80D348}.filter-panel-container{display:flex;flex-direction:column;height:100%;max-width:100%;min-width:20rem;position:absolute;right:0;background:var(--bg-primary, #FFFFFF);top:0;z-index:999;box-shadow:0 0 5px #000000a6;transition:all .3s ease}.filter-panel-container .panel-header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;font-weight:700;margin:0 1rem;flex-basis:5%}.filter-panel-container .panel-header span{font-size:1.25rem}.filter-panel-container .panel-header .close-icon{cursor:pointer;border-radius:50%;transform:scale(1.4);padding:.3rem;transition:all .3s ease}.filter-panel-container .panel-header .close-icon:hover{background:var(--bg-tertiary, #F5F5F5)}.filter-panel-container .panel-header .close-icon:active{background:var(--border-primary, #E0E0E0)}.filter-panel-container .mat-divider.horizontal{margin:1rem}.filters{display:flex;flex-direction:column;flex:1;row-gap:.5rem;overflow:auto;padding:0 1rem}.filters .filter{display:flex;flex-direction:column}.filters .filter .filter-title{color:var(--text-secondary, #6A737D);font-size:.875rem;font-weight:700;line-height:20px;letter-spacing:.25px}.filters .filter .checkbox-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:.8rem 0}.filters .filter .checkbox-row .checkbox-container{display:flex;flex-direction:row;align-items:center;gap:.5rem}.filters .filter .checkbox-row .checkbox-label{display:block;width:8rem}.filters .filter .checkbox-row ::ng-deep .mat-checkbox-inner-container{width:20px;height:20px}.filters .filter .checkbox-row ::ng-deep .mat-checkbox-frame{border-radius:5px}.filters .filter .multiselect-filter,.filters .filter mis-input{padding:.7rem 0}.horizontal-divider{display:block;width:100%;height:1px;margin:.5rem 0;background:var(--border-primary, #E0E0E0)}.first{margin-top:0}.actions{display:flex;flex-direction:row;justify-content:end;align-items:center;gap:1rem;border-top:1px solid var(--border-primary, #E0E0E0);flex-basis:4%;padding:.5rem}.actions button{font-weight:700;border-radius:.5rem;width:6rem}.no-padding ::ng-deep .container{padding:0!important}.range-container{display:flex;justify-content:space-between;padding:.8rem 0}.range-container .range-inner-container{display:flex;flex-direction:column}.range-container .range-inner-container input{height:2.2rem;outline:none;border-radius:.375rem;border:1px solid var(--border-primary, #E0E0E0);width:8rem;padding:0 .5rem}.range-container .range-inner-container span{margin-bottom:.2rem}input.ng-invalid.ng-touched{border:1px solid var(--brand-error, #B00020);background-color:var(--brand-error-lightest, #FDF2F2)}\n"] }]
549
+ args: [{ selector: 'mis-filter-panel', animations: [slideFromRight], template: "<div class=\"filter-panel-container\" *ngIf=\"show()\" @slideFromRight>\n <div class=\"panel-header\">\n <span>Filters</span>\n <svg class=\"close-icon\" (click)=\"closePanel()\" width=\"25\" height=\"25\" viewBox=\"0 0 25 25\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"ic-navigation-cancel-24\">\n <path id=\"Union\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8.60468 6.64355C8.09036 6.12923 7.25649 6.12923 6.74218 6.64355C6.22787 7.15786 6.22787 7.99173 6.74218 8.50604L10.4938 12.2576L6.7431 16.0083C6.22879 16.5226 6.22879 17.3564 6.7431 17.8708C7.25742 18.3851 8.09129 18.3851 8.60560 17.8708L12.3562 14.1201L16.1068 17.8707C16.6211 18.3850 17.4550 18.3850 17.9693 17.8707C18.4836 17.3564 18.4836 16.5225 17.9693 16.0082L14.2187 12.2576L17.9702 8.50613C18.4845 7.99181 18.4845 7.15794 17.9702 6.64363C17.4559 6.12932 16.6220 6.12932 16.1077 6.64363L12.3562 10.3951L8.60468 6.64355Z\" fill=\"#181F33\" />\n </g>\n </svg>\n </div>\n \n <div class=\"horizontal-divider first\"></div>\n \n <div class=\"filters\" [formGroup]=\"filterForm\">\n <ng-container *ngFor=\"let filter of config(); let last = last\">\n <div class=\"filter\" *ngIf=\"!filter.hidden\">\n <span class=\"filter-title\">{{filter.title}}</span>\n <ng-container *ngIf=\"filter.type === 'multiSelect'\">\n <div class=\"multiselect-filter\">\n <mis-multi-select-dropdown class=\"no-padding\" [label]=\"filter.placeholder || 'Select'\" [selectedItems]=\"filterForm.get(filter.key)?.value || []\" (onChange)=\"handleSelect($event, filter.key, filter)\" [data]=\"filter.options\" [searchEnabled]=\"true\"\n [showSelectedCount]=\"true\" [enableSelectAll]=\"true\"\n [hideApplyButton]=\"false\" width=\"100%\" height=\"44px\"></mis-multi-select-dropdown>\n </div>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'select'\">\n <div class=\"multiselect-filter\">\n <mis-dropdown [data]=\"filter.options\" [searchEnabled]=\"true\" width=\"100%\" height=\"44px\"\n (onChange)=\"handleSelect($event, filter.key, filter)\" [selectedItem]=\"filterForm.get(filter.key)?.value\">\n </mis-dropdown>\n </div>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'checkbox'\">\n <div class=\"checkbox-row\">\n <div *ngFor=\"let option of filter.options\" class=\"checkbox-container\">\n <mis-checkbox [type]=\"'Default'\" [checked]=\"filterForm.get(filter.key)?.value?.includes(option.value)\" (valueChange)=\"handleCheckbox($event, filter.key, option.value, filter)\"></mis-checkbox>\n <span class=\"checkbox-label\">{{option.label}}</span>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'datePicker'\">\n <mis-input type=\"rounded\">\n <input misTzDp misInput type=\"text\" readonly class=\"mis-input\" [dpConfig]=\"filter.datePickerConfig\" [placeholder]=\"filterForm.get(filter.key)?.value || filter.placeholder || 'Select'\" [value]=\"filterForm.get(filter.key)?.value || filter.placeholder || 'Select'\" (dateChange)=\"onDateChange($event, filter.key, filter)\" [selectedDate]=\"filterForm.get(filter.key)?.value\" [positionX]=\"'end'\" [offsetX]=\"-10\">\n </mis-input>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'dateRangePicker'\">\n <mis-input type=\"rounded\">\n <input misTzDrp misInput type=\"text\" class=\"mis-input\" readonly\n [placeholder]=\"(!dateRangeSelectedDates().startDate && !dateRangeSelectedDates().endDate) ? (filter.placeholder || 'Select') : dateRangeSelectedDates().startDate + ' - ' + dateRangeSelectedDates().endDate\"\n [value]=\"(!dateRangeSelectedDates().startDate && !dateRangeSelectedDates().endDate) ? (filter.placeholder || 'Select') : dateRangeSelectedDates().startDate + ' - ' + dateRangeSelectedDates().endDate\" [positionX]=\"'start'\"\n [positionY]=\"'top'\" [selectedDates]=\"dateRangeSelectedDates()\" (dateChange)=\"onDateChange($event, filter.key, filter)\"\n [dpConfig]=\"filter.dateRangePickerConfig\" />\n </mis-input>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'text'\">\n <mis-input type=\"rounded\">\n <input misInput type=\"text\" class=\"input\" [placeholder]=\"filter.placeholder || 'Type here'\" [formControlName]=\"filter.key\">\n </mis-input>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'number'\">\n <mis-input type=\"rounded\">\n <input misInput type=\"number\" class=\"input\" [placeholder]=\"filter.placeholder || 'Type here'\" [formControlName]=\"filter.key\">\n </mis-input>\n </ng-container>\n <ng-container *ngIf=\"filter.type === 'range'\">\n <div class=\"range-container\" [formGroup]=\"filterForm.get(filter.key)\">\n <div class=\"range-inner-container\">\n <span>{{ filter?.options?.[0]?.label || 'Min' }}</span>\n <input\n misInput\n type=\"number\"\n class=\"input\"\n [placeholder]=\"filter.placeholder || 'Type here'\"\n formControlName=\"min\"\n />\n </div>\n <div class=\"range-inner-container\">\n <span>{{ filter?.options?.[1]?.label || 'Max' }}</span>\n <input\n misInput\n type=\"number\"\n class=\"input\"\n [placeholder]=\"filter.placeholder || 'Type here'\"\n formControlName=\"max\"\n [min]=\"filterForm.get(filter.key)?.get('min')?.value || 0\"\n />\n </div>\n </div>\n </ng-container>\n <div class=\"horizontal-divider\" *ngIf=\"!last\"></div>\n </div>\n </ng-container>\n </div>\n \n <div class=\"actions\">\n <mis-button [name]=\"'Clear All'\" [size]=\"'Small'\" [type]=\"'Text'\" (click)=\"resetFilters()\"></mis-button>\n <mis-button [name]=\"'Apply'\" [size]=\"'Small'\" [type]=\"'Solid'\" (click)=\"applyFilters()\" [disabled]=\"filterForm.invalid\"></mis-button>\n </div>\n </div>", styles: [":root{--pmry-200: #99BAF7;--pmry-100: #CBDDFB;--pmry-500: #0937B2;--pmry-400: #3C68D0;--pmry-600: #062A99;--pmry-700: #041F80;--pmry-300: #638FE7;--pmry-800: #021567;--pmry-900: #010F55;--sec-d-purple: #40447F;--sec-maroon: #6B034E;--sec-mud-red: #B23600;--sec-orange: #ED711C;--sec-purple: #815FD5;--sec-teal: #10ADAE;--sec-yellow: #D4900C;--sec-green: #547F40;--sec-bright-green: #27D22E;--sec-dark-teal: #035F6B;--sec-chocolate: #7C2F33;--sec-rube-pink: #C13D6D;--sec-cerulean: #0087B2;--sem-error: #B00020;--sem-info: #0091FF;--sem-warning: #FF9D00;--sem-success: #38AF49;--grey-bg-1: #FAFAFA;--grey-bg: #F5F5F5;--grey-seperators: #E0E0E0;--grey-disabled: #C8CDD3;--grey-hover: #F5F7FC;--grey-pressed: #E6EBF7;--grey-row: #F5F7FC;--dec-light-yellow: #F4E7C3;--dec-light-purple: #DACFF9;--dec-light-green: #E4F5E9;--dec-light-green2: #F1FFF3;--dec-light-pink: #FAE1EA;--dec-: #F4CBC1;--dec-lt-orange: #FAEFED;--dec-light-blue: #CFECF9;--dec-row-selection: #F1FDF8;--dec-row-selection2: #F2FBFF;--dec-row-lines: #D3E1E9;--text-white: #FFFFFF;--text-muted: #6A737D;--text-black: #181F33;--MR-solid-blue2:#C8D5F6;--MR-solid-purple:#C9C3FB;--MR-solid-orange:#EEAC9F;--MR-solid-green:#ACDADA;--MR-solid-brown:#E8C8AF;--MR-solid-yellow:#FFEFC7;--MR-solid-blue:#BBE6FF;--MR-solid-pink:#FFC6F2;--tr-hover:#F0F3FA;--tr-pressed:#DAE1F3;--brand-primary: #0937B2;--brand-primary-light: #3C68D0;--brand-primary-dark: #062A99;--brand-primary-darker: #041F80;--brand-primary-lighter: #638FE7;--brand-primary-lightest: #CBDDFB;--brand-primary-hover: #F0F3FA;--brand-primary-active: #DAE1F3;--brand-secondary: #ED711C;--brand-secondary-light: #F09E65;--brand-secondary-dark: #B23600;--brand-secondary-lighter: #FFC6F2;--brand-accent: #10ADAE;--brand-accent-light: #16CBBC;--brand-accent-dark: #035F6B;--brand-accent-lighter: #ACDADA;--brand-success: #38AF49;--brand-success-light: #4CAF50;--brand-success-dark: #216531;--brand-success-lighter: #E4F5E9;--brand-success-lightest: #F1FFF3;--brand-error: #B00020;--brand-error-light: #F04E4E;--brand-error-dark: #A60060;--brand-error-lighter: #FAE1EA;--brand-error-lightest: #FDF2F2;--brand-warning: #FF9D00;--brand-warning-light: #D4900C;--brand-warning-dark: #624000;--brand-warning-lighter: #F4E7C3;--brand-warning-lightest: #FAEFED;--brand-info: #0091FF;--brand-info-light: #35A1FF;--brand-info-dark: #0087B2;--brand-info-lighter: #CFECF9;--text-primary: #181F33;--text-secondary: #6A737D;--text-tertiary: #929DAB;--text-disabled: #929DAB;--text-primary-87: rgba(24, 31, 51, .87);--text-primary-60: rgba(24, 31, 51, .6);--text-primary-38: rgba(24, 31, 51, .38);--text-primary-12: rgba(24, 31, 51, .12);--bg-primary: #FFFFFF;--bg-secondary: #FAFAFA;--bg-tertiary: #F5F5F5;--bg-overlay: rgba(0, 0, 0, .32);--bg-overlay-light: rgba(0, 0, 0, .12);--bg-overlay-lighter: rgba(0, 0, 0, .08);--bg-overlay-lightest: rgba(0, 0, 0, .04);--border-primary: #E0E0E0;--border-secondary: #D6DCE2;--border-tertiary: #C8CDD3;--border-light: #F1F4F8;--border-primary-12: rgba(0, 0, 0, .12);--border-primary-08: rgba(0, 0, 0, .08);--border-primary-06: rgba(0, 0, 0, .06);--shadow-primary: rgba(0, 0, 0, .12);--shadow-secondary: rgba(0, 0, 0, .08);--shadow-tertiary: rgba(0, 0, 0, .04);--shadow-light: rgba(0, 0, 0, .06);--status-available: #929DAB;--status-unavailable: #CCD3DA;--status-hotseat: #857BFF;--status-multiteam: #10ADAE;--status-selected: #10ADAE;--status-upcoming: #D4900C;--status-room: #38AF49;--status-room-booked: #B23600;--status-room-unavailable: #181F33;--team-color-1: #F8C52E;--team-color-2: #FA8E20;--team-color-3: #987CDD;--team-color-4: #16CBBC;--team-color-5: #E65010;--team-color-6: #A60060;--team-color-7: #ED323B;--team-color-8: #35A1FF;--team-color-9: #80D348}.filter-panel-container{display:flex;flex-direction:column;height:100%;max-width:100%;min-width:20rem;position:absolute;right:0;background:var(--bg-primary, #FFFFFF);top:0;z-index:999;box-shadow:0 0 5px #000000a6;transition:all .3s ease}.filter-panel-container .panel-header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;font-weight:700;margin:0 1rem;flex-basis:5%}.filter-panel-container .panel-header span{font-size:1.25rem}.filter-panel-container .panel-header .close-icon{cursor:pointer;border-radius:50%;transform:scale(1.4);padding:.3rem;transition:all .3s ease}.filter-panel-container .panel-header .close-icon:hover{background:var(--bg-tertiary, #F5F5F5)}.filter-panel-container .panel-header .close-icon:active{background:var(--border-primary, #E0E0E0)}.filter-panel-container .mat-divider.horizontal{margin:1rem}.filters{display:flex;flex-direction:column;flex:1;row-gap:.5rem;overflow:auto;padding:0 1rem}.filters .filter{display:flex;flex-direction:column}.filters .filter .filter-title{color:var(--text-secondary, #6A737D);font-size:.875rem;font-weight:700;line-height:20px;letter-spacing:.25px}.filters .filter .checkbox-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:.8rem 0}.filters .filter .checkbox-row .checkbox-container{display:flex;flex-direction:row;align-items:center;gap:.5rem}.filters .filter .checkbox-row .checkbox-label{display:block;width:8rem}.filters .filter .checkbox-row ::ng-deep .mat-checkbox-inner-container{width:20px;height:20px}.filters .filter .checkbox-row ::ng-deep .mat-checkbox-frame{border-radius:5px}.filters .filter .multiselect-filter,.filters .filter mis-input{padding:.7rem 0}.horizontal-divider{display:block;width:100%;height:1px;margin:.5rem 0;background:var(--border-primary, #E0E0E0)}.first{margin-top:0}.actions{display:flex;flex-direction:row;justify-content:end;align-items:center;gap:1rem;border-top:1px solid var(--border-primary, #E0E0E0);flex-basis:4%;padding:.5rem}.actions button{font-weight:700;border-radius:.5rem;width:6rem}.no-padding ::ng-deep .container{padding:0!important}.range-container{display:flex;justify-content:space-between;padding:.8rem 0}.range-container .range-inner-container{display:flex;flex-direction:column}.range-container .range-inner-container input{height:2.2rem;outline:none;border-radius:.375rem;border:1px solid var(--border-primary, #E0E0E0);width:8rem;padding:0 .5rem}.range-container .range-inner-container span{margin-bottom:.2rem}input.ng-invalid.ng-touched{border:1px solid var(--brand-error, #B00020);background-color:var(--brand-error-lightest, #FDF2F2)}\n"] }]
446
550
  }], () => [{ type: HasValuePipe }], null); })();
447
551
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FilterPanelComponent, { className: "FilterPanelComponent" }); })();
448
552