ngx-register-base 1.3.1 → 1.3.3

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 (479) hide show
  1. package/esm2022/lib/components/checkbox-selector/checkbox-selector.component.mjs +129 -0
  2. package/esm2022/lib/components/checkbox-selector/checkbox-selector.types.mjs +8 -0
  3. package/esm2022/lib/components/column-settings/column-settings.component.mjs +249 -0
  4. package/esm2022/lib/components/column-settings/components/column-settings-template/column-settings-template.component.mjs +80 -0
  5. package/esm2022/lib/components/column-settings/consts/column-settings.consts.mjs +10 -0
  6. package/esm2022/lib/components/column-settings/index.mjs +3 -0
  7. package/esm2022/lib/components/column-settings/types/column-settings.types.mjs +7 -0
  8. package/esm2022/lib/components/divider/divider.component.mjs +16 -0
  9. package/esm2022/lib/components/filter-button/filter-button.component.mjs +19 -0
  10. package/esm2022/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.mjs +31 -0
  11. package/esm2022/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.mjs +57 -0
  12. package/esm2022/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.mjs +110 -0
  13. package/esm2022/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.mjs +130 -0
  14. package/esm2022/lib/components/filters/components/filter-list/filter-list.service.mjs +89 -0
  15. package/esm2022/lib/components/filters/components/filter-list/filters-section/filters-section.component.mjs +41 -0
  16. package/esm2022/lib/components/filters/components/filter-list.module.mjs +45 -0
  17. package/esm2022/lib/components/filters/index.mjs +3 -0
  18. package/esm2022/lib/components/filters/register-table-filter.component.mjs +155 -0
  19. package/esm2022/lib/components/filters/register-table-filter.module.mjs +39 -0
  20. package/esm2022/lib/components/index.mjs +11 -0
  21. package/esm2022/lib/components/inputs/index.mjs +20 -0
  22. package/esm2022/lib/components/inputs/inputs.module.mjs +166 -0
  23. package/esm2022/lib/components/inputs/param-calendar-year/param-calendar-year.component.mjs +45 -0
  24. package/esm2022/lib/components/inputs/param-custom/param-custom.component.mjs +12 -0
  25. package/esm2022/lib/components/inputs/param-date/param-date.component.mjs +76 -0
  26. package/esm2022/lib/components/inputs/param-date-range/param-date-range.component.mjs +60 -0
  27. package/esm2022/lib/components/inputs/param-date-time/param-date-time.component.mjs +86 -0
  28. package/esm2022/lib/components/inputs/param-date-time-range/param-date-time-range.component.mjs +95 -0
  29. package/esm2022/lib/components/inputs/param-month/param-month.component.mjs +50 -0
  30. package/esm2022/lib/components/inputs/param-month-range/param-month-range.component.mjs +62 -0
  31. package/esm2022/lib/components/inputs/param-multi-select/param-multi-select.component.mjs +309 -0
  32. package/esm2022/lib/components/inputs/param-select/param-select.component.mjs +233 -0
  33. package/esm2022/lib/components/inputs/param-switcher/param-switcher.component.mjs +21 -0
  34. package/esm2022/lib/components/inputs/param-switcher-date-time-range/consts/param-switcher-date-time-range.consts.mjs +28 -0
  35. package/esm2022/lib/components/inputs/param-switcher-date-time-range/index.mjs +3 -0
  36. package/esm2022/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.mjs +105 -0
  37. package/esm2022/lib/components/inputs/param-switcher-date-time-range/types/param-switcher-date-time-range.types.mjs +10 -0
  38. package/esm2022/lib/components/inputs/param-text/param-text.component.mjs +40 -0
  39. package/esm2022/lib/components/inputs/param-textarea/param-textarea.component.mjs +38 -0
  40. package/esm2022/lib/components/inputs/param-toggle/param-toggle.component.mjs +20 -0
  41. package/esm2022/lib/components/inputs/param-tree/consts/param-tree.consts.mjs +37 -0
  42. package/esm2022/lib/components/inputs/param-tree/index.mjs +8 -0
  43. package/esm2022/lib/components/inputs/param-tree/param-tree.component.mjs +207 -0
  44. package/esm2022/lib/components/inputs/param-tree/services/param-tree.service.mjs +116 -0
  45. package/esm2022/lib/components/inputs/param-tree/services/sync-tree-loader.service.mjs +20 -0
  46. package/esm2022/lib/components/inputs/param-tree/tokens/param-tree.tokens.mjs +3 -0
  47. package/esm2022/lib/components/inputs/param-tree/types/param-tree.types.mjs +2 -0
  48. package/esm2022/lib/components/inputs/param-tree/utils/param-tree.utils.mjs +9 -0
  49. package/esm2022/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.mjs +80 -0
  50. package/esm2022/lib/components/inputs/param-tree-select/param-tree-select.component.mjs +85 -0
  51. package/esm2022/lib/components/inputs/sub-components/param-delete-content-icon/param-delete-content-btn.component.mjs +15 -0
  52. package/esm2022/lib/components/inputs/sub-components/param-invalid-icon/param-invalid-icon.component.mjs +12 -0
  53. package/esm2022/lib/components/menu-constructor/index.mjs +5 -0
  54. package/esm2022/lib/components/menu-constructor/sproc-menu-constructor.component.mjs +559 -0
  55. package/esm2022/lib/components/menu-constructor/store/sproc-abstract-menu-constructor.store.mjs +3 -0
  56. package/esm2022/lib/components/menu-constructor/store/sproc-menu-constructor.consts.mjs +5 -0
  57. package/esm2022/lib/components/menu-constructor/store/sproc-menu.tokens.mjs +3 -0
  58. package/esm2022/lib/components/page-menu/index.mjs +6 -0
  59. package/esm2022/lib/components/page-menu/schema/sproc-page-menu.consts.mjs +9 -0
  60. package/esm2022/lib/components/page-menu/schema/sproc-page-menu.schema.mjs +2 -0
  61. package/esm2022/lib/components/page-menu/schema/sproc-page-menu.tokens.mjs +4 -0
  62. package/esm2022/lib/components/page-menu/schema/sproc-page-menu.types.mjs +3 -0
  63. package/esm2022/lib/components/page-menu/sproc-page-menu.component.mjs +275 -0
  64. package/esm2022/lib/components/paginator/paginator.component.mjs +159 -0
  65. package/esm2022/lib/components/paginator/types/paginator.types.mjs +2 -0
  66. package/esm2022/lib/components/register-table/consts/register-table.consts.mjs +4 -0
  67. package/esm2022/lib/components/register-table/directives/cell-template.directive.mjs +19 -0
  68. package/esm2022/lib/components/register-table/directives/header-template.directive.mjs +18 -0
  69. package/esm2022/lib/components/register-table/index.mjs +4 -0
  70. package/esm2022/lib/components/register-table/model/schema.mjs +10 -0
  71. package/esm2022/lib/components/register-table/pipes/class-by-type.pipe.mjs +33 -0
  72. package/esm2022/lib/components/register-table/pipes/sticky-column.pipe.mjs +17 -0
  73. package/esm2022/lib/components/register-table/register-table.component.mjs +544 -0
  74. package/esm2022/lib/components/reset-settings-form/reset-settings-form.component.mjs +18 -0
  75. package/esm2022/lib/components/search-input/search-input.component.mjs +28 -0
  76. package/esm2022/lib/components/sliding-panel/sliding-panel.component.mjs +48 -0
  77. package/esm2022/lib/components/sliding-panel/sliding-panel.module.mjs +19 -0
  78. package/esm2022/lib/consts/date-time.consts.mjs +2 -0
  79. package/esm2022/lib/consts/index.mjs +4 -0
  80. package/esm2022/lib/consts/inputs.consts.mjs +4 -0
  81. package/esm2022/lib/consts/month.consts.mjs +77 -0
  82. package/esm2022/lib/consts/params.consts.mjs +2 -0
  83. package/esm2022/lib/consts/register-base.consts.mjs +26 -0
  84. package/esm2022/lib/core/form-group-wrapper/errors-consts.mjs +8 -0
  85. package/esm2022/lib/core/form-group-wrapper/form-group-wrapper.mjs +81 -0
  86. package/esm2022/lib/core/form-group-wrapper/index.mjs +2 -0
  87. package/esm2022/lib/core/index.mjs +5 -0
  88. package/esm2022/lib/core/input-control/index.mjs +2 -0
  89. package/esm2022/lib/core/input-control/input-control.mjs +11 -0
  90. package/esm2022/lib/core/param/index.mjs +6 -0
  91. package/esm2022/lib/core/param/param-base.mjs +215 -0
  92. package/esm2022/lib/core/param/param-date-base.mjs +26 -0
  93. package/esm2022/lib/core/param/param-select-base.mjs +114 -0
  94. package/esm2022/lib/core/param/param-text-base.mjs +25 -0
  95. package/esm2022/lib/core/param/param.tokens.mjs +4 -0
  96. package/esm2022/lib/core/register-base/index.mjs +3 -0
  97. package/esm2022/lib/core/register-base/register-base.mjs +575 -0
  98. package/esm2022/lib/core/register-base/register-base.store.mjs +43 -0
  99. package/esm2022/lib/directives/date/date-time.types.mjs +34 -0
  100. package/esm2022/lib/directives/date/format-date.pipe.mjs +33 -0
  101. package/esm2022/lib/directives/index.mjs +3 -0
  102. package/esm2022/lib/directives/number/number-only.directive.mjs +41 -0
  103. package/esm2022/lib/directives/sticky/index.mjs +3 -0
  104. package/esm2022/lib/directives/sticky/sticky-relative.directive.mjs +32 -0
  105. package/esm2022/lib/directives/sticky/sticky-relative.service.mjs +32 -0
  106. package/esm2022/lib/directives/sticky/sticky.directive.mjs +169 -0
  107. package/esm2022/lib/services/date-time.service.mjs +314 -0
  108. package/esm2022/lib/services/dialog/dialog.service.mjs +53 -0
  109. package/esm2022/lib/services/dialog/dialog.types.mjs +2 -0
  110. package/esm2022/lib/services/dialog/index.mjs +3 -0
  111. package/esm2022/lib/services/dom-intersection.service.mjs +22 -0
  112. package/esm2022/lib/services/filter/filters-state.service.mjs +65 -0
  113. package/esm2022/lib/services/filter/filters-transmit.service.mjs +82 -0
  114. package/esm2022/lib/services/filter/filters.service.mjs +23 -0
  115. package/esm2022/lib/services/index.mjs +8 -0
  116. package/esm2022/lib/services/inputs-state.service.mjs +130 -0
  117. package/esm2022/lib/services/inputs.service.mjs +88 -0
  118. package/esm2022/lib/services/key-pressed.service.mjs +37 -0
  119. package/esm2022/lib/services/resize-window-observer.service.mjs +33 -0
  120. package/esm2022/lib/services/selected-objects-state.service.mjs +123 -0
  121. package/esm2022/lib/store/fast-query-store.service.mjs +110 -0
  122. package/esm2022/lib/store/index.mjs +2 -0
  123. package/esm2022/lib/types/event.types.mjs +2 -0
  124. package/esm2022/lib/types/hasura.types.mjs +2 -0
  125. package/esm2022/lib/types/index.mjs +7 -0
  126. package/esm2022/lib/types/inputs.types.mjs +19 -0
  127. package/esm2022/lib/types/params.types.mjs +2 -0
  128. package/esm2022/lib/types/register-base.types.mjs +6 -0
  129. package/esm2022/lib/types/sub-types.mjs +2 -0
  130. package/esm2022/lib/types/user-profile.types.mjs +2 -0
  131. package/esm2022/lib/utils/functions.mjs +10 -0
  132. package/esm2022/lib/utils/get-url-segment.mjs +35 -0
  133. package/esm2022/lib/utils/index.mjs +5 -0
  134. package/esm2022/lib/utils/prizm.shared.module.mjs +284 -0
  135. package/esm2022/lib/utils/rxjs.mjs +28 -0
  136. package/esm2022/lib/utils/select-all-utils.mjs +11 -0
  137. package/esm2022/ngx-register-base.mjs +5 -0
  138. package/esm2022/public-api.mjs +9 -0
  139. package/fesm2022/ngx-register-base.mjs +7487 -0
  140. package/fesm2022/ngx-register-base.mjs.map +1 -0
  141. package/index.d.ts +5 -0
  142. package/lib/components/checkbox-selector/checkbox-selector.component.d.ts +33 -0
  143. package/lib/components/checkbox-selector/checkbox-selector.types.d.ts +7 -0
  144. package/lib/components/column-settings/column-settings.component.d.ts +80 -0
  145. package/lib/components/column-settings/components/column-settings-template/column-settings-template.component.d.ts +24 -0
  146. package/lib/components/column-settings/consts/column-settings.consts.d.ts +8 -0
  147. package/lib/components/column-settings/types/column-settings.types.d.ts +22 -0
  148. package/lib/components/divider/divider.component.d.ts +6 -0
  149. package/lib/components/filter-button/filter-button.component.d.ts +8 -0
  150. package/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.d.ts +14 -0
  151. package/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.d.ts +25 -0
  152. package/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.d.ts +39 -0
  153. package/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.d.ts +41 -0
  154. package/lib/components/filters/components/filter-list/filter-list.service.d.ts +20 -0
  155. package/lib/components/filters/components/filter-list/filters-section/filters-section.component.d.ts +15 -0
  156. package/lib/components/filters/components/filter-list.module.d.ts +15 -0
  157. package/lib/components/filters/register-table-filter.component.d.ts +40 -0
  158. package/lib/components/filters/register-table-filter.module.d.ts +13 -0
  159. package/lib/components/inputs/inputs.module.d.ts +31 -0
  160. package/lib/components/inputs/param-calendar-year/param-calendar-year.component.d.ts +19 -0
  161. package/lib/components/inputs/param-custom/param-custom.component.d.ts +6 -0
  162. package/lib/components/inputs/param-date/param-date.component.d.ts +20 -0
  163. package/lib/components/inputs/param-date-range/param-date-range.component.d.ts +26 -0
  164. package/lib/components/inputs/param-date-time/param-date-time.component.d.ts +25 -0
  165. package/lib/components/inputs/param-date-time-range/param-date-time-range.component.d.ts +28 -0
  166. package/lib/components/inputs/param-month/param-month.component.d.ts +18 -0
  167. package/lib/components/inputs/param-month-range/param-month-range.component.d.ts +21 -0
  168. package/lib/components/inputs/param-multi-select/param-multi-select.component.d.ts +46 -0
  169. package/lib/components/inputs/param-select/param-select.component.d.ts +34 -0
  170. package/lib/components/inputs/param-switcher/param-switcher.component.d.ts +8 -0
  171. package/lib/components/inputs/param-switcher-date-time-range/consts/param-switcher-date-time-range.consts.d.ts +2 -0
  172. package/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.d.ts +19 -0
  173. package/lib/components/inputs/param-switcher-date-time-range/types/param-switcher-date-time-range.types.d.ts +8 -0
  174. package/lib/components/inputs/param-text/param-text.component.d.ts +10 -0
  175. package/lib/components/inputs/param-textarea/param-textarea.component.d.ts +10 -0
  176. package/lib/components/inputs/param-toggle/param-toggle.component.d.ts +9 -0
  177. package/lib/components/inputs/param-tree/consts/param-tree.consts.d.ts +7 -0
  178. package/lib/components/inputs/param-tree/param-tree.component.d.ts +41 -0
  179. package/lib/components/inputs/param-tree/services/param-tree.service.d.ts +37 -0
  180. package/lib/components/inputs/param-tree/services/sync-tree-loader.service.d.ts +10 -0
  181. package/{src/lib/components/inputs/param-tree/tokens/param-tree.tokens.ts → lib/components/inputs/param-tree/tokens/param-tree.tokens.d.ts} +1 -2
  182. package/lib/components/inputs/param-tree/types/param-tree.types.d.ts +32 -0
  183. package/lib/components/inputs/param-tree/utils/param-tree.utils.d.ts +7 -0
  184. package/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.d.ts +31 -0
  185. package/lib/components/inputs/param-tree-select/param-tree-select.component.d.ts +30 -0
  186. package/lib/components/inputs/sub-components/param-delete-content-icon/param-delete-content-btn.component.d.ts +6 -0
  187. package/lib/components/inputs/sub-components/param-invalid-icon/param-invalid-icon.component.d.ts +5 -0
  188. package/lib/components/menu-constructor/sproc-menu-constructor.component.d.ts +113 -0
  189. package/lib/components/menu-constructor/store/sproc-abstract-menu-constructor.store.d.ts +24 -0
  190. package/lib/components/menu-constructor/store/sproc-menu-constructor.consts.d.ts +36 -0
  191. package/{src/lib/components/menu-constructor/store/sproc-menu.tokens.ts → lib/components/menu-constructor/store/sproc-menu.tokens.d.ts} +1 -4
  192. package/lib/components/page-menu/schema/sproc-page-menu.consts.d.ts +7 -0
  193. package/lib/components/page-menu/schema/sproc-page-menu.schema.d.ts +30 -0
  194. package/lib/components/page-menu/schema/sproc-page-menu.tokens.d.ts +3 -0
  195. package/lib/components/page-menu/schema/sproc-page-menu.types.d.ts +36 -0
  196. package/lib/components/page-menu/sproc-page-menu.component.d.ts +48 -0
  197. package/lib/components/paginator/paginator.component.d.ts +52 -0
  198. package/lib/components/paginator/types/paginator.types.d.ts +15 -0
  199. package/lib/components/register-table/consts/register-table.consts.d.ts +3 -0
  200. package/lib/components/register-table/directives/cell-template.directive.d.ts +9 -0
  201. package/lib/components/register-table/directives/header-template.directive.d.ts +9 -0
  202. package/lib/components/register-table/model/schema.d.ts +52 -0
  203. package/lib/components/register-table/pipes/class-by-type.pipe.d.ts +8 -0
  204. package/lib/components/register-table/pipes/sticky-column.pipe.d.ts +7 -0
  205. package/lib/components/register-table/register-table.component.d.ts +165 -0
  206. package/lib/components/reset-settings-form/reset-settings-form.component.d.ts +9 -0
  207. package/lib/components/search-input/search-input.component.d.ts +11 -0
  208. package/lib/components/sliding-panel/sliding-panel.component.d.ts +14 -0
  209. package/lib/components/sliding-panel/sliding-panel.module.d.ts +9 -0
  210. package/lib/consts/date-time.consts.d.ts +1 -0
  211. package/lib/consts/index.d.ts +3 -0
  212. package/lib/consts/inputs.consts.d.ts +4 -0
  213. package/lib/consts/month.consts.d.ts +49 -0
  214. package/lib/consts/params.consts.d.ts +1 -0
  215. package/lib/consts/register-base.consts.d.ts +19 -0
  216. package/lib/core/form-group-wrapper/errors-consts.d.ts +5 -0
  217. package/lib/core/form-group-wrapper/form-group-wrapper.d.ts +15 -0
  218. package/lib/core/input-control/input-control.d.ts +11 -0
  219. package/lib/core/param/param-base.d.ts +68 -0
  220. package/lib/core/param/param-date-base.d.ts +18 -0
  221. package/lib/core/param/param-select-base.d.ts +42 -0
  222. package/lib/core/param/param-text-base.d.ts +15 -0
  223. package/{src/lib/core/param/param.tokens.ts → lib/core/param/param.tokens.d.ts} +1 -2
  224. package/lib/core/register-base/register-base.d.ts +168 -0
  225. package/lib/core/register-base/register-base.store.d.ts +35 -0
  226. package/lib/directives/date/date-time.types.d.ts +32 -0
  227. package/lib/directives/date/format-date.pipe.d.ts +10 -0
  228. package/lib/directives/number/number-only.directive.d.ts +10 -0
  229. package/lib/directives/sticky/sticky-relative.directive.d.ts +13 -0
  230. package/lib/directives/sticky/sticky-relative.service.d.ts +15 -0
  231. package/lib/directives/sticky/sticky.directive.d.ts +27 -0
  232. package/lib/services/date-time.service.d.ts +80 -0
  233. package/lib/services/dialog/dialog.service.d.ts +22 -0
  234. package/{src/lib/services/dialog/dialog.types.ts → lib/services/dialog/dialog.types.d.ts} +4 -8
  235. package/lib/services/dom-intersection.service.d.ts +8 -0
  236. package/lib/services/filter/filters-state.service.d.ts +21 -0
  237. package/lib/services/filter/filters-transmit.service.d.ts +28 -0
  238. package/lib/services/filter/filters.service.d.ts +12 -0
  239. package/lib/services/inputs-state.service.d.ts +57 -0
  240. package/lib/services/inputs.service.d.ts +28 -0
  241. package/lib/services/key-pressed.service.d.ts +15 -0
  242. package/lib/services/resize-window-observer.service.d.ts +11 -0
  243. package/lib/services/selected-objects-state.service.d.ts +47 -0
  244. package/lib/store/fast-query-store.service.d.ts +19 -0
  245. package/{src/lib/types/event.types.ts → lib/types/event.types.d.ts} +1 -1
  246. package/lib/types/hasura.types.d.ts +35 -0
  247. package/lib/types/inputs.types.d.ts +41 -0
  248. package/lib/types/params.types.d.ts +27 -0
  249. package/lib/types/register-base.types.d.ts +123 -0
  250. package/lib/types/sub-types.d.ts +8 -0
  251. package/lib/types/user-profile.types.d.ts +17 -0
  252. package/lib/utils/functions.d.ts +3 -0
  253. package/lib/utils/get-url-segment.d.ts +7 -0
  254. package/lib/utils/prizm.shared.module.d.ts +14 -0
  255. package/lib/utils/rxjs.d.ts +10 -0
  256. package/lib/utils/select-all-utils.d.ts +8 -0
  257. package/package.json +15 -12
  258. package/schematics/ng-update/replace-menu-state-token/index.d.ts +2 -0
  259. package/schematics/ng-update/replace-menu-state-token/index.js +29 -0
  260. package/schematics/ng-update/replace-menu-state-token/index.js.map +1 -0
  261. package/schematics/ng-update/update-prefix/index.d.ts +2 -0
  262. package/schematics/ng-update/update-prefix/index.js +33 -0
  263. package/schematics/ng-update/update-prefix/index.js.map +1 -0
  264. package/schematics/utils/{utils.ts → utils.d.ts} +2 -9
  265. package/schematics/utils/utils.js +25 -0
  266. package/schematics/utils/utils.js.map +1 -0
  267. package/ng-package.json +0 -15
  268. package/schematics/ng-update/replace-menu-state-token/index.ts +0 -33
  269. package/schematics/ng-update/update-prefix/index.ts +0 -38
  270. package/src/lib/components/checkbox-selector/checkbox-selector.component.html +0 -91
  271. package/src/lib/components/checkbox-selector/checkbox-selector.component.less +0 -67
  272. package/src/lib/components/checkbox-selector/checkbox-selector.component.ts +0 -176
  273. package/src/lib/components/checkbox-selector/checkbox-selector.types.ts +0 -8
  274. package/src/lib/components/column-settings/column-settings.component.html +0 -160
  275. package/src/lib/components/column-settings/column-settings.component.less +0 -131
  276. package/src/lib/components/column-settings/column-settings.component.ts +0 -352
  277. package/src/lib/components/column-settings/components/column-settings-template/column-settings-template.component.html +0 -65
  278. package/src/lib/components/column-settings/components/column-settings-template/column-settings-template.component.less +0 -79
  279. package/src/lib/components/column-settings/components/column-settings-template/column-settings-template.component.ts +0 -114
  280. package/src/lib/components/column-settings/consts/column-settings.consts.ts +0 -9
  281. package/src/lib/components/column-settings/types/column-settings.types.ts +0 -26
  282. package/src/lib/components/divider/divider.component.html +0 -4
  283. package/src/lib/components/divider/divider.component.less +0 -10
  284. package/src/lib/components/divider/divider.component.ts +0 -12
  285. package/src/lib/components/filter-button/filter-button.component.html +0 -20
  286. package/src/lib/components/filter-button/filter-button.component.less +0 -41
  287. package/src/lib/components/filter-button/filter-button.component.ts +0 -18
  288. package/src/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.html +0 -22
  289. package/src/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.less +0 -23
  290. package/src/lib/components/filters/components/filter-list/filter-edit/filter-edit.component.ts +0 -31
  291. package/src/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.html +0 -49
  292. package/src/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.less +0 -37
  293. package/src/lib/components/filters/components/filter-list/filter-list-footer/filter-list-footer.component.ts +0 -66
  294. package/src/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.html +0 -147
  295. package/src/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.less +0 -45
  296. package/src/lib/components/filters/components/filter-list/filter-list-header/filter-list-header.component.ts +0 -114
  297. package/src/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.html +0 -44
  298. package/src/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.less +0 -49
  299. package/src/lib/components/filters/components/filter-list/filter-list-saved/filter-list-saved.component.ts +0 -167
  300. package/src/lib/components/filters/components/filter-list/filter-list.service.ts +0 -97
  301. package/src/lib/components/filters/components/filter-list/filters-section/filters-section.component.html +0 -18
  302. package/src/lib/components/filters/components/filter-list/filters-section/filters-section.component.less +0 -55
  303. package/src/lib/components/filters/components/filter-list/filters-section/filters-section.component.ts +0 -69
  304. package/src/lib/components/filters/components/filter-list.module.ts +0 -29
  305. package/src/lib/components/filters/register-table-filter.component.html +0 -53
  306. package/src/lib/components/filters/register-table-filter.component.less +0 -17
  307. package/src/lib/components/filters/register-table-filter.component.ts +0 -167
  308. package/src/lib/components/filters/register-table-filter.module.ts +0 -22
  309. package/src/lib/components/inputs/inputs.module.ts +0 -104
  310. package/src/lib/components/inputs/param-calendar-year/param-calendar-year.component.html +0 -49
  311. package/src/lib/components/inputs/param-calendar-year/param-calendar-year.component.less +0 -70
  312. package/src/lib/components/inputs/param-calendar-year/param-calendar-year.component.ts +0 -52
  313. package/src/lib/components/inputs/param-custom/param-custom.component.html +0 -1
  314. package/src/lib/components/inputs/param-custom/param-custom.component.ts +0 -9
  315. package/src/lib/components/inputs/param-date/param-date.component.html +0 -55
  316. package/src/lib/components/inputs/param-date/param-date.component.less +0 -67
  317. package/src/lib/components/inputs/param-date/param-date.component.ts +0 -77
  318. package/src/lib/components/inputs/param-date-range/param-date-range.component.html +0 -45
  319. package/src/lib/components/inputs/param-date-range/param-date-range.component.less +0 -75
  320. package/src/lib/components/inputs/param-date-range/param-date-range.component.ts +0 -67
  321. package/src/lib/components/inputs/param-date-time/param-date-time.component.html +0 -70
  322. package/src/lib/components/inputs/param-date-time/param-date-time.component.less +0 -72
  323. package/src/lib/components/inputs/param-date-time/param-date-time.component.ts +0 -101
  324. package/src/lib/components/inputs/param-date-time-range/param-date-time-range.component.html +0 -67
  325. package/src/lib/components/inputs/param-date-time-range/param-date-time-range.component.less +0 -103
  326. package/src/lib/components/inputs/param-date-time-range/param-date-time-range.component.ts +0 -128
  327. package/src/lib/components/inputs/param-month/param-month.component.html +0 -46
  328. package/src/lib/components/inputs/param-month/param-month.component.less +0 -72
  329. package/src/lib/components/inputs/param-month/param-month.component.ts +0 -55
  330. package/src/lib/components/inputs/param-month-range/param-month-range.component.html +0 -39
  331. package/src/lib/components/inputs/param-month-range/param-month-range.component.less +0 -71
  332. package/src/lib/components/inputs/param-month-range/param-month-range.component.ts +0 -76
  333. package/src/lib/components/inputs/param-multi-select/param-multi-select.component.html +0 -84
  334. package/src/lib/components/inputs/param-multi-select/param-multi-select.component.less +0 -108
  335. package/src/lib/components/inputs/param-multi-select/param-multi-select.component.ts +0 -448
  336. package/src/lib/components/inputs/param-select/param-select.component.html +0 -106
  337. package/src/lib/components/inputs/param-select/param-select.component.less +0 -26
  338. package/src/lib/components/inputs/param-select/param-select.component.ts +0 -318
  339. package/src/lib/components/inputs/param-switcher/param-switcher.component.html +0 -8
  340. package/src/lib/components/inputs/param-switcher/param-switcher.component.less +0 -53
  341. package/src/lib/components/inputs/param-switcher/param-switcher.component.ts +0 -13
  342. package/src/lib/components/inputs/param-switcher-date-time-range/consts/param-switcher-date-time-range.consts.ts +0 -29
  343. package/src/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.html +0 -19
  344. package/src/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.less +0 -76
  345. package/src/lib/components/inputs/param-switcher-date-time-range/param-switcher-date-time-range.component.ts +0 -134
  346. package/src/lib/components/inputs/param-switcher-date-time-range/types/param-switcher-date-time-range.types.ts +0 -8
  347. package/src/lib/components/inputs/param-text/param-text.component.html +0 -59
  348. package/src/lib/components/inputs/param-text/param-text.component.less +0 -33
  349. package/src/lib/components/inputs/param-text/param-text.component.ts +0 -36
  350. package/src/lib/components/inputs/param-textarea/param-textarea.component.html +0 -61
  351. package/src/lib/components/inputs/param-textarea/param-textarea.component.less +0 -21
  352. package/src/lib/components/inputs/param-textarea/param-textarea.component.ts +0 -33
  353. package/src/lib/components/inputs/param-toggle/param-toggle.component.html +0 -40
  354. package/src/lib/components/inputs/param-toggle/param-toggle.component.less +0 -69
  355. package/src/lib/components/inputs/param-toggle/param-toggle.component.ts +0 -14
  356. package/src/lib/components/inputs/param-tree/consts/param-tree.consts.ts +0 -59
  357. package/src/lib/components/inputs/param-tree/param-tree.component.html +0 -51
  358. package/src/lib/components/inputs/param-tree/param-tree.component.less +0 -3
  359. package/src/lib/components/inputs/param-tree/param-tree.component.ts +0 -282
  360. package/src/lib/components/inputs/param-tree/services/param-tree.service.ts +0 -176
  361. package/src/lib/components/inputs/param-tree/services/sync-tree-loader.service.ts +0 -18
  362. package/src/lib/components/inputs/param-tree/types/param-tree.types.ts +0 -39
  363. package/src/lib/components/inputs/param-tree/utils/param-tree.utils.ts +0 -18
  364. package/src/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.html +0 -78
  365. package/src/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.less +0 -109
  366. package/src/lib/components/inputs/param-tree-multi-select/param-tree-multi-select.component.ts +0 -89
  367. package/src/lib/components/inputs/param-tree-select/param-tree-select.component.html +0 -54
  368. package/src/lib/components/inputs/param-tree-select/param-tree-select.component.less +0 -56
  369. package/src/lib/components/inputs/param-tree-select/param-tree-select.component.ts +0 -91
  370. package/src/lib/components/inputs/sub-components/param-delete-content-icon/param-delete-content-btn.component.html +0 -5
  371. package/src/lib/components/inputs/sub-components/param-delete-content-icon/param-delete-content-btn.component.ts +0 -13
  372. package/src/lib/components/inputs/sub-components/param-invalid-icon/param-invalid-icon.component.html +0 -4
  373. package/src/lib/components/inputs/sub-components/param-invalid-icon/param-invalid-icon.component.ts +0 -11
  374. package/src/lib/components/menu-constructor/sproc-menu-constructor.component.html +0 -95
  375. package/src/lib/components/menu-constructor/sproc-menu-constructor.component.less +0 -183
  376. package/src/lib/components/menu-constructor/sproc-menu-constructor.component.ts +0 -687
  377. package/src/lib/components/menu-constructor/store/sproc-abstract-menu-constructor.store.ts +0 -32
  378. package/src/lib/components/menu-constructor/store/sproc-menu-constructor.consts.ts +0 -46
  379. package/src/lib/components/page-menu/README.md +0 -60
  380. package/src/lib/components/page-menu/schema/sproc-page-menu.consts.ts +0 -8
  381. package/src/lib/components/page-menu/schema/sproc-page-menu.schema.ts +0 -35
  382. package/src/lib/components/page-menu/schema/sproc-page-menu.tokens.ts +0 -5
  383. package/src/lib/components/page-menu/schema/sproc-page-menu.types.ts +0 -42
  384. package/src/lib/components/page-menu/sproc-page-menu.component.html +0 -166
  385. package/src/lib/components/page-menu/sproc-page-menu.component.less +0 -228
  386. package/src/lib/components/page-menu/sproc-page-menu.component.ts +0 -337
  387. package/src/lib/components/paginator/paginator.component.html +0 -97
  388. package/src/lib/components/paginator/paginator.component.less +0 -101
  389. package/src/lib/components/paginator/paginator.component.ts +0 -192
  390. package/src/lib/components/paginator/types/paginator.types.ts +0 -16
  391. package/src/lib/components/register-table/consts/register-table.consts.ts +0 -3
  392. package/src/lib/components/register-table/directives/cell-template.directive.ts +0 -11
  393. package/src/lib/components/register-table/directives/header-template.directive.ts +0 -11
  394. package/src/lib/components/register-table/model/schema.ts +0 -62
  395. package/src/lib/components/register-table/pipes/class-by-type.pipe.ts +0 -28
  396. package/src/lib/components/register-table/pipes/sticky-column.pipe.ts +0 -11
  397. package/src/lib/components/register-table/register-table.component.html +0 -257
  398. package/src/lib/components/register-table/register-table.component.less +0 -151
  399. package/src/lib/components/register-table/register-table.component.ts +0 -743
  400. package/src/lib/components/reset-settings-form/reset-settings-form.component.html +0 -14
  401. package/src/lib/components/reset-settings-form/reset-settings-form.component.less +0 -26
  402. package/src/lib/components/reset-settings-form/reset-settings-form.component.ts +0 -15
  403. package/src/lib/components/search-input/search-input.component.html +0 -6
  404. package/src/lib/components/search-input/search-input.component.less +0 -17
  405. package/src/lib/components/search-input/search-input.component.ts +0 -31
  406. package/src/lib/components/sliding-panel/sliding-panel.component.html +0 -13
  407. package/src/lib/components/sliding-panel/sliding-panel.component.less +0 -112
  408. package/src/lib/components/sliding-panel/sliding-panel.component.ts +0 -36
  409. package/src/lib/components/sliding-panel/sliding-panel.module.ts +0 -11
  410. package/src/lib/consts/date-time.consts.ts +0 -1
  411. package/src/lib/consts/index.ts +0 -8
  412. package/src/lib/consts/inputs.consts.ts +0 -9
  413. package/src/lib/consts/month.consts.ts +0 -82
  414. package/src/lib/consts/params.consts.ts +0 -1
  415. package/src/lib/consts/register-base.consts.ts +0 -40
  416. package/src/lib/core/form-group-wrapper/errors-consts.ts +0 -6
  417. package/src/lib/core/form-group-wrapper/form-group-wrapper.ts +0 -109
  418. package/src/lib/core/input-control/input-control.ts +0 -30
  419. package/src/lib/core/param/param-base.ts +0 -262
  420. package/src/lib/core/param/param-date-base.ts +0 -30
  421. package/src/lib/core/param/param-select-base.ts +0 -118
  422. package/src/lib/core/param/param-text-base.ts +0 -23
  423. package/src/lib/core/register-base/register-base.store.ts +0 -84
  424. package/src/lib/core/register-base/register-base.ts +0 -854
  425. package/src/lib/directives/date/date-time.types.ts +0 -36
  426. package/src/lib/directives/date/format-date.pipe.ts +0 -28
  427. package/src/lib/directives/number/number-only.directive.ts +0 -36
  428. package/src/lib/directives/sticky/sticky-relative.directive.ts +0 -30
  429. package/src/lib/directives/sticky/sticky-relative.service.ts +0 -34
  430. package/src/lib/directives/sticky/sticky.directive.ts +0 -189
  431. package/src/lib/services/date-time.service.ts +0 -399
  432. package/src/lib/services/dialog/dialog.service.ts +0 -62
  433. package/src/lib/services/dom-intersection.service.ts +0 -23
  434. package/src/lib/services/filter/filters-state.service.ts +0 -83
  435. package/src/lib/services/filter/filters-transmit.service.ts +0 -105
  436. package/src/lib/services/filter/filters.service.ts +0 -21
  437. package/src/lib/services/inputs-state.service.ts +0 -157
  438. package/src/lib/services/inputs.service.ts +0 -114
  439. package/src/lib/services/key-pressed.service.ts +0 -40
  440. package/src/lib/services/resize-window-observer.service.ts +0 -37
  441. package/src/lib/services/selected-objects-state.service.ts +0 -159
  442. package/src/lib/store/fast-query-store.service.ts +0 -132
  443. package/src/lib/types/hasura.types.ts +0 -41
  444. package/src/lib/types/inputs.types.ts +0 -63
  445. package/src/lib/types/params.types.ts +0 -42
  446. package/src/lib/types/register-base.types.ts +0 -161
  447. package/src/lib/types/sub-types.ts +0 -15
  448. package/src/lib/types/user-profile.types.ts +0 -18
  449. package/src/lib/utils/functions.ts +0 -11
  450. package/src/lib/utils/get-url-segment.ts +0 -46
  451. package/src/lib/utils/prizm.shared.module.ts +0 -176
  452. package/src/lib/utils/rxjs.ts +0 -33
  453. package/src/lib/utils/select-all-utils.ts +0 -16
  454. package/tsconfig.lib.json +0 -16
  455. package/tsconfig.lib.prod.json +0 -11
  456. package/tsconfig.schematics.json +0 -26
  457. package/tsconfig.spec.json +0 -15
  458. /package/{src/lib/components/column-settings/index.ts → lib/components/column-settings/index.d.ts} +0 -0
  459. /package/{src/lib/components/filters/index.ts → lib/components/filters/index.d.ts} +0 -0
  460. /package/{src/lib/components/index.ts → lib/components/index.d.ts} +0 -0
  461. /package/{src/lib/components/inputs/index.ts → lib/components/inputs/index.d.ts} +0 -0
  462. /package/{src/lib/components/inputs/param-switcher-date-time-range/index.ts → lib/components/inputs/param-switcher-date-time-range/index.d.ts} +0 -0
  463. /package/{src/lib/components/inputs/param-tree/index.ts → lib/components/inputs/param-tree/index.d.ts} +0 -0
  464. /package/{src/lib/components/menu-constructor/index.ts → lib/components/menu-constructor/index.d.ts} +0 -0
  465. /package/{src/lib/components/page-menu/index.ts → lib/components/page-menu/index.d.ts} +0 -0
  466. /package/{src/lib/components/register-table/index.ts → lib/components/register-table/index.d.ts} +0 -0
  467. /package/{src/lib/core/form-group-wrapper/index.ts → lib/core/form-group-wrapper/index.d.ts} +0 -0
  468. /package/{src/lib/core/index.ts → lib/core/index.d.ts} +0 -0
  469. /package/{src/lib/core/input-control/index.ts → lib/core/input-control/index.d.ts} +0 -0
  470. /package/{src/lib/core/param/index.ts → lib/core/param/index.d.ts} +0 -0
  471. /package/{src/lib/core/register-base/index.ts → lib/core/register-base/index.d.ts} +0 -0
  472. /package/{src/lib/directives/index.ts → lib/directives/index.d.ts} +0 -0
  473. /package/{src/lib/directives/sticky/index.ts → lib/directives/sticky/index.d.ts} +0 -0
  474. /package/{src/lib/services/dialog/index.ts → lib/services/dialog/index.d.ts} +0 -0
  475. /package/{src/lib/services/index.ts → lib/services/index.d.ts} +0 -0
  476. /package/{src/lib/store/index.ts → lib/store/index.d.ts} +0 -0
  477. /package/{src/lib/types/index.ts → lib/types/index.d.ts} +0 -0
  478. /package/{src/lib/utils/index.ts → lib/utils/index.d.ts} +0 -0
  479. /package/{src/public-api.ts → public-api.d.ts} +0 -0
@@ -1,687 +0,0 @@
1
- import { Component, computed, DestroyRef, inject, OnInit, output, signal } from '@angular/core';
2
- import { FormsModule } from '@angular/forms';
3
- import {
4
- CdkDrag,
5
- CdkDragDrop,
6
- CdkDragHandle,
7
- CdkDragPreview,
8
- CdkDropList,
9
- } from '@angular/cdk/drag-drop';
10
- import { AsyncPipe, NgForOf } from '@angular/common';
11
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
12
- import { filter } from 'rxjs';
13
- import { SprocAbstractMenuConstructorStore } from './store/sproc-abstract-menu-constructor.store';
14
- import {
15
- EMPTY_UUID,
16
- FlatNode,
17
- IClsMenuItemInput,
18
- IMenuConstructorError,
19
- MIGRATION_HINT,
20
- NEW_ITEM_PREFIX,
21
- ROOT_TITLE,
22
- } from './store/sproc-menu-constructor.consts';
23
- import { IClsMenuItem } from '../page-menu';
24
- import { MENU_CONSTRUCTOR_STORE_TOKEN } from './store/sproc-menu.tokens';
25
-
26
- @Component({
27
- standalone: true,
28
- selector: 'sproc-menu-constructor',
29
- templateUrl: './sproc-menu-constructor.component.html',
30
- styleUrls: ['./sproc-menu-constructor.component.less'],
31
- imports: [CdkDrag, CdkDropList, NgForOf, FormsModule, CdkDragPreview, CdkDragHandle, AsyncPipe],
32
- })
33
- export class SprocMenuConstructorComponent implements OnInit {
34
- private _store = inject(MENU_CONSTRUCTOR_STORE_TOKEN);
35
- private _ref = inject(DestroyRef);
36
-
37
- protected ROOT_TITLE = ROOT_TITLE;
38
- protected loading$ = this._store.loading$;
39
- protected originalTree: Map<string, FlatNode> = new Map([]);
40
- protected MIGRATION_HINT = MIGRATION_HINT;
41
- private deletedIds: string[] = [];
42
-
43
- public errorMsgOutput = output<IMenuConstructorError>();
44
-
45
- // плоское представление иерархического меню
46
- protected flatTree = signal<FlatNode[]>([]);
47
-
48
- // ветка элементов, которая перетаскивается
49
- protected draggedBranch = signal<FlatNode[]>([]);
50
-
51
- // вычисляемое свойство, возвращающее только видимые (не свернутые) элементы
52
- protected visibleFlatTree = computed<FlatNode[]>(() => {
53
- const flatTree = this.flatTree();
54
- return this._getVisibleFrom(flatTree);
55
- });
56
-
57
- private _pendingRecalc = false;
58
-
59
- ngOnInit(): void {
60
- this._store.menuItems$
61
- .pipe(
62
- filter((arr) => Array.isArray(arr) && arr.length > 0),
63
- takeUntilDestroyed(this._ref)
64
- )
65
- .subscribe((value) => {
66
- this.flatTree.set(this._convertToFlatNode(value));
67
- this.originalTree = new Map(this.flatTree().map((item) => [item.id, { ...item }]));
68
- });
69
- }
70
-
71
- /**
72
- * Переключает состояние свернутости узла (collapse/expand)
73
- * После изменения создает новый массив для триггера обновления сигнала
74
- */
75
- protected toggleCollapse(node: FlatNode): void {
76
- node.collapsed = !node.collapsed;
77
- this.flatTree.set([...this.flatTree()]);
78
- }
79
-
80
- /**
81
- * Начало перетаскивания: сохраняет всю ветку узла, которую тянут
82
- */
83
- protected dragStarted(node: FlatNode): void {
84
- const branch = this._collectBranch(this.flatTree(), node);
85
- this.draggedBranch.set(branch);
86
- }
87
-
88
- /**
89
- * Завершение перетаскивания: очищает информацию о текущей ветке
90
- */
91
- protected dragEnded(): void {
92
- this.draggedBranch.set([]);
93
- }
94
-
95
- /**
96
- * Основная логика drag&drop при отпускании элемента
97
- * Определяет новую позицию узла, пересчитывает глубины и связи
98
- */
99
- protected drop(event: CdkDragDrop<FlatNode[]>): void {
100
- const before = [...this.flatTree()];
101
- const visibleBefore = this._getVisibleFrom(before);
102
- const prevIdx = event.previousIndex;
103
- const currIdx = event.currentIndex;
104
-
105
- // Получает перетаскиваемый элемент из списка видимых
106
- const draggedVisible = visibleBefore[prevIdx];
107
- if (!draggedVisible) {
108
- return;
109
- }
110
-
111
- // Находит индекс узла в полном массиве
112
- const start = before.findIndex((n) => n.id === draggedVisible.id);
113
- if (start < 0) {
114
- return;
115
- }
116
-
117
- // Собирает всю ветку, начинающуюся с перетаскиваемого узла
118
- const branch = this._collectBranch(before, before[start]);
119
- const branchIds = new Set(branch.map((n) => n.id));
120
-
121
- // Убирает ветку из исходного списка
122
- const full = before.filter((n) => !branchIds.has(n.id));
123
-
124
- // Определяет видимые элементы после удаления ветки
125
- const visible = this._getVisibleFrom(full);
126
- const prevVisible = visible[currIdx - 1] ?? null;
127
- const nextVisible = visible[currIdx] ?? null;
128
-
129
- // Индекс вставки ветки в новый список
130
- const insert = nextVisible ? full.findIndex((n) => n.id === nextVisible.id) : full.length;
131
-
132
- // Рассчитывает глубину вставляемой ветки в зависимости от соседей
133
- let targetDepth;
134
- if (prevVisible && nextVisible) {
135
- targetDepth =
136
- prevVisible.depth < nextVisible.depth ? prevVisible.depth + 1 : nextVisible.depth;
137
- } else if (prevVisible && !nextVisible) {
138
- targetDepth = prevVisible.depth;
139
- } else if (!prevVisible && nextVisible) {
140
- targetDepth = nextVisible.depth;
141
- } else {
142
- targetDepth = 0;
143
- }
144
-
145
- // Вставляет ветку в новое место
146
- full.splice(insert, 0, ...branch);
147
- // Сдвигает глубину всей ветки
148
- this._applyDepthShift(branch, targetDepth - branch[0].depth);
149
-
150
- // Планирует пересчет структуры дерева
151
- this._scheduleRecalc(full);
152
- }
153
-
154
- /**
155
- * Увеличивает глубину (depth) конкретного узла, если возможно
156
- */
157
- protected indent(node: FlatNode): void {
158
- const arr = [...this.flatTree()];
159
- const index = arr.indexOf(node);
160
- if (index === -1) {
161
- return;
162
- }
163
-
164
- const proposedDepth = node.depth + 1;
165
- // Ищет подходящего родителя с нужной глубиной
166
- const parentCandidate = [...arr]
167
- .slice(0, index)
168
- .reverse()
169
- .find((n) => n.depth === proposedDepth - 1);
170
-
171
- if (!parentCandidate) {
172
- return;
173
- }
174
-
175
- node.depth = proposedDepth;
176
- this._scheduleRecalc(arr);
177
- }
178
-
179
- /**
180
- * Уменьшает глубину (depth) узла + по возможности превращает его в родителя
181
- */
182
- protected outdent(node: FlatNode): void {
183
- const arr = [...this.flatTree()];
184
- const index = arr.indexOf(node);
185
- if (index === -1 || node.depth <= 0) {
186
- return;
187
- }
188
- node.depth = Math.max(0, node.depth - 1);
189
- this._scheduleRecalc(arr);
190
- }
191
-
192
- /**
193
- * Увеличивает глубину всей ветки узла (вместе с потомками)
194
- */
195
- protected indentBranch(node: FlatNode): void {
196
- const arr = [...this.flatTree()];
197
- const index = arr.indexOf(node);
198
- if (index === -1) {
199
- return;
200
- }
201
- const proposedDepth = node.depth + 1;
202
- const parentCandidate = [...arr]
203
- .slice(0, index)
204
- .reverse()
205
- .find((n) => n.depth === proposedDepth - 1);
206
-
207
- if (!parentCandidate) {
208
- return;
209
- }
210
-
211
- const branch = this._collectBranch(arr, node);
212
- this._applyDepthShift(branch, 1);
213
-
214
- this._scheduleRecalc(arr);
215
- }
216
-
217
- /**
218
- * Уменьшает глубину всей ветки узла
219
- */
220
- protected outdentBranch(node: FlatNode): void {
221
- const arr = [...this.flatTree()];
222
- const branch = this._collectBranch(arr, node);
223
- this._applyDepthShift(branch, -1);
224
- this._scheduleRecalc(arr);
225
- }
226
-
227
- /**
228
- * Проверяет, есть ли у узла дочерние элементы
229
- */
230
- protected hasChildren(node: FlatNode): boolean {
231
- const arr = this.flatTree();
232
- const idx = arr.indexOf(node);
233
- if (idx === -1) {
234
- return false;
235
- }
236
- for (let i = idx + 1; i < arr.length; i++) {
237
- const next = arr[i];
238
- if (next.depth <= node.depth) {
239
- break;
240
- }
241
- if (next.depth === node.depth + 1) {
242
- return true;
243
- }
244
- }
245
- return false;
246
- }
247
-
248
- protected save(): void {
249
- // Флаг для логгирования на время отладки
250
- const logging = false;
251
-
252
- const changedElements = this.flatTree().filter((newItem) => {
253
- const originalItem = this.originalTree.get(newItem.id);
254
-
255
- // Новый элемент
256
- if (!originalItem) {
257
- if (logging) {
258
- console.log(`Новый элемент ${newItem.title}`);
259
- }
260
-
261
- return true;
262
- }
263
-
264
- const {
265
- order_num: originalOrderNum,
266
- id_parent: originalIdParent,
267
- title: originalTitle,
268
- allowed_roles: originalRoles,
269
- code: originalCode,
270
- route: originalRoute,
271
- icon: originalIcon,
272
- } = originalItem;
273
-
274
- const {
275
- order_num: newOrderNum,
276
- id_parent: newIdParent,
277
- title: newTitle,
278
- allowed_roles: newRoles,
279
- code: newCode,
280
- route: newRoute,
281
- icon: newIcon,
282
- } = newItem;
283
-
284
- const changedFields: string[] = [];
285
-
286
- if (originalOrderNum !== newOrderNum) {
287
- changedFields.push(`order_num: ${originalOrderNum} → ${newOrderNum}`);
288
- }
289
- if (originalIdParent !== newIdParent) {
290
- changedFields.push(`id_parent: ${originalIdParent} → ${newIdParent}`);
291
- }
292
- if (originalTitle !== newTitle) {
293
- changedFields.push(`title: ${originalTitle} → ${newTitle}`);
294
- }
295
- if (originalCode !== newCode) {
296
- changedFields.push(`code: ${originalCode} → ${newCode}`);
297
- }
298
- if (originalRoute !== newRoute) {
299
- changedFields.push(`route: ${originalRoute} → ${newRoute}`);
300
- }
301
- if (originalIcon !== newIcon) {
302
- changedFields.push(`icon: ${originalIcon} → ${newIcon}`);
303
- }
304
- if (JSON.stringify(originalRoles) !== JSON.stringify(newRoles)) {
305
- changedFields.push(`allowed_roles: ${originalRoles} → ${newRoles}`);
306
- }
307
-
308
- return changedFields.length > 0;
309
- });
310
-
311
- const isBlank = (s: unknown): boolean => typeof s !== 'string' || s.trim() === '';
312
-
313
- const isRouteValid = ({ route, code }: FlatNode): boolean => {
314
- // route считается заданным, только если это непустая строка
315
- const hasRoute = route.trim() !== '';
316
-
317
- return !hasRoute || route === code;
318
- };
319
-
320
- const invalidCodeTitles: string[] = [];
321
- const invalidRouteTitles: FlatNode[] = [];
322
-
323
- for (const el of changedElements) {
324
- if (isBlank(el.code)) {
325
- invalidCodeTitles.push(el.title ?? '(без названия)');
326
- }
327
-
328
- if (!isRouteValid(el)) {
329
- invalidRouteTitles.push(el);
330
- }
331
- }
332
-
333
- if (invalidCodeTitles.length > 0) {
334
- this.errorMsgOutput.emit({
335
- label: 'Конструктор меню',
336
- appearance: 'negative',
337
- // eslint-disable-next-line xss/no-mixed-html
338
- content: `Все поля code должны быть заполнены. </br>
339
- Исправьте следующие поля: </br>
340
- ${invalidCodeTitles.map((t) => `- ${t}`).join('</br>')}
341
- `,
342
- });
343
-
344
- return;
345
- }
346
-
347
- if (invalidRouteTitles.length > 0) {
348
- this.errorMsgOutput.emit({
349
- label: 'Конструктор меню',
350
- appearance: 'negative',
351
- // eslint-disable-next-line xss/no-mixed-html
352
- content: `Все поля code должны быть равны полю route. </br>
353
- Исправьте следующие поля: </br>
354
- ${invalidRouteTitles.map((t) => `- ${t.title} (${t.code} | ${t.route})`).join('</br>')}
355
- `,
356
- });
357
-
358
- return;
359
- }
360
-
361
- const elRoute = (route: string): string | null => (route === '' ? null : route);
362
-
363
- const normalizeElement = (el: FlatNode): IClsMenuItemInput => ({
364
- title: el.title.trim(),
365
- route: elRoute(el.route.trim()),
366
- code: el.code,
367
- icon: el.icon,
368
- order_num: el.order_num,
369
- allowed_roles: el.allowed_roles
370
- ? el.allowed_roles.split(',').map((value) => value.trim())
371
- : null,
372
- id_parent: el.id_parent,
373
- });
374
-
375
- const objectsToSave = changedElements
376
- .filter(({ id }) => !id.includes(NEW_ITEM_PREFIX))
377
- .map((el) => ({
378
- _set: normalizeElement(el),
379
- where: { id: { _eq: el.id } },
380
- }));
381
-
382
- const objectsToInsert = changedElements
383
- .filter(({ id }) => id.includes(NEW_ITEM_PREFIX))
384
- .map((element) => {
385
- element.id = EMPTY_UUID;
386
-
387
- return normalizeElement(element);
388
- });
389
-
390
- const objectsToDelete = [...this.deletedIds];
391
-
392
- if (logging) {
393
- console.log(`Измененные элементы`, objectsToSave);
394
- console.log(`Новые элементы`, objectsToInsert);
395
- console.log('Удалённые элементы:', objectsToDelete);
396
- }
397
-
398
- this._store.updateMenu(objectsToSave, objectsToInsert, objectsToDelete);
399
-
400
- this.deletedIds = [];
401
- }
402
-
403
- protected handleFold(state: boolean): void {
404
- for (const element of this.flatTree()) {
405
- if (element.title !== ROOT_TITLE) {
406
- element.collapsed = state;
407
- }
408
- }
409
-
410
- this.flatTree.set([...this.flatTree()]);
411
- }
412
-
413
- /**
414
- * Удаляет один элемент из дерева.
415
- * Потомки становятся дочерними элементами родителя удалённого узла.
416
- */
417
- protected deleteItem(node: FlatNode): void {
418
- const arr = [...this.flatTree()];
419
- const index = arr.indexOf(node);
420
- if (index === -1) {
421
- return;
422
- }
423
-
424
- const parentId = node.id_parent;
425
- const nodeDepth = node.depth;
426
-
427
- // Находим потомков, которые были напрямую под этим узлом
428
- for (let i = index + 1; i < arr.length; i++) {
429
- const next = arr[i];
430
- if (next.depth <= nodeDepth) {
431
- break;
432
- }
433
- if (next.depth === nodeDepth + 1) {
434
- // потомок становится ребёнком родителя удалённого узла
435
- next.id_parent = parentId ?? null;
436
- next.depth = nodeDepth; // поднимаем на один уровень вверх
437
- } else if (next.depth > nodeDepth + 1) {
438
- // поднимаем остальные на один уровень вверх
439
- next.depth -= 1;
440
- }
441
- }
442
-
443
- // Удаляем сам элемент
444
- arr.splice(index, 1);
445
-
446
- // Если id не временный — добавляем в список на удаление
447
- if (!node.id.includes(NEW_ITEM_PREFIX)) {
448
- this.deletedIds.push(node.id);
449
- }
450
-
451
- this._scheduleRecalc(arr);
452
- }
453
-
454
- /**
455
- * Добавляет новый элемент в дерево.
456
- * По умолчанию он создаётся как дочерний элемент root.
457
- */
458
- protected addNewItem(): void {
459
- const arr = [...this.flatTree()];
460
-
461
- const rootNode = arr.find((n) => n.title === this.ROOT_TITLE);
462
-
463
- if (!rootNode) {
464
- console.error('Root элемент не найден. Новый пункт не может быть добавлен.');
465
- return;
466
- }
467
-
468
- const newNode: FlatNode = {
469
- id: `${NEW_ITEM_PREFIX}${crypto.randomUUID()}`,
470
- id_parent: rootNode.id,
471
- title: 'Новый пункт меню',
472
- route: '',
473
- icon: '',
474
- order_num: 1,
475
- allowed_roles: null,
476
- collapsed: true,
477
- code: '',
478
- depth: rootNode.depth + 1,
479
- };
480
-
481
- const insertIndex = arr.findIndex((n) => n.id === rootNode.id) + 1;
482
- arr.splice(insertIndex, 0, newNode);
483
-
484
- this._scheduleRecalc(arr);
485
- }
486
-
487
- /**
488
- * Сбрасывает текущее состояние в исходное
489
- */
490
- protected reset(): void {
491
- const originalMenu = structuredClone(this._store.originalMenu);
492
- this.flatTree.set(this._convertToFlatNode(originalMenu));
493
- this.deletedIds = [];
494
- }
495
-
496
- /**
497
- * Проверяет, находится ли элемент в текущей перетаскиваемой ветке
498
- */
499
- protected isDragged(node: FlatNode): boolean {
500
- return this.draggedBranch().some((n) => n.id === node.id);
501
- }
502
-
503
- /**
504
- * Собирает всю ветку элементов начиная с указанного узла (включая потомков)
505
- */
506
- private _collectBranch(arr: FlatNode[], root: FlatNode): FlatNode[] {
507
- const start = arr.indexOf(root);
508
- if (start < 0) {
509
- return [];
510
- }
511
- const branch: FlatNode[] = [{ ...root }];
512
- for (let i = start + 1; i < arr.length; i++) {
513
- const n = arr[i];
514
- if (n.depth > root.depth) {
515
- branch.push(n);
516
- } else {
517
- break;
518
- }
519
- }
520
- return branch;
521
- }
522
-
523
- /**
524
- * Сдвигает глубину всех элементов ветки на указанную разницу
525
- * Не допускает отрицательных глубин
526
- */
527
- private _applyDepthShift(branch: FlatNode[], diff: number): void {
528
- if (diff === 0) {
529
- return;
530
- }
531
- for (const n of branch) {
532
- n.depth = Math.max(0, n.depth + diff);
533
- }
534
- }
535
-
536
- /**
537
- * Преобразует иерархический JSON в плоский массив FlatNode[]
538
- * Сохраняет порядок элементов и их вложенность
539
- */
540
- private _convertToFlatNode(data: IClsMenuItem[]): FlatNode[] {
541
- // Глубокая копия, чтобы не портить оригинал
542
- const cloned = structuredClone(data);
543
-
544
- const map = new Map<string, IClsMenuItem>();
545
- const roots: IClsMenuItem[] = [];
546
-
547
- for (const item of cloned) {
548
- map.set(item.id, item);
549
- }
550
-
551
- for (const item of cloned) {
552
- if (item.id_parent && map.has(item.id_parent)) {
553
- const parent = map.get(item.id_parent)!;
554
- if (!parent.children) {
555
- parent.children = [];
556
- }
557
- parent.children.push(item);
558
- } else {
559
- roots.push(item);
560
- }
561
- }
562
-
563
- const flat: FlatNode[] = [];
564
- const walk = (node: IClsMenuItem, depth: number): void => {
565
- flat.push({
566
- id: node.id,
567
- id_parent: node.id_parent,
568
- title: node.title ?? '',
569
- route: node.route ?? '',
570
- icon: node.icon ?? '',
571
- order_num: node.order_num ?? 0,
572
- allowed_roles: node.allowed_roles?.join(',') ?? null,
573
- collapsed: node.title !== ROOT_TITLE,
574
- code: node.code ?? '',
575
- depth,
576
- });
577
-
578
- if (node.children?.length) {
579
- const sortedChildren = [...node.children].sort(
580
- (a, b) => (a.order_num ?? 0) - (b.order_num ?? 0)
581
- );
582
- for (const child of sortedChildren) {
583
- walk(child, depth + 1);
584
- }
585
- }
586
- };
587
-
588
- const sortedRoots = [...roots].sort((a, b) => (a.order_num ?? 0) - (b.order_num ?? 0));
589
- for (const root of sortedRoots) {
590
- walk(root, 0);
591
- }
592
-
593
- return flat;
594
- }
595
-
596
- /**
597
- * Возвращает список видимых элементов на основе флагов collapsed
598
- * Использует стек для отслеживания свернутости на каждом уровне
599
- */
600
- private _getVisibleFrom(arr: FlatNode[] | (() => FlatNode[])): FlatNode[] {
601
- const source = typeof arr === 'function' ? arr() : arr;
602
- const out: FlatNode[] = [];
603
- const collapsedStack: boolean[] = [];
604
-
605
- for (const n of source) {
606
- while (collapsedStack.length > n.depth) {
607
- collapsedStack.pop();
608
- }
609
-
610
- if (!collapsedStack.includes(true)) {
611
- out.push(n);
612
- collapsedStack[n.depth] = !!n.collapsed;
613
- }
614
- }
615
-
616
- return out;
617
- }
618
-
619
- /**
620
- * Пересчитывает order_num и id_parent у всех элементов массива
621
- * После перемещений поддерживает корректную структуру дерева
622
- * order_num назначается относительно родителя (1..N)
623
- */
624
- private _recalculateTree(arr: FlatNode[]): void {
625
- const parents: FlatNode[] = [];
626
- const childCounters = new Map<string | null, number>();
627
-
628
- for (const node of arr) {
629
- while (parents.length > 0 && parents[parents.length - 1].depth >= node.depth) {
630
- parents.pop();
631
- }
632
-
633
- const parent = parents.length > 0 ? parents[parents.length - 1] : null;
634
- node.id_parent = parent ? parent.id : null;
635
-
636
- // вычисляем порядковый номер среди братьев
637
- if (node.title !== ROOT_TITLE) {
638
- const parentId = node.id_parent ?? null;
639
- const currentCount = childCounters.get(parentId) ?? 1;
640
- node.order_num = currentCount;
641
- childCounters.set(parentId, currentCount + 1);
642
- }
643
-
644
- parents.push(node);
645
- }
646
- }
647
-
648
- /**
649
- * Асинхронно планирует пересчет дерева через requestAnimationFrame
650
- * Это предотвращает множественные лишние пересчеты при частых изменениях
651
- */
652
- private _scheduleRecalc(arr: FlatNode[]): void {
653
- if (this._pendingRecalc) {
654
- return;
655
- }
656
-
657
- this._pendingRecalc = true;
658
- requestAnimationFrame(() => {
659
- this._recalculateTree([...arr]);
660
- const current = this.flatTree();
661
- if (!this._arraysEqual(current, arr)) {
662
- this.flatTree.set([...arr]);
663
- }
664
- this._pendingRecalc = false;
665
- });
666
- }
667
-
668
- /**
669
- * Проверяет равенство двух массивов FlatNode по ключевым свойствам
670
- */
671
- private _arraysEqual(a: FlatNode[], b: FlatNode[]): boolean {
672
- if (a.length !== b.length) {
673
- return false;
674
- }
675
- for (const [i, element] of a.entries()) {
676
- if (
677
- element.id !== b[i].id ||
678
- element.depth !== b[i].depth ||
679
- element.order_num !== b[i].order_num
680
- ) {
681
- return false;
682
- }
683
- }
684
-
685
- return true;
686
- }
687
- }