ngx-tethys 19.0.16 → 19.0.18

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [19.0.18](https://github.com/atinc/ngx-tethys/compare/19.0.17...19.0.18) (2025-07-30)
6
+
7
+
8
+ ### Features
9
+
10
+ * **date-picker:** add dateCellRender #TINFR-2386 ([#3495](https://github.com/atinc/ngx-tethys/issues/3495)) ([1fac2cb](https://github.com/atinc/ngx-tethys/commit/1fac2cbe6a8fa54294eb780cb8d7bb334c0f90fd)), closes [#TINFR-2386](https://github.com/atinc/ngx-tethys/issues/TINFR-2386)
11
+
12
+
13
+
14
+ ## [19.0.17](https://github.com/atinc/ngx-tethys/compare/19.0.16...19.0.17) (2025-07-29)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **datePicker:** adjust ranger-picker date-panel-flexible style #TINFR-2562 ([#3491](https://github.com/atinc/ngx-tethys/issues/3491)) ([5db74a9](https://github.com/atinc/ngx-tethys/commit/5db74a986f9779d7c432679c63d199b78ca0beea)), closes [#TINFR-2562](https://github.com/atinc/ngx-tethys/issues/TINFR-2562)
20
+
21
+
22
+
5
23
  ## [19.0.16](https://github.com/atinc/ngx-tethys/compare/19.0.15...19.0.16) (2025-07-23)
6
24
 
7
25
 
@@ -1,4 +1,5 @@
1
1
  import { InjectionToken } from '@angular/core';
2
+ import { SafeHtml } from '@angular/platform-browser';
2
3
  import { ThyI18nService } from 'ngx-tethys/i18n';
3
4
  import { WeekDayIndex } from 'ngx-tethys/util';
4
5
  import { CompatiblePresets, ThyShortcutPosition } from './standard-types';
@@ -10,6 +11,7 @@ export interface ThyDatePickerConfig {
10
11
  weekStartsOn: WeekDayIndex;
11
12
  separator: string;
12
13
  timestampPrecision: 'seconds' | 'milliseconds';
14
+ dateCellRender?: (date: Date) => SafeHtml | undefined;
13
15
  }
14
16
  /**
15
17
  * @deprecated
@@ -1,4 +1,5 @@
1
1
  import { isTemplateRef } from 'ngx-tethys/util';
2
+ import { ThyDatePickerConfigService } from '../../date-picker.service';
2
3
  import { DateCell } from './types';
3
4
  import * as i0 from "@angular/core";
4
5
  /**
@@ -6,9 +7,12 @@ import * as i0 from "@angular/core";
6
7
  */
7
8
  export declare class DateTableCell {
8
9
  isTemplateRef: typeof isTemplateRef;
9
- prefixCls: 'thy-calendar' | 'thy-calendar-full';
10
- cell: DateCell;
10
+ readonly prefixCls: import("@angular/core").InputSignal<"thy-calendar" | "thy-calendar-full">;
11
+ readonly cell: import("@angular/core").InputSignal<DateCell>;
11
12
  isNonEmptyString: (v: any) => boolean;
13
+ functionRenderResult: import("@angular/core").Signal<boolean>;
14
+ datePickerConfigService: ThyDatePickerConfigService;
15
+ cellRender: import("@angular/core").Signal<string | ((date: Date) => import("@angular/platform-browser").SafeHtml | undefined) | import("@angular/core").TemplateRef<Date>>;
12
16
  static ɵfac: i0.ɵɵFactoryDeclaration<DateTableCell, never>;
13
- static ɵcmp: i0.ɵɵComponentDeclaration<DateTableCell, "[date-table-cell]", ["dateTableCell"], { "prefixCls": { "alias": "prefixCls"; "required": false; }; "cell": { "alias": "cell"; "required": false; }; }, {}, never, never, true, never>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateTableCell, "[date-table-cell]", ["dateTableCell"], { "prefixCls": { "alias": "prefixCls"; "required": false; "isSignal": true; }; "cell": { "alias": "cell"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
14
18
  }
@@ -40,6 +40,7 @@ $input-box-height: 34px;
40
40
  }
41
41
 
42
42
  &-flexible {
43
+ width: 338px;
43
44
  .#{style.$calendar-prefix-cls}-picker-inner-popup {
44
45
  width: 338px;
45
46
  .thy-calendar-body {
@@ -1,9 +1,9 @@
1
1
  import { CdkOverlayOrigin, CdkConnectedOverlay, OverlayModule } from '@angular/cdk/overlay';
2
2
  import { formatDate, NgClass, NgTemplateOutlet, CommonModule, isPlatformBrowser, registerLocaleData } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { Injectable, inject, EventEmitter, Output, Input, Directive, ChangeDetectionStrategy, Component, InjectionToken, Pipe, ChangeDetectorRef, forwardRef, HostBinding, NgModule, ViewChild, computed, ElementRef, PLATFORM_ID, NgZone, numberAttribute } from '@angular/core';
4
+ import { Injectable, inject, EventEmitter, Output, Input, Directive, ChangeDetectionStrategy, Component, InjectionToken, Pipe, ChangeDetectorRef, forwardRef, HostBinding, input, computed, NgModule, ViewChild, ElementRef, PLATFORM_ID, NgZone, numberAttribute } from '@angular/core';
5
5
  import localeZhHans from '@angular/common/locales/zh-Hans';
6
- import { TinyDate, coerceBooleanProperty, subDays, startOfDay, startOfWeek, addDays, addWeeks, helpers, coerceArray, isTemplateRef, isEmpty, isString, valueFunctionProp, isUndefinedOrNull, isFunction, endOfDay, sortRangeValue, elementMatchClosest, warnDeprecation } from 'ngx-tethys/util';
6
+ import { TinyDate, coerceBooleanProperty, subDays, startOfDay, startOfWeek, addDays, addWeeks, helpers, coerceArray, isTemplateRef, isEmpty, isString, isFunction, isUndefinedOrNull, valueFunctionProp, endOfDay, sortRangeValue, elementMatchClosest, warnDeprecation } from 'ngx-tethys/util';
7
7
  import { injectLocale, ThyI18nService, ThyLocaleType } from 'ngx-tethys/i18n';
8
8
  import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
9
9
  import * as i1 from '@angular/forms';
@@ -1240,19 +1240,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
1240
1240
  class DateTableCell {
1241
1241
  constructor() {
1242
1242
  this.isTemplateRef = isTemplateRef;
1243
+ this.prefixCls = input();
1244
+ this.cell = input();
1243
1245
  this.isNonEmptyString = (v) => isEmpty(v) && isString(v);
1246
+ this.functionRenderResult = computed(() => {
1247
+ const renderFn = this.cellRender();
1248
+ if (!isFunction(renderFn)) {
1249
+ return false;
1250
+ }
1251
+ const result = renderFn(this.cell().value);
1252
+ return !isUndefinedOrNull(result);
1253
+ });
1254
+ this.datePickerConfigService = inject(ThyDatePickerConfigService);
1255
+ this.cellRender = computed(() => {
1256
+ return this.cell()?.dateCellRender || this.datePickerConfigService.config?.dateCellRender;
1257
+ });
1244
1258
  }
1245
1259
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: DateTableCell, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1246
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: DateTableCell, isStandalone: true, selector: "[date-table-cell]", inputs: { prefixCls: "prefixCls", cell: "cell" }, exportAs: ["dateTableCell"], ngImport: i0, template: "\n@switch (prefixCls) {\n @case ('thy-calendar') {\n @switch (true) {\n @case (isTemplateRef(cell.dateCellRender)) {\n <ng-container *ngTemplateOutlet=\"cell.dateCellRender; context: { $implicit: cell.value }\"></ng-container>\n }\n @case (isNonEmptyString(cell.dateCellRender)) {\n <span [innerHTML]=\"cell.dateCellRender\"></span>\n }\n @default {\n <div class=\"{{ prefixCls }}-date\" [attr.aria-selected]=\"cell.isSelected\" [attr.aria-disabled]=\"cell.isDisabled\">\n {{ cell.content }}\n </div>\n }\n }\n }\n @case ('thy-calendar-full') {\n <div\n tabindex=\"0\"\n class=\"{{ prefixCls }}-date thy-calendar-full-cell-inner\"\n [class.thy-calendar-full-calendar-date-today]=\"cell.isToday\"\n >\n @if (cell.fullCellRender) {\n <ng-container *ngTemplateOutlet=\"$any(cell.fullCellRender); context: { $implicit: cell.value }\"> </ng-container>\n } @else {\n <div class=\"{{ prefixCls }}-date-value\">\n <span class=\"{{ prefixCls }}-date-value-today-text\">\n <span class=\"{{ prefixCls }}-date-value-text\">{{ cell.content }}</span>\n </span>\n </div>\n <div class=\"{{ prefixCls }}-date-content\">\n <ng-container *ngTemplateOutlet=\"$any(cell.dateCellRender); context: { $implicit: cell.value }\"> </ng-container>\n </div>\n }\n </div>\n }\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
1260
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: DateTableCell, isStandalone: true, selector: "[date-table-cell]", inputs: { prefixCls: { classPropertyName: "prefixCls", publicName: "prefixCls", isSignal: true, isRequired: false, transformFunction: null }, cell: { classPropertyName: "cell", publicName: "cell", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["dateTableCell"], ngImport: i0, template: "@switch (prefixCls()) {\n @case ('thy-calendar') {\n @switch (true) {\n @case (isTemplateRef(cellRender())) {\n <ng-container *ngTemplateOutlet=\"cellRender(); context: { $implicit: cell().value }\"></ng-container>\n }\n @case (isNonEmptyString(cellRender())) {\n <span [innerHTML]=\"cellRender()\"></span>\n }\n @case (functionRenderResult()) {\n <span [innerHTML]=\"$any(cellRender())(cell().value)\"></span>\n }\n @default {\n <div class=\"{{ prefixCls() }}-date\" [attr.aria-selected]=\"cell().isSelected\" [attr.aria-disabled]=\"cell().isDisabled\">\n {{ cell().content }}\n </div>\n }\n }\n }\n @case ('thy-calendar-full') {\n <div\n tabindex=\"0\"\n class=\"{{ prefixCls() }}-date thy-calendar-full-cell-inner\"\n [class.thy-calendar-full-calendar-date-today]=\"cell().isToday\">\n @if (cell().fullCellRender) {\n <ng-container *ngTemplateOutlet=\"$any(cell().fullCellRender); context: { $implicit: cell().value }\"> </ng-container>\n } @else {\n <div class=\"{{ prefixCls() }}-date-value\">\n <span class=\"{{ prefixCls() }}-date-value-today-text\">\n <span class=\"{{ prefixCls() }}-date-value-text\">{{ cell().content }}</span>\n </span>\n </div>\n <div class=\"{{ prefixCls() }}-date-content\">\n <ng-container *ngTemplateOutlet=\"$any(cellRender()); context: { $implicit: cell().value }\"> </ng-container>\n </div>\n }\n </div>\n }\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
1247
1261
  }
1248
1262
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: DateTableCell, decorators: [{
1249
1263
  type: Component,
1250
- args: [{ selector: '[date-table-cell]', exportAs: 'dateTableCell', imports: [NgTemplateOutlet], template: "\n@switch (prefixCls) {\n @case ('thy-calendar') {\n @switch (true) {\n @case (isTemplateRef(cell.dateCellRender)) {\n <ng-container *ngTemplateOutlet=\"cell.dateCellRender; context: { $implicit: cell.value }\"></ng-container>\n }\n @case (isNonEmptyString(cell.dateCellRender)) {\n <span [innerHTML]=\"cell.dateCellRender\"></span>\n }\n @default {\n <div class=\"{{ prefixCls }}-date\" [attr.aria-selected]=\"cell.isSelected\" [attr.aria-disabled]=\"cell.isDisabled\">\n {{ cell.content }}\n </div>\n }\n }\n }\n @case ('thy-calendar-full') {\n <div\n tabindex=\"0\"\n class=\"{{ prefixCls }}-date thy-calendar-full-cell-inner\"\n [class.thy-calendar-full-calendar-date-today]=\"cell.isToday\"\n >\n @if (cell.fullCellRender) {\n <ng-container *ngTemplateOutlet=\"$any(cell.fullCellRender); context: { $implicit: cell.value }\"> </ng-container>\n } @else {\n <div class=\"{{ prefixCls }}-date-value\">\n <span class=\"{{ prefixCls }}-date-value-today-text\">\n <span class=\"{{ prefixCls }}-date-value-text\">{{ cell.content }}</span>\n </span>\n </div>\n <div class=\"{{ prefixCls }}-date-content\">\n <ng-container *ngTemplateOutlet=\"$any(cell.dateCellRender); context: { $implicit: cell.value }\"> </ng-container>\n </div>\n }\n </div>\n }\n}\n" }]
1251
- }], propDecorators: { prefixCls: [{
1252
- type: Input
1253
- }], cell: [{
1254
- type: Input
1255
- }] } });
1264
+ args: [{ selector: '[date-table-cell]', exportAs: 'dateTableCell', imports: [NgTemplateOutlet], template: "@switch (prefixCls()) {\n @case ('thy-calendar') {\n @switch (true) {\n @case (isTemplateRef(cellRender())) {\n <ng-container *ngTemplateOutlet=\"cellRender(); context: { $implicit: cell().value }\"></ng-container>\n }\n @case (isNonEmptyString(cellRender())) {\n <span [innerHTML]=\"cellRender()\"></span>\n }\n @case (functionRenderResult()) {\n <span [innerHTML]=\"$any(cellRender())(cell().value)\"></span>\n }\n @default {\n <div class=\"{{ prefixCls() }}-date\" [attr.aria-selected]=\"cell().isSelected\" [attr.aria-disabled]=\"cell().isDisabled\">\n {{ cell().content }}\n </div>\n }\n }\n }\n @case ('thy-calendar-full') {\n <div\n tabindex=\"0\"\n class=\"{{ prefixCls() }}-date thy-calendar-full-cell-inner\"\n [class.thy-calendar-full-calendar-date-today]=\"cell().isToday\">\n @if (cell().fullCellRender) {\n <ng-container *ngTemplateOutlet=\"$any(cell().fullCellRender); context: { $implicit: cell().value }\"> </ng-container>\n } @else {\n <div class=\"{{ prefixCls() }}-date-value\">\n <span class=\"{{ prefixCls() }}-date-value-today-text\">\n <span class=\"{{ prefixCls() }}-date-value-text\">{{ cell().content }}</span>\n </span>\n </div>\n <div class=\"{{ prefixCls() }}-date-content\">\n <ng-container *ngTemplateOutlet=\"$any(cellRender()); context: { $implicit: cell().value }\"> </ng-container>\n </div>\n }\n </div>\n }\n}\n" }]
1265
+ }] });
1256
1266
 
1257
1267
  /**
1258
1268
  * @private