@shival99/z-ui 1.2.1 → 1.2.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.
Files changed (33) hide show
  1. package/fesm2022/shival99-z-ui-components-z-calendar.mjs +14 -14
  2. package/fesm2022/shival99-z-ui-components-z-calendar.mjs.map +1 -1
  3. package/fesm2022/shival99-z-ui-components-z-checkbox.mjs +4 -7
  4. package/fesm2022/shival99-z-ui-components-z-checkbox.mjs.map +1 -1
  5. package/fesm2022/shival99-z-ui-components-z-code.mjs +3 -4
  6. package/fesm2022/shival99-z-ui-components-z-code.mjs.map +1 -1
  7. package/fesm2022/shival99-z-ui-components-z-editor.mjs +11 -12
  8. package/fesm2022/shival99-z-ui-components-z-editor.mjs.map +1 -1
  9. package/fesm2022/shival99-z-ui-components-z-input.mjs +6 -8
  10. package/fesm2022/shival99-z-ui-components-z-input.mjs.map +1 -1
  11. package/fesm2022/shival99-z-ui-components-z-modal.mjs +7 -8
  12. package/fesm2022/shival99-z-ui-components-z-modal.mjs.map +1 -1
  13. package/fesm2022/shival99-z-ui-components-z-pagination.mjs +11 -13
  14. package/fesm2022/shival99-z-ui-components-z-pagination.mjs.map +1 -1
  15. package/fesm2022/shival99-z-ui-components-z-table.mjs +60 -50
  16. package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -1
  17. package/fesm2022/shival99-z-ui-components-z-upload.mjs +10 -10
  18. package/fesm2022/shival99-z-ui-components-z-upload.mjs.map +1 -1
  19. package/fesm2022/shival99-z-ui-pipes.mjs +5 -1
  20. package/fesm2022/shival99-z-ui-pipes.mjs.map +1 -1
  21. package/fesm2022/shival99-z-ui-utils.mjs.map +1 -1
  22. package/package.json +1 -1
  23. package/types/shival99-z-ui-components-z-calendar.d.ts +3 -4
  24. package/types/shival99-z-ui-components-z-checkbox.d.ts +2 -3
  25. package/types/shival99-z-ui-components-z-code.d.ts +1 -1
  26. package/types/shival99-z-ui-components-z-editor.d.ts +3 -4
  27. package/types/shival99-z-ui-components-z-input.d.ts +2 -3
  28. package/types/shival99-z-ui-components-z-modal.d.ts +1 -2
  29. package/types/shival99-z-ui-components-z-pagination.d.ts +4 -5
  30. package/types/shival99-z-ui-components-z-table.d.ts +23 -12
  31. package/types/shival99-z-ui-components-z-upload.d.ts +1 -2
  32. package/types/shival99-z-ui-pipes.d.ts +1 -0
  33. package/types/shival99-z-ui-utils.d.ts +1 -1
@@ -1,13 +1,14 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Pipe, input, output, viewChild, computed, signal, inject, Injector, DestroyRef, ChangeDetectorRef, effect, forwardRef, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
3
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
4
  import { NgControl, NG_VALUE_ACCESSOR } from '@angular/forms';
5
- import { TranslateService, TranslatePipe } from '@ngx-translate/core';
5
+ import { TranslatePipe } from '@ngx-translate/core';
6
6
  import { ZButtonComponent } from '@shival99/z-ui/components/z-button';
7
7
  import { ZIconComponent } from '@shival99/z-ui/components/z-icon';
8
8
  import { ZPopoverDirective } from '@shival99/z-ui/components/z-popover';
9
+ import { ZTranslateService } from '@shival99/z-ui/services';
9
10
  import { zTransform, zUuid, zMergeClasses } from '@shival99/z-ui/utils';
10
- import { startWith, merge } from 'rxjs';
11
+ import { merge } from 'rxjs';
11
12
  import { cva } from 'class-variance-authority';
12
13
 
13
14
  const createDate = (year, month, day, hour = 0, minute = 0, second = 0) => new Date(year, month, day, hour, minute, second);
@@ -675,8 +676,7 @@ class ZCalendarComponent {
675
676
  _injector = inject(Injector);
676
677
  _destroyRef = inject(DestroyRef);
677
678
  _cdr = inject(ChangeDetectorRef);
678
- _translate = inject(TranslateService);
679
- _currentLang = toSignal(this._translate.onLangChange.pipe(startWith({ lang: this._translate.currentLang })));
679
+ _zTranslate = inject(ZTranslateService);
680
680
  _onChange = () => void 0;
681
681
  _onTouched = () => void 0;
682
682
  _ngControl = null;
@@ -714,20 +714,20 @@ class ZCalendarComponent {
714
714
  isYearMode = computed(() => this.zMode() === 'year', ...(ngDevMode ? [{ debugName: "isYearMode" }] : []));
715
715
  isQuarterMode = computed(() => this.zMode() === 'quarter', ...(ngDevMode ? [{ debugName: "isQuarterMode" }] : []));
716
716
  todayButtonText = computed(() => {
717
- this._currentLang();
717
+ this._zTranslate.currentLang();
718
718
  if (this.isQuarterMode()) {
719
- return this._translate.instant('i18n_z_ui_calendar_this_quarter');
719
+ return this._zTranslate.instant('i18n_z_ui_calendar_this_quarter');
720
720
  }
721
721
  if (this.isYearMode()) {
722
- return this._translate.instant('i18n_z_ui_calendar_this_year');
722
+ return this._zTranslate.instant('i18n_z_ui_calendar_this_year');
723
723
  }
724
724
  if (this.isMonthMode()) {
725
- return this._translate.instant('i18n_z_ui_calendar_this_month');
725
+ return this._zTranslate.instant('i18n_z_ui_calendar_this_month');
726
726
  }
727
727
  if (this.zShowTime() || this.isTimeMode()) {
728
- return this._translate.instant('i18n_z_ui_calendar_now');
728
+ return this._zTranslate.instant('i18n_z_ui_calendar_now');
729
729
  }
730
- return this._translate.instant('i18n_z_ui_calendar_today');
730
+ return this._zTranslate.instant('i18n_z_ui_calendar_today');
731
731
  }, ...(ngDevMode ? [{ debugName: "todayButtonText" }] : []));
732
732
  currentMonth = computed(() => this._currentMonth(), ...(ngDevMode ? [{ debugName: "currentMonth" }] : []));
733
733
  currentYear = computed(() => this._currentMonth().getFullYear(), ...(ngDevMode ? [{ debugName: "currentYear" }] : []));
@@ -1068,8 +1068,8 @@ class ZCalendarComponent {
1068
1068
  }
1069
1069
  }
1070
1070
  if (errors['required']) {
1071
- this._currentLang();
1072
- return this._translate.instant('i18n_z_ui_calendar_required');
1071
+ this._zTranslate.currentLang();
1072
+ return this._zTranslate.instant('i18n_z_ui_calendar_required');
1073
1073
  }
1074
1074
  return '';
1075
1075
  }, ...(ngDevMode ? [{ debugName: "errorMessage" }] : []));
@@ -2202,7 +2202,7 @@ class ZCalendarComponent {
2202
2202
  if (isRequired) {
2203
2203
  const hasValidValue = this.isRangeMode() ? !!(this._rangeStart() && this._rangeEnd()) : !!this._selectedDate();
2204
2204
  if (!hasValidValue) {
2205
- errors.push(this._translate.instant('i18n_z_ui_calendar_required'));
2205
+ errors.push(this._zTranslate.instant('i18n_z_ui_calendar_required'));
2206
2206
  }
2207
2207
  }
2208
2208
  const value = this._getEmitValue();