@simplysm/angular 14.0.1 → 14.0.5
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.
- package/README.md +318 -0
- package/dist/core/commons.d.ts +2 -0
- package/dist/core/commons.d.ts.map +1 -0
- package/dist/core/commons.js +4 -0
- package/dist/core/directives/sd-events.directive.js +7 -7
- package/dist/core/directives/sd-item-of-template.directive.d.ts +14 -0
- package/dist/core/directives/sd-item-of-template.directive.d.ts.map +1 -0
- package/dist/core/directives/sd-item-of-template.directive.js +17 -0
- package/dist/core/directives/sd-router-link.directive.d.ts +19 -0
- package/dist/core/directives/sd-router-link.directive.d.ts.map +1 -0
- package/dist/core/directives/sd-router-link.directive.js +64 -0
- package/dist/core/directives/sd-typed-template.directive.d.ts +8 -0
- package/dist/core/directives/sd-typed-template.directive.d.ts.map +1 -0
- package/dist/core/directives/sd-typed-template.directive.js +17 -0
- package/dist/core/pipes/format.pipe.d.ts +9 -0
- package/dist/core/pipes/format.pipe.d.ts.map +1 -0
- package/dist/core/pipes/format.pipe.js +43 -0
- package/dist/core/plugins/commands/findTopOpenModalEl.d.ts +8 -0
- package/dist/core/plugins/commands/findTopOpenModalEl.d.ts.map +1 -0
- package/dist/core/plugins/commands/findTopOpenModalEl.js +21 -0
- package/dist/core/plugins/commands/sd-insert-command-event.plugin.d.ts.map +1 -1
- package/dist/core/plugins/commands/sd-insert-command-event.plugin.js +4 -0
- package/dist/core/plugins/commands/sd-refresh-command-event.plugin.d.ts.map +1 -1
- package/dist/core/plugins/commands/sd-refresh-command-event.plugin.js +4 -0
- package/dist/core/plugins/commands/sd-save-command-event.plugin.d.ts.map +1 -1
- package/dist/core/plugins/commands/sd-save-command-event.plugin.js +4 -0
- package/dist/core/plugins/events/sd-resize-event.plugin.d.ts.map +1 -1
- package/dist/core/plugins/events/sd-resize-event.plugin.js +0 -18
- package/dist/core/plugins/sd-global-error-handler.plugin.d.ts +1 -0
- package/dist/core/plugins/sd-global-error-handler.plugin.d.ts.map +1 -1
- package/dist/core/plugins/sd-global-error-handler.plugin.js +23 -13
- package/dist/core/provideSdAngular.d.ts +5 -0
- package/dist/core/provideSdAngular.d.ts.map +1 -0
- package/dist/core/provideSdAngular.js +127 -0
- package/dist/core/providers/sd-angular-config.provider.d.ts +7 -0
- package/dist/core/providers/sd-angular-config.provider.d.ts.map +1 -0
- package/dist/core/providers/sd-angular-config.provider.js +11 -0
- package/dist/core/providers/sd-app-structure.provider.d.ts +79 -0
- package/dist/core/providers/sd-app-structure.provider.d.ts.map +1 -0
- package/dist/core/providers/sd-app-structure.provider.js +278 -0
- package/dist/core/providers/sd-file-dialog.provider.d.ts +8 -0
- package/dist/core/providers/sd-file-dialog.provider.d.ts.map +1 -0
- package/dist/core/providers/sd-file-dialog.provider.js +49 -0
- package/dist/core/providers/sd-local-storage.provider.d.ts +10 -0
- package/dist/core/providers/sd-local-storage.provider.d.ts.map +1 -0
- package/dist/core/providers/sd-local-storage.provider.js +24 -0
- package/dist/core/providers/sd-navigate-window.provider.d.ts +9 -0
- package/dist/core/providers/sd-navigate-window.provider.d.ts.map +1 -0
- package/dist/core/providers/sd-navigate-window.provider.js +33 -0
- package/dist/core/providers/sd-print.provider.d.ts +26 -0
- package/dist/core/providers/sd-print.provider.d.ts.map +1 -0
- package/dist/core/providers/sd-print.provider.js +142 -0
- package/dist/core/providers/sd-service-client-factory.provider.d.ts +19 -0
- package/dist/core/providers/sd-service-client-factory.provider.d.ts.map +1 -0
- package/dist/core/providers/sd-service-client-factory.provider.js +86 -0
- package/dist/core/providers/sd-shared-data.provider.d.ts +36 -0
- package/dist/core/providers/sd-shared-data.provider.d.ts.map +1 -0
- package/dist/core/providers/sd-shared-data.provider.js +119 -0
- package/dist/core/providers/sd-system-config.provider.d.ts +13 -0
- package/dist/core/providers/sd-system-config.provider.d.ts.map +1 -0
- package/dist/core/providers/sd-system-config.provider.js +29 -0
- package/dist/core/providers/sd-system-log.provider.d.ts +8 -0
- package/dist/core/providers/sd-system-log.provider.d.ts.map +1 -0
- package/dist/core/providers/sd-system-log.provider.js +23 -0
- package/dist/core/providers/sd-theme-provider.js +1 -1
- package/dist/core/utils/TDirectiveInputSignals.d.ts +29 -0
- package/dist/core/utils/TDirectiveInputSignals.d.ts.map +1 -0
- package/dist/core/utils/TDirectiveInputSignals.js +1 -0
- package/dist/core/utils/setups/setupCanDeactivate.d.ts +2 -0
- package/dist/core/utils/setups/setupCanDeactivate.d.ts.map +1 -0
- package/dist/core/utils/setups/setupCanDeactivate.js +28 -0
- package/dist/core/utils/setups/setupModelHook.d.ts +3 -0
- package/dist/core/utils/setups/setupModelHook.d.ts.map +1 -0
- package/dist/core/utils/setups/setupModelHook.js +18 -0
- package/dist/core/utils/useCurrentPageCodeSignal.d.ts +3 -0
- package/dist/core/utils/useCurrentPageCodeSignal.d.ts.map +1 -0
- package/dist/core/utils/useCurrentPageCodeSignal.js +13 -0
- package/dist/core/utils/useExpandingManager.d.ts +23 -0
- package/dist/core/utils/useExpandingManager.d.ts.map +1 -0
- package/dist/core/utils/useExpandingManager.js +86 -0
- package/dist/core/utils/useFullPageCodeSignal.d.ts +3 -0
- package/dist/core/utils/useFullPageCodeSignal.d.ts.map +1 -0
- package/dist/core/utils/useFullPageCodeSignal.js +13 -0
- package/dist/core/utils/useSdSystemConfigResource.d.ts +13 -0
- package/dist/core/utils/useSdSystemConfigResource.d.ts.map +1 -0
- package/dist/core/utils/useSdSystemConfigResource.js +31 -0
- package/dist/core/utils/useSelectionManager.d.ts +18 -0
- package/dist/core/utils/useSelectionManager.d.ts.map +1 -0
- package/dist/core/utils/useSelectionManager.js +89 -0
- package/dist/core/utils/useSortingManager.d.ts +17 -0
- package/dist/core/utils/useSortingManager.d.ts.map +1 -0
- package/dist/core/utils/useSortingManager.js +81 -0
- package/dist/core/utils/useViewTitleSignal.d.ts +3 -0
- package/dist/core/utils/useViewTitleSignal.d.ts.map +1 -0
- package/dist/core/utils/useViewTitleSignal.js +17 -0
- package/dist/core/utils/useViewTypeSignal.d.ts +4 -0
- package/dist/core/utils/useViewTypeSignal.d.ts.map +1 -0
- package/dist/core/utils/useViewTypeSignal.js +23 -0
- package/dist/index.d.ts +95 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +115 -0
- package/dist/styles.css +1462 -722
- package/dist/ui/data/list/sd-list-item.control.d.ts +18 -0
- package/dist/ui/data/list/sd-list-item.control.d.ts.map +1 -0
- package/dist/ui/data/list/sd-list-item.control.js +130 -0
- package/dist/ui/data/list/sd-list.control.d.ts +7 -0
- package/dist/ui/data/list/sd-list.control.d.ts.map +1 -0
- package/dist/ui/data/list/sd-list.control.js +22 -0
- package/dist/ui/data/sheet/sd-sheet-column.directive.d.ts +18 -0
- package/dist/ui/data/sheet/sd-sheet-column.directive.d.ts.map +1 -0
- package/dist/ui/data/sheet/sd-sheet-column.directive.js +30 -0
- package/dist/ui/data/sheet/sd-sheet-config.modal.d.ts +39 -0
- package/dist/ui/data/sheet/sd-sheet-config.modal.d.ts.map +1 -0
- package/dist/ui/data/sheet/sd-sheet-config.modal.js +258 -0
- package/dist/ui/data/sheet/sd-sheet.control.d.ts +154 -0
- package/dist/ui/data/sheet/sd-sheet.control.d.ts.map +1 -0
- package/dist/ui/data/sheet/sd-sheet.control.js +846 -0
- package/dist/ui/data/sheet/types.d.ts +32 -0
- package/dist/ui/data/sheet/types.d.ts.map +1 -0
- package/dist/ui/data/sheet/types.js +1 -0
- package/dist/ui/data/sheet/useSheetCellAgent.d.ts +21 -0
- package/dist/ui/data/sheet/useSheetCellAgent.d.ts.map +1 -0
- package/dist/ui/data/sheet/useSheetCellAgent.js +245 -0
- package/dist/ui/data/sheet/useSheetColumnFixing.d.ts +9 -0
- package/dist/ui/data/sheet/useSheetColumnFixing.d.ts.map +1 -0
- package/dist/ui/data/sheet/useSheetColumnFixing.js +29 -0
- package/dist/ui/data/sheet/useSheetDomAccessor.d.ts +11 -0
- package/dist/ui/data/sheet/useSheetDomAccessor.d.ts.map +1 -0
- package/dist/ui/data/sheet/useSheetDomAccessor.js +55 -0
- package/dist/ui/data/sheet/useSheetLayoutEngine.d.ts +14 -0
- package/dist/ui/data/sheet/useSheetLayoutEngine.d.ts.map +1 -0
- package/dist/ui/data/sheet/useSheetLayoutEngine.js +126 -0
- package/dist/ui/form/button/sd-additional-button.control.d.ts +8 -0
- package/dist/ui/form/button/sd-additional-button.control.d.ts.map +1 -0
- package/dist/ui/form/button/sd-additional-button.control.js +38 -0
- package/dist/ui/form/button/sd-anchor.control.d.ts +8 -0
- package/dist/ui/form/button/sd-anchor.control.d.ts.map +1 -0
- package/dist/ui/form/button/sd-anchor.control.js +25 -0
- package/dist/ui/form/button/sd-button.control.d.ts +14 -0
- package/dist/ui/form/button/sd-button.control.d.ts.map +1 -0
- package/dist/ui/form/button/sd-button.control.js +49 -0
- package/dist/ui/form/button/sd-modal-select-button.control.d.ts +46 -0
- package/dist/ui/form/button/sd-modal-select-button.control.d.ts.map +1 -0
- package/dist/ui/form/button/sd-modal-select-button.control.js +149 -0
- package/dist/ui/form/checkbox/sd-checkbox-group-item.control.d.ts +12 -0
- package/dist/ui/form/checkbox/sd-checkbox-group-item.control.d.ts.map +1 -0
- package/dist/ui/form/checkbox/sd-checkbox-group-item.control.js +53 -0
- package/dist/ui/form/checkbox/sd-checkbox-group.control.d.ts +8 -0
- package/dist/ui/form/checkbox/sd-checkbox-group.control.d.ts.map +1 -0
- package/dist/ui/form/checkbox/sd-checkbox-group.control.js +26 -0
- package/dist/ui/form/checkbox/sd-checkbox.control.d.ts +19 -0
- package/dist/ui/form/checkbox/sd-checkbox.control.d.ts.map +1 -0
- package/dist/ui/form/checkbox/sd-checkbox.control.js +103 -0
- package/dist/ui/form/checkbox/sd-switch.control.d.ts +14 -0
- package/dist/ui/form/checkbox/sd-switch.control.d.ts.map +1 -0
- package/dist/ui/form/checkbox/sd-switch.control.js +54 -0
- package/dist/ui/form/choice/sd-state-preset.control.d.ts +24 -0
- package/dist/ui/form/choice/sd-state-preset.control.d.ts.map +1 -0
- package/dist/ui/form/choice/sd-state-preset.control.js +134 -0
- package/dist/ui/form/editor/sd-tiptap-editor.control.d.ts +35 -0
- package/dist/ui/form/editor/sd-tiptap-editor.control.d.ts.map +1 -0
- package/dist/ui/form/editor/sd-tiptap-editor.control.js +480 -0
- package/dist/ui/form/input/sd-date-range.picker.d.ts +13 -0
- package/dist/ui/form/input/sd-date-range.picker.d.ts.map +1 -0
- package/dist/ui/form/input/sd-date-range.picker.js +125 -0
- package/dist/ui/form/input/sd-numpad.control.d.ts +18 -0
- package/dist/ui/form/input/sd-numpad.control.d.ts.map +1 -0
- package/dist/ui/form/input/sd-numpad.control.js +241 -0
- package/dist/ui/form/input/sd-range.control.d.ts +13 -0
- package/dist/ui/form/input/sd-range.control.d.ts.map +1 -0
- package/dist/ui/form/input/sd-range.control.js +53 -0
- package/dist/ui/form/input/sd-textarea.control.d.ts +23 -0
- package/dist/ui/form/input/sd-textarea.control.d.ts.map +1 -0
- package/dist/ui/form/input/sd-textarea.control.js +132 -0
- package/dist/ui/form/input/sd-textfield-type-handlers.d.ts +46 -0
- package/dist/ui/form/input/sd-textfield-type-handlers.d.ts.map +1 -0
- package/dist/ui/form/input/sd-textfield-type-handlers.js +336 -0
- package/dist/ui/form/input/sd-textfield.control.d.ts +39 -0
- package/dist/ui/form/input/sd-textfield.control.d.ts.map +1 -0
- package/dist/ui/form/input/sd-textfield.control.js +211 -0
- package/dist/ui/form/sd-form.control.d.ts +13 -0
- package/dist/ui/form/sd-form.control.d.ts.map +1 -0
- package/dist/ui/form/sd-form.control.js +60 -0
- package/dist/ui/form/select/sd-select-button.control.d.ts +7 -0
- package/dist/ui/form/select/sd-select-button.control.d.ts.map +1 -0
- package/dist/ui/form/select/sd-select-button.control.js +25 -0
- package/dist/ui/form/select/sd-select-item.control.d.ts +18 -0
- package/dist/ui/form/select/sd-select-item.control.d.ts.map +1 -0
- package/dist/ui/form/select/sd-select-item.control.js +103 -0
- package/dist/ui/form/select/sd-select.control.d.ts +45 -0
- package/dist/ui/form/select/sd-select.control.d.ts.map +1 -0
- package/dist/ui/form/select/sd-select.control.js +430 -0
- package/dist/ui/layout/dock/sd-dock-container.control.d.ts +12 -0
- package/dist/ui/layout/dock/sd-dock-container.control.d.ts.map +1 -0
- package/dist/ui/layout/dock/sd-dock-container.control.js +96 -0
- package/dist/ui/layout/dock/sd-dock.control.d.ts +17 -0
- package/dist/ui/layout/dock/sd-dock.control.d.ts.map +1 -0
- package/dist/ui/layout/dock/sd-dock.control.js +111 -0
- package/dist/ui/layout/kanban/sd-kanban-board.control.d.ts +24 -0
- package/dist/ui/layout/kanban/sd-kanban-board.control.d.ts.map +1 -0
- package/dist/ui/layout/kanban/sd-kanban-board.control.js +37 -0
- package/dist/ui/layout/kanban/sd-kanban-lane.control.d.ts +29 -0
- package/dist/ui/layout/kanban/sd-kanban-lane.control.d.ts.map +1 -0
- package/dist/ui/layout/kanban/sd-kanban-lane.control.js +223 -0
- package/dist/ui/layout/kanban/sd-kanban.control.d.ts +32 -0
- package/dist/ui/layout/kanban/sd-kanban.control.d.ts.map +1 -0
- package/dist/ui/layout/kanban/sd-kanban.control.js +147 -0
- package/dist/ui/layout/sd-card.directive.d.ts +6 -0
- package/dist/ui/layout/sd-card.directive.d.ts.map +1 -0
- package/dist/ui/layout/sd-card.directive.js +16 -0
- package/dist/ui/layout/sd-gap.control.d.ts +13 -0
- package/dist/ui/layout/sd-gap.control.d.ts.map +1 -0
- package/dist/ui/layout/sd-gap.control.js +44 -0
- package/dist/ui/layout/sd-pane.directive.d.ts +6 -0
- package/dist/ui/layout/sd-pane.directive.d.ts.map +1 -0
- package/dist/ui/layout/sd-pane.directive.js +17 -0
- package/dist/ui/layout/view/sd-view-item.control.d.ts +9 -0
- package/dist/ui/layout/view/sd-view-item.control.d.ts.map +1 -0
- package/dist/ui/layout/view/sd-view-item.control.js +25 -0
- package/dist/ui/layout/view/sd-view.control.d.ts +8 -0
- package/dist/ui/layout/view/sd-view.control.d.ts.map +1 -0
- package/dist/ui/layout/view/sd-view.control.js +23 -0
- package/dist/ui/navigation/collapse/sd-collapse-icon.control.d.ts +13 -0
- package/dist/ui/navigation/collapse/sd-collapse-icon.control.d.ts.map +1 -0
- package/dist/ui/navigation/collapse/sd-collapse-icon.control.js +33 -0
- package/dist/ui/navigation/collapse/sd-collapse.control.d.ts +14 -0
- package/dist/ui/navigation/collapse/sd-collapse.control.d.ts.map +1 -0
- package/dist/ui/navigation/collapse/sd-collapse.control.js +59 -0
- package/dist/ui/navigation/menu-utils.d.ts +13 -0
- package/dist/ui/navigation/menu-utils.d.ts.map +1 -0
- package/dist/ui/navigation/menu-utils.js +18 -0
- package/dist/ui/navigation/pagination/sd-pagination.control.d.ts +24 -0
- package/dist/ui/navigation/pagination/sd-pagination.control.d.ts.map +1 -0
- package/dist/ui/navigation/pagination/sd-pagination.control.js +137 -0
- package/dist/ui/navigation/sidebar/sd-sidebar-container.control.d.ts +11 -0
- package/dist/ui/navigation/sidebar/sd-sidebar-container.control.d.ts.map +1 -0
- package/dist/ui/navigation/sidebar/sd-sidebar-container.control.js +46 -0
- package/dist/ui/navigation/sidebar/sd-sidebar-menu.control.d.ts +28 -0
- package/dist/ui/navigation/sidebar/sd-sidebar-menu.control.d.ts.map +1 -0
- package/dist/ui/navigation/sidebar/sd-sidebar-menu.control.js +159 -0
- package/dist/ui/navigation/sidebar/sd-sidebar-user.control.d.ts +16 -0
- package/dist/ui/navigation/sidebar/sd-sidebar-user.control.d.ts.map +1 -0
- package/dist/ui/navigation/sidebar/sd-sidebar-user.control.js +109 -0
- package/dist/ui/navigation/sidebar/sd-sidebar.control.d.ts +8 -0
- package/dist/ui/navigation/sidebar/sd-sidebar.control.d.ts.map +1 -0
- package/dist/ui/navigation/sidebar/sd-sidebar.control.js +24 -0
- package/dist/ui/navigation/tab/sd-tab-item.control.d.ts +10 -0
- package/dist/ui/navigation/tab/sd-tab-item.control.d.ts.map +1 -0
- package/dist/ui/navigation/tab/sd-tab-item.control.js +31 -0
- package/dist/ui/navigation/tab/sd-tab.control.d.ts +7 -0
- package/dist/ui/navigation/tab/sd-tab.control.d.ts.map +1 -0
- package/dist/ui/navigation/tab/sd-tab.control.js +18 -0
- package/dist/ui/navigation/tab/sd-tabview-item.control.d.ts +10 -0
- package/dist/ui/navigation/tab/sd-tabview-item.control.d.ts.map +1 -0
- package/dist/ui/navigation/tab/sd-tabview-item.control.js +26 -0
- package/dist/ui/navigation/tab/sd-tabview.control.d.ts +9 -0
- package/dist/ui/navigation/tab/sd-tabview.control.d.ts.map +1 -0
- package/dist/ui/navigation/tab/sd-tabview.control.js +67 -0
- package/dist/ui/navigation/topbar/sd-topbar-container.control.d.ts +6 -0
- package/dist/ui/navigation/topbar/sd-topbar-container.control.d.ts.map +1 -0
- package/dist/ui/navigation/topbar/sd-topbar-container.control.js +17 -0
- package/dist/ui/navigation/topbar/sd-topbar-menu.control.d.ts +29 -0
- package/dist/ui/navigation/topbar/sd-topbar-menu.control.d.ts.map +1 -0
- package/dist/ui/navigation/topbar/sd-topbar-menu.control.js +245 -0
- package/dist/ui/navigation/topbar/sd-topbar-user.control.d.ts +13 -0
- package/dist/ui/navigation/topbar/sd-topbar-user.control.d.ts.map +1 -0
- package/dist/ui/navigation/topbar/sd-topbar-user.control.js +77 -0
- package/dist/ui/navigation/topbar/sd-topbar.control.d.ts +12 -0
- package/dist/ui/navigation/topbar/sd-topbar.control.d.ts.map +1 -0
- package/dist/ui/navigation/topbar/sd-topbar.control.js +59 -0
- package/dist/ui/overlay/busy/sd-busy-container.control.d.ts +14 -0
- package/dist/ui/overlay/busy/sd-busy-container.control.d.ts.map +1 -0
- package/dist/ui/overlay/busy/sd-busy-container.control.js +119 -0
- package/dist/ui/overlay/busy/sd-busy.provider.d.ts +16 -0
- package/dist/ui/overlay/busy/sd-busy.provider.d.ts.map +1 -0
- package/dist/ui/overlay/busy/sd-busy.provider.js +43 -0
- package/dist/ui/overlay/dropdown/sd-dropdown-popup.control.d.ts +11 -0
- package/dist/ui/overlay/dropdown/sd-dropdown-popup.control.d.ts.map +1 -0
- package/dist/ui/overlay/dropdown/sd-dropdown-popup.control.js +43 -0
- package/dist/ui/overlay/dropdown/sd-dropdown.control.d.ts +27 -0
- package/dist/ui/overlay/dropdown/sd-dropdown.control.d.ts.map +1 -0
- package/dist/ui/overlay/dropdown/sd-dropdown.control.js +284 -0
- package/dist/ui/overlay/modal/sd-confirm-modal.control.d.ts +17 -0
- package/dist/ui/overlay/modal/sd-confirm-modal.control.d.ts.map +1 -0
- package/dist/ui/overlay/modal/sd-confirm-modal.control.js +51 -0
- package/dist/ui/overlay/modal/sd-modal.control.d.ts +51 -0
- package/dist/ui/overlay/modal/sd-modal.control.d.ts.map +1 -0
- package/dist/ui/overlay/modal/sd-modal.control.js +411 -0
- package/dist/ui/overlay/modal/sd-modal.provider.d.ts +65 -0
- package/dist/ui/overlay/modal/sd-modal.provider.d.ts.map +1 -0
- package/dist/ui/overlay/modal/sd-modal.provider.js +146 -0
- package/dist/ui/overlay/modal/sd-prompt-modal.control.d.ts +19 -0
- package/dist/ui/overlay/modal/sd-prompt-modal.control.d.ts.map +1 -0
- package/dist/ui/overlay/modal/sd-prompt-modal.control.js +71 -0
- package/dist/ui/overlay/toast/sd-toast-container.control.d.ts +7 -0
- package/dist/ui/overlay/toast/sd-toast-container.control.d.ts.map +1 -0
- package/dist/ui/overlay/toast/sd-toast-container.control.js +20 -0
- package/dist/ui/overlay/toast/sd-toast.control.d.ts +14 -0
- package/dist/ui/overlay/toast/sd-toast.control.d.ts.map +1 -0
- package/dist/ui/overlay/toast/sd-toast.control.js +79 -0
- package/dist/ui/overlay/toast/sd-toast.provider.d.ts +45 -0
- package/dist/ui/overlay/toast/sd-toast.provider.d.ts.map +1 -0
- package/dist/ui/overlay/toast/sd-toast.provider.js +219 -0
- package/dist/ui/visual/sd-barcode.control.d.ts +11 -0
- package/dist/ui/visual/sd-barcode.control.d.ts.map +1 -0
- package/dist/ui/visual/sd-barcode.control.js +35 -0
- package/dist/ui/visual/sd-calendar.control.d.ts +20 -0
- package/dist/ui/visual/sd-calendar.control.d.ts.map +1 -0
- package/dist/ui/visual/sd-calendar.control.js +189 -0
- package/dist/ui/visual/sd-echarts.control.d.ts +13 -0
- package/dist/ui/visual/sd-echarts.control.d.ts.map +1 -0
- package/dist/ui/visual/sd-echarts.control.js +55 -0
- package/dist/ui/visual/sd-label.control.d.ts +9 -0
- package/dist/ui/visual/sd-label.control.d.ts.map +1 -0
- package/dist/ui/visual/sd-label.control.js +27 -0
- package/dist/ui/visual/sd-note.control.d.ts +9 -0
- package/dist/ui/visual/sd-note.control.d.ts.map +1 -0
- package/dist/ui/visual/sd-note.control.js +26 -0
- package/dist/ui/visual/sd-progress.control.d.ts +10 -0
- package/dist/ui/visual/sd-progress.control.d.ts.map +1 -0
- package/dist/ui/visual/sd-progress.control.js +38 -0
- package/docs/commons-and-configuration.md +34 -0
- package/docs/data-display-components.md +146 -0
- package/docs/directives.md +158 -0
- package/docs/event-plugins.md +109 -0
- package/docs/form-components.md +362 -0
- package/docs/hooks-and-utilities.md +175 -0
- package/docs/layout-components.md +140 -0
- package/docs/navigation-components.md +200 -0
- package/docs/overlay-components.md +193 -0
- package/docs/pipes.md +25 -0
- package/docs/providers.md +448 -0
- package/docs/setup-functions.md +66 -0
- package/docs/visual-components.md +89 -0
- package/package.json +37 -18
- package/scss/commons/_mixins.scss +34 -0
- package/scss/commons/_styles.scss +27 -68
- package/scss/commons/_variables.scss +7 -0
- package/scss/controls/_card.scss +29 -0
- package/scss/controls/_flex.scss +38 -0
- package/scss/controls/_form-box.scss +49 -0
- package/scss/controls/_form-table.scss +45 -0
- package/scss/controls/_grid.scss +36 -0
- package/scss/controls/_table.scss +99 -0
- package/scss/styles.scss +7 -0
- package/scss/themes/_variables-dark.scss +2 -0
- package/src/core/commons.ts +4 -0
- package/src/core/directives/sd-events.directive.ts +7 -7
- package/src/core/directives/sd-item-of-template.directive.ts +23 -0
- package/src/core/directives/sd-router-link.directive.ts +81 -0
- package/src/core/directives/sd-typed-template.directive.ts +16 -0
- package/src/core/pipes/format.pipe.ts +37 -0
- package/src/core/plugins/commands/findTopOpenModalEl.ts +23 -0
- package/src/core/plugins/commands/sd-insert-command-event.plugin.ts +4 -0
- package/src/core/plugins/commands/sd-refresh-command-event.plugin.ts +4 -0
- package/src/core/plugins/commands/sd-save-command-event.plugin.ts +4 -0
- package/src/core/plugins/events/sd-resize-event.plugin.ts +0 -22
- package/src/core/plugins/sd-global-error-handler.plugin.ts +22 -13
- package/src/core/provideSdAngular.ts +154 -0
- package/src/core/providers/sd-angular-config.provider.ts +6 -0
- package/src/core/providers/sd-app-structure.provider.ts +446 -0
- package/src/core/providers/sd-file-dialog.provider.ts +49 -0
- package/src/core/providers/sd-local-storage.provider.ts +21 -0
- package/src/core/providers/sd-navigate-window.provider.ts +44 -0
- package/src/core/providers/sd-print.provider.ts +189 -0
- package/src/core/providers/sd-service-client-factory.provider.ts +98 -0
- package/src/core/providers/sd-shared-data.provider.ts +179 -0
- package/src/core/providers/sd-system-config.provider.ts +28 -0
- package/src/core/providers/sd-system-log.provider.ts +19 -0
- package/src/core/providers/sd-theme-provider.ts +1 -1
- package/src/core/utils/TDirectiveInputSignals.ts +34 -0
- package/src/core/utils/setups/setupCanDeactivate.ts +34 -0
- package/src/core/utils/setups/setupModelHook.ts +26 -0
- package/src/core/utils/useCurrentPageCodeSignal.ts +16 -0
- package/src/core/utils/useExpandingManager.ts +117 -0
- package/src/core/utils/useFullPageCodeSignal.ts +24 -0
- package/src/core/utils/useSdSystemConfigResource.ts +36 -0
- package/src/core/utils/useSelectionManager.ts +104 -0
- package/src/core/utils/useSortingManager.ts +89 -0
- package/src/core/utils/useViewTitleSignal.ts +21 -0
- package/src/core/utils/useViewTypeSignal.ts +33 -0
- package/src/index.ts +209 -0
- package/src/scss.d.ts +1 -0
- package/src/ui/data/list/sd-list-item.control.ts +143 -0
- package/src/ui/data/list/sd-list.control.ts +41 -0
- package/src/ui/data/sheet/sd-sheet-column.directive.ts +26 -0
- package/src/ui/data/sheet/sd-sheet-config.modal.ts +252 -0
- package/src/ui/data/sheet/sd-sheet.control.ts +766 -0
- package/src/ui/data/sheet/types.ts +37 -0
- package/src/ui/data/sheet/useSheetCellAgent.ts +267 -0
- package/src/ui/data/sheet/useSheetColumnFixing.ts +37 -0
- package/src/ui/data/sheet/useSheetDomAccessor.ts +62 -0
- package/src/ui/data/sheet/useSheetLayoutEngine.ts +143 -0
- package/src/ui/form/button/sd-additional-button.control.ts +100 -0
- package/src/ui/form/button/sd-anchor.control.ts +67 -0
- package/src/ui/form/button/sd-button.control.ts +209 -0
- package/src/ui/form/button/sd-modal-select-button.control.ts +237 -0
- package/src/ui/form/checkbox/sd-checkbox-group-item.control.ts +51 -0
- package/src/ui/form/checkbox/sd-checkbox-group.control.ts +24 -0
- package/src/ui/form/checkbox/sd-checkbox.control.ts +305 -0
- package/src/ui/form/checkbox/sd-switch.control.ts +145 -0
- package/src/ui/form/choice/sd-state-preset.control.ts +173 -0
- package/src/ui/form/editor/sd-tiptap-editor.control.ts +474 -0
- package/src/ui/form/input/sd-date-range.picker.ts +98 -0
- package/src/ui/form/input/sd-numpad.control.ts +178 -0
- package/src/ui/form/input/sd-range.control.ts +59 -0
- package/src/ui/form/input/sd-textarea.control.ts +221 -0
- package/src/ui/form/input/sd-textfield-type-handlers.ts +445 -0
- package/src/ui/form/input/sd-textfield.control.ts +395 -0
- package/src/ui/form/sd-form.control.ts +52 -0
- package/src/ui/form/select/sd-select-button.control.ts +43 -0
- package/src/ui/form/select/sd-select-item.control.ts +143 -0
- package/src/ui/form/select/sd-select.control.ts +412 -0
- package/src/ui/layout/dock/sd-dock-container.control.ts +100 -0
- package/src/ui/layout/dock/sd-dock.control.ts +171 -0
- package/src/ui/layout/kanban/sd-kanban-board.control.ts +74 -0
- package/src/ui/layout/kanban/sd-kanban-lane.control.ts +210 -0
- package/src/ui/layout/kanban/sd-kanban.control.ts +227 -0
- package/src/ui/layout/sd-card.directive.ts +10 -0
- package/src/ui/layout/sd-gap.control.ts +63 -0
- package/src/ui/layout/sd-pane.directive.ts +11 -0
- package/src/ui/layout/view/sd-view-item.control.ts +45 -0
- package/src/ui/layout/view/sd-view.control.ts +31 -0
- package/src/ui/navigation/collapse/sd-collapse-icon.control.ts +51 -0
- package/src/ui/navigation/collapse/sd-collapse.control.ts +75 -0
- package/src/ui/navigation/menu-utils.ts +36 -0
- package/src/ui/navigation/pagination/sd-pagination.control.ts +125 -0
- package/src/ui/navigation/sidebar/sd-sidebar-container.control.ts +92 -0
- package/src/ui/navigation/sidebar/sd-sidebar-menu.control.ts +129 -0
- package/src/ui/navigation/sidebar/sd-sidebar-user.control.ts +84 -0
- package/src/ui/navigation/sidebar/sd-sidebar.control.ts +67 -0
- package/src/ui/navigation/tab/sd-tab-item.control.ts +55 -0
- package/src/ui/navigation/tab/sd-tab.control.ts +25 -0
- package/src/ui/navigation/tab/sd-tabview-item.control.ts +48 -0
- package/src/ui/navigation/tab/sd-tabview.control.ts +39 -0
- package/src/ui/navigation/topbar/sd-topbar-container.control.ts +22 -0
- package/src/ui/navigation/topbar/sd-topbar-menu.control.ts +165 -0
- package/src/ui/navigation/topbar/sd-topbar-user.control.ts +58 -0
- package/src/ui/navigation/topbar/sd-topbar.control.ts +94 -0
- package/src/ui/overlay/busy/sd-busy-container.control.ts +243 -0
- package/src/ui/overlay/busy/sd-busy.provider.ts +55 -0
- package/src/ui/overlay/dropdown/sd-dropdown-popup.control.ts +110 -0
- package/src/ui/overlay/dropdown/sd-dropdown.control.ts +310 -0
- package/src/ui/overlay/modal/sd-confirm-modal.control.ts +66 -0
- package/src/ui/overlay/modal/sd-modal.control.ts +362 -0
- package/src/ui/overlay/modal/sd-modal.provider.ts +216 -0
- package/src/ui/overlay/modal/sd-prompt-modal.control.ts +92 -0
- package/src/ui/overlay/toast/sd-toast-container.control.ts +58 -0
- package/src/ui/overlay/toast/sd-toast.control.ts +123 -0
- package/src/ui/overlay/toast/sd-toast.provider.ts +302 -0
- package/src/ui/visual/sd-barcode.control.ts +62 -0
- package/src/ui/visual/sd-calendar.control.ts +188 -0
- package/src/ui/visual/sd-echarts.control.ts +73 -0
- package/src/ui/visual/sd-label.control.ts +66 -0
- package/src/ui/visual/sd-note.control.ts +66 -0
- package/src/ui/visual/sd-progress.control.ts +88 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ApplicationRef,
|
|
3
|
+
createComponent,
|
|
4
|
+
inject,
|
|
5
|
+
Injectable,
|
|
6
|
+
inputBinding,
|
|
7
|
+
type Signal,
|
|
8
|
+
type Type,
|
|
9
|
+
} from "@angular/core";
|
|
10
|
+
import type { TDirectiveInputSignals } from "../utils/TDirectiveInputSignals";
|
|
11
|
+
import { SdBusyProvider } from "../../ui/overlay/busy/sd-busy.provider";
|
|
12
|
+
import { wait } from "@simplysm/core-common";
|
|
13
|
+
import { jsPDF } from "jspdf";
|
|
14
|
+
import * as htmlToImage from "html-to-image";
|
|
15
|
+
|
|
16
|
+
export interface ISdPrint {
|
|
17
|
+
initialized: Signal<boolean>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ISdPrintInput<T, X extends keyof any = ""> {
|
|
21
|
+
type: Type<T>;
|
|
22
|
+
inputs: Omit<TDirectiveInputSignals<T>, X>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@Injectable({ providedIn: "root" })
|
|
26
|
+
export class SdPrintProvider {
|
|
27
|
+
private readonly _appRef = inject(ApplicationRef);
|
|
28
|
+
private readonly _sdBusy = inject(SdBusyProvider);
|
|
29
|
+
|
|
30
|
+
async printAsync<T extends ISdPrint>(
|
|
31
|
+
template: ISdPrintInput<T>,
|
|
32
|
+
options?: {
|
|
33
|
+
size?: string;
|
|
34
|
+
margin?: string;
|
|
35
|
+
},
|
|
36
|
+
): Promise<void> {
|
|
37
|
+
this._sdBusy.globalBusyCount.update((v) => v + 1);
|
|
38
|
+
try {
|
|
39
|
+
const compRef = createComponent(template.type, {
|
|
40
|
+
environmentInjector: this._appRef.injector,
|
|
41
|
+
bindings: [
|
|
42
|
+
...Object.keys(template.inputs).map((inputKey) =>
|
|
43
|
+
inputBinding(inputKey, () => (template.inputs as Record<string, unknown>)[inputKey]),
|
|
44
|
+
),
|
|
45
|
+
],
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const compEl = compRef.location.nativeElement as HTMLElement;
|
|
49
|
+
compEl.classList.add("_sd-print-template");
|
|
50
|
+
|
|
51
|
+
const styleEl = document.createElement("style");
|
|
52
|
+
styleEl.innerHTML = `
|
|
53
|
+
@page {
|
|
54
|
+
size: ${options?.size ?? "A4 auto"};
|
|
55
|
+
margin: ${options?.margin ?? "0"};
|
|
56
|
+
}
|
|
57
|
+
body > ._sd-print-template { display: none; }
|
|
58
|
+
@media print
|
|
59
|
+
{
|
|
60
|
+
html, body { -webkit-print-color-adjust: exact; background: white; }
|
|
61
|
+
body > * { display: none !important; }
|
|
62
|
+
body > ._sd-print-template { display: block !important; }
|
|
63
|
+
}`;
|
|
64
|
+
|
|
65
|
+
this._appRef.attachView(compRef.hostView);
|
|
66
|
+
document.body.appendChild(compEl);
|
|
67
|
+
document.head.appendChild(styleEl);
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
this._appRef.tick();
|
|
71
|
+
await wait.until(() => compRef.instance.initialized());
|
|
72
|
+
await this._waitForAllImagesLoadedAsync(compEl);
|
|
73
|
+
|
|
74
|
+
window.print();
|
|
75
|
+
} finally {
|
|
76
|
+
styleEl.remove();
|
|
77
|
+
compEl.remove();
|
|
78
|
+
compRef.destroy();
|
|
79
|
+
}
|
|
80
|
+
} finally {
|
|
81
|
+
this._sdBusy.globalBusyCount.update((v) => v - 1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async getPdfBufferAsync<T extends ISdPrint>(
|
|
86
|
+
template: ISdPrintInput<T>,
|
|
87
|
+
options?: {
|
|
88
|
+
orientation?: "portrait" | "landscape";
|
|
89
|
+
pageSize?: string;
|
|
90
|
+
},
|
|
91
|
+
): Promise<Uint8Array> {
|
|
92
|
+
this._sdBusy.globalBusyCount.update((v) => v + 1);
|
|
93
|
+
try {
|
|
94
|
+
const compRef = createComponent(template.type, {
|
|
95
|
+
environmentInjector: this._appRef.injector,
|
|
96
|
+
bindings: [
|
|
97
|
+
...Object.keys(template.inputs).map((inputKey) =>
|
|
98
|
+
inputBinding(inputKey, () => (template.inputs as Record<string, unknown>)[inputKey]),
|
|
99
|
+
),
|
|
100
|
+
],
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const compEl = compRef.location.nativeElement as HTMLElement;
|
|
104
|
+
compEl.classList.add("_sd-print-template");
|
|
105
|
+
|
|
106
|
+
const styleEl = document.createElement("style");
|
|
107
|
+
styleEl.innerHTML = `html, body { overflow: hidden }`;
|
|
108
|
+
|
|
109
|
+
this._appRef.attachView(compRef.hostView);
|
|
110
|
+
document.body.appendChild(compEl);
|
|
111
|
+
document.head.appendChild(styleEl);
|
|
112
|
+
|
|
113
|
+
const headStylesBefore = new Set(document.head.querySelectorAll("style"));
|
|
114
|
+
|
|
115
|
+
try {
|
|
116
|
+
this._appRef.tick();
|
|
117
|
+
await wait.until(() => compRef.instance.initialized());
|
|
118
|
+
await this._waitForAllImagesLoadedAsync(compEl);
|
|
119
|
+
|
|
120
|
+
const pageSize = options?.pageSize ?? "a4";
|
|
121
|
+
const orientation = options?.orientation ?? "p";
|
|
122
|
+
const doc = new jsPDF(orientation, "pt", pageSize);
|
|
123
|
+
const pageWidth = doc.internal.pageSize.getWidth();
|
|
124
|
+
doc.deletePage(1);
|
|
125
|
+
|
|
126
|
+
let els = Array.from(compEl.querySelectorAll<HTMLElement>(".page"));
|
|
127
|
+
if (els.length === 0) {
|
|
128
|
+
els = [compEl];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
for (const el of els) {
|
|
132
|
+
el.style.width = pageWidth + "pt";
|
|
133
|
+
|
|
134
|
+
const canvas = await htmlToImage.toCanvas(el, {
|
|
135
|
+
backgroundColor: "white",
|
|
136
|
+
pixelRatio: 4,
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
const imgWidth = pageWidth;
|
|
140
|
+
const imgHeight = canvas.height * (pageWidth / canvas.width);
|
|
141
|
+
|
|
142
|
+
doc.addPage(pageSize, orientation).addImage({
|
|
143
|
+
imageData: canvas,
|
|
144
|
+
x: 0,
|
|
145
|
+
y: 0,
|
|
146
|
+
width: imgWidth,
|
|
147
|
+
height: imgHeight,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const arrayBuffer = doc.output("arraybuffer");
|
|
152
|
+
return new Uint8Array(arrayBuffer);
|
|
153
|
+
} finally {
|
|
154
|
+
styleEl.remove();
|
|
155
|
+
for (const s of document.head.querySelectorAll("style")) {
|
|
156
|
+
if (!headStylesBefore.has(s)) {
|
|
157
|
+
s.remove();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
compEl.remove();
|
|
161
|
+
compRef.destroy();
|
|
162
|
+
}
|
|
163
|
+
} finally {
|
|
164
|
+
this._sdBusy.globalBusyCount.update((v) => v - 1);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
private async _waitForAllImagesLoadedAsync(container: HTMLElement): Promise<void> {
|
|
169
|
+
const imgs = Array.from(container.querySelectorAll("img"));
|
|
170
|
+
|
|
171
|
+
await Promise.all(
|
|
172
|
+
imgs.map((img) => {
|
|
173
|
+
return new Promise<void>((resolve) => {
|
|
174
|
+
if (img.complete && img.naturalWidth !== 0) {
|
|
175
|
+
resolve();
|
|
176
|
+
} else {
|
|
177
|
+
const onDone = () => {
|
|
178
|
+
img.removeEventListener("load", onDone);
|
|
179
|
+
img.removeEventListener("error", onDone);
|
|
180
|
+
resolve();
|
|
181
|
+
};
|
|
182
|
+
img.addEventListener("load", onDone);
|
|
183
|
+
img.addEventListener("error", onDone);
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}),
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { DestroyRef, inject, Injectable, type WritableSignal } from "@angular/core";
|
|
2
|
+
import type { ServiceConnectionOptions, ServiceProgressState } from "@simplysm/service-client";
|
|
3
|
+
import { createServiceClient, ServiceClient } from "@simplysm/service-client";
|
|
4
|
+
import { SdAngularConfigProvider } from "./sd-angular-config.provider";
|
|
5
|
+
import { SdToastProvider } from "../../ui/overlay/toast/sd-toast.provider";
|
|
6
|
+
|
|
7
|
+
@Injectable({ providedIn: "root" })
|
|
8
|
+
export class SdServiceClientFactoryProvider {
|
|
9
|
+
private readonly _toastProvider = inject(SdToastProvider);
|
|
10
|
+
private readonly _configProvider = inject(SdAngularConfigProvider);
|
|
11
|
+
private readonly _destroyRef = inject(DestroyRef);
|
|
12
|
+
|
|
13
|
+
private readonly _clientMap = new Map<string, ServiceClient>();
|
|
14
|
+
private readonly _closedKeys = new Set<string>();
|
|
15
|
+
private readonly _progressMap = new Map<string, WritableSignal<number>>();
|
|
16
|
+
|
|
17
|
+
constructor() {
|
|
18
|
+
this._destroyRef.onDestroy(() => {
|
|
19
|
+
for (const client of this._clientMap.values()) {
|
|
20
|
+
void client.close();
|
|
21
|
+
}
|
|
22
|
+
this._clientMap.clear();
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async connectAsync(key: string, options?: Partial<ServiceConnectionOptions>): Promise<void> {
|
|
27
|
+
if (this._closedKeys.has(key)) {
|
|
28
|
+
throw new Error("이미 연결이 끊긴 클라이언트");
|
|
29
|
+
}
|
|
30
|
+
if (this._clientMap.has(key)) {
|
|
31
|
+
throw new Error("이미 연결된 클라이언트");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const ssl = location.protocol.startsWith("https");
|
|
35
|
+
const defaultOptions: ServiceConnectionOptions = {
|
|
36
|
+
host: location.hostname,
|
|
37
|
+
port: location.port !== "" ? Number(location.port) : ssl ? 443 : 80,
|
|
38
|
+
ssl,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const mergedOptions: ServiceConnectionOptions = {
|
|
42
|
+
...defaultOptions,
|
|
43
|
+
...options,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const client = createServiceClient(this._configProvider.clientName, mergedOptions);
|
|
47
|
+
|
|
48
|
+
client.on("request-progress", (state: ServiceProgressState) => {
|
|
49
|
+
this._handleProgress("요청을 전송하는 중입니다.", state);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
client.on("response-progress", (state: ServiceProgressState) => {
|
|
53
|
+
this._handleProgress("응답을 전송받는 중입니다.", state);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
await client.connect();
|
|
57
|
+
this._clientMap.set(key, client);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async closeAsync(key: string): Promise<void> {
|
|
61
|
+
const client = this._clientMap.get(key);
|
|
62
|
+
if (client == null) {
|
|
63
|
+
throw new Error("연결하지 않은 클라이언트 키");
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
await client.close();
|
|
67
|
+
this._clientMap.delete(key);
|
|
68
|
+
this._closedKeys.add(key);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get(key: string): ServiceClient {
|
|
72
|
+
const client = this._clientMap.get(key);
|
|
73
|
+
if (client == null) {
|
|
74
|
+
if (this._closedKeys.has(key)) {
|
|
75
|
+
throw new Error("이미 연결이 끊긴 클라이언트");
|
|
76
|
+
}
|
|
77
|
+
throw new Error("연결하지 않은 클라이언트 키");
|
|
78
|
+
}
|
|
79
|
+
return client;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
private _handleProgress(message: string, state: ServiceProgressState): void {
|
|
83
|
+
const { uuid, totalSize, completedSize } = state;
|
|
84
|
+
const progress = totalSize === 0 ? 0 : Math.round((completedSize / totalSize) * 100);
|
|
85
|
+
|
|
86
|
+
let progressSignal = this._progressMap.get(uuid);
|
|
87
|
+
if (progressSignal == null) {
|
|
88
|
+
progressSignal = this._toastProvider.info(message, true);
|
|
89
|
+
this._progressMap.set(uuid, progressSignal);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
progressSignal.set(progress);
|
|
93
|
+
|
|
94
|
+
if (completedSize === totalSize) {
|
|
95
|
+
this._progressMap.delete(uuid);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { computed, ErrorHandler, inject, Injectable, signal, type Signal, type WritableSignal } from "@angular/core";
|
|
2
|
+
import { defineEvent } from "@simplysm/service-common";
|
|
3
|
+
import { obj, wait as waitUtil } from "@simplysm/core-common";
|
|
4
|
+
import { SdServiceClientFactoryProvider } from "./sd-service-client-factory.provider";
|
|
5
|
+
import "@simplysm/core-common";
|
|
6
|
+
|
|
7
|
+
export interface ISharedDataBase<TKey extends string | number> {
|
|
8
|
+
__valueKey: TKey;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ISharedDataInfo<T extends ISharedDataBase<string | number>> {
|
|
12
|
+
serviceKey: string;
|
|
13
|
+
getter: (changeKeys?: (string | number)[]) => Promise<T[]>;
|
|
14
|
+
filter?: unknown;
|
|
15
|
+
orderBy?: (a: T, b: T) => number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface SharedDataHandle<T extends ISharedDataBase<string | number>> {
|
|
19
|
+
items: Signal<T[]>;
|
|
20
|
+
get(key: T["__valueKey"] | undefined): T | undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const SdSharedDataChangeEvent = defineEvent<
|
|
24
|
+
{ name: string; filter: unknown },
|
|
25
|
+
(string | number)[] | undefined
|
|
26
|
+
>("SdSharedDataChange");
|
|
27
|
+
|
|
28
|
+
interface ISharedDataEntry<T extends ISharedDataBase<string | number>> {
|
|
29
|
+
info: ISharedDataInfo<T>;
|
|
30
|
+
itemsSignal: WritableSignal<T[]>;
|
|
31
|
+
handle: SharedDataHandle<T>;
|
|
32
|
+
listenerKey?: string;
|
|
33
|
+
needsReload: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@Injectable()
|
|
37
|
+
export abstract class SdSharedDataProvider<T extends Record<string, ISharedDataBase<string | number>>> {
|
|
38
|
+
private readonly _clientFactory = inject(SdServiceClientFactoryProvider);
|
|
39
|
+
private readonly _errorHandler = inject(ErrorHandler);
|
|
40
|
+
|
|
41
|
+
readonly loadingCount: WritableSignal<number> = signal(0);
|
|
42
|
+
|
|
43
|
+
private readonly _entries = new Map<string, ISharedDataEntry<any>>();
|
|
44
|
+
|
|
45
|
+
abstract initialize(): void;
|
|
46
|
+
|
|
47
|
+
register<K extends string & keyof T>(name: K, info: ISharedDataInfo<T[K]>): void {
|
|
48
|
+
const existing = this._entries.get(name as string);
|
|
49
|
+
if (existing != null) {
|
|
50
|
+
// 기존 리스너 키 초기화
|
|
51
|
+
if (existing.listenerKey != null) {
|
|
52
|
+
const client = this._clientFactory.get(existing.info.serviceKey);
|
|
53
|
+
void client.removeListener(existing.listenerKey);
|
|
54
|
+
existing.listenerKey = undefined;
|
|
55
|
+
}
|
|
56
|
+
existing.info = info;
|
|
57
|
+
existing.needsReload = true;
|
|
58
|
+
} else {
|
|
59
|
+
const itemsSignal = signal<T[K][]>([]);
|
|
60
|
+
const itemsMapComputed = computed(() =>
|
|
61
|
+
itemsSignal().toMap((i) => i.__valueKey),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const handle: SharedDataHandle<T[K]> = {
|
|
65
|
+
items: itemsSignal.asReadonly(),
|
|
66
|
+
get: (key: T[K]["__valueKey"] | undefined) => {
|
|
67
|
+
if (key == null) return undefined;
|
|
68
|
+
return itemsMapComputed().get(key);
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
this._entries.set(name as string, {
|
|
73
|
+
info,
|
|
74
|
+
itemsSignal,
|
|
75
|
+
handle,
|
|
76
|
+
needsReload: true,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
getHandle<K extends string & keyof T>(name: K): SharedDataHandle<T[K]> {
|
|
82
|
+
const entry = this._entries.get(name as string);
|
|
83
|
+
if (entry == null) {
|
|
84
|
+
throw new Error(`등록되지 않은 공유 데이터: ${name as string}`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (entry.needsReload) {
|
|
88
|
+
entry.needsReload = false;
|
|
89
|
+
this._loadAndListen(name as string, entry);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return entry.handle;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async emitAsync<K extends string & keyof T>(
|
|
96
|
+
name: K,
|
|
97
|
+
changeKeys?: (string | number)[],
|
|
98
|
+
): Promise<void> {
|
|
99
|
+
const entry = this._entries.get(name as string);
|
|
100
|
+
if (entry == null) {
|
|
101
|
+
throw new Error(`등록되지 않은 공유 데이터: ${name as string}`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const client = this._clientFactory.get(entry.info.serviceKey);
|
|
105
|
+
await client.emitEvent(
|
|
106
|
+
SdSharedDataChangeEvent,
|
|
107
|
+
(item) => item.name === (name as string) && obj.equal(item.filter, entry.info.filter),
|
|
108
|
+
changeKeys,
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
async wait(): Promise<void> {
|
|
113
|
+
await waitUtil.until(() => this.loadingCount() <= 0);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private _loadAndListen(name: string, entry: ISharedDataEntry<any>): void {
|
|
117
|
+
this.loadingCount.update((v) => v + 1);
|
|
118
|
+
|
|
119
|
+
// 비동기 로드
|
|
120
|
+
void entry.info
|
|
121
|
+
.getter()
|
|
122
|
+
.then(async (data: any[]) => {
|
|
123
|
+
entry.itemsSignal.set(data);
|
|
124
|
+
|
|
125
|
+
// 이벤트 리스너 등록
|
|
126
|
+
if (entry.listenerKey == null) {
|
|
127
|
+
const client = this._clientFactory.get(entry.info.serviceKey);
|
|
128
|
+
entry.listenerKey = await client.addListener(
|
|
129
|
+
SdSharedDataChangeEvent,
|
|
130
|
+
{ name, filter: entry.info.filter },
|
|
131
|
+
async (changeKeys) => {
|
|
132
|
+
await this._onEvent(name, entry, changeKeys);
|
|
133
|
+
},
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
.catch((err) => {
|
|
138
|
+
this._errorHandler.handleError(err);
|
|
139
|
+
})
|
|
140
|
+
.finally(() => {
|
|
141
|
+
this.loadingCount.update((v) => v - 1);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
private async _onEvent(
|
|
146
|
+
name: string,
|
|
147
|
+
entry: ISharedDataEntry<any>,
|
|
148
|
+
changeKeys: (string | number)[] | undefined,
|
|
149
|
+
): Promise<void> {
|
|
150
|
+
this.loadingCount.update((v) => v + 1);
|
|
151
|
+
|
|
152
|
+
try {
|
|
153
|
+
if (changeKeys == null) {
|
|
154
|
+
// 전체 리로드
|
|
155
|
+
const data = await entry.info.getter();
|
|
156
|
+
entry.itemsSignal.set(data);
|
|
157
|
+
} else {
|
|
158
|
+
// 부분 업데이트
|
|
159
|
+
const newItems = await entry.info.getter(changeKeys);
|
|
160
|
+
const currentItems = entry.itemsSignal();
|
|
161
|
+
|
|
162
|
+
// 변경된 키를 제거하고 새 항목 추가
|
|
163
|
+
const filtered = currentItems.filter(
|
|
164
|
+
(item: any) => !changeKeys.includes(item.__valueKey),
|
|
165
|
+
);
|
|
166
|
+
const merged = [...filtered, ...newItems];
|
|
167
|
+
|
|
168
|
+
// orderBy 적용
|
|
169
|
+
if (entry.info.orderBy != null) {
|
|
170
|
+
merged.sort(entry.info.orderBy);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
entry.itemsSignal.set(merged);
|
|
174
|
+
}
|
|
175
|
+
} finally {
|
|
176
|
+
this.loadingCount.update((v) => v - 1);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { inject, Injectable } from "@angular/core";
|
|
2
|
+
import { SdLocalStorageProvider } from "./sd-local-storage.provider";
|
|
3
|
+
|
|
4
|
+
@Injectable({ providedIn: "root" })
|
|
5
|
+
export class SdSystemConfigProvider<T> {
|
|
6
|
+
private readonly _sdLocalStorage = inject<SdLocalStorageProvider<T>>(SdLocalStorageProvider);
|
|
7
|
+
|
|
8
|
+
fn?: {
|
|
9
|
+
set<K extends keyof T & string>(key: K, data: T[K]): Promise<void> | void;
|
|
10
|
+
get(key: keyof T & string): PromiseLike<any>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
async setAsync<K extends keyof T & string>(key: K, data: T[K]) {
|
|
14
|
+
if (this.fn) {
|
|
15
|
+
await this.fn.set(key, data);
|
|
16
|
+
} else {
|
|
17
|
+
this._sdLocalStorage.set(key, data);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async getAsync(key: keyof T & string) {
|
|
22
|
+
if (this.fn) {
|
|
23
|
+
return this.fn.get(key);
|
|
24
|
+
} else {
|
|
25
|
+
return this._sdLocalStorage.get(key);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { Injectable } from "@angular/core";
|
|
3
|
+
|
|
4
|
+
@Injectable({ providedIn: "root" })
|
|
5
|
+
export class SdSystemLogProvider {
|
|
6
|
+
writeFn?: (severity: "error" | "warn" | "log", ...data: any[]) => Promise<void> | void;
|
|
7
|
+
|
|
8
|
+
async writeAsync(severity: "error" | "warn" | "log", ...data: any[]): Promise<void> {
|
|
9
|
+
console[severity](...data);
|
|
10
|
+
|
|
11
|
+
if (this.writeFn) {
|
|
12
|
+
try {
|
|
13
|
+
await this.writeFn(severity, ...data);
|
|
14
|
+
} catch (err) {
|
|
15
|
+
console.error(err);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { InputSignal } from "@angular/core";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* undefined를 포함하는 프로퍼티를 optional로 변환하는 유틸리티 타입
|
|
5
|
+
*
|
|
6
|
+
* `{ name: string; age: number | undefined }` -> `{ name: string; age?: number }`
|
|
7
|
+
*/
|
|
8
|
+
export type TUndefToOptional<T> = {
|
|
9
|
+
[K in keyof T as undefined extends T[K] ? never : K]: T[K];
|
|
10
|
+
} & {
|
|
11
|
+
[K in keyof T as undefined extends T[K] ? K : never]?: Exclude<T[K], undefined>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 컴포넌트/디렉티브의 InputSignal 프로퍼티에서 값 타입을 추출하는 유틸리티 타입
|
|
16
|
+
*
|
|
17
|
+
* InputSignal이 아닌 프로퍼티는 제외되며, undefined를 포함하는 필드는 optional로 변환된다.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* class MyComponent {
|
|
22
|
+
* name = input.required<string>();
|
|
23
|
+
* age = input(0);
|
|
24
|
+
* }
|
|
25
|
+
* // TDirectiveInputSignals<MyComponent> = { name: string; age: number }
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export type TDirectiveInputSignals<T> = TUndefToOptional<{
|
|
29
|
+
[P in keyof T as T[P] extends InputSignal<any> ? P : never]: T[P] extends InputSignal<
|
|
30
|
+
infer V
|
|
31
|
+
>
|
|
32
|
+
? V
|
|
33
|
+
: never;
|
|
34
|
+
}>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ElementRef, inject, reflectComponentType } from "@angular/core";
|
|
2
|
+
import { ActivatedRoute, type CanDeactivateFn } from "@angular/router";
|
|
3
|
+
import { SdActivatedModalProvider } from "../../../ui/overlay/modal/sd-modal.provider";
|
|
4
|
+
|
|
5
|
+
export function setupCanDeactivate(fn: () => boolean): void {
|
|
6
|
+
const activatedModal = inject(SdActivatedModalProvider, { optional: true });
|
|
7
|
+
const activatedRoute = inject(ActivatedRoute, { optional: true });
|
|
8
|
+
const elRef = inject(ElementRef);
|
|
9
|
+
|
|
10
|
+
if (activatedModal != null) {
|
|
11
|
+
activatedModal.canDeactivefn = fn;
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (activatedRoute) {
|
|
16
|
+
if (!activatedRoute.routeConfig) return;
|
|
17
|
+
|
|
18
|
+
const component = activatedRoute.component;
|
|
19
|
+
if (component == null || typeof component === "string") return;
|
|
20
|
+
|
|
21
|
+
if (
|
|
22
|
+
reflectComponentType(component)?.selector !==
|
|
23
|
+
elRef.nativeElement.tagName.toLowerCase()
|
|
24
|
+
) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const canDeactivateFn: CanDeactivateFn<unknown> = () => fn();
|
|
29
|
+
if (activatedRoute.routeConfig.canDeactivate == null) {
|
|
30
|
+
activatedRoute.routeConfig.canDeactivate = [];
|
|
31
|
+
}
|
|
32
|
+
activatedRoute.routeConfig.canDeactivate.push(canDeactivateFn);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Signal, WritableSignal } from "@angular/core";
|
|
2
|
+
|
|
3
|
+
export function setupModelHook<T, S extends WritableSignal<T>>(
|
|
4
|
+
model: S,
|
|
5
|
+
canFn: Signal<(item: T) => boolean | Promise<boolean>>,
|
|
6
|
+
): void {
|
|
7
|
+
const orgSet = model.set;
|
|
8
|
+
model.set = (value) => {
|
|
9
|
+
const canSet = canFn()(value);
|
|
10
|
+
|
|
11
|
+
if (canSet === false) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (canSet === true) {
|
|
16
|
+
orgSet(value);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
void canSet.then((allowed) => {
|
|
21
|
+
if (allowed !== false) {
|
|
22
|
+
orgSet(value);
|
|
23
|
+
}
|
|
24
|
+
}).catch(() => {});
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { computed, inject, type Signal } from "@angular/core";
|
|
2
|
+
import { toSignal } from "@angular/core/rxjs-interop";
|
|
3
|
+
import { ActivatedRoute } from "@angular/router";
|
|
4
|
+
|
|
5
|
+
export function useCurrentPageCodeSignal(): Signal<string> | undefined {
|
|
6
|
+
const activatedRoute = inject(ActivatedRoute, { optional: true });
|
|
7
|
+
|
|
8
|
+
if (activatedRoute) {
|
|
9
|
+
const activatedUrlSegmentsSignals = activatedRoute.pathFromRoot
|
|
10
|
+
.slice(2)
|
|
11
|
+
.map((item) => toSignal(item.url, { initialValue: item.snapshot.url }));
|
|
12
|
+
return computed(() => activatedUrlSegmentsSignals.map((item) => item()).join("."));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|