@simplysm/angular 14.0.7 → 14.0.9

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 (294) hide show
  1. package/README.md +234 -246
  2. package/dist/core/commons.d.ts.map +1 -1
  3. package/dist/core/directives/sd-events.directive.d.ts.map +1 -1
  4. package/dist/core/directives/sd-invalid.directive.d.ts.map +1 -1
  5. package/dist/core/directives/sd-item-of-template.directive.d.ts.map +1 -1
  6. package/dist/core/directives/sd-ripple.directive.d.ts.map +1 -1
  7. package/dist/core/directives/sd-router-link.directive.d.ts.map +1 -1
  8. package/dist/core/directives/sd-show-effect.directive.d.ts.map +1 -1
  9. package/dist/core/directives/sd-typed-template.directive.d.ts.map +1 -1
  10. package/dist/core/pipes/format.pipe.d.ts.map +1 -1
  11. package/dist/core/plugins/commands/findTopOpenModalEl.d.ts.map +1 -1
  12. package/dist/core/plugins/commands/sd-insert-command-event.plugin.d.ts.map +1 -1
  13. package/dist/core/plugins/commands/sd-refresh-command-event.plugin.d.ts.map +1 -1
  14. package/dist/core/plugins/commands/sd-save-command-event.plugin.d.ts.map +1 -1
  15. package/dist/core/plugins/events/sd-intersection-event.plugin.d.ts.map +1 -1
  16. package/dist/core/plugins/events/sd-option-event.plugin.d.ts.map +1 -1
  17. package/dist/core/plugins/events/sd-resize-event.plugin.d.ts.map +1 -1
  18. package/dist/core/plugins/sd-global-error-handler.plugin.d.ts.map +1 -1
  19. package/dist/core/provideSdAngular.d.ts.map +1 -1
  20. package/dist/core/providers/sd-angular-config.provider.d.ts.map +1 -1
  21. package/dist/core/providers/sd-app-structure.provider.d.ts.map +1 -1
  22. package/dist/core/providers/sd-file-dialog.provider.d.ts.map +1 -1
  23. package/dist/core/providers/sd-local-storage.provider.d.ts.map +1 -1
  24. package/dist/core/providers/sd-navigate-window.provider.d.ts.map +1 -1
  25. package/dist/core/providers/sd-print.provider.d.ts +7 -2
  26. package/dist/core/providers/sd-print.provider.d.ts.map +1 -1
  27. package/dist/core/providers/sd-service-client-factory.provider.d.ts.map +1 -1
  28. package/dist/core/providers/sd-shared-data.provider.d.ts +3 -0
  29. package/dist/core/providers/sd-shared-data.provider.d.ts.map +1 -1
  30. package/dist/core/providers/sd-system-config.provider.d.ts.map +1 -1
  31. package/dist/core/providers/sd-system-log.provider.d.ts.map +1 -1
  32. package/dist/core/providers/sd-theme-provider.d.ts.map +1 -1
  33. package/dist/core/utils/TDirectiveInputSignals.d.ts +4 -0
  34. package/dist/core/utils/TDirectiveInputSignals.d.ts.map +1 -1
  35. package/dist/core/utils/injectParent.d.ts +7 -0
  36. package/dist/core/utils/injectParent.d.ts.map +1 -0
  37. package/dist/core/utils/injectParent.js +26 -0
  38. package/dist/core/utils/setSafeStyle.d.ts.map +1 -1
  39. package/dist/core/utils/setups/setupBgTheme.d.ts.map +1 -1
  40. package/dist/core/utils/setups/setupCanDeactivate.d.ts.map +1 -1
  41. package/dist/core/utils/setups/setupCloserWhenSingleSelectionChange.d.ts +9 -0
  42. package/dist/core/utils/setups/setupCloserWhenSingleSelectionChange.d.ts.map +1 -0
  43. package/dist/core/utils/setups/setupCloserWhenSingleSelectionChange.js +20 -0
  44. package/dist/core/utils/setups/setupCumulateSelectedKeys.d.ts +9 -0
  45. package/dist/core/utils/setups/setupCumulateSelectedKeys.d.ts.map +1 -0
  46. package/dist/core/utils/setups/setupCumulateSelectedKeys.js +27 -0
  47. package/dist/core/utils/setups/setupInvalid.d.ts.map +1 -1
  48. package/dist/core/utils/setups/setupModelHook.d.ts.map +1 -1
  49. package/dist/core/utils/setups/setupRevealOnShow.d.ts.map +1 -1
  50. package/dist/core/utils/setups/setupRipple.d.ts.map +1 -1
  51. package/dist/core/utils/useCurrentPageCodeSignal.d.ts.map +1 -1
  52. package/dist/core/utils/useExpandingManager.d.ts.map +1 -1
  53. package/dist/core/utils/useFullPageCodeSignal.d.ts.map +1 -1
  54. package/dist/core/utils/useSdSystemConfigResource.d.ts.map +1 -1
  55. package/dist/core/utils/useSelectionManager.d.ts.map +1 -1
  56. package/dist/core/utils/useSortingManager.d.ts.map +1 -1
  57. package/dist/core/utils/useViewTitleSignal.d.ts.map +1 -1
  58. package/dist/core/utils/useViewTypeSignal.d.ts.map +1 -1
  59. package/dist/features/address/sd-address-search.modal.d.ts +19 -0
  60. package/dist/features/address/sd-address-search.modal.d.ts.map +1 -0
  61. package/dist/features/address/sd-address-search.modal.js +88 -0
  62. package/dist/features/base/sd-base-container.control.d.ts +26 -0
  63. package/dist/features/base/sd-base-container.control.d.ts.map +1 -0
  64. package/dist/features/base/sd-base-container.control.js +183 -0
  65. package/dist/features/data-view/sd-data-detail.control.d.ts +70 -0
  66. package/dist/features/data-view/sd-data-detail.control.d.ts.map +1 -0
  67. package/dist/features/data-view/sd-data-detail.control.js +606 -0
  68. package/dist/features/data-view/sd-data-select-button.control.d.ts +35 -0
  69. package/dist/features/data-view/sd-data-select-button.control.d.ts.map +1 -0
  70. package/dist/features/data-view/sd-data-select-button.control.js +219 -0
  71. package/dist/features/data-view/sd-data-sheet-column.directive.d.ts +8 -0
  72. package/dist/features/data-view/sd-data-sheet-column.directive.d.ts.map +1 -0
  73. package/dist/features/data-view/sd-data-sheet-column.directive.js +15 -0
  74. package/dist/features/data-view/sd-data-sheet.control.d.ts +131 -0
  75. package/dist/features/data-view/sd-data-sheet.control.d.ts.map +1 -0
  76. package/dist/features/data-view/sd-data-sheet.control.js +1152 -0
  77. package/dist/features/shared-data/sd-shared-data-select-button.control.d.ts +16 -0
  78. package/dist/features/shared-data/sd-shared-data-select-button.control.d.ts.map +1 -0
  79. package/dist/features/shared-data/sd-shared-data-select-button.control.js +66 -0
  80. package/dist/features/shared-data/sd-shared-data-select-list.control.d.ts +33 -0
  81. package/dist/features/shared-data/sd-shared-data-select-list.control.d.ts.map +1 -0
  82. package/dist/features/shared-data/sd-shared-data-select-list.control.js +346 -0
  83. package/dist/features/shared-data/sd-shared-data-select.control.d.ts +50 -0
  84. package/dist/features/shared-data/sd-shared-data-select.control.d.ts.map +1 -0
  85. package/dist/features/shared-data/sd-shared-data-select.control.js +425 -0
  86. package/dist/index.d.ts +13 -1
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +15 -0
  89. package/dist/ui/data/list/sd-list-item.control.d.ts +3 -1
  90. package/dist/ui/data/list/sd-list-item.control.d.ts.map +1 -1
  91. package/dist/ui/data/list/sd-list-item.control.js +9 -5
  92. package/dist/ui/data/list/sd-list.control.d.ts.map +1 -1
  93. package/dist/ui/data/list/sd-list.control.js +1 -1
  94. package/dist/ui/data/sheet/sd-sheet-column.directive.d.ts +8 -1
  95. package/dist/ui/data/sheet/sd-sheet-column.directive.d.ts.map +1 -1
  96. package/dist/ui/data/sheet/sd-sheet-config.modal.d.ts.map +1 -1
  97. package/dist/ui/data/sheet/sd-sheet-config.modal.js +1 -1
  98. package/dist/ui/data/sheet/sd-sheet.control.d.ts +6 -5
  99. package/dist/ui/data/sheet/sd-sheet.control.d.ts.map +1 -1
  100. package/dist/ui/data/sheet/sd-sheet.control.js +19 -17
  101. package/dist/ui/data/sheet/types.d.ts.map +1 -1
  102. package/dist/ui/data/sheet/useSheetCellAgent.d.ts.map +1 -1
  103. package/dist/ui/data/sheet/useSheetCellAgent.js +1 -2
  104. package/dist/ui/data/sheet/useSheetColumnFixing.d.ts.map +1 -1
  105. package/dist/ui/data/sheet/useSheetDomAccessor.d.ts.map +1 -1
  106. package/dist/ui/data/sheet/useSheetLayoutEngine.d.ts.map +1 -1
  107. package/dist/ui/data/sheet/useSheetLayoutEngine.js +1 -0
  108. package/dist/ui/form/button/sd-additional-button.control.d.ts.map +1 -1
  109. package/dist/ui/form/button/sd-additional-button.control.js +1 -1
  110. package/dist/ui/form/button/sd-anchor.control.d.ts.map +1 -1
  111. package/dist/ui/form/button/sd-anchor.control.js +1 -1
  112. package/dist/ui/form/button/sd-button.control.d.ts.map +1 -1
  113. package/dist/ui/form/button/sd-button.control.js +1 -1
  114. package/dist/ui/form/button/sd-modal-select-button.control.d.ts +16 -18
  115. package/dist/ui/form/button/sd-modal-select-button.control.d.ts.map +1 -1
  116. package/dist/ui/form/button/sd-modal-select-button.control.js +22 -39
  117. package/dist/ui/form/checkbox/sd-checkbox-group-item.control.d.ts.map +1 -1
  118. package/dist/ui/form/checkbox/sd-checkbox-group-item.control.js +1 -1
  119. package/dist/ui/form/checkbox/sd-checkbox-group.control.d.ts.map +1 -1
  120. package/dist/ui/form/checkbox/sd-checkbox-group.control.js +1 -1
  121. package/dist/ui/form/checkbox/sd-checkbox.control.d.ts.map +1 -1
  122. package/dist/ui/form/checkbox/sd-checkbox.control.js +1 -1
  123. package/dist/ui/form/checkbox/sd-switch.control.d.ts.map +1 -1
  124. package/dist/ui/form/checkbox/sd-switch.control.js +1 -1
  125. package/dist/ui/form/choice/sd-state-preset.control.d.ts.map +1 -1
  126. package/dist/ui/form/choice/sd-state-preset.control.js +1 -1
  127. package/dist/ui/form/editor/sd-tiptap-editor.control.d.ts +18 -1
  128. package/dist/ui/form/editor/sd-tiptap-editor.control.d.ts.map +1 -1
  129. package/dist/ui/form/editor/sd-tiptap-editor.control.js +18 -2
  130. package/dist/ui/form/input/sd-date-range.picker.d.ts.map +1 -1
  131. package/dist/ui/form/input/sd-date-range.picker.js +1 -1
  132. package/dist/ui/form/input/sd-numpad.control.d.ts.map +1 -1
  133. package/dist/ui/form/input/sd-numpad.control.js +1 -1
  134. package/dist/ui/form/input/sd-range.control.d.ts.map +1 -1
  135. package/dist/ui/form/input/sd-range.control.js +1 -1
  136. package/dist/ui/form/input/sd-textarea.control.d.ts.map +1 -1
  137. package/dist/ui/form/input/sd-textarea.control.js +1 -1
  138. package/dist/ui/form/input/sd-textfield-type-handlers.d.ts.map +1 -1
  139. package/dist/ui/form/input/sd-textfield.control.d.ts.map +1 -1
  140. package/dist/ui/form/input/sd-textfield.control.js +1 -1
  141. package/dist/ui/form/sd-form.control.d.ts.map +1 -1
  142. package/dist/ui/form/sd-form.control.js +1 -1
  143. package/dist/ui/form/select/sd-select-button.control.d.ts.map +1 -1
  144. package/dist/ui/form/select/sd-select-button.control.js +1 -1
  145. package/dist/ui/form/select/sd-select-item.control.d.ts +1 -1
  146. package/dist/ui/form/select/sd-select-item.control.d.ts.map +1 -1
  147. package/dist/ui/form/select/sd-select-item.control.js +1 -1
  148. package/dist/ui/form/select/sd-select.control.d.ts +9 -6
  149. package/dist/ui/form/select/sd-select.control.d.ts.map +1 -1
  150. package/dist/ui/form/select/sd-select.control.js +1 -1
  151. package/dist/ui/layout/dock/sd-dock-container.control.d.ts.map +1 -1
  152. package/dist/ui/layout/dock/sd-dock-container.control.js +1 -1
  153. package/dist/ui/layout/dock/sd-dock.control.d.ts +2 -0
  154. package/dist/ui/layout/dock/sd-dock.control.d.ts.map +1 -1
  155. package/dist/ui/layout/dock/sd-dock.control.js +13 -4
  156. package/dist/ui/layout/kanban/sd-kanban-board.control.d.ts.map +1 -1
  157. package/dist/ui/layout/kanban/sd-kanban-board.control.js +1 -1
  158. package/dist/ui/layout/kanban/sd-kanban-lane.control.d.ts.map +1 -1
  159. package/dist/ui/layout/kanban/sd-kanban-lane.control.js +8 -2
  160. package/dist/ui/layout/kanban/sd-kanban.control.d.ts.map +1 -1
  161. package/dist/ui/layout/kanban/sd-kanban.control.js +1 -1
  162. package/dist/ui/layout/sd-card.directive.d.ts.map +1 -1
  163. package/dist/ui/layout/sd-gap.control.d.ts +2 -2
  164. package/dist/ui/layout/sd-gap.control.d.ts.map +1 -1
  165. package/dist/ui/layout/sd-gap.control.js +1 -1
  166. package/dist/ui/layout/sd-pane.directive.d.ts.map +1 -1
  167. package/dist/ui/layout/view/sd-view-item.control.d.ts.map +1 -1
  168. package/dist/ui/layout/view/sd-view-item.control.js +1 -1
  169. package/dist/ui/layout/view/sd-view.control.d.ts.map +1 -1
  170. package/dist/ui/layout/view/sd-view.control.js +1 -1
  171. package/dist/ui/navigation/collapse/sd-collapse-icon.control.d.ts.map +1 -1
  172. package/dist/ui/navigation/collapse/sd-collapse-icon.control.js +1 -1
  173. package/dist/ui/navigation/collapse/sd-collapse.control.d.ts.map +1 -1
  174. package/dist/ui/navigation/collapse/sd-collapse.control.js +1 -1
  175. package/dist/ui/navigation/menu-utils.d.ts.map +1 -1
  176. package/dist/ui/navigation/pagination/sd-pagination.control.d.ts.map +1 -1
  177. package/dist/ui/navigation/pagination/sd-pagination.control.js +8 -4
  178. package/dist/ui/navigation/sidebar/sd-sidebar-container.control.d.ts.map +1 -1
  179. package/dist/ui/navigation/sidebar/sd-sidebar-container.control.js +2 -2
  180. package/dist/ui/navigation/sidebar/sd-sidebar-menu.control.d.ts.map +1 -1
  181. package/dist/ui/navigation/sidebar/sd-sidebar-menu.control.js +1 -1
  182. package/dist/ui/navigation/sidebar/sd-sidebar-user.control.d.ts.map +1 -1
  183. package/dist/ui/navigation/sidebar/sd-sidebar-user.control.js +1 -1
  184. package/dist/ui/navigation/sidebar/sd-sidebar.control.d.ts.map +1 -1
  185. package/dist/ui/navigation/sidebar/sd-sidebar.control.js +1 -1
  186. package/dist/ui/navigation/tab/sd-tab-item.control.d.ts.map +1 -1
  187. package/dist/ui/navigation/tab/sd-tab-item.control.js +1 -1
  188. package/dist/ui/navigation/tab/sd-tab.control.d.ts.map +1 -1
  189. package/dist/ui/navigation/tab/sd-tab.control.js +1 -1
  190. package/dist/ui/navigation/tab/sd-tabview-item.control.d.ts.map +1 -1
  191. package/dist/ui/navigation/tab/sd-tabview-item.control.js +1 -1
  192. package/dist/ui/navigation/tab/sd-tabview.control.d.ts.map +1 -1
  193. package/dist/ui/navigation/tab/sd-tabview.control.js +1 -1
  194. package/dist/ui/navigation/topbar/sd-topbar-container.control.d.ts.map +1 -1
  195. package/dist/ui/navigation/topbar/sd-topbar-container.control.js +1 -1
  196. package/dist/ui/navigation/topbar/sd-topbar-menu.control.d.ts.map +1 -1
  197. package/dist/ui/navigation/topbar/sd-topbar-menu.control.js +1 -1
  198. package/dist/ui/navigation/topbar/sd-topbar-user.control.d.ts.map +1 -1
  199. package/dist/ui/navigation/topbar/sd-topbar-user.control.js +1 -1
  200. package/dist/ui/navigation/topbar/sd-topbar.control.d.ts.map +1 -1
  201. package/dist/ui/navigation/topbar/sd-topbar.control.js +1 -1
  202. package/dist/ui/overlay/busy/sd-busy-container.control.d.ts.map +1 -1
  203. package/dist/ui/overlay/busy/sd-busy-container.control.js +1 -1
  204. package/dist/ui/overlay/busy/sd-busy.provider.d.ts.map +1 -1
  205. package/dist/ui/overlay/dropdown/sd-dropdown-popup.control.d.ts.map +1 -1
  206. package/dist/ui/overlay/dropdown/sd-dropdown-popup.control.js +2 -2
  207. package/dist/ui/overlay/dropdown/sd-dropdown.control.d.ts.map +1 -1
  208. package/dist/ui/overlay/dropdown/sd-dropdown.control.js +1 -1
  209. package/dist/ui/overlay/modal/sd-confirm-modal.control.d.ts.map +1 -1
  210. package/dist/ui/overlay/modal/sd-confirm-modal.control.js +1 -1
  211. package/dist/ui/overlay/modal/sd-modal.control.d.ts +1 -0
  212. package/dist/ui/overlay/modal/sd-modal.control.d.ts.map +1 -1
  213. package/dist/ui/overlay/modal/sd-modal.control.js +10 -2
  214. package/dist/ui/overlay/modal/sd-modal.provider.d.ts +9 -3
  215. package/dist/ui/overlay/modal/sd-modal.provider.d.ts.map +1 -1
  216. package/dist/ui/overlay/modal/sd-prompt-modal.control.d.ts.map +1 -1
  217. package/dist/ui/overlay/modal/sd-prompt-modal.control.js +1 -1
  218. package/dist/ui/overlay/toast/sd-toast-container.control.d.ts.map +1 -1
  219. package/dist/ui/overlay/toast/sd-toast-container.control.js +1 -1
  220. package/dist/ui/overlay/toast/sd-toast.control.d.ts.map +1 -1
  221. package/dist/ui/overlay/toast/sd-toast.control.js +1 -1
  222. package/dist/ui/overlay/toast/sd-toast.provider.d.ts.map +1 -1
  223. package/dist/ui/overlay/toast/sd-toast.provider.js +7 -3
  224. package/dist/ui/visual/sd-barcode.control.d.ts.map +1 -1
  225. package/dist/ui/visual/sd-barcode.control.js +1 -1
  226. package/dist/ui/visual/sd-calendar.control.d.ts.map +1 -1
  227. package/dist/ui/visual/sd-calendar.control.js +1 -1
  228. package/dist/ui/visual/sd-echarts.control.d.ts.map +1 -1
  229. package/dist/ui/visual/sd-echarts.control.js +1 -1
  230. package/dist/ui/visual/sd-label.control.d.ts.map +1 -1
  231. package/dist/ui/visual/sd-label.control.js +1 -1
  232. package/dist/ui/visual/sd-note.control.d.ts.map +1 -1
  233. package/dist/ui/visual/sd-note.control.js +1 -1
  234. package/dist/ui/visual/sd-progress.control.d.ts +1 -0
  235. package/dist/ui/visual/sd-progress.control.d.ts.map +1 -1
  236. package/dist/ui/visual/sd-progress.control.js +5 -4
  237. package/docs/core.md +877 -0
  238. package/docs/features.md +377 -0
  239. package/docs/styling.md +309 -0
  240. package/docs/ui-data.md +233 -0
  241. package/docs/ui-form.md +421 -0
  242. package/docs/ui-layout.md +216 -0
  243. package/docs/ui-navigation.md +279 -0
  244. package/docs/ui-overlay.md +330 -0
  245. package/docs/ui-visual.md +131 -0
  246. package/package.json +5 -5
  247. package/src/core/providers/sd-print.provider.ts +10 -2
  248. package/src/core/providers/sd-shared-data.provider.ts +3 -0
  249. package/src/core/utils/TDirectiveInputSignals.ts +5 -0
  250. package/src/core/utils/injectParent.ts +41 -0
  251. package/src/core/utils/setups/setupCloserWhenSingleSelectionChange.ts +29 -0
  252. package/src/core/utils/setups/setupCumulateSelectedKeys.ts +38 -0
  253. package/src/features/address/sd-address-search.modal.ts +119 -0
  254. package/src/features/base/sd-base-container.control.ts +113 -0
  255. package/src/features/data-view/sd-data-detail.control.ts +394 -0
  256. package/src/features/data-view/sd-data-select-button.control.ts +210 -0
  257. package/src/features/data-view/sd-data-sheet-column.directive.ts +10 -0
  258. package/src/features/data-view/sd-data-sheet.control.ts +850 -0
  259. package/src/features/shared-data/sd-shared-data-select-button.control.ts +64 -0
  260. package/src/features/shared-data/sd-shared-data-select-list.control.ts +245 -0
  261. package/src/features/shared-data/sd-shared-data-select.control.ts +364 -0
  262. package/src/index.ts +39 -1
  263. package/src/scss.d.ts +5 -0
  264. package/src/ui/data/list/sd-list-item.control.ts +4 -2
  265. package/src/ui/data/sheet/sd-sheet-column.directive.ts +9 -1
  266. package/src/ui/data/sheet/sd-sheet.control.ts +23 -19
  267. package/src/ui/data/sheet/useSheetCellAgent.ts +1 -2
  268. package/src/ui/data/sheet/useSheetLayoutEngine.ts +1 -0
  269. package/src/ui/form/button/sd-modal-select-button.control.ts +41 -59
  270. package/src/ui/form/editor/sd-tiptap-editor.control.ts +35 -1
  271. package/src/ui/form/select/sd-select-item.control.ts +1 -1
  272. package/src/ui/form/select/sd-select.control.ts +7 -4
  273. package/src/ui/layout/dock/sd-dock.control.ts +15 -2
  274. package/src/ui/layout/kanban/sd-kanban-lane.control.ts +6 -3
  275. package/src/ui/navigation/pagination/sd-pagination.control.ts +5 -3
  276. package/src/ui/navigation/sidebar/sd-sidebar-container.control.ts +1 -1
  277. package/src/ui/overlay/dropdown/sd-dropdown-popup.control.ts +1 -1
  278. package/src/ui/overlay/modal/sd-modal.control.ts +9 -0
  279. package/src/ui/overlay/modal/sd-modal.provider.ts +15 -3
  280. package/src/ui/overlay/toast/sd-toast.provider.ts +9 -3
  281. package/src/ui/visual/sd-progress.control.ts +4 -1
  282. package/docs/commons-and-configuration.md +0 -34
  283. package/docs/data-display-components.md +0 -146
  284. package/docs/directives.md +0 -158
  285. package/docs/event-plugins.md +0 -109
  286. package/docs/form-components.md +0 -362
  287. package/docs/hooks-and-utilities.md +0 -175
  288. package/docs/layout-components.md +0 -140
  289. package/docs/navigation-components.md +0 -200
  290. package/docs/overlay-components.md +0 -193
  291. package/docs/pipes.md +0 -25
  292. package/docs/providers.md +0 -448
  293. package/docs/setup-functions.md +0 -66
  294. package/docs/visual-components.md +0 -89
@@ -0,0 +1,119 @@
1
+ import {
2
+ ChangeDetectionStrategy,
3
+ Component,
4
+ ElementRef,
5
+ output,
6
+ signal,
7
+ viewChild,
8
+ ViewEncapsulation,
9
+ } from "@angular/core";
10
+ import type { OnInit } from "@angular/core";
11
+ import { SdBusyContainerControl } from "../../ui/overlay/busy/sd-busy-container.control";
12
+ import type { ISdModal } from "../../ui/overlay/modal/sd-modal.provider";
13
+
14
+ declare const daum: {
15
+ postcode: {
16
+ load(callback: () => void): void;
17
+ };
18
+ Postcode: new (options: {
19
+ oncomplete: (data: IDaumPostcodeData) => void;
20
+ onresize: (size: { height: number }) => void;
21
+ width: string;
22
+ height: string;
23
+ }) => { embed(el: HTMLElement, options: { autoClose: boolean }): void };
24
+ };
25
+
26
+ interface IDaumPostcodeData {
27
+ zonecode: string;
28
+ roadAddress: string;
29
+ jibunAddress: string;
30
+ userSelectedType: "R" | "J";
31
+ bname: string;
32
+ buildingName: string;
33
+ apartment: "Y" | "N";
34
+ }
35
+
36
+ export interface IAddress {
37
+ postNumber: string | undefined;
38
+ address: string | undefined;
39
+ buildingName: string | undefined;
40
+ }
41
+
42
+ @Component({
43
+ selector: "sd-address-search-modal",
44
+ changeDetection: ChangeDetectionStrategy.OnPush,
45
+ encapsulation: ViewEncapsulation.None,
46
+ standalone: true,
47
+ imports: [SdBusyContainerControl],
48
+ template: `
49
+ <sd-busy-container [busy]="!initialized()">
50
+ <div #content style="min-height: 100px;"></div>
51
+ </sd-busy-container>
52
+ `,
53
+ })
54
+ export class SdAddressSearchModal implements ISdModal<IAddress>, OnInit {
55
+ contentElRef = viewChild.required<"content", ElementRef<HTMLElement>>("content", {
56
+ read: ElementRef,
57
+ });
58
+
59
+ close = output<IAddress>();
60
+
61
+ initialized = signal(false);
62
+
63
+ ngOnInit() {
64
+ void this.initAsync();
65
+ }
66
+
67
+ private async initAsync() {
68
+ if (!document.getElementById("daum_address")) {
69
+ await new Promise<void>((resolve) => {
70
+ const scriptEl = document.createElement("script");
71
+ scriptEl.src = "//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js";
72
+ scriptEl.setAttribute("id", "daum_address");
73
+
74
+ scriptEl.onload = (): void => {
75
+ daum.postcode.load(() => {
76
+ resolve();
77
+ });
78
+ };
79
+ document.head.appendChild(scriptEl);
80
+ });
81
+ }
82
+
83
+ const contentEl = this.contentElRef().nativeElement;
84
+
85
+ new daum.Postcode({
86
+ oncomplete: (data: IDaumPostcodeData): void => {
87
+ const addr = data.userSelectedType === "R" ? data.roadAddress : data.jibunAddress;
88
+
89
+ let extraAddr = "";
90
+ if (data.userSelectedType === "R") {
91
+ if (data.bname !== "" && /[동로가]$/g.test(data.bname)) {
92
+ extraAddr += data.bname;
93
+ }
94
+
95
+ if (data.buildingName !== "" && data.apartment === "Y") {
96
+ extraAddr += extraAddr !== "" ? ", " + data.buildingName : data.buildingName;
97
+ }
98
+
99
+ if (extraAddr !== "") {
100
+ extraAddr = " (" + extraAddr + ")";
101
+ }
102
+ }
103
+
104
+ this.close.emit({
105
+ postNumber: data.zonecode,
106
+ address: addr + extraAddr,
107
+ buildingName: data.buildingName,
108
+ });
109
+ },
110
+ onresize: (size: { height: number }): void => {
111
+ contentEl.style.height = size.height + "px";
112
+ },
113
+ width: "100%",
114
+ height: "100%",
115
+ }).embed(contentEl, { autoClose: false });
116
+
117
+ this.initialized.set(true);
118
+ }
119
+ }
@@ -0,0 +1,113 @@
1
+ import { NgTemplateOutlet } from "@angular/common";
2
+ import {
3
+ booleanAttribute,
4
+ ChangeDetectionStrategy,
5
+ Component,
6
+ computed,
7
+ contentChild,
8
+ inject,
9
+ input,
10
+ TemplateRef,
11
+ ViewEncapsulation,
12
+ } from "@angular/core";
13
+ import { SdBusyContainerControl } from "../../ui/overlay/busy/sd-busy-container.control";
14
+ import { SdTopbarContainerControl } from "../../ui/navigation/topbar/sd-topbar-container.control";
15
+ import { SdTopbarControl } from "../../ui/navigation/topbar/sd-topbar.control";
16
+ import { SdAppStructureProvider } from "../../core/providers/sd-app-structure.provider";
17
+ import { SdActivatedModalProvider } from "../../ui/overlay/modal/sd-modal.provider";
18
+ import { useCurrentPageCodeSignal } from "../../core/utils/useCurrentPageCodeSignal";
19
+ import { useFullPageCodeSignal } from "../../core/utils/useFullPageCodeSignal";
20
+ import {
21
+ useViewTypeSignal,
22
+ type TSdViewType,
23
+ } from "../../core/utils/useViewTypeSignal";
24
+ import { injectParent } from "../../core/utils/injectParent";
25
+ import { NgIcon } from "@ng-icons/core";
26
+ import { tablerAlertTriangle } from "@ng-icons/tabler-icons";
27
+
28
+ @Component({
29
+ selector: "sd-base-container",
30
+ changeDetection: ChangeDetectionStrategy.OnPush,
31
+ encapsulation: ViewEncapsulation.None,
32
+ standalone: true,
33
+ imports: [
34
+ SdBusyContainerControl,
35
+ SdTopbarContainerControl,
36
+ SdTopbarControl,
37
+ NgTemplateOutlet,
38
+ NgIcon,
39
+ ],
40
+ template: `
41
+ <sd-busy-container [busy]="busy()" [message]="busyMessage()">
42
+ @if (initialized() === undefined || initialized()) {
43
+ @if (restricted()) {
44
+ <div class="fill tx-theme-gray-light p-xxl tx-center">
45
+ <br />
46
+ <ng-icon [svg]="tablerAlertTriangle" [size]="'5em'" />
47
+ <br />
48
+ <br />
49
+ '{{ modalOrPageTitle() }}'에 대한 사용권한이 없습니다. 시스템 관리자에게 문의하세요.
50
+ </div>
51
+ } @else if (currViewType() === "page") {
52
+ <sd-topbar-container>
53
+ <sd-topbar>
54
+ <h4>{{ modalOrPageTitle() }}</h4>
55
+
56
+ <ng-template [ngTemplateOutlet]="pageTopbarTplRef() ?? null" />
57
+ </sd-topbar>
58
+
59
+ <div class="fill">
60
+ <ng-template [ngTemplateOutlet]="contentTplRef()" />
61
+ </div>
62
+ </sd-topbar-container>
63
+ } @else if (currViewType() === "modal") {
64
+ <div class="flex-column fill">
65
+ <div class="flex-fill">
66
+ <ng-template [ngTemplateOutlet]="contentTplRef()" />
67
+ </div>
68
+ @if (modalBottomTplRef()) {
69
+ <div class="bdt bdt-theme-gray-lightest">
70
+ <ng-template [ngTemplateOutlet]="modalBottomTplRef() ?? null" />
71
+ </div>
72
+ }
73
+ </div>
74
+ } @else {
75
+ <ng-template [ngTemplateOutlet]="contentTplRef()" />
76
+ }
77
+ }
78
+ </sd-busy-container>
79
+ `,
80
+ })
81
+ export class SdBaseContainerControl {
82
+ private readonly _sdActivatedModal = inject(SdActivatedModalProvider, { optional: true });
83
+ private readonly _sdAppStructure = inject(SdAppStructureProvider);
84
+
85
+ private readonly _parent = injectParent();
86
+
87
+ private readonly _fullPageCode = useFullPageCodeSignal();
88
+ private readonly _currPageCode = useCurrentPageCodeSignal();
89
+
90
+ contentTplRef = contentChild.required("contentTpl", { read: TemplateRef });
91
+
92
+ pageTopbarTplRef = contentChild("pageTopbarTpl", { read: TemplateRef });
93
+ modalBottomTplRef = contentChild("modalBottomTpl", { read: TemplateRef });
94
+
95
+ private readonly _parentViewType = useViewTypeSignal(() => this._parent);
96
+ viewType = input<TSdViewType>();
97
+ currViewType = computed(() => this.viewType() ?? this._parentViewType());
98
+
99
+ header = input<string>();
100
+ modalOrPageTitle = computed(
101
+ () =>
102
+ this.header() ??
103
+ this._sdActivatedModal?.modalComponent()?.title() ??
104
+ this._sdAppStructure.getTitleByFullCode(this._currPageCode?.() ?? this._fullPageCode()),
105
+ );
106
+
107
+ initialized = input<boolean | undefined>(undefined);
108
+ restricted = input(false, { transform: booleanAttribute });
109
+ busy = input(false, { transform: booleanAttribute });
110
+ busyMessage = input<string>();
111
+
112
+ protected readonly tablerAlertTriangle = tablerAlertTriangle;
113
+ }
@@ -0,0 +1,394 @@
1
+ import { NgTemplateOutlet } from "@angular/common";
2
+ import {
3
+ ChangeDetectionStrategy,
4
+ Component,
5
+ contentChild,
6
+ Directive,
7
+ effect,
8
+ inject,
9
+ output,
10
+ signal,
11
+ type Signal,
12
+ TemplateRef,
13
+ viewChild,
14
+ ViewEncapsulation,
15
+ } from "@angular/core";
16
+ import { DateTime, obj } from "@simplysm/core-common";
17
+ import { TXT_CHANGE_IGNORE_CONFIRM } from "../../core/commons";
18
+ import { FormatPipe } from "../../core/pipes/format.pipe";
19
+ import { SdSharedDataProvider } from "../../core/providers/sd-shared-data.provider";
20
+ import { injectParent } from "../../core/utils/injectParent";
21
+ import { setupCanDeactivate } from "../../core/utils/setups/setupCanDeactivate";
22
+ import { useViewTypeSignal } from "../../core/utils/useViewTypeSignal";
23
+ import { SdButtonControl } from "../../ui/form/button/sd-button.control";
24
+ import { SdAnchorControl } from "../../ui/form/button/sd-anchor.control";
25
+ import { SdFormControl } from "../../ui/form/sd-form.control";
26
+ import { type ISdModal } from "../../ui/overlay/modal/sd-modal.provider";
27
+ import { SdToastProvider } from "../../ui/overlay/toast/sd-toast.provider";
28
+ import { SdBaseContainerControl } from "../base/sd-base-container.control";
29
+ import { NgIcon } from "@ng-icons/core";
30
+ import {
31
+ tablerDeviceFloppy,
32
+ tablerEraser,
33
+ tablerRefresh,
34
+ tablerRestore,
35
+ } from "@ng-icons/tabler-icons";
36
+
37
+ //#region Interface
38
+
39
+ export interface ISdDataDetailDataInfo {
40
+ isNew: boolean;
41
+ isDeleted: boolean;
42
+ lastModifiedAt: DateTime | undefined;
43
+ lastModifiedBy: string | undefined;
44
+ }
45
+
46
+ //#endregion
47
+
48
+ //#region AbsSdDataDetail
49
+
50
+ @Directive()
51
+ export abstract class AbsSdDataDetail<T extends object, R = boolean>
52
+ implements ISdModal<R>
53
+ {
54
+ //-- abstract
55
+
56
+ abstract canUse: Signal<boolean>;
57
+ abstract canEdit: Signal<boolean>;
58
+ canDelete?: Signal<boolean>;
59
+
60
+ prepareRefreshEffect?(): void;
61
+
62
+ abstract load():
63
+ | Promise<{ data: T; info: ISdDataDetailDataInfo }>
64
+ | { data: T; info: ISdDataDetailDataInfo };
65
+
66
+ toggleDelete?(del: boolean): Promise<R | undefined> | R | undefined;
67
+
68
+ submit?(data: T): Promise<R | undefined> | R | undefined;
69
+
70
+ //-- implement
71
+
72
+ private readonly _sdToast = inject(SdToastProvider);
73
+ private readonly _sdSharedData = inject(SdSharedDataProvider);
74
+
75
+ viewType = useViewTypeSignal(() => this);
76
+
77
+ busyCount = signal(0);
78
+ busyMessage = signal<string | undefined>(undefined);
79
+ initialized = signal(false);
80
+ close = output<R>();
81
+ actionTplRef?: TemplateRef<any>;
82
+
83
+ data = signal<T>({} as T);
84
+
85
+ dataInfo = signal<ISdDataDetailDataInfo | undefined>(undefined);
86
+
87
+ private _dataSnapshot?: T;
88
+
89
+ constructor() {
90
+ effect(() => {
91
+ this.prepareRefreshEffect?.();
92
+
93
+ queueMicrotask(async () => {
94
+ if (!this.canUse()) {
95
+ this.initialized.set(true);
96
+ return;
97
+ }
98
+
99
+ this.busyCount.update((v) => v + 1);
100
+ await this._sdToast.try(async () => {
101
+ await this._sdSharedData.wait();
102
+ await this.refresh();
103
+ });
104
+ this.busyCount.update((v) => v - 1);
105
+ this.initialized.set(true);
106
+ });
107
+ });
108
+
109
+ setupCanDeactivate(() => this.viewType() === "modal" || this.checkIgnoreChanges());
110
+ }
111
+
112
+ checkIgnoreChanges() {
113
+ return (
114
+ this._dataSnapshot == null ||
115
+ obj.equal(this.data(), this._dataSnapshot) ||
116
+ confirm(TXT_CHANGE_IGNORE_CONFIRM)
117
+ );
118
+ }
119
+
120
+ async doRefresh() {
121
+ if (this.busyCount() > 0) return;
122
+ if (!this.canUse()) return;
123
+ if (!this.checkIgnoreChanges()) return;
124
+
125
+ this.busyCount.update((v) => v + 1);
126
+ await this._sdToast.try(async () => {
127
+ await this.refresh();
128
+ });
129
+ this.busyCount.update((v) => v - 1);
130
+ }
131
+
132
+ async refresh() {
133
+ const result = await this.load();
134
+ this.data.set(result.data);
135
+ this.dataInfo.set(result.info);
136
+ if (!result.info.isNew) {
137
+ this._dataSnapshot = obj.clone(result.data);
138
+ }
139
+ }
140
+
141
+ async doToggleDelete(del: boolean) {
142
+ if (this.busyCount() > 0) return;
143
+ if (!this.canEdit()) return;
144
+ if (this.canDelete && !this.canDelete()) return;
145
+ if (!this.toggleDelete) return;
146
+
147
+ this.busyCount.update((v) => v + 1);
148
+ await this._sdToast.try(async () => {
149
+ const result = await this.toggleDelete!(del);
150
+ if (!result) return;
151
+
152
+ this._sdToast.success(`${del ? "삭제" : "복구"}되었습니다.`);
153
+
154
+ this.close.emit(result);
155
+ });
156
+ this.busyCount.update((v) => v - 1);
157
+ }
158
+
159
+ async doSubmit(opt?: { permCheck?: boolean; hideNoChangeMessage?: boolean }) {
160
+ if (this.busyCount() > 0) return;
161
+ if (opt?.permCheck && !this.canEdit()) return;
162
+ if (!this.submit) return;
163
+
164
+ if (
165
+ !this.dataInfo()?.isNew &&
166
+ (this._dataSnapshot == null || obj.equal(this.data(), this._dataSnapshot))
167
+ ) {
168
+ if (!opt?.hideNoChangeMessage) {
169
+ this._sdToast.info("변경사항이 없습니다.");
170
+ }
171
+ return;
172
+ }
173
+
174
+ this.busyCount.update((v) => v + 1);
175
+ await this._sdToast.try(async () => {
176
+ const result = await this.submit!(this.data());
177
+ if (!result) return;
178
+
179
+ this._sdToast.success("저장되었습니다.");
180
+
181
+ this.close.emit(result);
182
+
183
+ await this.refresh();
184
+ });
185
+ this.busyCount.update((v) => v - 1);
186
+ }
187
+ }
188
+
189
+ //#endregion
190
+
191
+ //#region SdDataDetailControl
192
+
193
+ @Component({
194
+ selector: "sd-data-detail",
195
+ changeDetection: ChangeDetectionStrategy.OnPush,
196
+ encapsulation: ViewEncapsulation.None,
197
+ standalone: true,
198
+ imports: [
199
+ SdBaseContainerControl,
200
+ SdFormControl,
201
+ SdButtonControl,
202
+ NgTemplateOutlet,
203
+ FormatPipe,
204
+ SdAnchorControl,
205
+ NgIcon,
206
+ ],
207
+ host: {
208
+ "(sdRefreshCommand)": "onRefreshButtonClick()",
209
+ "(sdSaveCommand)": "onSubmitButtonClick()",
210
+ },
211
+ template: `
212
+ <sd-base-container
213
+ [busy]="parent.busyCount() > 0"
214
+ [busyMessage]="parent.busyMessage()"
215
+ [viewType]="parent.viewType()"
216
+ [initialized]="parent.initialized()"
217
+ [restricted]="!parent.canUse()"
218
+ >
219
+ <ng-template #pageTopbarTpl>
220
+ @if (parent.canEdit() && parent.submit) {
221
+ <sd-button [theme]="'link-primary'" (click)="onSubmitButtonClick()">
222
+ <ng-icon [svg]="tablerDeviceFloppy" />
223
+ 저장
224
+ <small>(CTRL+S)</small>
225
+ </sd-button>
226
+ }
227
+ <sd-button [theme]="'link-info'" (click)="onRefreshButtonClick()">
228
+ <ng-icon [svg]="tablerRefresh" />
229
+ 새로고침
230
+ <small>(CTRL+ALT+L)</small>
231
+ </sd-button>
232
+ </ng-template>
233
+
234
+ <ng-template #contentTpl>
235
+ <div class="flex-column fill">
236
+ @if ((parent.viewType() === "control" && parent.canEdit()) || toolTplRef()) {
237
+ <div class="p-default flex-row gap-default bdb bdb-theme-gray-lightest">
238
+ @if (parent.viewType() === "control" && parent.canEdit()) {
239
+ @if (parent.submit) {
240
+ <sd-button [theme]="'primary'" (click)="onSubmitButtonClick()">
241
+ <ng-icon [svg]="tablerDeviceFloppy" />
242
+ 저장
243
+ <small>(CTRL+S)</small>
244
+ </sd-button>
245
+ <sd-button [theme]="'info'" (click)="onRefreshButtonClick()">
246
+ <ng-icon [svg]="tablerRefresh" />
247
+ 새로고침
248
+ <small>(CTRL+ALT+L)</small>
249
+ </sd-button>
250
+ }
251
+ @if (
252
+ !parent.dataInfo()?.isNew &&
253
+ parent.toggleDelete &&
254
+ (!parent.canDelete || parent.canDelete())
255
+ ) {
256
+ @if (parent.dataInfo()?.isDeleted) {
257
+ <sd-button [theme]="'warning'" (click)="onRestoreButtonClick()">
258
+ <ng-icon [svg]="tablerRestore" />
259
+ 복구
260
+ </sd-button>
261
+ } @else {
262
+ <sd-button [theme]="'danger'" (click)="onDeleteButtonClick()">
263
+ <ng-icon [svg]="tablerEraser" />
264
+ 삭제
265
+ </sd-button>
266
+ }
267
+ }
268
+ }
269
+
270
+ <ng-template [ngTemplateOutlet]="toolTplRef() ?? null" />
271
+ </div>
272
+ }
273
+
274
+ @if (prevTplRef()) {
275
+ <div>
276
+ <ng-template [ngTemplateOutlet]="prevTplRef() ?? null" />
277
+ </div>
278
+ }
279
+
280
+ <div class="flex-fill">
281
+ <sd-form #formCtrl (submit)="onSubmit()">
282
+ <ng-template [ngTemplateOutlet]="contentTplRef()" />
283
+ </sd-form>
284
+ </div>
285
+
286
+ @if (parent.dataInfo()?.lastModifiedAt || parent.dataInfo()?.lastModifiedBy) {
287
+ <div
288
+ class="p-sm-default"
289
+ [class.bg-theme-gray-lightest]="parent.viewType() === 'modal'"
290
+ >
291
+ 최종수정:
292
+ @if (parent.dataInfo()?.lastModifiedAt) {
293
+ {{ parent.dataInfo()!.lastModifiedAt | format: "yyyy-MM-dd HH:mm" }}
294
+ }
295
+ @if (parent.dataInfo()?.lastModifiedBy) {
296
+ ({{ parent.dataInfo()?.lastModifiedBy }})
297
+ }
298
+ </div>
299
+ }
300
+
301
+ @if (nextTplRef()) {
302
+ <div>
303
+ <ng-template [ngTemplateOutlet]="nextTplRef() ?? null" />
304
+ </div>
305
+ }
306
+ </div>
307
+ </ng-template>
308
+
309
+ @if (parent.canEdit()) {
310
+ <ng-template #modalBottomTpl>
311
+ <div class="p-sm-default flex-row gap-sm">
312
+ @if (
313
+ !parent.dataInfo()?.isNew &&
314
+ parent.toggleDelete &&
315
+ (!parent.canDelete || parent.canDelete())
316
+ ) {
317
+ @if (parent.dataInfo()?.isDeleted) {
318
+ <sd-button [size]="'sm'" [theme]="'warning'" (click)="onRestoreButtonClick()">
319
+ 복구
320
+ </sd-button>
321
+ } @else {
322
+ <sd-button [size]="'sm'" [theme]="'danger'" (click)="onDeleteButtonClick()">
323
+ 삭제
324
+ </sd-button>
325
+ }
326
+ }
327
+
328
+ <div class="flex-fill flex-row gap-sm main-align-end">
329
+ <sd-button [size]="'sm'" [theme]="'primary'" (click)="onSubmitButtonClick()">
330
+ 확인
331
+ </sd-button>
332
+ </div>
333
+ </div>
334
+ </ng-template>
335
+
336
+ <ng-template #modalActionTpl>
337
+ <sd-anchor
338
+ [theme]="'gray'"
339
+ class="p-sm-default"
340
+ (click)="onRefreshButtonClick()"
341
+ title="새로고침(CTRL+ALT+L)"
342
+ >
343
+ <ng-icon [svg]="tablerRefresh" />
344
+ </sd-anchor>
345
+ </ng-template>
346
+ }
347
+ </sd-base-container>
348
+ `,
349
+ })
350
+ export class SdDataDetailControl {
351
+ parent = injectParent<AbsSdDataDetail<any>>();
352
+
353
+ formCtrl = viewChild<SdFormControl>("formCtrl");
354
+
355
+ toolTplRef = contentChild("toolTpl", { read: TemplateRef });
356
+ prevTplRef = contentChild("prevTpl", { read: TemplateRef });
357
+ contentTplRef = contentChild.required("contentTpl", { read: TemplateRef });
358
+ nextTplRef = contentChild("nextTpl", { read: TemplateRef });
359
+
360
+ modalActionTplRef = viewChild("modalActionTpl", { read: TemplateRef });
361
+
362
+ constructor() {
363
+ effect(() => {
364
+ this.parent.actionTplRef = this.modalActionTplRef();
365
+ });
366
+ }
367
+
368
+ async onRefreshButtonClick() {
369
+ await this.parent.doRefresh();
370
+ }
371
+
372
+ async onDeleteButtonClick() {
373
+ await this.parent.doToggleDelete(true);
374
+ }
375
+
376
+ async onRestoreButtonClick() {
377
+ await this.parent.doToggleDelete(false);
378
+ }
379
+
380
+ onSubmitButtonClick() {
381
+ this.formCtrl()?.requestSubmit();
382
+ }
383
+
384
+ async onSubmit() {
385
+ await this.parent.doSubmit({ permCheck: true });
386
+ }
387
+
388
+ protected readonly tablerDeviceFloppy = tablerDeviceFloppy;
389
+ protected readonly tablerRefresh = tablerRefresh;
390
+ protected readonly tablerRestore = tablerRestore;
391
+ protected readonly tablerEraser = tablerEraser;
392
+ }
393
+
394
+ //#endregion