@vc-shell/framework 1.2.3 → 1.2.4-beta.1
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/core/composables/index.ts +2 -0
- package/core/composables/useAppBarMobileButtons/index.ts +10 -1
- package/core/composables/useAppBarWidget/index.test.ts +86 -0
- package/core/composables/useAppBarWidget/index.ts +22 -3
- package/core/composables/useAssets/index.ts +78 -28
- package/core/composables/useAsync/index.ts +4 -1
- package/core/composables/useBlade/index.ts +137 -3
- package/core/composables/useBladeRegistry/index.test.ts +192 -0
- package/core/composables/useBladeRegistry/index.ts +61 -6
- package/core/composables/useBreadcrumbs/index.ts +4 -1
- package/core/composables/useDashboard/index.test.ts +86 -0
- package/core/composables/useDashboard/index.ts +36 -4
- package/core/composables/useErrorHandler/index.ts +4 -1
- package/core/composables/useFunctions/debounce.ts +0 -1
- package/core/composables/useFunctions/delay.ts +0 -1
- package/core/composables/useFunctions/index.ts +0 -1
- package/core/composables/useFunctions/once.ts +0 -1
- package/core/composables/useFunctions/sleep.ts +0 -1
- package/core/composables/useFunctions/throttle.ts +0 -1
- package/core/composables/useGlobalSearch/index.ts +12 -3
- package/core/composables/useLanguages/index.ts +30 -4
- package/core/composables/useMenuService/index.test.ts +86 -0
- package/core/composables/useMenuService/index.ts +17 -3
- package/core/composables/useNotifications/index.ts +5 -2
- package/core/composables/useSettingsMenu/index.test.ts +86 -0
- package/core/composables/useSettingsMenu/index.ts +17 -2
- package/core/composables/useTheme/index.ts +4 -1
- package/core/composables/useToolbar.ts +24 -12
- package/core/composables/useUser/index.ts +189 -20
- package/core/composables/useWidgets/index.test.ts +86 -0
- package/core/composables/useWidgets/index.ts +17 -3
- package/core/constants/defaults.ts +76 -0
- package/core/constants/index.ts +2 -0
- package/core/constants/ui.ts +68 -0
- package/core/interceptors/index.ts +5 -2
- package/core/plugins/ai-agent/README.md +336 -0
- package/core/plugins/ai-agent/components/VcAiAgentPanel.vue +125 -0
- package/core/plugins/ai-agent/components/_internal/VcAiAgentHeader.vue +102 -0
- package/core/plugins/ai-agent/components/_internal/VcAiAgentIframe.vue +107 -0
- package/core/plugins/ai-agent/components/_internal/VcAiAgentLoader.vue +72 -0
- package/core/plugins/ai-agent/components/_internal/VcVirtoOzLogo.vue +136 -0
- package/core/plugins/ai-agent/components/index.ts +1 -0
- package/core/plugins/ai-agent/composables/index.ts +4 -0
- package/core/plugins/ai-agent/composables/useAiAgent.ts +231 -0
- package/core/plugins/ai-agent/composables/useAiAgentContext.ts +285 -0
- package/core/plugins/ai-agent/constants.ts +89 -0
- package/core/plugins/ai-agent/index.ts +91 -0
- package/core/plugins/ai-agent/services/ai-agent-service.ts +621 -0
- package/core/plugins/ai-agent/types.ts +310 -0
- package/core/plugins/extension-points/ExtensionPoint.vue +95 -0
- package/core/plugins/extension-points/defineExtensionPoint.ts +29 -0
- package/core/plugins/extension-points/index.ts +10 -7
- package/core/plugins/extension-points/store.ts +54 -0
- package/core/plugins/extension-points/types.ts +28 -0
- package/core/plugins/extension-points/useExtensionPoint.ts +42 -0
- package/core/plugins/modularity/index.ts +47 -37
- package/core/plugins/modularity/loader.ts +36 -33
- package/core/plugins/signalR/index.ts +6 -3
- package/core/services/_internal/createBladeScopedRegistry.test.ts +130 -0
- package/core/services/_internal/createBladeScopedRegistry.ts +127 -0
- package/core/services/_internal/createPreregistrationBus.test.ts +175 -0
- package/core/services/_internal/createPreregistrationBus.ts +89 -0
- package/core/services/_internal/createSimpleMapRegistry.test.ts +82 -0
- package/core/services/_internal/createSimpleMapRegistry.ts +41 -0
- package/core/services/_internal/index.ts +3 -0
- package/core/services/app-bar-menu-service.ts +23 -44
- package/core/services/app-bar-settings-service.test.ts +138 -0
- package/core/services/dashboard-service.ts +39 -44
- package/core/services/global-search-service/global-search-service.md +19 -194
- package/core/services/index.ts +2 -0
- package/core/services/language-dashboard-service.test.ts +183 -0
- package/core/services/language-service.ts +22 -12
- package/core/services/menu-service.test.ts +118 -0
- package/core/services/menu-service.ts +71 -24
- package/core/services/settings-menu-service.ts +22 -39
- package/core/services/toolbar-service.ts +49 -89
- package/core/services/toolbar-widget-service.test.ts +207 -0
- package/core/services/widget-service.ts +78 -155
- package/core/shell-features/ai-agent.ts +22 -0
- package/core/shell-features/index.ts +16 -0
- package/core/shell-features/notifications.ts +22 -0
- package/core/shell-features/settings.ts +15 -0
- package/core/types/index.ts +32 -0
- package/core/types/services.ts +194 -0
- package/core/types/shell-feature.ts +44 -0
- package/core/utilities/errorTypes.ts +126 -0
- package/core/utilities/index.ts +2 -0
- package/core/utilities/logger.ts +120 -0
- package/dist/core/composables/useAppBarMobileButtons/index.d.ts.map +1 -1
- package/dist/core/composables/useAppBarWidget/index.d.ts.map +1 -1
- package/dist/core/composables/useAppBarWidget/index.test.d.ts +2 -0
- package/dist/core/composables/useAppBarWidget/index.test.d.ts.map +1 -0
- package/dist/core/composables/useAssets/index.d.ts.map +1 -1
- package/dist/core/composables/useAsync/index.d.ts.map +1 -1
- package/dist/core/composables/useBlade/index.d.ts +41 -2
- package/dist/core/composables/useBlade/index.d.ts.map +1 -1
- package/dist/core/composables/useBladeRegistry/index.d.ts +7 -1
- package/dist/core/composables/useBladeRegistry/index.d.ts.map +1 -1
- package/dist/core/composables/useBladeRegistry/index.test.d.ts +2 -0
- package/dist/core/composables/useBladeRegistry/index.test.d.ts.map +1 -0
- package/dist/core/composables/useBreadcrumbs/index.d.ts.map +1 -1
- package/dist/core/composables/useDashboard/index.d.ts.map +1 -1
- package/dist/core/composables/useDashboard/index.test.d.ts +2 -0
- package/dist/core/composables/useDashboard/index.test.d.ts.map +1 -0
- package/dist/core/composables/useErrorHandler/index.d.ts.map +1 -1
- package/dist/core/composables/useFunctions/debounce.d.ts.map +1 -1
- package/dist/core/composables/useFunctions/delay.d.ts.map +1 -1
- package/dist/core/composables/useFunctions/index.d.ts.map +1 -1
- package/dist/core/composables/useFunctions/once.d.ts.map +1 -1
- package/dist/core/composables/useFunctions/sleep.d.ts.map +1 -1
- package/dist/core/composables/useFunctions/throttle.d.ts.map +1 -1
- package/dist/core/composables/useGlobalSearch/index.d.ts.map +1 -1
- package/dist/core/composables/useLanguages/index.d.ts.map +1 -1
- package/dist/core/composables/useMenuService/index.d.ts.map +1 -1
- package/dist/core/composables/useMenuService/index.test.d.ts +2 -0
- package/dist/core/composables/useMenuService/index.test.d.ts.map +1 -0
- package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
- package/dist/core/composables/useSettingsMenu/index.d.ts.map +1 -1
- package/dist/core/composables/useSettingsMenu/index.test.d.ts +2 -0
- package/dist/core/composables/useSettingsMenu/index.test.d.ts.map +1 -0
- package/dist/core/composables/useTheme/index.d.ts.map +1 -1
- package/dist/core/composables/useToolbar.d.ts +13 -6
- package/dist/core/composables/useToolbar.d.ts.map +1 -1
- package/dist/core/composables/useUser/index.d.ts +8 -0
- package/dist/core/composables/useUser/index.d.ts.map +1 -1
- package/dist/core/composables/useWidgets/index.d.ts.map +1 -1
- package/dist/core/composables/useWidgets/index.test.d.ts +2 -0
- package/dist/core/composables/useWidgets/index.test.d.ts.map +1 -0
- package/dist/core/constants/defaults.d.ts +63 -0
- package/dist/core/constants/defaults.d.ts.map +1 -0
- package/dist/core/constants/index.d.ts +2 -0
- package/dist/core/constants/index.d.ts.map +1 -1
- package/dist/core/constants/ui.d.ts +50 -0
- package/dist/core/constants/ui.d.ts.map +1 -0
- package/dist/core/interceptors/index.d.ts.map +1 -1
- package/dist/core/plugins/ai-agent/components/VcAiAgentPanel.vue.d.ts +3 -0
- package/dist/core/plugins/ai-agent/components/VcAiAgentPanel.vue.d.ts.map +1 -0
- package/dist/core/plugins/ai-agent/components/_internal/VcAiAgentHeader.vue.d.ts +15 -0
- package/dist/core/plugins/ai-agent/components/_internal/VcAiAgentHeader.vue.d.ts.map +1 -0
- package/dist/core/plugins/ai-agent/components/_internal/VcAiAgentIframe.vue.d.ts +10 -0
- package/dist/core/plugins/ai-agent/components/_internal/VcAiAgentIframe.vue.d.ts.map +1 -0
- package/dist/core/plugins/ai-agent/components/_internal/VcAiAgentLoader.vue.d.ts +7 -0
- package/dist/core/plugins/ai-agent/components/_internal/VcAiAgentLoader.vue.d.ts.map +1 -0
- package/dist/core/plugins/ai-agent/components/_internal/VcVirtoOzLogo.vue.d.ts +15 -0
- package/dist/core/plugins/ai-agent/components/_internal/VcVirtoOzLogo.vue.d.ts.map +1 -0
- package/dist/core/plugins/ai-agent/components/index.d.ts +2 -0
- package/dist/core/plugins/ai-agent/components/index.d.ts.map +1 -0
- package/dist/core/plugins/ai-agent/composables/index.d.ts +4 -0
- package/dist/core/plugins/ai-agent/composables/index.d.ts.map +1 -0
- package/dist/core/plugins/ai-agent/composables/useAiAgent.d.ts +95 -0
- package/dist/core/plugins/ai-agent/composables/useAiAgent.d.ts.map +1 -0
- package/dist/core/plugins/ai-agent/composables/useAiAgentContext.d.ts +55 -0
- package/dist/core/plugins/ai-agent/composables/useAiAgentContext.d.ts.map +1 -0
- package/dist/core/plugins/ai-agent/constants.d.ts +47 -0
- package/dist/core/plugins/ai-agent/constants.d.ts.map +1 -0
- package/dist/core/plugins/ai-agent/index.d.ts +48 -0
- package/dist/core/plugins/ai-agent/index.d.ts.map +1 -0
- package/dist/core/plugins/ai-agent/services/ai-agent-service.d.ts +45 -0
- package/dist/core/plugins/ai-agent/services/ai-agent-service.d.ts.map +1 -0
- package/dist/core/plugins/ai-agent/types.d.ts +258 -0
- package/dist/core/plugins/ai-agent/types.d.ts.map +1 -0
- package/dist/core/plugins/extension-points/ExtensionPoint.vue.d.ts +30 -0
- package/dist/core/plugins/extension-points/ExtensionPoint.vue.d.ts.map +1 -0
- package/dist/core/plugins/extension-points/defineExtensionPoint.d.ts +19 -0
- package/dist/core/plugins/extension-points/defineExtensionPoint.d.ts.map +1 -0
- package/dist/core/plugins/extension-points/index.d.ts +4 -2
- package/dist/core/plugins/extension-points/index.d.ts.map +1 -1
- package/dist/core/plugins/extension-points/store.d.ts +18 -0
- package/dist/core/plugins/extension-points/store.d.ts.map +1 -0
- package/dist/core/plugins/extension-points/types.d.ts +26 -0
- package/dist/core/plugins/extension-points/types.d.ts.map +1 -0
- package/dist/core/plugins/extension-points/useExtensionPoint.d.ts +22 -0
- package/dist/core/plugins/extension-points/useExtensionPoint.d.ts.map +1 -0
- package/dist/core/plugins/modularity/index.d.ts +18 -1
- package/dist/core/plugins/modularity/index.d.ts.map +1 -1
- package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
- package/dist/core/plugins/signalR/index.d.ts.map +1 -1
- package/dist/core/services/_internal/createBladeScopedRegistry.d.ts +23 -0
- package/dist/core/services/_internal/createBladeScopedRegistry.d.ts.map +1 -0
- package/dist/core/services/_internal/createBladeScopedRegistry.test.d.ts +2 -0
- package/dist/core/services/_internal/createBladeScopedRegistry.test.d.ts.map +1 -0
- package/dist/core/services/_internal/createPreregistrationBus.d.ts +17 -0
- package/dist/core/services/_internal/createPreregistrationBus.d.ts.map +1 -0
- package/dist/core/services/_internal/createPreregistrationBus.test.d.ts +2 -0
- package/dist/core/services/_internal/createPreregistrationBus.test.d.ts.map +1 -0
- package/dist/core/services/_internal/createSimpleMapRegistry.d.ts +19 -0
- package/dist/core/services/_internal/createSimpleMapRegistry.d.ts.map +1 -0
- package/dist/core/services/_internal/createSimpleMapRegistry.test.d.ts +2 -0
- package/dist/core/services/_internal/createSimpleMapRegistry.test.d.ts.map +1 -0
- package/dist/core/services/_internal/index.d.ts +4 -0
- package/dist/core/services/_internal/index.d.ts.map +1 -0
- package/dist/core/services/app-bar-menu-service.d.ts +4 -3
- package/dist/core/services/app-bar-menu-service.d.ts.map +1 -1
- package/dist/core/services/app-bar-settings-service.test.d.ts +2 -0
- package/dist/core/services/app-bar-settings-service.test.d.ts.map +1 -0
- package/dist/core/services/dashboard-service.d.ts +8 -4
- package/dist/core/services/dashboard-service.d.ts.map +1 -1
- package/dist/core/services/language-dashboard-service.test.d.ts +2 -0
- package/dist/core/services/language-dashboard-service.test.d.ts.map +1 -0
- package/dist/core/services/language-service.d.ts.map +1 -1
- package/dist/core/services/menu-service.d.ts +1 -0
- package/dist/core/services/menu-service.d.ts.map +1 -1
- package/dist/core/services/menu-service.test.d.ts +2 -0
- package/dist/core/services/menu-service.test.d.ts.map +1 -0
- package/dist/core/services/settings-menu-service.d.ts +3 -2
- package/dist/core/services/settings-menu-service.d.ts.map +1 -1
- package/dist/core/services/toolbar-service.d.ts +2 -1
- package/dist/core/services/toolbar-service.d.ts.map +1 -1
- package/dist/core/services/toolbar-widget-service.test.d.ts +2 -0
- package/dist/core/services/toolbar-widget-service.test.d.ts.map +1 -0
- package/dist/core/services/widget-service.d.ts +9 -9
- package/dist/core/services/widget-service.d.ts.map +1 -1
- package/dist/core/shell-features/ai-agent.d.ts +8 -0
- package/dist/core/shell-features/ai-agent.d.ts.map +1 -0
- package/dist/core/shell-features/index.d.ts +14 -0
- package/dist/core/shell-features/index.d.ts.map +1 -0
- package/dist/core/shell-features/notifications.d.ts +3 -0
- package/dist/core/shell-features/notifications.d.ts.map +1 -0
- package/dist/core/shell-features/settings.d.ts +3 -0
- package/dist/core/shell-features/settings.d.ts.map +1 -0
- package/dist/core/types/index.d.ts +30 -1
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/core/types/services.d.ts +169 -0
- package/dist/core/types/services.d.ts.map +1 -0
- package/dist/core/types/shell-feature.d.ts +39 -0
- package/dist/core/types/shell-feature.d.ts.map +1 -0
- package/dist/core/utilities/errorTypes.d.ts +61 -0
- package/dist/core/utilities/errorTypes.d.ts.map +1 -0
- package/dist/core/utilities/index.d.ts +2 -0
- package/dist/core/utilities/index.d.ts.map +1 -1
- package/dist/core/utilities/logger.d.ts +259 -0
- package/dist/core/utilities/logger.d.ts.map +1 -0
- package/dist/framework.js +22000 -15158
- package/dist/index.css +1 -1
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/injection-keys.d.ts +23 -7
- package/dist/injection-keys.d.ts.map +1 -1
- package/dist/locales/de.json +57 -10
- package/dist/locales/en.json +58 -11
- package/dist/shared/components/app-switcher/composables/useAppSwitcher/index.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/components/index.d.ts +1 -0
- package/dist/shared/components/blade-navigation/components/index.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/index.d.ts +2 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/index.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation-new.vue.d.ts +3 -0
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation-new.vue.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/components/vc-blade-slot/index.d.ts +2 -0
- package/dist/shared/components/blade-navigation/components/vc-blade-slot/index.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/components/vc-blade-slot/vc-blade-slot.vue.d.ts +20 -0
- package/dist/shared/components/blade-navigation/components/vc-blade-slot/vc-blade-slot.vue.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts +1 -1
- package/dist/shared/components/blade-navigation/composables/index.d.ts +5 -1
- package/dist/shared/components/blade-navigation/composables/index.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/composables/useBladeMessaging.d.ts +16 -0
- package/dist/shared/components/blade-navigation/composables/useBladeMessaging.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/composables/useBladeMessaging.test.d.ts +2 -0
- package/dist/shared/components/blade-navigation/composables/useBladeMessaging.test.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/composables/useBladeNavigationAdapter.d.ts +33 -0
- package/dist/shared/components/blade-navigation/composables/useBladeNavigationAdapter.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/composables/useBladeStack.d.ts +17 -0
- package/dist/shared/components/blade-navigation/composables/useBladeStack.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/composables/useBladeStack.test.d.ts +2 -0
- package/dist/shared/components/blade-navigation/composables/useBladeStack.test.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/index.d.ts +1 -1
- package/dist/shared/components/blade-navigation/index.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/plugin-v2.d.ts +39 -0
- package/dist/shared/components/blade-navigation/plugin-v2.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/types/index.d.ts +115 -1
- package/dist/shared/components/blade-navigation/types/index.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/utils/restoreFromUrl.d.ts +20 -0
- package/dist/shared/components/blade-navigation/utils/restoreFromUrl.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/utils/restoreFromUrl.test.d.ts +2 -0
- package/dist/shared/components/blade-navigation/utils/restoreFromUrl.test.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/utils/urlSync.d.ts +54 -0
- package/dist/shared/components/blade-navigation/utils/urlSync.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/utils/urlSync.test.d.ts +2 -0
- package/dist/shared/components/blade-navigation/utils/urlSync.test.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/DraggableDashboard.vue.d.ts +14 -2
- package/dist/shared/components/draggable-dashboard/DraggableDashboard.vue.d.ts.map +1 -1
- package/dist/shared/components/draggable-dashboard/GridstackDashboard.vue.d.ts +21 -0
- package/dist/shared/components/draggable-dashboard/GridstackDashboard.vue.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useGridstack.d.ts +56 -0
- package/dist/shared/components/draggable-dashboard/composables/useGridstack.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useGridstackAdapter.d.ts +47 -0
- package/dist/shared/components/draggable-dashboard/composables/useGridstackAdapter.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/index.d.ts +11 -0
- package/dist/shared/components/draggable-dashboard/index.d.ts.map +1 -1
- package/dist/shared/components/generic-dropdown/generic-dropdown.vue.d.ts +10 -6
- package/dist/shared/components/generic-dropdown/generic-dropdown.vue.d.ts.map +1 -1
- package/dist/shared/components/generic-dropdown/index.d.ts +72 -1
- package/dist/shared/components/generic-dropdown/index.d.ts.map +1 -1
- package/dist/shared/components/index.d.ts +8 -2
- package/dist/shared/components/index.d.ts.map +1 -1
- package/dist/shared/components/language-selector/language-selector.vue.d.ts.map +1 -1
- package/dist/shared/components/multilanguage-selector/multilanguage-selector.vue.d.ts.map +1 -1
- package/dist/shared/components/notification-dropdown/notification-dropdown.vue.d.ts.map +1 -1
- package/dist/shared/components/notifications/components/notification-container/index.d.ts +1 -1
- package/dist/shared/components/notifications/components/notification-container/index.d.ts.map +1 -1
- package/dist/shared/components/notifications/composables/useContainer/index.d.ts.map +1 -1
- package/dist/shared/components/notifications/composables/useInstance/index.d.ts.map +1 -1
- package/dist/shared/components/notifications/core/notification.d.ts.map +1 -1
- package/dist/shared/components/popup-handler/components/vc-popup-container/vc-popup-container.vue.d.ts.map +1 -1
- package/dist/shared/components/sidebar/index.d.ts +46 -1
- package/dist/shared/components/sidebar/index.d.ts.map +1 -1
- package/dist/shared/components/sidebar/sidebar.vue.d.ts +5 -6
- package/dist/shared/components/sidebar/sidebar.vue.d.ts.map +1 -1
- package/dist/shared/components/sign-in/external-providers.vue.d.ts.map +1 -1
- package/dist/shared/components/sign-in/useExternalProvider.d.ts.map +1 -1
- package/dist/shared/components/theme-selector/theme-selector.vue.d.ts.map +1 -1
- package/dist/shared/components/user-dropdown-button/_internal/user-info.vue.d.ts.map +1 -1
- package/dist/shared/components/user-dropdown-button/_internal/user-sidebar.vue.d.ts.map +1 -1
- package/dist/shared/composables/useExternalWidgets.d.ts.map +1 -1
- package/dist/shared/composables/useMenuExpanded.d.ts.map +1 -1
- package/dist/shared/composables/useTableSelection.d.ts.map +1 -1
- package/dist/shared/composables/useTableSort.d.ts.map +1 -1
- package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts.map +1 -1
- package/dist/shared/pages/ChangePasswordPage/components/change-password/ChangePassword.vue.d.ts +4 -4
- package/dist/shared/pages/ChangePasswordPage/components/change-password/ChangePassword.vue.d.ts.map +1 -1
- package/dist/shared/pages/ForgotPasswordPage/components/forgot-password/ForgotPassword.vue.d.ts +13 -0
- package/dist/shared/pages/ForgotPasswordPage/components/forgot-password/ForgotPassword.vue.d.ts.map +1 -0
- package/dist/shared/pages/ForgotPasswordPage/components/forgot-password/index.d.ts +3 -0
- package/dist/shared/pages/ForgotPasswordPage/components/forgot-password/index.d.ts.map +1 -0
- package/dist/shared/pages/ForgotPasswordPage/components/index.d.ts +2 -0
- package/dist/shared/pages/ForgotPasswordPage/components/index.d.ts.map +1 -0
- package/dist/shared/pages/ForgotPasswordPage/index.d.ts +2 -0
- package/dist/shared/pages/ForgotPasswordPage/index.d.ts.map +1 -0
- package/dist/shared/pages/ForgotPasswordPage/plugin.d.ts +4 -0
- package/dist/shared/pages/ForgotPasswordPage/plugin.d.ts.map +1 -0
- package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
- package/dist/shared/pages/LoginPage/components/login/Login.vue.d.ts +4 -9
- package/dist/shared/pages/LoginPage/components/login/Login.vue.d.ts.map +1 -1
- package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
- package/dist/shared/pages/index.d.ts +1 -0
- package/dist/shared/pages/index.d.ts.map +1 -1
- package/dist/shared/pages/plugin.d.ts +1 -0
- package/dist/shared/pages/plugin.d.ts.map +1 -1
- package/dist/shared/utilities/colorUtils.d.ts +0 -6
- package/dist/shared/utilities/colorUtils.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-banner/vc-banner.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-button/index.d.ts +2 -0
- package/dist/ui/components/atoms/vc-button/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-button/types.d.ts +13 -0
- package/dist/ui/components/atoms/vc-button/types.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-button/vc-button-group.vue.d.ts +22 -0
- package/dist/ui/components/atoms/vc-button/vc-button-group.vue.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts +10 -19
- package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-container/vc-container.vue.d.ts +3 -8
- package/dist/ui/components/atoms/vc-container/vc-container.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-image/vc-image.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-link/vc-link.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-loading/vc-loading.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-status/vc-status.vue.d.ts +0 -5
- package/dist/ui/components/atoms/vc-status/vc-status.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-tooltip/vc-tooltip.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-video/vc-video.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-widget/vc-widget.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/index.d.ts +5 -0
- package/dist/ui/components/molecules/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-accordion/_internal/vc-accordion-item/vc-accordion-item.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-accordion/_internal/vc-accordion-item/vc-accordion-item.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-accordion/vc-accordion.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-accordion/vc-accordion.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-checkbox/vc-checkbox.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-color-input/index.d.ts +2 -0
- package/dist/ui/components/molecules/vc-color-input/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-color-input/vc-color-input.vue.d.ts +40 -0
- package/dist/ui/components/molecules/vc-color-input/vc-color-input.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-date-picker/index.d.ts +2 -0
- package/dist/ui/components/molecules/vc-date-picker/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-date-picker/vc-date-picker.vue.d.ts +42 -0
- package/dist/ui/components/molecules/vc-date-picker/vc-date-picker.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-dropdown/index.d.ts +2 -0
- package/dist/ui/components/molecules/vc-dropdown/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-dropdown/vc-dropdown.test.d.ts +2 -0
- package/dist/ui/components/molecules/vc-dropdown/vc-dropdown.test.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-dropdown/vc-dropdown.vue.d.ts +65 -0
- package/dist/ui/components/molecules/vc-dropdown/vc-dropdown.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-dropdown-panel/index.d.ts +2 -0
- package/dist/ui/components/molecules/vc-dropdown-panel/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-dropdown-panel/vc-dropdown-panel.vue.d.ts +52 -0
- package/dist/ui/components/molecules/vc-dropdown-panel/vc-dropdown-panel.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts +1 -2
- package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/_internal/MultivalueDropdown.vue.d.ts +36 -0
- package/dist/ui/components/molecules/vc-multivalue/_internal/MultivalueDropdown.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-multivalue/_internal/MultivalueTrigger.vue.d.ts +63 -0
- package/dist/ui/components/molecules/vc-multivalue/_internal/MultivalueTrigger.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/index.d.ts +7 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/useMultivalueColor.d.ts +20 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/useMultivalueColor.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/useMultivalueDropdown.d.ts +38 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/useMultivalueDropdown.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/useMultivalueInput.d.ts +21 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/useMultivalueInput.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/useMultivalueMode.d.ts +18 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/useMultivalueMode.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/useMultivalueOptions.d.ts +14 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/useMultivalueOptions.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/useMultivalueValues.d.ts +21 -0
- package/dist/ui/components/molecules/vc-multivalue/composables/useMultivalueValues.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +8 -2
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-paginator/index.d.ts +4 -0
- package/dist/ui/components/molecules/vc-paginator/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-paginator/vc-paginator.vue.d.ts +73 -0
- package/dist/ui/components/molecules/vc-paginator/vc-paginator.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-radio-button/vc-radio-button.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/_internal/SelectDropdown.vue.d.ts +48 -0
- package/dist/ui/components/molecules/vc-select/_internal/SelectDropdown.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/_internal/SelectTrigger.vue.d.ts +72 -0
- package/dist/ui/components/molecules/vc-select/_internal/SelectTrigger.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/composables/index.d.ts +8 -0
- package/dist/ui/components/molecules/vc-select/composables/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectDefaultValue.d.ts +16 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectDefaultValue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectDropdown.d.ts +32 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectDropdown.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectOptions.d.ts +19 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectOptions.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectSearch.d.ts +23 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectSearch.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectSelection.d.ts +44 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectSelection.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectValueMapping.d.ts +15 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectValueMapping.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectVisibility.d.ts +6 -0
- package/dist/ui/components/molecules/vc-select/composables/useSelectVisibility.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/index.d.ts +1 -0
- package/dist/ui/components/molecules/vc-select/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-switch/vc-switch.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-toast/vc-toast.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/index.d.ts +2 -1
- package/dist/ui/components/organisms/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarMobileActions.vue.d.ts +8 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarMobileActions.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarOverlay.vue.d.ts +18 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarOverlay.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarWidgetContent.vue.d.ts +8 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarWidgetContent.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarWidgetItem.vue.d.ts +33 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarWidgetItem.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarWidgetsMenu.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/MenuSidebar.vue.d.ts +25 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/MenuSidebar.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/composables/useAppBarMobileActions.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/composables/useAppBarState.d.ts +17 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/composables/useAppBarState.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/composables/useAppBarWidgets.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/composables/useToggleableContent.d.ts +23 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/composables/useToggleableContent.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/layouts/DesktopLayout.vue.d.ts +53 -0
- package/dist/ui/components/organisms/vc-app/_internal/layouts/DesktopLayout.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/layouts/MobileLayout.vue.d.ts +51 -0
- package/dist/ui/components/organisms/vc-app/_internal/layouts/MobileLayout.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/menu/VcAppMenu.vue.d.ts +13 -0
- package/dist/ui/components/organisms/vc-app/_internal/menu/VcAppMenu.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/menu/VcAppMenuGroup.vue.d.ts +21 -0
- package/dist/ui/components/organisms/vc-app/_internal/menu/VcAppMenuGroup.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/menu/VcAppMenuItem.vue.d.ts +32 -0
- package/dist/ui/components/organisms/vc-app/_internal/menu/VcAppMenuItem.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/menu/composables/useBadge.d.ts +18 -0
- package/dist/ui/components/organisms/vc-app/_internal/menu/composables/useBadge.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/menu/composables/useMenuActiveState.d.ts +18 -0
- package/dist/ui/components/organisms/vc-app/_internal/menu/composables/useMenuActiveState.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/sidebar/SidebarCollapseButton.vue.d.ts +10 -0
- package/dist/ui/components/organisms/vc-app/_internal/sidebar/SidebarCollapseButton.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/sidebar/SidebarContent.vue.d.ts +37 -0
- package/dist/ui/components/organisms/vc-app/_internal/sidebar/SidebarContent.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/sidebar/SidebarHeader.vue.d.ts +35 -0
- package/dist/ui/components/organisms/vc-app/_internal/sidebar/SidebarHeader.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/composables/useShellBootstrap.d.ts +18 -0
- package/dist/ui/components/organisms/vc-app/composables/useShellBootstrap.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/composables/useShellLifecycle.d.ts +13 -0
- package/dist/ui/components/organisms/vc-app/composables/useShellLifecycle.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/composables/useShellNavigation.d.ts +10 -0
- package/dist/ui/components/organisms/vc-app/composables/useShellNavigation.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/composables/useSidebarState.d.ts +34 -0
- package/dist/ui/components/organisms/vc-app/composables/useSidebarState.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/composition/app-bar/index.d.ts +7 -0
- package/dist/ui/components/organisms/vc-app/composition/app-bar/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/composition/index.d.ts +7 -0
- package/dist/ui/components/organisms/vc-app/composition/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/composition/layouts/index.d.ts +3 -0
- package/dist/ui/components/organisms/vc-app/composition/layouts/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/composition/menu/index.d.ts +6 -0
- package/dist/ui/components/organisms/vc-app/composition/menu/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/composition/shell/index.d.ts +4 -0
- package/dist/ui/components/organisms/vc-app/composition/shell/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/composition/sidebar/index.d.ts +4 -0
- package/dist/ui/components/organisms/vc-app/composition/sidebar/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/composition/state/index.d.ts +6 -0
- package/dist/ui/components/organisms/vc-app/composition/state/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/index.d.ts +1 -0
- package/dist/ui/components/organisms/vc-app/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts +36 -6
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-auth-layout/index.d.ts +2 -0
- package/dist/ui/components/organisms/vc-auth-layout/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-auth-layout/vc-auth-layout.vue.d.ts +31 -0
- package/dist/ui/components/organisms/vc-auth-layout/vc-auth-layout.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/BladeHeader.vue.d.ts +30 -0
- package/dist/ui/components/organisms/vc-blade/_internal/BladeHeader.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/BladeStatusBanners.vue.d.ts +6 -0
- package/dist/ui/components/organisms/vc-blade/_internal/BladeStatusBanners.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/BladeToolbar.vue.d.ts +19 -0
- package/dist/ui/components/organisms/vc-blade/_internal/BladeToolbar.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/composables/useBladeError.d.ts +14 -0
- package/dist/ui/components/organisms/vc-blade/_internal/composables/useBladeError.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/composables/useToolbarRegistration.d.ts +15 -0
- package/dist/ui/components/organisms/vc-blade/_internal/composables/useToolbarRegistration.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarBaseButton.test.d.ts +2 -0
- package/dist/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarBaseButton.test.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarBaseButton.vue.d.ts +9 -0
- package/dist/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarBaseButton.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarCircleButton.vue.d.ts +13 -0
- package/dist/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarCircleButton.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarDesktop.vue.d.ts +8 -0
- package/dist/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarDesktop.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarMobile.vue.d.ts +7 -0
- package/dist/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarMobile.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/toolbar/toolbar-button-props.d.ts +14 -0
- package/dist/ui/components/organisms/vc-blade/_internal/toolbar/toolbar-button-props.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/widgets/WidgetContainer.vue.d.ts +6 -0
- package/dist/ui/components/organisms/vc-blade/_internal/widgets/WidgetContainer.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/widgets/WidgetContainerDesktop.vue.d.ts +8 -0
- package/dist/ui/components/organisms/vc-blade/_internal/widgets/WidgetContainerDesktop.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/_internal/widgets/WidgetContainerMobile.vue.d.ts +8 -0
- package/dist/ui/components/organisms/vc-blade/_internal/widgets/WidgetContainerMobile.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/constants.d.ts +8 -0
- package/dist/ui/components/organisms/vc-blade/constants.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/utils.d.ts +21 -0
- package/dist/ui/components/organisms/vc-blade/utils.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/utils.test.d.ts +2 -0
- package/dist/ui/components/organisms/vc-blade/utils.test.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +3 -6
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-sidebar/index.d.ts +2 -0
- package/dist/ui/components/organisms/vc-sidebar/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-sidebar/vc-sidebar.test.d.ts +2 -0
- package/dist/ui/components/organisms/vc-sidebar/vc-sidebar.test.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-sidebar/vc-sidebar.vue.d.ts +79 -0
- package/dist/ui/components/organisms/vc-sidebar/vc-sidebar.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/VcDataTable.vue.d.ts +124 -0
- package/dist/ui/components/organisms/vc-table/VcDataTable.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/VcTableAdapter.vue.d.ts +127 -0
- package/dist/ui/components/organisms/vc-table/VcTableAdapter.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-base-header/vc-table-base-header.vue.d.ts +3 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-base-header/vc-table-base-header.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/base/BaseVcDataTable.d.ts +369 -0
- package/dist/ui/components/organisms/vc-table/base/BaseVcDataTable.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/ColumnFilter.vue.d.ts +58 -0
- package/dist/ui/components/organisms/vc-table/components/ColumnFilter.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/ColumnSwitcherButton.vue.d.ts +13 -0
- package/dist/ui/components/organisms/vc-table/components/ColumnSwitcherButton.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/DataTableBody.vue.d.ts +140 -0
- package/dist/ui/components/organisms/vc-table/components/DataTableBody.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/DataTableCellRenderer.vue.d.ts +47 -0
- package/dist/ui/components/organisms/vc-table/components/DataTableCellRenderer.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/DataTableHeader.vue.d.ts +78 -0
- package/dist/ui/components/organisms/vc-table/components/DataTableHeader.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/DataTableRow.vue.d.ts +111 -0
- package/dist/ui/components/organisms/vc-table/components/DataTableRow.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/GlobalFiltersButton.vue.d.ts +16 -0
- package/dist/ui/components/organisms/vc-table/components/GlobalFiltersButton.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/GlobalFiltersPanel.vue.d.ts +39 -0
- package/dist/ui/components/organisms/vc-table/components/GlobalFiltersPanel.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/Table.vue.d.ts +21 -0
- package/dist/ui/components/organisms/vc-table/components/Table.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableActions.vue.d.ts +22 -0
- package/dist/ui/components/organisms/vc-table/components/TableActions.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableAddRowButton.vue.d.ts +16 -0
- package/dist/ui/components/organisms/vc-table/components/TableAddRowButton.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableBody.vue.d.ts +31 -0
- package/dist/ui/components/organisms/vc-table/components/TableBody.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableCell.vue.d.ts +43 -0
- package/dist/ui/components/organisms/vc-table/components/TableCell.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableCheckbox.vue.d.ts +27 -0
- package/dist/ui/components/organisms/vc-table/components/TableCheckbox.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableColumnSwitcher.vue.d.ts +29 -0
- package/dist/ui/components/organisms/vc-table/components/TableColumnSwitcher.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableEmpty.vue.d.ts +29 -0
- package/dist/ui/components/organisms/vc-table/components/TableEmpty.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableFooter.vue.d.ts +13 -0
- package/dist/ui/components/organisms/vc-table/components/TableFooter.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableGroupRow.vue.d.ts +29 -0
- package/dist/ui/components/organisms/vc-table/components/TableGroupRow.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableHead.vue.d.ts +75 -0
- package/dist/ui/components/organisms/vc-table/components/TableHead.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableHeader.vue.d.ts +13 -0
- package/dist/ui/components/organisms/vc-table/components/TableHeader.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableResizeHandle.vue.d.ts +17 -0
- package/dist/ui/components/organisms/vc-table/components/TableResizeHandle.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableRow.vue.d.ts +64 -0
- package/dist/ui/components/organisms/vc-table/components/TableRow.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableRowActions.vue.d.ts +42 -0
- package/dist/ui/components/organisms/vc-table/components/TableRowActions.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableSearchHeader.vue.d.ts +68 -0
- package/dist/ui/components/organisms/vc-table/components/TableSearchHeader.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/TableSelectAllBar.vue.d.ts +28 -0
- package/dist/ui/components/organisms/vc-table/components/TableSelectAllBar.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/VcColumn.vue.d.ts +361 -0
- package/dist/ui/components/organisms/vc-table/components/VcColumn.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/_internal/SlotProxy.d.ts +35 -0
- package/dist/ui/components/organisms/vc-table/components/_internal/SlotProxy.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellDate.vue.d.ts +11 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellDate.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellDateAgo.vue.d.ts +7 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellDateAgo.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellDefault.vue.d.ts +37 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellDefault.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellEditableWrapper.vue.d.ts +26 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellEditableWrapper.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellHtml.vue.d.ts +9 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellHtml.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellImage.vue.d.ts +9 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellImage.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellLink.vue.d.ts +7 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellLink.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellMoney.vue.d.ts +39 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellMoney.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellNumber.vue.d.ts +37 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellNumber.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellStatus.vue.d.ts +7 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellStatus.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellStatusIcon.vue.d.ts +7 -0
- package/dist/ui/components/organisms/vc-table/components/cells/CellStatusIcon.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/cells/DynamicCellRenderer.vue.d.ts +45 -0
- package/dist/ui/components/organisms/vc-table/components/cells/DynamicCellRenderer.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/cells/index.d.ts +12 -0
- package/dist/ui/components/organisms/vc-table/components/cells/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/index.d.ts +27 -0
- package/dist/ui/components/organisms/vc-table/components/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/mobile/DataTableMobileCard.vue.d.ts +44 -0
- package/dist/ui/components/organisms/vc-table/components/mobile/DataTableMobileCard.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/mobile/DataTableMobileView.vue.d.ts +56 -0
- package/dist/ui/components/organisms/vc-table/components/mobile/DataTableMobileView.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/mobile/MobileActionSheet.vue.d.ts +27 -0
- package/dist/ui/components/organisms/vc-table/components/mobile/MobileActionSheet.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/mobile/MobileCellRenderer.vue.d.ts +22 -0
- package/dist/ui/components/organisms/vc-table/components/mobile/MobileCellRenderer.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/mobile/PullToRefresh.vue.d.ts +43 -0
- package/dist/ui/components/organisms/vc-table/components/mobile/PullToRefresh.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/components/mobile/index.d.ts +6 -0
- package/dist/ui/components/organisms/vc-table/components/mobile/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/index.d.ts +31 -0
- package/dist/ui/components/organisms/vc-table/composables/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useCellBase.d.ts +72 -0
- package/dist/ui/components/organisms/vc-table/composables/useCellBase.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useCellRegistry.d.ts +61 -0
- package/dist/ui/components/organisms/vc-table/composables/useCellRegistry.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useColumnFilter.d.ts +38 -0
- package/dist/ui/components/organisms/vc-table/composables/useColumnFilter.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useDataProcessing.d.ts +34 -0
- package/dist/ui/components/organisms/vc-table/composables/useDataProcessing.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useDataTableOrchestrator.d.ts +173 -0
- package/dist/ui/components/organisms/vc-table/composables/useDataTableOrchestrator.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useDataTableState.d.ts +30 -0
- package/dist/ui/components/organisms/vc-table/composables/useDataTableState.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useDataTableState.test.d.ts +2 -0
- package/dist/ui/components/organisms/vc-table/composables/useDataTableState.test.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useMobileCardLayout.d.ts +48 -0
- package/dist/ui/components/organisms/vc-table/composables/useMobileCardLayout.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useMobileCardLayout.test.d.ts +2 -0
- package/dist/ui/components/organisms/vc-table/composables/useMobileCardLayout.test.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableColumns.d.ts +40 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableColumns.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableColumnsReorder.d.ts +33 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableColumnsReorder.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableColumnsResize.d.ts +25 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableColumnsResize.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableContext.d.ts +12 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableContext.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableEditing.d.ts +77 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableEditing.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableExpansion.d.ts +40 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableExpansion.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableFilter.d.ts +25 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableFilter.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableInlineEdit.d.ts +68 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableInlineEdit.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableRowGrouping.d.ts +127 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableRowGrouping.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableRowReorder.d.ts +17 -1
- package/dist/ui/components/organisms/vc-table/composables/useTableRowReorder.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/composables/useTableSelectionV2.d.ts +95 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableSelectionV2.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableSort.d.ts +48 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableSort.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/composables/useVirtualScroll.d.ts +82 -0
- package/dist/ui/components/organisms/vc-table/composables/useVirtualScroll.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/index.d.ts +12 -1
- package/dist/ui/components/organisms/vc-table/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/types.d.ts +764 -19
- package/dist/ui/components/organisms/vc-table/types.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/utils/ColumnCollector.d.ts +71 -0
- package/dist/ui/components/organisms/vc-table/utils/ColumnCollector.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/utils/deepClone.d.ts +20 -0
- package/dist/ui/components/organisms/vc-table/utils/deepClone.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/utils/index.d.ts +9 -0
- package/dist/ui/components/organisms/vc-table/utils/index.d.ts.map +1 -0
- package/dist/ui/composables/index.d.ts +5 -0
- package/dist/ui/composables/index.d.ts.map +1 -0
- package/dist/ui/composables/useAdaptiveItems.d.ts.map +1 -1
- package/dist/ui/composables/useFloatingPosition.d.ts +44 -0
- package/dist/ui/composables/useFloatingPosition.d.ts.map +1 -0
- package/dist/ui/composables/useScrollArrows.d.ts +13 -0
- package/dist/ui/composables/useScrollArrows.d.ts.map +1 -0
- package/dist/ui/composables/useTeleportTarget.d.ts +13 -0
- package/dist/ui/composables/useTeleportTarget.d.ts.map +1 -0
- package/dist/vendor-boolbase-D2i1C8XR.js +18 -0
- package/dist/vendor-cheerio-BcTJMzyu.js +1053 -0
- package/dist/vendor-cheerio-select-sLyWsUb6.js +191 -0
- package/dist/vendor-core-js-Do_NZFHx.js +880 -0
- package/dist/vendor-css-select-DtZUShJh.js +622 -0
- package/dist/vendor-cypress-signalr-mock-itnm2wpA.js +781 -0
- package/dist/vendor-date-fns-Bbji1B6n.js +3008 -0
- package/dist/vendor-dom-serializer-BbVuF1MQ.js +213 -0
- package/dist/vendor-domhandler-BVR67j0z.js +311 -0
- package/dist/vendor-dompurify-BGaRrCfO.js +553 -0
- package/dist/vendor-domutils-DhLr70Dk.js +386 -0
- package/dist/vendor-entities-J86Og8IU.js +364 -0
- package/dist/vendor-floating-ui-core-D4y4RtZX.js +390 -0
- package/dist/vendor-floating-ui-dom-KiWKlpyx.js +396 -0
- package/dist/vendor-floating-ui-utils-BwDnZ8dn.js +259 -0
- package/dist/vendor-floating-ui-vue-3a2TgQR9.js +107 -0
- package/dist/vendor-gridstack-Dkfw452e.js +3390 -0
- package/dist/vendor-headlessui-vue-Cn-RMs4E.js +961 -0
- package/dist/vendor-htmlparser2-DOGAmM6C.js +735 -0
- package/dist/vendor-intlify-core-base-YZqJSEvl.js +1130 -0
- package/dist/vendor-intlify-message-compiler-C5QaCXcF.js +952 -0
- package/dist/vendor-intlify-shared-BrKs3jCC.js +144 -0
- package/dist/vendor-iso-639-1-rPqx9HMT.js +786 -0
- package/dist/vendor-lodash-es-MFObj6kX.js +4829 -0
- package/dist/vendor-markdown-it-DdaObR1P.js +2263 -0
- package/dist/vendor-markdown-it-task-lists-CHCnS7dl.js +69 -0
- package/dist/vendor-microsoft-applicationinsights-analytics-js-DQheg2jT.js +1207 -0
- package/dist/vendor-microsoft-applicationinsights-cfgsync-js-B9Mn84BU.js +261 -0
- package/dist/vendor-microsoft-applicationinsights-channel-js-BuJeAYY2.js +1822 -0
- package/dist/vendor-microsoft-applicationinsights-common-RIQBFrw5.js +1921 -0
- package/dist/vendor-microsoft-applicationinsights-core-js-KDX0EIdd.js +4276 -0
- package/dist/vendor-microsoft-applicationinsights-dependencies-js-BZbdJERa.js +1407 -0
- package/dist/vendor-microsoft-applicationinsights-properties-js-DWXnzqoT.js +572 -0
- package/dist/vendor-microsoft-applicationinsights-shims-DKvw2C8l.js +43 -0
- package/dist/vendor-microsoft-applicationinsights-web-CvYf2SnW.js +487 -0
- package/dist/vendor-microsoft-dynamicproto-js-BqPecdaw.js +147 -0
- package/dist/vendor-nevware21-ts-async-CO9QBh90.js +261 -0
- package/dist/vendor-nevware21-ts-utils-DbCMkHfb.js +853 -0
- package/dist/vendor-nth-check-CGMdQf59.js +45 -0
- package/dist/vendor-parse5-htmlparser2-tree-adapter-DBkuDq0i.js +143 -0
- package/dist/vendor-prettier-CoRReRqw.js +5215 -0
- package/dist/vendor-prosemirror-commands-Dml_M5TN.js +385 -0
- package/dist/vendor-prosemirror-dropcursor-BpoETgOQ.js +86 -0
- package/dist/vendor-prosemirror-gapcursor-lxy5mExv.js +203 -0
- package/dist/vendor-prosemirror-history-CZUb2jWK.js +248 -0
- package/dist/vendor-prosemirror-keymap-D5bacBom.js +62 -0
- package/dist/vendor-prosemirror-markdown-BMtperlo.js +663 -0
- package/dist/vendor-prosemirror-model-DAA3avbR.js +2730 -0
- package/dist/vendor-prosemirror-schema-list-BZ-Z46DO.js +87 -0
- package/dist/vendor-prosemirror-state-DYjHje5i.js +821 -0
- package/dist/vendor-prosemirror-tables-BDngzx2l.js +1414 -0
- package/dist/vendor-prosemirror-transform-6xBwIzbI.js +1525 -0
- package/dist/vendor-prosemirror-view-uqPP-lBa.js +3794 -0
- package/dist/vendor-tiptap-core-LywLFS5q.js +3848 -0
- package/dist/vendor-tiptap-extension-blockquote-CUbclnpI.js +55 -0
- package/dist/vendor-tiptap-extension-bold-CXpSSKmE.js +74 -0
- package/dist/vendor-tiptap-extension-code-C1tY2qvi.js +52 -0
- package/dist/vendor-tiptap-extension-code-block-BqRZkHQ4.js +215 -0
- package/dist/vendor-tiptap-extension-document-BSOVj3v3.js +12 -0
- package/dist/vendor-tiptap-extension-hard-break--p8uEOJZ.js +59 -0
- package/dist/vendor-tiptap-extension-heading-DjIM20yC.js +63 -0
- package/dist/vendor-tiptap-extension-horizontal-rule-D20byOId.js +56 -0
- package/dist/vendor-tiptap-extension-image-Db5NXKel.js +128 -0
- package/dist/vendor-tiptap-extension-italic-Cf7LHF9o.js +73 -0
- package/dist/vendor-tiptap-extension-link-CdVea6vB.js +309 -0
- package/dist/vendor-tiptap-extension-list-DL7hIPxx.js +722 -0
- package/dist/vendor-tiptap-extension-paragraph-C3kvhOgp.js +44 -0
- package/dist/vendor-tiptap-extension-placeholder-Y2tnzcM5.js +1 -0
- package/dist/vendor-tiptap-extension-strike-xhz27lGu.js +64 -0
- package/dist/vendor-tiptap-extension-table-CssmoD70.js +374 -0
- package/dist/vendor-tiptap-extension-table-cell-BBgwVlAR.js +1 -0
- package/dist/vendor-tiptap-extension-table-header-BBgwVlAR.js +1 -0
- package/dist/vendor-tiptap-extension-table-row-BBgwVlAR.js +1 -0
- package/dist/vendor-tiptap-extension-text-CRV6Gvxj.js +13 -0
- package/dist/vendor-tiptap-extension-text-style-Cv4iMrzw.js +235 -0
- package/dist/vendor-tiptap-extension-underline-BTLugB1v.js +65 -0
- package/dist/vendor-tiptap-extensions-B0P4Mabp.js +290 -0
- package/dist/vendor-tiptap-markdown-DUkyNmCR.js +826 -0
- package/dist/vendor-tiptap-pm-DLQ8Uc5L.js +1 -0
- package/dist/vendor-tiptap-starter-kit-BqrBDkt0.js +28 -0
- package/dist/vendor-tiptap-vue-3-DLkg5lC5.js +157 -0
- package/dist/vendor-truncate-html-FnN2i7S3.js +145 -0
- package/dist/vendor-vue-currency-input-CckB4kjx.js +317 -0
- package/dist/vendor-vue-i18n-D0F0w-9Q.js +1378 -0
- package/dist/vendor-vue3-application-insights-D3zyAvES.js +69 -0
- package/dist/vendor-vuepic-vue-datepicker-D_tZFDQ8.js +4998 -0
- package/dist/vendor-vueuse-components-BEk9m-fb.js +542 -0
- package/dist/vendor-vueuse-core-2bXFxKo3.js +5130 -0
- package/dist/vendor-vueuse-shared-CnsRXFsC.js +1169 -0
- package/package.json +6 -5
- package/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +4 -4
- package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +4 -1
- package/shared/components/blade-navigation/ARCHITECTURE.md +420 -0
- package/shared/components/blade-navigation/MIGRATION.md +224 -0
- package/shared/components/blade-navigation/components/index.ts +1 -0
- package/shared/components/blade-navigation/components/vc-blade-navigation/index.ts +2 -1
- package/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation-new.vue +159 -0
- package/shared/components/blade-navigation/components/vc-blade-slot/index.ts +1 -0
- package/shared/components/blade-navigation/components/vc-blade-slot/vc-blade-slot.vue +138 -0
- package/shared/components/blade-navigation/composables/index.ts +5 -1
- package/shared/components/blade-navigation/composables/useBladeMessaging.test.ts +189 -0
- package/shared/components/blade-navigation/composables/useBladeMessaging.ts +81 -0
- package/shared/components/blade-navigation/composables/useBladeNavigationAdapter.ts +513 -0
- package/shared/components/blade-navigation/composables/useBladeStack.test.ts +420 -0
- package/shared/components/blade-navigation/composables/useBladeStack.ts +335 -0
- package/shared/components/blade-navigation/index.ts +1 -1
- package/shared/components/blade-navigation/plugin-v2.ts +144 -0
- package/shared/components/blade-navigation/types/index.ts +127 -0
- package/shared/components/blade-navigation/utils/restoreFromUrl.test.ts +247 -0
- package/shared/components/blade-navigation/utils/restoreFromUrl.ts +84 -0
- package/shared/components/blade-navigation/utils/urlSync.test.ts +181 -0
- package/shared/components/blade-navigation/utils/urlSync.ts +151 -0
- package/shared/components/change-password/change-password.vue +1 -1
- package/shared/components/draggable-dashboard/DraggableDashboard.vue +70 -355
- package/shared/components/draggable-dashboard/GridstackDashboard.vue +315 -0
- package/shared/components/draggable-dashboard/composables/useGridstack.ts +380 -0
- package/shared/components/draggable-dashboard/composables/useGridstackAdapter.ts +245 -0
- package/shared/components/draggable-dashboard/index.ts +33 -0
- package/shared/components/generic-dropdown/generic-dropdown.vue +72 -202
- package/shared/components/generic-dropdown/index.ts +7 -1
- package/shared/components/index.ts +10 -2
- package/shared/components/language-selector/language-selector.vue +4 -5
- package/shared/components/multilanguage-selector/multilanguage-selector.vue +6 -61
- package/shared/components/notification-dropdown/notification-dropdown.vue +5 -4
- package/shared/components/notifications/composables/useContainer/index.ts +8 -6
- package/shared/components/notifications/composables/useInstance/index.ts +4 -1
- package/shared/components/notifications/core/notification.ts +10 -7
- package/shared/components/popup-handler/components/vc-popup-container/vc-popup-container.vue +20 -1
- package/shared/components/sidebar/index.ts +7 -1
- package/shared/components/sidebar/sidebar.vue +47 -114
- package/shared/components/sign-in/external-provider.vue +1 -1
- package/shared/components/sign-in/external-providers.vue +1 -2
- package/shared/components/sign-in/useExternalProvider.ts +6 -4
- package/shared/components/theme-selector/theme-selector.vue +4 -5
- package/shared/components/user-dropdown-button/_internal/user-info.vue +7 -2
- package/shared/components/user-dropdown-button/_internal/user-sidebar.vue +16 -15
- package/shared/components/user-dropdown-button/user-dropdown-button.vue +4 -4
- package/shared/composables/useExternalWidgets.ts +7 -4
- package/shared/composables/useMenuExpanded.ts +17 -4
- package/shared/composables/useTableSelection.ts +6 -0
- package/shared/composables/useTableSort.ts +16 -8
- package/shared/modules/assets-manager/components/assets-manager/assets-manager.vue +6 -3
- package/shared/modules/dynamic/pages/dynamic-blade-form.vue +5 -5
- package/shared/pages/ChangePasswordPage/components/change-password/ChangePassword.vue +193 -20
- package/shared/pages/ForgotPasswordPage/components/forgot-password/ForgotPassword.vue +155 -0
- package/shared/pages/ForgotPasswordPage/components/forgot-password/index.ts +3 -0
- package/shared/pages/ForgotPasswordPage/components/index.ts +1 -0
- package/shared/pages/ForgotPasswordPage/index.ts +1 -0
- package/shared/pages/ForgotPasswordPage/plugin.ts +4 -0
- package/shared/pages/InvitePage/components/invite/Invite.vue +94 -129
- package/shared/pages/LoginPage/components/login/Login.vue +130 -283
- package/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue +86 -129
- package/shared/pages/index.ts +5 -4
- package/shared/pages/plugin.ts +1 -0
- package/shared/utilities/colorUtils.ts +5 -12
- package/ui/components/atoms/vc-banner/vc-banner.vue +4 -1
- package/ui/components/atoms/vc-button/index.ts +2 -0
- package/ui/components/atoms/vc-button/types.ts +28 -0
- package/ui/components/atoms/vc-button/vc-button-group.stories.ts +172 -0
- package/ui/components/atoms/vc-button/vc-button-group.vue +101 -0
- package/ui/components/atoms/vc-button/vc-button.stories.ts +258 -132
- package/ui/components/atoms/vc-button/vc-button.vue +218 -78
- package/ui/components/atoms/vc-container/vc-container.stories.ts +2 -60
- package/ui/components/atoms/vc-container/vc-container.vue +10 -108
- package/ui/components/atoms/vc-icon/vc-icon.vue +0 -10
- package/ui/components/atoms/vc-icon/vc-lucide-icon.vue +5 -2
- package/ui/components/atoms/vc-image/vc-image.vue +4 -1
- package/ui/components/atoms/vc-link/vc-link.vue +61 -54
- package/ui/components/atoms/vc-loading/vc-loading.vue +4 -0
- package/ui/components/atoms/vc-status/vc-status.vue +0 -5
- package/ui/components/atoms/vc-status-icon/vc-status-icon.vue +4 -4
- package/ui/components/atoms/vc-tooltip/vc-tooltip.vue +17 -10
- package/ui/components/atoms/vc-video/vc-video.vue +4 -2
- package/ui/components/atoms/vc-widget/vc-widget.vue +4 -1
- package/ui/components/molecules/index.ts +5 -0
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +12 -7
- package/ui/components/molecules/vc-checkbox/vc-checkbox.vue +24 -6
- package/ui/components/molecules/vc-color-input/index.ts +1 -0
- package/ui/components/molecules/vc-color-input/vc-color-input.stories.ts +152 -0
- package/ui/components/molecules/vc-color-input/vc-color-input.vue +421 -0
- package/ui/components/molecules/vc-date-picker/index.ts +1 -0
- package/ui/components/molecules/vc-date-picker/vc-date-picker.stories.ts +168 -0
- package/ui/components/molecules/vc-date-picker/vc-date-picker.vue +462 -0
- package/ui/components/molecules/vc-dropdown/index.ts +1 -0
- package/ui/components/molecules/vc-dropdown/vc-dropdown.stories.ts +399 -0
- package/ui/components/molecules/vc-dropdown/vc-dropdown.test.ts +54 -0
- package/ui/components/molecules/vc-dropdown/vc-dropdown.vue +490 -0
- package/ui/components/molecules/vc-dropdown-panel/index.ts +1 -0
- package/ui/components/molecules/vc-dropdown-panel/vc-dropdown-panel.vue +216 -0
- package/ui/components/molecules/vc-editor/vc-editor.vue +20 -8
- package/ui/components/molecules/vc-file-upload/vc-file-upload.vue +38 -18
- package/ui/components/molecules/vc-input/vc-input.stories.ts +94 -0
- package/ui/components/molecules/vc-input/vc-input.vue +115 -320
- package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +1 -1
- package/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.vue +1 -1
- package/ui/components/molecules/vc-multivalue/_internal/MultivalueDropdown.vue +216 -0
- package/ui/components/molecules/vc-multivalue/_internal/MultivalueTrigger.vue +204 -0
- package/ui/components/molecules/vc-multivalue/composables/index.ts +6 -0
- package/ui/components/molecules/vc-multivalue/composables/useMultivalueColor.ts +50 -0
- package/ui/components/molecules/vc-multivalue/composables/useMultivalueDropdown.ts +123 -0
- package/ui/components/molecules/vc-multivalue/composables/useMultivalueInput.ts +64 -0
- package/ui/components/molecules/vc-multivalue/composables/useMultivalueMode.ts +32 -0
- package/ui/components/molecules/vc-multivalue/composables/useMultivalueOptions.ts +27 -0
- package/ui/components/molecules/vc-multivalue/composables/useMultivalueValues.ts +50 -0
- package/ui/components/molecules/vc-multivalue/vc-multivalue.stories.ts +53 -0
- package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +364 -464
- package/ui/components/molecules/vc-pagination/vc-pagination.vue +6 -1
- package/ui/components/molecules/vc-paginator/index.ts +4 -0
- package/ui/components/molecules/vc-paginator/vc-paginator.vue +378 -0
- package/ui/components/molecules/vc-radio-button/vc-radio-button.vue +31 -22
- package/ui/components/molecules/vc-rating/vc-rating.vue +1 -1
- package/ui/components/molecules/vc-select/_internal/SelectDropdown.vue +232 -0
- package/ui/components/molecules/vc-select/_internal/SelectTrigger.vue +290 -0
- package/ui/components/molecules/vc-select/composables/index.ts +7 -0
- package/ui/components/molecules/vc-select/composables/useSelectDefaultValue.ts +106 -0
- package/ui/components/molecules/vc-select/composables/useSelectDropdown.ts +88 -0
- package/ui/components/molecules/vc-select/composables/useSelectOptions.ts +125 -0
- package/ui/components/molecules/vc-select/composables/useSelectSearch.ts +83 -0
- package/ui/components/molecules/vc-select/composables/useSelectSelection.ts +170 -0
- package/ui/components/molecules/vc-select/composables/useSelectValueMapping.ts +57 -0
- package/ui/components/molecules/vc-select/composables/useSelectVisibility.ts +60 -0
- package/ui/components/molecules/vc-select/index.ts +1 -0
- package/ui/components/molecules/vc-select/vc-select.stories.ts +153 -4
- package/ui/components/molecules/vc-select/vc-select.vue +384 -915
- package/ui/components/molecules/vc-switch/vc-switch.vue +20 -8
- package/ui/components/molecules/vc-textarea/vc-textarea.vue +42 -13
- package/ui/components/molecules/vc-toast/vc-toast.vue +11 -1
- package/ui/components/organisms/blade-navigation-v2.stories.ts +611 -0
- package/ui/components/organisms/index.ts +5 -4
- package/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarMobileActions.vue +112 -0
- package/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarOverlay.vue +91 -0
- package/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarWidgetContent.vue +40 -0
- package/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarWidgetItem.vue +154 -0
- package/ui/components/organisms/vc-app/_internal/app-bar/components/AppBarWidgetsMenu.vue +110 -0
- package/ui/components/organisms/vc-app/_internal/app-bar/components/MenuSidebar.vue +265 -0
- package/ui/components/organisms/vc-app/_internal/app-bar/composables/useAppBarMobileActions.ts +50 -0
- package/ui/components/organisms/vc-app/_internal/app-bar/composables/useAppBarState.ts +35 -0
- package/ui/components/organisms/vc-app/_internal/app-bar/composables/useAppBarWidgets.ts +25 -0
- package/ui/components/organisms/vc-app/_internal/app-bar/composables/useToggleableContent.ts +67 -0
- package/ui/components/organisms/vc-app/_internal/layouts/DesktopLayout.vue +308 -0
- package/ui/components/organisms/vc-app/_internal/layouts/MobileLayout.vue +171 -0
- package/ui/components/organisms/vc-app/_internal/menu/VcAppMenu.vue +158 -0
- package/ui/components/organisms/vc-app/_internal/menu/VcAppMenuGroup.vue +160 -0
- package/ui/components/organisms/vc-app/_internal/menu/VcAppMenuItem.vue +215 -0
- package/ui/components/organisms/vc-app/_internal/menu/composables/useBadge.ts +82 -0
- package/ui/components/organisms/vc-app/_internal/menu/composables/useMenuActiveState.ts +41 -0
- package/ui/components/organisms/vc-app/_internal/sidebar/SidebarCollapseButton.vue +58 -0
- package/ui/components/organisms/vc-app/_internal/sidebar/SidebarContent.vue +170 -0
- package/ui/components/organisms/vc-app/_internal/sidebar/SidebarHeader.vue +172 -0
- package/ui/components/organisms/vc-app/composables/useShellBootstrap.ts +87 -0
- package/ui/components/organisms/vc-app/composables/useShellLifecycle.ts +39 -0
- package/ui/components/organisms/vc-app/composables/useShellNavigation.ts +57 -0
- package/ui/components/organisms/vc-app/composables/useSidebarState.ts +86 -0
- package/ui/components/organisms/vc-app/composition/README.md +78 -0
- package/ui/components/organisms/vc-app/composition/app-bar/index.ts +6 -0
- package/ui/components/organisms/vc-app/composition/index.ts +6 -0
- package/ui/components/organisms/vc-app/composition/layouts/index.ts +2 -0
- package/ui/components/organisms/vc-app/composition/menu/index.ts +6 -0
- package/ui/components/organisms/vc-app/composition/shell/index.ts +3 -0
- package/ui/components/organisms/vc-app/composition/sidebar/index.ts +3 -0
- package/ui/components/organisms/vc-app/composition/state/index.ts +6 -0
- package/ui/components/organisms/vc-app/index.ts +1 -0
- package/ui/components/organisms/vc-app/vc-app-shell.stories.ts +698 -0
- package/ui/components/organisms/vc-app/vc-app.vue +142 -186
- package/ui/components/organisms/vc-auth-layout/index.ts +1 -0
- package/ui/components/organisms/vc-auth-layout/vc-auth-layout.vue +162 -0
- package/ui/components/organisms/vc-blade/_internal/BladeHeader.vue +263 -0
- package/ui/components/organisms/vc-blade/_internal/BladeStatusBanners.vue +78 -0
- package/ui/components/organisms/vc-blade/_internal/BladeToolbar.vue +73 -0
- package/ui/components/organisms/vc-blade/_internal/composables/useBladeError.ts +64 -0
- package/ui/components/organisms/vc-blade/_internal/composables/useToolbarRegistration.ts +114 -0
- package/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarBaseButton.test.ts +79 -0
- package/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarBaseButton.vue +135 -0
- package/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarCircleButton.vue +101 -0
- package/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarDesktop.vue +124 -0
- package/ui/components/organisms/vc-blade/_internal/toolbar/ToolbarMobile.vue +421 -0
- package/ui/components/organisms/vc-blade/_internal/toolbar/toolbar-button-props.ts +14 -0
- package/ui/components/organisms/vc-blade/_internal/widgets/WidgetContainer.vue +38 -0
- package/ui/components/organisms/vc-blade/_internal/widgets/WidgetContainerDesktop.vue +92 -0
- package/ui/components/organisms/vc-blade/_internal/widgets/WidgetContainerMobile.vue +115 -0
- package/ui/components/organisms/vc-blade/constants.ts +19 -0
- package/ui/components/organisms/vc-blade/utils.test.ts +82 -0
- package/ui/components/organisms/vc-blade/utils.ts +48 -0
- package/ui/components/organisms/vc-blade/vc-blade.stories.ts +425 -0
- package/ui/components/organisms/vc-blade/vc-blade.vue +23 -185
- package/ui/components/organisms/vc-sidebar/index.ts +1 -0
- package/ui/components/organisms/vc-sidebar/vc-sidebar.stories.ts +248 -0
- package/ui/components/organisms/vc-sidebar/vc-sidebar.test.ts +125 -0
- package/ui/components/organisms/vc-sidebar/vc-sidebar.vue +689 -0
- package/ui/components/organisms/vc-table/VcDataTable.vue +1656 -0
- package/ui/components/organisms/vc-table/VcTableAdapter.vue +627 -0
- package/ui/components/organisms/vc-table/_internal/vc-table-base-header/vc-table-base-header.vue +12 -0
- package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +34 -2
- package/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue +5 -5
- package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +64 -48
- package/ui/components/organisms/vc-table/base/BaseVcDataTable.ts +531 -0
- package/ui/components/organisms/vc-table/components/ColumnFilter.vue +445 -0
- package/ui/components/organisms/vc-table/components/ColumnSwitcherButton.vue +43 -0
- package/ui/components/organisms/vc-table/components/DataTableBody.vue +335 -0
- package/ui/components/organisms/vc-table/components/DataTableCellRenderer.vue +396 -0
- package/ui/components/organisms/vc-table/components/DataTableHeader.vue +284 -0
- package/ui/components/organisms/vc-table/components/DataTableRow.vue +367 -0
- package/ui/components/organisms/vc-table/components/GlobalFiltersButton.vue +58 -0
- package/ui/components/organisms/vc-table/components/GlobalFiltersPanel.vue +328 -0
- package/ui/components/organisms/vc-table/components/Table.vue +100 -0
- package/ui/components/organisms/vc-table/components/TableActions.vue +126 -0
- package/ui/components/organisms/vc-table/components/TableAddRowButton.vue +55 -0
- package/ui/components/organisms/vc-table/components/TableBody.vue +79 -0
- package/ui/components/organisms/vc-table/components/TableCell.vue +160 -0
- package/ui/components/organisms/vc-table/components/TableCheckbox.vue +78 -0
- package/ui/components/organisms/vc-table/components/TableColumnSwitcher.vue +150 -0
- package/ui/components/organisms/vc-table/components/TableEmpty.vue +63 -0
- package/ui/components/organisms/vc-table/components/TableFooter.vue +13 -0
- package/ui/components/organisms/vc-table/components/TableGroupRow.vue +130 -0
- package/ui/components/organisms/vc-table/components/TableHead.vue +311 -0
- package/ui/components/organisms/vc-table/components/TableHeader.vue +13 -0
- package/ui/components/organisms/vc-table/components/TableResizeHandle.vue +125 -0
- package/ui/components/organisms/vc-table/components/TableRow.vue +280 -0
- package/ui/components/organisms/vc-table/components/TableRowActions.vue +478 -0
- package/ui/components/organisms/vc-table/components/TableSearchHeader.vue +233 -0
- package/ui/components/organisms/vc-table/components/TableSelectAllBar.vue +135 -0
- package/ui/components/organisms/vc-table/components/VcColumn.vue +255 -0
- package/ui/components/organisms/vc-table/components/_internal/SlotProxy.ts +20 -0
- package/ui/components/organisms/vc-table/components/cells/CellDate.vue +54 -0
- package/ui/components/organisms/vc-table/components/cells/CellDateAgo.vue +48 -0
- package/ui/components/organisms/vc-table/components/cells/CellDefault.vue +89 -0
- package/ui/components/organisms/vc-table/components/cells/CellEditableWrapper.vue +47 -0
- package/ui/components/organisms/vc-table/components/cells/CellHtml.vue +62 -0
- package/ui/components/organisms/vc-table/components/cells/CellImage.vue +28 -0
- package/ui/components/organisms/vc-table/components/cells/CellLink.vue +18 -0
- package/ui/components/organisms/vc-table/components/cells/CellMoney.vue +119 -0
- package/ui/components/organisms/vc-table/components/cells/CellNumber.vue +112 -0
- package/ui/components/organisms/vc-table/components/cells/CellStatus.vue +18 -0
- package/ui/components/organisms/vc-table/components/cells/CellStatusIcon.vue +20 -0
- package/ui/components/organisms/vc-table/components/cells/DynamicCellRenderer.vue +164 -0
- package/ui/components/organisms/vc-table/components/cells/index.ts +11 -0
- package/ui/components/organisms/vc-table/components/index.ts +39 -0
- package/ui/components/organisms/vc-table/components/mobile/DataTableMobileCard.vue +672 -0
- package/ui/components/organisms/vc-table/components/mobile/DataTableMobileView.vue +251 -0
- package/ui/components/organisms/vc-table/components/mobile/MobileActionSheet.vue +335 -0
- package/ui/components/organisms/vc-table/components/mobile/MobileCellRenderer.vue +68 -0
- package/ui/components/organisms/vc-table/components/mobile/PullToRefresh.vue +353 -0
- package/ui/components/organisms/vc-table/components/mobile/index.ts +6 -0
- package/ui/components/organisms/vc-table/composables/index.ts +49 -0
- package/ui/components/organisms/vc-table/composables/useCellBase.ts +114 -0
- package/ui/components/organisms/vc-table/composables/useCellRegistry.ts +130 -0
- package/ui/components/organisms/vc-table/composables/useColumnFilter.ts +158 -0
- package/ui/components/organisms/vc-table/composables/useDataProcessing.ts +239 -0
- package/ui/components/organisms/vc-table/composables/useDataTableOrchestrator.ts +516 -0
- package/ui/components/organisms/vc-table/composables/useDataTableState.test.ts +78 -0
- package/ui/components/organisms/vc-table/composables/useDataTableState.ts +343 -0
- package/ui/components/organisms/vc-table/composables/useMobileCardLayout.test.ts +81 -0
- package/ui/components/organisms/vc-table/composables/useMobileCardLayout.ts +345 -0
- package/ui/components/organisms/vc-table/composables/useTableColumns.ts +276 -0
- package/ui/components/organisms/vc-table/composables/useTableColumnsReorder.ts +175 -0
- package/ui/components/organisms/vc-table/composables/useTableColumnsResize.ts +292 -0
- package/ui/components/organisms/vc-table/composables/useTableContext.ts +15 -0
- package/ui/components/organisms/vc-table/composables/useTableEditing.ts +385 -0
- package/ui/components/organisms/vc-table/composables/useTableExpansion.ts +159 -0
- package/ui/components/organisms/vc-table/composables/useTableFilter.ts +121 -0
- package/ui/components/organisms/vc-table/composables/useTableInlineEdit.ts +306 -0
- package/ui/components/organisms/vc-table/composables/useTableRowGrouping.ts +310 -0
- package/ui/components/organisms/vc-table/composables/useTableRowReorder.ts +168 -116
- package/ui/components/organisms/vc-table/composables/useTableSelectionV2.ts +388 -0
- package/ui/components/organisms/vc-table/composables/useTableSort.ts +221 -0
- package/ui/components/organisms/vc-table/composables/useVirtualScroll.ts +286 -0
- package/ui/components/organisms/vc-table/index.ts +68 -1
- package/ui/components/organisms/vc-table/types.ts +809 -9
- package/ui/components/organisms/vc-table/utils/ColumnCollector.ts +137 -0
- package/ui/components/organisms/vc-table/utils/deepClone.ts +46 -0
- package/ui/components/organisms/vc-table/utils/index.ts +19 -0
- package/ui/components/organisms/vc-table/vc-data-table.stories.ts +4973 -0
- package/ui/composables/index.ts +4 -0
- package/ui/composables/useAdaptiveItems.ts +30 -15
- package/ui/composables/useFloatingPosition.ts +94 -0
- package/ui/composables/useScrollArrows.ts +88 -0
- package/ui/composables/useTeleportTarget.ts +37 -0
- package/core/plugins/extension-points/ExtensionSlot.vue +0 -23
- package/core/plugins/extension-points/README.md +0 -406
- package/core/plugins/extension-points/migration-examples.md +0 -613
- package/core/plugins/extension-points/simple-extensions.ts +0 -148
- package/core/services/global-search-service.ts +0 -36
- package/dist/core/plugins/extension-points/ExtensionSlot.vue.d.ts +0 -6
- package/dist/core/plugins/extension-points/ExtensionSlot.vue.d.ts.map +0 -1
- package/dist/core/plugins/extension-points/simple-extensions.d.ts +0 -29
- package/dist/core/plugins/extension-points/simple-extensions.d.ts.map +0 -1
- package/dist/core/services/global-search-service.d.ts +0 -10
- package/dist/core/services/global-search-service.d.ts.map +0 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue.d.ts +0 -3
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue.d.ts.map +0 -1
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts +0 -24
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts.map +0 -1
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeActions.d.ts +0 -15
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeActions.d.ts.map +0 -1
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.d.ts +0 -11
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.d.ts.map +0 -1
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeState.d.ts +0 -17
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeState.d.ts.map +0 -1
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeWatchers.d.ts +0 -6
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeWatchers.d.ts.map +0 -1
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/routerUtils.d.ts +0 -28
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/routerUtils.d.ts.map +0 -1
- package/dist/shared/components/blade-navigation/plugin.d.ts +0 -16
- package/dist/shared/components/blade-navigation/plugin.d.ts.map +0 -1
- package/dist/shared/components/draggable-dashboard/_internal/DashboardWidget.vue.d.ts +0 -11
- package/dist/shared/components/draggable-dashboard/_internal/DashboardWidget.vue.d.ts.map +0 -1
- package/dist/shared/components/draggable-dashboard/composables/useCellSizeCalculator.d.ts +0 -25
- package/dist/shared/components/draggable-dashboard/composables/useCellSizeCalculator.d.ts.map +0 -1
- package/dist/shared/components/draggable-dashboard/composables/useCollisionDetection.d.ts +0 -27
- package/dist/shared/components/draggable-dashboard/composables/useCollisionDetection.d.ts.map +0 -1
- package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts +0 -29
- package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts.map +0 -1
- package/dist/shared/components/draggable-dashboard/composables/useDashboardGrid.d.ts +0 -21
- package/dist/shared/components/draggable-dashboard/composables/useDashboardGrid.d.ts.map +0 -1
- package/dist/shared/components/draggable-dashboard/composables/useDragClone.d.ts +0 -15
- package/dist/shared/components/draggable-dashboard/composables/useDragClone.d.ts.map +0 -1
- package/dist/shared/components/draggable-dashboard/composables/useEventCoordinates.d.ts +0 -33
- package/dist/shared/components/draggable-dashboard/composables/useEventCoordinates.d.ts.map +0 -1
- package/dist/shared/components/draggable-dashboard/composables/useGridPosition.d.ts +0 -57
- package/dist/shared/components/draggable-dashboard/composables/useGridPosition.d.ts.map +0 -1
- package/dist/shared/components/draggable-dashboard/composables/useGridSystem.d.ts +0 -22
- package/dist/shared/components/draggable-dashboard/composables/useGridSystem.d.ts.map +0 -1
- package/dist/shared/components/draggable-dashboard/composables/useLayoutPersistence.d.ts +0 -20
- package/dist/shared/components/draggable-dashboard/composables/useLayoutPersistence.d.ts.map +0 -1
- package/dist/shared/components/draggable-dashboard/composables/useResizeObserver.d.ts +0 -18
- package/dist/shared/components/draggable-dashboard/composables/useResizeObserver.d.ts.map +0 -1
- package/dist/shared/components/draggable-dashboard/composables/useWidgetLayout.d.ts +0 -15
- package/dist/shared/components/draggable-dashboard/composables/useWidgetLayout.d.ts.map +0 -1
- package/dist/shared/components/draggable-dashboard/composables/useWidgetStyles.d.ts +0 -21
- package/dist/shared/components/draggable-dashboard/composables/useWidgetStyles.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/composables/useAppMenuState.d.ts +0 -19
- package/dist/ui/components/organisms/vc-app/_internal/composables/useAppMenuState.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarContent.vue.d.ts +0 -19
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarContent.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarHeader.vue.d.ts +0 -24
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarHeader.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarMobileActions.vue.d.ts +0 -8
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarMobileActions.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarOverlay.vue.d.ts +0 -22
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarOverlay.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarSlots.vue.d.ts +0 -3
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarSlots.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarWidgetItem.vue.d.ts +0 -34
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarWidgetItem.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarWidgetsMenu.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue.d.ts +0 -25
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/composables/useAppBarMobileActions.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/composables/useAppBarWidgets.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/composables/useToggleableContent.d.ts +0 -23
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/composables/useToggleableContent.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts +0 -30
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/useBadge.d.ts +0 -18
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/useBadge.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts +0 -26
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts +0 -28
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue.d.ts +0 -19
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/composables/useAppSlots.d.ts +0 -28
- package/dist/ui/components/organisms/vc-app/composables/useAppSlots.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/vc-app.backupsb.d.ts +0 -50
- package/dist/ui/components/organisms/vc-app/vc-app.backupsb.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue.d.ts +0 -30
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/props.d.ts +0 -14
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/props.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-base-button.vue.d.ts +0 -10
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-base-button.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts +0 -30
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue.d.ts +0 -13
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/desktop/vc-blade-toolbar-desktop.vue.d.ts +0 -8
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/desktop/vc-blade-toolbar-desktop.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/mobile/vc-blade-toolbar-mobile.vue.d.ts +0 -7
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/mobile/vc-blade-toolbar-mobile.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/vc-blade-toolbar-buttons.vue.d.ts +0 -8
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/vc-blade-toolbar-buttons.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue.d.ts +0 -19
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/index.d.ts +0 -3
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/index.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue.d.ts +0 -8
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue.d.ts +0 -8
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/vc-widget-container.vue.d.ts +0 -6
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/vc-widget-container.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-blade/vc-blade.backupsb.d.ts +0 -93
- package/dist/ui/components/organisms/vc-blade/vc-blade.backupsb.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-login-form/index.d.ts +0 -2
- package/dist/ui/components/organisms/vc-login-form/index.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-login-form/vc-login-form.vue.d.ts +0 -19
- package/dist/ui/components/organisms/vc-login-form/vc-login-form.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-add-new/vc-table-add-new.vue.d.ts +0 -17
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-add-new/vc-table-add-new.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-body/vc-table-body.vue.d.ts +0 -81
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-body/vc-table-body.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-columns-header/vc-table-columns-header.vue.d.ts +0 -50
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-columns-header/vc-table-columns-header.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue.d.ts +0 -83
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-select-all-header/vc-table-select-all-header.vue.d.ts +0 -12
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-select-all-header/vc-table-select-all-header.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue.d.ts +0 -113
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-footer/vc-table-footer.vue.d.ts +0 -17
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-footer/vc-table-footer.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts +0 -32
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue.d.ts +0 -35
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts +0 -95
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-select-all/vc-table-select-all.vue.d.ts +0 -22
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-select-all/vc-table-select-all.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/composables/useTableActions.d.ts +0 -17
- package/dist/ui/components/organisms/vc-table/composables/useTableActions.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/composables/useTableColumnReorder.d.ts +0 -389
- package/dist/ui/components/organisms/vc-table/composables/useTableColumnReorder.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/composables/useTableColumnResize.d.ts +0 -9
- package/dist/ui/components/organisms/vc-table/composables/useTableColumnResize.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/composables/useTableSelection.d.ts +0 -23
- package/dist/ui/components/organisms/vc-table/composables/useTableSelection.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/composables/useTableState.d.ts +0 -21
- package/dist/ui/components/organisms/vc-table/composables/useTableState.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +0 -109
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +0 -1
- package/dist/vendor-boolbase-A_-Pp38P.js +0 -23
- package/dist/vendor-cheerio-C46iBpCu.js +0 -1053
- package/dist/vendor-cheerio-select-C8emRZsx.js +0 -191
- package/dist/vendor-core-js-DDuR6YMQ.js +0 -1206
- package/dist/vendor-css-select-DR9bp36p.js +0 -622
- package/dist/vendor-cypress-signalr-mock-DjBxJHA6.js +0 -769
- package/dist/vendor-date-fns-sZ1zMzTH.js +0 -3008
- package/dist/vendor-dom-serializer-Sk3xHhQk.js +0 -213
- package/dist/vendor-domhandler-CL40eeX9.js +0 -311
- package/dist/vendor-dompurify-BuxjWxA2.js +0 -553
- package/dist/vendor-domutils-BiVCXO8c.js +0 -386
- package/dist/vendor-entities-CCReaWqU.js +0 -364
- package/dist/vendor-floating-ui-core-Cl9nBI4j.js +0 -349
- package/dist/vendor-floating-ui-dom-3z44E4mf.js +0 -395
- package/dist/vendor-floating-ui-utils-D2sT7feD.js +0 -259
- package/dist/vendor-floating-ui-vue-ClrgkeO5.js +0 -107
- package/dist/vendor-headlessui-vue-D7tzx4PC.js +0 -961
- package/dist/vendor-htmlparser2-CpQu33io.js +0 -735
- package/dist/vendor-intlify-core-base-Da62SG4M.js +0 -1130
- package/dist/vendor-intlify-message-compiler-CHvGSH2u.js +0 -952
- package/dist/vendor-intlify-shared-jWBPd9WB.js +0 -144
- package/dist/vendor-iso-639-1-BJO6WZAt.js +0 -781
- package/dist/vendor-lodash-es-BqkGj3Jl.js +0 -4816
- package/dist/vendor-markdown-it-Czg9qJTh.js +0 -2263
- package/dist/vendor-markdown-it-task-lists-BxLwscWK.js +0 -69
- package/dist/vendor-microsoft-applicationinsights-analytics-js-C1Yxuzwg.js +0 -1207
- package/dist/vendor-microsoft-applicationinsights-cfgsync-js-DArHD4Dn.js +0 -261
- package/dist/vendor-microsoft-applicationinsights-channel-js-Dbs0XRes.js +0 -1822
- package/dist/vendor-microsoft-applicationinsights-common-OjU3Zs6r.js +0 -1921
- package/dist/vendor-microsoft-applicationinsights-core-js-DWRvqBek.js +0 -4276
- package/dist/vendor-microsoft-applicationinsights-dependencies-js-BxTNw-Sk.js +0 -1407
- package/dist/vendor-microsoft-applicationinsights-properties-js-Gfhpu-At.js +0 -572
- package/dist/vendor-microsoft-applicationinsights-shims-CxtPYiwp.js +0 -43
- package/dist/vendor-microsoft-applicationinsights-web-9yeJ0EZv.js +0 -487
- package/dist/vendor-microsoft-dynamicproto-js-DSkQkH3T.js +0 -147
- package/dist/vendor-nevware21-ts-async-CdMc_sGt.js +0 -261
- package/dist/vendor-nevware21-ts-utils-Dy41wRhA.js +0 -853
- package/dist/vendor-nth-check-CS1D-zr5.js +0 -45
- package/dist/vendor-parse5-htmlparser2-tree-adapter-BWywtwol.js +0 -143
- package/dist/vendor-prettier-cZc5sCiS.js +0 -4875
- package/dist/vendor-prosemirror-commands-Cu1q5ZDk.js +0 -385
- package/dist/vendor-prosemirror-dropcursor-BuGmFgFS.js +0 -86
- package/dist/vendor-prosemirror-gapcursor-CyYcCWVK.js +0 -203
- package/dist/vendor-prosemirror-history-DzRcbrCw.js +0 -248
- package/dist/vendor-prosemirror-keymap-KfbdOEJw.js +0 -62
- package/dist/vendor-prosemirror-markdown-OyxRuawK.js +0 -650
- package/dist/vendor-prosemirror-model-DFp4ML7B.js +0 -2730
- package/dist/vendor-prosemirror-schema-list-CwCUArvx.js +0 -87
- package/dist/vendor-prosemirror-state-DHaVEu5h.js +0 -821
- package/dist/vendor-prosemirror-tables-mYok4vGT.js +0 -1711
- package/dist/vendor-prosemirror-transform-CAHmg-qG.js +0 -1508
- package/dist/vendor-prosemirror-view-CspJa44O.js +0 -3751
- package/dist/vendor-tiptap-core-8RGSOCZs.js +0 -3442
- package/dist/vendor-tiptap-extension-blockquote-BVmAuV7o.js +0 -54
- package/dist/vendor-tiptap-extension-bold-BOh8AIRZ.js +0 -74
- package/dist/vendor-tiptap-extension-code-R4pc2wFE.js +0 -52
- package/dist/vendor-tiptap-extension-code-block-DibKlZFG.js +0 -215
- package/dist/vendor-tiptap-extension-document-BwORJR1k.js +0 -12
- package/dist/vendor-tiptap-extension-hard-break-DH36OfVk.js +0 -55
- package/dist/vendor-tiptap-extension-heading-oMLORiPI.js +0 -63
- package/dist/vendor-tiptap-extension-horizontal-rule-BMHSoB_Y.js +0 -56
- package/dist/vendor-tiptap-extension-image-DF1ZJ94q.js +0 -80
- package/dist/vendor-tiptap-extension-italic-BzqrUuB0.js +0 -73
- package/dist/vendor-tiptap-extension-link-hMFZ0hfl.js +0 -298
- package/dist/vendor-tiptap-extension-list-Bj5AK6Pq.js +0 -707
- package/dist/vendor-tiptap-extension-paragraph-Bs1wl42E.js +0 -41
- package/dist/vendor-tiptap-extension-placeholder-CupUGaI_.js +0 -1
- package/dist/vendor-tiptap-extension-strike-C4YpGyzc.js +0 -64
- package/dist/vendor-tiptap-extension-table-D8RFr_6X.js +0 -368
- package/dist/vendor-tiptap-extension-table-cell-k9uLwyL6.js +0 -1
- package/dist/vendor-tiptap-extension-table-header-k9uLwyL6.js +0 -1
- package/dist/vendor-tiptap-extension-table-row-k9uLwyL6.js +0 -1
- package/dist/vendor-tiptap-extension-text-C4dQW13r.js +0 -13
- package/dist/vendor-tiptap-extension-text-style-a_NYjXT6.js +0 -235
- package/dist/vendor-tiptap-extension-underline-DthCaPX3.js +0 -65
- package/dist/vendor-tiptap-extensions-C8rF1qdq.js +0 -290
- package/dist/vendor-tiptap-markdown-DRc3qhBU.js +0 -826
- package/dist/vendor-tiptap-pm-d91nGny8.js +0 -1
- package/dist/vendor-tiptap-starter-kit-BfUUblkP.js +0 -28
- package/dist/vendor-tiptap-vue-3-DYxT2sf6.js +0 -157
- package/dist/vendor-truncate-html-DYC0Lj9o.js +0 -145
- package/dist/vendor-vue-currency-input-BqaYAdhD.js +0 -317
- package/dist/vendor-vue-i18n-CO5LWKE0.js +0 -1370
- package/dist/vendor-vue3-application-insights-BKiiWnf2.js +0 -69
- package/dist/vendor-vuepic-vue-datepicker-CaY_xSnG.js +0 -4998
- package/dist/vendor-vueuse-components-B0zqjNRW.js +0 -542
- package/dist/vendor-vueuse-core-CYgwn-B2.js +0 -5130
- package/dist/vendor-vueuse-shared-B_uDJJ6V.js +0 -1169
- package/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue +0 -165
- package/shared/components/blade-navigation/composables/useBladeNavigation/index.ts +0 -334
- package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeActions.ts +0 -151
- package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.ts +0 -244
- package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeState.ts +0 -127
- package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeWatchers.ts +0 -96
- package/shared/components/blade-navigation/composables/useBladeNavigation/internal/routerUtils.ts +0 -150
- package/shared/components/blade-navigation/plugin.ts +0 -40
- package/shared/components/draggable-dashboard/_internal/DashboardWidget.vue +0 -117
- package/shared/components/draggable-dashboard/composables/useCellSizeCalculator.ts +0 -121
- package/shared/components/draggable-dashboard/composables/useCollisionDetection.ts +0 -219
- package/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.ts +0 -356
- package/shared/components/draggable-dashboard/composables/useDashboardGrid.ts +0 -129
- package/shared/components/draggable-dashboard/composables/useDragClone.ts +0 -97
- package/shared/components/draggable-dashboard/composables/useEventCoordinates.ts +0 -91
- package/shared/components/draggable-dashboard/composables/useGridPosition.ts +0 -150
- package/shared/components/draggable-dashboard/composables/useGridSystem.ts +0 -169
- package/shared/components/draggable-dashboard/composables/useLayoutPersistence.ts +0 -99
- package/shared/components/draggable-dashboard/composables/useResizeObserver.ts +0 -105
- package/shared/components/draggable-dashboard/composables/useWidgetLayout.ts +0 -303
- package/shared/components/draggable-dashboard/composables/useWidgetStyles.ts +0 -120
- package/ui/components/organisms/vc-app/_internal/composables/useAppMenuState.ts +0 -97
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarContent.vue +0 -58
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarHeader.vue +0 -181
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarMobileActions.vue +0 -102
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarOverlay.vue +0 -90
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarSlots.vue +0 -118
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarWidgetItem.vue +0 -163
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarWidgetsMenu.vue +0 -110
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue +0 -174
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/composables/useAppBarMobileActions.ts +0 -51
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/composables/useAppBarWidgets.ts +0 -27
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/composables/useToggleableContent.ts +0 -66
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +0 -356
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/useBadge.ts +0 -80
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +0 -446
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +0 -70
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +0 -238
- package/ui/components/organisms/vc-app/composables/useAppSlots.ts +0 -75
- package/ui/components/organisms/vc-app/vc-app.backupsb.ts +0 -214
- package/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +0 -261
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/props.ts +0 -14
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-base-button.vue +0 -117
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue +0 -215
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue +0 -101
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/desktop/vc-blade-toolbar-desktop.vue +0 -134
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/mobile/vc-blade-toolbar-mobile.vue +0 -146
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/vc-blade-toolbar-buttons.vue +0 -32
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue +0 -181
- package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/index.ts +0 -2
- package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue +0 -105
- package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue +0 -145
- package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/vc-widget-container.vue +0 -148
- package/ui/components/organisms/vc-blade/vc-blade.backupsb.ts +0 -83
- package/ui/components/organisms/vc-login-form/index.ts +0 -1
- package/ui/components/organisms/vc-login-form/vc-login-form.vue +0 -99
- package/ui/components/organisms/vc-table/_internal/vc-table-add-new/vc-table-add-new.vue +0 -63
- package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-body/vc-table-body.vue +0 -131
- package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-columns-header/vc-table-columns-header.vue +0 -320
- package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue +0 -245
- package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-select-all-header/vc-table-select-all-header.vue +0 -54
- package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue +0 -212
- package/ui/components/organisms/vc-table/_internal/vc-table-footer/vc-table-footer.vue +0 -62
- package/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue +0 -159
- package/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue +0 -528
- package/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue +0 -438
- package/ui/components/organisms/vc-table/_internal/vc-table-select-all/vc-table-select-all.vue +0 -118
- package/ui/components/organisms/vc-table/composables/useTableActions.ts +0 -61
- package/ui/components/organisms/vc-table/composables/useTableColumnReorder.ts +0 -257
- package/ui/components/organisms/vc-table/composables/useTableColumnResize.ts +0 -255
- package/ui/components/organisms/vc-table/composables/useTableSelection.ts +0 -118
- package/ui/components/organisms/vc-table/composables/useTableState.ts +0 -284
- package/ui/components/organisms/vc-table/vc-table.vue +0 -725
- /package/dist/ui/components/organisms/vc-app/_internal/{vc-app-bar/_internal → app-bar/components}/AppBarWidgetsMenu.vue.d.ts +0 -0
- /package/dist/ui/components/organisms/vc-app/_internal/{vc-app-bar → app-bar}/composables/useAppBarMobileActions.d.ts +0 -0
- /package/dist/ui/components/organisms/vc-app/_internal/{vc-app-bar → app-bar}/composables/useAppBarWidgets.d.ts +0 -0
|
@@ -0,0 +1,3390 @@
|
|
|
1
|
+
class h {
|
|
2
|
+
/**
|
|
3
|
+
* Convert a potential selector into an actual list of HTML elements.
|
|
4
|
+
* Supports CSS selectors, element references, and special ID handling.
|
|
5
|
+
*
|
|
6
|
+
* @param els selector string, HTMLElement, or array of elements
|
|
7
|
+
* @param root optional root element to search within (defaults to document, useful for shadow DOM)
|
|
8
|
+
* @returns array of HTML elements matching the selector
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const elements = Utils.getElements('.grid-item');
|
|
12
|
+
* const byId = Utils.getElements('#myWidget');
|
|
13
|
+
* const fromShadow = Utils.getElements('.item', shadowRoot);
|
|
14
|
+
*/
|
|
15
|
+
static getElements(t, e = document) {
|
|
16
|
+
if (typeof t == "string") {
|
|
17
|
+
const i = "getElementById" in e ? e : void 0;
|
|
18
|
+
if (i && !isNaN(+t[0])) {
|
|
19
|
+
const r = i.getElementById(t);
|
|
20
|
+
return r ? [r] : [];
|
|
21
|
+
}
|
|
22
|
+
let s = e.querySelectorAll(t);
|
|
23
|
+
if (!s.length && t[0] !== "." && t[0] !== "#" && (s = e.querySelectorAll("." + t), s.length || (s = e.querySelectorAll("#" + t)), !s.length)) {
|
|
24
|
+
const r = e.querySelector(`[gs-id="${t}"]`);
|
|
25
|
+
return r ? [r] : [];
|
|
26
|
+
}
|
|
27
|
+
return Array.from(s);
|
|
28
|
+
}
|
|
29
|
+
return [t];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Convert a potential selector into a single HTML element.
|
|
33
|
+
* Similar to getElements() but returns only the first match.
|
|
34
|
+
*
|
|
35
|
+
* @param els selector string or HTMLElement
|
|
36
|
+
* @param root optional root element to search within (defaults to document)
|
|
37
|
+
* @returns the first HTML element matching the selector, or null if not found
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* const element = Utils.getElement('#myWidget');
|
|
41
|
+
* const first = Utils.getElement('.grid-item');
|
|
42
|
+
*/
|
|
43
|
+
static getElement(t, e = document) {
|
|
44
|
+
if (typeof t == "string") {
|
|
45
|
+
const i = "getElementById" in e ? e : void 0;
|
|
46
|
+
if (!t.length)
|
|
47
|
+
return null;
|
|
48
|
+
if (i && t[0] === "#")
|
|
49
|
+
return i.getElementById(t.substring(1));
|
|
50
|
+
if (t[0] === "#" || t[0] === "." || t[0] === "[")
|
|
51
|
+
return e.querySelector(t);
|
|
52
|
+
if (i && !isNaN(+t[0]))
|
|
53
|
+
return i.getElementById(t);
|
|
54
|
+
let s = e.querySelector(t);
|
|
55
|
+
return i && !s && (s = i.getElementById(t)), s || (s = e.querySelector("." + t)), s;
|
|
56
|
+
}
|
|
57
|
+
return t;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Check if a widget should be lazy loaded based on node or grid settings.
|
|
61
|
+
*
|
|
62
|
+
* @param n the grid node to check
|
|
63
|
+
* @returns true if the item should be lazy loaded
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* if (Utils.lazyLoad(node)) {
|
|
67
|
+
* // Set up intersection observer for lazy loading
|
|
68
|
+
* }
|
|
69
|
+
*/
|
|
70
|
+
static lazyLoad(t) {
|
|
71
|
+
return t.lazyLoad || t.grid?.opts?.lazyLoad && t.lazyLoad !== !1;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Create a div element with the specified CSS classes.
|
|
75
|
+
*
|
|
76
|
+
* @param classes array of CSS class names to add
|
|
77
|
+
* @param parent optional parent element to append the div to
|
|
78
|
+
* @returns the created div element
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* const div = Utils.createDiv(['grid-item', 'draggable']);
|
|
82
|
+
* const nested = Utils.createDiv(['content'], parentDiv);
|
|
83
|
+
*/
|
|
84
|
+
static createDiv(t, e) {
|
|
85
|
+
const i = document.createElement("div");
|
|
86
|
+
return t.forEach((s) => {
|
|
87
|
+
s && i.classList.add(s);
|
|
88
|
+
}), e?.appendChild(i), i;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Check if a widget should resize to fit its content.
|
|
92
|
+
*
|
|
93
|
+
* @param n the grid node to check (can be undefined)
|
|
94
|
+
* @param strict if true, only returns true for explicit sizeToContent:true (not numbers)
|
|
95
|
+
* @returns true if the widget should resize to content
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* if (Utils.shouldSizeToContent(node)) {
|
|
99
|
+
* // Trigger content-based resizing
|
|
100
|
+
* }
|
|
101
|
+
*/
|
|
102
|
+
static shouldSizeToContent(t, e = !1) {
|
|
103
|
+
return t?.grid && (e ? t.sizeToContent === !0 || t.grid.opts.sizeToContent === !0 && t.sizeToContent === void 0 : !!t.sizeToContent || t.grid.opts.sizeToContent && t.sizeToContent !== !1);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Check if two grid positions overlap/intersect.
|
|
107
|
+
*
|
|
108
|
+
* @param a first position with x, y, w, h properties
|
|
109
|
+
* @param b second position with x, y, w, h properties
|
|
110
|
+
* @returns true if the positions overlap
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* const overlaps = Utils.isIntercepted(
|
|
114
|
+
* {x: 0, y: 0, w: 2, h: 1},
|
|
115
|
+
* {x: 1, y: 0, w: 2, h: 1}
|
|
116
|
+
* ); // true - they overlap
|
|
117
|
+
*/
|
|
118
|
+
static isIntercepted(t, e) {
|
|
119
|
+
return !(t.y >= e.y + e.h || t.y + t.h <= e.y || t.x + t.w <= e.x || t.x >= e.x + e.w);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Check if two grid positions are touching (edges or corners).
|
|
123
|
+
*
|
|
124
|
+
* @param a first position
|
|
125
|
+
* @param b second position
|
|
126
|
+
* @returns true if the positions are touching
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* const touching = Utils.isTouching(
|
|
130
|
+
* {x: 0, y: 0, w: 2, h: 1},
|
|
131
|
+
* {x: 2, y: 0, w: 1, h: 1}
|
|
132
|
+
* ); // true - they share an edge
|
|
133
|
+
*/
|
|
134
|
+
static isTouching(t, e) {
|
|
135
|
+
return h.isIntercepted(t, { x: e.x - 0.5, y: e.y - 0.5, w: e.w + 1, h: e.h + 1 });
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Calculate the overlapping area between two grid positions.
|
|
139
|
+
*
|
|
140
|
+
* @param a first position
|
|
141
|
+
* @param b second position
|
|
142
|
+
* @returns the area of overlap (0 if no overlap)
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* const overlap = Utils.areaIntercept(
|
|
146
|
+
* {x: 0, y: 0, w: 3, h: 2},
|
|
147
|
+
* {x: 1, y: 0, w: 3, h: 2}
|
|
148
|
+
* ); // returns 4 (2x2 overlap)
|
|
149
|
+
*/
|
|
150
|
+
static areaIntercept(t, e) {
|
|
151
|
+
const i = t.x > e.x ? t.x : e.x, s = t.x + t.w < e.x + e.w ? t.x + t.w : e.x + e.w;
|
|
152
|
+
if (s <= i)
|
|
153
|
+
return 0;
|
|
154
|
+
const r = t.y > e.y ? t.y : e.y, n = t.y + t.h < e.y + e.h ? t.y + t.h : e.y + e.h;
|
|
155
|
+
return n <= r ? 0 : (s - i) * (n - r);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Calculate the total area of a grid position.
|
|
159
|
+
*
|
|
160
|
+
* @param a position with width and height
|
|
161
|
+
* @returns the total area (width * height)
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* const area = Utils.area({x: 0, y: 0, w: 3, h: 2}); // returns 6
|
|
165
|
+
*/
|
|
166
|
+
static area(t) {
|
|
167
|
+
return t.w * t.h;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Sort an array of grid nodes by position (y first, then x).
|
|
171
|
+
*
|
|
172
|
+
* @param nodes array of nodes to sort
|
|
173
|
+
* @param dir sort direction: 1 for ascending (top-left first), -1 for descending
|
|
174
|
+
* @returns the sorted array (modifies original)
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* const sorted = Utils.sort(nodes); // Sort top-left to bottom-right
|
|
178
|
+
* const reverse = Utils.sort(nodes, -1); // Sort bottom-right to top-left
|
|
179
|
+
*/
|
|
180
|
+
static sort(t, e = 1) {
|
|
181
|
+
return t.sort((s, r) => {
|
|
182
|
+
const n = e * ((s.y ?? 1e4) - (r.y ?? 1e4));
|
|
183
|
+
return n === 0 ? e * ((s.x ?? 1e4) - (r.x ?? 1e4)) : n;
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Find a grid node by its ID.
|
|
188
|
+
*
|
|
189
|
+
* @param nodes array of nodes to search
|
|
190
|
+
* @param id the ID to search for
|
|
191
|
+
* @returns the node with matching ID, or undefined if not found
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* const node = Utils.find(nodes, 'widget-1');
|
|
195
|
+
* if (node) console.log('Found node at:', node.x, node.y);
|
|
196
|
+
*/
|
|
197
|
+
static find(t, e) {
|
|
198
|
+
return e ? t.find((i) => i.id === e) : void 0;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Convert various value types to boolean.
|
|
202
|
+
* Handles strings like 'false', 'no', '0' as false.
|
|
203
|
+
*
|
|
204
|
+
* @param v value to convert
|
|
205
|
+
* @returns boolean representation
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* Utils.toBool('true'); // true
|
|
209
|
+
* Utils.toBool('false'); // false
|
|
210
|
+
* Utils.toBool('no'); // false
|
|
211
|
+
* Utils.toBool('1'); // true
|
|
212
|
+
*/
|
|
213
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
214
|
+
static toBool(t) {
|
|
215
|
+
return typeof t == "boolean" ? t : typeof t == "string" ? (t = t.toLowerCase(), !(t === "" || t === "no" || t === "false" || t === "0")) : !!t;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Convert a string value to a number, handling null and empty strings.
|
|
219
|
+
*
|
|
220
|
+
* @param value string or null value to convert
|
|
221
|
+
* @returns number value, or undefined for null/empty strings
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* Utils.toNumber('42'); // 42
|
|
225
|
+
* Utils.toNumber(''); // undefined
|
|
226
|
+
* Utils.toNumber(null); // undefined
|
|
227
|
+
*/
|
|
228
|
+
static toNumber(t) {
|
|
229
|
+
return t === null || t.length === 0 ? void 0 : Number(t);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Parse a height value with units into numeric value and unit string.
|
|
233
|
+
* Supports px, em, rem, vh, vw, %, cm, mm units.
|
|
234
|
+
*
|
|
235
|
+
* @param val height value as number or string with units
|
|
236
|
+
* @returns object with h (height) and unit properties
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* Utils.parseHeight('100px'); // {h: 100, unit: 'px'}
|
|
240
|
+
* Utils.parseHeight('2rem'); // {h: 2, unit: 'rem'}
|
|
241
|
+
* Utils.parseHeight(50); // {h: 50, unit: 'px'}
|
|
242
|
+
*/
|
|
243
|
+
static parseHeight(t) {
|
|
244
|
+
let e, i = "px";
|
|
245
|
+
if (typeof t == "string")
|
|
246
|
+
if (t === "auto" || t === "")
|
|
247
|
+
e = 0;
|
|
248
|
+
else {
|
|
249
|
+
const s = t.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);
|
|
250
|
+
if (!s)
|
|
251
|
+
throw new Error(`Invalid height val = ${t}`);
|
|
252
|
+
i = s[2] || "px", e = parseFloat(s[1]);
|
|
253
|
+
}
|
|
254
|
+
else
|
|
255
|
+
e = t;
|
|
256
|
+
return { h: e, unit: i };
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Copy unset fields from source objects to target object (shallow merge with defaults).
|
|
260
|
+
* Similar to Object.assign but only sets undefined/null fields.
|
|
261
|
+
*
|
|
262
|
+
* @param target the object to copy defaults into
|
|
263
|
+
* @param sources one or more source objects to copy defaults from
|
|
264
|
+
* @returns the modified target object
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* const config = { width: 100 };
|
|
268
|
+
* Utils.defaults(config, { width: 200, height: 50 });
|
|
269
|
+
* // config is now { width: 100, height: 50 }
|
|
270
|
+
*/
|
|
271
|
+
// eslint-disable-next-line
|
|
272
|
+
static defaults(t, ...e) {
|
|
273
|
+
return e.forEach((i) => {
|
|
274
|
+
for (const s in i) {
|
|
275
|
+
if (!i.hasOwnProperty(s))
|
|
276
|
+
return;
|
|
277
|
+
t[s] === null || t[s] === void 0 ? t[s] = i[s] : typeof i[s] == "object" && typeof t[s] == "object" && h.defaults(t[s], i[s]);
|
|
278
|
+
}
|
|
279
|
+
}), t;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Compare two objects for equality (shallow comparison).
|
|
283
|
+
* Checks if objects have the same fields and values at one level deep.
|
|
284
|
+
*
|
|
285
|
+
* @param a first object to compare
|
|
286
|
+
* @param b second object to compare
|
|
287
|
+
* @returns true if objects have the same values
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* Utils.same({x: 1, y: 2}, {x: 1, y: 2}); // true
|
|
291
|
+
* Utils.same({x: 1}, {x: 1, y: 2}); // false
|
|
292
|
+
*/
|
|
293
|
+
static same(t, e) {
|
|
294
|
+
if (typeof t != "object")
|
|
295
|
+
return t == e;
|
|
296
|
+
if (typeof t != typeof e || Object.keys(t).length !== Object.keys(e).length)
|
|
297
|
+
return !1;
|
|
298
|
+
for (const i in t)
|
|
299
|
+
if (t[i] !== e[i])
|
|
300
|
+
return !1;
|
|
301
|
+
return !0;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Copy position and size properties from one widget to another.
|
|
305
|
+
* Copies x, y, w, h and optionally min/max constraints.
|
|
306
|
+
*
|
|
307
|
+
* @param a target widget to copy to
|
|
308
|
+
* @param b source widget to copy from
|
|
309
|
+
* @param doMinMax if true, also copy min/max width/height constraints
|
|
310
|
+
* @returns the target widget (a)
|
|
311
|
+
*
|
|
312
|
+
* @example
|
|
313
|
+
* Utils.copyPos(widget1, widget2); // Copy position/size
|
|
314
|
+
* Utils.copyPos(widget1, widget2, true); // Also copy constraints
|
|
315
|
+
*/
|
|
316
|
+
static copyPos(t, e, i = !1) {
|
|
317
|
+
return e.x !== void 0 && (t.x = e.x), e.y !== void 0 && (t.y = e.y), e.w !== void 0 && (t.w = e.w), e.h !== void 0 && (t.h = e.h), i && (e.minW && (t.minW = e.minW), e.minH && (t.minH = e.minH), e.maxW && (t.maxW = e.maxW), e.maxH && (t.maxH = e.maxH)), t;
|
|
318
|
+
}
|
|
319
|
+
/** true if a and b has same size & position */
|
|
320
|
+
static samePos(t, e) {
|
|
321
|
+
return t && e && t.x === e.x && t.y === e.y && (t.w || 1) === (e.w || 1) && (t.h || 1) === (e.h || 1);
|
|
322
|
+
}
|
|
323
|
+
/** given a node, makes sure it's min/max are valid */
|
|
324
|
+
static sanitizeMinMax(t) {
|
|
325
|
+
t.minW || delete t.minW, t.minH || delete t.minH, t.maxW || delete t.maxW, t.maxH || delete t.maxH;
|
|
326
|
+
}
|
|
327
|
+
/** removes field from the first object if same as the second objects (like diffing) and internal '_' for saving */
|
|
328
|
+
static removeInternalAndSame(t, e) {
|
|
329
|
+
if (!(typeof t != "object" || typeof e != "object") && !(Array.isArray(t) || Array.isArray(e)))
|
|
330
|
+
for (let i in t) {
|
|
331
|
+
const s = t[i], r = e[i];
|
|
332
|
+
i[0] === "_" || s === r ? delete t[i] : s && typeof s == "object" && r !== void 0 && (h.removeInternalAndSame(s, r), Object.keys(s).length || delete t[i]);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
/** removes internal fields '_' and default values for saving */
|
|
336
|
+
static removeInternalForSave(t, e = !0) {
|
|
337
|
+
for (let i in t)
|
|
338
|
+
(i[0] === "_" || t[i] === null || t[i] === void 0) && delete t[i];
|
|
339
|
+
delete t.grid, e && delete t.el, t.autoPosition || delete t.autoPosition, t.noResize || delete t.noResize, t.noMove || delete t.noMove, t.locked || delete t.locked, (t.w === 1 || t.w === t.minW) && delete t.w, (t.h === 1 || t.h === t.minH) && delete t.h;
|
|
340
|
+
}
|
|
341
|
+
/** return the closest parent (or itself) matching the given class */
|
|
342
|
+
// static closestUpByClass(el: HTMLElement, name: string): HTMLElement {
|
|
343
|
+
// while (el) {
|
|
344
|
+
// if (el.classList.contains(name)) return el;
|
|
345
|
+
// el = el.parentElement
|
|
346
|
+
// }
|
|
347
|
+
// return null;
|
|
348
|
+
// }
|
|
349
|
+
/** delay calling the given function for given delay, preventing new calls from happening while waiting */
|
|
350
|
+
static throttle(t, e) {
|
|
351
|
+
let i = !1;
|
|
352
|
+
return (...s) => {
|
|
353
|
+
i || (i = !0, setTimeout(() => {
|
|
354
|
+
t(...s), i = !1;
|
|
355
|
+
}, e));
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
static removePositioningStyles(t) {
|
|
359
|
+
const e = t.style;
|
|
360
|
+
e.position && e.removeProperty("position"), e.left && e.removeProperty("left"), e.top && e.removeProperty("top"), e.width && e.removeProperty("width"), e.height && e.removeProperty("height");
|
|
361
|
+
}
|
|
362
|
+
/** @internal returns the passed element if scrollable, else the closest parent that will, up to the entire document scrolling element */
|
|
363
|
+
static getScrollElement(t) {
|
|
364
|
+
if (!t)
|
|
365
|
+
return document.scrollingElement || document.documentElement;
|
|
366
|
+
const e = getComputedStyle(t);
|
|
367
|
+
return /(auto|scroll)/.test(e.overflow + e.overflowY) ? t : h.getScrollElement(t.parentElement);
|
|
368
|
+
}
|
|
369
|
+
/** @internal */
|
|
370
|
+
static updateScrollPosition(t, e, i) {
|
|
371
|
+
const s = h.getScrollElement(t);
|
|
372
|
+
if (!s)
|
|
373
|
+
return;
|
|
374
|
+
const r = t.getBoundingClientRect(), n = s.getBoundingClientRect(), o = window.innerHeight || document.documentElement.clientHeight, d = r.bottom - Math.min(n.bottom, o), l = r.top - Math.max(n.top, 0), a = s.scrollTop;
|
|
375
|
+
l < 0 && i < 0 ? t.offsetHeight > n.height ? s.scrollTop += i : s.scrollTop += Math.abs(l) > Math.abs(i) ? i : l : d > 0 && i > 0 && (t.offsetHeight > n.height ? s.scrollTop += i : s.scrollTop += d > i ? i : d), e.top += s.scrollTop - a;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* @internal Function used to scroll the page.
|
|
379
|
+
*
|
|
380
|
+
* @param event `MouseEvent` that triggers the resize
|
|
381
|
+
* @param el `HTMLElement` that's being resized
|
|
382
|
+
* @param distance Distance from the V edges to start scrolling
|
|
383
|
+
*/
|
|
384
|
+
static updateScrollResize(t, e, i) {
|
|
385
|
+
const s = h.getScrollElement(e), r = s.clientHeight, n = s === h.getScrollElement() ? 0 : s.getBoundingClientRect().top, o = t.clientY - n, d = o < i, l = o > r - i;
|
|
386
|
+
d ? s.scrollBy({ behavior: "smooth", top: o - i }) : l && s.scrollBy({ behavior: "smooth", top: i - (r - o) });
|
|
387
|
+
}
|
|
388
|
+
/** single level clone, returning a new object with same top fields. This will share sub objects and arrays */
|
|
389
|
+
static clone(t) {
|
|
390
|
+
return t == null || typeof t != "object" ? t : t instanceof Array ? [...t] : { ...t };
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Recursive clone version that returns a full copy, checking for nested objects and arrays ONLY.
|
|
394
|
+
* Note: this will use as-is any key starting with double __ (and not copy inside) some lib have circular dependencies.
|
|
395
|
+
*/
|
|
396
|
+
static cloneDeep(t) {
|
|
397
|
+
const e = ["parentGrid", "el", "grid", "subGrid", "engine"], i = h.clone(t);
|
|
398
|
+
for (const s in i)
|
|
399
|
+
i.hasOwnProperty(s) && typeof i[s] == "object" && s.substring(0, 2) !== "__" && !e.find((r) => r === s) && (i[s] = h.cloneDeep(t[s]));
|
|
400
|
+
return i;
|
|
401
|
+
}
|
|
402
|
+
/** deep clone the given HTML node, removing teh unique id field */
|
|
403
|
+
static cloneNode(t) {
|
|
404
|
+
const e = t.cloneNode(!0);
|
|
405
|
+
return e.removeAttribute("id"), e;
|
|
406
|
+
}
|
|
407
|
+
static appendTo(t, e) {
|
|
408
|
+
let i;
|
|
409
|
+
typeof e == "string" ? i = h.getElement(e) : i = e, i && i.appendChild(t);
|
|
410
|
+
}
|
|
411
|
+
// public static setPositionRelative(el: HTMLElement): void {
|
|
412
|
+
// if (!(/^(?:r|a|f)/).test(getComputedStyle(el).position)) {
|
|
413
|
+
// el.style.position = "relative";
|
|
414
|
+
// }
|
|
415
|
+
// }
|
|
416
|
+
static addElStyles(t, e) {
|
|
417
|
+
if (e instanceof Object)
|
|
418
|
+
for (const i in e)
|
|
419
|
+
e.hasOwnProperty(i) && (Array.isArray(e[i]) ? e[i].forEach((s) => {
|
|
420
|
+
t.style[i] = s;
|
|
421
|
+
}) : t.style[i] = e[i]);
|
|
422
|
+
}
|
|
423
|
+
static initEvent(t, e) {
|
|
424
|
+
const i = { type: e.type }, s = {
|
|
425
|
+
button: 0,
|
|
426
|
+
which: 0,
|
|
427
|
+
buttons: 1,
|
|
428
|
+
bubbles: !0,
|
|
429
|
+
cancelable: !0,
|
|
430
|
+
target: e.target ? e.target : t.target
|
|
431
|
+
};
|
|
432
|
+
return ["altKey", "ctrlKey", "metaKey", "shiftKey"].forEach((r) => i[r] = t[r]), ["pageX", "pageY", "clientX", "clientY", "screenX", "screenY"].forEach((r) => i[r] = t[r]), { ...i, ...s };
|
|
433
|
+
}
|
|
434
|
+
/** copies the MouseEvent (or convert Touch) properties and sends it as another event to the given target */
|
|
435
|
+
static simulateMouseEvent(t, e, i) {
|
|
436
|
+
const s = t, r = new MouseEvent(e, {
|
|
437
|
+
bubbles: !0,
|
|
438
|
+
composed: !0,
|
|
439
|
+
cancelable: !0,
|
|
440
|
+
view: window,
|
|
441
|
+
detail: 1,
|
|
442
|
+
screenX: t.screenX,
|
|
443
|
+
screenY: t.screenY,
|
|
444
|
+
clientX: t.clientX,
|
|
445
|
+
clientY: t.clientY,
|
|
446
|
+
ctrlKey: s.ctrlKey ?? !1,
|
|
447
|
+
altKey: s.altKey ?? !1,
|
|
448
|
+
shiftKey: s.shiftKey ?? !1,
|
|
449
|
+
metaKey: s.metaKey ?? !1,
|
|
450
|
+
button: 0,
|
|
451
|
+
relatedTarget: t.target
|
|
452
|
+
});
|
|
453
|
+
(i || t.target).dispatchEvent(r);
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* defines an element that is used to get the offset and scale from grid transforms
|
|
457
|
+
* returns the scale and offsets from said element
|
|
458
|
+
*/
|
|
459
|
+
static getValuesFromTransformedElement(t) {
|
|
460
|
+
const e = document.createElement("div");
|
|
461
|
+
h.addElStyles(e, {
|
|
462
|
+
opacity: "0",
|
|
463
|
+
position: "fixed",
|
|
464
|
+
top: "0px",
|
|
465
|
+
left: "0px",
|
|
466
|
+
width: "1px",
|
|
467
|
+
height: "1px",
|
|
468
|
+
zIndex: "-999999"
|
|
469
|
+
}), t.appendChild(e);
|
|
470
|
+
const i = e.getBoundingClientRect();
|
|
471
|
+
return t.removeChild(e), e.remove(), {
|
|
472
|
+
xScale: 1 / i.width,
|
|
473
|
+
yScale: 1 / i.height,
|
|
474
|
+
xOffset: i.left,
|
|
475
|
+
yOffset: i.top
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
/** swap the given object 2 field values */
|
|
479
|
+
static swap(t, e, i) {
|
|
480
|
+
if (!t)
|
|
481
|
+
return;
|
|
482
|
+
const s = t[e];
|
|
483
|
+
t[e] = t[i], t[i] = s;
|
|
484
|
+
}
|
|
485
|
+
/** returns true if event is inside the given element rectangle */
|
|
486
|
+
// Note: Safari Mac has null event.relatedTarget which causes #1684 so check if DragEvent is inside the coordinates instead
|
|
487
|
+
// Utils.el.contains(event.relatedTarget as HTMLElement)
|
|
488
|
+
// public static inside(e: MouseEvent, el: HTMLElement): boolean {
|
|
489
|
+
// // srcElement, toElement, target: all set to placeholder when leaving simple grid, so we can't use that (Chrome)
|
|
490
|
+
// const target: HTMLElement = e.relatedTarget || (e as any).fromElement;
|
|
491
|
+
// if (!target) {
|
|
492
|
+
// const { bottom, left, right, top } = el.getBoundingClientRect();
|
|
493
|
+
// return (e.x < right && e.x > left && e.y < bottom && e.y > top);
|
|
494
|
+
// }
|
|
495
|
+
// return el.contains(target);
|
|
496
|
+
// }
|
|
497
|
+
/** true if the item can be rotated (checking for prop, not space available) */
|
|
498
|
+
static canBeRotated(t) {
|
|
499
|
+
return !(!t || t.w === t.h || t.locked || t.noResize || t.grid?.opts.disableResize || t.minW && t.minW === t.maxW || t.minH && t.minH === t.maxH);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
class x {
|
|
503
|
+
constructor(t = {}) {
|
|
504
|
+
this.addedNodes = [], this.removedNodes = [], this.defaultColumn = 12, this.column = t.column || this.defaultColumn, this.column > this.defaultColumn && (this.defaultColumn = this.column), this.maxRow = t.maxRow, this._float = t.float, this.nodes = t.nodes || [], this.onChange = t.onChange;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Enable/disable batch mode for multiple operations to optimize performance.
|
|
508
|
+
* When enabled, layout updates are deferred until batch mode is disabled.
|
|
509
|
+
*
|
|
510
|
+
* @param flag true to enable batch mode, false to disable and apply changes
|
|
511
|
+
* @param doPack if true (default), pack/compact nodes when disabling batch mode
|
|
512
|
+
* @returns the engine instance for chaining
|
|
513
|
+
*
|
|
514
|
+
* @example
|
|
515
|
+
* // Start batch mode for multiple operations
|
|
516
|
+
* engine.batchUpdate(true);
|
|
517
|
+
* engine.addNode(node1);
|
|
518
|
+
* engine.addNode(node2);
|
|
519
|
+
* engine.batchUpdate(false); // Apply all changes at once
|
|
520
|
+
*/
|
|
521
|
+
batchUpdate(t = !0, e = !0) {
|
|
522
|
+
return !!this.batchMode === t ? this : (this.batchMode = t, t ? (this._prevFloat = this._float, this._float = !0, this.cleanNodes(), this.saveInitial()) : (this._float = this._prevFloat, delete this._prevFloat, e && this._packNodes(), this._notify()), this);
|
|
523
|
+
}
|
|
524
|
+
// use entire row for hitting area (will use bottom reverse sorted first) if we not actively moving DOWN and didn't already skip
|
|
525
|
+
_useEntireRowArea(t, e) {
|
|
526
|
+
return (!this.float || this.batchMode && !this._prevFloat) && !this._hasLocked && (!t._moving || t._skipDown || e.y <= t.y);
|
|
527
|
+
}
|
|
528
|
+
/** @internal fix collision on given 'node', going to given new location 'nn', with optional 'collide' node already found.
|
|
529
|
+
* return true if we moved. */
|
|
530
|
+
_fixCollisions(t, e = t, i, s = {}) {
|
|
531
|
+
if (this.sortNodes(-1), i = i || this.collide(t, e), !i)
|
|
532
|
+
return !1;
|
|
533
|
+
if (t._moving && !s.nested && !this.float && this.swap(t, i))
|
|
534
|
+
return !0;
|
|
535
|
+
let r = e;
|
|
536
|
+
!this._loading && this._useEntireRowArea(t, e) && (r = { x: 0, w: this.column, y: e.y, h: e.h }, i = this.collide(t, r, s.skip));
|
|
537
|
+
let n = !1;
|
|
538
|
+
const o = { nested: !0, pack: !1 };
|
|
539
|
+
let d = 0;
|
|
540
|
+
for (; i = i || this.collide(t, r, s.skip); ) {
|
|
541
|
+
if (d++ > this.nodes.length * 2)
|
|
542
|
+
throw new Error("Infinite collide check");
|
|
543
|
+
let l;
|
|
544
|
+
if (i.locked || this._loading || t._moving && !t._skipDown && e.y > t.y && !this.float && // can take space we had, or before where we're going
|
|
545
|
+
(!this.collide(i, { ...i, y: t.y }, t) || !this.collide(i, { ...i, y: e.y - i.h }, t))) {
|
|
546
|
+
t._skipDown = t._skipDown || e.y > t.y;
|
|
547
|
+
const a = { ...e, y: i.y + i.h, ...o };
|
|
548
|
+
l = this._loading && h.samePos(t, a) ? !0 : this.moveNode(t, a), (i.locked || this._loading) && l ? h.copyPos(e, t) : !i.locked && l && s.pack && (this._packNodes(), e.y = i.y + i.h, h.copyPos(t, e)), n = n || l;
|
|
549
|
+
} else
|
|
550
|
+
l = this.moveNode(i, { ...i, y: e.y + e.h, skip: t, ...o });
|
|
551
|
+
if (!l)
|
|
552
|
+
return n;
|
|
553
|
+
i = void 0;
|
|
554
|
+
}
|
|
555
|
+
return n;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Return the first node that intercepts/collides with the given node or area.
|
|
559
|
+
* Used for collision detection during drag and drop operations.
|
|
560
|
+
*
|
|
561
|
+
* @param skip the node to skip in collision detection (usually the node being moved)
|
|
562
|
+
* @param area the area to check for collisions (defaults to skip node's area)
|
|
563
|
+
* @param skip2 optional second node to skip in collision detection
|
|
564
|
+
* @returns the first colliding node, or undefined if no collision
|
|
565
|
+
*
|
|
566
|
+
* @example
|
|
567
|
+
* const colliding = engine.collide(draggedNode, {x: 2, y: 1, w: 2, h: 1});
|
|
568
|
+
* if (colliding) {
|
|
569
|
+
* console.log('Would collide with:', colliding.id);
|
|
570
|
+
* }
|
|
571
|
+
*/
|
|
572
|
+
collide(t, e = t, i) {
|
|
573
|
+
const s = t._id, r = i?._id;
|
|
574
|
+
return this.nodes.find((n) => n._id !== s && n._id !== r && h.isIntercepted(n, e));
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Return all nodes that intercept/collide with the given node or area.
|
|
578
|
+
* Similar to collide() but returns all colliding nodes instead of just the first.
|
|
579
|
+
*
|
|
580
|
+
* @param skip the node to skip in collision detection
|
|
581
|
+
* @param area the area to check for collisions (defaults to skip node's area)
|
|
582
|
+
* @param skip2 optional second node to skip in collision detection
|
|
583
|
+
* @returns array of all colliding nodes
|
|
584
|
+
*
|
|
585
|
+
* @example
|
|
586
|
+
* const allCollisions = engine.collideAll(draggedNode);
|
|
587
|
+
* console.log('Colliding with', allCollisions.length, 'nodes');
|
|
588
|
+
*/
|
|
589
|
+
collideAll(t, e = t, i) {
|
|
590
|
+
const s = t._id, r = i?._id;
|
|
591
|
+
return this.nodes.filter((n) => n._id !== s && n._id !== r && h.isIntercepted(n, e));
|
|
592
|
+
}
|
|
593
|
+
/** does a pixel coverage collision based on where we started, returning the node that has the most coverage that is >50% mid line */
|
|
594
|
+
directionCollideCoverage(t, e, i) {
|
|
595
|
+
if (!e.rect || !t._rect)
|
|
596
|
+
return;
|
|
597
|
+
const s = t._rect, r = { ...e.rect };
|
|
598
|
+
r.y > s.y ? (r.h += r.y - s.y, r.y = s.y) : r.h += s.y - r.y, r.x > s.x ? (r.w += r.x - s.x, r.x = s.x) : r.w += s.x - r.x;
|
|
599
|
+
let n, o = 0.5;
|
|
600
|
+
for (let d of i) {
|
|
601
|
+
if (d.locked || !d._rect)
|
|
602
|
+
break;
|
|
603
|
+
const l = d._rect;
|
|
604
|
+
let a = Number.MAX_VALUE, u = Number.MAX_VALUE;
|
|
605
|
+
s.y < l.y ? a = (r.y + r.h - l.y) / l.h : s.y + s.h > l.y + l.h && (a = (l.y + l.h - r.y) / l.h), s.x < l.x ? u = (r.x + r.w - l.x) / l.w : s.x + s.w > l.x + l.w && (u = (l.x + l.w - r.x) / l.w);
|
|
606
|
+
const g = Math.min(u, a);
|
|
607
|
+
g > o && (o = g, n = d);
|
|
608
|
+
}
|
|
609
|
+
return e.collide = n, n;
|
|
610
|
+
}
|
|
611
|
+
/** does a pixel coverage returning the node that has the most coverage by area */
|
|
612
|
+
/*
|
|
613
|
+
protected collideCoverage(r: GridStackPosition, collides: GridStackNode[]): {collide: GridStackNode, over: number} {
|
|
614
|
+
const collide: GridStackNode;
|
|
615
|
+
const overMax = 0;
|
|
616
|
+
collides.forEach(n => {
|
|
617
|
+
if (n.locked || !n._rect) return;
|
|
618
|
+
const over = Utils.areaIntercept(r, n._rect);
|
|
619
|
+
if (over > overMax) {
|
|
620
|
+
overMax = over;
|
|
621
|
+
collide = n;
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
return {collide, over: overMax};
|
|
625
|
+
}
|
|
626
|
+
*/
|
|
627
|
+
/**
|
|
628
|
+
* Cache the pixel rectangles for all nodes used for collision detection during drag operations.
|
|
629
|
+
* This optimization converts grid coordinates to pixel coordinates for faster collision detection.
|
|
630
|
+
*
|
|
631
|
+
* @param w width of a single grid cell in pixels
|
|
632
|
+
* @param h height of a single grid cell in pixels
|
|
633
|
+
* @param top top margin/padding in pixels
|
|
634
|
+
* @param right right margin/padding in pixels
|
|
635
|
+
* @param bottom bottom margin/padding in pixels
|
|
636
|
+
* @param left left margin/padding in pixels
|
|
637
|
+
* @returns the engine instance for chaining
|
|
638
|
+
*
|
|
639
|
+
* @internal This is typically called by GridStack during resize events
|
|
640
|
+
*/
|
|
641
|
+
cacheRects(t, e, i, s, r, n) {
|
|
642
|
+
return this.nodes.forEach((o) => o._rect = {
|
|
643
|
+
y: o.y * e + i,
|
|
644
|
+
x: o.x * t + n,
|
|
645
|
+
w: o.w * t - n - s,
|
|
646
|
+
h: o.h * e - i - r
|
|
647
|
+
}), this;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Attempt to swap the positions of two nodes if they meet swapping criteria.
|
|
651
|
+
* Nodes can swap if they are the same size or in the same column/row, not locked, and touching.
|
|
652
|
+
*
|
|
653
|
+
* @param a first node to swap
|
|
654
|
+
* @param b second node to swap
|
|
655
|
+
* @returns true if swap was successful, false if not possible, undefined if not applicable
|
|
656
|
+
*
|
|
657
|
+
* @example
|
|
658
|
+
* const swapped = engine.swap(nodeA, nodeB);
|
|
659
|
+
* if (swapped) {
|
|
660
|
+
* console.log('Nodes swapped successfully');
|
|
661
|
+
* }
|
|
662
|
+
*/
|
|
663
|
+
swap(t, e) {
|
|
664
|
+
if (!e || e.locked || !t || t.locked)
|
|
665
|
+
return !1;
|
|
666
|
+
function i() {
|
|
667
|
+
const r = e.x, n = e.y;
|
|
668
|
+
return e.x = t.x, e.y = t.y, t.h != e.h ? (t.x = r, t.y = e.y + e.h) : t.w != e.w ? (t.x = e.x + e.w, t.y = n) : (t.x = r, t.y = n), t._dirty = e._dirty = !0, !0;
|
|
669
|
+
}
|
|
670
|
+
let s;
|
|
671
|
+
if (t.w === e.w && t.h === e.h && (t.x === e.x || t.y === e.y) && (s = h.isTouching(t, e)))
|
|
672
|
+
return i();
|
|
673
|
+
if (s !== !1) {
|
|
674
|
+
if (t.w === e.w && t.x === e.x && (s || (s = h.isTouching(t, e)))) {
|
|
675
|
+
if (e.y < t.y) {
|
|
676
|
+
const r = t;
|
|
677
|
+
t = e, e = r;
|
|
678
|
+
}
|
|
679
|
+
return i();
|
|
680
|
+
}
|
|
681
|
+
if (s !== !1) {
|
|
682
|
+
if (t.h === e.h && t.y === e.y && (s || (s = h.isTouching(t, e)))) {
|
|
683
|
+
if (e.x < t.x) {
|
|
684
|
+
const r = t;
|
|
685
|
+
t = e, e = r;
|
|
686
|
+
}
|
|
687
|
+
return i();
|
|
688
|
+
}
|
|
689
|
+
return !1;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Check if the specified rectangular area is empty (no nodes occupy any part of it).
|
|
695
|
+
*
|
|
696
|
+
* @param x the x coordinate (column) of the area to check
|
|
697
|
+
* @param y the y coordinate (row) of the area to check
|
|
698
|
+
* @param w the width in columns of the area to check
|
|
699
|
+
* @param h the height in rows of the area to check
|
|
700
|
+
* @returns true if the area is completely empty, false if any node overlaps
|
|
701
|
+
*
|
|
702
|
+
* @example
|
|
703
|
+
* if (engine.isAreaEmpty(2, 1, 3, 2)) {
|
|
704
|
+
* console.log('Area is available for placement');
|
|
705
|
+
* }
|
|
706
|
+
*/
|
|
707
|
+
isAreaEmpty(t, e, i, s) {
|
|
708
|
+
const r = { x: t || 0, y: e || 0, w: i || 1, h: s || 1 };
|
|
709
|
+
return !this.collide(r);
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Re-layout grid items to reclaim any empty space.
|
|
713
|
+
* This optimizes the grid layout by moving items to fill gaps.
|
|
714
|
+
*
|
|
715
|
+
* @param layout layout algorithm to use:
|
|
716
|
+
* - 'compact' (default): find truly empty spaces, may reorder items
|
|
717
|
+
* - 'list': keep the sort order exactly the same, move items up sequentially
|
|
718
|
+
* @param doSort if true (default), sort nodes by position before compacting
|
|
719
|
+
* @returns the engine instance for chaining
|
|
720
|
+
*
|
|
721
|
+
* @example
|
|
722
|
+
* // Compact to fill empty spaces
|
|
723
|
+
* engine.compact();
|
|
724
|
+
*
|
|
725
|
+
* // Compact preserving item order
|
|
726
|
+
* engine.compact('list');
|
|
727
|
+
*/
|
|
728
|
+
compact(t = "compact", e = !0) {
|
|
729
|
+
if (this.nodes.length === 0)
|
|
730
|
+
return this;
|
|
731
|
+
e && this.sortNodes();
|
|
732
|
+
const i = this.batchMode;
|
|
733
|
+
i || this.batchUpdate();
|
|
734
|
+
const s = this._inColumnResize;
|
|
735
|
+
s || (this._inColumnResize = !0);
|
|
736
|
+
const r = this.nodes;
|
|
737
|
+
return this.nodes = [], r.forEach((n, o, d) => {
|
|
738
|
+
let l;
|
|
739
|
+
n.locked || (n.autoPosition = !0, t === "list" && o && (l = d[o - 1])), this.addNode(n, !1, l);
|
|
740
|
+
}), s || delete this._inColumnResize, i || this.batchUpdate(!1), this;
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* Enable/disable floating widgets (default: `false`).
|
|
744
|
+
* When floating is enabled, widgets can move up to fill empty spaces.
|
|
745
|
+
* See [example](http://gridstackjs.com/demo/float.html)
|
|
746
|
+
*
|
|
747
|
+
* @param val true to enable floating, false to disable
|
|
748
|
+
*
|
|
749
|
+
* @example
|
|
750
|
+
* engine.float = true; // Enable floating
|
|
751
|
+
* engine.float = false; // Disable floating (default)
|
|
752
|
+
*/
|
|
753
|
+
set float(t) {
|
|
754
|
+
this._float !== t && (this._float = t || !1, t || this._packNodes()._notify());
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* Get the current floating mode setting.
|
|
758
|
+
*
|
|
759
|
+
* @returns true if floating is enabled, false otherwise
|
|
760
|
+
*
|
|
761
|
+
* @example
|
|
762
|
+
* const isFloating = engine.float;
|
|
763
|
+
* console.log('Floating enabled:', isFloating);
|
|
764
|
+
*/
|
|
765
|
+
get float() {
|
|
766
|
+
return this._float || !1;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Sort the nodes array from first to last, or reverse.
|
|
770
|
+
* This is called during collision/placement operations to enforce a specific order.
|
|
771
|
+
*
|
|
772
|
+
* @param dir sort direction: 1 for ascending (first to last), -1 for descending (last to first)
|
|
773
|
+
* @returns the engine instance for chaining
|
|
774
|
+
*
|
|
775
|
+
* @example
|
|
776
|
+
* engine.sortNodes(); // Sort ascending (default)
|
|
777
|
+
* engine.sortNodes(-1); // Sort descending
|
|
778
|
+
*/
|
|
779
|
+
sortNodes(t = 1) {
|
|
780
|
+
return this.nodes = h.sort(this.nodes, t), this;
|
|
781
|
+
}
|
|
782
|
+
/** @internal called to top gravity pack the items back OR revert back to original Y positions when floating */
|
|
783
|
+
_packNodes() {
|
|
784
|
+
return this.batchMode ? this : (this.sortNodes(), this.float ? this.nodes.forEach((t) => {
|
|
785
|
+
if (t._updating || t._orig === void 0 || t.y === t._orig.y)
|
|
786
|
+
return;
|
|
787
|
+
let e = t.y;
|
|
788
|
+
for (; e > t._orig.y; )
|
|
789
|
+
--e, this.collide(t, { x: t.x, y: e, w: t.w, h: t.h }) || (t._dirty = !0, t.y = e);
|
|
790
|
+
}) : this.nodes.forEach((t, e) => {
|
|
791
|
+
if (!t.locked)
|
|
792
|
+
for (; t.y > 0; ) {
|
|
793
|
+
const i = e === 0 ? 0 : t.y - 1;
|
|
794
|
+
if (!(e === 0 || !this.collide(t, { x: t.x, y: i, w: t.w, h: t.h })))
|
|
795
|
+
break;
|
|
796
|
+
t._dirty = t.y !== i, t.y = i;
|
|
797
|
+
}
|
|
798
|
+
}), this);
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* Prepare and validate a node's coordinates and values for the current grid.
|
|
802
|
+
* This ensures the node has valid position, size, and properties before being added to the grid.
|
|
803
|
+
*
|
|
804
|
+
* @param node the node to prepare and validate
|
|
805
|
+
* @param resizing if true, resize the node down if it's out of bounds; if false, move it to fit
|
|
806
|
+
* @returns the prepared node with valid coordinates
|
|
807
|
+
*
|
|
808
|
+
* @example
|
|
809
|
+
* const node = { w: 3, h: 2, content: 'Hello' };
|
|
810
|
+
* const prepared = engine.prepareNode(node);
|
|
811
|
+
* console.log('Node prepared at:', prepared.x, prepared.y);
|
|
812
|
+
*/
|
|
813
|
+
prepareNode(t, e) {
|
|
814
|
+
t._id = t._id ?? x._idSeq++;
|
|
815
|
+
const i = t.id;
|
|
816
|
+
if (i) {
|
|
817
|
+
let r = 1;
|
|
818
|
+
for (; this.nodes.find((n) => n.id === t.id && n !== t); )
|
|
819
|
+
t.id = i + "_" + r++;
|
|
820
|
+
}
|
|
821
|
+
(t.x === void 0 || t.y === void 0 || t.x === null || t.y === null) && (t.autoPosition = !0);
|
|
822
|
+
const s = { x: 0, y: 0, w: 1, h: 1 };
|
|
823
|
+
return h.defaults(t, s), t.autoPosition || delete t.autoPosition, t.noResize || delete t.noResize, t.noMove || delete t.noMove, h.sanitizeMinMax(t), typeof t.x == "string" && (t.x = Number(t.x)), typeof t.y == "string" && (t.y = Number(t.y)), typeof t.w == "string" && (t.w = Number(t.w)), typeof t.h == "string" && (t.h = Number(t.h)), isNaN(t.x) && (t.x = s.x, t.autoPosition = !0), isNaN(t.y) && (t.y = s.y, t.autoPosition = !0), isNaN(t.w) && (t.w = s.w), isNaN(t.h) && (t.h = s.h), this.nodeBoundFix(t, e), t;
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Part 2 of preparing a node to fit inside the grid - validates and fixes coordinates and dimensions.
|
|
827
|
+
* This ensures the node fits within grid boundaries and respects min/max constraints.
|
|
828
|
+
*
|
|
829
|
+
* @param node the node to validate and fix
|
|
830
|
+
* @param resizing if true, resize the node to fit; if false, move the node to fit
|
|
831
|
+
* @returns the engine instance for chaining
|
|
832
|
+
*
|
|
833
|
+
* @example
|
|
834
|
+
* // Fix a node that might be out of bounds
|
|
835
|
+
* engine.nodeBoundFix(node, true); // Resize to fit
|
|
836
|
+
* engine.nodeBoundFix(node, false); // Move to fit
|
|
837
|
+
*/
|
|
838
|
+
nodeBoundFix(t, e) {
|
|
839
|
+
const i = t._orig || h.copyPos({}, t);
|
|
840
|
+
if (t.maxW && (t.w = Math.min(t.w || 1, t.maxW)), t.maxH && (t.h = Math.min(t.h || 1, t.maxH)), t.minW && (t.w = Math.max(t.w || 1, t.minW)), t.minH && (t.h = Math.max(t.h || 1, t.minH)), (t.x || 0) + (t.w || 1) > this.column && this.column < this.defaultColumn && !this._inColumnResize && !this.skipCacheUpdate && t._id != null && this.findCacheLayout(t, this.defaultColumn) === -1) {
|
|
841
|
+
const r = { ...t };
|
|
842
|
+
r.autoPosition || r.x === void 0 ? (delete r.x, delete r.y) : r.x = Math.min(this.defaultColumn - 1, r.x), r.w = Math.min(this.defaultColumn, r.w || 1), this.cacheOneLayout(r, this.defaultColumn);
|
|
843
|
+
}
|
|
844
|
+
return t.w > this.column ? t.w = this.column : t.w < 1 && (t.w = 1), this.maxRow && t.h > this.maxRow ? t.h = this.maxRow : t.h < 1 && (t.h = 1), t.x < 0 && (t.x = 0), t.y < 0 && (t.y = 0), t.x + t.w > this.column && (e ? t.w = this.column - t.x : t.x = this.column - t.w), this.maxRow && t.y + t.h > this.maxRow && (e ? t.h = this.maxRow - t.y : t.y = this.maxRow - t.h), h.samePos(t, i) || (t._dirty = !0), this;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Returns a list of nodes that have been modified from their original values.
|
|
848
|
+
* This is used to track which nodes need DOM updates.
|
|
849
|
+
*
|
|
850
|
+
* @param verify if true, performs additional verification by comparing current vs original positions
|
|
851
|
+
* @returns array of nodes that have been modified
|
|
852
|
+
*
|
|
853
|
+
* @example
|
|
854
|
+
* const changed = engine.getDirtyNodes();
|
|
855
|
+
* console.log('Modified nodes:', changed.length);
|
|
856
|
+
*
|
|
857
|
+
* // Get verified dirty nodes
|
|
858
|
+
* const verified = engine.getDirtyNodes(true);
|
|
859
|
+
*/
|
|
860
|
+
getDirtyNodes(t) {
|
|
861
|
+
return t ? this.nodes.filter((e) => e._dirty && !h.samePos(e, e._orig)) : this.nodes.filter((e) => e._dirty);
|
|
862
|
+
}
|
|
863
|
+
/** @internal call this to call onChange callback with dirty nodes so DOM can be updated */
|
|
864
|
+
_notify(t) {
|
|
865
|
+
if (this.batchMode || !this.onChange)
|
|
866
|
+
return this;
|
|
867
|
+
const e = (t || []).concat(this.getDirtyNodes());
|
|
868
|
+
return this.onChange(e), this;
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Clean all dirty and last tried information from nodes.
|
|
872
|
+
* This resets the dirty state tracking for all nodes.
|
|
873
|
+
*
|
|
874
|
+
* @returns the engine instance for chaining
|
|
875
|
+
*
|
|
876
|
+
* @internal
|
|
877
|
+
*/
|
|
878
|
+
cleanNodes() {
|
|
879
|
+
return this.batchMode ? this : (this.nodes.forEach((t) => {
|
|
880
|
+
delete t._dirty, delete t._lastTried;
|
|
881
|
+
}), this);
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* Save the initial position/size of all nodes to track real dirty state.
|
|
885
|
+
* This creates a snapshot of current positions that can be restored later.
|
|
886
|
+
*
|
|
887
|
+
* Note: Should be called right after change events and before move/resize operations.
|
|
888
|
+
*
|
|
889
|
+
* @returns the engine instance for chaining
|
|
890
|
+
*
|
|
891
|
+
* @internal
|
|
892
|
+
*/
|
|
893
|
+
saveInitial() {
|
|
894
|
+
return this.nodes.forEach((t) => {
|
|
895
|
+
t._orig = h.copyPos({}, t), delete t._dirty;
|
|
896
|
+
}), this._hasLocked = this.nodes.some((t) => t.locked), this;
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* Restore all nodes back to their initial values.
|
|
900
|
+
* This is typically called when canceling an operation (e.g., Esc key during drag).
|
|
901
|
+
*
|
|
902
|
+
* @returns the engine instance for chaining
|
|
903
|
+
*
|
|
904
|
+
* @internal
|
|
905
|
+
*/
|
|
906
|
+
restoreInitial() {
|
|
907
|
+
return this.nodes.forEach((t) => {
|
|
908
|
+
!t._orig || h.samePos(t, t._orig) || (h.copyPos(t, t._orig), t._dirty = !0);
|
|
909
|
+
}), this._notify(), this;
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* Find the first available empty spot for the given node dimensions.
|
|
913
|
+
* Updates the node's x,y attributes with the found position.
|
|
914
|
+
*
|
|
915
|
+
* @param node the node to find a position for (w,h must be set)
|
|
916
|
+
* @param nodeList optional list of nodes to check against (defaults to engine nodes)
|
|
917
|
+
* @param column optional column count (defaults to engine column count)
|
|
918
|
+
* @param after optional node to start search after (maintains order)
|
|
919
|
+
* @returns true if an empty position was found and node was updated
|
|
920
|
+
*
|
|
921
|
+
* @example
|
|
922
|
+
* const node = { w: 2, h: 1 };
|
|
923
|
+
* if (engine.findEmptyPosition(node)) {
|
|
924
|
+
* console.log('Found position at:', node.x, node.y);
|
|
925
|
+
* }
|
|
926
|
+
*/
|
|
927
|
+
findEmptyPosition(t, e = this.nodes, i = this.column, s) {
|
|
928
|
+
const r = s ? s.y * i + (s.x + s.w) : 0;
|
|
929
|
+
let n = !1;
|
|
930
|
+
for (let o = r; !n; ++o) {
|
|
931
|
+
const d = o % i, l = Math.floor(o / i);
|
|
932
|
+
if (d + t.w > i)
|
|
933
|
+
continue;
|
|
934
|
+
const a = { x: d, y: l, w: t.w, h: t.h };
|
|
935
|
+
e.find((u) => h.isIntercepted(a, u)) || ((t.x !== d || t.y !== l) && (t._dirty = !0), t.x = d, t.y = l, delete t.autoPosition, n = !0);
|
|
936
|
+
}
|
|
937
|
+
return n;
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* Add the given node to the grid, handling collision detection and re-packing.
|
|
941
|
+
* This is the main method for adding new widgets to the engine.
|
|
942
|
+
*
|
|
943
|
+
* @param node the node to add to the grid
|
|
944
|
+
* @param triggerAddEvent if true, adds node to addedNodes list for event triggering
|
|
945
|
+
* @param after optional node to place this node after (for ordering)
|
|
946
|
+
* @returns the added node (or existing node if duplicate)
|
|
947
|
+
*
|
|
948
|
+
* @example
|
|
949
|
+
* const node = { x: 0, y: 0, w: 2, h: 1, content: 'Hello' };
|
|
950
|
+
* const added = engine.addNode(node, true);
|
|
951
|
+
*/
|
|
952
|
+
addNode(t, e = !1, i) {
|
|
953
|
+
const s = this.nodes.find((n) => n._id === t._id);
|
|
954
|
+
if (s)
|
|
955
|
+
return s;
|
|
956
|
+
this._inColumnResize ? this.nodeBoundFix(t) : this.prepareNode(t), delete t._temporaryRemoved, delete t._removeDOM;
|
|
957
|
+
let r;
|
|
958
|
+
return t.autoPosition && this.findEmptyPosition(t, this.nodes, this.column, i) && (delete t.autoPosition, r = !0), this.nodes.push(t), e && this.addedNodes.push(t), r || this._fixCollisions(t), this.batchMode || this._packNodes()._notify(), t;
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* Remove the given node from the grid.
|
|
962
|
+
*
|
|
963
|
+
* @param node the node to remove
|
|
964
|
+
* @param removeDOM if true (default), marks node for DOM removal
|
|
965
|
+
* @param triggerEvent if true, adds node to removedNodes list for event triggering
|
|
966
|
+
* @returns the engine instance for chaining
|
|
967
|
+
*
|
|
968
|
+
* @example
|
|
969
|
+
* engine.removeNode(node, true, true);
|
|
970
|
+
*/
|
|
971
|
+
removeNode(t, e = !0, i = !1) {
|
|
972
|
+
return this.nodes.find((s) => s._id === t._id) ? (i && this.removedNodes.push(t), e && (t._removeDOM = !0), this.nodes = this.nodes.filter((s) => s._id !== t._id), t._isAboutToRemove || this._packNodes(), this._notify([t]), this) : this;
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Remove all nodes from the grid.
|
|
976
|
+
*
|
|
977
|
+
* @param removeDOM if true (default), marks all nodes for DOM removal
|
|
978
|
+
* @param triggerEvent if true (default), triggers removal events
|
|
979
|
+
* @returns the engine instance for chaining
|
|
980
|
+
*
|
|
981
|
+
* @example
|
|
982
|
+
* engine.removeAll(); // Remove all nodes
|
|
983
|
+
*/
|
|
984
|
+
removeAll(t = !0, e = !0) {
|
|
985
|
+
if (delete this._layouts, !this.nodes.length)
|
|
986
|
+
return this;
|
|
987
|
+
t && this.nodes.forEach((s) => s._removeDOM = !0);
|
|
988
|
+
const i = this.nodes;
|
|
989
|
+
return this.removedNodes = e ? i : [], this.nodes = [], this._notify(i);
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* Check if a node can be moved to a new position, considering layout constraints.
|
|
993
|
+
* This is a safer version of moveNode() that validates the move first.
|
|
994
|
+
*
|
|
995
|
+
* For complex cases (like maxRow constraints), it simulates the move in a clone first,
|
|
996
|
+
* then applies the changes only if they meet all specifications.
|
|
997
|
+
*
|
|
998
|
+
* @param node the node to move
|
|
999
|
+
* @param o move options including target position
|
|
1000
|
+
* @returns true if the node was successfully moved
|
|
1001
|
+
*
|
|
1002
|
+
* @example
|
|
1003
|
+
* const canMove = engine.moveNodeCheck(node, { x: 2, y: 1 });
|
|
1004
|
+
* if (canMove) {
|
|
1005
|
+
* console.log('Node moved successfully');
|
|
1006
|
+
* }
|
|
1007
|
+
*/
|
|
1008
|
+
moveNodeCheck(t, e) {
|
|
1009
|
+
if (!this.changedPosConstrain(t, e))
|
|
1010
|
+
return !1;
|
|
1011
|
+
if (e.pack = !0, !this.maxRow)
|
|
1012
|
+
return this.moveNode(t, e);
|
|
1013
|
+
let i;
|
|
1014
|
+
const s = new x({
|
|
1015
|
+
column: this.column,
|
|
1016
|
+
float: this.float,
|
|
1017
|
+
nodes: this.nodes.map((n) => n._id === t._id ? (i = { ...n }, i) : { ...n })
|
|
1018
|
+
});
|
|
1019
|
+
if (!i)
|
|
1020
|
+
return !1;
|
|
1021
|
+
const r = s.moveNode(i, e) && s.getRow() <= Math.max(this.getRow(), this.maxRow);
|
|
1022
|
+
if (!r && !e.resizing && e.collide) {
|
|
1023
|
+
const n = e.collide.el.gridstackNode;
|
|
1024
|
+
if (this.swap(t, n))
|
|
1025
|
+
return this._notify(), !0;
|
|
1026
|
+
}
|
|
1027
|
+
return r ? (s.nodes.filter((n) => n._dirty).forEach((n) => {
|
|
1028
|
+
const o = this.nodes.find((d) => d._id === n._id);
|
|
1029
|
+
o && (h.copyPos(o, n), o._dirty = !0);
|
|
1030
|
+
}), this._notify(), !0) : !1;
|
|
1031
|
+
}
|
|
1032
|
+
/** return true if can fit in grid height constrain only (always true if no maxRow) */
|
|
1033
|
+
willItFit(t) {
|
|
1034
|
+
if (delete t._willFitPos, !this.maxRow)
|
|
1035
|
+
return !0;
|
|
1036
|
+
const e = new x({
|
|
1037
|
+
column: this.column,
|
|
1038
|
+
float: this.float,
|
|
1039
|
+
nodes: this.nodes.map((s) => ({ ...s }))
|
|
1040
|
+
}), i = { ...t };
|
|
1041
|
+
return this.cleanupNode(i), delete i.el, delete i._id, delete i.content, delete i.grid, e.addNode(i), e.getRow() <= this.maxRow ? (t._willFitPos = h.copyPos({}, i), !0) : !1;
|
|
1042
|
+
}
|
|
1043
|
+
/** true if x,y or w,h are different after clamping to min/max */
|
|
1044
|
+
changedPosConstrain(t, e) {
|
|
1045
|
+
return e.w = e.w || t.w, e.h = e.h || t.h, t.x !== e.x || t.y !== e.y ? !0 : (t.maxW && (e.w = Math.min(e.w, t.maxW)), t.maxH && (e.h = Math.min(e.h, t.maxH)), t.minW && (e.w = Math.max(e.w, t.minW)), t.minH && (e.h = Math.max(e.h, t.minH)), t.w !== e.w || t.h !== e.h);
|
|
1046
|
+
}
|
|
1047
|
+
/** return true if the passed in node was actually moved (checks for no-op and locked) */
|
|
1048
|
+
moveNode(t, e) {
|
|
1049
|
+
if (!t || /*node.locked ||*/
|
|
1050
|
+
!e)
|
|
1051
|
+
return !1;
|
|
1052
|
+
let i;
|
|
1053
|
+
e.pack === void 0 && !this.batchMode && (i = e.pack = !0), typeof e.x != "number" && (e.x = t.x), typeof e.y != "number" && (e.y = t.y), typeof e.w != "number" && (e.w = t.w), typeof e.h != "number" && (e.h = t.h);
|
|
1054
|
+
const s = t.w !== e.w || t.h !== e.h, r = h.copyPos({}, t, !0);
|
|
1055
|
+
if (h.copyPos(r, e), this.nodeBoundFix(r, s), h.copyPos(e, r), !e.forceCollide && h.samePos(t, e))
|
|
1056
|
+
return !1;
|
|
1057
|
+
const n = h.copyPos({}, t), o = this.collideAll(t, r, e.skip);
|
|
1058
|
+
let d = !0;
|
|
1059
|
+
if (o.length) {
|
|
1060
|
+
const l = t._moving && !e.nested;
|
|
1061
|
+
let a = l ? this.directionCollideCoverage(t, e, o) : o[0];
|
|
1062
|
+
if (l && a && t.grid?.opts?.subGridDynamic && !t.grid._isTemp) {
|
|
1063
|
+
const u = h.areaIntercept(e.rect, a._rect), g = h.area(e.rect), p = h.area(a._rect);
|
|
1064
|
+
u / (g < p ? g : p) > 0.8 && (a.grid.makeSubGrid(a.el, void 0, t), a = void 0);
|
|
1065
|
+
}
|
|
1066
|
+
a ? d = !this._fixCollisions(t, r, a, e) : (d = !1, i && delete e.pack);
|
|
1067
|
+
}
|
|
1068
|
+
return d && !h.samePos(t, r) && (t._dirty = !0, h.copyPos(t, r)), e.pack && this._packNodes()._notify(), !h.samePos(t, n);
|
|
1069
|
+
}
|
|
1070
|
+
getRow() {
|
|
1071
|
+
return this.nodes.reduce((t, e) => Math.max(t, e.y + e.h), 0);
|
|
1072
|
+
}
|
|
1073
|
+
beginUpdate(t) {
|
|
1074
|
+
return t._updating || (t._updating = !0, delete t._skipDown, this.batchMode || this.saveInitial()), this;
|
|
1075
|
+
}
|
|
1076
|
+
endUpdate() {
|
|
1077
|
+
const t = this.nodes.find((e) => e._updating);
|
|
1078
|
+
return t && (delete t._updating, delete t._skipDown), this;
|
|
1079
|
+
}
|
|
1080
|
+
/** saves a copy of the largest column layout (eg 12 even when rendering 1 column) so we don't loose orig layout, unless explicity column
|
|
1081
|
+
* count to use is given. returning a list of widgets for serialization
|
|
1082
|
+
* @param saveElement if true (default), the element will be saved to GridStackWidget.el field, else it will be removed.
|
|
1083
|
+
* @param saveCB callback for each node -> widget, so application can insert additional data to be saved into the widget data structure.
|
|
1084
|
+
* @param column if provided, the grid will be saved for the given column count (IFF we have matching internal saved layout, or current layout).
|
|
1085
|
+
* Note: nested grids will ALWAYS save the container w to match overall layouts (parent + child) to be consistent.
|
|
1086
|
+
*/
|
|
1087
|
+
save(t = !0, e, i) {
|
|
1088
|
+
const s = this._layouts?.length || 0;
|
|
1089
|
+
let r;
|
|
1090
|
+
s && (i ? i !== this.column && (r = this._layouts[i]) : this.column !== s - 1 && (r = this._layouts[s - 1]));
|
|
1091
|
+
const n = [];
|
|
1092
|
+
return this.sortNodes(), this.nodes.forEach((o) => {
|
|
1093
|
+
const d = r?.find((a) => a._id === o._id), l = { ...o, ...d || {} };
|
|
1094
|
+
h.removeInternalForSave(l, !t), e && e(o, l), n.push(l);
|
|
1095
|
+
}), n;
|
|
1096
|
+
}
|
|
1097
|
+
/** @internal called whenever a node is added or moved - updates the cached layouts */
|
|
1098
|
+
layoutsNodesChange(t) {
|
|
1099
|
+
return !this._layouts || this._inColumnResize ? this : (this._layouts.forEach((e, i) => {
|
|
1100
|
+
if (!e || i === this.column)
|
|
1101
|
+
return this;
|
|
1102
|
+
if (i < this.column)
|
|
1103
|
+
this._layouts[i] = void 0;
|
|
1104
|
+
else {
|
|
1105
|
+
const s = i / this.column;
|
|
1106
|
+
t.forEach((r) => {
|
|
1107
|
+
if (!r._orig)
|
|
1108
|
+
return;
|
|
1109
|
+
const n = e.find((o) => o._id === r._id);
|
|
1110
|
+
n && (n.y >= 0 && r.y !== r._orig.y && (n.y += r.y - r._orig.y, n.y < 0 && (n.y = 0)), r.x !== r._orig.x && (n.x = Math.round(r.x * s), n.x < 0 && (n.x = 0)), r.w !== r._orig.w && (n.w = Math.round(r.w * s), n.w < 1 && (n.w = 1)));
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
}), this);
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* @internal Called to scale the widget width & position up/down based on the column change.
|
|
1117
|
+
* Note we store previous layouts (especially original ones) to make it possible to go
|
|
1118
|
+
* from say 12 -> 1 -> 12 and get back to where we were.
|
|
1119
|
+
*
|
|
1120
|
+
* @param prevColumn previous number of columns
|
|
1121
|
+
* @param column new column number
|
|
1122
|
+
* @param layout specify the type of re-layout that will happen (position, size, etc...).
|
|
1123
|
+
* Note: items will never be outside of the current column boundaries. default (moveScale). Ignored for 1 column
|
|
1124
|
+
*/
|
|
1125
|
+
columnChanged(t, e, i = "moveScale") {
|
|
1126
|
+
if (!this.nodes.length || !e || t === e)
|
|
1127
|
+
return this;
|
|
1128
|
+
const s = i === "compact" || i === "list";
|
|
1129
|
+
s && this.sortNodes(1), e < t && this.cacheLayout(this.nodes, t), this.batchUpdate();
|
|
1130
|
+
let r = [], n = s ? this.nodes : h.sort(this.nodes, -1);
|
|
1131
|
+
if (e > t && this._layouts) {
|
|
1132
|
+
const o = this._layouts[e] || [], d = this._layouts.length - 1;
|
|
1133
|
+
!o.length && t !== d && this._layouts[d]?.length && (t = d, this._layouts[d].forEach((l) => {
|
|
1134
|
+
const a = n.find((u) => u._id === l._id);
|
|
1135
|
+
a && (!s && !l.autoPosition && (a.x = l.x ?? a.x, a.y = l.y ?? a.y), a.w = l.w ?? a.w, (l.x == null || l.y === void 0) && (a.autoPosition = !0));
|
|
1136
|
+
})), o.forEach((l) => {
|
|
1137
|
+
const a = n.findIndex((u) => u._id === l._id);
|
|
1138
|
+
if (a !== -1) {
|
|
1139
|
+
const u = n[a];
|
|
1140
|
+
if (s) {
|
|
1141
|
+
u.w = l.w;
|
|
1142
|
+
return;
|
|
1143
|
+
}
|
|
1144
|
+
(l.autoPosition || isNaN(l.x) || isNaN(l.y)) && this.findEmptyPosition(l, r), l.autoPosition || (u.x = l.x ?? u.x, u.y = l.y ?? u.y, u.w = l.w ?? u.w, r.push(u)), n.splice(a, 1);
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
if (s)
|
|
1149
|
+
this.compact(i, !1);
|
|
1150
|
+
else {
|
|
1151
|
+
if (n.length)
|
|
1152
|
+
if (typeof i == "function")
|
|
1153
|
+
i(e, t, r, n);
|
|
1154
|
+
else {
|
|
1155
|
+
const o = s || i === "none" ? 1 : e / t, d = i === "move" || i === "moveScale", l = i === "scale" || i === "moveScale";
|
|
1156
|
+
n.forEach((a) => {
|
|
1157
|
+
a.x = e === 1 ? 0 : d ? Math.round(a.x * o) : Math.min(a.x, e - 1), a.w = e === 1 || t === 1 ? 1 : l ? Math.round(a.w * o) || 1 : Math.min(a.w, e), r.push(a);
|
|
1158
|
+
}), n = [];
|
|
1159
|
+
}
|
|
1160
|
+
r = h.sort(r, -1), this._inColumnResize = !0, this.nodes = [], r.forEach((o) => {
|
|
1161
|
+
this.addNode(o, !1), delete o._orig;
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
return this.nodes.forEach((o) => delete o._orig), this.batchUpdate(!1, !s), delete this._inColumnResize, this;
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* call to cache the given layout internally to the given location so we can restore back when column changes size
|
|
1168
|
+
* @param nodes list of nodes
|
|
1169
|
+
* @param column corresponding column index to save it under
|
|
1170
|
+
* @param clear if true, will force other caches to be removed (default false)
|
|
1171
|
+
*/
|
|
1172
|
+
cacheLayout(t, e, i = !1) {
|
|
1173
|
+
const s = [];
|
|
1174
|
+
return t.forEach((r, n) => {
|
|
1175
|
+
if (r._id === void 0) {
|
|
1176
|
+
const o = r.id ? this.nodes.find((d) => d.id === r.id) : void 0;
|
|
1177
|
+
r._id = o?._id ?? x._idSeq++;
|
|
1178
|
+
}
|
|
1179
|
+
s[n] = { x: r.x, y: r.y, w: r.w, _id: r._id };
|
|
1180
|
+
}), this._layouts = i ? [] : this._layouts || [], this._layouts[e] = s, this;
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* call to cache the given node layout internally to the given location so we can restore back when column changes size
|
|
1184
|
+
* @param node single node to cache
|
|
1185
|
+
* @param column corresponding column index to save it under
|
|
1186
|
+
*/
|
|
1187
|
+
cacheOneLayout(t, e) {
|
|
1188
|
+
t._id = t._id ?? x._idSeq++;
|
|
1189
|
+
const i = { x: t.x, y: t.y, w: t.w, _id: t._id };
|
|
1190
|
+
(t.autoPosition || t.x === void 0) && (delete i.x, delete i.y, t.autoPosition && (i.autoPosition = !0)), this._layouts = this._layouts || [], this._layouts[e] = this._layouts[e] || [];
|
|
1191
|
+
const s = this.findCacheLayout(t, e);
|
|
1192
|
+
return s === -1 ? this._layouts[e].push(i) : this._layouts[e][s] = i, this;
|
|
1193
|
+
}
|
|
1194
|
+
findCacheLayout(t, e) {
|
|
1195
|
+
return this._layouts?.[e]?.findIndex((i) => i._id === t._id) ?? -1;
|
|
1196
|
+
}
|
|
1197
|
+
removeNodeFromLayoutCache(t) {
|
|
1198
|
+
if (this._layouts)
|
|
1199
|
+
for (let e = 0; e < this._layouts.length; e++) {
|
|
1200
|
+
const i = this.findCacheLayout(t, e);
|
|
1201
|
+
i !== -1 && this._layouts[e].splice(i, 1);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
/** called to remove all internal values but the _id */
|
|
1205
|
+
cleanupNode(t) {
|
|
1206
|
+
for (const e in t)
|
|
1207
|
+
e[0] === "_" && e !== "_id" && delete t[e];
|
|
1208
|
+
return this;
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
x._idSeq = 0;
|
|
1212
|
+
const v = {
|
|
1213
|
+
alwaysShowResizeHandle: "mobile",
|
|
1214
|
+
animate: !0,
|
|
1215
|
+
auto: !0,
|
|
1216
|
+
cellHeight: "auto",
|
|
1217
|
+
cellHeightThrottle: 100,
|
|
1218
|
+
cellHeightUnit: "px",
|
|
1219
|
+
column: 12,
|
|
1220
|
+
draggable: { handle: ".grid-stack-item-content", appendTo: "body", scroll: !0 },
|
|
1221
|
+
handle: ".grid-stack-item-content",
|
|
1222
|
+
itemClass: "grid-stack-item",
|
|
1223
|
+
margin: 10,
|
|
1224
|
+
marginUnit: "px",
|
|
1225
|
+
maxRow: 0,
|
|
1226
|
+
minRow: 0,
|
|
1227
|
+
placeholderClass: "grid-stack-placeholder",
|
|
1228
|
+
placeholderText: "",
|
|
1229
|
+
removableOptions: { accept: "grid-stack-item", decline: "grid-stack-non-removable" },
|
|
1230
|
+
resizable: { handles: "se" },
|
|
1231
|
+
rtl: "auto"
|
|
1232
|
+
// **** same as not being set ****
|
|
1233
|
+
// disableDrag: false,
|
|
1234
|
+
// disableResize: false,
|
|
1235
|
+
// float: false,
|
|
1236
|
+
// handleClass: null,
|
|
1237
|
+
// removable: false,
|
|
1238
|
+
// staticGrid: false,
|
|
1239
|
+
//removable
|
|
1240
|
+
};
|
|
1241
|
+
class f {
|
|
1242
|
+
}
|
|
1243
|
+
const b = typeof window < "u" && typeof document < "u" && ("ontouchstart" in document || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
|
|
1244
|
+
class w {
|
|
1245
|
+
}
|
|
1246
|
+
function D(m, t) {
|
|
1247
|
+
m.touches.length > 1 || (m.cancelable && m.preventDefault(), h.simulateMouseEvent(m.changedTouches[0], t));
|
|
1248
|
+
}
|
|
1249
|
+
function G(m, t) {
|
|
1250
|
+
m.cancelable && m.preventDefault(), h.simulateMouseEvent(m, t);
|
|
1251
|
+
}
|
|
1252
|
+
function N(m) {
|
|
1253
|
+
w.touchHandled || (w.touchHandled = !0, D(m, "mousedown"));
|
|
1254
|
+
}
|
|
1255
|
+
function H(m) {
|
|
1256
|
+
w.touchHandled && D(m, "mousemove");
|
|
1257
|
+
}
|
|
1258
|
+
function T(m) {
|
|
1259
|
+
if (!w.touchHandled)
|
|
1260
|
+
return;
|
|
1261
|
+
w.pointerLeaveTimeout && (window.clearTimeout(w.pointerLeaveTimeout), delete w.pointerLeaveTimeout);
|
|
1262
|
+
const t = !!f.dragElement;
|
|
1263
|
+
D(m, "mouseup"), t || D(m, "click"), w.touchHandled = !1;
|
|
1264
|
+
}
|
|
1265
|
+
function k(m) {
|
|
1266
|
+
m.pointerType !== "mouse" && m.target.releasePointerCapture(m.pointerId);
|
|
1267
|
+
}
|
|
1268
|
+
function B(m) {
|
|
1269
|
+
f.dragElement && m.pointerType !== "mouse" && G(m, "mouseenter");
|
|
1270
|
+
}
|
|
1271
|
+
function W(m) {
|
|
1272
|
+
f.dragElement && m.pointerType !== "mouse" && (w.pointerLeaveTimeout = window.setTimeout(() => {
|
|
1273
|
+
delete w.pointerLeaveTimeout, G(m, "mouseleave");
|
|
1274
|
+
}, 10));
|
|
1275
|
+
}
|
|
1276
|
+
class L {
|
|
1277
|
+
constructor(t, e, i) {
|
|
1278
|
+
this.host = t, this.dir = e, this.option = i, this.moving = !1, this._mouseDown = this._mouseDown.bind(this), this._mouseMove = this._mouseMove.bind(this), this._mouseUp = this._mouseUp.bind(this), this._keyEvent = this._keyEvent.bind(this), this._init();
|
|
1279
|
+
}
|
|
1280
|
+
/** @internal */
|
|
1281
|
+
_init() {
|
|
1282
|
+
if (this.option.element)
|
|
1283
|
+
try {
|
|
1284
|
+
this.el = this.option.element instanceof HTMLElement ? this.option.element : this.host.querySelector(this.option.element);
|
|
1285
|
+
} catch (t) {
|
|
1286
|
+
this.option.element = void 0, console.error("Query for resizeable handle failed, falling back", t);
|
|
1287
|
+
}
|
|
1288
|
+
return this.el || (this.el = document.createElement("div"), this.host.appendChild(this.el)), this.el.classList.add("ui-resizable-handle"), this.el.classList.add(`${L.prefix}${this.dir}`), this.el.style.zIndex = "100", this.el.style.userSelect = "none", this.el.addEventListener("mousedown", this._mouseDown), b && (this.el.addEventListener("touchstart", N), this.el.addEventListener("pointerdown", k)), this;
|
|
1289
|
+
}
|
|
1290
|
+
/** call this when resize handle needs to be removed and cleaned up */
|
|
1291
|
+
destroy() {
|
|
1292
|
+
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), b && (this.el.removeEventListener("touchstart", N), this.el.removeEventListener("pointerdown", k)), this.option.element || this.host.removeChild(this.el), delete this.el, delete this.host, this;
|
|
1293
|
+
}
|
|
1294
|
+
/** @internal called on mouse down on us: capture move on the entire document (mouse might not stay on us) until we release the mouse */
|
|
1295
|
+
_mouseDown(t) {
|
|
1296
|
+
this.mouseDownEvent = t, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), b && (this.el.addEventListener("touchmove", H), this.el.addEventListener("touchend", T)), t.stopPropagation(), t.preventDefault();
|
|
1297
|
+
}
|
|
1298
|
+
/** @internal */
|
|
1299
|
+
_mouseMove(t) {
|
|
1300
|
+
const e = this.mouseDownEvent;
|
|
1301
|
+
this.moving ? this._triggerEvent("move", t) : Math.abs(t.x - e.x) + Math.abs(t.y - e.y) > 2 && (this.moving = !0, this._triggerEvent("start", this.mouseDownEvent), this._triggerEvent("move", t), document.addEventListener("keydown", this._keyEvent)), t.stopPropagation();
|
|
1302
|
+
}
|
|
1303
|
+
/** @internal */
|
|
1304
|
+
_mouseUp(t) {
|
|
1305
|
+
this.moving && (this._triggerEvent("stop", t), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), b && (this.el.removeEventListener("touchmove", H), this.el.removeEventListener("touchend", T)), delete this.moving, delete this.mouseDownEvent, t.stopPropagation(), t.preventDefault();
|
|
1306
|
+
}
|
|
1307
|
+
/** @internal call when keys are being pressed - use Esc to cancel */
|
|
1308
|
+
_keyEvent(t) {
|
|
1309
|
+
t.key === "Escape" && (this.host.gridstackNode?.grid?.engine.restoreInitial(), this._mouseUp(this.mouseDownEvent));
|
|
1310
|
+
}
|
|
1311
|
+
/** @internal */
|
|
1312
|
+
_triggerEvent(t, e) {
|
|
1313
|
+
return this.option[t] && this.option[t](e), this;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
L.prefix = "ui-resizable-";
|
|
1317
|
+
class S {
|
|
1318
|
+
constructor() {
|
|
1319
|
+
this._eventRegister = {};
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* Returns the current disabled state.
|
|
1323
|
+
* Note: Use enable()/disable() methods to change state as other operations need to happen.
|
|
1324
|
+
*/
|
|
1325
|
+
get disabled() {
|
|
1326
|
+
return this._disabled;
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* Register an event callback for the specified event.
|
|
1330
|
+
*
|
|
1331
|
+
* @param event - Event name to listen for
|
|
1332
|
+
* @param callback - Function to call when event occurs
|
|
1333
|
+
*/
|
|
1334
|
+
on(t, e) {
|
|
1335
|
+
this._eventRegister[t] = e;
|
|
1336
|
+
}
|
|
1337
|
+
/**
|
|
1338
|
+
* Unregister an event callback for the specified event.
|
|
1339
|
+
*
|
|
1340
|
+
* @param event - Event name to stop listening for
|
|
1341
|
+
*/
|
|
1342
|
+
off(t) {
|
|
1343
|
+
delete this._eventRegister[t];
|
|
1344
|
+
}
|
|
1345
|
+
/**
|
|
1346
|
+
* Enable this drag & drop implementation.
|
|
1347
|
+
* Subclasses should override to perform additional setup.
|
|
1348
|
+
*/
|
|
1349
|
+
enable() {
|
|
1350
|
+
this._disabled = !1;
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* Disable this drag & drop implementation.
|
|
1354
|
+
* Subclasses should override to perform additional cleanup.
|
|
1355
|
+
*/
|
|
1356
|
+
disable() {
|
|
1357
|
+
this._disabled = !0;
|
|
1358
|
+
}
|
|
1359
|
+
/**
|
|
1360
|
+
* Destroy this drag & drop implementation and clean up resources.
|
|
1361
|
+
* Removes all event handlers and clears internal state.
|
|
1362
|
+
*/
|
|
1363
|
+
destroy() {
|
|
1364
|
+
delete this._eventRegister;
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* Trigger a registered event callback if one exists and the implementation is enabled.
|
|
1368
|
+
*
|
|
1369
|
+
* @param eventName - Name of the event to trigger
|
|
1370
|
+
* @param event - DOM event object to pass to the callback
|
|
1371
|
+
* @returns Result from the callback function, if any
|
|
1372
|
+
*/
|
|
1373
|
+
triggerEvent(t, e) {
|
|
1374
|
+
if (!this.disabled && this._eventRegister && this._eventRegister[t])
|
|
1375
|
+
return this._eventRegister[t](e);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
class R extends S {
|
|
1379
|
+
// have to be public else complains for HTMLElementExtendOpt ?
|
|
1380
|
+
constructor(t, e = {}) {
|
|
1381
|
+
super(), this.el = t, this.option = e, this.rectScale = { x: 1, y: 1 }, this._ui = () => {
|
|
1382
|
+
const s = this.el.parentElement.getBoundingClientRect(), r = {
|
|
1383
|
+
width: this.originalRect.width,
|
|
1384
|
+
height: this.originalRect.height + this.scrolled,
|
|
1385
|
+
left: this.originalRect.left,
|
|
1386
|
+
top: this.originalRect.top - this.scrolled
|
|
1387
|
+
}, n = this.temporalRect || r;
|
|
1388
|
+
return {
|
|
1389
|
+
position: {
|
|
1390
|
+
left: (n.left - s.left) * this.rectScale.x,
|
|
1391
|
+
top: (n.top - s.top) * this.rectScale.y
|
|
1392
|
+
},
|
|
1393
|
+
size: {
|
|
1394
|
+
width: n.width * this.rectScale.x,
|
|
1395
|
+
height: n.height * this.rectScale.y
|
|
1396
|
+
}
|
|
1397
|
+
/* Gridstack ONLY needs position set above... keep around in case.
|
|
1398
|
+
element: [this.el], // The object representing the element to be resized
|
|
1399
|
+
helper: [], // TODO: not support yet - The object representing the helper that's being resized
|
|
1400
|
+
originalElement: [this.el],// we don't wrap here, so simplify as this.el //The object representing the original element before it is wrapped
|
|
1401
|
+
originalPosition: { // The position represented as { left, top } before the resizable is resized
|
|
1402
|
+
left: this.originalRect.left - containmentRect.left,
|
|
1403
|
+
top: this.originalRect.top - containmentRect.top
|
|
1404
|
+
},
|
|
1405
|
+
originalSize: { // The size represented as { width, height } before the resizable is resized
|
|
1406
|
+
width: this.originalRect.width,
|
|
1407
|
+
height: this.originalRect.height
|
|
1408
|
+
}
|
|
1409
|
+
*/
|
|
1410
|
+
};
|
|
1411
|
+
}, this._mouseOver = this._mouseOver.bind(this), this._mouseOut = this._mouseOut.bind(this), this.enable(), this._setupAutoHide(this.option.autoHide), this._setupHandlers();
|
|
1412
|
+
}
|
|
1413
|
+
on(t, e) {
|
|
1414
|
+
super.on(t, e);
|
|
1415
|
+
}
|
|
1416
|
+
off(t) {
|
|
1417
|
+
super.off(t);
|
|
1418
|
+
}
|
|
1419
|
+
enable() {
|
|
1420
|
+
super.enable(), this.el.classList.remove("ui-resizable-disabled"), this._setupAutoHide(this.option.autoHide);
|
|
1421
|
+
}
|
|
1422
|
+
disable() {
|
|
1423
|
+
super.disable(), this.el.classList.add("ui-resizable-disabled"), this._setupAutoHide(!1);
|
|
1424
|
+
}
|
|
1425
|
+
destroy() {
|
|
1426
|
+
this._removeHandlers(), this._setupAutoHide(!1), delete this.el, super.destroy();
|
|
1427
|
+
}
|
|
1428
|
+
updateOption(t) {
|
|
1429
|
+
const e = t.handles && t.handles !== this.option.handles, i = t.autoHide && t.autoHide !== this.option.autoHide;
|
|
1430
|
+
return Object.keys(t).forEach((s) => this.option[s] = t[s]), e && (this._removeHandlers(), this._setupHandlers()), i && this._setupAutoHide(this.option.autoHide), this;
|
|
1431
|
+
}
|
|
1432
|
+
/** @internal turns auto hide on/off */
|
|
1433
|
+
_setupAutoHide(t) {
|
|
1434
|
+
return t ? (this.el.classList.add("ui-resizable-autohide"), this.el.addEventListener("mouseover", this._mouseOver), this.el.addEventListener("mouseout", this._mouseOut)) : (this.el.classList.remove("ui-resizable-autohide"), this.el.removeEventListener("mouseover", this._mouseOver), this.el.removeEventListener("mouseout", this._mouseOut), f.overResizeElement === this && delete f.overResizeElement), this;
|
|
1435
|
+
}
|
|
1436
|
+
/** @internal */
|
|
1437
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1438
|
+
_mouseOver(t) {
|
|
1439
|
+
f.overResizeElement || f.dragElement || (f.overResizeElement = this, this.el.classList.remove("ui-resizable-autohide"));
|
|
1440
|
+
}
|
|
1441
|
+
/** @internal */
|
|
1442
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1443
|
+
_mouseOut(t) {
|
|
1444
|
+
f.overResizeElement === this && (delete f.overResizeElement, this.el.classList.add("ui-resizable-autohide"));
|
|
1445
|
+
}
|
|
1446
|
+
/** @internal */
|
|
1447
|
+
_setupHandlers() {
|
|
1448
|
+
return this.handlers = this.option.handles.split(",").map((t) => t.trim()).map((t) => new L(this.el, t, {
|
|
1449
|
+
element: this.option.element,
|
|
1450
|
+
start: (e) => this._resizeStart(e),
|
|
1451
|
+
stop: (e) => this._resizeStop(e),
|
|
1452
|
+
move: (e) => this._resizing(e, t)
|
|
1453
|
+
})), this;
|
|
1454
|
+
}
|
|
1455
|
+
/** @internal */
|
|
1456
|
+
_resizeStart(t) {
|
|
1457
|
+
this.sizeToContent = h.shouldSizeToContent(this.el.gridstackNode, !0), this.originalRect = this.el.getBoundingClientRect(), this.scrollEl = h.getScrollElement(this.el), this.scrollY = this.scrollEl.scrollTop, this.scrolled = 0, this.startEvent = t, this._setupHelper(), this._applyChange();
|
|
1458
|
+
const e = h.initEvent(t, { type: "resizestart", target: this.el });
|
|
1459
|
+
return this.option.start && this.option.start(e, this._ui()), this.el.classList.add("ui-resizable-resizing"), this.triggerEvent("resizestart", e), this;
|
|
1460
|
+
}
|
|
1461
|
+
/** @internal */
|
|
1462
|
+
_resizing(t, e) {
|
|
1463
|
+
this.scrolled = this.scrollEl.scrollTop - this.scrollY, this.temporalRect = this._getChange(t, e), this._applyChange();
|
|
1464
|
+
const i = h.initEvent(t, { type: "resize", target: this.el });
|
|
1465
|
+
return this.option.resize && this.option.resize(i, this._ui()), this.triggerEvent("resize", i), this;
|
|
1466
|
+
}
|
|
1467
|
+
/** @internal */
|
|
1468
|
+
_resizeStop(t) {
|
|
1469
|
+
const e = h.initEvent(t, { type: "resizestop", target: this.el });
|
|
1470
|
+
return this._cleanHelper(), this.option.stop && this.option.stop(e), this.el.classList.remove("ui-resizable-resizing"), this.triggerEvent("resizestop", e), delete this.startEvent, delete this.originalRect, delete this.temporalRect, delete this.scrollY, delete this.scrolled, this;
|
|
1471
|
+
}
|
|
1472
|
+
/** @internal */
|
|
1473
|
+
_setupHelper() {
|
|
1474
|
+
this.elOriginStyleVal = R._originStyleProp.map((i) => this.el.style[i]), this.parentOriginStylePosition = this.el.parentElement.style.position;
|
|
1475
|
+
const t = this.el.parentElement, e = h.getValuesFromTransformedElement(t);
|
|
1476
|
+
return this.rectScale = {
|
|
1477
|
+
x: e.xScale,
|
|
1478
|
+
y: e.yScale
|
|
1479
|
+
}, getComputedStyle(this.el.parentElement).position.match(/static/) && (this.el.parentElement.style.position = "relative"), this.el.style.position = "absolute", this.el.style.opacity = "0.8", this;
|
|
1480
|
+
}
|
|
1481
|
+
/** @internal */
|
|
1482
|
+
_cleanHelper() {
|
|
1483
|
+
return R._originStyleProp.forEach((t, e) => {
|
|
1484
|
+
this.el.style[t] = this.elOriginStyleVal[e] || null;
|
|
1485
|
+
}), this.el.parentElement.style.position = this.parentOriginStylePosition || null, this;
|
|
1486
|
+
}
|
|
1487
|
+
/** @internal */
|
|
1488
|
+
_getChange(t, e) {
|
|
1489
|
+
const i = this.startEvent, s = {
|
|
1490
|
+
width: this.originalRect.width,
|
|
1491
|
+
height: this.originalRect.height + this.scrolled,
|
|
1492
|
+
left: this.originalRect.left,
|
|
1493
|
+
top: this.originalRect.top - this.scrolled
|
|
1494
|
+
}, r = t.clientX - i.clientX, n = this.sizeToContent ? 0 : t.clientY - i.clientY;
|
|
1495
|
+
let o, d;
|
|
1496
|
+
e.indexOf("e") > -1 ? s.width += r : e.indexOf("w") > -1 && (s.width -= r, s.left += r, o = !0), e.indexOf("s") > -1 ? s.height += n : e.indexOf("n") > -1 && (s.height -= n, s.top += n, d = !0);
|
|
1497
|
+
const l = this._constrainSize(s.width, s.height, o, d);
|
|
1498
|
+
return Math.round(s.width) !== Math.round(l.width) && (e.indexOf("w") > -1 && (s.left += s.width - l.width), s.width = l.width), Math.round(s.height) !== Math.round(l.height) && (e.indexOf("n") > -1 && (s.top += s.height - l.height), s.height = l.height), s;
|
|
1499
|
+
}
|
|
1500
|
+
/** @internal constrain the size to the set min/max values */
|
|
1501
|
+
_constrainSize(t, e, i, s) {
|
|
1502
|
+
const r = this.option, n = (i ? r.maxWidthMoveLeft : r.maxWidth) || Number.MAX_SAFE_INTEGER, o = r.minWidth / this.rectScale.x || t, d = (s ? r.maxHeightMoveUp : r.maxHeight) || Number.MAX_SAFE_INTEGER, l = r.minHeight / this.rectScale.y || e, a = Math.min(n, Math.max(o, t)), u = Math.min(d, Math.max(l, e));
|
|
1503
|
+
return { width: a, height: u };
|
|
1504
|
+
}
|
|
1505
|
+
/** @internal */
|
|
1506
|
+
_applyChange() {
|
|
1507
|
+
let t = { left: 0, top: 0, width: 0, height: 0 };
|
|
1508
|
+
if (this.el.style.position === "absolute") {
|
|
1509
|
+
const e = this.el.parentElement, { left: i, top: s } = e.getBoundingClientRect();
|
|
1510
|
+
t = { left: i, top: s, width: 0, height: 0 };
|
|
1511
|
+
}
|
|
1512
|
+
return this.temporalRect ? (Object.keys(this.temporalRect).forEach((e) => {
|
|
1513
|
+
const i = this.temporalRect[e], s = e === "width" || e === "left" ? this.rectScale.x : e === "height" || e === "top" ? this.rectScale.y : 1;
|
|
1514
|
+
this.el.style[e] = (i - t[e]) * s + "px";
|
|
1515
|
+
}), this) : this;
|
|
1516
|
+
}
|
|
1517
|
+
/** @internal */
|
|
1518
|
+
_removeHandlers() {
|
|
1519
|
+
return this.handlers.forEach((t) => t.destroy()), delete this.handlers, this;
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
R._originStyleProp = ["width", "height", "position", "left", "top", "opacity", "zIndex"];
|
|
1523
|
+
const F = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';
|
|
1524
|
+
class z extends S {
|
|
1525
|
+
constructor(t, e = {}) {
|
|
1526
|
+
super(), this.el = t, this.option = e, this.dragTransform = {
|
|
1527
|
+
xScale: 1,
|
|
1528
|
+
yScale: 1,
|
|
1529
|
+
xOffset: 0,
|
|
1530
|
+
yOffset: 0
|
|
1531
|
+
};
|
|
1532
|
+
const i = e?.handle?.substring(1), s = t.gridstackNode;
|
|
1533
|
+
this.dragEls = !i || t.classList.contains(i) ? [t] : s?.subGrid ? [t.querySelector(e.handle) || t] : Array.from(t.querySelectorAll(e.handle)), this.dragEls.length === 0 && (this.dragEls = [t]), this._mouseDown = this._mouseDown.bind(this), this._mouseMove = this._mouseMove.bind(this), this._mouseUp = this._mouseUp.bind(this), this._keyEvent = this._keyEvent.bind(this), this.enable();
|
|
1534
|
+
}
|
|
1535
|
+
on(t, e) {
|
|
1536
|
+
super.on(t, e);
|
|
1537
|
+
}
|
|
1538
|
+
off(t) {
|
|
1539
|
+
super.off(t);
|
|
1540
|
+
}
|
|
1541
|
+
enable() {
|
|
1542
|
+
this.disabled !== !1 && (super.enable(), this.dragEls.forEach((t) => {
|
|
1543
|
+
t.addEventListener("mousedown", this._mouseDown), b && (t.addEventListener("touchstart", N), t.addEventListener("pointerdown", k));
|
|
1544
|
+
}), this.el.classList.remove("ui-draggable-disabled"));
|
|
1545
|
+
}
|
|
1546
|
+
disable(t = !1) {
|
|
1547
|
+
this.disabled !== !0 && (super.disable(), this.dragEls.forEach((e) => {
|
|
1548
|
+
e.removeEventListener("mousedown", this._mouseDown), b && (e.removeEventListener("touchstart", N), e.removeEventListener("pointerdown", k));
|
|
1549
|
+
}), t || this.el.classList.add("ui-draggable-disabled"));
|
|
1550
|
+
}
|
|
1551
|
+
destroy() {
|
|
1552
|
+
this.dragTimeout && window.clearTimeout(this.dragTimeout), delete this.dragTimeout, this.mouseDownEvent && this._mouseUp(this.mouseDownEvent), this.disable(!0), delete this.el, delete this.helper, delete this.option, super.destroy();
|
|
1553
|
+
}
|
|
1554
|
+
updateOption(t) {
|
|
1555
|
+
return Object.keys(t).forEach((e) => this.option[e] = t[e]), this;
|
|
1556
|
+
}
|
|
1557
|
+
/** @internal call when mouse goes down before a dragstart happens */
|
|
1558
|
+
_mouseDown(t) {
|
|
1559
|
+
if (w.touchHandled && t.isTrusted && (w.touchHandled = !1), !f.mouseHandled)
|
|
1560
|
+
return t.button !== 0 || !this.dragEls.find((e) => e === t.target) && t.target.closest(F) || this.option.cancel && t.target.closest(this.option.cancel) || (this.mouseDownEvent = t, delete this.dragging, delete f.dragElement, delete f.dropElement, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), b && (t.currentTarget.addEventListener("touchmove", H), t.currentTarget.addEventListener("touchend", T)), t.preventDefault(), document.activeElement && document.activeElement.blur(), f.mouseHandled = !0), !0;
|
|
1561
|
+
}
|
|
1562
|
+
/** @internal method to call actual drag event */
|
|
1563
|
+
_callDrag(t) {
|
|
1564
|
+
if (!this.dragging)
|
|
1565
|
+
return;
|
|
1566
|
+
const e = h.initEvent(t, { target: this.el, type: "drag" });
|
|
1567
|
+
this.option.drag && this.option.drag(e, this.ui()), this.triggerEvent("drag", e);
|
|
1568
|
+
}
|
|
1569
|
+
/** @internal called when the main page (after successful mousedown) receives a move event to drag the item around the screen */
|
|
1570
|
+
_mouseMove(t) {
|
|
1571
|
+
const e = this.mouseDownEvent;
|
|
1572
|
+
if (this.lastDrag = t, this.dragging)
|
|
1573
|
+
if (this._dragFollow(t), f.pauseDrag) {
|
|
1574
|
+
const i = Number.isInteger(f.pauseDrag) ? f.pauseDrag : 100;
|
|
1575
|
+
this.dragTimeout && window.clearTimeout(this.dragTimeout), this.dragTimeout = window.setTimeout(() => this._callDrag(t), i);
|
|
1576
|
+
} else
|
|
1577
|
+
this._callDrag(t);
|
|
1578
|
+
else if (Math.abs(t.x - e.x) + Math.abs(t.y - e.y) > 3) {
|
|
1579
|
+
this.dragging = !0, f.dragElement = this;
|
|
1580
|
+
const i = this.el.gridstackNode?.grid;
|
|
1581
|
+
i ? f.dropElement = i.el.ddElement.ddDroppable : delete f.dropElement, this.helper = this._createHelper(), this._setupHelperContainmentStyle(), this.dragTransform = h.getValuesFromTransformedElement(this.helperContainment), this.dragOffset = this._getDragOffset(t, this.el, this.helperContainment), this._setupHelperStyle(t);
|
|
1582
|
+
const s = h.initEvent(t, { target: this.el, type: "dragstart" });
|
|
1583
|
+
this.option.start && this.option.start(s, this.ui()), this.triggerEvent("dragstart", s), document.addEventListener("keydown", this._keyEvent);
|
|
1584
|
+
}
|
|
1585
|
+
return !0;
|
|
1586
|
+
}
|
|
1587
|
+
/** @internal call when the mouse gets released to drop the item at current location */
|
|
1588
|
+
_mouseUp(t) {
|
|
1589
|
+
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), b && t.currentTarget && (t.currentTarget.removeEventListener("touchmove", H, !0), t.currentTarget.removeEventListener("touchend", T, !0)), this.dragging) {
|
|
1590
|
+
delete this.dragging, delete this.el.gridstackNode?._origRotate, document.removeEventListener("keydown", this._keyEvent), f.dropElement?.el === this.el.parentElement && delete f.dropElement, this.helperContainment.style.position = this.parentOriginStylePosition || null, this.helper !== this.el && this.helper.remove(), this._removeHelperStyle();
|
|
1591
|
+
const e = h.initEvent(t, { target: this.el, type: "dragstop" });
|
|
1592
|
+
this.option.stop && this.option.stop(e), this.triggerEvent("dragstop", e), f.dropElement && f.dropElement.drop(t);
|
|
1593
|
+
}
|
|
1594
|
+
delete this.helper, delete this.mouseDownEvent, delete f.dragElement, delete f.dropElement, delete f.mouseHandled, t.preventDefault();
|
|
1595
|
+
}
|
|
1596
|
+
/** @internal call when keys are being pressed - use Esc to cancel, R to rotate */
|
|
1597
|
+
_keyEvent(t) {
|
|
1598
|
+
const e = this.el.gridstackNode, i = e?.grid || f.dropElement?.el?.gridstack;
|
|
1599
|
+
if (t.key === "Escape")
|
|
1600
|
+
e && e._origRotate && (e._orig = e._origRotate, delete e._origRotate), i?.cancelDrag(), this._mouseUp(this.mouseDownEvent);
|
|
1601
|
+
else if (e && i && (t.key === "r" || t.key === "R")) {
|
|
1602
|
+
if (!h.canBeRotated(e))
|
|
1603
|
+
return;
|
|
1604
|
+
e._origRotate = e._origRotate || { ...e._orig }, delete e._moving, i.setAnimation(!1).rotate(e.el, { top: -this.dragOffset.offsetTop, left: -this.dragOffset.offsetLeft }).setAnimation(), e._moving = !0, this.dragOffset = this._getDragOffset(this.lastDrag, e.el, this.helperContainment), this.helper.style.width = this.dragOffset.width + "px", this.helper.style.height = this.dragOffset.height + "px", h.swap(e._orig, "w", "h"), delete e._rect, this._mouseMove(this.lastDrag);
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
/** @internal create a clone copy (or user defined method) of the original drag item if set */
|
|
1608
|
+
_createHelper() {
|
|
1609
|
+
let t = this.el;
|
|
1610
|
+
return typeof this.option.helper == "function" ? t = this.option.helper(this.el) : this.option.helper === "clone" && (t = h.cloneNode(this.el)), t.parentElement || h.appendTo(t, this.option.appendTo === "parent" ? this.el.parentElement : this.option.appendTo), this.dragElementOriginStyle = z.originStyleProp.map((e) => this.el.style[e]), t;
|
|
1611
|
+
}
|
|
1612
|
+
/** @internal set the fix position of the dragged item */
|
|
1613
|
+
_setupHelperStyle(t) {
|
|
1614
|
+
this.helper.classList.add("ui-draggable-dragging"), this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");
|
|
1615
|
+
const e = this.helper.style;
|
|
1616
|
+
return e.pointerEvents = "none", e.width = this.dragOffset.width + "px", e.height = this.dragOffset.height + "px", e.willChange = "left, top", e.position = "fixed", this._dragFollow(t), e.transition = "none", setTimeout(() => {
|
|
1617
|
+
this.helper && (e.transition = null);
|
|
1618
|
+
}, 0), this;
|
|
1619
|
+
}
|
|
1620
|
+
/** @internal restore back the original style before dragging */
|
|
1621
|
+
_removeHelperStyle() {
|
|
1622
|
+
if (this.helper.classList.remove("ui-draggable-dragging"), this.el.gridstackNode?.grid?.el.classList.remove("grid-stack-dragging"), !this.helper?.gridstackNode?._isAboutToRemove && this.dragElementOriginStyle) {
|
|
1623
|
+
const e = this.helper, i = this.dragElementOriginStyle.transition || null;
|
|
1624
|
+
e.style.transition = this.dragElementOriginStyle.transition = "none", z.originStyleProp.forEach((s) => e.style[s] = this.dragElementOriginStyle[s] || null), setTimeout(() => e.style.transition = i, 50);
|
|
1625
|
+
}
|
|
1626
|
+
return delete this.dragElementOriginStyle, this;
|
|
1627
|
+
}
|
|
1628
|
+
/** @internal updates the top/left position to follow the mouse */
|
|
1629
|
+
_dragFollow(t) {
|
|
1630
|
+
const e = { left: 0, top: 0 }, i = this.helper.style, s = this.dragOffset;
|
|
1631
|
+
i.left = (t.clientX + s.offsetLeft - e.left) * this.dragTransform.xScale + "px", i.top = (t.clientY + s.offsetTop - e.top) * this.dragTransform.yScale + "px";
|
|
1632
|
+
}
|
|
1633
|
+
/** @internal */
|
|
1634
|
+
_setupHelperContainmentStyle() {
|
|
1635
|
+
return this.helperContainment = this.helper.parentElement, this.helper.style.position !== "fixed" && (this.parentOriginStylePosition = this.helperContainment.style.position, getComputedStyle(this.helperContainment).position.match(/static/) && (this.helperContainment.style.position = "relative")), this;
|
|
1636
|
+
}
|
|
1637
|
+
/** @internal */
|
|
1638
|
+
_getDragOffset(t, e, i) {
|
|
1639
|
+
let s = 0, r = 0;
|
|
1640
|
+
i && (s = this.dragTransform.xOffset, r = this.dragTransform.yOffset);
|
|
1641
|
+
const n = e.getBoundingClientRect();
|
|
1642
|
+
return {
|
|
1643
|
+
left: n.left,
|
|
1644
|
+
top: n.top,
|
|
1645
|
+
offsetLeft: -t.clientX + n.left - s,
|
|
1646
|
+
offsetTop: -t.clientY + n.top - r,
|
|
1647
|
+
width: n.width * this.dragTransform.xScale,
|
|
1648
|
+
height: n.height * this.dragTransform.yScale
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1651
|
+
/** @internal TODO: set to public as called by DDDroppable! */
|
|
1652
|
+
ui() {
|
|
1653
|
+
const e = this.el.parentElement.getBoundingClientRect(), i = this.helper.getBoundingClientRect();
|
|
1654
|
+
return {
|
|
1655
|
+
position: {
|
|
1656
|
+
top: (i.top - e.top) * this.dragTransform.yScale,
|
|
1657
|
+
left: (i.left - e.left) * this.dragTransform.xScale
|
|
1658
|
+
}
|
|
1659
|
+
/* not used by GridStack for now...
|
|
1660
|
+
helper: [this.helper], //The object arr representing the helper that's being dragged.
|
|
1661
|
+
offset: { top: offset.top, left: offset.left } // Current offset position of the helper as { top, left } object.
|
|
1662
|
+
*/
|
|
1663
|
+
};
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
z.originStyleProp = ["width", "height", "transform", "transform-origin", "transition", "pointerEvents", "position", "left", "top", "minWidth", "willChange"];
|
|
1667
|
+
class Y extends S {
|
|
1668
|
+
constructor(t, e = {}) {
|
|
1669
|
+
super(), this.el = t, this.option = e, this._mouseEnter = this._mouseEnter.bind(this), this._mouseLeave = this._mouseLeave.bind(this), this.enable(), this._setupAccept();
|
|
1670
|
+
}
|
|
1671
|
+
on(t, e) {
|
|
1672
|
+
super.on(t, e);
|
|
1673
|
+
}
|
|
1674
|
+
off(t) {
|
|
1675
|
+
super.off(t);
|
|
1676
|
+
}
|
|
1677
|
+
enable() {
|
|
1678
|
+
this.disabled !== !1 && (super.enable(), this.el.classList.add("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), this.el.addEventListener("mouseenter", this._mouseEnter), this.el.addEventListener("mouseleave", this._mouseLeave), b && (this.el.addEventListener("pointerenter", B), this.el.addEventListener("pointerleave", W)));
|
|
1679
|
+
}
|
|
1680
|
+
disable(t = !1) {
|
|
1681
|
+
this.disabled !== !0 && (super.disable(), this.el.classList.remove("ui-droppable"), t || this.el.classList.add("ui-droppable-disabled"), this.el.removeEventListener("mouseenter", this._mouseEnter), this.el.removeEventListener("mouseleave", this._mouseLeave), b && (this.el.removeEventListener("pointerenter", B), this.el.removeEventListener("pointerleave", W)));
|
|
1682
|
+
}
|
|
1683
|
+
destroy() {
|
|
1684
|
+
this.disable(!0), this.el.classList.remove("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), super.destroy();
|
|
1685
|
+
}
|
|
1686
|
+
updateOption(t) {
|
|
1687
|
+
return Object.keys(t).forEach((e) => this.option[e] = t[e]), this._setupAccept(), this;
|
|
1688
|
+
}
|
|
1689
|
+
/** @internal called when the cursor enters our area - prepare for a possible drop and track leaving */
|
|
1690
|
+
_mouseEnter(t) {
|
|
1691
|
+
if (!f.dragElement || w.touchHandled && t.isTrusted || !this._canDrop(f.dragElement.el))
|
|
1692
|
+
return;
|
|
1693
|
+
t.preventDefault(), t.stopPropagation(), f.dropElement && f.dropElement !== this && f.dropElement._mouseLeave(t, !0), f.dropElement = this;
|
|
1694
|
+
const e = h.initEvent(t, { target: this.el, type: "dropover" });
|
|
1695
|
+
this.option.over && this.option.over(e, this._ui(f.dragElement)), this.triggerEvent("dropover", e), this.el.classList.add("ui-droppable-over");
|
|
1696
|
+
}
|
|
1697
|
+
/** @internal called when the item is leaving our area, stop tracking if we had moving item */
|
|
1698
|
+
_mouseLeave(t, e = !1) {
|
|
1699
|
+
if (!f.dragElement || f.dropElement !== this)
|
|
1700
|
+
return;
|
|
1701
|
+
t.preventDefault(), t.stopPropagation();
|
|
1702
|
+
const i = h.initEvent(t, { target: this.el, type: "dropout" });
|
|
1703
|
+
if (this.option.out && this.option.out(i, this._ui(f.dragElement)), this.triggerEvent("dropout", i), f.dropElement === this && (delete f.dropElement, !e)) {
|
|
1704
|
+
let s, r = this.el.parentElement;
|
|
1705
|
+
for (; !s && r; )
|
|
1706
|
+
s = r.ddElement?.ddDroppable, r = r.parentElement;
|
|
1707
|
+
s && s._mouseEnter(t);
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
/** item is being dropped on us - called by the drag mouseup handler - this calls the client drop event */
|
|
1711
|
+
drop(t) {
|
|
1712
|
+
t.preventDefault();
|
|
1713
|
+
const e = h.initEvent(t, { target: this.el, type: "drop" });
|
|
1714
|
+
this.option.drop && this.option.drop(e, this._ui(f.dragElement)), this.triggerEvent("drop", e);
|
|
1715
|
+
}
|
|
1716
|
+
/** @internal true if element matches the string/method accept option */
|
|
1717
|
+
_canDrop(t) {
|
|
1718
|
+
return t && (!this.accept || this.accept(t));
|
|
1719
|
+
}
|
|
1720
|
+
/** @internal */
|
|
1721
|
+
_setupAccept() {
|
|
1722
|
+
return this.option.accept ? (typeof this.option.accept == "string" ? this.accept = (t) => t.classList.contains(this.option.accept) || t.matches(this.option.accept) : this.accept = this.option.accept, this) : this;
|
|
1723
|
+
}
|
|
1724
|
+
/** @internal */
|
|
1725
|
+
_ui(t) {
|
|
1726
|
+
return {
|
|
1727
|
+
draggable: t.el,
|
|
1728
|
+
...t.ui()
|
|
1729
|
+
};
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
class P {
|
|
1733
|
+
static init(t) {
|
|
1734
|
+
return t.ddElement || (t.ddElement = new P(t)), t.ddElement;
|
|
1735
|
+
}
|
|
1736
|
+
constructor(t) {
|
|
1737
|
+
this.el = t;
|
|
1738
|
+
}
|
|
1739
|
+
on(t, e) {
|
|
1740
|
+
return this.ddDraggable && ["drag", "dragstart", "dragstop"].indexOf(t) > -1 ? this.ddDraggable.on(t, e) : this.ddDroppable && ["drop", "dropover", "dropout"].indexOf(t) > -1 ? this.ddDroppable.on(t, e) : this.ddResizable && ["resizestart", "resize", "resizestop"].indexOf(t) > -1 && this.ddResizable.on(t, e), this;
|
|
1741
|
+
}
|
|
1742
|
+
off(t) {
|
|
1743
|
+
return this.ddDraggable && ["drag", "dragstart", "dragstop"].indexOf(t) > -1 ? this.ddDraggable.off(t) : this.ddDroppable && ["drop", "dropover", "dropout"].indexOf(t) > -1 ? this.ddDroppable.off(t) : this.ddResizable && ["resizestart", "resize", "resizestop"].indexOf(t) > -1 && this.ddResizable.off(t), this;
|
|
1744
|
+
}
|
|
1745
|
+
setupDraggable(t) {
|
|
1746
|
+
return this.ddDraggable ? this.ddDraggable.updateOption(t) : this.ddDraggable = new z(this.el, t), this;
|
|
1747
|
+
}
|
|
1748
|
+
cleanDraggable() {
|
|
1749
|
+
return this.ddDraggable && (this.ddDraggable.destroy(), delete this.ddDraggable), this;
|
|
1750
|
+
}
|
|
1751
|
+
setupResizable(t) {
|
|
1752
|
+
return this.ddResizable ? this.ddResizable.updateOption(t) : this.ddResizable = new R(this.el, t), this;
|
|
1753
|
+
}
|
|
1754
|
+
cleanResizable() {
|
|
1755
|
+
return this.ddResizable && (this.ddResizable.destroy(), delete this.ddResizable), this;
|
|
1756
|
+
}
|
|
1757
|
+
setupDroppable(t) {
|
|
1758
|
+
return this.ddDroppable ? this.ddDroppable.updateOption(t) : this.ddDroppable = new Y(this.el, t), this;
|
|
1759
|
+
}
|
|
1760
|
+
cleanDroppable() {
|
|
1761
|
+
return this.ddDroppable && (this.ddDroppable.destroy(), delete this.ddDroppable), this;
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
class q {
|
|
1765
|
+
/**
|
|
1766
|
+
* Enable/disable/configure resizing for grid elements.
|
|
1767
|
+
*
|
|
1768
|
+
* @param el - Grid item element(s) to configure
|
|
1769
|
+
* @param opts - Resize options or command ('enable', 'disable', 'destroy', 'option', or config object)
|
|
1770
|
+
* @param key - Option key when using 'option' command
|
|
1771
|
+
* @param value - Option value when using 'option' command
|
|
1772
|
+
* @returns this instance for chaining
|
|
1773
|
+
*
|
|
1774
|
+
* @example
|
|
1775
|
+
* dd.resizable(element, 'enable'); // Enable resizing
|
|
1776
|
+
* dd.resizable(element, 'option', 'minWidth', 100); // Set minimum width
|
|
1777
|
+
*/
|
|
1778
|
+
resizable(t, e, i, s) {
|
|
1779
|
+
return this._getDDElements(t, e).forEach((r) => {
|
|
1780
|
+
if (e === "disable" || e === "enable")
|
|
1781
|
+
r.ddResizable && r.ddResizable[e]();
|
|
1782
|
+
else if (e === "destroy")
|
|
1783
|
+
r.ddResizable && r.cleanResizable();
|
|
1784
|
+
else if (e === "option")
|
|
1785
|
+
r.setupResizable({ [i]: s });
|
|
1786
|
+
else {
|
|
1787
|
+
const o = r.el.gridstackNode.grid;
|
|
1788
|
+
let d = r.el.getAttribute("gs-resize-handles") || o.opts.resizable.handles || "e,s,se";
|
|
1789
|
+
d === "all" && (d = "n,e,s,w,se,sw,ne,nw");
|
|
1790
|
+
const l = !o.opts.alwaysShowResizeHandle;
|
|
1791
|
+
r.setupResizable({
|
|
1792
|
+
...o.opts.resizable,
|
|
1793
|
+
handles: d,
|
|
1794
|
+
autoHide: l,
|
|
1795
|
+
start: e.start,
|
|
1796
|
+
stop: e.stop,
|
|
1797
|
+
resize: e.resize
|
|
1798
|
+
});
|
|
1799
|
+
}
|
|
1800
|
+
}), this;
|
|
1801
|
+
}
|
|
1802
|
+
/**
|
|
1803
|
+
* Enable/disable/configure dragging for grid elements.
|
|
1804
|
+
*
|
|
1805
|
+
* @param el - Grid item element(s) to configure
|
|
1806
|
+
* @param opts - Drag options or command ('enable', 'disable', 'destroy', 'option', or config object)
|
|
1807
|
+
* @param key - Option key when using 'option' command
|
|
1808
|
+
* @param value - Option value when using 'option' command
|
|
1809
|
+
* @returns this instance for chaining
|
|
1810
|
+
*
|
|
1811
|
+
* @example
|
|
1812
|
+
* dd.draggable(element, 'enable'); // Enable dragging
|
|
1813
|
+
* dd.draggable(element, {handle: '.drag-handle'}); // Configure drag handle
|
|
1814
|
+
*/
|
|
1815
|
+
draggable(t, e, i, s) {
|
|
1816
|
+
return this._getDDElements(t, e).forEach((r) => {
|
|
1817
|
+
if (e === "disable" || e === "enable")
|
|
1818
|
+
r.ddDraggable && r.ddDraggable[e]();
|
|
1819
|
+
else if (e === "destroy")
|
|
1820
|
+
r.ddDraggable && r.cleanDraggable();
|
|
1821
|
+
else if (e === "option")
|
|
1822
|
+
r.setupDraggable({ [i]: s });
|
|
1823
|
+
else {
|
|
1824
|
+
const n = r.el.gridstackNode.grid;
|
|
1825
|
+
r.setupDraggable({
|
|
1826
|
+
...n.opts.draggable,
|
|
1827
|
+
// containment: (grid.parentGridNode && grid.opts.dragOut === false) ? grid.el.parentElement : (grid.opts.draggable.containment || null),
|
|
1828
|
+
start: e.start,
|
|
1829
|
+
stop: e.stop,
|
|
1830
|
+
drag: e.drag
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
}), this;
|
|
1834
|
+
}
|
|
1835
|
+
dragIn(t, e) {
|
|
1836
|
+
return this._getDDElements(t).forEach((i) => i.setupDraggable(e)), this;
|
|
1837
|
+
}
|
|
1838
|
+
droppable(t, e, i, s) {
|
|
1839
|
+
return typeof e.accept == "function" && !e._accept && (e._accept = e.accept, e.accept = (r) => e._accept(r)), this._getDDElements(t, e).forEach((r) => {
|
|
1840
|
+
e === "disable" || e === "enable" ? r.ddDroppable && r.ddDroppable[e]() : e === "destroy" ? r.ddDroppable && r.cleanDroppable() : e === "option" ? r.setupDroppable({ [i]: s }) : r.setupDroppable(e);
|
|
1841
|
+
}), this;
|
|
1842
|
+
}
|
|
1843
|
+
/** true if element is droppable */
|
|
1844
|
+
isDroppable(t) {
|
|
1845
|
+
return !!(t?.ddElement?.ddDroppable && !t.ddElement.ddDroppable.disabled);
|
|
1846
|
+
}
|
|
1847
|
+
/** true if element is draggable */
|
|
1848
|
+
isDraggable(t) {
|
|
1849
|
+
return !!(t?.ddElement?.ddDraggable && !t.ddElement.ddDraggable.disabled);
|
|
1850
|
+
}
|
|
1851
|
+
/** true if element is draggable */
|
|
1852
|
+
isResizable(t) {
|
|
1853
|
+
return !!(t?.ddElement?.ddResizable && !t.ddElement.ddResizable.disabled);
|
|
1854
|
+
}
|
|
1855
|
+
on(t, e, i) {
|
|
1856
|
+
return this._getDDElements(t).forEach((s) => s.on(e, (r) => {
|
|
1857
|
+
i(r, f.dragElement ? f.dragElement.el : r.target, f.dragElement ? f.dragElement.helper : null);
|
|
1858
|
+
})), this;
|
|
1859
|
+
}
|
|
1860
|
+
off(t, e) {
|
|
1861
|
+
return this._getDDElements(t).forEach((i) => i.off(e)), this;
|
|
1862
|
+
}
|
|
1863
|
+
/** @internal returns a list of DD elements, creating them on the fly by default unless option is to destroy or disable */
|
|
1864
|
+
_getDDElements(t, e) {
|
|
1865
|
+
const i = t.gridstack || e !== "destroy" && e !== "disable", s = h.getElements(t);
|
|
1866
|
+
return s.length ? s.map((n) => n.ddElement || (i ? P.init(n) : null)).filter((n) => n) : [];
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
/*!
|
|
1870
|
+
* GridStack 12.4.2
|
|
1871
|
+
* https://gridstackjs.com/
|
|
1872
|
+
*
|
|
1873
|
+
* Copyright (c) 2021-2025 Alain Dumesny
|
|
1874
|
+
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
1875
|
+
*/
|
|
1876
|
+
const y = new q();
|
|
1877
|
+
class c {
|
|
1878
|
+
/**
|
|
1879
|
+
* initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
|
|
1880
|
+
* simply return the existing instance (ignore any passed options). There is also an initAll() version that support
|
|
1881
|
+
* multiple grids initialization at once. Or you can use addGrid() to create the entire grid from JSON.
|
|
1882
|
+
* @param options grid options (optional)
|
|
1883
|
+
* @param elOrString element or CSS selector (first one used) to convert to a grid (default to '.grid-stack' class selector)
|
|
1884
|
+
*
|
|
1885
|
+
* @example
|
|
1886
|
+
* const grid = GridStack.init();
|
|
1887
|
+
*
|
|
1888
|
+
* Note: the HTMLElement (of type GridHTMLElement) will store a `gridstack: GridStack` value that can be retrieve later
|
|
1889
|
+
* const grid = document.querySelector('.grid-stack').gridstack;
|
|
1890
|
+
*/
|
|
1891
|
+
static init(t = {}, e = ".grid-stack") {
|
|
1892
|
+
if (typeof document > "u")
|
|
1893
|
+
return null;
|
|
1894
|
+
const i = c.getGridElement(e);
|
|
1895
|
+
return i ? (i.gridstack || (i.gridstack = new c(i, h.cloneDeep(t))), i.gridstack) : (console.error(typeof e == "string" ? 'GridStack.initAll() no grid was found with selector "' + e + `" - element missing or wrong selector ?
|
|
1896
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.` : "GridStack.init() no grid element was passed."), null);
|
|
1897
|
+
}
|
|
1898
|
+
/**
|
|
1899
|
+
* Will initialize a list of elements (given a selector) and return an array of grids.
|
|
1900
|
+
* @param options grid options (optional)
|
|
1901
|
+
* @param selector elements selector to convert to grids (default to '.grid-stack' class selector)
|
|
1902
|
+
*
|
|
1903
|
+
* @example
|
|
1904
|
+
* const grids = GridStack.initAll();
|
|
1905
|
+
* grids.forEach(...)
|
|
1906
|
+
*/
|
|
1907
|
+
static initAll(t = {}, e = ".grid-stack") {
|
|
1908
|
+
const i = [];
|
|
1909
|
+
return typeof document > "u" || (c.getGridElements(e).forEach((s) => {
|
|
1910
|
+
s.gridstack || (s.gridstack = new c(s, h.cloneDeep(t))), i.push(s.gridstack);
|
|
1911
|
+
}), i.length === 0 && console.error('GridStack.initAll() no grid was found with selector "' + e + `" - element missing or wrong selector ?
|
|
1912
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)), i;
|
|
1913
|
+
}
|
|
1914
|
+
/**
|
|
1915
|
+
* call to create a grid with the given options, including loading any children from JSON structure. This will call GridStack.init(), then
|
|
1916
|
+
* grid.load() on any passed children (recursively). Great alternative to calling init() if you want entire grid to come from
|
|
1917
|
+
* JSON serialized data, including options.
|
|
1918
|
+
* @param parent HTML element parent to the grid
|
|
1919
|
+
* @param opt grids options used to initialize the grid, and list of children
|
|
1920
|
+
*/
|
|
1921
|
+
static addGrid(t, e = {}) {
|
|
1922
|
+
if (!t)
|
|
1923
|
+
return null;
|
|
1924
|
+
let i = t;
|
|
1925
|
+
if (i.gridstack) {
|
|
1926
|
+
const n = i.gridstack;
|
|
1927
|
+
return e && (n.opts = { ...n.opts, ...e }), e.children !== void 0 && n.load(e.children), n;
|
|
1928
|
+
}
|
|
1929
|
+
return (!t.classList.contains("grid-stack") || c.addRemoveCB) && (c.addRemoveCB ? i = c.addRemoveCB(t, e, !0, !0) : i = h.createDiv(["grid-stack", e.class], t)), c.init(e, i);
|
|
1930
|
+
}
|
|
1931
|
+
/** call this method to register your engine instead of the default one.
|
|
1932
|
+
* See instead `GridStackOptions.engineClass` if you only need to
|
|
1933
|
+
* replace just one instance.
|
|
1934
|
+
*/
|
|
1935
|
+
static registerEngine(t) {
|
|
1936
|
+
c.engineClass = t;
|
|
1937
|
+
}
|
|
1938
|
+
/**
|
|
1939
|
+
* @internal create placeholder DIV as needed
|
|
1940
|
+
* @returns the placeholder element for indicating drop zones during drag operations
|
|
1941
|
+
*/
|
|
1942
|
+
get placeholder() {
|
|
1943
|
+
if (!this._placeholder) {
|
|
1944
|
+
this._placeholder = h.createDiv([this.opts.placeholderClass, v.itemClass, this.opts.itemClass]);
|
|
1945
|
+
const t = h.createDiv(["placeholder-content"], this._placeholder);
|
|
1946
|
+
this.opts.placeholderText && (t.textContent = this.opts.placeholderText);
|
|
1947
|
+
}
|
|
1948
|
+
return this._placeholder;
|
|
1949
|
+
}
|
|
1950
|
+
/**
|
|
1951
|
+
* Construct a grid item from the given element and options
|
|
1952
|
+
* @param el the HTML element tied to this grid after it's been initialized
|
|
1953
|
+
* @param opts grid options - public for classes to access, but use methods to modify!
|
|
1954
|
+
*/
|
|
1955
|
+
constructor(t, e = {}) {
|
|
1956
|
+
this.el = t, this.opts = e, this.animationDelay = 310, this._gsEventHandler = {}, this._extraDragRow = 0, this.dragTransform = { xScale: 1, yScale: 1, xOffset: 0, yOffset: 0 }, t.gridstack = this, this.opts = e = e || {}, t.classList.contains("grid-stack") || this.el.classList.add("grid-stack"), e.row && (e.minRow = e.maxRow = e.row, delete e.row);
|
|
1957
|
+
const i = h.toNumber(t.getAttribute("gs-row"));
|
|
1958
|
+
e.column === "auto" && delete e.column, e.alwaysShowResizeHandle !== void 0 && (e._alwaysShowResizeHandle = e.alwaysShowResizeHandle);
|
|
1959
|
+
const s = e.columnOpts;
|
|
1960
|
+
if (s) {
|
|
1961
|
+
const l = s.breakpoints;
|
|
1962
|
+
!s.columnWidth && !l?.length ? delete e.columnOpts : (s.columnMax = s.columnMax || 12, l?.length > 1 && l.sort((a, u) => (u.w || 0) - (a.w || 0)));
|
|
1963
|
+
}
|
|
1964
|
+
const r = {
|
|
1965
|
+
...h.cloneDeep(v),
|
|
1966
|
+
column: h.toNumber(t.getAttribute("gs-column")) || v.column,
|
|
1967
|
+
minRow: i || h.toNumber(t.getAttribute("gs-min-row")) || v.minRow,
|
|
1968
|
+
maxRow: i || h.toNumber(t.getAttribute("gs-max-row")) || v.maxRow,
|
|
1969
|
+
staticGrid: h.toBool(t.getAttribute("gs-static")) || v.staticGrid,
|
|
1970
|
+
sizeToContent: h.toBool(t.getAttribute("gs-size-to-content")) || void 0,
|
|
1971
|
+
draggable: {
|
|
1972
|
+
handle: (e.handleClass ? "." + e.handleClass : e.handle ? e.handle : "") || v.draggable.handle
|
|
1973
|
+
},
|
|
1974
|
+
removableOptions: {
|
|
1975
|
+
accept: e.itemClass || v.removableOptions.accept,
|
|
1976
|
+
decline: v.removableOptions.decline
|
|
1977
|
+
}
|
|
1978
|
+
};
|
|
1979
|
+
t.getAttribute("gs-animate") && (r.animate = h.toBool(t.getAttribute("gs-animate"))), e = h.defaults(e, r), this._initMargin(), this.checkDynamicColumn(), this._updateColumnVar(e), e.rtl === "auto" && (e.rtl = t.style.direction === "rtl"), e.rtl && this.el.classList.add("grid-stack-rtl");
|
|
1980
|
+
const o = this.el.closest("." + v.itemClass)?.gridstackNode;
|
|
1981
|
+
if (o && (o.subGrid = this, this.parentGridNode = o, this.el.classList.add("grid-stack-nested"), o.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = e.cellHeight === "auto", this._isAutoCellHeight || e.cellHeight === "initial")
|
|
1982
|
+
this.cellHeight(void 0);
|
|
1983
|
+
else {
|
|
1984
|
+
typeof e.cellHeight == "number" && e.cellHeightUnit && e.cellHeightUnit !== v.cellHeightUnit && (e.cellHeight = e.cellHeight + e.cellHeightUnit, delete e.cellHeightUnit);
|
|
1985
|
+
const l = e.cellHeight;
|
|
1986
|
+
delete e.cellHeight, this.cellHeight(l);
|
|
1987
|
+
}
|
|
1988
|
+
e.alwaysShowResizeHandle === "mobile" && (e.alwaysShowResizeHandle = b), this._setStaticClass();
|
|
1989
|
+
const d = e.engineClass || c.engineClass || x;
|
|
1990
|
+
if (this.engine = new d({
|
|
1991
|
+
column: this.getColumn(),
|
|
1992
|
+
float: e.float,
|
|
1993
|
+
maxRow: e.maxRow,
|
|
1994
|
+
onChange: (l) => {
|
|
1995
|
+
l.forEach((a) => {
|
|
1996
|
+
const u = a.el;
|
|
1997
|
+
u && (a._removeDOM ? (u && u.remove(), delete a._removeDOM) : this._writePosAttr(u, a));
|
|
1998
|
+
}), this._updateContainerHeight();
|
|
1999
|
+
}
|
|
2000
|
+
}), e.auto && (this.batchUpdate(), this.engine._loading = !0, this.getGridItems().forEach((l) => this._prepareElement(l)), delete this.engine._loading, this.batchUpdate(!1)), e.children) {
|
|
2001
|
+
const l = e.children;
|
|
2002
|
+
delete e.children, l.length && this.load(l);
|
|
2003
|
+
}
|
|
2004
|
+
this.setAnimation(), e.subGridDynamic && !f.pauseDrag && (f.pauseDrag = !0), e.draggable?.pause !== void 0 && (f.pauseDrag = e.draggable.pause), this._setupRemoveDrop(), this._setupAcceptWidget(), this._updateResizeEvent();
|
|
2005
|
+
}
|
|
2006
|
+
_updateColumnVar(t = this.opts) {
|
|
2007
|
+
this.el.classList.add("gs-" + t.column), typeof t.column == "number" && this.el.style.setProperty("--gs-column-width", `${100 / t.column}%`);
|
|
2008
|
+
}
|
|
2009
|
+
/**
|
|
2010
|
+
* add a new widget and returns it.
|
|
2011
|
+
*
|
|
2012
|
+
* Widget will be always placed even if result height is more than actual grid height.
|
|
2013
|
+
* You need to use `willItFit()` before calling addWidget for additional check.
|
|
2014
|
+
* See also `makeWidget(el)` for DOM element.
|
|
2015
|
+
*
|
|
2016
|
+
* @example
|
|
2017
|
+
* const grid = GridStack.init();
|
|
2018
|
+
* grid.addWidget({w: 3, content: 'hello'});
|
|
2019
|
+
*
|
|
2020
|
+
* @param w GridStackWidget definition. used MakeWidget(el) if you have dom element instead.
|
|
2021
|
+
*/
|
|
2022
|
+
addWidget(t) {
|
|
2023
|
+
if (!t)
|
|
2024
|
+
return;
|
|
2025
|
+
if (typeof t == "string") {
|
|
2026
|
+
console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");
|
|
2027
|
+
return;
|
|
2028
|
+
}
|
|
2029
|
+
if (t.ELEMENT_NODE)
|
|
2030
|
+
return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"), this.makeWidget(t);
|
|
2031
|
+
let e, i = t;
|
|
2032
|
+
if (i.grid = this, i.el ? e = i.el : c.addRemoveCB ? e = c.addRemoveCB(this.el, t, !0, !1) : e = this.createWidgetDivs(i), !e)
|
|
2033
|
+
return;
|
|
2034
|
+
if (i = e.gridstackNode, i && e.parentElement === this.el && this.engine.nodes.find((r) => r._id === i._id))
|
|
2035
|
+
return e;
|
|
2036
|
+
const s = this._readAttr(e);
|
|
2037
|
+
return h.defaults(t, s), this.engine.prepareNode(t), this.el.appendChild(e), this.makeWidget(e, t), e;
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* Create the default grid item divs and content (possibly lazy loaded) by using GridStack.renderCB().
|
|
2041
|
+
*
|
|
2042
|
+
* @param n GridStackNode definition containing widget configuration
|
|
2043
|
+
* @returns the created HTML element with proper grid item structure
|
|
2044
|
+
*
|
|
2045
|
+
* @example
|
|
2046
|
+
* const element = grid.createWidgetDivs({ w: 2, h: 1, content: 'Hello World' });
|
|
2047
|
+
*/
|
|
2048
|
+
createWidgetDivs(t) {
|
|
2049
|
+
const e = h.createDiv(["grid-stack-item", this.opts.itemClass]), i = h.createDiv(["grid-stack-item-content"], e);
|
|
2050
|
+
return h.lazyLoad(t) ? t.visibleObservable || (t.visibleObservable = new IntersectionObserver(([s]) => {
|
|
2051
|
+
s.isIntersecting && (t.visibleObservable?.disconnect(), delete t.visibleObservable, c.renderCB(i, t), t.grid?.prepareDragDrop(t.el));
|
|
2052
|
+
}), window.setTimeout(() => t.visibleObservable?.observe(e))) : c.renderCB(i, t), e;
|
|
2053
|
+
}
|
|
2054
|
+
/**
|
|
2055
|
+
* Convert an existing gridItem element into a sub-grid with the given (optional) options, else inherit them
|
|
2056
|
+
* from the parent's subGrid options.
|
|
2057
|
+
* @param el gridItem element to convert
|
|
2058
|
+
* @param ops (optional) sub-grid options, else default to node, then parent settings, else defaults
|
|
2059
|
+
* @param nodeToAdd (optional) node to add to the newly created sub grid (used when dragging over existing regular item)
|
|
2060
|
+
* @param saveContent if true (default) the html inside .grid-stack-content will be saved to child widget
|
|
2061
|
+
* @returns newly created grid
|
|
2062
|
+
*/
|
|
2063
|
+
makeSubGrid(t, e, i, s = !0) {
|
|
2064
|
+
let r = t.gridstackNode;
|
|
2065
|
+
if (r || (r = this.makeWidget(t).gridstackNode), r.subGrid?.el)
|
|
2066
|
+
return r.subGrid;
|
|
2067
|
+
let n, o = this;
|
|
2068
|
+
for (; o && !n; )
|
|
2069
|
+
n = o.opts?.subGridOpts, o = o.parentGridNode?.grid;
|
|
2070
|
+
e = h.cloneDeep({
|
|
2071
|
+
// by default sub-grid inherit from us | parent, other than id, children, etc...
|
|
2072
|
+
...this.opts,
|
|
2073
|
+
id: void 0,
|
|
2074
|
+
children: void 0,
|
|
2075
|
+
column: "auto",
|
|
2076
|
+
columnOpts: void 0,
|
|
2077
|
+
layout: "list",
|
|
2078
|
+
subGridOpts: void 0,
|
|
2079
|
+
...n || {},
|
|
2080
|
+
...e || r.subGridOpts || {}
|
|
2081
|
+
}), r.subGridOpts = e;
|
|
2082
|
+
let d;
|
|
2083
|
+
e.column === "auto" && (d = !0, e.column = Math.max(r.w || 1, i?.w || 1), delete e.columnOpts);
|
|
2084
|
+
let l = r.el.querySelector(".grid-stack-item-content"), a, u;
|
|
2085
|
+
if (s && (this._removeDD(r.el), u = { ...r, x: 0, y: 0 }, h.removeInternalForSave(u), delete u.subGridOpts, r.content && (u.content = r.content, delete r.content), c.addRemoveCB ? a = c.addRemoveCB(this.el, u, !0, !1) : (a = h.createDiv(["grid-stack-item"]), a.appendChild(l), l = h.createDiv(["grid-stack-item-content"], r.el)), this.prepareDragDrop(r.el)), i) {
|
|
2086
|
+
const p = d ? e.column : r.w, _ = r.h + i.h, E = r.el.style;
|
|
2087
|
+
E.transition = "none", this.update(r.el, { w: p, h: _ }), setTimeout(() => E.transition = null);
|
|
2088
|
+
}
|
|
2089
|
+
const g = r.subGrid = c.addGrid(l, e);
|
|
2090
|
+
return i?._moving && (g._isTemp = !0), d && (g._autoColumn = !0), s && g.makeWidget(a, u), i && (i._moving ? window.setTimeout(() => h.simulateMouseEvent(i._event, "mouseenter", g.el), 0) : g.makeWidget(r.el, r)), this.resizeToContentCheck(!1, r), g;
|
|
2091
|
+
}
|
|
2092
|
+
/**
|
|
2093
|
+
* called when an item was converted into a nested grid to accommodate a dragged over item, but then item leaves - return back
|
|
2094
|
+
* to the original grid-item. Also called to remove empty sub-grids when last item is dragged out (since re-creating is simple)
|
|
2095
|
+
*/
|
|
2096
|
+
removeAsSubGrid(t) {
|
|
2097
|
+
const e = this.parentGridNode?.grid;
|
|
2098
|
+
e && (e.batchUpdate(), e.removeWidget(this.parentGridNode.el, !0, !0), this.engine.nodes.forEach((i) => {
|
|
2099
|
+
i.x += this.parentGridNode.x, i.y += this.parentGridNode.y, e.makeWidget(i.el, i);
|
|
2100
|
+
}), e.batchUpdate(!1), this.parentGridNode && delete this.parentGridNode.subGrid, delete this.parentGridNode, t && window.setTimeout(() => h.simulateMouseEvent(t._event, "mouseenter", e.el), 0));
|
|
2101
|
+
}
|
|
2102
|
+
/**
|
|
2103
|
+
* saves the current layout returning a list of widgets for serialization which might include any nested grids.
|
|
2104
|
+
* @param saveContent if true (default) the latest html inside .grid-stack-content will be saved to GridStackWidget.content field, else it will
|
|
2105
|
+
* be removed.
|
|
2106
|
+
* @param saveGridOpt if true (default false), save the grid options itself, so you can call the new GridStack.addGrid()
|
|
2107
|
+
* to recreate everything from scratch. GridStackOptions.children would then contain the widget list instead.
|
|
2108
|
+
* @param saveCB callback for each node -> widget, so application can insert additional data to be saved into the widget data structure.
|
|
2109
|
+
* @param column if provided, the grid will be saved for the given column size (IFF we have matching internal saved layout, or current layout).
|
|
2110
|
+
* Otherwise it will use the largest possible layout (say 12 even if rendering at 1 column) so we can restore to all layouts.
|
|
2111
|
+
* NOTE: if you want to save to currently display layout, pass this.getColumn() as column.
|
|
2112
|
+
* NOTE2: nested grids will ALWAYS save to the container size to be in sync with parent.
|
|
2113
|
+
* @returns list of widgets or full grid option, including .children list of widgets
|
|
2114
|
+
*/
|
|
2115
|
+
save(t = !0, e = !1, i = c.saveCB, s) {
|
|
2116
|
+
const r = this.engine.save(t, i, s);
|
|
2117
|
+
if (r.forEach((n) => {
|
|
2118
|
+
if (t && n.el && !n.subGrid && !i) {
|
|
2119
|
+
const o = n.el.querySelector(".grid-stack-item-content");
|
|
2120
|
+
n.content = o?.innerHTML, n.content || delete n.content;
|
|
2121
|
+
} else if (!t && !i && delete n.content, n.subGrid?.el) {
|
|
2122
|
+
const o = n.w || n.subGrid.getColumn(), d = n.subGrid.save(t, e, i, o);
|
|
2123
|
+
n.subGridOpts = e ? d : { children: d }, delete n.subGrid;
|
|
2124
|
+
}
|
|
2125
|
+
delete n.el;
|
|
2126
|
+
}), e) {
|
|
2127
|
+
const n = h.cloneDeep(this.opts);
|
|
2128
|
+
n.marginBottom === n.marginTop && n.marginRight === n.marginLeft && n.marginTop === n.marginRight && (n.margin = n.marginTop, delete n.marginTop, delete n.marginRight, delete n.marginBottom, delete n.marginLeft), n.rtl === (this.el.style.direction === "rtl") && (n.rtl = "auto"), this._isAutoCellHeight && (n.cellHeight = "auto"), this._autoColumn && (n.column = "auto");
|
|
2129
|
+
const o = n._alwaysShowResizeHandle;
|
|
2130
|
+
return delete n._alwaysShowResizeHandle, o !== void 0 ? n.alwaysShowResizeHandle = o : delete n.alwaysShowResizeHandle, h.removeInternalAndSame(n, v), n.children = r, n;
|
|
2131
|
+
}
|
|
2132
|
+
return r;
|
|
2133
|
+
}
|
|
2134
|
+
/**
|
|
2135
|
+
* Load widgets from a list. This will call update() on each (matching by id) or add/remove widgets that are not there.
|
|
2136
|
+
* Used to restore a grid layout for a saved layout list (see `save()`).
|
|
2137
|
+
*
|
|
2138
|
+
* @param items list of widgets definition to update/create
|
|
2139
|
+
* @param addRemove boolean (default true) or callback method can be passed to control if and how missing widgets can be added/removed, giving
|
|
2140
|
+
* the user control of insertion.
|
|
2141
|
+
* @returns the grid instance for chaining
|
|
2142
|
+
*
|
|
2143
|
+
* @example
|
|
2144
|
+
* // Basic usage with saved layout
|
|
2145
|
+
* const savedLayout = grid.save(); // Save current layout
|
|
2146
|
+
* // ... later restore it
|
|
2147
|
+
* grid.load(savedLayout);
|
|
2148
|
+
*
|
|
2149
|
+
* // Load with custom add/remove callback
|
|
2150
|
+
* grid.load(layout, (items, grid, add) => {
|
|
2151
|
+
* if (add) {
|
|
2152
|
+
* // Custom logic for adding new widgets
|
|
2153
|
+
* items.forEach(item => {
|
|
2154
|
+
* const el = document.createElement('div');
|
|
2155
|
+
* el.innerHTML = item.content || '';
|
|
2156
|
+
* grid.addWidget(el, item);
|
|
2157
|
+
* });
|
|
2158
|
+
* } else {
|
|
2159
|
+
* // Custom logic for removing widgets
|
|
2160
|
+
* items.forEach(item => grid.removeWidget(item.el));
|
|
2161
|
+
* }
|
|
2162
|
+
* });
|
|
2163
|
+
*
|
|
2164
|
+
* // Load without adding/removing missing widgets
|
|
2165
|
+
* grid.load(layout, false);
|
|
2166
|
+
*
|
|
2167
|
+
* @see {@link http://gridstackjs.com/demo/serialization.html} for complete example
|
|
2168
|
+
*/
|
|
2169
|
+
load(t, e = c.addRemoveCB || !0) {
|
|
2170
|
+
t = h.cloneDeep(t);
|
|
2171
|
+
const i = this.getColumn();
|
|
2172
|
+
t.forEach((a) => {
|
|
2173
|
+
a.w = a.w || a.minW || 1, a.h = a.h || a.minH || 1;
|
|
2174
|
+
}), t = h.sort(t), this.engine.skipCacheUpdate = this._ignoreLayoutsNodeChange = !0;
|
|
2175
|
+
let s = 0;
|
|
2176
|
+
t.forEach((a) => {
|
|
2177
|
+
s = Math.max(s, (a.x || 0) + a.w);
|
|
2178
|
+
}), s > this.engine.defaultColumn && (this.engine.defaultColumn = s), s > i && (this.engine.nodes.length === 0 && this.responseLayout ? (this.engine.nodes = t, this.engine.columnChanged(s, i, this.responseLayout), t = this.engine.nodes, this.engine.nodes = [], delete this.responseLayout) : this.engine.cacheLayout(t, s, !0));
|
|
2179
|
+
const r = c.addRemoveCB;
|
|
2180
|
+
typeof e == "function" && (c.addRemoveCB = e);
|
|
2181
|
+
const n = [];
|
|
2182
|
+
this.batchUpdate();
|
|
2183
|
+
const o = !this.engine.nodes.length, d = o && this.opts.animate;
|
|
2184
|
+
d && this.setAnimation(!1), !o && e && [...this.engine.nodes].forEach((u) => {
|
|
2185
|
+
if (!u.id)
|
|
2186
|
+
return;
|
|
2187
|
+
h.find(t, u.id) || (c.addRemoveCB && c.addRemoveCB(this.el, u, !1, !1), n.push(u), this.removeWidget(u.el, !0, !1));
|
|
2188
|
+
}), this.engine._loading = !0;
|
|
2189
|
+
const l = [];
|
|
2190
|
+
return this.engine.nodes = this.engine.nodes.filter((a) => h.find(t, a.id) ? (l.push(a), !1) : !0), t.forEach((a) => {
|
|
2191
|
+
const u = h.find(l, a.id);
|
|
2192
|
+
if (u) {
|
|
2193
|
+
if (h.shouldSizeToContent(u) && (a.h = u.h), this.engine.nodeBoundFix(a), (a.autoPosition || a.x === void 0 || a.y === void 0) && (a.w = a.w || u.w, a.h = a.h || u.h, this.engine.findEmptyPosition(a)), this.engine.nodes.push(u), h.samePos(u, a) && this.engine.nodes.length > 1 && (this.moveNode(u, { ...a, forceCollide: !0 }), h.copyPos(a, u)), this.update(u.el, a), a.subGridOpts?.children) {
|
|
2194
|
+
const g = u.el.querySelector(".grid-stack");
|
|
2195
|
+
g && g.gridstack && g.gridstack.load(a.subGridOpts.children);
|
|
2196
|
+
}
|
|
2197
|
+
} else e && this.addWidget(a);
|
|
2198
|
+
}), delete this.engine._loading, this.engine.removedNodes = n, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ? c.addRemoveCB = r : delete c.addRemoveCB, d && this.setAnimation(!0, !0), this;
|
|
2199
|
+
}
|
|
2200
|
+
/**
|
|
2201
|
+
* use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
|
|
2202
|
+
* and get a single event callback. You will see no changes until `batchUpdate(false)` is called.
|
|
2203
|
+
*/
|
|
2204
|
+
batchUpdate(t = !0) {
|
|
2205
|
+
return this.engine.batchUpdate(t), t || (this._updateContainerHeight(), this._triggerRemoveEvent(), this._triggerAddEvent(), this._triggerChangeEvent()), this;
|
|
2206
|
+
}
|
|
2207
|
+
/**
|
|
2208
|
+
* Gets the current cell height in pixels. This takes into account the unit type and converts to pixels if necessary.
|
|
2209
|
+
*
|
|
2210
|
+
* @param forcePixel if true, forces conversion to pixels even when cellHeight is specified in other units
|
|
2211
|
+
* @returns the cell height in pixels
|
|
2212
|
+
*
|
|
2213
|
+
* @example
|
|
2214
|
+
* const height = grid.getCellHeight();
|
|
2215
|
+
* console.log('Cell height:', height, 'px');
|
|
2216
|
+
*
|
|
2217
|
+
* // Force pixel conversion
|
|
2218
|
+
* const pixelHeight = grid.getCellHeight(true);
|
|
2219
|
+
*/
|
|
2220
|
+
getCellHeight(t = !1) {
|
|
2221
|
+
if (this.opts.cellHeight && this.opts.cellHeight !== "auto" && (!t || !this.opts.cellHeightUnit || this.opts.cellHeightUnit === "px"))
|
|
2222
|
+
return this.opts.cellHeight;
|
|
2223
|
+
if (this.opts.cellHeightUnit === "rem")
|
|
2224
|
+
return this.opts.cellHeight * parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
2225
|
+
if (this.opts.cellHeightUnit === "em")
|
|
2226
|
+
return this.opts.cellHeight * parseFloat(getComputedStyle(this.el).fontSize);
|
|
2227
|
+
if (this.opts.cellHeightUnit === "cm")
|
|
2228
|
+
return this.opts.cellHeight * (96 / 2.54);
|
|
2229
|
+
if (this.opts.cellHeightUnit === "mm")
|
|
2230
|
+
return this.opts.cellHeight * (96 / 2.54) / 10;
|
|
2231
|
+
const e = this.el.querySelector("." + this.opts.itemClass);
|
|
2232
|
+
if (e) {
|
|
2233
|
+
const s = h.toNumber(e.getAttribute("gs-h")) || 1;
|
|
2234
|
+
return Math.round(e.offsetHeight / s);
|
|
2235
|
+
}
|
|
2236
|
+
const i = parseInt(this.el.getAttribute("gs-current-row"));
|
|
2237
|
+
return i ? Math.round(this.el.getBoundingClientRect().height / i) : this.opts.cellHeight;
|
|
2238
|
+
}
|
|
2239
|
+
/**
|
|
2240
|
+
* Update current cell height - see `GridStackOptions.cellHeight` for format by updating eh Browser CSS variable.
|
|
2241
|
+
*
|
|
2242
|
+
* @param val the cell height. Options:
|
|
2243
|
+
* - `undefined`: cells content will be made square (match width minus margin)
|
|
2244
|
+
* - `0`: the CSS will be generated by the application instead
|
|
2245
|
+
* - number: height in pixels
|
|
2246
|
+
* - string: height with units (e.g., '70px', '5rem', '2em')
|
|
2247
|
+
* @returns the grid instance for chaining
|
|
2248
|
+
*
|
|
2249
|
+
* @example
|
|
2250
|
+
* grid.cellHeight(100); // 100px height
|
|
2251
|
+
* grid.cellHeight('70px'); // explicit pixel height
|
|
2252
|
+
* grid.cellHeight('5rem'); // relative to root font size
|
|
2253
|
+
* grid.cellHeight(grid.cellWidth() * 1.2); // aspect ratio
|
|
2254
|
+
* grid.cellHeight('auto'); // auto-size based on content
|
|
2255
|
+
*/
|
|
2256
|
+
cellHeight(t) {
|
|
2257
|
+
if (t !== void 0 && this._isAutoCellHeight !== (t === "auto") && (this._isAutoCellHeight = t === "auto", this._updateResizeEvent()), (t === "initial" || t === "auto") && (t = void 0), t === void 0) {
|
|
2258
|
+
const i = -this.opts.marginRight - this.opts.marginLeft + this.opts.marginTop + this.opts.marginBottom;
|
|
2259
|
+
t = this.cellWidth() + i;
|
|
2260
|
+
}
|
|
2261
|
+
const e = h.parseHeight(t);
|
|
2262
|
+
return this.opts.cellHeightUnit === e.unit && this.opts.cellHeight === e.h ? this : (this.opts.cellHeightUnit = e.unit, this.opts.cellHeight = e.h, this.el.style.setProperty("--gs-cell-height", `${this.opts.cellHeight}${this.opts.cellHeightUnit}`), this._updateContainerHeight(), this.resizeToContentCheck(), this);
|
|
2263
|
+
}
|
|
2264
|
+
/** Gets current cell width. */
|
|
2265
|
+
/**
|
|
2266
|
+
* Gets the current cell width in pixels. This is calculated based on the grid container width divided by the number of columns.
|
|
2267
|
+
*
|
|
2268
|
+
* @returns the cell width in pixels
|
|
2269
|
+
*
|
|
2270
|
+
* @example
|
|
2271
|
+
* const width = grid.cellWidth();
|
|
2272
|
+
* console.log('Cell width:', width, 'px');
|
|
2273
|
+
*
|
|
2274
|
+
* // Use cell width to calculate widget dimensions
|
|
2275
|
+
* const widgetWidth = width * 3; // For a 3-column wide widget
|
|
2276
|
+
*/
|
|
2277
|
+
cellWidth() {
|
|
2278
|
+
return this._widthOrContainer() / this.getColumn();
|
|
2279
|
+
}
|
|
2280
|
+
/** return our expected width (or parent) , and optionally of window for dynamic column check */
|
|
2281
|
+
_widthOrContainer(t = !1) {
|
|
2282
|
+
return t && this.opts.columnOpts?.breakpointForWindow ? window.innerWidth : this.el.clientWidth || this.el.parentElement.clientWidth || window.innerWidth;
|
|
2283
|
+
}
|
|
2284
|
+
/** checks for dynamic column count for our current size, returning true if changed */
|
|
2285
|
+
checkDynamicColumn() {
|
|
2286
|
+
const t = this.opts.columnOpts;
|
|
2287
|
+
if (!t || !t.columnWidth && !t.breakpoints?.length)
|
|
2288
|
+
return !1;
|
|
2289
|
+
const e = this.getColumn();
|
|
2290
|
+
let i = e;
|
|
2291
|
+
const s = this._widthOrContainer(!0);
|
|
2292
|
+
if (t.columnWidth)
|
|
2293
|
+
i = Math.min(Math.round(s / t.columnWidth) || 1, t.columnMax);
|
|
2294
|
+
else {
|
|
2295
|
+
i = t.columnMax;
|
|
2296
|
+
let r = 0;
|
|
2297
|
+
for (; r < t.breakpoints.length && s <= t.breakpoints[r].w; )
|
|
2298
|
+
i = t.breakpoints[r++].c || e;
|
|
2299
|
+
}
|
|
2300
|
+
if (i !== e) {
|
|
2301
|
+
const r = t.breakpoints?.find((n) => n.c === i);
|
|
2302
|
+
return this.column(i, r?.layout || t.layout), !0;
|
|
2303
|
+
}
|
|
2304
|
+
return !1;
|
|
2305
|
+
}
|
|
2306
|
+
/**
|
|
2307
|
+
* Re-layout grid items to reclaim any empty space. This is useful after removing widgets
|
|
2308
|
+
* or when you want to optimize the layout.
|
|
2309
|
+
*
|
|
2310
|
+
* @param layout layout type. Options:
|
|
2311
|
+
* - 'compact' (default): might re-order items to fill any empty space
|
|
2312
|
+
* - 'list': keep the widget left->right order the same, even if that means leaving an empty slot if things don't fit
|
|
2313
|
+
* @param doSort re-sort items first based on x,y position. Set to false to do your own sorting ahead (default: true)
|
|
2314
|
+
* @returns the grid instance for chaining
|
|
2315
|
+
*
|
|
2316
|
+
* @example
|
|
2317
|
+
* // Compact layout after removing widgets
|
|
2318
|
+
* grid.removeWidget('.widget-to-remove');
|
|
2319
|
+
* grid.compact();
|
|
2320
|
+
*
|
|
2321
|
+
* // Use list layout (preserve order)
|
|
2322
|
+
* grid.compact('list');
|
|
2323
|
+
*
|
|
2324
|
+
* // Compact without sorting first
|
|
2325
|
+
* grid.compact('compact', false);
|
|
2326
|
+
*/
|
|
2327
|
+
compact(t = "compact", e = !0) {
|
|
2328
|
+
return this.engine.compact(t, e), this._triggerChangeEvent(), this;
|
|
2329
|
+
}
|
|
2330
|
+
/**
|
|
2331
|
+
* Set the number of columns in the grid. Will update existing widgets to conform to new number of columns,
|
|
2332
|
+
* as well as cache the original layout so you can revert back to previous positions without loss.
|
|
2333
|
+
*
|
|
2334
|
+
* Requires `gridstack-extra.css` or `gridstack-extra.min.css` for [2-11] columns,
|
|
2335
|
+
* else you will need to generate correct CSS.
|
|
2336
|
+
* See: https://github.com/gridstack/gridstack.js#change-grid-columns
|
|
2337
|
+
*
|
|
2338
|
+
* @param column Integer > 0 (default 12)
|
|
2339
|
+
* @param layout specify the type of re-layout that will happen. Options:
|
|
2340
|
+
* - 'moveScale' (default): scale widget positions and sizes
|
|
2341
|
+
* - 'move': keep widget sizes, only move positions
|
|
2342
|
+
* - 'scale': keep widget positions, only scale sizes
|
|
2343
|
+
* - 'none': don't change widget positions or sizes
|
|
2344
|
+
* Note: items will never be outside of the current column boundaries.
|
|
2345
|
+
* Ignored for `column=1` as we always want to vertically stack.
|
|
2346
|
+
* @returns the grid instance for chaining
|
|
2347
|
+
*
|
|
2348
|
+
* @example
|
|
2349
|
+
* // Change to 6 columns with default scaling
|
|
2350
|
+
* grid.column(6);
|
|
2351
|
+
*
|
|
2352
|
+
* // Change to 4 columns, only move positions
|
|
2353
|
+
* grid.column(4, 'move');
|
|
2354
|
+
*
|
|
2355
|
+
* // Single column layout (vertical stack)
|
|
2356
|
+
* grid.column(1);
|
|
2357
|
+
*/
|
|
2358
|
+
column(t, e = "moveScale") {
|
|
2359
|
+
if (!t || t < 1 || this.opts.column === t)
|
|
2360
|
+
return this;
|
|
2361
|
+
const i = this.getColumn();
|
|
2362
|
+
return this.opts.column = t, this.engine ? (this.engine.column = t, this.el.classList.remove("gs-" + i), this._updateColumnVar(), this.engine.columnChanged(i, t, e), this._isAutoCellHeight && this.cellHeight(), this.resizeToContentCheck(!0), this._ignoreLayoutsNodeChange = !0, this._triggerChangeEvent(), delete this._ignoreLayoutsNodeChange, this) : (this.responseLayout = e, this);
|
|
2363
|
+
}
|
|
2364
|
+
/**
|
|
2365
|
+
* Get the number of columns in the grid (default 12).
|
|
2366
|
+
*
|
|
2367
|
+
* @returns the current number of columns in the grid
|
|
2368
|
+
*
|
|
2369
|
+
* @example
|
|
2370
|
+
* const columnCount = grid.getColumn(); // returns 12 by default
|
|
2371
|
+
*/
|
|
2372
|
+
getColumn() {
|
|
2373
|
+
return this.opts.column;
|
|
2374
|
+
}
|
|
2375
|
+
/**
|
|
2376
|
+
* Returns an array of grid HTML elements (no placeholder) - used to iterate through our children in DOM order.
|
|
2377
|
+
* This method excludes placeholder elements and returns only actual grid items.
|
|
2378
|
+
*
|
|
2379
|
+
* @returns array of GridItemHTMLElement instances representing all grid items
|
|
2380
|
+
*
|
|
2381
|
+
* @example
|
|
2382
|
+
* const items = grid.getGridItems();
|
|
2383
|
+
* items.forEach(item => {
|
|
2384
|
+
* console.log('Item ID:', item.gridstackNode.id);
|
|
2385
|
+
* });
|
|
2386
|
+
*/
|
|
2387
|
+
getGridItems() {
|
|
2388
|
+
return Array.from(this.el.children).filter((t) => t.matches("." + this.opts.itemClass) && !t.matches("." + this.opts.placeholderClass));
|
|
2389
|
+
}
|
|
2390
|
+
/**
|
|
2391
|
+
* Returns true if change callbacks should be ignored due to column change, sizeToContent, loading, etc.
|
|
2392
|
+
* This is useful for callers who want to implement dirty flag functionality.
|
|
2393
|
+
*
|
|
2394
|
+
* @returns true if change callbacks are currently being ignored
|
|
2395
|
+
*
|
|
2396
|
+
* @example
|
|
2397
|
+
* if (!grid.isIgnoreChangeCB()) {
|
|
2398
|
+
* // Process the change event
|
|
2399
|
+
* console.log('Grid layout changed');
|
|
2400
|
+
* }
|
|
2401
|
+
*/
|
|
2402
|
+
isIgnoreChangeCB() {
|
|
2403
|
+
return this._ignoreLayoutsNodeChange;
|
|
2404
|
+
}
|
|
2405
|
+
/**
|
|
2406
|
+
* Destroys a grid instance. DO NOT CALL any methods or access any vars after this as it will free up members.
|
|
2407
|
+
* @param removeDOM if `false` grid and items HTML elements will not be removed from the DOM (Optional. Default `true`).
|
|
2408
|
+
*/
|
|
2409
|
+
destroy(t = !0) {
|
|
2410
|
+
if (this.el)
|
|
2411
|
+
return this.offAll(), this._updateResizeEvent(!0), this.setStatic(!0, !1), this.setAnimation(!1), t ? this.el.parentNode.removeChild(this.el) : (this.removeAll(t), this.el.removeAttribute("gs-current-row")), this.parentGridNode && delete this.parentGridNode.subGrid, delete this.parentGridNode, delete this.opts, delete this._placeholder?.gridstackNode, delete this._placeholder, delete this.engine, delete this.el.gridstack, delete this.el, this;
|
|
2412
|
+
}
|
|
2413
|
+
/**
|
|
2414
|
+
* Enable/disable floating widgets (default: `false`). When enabled, widgets can float up to fill empty spaces.
|
|
2415
|
+
* See [example](http://gridstackjs.com/demo/float.html)
|
|
2416
|
+
*
|
|
2417
|
+
* @param val true to enable floating, false to disable
|
|
2418
|
+
* @returns the grid instance for chaining
|
|
2419
|
+
*
|
|
2420
|
+
* @example
|
|
2421
|
+
* grid.float(true); // Enable floating
|
|
2422
|
+
* grid.float(false); // Disable floating (default)
|
|
2423
|
+
*/
|
|
2424
|
+
float(t) {
|
|
2425
|
+
return this.opts.float !== t && (this.opts.float = this.engine.float = t, this._triggerChangeEvent()), this;
|
|
2426
|
+
}
|
|
2427
|
+
/**
|
|
2428
|
+
* Get the current float mode setting.
|
|
2429
|
+
*
|
|
2430
|
+
* @returns true if floating is enabled, false otherwise
|
|
2431
|
+
*
|
|
2432
|
+
* @example
|
|
2433
|
+
* const isFloating = grid.getFloat();
|
|
2434
|
+
* console.log('Floating enabled:', isFloating);
|
|
2435
|
+
*/
|
|
2436
|
+
getFloat() {
|
|
2437
|
+
return this.engine.float;
|
|
2438
|
+
}
|
|
2439
|
+
/**
|
|
2440
|
+
* Get the position of the cell under a pixel on screen.
|
|
2441
|
+
* @param position the position of the pixel to resolve in
|
|
2442
|
+
* absolute coordinates, as an object with top and left properties
|
|
2443
|
+
* @param useDocRelative if true, value will be based on document position vs parent position (Optional. Default false).
|
|
2444
|
+
* Useful when grid is within `position: relative` element
|
|
2445
|
+
*
|
|
2446
|
+
* Returns an object with properties `x` and `y` i.e. the column and row in the grid.
|
|
2447
|
+
*/
|
|
2448
|
+
getCellFromPixel(t, e = !1) {
|
|
2449
|
+
const i = this.el.getBoundingClientRect();
|
|
2450
|
+
let s;
|
|
2451
|
+
e ? s = { top: i.top + document.documentElement.scrollTop, left: i.left } : s = { top: this.el.offsetTop, left: this.el.offsetLeft };
|
|
2452
|
+
const r = t.left - s.left, n = t.top - s.top, o = i.width / this.getColumn(), d = i.height / parseInt(this.el.getAttribute("gs-current-row"));
|
|
2453
|
+
return { x: Math.floor(r / o), y: Math.floor(n / d) };
|
|
2454
|
+
}
|
|
2455
|
+
/**
|
|
2456
|
+
* Returns the current number of rows, which will be at least `minRow` if set.
|
|
2457
|
+
* The row count is based on the highest positioned widget in the grid.
|
|
2458
|
+
*
|
|
2459
|
+
* @returns the current number of rows in the grid
|
|
2460
|
+
*
|
|
2461
|
+
* @example
|
|
2462
|
+
* const rowCount = grid.getRow();
|
|
2463
|
+
* console.log('Grid has', rowCount, 'rows');
|
|
2464
|
+
*/
|
|
2465
|
+
getRow() {
|
|
2466
|
+
return Math.max(this.engine.getRow(), this.opts.minRow || 0);
|
|
2467
|
+
}
|
|
2468
|
+
/**
|
|
2469
|
+
* Checks if the specified rectangular area is empty (no widgets occupy any part of it).
|
|
2470
|
+
*
|
|
2471
|
+
* @param x the x coordinate (column) of the area to check
|
|
2472
|
+
* @param y the y coordinate (row) of the area to check
|
|
2473
|
+
* @param w the width in columns of the area to check
|
|
2474
|
+
* @param h the height in rows of the area to check
|
|
2475
|
+
* @returns true if the area is completely empty, false if any widget overlaps
|
|
2476
|
+
*
|
|
2477
|
+
* @example
|
|
2478
|
+
* // Check if a 2x2 area at position (1,1) is empty
|
|
2479
|
+
* if (grid.isAreaEmpty(1, 1, 2, 2)) {
|
|
2480
|
+
* console.log('Area is available for placement');
|
|
2481
|
+
* }
|
|
2482
|
+
*/
|
|
2483
|
+
isAreaEmpty(t, e, i, s) {
|
|
2484
|
+
return this.engine.isAreaEmpty(t, e, i, s);
|
|
2485
|
+
}
|
|
2486
|
+
/**
|
|
2487
|
+
* If you add elements to your grid by hand (or have some framework creating DOM), you have to tell gridstack afterwards to make them widgets.
|
|
2488
|
+
* If you want gridstack to add the elements for you, use `addWidget()` instead.
|
|
2489
|
+
* Makes the given element a widget and returns it.
|
|
2490
|
+
*
|
|
2491
|
+
* @param els widget or single selector to convert.
|
|
2492
|
+
* @param options widget definition to use instead of reading attributes or using default sizing values
|
|
2493
|
+
* @returns the converted GridItemHTMLElement
|
|
2494
|
+
*
|
|
2495
|
+
* @example
|
|
2496
|
+
* const grid = GridStack.init();
|
|
2497
|
+
*
|
|
2498
|
+
* // Create HTML content manually, possibly looking like:
|
|
2499
|
+
* // <div id="item-1" gs-x="0" gs-y="0" gs-w="3" gs-h="2"></div>
|
|
2500
|
+
* grid.el.innerHTML = '<div id="item-1" gs-w="3"></div><div id="item-2"></div>';
|
|
2501
|
+
*
|
|
2502
|
+
* // Convert existing elements to widgets
|
|
2503
|
+
* grid.makeWidget('#item-1'); // Uses gs-* attributes from DOM
|
|
2504
|
+
* grid.makeWidget('#item-2', {w: 2, h: 1, content: 'Hello World'});
|
|
2505
|
+
*
|
|
2506
|
+
* // Or pass DOM element directly
|
|
2507
|
+
* const element = document.getElementById('item-3');
|
|
2508
|
+
* grid.makeWidget(element, {x: 0, y: 1, w: 4, h: 2});
|
|
2509
|
+
*/
|
|
2510
|
+
makeWidget(t, e) {
|
|
2511
|
+
const i = c.getElement(t);
|
|
2512
|
+
if (!i || i.gridstackNode)
|
|
2513
|
+
return i;
|
|
2514
|
+
i.parentElement || this.el.appendChild(i), this._prepareElement(i, !0, e);
|
|
2515
|
+
const s = i.gridstackNode;
|
|
2516
|
+
this._updateContainerHeight(), s.subGridOpts && this.makeSubGrid(i, s.subGridOpts, void 0, !1);
|
|
2517
|
+
let r;
|
|
2518
|
+
return this.opts.column === 1 && !this._ignoreLayoutsNodeChange && (r = this._ignoreLayoutsNodeChange = !0), this._triggerAddEvent(), this._triggerChangeEvent(), r && delete this._ignoreLayoutsNodeChange, i;
|
|
2519
|
+
}
|
|
2520
|
+
on(t, e) {
|
|
2521
|
+
return t.indexOf(" ") !== -1 ? (t.split(" ").forEach((s) => this.on(s, e)), this) : (t === "change" || t === "added" || t === "removed" || t === "enable" || t === "disable" ? (t === "enable" || t === "disable" ? this._gsEventHandler[t] = (s) => e(s) : this._gsEventHandler[t] = (s) => {
|
|
2522
|
+
s.detail && e(s, s.detail);
|
|
2523
|
+
}, this.el.addEventListener(t, this._gsEventHandler[t])) : t === "drag" || t === "dragstart" || t === "dragstop" || t === "resizestart" || t === "resize" || t === "resizestop" || t === "dropped" || t === "resizecontent" ? this._gsEventHandler[t] = e : console.error("GridStack.on(" + t + ") event not supported"), this);
|
|
2524
|
+
}
|
|
2525
|
+
/**
|
|
2526
|
+
* unsubscribe from the 'on' event GridStackEvent
|
|
2527
|
+
* @param name of the event (see possible values) or list of names space separated
|
|
2528
|
+
*/
|
|
2529
|
+
off(t) {
|
|
2530
|
+
return t.indexOf(" ") !== -1 ? (t.split(" ").forEach((i) => this.off(i)), this) : ((t === "change" || t === "added" || t === "removed" || t === "enable" || t === "disable") && this._gsEventHandler[t] && this.el.removeEventListener(t, this._gsEventHandler[t]), delete this._gsEventHandler[t], this);
|
|
2531
|
+
}
|
|
2532
|
+
/**
|
|
2533
|
+
* Remove all event handlers from the grid. This is useful for cleanup when destroying a grid.
|
|
2534
|
+
*
|
|
2535
|
+
* @returns the grid instance for chaining
|
|
2536
|
+
*
|
|
2537
|
+
* @example
|
|
2538
|
+
* grid.offAll(); // Remove all event listeners
|
|
2539
|
+
*/
|
|
2540
|
+
offAll() {
|
|
2541
|
+
return Object.keys(this._gsEventHandler).forEach((t) => this.off(t)), this;
|
|
2542
|
+
}
|
|
2543
|
+
/**
|
|
2544
|
+
* Removes widget from the grid.
|
|
2545
|
+
* @param el widget or selector to modify
|
|
2546
|
+
* @param removeDOM if `false` DOM element won't be removed from the tree (Default? true).
|
|
2547
|
+
* @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
|
|
2548
|
+
*/
|
|
2549
|
+
removeWidget(t, e = !0, i = !0) {
|
|
2550
|
+
return t ? (c.getElements(t).forEach((s) => {
|
|
2551
|
+
if (s.parentElement && s.parentElement !== this.el)
|
|
2552
|
+
return;
|
|
2553
|
+
let r = s.gridstackNode;
|
|
2554
|
+
r || (r = this.engine.nodes.find((n) => s === n.el)), r && (e && c.addRemoveCB && c.addRemoveCB(this.el, r, !1, !1), delete s.gridstackNode, this._removeDD(s), this.engine.removeNode(r, e, i), e && s.parentElement && s.remove());
|
|
2555
|
+
}), i && (this._triggerRemoveEvent(), this._triggerChangeEvent()), this) : (console.error("Error: GridStack.removeWidget(undefined) called"), this);
|
|
2556
|
+
}
|
|
2557
|
+
/**
|
|
2558
|
+
* Removes all widgets from the grid.
|
|
2559
|
+
* @param removeDOM if `false` DOM elements won't be removed from the tree (Default? `true`).
|
|
2560
|
+
* @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
|
|
2561
|
+
*/
|
|
2562
|
+
removeAll(t = !0, e = !0) {
|
|
2563
|
+
return this.engine.nodes.forEach((i) => {
|
|
2564
|
+
t && c.addRemoveCB && c.addRemoveCB(this.el, i, !1, !1), delete i.el.gridstackNode, this.opts.staticGrid || this._removeDD(i.el);
|
|
2565
|
+
}), this.engine.removeAll(t, e), e && this._triggerRemoveEvent(), this;
|
|
2566
|
+
}
|
|
2567
|
+
/**
|
|
2568
|
+
* Toggle the grid animation state. Toggles the `grid-stack-animate` class.
|
|
2569
|
+
* @param doAnimate if true the grid will animate.
|
|
2570
|
+
* @param delay if true setting will be set on next event loop.
|
|
2571
|
+
*/
|
|
2572
|
+
setAnimation(t = this.opts.animate, e) {
|
|
2573
|
+
return e ? setTimeout(() => {
|
|
2574
|
+
this.opts && this.setAnimation(t);
|
|
2575
|
+
}) : t ? this.el.classList.add("grid-stack-animate") : this.el.classList.remove("grid-stack-animate"), this.opts.animate = t, this;
|
|
2576
|
+
}
|
|
2577
|
+
/** @internal */
|
|
2578
|
+
hasAnimationCSS() {
|
|
2579
|
+
return this.el.classList.contains("grid-stack-animate");
|
|
2580
|
+
}
|
|
2581
|
+
/**
|
|
2582
|
+
* Toggle the grid static state, which permanently removes/add Drag&Drop support, unlike disable()/enable() that just turns it off/on.
|
|
2583
|
+
* Also toggle the grid-stack-static class.
|
|
2584
|
+
* @param val if true the grid become static.
|
|
2585
|
+
* @param updateClass true (default) if css class gets updated
|
|
2586
|
+
* @param recurse true (default) if sub-grids also get updated
|
|
2587
|
+
*/
|
|
2588
|
+
setStatic(t, e = !0, i = !0) {
|
|
2589
|
+
return !!this.opts.staticGrid === t ? this : (t ? this.opts.staticGrid = !0 : delete this.opts.staticGrid, this._setupRemoveDrop(), this._setupAcceptWidget(), this.engine.nodes.forEach((s) => {
|
|
2590
|
+
this.prepareDragDrop(s.el), s.subGrid && i && s.subGrid.setStatic(t, e, i);
|
|
2591
|
+
}), e && this._setStaticClass(), this);
|
|
2592
|
+
}
|
|
2593
|
+
/**
|
|
2594
|
+
* Updates the passed in options on the grid (similar to update(widget) for for the grid options).
|
|
2595
|
+
* @param options PARTIAL grid options to update - only items specified will be updated.
|
|
2596
|
+
* NOTE: not all options updating are currently supported (lot of code, unlikely to change)
|
|
2597
|
+
*/
|
|
2598
|
+
updateOptions(t) {
|
|
2599
|
+
const e = this.opts;
|
|
2600
|
+
return t === e ? this : (t.acceptWidgets !== void 0 && (e.acceptWidgets = t.acceptWidgets, this._setupAcceptWidget()), t.animate !== void 0 && this.setAnimation(t.animate), t.cellHeight && this.cellHeight(t.cellHeight), t.class !== void 0 && t.class !== e.class && (e.class && this.el.classList.remove(e.class), t.class && this.el.classList.add(t.class)), t.columnOpts ? (this.opts.columnOpts = t.columnOpts, this.checkDynamicColumn()) : t.columnOpts === null && this.opts.columnOpts ? (delete this.opts.columnOpts, this._updateResizeEvent()) : typeof t.column == "number" && this.column(t.column), t.margin !== void 0 && this.margin(t.margin), t.staticGrid !== void 0 && this.setStatic(t.staticGrid), t.disableDrag !== void 0 && !t.staticGrid && this.enableMove(!t.disableDrag), t.disableResize !== void 0 && !t.staticGrid && this.enableResize(!t.disableResize), t.float !== void 0 && this.float(t.float), t.row !== void 0 ? (e.minRow = e.maxRow = e.row = t.row, this._updateContainerHeight()) : (t.minRow !== void 0 && (e.minRow = t.minRow, this._updateContainerHeight()), t.maxRow !== void 0 && (e.maxRow = t.maxRow)), t.lazyLoad !== void 0 && (e.lazyLoad = t.lazyLoad), t.children?.length && this.load(t.children), this);
|
|
2601
|
+
}
|
|
2602
|
+
/**
|
|
2603
|
+
* Updates widget position/size and other info. This is used to change widget properties after creation.
|
|
2604
|
+
* Can update position, size, content, and other widget properties.
|
|
2605
|
+
*
|
|
2606
|
+
* Note: If you need to call this on all nodes, use load() instead which will update what changed.
|
|
2607
|
+
* Setting the same x,y for multiple items will be indeterministic and likely unwanted.
|
|
2608
|
+
*
|
|
2609
|
+
* @param els widget element(s) or selector to modify
|
|
2610
|
+
* @param opt new widget options (x,y,w,h, etc.). Only those set will be updated.
|
|
2611
|
+
* @returns the grid instance for chaining
|
|
2612
|
+
*
|
|
2613
|
+
* @example
|
|
2614
|
+
* // Update widget size and position
|
|
2615
|
+
* grid.update('.my-widget', { x: 2, y: 1, w: 3, h: 2 });
|
|
2616
|
+
*
|
|
2617
|
+
* // Update widget content
|
|
2618
|
+
* grid.update(widget, { content: '<p>New content</p>' });
|
|
2619
|
+
*
|
|
2620
|
+
* // Update multiple properties
|
|
2621
|
+
* grid.update('#my-widget', {
|
|
2622
|
+
* w: 4,
|
|
2623
|
+
* h: 3,
|
|
2624
|
+
* noResize: true,
|
|
2625
|
+
* locked: true
|
|
2626
|
+
* });
|
|
2627
|
+
*/
|
|
2628
|
+
update(t, e) {
|
|
2629
|
+
return c.getElements(t).forEach((i) => {
|
|
2630
|
+
const s = i?.gridstackNode;
|
|
2631
|
+
if (!s)
|
|
2632
|
+
return;
|
|
2633
|
+
const r = { ...h.copyPos({}, s), ...h.cloneDeep(e) };
|
|
2634
|
+
this.engine.nodeBoundFix(r), delete r.autoPosition;
|
|
2635
|
+
const n = ["x", "y", "w", "h"];
|
|
2636
|
+
let o;
|
|
2637
|
+
if (n.some((a) => r[a] !== void 0 && r[a] !== s[a]) && (o = {}, n.forEach((a) => {
|
|
2638
|
+
o[a] = r[a] !== void 0 ? r[a] : s[a], delete r[a];
|
|
2639
|
+
})), !o && (r.minW || r.minH || r.maxW || r.maxH) && (o = {}), r.content !== void 0) {
|
|
2640
|
+
const a = i.querySelector(".grid-stack-item-content");
|
|
2641
|
+
a && a.textContent !== r.content && (s.content = r.content, c.renderCB(a, r), s.subGrid?.el && (a.appendChild(s.subGrid.el), s.subGrid._updateContainerHeight())), delete r.content;
|
|
2642
|
+
}
|
|
2643
|
+
let d = !1, l = !1;
|
|
2644
|
+
for (const a in r)
|
|
2645
|
+
a[0] !== "_" && s[a] !== r[a] && (s[a] = r[a], d = !0, l = l || !this.opts.staticGrid && (a === "noResize" || a === "noMove" || a === "locked"));
|
|
2646
|
+
if (h.sanitizeMinMax(s), o) {
|
|
2647
|
+
const a = o.w !== void 0 && o.w !== s.w;
|
|
2648
|
+
this.moveNode(s, o), a && s.subGrid ? s.subGrid.onResize(this.hasAnimationCSS() ? s.w : void 0) : this.resizeToContentCheck(a, s), delete s._orig;
|
|
2649
|
+
}
|
|
2650
|
+
(o || d) && this._writeAttr(i, s), l && this.prepareDragDrop(s.el), c.updateCB && c.updateCB(s);
|
|
2651
|
+
}), this;
|
|
2652
|
+
}
|
|
2653
|
+
moveNode(t, e) {
|
|
2654
|
+
const i = t._updating;
|
|
2655
|
+
i || this.engine.cleanNodes().beginUpdate(t), this.engine.moveNode(t, e), this._updateContainerHeight(), i || (this._triggerChangeEvent(), this.engine.endUpdate());
|
|
2656
|
+
}
|
|
2657
|
+
/**
|
|
2658
|
+
* Updates widget height to match the content height to avoid vertical scrollbars or dead space.
|
|
2659
|
+
* This automatically adjusts the widget height based on its content size.
|
|
2660
|
+
*
|
|
2661
|
+
* Note: This assumes only 1 child under resizeToContentParent='.grid-stack-item-content'
|
|
2662
|
+
* (sized to gridItem minus padding) that represents the entire content size.
|
|
2663
|
+
*
|
|
2664
|
+
* @param el the grid item element to resize
|
|
2665
|
+
*
|
|
2666
|
+
* @example
|
|
2667
|
+
* // Resize a widget to fit its content
|
|
2668
|
+
* const widget = document.querySelector('.grid-stack-item');
|
|
2669
|
+
* grid.resizeToContent(widget);
|
|
2670
|
+
*
|
|
2671
|
+
* // This is commonly used with dynamic content:
|
|
2672
|
+
* widget.querySelector('.content').innerHTML = 'New longer content...';
|
|
2673
|
+
* grid.resizeToContent(widget);
|
|
2674
|
+
*/
|
|
2675
|
+
resizeToContent(t) {
|
|
2676
|
+
if (!t || (t.classList.remove("size-to-content-max"), !t.clientHeight))
|
|
2677
|
+
return;
|
|
2678
|
+
const e = t.gridstackNode;
|
|
2679
|
+
if (!e)
|
|
2680
|
+
return;
|
|
2681
|
+
const i = e.grid;
|
|
2682
|
+
if (!i || t.parentElement !== i.el)
|
|
2683
|
+
return;
|
|
2684
|
+
const s = i.getCellHeight(!0);
|
|
2685
|
+
if (!s)
|
|
2686
|
+
return;
|
|
2687
|
+
let r = e.h ? e.h * s : t.clientHeight, n;
|
|
2688
|
+
if (e.resizeToContentParent && (n = t.querySelector(e.resizeToContentParent)), n || (n = t.querySelector(c.resizeToContentParent)), !n)
|
|
2689
|
+
return;
|
|
2690
|
+
const o = t.clientHeight - n.clientHeight, d = e.h ? e.h * s - o : n.clientHeight;
|
|
2691
|
+
let l;
|
|
2692
|
+
if (e.subGrid) {
|
|
2693
|
+
l = e.subGrid.getRow() * e.subGrid.getCellHeight(!0);
|
|
2694
|
+
const g = e.subGrid.el.getBoundingClientRect(), p = t.getBoundingClientRect();
|
|
2695
|
+
l += g.top - p.top;
|
|
2696
|
+
} else {
|
|
2697
|
+
if (e.subGridOpts?.children?.length)
|
|
2698
|
+
return;
|
|
2699
|
+
{
|
|
2700
|
+
const g = n.firstElementChild;
|
|
2701
|
+
if (!g) {
|
|
2702
|
+
console.error(`Error: GridStack.resizeToContent() widget id:${e.id} '${c.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);
|
|
2703
|
+
return;
|
|
2704
|
+
}
|
|
2705
|
+
l = g.getBoundingClientRect().height || d;
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
if (d === l)
|
|
2709
|
+
return;
|
|
2710
|
+
r += l - d;
|
|
2711
|
+
let a = Math.ceil(r / s);
|
|
2712
|
+
const u = Number.isInteger(e.sizeToContent) ? e.sizeToContent : 0;
|
|
2713
|
+
u && a > u && (a = u, t.classList.add("size-to-content-max")), e.minH && a < e.minH ? a = e.minH : e.maxH && a > e.maxH && (a = e.maxH), a !== e.h && (i._ignoreLayoutsNodeChange = !0, i.moveNode(e, { h: a }), delete i._ignoreLayoutsNodeChange);
|
|
2714
|
+
}
|
|
2715
|
+
/** call the user resize (so they can do extra work) else our build in version */
|
|
2716
|
+
resizeToContentCBCheck(t) {
|
|
2717
|
+
c.resizeToContentCB ? c.resizeToContentCB(t) : this.resizeToContent(t);
|
|
2718
|
+
}
|
|
2719
|
+
/**
|
|
2720
|
+
* Rotate widgets by swapping their width and height. This is typically called when the user presses 'r' during dragging.
|
|
2721
|
+
* The rotation swaps the w/h dimensions and adjusts min/max constraints accordingly.
|
|
2722
|
+
*
|
|
2723
|
+
* @param els widget element(s) or selector to rotate
|
|
2724
|
+
* @param relative optional pixel coordinate relative to upper/left corner to rotate around (keeps that cell under cursor)
|
|
2725
|
+
* @returns the grid instance for chaining
|
|
2726
|
+
*
|
|
2727
|
+
* @example
|
|
2728
|
+
* // Rotate a specific widget
|
|
2729
|
+
* grid.rotate('.my-widget');
|
|
2730
|
+
*
|
|
2731
|
+
* // Rotate with relative positioning during drag
|
|
2732
|
+
* grid.rotate(widget, { left: 50, top: 30 });
|
|
2733
|
+
*/
|
|
2734
|
+
rotate(t, e) {
|
|
2735
|
+
return c.getElements(t).forEach((i) => {
|
|
2736
|
+
const s = i.gridstackNode;
|
|
2737
|
+
if (!h.canBeRotated(s))
|
|
2738
|
+
return;
|
|
2739
|
+
const r = { w: s.h, h: s.w, minH: s.minW, minW: s.minH, maxH: s.maxW, maxW: s.maxH };
|
|
2740
|
+
if (e) {
|
|
2741
|
+
const o = e.left > 0 ? Math.floor(e.left / this.cellWidth()) : 0, d = e.top > 0 ? Math.floor(e.top / this.opts.cellHeight) : 0;
|
|
2742
|
+
r.x = s.x + o - (s.h - (d + 1)), r.y = s.y + d - o;
|
|
2743
|
+
}
|
|
2744
|
+
Object.keys(r).forEach((o) => {
|
|
2745
|
+
r[o] === void 0 && delete r[o];
|
|
2746
|
+
});
|
|
2747
|
+
const n = s._orig;
|
|
2748
|
+
this.update(i, r), s._orig = n;
|
|
2749
|
+
}), this;
|
|
2750
|
+
}
|
|
2751
|
+
/**
|
|
2752
|
+
* Updates the margins which will set all 4 sides at once - see `GridStackOptions.margin` for format options.
|
|
2753
|
+
* Supports CSS string format of 1, 2, or 4 values or a single number.
|
|
2754
|
+
*
|
|
2755
|
+
* @param value margin value - can be:
|
|
2756
|
+
* - Single number: `10` (applies to all sides)
|
|
2757
|
+
* - Two values: `'10px 20px'` (top/bottom, left/right)
|
|
2758
|
+
* - Four values: `'10px 20px 5px 15px'` (top, right, bottom, left)
|
|
2759
|
+
* @returns the grid instance for chaining
|
|
2760
|
+
*
|
|
2761
|
+
* @example
|
|
2762
|
+
* grid.margin(10); // 10px all sides
|
|
2763
|
+
* grid.margin('10px 20px'); // 10px top/bottom, 20px left/right
|
|
2764
|
+
* grid.margin('5px 10px 15px 20px'); // Different for each side
|
|
2765
|
+
*/
|
|
2766
|
+
margin(t) {
|
|
2767
|
+
if (!(typeof t == "string" && t.split(" ").length > 1)) {
|
|
2768
|
+
const i = h.parseHeight(t);
|
|
2769
|
+
if (this.opts.marginUnit === i.unit && this.opts.margin === i.h)
|
|
2770
|
+
return;
|
|
2771
|
+
}
|
|
2772
|
+
return this.opts.margin = t, this.opts.marginTop = this.opts.marginBottom = this.opts.marginLeft = this.opts.marginRight = void 0, this._initMargin(), this;
|
|
2773
|
+
}
|
|
2774
|
+
/**
|
|
2775
|
+
* Returns the current margin value as a number (undefined if the 4 sides don't match).
|
|
2776
|
+
* This only returns a number if all sides have the same margin value.
|
|
2777
|
+
*
|
|
2778
|
+
* @returns the margin value in pixels, or undefined if sides have different values
|
|
2779
|
+
*
|
|
2780
|
+
* @example
|
|
2781
|
+
* const margin = grid.getMargin();
|
|
2782
|
+
* if (margin !== undefined) {
|
|
2783
|
+
* console.log('Uniform margin:', margin, 'px');
|
|
2784
|
+
* } else {
|
|
2785
|
+
* console.log('Margins are different on different sides');
|
|
2786
|
+
* }
|
|
2787
|
+
*/
|
|
2788
|
+
getMargin() {
|
|
2789
|
+
return this.opts.margin;
|
|
2790
|
+
}
|
|
2791
|
+
/**
|
|
2792
|
+
* Returns true if the height of the grid will be less than the vertical
|
|
2793
|
+
* constraint. Always returns true if grid doesn't have height constraint.
|
|
2794
|
+
* @param node contains x,y,w,h,auto-position options
|
|
2795
|
+
*
|
|
2796
|
+
* @example
|
|
2797
|
+
* if (grid.willItFit(newWidget)) {
|
|
2798
|
+
* grid.addWidget(newWidget);
|
|
2799
|
+
* } else {
|
|
2800
|
+
* alert('Not enough free space to place the widget');
|
|
2801
|
+
* }
|
|
2802
|
+
*/
|
|
2803
|
+
willItFit(t) {
|
|
2804
|
+
return this.engine.willItFit(t);
|
|
2805
|
+
}
|
|
2806
|
+
/** @internal */
|
|
2807
|
+
_triggerChangeEvent() {
|
|
2808
|
+
if (this.engine.batchMode)
|
|
2809
|
+
return this;
|
|
2810
|
+
const t = this.engine.getDirtyNodes(!0);
|
|
2811
|
+
return t && t.length && (this._ignoreLayoutsNodeChange || this.engine.layoutsNodesChange(t), this._triggerEvent("change", t)), this.engine.saveInitial(), this;
|
|
2812
|
+
}
|
|
2813
|
+
/** @internal */
|
|
2814
|
+
_triggerAddEvent() {
|
|
2815
|
+
if (this.engine.batchMode)
|
|
2816
|
+
return this;
|
|
2817
|
+
if (this.engine.addedNodes?.length) {
|
|
2818
|
+
this._ignoreLayoutsNodeChange || this.engine.layoutsNodesChange(this.engine.addedNodes), this.engine.addedNodes.forEach((e) => {
|
|
2819
|
+
delete e._dirty;
|
|
2820
|
+
});
|
|
2821
|
+
const t = [...this.engine.addedNodes];
|
|
2822
|
+
this.engine.addedNodes = [], this._triggerEvent("added", t);
|
|
2823
|
+
}
|
|
2824
|
+
return this;
|
|
2825
|
+
}
|
|
2826
|
+
/** @internal */
|
|
2827
|
+
_triggerRemoveEvent() {
|
|
2828
|
+
if (this.engine.batchMode)
|
|
2829
|
+
return this;
|
|
2830
|
+
if (this.engine.removedNodes?.length) {
|
|
2831
|
+
const t = [...this.engine.removedNodes];
|
|
2832
|
+
this.engine.removedNodes = [], this._triggerEvent("removed", t);
|
|
2833
|
+
}
|
|
2834
|
+
return this;
|
|
2835
|
+
}
|
|
2836
|
+
/** @internal */
|
|
2837
|
+
_triggerEvent(t, e) {
|
|
2838
|
+
const i = e ? new CustomEvent(t, { bubbles: !1, detail: e }) : new Event(t);
|
|
2839
|
+
let s = this;
|
|
2840
|
+
for (; s.parentGridNode; )
|
|
2841
|
+
s = s.parentGridNode.grid;
|
|
2842
|
+
return s.el.dispatchEvent(i), this;
|
|
2843
|
+
}
|
|
2844
|
+
/** @internal */
|
|
2845
|
+
_updateContainerHeight() {
|
|
2846
|
+
if (!this.engine || this.engine.batchMode)
|
|
2847
|
+
return this;
|
|
2848
|
+
const t = this.parentGridNode;
|
|
2849
|
+
let e = this.getRow() + this._extraDragRow;
|
|
2850
|
+
const i = this.opts.cellHeight, s = this.opts.cellHeightUnit;
|
|
2851
|
+
if (!i)
|
|
2852
|
+
return this;
|
|
2853
|
+
if (!t && !this.opts.minRow) {
|
|
2854
|
+
const r = h.parseHeight(getComputedStyle(this.el).minHeight);
|
|
2855
|
+
if (r.h > 0 && r.unit === s) {
|
|
2856
|
+
const n = Math.floor(r.h / i);
|
|
2857
|
+
e < n && (e = n);
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
return this.el.setAttribute("gs-current-row", String(e)), this.el.style.removeProperty("min-height"), this.el.style.removeProperty("height"), e && (this.el.style[t ? "minHeight" : "height"] = e * i + s), t && h.shouldSizeToContent(t) && t.grid.resizeToContentCBCheck(t.el), this;
|
|
2861
|
+
}
|
|
2862
|
+
/** @internal */
|
|
2863
|
+
_prepareElement(t, e = !1, i) {
|
|
2864
|
+
i = i || this._readAttr(t), t.gridstackNode = i, i.el = t, i.grid = this, i = this.engine.addNode(i, e), this._writeAttr(t, i), t.classList.add(v.itemClass, this.opts.itemClass);
|
|
2865
|
+
const s = h.shouldSizeToContent(i);
|
|
2866
|
+
return s ? t.classList.add("size-to-content") : t.classList.remove("size-to-content"), s && this.resizeToContentCheck(!1, i), h.lazyLoad(i) || this.prepareDragDrop(i.el), this;
|
|
2867
|
+
}
|
|
2868
|
+
/** @internal write position CSS vars and x,y,w,h attributes (not used for CSS but by users) back to element */
|
|
2869
|
+
_writePosAttr(t, e) {
|
|
2870
|
+
return (!e._moving && !e._resizing || this._placeholder === t) && (t.style.top = e.y ? e.y === 1 ? "var(--gs-cell-height)" : `calc(${e.y} * var(--gs-cell-height))` : null, t.style.left = e.x ? e.x === 1 ? "var(--gs-column-width)" : `calc(${e.x} * var(--gs-column-width))` : null, t.style.width = e.w > 1 ? `calc(${e.w} * var(--gs-column-width))` : null, t.style.height = e.h > 1 ? `calc(${e.h} * var(--gs-cell-height))` : null), t.setAttribute("gs-x", String(e.x)), t.setAttribute("gs-y", String(e.y)), e.w > 1 ? t.setAttribute("gs-w", String(e.w)) : t.removeAttribute("gs-w"), e.h > 1 ? t.setAttribute("gs-h", String(e.h)) : t.removeAttribute("gs-h"), this;
|
|
2871
|
+
}
|
|
2872
|
+
/** @internal call to write any default attributes back to element */
|
|
2873
|
+
_writeAttr(t, e) {
|
|
2874
|
+
if (!e)
|
|
2875
|
+
return this;
|
|
2876
|
+
this._writePosAttr(t, e);
|
|
2877
|
+
const i = {
|
|
2878
|
+
// autoPosition: 'gs-auto-position', // no need to write out as already in node and doesn't affect CSS
|
|
2879
|
+
noResize: "gs-no-resize",
|
|
2880
|
+
noMove: "gs-no-move",
|
|
2881
|
+
locked: "gs-locked",
|
|
2882
|
+
id: "gs-id",
|
|
2883
|
+
sizeToContent: "gs-size-to-content"
|
|
2884
|
+
};
|
|
2885
|
+
for (const s in i)
|
|
2886
|
+
e[s] ? t.setAttribute(i[s], String(e[s])) : t.removeAttribute(i[s]);
|
|
2887
|
+
return this;
|
|
2888
|
+
}
|
|
2889
|
+
/** @internal call to read any default attributes from element */
|
|
2890
|
+
_readAttr(t, e = !0) {
|
|
2891
|
+
const i = {};
|
|
2892
|
+
i.x = h.toNumber(t.getAttribute("gs-x")), i.y = h.toNumber(t.getAttribute("gs-y")), i.w = h.toNumber(t.getAttribute("gs-w")), i.h = h.toNumber(t.getAttribute("gs-h")), i.autoPosition = h.toBool(t.getAttribute("gs-auto-position")), i.noResize = h.toBool(t.getAttribute("gs-no-resize")), i.noMove = h.toBool(t.getAttribute("gs-no-move")), i.locked = h.toBool(t.getAttribute("gs-locked"));
|
|
2893
|
+
const s = t.getAttribute("gs-size-to-content");
|
|
2894
|
+
s && (s === "true" || s === "false" ? i.sizeToContent = h.toBool(s) : i.sizeToContent = parseInt(s, 10)), i.id = t.getAttribute("gs-id"), i.maxW = h.toNumber(t.getAttribute("gs-max-w")), i.minW = h.toNumber(t.getAttribute("gs-min-w")), i.maxH = h.toNumber(t.getAttribute("gs-max-h")), i.minH = h.toNumber(t.getAttribute("gs-min-h")), e && (i.w === 1 && t.removeAttribute("gs-w"), i.h === 1 && t.removeAttribute("gs-h"), i.maxW && t.removeAttribute("gs-max-w"), i.minW && t.removeAttribute("gs-min-w"), i.maxH && t.removeAttribute("gs-max-h"), i.minH && t.removeAttribute("gs-min-h"));
|
|
2895
|
+
for (const r in i) {
|
|
2896
|
+
if (!i.hasOwnProperty(r))
|
|
2897
|
+
return;
|
|
2898
|
+
!i[r] && i[r] !== 0 && r !== "sizeToContent" && delete i[r];
|
|
2899
|
+
}
|
|
2900
|
+
return i;
|
|
2901
|
+
}
|
|
2902
|
+
/** @internal */
|
|
2903
|
+
_setStaticClass() {
|
|
2904
|
+
const t = ["grid-stack-static"];
|
|
2905
|
+
return this.opts.staticGrid ? (this.el.classList.add(...t), this.el.setAttribute("gs-static", "true")) : (this.el.classList.remove(...t), this.el.removeAttribute("gs-static")), this;
|
|
2906
|
+
}
|
|
2907
|
+
/**
|
|
2908
|
+
* called when we are being resized - check if the one Column Mode needs to be turned on/off
|
|
2909
|
+
* and remember the prev columns we used, or get our count from parent, as well as check for cellHeight==='auto' (square)
|
|
2910
|
+
* or `sizeToContent` gridItem options.
|
|
2911
|
+
*/
|
|
2912
|
+
onResize(t = this.el?.clientWidth) {
|
|
2913
|
+
if (!t || this.prevWidth === t)
|
|
2914
|
+
return;
|
|
2915
|
+
this.prevWidth = t, this.batchUpdate();
|
|
2916
|
+
let e = !1;
|
|
2917
|
+
return this._autoColumn && this.parentGridNode ? this.opts.column !== this.parentGridNode.w && (this.column(this.parentGridNode.w, this.opts.layout || "list"), e = !0) : e = this.checkDynamicColumn(), this._isAutoCellHeight && this.cellHeight(), this.engine.nodes.forEach((i) => {
|
|
2918
|
+
i.subGrid && i.subGrid.onResize();
|
|
2919
|
+
}), this._skipInitialResize || this.resizeToContentCheck(e), delete this._skipInitialResize, this.batchUpdate(!1), this;
|
|
2920
|
+
}
|
|
2921
|
+
/** resizes content for given node (or all) if shouldSizeToContent() is true */
|
|
2922
|
+
resizeToContentCheck(t = !1, e = void 0) {
|
|
2923
|
+
if (this.engine) {
|
|
2924
|
+
if (t && this.hasAnimationCSS())
|
|
2925
|
+
return setTimeout(() => this.resizeToContentCheck(!1, e), this.animationDelay);
|
|
2926
|
+
if (e)
|
|
2927
|
+
h.shouldSizeToContent(e) && this.resizeToContentCBCheck(e.el);
|
|
2928
|
+
else if (this.engine.nodes.some((i) => h.shouldSizeToContent(i))) {
|
|
2929
|
+
const i = [...this.engine.nodes];
|
|
2930
|
+
this.batchUpdate(), i.forEach((s) => {
|
|
2931
|
+
h.shouldSizeToContent(s) && this.resizeToContentCBCheck(s.el);
|
|
2932
|
+
}), this._ignoreLayoutsNodeChange = !0, this.batchUpdate(!1), this._ignoreLayoutsNodeChange = !1;
|
|
2933
|
+
}
|
|
2934
|
+
this._gsEventHandler.resizecontent && this._gsEventHandler.resizecontent(null, e ? [e] : this.engine.nodes);
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
/** add or remove the grid element size event handler */
|
|
2938
|
+
_updateResizeEvent(t = !1) {
|
|
2939
|
+
const e = !this.parentGridNode && (this._isAutoCellHeight || this.opts.sizeToContent || this.opts.columnOpts || this.engine.nodes.find((i) => i.sizeToContent));
|
|
2940
|
+
return !t && e && !this.resizeObserver ? (this._sizeThrottle = h.throttle(() => this.onResize(), this.opts.cellHeightThrottle), this.resizeObserver = new ResizeObserver(() => this._sizeThrottle()), this.resizeObserver.observe(this.el), this._skipInitialResize = !0) : (t || !e) && this.resizeObserver && (this.resizeObserver.disconnect(), delete this.resizeObserver, delete this._sizeThrottle), this;
|
|
2941
|
+
}
|
|
2942
|
+
/** @internal convert a potential selector into actual element */
|
|
2943
|
+
static getElement(t = ".grid-stack-item") {
|
|
2944
|
+
return h.getElement(t);
|
|
2945
|
+
}
|
|
2946
|
+
/** @internal */
|
|
2947
|
+
static getElements(t = ".grid-stack-item") {
|
|
2948
|
+
return h.getElements(t);
|
|
2949
|
+
}
|
|
2950
|
+
/** @internal */
|
|
2951
|
+
static getGridElement(t) {
|
|
2952
|
+
return c.getElement(t);
|
|
2953
|
+
}
|
|
2954
|
+
/** @internal */
|
|
2955
|
+
static getGridElements(t) {
|
|
2956
|
+
return h.getElements(t);
|
|
2957
|
+
}
|
|
2958
|
+
/** @internal initialize margin top/bottom/left/right and units */
|
|
2959
|
+
_initMargin() {
|
|
2960
|
+
let t, e = 0, i = [];
|
|
2961
|
+
typeof this.opts.margin == "string" && (i = this.opts.margin.split(" ")), i.length === 2 ? (this.opts.marginTop = this.opts.marginBottom = i[0], this.opts.marginLeft = this.opts.marginRight = i[1]) : i.length === 4 ? (this.opts.marginTop = i[0], this.opts.marginRight = i[1], this.opts.marginBottom = i[2], this.opts.marginLeft = i[3]) : (t = h.parseHeight(this.opts.margin), this.opts.marginUnit = t.unit, e = this.opts.margin = t.h), ["marginTop", "marginRight", "marginBottom", "marginLeft"].forEach((n) => {
|
|
2962
|
+
this.opts[n] === void 0 ? this.opts[n] = e : (t = h.parseHeight(this.opts[n]), this.opts[n] = t.h, delete this.opts.margin);
|
|
2963
|
+
}), this.opts.marginUnit = t.unit, this.opts.marginTop === this.opts.marginBottom && this.opts.marginLeft === this.opts.marginRight && this.opts.marginTop === this.opts.marginRight && (this.opts.margin = this.opts.marginTop);
|
|
2964
|
+
const r = this.el.style;
|
|
2965
|
+
return r.setProperty("--gs-item-margin-top", `${this.opts.marginTop}${this.opts.marginUnit}`), r.setProperty("--gs-item-margin-bottom", `${this.opts.marginBottom}${this.opts.marginUnit}`), r.setProperty("--gs-item-margin-right", `${this.opts.marginRight}${this.opts.marginUnit}`), r.setProperty("--gs-item-margin-left", `${this.opts.marginLeft}${this.opts.marginUnit}`), this;
|
|
2966
|
+
}
|
|
2967
|
+
/* ===========================================================================================
|
|
2968
|
+
* drag&drop methods that used to be stubbed out and implemented in dd-gridstack.ts
|
|
2969
|
+
* but caused loading issues in prod - see https://github.com/gridstack/gridstack.js/issues/2039
|
|
2970
|
+
* ===========================================================================================
|
|
2971
|
+
*/
|
|
2972
|
+
/**
|
|
2973
|
+
* Get the global drag & drop implementation instance.
|
|
2974
|
+
* This provides access to the underlying drag & drop functionality.
|
|
2975
|
+
*
|
|
2976
|
+
* @returns the DDGridStack instance used for drag & drop operations
|
|
2977
|
+
*
|
|
2978
|
+
* @example
|
|
2979
|
+
* const dd = GridStack.getDD();
|
|
2980
|
+
* // Access drag & drop functionality
|
|
2981
|
+
*/
|
|
2982
|
+
static getDD() {
|
|
2983
|
+
return y;
|
|
2984
|
+
}
|
|
2985
|
+
/**
|
|
2986
|
+
* call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.
|
|
2987
|
+
* Called during GridStack.init() as options, but can also be called directly (last param are used) in case the toolbar
|
|
2988
|
+
* is dynamically create and needs to be set later.
|
|
2989
|
+
* @param dragIn string selector (ex: '.sidebar-item') or list of dom elements
|
|
2990
|
+
* @param dragInOptions options - see DDDragOpt. (default: {handle: '.grid-stack-item-content', appendTo: 'body'}
|
|
2991
|
+
* @param widgets GridStackWidget def to assign to each element which defines what to create on drop
|
|
2992
|
+
* @param root optional root which defaults to document (for shadow dom pass the parent HTMLDocument)
|
|
2993
|
+
*/
|
|
2994
|
+
static setupDragIn(t, e, i, s = document) {
|
|
2995
|
+
e?.pause !== void 0 && (f.pauseDrag = e.pause), e = { appendTo: "body", helper: "clone", ...e || {} }, (typeof t == "string" ? h.getElements(t, s) : t).forEach((n, o) => {
|
|
2996
|
+
y.isDraggable(n) || y.dragIn(n, e), i?.[o] && (n.gridstackNode = i[o]);
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2999
|
+
/**
|
|
3000
|
+
* Enables/Disables dragging by the user for specific grid elements.
|
|
3001
|
+
* For all items and future items, use enableMove() instead. No-op for static grids.
|
|
3002
|
+
*
|
|
3003
|
+
* Note: If you want to prevent an item from moving due to being pushed around by another
|
|
3004
|
+
* during collision, use the 'locked' property instead.
|
|
3005
|
+
*
|
|
3006
|
+
* @param els widget element(s) or selector to modify
|
|
3007
|
+
* @param val if true widget will be draggable, assuming the parent grid isn't noMove or static
|
|
3008
|
+
* @returns the grid instance for chaining
|
|
3009
|
+
*
|
|
3010
|
+
* @example
|
|
3011
|
+
* // Make specific widgets draggable
|
|
3012
|
+
* grid.movable('.my-widget', true);
|
|
3013
|
+
*
|
|
3014
|
+
* // Disable dragging for specific widgets
|
|
3015
|
+
* grid.movable('#fixed-widget', false);
|
|
3016
|
+
*/
|
|
3017
|
+
movable(t, e) {
|
|
3018
|
+
return this.opts.staticGrid ? this : (c.getElements(t).forEach((i) => {
|
|
3019
|
+
const s = i.gridstackNode;
|
|
3020
|
+
s && (e ? delete s.noMove : s.noMove = !0, this.prepareDragDrop(s.el));
|
|
3021
|
+
}), this);
|
|
3022
|
+
}
|
|
3023
|
+
/**
|
|
3024
|
+
* Enables/Disables user resizing for specific grid elements.
|
|
3025
|
+
* For all items and future items, use enableResize() instead. No-op for static grids.
|
|
3026
|
+
*
|
|
3027
|
+
* @param els widget element(s) or selector to modify
|
|
3028
|
+
* @param val if true widget will be resizable, assuming the parent grid isn't noResize or static
|
|
3029
|
+
* @returns the grid instance for chaining
|
|
3030
|
+
*
|
|
3031
|
+
* @example
|
|
3032
|
+
* // Make specific widgets resizable
|
|
3033
|
+
* grid.resizable('.my-widget', true);
|
|
3034
|
+
*
|
|
3035
|
+
* // Disable resizing for specific widgets
|
|
3036
|
+
* grid.resizable('#fixed-size-widget', false);
|
|
3037
|
+
*/
|
|
3038
|
+
resizable(t, e) {
|
|
3039
|
+
return this.opts.staticGrid ? this : (c.getElements(t).forEach((i) => {
|
|
3040
|
+
const s = i.gridstackNode;
|
|
3041
|
+
s && (e ? delete s.noResize : s.noResize = !0, this.prepareDragDrop(s.el));
|
|
3042
|
+
}), this);
|
|
3043
|
+
}
|
|
3044
|
+
/**
|
|
3045
|
+
* Temporarily disables widgets moving/resizing.
|
|
3046
|
+
* If you want a more permanent way (which freezes up resources) use `setStatic(true)` instead.
|
|
3047
|
+
*
|
|
3048
|
+
* Note: This is a no-op for static grids.
|
|
3049
|
+
*
|
|
3050
|
+
* This is a shortcut for:
|
|
3051
|
+
* ```typescript
|
|
3052
|
+
* grid.enableMove(false);
|
|
3053
|
+
* grid.enableResize(false);
|
|
3054
|
+
* ```
|
|
3055
|
+
*
|
|
3056
|
+
* @param recurse if true (default), sub-grids also get updated
|
|
3057
|
+
* @returns the grid instance for chaining
|
|
3058
|
+
*
|
|
3059
|
+
* @example
|
|
3060
|
+
* // Disable all interactions
|
|
3061
|
+
* grid.disable();
|
|
3062
|
+
*
|
|
3063
|
+
* // Disable only this grid, not sub-grids
|
|
3064
|
+
* grid.disable(false);
|
|
3065
|
+
*/
|
|
3066
|
+
disable(t = !0) {
|
|
3067
|
+
if (!this.opts.staticGrid)
|
|
3068
|
+
return this.enableMove(!1, t), this.enableResize(!1, t), this._triggerEvent("disable"), this;
|
|
3069
|
+
}
|
|
3070
|
+
/**
|
|
3071
|
+
* Re-enables widgets moving/resizing - see disable().
|
|
3072
|
+
* Note: This is a no-op for static grids.
|
|
3073
|
+
*
|
|
3074
|
+
* This is a shortcut for:
|
|
3075
|
+
* ```typescript
|
|
3076
|
+
* grid.enableMove(true);
|
|
3077
|
+
* grid.enableResize(true);
|
|
3078
|
+
* ```
|
|
3079
|
+
*
|
|
3080
|
+
* @param recurse if true (default), sub-grids also get updated
|
|
3081
|
+
* @returns the grid instance for chaining
|
|
3082
|
+
*
|
|
3083
|
+
* @example
|
|
3084
|
+
* // Re-enable all interactions
|
|
3085
|
+
* grid.enable();
|
|
3086
|
+
*
|
|
3087
|
+
* // Enable only this grid, not sub-grids
|
|
3088
|
+
* grid.enable(false);
|
|
3089
|
+
*/
|
|
3090
|
+
enable(t = !0) {
|
|
3091
|
+
if (!this.opts.staticGrid)
|
|
3092
|
+
return this.enableMove(!0, t), this.enableResize(!0, t), this._triggerEvent("enable"), this;
|
|
3093
|
+
}
|
|
3094
|
+
/**
|
|
3095
|
+
* Enables/disables widget moving for all widgets. No-op for static grids.
|
|
3096
|
+
* Note: locally defined items (with noMove property) still override this setting.
|
|
3097
|
+
*
|
|
3098
|
+
* @param doEnable if true widgets will be movable, if false moving is disabled
|
|
3099
|
+
* @param recurse if true (default), sub-grids also get updated
|
|
3100
|
+
* @returns the grid instance for chaining
|
|
3101
|
+
*
|
|
3102
|
+
* @example
|
|
3103
|
+
* // Enable moving for all widgets
|
|
3104
|
+
* grid.enableMove(true);
|
|
3105
|
+
*
|
|
3106
|
+
* // Disable moving for all widgets
|
|
3107
|
+
* grid.enableMove(false);
|
|
3108
|
+
*
|
|
3109
|
+
* // Enable only this grid, not sub-grids
|
|
3110
|
+
* grid.enableMove(true, false);
|
|
3111
|
+
*/
|
|
3112
|
+
enableMove(t, e = !0) {
|
|
3113
|
+
return this.opts.staticGrid ? this : (t ? delete this.opts.disableDrag : this.opts.disableDrag = !0, this.engine.nodes.forEach((i) => {
|
|
3114
|
+
this.prepareDragDrop(i.el), i.subGrid && e && i.subGrid.enableMove(t, e);
|
|
3115
|
+
}), this);
|
|
3116
|
+
}
|
|
3117
|
+
/**
|
|
3118
|
+
* Enables/disables widget resizing for all widgets. No-op for static grids.
|
|
3119
|
+
* Note: locally defined items (with noResize property) still override this setting.
|
|
3120
|
+
*
|
|
3121
|
+
* @param doEnable if true widgets will be resizable, if false resizing is disabled
|
|
3122
|
+
* @param recurse if true (default), sub-grids also get updated
|
|
3123
|
+
* @returns the grid instance for chaining
|
|
3124
|
+
*
|
|
3125
|
+
* @example
|
|
3126
|
+
* // Enable resizing for all widgets
|
|
3127
|
+
* grid.enableResize(true);
|
|
3128
|
+
*
|
|
3129
|
+
* // Disable resizing for all widgets
|
|
3130
|
+
* grid.enableResize(false);
|
|
3131
|
+
*
|
|
3132
|
+
* // Enable only this grid, not sub-grids
|
|
3133
|
+
* grid.enableResize(true, false);
|
|
3134
|
+
*/
|
|
3135
|
+
enableResize(t, e = !0) {
|
|
3136
|
+
return this.opts.staticGrid ? this : (t ? delete this.opts.disableResize : this.opts.disableResize = !0, this.engine.nodes.forEach((i) => {
|
|
3137
|
+
this.prepareDragDrop(i.el), i.subGrid && e && i.subGrid.enableResize(t, e);
|
|
3138
|
+
}), this);
|
|
3139
|
+
}
|
|
3140
|
+
/** @internal call when drag (and drop) needs to be cancelled (Esc key) */
|
|
3141
|
+
cancelDrag() {
|
|
3142
|
+
const t = this._placeholder?.gridstackNode;
|
|
3143
|
+
t && (t._isExternal ? (t._isAboutToRemove = !0, this.engine.removeNode(t)) : t._isAboutToRemove && c._itemRemoving(t.el, !1), this.engine.restoreInitial());
|
|
3144
|
+
}
|
|
3145
|
+
/** @internal removes any drag&drop present (called during destroy) */
|
|
3146
|
+
_removeDD(t) {
|
|
3147
|
+
return y.draggable(t, "destroy").resizable(t, "destroy"), t.gridstackNode && delete t.gridstackNode._initDD, delete t.ddElement, this;
|
|
3148
|
+
}
|
|
3149
|
+
/** @internal called to add drag over to support widgets being added externally */
|
|
3150
|
+
_setupAcceptWidget() {
|
|
3151
|
+
if (this.opts.staticGrid || !this.opts.acceptWidgets && !this.opts.removable)
|
|
3152
|
+
return y.droppable(this.el, "destroy"), this;
|
|
3153
|
+
let t, e;
|
|
3154
|
+
const i = (s, r, n) => {
|
|
3155
|
+
n = n || r;
|
|
3156
|
+
const o = n.gridstackNode;
|
|
3157
|
+
if (!o)
|
|
3158
|
+
return;
|
|
3159
|
+
if (!o.grid?.el) {
|
|
3160
|
+
n.style.transform = `scale(${1 / this.dragTransform.xScale},${1 / this.dragTransform.yScale})`;
|
|
3161
|
+
const g = n.getBoundingClientRect();
|
|
3162
|
+
n.style.left = g.x + (this.dragTransform.xScale - 1) * (s.clientX - g.x) / this.dragTransform.xScale + "px", n.style.top = g.y + (this.dragTransform.yScale - 1) * (s.clientY - g.y) / this.dragTransform.yScale + "px", n.style.transformOrigin = "0px 0px";
|
|
3163
|
+
}
|
|
3164
|
+
let { top: d, left: l } = n.getBoundingClientRect();
|
|
3165
|
+
const a = this.el.getBoundingClientRect();
|
|
3166
|
+
l -= a.left, d -= a.top;
|
|
3167
|
+
const u = {
|
|
3168
|
+
position: {
|
|
3169
|
+
top: d * this.dragTransform.xScale,
|
|
3170
|
+
left: l * this.dragTransform.yScale
|
|
3171
|
+
}
|
|
3172
|
+
};
|
|
3173
|
+
if (o._temporaryRemoved) {
|
|
3174
|
+
if (o.x = Math.max(0, Math.round(l / e)), o.y = Math.max(0, Math.round(d / t)), delete o.autoPosition, this.engine.nodeBoundFix(o), !this.engine.willItFit(o)) {
|
|
3175
|
+
if (o.autoPosition = !0, !this.engine.willItFit(o)) {
|
|
3176
|
+
y.off(r, "drag");
|
|
3177
|
+
return;
|
|
3178
|
+
}
|
|
3179
|
+
o._willFitPos && (h.copyPos(o, o._willFitPos), delete o._willFitPos);
|
|
3180
|
+
}
|
|
3181
|
+
this._onStartMoving(n, s, u, o, e, t);
|
|
3182
|
+
} else
|
|
3183
|
+
this._dragOrResize(n, s, u, o, e, t);
|
|
3184
|
+
};
|
|
3185
|
+
return y.droppable(this.el, {
|
|
3186
|
+
accept: (s) => {
|
|
3187
|
+
const r = s.gridstackNode || this._readAttr(s, !1);
|
|
3188
|
+
if (r?.grid === this)
|
|
3189
|
+
return !0;
|
|
3190
|
+
if (!this.opts.acceptWidgets)
|
|
3191
|
+
return !1;
|
|
3192
|
+
let n = !0;
|
|
3193
|
+
if (typeof this.opts.acceptWidgets == "function")
|
|
3194
|
+
n = this.opts.acceptWidgets(s);
|
|
3195
|
+
else {
|
|
3196
|
+
const o = this.opts.acceptWidgets === !0 ? ".grid-stack-item" : this.opts.acceptWidgets;
|
|
3197
|
+
n = s.matches(o);
|
|
3198
|
+
}
|
|
3199
|
+
if (n && r && this.opts.maxRow) {
|
|
3200
|
+
const o = { w: r.w, h: r.h, minW: r.minW, minH: r.minH };
|
|
3201
|
+
n = this.engine.willItFit(o);
|
|
3202
|
+
}
|
|
3203
|
+
return n;
|
|
3204
|
+
}
|
|
3205
|
+
}).on(this.el, "dropover", (s, r, n) => {
|
|
3206
|
+
let o = n?.gridstackNode || r.gridstackNode;
|
|
3207
|
+
if (o?.grid === this && !o._temporaryRemoved)
|
|
3208
|
+
return !1;
|
|
3209
|
+
if (o?._sidebarOrig && (o.w = o._sidebarOrig.w, o.h = o._sidebarOrig.h), o?.grid && o.grid !== this && !o._temporaryRemoved && o.grid._leave(r, n), n = n || r, e = this.cellWidth(), t = this.getCellHeight(!0), !o) {
|
|
3210
|
+
const a = n.getAttribute("data-gs-widget") || n.getAttribute("gridstacknode");
|
|
3211
|
+
if (a) {
|
|
3212
|
+
try {
|
|
3213
|
+
o = JSON.parse(a);
|
|
3214
|
+
} catch {
|
|
3215
|
+
console.error("Gridstack dropover: Bad JSON format: ", a);
|
|
3216
|
+
}
|
|
3217
|
+
n.removeAttribute("data-gs-widget"), n.removeAttribute("gridstacknode");
|
|
3218
|
+
}
|
|
3219
|
+
o || (o = this._readAttr(n)), o._sidebarOrig = { w: o.w, h: o.h };
|
|
3220
|
+
}
|
|
3221
|
+
o.grid || (o.el || (o = { ...o }), o._isExternal = !0, n.gridstackNode = o);
|
|
3222
|
+
const d = o.w || Math.round(n.offsetWidth / e) || 1, l = o.h || Math.round(n.offsetHeight / t) || 1;
|
|
3223
|
+
return o.grid && o.grid !== this ? (r._gridstackNodeOrig || (r._gridstackNodeOrig = o), r.gridstackNode = o = { ...o, w: d, h: l, grid: this }, delete o.x, delete o.y, this.engine.cleanupNode(o).nodeBoundFix(o), o._initDD = o._isExternal = // DOM needs to be re-parented on a drop
|
|
3224
|
+
o._temporaryRemoved = !0) : (o.w = d, o.h = l, o._temporaryRemoved = !0), c._itemRemoving(o.el, !1), y.on(r, "drag", i), i(s, r, n), !1;
|
|
3225
|
+
}).on(this.el, "dropout", (s, r, n) => {
|
|
3226
|
+
const o = n?.gridstackNode || r.gridstackNode;
|
|
3227
|
+
return o && (!o.grid || o.grid === this) && (this._leave(r, n), this._isTemp && this.removeAsSubGrid(o)), !1;
|
|
3228
|
+
}).on(this.el, "drop", (s, r, n) => {
|
|
3229
|
+
const o = n?.gridstackNode || r.gridstackNode;
|
|
3230
|
+
if (o?.grid === this && !o._isExternal)
|
|
3231
|
+
return !1;
|
|
3232
|
+
const d = !!this.placeholder.parentElement, l = r !== n;
|
|
3233
|
+
this.placeholder.remove(), delete this.placeholder.gridstackNode, d && this.opts.animate && (this.setAnimation(!1), this.setAnimation(!0, !0));
|
|
3234
|
+
const a = r._gridstackNodeOrig;
|
|
3235
|
+
if (delete r._gridstackNodeOrig, d && a?.grid && a.grid !== this) {
|
|
3236
|
+
const g = a.grid;
|
|
3237
|
+
g.engine.removeNodeFromLayoutCache(a), g.engine.removedNodes.push(a), g._triggerRemoveEvent()._triggerChangeEvent(), g.parentGridNode && !g.engine.nodes.length && g.opts.subGridDynamic && g.removeAsSubGrid();
|
|
3238
|
+
}
|
|
3239
|
+
if (!o || (d && (this.engine.cleanupNode(o), o.grid = this), delete o.grid?._isTemp, y.off(r, "drag"), n !== r ? (n.remove(), r = n) : r.remove(), this._removeDD(r), !d))
|
|
3240
|
+
return !1;
|
|
3241
|
+
const u = o.subGrid?.el?.gridstack;
|
|
3242
|
+
return h.copyPos(o, this._readAttr(this.placeholder)), h.removePositioningStyles(r), l && (o.content || o.subGridOpts || c.addRemoveCB) ? (delete o.el, r = this.addWidget(o)) : (this._prepareElement(r, !0, o), this.el.appendChild(r), this.resizeToContentCheck(!1, o), u && (u.parentGridNode = o), this._updateContainerHeight()), this.engine.addedNodes.push(o), this._triggerAddEvent(), this._triggerChangeEvent(), this.engine.endUpdate(), this._gsEventHandler.dropped && this._gsEventHandler.dropped({ ...s, type: "dropped" }, a && a.grid ? a : void 0, o), !1;
|
|
3243
|
+
}), this;
|
|
3244
|
+
}
|
|
3245
|
+
/** @internal mark item for removal */
|
|
3246
|
+
static _itemRemoving(t, e) {
|
|
3247
|
+
if (!t)
|
|
3248
|
+
return;
|
|
3249
|
+
const i = t ? t.gridstackNode : void 0;
|
|
3250
|
+
!i?.grid || t.classList.contains(i.grid.opts.removableOptions.decline) || (e ? i._isAboutToRemove = !0 : delete i._isAboutToRemove, e ? t.classList.add("grid-stack-item-removing") : t.classList.remove("grid-stack-item-removing"));
|
|
3251
|
+
}
|
|
3252
|
+
/** @internal called to setup a trash drop zone if the user specifies it */
|
|
3253
|
+
_setupRemoveDrop() {
|
|
3254
|
+
if (typeof this.opts.removable != "string")
|
|
3255
|
+
return this;
|
|
3256
|
+
const t = document.querySelector(this.opts.removable);
|
|
3257
|
+
return t ? (!this.opts.staticGrid && !y.isDroppable(t) && y.droppable(t, this.opts.removableOptions).on(t, "dropover", (e, i) => c._itemRemoving(i, !0)).on(t, "dropout", (e, i) => c._itemRemoving(i, !1)), this) : this;
|
|
3258
|
+
}
|
|
3259
|
+
/**
|
|
3260
|
+
* prepares the element for drag&drop - this is normally called by makeWidget() unless are are delay loading
|
|
3261
|
+
* @param el GridItemHTMLElement of the widget
|
|
3262
|
+
* @param [force=false]
|
|
3263
|
+
* */
|
|
3264
|
+
prepareDragDrop(t, e = !1) {
|
|
3265
|
+
const i = t?.gridstackNode;
|
|
3266
|
+
if (!i)
|
|
3267
|
+
return;
|
|
3268
|
+
const s = i.noMove || this.opts.disableDrag, r = i.noResize || this.opts.disableResize, n = this.opts.staticGrid || s && r;
|
|
3269
|
+
if ((e || n) && (i._initDD && (this._removeDD(t), delete i._initDD), n && t.classList.add("ui-draggable-disabled", "ui-resizable-disabled"), !e))
|
|
3270
|
+
return this;
|
|
3271
|
+
if (!i._initDD) {
|
|
3272
|
+
let o, d;
|
|
3273
|
+
const l = (g, p) => {
|
|
3274
|
+
this.triggerEvent(g, g.target), o = this.cellWidth(), d = this.getCellHeight(!0), this._onStartMoving(t, g, p, i, o, d);
|
|
3275
|
+
}, a = (g, p) => {
|
|
3276
|
+
this._dragOrResize(t, g, p, i, o, d);
|
|
3277
|
+
}, u = (g) => {
|
|
3278
|
+
this.placeholder.remove(), delete this.placeholder.gridstackNode, delete i._moving, delete i._resizing, delete i._event, delete i._lastTried;
|
|
3279
|
+
const p = i.w !== i._orig.w, _ = g.target;
|
|
3280
|
+
if (!(!_.gridstackNode || _.gridstackNode.grid !== this)) {
|
|
3281
|
+
if (i.el = _, i._isAboutToRemove) {
|
|
3282
|
+
const E = t.gridstackNode.grid;
|
|
3283
|
+
E._gsEventHandler[g.type] && E._gsEventHandler[g.type](g, _), E.engine.nodes.push(i), E.removeWidget(t, !0, !0);
|
|
3284
|
+
} else
|
|
3285
|
+
h.removePositioningStyles(_), i._temporaryRemoved ? (this._writePosAttr(_, i), this.engine.addNode(i)) : this._writePosAttr(_, i), this.triggerEvent(g, _);
|
|
3286
|
+
this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), g.type === "resizestop" && (Number.isInteger(i.sizeToContent) && (i.sizeToContent = i.h), this.resizeToContentCheck(p, i));
|
|
3287
|
+
}
|
|
3288
|
+
};
|
|
3289
|
+
y.draggable(t, {
|
|
3290
|
+
start: l,
|
|
3291
|
+
stop: u,
|
|
3292
|
+
drag: a
|
|
3293
|
+
}).resizable(t, {
|
|
3294
|
+
start: l,
|
|
3295
|
+
stop: u,
|
|
3296
|
+
resize: a
|
|
3297
|
+
}), i._initDD = !0;
|
|
3298
|
+
}
|
|
3299
|
+
return y.draggable(t, s ? "disable" : "enable").resizable(t, r ? "disable" : "enable"), this;
|
|
3300
|
+
}
|
|
3301
|
+
/** @internal handles actual drag/resize start */
|
|
3302
|
+
_onStartMoving(t, e, i, s, r, n) {
|
|
3303
|
+
if (this.engine.cleanNodes().beginUpdate(s), this._writePosAttr(this.placeholder, s), this.el.appendChild(this.placeholder), this.placeholder.gridstackNode = s, s.grid?.el)
|
|
3304
|
+
this.dragTransform = h.getValuesFromTransformedElement(t);
|
|
3305
|
+
else if (this.placeholder && this.placeholder.closest(".grid-stack")) {
|
|
3306
|
+
const o = this.placeholder.closest(".grid-stack");
|
|
3307
|
+
this.dragTransform = h.getValuesFromTransformedElement(o);
|
|
3308
|
+
} else
|
|
3309
|
+
this.dragTransform = {
|
|
3310
|
+
xScale: 1,
|
|
3311
|
+
xOffset: 0,
|
|
3312
|
+
yScale: 1,
|
|
3313
|
+
yOffset: 0
|
|
3314
|
+
};
|
|
3315
|
+
if (s.el = this.placeholder, s._lastUiPosition = i.position, s._prevYPix = i.position.top, s._moving = e.type === "dragstart", s._resizing = e.type === "resizestart", delete s._lastTried, e.type === "dropover" && s._temporaryRemoved && (this.engine.addNode(s), s._moving = !0), this.engine.cacheRects(r, n, this.opts.marginTop, this.opts.marginRight, this.opts.marginBottom, this.opts.marginLeft), e.type === "resizestart") {
|
|
3316
|
+
const o = this.getColumn() - s.x, d = (this.opts.maxRow || Number.MAX_SAFE_INTEGER) - s.y;
|
|
3317
|
+
y.resizable(t, "option", "minWidth", r * Math.min(s.minW || 1, o)).resizable(t, "option", "minHeight", n * Math.min(s.minH || 1, d)).resizable(t, "option", "maxWidth", r * Math.min(s.maxW || Number.MAX_SAFE_INTEGER, o)).resizable(t, "option", "maxWidthMoveLeft", r * Math.min(s.maxW || Number.MAX_SAFE_INTEGER, s.x + s.w)).resizable(t, "option", "maxHeight", n * Math.min(s.maxH || Number.MAX_SAFE_INTEGER, d)).resizable(t, "option", "maxHeightMoveUp", n * Math.min(s.maxH || Number.MAX_SAFE_INTEGER, s.y + s.h));
|
|
3318
|
+
}
|
|
3319
|
+
}
|
|
3320
|
+
/** @internal handles actual drag/resize */
|
|
3321
|
+
_dragOrResize(t, e, i, s, r, n) {
|
|
3322
|
+
const o = { ...s._orig };
|
|
3323
|
+
let d, l = this.opts.marginLeft, a = this.opts.marginRight, u = this.opts.marginTop, g = this.opts.marginBottom;
|
|
3324
|
+
const p = Math.round(n * 0.1), _ = Math.round(r * 0.1);
|
|
3325
|
+
if (l = Math.min(l, _), a = Math.min(a, _), u = Math.min(u, p), g = Math.min(g, p), e.type === "drag") {
|
|
3326
|
+
if (s._temporaryRemoved)
|
|
3327
|
+
return;
|
|
3328
|
+
const C = i.position.top - s._prevYPix;
|
|
3329
|
+
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && h.updateScrollPosition(t, i.position, C);
|
|
3330
|
+
const M = i.position.left + (i.position.left > s._lastUiPosition.left ? -a : l), I = i.position.top + (i.position.top > s._lastUiPosition.top ? -g : u);
|
|
3331
|
+
o.x = Math.round(M / r), o.y = Math.round(I / n);
|
|
3332
|
+
const U = this._extraDragRow;
|
|
3333
|
+
if (this.engine.collide(s, o)) {
|
|
3334
|
+
const A = this.getRow();
|
|
3335
|
+
let O = Math.max(0, o.y + s.h - A);
|
|
3336
|
+
this.opts.maxRow && A + O > this.opts.maxRow && (O = Math.max(0, this.opts.maxRow - A)), this._extraDragRow = O;
|
|
3337
|
+
} else
|
|
3338
|
+
this._extraDragRow = 0;
|
|
3339
|
+
if (this._extraDragRow !== U && this._updateContainerHeight(), s.x === o.x && s.y === o.y)
|
|
3340
|
+
return;
|
|
3341
|
+
} else if (e.type === "resize") {
|
|
3342
|
+
if (o.x < 0 || (h.updateScrollResize(e, t, n), o.w = Math.round((i.size.width - l) / r), o.h = Math.round((i.size.height - u) / n), s.w === o.w && s.h === o.h) || s._lastTried && s._lastTried.w === o.w && s._lastTried.h === o.h)
|
|
3343
|
+
return;
|
|
3344
|
+
const C = i.position.left + l, M = i.position.top + u;
|
|
3345
|
+
o.x = Math.round(C / r), o.y = Math.round(M / n), d = !0;
|
|
3346
|
+
}
|
|
3347
|
+
s._event = e, s._lastTried = o;
|
|
3348
|
+
const E = {
|
|
3349
|
+
x: i.position.left + l,
|
|
3350
|
+
y: i.position.top + u,
|
|
3351
|
+
w: (i.size ? i.size.width : s.w * r) - l - a,
|
|
3352
|
+
h: (i.size ? i.size.height : s.h * n) - u - g
|
|
3353
|
+
};
|
|
3354
|
+
if (this.engine.moveNodeCheck(s, { ...o, cellWidth: r, cellHeight: n, rect: E, resizing: d })) {
|
|
3355
|
+
s._lastUiPosition = i.position, this.engine.cacheRects(r, n, u, a, g, l), delete s._skipDown, d && s.subGrid && s.subGrid.onResize(), this._extraDragRow = 0, this._updateContainerHeight();
|
|
3356
|
+
const C = e.target;
|
|
3357
|
+
s._sidebarOrig || this._writePosAttr(C, s), this.triggerEvent(e, C);
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
/** call given event callback on our main top-most grid (if we're nested) */
|
|
3361
|
+
triggerEvent(t, e) {
|
|
3362
|
+
let i = this;
|
|
3363
|
+
for (; i.parentGridNode; )
|
|
3364
|
+
i = i.parentGridNode.grid;
|
|
3365
|
+
i._gsEventHandler[t.type] && i._gsEventHandler[t.type](t, e);
|
|
3366
|
+
}
|
|
3367
|
+
/** @internal called when item leaving our area by either cursor dropout event
|
|
3368
|
+
* or shape is outside our boundaries. remove it from us, and mark temporary if this was
|
|
3369
|
+
* our item to start with else restore prev node values from prev grid it came from.
|
|
3370
|
+
*/
|
|
3371
|
+
_leave(t, e) {
|
|
3372
|
+
e = e || t;
|
|
3373
|
+
const i = e.gridstackNode;
|
|
3374
|
+
if (!i || (e.style.transform = e.style.transformOrigin = null, y.off(t, "drag"), i._temporaryRemoved))
|
|
3375
|
+
return;
|
|
3376
|
+
i._temporaryRemoved = !0, this.engine.removeNode(i), i.el = i._isExternal && e ? e : t;
|
|
3377
|
+
const s = i._sidebarOrig;
|
|
3378
|
+
i._isExternal && this.engine.cleanupNode(i), i._sidebarOrig = s, this.opts.removable === !0 && c._itemRemoving(t, !0), t._gridstackNodeOrig ? (t.gridstackNode = t._gridstackNodeOrig, delete t._gridstackNodeOrig) : i._isExternal && this.engine.restoreInitial();
|
|
3379
|
+
}
|
|
3380
|
+
}
|
|
3381
|
+
c.renderCB = (m, t) => {
|
|
3382
|
+
m && t?.content && (m.textContent = t.content);
|
|
3383
|
+
};
|
|
3384
|
+
c.resizeToContentParent = ".grid-stack-item-content";
|
|
3385
|
+
c.Utils = h;
|
|
3386
|
+
c.Engine = x;
|
|
3387
|
+
c.GDRev = "12.4.2";
|
|
3388
|
+
export {
|
|
3389
|
+
c as G
|
|
3390
|
+
};
|