@yuuvis/client-framework 2.1.0 → 2.1.2

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 (26) hide show
  1. package/fesm2022/yuuvis-client-framework-forms.mjs +18 -35
  2. package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
  3. package/fesm2022/yuuvis-client-framework-object-details.mjs +228 -195
  4. package/fesm2022/yuuvis-client-framework-object-details.mjs.map +1 -1
  5. package/fesm2022/yuuvis-client-framework-tile-list.mjs +41 -21
  6. package/fesm2022/yuuvis-client-framework-tile-list.mjs.map +1 -1
  7. package/fesm2022/yuuvis-client-framework-upload-progress.mjs +18 -2
  8. package/fesm2022/yuuvis-client-framework-upload-progress.mjs.map +1 -1
  9. package/fesm2022/yuuvis-client-framework-widget-grid.mjs +2 -3
  10. package/fesm2022/yuuvis-client-framework-widget-grid.mjs.map +1 -1
  11. package/forms/lib/elements/datetime-range/datetime-range.component.d.ts +4 -4
  12. package/forms/lib/elements/range-select-date/date-range-picker/date-range-picker.component.d.ts +3 -3
  13. package/lib/assets/i18n/de.json +2 -2
  14. package/lib/assets/i18n/en.json +2 -2
  15. package/master-details/index.d.ts +1 -0
  16. package/object-details/index.d.ts +3 -0
  17. package/object-details/lib/object-details-header/object-details-header.component.d.ts +26 -0
  18. package/object-details/lib/object-details-shell/object-details-shell.component.d.ts +17 -43
  19. package/object-details/lib/object-details-shell/object-details-shell.service.d.ts +13 -0
  20. package/object-details/lib/object-details.component.d.ts +11 -17
  21. package/object-details/lib/object-details.module.d.ts +12 -0
  22. package/package.json +4 -4
  23. package/tile-list/lib/tile-config/tile-config-tile/tile-config-tile.component.d.ts +3 -3
  24. package/tile-list/lib/tile-config/tile-config.component.d.ts +3 -2
  25. package/upload-progress/index.d.ts +1 -0
  26. package/upload-progress/lib/upload-progress/upload-progress.module.d.ts +7 -0
@@ -373,7 +373,7 @@ class DatetimeComponent extends AbstractMatFormField {
373
373
  // eslint-disable-next-line @typescript-eslint/no-empty-function
374
374
  registerOnTouched() { }
375
375
  onValueChange(e) {
376
- this.propagateChange(this.withTime() ? e : e.toISOString().split('T')[0]);
376
+ this.propagateChange(e);
377
377
  }
378
378
  ngOnInit() {
379
379
  this.focusHandled.set(true);
@@ -420,18 +420,9 @@ class DatetimeRangeComponent extends AbstractMatFormField {
420
420
  }
421
421
  #dRef;
422
422
  #checkForEqualsRange(value) {
423
- const removeZ = (v) => (typeof v === 'string' && v.endsWith('Z') ? v.slice(0, -1) : v);
424
- if (value.firstValue && typeof value.firstValue === 'string') {
425
- value.firstValue = removeZ(value.firstValue);
426
- }
427
- if (value.secondValue && typeof value.secondValue === 'string') {
428
- value.secondValue = removeZ(value.secondValue);
429
- }
430
- const firstEndsWith = value.firstValue.endsWith(Utils.DEFAULT_RANGE_TIME_V1);
431
- const secondEndsWith = value.secondValue && value.secondValue.endsWith(Utils.DEFAULT_RANGE_TIME_V2);
432
- const firstDate = value.firstValue.slice(0, 10);
433
- const secondDate = value.secondValue && value.secondValue.slice(0, 10);
434
- if (firstEndsWith && secondEndsWith && firstDate === secondDate) {
423
+ const firstDate = value.firstValue;
424
+ const secondDate = value.secondValue ? new Date(value.secondValue.getTime() - Utils.DEFAULT_TIME_OFFSET_V2) : undefined;
425
+ if (firstDate.getTime() === secondDate?.getTime()) {
435
426
  return {
436
427
  operator: Operator.EQUAL,
437
428
  firstValue: value.firstValue,
@@ -441,14 +432,15 @@ class DatetimeRangeComponent extends AbstractMatFormField {
441
432
  return value;
442
433
  }
443
434
  writeValue(value) {
444
- if (value && (value.firstValue || value.secondValue)) {
445
- value = this.#checkForEqualsRange(value);
446
- this.value = value;
447
- const match = this.availableSearchOptions.find((o) => o.value === value.operator);
435
+ let _value = value && Utils.getDateRangeFrom(value);
436
+ if (_value && (_value.firstValue || _value.secondValue)) {
437
+ _value = this.#checkForEqualsRange(_value);
438
+ this.value = _value;
439
+ const match = this.availableSearchOptions.find((o) => o.value === _value?.operator);
448
440
  this.rangeForm.patchValue({
449
- dateValueFrom: value.secondValue && value.firstValue,
441
+ dateValueFrom: _value.secondValue && _value.firstValue,
450
442
  operator: match ? match.value : this.availableSearchOptions[0].value,
451
- dateValue: value.secondValue || value.firstValue
443
+ dateValue: _value.secondValue || _value.firstValue
452
444
  });
453
445
  }
454
446
  else {
@@ -462,12 +454,12 @@ class DatetimeRangeComponent extends AbstractMatFormField {
462
454
  // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
463
455
  registerOnTouched(fn) { }
464
456
  #onValueChange() {
465
- const dateValue = this.rangeForm.value.dateValue || undefined;
457
+ const dateValue = this.rangeForm.value.dateValue;
466
458
  const operator = this.rangeForm.value.operator;
467
459
  if (operator === Operator.INTERVAL_INCLUDE_BOTH) {
468
- const dateValueFrom = this.rangeForm.value.dateValueFrom || undefined;
469
- if (dateValueFrom || dateValue) {
470
- this._isValid = this.rangeForm.valid && !!dateValueFrom && !!dateValue;
460
+ const dateValueFrom = this.rangeForm.value.dateValueFrom;
461
+ if (dateValueFrom && dateValue) {
462
+ this._isValid = this.rangeForm.valid;
471
463
  this.value = !this._isValid
472
464
  ? null
473
465
  : {
@@ -477,7 +469,7 @@ class DatetimeRangeComponent extends AbstractMatFormField {
477
469
  };
478
470
  }
479
471
  }
480
- else {
472
+ else if (dateValue) {
481
473
  this._isValid = this.rangeForm.valid;
482
474
  this.value = !this._isValid
483
475
  ? null
@@ -489,20 +481,11 @@ class DatetimeRangeComponent extends AbstractMatFormField {
489
481
  }
490
482
  this.propagateChange(this.value);
491
483
  }
492
- #toDate(value) {
493
- if (value instanceof Date)
494
- return value;
495
- if (typeof value === 'string') {
496
- const parsed = new Date(value);
497
- return isNaN(parsed.getTime()) ? null : parsed;
498
- }
499
- return null;
500
- }
501
484
  #getValidator() {
502
485
  return (control) => {
503
486
  const operator = control.get('operator')?.value;
504
- const dateValue = this.#toDate(control.get('dateValue')?.value);
505
- const dateValueFrom = this.#toDate(control.get('dateValueFrom')?.value);
487
+ const dateValue = Utils.getDateFrom(control.get('dateValue')?.value);
488
+ const dateValueFrom = Utils.getDateFrom(control.get('dateValueFrom')?.value);
506
489
  const singleValueOperators = new Set([Operator.EQUAL, Operator.GREATER_OR_EQUAL, Operator.LESS_OR_EQUAL]);
507
490
  const rangeOperators = new Set([Operator.INTERVAL_INCLUDE_BOTH]);
508
491
  if (this.situation === Situation.SEARCH && !rangeOperators.has(operator))