@ng-atomic/common 2.0.0 → 3.1.0

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 (267) hide show
  1. package/directives/ios-safari-scroll-buggyfill/package.json +5 -5
  2. package/directives/package.json +5 -5
  3. package/esm2020/directives/index.mjs +2 -0
  4. package/esm2020/directives/ios-safari-scroll-buggyfill/index.mjs +3 -0
  5. package/esm2020/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.directive.mjs +24 -0
  6. package/esm2020/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.module.mjs +26 -0
  7. package/esm2020/directives/ios-safari-scroll-buggyfill/ng-atomic-common-directives-ios-safari-scroll-buggyfill.mjs +5 -0
  8. package/esm2020/directives/ng-atomic-common-directives.mjs +5 -0
  9. package/esm2020/index.mjs +2 -0
  10. package/esm2020/models/action-item.mjs +2 -0
  11. package/esm2020/models/index.mjs +2 -0
  12. package/esm2020/models/menu-item.mjs +2 -0
  13. package/esm2020/models/ng-atomic-common-models.mjs +5 -0
  14. package/esm2020/models/public_api.mjs +3 -0
  15. package/esm2020/ng-atomic-common.mjs +5 -0
  16. package/esm2020/pipes/domain/domain.module.mjs +26 -0
  17. package/esm2020/pipes/domain/domain.pipe.mjs +27 -0
  18. package/esm2020/pipes/domain/index.mjs +3 -0
  19. package/esm2020/pipes/index.mjs +7 -0
  20. package/esm2020/pipes/ng-atomic-common-pipes.mjs +5 -0
  21. package/esm2020/pipes/smart-clamp/index.mjs +3 -0
  22. package/esm2020/pipes/smart-clamp/smart-clamp.module.mjs +26 -0
  23. package/esm2020/pipes/smart-clamp/smart-clamp.pipe.mjs +44 -0
  24. package/esm2020/pipes/smart-exp/index.mjs +3 -0
  25. package/esm2020/pipes/smart-exp/smart-exp.module.mjs +16 -0
  26. package/esm2020/pipes/smart-exp/smart-exp.pipe.mjs +27 -0
  27. package/esm2020/pipes/smart-field/index.mjs +3 -0
  28. package/esm2020/pipes/smart-field/smart-field.module.mjs +26 -0
  29. package/esm2020/pipes/smart-field/smart-field.pipe.mjs +31 -0
  30. package/esm2020/pipes/smart-sort-by/index.mjs +3 -0
  31. package/esm2020/pipes/smart-sort-by/smart-sort-by.module.mjs +26 -0
  32. package/esm2020/pipes/smart-sort-by/smart-sort-by.pipe.mjs +31 -0
  33. package/esm2020/pipes/yen/index.mjs +3 -0
  34. package/esm2020/pipes/yen/yen.module.mjs +26 -0
  35. package/esm2020/pipes/yen/yen.pipe.mjs +17 -0
  36. package/esm2020/services/form/form.service.mjs +38 -0
  37. package/esm2020/services/form/index.mjs +2 -0
  38. package/esm2020/services/index.mjs +5 -0
  39. package/esm2020/services/loading/index.mjs +2 -0
  40. package/esm2020/services/loading/loading.service.mjs +32 -0
  41. package/esm2020/services/ng-atomic-common-services.mjs +5 -0
  42. package/esm2020/services/query-resolver/index.mjs +2 -0
  43. package/esm2020/services/query-resolver/query-resolver.service.mjs +27 -0
  44. package/esm2020/services/snack-bar/index.mjs +3 -0
  45. package/esm2020/services/snack-bar/snack-bar.module.mjs +24 -0
  46. package/esm2020/services/snack-bar/snack-bar.service.mjs +23 -0
  47. package/esm2020/store/entities.page.store.mjs +44 -0
  48. package/esm2020/store/entity.page.store.mjs +40 -0
  49. package/esm2020/store/index.mjs +3 -0
  50. package/esm2020/store/ng-atomic-common-store.mjs +5 -0
  51. package/esm2020/utils/comma/comma.mjs +4 -0
  52. package/esm2020/utils/comma/index.mjs +2 -0
  53. package/esm2020/utils/compare-by-id/compare-by-id.mjs +2 -0
  54. package/esm2020/utils/compare-by-id/index.mjs +2 -0
  55. package/esm2020/utils/date-utils/date-utils.mjs +13 -0
  56. package/esm2020/utils/date-utils/index.mjs +2 -0
  57. package/esm2020/utils/index.mjs +9 -0
  58. package/esm2020/utils/mat-dayjs-date/dayjs-date.adapter.mjs +191 -0
  59. package/esm2020/utils/mat-dayjs-date/dayjs-date.formats.mjs +15 -0
  60. package/esm2020/utils/mat-dayjs-date/dayjs-date.module.mjs +41 -0
  61. package/esm2020/utils/mat-dayjs-date/dayjs-jp-providers.mjs +20 -0
  62. package/esm2020/utils/mat-dayjs-date/index.mjs +5 -0
  63. package/esm2020/utils/ng-atomic-common-utils.mjs +5 -0
  64. package/esm2020/utils/query/index.mjs +2 -0
  65. package/esm2020/utils/query/query.resolver.mjs +97 -0
  66. package/esm2020/utils/smart-exp-transformer/index.mjs +2 -0
  67. package/esm2020/utils/smart-exp-transformer/smart-exp-transformer.mjs +18 -0
  68. package/esm2020/utils/to-object/index.mjs +2 -0
  69. package/esm2020/utils/to-object/to-object.mjs +10 -0
  70. package/fesm2015/{ng-atomic-common-directives-ios-safari-scroll-buggyfill.js → ng-atomic-common-directives-ios-safari-scroll-buggyfill.mjs} +8 -8
  71. package/fesm2015/ng-atomic-common-directives-ios-safari-scroll-buggyfill.mjs.map +1 -0
  72. package/fesm2015/{ng-atomic-common-directives.js → ng-atomic-common-directives.mjs} +8 -8
  73. package/fesm2015/ng-atomic-common-directives.mjs.map +1 -0
  74. package/fesm2015/ng-atomic-common-models.mjs +4 -0
  75. package/fesm2015/ng-atomic-common-models.mjs.map +1 -0
  76. package/fesm2015/ng-atomic-common-pipes.mjs +312 -0
  77. package/fesm2015/ng-atomic-common-pipes.mjs.map +1 -0
  78. package/fesm2015/{ng-atomic-common-services.js → ng-atomic-common-services.mjs} +24 -26
  79. package/fesm2015/ng-atomic-common-services.mjs.map +1 -0
  80. package/fesm2015/{ng-atomic-common-store.js → ng-atomic-common-store.mjs} +1 -1
  81. package/fesm2015/ng-atomic-common-store.mjs.map +1 -0
  82. package/fesm2015/{ng-atomic-common-utils.js → ng-atomic-common-utils.mjs} +9 -9
  83. package/fesm2015/ng-atomic-common-utils.mjs.map +1 -0
  84. package/fesm2015/{ng-atomic-common.js → ng-atomic-common.mjs} +1 -1
  85. package/fesm2015/ng-atomic-common.mjs.map +1 -0
  86. package/fesm2020/ng-atomic-common-directives-ios-safari-scroll-buggyfill.mjs +54 -0
  87. package/fesm2020/ng-atomic-common-directives-ios-safari-scroll-buggyfill.mjs.map +1 -0
  88. package/fesm2020/ng-atomic-common-directives.mjs +54 -0
  89. package/fesm2020/ng-atomic-common-directives.mjs.map +1 -0
  90. package/fesm2020/ng-atomic-common-models.mjs +4 -0
  91. package/fesm2020/ng-atomic-common-models.mjs.map +1 -0
  92. package/{fesm2015/ng-atomic-common-pipes.js → fesm2020/ng-atomic-common-pipes.mjs} +51 -58
  93. package/fesm2020/ng-atomic-common-pipes.mjs.map +1 -0
  94. package/fesm2020/ng-atomic-common-services.mjs +142 -0
  95. package/fesm2020/ng-atomic-common-services.mjs.map +1 -0
  96. package/fesm2020/ng-atomic-common-store.mjs +89 -0
  97. package/fesm2020/ng-atomic-common-store.mjs.map +1 -0
  98. package/fesm2020/ng-atomic-common-utils.mjs +406 -0
  99. package/fesm2020/ng-atomic-common-utils.mjs.map +1 -0
  100. package/fesm2020/ng-atomic-common.mjs +4 -0
  101. package/fesm2020/ng-atomic-common.mjs.map +1 -0
  102. package/models/package.json +5 -5
  103. package/package.json +78 -8
  104. package/pipes/package.json +5 -5
  105. package/services/package.json +5 -5
  106. package/store/package.json +5 -5
  107. package/utils/mat-dayjs-date/dayjs-jp-providers.d.ts +1 -1
  108. package/utils/package.json +5 -5
  109. package/bundles/ng-atomic-common-directives-ios-safari-scroll-buggyfill.umd.js +0 -87
  110. package/bundles/ng-atomic-common-directives-ios-safari-scroll-buggyfill.umd.js.map +0 -1
  111. package/bundles/ng-atomic-common-directives.umd.js +0 -87
  112. package/bundles/ng-atomic-common-directives.umd.js.map +0 -1
  113. package/bundles/ng-atomic-common-models.umd.js +0 -11
  114. package/bundles/ng-atomic-common-models.umd.js.map +0 -1
  115. package/bundles/ng-atomic-common-pipes.umd.js +0 -378
  116. package/bundles/ng-atomic-common-pipes.umd.js.map +0 -1
  117. package/bundles/ng-atomic-common-services.umd.js +0 -526
  118. package/bundles/ng-atomic-common-services.umd.js.map +0 -1
  119. package/bundles/ng-atomic-common-store.umd.js +0 -460
  120. package/bundles/ng-atomic-common-store.umd.js.map +0 -1
  121. package/bundles/ng-atomic-common-utils.umd.js +0 -806
  122. package/bundles/ng-atomic-common-utils.umd.js.map +0 -1
  123. package/bundles/ng-atomic-common.umd.js +0 -11
  124. package/bundles/ng-atomic-common.umd.js.map +0 -1
  125. package/esm2015/directives/index.js +0 -2
  126. package/esm2015/directives/index.js.map +0 -1
  127. package/esm2015/directives/ios-safari-scroll-buggyfill/index.js +0 -3
  128. package/esm2015/directives/ios-safari-scroll-buggyfill/index.js.map +0 -1
  129. package/esm2015/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.directive.js +0 -24
  130. package/esm2015/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.directive.js.map +0 -1
  131. package/esm2015/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.module.js +0 -26
  132. package/esm2015/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.module.js.map +0 -1
  133. package/esm2015/directives/ios-safari-scroll-buggyfill/ng-atomic-common-directives-ios-safari-scroll-buggyfill.js +0 -5
  134. package/esm2015/directives/ios-safari-scroll-buggyfill/ng-atomic-common-directives-ios-safari-scroll-buggyfill.js.map +0 -1
  135. package/esm2015/directives/ng-atomic-common-directives.js +0 -5
  136. package/esm2015/directives/ng-atomic-common-directives.js.map +0 -1
  137. package/esm2015/index.js +0 -2
  138. package/esm2015/index.js.map +0 -1
  139. package/esm2015/models/action-item.js +0 -2
  140. package/esm2015/models/action-item.js.map +0 -1
  141. package/esm2015/models/index.js +0 -2
  142. package/esm2015/models/index.js.map +0 -1
  143. package/esm2015/models/menu-item.js +0 -2
  144. package/esm2015/models/menu-item.js.map +0 -1
  145. package/esm2015/models/ng-atomic-common-models.js +0 -5
  146. package/esm2015/models/ng-atomic-common-models.js.map +0 -1
  147. package/esm2015/models/public_api.js +0 -3
  148. package/esm2015/models/public_api.js.map +0 -1
  149. package/esm2015/ng-atomic-common.js +0 -5
  150. package/esm2015/ng-atomic-common.js.map +0 -1
  151. package/esm2015/pipes/domain/domain.module.js +0 -26
  152. package/esm2015/pipes/domain/domain.module.js.map +0 -1
  153. package/esm2015/pipes/domain/domain.pipe.js +0 -29
  154. package/esm2015/pipes/domain/domain.pipe.js.map +0 -1
  155. package/esm2015/pipes/domain/index.js +0 -3
  156. package/esm2015/pipes/domain/index.js.map +0 -1
  157. package/esm2015/pipes/index.js +0 -7
  158. package/esm2015/pipes/index.js.map +0 -1
  159. package/esm2015/pipes/ng-atomic-common-pipes.js +0 -5
  160. package/esm2015/pipes/ng-atomic-common-pipes.js.map +0 -1
  161. package/esm2015/pipes/smart-clamp/index.js +0 -3
  162. package/esm2015/pipes/smart-clamp/index.js.map +0 -1
  163. package/esm2015/pipes/smart-clamp/smart-clamp.module.js +0 -26
  164. package/esm2015/pipes/smart-clamp/smart-clamp.module.js.map +0 -1
  165. package/esm2015/pipes/smart-clamp/smart-clamp.pipe.js +0 -45
  166. package/esm2015/pipes/smart-clamp/smart-clamp.pipe.js.map +0 -1
  167. package/esm2015/pipes/smart-exp/index.js +0 -3
  168. package/esm2015/pipes/smart-exp/index.js.map +0 -1
  169. package/esm2015/pipes/smart-exp/smart-exp.module.js +0 -16
  170. package/esm2015/pipes/smart-exp/smart-exp.module.js.map +0 -1
  171. package/esm2015/pipes/smart-exp/smart-exp.pipe.js +0 -28
  172. package/esm2015/pipes/smart-exp/smart-exp.pipe.js.map +0 -1
  173. package/esm2015/pipes/smart-field/index.js +0 -3
  174. package/esm2015/pipes/smart-field/index.js.map +0 -1
  175. package/esm2015/pipes/smart-field/smart-field.module.js +0 -26
  176. package/esm2015/pipes/smart-field/smart-field.module.js.map +0 -1
  177. package/esm2015/pipes/smart-field/smart-field.pipe.js +0 -33
  178. package/esm2015/pipes/smart-field/smart-field.pipe.js.map +0 -1
  179. package/esm2015/pipes/smart-sort-by/index.js +0 -3
  180. package/esm2015/pipes/smart-sort-by/index.js.map +0 -1
  181. package/esm2015/pipes/smart-sort-by/smart-sort-by.module.js +0 -26
  182. package/esm2015/pipes/smart-sort-by/smart-sort-by.module.js.map +0 -1
  183. package/esm2015/pipes/smart-sort-by/smart-sort-by.pipe.js +0 -32
  184. package/esm2015/pipes/smart-sort-by/smart-sort-by.pipe.js.map +0 -1
  185. package/esm2015/pipes/yen/index.js +0 -3
  186. package/esm2015/pipes/yen/index.js.map +0 -1
  187. package/esm2015/pipes/yen/yen.module.js +0 -26
  188. package/esm2015/pipes/yen/yen.module.js.map +0 -1
  189. package/esm2015/pipes/yen/yen.pipe.js +0 -17
  190. package/esm2015/pipes/yen/yen.pipe.js.map +0 -1
  191. package/esm2015/services/form/form.service.js +0 -35
  192. package/esm2015/services/form/form.service.js.map +0 -1
  193. package/esm2015/services/form/index.js +0 -2
  194. package/esm2015/services/form/index.js.map +0 -1
  195. package/esm2015/services/index.js +0 -5
  196. package/esm2015/services/index.js.map +0 -1
  197. package/esm2015/services/loading/index.js +0 -2
  198. package/esm2015/services/loading/index.js.map +0 -1
  199. package/esm2015/services/loading/loading.service.js +0 -32
  200. package/esm2015/services/loading/loading.service.js.map +0 -1
  201. package/esm2015/services/ng-atomic-common-services.js +0 -5
  202. package/esm2015/services/ng-atomic-common-services.js.map +0 -1
  203. package/esm2015/services/query-resolver/index.js +0 -2
  204. package/esm2015/services/query-resolver/index.js.map +0 -1
  205. package/esm2015/services/query-resolver/query-resolver.service.js +0 -31
  206. package/esm2015/services/query-resolver/query-resolver.service.js.map +0 -1
  207. package/esm2015/services/snack-bar/index.js +0 -3
  208. package/esm2015/services/snack-bar/index.js.map +0 -1
  209. package/esm2015/services/snack-bar/snack-bar.module.js +0 -24
  210. package/esm2015/services/snack-bar/snack-bar.module.js.map +0 -1
  211. package/esm2015/services/snack-bar/snack-bar.service.js +0 -23
  212. package/esm2015/services/snack-bar/snack-bar.service.js.map +0 -1
  213. package/esm2015/store/entities.page.store.js +0 -44
  214. package/esm2015/store/entities.page.store.js.map +0 -1
  215. package/esm2015/store/entity.page.store.js +0 -41
  216. package/esm2015/store/entity.page.store.js.map +0 -1
  217. package/esm2015/store/index.js +0 -3
  218. package/esm2015/store/index.js.map +0 -1
  219. package/esm2015/store/ng-atomic-common-store.js +0 -5
  220. package/esm2015/store/ng-atomic-common-store.js.map +0 -1
  221. package/esm2015/utils/comma/comma.js +0 -4
  222. package/esm2015/utils/comma/comma.js.map +0 -1
  223. package/esm2015/utils/comma/index.js +0 -2
  224. package/esm2015/utils/comma/index.js.map +0 -1
  225. package/esm2015/utils/compare-by-id/compare-by-id.js +0 -2
  226. package/esm2015/utils/compare-by-id/compare-by-id.js.map +0 -1
  227. package/esm2015/utils/compare-by-id/index.js +0 -2
  228. package/esm2015/utils/compare-by-id/index.js.map +0 -1
  229. package/esm2015/utils/date-utils/date-utils.js +0 -13
  230. package/esm2015/utils/date-utils/date-utils.js.map +0 -1
  231. package/esm2015/utils/date-utils/index.js +0 -2
  232. package/esm2015/utils/date-utils/index.js.map +0 -1
  233. package/esm2015/utils/index.js +0 -9
  234. package/esm2015/utils/index.js.map +0 -1
  235. package/esm2015/utils/mat-dayjs-date/dayjs-date.adapter.js +0 -191
  236. package/esm2015/utils/mat-dayjs-date/dayjs-date.adapter.js.map +0 -1
  237. package/esm2015/utils/mat-dayjs-date/dayjs-date.formats.js +0 -15
  238. package/esm2015/utils/mat-dayjs-date/dayjs-date.formats.js.map +0 -1
  239. package/esm2015/utils/mat-dayjs-date/dayjs-date.module.js +0 -41
  240. package/esm2015/utils/mat-dayjs-date/dayjs-date.module.js.map +0 -1
  241. package/esm2015/utils/mat-dayjs-date/dayjs-jp-providers.js +0 -20
  242. package/esm2015/utils/mat-dayjs-date/dayjs-jp-providers.js.map +0 -1
  243. package/esm2015/utils/mat-dayjs-date/index.js +0 -5
  244. package/esm2015/utils/mat-dayjs-date/index.js.map +0 -1
  245. package/esm2015/utils/ng-atomic-common-utils.js +0 -5
  246. package/esm2015/utils/ng-atomic-common-utils.js.map +0 -1
  247. package/esm2015/utils/query/index.js +0 -2
  248. package/esm2015/utils/query/index.js.map +0 -1
  249. package/esm2015/utils/query/query.resolver.js +0 -100
  250. package/esm2015/utils/query/query.resolver.js.map +0 -1
  251. package/esm2015/utils/smart-exp-transformer/index.js +0 -2
  252. package/esm2015/utils/smart-exp-transformer/index.js.map +0 -1
  253. package/esm2015/utils/smart-exp-transformer/smart-exp-transformer.js +0 -18
  254. package/esm2015/utils/smart-exp-transformer/smart-exp-transformer.js.map +0 -1
  255. package/esm2015/utils/to-object/index.js +0 -2
  256. package/esm2015/utils/to-object/index.js.map +0 -1
  257. package/esm2015/utils/to-object/to-object.js +0 -10
  258. package/esm2015/utils/to-object/to-object.js.map +0 -1
  259. package/fesm2015/ng-atomic-common-directives-ios-safari-scroll-buggyfill.js.map +0 -1
  260. package/fesm2015/ng-atomic-common-directives.js.map +0 -1
  261. package/fesm2015/ng-atomic-common-models.js +0 -4
  262. package/fesm2015/ng-atomic-common-models.js.map +0 -1
  263. package/fesm2015/ng-atomic-common-pipes.js.map +0 -1
  264. package/fesm2015/ng-atomic-common-services.js.map +0 -1
  265. package/fesm2015/ng-atomic-common-store.js.map +0 -1
  266. package/fesm2015/ng-atomic-common-utils.js.map +0 -1
  267. package/fesm2015/ng-atomic-common.js.map +0 -1
@@ -1,806 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('dayjs'), require('@angular/core'), require('@angular/material/core'), require('dayjs/plugin/utc'), require('dayjs/plugin/localeData'), require('dayjs/plugin/localizedFormat'), require('dayjs/plugin/customParseFormat'), require('dayjs/locale/ja'), require('flat')) :
3
- typeof define === 'function' && define.amd ? define('@ng-atomic/common/utils', ['exports', 'dayjs', '@angular/core', '@angular/material/core', 'dayjs/plugin/utc', 'dayjs/plugin/localeData', 'dayjs/plugin/localizedFormat', 'dayjs/plugin/customParseFormat', 'dayjs/locale/ja', 'flat'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["ng-atomic"] = global["ng-atomic"] || {}, global["ng-atomic"].common = global["ng-atomic"].common || {}, global["ng-atomic"].common.utils = {}), global.dayjs, global.ng.core, global.ng.material.core, global.utc, global.localeData, global.LocalizedFormat, global.customParseFormat, null, global.flat));
5
- })(this, (function (exports, dayjs, i0, core, utc, localeData, LocalizedFormat, customParseFormat, ja, flat) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
11
- var n = Object.create(null);
12
- if (e) {
13
- Object.keys(e).forEach(function (k) {
14
- if (k !== 'default') {
15
- var d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: function () { return e[k]; }
19
- });
20
- }
21
- });
22
- }
23
- n["default"] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
28
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
29
- var utc__default = /*#__PURE__*/_interopDefaultLegacy(utc);
30
- var localeData__default = /*#__PURE__*/_interopDefaultLegacy(localeData);
31
- var LocalizedFormat__default = /*#__PURE__*/_interopDefaultLegacy(LocalizedFormat);
32
- var customParseFormat__default = /*#__PURE__*/_interopDefaultLegacy(customParseFormat);
33
-
34
- var comma = function (n) { return n === null ? '0' : n.toLocaleString(); };
35
- var commaStr = function (n, unit) {
36
- if (unit === void 0) { unit = '円'; }
37
- return n < 0 ? "-" + comma(abs(n)) + unit : "" + comma(n) + unit;
38
- };
39
- var abs = function (n) { return Math.abs(n); };
40
-
41
- var compareById = function (a, b) { return parseInt(a.id, 10) - parseInt(b.id, 10); };
42
-
43
- var removeComma = function (str) { return str.replace(/\,/g, ''); };
44
- var DATE_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
45
- var DATE_REGEX = /^[0-9]{4}\/(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])$/;
46
- var DATETIME_REGEX = /^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\+([+-][0-2]\d:[0-5]\d)$/;
47
- var isDateStr = function (str) { return str && !!str.match(DATE_REGEX); };
48
- var isDateTimeStr = function (str) { return str && !!str.match(DATE_REGEX); };
49
- var ISO_REGEX = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/;
50
- var isIsoString = function (str) { return str && !!str.match(ISO_REGEX); };
51
- function timestampToDayjs(timestamp) {
52
- return timestamp ? dayjs__default["default"](timestamp.toDate()) : null;
53
- }
54
-
55
- /*! *****************************************************************************
56
- Copyright (c) Microsoft Corporation.
57
-
58
- Permission to use, copy, modify, and/or distribute this software for any
59
- purpose with or without fee is hereby granted.
60
-
61
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
62
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
63
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
64
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
65
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
66
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
67
- PERFORMANCE OF THIS SOFTWARE.
68
- ***************************************************************************** */
69
- /* global Reflect, Promise */
70
- var extendStatics = function (d, b) {
71
- extendStatics = Object.setPrototypeOf ||
72
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
73
- function (d, b) { for (var p in b)
74
- if (Object.prototype.hasOwnProperty.call(b, p))
75
- d[p] = b[p]; };
76
- return extendStatics(d, b);
77
- };
78
- function __extends(d, b) {
79
- if (typeof b !== "function" && b !== null)
80
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
81
- extendStatics(d, b);
82
- function __() { this.constructor = d; }
83
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
84
- }
85
- var __assign = function () {
86
- __assign = Object.assign || function __assign(t) {
87
- for (var s, i = 1, n = arguments.length; i < n; i++) {
88
- s = arguments[i];
89
- for (var p in s)
90
- if (Object.prototype.hasOwnProperty.call(s, p))
91
- t[p] = s[p];
92
- }
93
- return t;
94
- };
95
- return __assign.apply(this, arguments);
96
- };
97
- function __rest(s, e) {
98
- var t = {};
99
- for (var p in s)
100
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
101
- t[p] = s[p];
102
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
103
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
104
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
105
- t[p[i]] = s[p[i]];
106
- }
107
- return t;
108
- }
109
- function __decorate(decorators, target, key, desc) {
110
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
111
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
112
- r = Reflect.decorate(decorators, target, key, desc);
113
- else
114
- for (var i = decorators.length - 1; i >= 0; i--)
115
- if (d = decorators[i])
116
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
117
- return c > 3 && r && Object.defineProperty(target, key, r), r;
118
- }
119
- function __param(paramIndex, decorator) {
120
- return function (target, key) { decorator(target, key, paramIndex); };
121
- }
122
- function __metadata(metadataKey, metadataValue) {
123
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
124
- return Reflect.metadata(metadataKey, metadataValue);
125
- }
126
- function __awaiter(thisArg, _arguments, P, generator) {
127
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
128
- return new (P || (P = Promise))(function (resolve, reject) {
129
- function fulfilled(value) { try {
130
- step(generator.next(value));
131
- }
132
- catch (e) {
133
- reject(e);
134
- } }
135
- function rejected(value) { try {
136
- step(generator["throw"](value));
137
- }
138
- catch (e) {
139
- reject(e);
140
- } }
141
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
142
- step((generator = generator.apply(thisArg, _arguments || [])).next());
143
- });
144
- }
145
- function __generator(thisArg, body) {
146
- var _ = { label: 0, sent: function () { if (t[0] & 1)
147
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
148
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
149
- function verb(n) { return function (v) { return step([n, v]); }; }
150
- function step(op) {
151
- if (f)
152
- throw new TypeError("Generator is already executing.");
153
- while (_)
154
- try {
155
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
156
- return t;
157
- if (y = 0, t)
158
- op = [op[0] & 2, t.value];
159
- switch (op[0]) {
160
- case 0:
161
- case 1:
162
- t = op;
163
- break;
164
- case 4:
165
- _.label++;
166
- return { value: op[1], done: false };
167
- case 5:
168
- _.label++;
169
- y = op[1];
170
- op = [0];
171
- continue;
172
- case 7:
173
- op = _.ops.pop();
174
- _.trys.pop();
175
- continue;
176
- default:
177
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
178
- _ = 0;
179
- continue;
180
- }
181
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
182
- _.label = op[1];
183
- break;
184
- }
185
- if (op[0] === 6 && _.label < t[1]) {
186
- _.label = t[1];
187
- t = op;
188
- break;
189
- }
190
- if (t && _.label < t[2]) {
191
- _.label = t[2];
192
- _.ops.push(op);
193
- break;
194
- }
195
- if (t[2])
196
- _.ops.pop();
197
- _.trys.pop();
198
- continue;
199
- }
200
- op = body.call(thisArg, _);
201
- }
202
- catch (e) {
203
- op = [6, e];
204
- y = 0;
205
- }
206
- finally {
207
- f = t = 0;
208
- }
209
- if (op[0] & 5)
210
- throw op[1];
211
- return { value: op[0] ? op[1] : void 0, done: true };
212
- }
213
- }
214
- var __createBinding = Object.create ? (function (o, m, k, k2) {
215
- if (k2 === undefined)
216
- k2 = k;
217
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
218
- }) : (function (o, m, k, k2) {
219
- if (k2 === undefined)
220
- k2 = k;
221
- o[k2] = m[k];
222
- });
223
- function __exportStar(m, o) {
224
- for (var p in m)
225
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
226
- __createBinding(o, m, p);
227
- }
228
- function __values(o) {
229
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
230
- if (m)
231
- return m.call(o);
232
- if (o && typeof o.length === "number")
233
- return {
234
- next: function () {
235
- if (o && i >= o.length)
236
- o = void 0;
237
- return { value: o && o[i++], done: !o };
238
- }
239
- };
240
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
241
- }
242
- function __read(o, n) {
243
- var m = typeof Symbol === "function" && o[Symbol.iterator];
244
- if (!m)
245
- return o;
246
- var i = m.call(o), r, ar = [], e;
247
- try {
248
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
249
- ar.push(r.value);
250
- }
251
- catch (error) {
252
- e = { error: error };
253
- }
254
- finally {
255
- try {
256
- if (r && !r.done && (m = i["return"]))
257
- m.call(i);
258
- }
259
- finally {
260
- if (e)
261
- throw e.error;
262
- }
263
- }
264
- return ar;
265
- }
266
- /** @deprecated */
267
- function __spread() {
268
- for (var ar = [], i = 0; i < arguments.length; i++)
269
- ar = ar.concat(__read(arguments[i]));
270
- return ar;
271
- }
272
- /** @deprecated */
273
- function __spreadArrays() {
274
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
275
- s += arguments[i].length;
276
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
277
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
278
- r[k] = a[j];
279
- return r;
280
- }
281
- function __spreadArray(to, from, pack) {
282
- if (pack || arguments.length === 2)
283
- for (var i = 0, l = from.length, ar; i < l; i++) {
284
- if (ar || !(i in from)) {
285
- if (!ar)
286
- ar = Array.prototype.slice.call(from, 0, i);
287
- ar[i] = from[i];
288
- }
289
- }
290
- return to.concat(ar || Array.prototype.slice.call(from));
291
- }
292
- function __await(v) {
293
- return this instanceof __await ? (this.v = v, this) : new __await(v);
294
- }
295
- function __asyncGenerator(thisArg, _arguments, generator) {
296
- if (!Symbol.asyncIterator)
297
- throw new TypeError("Symbol.asyncIterator is not defined.");
298
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
299
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
300
- function verb(n) { if (g[n])
301
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
302
- function resume(n, v) { try {
303
- step(g[n](v));
304
- }
305
- catch (e) {
306
- settle(q[0][3], e);
307
- } }
308
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
309
- function fulfill(value) { resume("next", value); }
310
- function reject(value) { resume("throw", value); }
311
- function settle(f, v) { if (f(v), q.shift(), q.length)
312
- resume(q[0][0], q[0][1]); }
313
- }
314
- function __asyncDelegator(o) {
315
- var i, p;
316
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
317
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
318
- }
319
- function __asyncValues(o) {
320
- if (!Symbol.asyncIterator)
321
- throw new TypeError("Symbol.asyncIterator is not defined.");
322
- var m = o[Symbol.asyncIterator], i;
323
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
324
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
325
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
326
- }
327
- function __makeTemplateObject(cooked, raw) {
328
- if (Object.defineProperty) {
329
- Object.defineProperty(cooked, "raw", { value: raw });
330
- }
331
- else {
332
- cooked.raw = raw;
333
- }
334
- return cooked;
335
- }
336
- ;
337
- var __setModuleDefault = Object.create ? (function (o, v) {
338
- Object.defineProperty(o, "default", { enumerable: true, value: v });
339
- }) : function (o, v) {
340
- o["default"] = v;
341
- };
342
- function __importStar(mod) {
343
- if (mod && mod.__esModule)
344
- return mod;
345
- var result = {};
346
- if (mod != null)
347
- for (var k in mod)
348
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
349
- __createBinding(result, mod, k);
350
- __setModuleDefault(result, mod);
351
- return result;
352
- }
353
- function __importDefault(mod) {
354
- return (mod && mod.__esModule) ? mod : { default: mod };
355
- }
356
- function __classPrivateFieldGet(receiver, state, kind, f) {
357
- if (kind === "a" && !f)
358
- throw new TypeError("Private accessor was defined without a getter");
359
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
360
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
361
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
362
- }
363
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
364
- if (kind === "m")
365
- throw new TypeError("Private method is not writable");
366
- if (kind === "a" && !f)
367
- throw new TypeError("Private accessor was defined without a setter");
368
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
369
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
370
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
371
- }
372
-
373
- /** InjectionToken for Dayjs date adapter to configure options. */
374
- var MAT_DAYJS_DATE_ADAPTER_OPTIONS = new i0.InjectionToken('MAT_DAYJS_DATE_ADAPTER_OPTIONS', {
375
- providedIn: 'root',
376
- factory: MAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY
377
- });
378
- function MAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY() {
379
- return {
380
- useUtc: false
381
- };
382
- }
383
- /** Creates an array and fills it with values. */
384
- function range(length, valueFunction) {
385
- var valuesArray = Array(length);
386
- for (var i = 0; i < length; i++) {
387
- valuesArray[i] = valueFunction(i);
388
- }
389
- return valuesArray;
390
- }
391
- /** Adapts Dayjs Dates for use with Angular Material. */
392
- exports.DayjsDateAdapter = /** @class */ (function (_super) {
393
- __extends(DayjsDateAdapter, _super);
394
- function DayjsDateAdapter(dateLocale, options) {
395
- var _this = _super.call(this) || this;
396
- _this.dateLocale = dateLocale;
397
- _this.options = options;
398
- _this.initializeParser(dateLocale);
399
- return _this;
400
- }
401
- // TODO: Implement
402
- DayjsDateAdapter.prototype.setLocale = function (locale) {
403
- var _this = this;
404
- _super.prototype.setLocale.call(this, locale);
405
- var dayJsLocaleData = this.dayJs().localeData();
406
- this.localeData = {
407
- firstDayOfWeek: dayJsLocaleData.firstDayOfWeek(),
408
- longMonths: dayJsLocaleData.months(),
409
- shortMonths: dayJsLocaleData.monthsShort(),
410
- dates: range(31, function (i) { return _this.createDate(2017, 0, i + 1).format('D'); }),
411
- longDaysOfWeek: range(7, function (i) { return _this.dayJs().set('day', i).format('dddd'); }),
412
- shortDaysOfWeek: dayJsLocaleData.weekdaysShort(),
413
- narrowDaysOfWeek: dayJsLocaleData.weekdaysMin(),
414
- };
415
- };
416
- DayjsDateAdapter.prototype.getYear = function (date) {
417
- return this.dayJs(date).year();
418
- };
419
- DayjsDateAdapter.prototype.getMonth = function (date) {
420
- return this.dayJs(date).month();
421
- };
422
- DayjsDateAdapter.prototype.getDate = function (date) {
423
- return this.dayJs(date).date();
424
- };
425
- DayjsDateAdapter.prototype.getDayOfWeek = function (date) {
426
- return this.dayJs(date).day();
427
- };
428
- DayjsDateAdapter.prototype.getMonthNames = function (style) {
429
- return style === 'long' ? this.localeData.longMonths : this.localeData.shortMonths;
430
- };
431
- DayjsDateAdapter.prototype.getDateNames = function () {
432
- return this.localeData.dates;
433
- };
434
- DayjsDateAdapter.prototype.getDayOfWeekNames = function (style) {
435
- if (style === 'long') {
436
- return this.localeData.longDaysOfWeek;
437
- }
438
- if (style === 'short') {
439
- return this.localeData.shortDaysOfWeek;
440
- }
441
- return this.localeData.narrowDaysOfWeek;
442
- };
443
- DayjsDateAdapter.prototype.getYearName = function (date) {
444
- return this.dayJs(date).format('YYYY');
445
- };
446
- DayjsDateAdapter.prototype.getFirstDayOfWeek = function () {
447
- return this.localeData.firstDayOfWeek;
448
- };
449
- DayjsDateAdapter.prototype.getNumDaysInMonth = function (date) {
450
- return this.dayJs(date).daysInMonth();
451
- };
452
- DayjsDateAdapter.prototype.clone = function (date) {
453
- return date.clone();
454
- };
455
- DayjsDateAdapter.prototype.createDate = function (year, month, date) {
456
- var returnDayjs = this.dayJs()
457
- .set('year', year)
458
- .set('month', month)
459
- .set('date', date);
460
- return returnDayjs;
461
- };
462
- DayjsDateAdapter.prototype.today = function () {
463
- return this.dayJs();
464
- };
465
- DayjsDateAdapter.prototype.parse = function (value, parseFormat) {
466
- if (value && typeof value === 'string') {
467
- return this.dayJs(value, dayjs__default["default"]().localeData().longDateFormat(parseFormat), this.locale);
468
- }
469
- return value ? this.dayJs(value).locale(this.locale) : null;
470
- };
471
- DayjsDateAdapter.prototype.format = function (date, displayFormat) {
472
- if (!this.isValid(date)) {
473
- throw Error('DayjsDateAdapter: Cannot format invalid date.');
474
- }
475
- return date.locale(this.locale).format(displayFormat);
476
- };
477
- DayjsDateAdapter.prototype.addCalendarYears = function (date, years) {
478
- return date.add(years, 'year');
479
- };
480
- DayjsDateAdapter.prototype.addCalendarMonths = function (date, months) {
481
- return date.add(months, 'month');
482
- };
483
- DayjsDateAdapter.prototype.addCalendarDays = function (date, days) {
484
- return date.add(days, 'day');
485
- };
486
- DayjsDateAdapter.prototype.toIso8601 = function (date) {
487
- return date.toISOString();
488
- };
489
- /**
490
- * Attempts to deserialize a value to a valid date object. This is different from parsing in that
491
- * deserialize should only accept non-ambiguous, locale-independent formats (e.g. a ISO 8601
492
- * string). The default implementation does not allow any deserialization, it simply checks that
493
- * the given value is already a valid date object or null. The `<mat-datepicker>` will call this
494
- * method on all of it's `@Input()` properties that accept dates. It is therefore possible to
495
- * support passing values from your backend directly to these properties by overriding this method
496
- * to also deserialize the format used by your backend.
497
- * @param value The value to be deserialized into a date object.
498
- * @returns The deserialized date object, either a valid date, null if the value can be
499
- * deserialized into a null date (e.g. the empty string), or an invalid date.
500
- */
501
- DayjsDateAdapter.prototype.deserialize = function (value) {
502
- var date;
503
- if (value instanceof Date) {
504
- date = this.dayJs(value);
505
- }
506
- else if (this.isDateInstance(value)) {
507
- // NOTE: assumes that cloning also sets the correct locale.
508
- return this.clone(value);
509
- }
510
- if (typeof value === 'string') {
511
- if (!value) {
512
- return null;
513
- }
514
- date = this.dayJs(value).toISOString();
515
- }
516
- if (date && this.isValid(date)) {
517
- return this.dayJs(date); // NOTE: Is this necessary since Dayjs is immutable and Moment was not?
518
- }
519
- return _super.prototype.deserialize.call(this, value);
520
- };
521
- DayjsDateAdapter.prototype.isDateInstance = function (obj) {
522
- return dayjs__default["default"].isDayjs(obj);
523
- };
524
- DayjsDateAdapter.prototype.isValid = function (date) {
525
- return this.dayJs(date).isValid();
526
- };
527
- DayjsDateAdapter.prototype.invalid = function () {
528
- return this.dayJs(null);
529
- };
530
- DayjsDateAdapter.prototype.dayJs = function (input, format, locale) {
531
- if (!this.shouldUseUtc) {
532
- return dayjs__default["default"](input, { format: format, locale: locale }, locale);
533
- }
534
- return dayjs__default["default"](input, { format: format, locale: locale, utc: this.shouldUseUtc }, locale).utc();
535
- };
536
- Object.defineProperty(DayjsDateAdapter.prototype, "shouldUseUtc", {
537
- get: function () {
538
- var useUtc = (this.options || {}).useUtc;
539
- return !!useUtc;
540
- },
541
- enumerable: false,
542
- configurable: true
543
- });
544
- DayjsDateAdapter.prototype.initializeParser = function (dateLocale) {
545
- if (this.shouldUseUtc) {
546
- dayjs__default["default"].extend(utc__default["default"]);
547
- }
548
- dayjs__default["default"].extend(LocalizedFormat__default["default"]);
549
- dayjs__default["default"].extend(customParseFormat__default["default"]);
550
- dayjs__default["default"].extend(localeData__default["default"]);
551
- this.setLocale(dateLocale);
552
- };
553
- return DayjsDateAdapter;
554
- }(core.DateAdapter));
555
- exports.DayjsDateAdapter = __decorate([
556
- __param(0, i0.Optional()),
557
- __param(0, i0.Inject(core.MAT_DATE_LOCALE)),
558
- __param(1, i0.Optional()),
559
- __param(1, i0.Inject(MAT_DAYJS_DATE_ADAPTER_OPTIONS)),
560
- __metadata("design:paramtypes", [String, Object])
561
- ], exports.DayjsDateAdapter);
562
-
563
- /**
564
- * Custom Date-Formats and Adapter (using https://github.com/iamkun/dayjs)
565
- */
566
- var MAT_DAYJS_DATE_FORMATS = {
567
- parse: {
568
- dateInput: 'MM/DD/YYYY',
569
- },
570
- display: {
571
- dateInput: 'MM/DD/YYYY',
572
- monthYearLabel: 'MMM YYYY',
573
- dateA11yLabel: 'LL',
574
- monthYearA11yLabel: 'MMMM YYYY',
575
- }
576
- };
577
-
578
- dayjs__default["default"].locale('ja');
579
- var MAT_DAYJS_DATE_FORMATS_FOR_JP = {
580
- parse: {
581
- dateInput: 'YYYY/MM/DD',
582
- },
583
- display: {
584
- dateInput: 'YYYY/MM/DD',
585
- monthYearLabel: 'MMM YYYY',
586
- dateA11yLabel: 'LL',
587
- monthYearA11yLabel: 'MMMM YYYY',
588
- }
589
- };
590
- var MAT_DAYJS_JP_PROVIDERS = [
591
- { provide: core.MAT_DATE_LOCALE, useValue: 'ja' },
592
- { provide: core.MAT_DATE_FORMATS, useValue: MAT_DAYJS_DATE_FORMATS_FOR_JP },
593
- ];
594
-
595
- var DayjsDateModule = /** @class */ (function () {
596
- function DayjsDateModule() {
597
- }
598
- return DayjsDateModule;
599
- }());
600
- DayjsDateModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: DayjsDateModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
601
- DayjsDateModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: DayjsDateModule });
602
- DayjsDateModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: DayjsDateModule, providers: [
603
- {
604
- provide: core.DateAdapter,
605
- useClass: exports.DayjsDateAdapter,
606
- deps: [core.MAT_DATE_LOCALE, MAT_DAYJS_DATE_ADAPTER_OPTIONS]
607
- },
608
- ] });
609
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: DayjsDateModule, decorators: [{
610
- type: i0.NgModule,
611
- args: [{
612
- providers: [
613
- {
614
- provide: core.DateAdapter,
615
- useClass: exports.DayjsDateAdapter,
616
- deps: [core.MAT_DATE_LOCALE, MAT_DAYJS_DATE_ADAPTER_OPTIONS]
617
- },
618
- ],
619
- }]
620
- }] });
621
- var MatDayjsDateModule = /** @class */ (function () {
622
- function MatDayjsDateModule() {
623
- }
624
- return MatDayjsDateModule;
625
- }());
626
- MatDayjsDateModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: MatDayjsDateModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
627
- MatDayjsDateModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: MatDayjsDateModule, imports: [DayjsDateModule] });
628
- MatDayjsDateModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: MatDayjsDateModule, providers: [{ provide: core.MAT_DATE_FORMATS, useValue: MAT_DAYJS_DATE_FORMATS }], imports: [[DayjsDateModule]] });
629
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: MatDayjsDateModule, decorators: [{
630
- type: i0.NgModule,
631
- args: [{
632
- imports: [DayjsDateModule],
633
- providers: [{ provide: core.MAT_DATE_FORMATS, useValue: MAT_DAYJS_DATE_FORMATS }],
634
- }]
635
- }] });
636
-
637
- var SMART_EXP_TRANSFORMER = new i0.InjectionToken('[@ng-atomic/common] Smart Transformer');
638
- // export const yenTransform = (value: number, _unit?: string): string => {
639
- // return value < 1 ? `${comma(value * 100)}%` : `${comma(value)}円`;
640
- // }
641
- var yenTransform = function (value, _unit) {
642
- return comma(value) + "\u5186";
643
- };
644
- var smartExpTransformer = function (input) { return dayjs__default["default"].isDayjs(input)
645
- ? input.format('YY/MM/DD')
646
- : Array.isArray(input)
647
- ? input.length + "\u500B\u306E\u30A2\u30A4\u30C6\u30E0"
648
- : typeof input === 'number'
649
- ? yenTransform(input)
650
- : input; };
651
-
652
- var getAllProps = function (obj, keys) {
653
- if (keys === void 0) { keys = Object.keys(obj); }
654
- var proto = Object.getPrototypeOf(obj);
655
- keys = Object.getOwnPropertyNames(proto)
656
- .filter(function (v) { return v !== '__proto__'; })
657
- .filter(function (v) { return Object.getOwnPropertyDescriptor(proto, v).get instanceof Function; })
658
- .concat(keys);
659
- return proto.constructor.name === 'Object' ? keys : getAllProps(proto, keys);
660
- };
661
- var toObject = function (obj) { return getAllProps(obj).reduce(function (p, k) {
662
- var _a;
663
- return (Object.assign(Object.assign({}, p), (_a = {}, _a[k] = obj[k], _a)));
664
- }, {}); };
665
-
666
- var filterByQuery = function (items, queryString, dlm, transformer) {
667
- if (dlm === void 0) { dlm = {}; }
668
- if (transformer === void 0) { transformer = smartExpTransformer; }
669
- return new QueryResolver(dlm, transformer).resolve(items, queryString);
670
- };
671
- var QueryResolver = /** @class */ (function () {
672
- function QueryResolver(map, transformer) {
673
- var _this = this;
674
- this.transformer = transformer;
675
- this.inQueryByKey = function (items, query) {
676
- var _a, _b;
677
- var _d = __read(_this.parseQuery(query), 3), not = _d[0], _key = _d[1], value = _d[2];
678
- var key = (_b = (_a = _this.REVERSED_MAP) === null || _a === void 0 ? void 0 : _a[_key]) !== null && _b !== void 0 ? _b : _key;
679
- return items.filter(function (item) { var _a; return _not(_this.in(key, (_a = flat.flatten(toObject(item))) === null || _a === void 0 ? void 0 : _a[key], value), not); });
680
- };
681
- this.gtQueryByKey = function (items, query) {
682
- var _a, _b;
683
- var _d = __read(query.split('>'), 2), _key = _d[0], value = _d[1];
684
- var key = (_b = (_a = _this.REVERSED_MAP) === null || _a === void 0 ? void 0 : _a[_key]) !== null && _b !== void 0 ? _b : _key;
685
- return items.filter(function (item) {
686
- var _a, _b, _c;
687
- // TODO(nontangent): flattenしたときにdayjsが壊れる
688
- var v = (_b = (_a = flat.flatten(toObject(item))) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : (_c = toObject(item)) === null || _c === void 0 ? void 0 : _c[key];
689
- return _this.gt(key, v, value);
690
- });
691
- };
692
- this.ltQueryByKey = function (items, query) {
693
- var _a, _b;
694
- var _d = __read(query.split('<'), 2), _key = _d[0], value = _d[1];
695
- var key = (_b = (_a = _this.REVERSED_MAP) === null || _a === void 0 ? void 0 : _a[_key]) !== null && _b !== void 0 ? _b : _key;
696
- return items.filter(function (item) {
697
- var _a, _b, _c;
698
- // TODO(nontangent): flattenしたときにdayjsが壊れる
699
- var v = (_b = (_a = flat.flatten(toObject(item))) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : (_c = toObject(item)) === null || _c === void 0 ? void 0 : _c[key];
700
- return _this.lt(key, v, value);
701
- });
702
- };
703
- this.inQuery = function (items, q) {
704
- return items.filter(function (item) { return Object.entries(flat.flatten(toObject(item))).some(function (_d) {
705
- var _e = __read(_d, 2), k = _e[0], v = _e[1];
706
- return _this.in(k, v, q);
707
- }); });
708
- };
709
- this.REVERSED_MAP = Object.entries(map).reduce(function (p, _d) {
710
- var _e;
711
- var _f = __read(_d, 2), k = _f[0], v = _f[1];
712
- return (Object.assign(Object.assign({}, p), (_e = {}, _e[v] = k, _e)));
713
- }, {});
714
- }
715
- QueryResolver.prototype.resolve = function (items, queryString) {
716
- return this.resolveQueries(items, queryString.split(' ').filter(function (q) { return q.length; }));
717
- };
718
- QueryResolver.prototype.resolveQueries = function (items, queries) {
719
- var _this = this;
720
- return queries.reduce(function (_items, query) {
721
- if (query.includes(':'))
722
- return _this.inQueryByKey(_items, query);
723
- if (query.includes('='))
724
- return _this.inQueryByKey(_items, query);
725
- if (query.includes('>'))
726
- return _this.gtQueryByKey(_items, query);
727
- if (query.includes('<'))
728
- return _this.ltQueryByKey(_items, query);
729
- return _this.inQuery(_items, query);
730
- }, items);
731
- };
732
- QueryResolver.prototype.parseQuery = function (query) {
733
- var _d = __read(query.split(':'), 2), _key = _d[0], value = _d[1];
734
- return [_key.startsWith('-'), _key.startsWith('-') ? _key.slice(1) : _key, value];
735
- };
736
- QueryResolver.prototype.in = function (k, v, q) {
737
- return _in(this.transformer(v, k), q);
738
- };
739
- QueryResolver.prototype.gt = function (k, v, q) {
740
- // const value = dayjs.isDayjs(v) ? v : this.transformer(v, k);
741
- return _gt(v, q);
742
- };
743
- QueryResolver.prototype.lt = function (k, v, q) {
744
- // const value = dayjs.isDayjs(v) ? v : this.transformer(v, k);
745
- return _lt(v, q);
746
- };
747
- return QueryResolver;
748
- }());
749
- var _not = function (bool, not) {
750
- return not ? !bool : bool;
751
- };
752
- var _in = function (value, query) {
753
- return typeof value === 'string' ? value === null || value === void 0 ? void 0 : value.includes(query) : false;
754
- };
755
- var _gt = function (value, query) {
756
- return typeof value === 'string'
757
- ? parseFloat(value) > parseFloat(query)
758
- : typeof value === 'number'
759
- ? value > parseFloat(query)
760
- : dayjs__default["default"].isDayjs(value)
761
- ? dayjs__default["default"](query).isBefore(value)
762
- : false;
763
- };
764
- var _lt = function (value, query) {
765
- return typeof value === 'string'
766
- ? parseFloat(value) < parseFloat(query)
767
- : typeof value === 'number'
768
- ? value < parseFloat(query)
769
- : dayjs__default["default"].isDayjs(value)
770
- ? dayjs__default["default"](query).isAfter(value)
771
- : false;
772
- };
773
-
774
- // export * from './define-element';
775
-
776
- /**
777
- * Generated bundle index. Do not edit.
778
- */
779
-
780
- exports.DATE_FORMAT = DATE_FORMAT;
781
- exports.DayjsDateModule = DayjsDateModule;
782
- exports.MAT_DAYJS_DATE_ADAPTER_OPTIONS = MAT_DAYJS_DATE_ADAPTER_OPTIONS;
783
- exports.MAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY = MAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY;
784
- exports.MAT_DAYJS_DATE_FORMATS = MAT_DAYJS_DATE_FORMATS;
785
- exports.MAT_DAYJS_DATE_FORMATS_FOR_JP = MAT_DAYJS_DATE_FORMATS_FOR_JP;
786
- exports.MAT_DAYJS_JP_PROVIDERS = MAT_DAYJS_JP_PROVIDERS;
787
- exports.MatDayjsDateModule = MatDayjsDateModule;
788
- exports.SMART_EXP_TRANSFORMER = SMART_EXP_TRANSFORMER;
789
- exports.abs = abs;
790
- exports.comma = comma;
791
- exports.commaStr = commaStr;
792
- exports.compareById = compareById;
793
- exports.filterByQuery = filterByQuery;
794
- exports.isDateStr = isDateStr;
795
- exports.isDateTimeStr = isDateTimeStr;
796
- exports.isIsoString = isIsoString;
797
- exports.removeComma = removeComma;
798
- exports.smartExpTransformer = smartExpTransformer;
799
- exports.timestampToDayjs = timestampToDayjs;
800
- exports.toObject = toObject;
801
- exports.yenTransform = yenTransform;
802
-
803
- Object.defineProperty(exports, '__esModule', { value: true });
804
-
805
- }));
806
- //# sourceMappingURL=ng-atomic-common-utils.umd.js.map