ngx-tethys 18.2.0-next.0 → 18.2.0-next.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.
- package/CHANGELOG.md +40 -0
- package/autocomplete/autocomplete.component.d.ts +2 -1
- package/calendar/calendar-header.component.d.ts +2 -0
- package/cascader/cascader.component.d.ts +1 -0
- package/color-picker/color-picker-panel.component.d.ts +3 -1
- package/copy/copy.directive.d.ts +1 -0
- package/core/theme/store.d.ts +2 -1
- package/date-picker/abstract-picker.component.d.ts +3 -1
- package/date-picker/date-helper.service.d.ts +3 -0
- package/date-picker/date-picker.config.d.ts +7 -1
- package/date-picker/lib/calendar/calendar-footer.component.d.ts +3 -1
- package/date-picker/lib/calendar/calendar-header.component.d.ts +3 -1
- package/date-picker/lib/calendar/calendar-table.component.d.ts +3 -1
- package/date-picker/lib/date-carousel/date-carousel.component.d.ts +4 -1
- package/date-picker/lib/popups/date-popup.component.d.ts +3 -1
- package/date-picker/lib/popups/inner-popup.component.d.ts +3 -1
- package/date-range/date-range.component.d.ts +2 -0
- package/date-range/optional-dates/optional-dates.component.d.ts +1 -0
- package/dialog/confirm/confirm.component.d.ts +1 -0
- package/dialog/confirm.config.d.ts +14 -7
- package/empty/empty.component.d.ts +14 -9
- package/empty/empty.config.d.ts +3 -0
- package/esm2022/autocomplete/autocomplete.component.mjs +5 -3
- package/esm2022/calendar/calendar-header.component.mjs +9 -5
- package/esm2022/cascader/cascader.component.mjs +5 -3
- package/esm2022/checkbox/checkbox.component.mjs +1 -1
- package/esm2022/color-picker/color-picker-panel.component.mjs +5 -3
- package/esm2022/copy/copy.directive.mjs +7 -5
- package/esm2022/core/theme/store.mjs +7 -7
- package/esm2022/date-picker/abstract-picker.component.mjs +4 -2
- package/esm2022/date-picker/base-picker.component.mjs +2 -2
- package/esm2022/date-picker/date-helper.service.mjs +4 -2
- package/esm2022/date-picker/date-picker.component.mjs +1 -1
- package/esm2022/date-picker/date-picker.config.mjs +55 -2
- package/esm2022/date-picker/date-picker.directive.mjs +1 -1
- package/esm2022/date-picker/date-picker.service.mjs +3 -3
- package/esm2022/date-picker/lib/calendar/calendar-footer.component.mjs +5 -3
- package/esm2022/date-picker/lib/calendar/calendar-header.component.mjs +3 -1
- package/esm2022/date-picker/lib/calendar/calendar-table.component.mjs +3 -1
- package/esm2022/date-picker/lib/date/date-header.component.mjs +6 -5
- package/esm2022/date-picker/lib/date/date-table.component.mjs +4 -4
- package/esm2022/date-picker/lib/date-carousel/date-carousel.component.mjs +9 -4
- package/esm2022/date-picker/lib/decade/decade-header.component.mjs +3 -3
- package/esm2022/date-picker/lib/month/month-header.component.mjs +4 -4
- package/esm2022/date-picker/lib/month/month-table.component.mjs +3 -2
- package/esm2022/date-picker/lib/popups/date-popup.component.mjs +5 -3
- package/esm2022/date-picker/lib/popups/inner-popup.component.mjs +5 -3
- package/esm2022/date-picker/lib/year/year-header.component.mjs +3 -3
- package/esm2022/date-picker/month-picker.component.mjs +1 -1
- package/esm2022/date-picker/quarter-picker.component.mjs +1 -1
- package/esm2022/date-picker/range-picker.component.mjs +1 -1
- package/esm2022/date-picker/range-picker.directive.mjs +1 -1
- package/esm2022/date-picker/week-picker.component.mjs +1 -1
- package/esm2022/date-picker/year-picker.component.mjs +1 -1
- package/esm2022/date-range/date-range.component.mjs +7 -4
- package/esm2022/date-range/optional-dates/optional-dates.component.mjs +4 -2
- package/esm2022/dialog/confirm/confirm.component.mjs +14 -3
- package/esm2022/dialog/confirm.config.mjs +17 -2
- package/esm2022/empty/empty.component.mjs +7 -2
- package/esm2022/empty/empty.config.mjs +4 -1
- package/esm2022/form/form-validator-loader.mjs +17 -15
- package/esm2022/guider/guider-hint/guider-hint.component.mjs +5 -3
- package/esm2022/i18n/i18n.mjs +2 -0
- package/esm2022/i18n/i18n.service.mjs +39 -0
- package/esm2022/i18n/i18n.token.mjs +8 -0
- package/esm2022/i18n/index.mjs +7 -0
- package/esm2022/i18n/locale.mjs +14 -0
- package/esm2022/i18n/locales/en-us.mjs +147 -0
- package/esm2022/i18n/locales/zh-cn.mjs +127 -0
- package/esm2022/i18n/ngx-tethys-i18n.mjs +5 -0
- package/esm2022/pagination/pagination.component.mjs +22 -5
- package/esm2022/pagination/pagination.module.mjs +26 -5
- package/esm2022/pagination/pagination.pipe.mjs +22 -1
- package/esm2022/property/property-item.component.mjs +3 -3
- package/esm2022/radio/button/radio-button.component.mjs +1 -1
- package/esm2022/radio/radio.component.mjs +1 -1
- package/esm2022/select/custom-select/custom-select.component.mjs +9 -3
- package/esm2022/strength/strength.component.mjs +21 -20
- package/esm2022/time-picker/time-picker-panel.component.mjs +5 -3
- package/esm2022/time-picker/time-picker.component.mjs +4 -2
- package/esm2022/transfer/transfer-list.component.mjs +5 -3
- package/esm2022/tree-select/tree-select.component.mjs +5 -3
- package/esm2022/version.mjs +2 -2
- package/fesm2022/ngx-tethys-autocomplete.mjs +4 -2
- package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
- package/fesm2022/ngx-tethys-calendar.mjs +8 -5
- package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-cascader.mjs +4 -2
- package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
- package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-tethys-color-picker.mjs +4 -2
- package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-copy.mjs +6 -4
- package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
- package/fesm2022/ngx-tethys-core.mjs +6 -6
- package/fesm2022/ngx-tethys-core.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-picker.mjs +95 -30
- package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-range.mjs +8 -4
- package/fesm2022/ngx-tethys-date-range.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dialog.mjs +27 -2
- package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
- package/fesm2022/ngx-tethys-empty.mjs +9 -1
- package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
- package/fesm2022/ngx-tethys-form.mjs +16 -14
- package/fesm2022/ngx-tethys-form.mjs.map +1 -1
- package/fesm2022/ngx-tethys-guider.mjs +4 -2
- package/fesm2022/ngx-tethys-guider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-i18n.mjs +338 -0
- package/fesm2022/ngx-tethys-i18n.mjs.map +1 -0
- package/fesm2022/ngx-tethys-pagination.mjs +66 -7
- package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property.mjs +2 -2
- package/fesm2022/ngx-tethys-property.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-select.mjs +8 -2
- package/fesm2022/ngx-tethys-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys-strength.mjs +20 -19
- package/fesm2022/ngx-tethys-strength.mjs.map +1 -1
- package/fesm2022/ngx-tethys-time-picker.mjs +6 -3
- package/fesm2022/ngx-tethys-time-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-transfer.mjs +4 -2
- package/fesm2022/ngx-tethys-transfer.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree-select.mjs +4 -2
- package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys.mjs +1 -1
- package/fesm2022/ngx-tethys.mjs.map +1 -1
- package/form/form-validator-loader.d.ts +2 -0
- package/guider/guider-hint/guider-hint.component.d.ts +3 -1
- package/i18n/i18n.d.ts +143 -0
- package/i18n/i18n.service.d.ts +19 -0
- package/i18n/i18n.token.d.ts +5 -0
- package/i18n/index.d.ts +6 -0
- package/i18n/locale.d.ts +4 -0
- package/i18n/locales/en-us.d.ts +147 -0
- package/i18n/locales/zh-cn.d.ts +126 -0
- package/package.json +7 -1
- package/pagination/pagination.component.d.ts +4 -1
- package/pagination/pagination.module.d.ts +1 -1
- package/pagination/pagination.pipe.d.ts +6 -0
- package/radio/radio.component.d.ts +0 -2
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/select/custom-select/custom-select.component.d.ts +1 -0
- package/strength/strength.component.d.ts +21 -2
- package/styles/modules/cdk/drag-drop.scss +1 -1
- package/time-picker/time-picker-panel.component.d.ts +3 -1
- package/time-picker/time-picker.component.d.ts +3 -1
- package/transfer/transfer-list.component.d.ts +3 -1
- package/tree-select/tree-select.component.d.ts +1 -0
|
@@ -6,6 +6,7 @@ import { ThyNotifyService, ThyNotifyModule } from 'ngx-tethys/notify';
|
|
|
6
6
|
import * as i1 from 'ngx-tethys/tooltip';
|
|
7
7
|
import { ThyTooltipDirective } from 'ngx-tethys/tooltip';
|
|
8
8
|
import { coerceBooleanProperty } from 'ngx-tethys/util';
|
|
9
|
+
import { injectLocale } from 'ngx-tethys/i18n';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* @name thyCopy
|
|
@@ -15,6 +16,7 @@ class ThyCopyDirective {
|
|
|
15
16
|
this.document = inject(DOCUMENT);
|
|
16
17
|
this.tooltipDirective = inject(ThyTooltipDirective);
|
|
17
18
|
this.notifyService = inject(ThyNotifyService);
|
|
19
|
+
this.locale = injectLocale('copy');
|
|
18
20
|
/**
|
|
19
21
|
* 默认为点击标签,可传复制目标标签
|
|
20
22
|
*/
|
|
@@ -22,18 +24,18 @@ class ThyCopyDirective {
|
|
|
22
24
|
/**
|
|
23
25
|
* 复制成功时的文案
|
|
24
26
|
*/
|
|
25
|
-
this.thyCopySuccessText =
|
|
27
|
+
this.thyCopySuccessText = this.locale().success;
|
|
26
28
|
/**
|
|
27
29
|
* 提示文案
|
|
28
30
|
*/
|
|
29
|
-
this.thyCopyTips =
|
|
31
|
+
this.thyCopyTips = this.locale().tips;
|
|
30
32
|
/**
|
|
31
33
|
* 是否展示通知
|
|
32
34
|
*/
|
|
33
35
|
this.thyShowNotify = true;
|
|
34
36
|
}
|
|
35
37
|
ngOnInit() {
|
|
36
|
-
this.tooltipDirective.content = this.thyCopyTips ? this.thyCopyTips :
|
|
38
|
+
this.tooltipDirective.content = this.thyCopyTips ? this.thyCopyTips : this.locale().tips;
|
|
37
39
|
this.tooltipDirective.tooltipOffset = this.thyCopyTipsOffset;
|
|
38
40
|
}
|
|
39
41
|
getContent(event) {
|
|
@@ -60,7 +62,7 @@ class ThyCopyDirective {
|
|
|
60
62
|
catch (err) {
|
|
61
63
|
this.thyCopy.emit({ isSuccess: false, event });
|
|
62
64
|
if (this.thyShowNotify) {
|
|
63
|
-
this.notifyService.error(
|
|
65
|
+
this.notifyService.error(this.locale().error);
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
finally {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-tethys-copy.mjs","sources":["../../../src/copy/copy.directive.ts","../../../src/copy/module.ts","../../../src/copy/ngx-tethys-copy.ts"],"sourcesContent":["import { Directive, ElementRef, EventEmitter, HostListener, Input, OnDestroy, OnInit, Output, inject } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { coerceElement } from '@angular/cdk/coercion';\nimport { ThyNotifyService } from 'ngx-tethys/notify';\nimport { ThyTooltipDirective } from 'ngx-tethys/tooltip';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\n\nexport interface ThyCopyEvent {\n isSuccess: boolean;\n event: Event;\n}\n\n/**\n * @name thyCopy\n */\n@Directive({\n selector: '[thyCopy]',\n hostDirectives: [ThyTooltipDirective],\n standalone: true\n})\nexport class ThyCopyDirective implements OnInit, OnDestroy {\n private document = inject(DOCUMENT);\n tooltipDirective = inject(ThyTooltipDirective);\n private notifyService = inject(ThyNotifyService);\n\n /**\n * 默认为点击标签,可传复制目标标签\n */\n @Output() thyCopy = new EventEmitter<ThyCopyEvent>();\n\n /**\n * 复制成功时的文案\n */\n @Input() thyCopySuccessText =
|
|
1
|
+
{"version":3,"file":"ngx-tethys-copy.mjs","sources":["../../../src/copy/copy.directive.ts","../../../src/copy/module.ts","../../../src/copy/ngx-tethys-copy.ts"],"sourcesContent":["import { Directive, ElementRef, EventEmitter, HostListener, Input, OnDestroy, OnInit, Output, Signal, inject } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { coerceElement } from '@angular/cdk/coercion';\nimport { ThyNotifyService } from 'ngx-tethys/notify';\nimport { ThyTooltipDirective } from 'ngx-tethys/tooltip';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\nimport { injectLocale, ThyCopyLocale } from 'ngx-tethys/i18n';\n\nexport interface ThyCopyEvent {\n isSuccess: boolean;\n event: Event;\n}\n\n/**\n * @name thyCopy\n */\n@Directive({\n selector: '[thyCopy]',\n hostDirectives: [ThyTooltipDirective],\n standalone: true\n})\nexport class ThyCopyDirective implements OnInit, OnDestroy {\n private document = inject(DOCUMENT);\n tooltipDirective = inject(ThyTooltipDirective);\n private notifyService = inject(ThyNotifyService);\n private locale: Signal<ThyCopyLocale> = injectLocale('copy');\n\n /**\n * 默认为点击标签,可传复制目标标签\n */\n @Output() thyCopy = new EventEmitter<ThyCopyEvent>();\n\n /**\n * 复制成功时的文案\n */\n @Input() thyCopySuccessText = this.locale().success;\n\n /**\n * 提示文案\n */\n @Input() thyCopyTips = this.locale().tips;\n\n /**\n * 偏移量\n */\n @Input() thyCopyTipsOffset: number;\n\n /**\n * 当为 string 时,复制的是传入的内容;当为 ElementRef | HTMLElement 时,复制的是 dom 节点的 value 或者 textContent\n */\n @Input() thyCopyContent: string | ElementRef | HTMLElement;\n\n /**\n * 是否展示通知\n */\n @Input({ transform: coerceBooleanProperty }) thyShowNotify = true;\n\n ngOnInit() {\n this.tooltipDirective.content = this.thyCopyTips ? this.thyCopyTips : this.locale().tips;\n this.tooltipDirective.tooltipOffset = this.thyCopyTipsOffset;\n }\n\n private getContent(event: Event) {\n if (typeof this.thyCopyContent === 'string') {\n return this.thyCopyContent;\n } else {\n const target = this.thyCopyContent ? coerceElement(this.thyCopyContent) : event.target;\n return target.value || target.textContent;\n }\n }\n\n @HostListener('click', ['$event'])\n public onClick(event: Event) {\n const textarea = this.document.createElement('textarea');\n this.document.body.appendChild(textarea);\n textarea.value = this.getContent(event);\n textarea.select();\n try {\n document.execCommand('copy', false, null);\n this.thyCopy.emit({ isSuccess: true, event });\n if (this.thyShowNotify) {\n this.notifyService.success(this.thyCopySuccessText);\n }\n } catch (err) {\n this.thyCopy.emit({ isSuccess: false, event });\n if (this.thyShowNotify) {\n this.notifyService.error(this.locale().error);\n }\n } finally {\n textarea.remove();\n }\n }\n\n ngOnDestroy() {\n this.tooltipDirective.hide();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ThyCopyDirective } from './copy.directive';\nimport { ThyNotifyModule } from 'ngx-tethys/notify';\n\n@NgModule({\n imports: [CommonModule, ThyNotifyModule, ThyCopyDirective],\n exports: [ThyCopyDirective]\n})\nexport class ThyCopyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAaA;;AAEG;MAMU,gBAAgB,CAAA;AAL7B,IAAA,WAAA,GAAA;AAMY,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AACpC,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACvC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACzC,QAAA,IAAA,CAAA,MAAM,GAA0B,YAAY,CAAC,MAAM,CAAC,CAAC;AAE7D;;AAEG;AACO,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,YAAY,EAAgB,CAAC;AAErD;;AAEG;AACM,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;AAEpD;;AAEG;AACM,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,MAAM,EAA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A;sBAAhB,MAAM;gBAKE,kBAAkB,EAAA,CAAA;sBAA1B,KAAK;gBAKG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBAKG,iBAAiB,EAAA,CAAA;sBAAzB,KAAK;gBAKG,cAAc,EAAA,CAAA;sBAAtB,KAAK;gBAKuC,aAAa,EAAA,CAAA;sBAAzD,KAAK;uBAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAA;gBAiBpC,OAAO,EAAA,CAAA;sBADb,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAA;;;MC9DxB,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAAb,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAHZ,YAAY,EAAE,eAAe,EAAE,gBAAgB,aAC/C,gBAAgB,CAAA,EAAA,CAAA,CAAA,EAAA;+GAEjB,aAAa,EAAA,OAAA,EAAA,CAHZ,YAAY,EAAE,eAAe,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAG9B,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,gBAAgB,CAAC;oBAC1D,OAAO,EAAE,CAAC,gBAAgB,CAAC;AAC9B,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -3,7 +3,7 @@ import { coerceBooleanProperty as coerceBooleanProperty$1, coerceNumberProperty
|
|
|
3
3
|
import { Subject, fromEvent, Observable, of, throwError, BehaviorSubject, from } from 'rxjs';
|
|
4
4
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { inject, ElementRef, Injectable, NgZone, signal, EventEmitter, TemplateRef, reflectComponentType, Directive, Renderer2, InjectionToken, isDevMode } from '@angular/core';
|
|
6
|
+
import { inject, ElementRef, Injectable, NgZone, signal, computed, EventEmitter, TemplateRef, reflectComponentType, Directive, Renderer2, InjectionToken, isDevMode } from '@angular/core';
|
|
7
7
|
import { takeUntil, take, finalize, filter, catchError, shareReplay, exhaustMap, map, distinctUntilChanged, debounceTime } from 'rxjs/operators';
|
|
8
8
|
import { ThyClickDispatcher } from '@tethys/cdk/event';
|
|
9
9
|
export * from '@tethys/cdk/event';
|
|
@@ -490,6 +490,11 @@ const scaleMotion = trigger('scaleMotion', [
|
|
|
490
490
|
class ThyThemeStore {
|
|
491
491
|
constructor() {
|
|
492
492
|
this.theme = signal("light" /* ThyTheme.light */);
|
|
493
|
+
this.isDark = computed(() => {
|
|
494
|
+
const theme = this.theme();
|
|
495
|
+
return (theme === "dark" /* ThyTheme.dark */ ||
|
|
496
|
+
(theme === "system" /* ThyTheme.system */ && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches));
|
|
497
|
+
});
|
|
493
498
|
}
|
|
494
499
|
setTheme(theme) {
|
|
495
500
|
this.theme.set(theme);
|
|
@@ -512,11 +517,6 @@ class ThyThemeStore {
|
|
|
512
517
|
}
|
|
513
518
|
}
|
|
514
519
|
}
|
|
515
|
-
isDark() {
|
|
516
|
-
const theme = this.theme();
|
|
517
|
-
return (theme === "dark" /* ThyTheme.dark */ ||
|
|
518
|
-
(theme === "system" /* ThyTheme.system */ && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches));
|
|
519
|
-
}
|
|
520
520
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ThyThemeStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
521
521
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ThyThemeStore, providedIn: 'root' }); }
|
|
522
522
|
}
|