ngx-tethys 18.2.0-next.0 → 18.2.0-next.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 (173) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/autocomplete/autocomplete.component.d.ts +4 -2
  3. package/calendar/calendar-header.component.d.ts +2 -0
  4. package/cascader/cascader.component.d.ts +3 -1
  5. package/color-picker/color-picker-panel.component.d.ts +3 -1
  6. package/copy/copy.directive.d.ts +1 -0
  7. package/core/overlay/abstract-overlay-ref.d.ts +4 -0
  8. package/core/overlay/abstract-overlay.service.d.ts +1 -1
  9. package/core/theme/store.d.ts +2 -1
  10. package/core/theme/theme.d.ts +2 -0
  11. package/date-picker/abstract-picker.component.d.ts +3 -1
  12. package/date-picker/date-helper.service.d.ts +3 -0
  13. package/date-picker/date-picker.config.d.ts +7 -1
  14. package/date-picker/lib/calendar/calendar-footer.component.d.ts +3 -1
  15. package/date-picker/lib/calendar/calendar-header.component.d.ts +3 -1
  16. package/date-picker/lib/calendar/calendar-table.component.d.ts +3 -1
  17. package/date-picker/lib/date-carousel/date-carousel.component.d.ts +4 -1
  18. package/date-picker/lib/popups/date-popup.component.d.ts +3 -1
  19. package/date-picker/lib/popups/inner-popup.component.d.ts +3 -1
  20. package/date-range/date-range.component.d.ts +2 -0
  21. package/date-range/optional-dates/optional-dates.component.d.ts +1 -0
  22. package/dialog/confirm/confirm.component.d.ts +1 -0
  23. package/dialog/confirm.config.d.ts +14 -7
  24. package/dialog/dialog-ref.d.ts +10 -2
  25. package/dialog/dialog.service.d.ts +6 -0
  26. package/empty/empty.component.d.ts +14 -9
  27. package/empty/empty.config.d.ts +3 -0
  28. package/esm2022/autocomplete/autocomplete.component.mjs +9 -5
  29. package/esm2022/calendar/calendar-header.component.mjs +9 -5
  30. package/esm2022/cascader/cascader.component.mjs +9 -6
  31. package/esm2022/checkbox/checkbox.component.mjs +1 -1
  32. package/esm2022/color-picker/color-picker-panel.component.mjs +5 -3
  33. package/esm2022/copy/copy.directive.mjs +7 -5
  34. package/esm2022/core/overlay/abstract-overlay-ref.mjs +2 -2
  35. package/esm2022/core/overlay/abstract-overlay.service.mjs +2 -2
  36. package/esm2022/core/theme/store.mjs +7 -7
  37. package/esm2022/core/theme/theme.mjs +9 -2
  38. package/esm2022/date-picker/abstract-picker.component.mjs +4 -2
  39. package/esm2022/date-picker/base-picker.component.mjs +2 -2
  40. package/esm2022/date-picker/date-helper.service.mjs +4 -2
  41. package/esm2022/date-picker/date-picker.component.mjs +1 -1
  42. package/esm2022/date-picker/date-picker.config.mjs +55 -2
  43. package/esm2022/date-picker/date-picker.directive.mjs +1 -1
  44. package/esm2022/date-picker/date-picker.service.mjs +3 -3
  45. package/esm2022/date-picker/lib/calendar/calendar-footer.component.mjs +5 -3
  46. package/esm2022/date-picker/lib/calendar/calendar-header.component.mjs +3 -1
  47. package/esm2022/date-picker/lib/calendar/calendar-table.component.mjs +3 -1
  48. package/esm2022/date-picker/lib/date/date-header.component.mjs +6 -5
  49. package/esm2022/date-picker/lib/date/date-table.component.mjs +4 -4
  50. package/esm2022/date-picker/lib/date-carousel/date-carousel.component.mjs +9 -4
  51. package/esm2022/date-picker/lib/decade/decade-header.component.mjs +3 -3
  52. package/esm2022/date-picker/lib/month/month-header.component.mjs +4 -4
  53. package/esm2022/date-picker/lib/month/month-table.component.mjs +3 -2
  54. package/esm2022/date-picker/lib/popups/date-popup.component.mjs +5 -3
  55. package/esm2022/date-picker/lib/popups/inner-popup.component.mjs +5 -3
  56. package/esm2022/date-picker/lib/year/year-header.component.mjs +3 -3
  57. package/esm2022/date-picker/month-picker.component.mjs +1 -1
  58. package/esm2022/date-picker/quarter-picker.component.mjs +1 -1
  59. package/esm2022/date-picker/range-picker.component.mjs +1 -1
  60. package/esm2022/date-picker/range-picker.directive.mjs +1 -1
  61. package/esm2022/date-picker/week-picker.component.mjs +1 -1
  62. package/esm2022/date-picker/year-picker.component.mjs +1 -1
  63. package/esm2022/date-range/date-range.component.mjs +7 -4
  64. package/esm2022/date-range/optional-dates/optional-dates.component.mjs +4 -2
  65. package/esm2022/dialog/confirm/confirm.component.mjs +14 -3
  66. package/esm2022/dialog/confirm.config.mjs +17 -2
  67. package/esm2022/dialog/dialog-ref.mjs +9 -6
  68. package/esm2022/dialog/dialog.service.mjs +27 -3
  69. package/esm2022/empty/empty.component.mjs +7 -2
  70. package/esm2022/empty/empty.config.mjs +4 -1
  71. package/esm2022/form/form-validator-loader.mjs +17 -15
  72. package/esm2022/guider/guider-hint/guider-hint.component.mjs +5 -3
  73. package/esm2022/i18n/i18n.mjs +9 -0
  74. package/esm2022/i18n/i18n.service.mjs +45 -0
  75. package/esm2022/i18n/i18n.token.mjs +10 -0
  76. package/esm2022/i18n/index.mjs +10 -0
  77. package/esm2022/i18n/locale.mjs +14 -0
  78. package/esm2022/i18n/locales/de-de.mjs +130 -0
  79. package/esm2022/i18n/locales/en-us.mjs +151 -0
  80. package/esm2022/i18n/locales/ja-jp.mjs +130 -0
  81. package/esm2022/i18n/locales/zh-hans.mjs +130 -0
  82. package/esm2022/i18n/locales/zh-hant.mjs +130 -0
  83. package/esm2022/i18n/ngx-tethys-i18n.mjs +5 -0
  84. package/esm2022/nav/nav.component.mjs +5 -3
  85. package/esm2022/pagination/pagination.component.mjs +22 -5
  86. package/esm2022/pagination/pagination.module.mjs +26 -5
  87. package/esm2022/pagination/pagination.pipe.mjs +25 -1
  88. package/esm2022/property/property-item.component.mjs +3 -3
  89. package/esm2022/radio/button/radio-button.component.mjs +1 -1
  90. package/esm2022/radio/radio.component.mjs +1 -1
  91. package/esm2022/select/custom-select/custom-select.component.mjs +13 -6
  92. package/esm2022/strength/strength.component.mjs +21 -20
  93. package/esm2022/time-picker/time-picker-panel.component.mjs +5 -3
  94. package/esm2022/time-picker/time-picker.component.mjs +4 -2
  95. package/esm2022/tooltip/tooltip-ref.mjs +4 -1
  96. package/esm2022/transfer/transfer-list.component.mjs +5 -3
  97. package/esm2022/tree-select/tree-select.component.mjs +9 -6
  98. package/esm2022/version.mjs +2 -2
  99. package/fesm2022/ngx-tethys-autocomplete.mjs +8 -5
  100. package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
  101. package/fesm2022/ngx-tethys-calendar.mjs +8 -5
  102. package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
  103. package/fesm2022/ngx-tethys-cascader.mjs +8 -5
  104. package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
  105. package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
  106. package/fesm2022/ngx-tethys-color-picker.mjs +4 -2
  107. package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
  108. package/fesm2022/ngx-tethys-copy.mjs +6 -4
  109. package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
  110. package/fesm2022/ngx-tethys-core.mjs +14 -7
  111. package/fesm2022/ngx-tethys-core.mjs.map +1 -1
  112. package/fesm2022/ngx-tethys-date-picker.mjs +95 -30
  113. package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
  114. package/fesm2022/ngx-tethys-date-range.mjs +8 -4
  115. package/fesm2022/ngx-tethys-date-range.mjs.map +1 -1
  116. package/fesm2022/ngx-tethys-dialog.mjs +61 -10
  117. package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
  118. package/fesm2022/ngx-tethys-empty.mjs +9 -1
  119. package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
  120. package/fesm2022/ngx-tethys-form.mjs +16 -14
  121. package/fesm2022/ngx-tethys-form.mjs.map +1 -1
  122. package/fesm2022/ngx-tethys-guider.mjs +4 -2
  123. package/fesm2022/ngx-tethys-guider.mjs.map +1 -1
  124. package/fesm2022/ngx-tethys-i18n.mjs +747 -0
  125. package/fesm2022/ngx-tethys-i18n.mjs.map +1 -0
  126. package/fesm2022/ngx-tethys-nav.mjs +4 -2
  127. package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
  128. package/fesm2022/ngx-tethys-pagination.mjs +69 -7
  129. package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
  130. package/fesm2022/ngx-tethys-property.mjs +2 -2
  131. package/fesm2022/ngx-tethys-property.mjs.map +1 -1
  132. package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
  133. package/fesm2022/ngx-tethys-select.mjs +12 -5
  134. package/fesm2022/ngx-tethys-select.mjs.map +1 -1
  135. package/fesm2022/ngx-tethys-strength.mjs +20 -19
  136. package/fesm2022/ngx-tethys-strength.mjs.map +1 -1
  137. package/fesm2022/ngx-tethys-time-picker.mjs +6 -3
  138. package/fesm2022/ngx-tethys-time-picker.mjs.map +1 -1
  139. package/fesm2022/ngx-tethys-tooltip.mjs +3 -0
  140. package/fesm2022/ngx-tethys-tooltip.mjs.map +1 -1
  141. package/fesm2022/ngx-tethys-transfer.mjs +4 -2
  142. package/fesm2022/ngx-tethys-transfer.mjs.map +1 -1
  143. package/fesm2022/ngx-tethys-tree-select.mjs +8 -5
  144. package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
  145. package/fesm2022/ngx-tethys.mjs +1 -1
  146. package/fesm2022/ngx-tethys.mjs.map +1 -1
  147. package/form/form-validator-loader.d.ts +2 -0
  148. package/guider/guider-hint/guider-hint.component.d.ts +3 -1
  149. package/i18n/i18n.d.ts +154 -0
  150. package/i18n/i18n.service.d.ts +19 -0
  151. package/i18n/i18n.token.d.ts +8 -0
  152. package/i18n/index.d.ts +9 -0
  153. package/i18n/locale.d.ts +4 -0
  154. package/i18n/locales/de-de.d.ts +130 -0
  155. package/i18n/locales/en-us.d.ts +151 -0
  156. package/i18n/locales/ja-jp.d.ts +130 -0
  157. package/i18n/locales/zh-hans.d.ts +130 -0
  158. package/i18n/locales/zh-hant.d.ts +130 -0
  159. package/nav/nav.component.d.ts +3 -1
  160. package/package.json +7 -1
  161. package/pagination/pagination.component.d.ts +4 -1
  162. package/pagination/pagination.module.d.ts +1 -1
  163. package/pagination/pagination.pipe.d.ts +6 -0
  164. package/radio/radio.component.d.ts +0 -2
  165. package/schematics/version.d.ts +1 -1
  166. package/schematics/version.js +1 -1
  167. package/select/custom-select/custom-select.component.d.ts +3 -1
  168. package/strength/strength.component.d.ts +21 -2
  169. package/styles/modules/cdk/drag-drop.scss +1 -1
  170. package/time-picker/time-picker-panel.component.d.ts +3 -1
  171. package/time-picker/time-picker.component.d.ts +3 -1
  172. package/transfer/transfer-list.component.d.ts +3 -1
  173. package/tree-select/tree-select.component.d.ts +3 -1
@@ -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 = '复制成功';\n\n /**\n * 提示文案\n */\n @Input() thyCopyTips = '点击复制';\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 : '点击复制';\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('复制失败');\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":";;;;;;;;;AAYA;;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;AAEjD;;AAEG;AACO,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,YAAY,EAAgB,CAAC;AAErD;;AAEG;QACM,IAAkB,CAAA,kBAAA,GAAG,MAAM,CAAC;AAErC;;AAEG;QACM,IAAW,CAAA,WAAA,GAAG,MAAM,CAAC;AAY9B;;AAEG;Q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B,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;;;MC5DxB,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;;;;"}
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,EAAE,CAAC,IAAI,CAAC;AAY1C;;AAEG;QAC0C,IAAa,CAAA,aAAA,GAAG,IAAI,CAAC;AAyCrE,KAAA;IAvCG,QAAQ,GAAA;QACJ,IAAI,CAAC,gBAAgB,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,M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K;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
  }
@@ -527,6 +527,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
527
527
  }]
528
528
  }], ctorParameters: () => [] });
529
529
 
530
+ function injectPanelEmptyIcon() {
531
+ const thyThemeStore = inject(ThyThemeStore);
532
+ return computed(() => {
533
+ return thyThemeStore.isDark() ? 'preset-light' : '';
534
+ });
535
+ }
536
+
530
537
  const POSITION_MAP = {
531
538
  top: {
532
539
  originX: 'center',
@@ -1637,5 +1644,5 @@ class DebounceTimeWrapper {
1637
1644
  * Generated bundle index. Do not edit.
1638
1645
  */
1639
1646
 
1640
- export { AbstractControlValueAccessor, AnimationCurves, AnimationDuration, AnonymousClass, DebounceTimeWrapper, EXPANDED_DROPDOWN_POSITIONS, InputBoolean, InputCssPixel, InputNumber, MiniAction, MiniActionState, MiniStore, MixinBase, POSITION_MAP, ScrollToService, TabIndexDisabledControlValueAccessorMixin, TabIndexMixinBase, ThyAbstractInternalOverlayRef, ThyAbstractOverlayConfig, ThyAbstractOverlayContainer, ThyAbstractOverlayRef, ThyAbstractOverlayService, ThyClickPositioner, ThyOverlayDirectiveBase, ThyPortalOutlet, ThyScrollService, ThyThemeStore, ThyTranslate, UpdateHostClassService, buildConnectedPositionOffset, buildConnectedPositionPair, cancelRequestAnimationFrame, collapseMotion, fadeMotion, getFallbackPlacements, getFlexiblePositions, getNumericSize, getPlacementByPosition, isBgColor, isTextColor, isThemeColor, mixinDisabled, mixinInitialized, mixinLoadingDone, mixinTabIndex, mixinUnsubscribe, presetBgColors, presetTextColors, presetThemeColors, reqAnimFrame, scaleMotion, scaleXMotion, scaleYMotion, throwPopoverContentAlreadyAttachedError, thumbMotion, useHostFocusControl };
1647
+ export { AbstractControlValueAccessor, AnimationCurves, AnimationDuration, AnonymousClass, DebounceTimeWrapper, EXPANDED_DROPDOWN_POSITIONS, InputBoolean, InputCssPixel, InputNumber, MiniAction, MiniActionState, MiniStore, MixinBase, POSITION_MAP, ScrollToService, TabIndexDisabledControlValueAccessorMixin, TabIndexMixinBase, ThyAbstractInternalOverlayRef, ThyAbstractOverlayConfig, ThyAbstractOverlayContainer, ThyAbstractOverlayRef, ThyAbstractOverlayService, ThyClickPositioner, ThyOverlayDirectiveBase, ThyPortalOutlet, ThyScrollService, ThyThemeStore, ThyTranslate, UpdateHostClassService, buildConnectedPositionOffset, buildConnectedPositionPair, cancelRequestAnimationFrame, collapseMotion, fadeMotion, getFallbackPlacements, getFlexiblePositions, getNumericSize, getPlacementByPosition, injectPanelEmptyIcon, isBgColor, isTextColor, isThemeColor, mixinDisabled, mixinInitialized, mixinLoadingDone, mixinTabIndex, mixinUnsubscribe, presetBgColors, presetTextColors, presetThemeColors, reqAnimFrame, scaleMotion, scaleXMotion, scaleYMotion, throwPopoverContentAlreadyAttachedError, thumbMotion, useHostFocusControl };
1641
1648
  //# sourceMappingURL=ngx-tethys-core.mjs.map