ngx-tethys 18.2.4 → 18.2.6

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 (577) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/carousel/carousel.component.d.ts +2 -2
  3. package/date-picker/date-picker.config.d.ts +1 -1
  4. package/date-picker/lib/calendar/calendar-footer.component.d.ts +2 -2
  5. package/date-picker/lib/date/date-table.component.d.ts +2 -2
  6. package/date-picker/lib/popups/date-popup.component.d.ts +3 -2
  7. package/date-picker/lib/popups/inner-popup.component.d.ts +1 -1
  8. package/date-picker/picker.util.d.ts +3 -3
  9. package/date-range/date-range.component.d.ts +1 -1
  10. package/esm2022/action/action.component.mjs +4 -4
  11. package/esm2022/action/action.module.mjs +5 -5
  12. package/esm2022/action/actions.component.mjs +4 -4
  13. package/esm2022/affix/affix.component.mjs +4 -4
  14. package/esm2022/affix/affix.module.mjs +5 -5
  15. package/esm2022/alert/alert.component.mjs +4 -4
  16. package/esm2022/alert/alert.directive.mjs +4 -4
  17. package/esm2022/alert/alert.module.mjs +5 -5
  18. package/esm2022/anchor/anchor-link.component.mjs +4 -4
  19. package/esm2022/anchor/anchor.component.mjs +4 -4
  20. package/esm2022/anchor/anchor.module.mjs +5 -5
  21. package/esm2022/arrow-switcher/arrow-switcher.component.mjs +4 -4
  22. package/esm2022/arrow-switcher/module.mjs +5 -5
  23. package/esm2022/autocomplete/autocomplete.component.mjs +4 -4
  24. package/esm2022/autocomplete/autocomplete.trigger.directive.mjs +4 -4
  25. package/esm2022/autocomplete/module.mjs +5 -5
  26. package/esm2022/autocomplete/overlay/autocomplete-container.component.mjs +4 -4
  27. package/esm2022/autocomplete/overlay/autocomplete.service.mjs +4 -4
  28. package/esm2022/avatar/avatar-list/avatar-list.component.mjs +4 -4
  29. package/esm2022/avatar/avatar.component.mjs +4 -4
  30. package/esm2022/avatar/avatar.module.mjs +5 -5
  31. package/esm2022/avatar/avatar.pipe.mjs +10 -10
  32. package/esm2022/avatar/avatar.service.mjs +4 -4
  33. package/esm2022/back-top/back-top.component.mjs +4 -4
  34. package/esm2022/back-top/back-top.module.mjs +5 -5
  35. package/esm2022/badge/badge.component.mjs +4 -4
  36. package/esm2022/badge/badge.module.mjs +5 -5
  37. package/esm2022/breadcrumb/breadcrumb-item.component.mjs +4 -4
  38. package/esm2022/breadcrumb/breadcrumb.component.mjs +4 -4
  39. package/esm2022/breadcrumb/module.mjs +5 -5
  40. package/esm2022/button/button-group.component.mjs +4 -4
  41. package/esm2022/button/button-icon.component.mjs +4 -4
  42. package/esm2022/button/button.component.mjs +4 -4
  43. package/esm2022/button/button.module.mjs +5 -5
  44. package/esm2022/calendar/calendar-cells.mjs +7 -7
  45. package/esm2022/calendar/calendar-header.component.mjs +17 -17
  46. package/esm2022/calendar/calendar.component.mjs +6 -6
  47. package/esm2022/calendar/module.mjs +5 -5
  48. package/esm2022/card/card.component.mjs +4 -4
  49. package/esm2022/card/card.module.mjs +5 -5
  50. package/esm2022/card/content.component.mjs +4 -4
  51. package/esm2022/card/header.component.mjs +4 -4
  52. package/esm2022/carousel/carousel-item.directive.mjs +4 -4
  53. package/esm2022/carousel/carousel.component.mjs +13 -13
  54. package/esm2022/carousel/carousel.service.mjs +4 -4
  55. package/esm2022/carousel/module.mjs +5 -5
  56. package/esm2022/cascader/cascader-li.component.mjs +4 -4
  57. package/esm2022/cascader/cascader-search-option.component.mjs +4 -4
  58. package/esm2022/cascader/cascader.component.mjs +4 -4
  59. package/esm2022/cascader/cascader.service.mjs +4 -4
  60. package/esm2022/cascader/module.mjs +5 -5
  61. package/esm2022/checkbox/checkbox.component.mjs +4 -4
  62. package/esm2022/checkbox/module.mjs +5 -5
  63. package/esm2022/collapse/collapse-item.component.mjs +4 -4
  64. package/esm2022/collapse/collapse.component.mjs +4 -4
  65. package/esm2022/collapse/module.mjs +5 -5
  66. package/esm2022/color-picker/color-picker-custom-panel.component.mjs +4 -4
  67. package/esm2022/color-picker/color-picker-panel.component.mjs +4 -4
  68. package/esm2022/color-picker/color-picker.component.mjs +4 -4
  69. package/esm2022/color-picker/coordinates.directive.mjs +4 -4
  70. package/esm2022/color-picker/module.mjs +5 -5
  71. package/esm2022/color-picker/parts/alpha/alpha.component.mjs +4 -4
  72. package/esm2022/color-picker/parts/hue/hue.component.mjs +4 -4
  73. package/esm2022/color-picker/parts/indicator/indicator.component.mjs +4 -4
  74. package/esm2022/color-picker/parts/inputs/inputs.component.mjs +4 -4
  75. package/esm2022/color-picker/parts/saturation/saturation.component.mjs +4 -4
  76. package/esm2022/comment/comment-actions.directive.mjs +4 -4
  77. package/esm2022/comment/comment-content.directive.mjs +4 -4
  78. package/esm2022/comment/comment.component.mjs +4 -4
  79. package/esm2022/comment/comment.module.mjs +5 -5
  80. package/esm2022/copy/copy.directive.mjs +4 -4
  81. package/esm2022/copy/module.mjs +5 -5
  82. package/esm2022/core/click-positioner.mjs +4 -4
  83. package/esm2022/core/overlay/portal-directives.mjs +4 -4
  84. package/esm2022/core/request-animation.mjs +3 -2
  85. package/esm2022/core/scroll.mjs +4 -4
  86. package/esm2022/core/store/store.mjs +4 -4
  87. package/esm2022/core/theme/store.mjs +4 -4
  88. package/esm2022/core/translate.mjs +4 -4
  89. package/esm2022/core/update-host-class.service.mjs +4 -4
  90. package/esm2022/date-picker/abstract-picker.component.mjs +4 -4
  91. package/esm2022/date-picker/abstract-picker.directive.mjs +4 -4
  92. package/esm2022/date-picker/base-picker.component.mjs +4 -4
  93. package/esm2022/date-picker/date-helper.service.mjs +4 -4
  94. package/esm2022/date-picker/date-picker.component.mjs +4 -4
  95. package/esm2022/date-picker/date-picker.config.mjs +12 -13
  96. package/esm2022/date-picker/date-picker.directive.mjs +4 -4
  97. package/esm2022/date-picker/date-picker.module.mjs +5 -5
  98. package/esm2022/date-picker/date-picker.service.mjs +4 -4
  99. package/esm2022/date-picker/lib/calendar/calendar-footer.component.mjs +9 -9
  100. package/esm2022/date-picker/lib/calendar/calendar-header.component.mjs +4 -4
  101. package/esm2022/date-picker/lib/calendar/calendar-table.component.mjs +4 -4
  102. package/esm2022/date-picker/lib/date/date-header.component.mjs +4 -4
  103. package/esm2022/date-picker/lib/date/date-table-cell.component.mjs +4 -4
  104. package/esm2022/date-picker/lib/date/date-table.component.mjs +10 -9
  105. package/esm2022/date-picker/lib/date-carousel/date-carousel.component.mjs +4 -4
  106. package/esm2022/date-picker/lib/decade/decade-header.component.mjs +4 -4
  107. package/esm2022/date-picker/lib/decade/decade-table.component.mjs +4 -4
  108. package/esm2022/date-picker/lib/lib-packer.module.mjs +5 -5
  109. package/esm2022/date-picker/lib/month/month-header.component.mjs +4 -4
  110. package/esm2022/date-picker/lib/month/month-table.component.mjs +4 -4
  111. package/esm2022/date-picker/lib/popups/date-popup.component.mjs +21 -18
  112. package/esm2022/date-picker/lib/popups/inner-popup.component.mjs +6 -6
  113. package/esm2022/date-picker/lib/quarter/quarter-table.component.mjs +4 -4
  114. package/esm2022/date-picker/lib/year/year-header.component.mjs +4 -4
  115. package/esm2022/date-picker/lib/year/year-table.component.mjs +4 -4
  116. package/esm2022/date-picker/month-picker.component.mjs +4 -4
  117. package/esm2022/date-picker/picker.component.mjs +8 -8
  118. package/esm2022/date-picker/picker.pipes.mjs +13 -13
  119. package/esm2022/date-picker/picker.util.mjs +8 -6
  120. package/esm2022/date-picker/picker.validators.mjs +7 -7
  121. package/esm2022/date-picker/quarter-picker.component.mjs +4 -4
  122. package/esm2022/date-picker/range-picker.component.mjs +4 -4
  123. package/esm2022/date-picker/range-picker.directive.mjs +4 -4
  124. package/esm2022/date-picker/week-picker.component.mjs +4 -4
  125. package/esm2022/date-picker/year-picker.component.mjs +4 -4
  126. package/esm2022/date-range/date-range.component.mjs +15 -16
  127. package/esm2022/date-range/module.mjs +5 -5
  128. package/esm2022/date-range/optional-dates/optional-dates.component.mjs +4 -4
  129. package/esm2022/dialog/body/dialog-body.component.mjs +4 -4
  130. package/esm2022/dialog/confirm/confirm.component.mjs +4 -4
  131. package/esm2022/dialog/dialog-container.component.mjs +4 -4
  132. package/esm2022/dialog/dialog.module.mjs +5 -5
  133. package/esm2022/dialog/dialog.service.mjs +4 -4
  134. package/esm2022/dialog/footer/dialog-footer.component.mjs +4 -4
  135. package/esm2022/dialog/header/dialog-header.component.mjs +4 -4
  136. package/esm2022/divider/divider.component.mjs +4 -4
  137. package/esm2022/divider/divider.module.mjs +5 -5
  138. package/esm2022/dot/dot.component.mjs +4 -4
  139. package/esm2022/dot/dot.module.mjs +5 -5
  140. package/esm2022/drag-drop/drag-content.directive.mjs +4 -4
  141. package/esm2022/drag-drop/drag-drop.service.mjs +4 -4
  142. package/esm2022/drag-drop/drag-handle.directive.mjs +4 -4
  143. package/esm2022/drag-drop/drag.directive.mjs +4 -4
  144. package/esm2022/drag-drop/drop-container.directive.mjs +4 -4
  145. package/esm2022/drag-drop/module.mjs +5 -5
  146. package/esm2022/dropdown/dropdown-active.directive.mjs +4 -4
  147. package/esm2022/dropdown/dropdown-menu-item.directive.mjs +22 -22
  148. package/esm2022/dropdown/dropdown-menu.component.mjs +13 -13
  149. package/esm2022/dropdown/dropdown-submenu.component.mjs +4 -4
  150. package/esm2022/dropdown/dropdown.directive.mjs +4 -4
  151. package/esm2022/dropdown/module.mjs +5 -5
  152. package/esm2022/empty/empty.component.mjs +4 -4
  153. package/esm2022/empty/empty.config.mjs +4 -4
  154. package/esm2022/empty/empty.module.mjs +5 -5
  155. package/esm2022/flexible-text/flexible-text.component.mjs +4 -4
  156. package/esm2022/flexible-text/flexible-text.module.mjs +5 -5
  157. package/esm2022/form/form-group-error/form-group-error.component.mjs +4 -4
  158. package/esm2022/form/form-group-label.directive.mjs +4 -4
  159. package/esm2022/form/form-group.component.mjs +4 -4
  160. package/esm2022/form/form-submit.directive.mjs +4 -4
  161. package/esm2022/form/form-validator-loader.mjs +4 -4
  162. package/esm2022/form/form-validator.service.mjs +4 -4
  163. package/esm2022/form/form.directive.mjs +4 -4
  164. package/esm2022/form/from-group-footer/form-group-footer.component.mjs +4 -4
  165. package/esm2022/form/module.mjs +5 -5
  166. package/esm2022/form/validator/confirm-validator.directive.mjs +4 -4
  167. package/esm2022/form/validator/max-validator.directive.mjs +4 -4
  168. package/esm2022/form/validator/min-validator.directive.mjs +4 -4
  169. package/esm2022/form/validator/unique-validator.directive.mjs +4 -4
  170. package/esm2022/fullscreen/fullscreen-launch.directive.mjs +4 -4
  171. package/esm2022/fullscreen/fullscreen.component.mjs +4 -4
  172. package/esm2022/fullscreen/fullscreen.module.mjs +5 -5
  173. package/esm2022/fullscreen/fullscreen.service.mjs +4 -4
  174. package/esm2022/grid/flex.mjs +13 -13
  175. package/esm2022/grid/module.mjs +5 -5
  176. package/esm2022/grid/thy-col.directive.mjs +4 -4
  177. package/esm2022/grid/thy-grid-item.component.mjs +4 -4
  178. package/esm2022/grid/thy-grid.component.mjs +7 -7
  179. package/esm2022/grid/thy-row.directive.mjs +4 -4
  180. package/esm2022/guider/guider-hint/guider-hint.component.mjs +4 -4
  181. package/esm2022/guider/guider-manager.mjs +4 -4
  182. package/esm2022/guider/guider.directive.mjs +4 -4
  183. package/esm2022/guider/guider.module.mjs +5 -5
  184. package/esm2022/guider/guider.service.mjs +4 -4
  185. package/esm2022/i18n/i18n.service.mjs +4 -4
  186. package/esm2022/icon/icon-registry.mjs +5 -5
  187. package/esm2022/icon/icon.component.mjs +4 -4
  188. package/esm2022/icon/icon.module.mjs +6 -7
  189. package/esm2022/image/image-group.component.mjs +4 -4
  190. package/esm2022/image/image.directive.mjs +4 -4
  191. package/esm2022/image/image.service.mjs +4 -4
  192. package/esm2022/image/module.mjs +5 -5
  193. package/esm2022/image/preview/image-preview.component.mjs +4 -4
  194. package/esm2022/input/input-count.component.mjs +4 -4
  195. package/esm2022/input/input-group.component.mjs +4 -4
  196. package/esm2022/input/input-search.component.mjs +4 -4
  197. package/esm2022/input/input.component.mjs +4 -4
  198. package/esm2022/input/input.directive.mjs +4 -4
  199. package/esm2022/input/module.mjs +5 -5
  200. package/esm2022/input-number/input-number.component.mjs +4 -4
  201. package/esm2022/input-number/module.mjs +5 -5
  202. package/esm2022/layout/content-main.component.mjs +7 -7
  203. package/esm2022/layout/content-section.component.mjs +7 -7
  204. package/esm2022/layout/content.component.mjs +7 -7
  205. package/esm2022/layout/header.component.mjs +7 -7
  206. package/esm2022/layout/layout.component.mjs +7 -7
  207. package/esm2022/layout/layout.module.mjs +5 -5
  208. package/esm2022/layout/sidebar-content.component.mjs +7 -7
  209. package/esm2022/layout/sidebar-footer.component.mjs +7 -7
  210. package/esm2022/layout/sidebar-header.component.mjs +7 -7
  211. package/esm2022/layout/sidebar.component.mjs +7 -7
  212. package/esm2022/list/list-item-meta.component.mjs +4 -4
  213. package/esm2022/list/list-item.component.mjs +4 -4
  214. package/esm2022/list/list.component.mjs +4 -4
  215. package/esm2022/list/list.module.mjs +5 -5
  216. package/esm2022/list/selection/selection-list.mjs +4 -4
  217. package/esm2022/loading/loading.component.mjs +4 -4
  218. package/esm2022/loading/loading.module.mjs +5 -5
  219. package/esm2022/mention/mention.directive.mjs +4 -4
  220. package/esm2022/mention/mention.module.mjs +5 -5
  221. package/esm2022/mention/suggestions/suggestions.component.mjs +4 -4
  222. package/esm2022/menu/divider/menu-divider.component.mjs +4 -4
  223. package/esm2022/menu/group/menu-group.component.mjs +4 -4
  224. package/esm2022/menu/item/action/menu-item-action.component.mjs +4 -4
  225. package/esm2022/menu/item/icon/menu-item-icon.component.mjs +4 -4
  226. package/esm2022/menu/item/menu-item.component.mjs +4 -4
  227. package/esm2022/menu/item/name/menu-item-name.component.mjs +4 -4
  228. package/esm2022/menu/menu.component.mjs +4 -4
  229. package/esm2022/menu/menu.module.mjs +5 -5
  230. package/esm2022/message/abstract/abstract-message-container.component.mjs +4 -4
  231. package/esm2022/message/abstract/abstract-message.component.mjs +4 -4
  232. package/esm2022/message/message-container.component.mjs +4 -4
  233. package/esm2022/message/message-queue.service.mjs +4 -4
  234. package/esm2022/message/message.component.mjs +4 -4
  235. package/esm2022/message/message.service.mjs +4 -4
  236. package/esm2022/message/module.mjs +5 -5
  237. package/esm2022/nav/icon-nav/icon-nav-link.directive.mjs +4 -4
  238. package/esm2022/nav/icon-nav/icon-nav.component.mjs +4 -4
  239. package/esm2022/nav/nav-ink-bar.directive.mjs +4 -4
  240. package/esm2022/nav/nav-item.directive.mjs +4 -4
  241. package/esm2022/nav/nav.component.mjs +4 -4
  242. package/esm2022/nav/nav.module.mjs +5 -5
  243. package/esm2022/nav/nav.pipe.mjs +4 -4
  244. package/esm2022/notify/module.mjs +5 -5
  245. package/esm2022/notify/notify-container.component.mjs +4 -4
  246. package/esm2022/notify/notify-queue.service.mjs +4 -4
  247. package/esm2022/notify/notify.component.mjs +4 -4
  248. package/esm2022/notify/notify.service.mjs +4 -4
  249. package/esm2022/pagination/pagination.component.mjs +4 -4
  250. package/esm2022/pagination/pagination.module.mjs +5 -5
  251. package/esm2022/pagination/pagination.pipe.mjs +7 -7
  252. package/esm2022/popover/body/popover-body.component.mjs +4 -4
  253. package/esm2022/popover/header/popover-header.component.mjs +4 -4
  254. package/esm2022/popover/module.mjs +5 -5
  255. package/esm2022/popover/popover-container.component.mjs +4 -4
  256. package/esm2022/popover/popover.directive.mjs +4 -4
  257. package/esm2022/popover/popover.service.mjs +4 -4
  258. package/esm2022/progress/progress-circle.component.mjs +4 -4
  259. package/esm2022/progress/progress-strip.component.mjs +4 -4
  260. package/esm2022/progress/progress.component.mjs +4 -4
  261. package/esm2022/progress/progress.module.mjs +5 -5
  262. package/esm2022/property/module.mjs +5 -5
  263. package/esm2022/property/properties.component.mjs +4 -4
  264. package/esm2022/property/property-item.component.mjs +4 -4
  265. package/esm2022/property-operation/group/property-operation-group.component.mjs +4 -4
  266. package/esm2022/property-operation/module.mjs +5 -5
  267. package/esm2022/property-operation/property-operation.component.mjs +4 -4
  268. package/esm2022/radio/button/radio-button.component.mjs +4 -4
  269. package/esm2022/radio/group/radio-group.component.mjs +4 -4
  270. package/esm2022/radio/module.mjs +5 -5
  271. package/esm2022/radio/radio.component.mjs +4 -4
  272. package/esm2022/rate/module.mjs +5 -5
  273. package/esm2022/rate/rate-item.component.mjs +4 -4
  274. package/esm2022/rate/rate.component.mjs +4 -4
  275. package/esm2022/resizable/module.mjs +5 -5
  276. package/esm2022/resizable/resizable.directive.mjs +4 -4
  277. package/esm2022/resizable/resizable.service.mjs +4 -4
  278. package/esm2022/resizable/resize-handle.component.mjs +4 -4
  279. package/esm2022/resizable/resize-handles.component.mjs +4 -4
  280. package/esm2022/result/result.component.mjs +4 -4
  281. package/esm2022/result/result.module.mjs +5 -5
  282. package/esm2022/segment/segment-item.component.mjs +4 -4
  283. package/esm2022/segment/segment.component.mjs +4 -4
  284. package/esm2022/segment/segment.module.mjs +5 -5
  285. package/esm2022/select/custom-select/custom-select.component.mjs +4 -4
  286. package/esm2022/select/module.mjs +5 -5
  287. package/esm2022/select/native-select/native-select.component.mjs +4 -4
  288. package/esm2022/shared/base-form-check.component.mjs +4 -4
  289. package/esm2022/shared/directives/string-or-template-outlet.directive.mjs +4 -4
  290. package/esm2022/shared/directives/thy-autofocus.directive.mjs +4 -4
  291. package/esm2022/shared/directives/thy-contextmenu.directive.mjs +4 -4
  292. package/esm2022/shared/directives/thy-ctrl-enter.directive.mjs +4 -4
  293. package/esm2022/shared/directives/thy-drag-drop.directive.mjs +4 -4
  294. package/esm2022/shared/directives/thy-enter.directive.mjs +4 -4
  295. package/esm2022/shared/directives/thy-scroll.directive.mjs +4 -4
  296. package/esm2022/shared/directives/thy-show.mjs +4 -4
  297. package/esm2022/shared/directives/thy-stop-propagation.directive.mjs +4 -4
  298. package/esm2022/shared/directives/view-outlet.directive.mjs +4 -4
  299. package/esm2022/shared/ng-transclude.directive.mjs +4 -4
  300. package/esm2022/shared/option/group/option-group.component.mjs +4 -4
  301. package/esm2022/shared/option/list-option/list-option.component.mjs +4 -4
  302. package/esm2022/shared/option/module.mjs +5 -5
  303. package/esm2022/shared/option/option-group.component.mjs +4 -4
  304. package/esm2022/shared/option/option.component.mjs +4 -4
  305. package/esm2022/shared/option/options-container.component.mjs +4 -4
  306. package/esm2022/shared/select/module.mjs +5 -5
  307. package/esm2022/shared/select/select-control/select-control.component.mjs +4 -4
  308. package/esm2022/shared/shared.module.mjs +5 -5
  309. package/esm2022/skeleton/module.mjs +5 -5
  310. package/esm2022/skeleton/skeleton-circle.component.mjs +4 -4
  311. package/esm2022/skeleton/skeleton-rectangle.component.mjs +4 -4
  312. package/esm2022/skeleton/skeleton.component.mjs +4 -4
  313. package/esm2022/skeleton/stylized/bullet-list.component.mjs +4 -4
  314. package/esm2022/skeleton/stylized/list.component.mjs +4 -4
  315. package/esm2022/skeleton/stylized/paragraph.component.mjs +4 -4
  316. package/esm2022/slide/drawer/drawer-container.directive.mjs +4 -4
  317. package/esm2022/slide/slide-body/slide-body-section.component.mjs +4 -4
  318. package/esm2022/slide/slide-body/slide-body.component.mjs +4 -4
  319. package/esm2022/slide/slide-container.component.mjs +4 -4
  320. package/esm2022/slide/slide-footer/slide-footer.component.mjs +4 -4
  321. package/esm2022/slide/slide-header/slide-header.component.mjs +4 -4
  322. package/esm2022/slide/slide-layout/slide-layout.component.mjs +4 -4
  323. package/esm2022/slide/slide-ref.service.mjs +4 -4
  324. package/esm2022/slide/slide.module.mjs +5 -5
  325. package/esm2022/slide/slide.service.mjs +4 -4
  326. package/esm2022/slider/slider.component.mjs +4 -4
  327. package/esm2022/slider/slider.module.mjs +5 -5
  328. package/esm2022/space/space.component.mjs +7 -7
  329. package/esm2022/space/space.module.mjs +5 -5
  330. package/esm2022/statistic/statistic.component.mjs +4 -4
  331. package/esm2022/statistic/statistic.module.mjs +5 -5
  332. package/esm2022/stepper/step-header.component.mjs +4 -4
  333. package/esm2022/stepper/step.component.mjs +4 -4
  334. package/esm2022/stepper/stepper-button.directive.mjs +7 -7
  335. package/esm2022/stepper/stepper.component.mjs +4 -4
  336. package/esm2022/stepper/stepper.module.mjs +5 -5
  337. package/esm2022/strength/strength.component.mjs +4 -4
  338. package/esm2022/strength/strength.module.mjs +5 -5
  339. package/esm2022/switch/switch.component.mjs +4 -4
  340. package/esm2022/switch/switch.module.mjs +5 -5
  341. package/esm2022/table/pipes/drag.pipe.mjs +4 -4
  342. package/esm2022/table/pipes/table.pipe.mjs +4 -4
  343. package/esm2022/table/table-column.component.mjs +4 -4
  344. package/esm2022/table/table-skeleton.component.mjs +4 -4
  345. package/esm2022/table/table.component.mjs +4 -4
  346. package/esm2022/table/table.module.mjs +5 -5
  347. package/esm2022/tabs/tab-content.component.mjs +4 -4
  348. package/esm2022/tabs/tab.component.mjs +4 -4
  349. package/esm2022/tabs/tabs.component.mjs +4 -4
  350. package/esm2022/tabs/tabs.module.mjs +5 -5
  351. package/esm2022/tag/tag.component.mjs +4 -4
  352. package/esm2022/tag/tag.module.mjs +5 -5
  353. package/esm2022/tag/tags.component.mjs +4 -4
  354. package/esm2022/time-picker/inner/inner-time-picker.component.mjs +5 -5
  355. package/esm2022/time-picker/inner/inner-time-picker.config.mjs +4 -4
  356. package/esm2022/time-picker/inner/inner-time-picker.store.mjs +12 -9
  357. package/esm2022/time-picker/time-picker-panel.component.mjs +11 -12
  358. package/esm2022/time-picker/time-picker.component.mjs +17 -19
  359. package/esm2022/time-picker/time-picker.module.mjs +5 -5
  360. package/esm2022/time-picker/time-picker.utils.mjs +14 -8
  361. package/esm2022/timeline/timeline-item.component.mjs +4 -4
  362. package/esm2022/timeline/timeline.component.mjs +4 -4
  363. package/esm2022/timeline/timeline.module.mjs +5 -5
  364. package/esm2022/timeline/timeline.service.mjs +4 -4
  365. package/esm2022/tooltip/tooltip.component.mjs +4 -4
  366. package/esm2022/tooltip/tooltip.directive.mjs +4 -4
  367. package/esm2022/tooltip/tooltip.module.mjs +5 -5
  368. package/esm2022/tooltip/tooltip.service.mjs +4 -4
  369. package/esm2022/transfer/transfer-list.component.mjs +4 -4
  370. package/esm2022/transfer/transfer.component.mjs +4 -4
  371. package/esm2022/transfer/transfer.module.mjs +5 -5
  372. package/esm2022/tree/tree-node.component.mjs +4 -4
  373. package/esm2022/tree/tree.component.mjs +4 -4
  374. package/esm2022/tree/tree.module.mjs +5 -5
  375. package/esm2022/tree/tree.pipe.mjs +4 -4
  376. package/esm2022/tree/tree.service.mjs +4 -4
  377. package/esm2022/tree-select/module.mjs +5 -5
  378. package/esm2022/tree-select/tree-select.component.mjs +7 -7
  379. package/esm2022/typography/bg-color.directive.mjs +4 -4
  380. package/esm2022/typography/module.mjs +5 -5
  381. package/esm2022/typography/text/text.component.mjs +4 -4
  382. package/esm2022/typography/text-color.directive.mjs +4 -4
  383. package/esm2022/upload/file-drop.directive.mjs +4 -4
  384. package/esm2022/upload/file-select-base.mjs +4 -4
  385. package/esm2022/upload/file-select.component.mjs +4 -4
  386. package/esm2022/upload/module.mjs +6 -7
  387. package/esm2022/upload/upload.service.mjs +11 -11
  388. package/esm2022/util/date/functions.mjs +26 -1
  389. package/esm2022/util/date/tiny-date.mjs +78 -34
  390. package/esm2022/util/index.mjs +9 -9
  391. package/esm2022/version.mjs +2 -2
  392. package/esm2022/vote/vote.component.mjs +4 -4
  393. package/esm2022/vote/vote.module.mjs +5 -5
  394. package/esm2022/watermark/watermark.directive.mjs +4 -4
  395. package/esm2022/watermark/watermark.module.mjs +5 -5
  396. package/fesm2022/ngx-tethys-action.mjs +10 -10
  397. package/fesm2022/ngx-tethys-action.mjs.map +1 -1
  398. package/fesm2022/ngx-tethys-affix.mjs +7 -7
  399. package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
  400. package/fesm2022/ngx-tethys-alert.mjs +10 -10
  401. package/fesm2022/ngx-tethys-alert.mjs.map +1 -1
  402. package/fesm2022/ngx-tethys-anchor.mjs +10 -10
  403. package/fesm2022/ngx-tethys-anchor.mjs.map +1 -1
  404. package/fesm2022/ngx-tethys-arrow-switcher.mjs +7 -7
  405. package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
  406. package/fesm2022/ngx-tethys-autocomplete.mjs +16 -16
  407. package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
  408. package/fesm2022/ngx-tethys-avatar.mjs +22 -22
  409. package/fesm2022/ngx-tethys-avatar.mjs.map +1 -1
  410. package/fesm2022/ngx-tethys-back-top.mjs +7 -7
  411. package/fesm2022/ngx-tethys-back-top.mjs.map +1 -1
  412. package/fesm2022/ngx-tethys-badge.mjs +7 -7
  413. package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
  414. package/fesm2022/ngx-tethys-breadcrumb.mjs +10 -10
  415. package/fesm2022/ngx-tethys-breadcrumb.mjs.map +1 -1
  416. package/fesm2022/ngx-tethys-button.mjs +13 -13
  417. package/fesm2022/ngx-tethys-button.mjs.map +1 -1
  418. package/fesm2022/ngx-tethys-calendar.mjs +26 -26
  419. package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
  420. package/fesm2022/ngx-tethys-card.mjs +13 -13
  421. package/fesm2022/ngx-tethys-card.mjs.map +1 -1
  422. package/fesm2022/ngx-tethys-carousel.mjs +84 -84
  423. package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
  424. package/fesm2022/ngx-tethys-cascader.mjs +16 -16
  425. package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
  426. package/fesm2022/ngx-tethys-checkbox.mjs +7 -7
  427. package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
  428. package/fesm2022/ngx-tethys-collapse.mjs +10 -10
  429. package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
  430. package/fesm2022/ngx-tethys-color-picker.mjs +31 -31
  431. package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
  432. package/fesm2022/ngx-tethys-comment.mjs +13 -13
  433. package/fesm2022/ngx-tethys-comment.mjs.map +1 -1
  434. package/fesm2022/ngx-tethys-copy.mjs +7 -7
  435. package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
  436. package/fesm2022/ngx-tethys-core.mjs +23 -23
  437. package/fesm2022/ngx-tethys-core.mjs.map +1 -1
  438. package/fesm2022/ngx-tethys-date-picker.mjs +242 -235
  439. package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
  440. package/fesm2022/ngx-tethys-date-range.mjs +17 -18
  441. package/fesm2022/ngx-tethys-date-range.mjs.map +1 -1
  442. package/fesm2022/ngx-tethys-dialog.mjs +22 -22
  443. package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
  444. package/fesm2022/ngx-tethys-divider.mjs +7 -7
  445. package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
  446. package/fesm2022/ngx-tethys-dot.mjs +7 -7
  447. package/fesm2022/ngx-tethys-dot.mjs.map +1 -1
  448. package/fesm2022/ngx-tethys-drag-drop.mjs +19 -19
  449. package/fesm2022/ngx-tethys-drag-drop.mjs.map +1 -1
  450. package/fesm2022/ngx-tethys-dropdown.mjs +46 -46
  451. package/fesm2022/ngx-tethys-dropdown.mjs.map +1 -1
  452. package/fesm2022/ngx-tethys-empty.mjs +10 -10
  453. package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
  454. package/fesm2022/ngx-tethys-flexible-text.mjs +7 -7
  455. package/fesm2022/ngx-tethys-flexible-text.mjs.map +1 -1
  456. package/fesm2022/ngx-tethys-form.mjs +40 -40
  457. package/fesm2022/ngx-tethys-form.mjs.map +1 -1
  458. package/fesm2022/ngx-tethys-fullscreen.mjs +13 -13
  459. package/fesm2022/ngx-tethys-fullscreen.mjs.map +1 -1
  460. package/fesm2022/ngx-tethys-grid.mjs +31 -31
  461. package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
  462. package/fesm2022/ngx-tethys-guider.mjs +16 -16
  463. package/fesm2022/ngx-tethys-guider.mjs.map +1 -1
  464. package/fesm2022/ngx-tethys-i18n.mjs +3 -3
  465. package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
  466. package/fesm2022/ngx-tethys-icon.mjs +13 -13
  467. package/fesm2022/ngx-tethys-icon.mjs.map +1 -1
  468. package/fesm2022/ngx-tethys-image.mjs +16 -16
  469. package/fesm2022/ngx-tethys-image.mjs.map +1 -1
  470. package/fesm2022/ngx-tethys-input-number.mjs +7 -7
  471. package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
  472. package/fesm2022/ngx-tethys-input.mjs +19 -19
  473. package/fesm2022/ngx-tethys-input.mjs.map +1 -1
  474. package/fesm2022/ngx-tethys-layout.mjs +58 -58
  475. package/fesm2022/ngx-tethys-layout.mjs.map +1 -1
  476. package/fesm2022/ngx-tethys-list.mjs +16 -16
  477. package/fesm2022/ngx-tethys-list.mjs.map +1 -1
  478. package/fesm2022/ngx-tethys-loading.mjs +7 -7
  479. package/fesm2022/ngx-tethys-loading.mjs.map +1 -1
  480. package/fesm2022/ngx-tethys-mention.mjs +10 -10
  481. package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
  482. package/fesm2022/ngx-tethys-menu.mjs +25 -25
  483. package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
  484. package/fesm2022/ngx-tethys-message.mjs +22 -22
  485. package/fesm2022/ngx-tethys-message.mjs.map +1 -1
  486. package/fesm2022/ngx-tethys-nav.mjs +22 -22
  487. package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
  488. package/fesm2022/ngx-tethys-notify.mjs +16 -16
  489. package/fesm2022/ngx-tethys-notify.mjs.map +1 -1
  490. package/fesm2022/ngx-tethys-pagination.mjs +13 -13
  491. package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
  492. package/fesm2022/ngx-tethys-popover.mjs +19 -19
  493. package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
  494. package/fesm2022/ngx-tethys-progress.mjs +13 -13
  495. package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
  496. package/fesm2022/ngx-tethys-property-operation.mjs +10 -10
  497. package/fesm2022/ngx-tethys-property-operation.mjs.map +1 -1
  498. package/fesm2022/ngx-tethys-property.mjs +10 -10
  499. package/fesm2022/ngx-tethys-property.mjs.map +1 -1
  500. package/fesm2022/ngx-tethys-radio.mjs +13 -13
  501. package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
  502. package/fesm2022/ngx-tethys-rate.mjs +10 -10
  503. package/fesm2022/ngx-tethys-rate.mjs.map +1 -1
  504. package/fesm2022/ngx-tethys-resizable.mjs +16 -16
  505. package/fesm2022/ngx-tethys-resizable.mjs.map +1 -1
  506. package/fesm2022/ngx-tethys-result.mjs +7 -7
  507. package/fesm2022/ngx-tethys-result.mjs.map +1 -1
  508. package/fesm2022/ngx-tethys-segment.mjs +10 -10
  509. package/fesm2022/ngx-tethys-segment.mjs.map +1 -1
  510. package/fesm2022/ngx-tethys-select.mjs +10 -10
  511. package/fesm2022/ngx-tethys-select.mjs.map +1 -1
  512. package/fesm2022/ngx-tethys-shared.mjs +66 -66
  513. package/fesm2022/ngx-tethys-shared.mjs.map +1 -1
  514. package/fesm2022/ngx-tethys-skeleton.mjs +22 -22
  515. package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
  516. package/fesm2022/ngx-tethys-slide.mjs +31 -31
  517. package/fesm2022/ngx-tethys-slide.mjs.map +1 -1
  518. package/fesm2022/ngx-tethys-slider.mjs +7 -7
  519. package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
  520. package/fesm2022/ngx-tethys-space.mjs +10 -10
  521. package/fesm2022/ngx-tethys-space.mjs.map +1 -1
  522. package/fesm2022/ngx-tethys-statistic.mjs +7 -7
  523. package/fesm2022/ngx-tethys-statistic.mjs.map +1 -1
  524. package/fesm2022/ngx-tethys-stepper.mjs +19 -19
  525. package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
  526. package/fesm2022/ngx-tethys-strength.mjs +7 -7
  527. package/fesm2022/ngx-tethys-strength.mjs.map +1 -1
  528. package/fesm2022/ngx-tethys-switch.mjs +7 -7
  529. package/fesm2022/ngx-tethys-switch.mjs.map +1 -1
  530. package/fesm2022/ngx-tethys-table.mjs +19 -19
  531. package/fesm2022/ngx-tethys-table.mjs.map +1 -1
  532. package/fesm2022/ngx-tethys-tabs.mjs +13 -13
  533. package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
  534. package/fesm2022/ngx-tethys-tag.mjs +10 -10
  535. package/fesm2022/ngx-tethys-tag.mjs.map +1 -1
  536. package/fesm2022/ngx-tethys-time-picker.mjs +46 -40
  537. package/fesm2022/ngx-tethys-time-picker.mjs.map +1 -1
  538. package/fesm2022/ngx-tethys-timeline.mjs +13 -13
  539. package/fesm2022/ngx-tethys-timeline.mjs.map +1 -1
  540. package/fesm2022/ngx-tethys-tooltip.mjs +13 -13
  541. package/fesm2022/ngx-tethys-tooltip.mjs.map +1 -1
  542. package/fesm2022/ngx-tethys-transfer.mjs +10 -10
  543. package/fesm2022/ngx-tethys-transfer.mjs.map +1 -1
  544. package/fesm2022/ngx-tethys-tree-select.mjs +10 -10
  545. package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
  546. package/fesm2022/ngx-tethys-tree.mjs +16 -16
  547. package/fesm2022/ngx-tethys-tree.mjs.map +1 -1
  548. package/fesm2022/ngx-tethys-typography.mjs +13 -13
  549. package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
  550. package/fesm2022/ngx-tethys-upload.mjs +23 -24
  551. package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
  552. package/fesm2022/ngx-tethys-util.mjs +107 -38
  553. package/fesm2022/ngx-tethys-util.mjs.map +1 -1
  554. package/fesm2022/ngx-tethys-vote.mjs +7 -7
  555. package/fesm2022/ngx-tethys-vote.mjs.map +1 -1
  556. package/fesm2022/ngx-tethys-watermark.mjs +7 -7
  557. package/fesm2022/ngx-tethys-watermark.mjs.map +1 -1
  558. package/fesm2022/ngx-tethys.mjs +1 -1
  559. package/fesm2022/ngx-tethys.mjs.map +1 -1
  560. package/nav/styles/nav.scss +18 -2
  561. package/package.json +3 -2
  562. package/schematics/ng-add/index.js +2 -3
  563. package/schematics/ng-add/index.spec.js +21 -22
  564. package/schematics/ng-update/update-18/index.spec.js +7 -8
  565. package/schematics/testing/test-app.js +2 -5
  566. package/schematics/testing/test-project.js +7 -10
  567. package/schematics/testing/test-workspace.d.ts +1 -0
  568. package/schematics/testing/test-workspace.js +14 -15
  569. package/schematics/tsconfig.json +1 -1
  570. package/schematics/utils/get-workspace-tsconfig.js +8 -9
  571. package/schematics/utils/package-config.js +1 -2
  572. package/schematics/version.d.ts +1 -1
  573. package/schematics/version.js +1 -1
  574. package/time-picker/inner/inner-time-picker.store.d.ts +1 -1
  575. package/util/date/functions.d.ts +25 -0
  576. package/util/date/tiny-date.d.ts +20 -4
  577. package/util/index.d.ts +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-tethys-watermark.mjs","sources":["../../../src/watermark/config.ts","../../../src/watermark/watermark.directive.ts","../../../src/watermark/watermark.module.ts","../../../src/watermark/ngx-tethys-watermark.ts"],"sourcesContent":["export const DEFAULT_WATERMARK_CONFIG = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n opacity: '0.8',\n 'background-repeat': 'repeat',\n 'pointer-events': 'none',\n 'z-index': 2147483647,\n 'background-image': ''\n};\n\nexport const DEFAULT_CANVAS_CONFIG = {\n degree: 15,\n color: ['rgba(51, 51, 51, 0.12)', 'rgb(60, 65, 74)'],\n fontSize: 12,\n textLineHeight: 20,\n gutter: [250, 200]\n};\n","import { Directive, Input, ElementRef, OnInit, SimpleChanges, OnChanges, inject, DestroyRef, effect } from '@angular/core';\nimport { Subject, Observable } from 'rxjs';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { DEFAULT_WATERMARK_CONFIG, DEFAULT_CANVAS_CONFIG } from './config';\nimport { MutationObserverFactory } from '@angular/cdk/observers';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\nimport { ThyThemeStore } from 'ngx-tethys/core';\n\n/**\n * @public\n * 水印样式配置\n */\nexport interface ThyCanvasConfigType {\n /**\n * 偏移角度\n */\n degree?: number;\n /**\n * 字体颜色。如果传的是数组,第一个为默认主题的字体颜色,第二个为黑暗主题的字体颜色\n */\n color?: string | string[];\n /**\n * 字体大小\n */\n fontSize?: number | string;\n /**\n * 文本行高\n */\n textLineHeight?: number;\n /**\n * 横纵间距\n */\n gutter?: number[];\n}\n\n/**\n * 水印指令\n * @name thyWatermark\n */\n@Directive({\n selector: '[thyWatermark]',\n standalone: true\n})\nexport class ThyWatermarkDirective implements OnInit, OnChanges {\n private el = inject(ElementRef);\n\n /**\n * 是否禁用,默认为 false\n */\n @Input({ transform: coerceBooleanProperty })\n thyDisabled: boolean = false;\n\n content: string;\n /**\n * 水印内容\n */\n @Input()\n set thyWatermark(value: string) {\n value = value?.replace(/^\\\"|\\\"$/g, '');\n this.content = !!value ? value : '';\n }\n\n /**\n * 水印样式配置\n */\n @Input() thyCanvasConfig: ThyCanvasConfigType;\n\n private createWatermark$ = new Subject<string>();\n\n private observer: MutationObserver;\n\n private canvas: HTMLCanvasElement;\n\n private wmDiv: HTMLElement;\n\n private readonly destroyRef = inject(DestroyRef);\n\n private thyThemeStore = inject(ThyThemeStore);\n\n constructor() {\n effect(() => {\n if (!this.thyDisabled && this.thyThemeStore.theme()) {\n this.refreshWatermark();\n }\n });\n }\n\n ngOnInit() {\n if (!this.thyDisabled) {\n this.createWatermark$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.observeAttributes()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {});\n });\n\n this.createWatermark();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const { thyWatermark, thyDisabled } = changes;\n const thyWatermarkChange = () => {\n if (thyWatermark.firstChange) return;\n if (thyWatermark.currentValue) {\n this.refreshWatermark();\n }\n };\n const thyDisabledChange = () => {\n if (thyDisabled.firstChange) return;\n thyDisabled?.currentValue ? this.removeWatermark() : this.refreshWatermark();\n };\n thyWatermark && thyWatermarkChange();\n thyDisabled && thyDisabledChange();\n }\n\n private refreshWatermark() {\n this.removeWatermark();\n this.createWatermark();\n }\n\n private removeWatermark() {\n if (this.wmDiv) {\n this.wmDiv.remove();\n this.wmDiv = null;\n }\n }\n\n createCanvas() {\n let { gutter, fontSize, color, degree, textLineHeight } = {\n ...DEFAULT_CANVAS_CONFIG,\n ...(this.thyCanvasConfig || {})\n };\n color = this.thyThemeStore.normalizeColor(color);\n\n const [xGutter, yGutter] = gutter;\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n const getFakeSize = () => {\n const fakeBox = document.createElement('div');\n const fakeBoxStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n display: 'inline-block',\n 'font-size': `${parseFloat('' + fontSize)}px`,\n 'word-wrap': 'break-word',\n 'font-family': 'inherit',\n 'white-space': 'pre-line'\n };\n const styleStr = Object.keys(fakeBoxStyle).reduce((pre, next) => ((pre += `${next}:${fakeBoxStyle[next]};`), pre), '');\n fakeBox.setAttribute('style', styleStr);\n\n fakeBox.innerHTML = this.content.replace(/(\\\\n)/gm, '</br>');\n document.querySelector('body').insertBefore(fakeBox, document.querySelector('body').firstChild);\n const { width, height } = fakeBox.getBoundingClientRect();\n fakeBox.remove();\n return { width, height };\n };\n const { width: fakeBoxWidth, height: fakeBoxHeight } = getFakeSize();\n\n const angle = (degree * Math.PI) / 180;\n const contentArr = this.content.split('\\\\n');\n const canvasHeight = Math.sin(angle) * fakeBoxWidth + fakeBoxHeight;\n\n let start = Math.ceil(Math.sin(angle) * fakeBoxWidth * Math.sin(angle));\n const canvasWidth = start + fakeBoxWidth;\n canvas.setAttribute('width', '' + (canvasWidth + xGutter));\n canvas.setAttribute('height', '' + (canvasHeight + yGutter));\n\n ctx.font = `${parseFloat('' + fontSize)}px microsoft yahei`;\n ctx.textAlign = 'center';\n ctx.textBaseline = 'top';\n ctx.fillStyle = color;\n ctx.rotate(0 - (degree * Math.PI) / 180);\n contentArr.map((k, i) => {\n ctx.fillText(k, -start + Math.ceil(canvasWidth / 2), Math.sin(angle) * canvasWidth + textLineHeight * i);\n start += Math.sin(angle) * textLineHeight;\n });\n this.canvas = canvas;\n return canvas;\n }\n\n private createWatermark(isRefresh = true) {\n const watermarkDiv = this.wmDiv || document.createElement('div');\n\n const background = !isRefresh ? this.canvas.toDataURL() : this.createCanvas().toDataURL();\n const watermarkStyle = {\n ...DEFAULT_WATERMARK_CONFIG,\n 'background-image': `url(${background})`\n };\n\n const styleStr = Object.keys(watermarkStyle).reduce((pre, next) => ((pre += `${next}:${watermarkStyle[next]};`), pre), '');\n watermarkDiv.setAttribute('style', styleStr);\n\n if (!this.wmDiv) {\n const parentNode = this.el.nativeElement;\n watermarkDiv.classList.add(`_vm`);\n this.wmDiv = watermarkDiv;\n parentNode.insertBefore(watermarkDiv, parentNode.firstChild);\n }\n this.createWatermark$.next('');\n }\n\n private observeAttributes() {\n this.observer?.disconnect();\n return new Observable(observe => {\n const stream = new Subject<MutationRecord[]>();\n this.observer = new MutationObserverFactory().create(mutations => stream.next(mutations));\n if (this.observer) {\n this.observer.observe(this.wmDiv, {\n attributes: true\n });\n }\n stream.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n if (this.wmDiv) {\n this?.observer?.disconnect();\n this.createWatermark(false);\n }\n });\n observe.next(stream);\n return () => {\n this.observer?.disconnect();\n };\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ThySharedModule } from 'ngx-tethys/shared';\nimport { ThyWatermarkDirective } from './watermark.directive';\n\n@NgModule({\n imports: [CommonModule, ThySharedModule, ThyWatermarkDirective],\n exports: [ThyWatermarkDirective],\n providers: []\n})\nexport class ThyWatermarkModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAO,MAAM,wBAAwB,GAAG;AACpC,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,GAAG,EAAE,CAAC;AACN,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,KAAK,EAAE,MAAM;AACb,IAAA,MAAM,EAAE,MAAM;AACd,IAAA,OAAO,EAAE,KAAK;AACd,IAAA,mBAAmB,EAAE,QAAQ;AAC7B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EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAJjB,YAAY,EAAE,eAAe,EAAE,qBAAqB,aACpD,qBAAqB,CAAA,EAAA,CAAA,CAAA,EAAA;+GAGtB,kBAAkB,EAAA,OAAA,EAAA,CAJjB,YAAY,EAAE,eAAe,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAI9B,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAL9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,qBAAqB,CAAC;oBAC/D,OAAO,EAAE,CAAC,qBAAqB,CAAC;AAChC,oBAAA,SAAS,EAAE,EAAE;AAChB,iBAAA,CAAA;;;ACTD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-tethys-watermark.mjs","sources":["../../../src/watermark/config.ts","../../../src/watermark/watermark.directive.ts","../../../src/watermark/watermark.module.ts","../../../src/watermark/ngx-tethys-watermark.ts"],"sourcesContent":["export const DEFAULT_WATERMARK_CONFIG = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n opacity: '0.8',\n 'background-repeat': 'repeat',\n 'pointer-events': 'none',\n 'z-index': 2147483647,\n 'background-image': ''\n};\n\nexport const DEFAULT_CANVAS_CONFIG = {\n degree: 15,\n color: ['rgba(51, 51, 51, 0.12)', 'rgb(60, 65, 74)'],\n fontSize: 12,\n textLineHeight: 20,\n gutter: [250, 200]\n};\n","import { Directive, Input, ElementRef, OnInit, SimpleChanges, OnChanges, inject, DestroyRef, effect } from '@angular/core';\nimport { Subject, Observable } from 'rxjs';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { DEFAULT_WATERMARK_CONFIG, DEFAULT_CANVAS_CONFIG } from './config';\nimport { MutationObserverFactory } from '@angular/cdk/observers';\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\nimport { ThyThemeStore } from 'ngx-tethys/core';\n\n/**\n * @public\n * 水印样式配置\n */\nexport interface ThyCanvasConfigType {\n /**\n * 偏移角度\n */\n degree?: number;\n /**\n * 字体颜色。如果传的是数组,第一个为默认主题的字体颜色,第二个为黑暗主题的字体颜色\n */\n color?: string | string[];\n /**\n * 字体大小\n */\n fontSize?: number | string;\n /**\n * 文本行高\n */\n textLineHeight?: number;\n /**\n * 横纵间距\n */\n gutter?: number[];\n}\n\n/**\n * 水印指令\n * @name thyWatermark\n */\n@Directive({\n selector: '[thyWatermark]',\n standalone: true\n})\nexport class ThyWatermarkDirective implements OnInit, OnChanges {\n private el = inject(ElementRef);\n\n /**\n * 是否禁用,默认为 false\n */\n @Input({ transform: coerceBooleanProperty })\n thyDisabled: boolean = false;\n\n content: string;\n /**\n * 水印内容\n */\n @Input()\n set thyWatermark(value: string) {\n value = value?.replace(/^\\\"|\\\"$/g, '');\n this.content = !!value ? value : '';\n }\n\n /**\n * 水印样式配置\n */\n @Input() thyCanvasConfig: ThyCanvasConfigType;\n\n private createWatermark$ = new Subject<string>();\n\n private observer: MutationObserver;\n\n private canvas: HTMLCanvasElement;\n\n private wmDiv: HTMLElement;\n\n private readonly destroyRef = inject(DestroyRef);\n\n private thyThemeStore = inject(ThyThemeStore);\n\n constructor() {\n effect(() => {\n if (!this.thyDisabled && this.thyThemeStore.theme()) {\n this.refreshWatermark();\n }\n });\n }\n\n ngOnInit() {\n if (!this.thyDisabled) {\n this.createWatermark$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.observeAttributes()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {});\n });\n\n this.createWatermark();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const { thyWatermark, thyDisabled } = changes;\n const thyWatermarkChange = () => {\n if (thyWatermark.firstChange) return;\n if (thyWatermark.currentValue) {\n this.refreshWatermark();\n }\n };\n const thyDisabledChange = () => {\n if (thyDisabled.firstChange) return;\n thyDisabled?.currentValue ? this.removeWatermark() : this.refreshWatermark();\n };\n thyWatermark && thyWatermarkChange();\n thyDisabled && thyDisabledChange();\n }\n\n private refreshWatermark() {\n this.removeWatermark();\n this.createWatermark();\n }\n\n private removeWatermark() {\n if (this.wmDiv) {\n this.wmDiv.remove();\n this.wmDiv = null;\n }\n }\n\n createCanvas() {\n let { gutter, fontSize, color, degree, textLineHeight } = {\n ...DEFAULT_CANVAS_CONFIG,\n ...(this.thyCanvasConfig || {})\n };\n color = this.thyThemeStore.normalizeColor(color);\n\n const [xGutter, yGutter] = gutter;\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n const getFakeSize = () => {\n const fakeBox = document.createElement('div');\n const fakeBoxStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n display: 'inline-block',\n 'font-size': `${parseFloat('' + fontSize)}px`,\n 'word-wrap': 'break-word',\n 'font-family': 'inherit',\n 'white-space': 'pre-line'\n };\n const styleStr = Object.keys(fakeBoxStyle).reduce((pre, next) => ((pre += `${next}:${fakeBoxStyle[next]};`), pre), '');\n fakeBox.setAttribute('style', styleStr);\n\n fakeBox.innerHTML = this.content.replace(/(\\\\n)/gm, '</br>');\n document.querySelector('body').insertBefore(fakeBox, document.querySelector('body').firstChild);\n const { width, height } = fakeBox.getBoundingClientRect();\n fakeBox.remove();\n return { width, height };\n };\n const { width: fakeBoxWidth, height: fakeBoxHeight } = getFakeSize();\n\n const angle = (degree * Math.PI) / 180;\n const contentArr = this.content.split('\\\\n');\n const canvasHeight = Math.sin(angle) * fakeBoxWidth + fakeBoxHeight;\n\n let start = Math.ceil(Math.sin(angle) * fakeBoxWidth * Math.sin(angle));\n const canvasWidth = start + fakeBoxWidth;\n canvas.setAttribute('width', '' + (canvasWidth + xGutter));\n canvas.setAttribute('height', '' + (canvasHeight + yGutter));\n\n ctx.font = `${parseFloat('' + fontSize)}px microsoft yahei`;\n ctx.textAlign = 'center';\n ctx.textBaseline = 'top';\n ctx.fillStyle = color;\n ctx.rotate(0 - (degree * Math.PI) / 180);\n contentArr.map((k, i) => {\n ctx.fillText(k, -start + Math.ceil(canvasWidth / 2), Math.sin(angle) * canvasWidth + textLineHeight * i);\n start += Math.sin(angle) * textLineHeight;\n });\n this.canvas = canvas;\n return canvas;\n }\n\n private createWatermark(isRefresh = true) {\n const watermarkDiv = this.wmDiv || document.createElement('div');\n\n const background = !isRefresh ? this.canvas.toDataURL() : this.createCanvas().toDataURL();\n const watermarkStyle = {\n ...DEFAULT_WATERMARK_CONFIG,\n 'background-image': `url(${background})`\n };\n\n const styleStr = Object.keys(watermarkStyle).reduce((pre, next) => ((pre += `${next}:${watermarkStyle[next]};`), pre), '');\n watermarkDiv.setAttribute('style', styleStr);\n\n if (!this.wmDiv) {\n const parentNode = this.el.nativeElement;\n watermarkDiv.classList.add(`_vm`);\n this.wmDiv = watermarkDiv;\n parentNode.insertBefore(watermarkDiv, parentNode.firstChild);\n }\n this.createWatermark$.next('');\n }\n\n private observeAttributes() {\n this.observer?.disconnect();\n return new Observable(observe => {\n const stream = new Subject<MutationRecord[]>();\n this.observer = new MutationObserverFactory().create(mutations => stream.next(mutations));\n if (this.observer) {\n this.observer.observe(this.wmDiv, {\n attributes: true\n });\n }\n stream.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n if (this.wmDiv) {\n this?.observer?.disconnect();\n this.createWatermark(false);\n }\n });\n observe.next(stream);\n return () => {\n this.observer?.disconnect();\n };\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ThySharedModule } from 'ngx-tethys/shared';\nimport { ThyWatermarkDirective } from './watermark.directive';\n\n@NgModule({\n imports: [CommonModule, ThySharedModule, ThyWatermarkDirective],\n exports: [ThyWatermarkDirective],\n providers: []\n})\nexport class ThyWatermarkModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAO,MAAM,wBAAwB,GAAG;AACpC,I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K;;;MCvDG,kBAAkB,CAAA;+GAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAJjB,YAAY,EAAE,eAAe,EAAE,qBAAqB,aACpD,qBAAqB,CAAA,EAAA,CAAA,CAAA,EAAA;gHAGtB,kBAAkB,EAAA,OAAA,EAAA,CAJjB,YAAY,EAAE,eAAe,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAI9B,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAL9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,qBAAqB,CAAC;oBAC/D,OAAO,EAAE,CAAC,qBAAqB,CAAC;AAChC,oBAAA,SAAS,EAAE,EAAE;AAChB,iBAAA,CAAA;;;ACTD;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { Version } from '@angular/core';
2
2
 
3
- const VERSION = new Version('18.2.4');
3
+ const VERSION = new Version('18.2.6');
4
4
 
5
5
  /**
6
6
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-tethys.mjs","sources":["../../../src/version.ts","../../../src/ngx-tethys.ts"],"sourcesContent":["import { Version } from '@angular/core';\n\nexport const VERSION = new Version('18.2.4');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;MAEa,OAAO,GAAG,IAAI,OAAO,CAAC,QAAQ;;ACF3C;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-tethys.mjs","sources":["../../../src/version.ts","../../../src/ngx-tethys.ts"],"sourcesContent":["import { Version } from '@angular/core';\n\nexport const VERSION = new Version('18.2.6');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;MAEa,OAAO,GAAG,IAAI,OAAO,CAAC,QAAQ;;ACF3C;;AAEG;;;;"}
@@ -90,6 +90,7 @@
90
90
  .thy-nav-item {
91
91
  display: flex;
92
92
  align-items: center;
93
+ position: relative;
93
94
  padding: 12px 20px;
94
95
  margin-right: 0;
95
96
  border: 1px solid transparent;
@@ -115,17 +116,32 @@
115
116
  border-bottom-color: variables.$bg-default;
116
117
  border-bottom-width: 2px;
117
118
  border-radius: 8px 8px 0 0;
119
+
120
+ &:first-child {
121
+ margin-left: 20px;
122
+ }
123
+
124
+ &::before,
125
+ &::after {
126
+ border: 1px solid variables.$border-color;
127
+ position: absolute;
128
+ bottom: -2px;
129
+ width: 8px;
130
+ height: 8px;
131
+ content: '';
132
+ }
133
+
118
134
  &::before {
119
135
  left: -8px;
120
136
  border-bottom-right-radius: 8px;
121
137
  border-width: 0 1px 1px 0;
122
- box-shadow: 1px 2px 0 variables.$white;
138
+ box-shadow: 1px 2px 0 variables.$bg-default;
123
139
  }
124
140
  &::after {
125
141
  right: -8px;
126
142
  border-bottom-left-radius: 8px;
127
143
  border-width: 0 0 1px 1px;
128
- box-shadow: -1px 2px 0 variables.$white;
144
+ box-shadow: -1px 2px 0 variables.$bg-default;
129
145
  }
130
146
  }
131
147
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-tethys",
3
- "version": "18.2.4",
3
+ "version": "18.2.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@github.com/atinc/ngx-tethys.git"
@@ -531,7 +531,8 @@
531
531
  "@angular/core": "^18.0.0",
532
532
  "@angular/cdk": "^18.0.0",
533
533
  "@tethys/cdk": "^18.0.0-next.1",
534
- "date-fns": "^2.6.0",
534
+ "date-fns": "4.1.0",
535
+ "@date-fns/tz": "1.2.0",
535
536
  "@tethys/icons": "^1.4.23",
536
537
  "rxjs": "^6.5.4 || ^7.0.0"
537
538
  },
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.main = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const schematics_1 = require("@angular-devkit/schematics");
6
5
  const tasks_1 = require("@angular-devkit/schematics/tasks");
7
6
  const workspace_1 = require("@schematics/angular/utility/workspace");
@@ -35,7 +34,7 @@ function addIconToWorkspace(projectName) {
35
34
  });
36
35
  }
37
36
  function main(options = {}) {
38
- return (host, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
37
+ return async (host, context) => {
39
38
  for (const pkg of Object.keys(dependencies_1.DEPENDENCIES)) {
40
39
  (0, utils_1.addPackageToPackageJson)(host, pkg, dependencies_1.DEPENDENCIES[pkg]);
41
40
  }
@@ -50,6 +49,6 @@ function main(options = {}) {
50
49
  }
51
50
  context.addTask(new tasks_1.NodePackageInstallTask());
52
51
  return (0, schematics_1.chain)([options.icon ? addIconToWorkspace(options.project) : (0, schematics_1.noop)(), addStyleToWorkspace(options.project)]);
53
- });
52
+ };
54
53
  }
55
54
  exports.main = main;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const testing_1 = require("@angular-devkit/schematics/testing");
5
4
  const dependencies_1 = require("../dependencies");
6
5
  const testing_2 = require("../testing");
@@ -11,11 +10,11 @@ describe('ng-add Schematic', () => {
11
10
  const baseOptions = { project: 'ngx-tethys-example' };
12
11
  const schematicRunner = new testing_1.SchematicTestRunner(baseOptions.project, require.resolve('../collection.json'));
13
12
  let workspaceTree;
14
- beforeEach(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
15
- tree = yield (0, testing_2.createTestApp)(schematicRunner, { name: baseOptions.project });
16
- }));
17
- it('should update package.json', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
18
- workspaceTree = yield schematicRunner.runSchematic('ng-add', baseOptions, tree);
13
+ beforeEach(async () => {
14
+ tree = await (0, testing_2.createTestApp)(schematicRunner, { name: baseOptions.project });
15
+ });
16
+ it('should update package.json', async () => {
17
+ workspaceTree = await schematicRunner.runSchematic('ng-add', baseOptions, tree);
19
18
  const packageJson = (0, testing_2.getJsonFileContent)(workspaceTree, '/package.json');
20
19
  const dependencies = packageJson.dependencies;
21
20
  expect(dependencies['date-fns']).toEqual(dependencies_1.DEPENDENCIES['date-fns']);
@@ -23,31 +22,31 @@ describe('ng-add Schematic', () => {
23
22
  expect(dependencies['@angular/cdk']).toEqual(dependencies_1.DEPENDENCIES['@angular/cdk']);
24
23
  expect(dependencies['ngx-tethys']).toEqual(version_1.VERSION);
25
24
  expect(schematicRunner.tasks.some(task => task.name === 'node-package')).toBe(true);
26
- }));
27
- it('should respect version range from CLI ng-add command', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
25
+ });
26
+ it('should respect version range from CLI ng-add command', async () => {
28
27
  // Simulates the behavior of the CLI `ng add` command. The command inserts the
29
28
  // requested package version into the `package.json` before the actual schematic runs.
30
29
  (0, utils_1.addPackageToPackageJson)(tree, 'ngx-tethys', '^9.0.0');
31
- workspaceTree = yield schematicRunner.runSchematic('ng-add', baseOptions, tree);
30
+ workspaceTree = await schematicRunner.runSchematic('ng-add', baseOptions, tree);
32
31
  const packageJson = (0, testing_2.getJsonFileContent)(workspaceTree, '/package.json');
33
32
  const dependencies = packageJson.dependencies;
34
33
  expect(dependencies['ngx-tethys']).toBe('^9.0.0');
35
34
  expect(schematicRunner.tasks.some(task => task.name === 'node-package')).toBe(true);
36
- }));
37
- it(`should add styles`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
38
- workspaceTree = yield schematicRunner.runSchematic('ng-add', baseOptions, tree);
35
+ });
36
+ it(`should add styles`, async () => {
37
+ workspaceTree = await schematicRunner.runSchematic('ng-add', baseOptions, tree);
39
38
  const workspace = (0, testing_2.getJsonFileContent)(workspaceTree, '/angular.json');
40
39
  const existStyle = workspace.projects[baseOptions.project].architect.build.options.styles.includes('./node_modules/ngx-tethys/styles/index.scss');
41
40
  expect(existStyle).toBe(true);
42
- }));
43
- it(`should add styles in [ngx-tethys-chen] project`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
44
- workspaceTree = yield schematicRunner.runSchematic('ng-add', baseOptions, tree);
41
+ });
42
+ it(`should add styles in [ngx-tethys-chen] project`, async () => {
43
+ workspaceTree = await schematicRunner.runSchematic('ng-add', baseOptions, tree);
45
44
  const workspace = (0, testing_2.getJsonFileContent)(workspaceTree, '/angular.json');
46
45
  const existStyle = workspace.projects[baseOptions.project].architect.build.options.styles.includes('./node_modules/ngx-tethys/styles/index.scss');
47
46
  expect(existStyle).toBe(true);
48
- }));
49
- it(`should add icons`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
50
- workspaceTree = yield schematicRunner.runSchematic('ng-add', Object.assign(Object.assign({}, baseOptions), { icon: true }), tree);
47
+ });
48
+ it(`should add icons`, async () => {
49
+ workspaceTree = await schematicRunner.runSchematic('ng-add', { ...baseOptions, icon: true }, tree);
51
50
  const workspace = (0, testing_2.getJsonFileContent)(workspaceTree, '/angular.json');
52
51
  const existIcon = workspace.projects[baseOptions.project].architect.build.options.assets.find(a => typeof a === 'object' && a.input === './node_modules/@tethys/icons');
53
52
  expect(existIcon).toEqual({
@@ -55,9 +54,9 @@ describe('ng-add Schematic', () => {
55
54
  input: './node_modules/@tethys/icons',
56
55
  output: '/assets/icons/'
57
56
  });
58
- }));
59
- it(`should not icons`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
60
- workspaceTree = yield schematicRunner.runSchematic('ng-add', Object.assign(Object.assign({}, baseOptions), { icon: false }), tree);
57
+ });
58
+ it(`should not icons`, async () => {
59
+ workspaceTree = await schematicRunner.runSchematic('ng-add', { ...baseOptions, icon: false }, tree);
61
60
  const workspace = (0, testing_2.getJsonFileContent)(workspaceTree, '/angular.json');
62
61
  const existIcon = workspace.projects[baseOptions.project].architect.build.options.assets.find(a => typeof a === 'object' && a.input === './node_modules/@tethys/icons');
63
62
  expect(existIcon).not.toEqual({
@@ -65,5 +64,5 @@ describe('ng-add Schematic', () => {
65
64
  input: './node_modules/@tethys/icons',
66
65
  output: '/assets/icons/'
67
66
  });
68
- }));
67
+ });
69
68
  });
@@ -1,23 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const testing_1 = require("@angular-devkit/schematics/testing");
5
4
  const testing_2 = require("../../testing");
6
5
  describe('ng-update v18 Schematic', () => {
7
6
  let tree;
8
7
  const schematicRunner = new testing_1.SchematicTestRunner('migrations', require.resolve('../migration-collection.json'));
9
8
  let workspaceTree;
10
- beforeEach(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
9
+ beforeEach(async () => {
11
10
  const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
12
- yield factory.create();
13
- yield factory.addApplication({ name: 'update-18-test' });
11
+ await factory.create();
12
+ await factory.addApplication({ name: 'update-18-test' });
14
13
  tree = factory.getTree();
15
- }));
16
- it('should update to ng v18', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
17
- workspaceTree = yield schematicRunner.runSchematic('migration-v18', undefined, tree);
14
+ });
15
+ it('should update to ng v18', async () => {
16
+ workspaceTree = await schematicRunner.runSchematic('migration-v18', undefined, tree);
18
17
  const file = workspaceTree.get('package.json');
19
18
  expect(file.content.toString()).toBeTruthy();
20
19
  const packageJSON = JSON.parse(file.content.toString());
21
20
  expect(packageJSON['dependencies']['@angular/core']).toContain('^18.');
22
- }));
21
+ });
23
22
  });
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createTestApp = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const test_project_1 = require("./test-project");
6
5
  /** Create a base app used for testing. */
7
- function createTestApp(runner_1) {
8
- return tslib_1.__awaiter(this, arguments, void 0, function* (runner, appOptions = {}, tree) {
9
- return (0, test_project_1.createTestProject)(runner, 'application', appOptions, tree);
10
- });
6
+ async function createTestApp(runner, appOptions = {}, tree) {
7
+ return (0, test_project_1.createTestProject)(runner, 'application', appOptions, tree);
11
8
  }
12
9
  exports.createTestApp = createTestApp;
@@ -8,16 +8,13 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.createTestProject = void 0;
11
- const tslib_1 = require("tslib");
12
11
  /** Create a base project used for testing. */
13
- function createTestProject(runner_1, projectType_1) {
14
- return tslib_1.__awaiter(this, arguments, void 0, function* (runner, projectType, appOptions = {}, tree) {
15
- const workspaceTree = yield runner.runExternalSchematic('@schematics/angular', 'workspace', {
16
- name: 'workspace',
17
- version: '6.0.0',
18
- newProjectRoot: 'projects'
19
- }, tree);
20
- return runner.runExternalSchematic('@schematics/angular', projectType, Object.assign({ name: 'ngx-tethys' }, appOptions), workspaceTree);
21
- });
12
+ async function createTestProject(runner, projectType, appOptions = {}, tree) {
13
+ const workspaceTree = await runner.runExternalSchematic('@schematics/angular', 'workspace', {
14
+ name: 'workspace',
15
+ version: '6.0.0',
16
+ newProjectRoot: 'projects'
17
+ }, tree);
18
+ return runner.runExternalSchematic('@schematics/angular', projectType, { name: 'ngx-tethys', ...appOptions }, workspaceTree);
22
19
  }
23
20
  exports.createTestProject = createTestProject;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
3
4
  export declare class TestWorkspaceFactory {
4
5
  runner: SchematicTestRunner;
@@ -10,23 +10,22 @@ class TestWorkspaceFactory {
10
10
  this.runner = runner;
11
11
  this.hostTree = new schematics_1.HostTree();
12
12
  }
13
- create(options) {
14
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
- this.tree = yield this.runner.runExternalSchematic('@schematics/angular', 'workspace', Object.assign({ name: 'test-workspace', version: '9.0.0', newProjectRoot: 'projects' }, options), this.hostTree);
16
- return this.tree;
17
- });
13
+ async create(options) {
14
+ this.tree = await this.runner.runExternalSchematic('@schematics/angular', 'workspace', {
15
+ name: 'test-workspace',
16
+ version: '9.0.0',
17
+ newProjectRoot: 'projects',
18
+ ...options
19
+ }, this.hostTree);
20
+ return this.tree;
18
21
  }
19
- addApplication(options) {
20
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
21
- this.tree = yield this.runner.runExternalSchematic('@schematics/angular', 'application', options, this.tree);
22
- return this.tree;
23
- });
22
+ async addApplication(options) {
23
+ this.tree = await this.runner.runExternalSchematic('@schematics/angular', 'application', options, this.tree);
24
+ return this.tree;
24
25
  }
25
- addLibrary(options) {
26
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
- this.tree = yield this.runner.runExternalSchematic('@schematics/angular', 'library', options, this.tree);
28
- return this.tree;
29
- });
26
+ async addLibrary(options) {
27
+ this.tree = await this.runner.runExternalSchematic('@schematics/angular', 'library', options, this.tree);
28
+ return this.tree;
30
29
  }
31
30
  addNewFile(templatePath, content) {
32
31
  this.hostTree.create(templatePath, content);
@@ -2,7 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "outDir": "../dist/tethys/schematics",
4
4
  "rootDir": "./",
5
- "target": "ES2015",
5
+ "target": "ES2020",
6
6
  "module": "commonjs",
7
7
  "declaration": true,
8
8
  "strict": false,
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getWorkspaceAllTsconfig = void 0;
4
4
  function getWorkspaceAllTsconfig(json) {
5
- var _a, _b, _c, _d;
6
5
  if (!json || !json.projects) {
7
6
  throw new Error('error angular.json');
8
7
  }
@@ -10,29 +9,29 @@ function getWorkspaceAllTsconfig(json) {
10
9
  for (const projectName in json.projects) {
11
10
  if (Object.prototype.hasOwnProperty.call(json.projects, projectName)) {
12
11
  const projectConfig = json.projects[projectName];
13
- const buildConfig = (_a = projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.architect) === null || _a === void 0 ? void 0 : _a.build;
14
- if ((_b = buildConfig === null || buildConfig === void 0 ? void 0 : buildConfig.options) === null || _b === void 0 ? void 0 : _b.tsConfig) {
12
+ const buildConfig = projectConfig?.architect?.build;
13
+ if (buildConfig?.options?.tsConfig) {
15
14
  list.push(buildConfig.options.tsConfig);
16
15
  }
17
- if (buildConfig === null || buildConfig === void 0 ? void 0 : buildConfig.configurations) {
16
+ if (buildConfig?.configurations) {
18
17
  for (const configName in buildConfig.configurations) {
19
18
  if (Object.prototype.hasOwnProperty.call(buildConfig.configurations, configName)) {
20
19
  const element = buildConfig.configurations[configName];
21
- if (element === null || element === void 0 ? void 0 : element.tsConfig) {
20
+ if (element?.tsConfig) {
22
21
  list.push(element.tsConfig);
23
22
  }
24
23
  }
25
24
  }
26
25
  }
27
- const testConfig = (_c = projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.architect) === null || _c === void 0 ? void 0 : _c.test;
28
- if ((_d = testConfig === null || testConfig === void 0 ? void 0 : testConfig.options) === null || _d === void 0 ? void 0 : _d.tsConfig) {
26
+ const testConfig = projectConfig?.architect?.test;
27
+ if (testConfig?.options?.tsConfig) {
29
28
  list.push(testConfig.options.tsConfig);
30
29
  }
31
- if (testConfig === null || testConfig === void 0 ? void 0 : testConfig.configurations) {
30
+ if (testConfig?.configurations) {
32
31
  for (const configName in testConfig.configurations) {
33
32
  if (Object.prototype.hasOwnProperty.call(testConfig.configurations, configName)) {
34
33
  const element = testConfig.configurations[configName];
35
- if (element === null || element === void 0 ? void 0 : element.tsConfig) {
34
+ if (element?.tsConfig) {
36
35
  list.push(element.tsConfig);
37
36
  }
38
37
  }
@@ -29,11 +29,10 @@ function addPackageToPackageJson(host, pkg, version) {
29
29
  exports.addPackageToPackageJson = addPackageToPackageJson;
30
30
  /** Gets the version of the specified package by looking at the package.json in the given tree. */
31
31
  function getPackageVersionFromPackageJson(tree, name) {
32
- var _a, _b;
33
32
  if (!tree.exists('package.json')) {
34
33
  return null;
35
34
  }
36
35
  const packageJson = JSON.parse(tree.read('package.json').toString('utf8'));
37
- return (_b = (_a = packageJson.dependencies) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : null;
36
+ return packageJson.dependencies?.[name] ?? null;
38
37
  }
39
38
  exports.getPackageVersionFromPackageJson = getPackageVersionFromPackageJson;
@@ -1 +1 @@
1
- export declare const VERSION = "18.2.4";
1
+ export declare const VERSION = "18.2.6";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '18.2.4';
4
+ exports.VERSION = '18.2.6';
@@ -1,5 +1,5 @@
1
1
  import { MiniStore } from 'ngx-tethys/core';
2
- import { TimeChangeEvent, TimePickerComponentState, Time, TimePickerControls } from './inner-time-picker.class';
2
+ import { Time, TimeChangeEvent, TimePickerComponentState, TimePickerControls } from './inner-time-picker.class';
3
3
  import * as i0 from "@angular/core";
4
4
  export interface TimePickerState {
5
5
  value: Date;
@@ -7,6 +7,9 @@ export declare const differenceInWeeks: typeof dateFns.differenceInWeeks;
7
7
  export declare const differenceInHours: typeof dateFns.differenceInHours;
8
8
  export declare const differenceInMinutes: typeof dateFns.differenceInMinutes;
9
9
  export declare const differenceInSeconds: typeof dateFns.differenceInSeconds;
10
+ export declare const differenceInDays: typeof dateFns.differenceInDays;
11
+ export declare const differenceInMonths: typeof dateFns.differenceInMonths;
12
+ export declare const differenceInYears: typeof dateFns.differenceInYears;
10
13
  export declare const isSameDay: typeof dateFns.isSameDay;
11
14
  export declare const isSameHour: typeof dateFns.isSameHour;
12
15
  export declare const isSameMinute: typeof dateFns.isSameMinute;
@@ -17,12 +20,14 @@ export declare const isSameQuarter: typeof dateFns.isSameQuarter;
17
20
  export declare const isToday: typeof dateFns.isToday;
18
21
  export declare const isTomorrow: typeof dateFns.isTomorrow;
19
22
  export declare const isValid: typeof dateFns.isValid;
23
+ export declare const isAfter: typeof dateFns.isAfter;
20
24
  export declare const setYear: typeof dateFns.setYear;
21
25
  export declare const startOfMonth: typeof dateFns.startOfMonth;
22
26
  export declare const startOfWeek: typeof dateFns.startOfWeek;
23
27
  export declare const addMonths: typeof dateFns.addMonths;
24
28
  export declare const addYears: typeof dateFns.addYears;
25
29
  export declare const setDay: typeof dateFns.setDay;
30
+ export declare const setDate: typeof dateFns.setDate;
26
31
  export declare const setMonth: typeof dateFns.setMonth;
27
32
  export declare const setQuarter: typeof dateFns.setQuarter;
28
33
  export declare const getUnixTime: typeof dateFns.getUnixTime;
@@ -30,7 +35,15 @@ export declare const startOfDay: typeof dateFns.startOfDay;
30
35
  export declare const endOfDay: typeof dateFns.endOfDay;
31
36
  export declare const fromUnixTime: typeof dateFns.fromUnixTime;
32
37
  export declare const isWeekend: typeof dateFns.isWeekend;
38
+ export declare const getTime: typeof dateFns.getTime;
39
+ export declare const getDay: typeof dateFns.getDay;
33
40
  export declare const getWeek: typeof dateFns.getWeek;
41
+ export declare const getMonth: typeof dateFns.getMonth;
42
+ export declare const getYear: typeof dateFns.getYear;
43
+ export declare const getDate: typeof dateFns.getDate;
44
+ export declare const getHours: typeof dateFns.getHours;
45
+ export declare const getMinutes: typeof dateFns.getMinutes;
46
+ export declare const getSeconds: typeof dateFns.getSeconds;
34
47
  export declare const getDaysInMonth: typeof dateFns.getDaysInMonth;
35
48
  export declare const addSeconds: typeof dateFns.addSeconds;
36
49
  export declare const addMinutes: typeof dateFns.addMinutes;
@@ -39,10 +52,16 @@ export declare const addWeeks: typeof dateFns.addWeeks;
39
52
  export declare const addQuarters: typeof dateFns.addQuarters;
40
53
  export declare const startOfQuarter: typeof dateFns.startOfQuarter;
41
54
  export declare const startOfYear: typeof dateFns.startOfYear;
55
+ export declare const startOfMinute: typeof dateFns.startOfMinute;
56
+ export declare const startOfHour: typeof dateFns.startOfHour;
57
+ export declare const startOfISOWeek: typeof dateFns.startOfISOWeek;
58
+ export declare const endOfMinute: typeof dateFns.endOfMinute;
59
+ export declare const endOfHour: typeof dateFns.endOfHour;
42
60
  export declare const endOfWeek: typeof dateFns.endOfWeek;
43
61
  export declare const endOfMonth: typeof dateFns.endOfMonth;
44
62
  export declare const endOfQuarter: typeof dateFns.endOfQuarter;
45
63
  export declare const endOfYear: typeof dateFns.endOfYear;
64
+ export declare const endOfISOWeek: typeof dateFns.endOfISOWeek;
46
65
  export declare const format: typeof dateFns.format;
47
66
  export declare const getQuarter: typeof dateFns.getQuarter;
48
67
  export declare const addDays: typeof dateFns.addDays;
@@ -56,3 +75,9 @@ export declare const subWeeks: typeof dateFns.subWeeks;
56
75
  export declare const subMonths: typeof dateFns.subMonths;
57
76
  export declare const subQuarters: typeof dateFns.subQuarters;
58
77
  export declare const subYears: typeof dateFns.subYears;
78
+ export declare const eachDayOfInterval: typeof dateFns.eachDayOfInterval;
79
+ export declare const eachWeekOfInterval: typeof dateFns.eachWeekOfInterval;
80
+ export declare const eachMonthOfInterval: typeof dateFns.eachMonthOfInterval;
81
+ export declare const eachYearOfInterval: typeof dateFns.eachYearOfInterval;
82
+ export declare const eachHourOfInterval: typeof dateFns.eachHourOfInterval;
83
+ export declare const setDefaultOptions: typeof dateFns.setDefaultOptions;
@@ -1,17 +1,24 @@
1
- import { Locale } from 'date-fns';
1
+ import { FirstWeekContainsDate, Locale } from 'date-fns';
2
2
  export type TinyDateCompareGrain = 'decade' | 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second';
3
3
  export type WeekDayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;
4
4
  export type TinyDateType = TinyDate | Date | null;
5
5
  export declare function sortRangeValue(rangeValue: TinyDate[]): TinyDate[];
6
+ export declare const DEFAULT_TIMEZONE = "Asia/Shanghai";
6
7
  export declare class TinyDate implements Record<string, any> {
7
8
  nativeDate: Date;
8
- constructor(date?: Date | string | number);
9
- static fromUnixTime(unixTime: number): TinyDate;
9
+ private useTimeZone;
10
+ protected static defaultTimeZone: string;
11
+ constructor(date?: Date | string | number, zone?: string);
12
+ static setDefaultTimeZone(zone: string): void;
13
+ static utcToZonedTime(value: Date | number, timeZone?: string): Date;
14
+ static createDateInTimeZone(year: number, month: number, day: number, hours: number, minutes: number, seconds: number, timeZone?: string): Date;
15
+ static fromUnixTime(unixTime: number, timeZone?: string): TinyDate;
10
16
  getTime(): number;
11
17
  getDate(): number;
12
18
  getYear(): number;
13
19
  getQuarter(): number;
14
20
  getMonth(): number;
21
+ getFullYear(): number;
15
22
  getWeek(options?: {
16
23
  locale?: Locale;
17
24
  weekStartsOn?: WeekDayIndex;
@@ -31,6 +38,9 @@ export declare class TinyDate implements Record<string, any> {
31
38
  setDay(day: number, options?: {
32
39
  weekStartsOn: WeekDayIndex;
33
40
  }): TinyDate;
41
+ setHours(hours: number): TinyDate;
42
+ setMinutes(minutes: number): TinyDate;
43
+ setSeconds(seconds: number): TinyDate;
34
44
  addYears(amount: number): TinyDate;
35
45
  addQuarters(amount: number): TinyDate;
36
46
  addMonths(amount: number): TinyDate;
@@ -86,7 +96,7 @@ export declare class TinyDate implements Record<string, any> {
86
96
  format(mat: string, options?: {
87
97
  locale?: Locale;
88
98
  weekStartsOn?: WeekDayIndex;
89
- firstWeekContainsDate?: number;
99
+ firstWeekContainsDate?: FirstWeekContainsDate;
90
100
  useAdditionalWeekYearTokens?: boolean;
91
101
  useAdditionalDayOfYearTokens?: boolean;
92
102
  }): string;
@@ -97,4 +107,10 @@ export declare class TinyDate implements Record<string, any> {
97
107
  getUnixTime(): number;
98
108
  compare(date: TinyDateType, grain?: TinyDateCompareGrain, isBefore?: boolean): boolean;
99
109
  private toNativeDate;
110
+ startOfISOWeek(): TinyDate;
111
+ endOfISOWeek(): TinyDate;
112
+ differenceInDays(date: Date): number;
113
+ differenceInHours(date: Date): number;
114
+ subWeeks(amount: number): TinyDate;
115
+ subDays(amount: number): TinyDate;
100
116
  }