@vertesia/ui 0.55.0 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/code/index.js +3 -0
- package/lib/esm/code/index.js.map +1 -0
- package/lib/esm/core/components/Avatar.js +31 -0
- package/lib/esm/core/components/Avatar.js.map +1 -0
- package/lib/esm/core/components/Badge.js +62 -0
- package/lib/esm/core/components/Badge.js.map +1 -0
- package/lib/esm/core/components/Button.js +32 -0
- package/lib/esm/core/components/Button.js.map +1 -0
- package/lib/esm/core/components/Center.js +6 -0
- package/lib/esm/core/components/Center.js.map +1 -0
- package/lib/esm/core/components/ComboBox.js +356 -0
- package/lib/esm/core/components/ComboBox.js.map +1 -0
- package/lib/esm/core/components/ConfirmModal.js +10 -0
- package/lib/esm/core/components/ConfirmModal.js.map +1 -0
- package/lib/esm/core/components/DeleteModal.js +28 -0
- package/lib/esm/core/components/DeleteModal.js.map +1 -0
- package/lib/esm/core/components/Divider.js +6 -0
- package/lib/esm/core/components/Divider.js.map +1 -0
- package/lib/esm/core/components/Dropdown.js +16 -0
- package/lib/esm/core/components/Dropdown.js.map +1 -0
- package/lib/esm/core/components/DropdownList.js +9 -0
- package/lib/esm/core/components/DropdownList.js.map +1 -0
- package/lib/esm/core/components/EmptyCollection.js +7 -0
- package/lib/esm/core/components/EmptyCollection.js.map +1 -0
- package/lib/esm/core/components/FileUpload.js +119 -0
- package/lib/esm/core/components/FileUpload.js.map +1 -0
- package/lib/esm/core/components/Input.js +16 -0
- package/lib/esm/core/components/Input.js.map +1 -0
- package/lib/esm/core/components/InputList.js +42 -0
- package/lib/esm/core/components/InputList.js.map +1 -0
- package/lib/esm/core/components/Link.js +13 -0
- package/lib/esm/core/components/Link.js.map +1 -0
- package/lib/esm/core/components/MenuList.js +23 -0
- package/lib/esm/core/components/MenuList.js.map +1 -0
- package/lib/esm/core/components/MessageBox.js +66 -0
- package/lib/esm/core/components/MessageBox.js.map +1 -0
- package/lib/esm/core/components/Modal.js +26 -0
- package/lib/esm/core/components/Modal.js.map +1 -0
- package/lib/esm/core/components/NumberInput.js +43 -0
- package/lib/esm/core/components/NumberInput.js.map +1 -0
- package/lib/esm/core/components/Portal.js +28 -0
- package/lib/esm/core/components/Portal.js.map +1 -0
- package/lib/esm/core/components/RadioGroup.js +34 -0
- package/lib/esm/core/components/RadioGroup.js.map +1 -0
- package/lib/esm/core/components/SelectBox.js +68 -0
- package/lib/esm/core/components/SelectBox.js.map +1 -0
- package/lib/esm/core/components/SelectList.js +47 -0
- package/lib/esm/core/components/SelectList.js.map +1 -0
- package/lib/esm/core/components/SelectStack.js +8 -0
- package/lib/esm/core/components/SelectStack.js.map +1 -0
- package/lib/esm/core/components/SidePanel.js +33 -0
- package/lib/esm/core/components/SidePanel.js.map +1 -0
- package/lib/esm/core/components/Spinner.js +18 -0
- package/lib/esm/core/components/Spinner.js.map +1 -0
- package/lib/esm/core/components/Switch.js +12 -0
- package/lib/esm/core/components/Switch.js.map +1 -0
- package/lib/esm/core/components/Textarea.js +15 -0
- package/lib/esm/core/components/Textarea.js.map +1 -0
- package/lib/esm/core/components/index.js +34 -0
- package/lib/esm/core/components/index.js.map +1 -0
- package/lib/esm/core/components/libs/utils.js +6 -0
- package/lib/esm/core/components/libs/utils.js.map +1 -0
- package/lib/esm/core/components/libs/visuallyHidden.js +16 -0
- package/lib/esm/core/components/libs/visuallyHidden.js.map +1 -0
- package/lib/esm/core/components/popup/Popup.js +60 -0
- package/lib/esm/core/components/popup/Popup.js.map +1 -0
- package/lib/esm/core/components/popup/PopupController.js +149 -0
- package/lib/esm/core/components/popup/PopupController.js.map +1 -0
- package/lib/esm/core/components/popup/index.js +4 -0
- package/lib/esm/core/components/popup/index.js.map +1 -0
- package/lib/esm/core/components/popup/position.js +221 -0
- package/lib/esm/core/components/popup/position.js.map +1 -0
- package/lib/esm/core/components/popup/utils.js +74 -0
- package/lib/esm/core/components/popup/utils.js.map +1 -0
- package/lib/esm/core/components/shadcn/breadcrumb.js +30 -0
- package/lib/esm/core/components/shadcn/breadcrumb.js.map +1 -0
- package/lib/esm/core/components/shadcn/button.js +45 -0
- package/lib/esm/core/components/shadcn/button.js.map +1 -0
- package/lib/esm/core/components/shadcn/calendar.js +46 -0
- package/lib/esm/core/components/shadcn/calendar.js.map +1 -0
- package/lib/esm/core/components/shadcn/card.js +17 -0
- package/lib/esm/core/components/shadcn/card.js.map +1 -0
- package/lib/esm/core/components/shadcn/checkbox.js +10 -0
- package/lib/esm/core/components/shadcn/checkbox.js.map +1 -0
- package/lib/esm/core/components/shadcn/command.js +30 -0
- package/lib/esm/core/components/shadcn/command.js.map +1 -0
- package/lib/esm/core/components/shadcn/dialog.js +61 -0
- package/lib/esm/core/components/shadcn/dialog.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/animateChangeInHeight.js +23 -0
- package/lib/esm/core/components/shadcn/filters/animateChangeInHeight.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox.js +82 -0
- package/lib/esm/core/components/shadcn/filters/comboBox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/dateFilter.js +31 -0
- package/lib/esm/core/components/shadcn/filters/dateFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filterBar.js +140 -0
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filters.js +42 -0
- package/lib/esm/core/components/shadcn/filters/filters.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/index.js +6 -0
- package/lib/esm/core/components/shadcn/filters/index.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/selectFilter.js +58 -0
- package/lib/esm/core/components/shadcn/filters/selectFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/textFilter.js +20 -0
- package/lib/esm/core/components/shadcn/filters/textFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/types.js +10 -0
- package/lib/esm/core/components/shadcn/filters/types.js.map +1 -0
- package/lib/esm/core/components/shadcn/heading.js +17 -0
- package/lib/esm/core/components/shadcn/heading.js.map +1 -0
- package/lib/esm/core/components/shadcn/index.js +22 -0
- package/lib/esm/core/components/shadcn/index.js.map +1 -0
- package/lib/esm/core/components/shadcn/input.js +38 -0
- package/lib/esm/core/components/shadcn/input.js.map +1 -0
- package/lib/esm/core/components/shadcn/label.js +11 -0
- package/lib/esm/core/components/shadcn/label.js.map +1 -0
- package/lib/esm/core/components/shadcn/popover.js +50 -0
- package/lib/esm/core/components/shadcn/popover.js.map +1 -0
- package/lib/esm/core/components/shadcn/selectBox.js +62 -0
- package/lib/esm/core/components/shadcn/selectBox.js.map +1 -0
- package/lib/esm/core/components/shadcn/separator.js +8 -0
- package/lib/esm/core/components/shadcn/separator.js.map +1 -0
- package/lib/esm/core/components/shadcn/tabs.js +77 -0
- package/lib/esm/core/components/shadcn/tabs.js.map +1 -0
- package/lib/esm/core/components/shadcn/text.js +30 -0
- package/lib/esm/core/components/shadcn/text.js.map +1 -0
- package/lib/esm/core/components/shadcn/theme/ThemeProvider.js +38 -0
- package/lib/esm/core/components/shadcn/theme/ThemeProvider.js.map +1 -0
- package/lib/esm/core/components/shadcn/theme/ThemeSwitcher.js +13 -0
- package/lib/esm/core/components/shadcn/theme/ThemeSwitcher.js.map +1 -0
- package/lib/esm/core/components/shadcn/tooltip.js +14 -0
- package/lib/esm/core/components/shadcn/tooltip.js.map +1 -0
- package/lib/esm/core/components/styles.js +10 -0
- package/lib/esm/core/components/styles.js.map +1 -0
- package/lib/esm/core/components/table/index.js +20 -0
- package/lib/esm/core/components/table/index.js.map +1 -0
- package/lib/esm/core/components/tabs/Tabs.js +78 -0
- package/lib/esm/core/components/tabs/Tabs.js.map +1 -0
- package/lib/esm/core/components/tabs/TabsContext.js +7 -0
- package/lib/esm/core/components/tabs/TabsContext.js.map +1 -0
- package/lib/esm/core/components/tabs/index.js +3 -0
- package/lib/esm/core/components/tabs/index.js.map +1 -0
- package/lib/esm/core/components/toast/NotificationPanel.js +37 -0
- package/lib/esm/core/components/toast/NotificationPanel.js.map +1 -0
- package/lib/esm/core/components/toast/ToastContext.js +7 -0
- package/lib/esm/core/components/toast/ToastContext.js.map +1 -0
- package/lib/esm/core/components/toast/ToastProps.js +2 -0
- package/lib/esm/core/components/toast/ToastProps.js.map +1 -0
- package/lib/esm/core/components/toast/ToastProvider.js +13 -0
- package/lib/esm/core/components/toast/ToastProvider.js.map +1 -0
- package/lib/esm/core/components/toast/index.js +3 -0
- package/lib/esm/core/components/toast/index.js.map +1 -0
- package/lib/esm/core/hooks/CompositeState.js +118 -0
- package/lib/esm/core/hooks/CompositeState.js.map +1 -0
- package/lib/esm/core/hooks/SharedState.js +64 -0
- package/lib/esm/core/hooks/SharedState.js.map +1 -0
- package/lib/esm/core/hooks/index.js +14 -0
- package/lib/esm/core/hooks/index.js.map +1 -0
- package/lib/esm/core/hooks/useClickOutside.js +29 -0
- package/lib/esm/core/hooks/useClickOutside.js.map +1 -0
- package/lib/esm/core/hooks/useCopyToClipboard.js +23 -0
- package/lib/esm/core/hooks/useCopyToClipboard.js.map +1 -0
- package/lib/esm/core/hooks/useDarkMode.js +11 -0
- package/lib/esm/core/hooks/useDarkMode.js.map +1 -0
- package/lib/esm/core/hooks/useDebounce.js +14 -0
- package/lib/esm/core/hooks/useDebounce.js.map +1 -0
- package/lib/esm/core/hooks/useEventSource.js +31 -0
- package/lib/esm/core/hooks/useEventSource.js.map +1 -0
- package/lib/esm/core/hooks/useFetch.js +40 -0
- package/lib/esm/core/hooks/useFetch.js.map +1 -0
- package/lib/esm/core/hooks/useFlag.js +13 -0
- package/lib/esm/core/hooks/useFlag.js.map +1 -0
- package/lib/esm/core/hooks/useIntersectionObserver.js +34 -0
- package/lib/esm/core/hooks/useIntersectionObserver.js.map +1 -0
- package/lib/esm/core/hooks/useIsFistRendering.js +14 -0
- package/lib/esm/core/hooks/useIsFistRendering.js.map +1 -0
- package/lib/esm/core/hooks/useSafeLayoutEffect.js +4 -0
- package/lib/esm/core/hooks/useSafeLayoutEffect.js.map +1 -0
- package/lib/esm/core/hooks/useSharedValue.js +21 -0
- package/lib/esm/core/hooks/useSharedValue.js.map +1 -0
- package/lib/esm/core/index.js +3 -0
- package/lib/esm/core/index.js.map +1 -0
- package/lib/esm/env/index.js +69 -0
- package/lib/esm/env/index.js.map +1 -0
- package/lib/esm/features/activity-doc/ActivityDoc.js +71 -0
- package/lib/esm/features/activity-doc/ActivityDoc.js.map +1 -0
- package/lib/esm/features/activity-doc/index.js +2 -0
- package/lib/esm/features/activity-doc/index.js.map +1 -0
- package/lib/esm/features/index.js +3 -0
- package/lib/esm/features/index.js.map +1 -0
- package/lib/esm/features/permissions/SecureButton.js +13 -0
- package/lib/esm/features/permissions/SecureButton.js.map +1 -0
- package/lib/esm/features/permissions/SecureSidebarItem.js +14 -0
- package/lib/esm/features/permissions/SecureSidebarItem.js.map +1 -0
- package/lib/esm/features/permissions/UserPermissionsProvider.js +86 -0
- package/lib/esm/features/permissions/UserPermissionsProvider.js.map +1 -0
- package/lib/esm/features/permissions/helpers.js +12 -0
- package/lib/esm/features/permissions/helpers.js.map +1 -0
- package/lib/esm/features/permissions/index.js +5 -0
- package/lib/esm/features/permissions/index.js.map +1 -0
- package/lib/esm/form/index.js +3 -0
- package/lib/esm/form/index.js.map +1 -0
- package/lib/esm/layout/AppLayout.js +46 -0
- package/lib/esm/layout/AppLayout.js.map +1 -0
- package/lib/esm/layout/FullHeightLayout.js +20 -0
- package/lib/esm/layout/FullHeightLayout.js.map +1 -0
- package/lib/esm/layout/Navbar.js +40 -0
- package/lib/esm/layout/Navbar.js.map +1 -0
- package/lib/esm/layout/Sidebar.js +35 -0
- package/lib/esm/layout/Sidebar.js.map +1 -0
- package/lib/esm/layout/SidebarContext.js +10 -0
- package/lib/esm/layout/SidebarContext.js.map +1 -0
- package/lib/esm/layout/TitleBar.js +5 -0
- package/lib/esm/layout/TitleBar.js.map +1 -0
- package/lib/esm/layout/index.js +7 -0
- package/lib/esm/layout/index.js.map +1 -0
- package/lib/esm/router/FixLinks.js +23 -0
- package/lib/esm/router/FixLinks.js.map +1 -0
- package/lib/esm/router/HistoryNavigator.js +149 -0
- package/lib/esm/router/HistoryNavigator.js.map +1 -0
- package/lib/esm/router/Nav.js +26 -0
- package/lib/esm/router/Nav.js.map +1 -0
- package/lib/esm/router/NestedNavigationContext.js +19 -0
- package/lib/esm/router/NestedNavigationContext.js.map +1 -0
- package/lib/esm/router/NestedRouterProvider.js +44 -0
- package/lib/esm/router/NestedRouterProvider.js.map +1 -0
- package/lib/esm/router/PathMatcher.js +159 -0
- package/lib/esm/router/PathMatcher.js.map +1 -0
- package/lib/esm/router/PathWithParams.js +34 -0
- package/lib/esm/router/PathWithParams.js.map +1 -0
- package/lib/esm/router/Route404.js +18 -0
- package/lib/esm/router/Route404.js.map +1 -0
- package/lib/esm/router/RouteComponent.js +32 -0
- package/lib/esm/router/RouteComponent.js.map +1 -0
- package/lib/esm/router/Router.js +161 -0
- package/lib/esm/router/Router.js.map +1 -0
- package/lib/esm/router/RouterProvider.js +41 -0
- package/lib/esm/router/RouterProvider.js.map +1 -0
- package/lib/esm/router/index.js +11 -0
- package/lib/esm/router/index.js.map +1 -0
- package/lib/esm/router/path.js +137 -0
- package/lib/esm/router/path.js.map +1 -0
- package/lib/esm/session/TypeRegistry.js +24 -0
- package/lib/esm/session/TypeRegistry.js.map +1 -0
- package/lib/esm/session/UserSession.js +191 -0
- package/lib/esm/session/UserSession.js.map +1 -0
- package/lib/esm/session/UserSessionProvider.js +161 -0
- package/lib/esm/session/UserSessionProvider.js.map +1 -0
- package/lib/esm/session/auth/composable.js +162 -0
- package/lib/esm/session/auth/composable.js.map +1 -0
- package/lib/esm/session/auth/firebase.js +151 -0
- package/lib/esm/session/auth/firebase.js.map +1 -0
- package/lib/esm/session/auth/useAuthState.js +49 -0
- package/lib/esm/session/auth/useAuthState.js.map +1 -0
- package/lib/esm/session/index.js +7 -0
- package/lib/esm/session/index.js.map +1 -0
- package/lib/esm/session/useUXTracking.js +29 -0
- package/lib/esm/session/useUXTracking.js.map +1 -0
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js +103 -0
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js.map +1 -0
- package/lib/esm/widgets/codemirror/CodemirrorStateSingleton.js +33 -0
- package/lib/esm/widgets/codemirror/CodemirrorStateSingleton.js.map +1 -0
- package/lib/esm/widgets/codemirror/index.js +2 -0
- package/lib/esm/widgets/codemirror/index.js.map +1 -0
- package/lib/esm/widgets/form/Form.js +102 -0
- package/lib/esm/widgets/form/Form.js.map +1 -0
- package/lib/esm/widgets/form/FormContext.js +29 -0
- package/lib/esm/widgets/form/FormContext.js.map +1 -0
- package/lib/esm/widgets/form/ManagedObject.js +283 -0
- package/lib/esm/widgets/form/ManagedObject.js.map +1 -0
- package/lib/esm/widgets/form/fields.js +11 -0
- package/lib/esm/widgets/form/fields.js.map +1 -0
- package/lib/esm/widgets/form/index.js +7 -0
- package/lib/esm/widgets/form/index.js.map +1 -0
- package/lib/esm/widgets/form/inputs.js +36 -0
- package/lib/esm/widgets/form/inputs.js.map +1 -0
- package/lib/esm/widgets/form/schema.js +191 -0
- package/lib/esm/widgets/form/schema.js.map +1 -0
- package/lib/esm/widgets/index.js +6 -0
- package/lib/esm/widgets/index.js.map +1 -0
- package/lib/esm/widgets/json-view/JSONCode.js +157 -0
- package/lib/esm/widgets/json-view/JSONCode.js.map +1 -0
- package/lib/esm/widgets/json-view/JSONDisplay.js +10 -0
- package/lib/esm/widgets/json-view/JSONDisplay.js.map +1 -0
- package/lib/esm/widgets/json-view/JSONView.js +106 -0
- package/lib/esm/widgets/json-view/JSONView.js.map +1 -0
- package/lib/esm/widgets/json-view/index.js +4 -0
- package/lib/esm/widgets/json-view/index.js.map +1 -0
- package/lib/esm/widgets/json-view/types.js +2 -0
- package/lib/esm/widgets/json-view/types.js.map +1 -0
- package/lib/esm/widgets/schema-editor/JSONSchemaEditorModal.js +50 -0
- package/lib/esm/widgets/schema-editor/JSONSchemaEditorModal.js.map +1 -0
- package/lib/esm/widgets/schema-editor/ManagedSchema.js +303 -0
- package/lib/esm/widgets/schema-editor/ManagedSchema.js.map +1 -0
- package/lib/esm/widgets/schema-editor/editor/Editable.js +111 -0
- package/lib/esm/widgets/schema-editor/editor/Editable.js.map +1 -0
- package/lib/esm/widgets/schema-editor/editor/EditableSchemaProperty.js +8 -0
- package/lib/esm/widgets/schema-editor/editor/EditableSchemaProperty.js.map +1 -0
- package/lib/esm/widgets/schema-editor/editor/PropertyEditor.js +81 -0
- package/lib/esm/widgets/schema-editor/editor/PropertyEditor.js.map +1 -0
- package/lib/esm/widgets/schema-editor/editor/PropertyViewer.js +7 -0
- package/lib/esm/widgets/schema-editor/editor/PropertyViewer.js.map +1 -0
- package/lib/esm/widgets/schema-editor/editor/SchemaContext.js +9 -0
- package/lib/esm/widgets/schema-editor/editor/SchemaContext.js.map +1 -0
- package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js +84 -0
- package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js.map +1 -0
- package/lib/esm/widgets/schema-editor/index.js +8 -0
- package/lib/esm/widgets/schema-editor/index.js.map +1 -0
- package/lib/esm/widgets/schema-editor/json-schema4-utils.js +188 -0
- package/lib/esm/widgets/schema-editor/json-schema4-utils.js.map +1 -0
- package/lib/esm/widgets/schema-editor/type-signature.js +30 -0
- package/lib/esm/widgets/schema-editor/type-signature.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/Attributes/index.js +11 -0
- package/lib/esm/widgets/xml-viewer/components/Attributes/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/CDataTag/index.js +8 -0
- package/lib/esm/widgets/xml-viewer/components/CDataTag/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/CollapseIcon/index.js +11 -0
- package/lib/esm/widgets/xml-viewer/components/CollapseIcon/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/CommentTag/index.js +11 -0
- package/lib/esm/widgets/xml-viewer/components/CommentTag/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/DeclarationTag/index.js +9 -0
- package/lib/esm/widgets/xml-viewer/components/DeclarationTag/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/Elements/index.js +36 -0
- package/lib/esm/widgets/xml-viewer/components/Elements/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/InvalidXml/index.js +5 -0
- package/lib/esm/widgets/xml-viewer/components/InvalidXml/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/Tag/index.js +13 -0
- package/lib/esm/widgets/xml-viewer/components/Tag/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/TextElement/index.js +13 -0
- package/lib/esm/widgets/xml-viewer/components/TextElement/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/XMLViewer.js +30 -0
- package/lib/esm/widgets/xml-viewer/components/XMLViewer.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/components/types.js +2 -0
- package/lib/esm/widgets/xml-viewer/components/types.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/constants/index.js +17 -0
- package/lib/esm/widgets/xml-viewer/constants/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/context/xml-viewer-context.js +10 -0
- package/lib/esm/widgets/xml-viewer/context/xml-viewer-context.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/helpers/index.js +40 -0
- package/lib/esm/widgets/xml-viewer/helpers/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/hooks/useCollapsible.js +22 -0
- package/lib/esm/widgets/xml-viewer/hooks/useCollapsible.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/hooks/useXMLViewer.js +31 -0
- package/lib/esm/widgets/xml-viewer/hooks/useXMLViewer.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/index.js +3 -0
- package/lib/esm/widgets/xml-viewer/index.js.map +1 -0
- package/lib/esm/widgets/xml-viewer/types/index.js +2 -0
- package/lib/esm/widgets/xml-viewer/types/index.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/code/index.d.ts +0 -0
- package/lib/types/core/components/Avatar.d.ts +15 -0
- package/lib/types/core/components/Badge.d.ts +20 -0
- package/lib/types/core/components/Button.d.ts +13 -0
- package/lib/types/core/components/Center.d.ts +7 -0
- package/lib/types/core/components/ComboBox.d.ts +123 -0
- package/lib/types/core/components/ConfirmModal.d.ts +10 -0
- package/lib/types/core/components/DeleteModal.d.ts +10 -0
- package/lib/types/core/components/Divider.d.ts +5 -0
- package/lib/types/core/components/Dropdown.d.ts +14 -0
- package/lib/types/core/components/DropdownList.d.ts +12 -0
- package/lib/types/core/components/EmptyCollection.d.ts +8 -0
- package/lib/types/core/components/FileUpload.d.ts +28 -0
- package/lib/types/core/components/Input.d.ts +8 -0
- package/lib/types/core/components/InputList.d.ts +10 -0
- package/lib/types/core/components/Link.d.ts +6 -0
- package/lib/types/core/components/MenuList.d.ts +13 -0
- package/lib/types/core/components/MessageBox.d.ts +35 -0
- package/lib/types/core/components/Modal.d.ts +29 -0
- package/lib/types/core/components/NumberInput.d.ts +15 -0
- package/lib/types/core/components/Portal.d.ts +5 -0
- package/lib/types/core/components/RadioGroup.d.ts +25 -0
- package/lib/types/core/components/SelectBox.d.ts +35 -0
- package/lib/types/core/components/SelectList.d.ts +17 -0
- package/lib/types/core/components/SelectStack.d.ts +12 -0
- package/lib/types/core/components/SidePanel.d.ts +8 -0
- package/lib/types/core/components/Spinner.d.ts +6 -0
- package/lib/types/core/components/Switch.d.ts +9 -0
- package/lib/types/core/components/Textarea.d.ts +7 -0
- package/lib/types/core/components/index.d.ts +37 -0
- package/lib/types/core/components/libs/utils.d.ts +2 -0
- package/lib/types/core/components/libs/visuallyHidden.d.ts +6 -0
- package/lib/types/core/components/popup/Popup.d.ts +25 -0
- package/lib/types/core/components/popup/PopupController.d.ts +40 -0
- package/lib/types/core/components/popup/index.d.ts +3 -0
- package/lib/types/core/components/popup/position.d.ts +58 -0
- package/lib/types/core/components/popup/utils.d.ts +29 -0
- package/lib/types/core/components/shadcn/breadcrumb.d.ts +13 -0
- package/lib/types/core/components/shadcn/button.d.ts +15 -0
- package/lib/types/core/components/shadcn/calendar.d.ts +10 -0
- package/lib/types/core/components/shadcn/card.d.ts +8 -0
- package/lib/types/core/components/shadcn/checkbox.d.ts +4 -0
- package/lib/types/core/components/shadcn/command.d.ts +80 -0
- package/lib/types/core/components/shadcn/dialog.d.ts +34 -0
- package/lib/types/core/components/shadcn/filters/animateChangeInHeight.d.ts +6 -0
- package/lib/types/core/components/shadcn/filters/comboBox.d.ts +17 -0
- package/lib/types/core/components/shadcn/filters/dateFilter.d.ts +14 -0
- package/lib/types/core/components/shadcn/filters/filterBar.d.ts +9 -0
- package/lib/types/core/components/shadcn/filters/filters.d.ts +9 -0
- package/lib/types/core/components/shadcn/filters/index.d.ts +5 -0
- package/lib/types/core/components/shadcn/filters/selectFilter.d.ts +11 -0
- package/lib/types/core/components/shadcn/filters/textFilter.d.ts +12 -0
- package/lib/types/core/components/shadcn/filters/types.d.ts +26 -0
- package/lib/types/core/components/shadcn/heading.d.ts +5 -0
- package/lib/types/core/components/shadcn/index.d.ts +21 -0
- package/lib/types/core/components/shadcn/input.d.ts +16 -0
- package/lib/types/core/components/shadcn/label.d.ts +7 -0
- package/lib/types/core/components/shadcn/popover.d.ts +16 -0
- package/lib/types/core/components/shadcn/selectBox.d.ts +21 -0
- package/lib/types/core/components/shadcn/separator.d.ts +4 -0
- package/lib/types/core/components/shadcn/tabs.d.ts +26 -0
- package/lib/types/core/components/shadcn/text.d.ts +10 -0
- package/lib/types/core/components/shadcn/theme/ThemeProvider.d.ts +13 -0
- package/lib/types/core/components/shadcn/theme/ThemeSwitcher.d.ts +9 -0
- package/lib/types/core/components/shadcn/tooltip.d.ts +19 -0
- package/lib/types/core/components/styles.d.ts +6 -0
- package/lib/types/core/components/table/index.d.ts +13 -0
- package/lib/types/core/components/tabs/Tabs.d.ts +24 -0
- package/lib/types/core/components/tabs/TabsContext.d.ts +16 -0
- package/lib/types/core/components/tabs/index.d.ts +2 -0
- package/lib/types/core/components/toast/NotificationPanel.d.ts +7 -0
- package/lib/types/core/components/toast/ToastContext.d.ts +5 -0
- package/lib/types/core/components/toast/ToastProps.d.ts +6 -0
- package/lib/types/core/components/toast/ToastProvider.d.ts +5 -0
- package/lib/types/core/components/toast/index.d.ts +2 -0
- package/lib/types/core/hooks/CompositeState.d.ts +27 -0
- package/lib/types/core/hooks/SharedState.d.ts +9 -0
- package/lib/types/core/hooks/index.d.ts +13 -0
- package/lib/types/core/hooks/useClickOutside.d.ts +7 -0
- package/lib/types/core/hooks/useCopyToClipboard.d.ts +4 -0
- package/lib/types/core/hooks/useDarkMode.d.ts +1 -0
- package/lib/types/core/hooks/useDebounce.d.ts +1 -0
- package/lib/types/core/hooks/useEventSource.d.ts +1 -0
- package/lib/types/core/hooks/useFetch.d.ts +23 -0
- package/lib/types/core/hooks/useFlag.d.ts +8 -0
- package/lib/types/core/hooks/useIntersectionObserver.d.ts +13 -0
- package/lib/types/core/hooks/useIsFistRendering.d.ts +1 -0
- package/lib/types/core/hooks/useSafeLayoutEffect.d.ts +3 -0
- package/lib/types/core/hooks/useSharedValue.d.ts +11 -0
- package/lib/types/core/index.d.ts +2 -0
- package/lib/types/env/index.d.ts +70 -0
- package/lib/types/features/activity-doc/ActivityDoc.d.ts +13 -0
- package/lib/types/features/activity-doc/index.d.ts +1 -0
- package/lib/types/features/index.d.ts +2 -0
- package/lib/types/features/permissions/SecureButton.d.ts +7 -0
- package/lib/types/features/permissions/SecureSidebarItem.d.ts +7 -0
- package/lib/types/features/permissions/UserPermissionsProvider.d.ts +19 -0
- package/lib/types/features/permissions/helpers.d.ts +4 -0
- package/lib/types/features/permissions/index.d.ts +4 -0
- package/lib/types/form/index.d.ts +0 -0
- package/lib/types/layout/AppLayout.d.ts +12 -0
- package/lib/types/layout/FullHeightLayout.d.ts +26 -0
- package/lib/types/layout/Navbar.d.ts +32 -0
- package/lib/types/layout/Sidebar.d.ts +29 -0
- package/lib/types/layout/SidebarContext.d.ts +8 -0
- package/lib/types/layout/TitleBar.d.ts +5 -0
- package/lib/types/layout/index.d.ts +6 -0
- package/lib/types/router/FixLinks.d.ts +6 -0
- package/lib/types/router/HistoryNavigator.d.ts +55 -0
- package/lib/types/router/Nav.d.ts +28 -0
- package/lib/types/router/NestedNavigationContext.d.ts +8 -0
- package/lib/types/router/NestedRouterProvider.d.ts +13 -0
- package/lib/types/router/PathMatcher.d.ts +35 -0
- package/lib/types/router/PathWithParams.d.ts +8 -0
- package/lib/types/router/Route404.d.ts +3 -0
- package/lib/types/router/RouteComponent.d.ts +5 -0
- package/lib/types/router/Router.d.ts +73 -0
- package/lib/types/router/RouterProvider.d.ts +14 -0
- package/lib/types/router/index.d.ts +10 -0
- package/lib/types/router/path.d.ts +7 -0
- package/lib/types/session/TypeRegistry.d.ts +9 -0
- package/lib/types/session/UserSession.d.ts +39 -0
- package/lib/types/session/UserSessionProvider.d.ts +6 -0
- package/lib/types/session/auth/composable.d.ts +25 -0
- package/lib/types/session/auth/firebase.d.ts +9 -0
- package/lib/types/session/auth/useAuthState.d.ts +9 -0
- package/lib/types/session/index.d.ts +6 -0
- package/lib/types/session/useUXTracking.d.ts +5 -0
- package/lib/types/widgets/codemirror/CodeMirrorEditor.d.ts +22 -0
- package/lib/types/widgets/codemirror/CodemirrorStateSingleton.d.ts +14 -0
- package/lib/types/widgets/codemirror/index.d.ts +1 -0
- package/lib/types/widgets/form/Form.d.ts +20 -0
- package/lib/types/widgets/form/FormContext.d.ts +16 -0
- package/lib/types/widgets/form/ManagedObject.d.ts +81 -0
- package/lib/types/widgets/form/fields.d.ts +15 -0
- package/lib/types/widgets/form/index.d.ts +6 -0
- package/lib/types/widgets/form/inputs.d.ts +7 -0
- package/lib/types/widgets/form/schema.d.ts +45 -0
- package/lib/types/widgets/index.d.ts +5 -0
- package/lib/types/widgets/json-view/JSONCode.d.ts +21 -0
- package/lib/types/widgets/json-view/JSONDisplay.d.ts +7 -0
- package/lib/types/widgets/json-view/JSONView.d.ts +6 -0
- package/lib/types/widgets/json-view/index.d.ts +4 -0
- package/lib/types/widgets/json-view/types.d.ts +7 -0
- package/lib/types/widgets/schema-editor/JSONSchemaEditorModal.d.ts +9 -0
- package/lib/types/widgets/schema-editor/ManagedSchema.d.ts +74 -0
- package/lib/types/widgets/schema-editor/editor/Editable.d.ts +39 -0
- package/lib/types/widgets/schema-editor/editor/EditableSchemaProperty.d.ts +7 -0
- package/lib/types/widgets/schema-editor/editor/PropertyEditor.d.ts +4 -0
- package/lib/types/widgets/schema-editor/editor/PropertyViewer.d.ts +3 -0
- package/lib/types/widgets/schema-editor/editor/SchemaContext.d.ts +2 -0
- package/lib/types/widgets/schema-editor/editor/SchemaEditor.d.ts +8 -0
- package/lib/types/widgets/schema-editor/index.d.ts +7 -0
- package/lib/types/widgets/schema-editor/json-schema4-utils.d.ts +15 -0
- package/lib/types/widgets/schema-editor/type-signature.d.ts +18 -0
- package/lib/types/widgets/xml-viewer/components/Attributes/index.d.ts +5 -0
- package/lib/types/widgets/xml-viewer/components/CDataTag/index.d.ts +7 -0
- package/lib/types/widgets/xml-viewer/components/CollapseIcon/index.d.ts +4 -0
- package/lib/types/widgets/xml-viewer/components/CommentTag/index.d.ts +8 -0
- package/lib/types/widgets/xml-viewer/components/DeclarationTag/index.d.ts +7 -0
- package/lib/types/widgets/xml-viewer/components/Elements/index.d.ts +7 -0
- package/lib/types/widgets/xml-viewer/components/InvalidXml/index.d.ts +1 -0
- package/lib/types/widgets/xml-viewer/components/Tag/index.d.ts +12 -0
- package/lib/types/widgets/xml-viewer/components/TextElement/index.d.ts +7 -0
- package/lib/types/widgets/xml-viewer/components/XMLViewer.d.ts +2 -0
- package/lib/types/widgets/xml-viewer/components/types.d.ts +103 -0
- package/lib/types/widgets/xml-viewer/constants/index.d.ts +16 -0
- package/lib/types/widgets/xml-viewer/context/xml-viewer-context.d.ts +3 -0
- package/lib/types/widgets/xml-viewer/helpers/index.d.ts +12 -0
- package/lib/types/widgets/xml-viewer/hooks/useCollapsible.d.ts +14 -0
- package/lib/types/widgets/xml-viewer/hooks/useXMLViewer.d.ts +9 -0
- package/lib/types/widgets/xml-viewer/index.d.ts +2 -0
- package/lib/types/widgets/xml-viewer/types/index.d.ts +15 -0
- package/lib/vertesia-ui-code.js +2 -0
- package/lib/vertesia-ui-code.js.map +1 -0
- package/lib/vertesia-ui-core.js +2 -0
- package/lib/vertesia-ui-core.js.map +1 -0
- package/lib/vertesia-ui-env.js +2 -0
- package/lib/vertesia-ui-env.js.map +1 -0
- package/lib/vertesia-ui-features.js +2 -0
- package/lib/vertesia-ui-features.js.map +1 -0
- package/lib/vertesia-ui-form.js +2 -0
- package/lib/vertesia-ui-form.js.map +1 -0
- package/lib/vertesia-ui-layout.js +2 -0
- package/lib/vertesia-ui-layout.js.map +1 -0
- package/lib/vertesia-ui-router.js +2 -0
- package/lib/vertesia-ui-router.js.map +1 -0
- package/lib/vertesia-ui-session.js +2 -0
- package/lib/vertesia-ui-session.js.map +1 -0
- package/lib/vertesia-ui-widgets.js +2 -0
- package/lib/vertesia-ui-widgets.js.map +1 -0
- package/package.json +113 -33
- package/src/code/index.ts +1 -0
- package/src/core/components/Avatar.tsx +67 -0
- package/src/core/components/Badge.tsx +114 -0
- package/src/core/components/Button.tsx +63 -0
- package/src/core/components/Center.tsx +12 -0
- package/src/core/components/ComboBox.tsx +488 -0
- package/src/core/components/ConfirmModal.tsx +51 -0
- package/src/core/components/DeleteModal.tsx +45 -0
- package/src/core/components/Divider.tsx +11 -0
- package/src/core/components/Dropdown.tsx +63 -0
- package/src/core/components/DropdownList.tsx +72 -0
- package/src/core/components/EmptyCollection.tsx +39 -0
- package/src/core/components/FileUpload.tsx +196 -0
- package/src/core/components/Input.tsx +43 -0
- package/src/core/components/InputList.tsx +75 -0
- package/src/core/components/Link.tsx +16 -0
- package/src/core/components/MenuList.tsx +44 -0
- package/src/core/components/MessageBox.tsx +96 -0
- package/src/core/components/Modal.tsx +144 -0
- package/src/core/components/NumberInput.tsx +64 -0
- package/src/core/components/Portal.tsx +33 -0
- package/src/core/components/RadioGroup.tsx +100 -0
- package/src/core/components/SelectBox.tsx +189 -0
- package/src/core/components/SelectList.tsx +85 -0
- package/src/core/components/SelectStack.tsx +63 -0
- package/src/core/components/SidePanel.tsx +104 -0
- package/src/core/components/Spinner.tsx +33 -0
- package/src/core/components/Switch.tsx +29 -0
- package/src/core/components/Textarea.tsx +25 -0
- package/src/core/components/index.ts +39 -0
- package/src/core/components/libs/utils.tsx +6 -0
- package/src/core/components/libs/visuallyHidden.tsx +25 -0
- package/src/core/components/popup/Popup.tsx +94 -0
- package/src/core/components/popup/PopupController.ts +182 -0
- package/src/core/components/popup/index.ts +3 -0
- package/src/core/components/popup/position.ts +277 -0
- package/src/core/components/popup/utils.ts +82 -0
- package/src/core/components/shadcn/breadcrumb.tsx +174 -0
- package/src/core/components/shadcn/button.tsx +95 -0
- package/src/core/components/shadcn/calendar.tsx +87 -0
- package/src/core/components/shadcn/card.tsx +76 -0
- package/src/core/components/shadcn/checkbox.tsx +30 -0
- package/src/core/components/shadcn/command.tsx +155 -0
- package/src/core/components/shadcn/dialog.tsx +230 -0
- package/src/core/components/shadcn/filters/animateChangeInHeight.tsx +41 -0
- package/src/core/components/shadcn/filters/comboBox.tsx +251 -0
- package/src/core/components/shadcn/filters/dateFilter.tsx +65 -0
- package/src/core/components/shadcn/filters/filterBar.tsx +262 -0
- package/src/core/components/shadcn/filters/filters.tsx +110 -0
- package/src/core/components/shadcn/filters/index.ts +5 -0
- package/src/core/components/shadcn/filters/selectFilter.tsx +91 -0
- package/src/core/components/shadcn/filters/textFilter.tsx +59 -0
- package/src/core/components/shadcn/filters/types.ts +29 -0
- package/src/core/components/shadcn/heading.tsx +23 -0
- package/src/core/components/shadcn/index.ts +22 -0
- package/src/core/components/shadcn/input.tsx +89 -0
- package/src/core/components/shadcn/label.tsx +31 -0
- package/src/core/components/shadcn/popover.tsx +115 -0
- package/src/core/components/shadcn/selectBox.tsx +186 -0
- package/src/core/components/shadcn/separator.tsx +29 -0
- package/src/core/components/shadcn/tabs.tsx +218 -0
- package/src/core/components/shadcn/text.tsx +33 -0
- package/src/core/components/shadcn/theme/ThemeProvider.tsx +73 -0
- package/src/core/components/shadcn/theme/ThemeSwitcher.tsx +35 -0
- package/src/core/components/shadcn/tooltip.tsx +57 -0
- package/src/core/components/styles.ts +11 -0
- package/src/core/components/table/index.tsx +49 -0
- package/src/core/components/tabs/Tabs.tsx +132 -0
- package/src/core/components/tabs/TabsContext.ts +25 -0
- package/src/core/components/tabs/index.ts +2 -0
- package/src/core/components/toast/NotificationPanel.tsx +91 -0
- package/src/core/components/toast/ToastContext.ts +12 -0
- package/src/core/components/toast/ToastProps.ts +6 -0
- package/src/core/components/toast/ToastProvider.tsx +26 -0
- package/src/core/components/toast/index.ts +2 -0
- package/src/core/hooks/CompositeState.tsx +142 -0
- package/src/core/hooks/SharedState.tsx +69 -0
- package/src/core/hooks/index.ts +13 -0
- package/src/core/hooks/useClickOutside.tsx +29 -0
- package/src/core/hooks/useCopyToClipboard.tsx +28 -0
- package/src/core/hooks/useDarkMode.ts +11 -0
- package/src/core/hooks/useDebounce.tsx +15 -0
- package/src/core/hooks/useEventSource.ts +35 -0
- package/src/core/hooks/useFetch.ts +51 -0
- package/src/core/hooks/useFlag.tsx +13 -0
- package/src/core/hooks/useIntersectionObserver.tsx +40 -0
- package/src/core/hooks/useIsFistRendering.ts +17 -0
- package/src/core/hooks/useSafeLayoutEffect.ts +5 -0
- package/src/core/hooks/useSharedValue.ts +22 -0
- package/src/core/index.ts +2 -0
- package/src/env/index.ts +116 -0
- package/src/features/activity-doc/ActivityDoc.tsx +199 -0
- package/src/features/activity-doc/index.ts +1 -0
- package/src/features/index.ts +2 -0
- package/src/features/permissions/SecureButton.tsx +18 -0
- package/src/features/permissions/SecureSidebarItem.tsx +19 -0
- package/src/features/permissions/UserPermissionsProvider.tsx +102 -0
- package/src/features/permissions/helpers.ts +16 -0
- package/src/features/permissions/index.ts +4 -0
- package/src/form/index.ts +1 -0
- package/src/layout/AppLayout.tsx +132 -0
- package/src/layout/FullHeightLayout.tsx +74 -0
- package/src/layout/Navbar.tsx +127 -0
- package/src/layout/Sidebar.tsx +129 -0
- package/src/layout/SidebarContext.ts +17 -0
- package/src/layout/TitleBar.tsx +7 -0
- package/src/layout/index.ts +6 -0
- package/src/router/FixLinks.tsx +28 -0
- package/src/router/HistoryNavigator.ts +178 -0
- package/src/router/Nav.tsx +55 -0
- package/src/router/NestedNavigationContext.tsx +32 -0
- package/src/router/NestedRouterProvider.tsx +64 -0
- package/src/router/PathMatcher.ts +166 -0
- package/src/router/PathWithParams.ts +34 -0
- package/src/router/Route404.tsx +18 -0
- package/src/router/RouteComponent.tsx +41 -0
- package/src/router/Router.tsx +216 -0
- package/src/router/RouterProvider.tsx +55 -0
- package/src/router/index.ts +10 -0
- package/src/router/path.ts +151 -0
- package/src/session/TypeRegistry.ts +27 -0
- package/src/session/UserSession.ts +227 -0
- package/src/session/UserSessionProvider.tsx +170 -0
- package/src/session/auth/composable.ts +190 -0
- package/src/session/auth/firebase.ts +160 -0
- package/src/session/auth/useAuthState.ts +61 -0
- package/src/session/index.ts +6 -0
- package/src/session/useUXTracking.tsx +38 -0
- package/src/vite-env.d.ts +2 -0
- package/src/widgets/codemirror/CodeMirrorEditor.tsx +121 -0
- package/src/widgets/codemirror/CodemirrorStateSingleton.tsx +39 -0
- package/src/widgets/codemirror/index.ts +2 -0
- package/src/widgets/form/Form.tsx +194 -0
- package/src/widgets/form/FormContext.ts +38 -0
- package/src/widgets/form/ManagedObject.ts +332 -0
- package/src/widgets/form/fields.tsx +34 -0
- package/src/widgets/form/index.ts +6 -0
- package/src/widgets/form/inputs.tsx +44 -0
- package/src/widgets/form/schema.ts +215 -0
- package/src/widgets/index.ts +5 -0
- package/src/widgets/json-view/JSONCode.tsx +176 -0
- package/src/widgets/json-view/JSONDisplay.tsx +24 -0
- package/src/widgets/json-view/JSONView.tsx +183 -0
- package/src/widgets/json-view/index.ts +4 -0
- package/src/widgets/json-view/types.ts +5 -0
- package/src/widgets/schema-editor/JSONSchemaEditorModal.tsx +68 -0
- package/src/widgets/schema-editor/ManagedSchema.ts +340 -0
- package/src/widgets/schema-editor/editor/Editable.tsx +252 -0
- package/src/widgets/schema-editor/editor/EditableSchemaProperty.tsx +15 -0
- package/src/widgets/schema-editor/editor/PropertyEditor.tsx +150 -0
- package/src/widgets/schema-editor/editor/PropertyViewer.tsx +15 -0
- package/src/widgets/schema-editor/editor/SchemaContext.tsx +9 -0
- package/src/widgets/schema-editor/editor/SchemaEditor.test.ts +48 -0
- package/src/widgets/schema-editor/editor/SchemaEditor.tsx +161 -0
- package/src/widgets/schema-editor/index.ts +7 -0
- package/src/widgets/schema-editor/json-schema4-utils.ts +187 -0
- package/src/widgets/schema-editor/type-signature.ts +39 -0
- package/src/widgets/xml-viewer/components/Attributes/index.tsx +27 -0
- package/src/widgets/xml-viewer/components/CDataTag/index.tsx +21 -0
- package/src/widgets/xml-viewer/components/CollapseIcon/index.tsx +32 -0
- package/src/widgets/xml-viewer/components/CommentTag/index.tsx +30 -0
- package/src/widgets/xml-viewer/components/DeclarationTag/index.tsx +23 -0
- package/src/widgets/xml-viewer/components/Elements/index.tsx +83 -0
- package/src/widgets/xml-viewer/components/InvalidXml/index.tsx +3 -0
- package/src/widgets/xml-viewer/components/Tag/index.tsx +47 -0
- package/src/widgets/xml-viewer/components/TextElement/index.tsx +28 -0
- package/src/widgets/xml-viewer/components/XMLViewer.tsx +53 -0
- package/src/widgets/xml-viewer/components/types.ts +104 -0
- package/src/widgets/xml-viewer/constants/index.ts +17 -0
- package/src/widgets/xml-viewer/context/xml-viewer-context.ts +12 -0
- package/src/widgets/xml-viewer/helpers/index.ts +56 -0
- package/src/widgets/xml-viewer/hooks/useCollapsible.ts +28 -0
- package/src/widgets/xml-viewer/hooks/useXMLViewer.ts +34 -0
- package/src/widgets/xml-viewer/index.ts +2 -0
- package/src/widgets/xml-viewer/types/index.ts +21 -0
- package/README.md +0 -1
- package/lib/context/HostContext.d.ts +0 -67
- package/lib/context/HostContext.d.ts.map +0 -1
- package/lib/context/HostContext.js +0 -2
- package/lib/context/HostContext.js.map +0 -1
- package/lib/context/index.d.ts +0 -9
- package/lib/context/index.d.ts.map +0 -1
- package/lib/context/index.js +0 -11
- package/lib/context/index.js.map +0 -1
- package/lib/host/PluginHost.d.ts +0 -7
- package/lib/host/PluginHost.d.ts.map +0 -1
- package/lib/host/PluginHost.js +0 -37
- package/lib/host/PluginHost.js.map +0 -1
- package/lib/host/PluginManager.d.ts +0 -59
- package/lib/host/PluginManager.d.ts.map +0 -1
- package/lib/host/PluginManager.js +0 -195
- package/lib/host/PluginManager.js.map +0 -1
- package/lib/host/index.d.ts +0 -3
- package/lib/host/index.d.ts.map +0 -1
- package/lib/host/index.js +0 -3
- package/lib/host/index.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -3
- package/lib/index.js.map +0 -1
- package/src/context/HostContext.ts +0 -73
- package/src/context/index.ts +0 -20
- package/src/host/PluginHost.tsx +0 -37
- package/src/host/PluginManager.tsx +0 -197
- package/src/host/index.ts +0 -2
- package/src/index.ts +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Listbox, ListboxButton, ListboxOption, ListboxOptions, Transition } from "@headlessui/react";
|
|
3
|
+
import { Check, ChevronDown } from "lucide-react";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { Fragment } from "react";
|
|
6
|
+
export function DropdownList({ items, value, onChange }) {
|
|
7
|
+
return (_jsx(Listbox, { value: value, onChange: onChange, children: ({ open }) => (_jsxs("div", { className: "relative", children: [_jsxs("div", { className: "inline-flex divide-x divide-indigo-700 rounded-md shadow-2xs", children: [_jsxs("div", { className: "inline-flex items-center gap-x-1.5 rounded-l-md bg-indigo-600 px-3 py-2 text-white shadow-2xs", children: [value.name && _jsx(Check, { className: "-ml-0.5 size-5", "aria-hidden": "true" }), _jsx("p", { className: "text-sm font-semibold", children: value.name || "" })] }), _jsxs(ListboxButton, { className: "inline-flex items-center rounded-l-none rounded-r-md bg-indigo-600 p-2 hover:bg-indigo-700 focus:outline-hidden focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2 focus:ring-offset-gray-50", children: [_jsx("span", { className: "sr-only", children: "Change selection" }), _jsx(ChevronDown, { className: "size-5 text-white", "aria-hidden": "true" })] })] }), _jsx(Transition, { show: open, as: Fragment, leave: "transition ease-in duration-100", leaveFrom: "opacity-100", leaveTo: "opacity-0", children: _jsx(ListboxOptions, { className: "absolute right-0 z-10 mt-2 w-72 origin-top-right divide-y divide-gray-200 overflow-hidden rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-hidden", children: items.map((option) => (_jsx(ListboxOption, { className: ({ active }) => clsx(active ? 'bg-indigo-600 text-white' : 'text-gray-900', 'cursor-default select-none p-4 text-sm'), value: option, children: ({ selected, active }) => (_jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex justify-between", children: [_jsx("p", { className: selected ? 'font-semibold' : 'font-normal', children: option.name }), selected ? (_jsx("span", { className: active ? 'text-white' : 'text-indigo-600', children: _jsx(Check, { className: "size-5", "aria-hidden": "true" }) })) : null] }), _jsx("p", { className: clsx(active ? 'text-indigo-200' : 'text-gray-500', 'mt-2'), children: option.description })] })) }, option.id))) }) })] })) }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=DropdownList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownList.js","sourceRoot":"","sources":["../../../../src/core/components/DropdownList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CA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,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACvB,eAAK,SAAS,EAAC,eAAe,aAC1B,eAAK,SAAS,EAAC,sBAAsB,aACjC,YAAG,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,YAAG,MAAM,CAAC,IAAI,GAAK,EAC1E,QAAQ,CAAC,CAAC,CAAC,CACR,eAAM,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,YACtD,KAAC,KAAK,IAAC,SAAS,EAAC,QAAQ,iBAAa,MAAM,GAAG,GAC5C,CACV,CAAC,CAAC,CAAC,IAAI,IACN,EACN,YAAG,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,eAAe,EAAE,MAAM,CAAC,YACnE,MAAM,CAAC,WAAW,GACnB,IACF,CACT,IAvBI,MAAM,CAAC,EAAE,CAwBF,CACnB,CAAC,GACW,GACR,IACX,CACT,GACK,CACb,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Plus } from "lucide-react";
|
|
3
|
+
import { Button } from "./Button.js";
|
|
4
|
+
export function EmptyCollection({ buttonLabel, title, children, onClick }) {
|
|
5
|
+
return (_jsxs("div", { className: "text-center py-12", children: [_jsx("svg", { className: "mx-auto h-12 w-12 text-gray-400 dark:text-gray-200", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", "aria-hidden": "true", children: _jsx("path", { vectorEffect: "non-scaling-stroke", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z" }) }), _jsx("h3", { className: "mt-2 text-sm font-semibold text-gray-500", children: title }), _jsx("p", { className: "mt-1 text-sm text-gray-500", children: children }), _jsx("div", { className: "mt-6", children: _jsxs(Button, { onClick: onClick, size: 'lg', children: [_jsx(Plus, { className: "-ml-0.5 mr-1.5 size-5", "aria-hidden": "true" }), buttonLabel] }) })] }));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=EmptyCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyCollection.js","sourceRoot":"","sources":["../../../../src/core/components/EmptyCollection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC,MAAM,UAAU,eAAe,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAA0B;IAC7F,OAAO,CACH,eAAK,SAAS,EAAC,mBAAmB,aAC9B,cACI,SAAS,EAAC,oDAAoD,EAC9D,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,EACnB,MAAM,EAAC,cAAc,iBACT,MAAM,YAElB,eACI,YAAY,EAAC,oBAAoB,EACjC,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAE,CAAC,EACd,CAAC,EAAC,sFAAsF,GAC1F,GACA,EACN,aAAI,SAAS,EAAC,0CAA0C,YAAE,KAAK,GAAM,EACrE,YAAG,SAAS,EAAC,4BAA4B,YAAE,QAAQ,GAAK,EACxD,cAAK,SAAS,EAAC,MAAM,YACjB,MAAC,MAAM,IAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,IAAI,aAC/B,KAAC,IAAI,IAAC,SAAS,EAAC,uBAAuB,iBAAa,MAAM,GAAG,EAC5D,WAAW,IACP,GACP,IACJ,CACT,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* TODO: TS complains that:
|
|
5
|
+
* Type 'FileList' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
|
|
6
|
+
* So as a quick fix aI use a for loop to convert FileList to File[]
|
|
7
|
+
* @param files
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
function fileListToArray(files) {
|
|
11
|
+
const ar = [];
|
|
12
|
+
for (let i = 0, l = files.length; i < l; i++) {
|
|
13
|
+
ar.push(files[i]);
|
|
14
|
+
}
|
|
15
|
+
return ar;
|
|
16
|
+
}
|
|
17
|
+
export function FileUploadInput({ children, onUpload }) {
|
|
18
|
+
const inputRef = useRef(null);
|
|
19
|
+
const _onUpload = () => {
|
|
20
|
+
if (inputRef.current?.files) {
|
|
21
|
+
onUpload(fileListToArray(inputRef.current.files));
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return (_jsxs("label", { style: { cursor: "pointer" }, children: [children, _jsx("input", { ref: inputRef, type: "file", style: { display: "none" }, onChange: _onUpload })] }));
|
|
25
|
+
}
|
|
26
|
+
//TODO implement using tailwind
|
|
27
|
+
export function DropZone({ onUpload }) {
|
|
28
|
+
const dropZoneProps = useDropZone({ onUpload });
|
|
29
|
+
return (_jsx("div", { ...dropZoneProps, className: "flex items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600", children: _jsxs("label", { htmlFor: "dropzone-file", className: "flex flex-col items-center justify-center w-full h-full", children: [_jsxs("div", { className: "flex flex-col items-center justify-center pt-5 pb-6", children: [_jsx("svg", { className: "w-8 h-8 mb-4 text-gray-500 dark:text-gray-400", "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 16", children: _jsx("path", { stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2" }) }), _jsxs("p", { className: "mb-2 text-sm text-gray-500 dark:text-gray-400", children: [_jsx("span", { className: "font-semibold", children: "Click to upload" }), " or drag and drop"] }), _jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "SVG, PNG, JPG or GIF (MAX. 800x400px)" })] }), _jsx("input", { id: "dropzone-file", type: "file", className: "hidden" })] }) }));
|
|
30
|
+
}
|
|
31
|
+
function _onDragEnter(el) {
|
|
32
|
+
let cnt = el.__dragOver_cnt__ || 0;
|
|
33
|
+
el.__dragOver_cnt__ = cnt + 1;
|
|
34
|
+
return !cnt; // true if first drag o ver false if dragover already recorded
|
|
35
|
+
}
|
|
36
|
+
function _onDragLeave(el) {
|
|
37
|
+
let cnt = el.__dragOver_cnt__;
|
|
38
|
+
if (!cnt)
|
|
39
|
+
return false;
|
|
40
|
+
el.__dragOver_cnt__ = cnt - 1;
|
|
41
|
+
return cnt === 1; // true if leave false if not
|
|
42
|
+
}
|
|
43
|
+
function _onDrop(el) {
|
|
44
|
+
delete el.__dragOver_cnt__;
|
|
45
|
+
}
|
|
46
|
+
export function useDropZone({ onUpload, dragOverClass = "is-drag-over-on", dropEffect = "copy", }) {
|
|
47
|
+
const ref = useRef(null);
|
|
48
|
+
const onDrop = (ev) => {
|
|
49
|
+
ev.preventDefault();
|
|
50
|
+
_onDrop(ref.current);
|
|
51
|
+
ref.current?.classList.remove(dragOverClass);
|
|
52
|
+
const items = ev.dataTransfer.items;
|
|
53
|
+
if (items) {
|
|
54
|
+
const promises = [];
|
|
55
|
+
const traverseFileTree = (item, path = "") => {
|
|
56
|
+
return new Promise((resolve) => {
|
|
57
|
+
if (item.isFile) {
|
|
58
|
+
item.file((file) => {
|
|
59
|
+
Object.defineProperty(file, "webkitRelativePath", { value: path + file.name });
|
|
60
|
+
resolve([file]);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
else if (item.isDirectory) {
|
|
64
|
+
const dirReader = item.createReader();
|
|
65
|
+
const entries = [];
|
|
66
|
+
const readEntries = () => {
|
|
67
|
+
dirReader.readEntries((results) => {
|
|
68
|
+
if (!results.length) {
|
|
69
|
+
Promise.all(entries).then((filesArrays) => resolve(filesArrays.flat()));
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
for (const entry of results) {
|
|
73
|
+
entries.push(traverseFileTree(entry, path + item.name + "/"));
|
|
74
|
+
}
|
|
75
|
+
readEntries();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
readEntries();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
for (let i = 0; i < items.length; i++) {
|
|
84
|
+
const entry = items[i].webkitGetAsEntry();
|
|
85
|
+
if (entry) {
|
|
86
|
+
promises.push(traverseFileTree(entry));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
Promise.all(promises).then((filesArrays) => {
|
|
90
|
+
const allFiles = filesArrays.flat();
|
|
91
|
+
if (allFiles.length) {
|
|
92
|
+
onUpload(allFiles);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const onDragOver = (ev) => {
|
|
98
|
+
ev.preventDefault();
|
|
99
|
+
ev.dataTransfer.dropEffect = dropEffect;
|
|
100
|
+
};
|
|
101
|
+
const onDragEnter = () => {
|
|
102
|
+
if (_onDragEnter(ref.current)) {
|
|
103
|
+
ref.current?.classList.add(dragOverClass);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const onDragLeave = () => {
|
|
107
|
+
if (_onDragLeave(ref.current)) {
|
|
108
|
+
ref.current?.classList.remove(dragOverClass);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
return {
|
|
112
|
+
onDrop,
|
|
113
|
+
onDragOver,
|
|
114
|
+
onDragEnter,
|
|
115
|
+
onDragLeave,
|
|
116
|
+
ref,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=FileUpload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileUpload.js","sourceRoot":"","sources":["../../../../src/core/components/FileUpload.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAiD,MAAM,EAAE,MAAM,OAAO,CAAC;AAE9E;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,KAAe;IACpC,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC;AAMD,MAAM,UAAU,eAAe,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAwB;IACxE,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,GAAG,EAAE;QACnB,IAAI,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;YAC1B,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QACtD,CAAC;IACL,CAAC,CAAC;IACF,OAAO,CACH,iBAAO,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,aAC9B,QAAQ,EACT,gBAAO,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,GAAI,IACjF,CACX,CAAC;AACN,CAAC;AASD,+BAA+B;AAC/B,MAAM,UAAU,QAAQ,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U,CAAC;IAC5C,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,EAAE;QACrB,IAAI,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC9C,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,EAAE;QACrB,IAAI,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QACjD,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACH,MAAM;QACN,UAAU;QACV,WAAW;QACX,WAAW;QACX,GAAG;KACN,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { X } from 'lucide-react';
|
|
5
|
+
import { Styles } from './styles.js';
|
|
6
|
+
const Input = React.forwardRef(({ unstyled, value, onChange, className, type, ...others }, ref) => {
|
|
7
|
+
const _onChange = (ev) => {
|
|
8
|
+
onChange && onChange(ev.target.value);
|
|
9
|
+
};
|
|
10
|
+
const _onClear = () => {
|
|
11
|
+
onChange && onChange('');
|
|
12
|
+
};
|
|
13
|
+
return (_jsxs("div", { style: { position: 'relative', display: 'inline-block' }, className: clsx("w-full", className), children: [_jsx("input", { type: type || 'text', value: value == null ? '' : value, onChange: _onChange, className: clsx('w-full', unstyled ? Styles.INPUT_UNSTYLED : Styles.INPUT, className), ref: ref, ...others }), value && (_jsx("button", { onClick: _onClear, className: `absolute ${type !== 'number' ? 'right-2' : 'right-7'} top-1/2 -translate-y-1/2 size-7 text-gray-400 hover:text-red-500 cursor-pointer`, children: _jsx(X, {}) }))] }));
|
|
14
|
+
});
|
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KAAK,IAAI,CACL,iBAAQ,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,kFAAkF,YACzK,KAAC,CAAC,KAAG,GACA,CACZ,IAEH,CACT,CAAC;AACN,CAAC,CAAC,CAAA;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { Badge } from './Badge';
|
|
5
|
+
import { VInput } from './shadcn/input';
|
|
6
|
+
export function InputList({ value = [], onChange, className, delimiters = ", ", placeholder }) {
|
|
7
|
+
const [text, setText] = useState('');
|
|
8
|
+
const onBlur = (ev) => {
|
|
9
|
+
const v = ev.target.value;
|
|
10
|
+
if (v && v.trim()) {
|
|
11
|
+
onChange([...value, v.trim()]);
|
|
12
|
+
setText('');
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const onKeyDown = (ev) => {
|
|
16
|
+
const v = ev.target.value;
|
|
17
|
+
const isEmpty = !v.trim();
|
|
18
|
+
const key = ev.key;
|
|
19
|
+
if (key === 'Enter' || delimiters.indexOf(key) > -1) {
|
|
20
|
+
ev.preventDefault();
|
|
21
|
+
if (value && !isEmpty) {
|
|
22
|
+
onChange([...value, v.trim()]);
|
|
23
|
+
setText('');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else if (key === 'Backspace' && isEmpty) {
|
|
27
|
+
if (value && value.length > 0) {
|
|
28
|
+
value.pop();
|
|
29
|
+
onChange([...value]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const _onClick = (index) => {
|
|
34
|
+
if (value && value.length > 0) {
|
|
35
|
+
value.splice(index, 1);
|
|
36
|
+
onChange([...value]);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return (_jsxs("div", { className: clsx(className, 'w-full space-x-1 space-y-1 flex flex-wrap w-full rounded-md py-2 px-1 text-sm border border-input bg-background dark:bg-slate-800 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2'), children: [value && value.length > 0 &&
|
|
40
|
+
(value.map((v, index) => _jsx(Badge, { variant: "secondary", onClick: () => _onClick(index), style: { whiteSpace: 'nowrap' }, className: 'cursor-pointer', children: v }, index))), _jsx("div", { children: _jsx(VInput, { clearable: false, className: 'placeholder:text-muted-foreground px-1', variant: 'unstyled', type: 'text', value: text, onBlur: onBlur, onKeyDown: onKeyDown, onChange: setText, placeholder: !value || value.length === 0 ? placeholder : '' }) })] }));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=InputList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputList.js","sourceRoot":"","sources":["../../../../src/core/components/InputList.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAUxC,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,GAAG,IAAI,EAAE,WAAW,EAAkB;IACzG,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAE7C,MAAM,MAAM,GAAG,CAAC,EAAO,EAAE,EAAE;QACvB,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YAChB,QAAQ,CAAC,CAAC,GAAG,KAAK,EA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EAAE,8PAA8P,CAAC,aAEvR,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;gBACzB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CACpB,KAAC,KAAK,IAAC,OAAO,EAAE,WAAW,EAAc,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAC,gBAAgB,YAC/H,CAAC,IAD4B,KAAK,CAE/B,CACX,CAAC,EAEN,wBACI,KAAC,MAAM,IACH,SAAS,EAAE,KAAK,EAChB,SAAS,EAAC,wCAAwC,EAClD,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,OAAO,EACjB,WAAW,EAAE,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,GAC9D,GACA,IACJ,CACT,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
export function Link({ underline = 'always', className, children, ...others }) {
|
|
4
|
+
let underlineClass;
|
|
5
|
+
if (underline === 'always') {
|
|
6
|
+
underlineClass = 'underline';
|
|
7
|
+
}
|
|
8
|
+
else if (underline === 'hover') {
|
|
9
|
+
underlineClass = 'hover:underline';
|
|
10
|
+
}
|
|
11
|
+
return _jsx("a", { className: clsx("text-indigo-800 dark:text-indigo-300", className, underlineClass), ...others, children: children });
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=Link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../../../src/core/components/Link.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AAKxB,MAAM,UAAU,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAa;IAEpF,IAAI,cAAkC,CAAC;IACvC,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QACzB,cAAc,GAAG,WAAW,CAAC;IACjC,CAAC;SAAM,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;QAC/B,cAAc,GAAG,iBAAiB,CAAC;IACvC,CAAC;IACD,OAAO,YAAG,SAAS,EAAE,IAAI,CAAC,sCAAsC,EAAE,SAAS,EAAE,cAAc,CAAC,KAAM,MAAM,YAAG,QAAQ,GAAK,CAAA;AAC5H,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
export function MenuList({ className, children }) {
|
|
5
|
+
return (_jsx("ul", { className: `${className} space-y-1 flex flex-col items-start dark:px-2`, children: children }));
|
|
6
|
+
}
|
|
7
|
+
const MenuListItem = forwardRef(function _MenuListItem(props, ref) {
|
|
8
|
+
const { current, children, className, href = '#', onClick, ...others } = props;
|
|
9
|
+
return (_jsx("li", { className: clsx(className, current ?
|
|
10
|
+
'bg-gray-50 text-indigo-600'
|
|
11
|
+
:
|
|
12
|
+
'text-gray-700 dark:dark:text-slate-300 hover:text-indigo-600 hover:bg-gray-50 dark:hover:bg-slate-800 dark:hover:text-slate-50 dark:border dark:border-transparent dark:hover:border-slate-50', 'w-full rounded-md p-2 pl-3 text-sm leading-6 font-semibold'), children: _jsx("a", { ref: ref, href: href, onClick: (e) => {
|
|
13
|
+
if (onClick) {
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
onClick(e);
|
|
16
|
+
}
|
|
17
|
+
else if (href === '#') {
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
}
|
|
20
|
+
}, className: 'w-full flex items-center gap-x-3', ...others, children: children }) }));
|
|
21
|
+
});
|
|
22
|
+
MenuList.Item = MenuListItem;
|
|
23
|
+
//# sourceMappingURL=MenuList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuList.js","sourceRoot":"","sources":["../../../../src/core/components/MenuList.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAwB,UAAU,EAAE,MAAM,OAAO,CAAC;AAMzD,MAAM,UAAU,QAAQ,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAiB;IAC3D,OAAO,CACH,aAAI,SAAS,EAAE,GAAG,SAAS,gDAAgD,YACtE,QAAQ,GACR,CACR,CAAA;AACL,CAAC;AAOD,MAAM,YAAY,GAAG,UAAU,CAAuC,SAAS,aAAa,CAAC,KAAK,EAAE,GAAG;IACnG,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,GAAG,GAAG,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC;IAC/E,OAAO,CACH,aAAI,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YACpC,4BAA4B;YAC5B,CAAC;gBACD,iMAAiM,EACjM,4DAA4D,CAAC,YAC7D,YAAG,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBACpC,IAAI,OAAO,EAAE,CAAC;oBACV,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,OAAO,CAAC,CAAC,CAAC,CAAC;gBACf,CAAC;qBAAM,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;oBACtB,CAAC,CAAC,cAAc,EAAE,CAAC;gBACvB,CAAC;YACL,CAAC,EACG,SAAS,EAAC,kCAAkC,KACxC,MAAM,YACZ,QAAQ,GAAK,GACd,CACR,CAAA;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CircleX, CircleCheck, AlertTriangle, Info } from 'lucide-react';
|
|
3
|
+
export function MessageBox({ icon, status, title, children, className }) {
|
|
4
|
+
let defaultIcon, titleColor, textColor, bgColor;
|
|
5
|
+
switch (status) {
|
|
6
|
+
case 'error': {
|
|
7
|
+
defaultIcon = _jsx(CircleX, { className: "size-5 text-destructive", "aria-hidden": "true" });
|
|
8
|
+
titleColor = "";
|
|
9
|
+
textColor = "text-foreground";
|
|
10
|
+
bgColor = "bg-destructive border border-destructive";
|
|
11
|
+
break;
|
|
12
|
+
}
|
|
13
|
+
case 'warning': {
|
|
14
|
+
defaultIcon = _jsx(AlertTriangle, { className: "size-5 text-attention", "aria-hidden": "true" });
|
|
15
|
+
titleColor = "";
|
|
16
|
+
textColor = "text-foreground";
|
|
17
|
+
bgColor = "bg-attention border border-attention";
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
case 'success': {
|
|
21
|
+
defaultIcon = _jsx(CircleCheck, { className: "size-5 text-success", "aria-hidden": "true" });
|
|
22
|
+
titleColor = "";
|
|
23
|
+
textColor = "text-foreground";
|
|
24
|
+
bgColor = "bg-success border border-success";
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
case 'info': {
|
|
28
|
+
defaultIcon = _jsx(Info, { className: "size-5 text-info", "aria-hidden": "true" });
|
|
29
|
+
titleColor = "";
|
|
30
|
+
textColor = "text-foreground";
|
|
31
|
+
bgColor = "bg-info border border-info";
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
case 'default': {
|
|
35
|
+
defaultIcon = _jsx(Info, { className: "size-5 text-muted", "aria-hidden": "true" });
|
|
36
|
+
titleColor = "";
|
|
37
|
+
textColor = "text-foreground";
|
|
38
|
+
bgColor = "bg-muted border border-muted";
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
case 'done': {
|
|
42
|
+
defaultIcon = _jsx(Info, { className: "size-5 text-done", "aria-hidden": "true" });
|
|
43
|
+
titleColor = "";
|
|
44
|
+
textColor = "text-foreground";
|
|
45
|
+
bgColor = "bg-done border border-done";
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return (_jsx("div", { className: `rounded-md p-4 ${bgColor} ${className}`, children: _jsxs("div", { className: "flex", children: [_jsx("div", { className: "shrink-0", children: icon ?? defaultIcon }), _jsxs("div", { className: "w-full ml-2 px-1", children: [title && _jsx("h3", { className: `text-sm font-medium mb-2 ${titleColor}`, children: title }), _jsx("div", { className: `text-sm ${textColor} break-words`, children: children })] })] }) }));
|
|
50
|
+
}
|
|
51
|
+
export function ErrorBox({ title, className, children }) {
|
|
52
|
+
return _jsx(MessageBox, { status: "error", title: title, className: className, children: _jsx("pre", { children: children }) });
|
|
53
|
+
}
|
|
54
|
+
export function InfoBox({ title, className, children }) {
|
|
55
|
+
return _jsx(MessageBox, { status: "info", title: title, className: className, children: children });
|
|
56
|
+
}
|
|
57
|
+
export function WarningBox({ title, className, children }) {
|
|
58
|
+
return _jsx(MessageBox, { status: "warning", title: title, className: className, children: children });
|
|
59
|
+
}
|
|
60
|
+
export function SuccessBox({ title, className, children }) {
|
|
61
|
+
return _jsx(MessageBox, { status: "success", title: title, className: className, children: children });
|
|
62
|
+
}
|
|
63
|
+
export function DefaultBox({ title, className, children }) {
|
|
64
|
+
return _jsx(MessageBox, { status: "default", title: title, className: className, children: children });
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=MessageBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageBox.js","sourceRoot":"","sources":["../../../../src/core/components/MessageBox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,E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CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAmE;IACtH,OAAO,KAAC,UAAU,IAAC,MAAM,EAAC,SAAS,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,YAAG,QAAQ,GAAc,CAAA;AACnG,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAmE;IACtH,OAAO,KAAC,UAAU,IAAC,MAAM,EAAC,SAAS,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,YAAG,QAAQ,GAAc,CAAA;AACnG,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAmE;IACtH,OAAO,KAAC,UAAU,IAAC,MAAM,EAAC,SAAS,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,YAAG,QAAQ,GAAc,CAAA;AACnG,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { Fragment } from "react";
|
|
4
|
+
import { Dialog, DialogPanel, DialogTitle, Transition, TransitionChild } from "@headlessui/react";
|
|
5
|
+
import { X } from "lucide-react";
|
|
6
|
+
export function Modal({ className, children, isOpen, onClose, noCloseButton = false, allowOverflow = false, disableCloseOnClickOutside = false, }) {
|
|
7
|
+
const setOpen = (open) => {
|
|
8
|
+
if (!open) {
|
|
9
|
+
onClose();
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
return (_jsx(Transition, { show: isOpen, as: Fragment, children: _jsxs(Dialog, { style: { zIndex: 50 }, as: "div", className: "relative", onClose: disableCloseOnClickOutside ? () => { } : setOpen, children: [_jsx(TransitionChild, { as: Fragment, enter: "ease-out duration-300", enterFrom: "opacity-0", enterTo: "opacity-100", leave: "ease-in duration-200", leaveFrom: "opacity-100", leaveTo: "opacity-0", unmount: true, children: _jsx("div", { className: "fixed inset-0 bg-gray-500 dark:bg-slate-800 dark:opacity-75 opacity-75 transition-opacity" }) }), _jsx("div", { className: "fixed inset-0 z-10 w-screen overflow-y-auto", children: _jsx("div", { className: "flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0", children: _jsx(TransitionChild, { as: Fragment, enter: "ease-out duration-300", enterFrom: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95", enterTo: "opacity-100 translate-y-0 sm:scale-100", leave: "ease-in duration-200", leaveFrom: "opacity-100 translate-y-0 sm:scale-100", leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95", children: _jsxs(DialogPanel, { className: clsx("p-0! relative transform rounded-lg bg-white dark:bg-slate-900 text-left dark:text-slate-100 shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-md sm:p-6", allowOverflow ? "overflow-visible" : "overflow-hidden", className), children: [!noCloseButton && _jsx(ModalCloseButton, { onClose: onClose }), children] }) }) }) })] }) }));
|
|
13
|
+
}
|
|
14
|
+
function ModalCloseButton({ onClose }) {
|
|
15
|
+
return (_jsx("div", { className: "absolute right-0 top-0 hidden pr-4 pt-4 sm:block", children: _jsxs("button", { tabIndex: -1, type: "button", className: "rounded-md bg-white text-gray-400 dark:text-slate-200 dark:bg-slate-800 hover:brightness-95 focus:outline-hidden focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 hover:cursor-pointer", onClick: onClose, children: [_jsx("span", { className: "sr-only", children: "Close" }), _jsx(X, { className: "size-6", "aria-hidden": "true" })] }) }));
|
|
16
|
+
}
|
|
17
|
+
export function ModalTitle({ children, showDivider = false }) {
|
|
18
|
+
return (_jsx("div", { className: showDivider ? "border-b-solid border-b border-b-1" : "", children: _jsx(DialogTitle, { as: "h3", className: "py-4 pl-4 pr-8 text-base font-semibold leading-6 text-gray-900 dark:text-slate-50", children: children }) }));
|
|
19
|
+
}
|
|
20
|
+
export function ModalFooter({ children, className = "justify-end", fill = false }) {
|
|
21
|
+
return (_jsx("div", { className: clsx("w-full flex space-x-2 p-4 border-t-solid border-t-gray-100 dark:border-t-gray-800 border-t", className || "justify-end", fill ? "bg-gray-100 dark:bg-slate-800" : ""), children: children }));
|
|
22
|
+
}
|
|
23
|
+
export function ModalBody({ children, className = "" }) {
|
|
24
|
+
return _jsx("div", { className: clsx("p-4", className), children: children });
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=Modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../../src/core/components/Modal.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAWjC,MAAM,UAAU,KAAK,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,aAAa,GAAG,KAAK,EACrB,aAAa,GAAG,KAAK,EACrB,0BAA0B,GAAG,KAAK,GACzB;IACT,MAAM,OAAO,GAAG,CAAC,IAAa,EAAE,EAAE;QAC9B,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,OAAO,EAAE,CAAC;QACd,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,UAAU,IAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,YAClC,MAAC,MAAM,IACH,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EACrB,EAAE,EAAC,KAAK,EACR,SAAS,EAAC,UAAU,EACpB,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,aAEzD,KAAC,eAAe,IACZ,EAAE,EAAE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,oCAAoC,CAAC,CAAC,CAAC,EAAE,YACnE,KAAC,WAAW,IACR,EAAE,EAAC,IAAI,EACP,SAAS,EAAC,mFAAmF,YAE5F,QAAQ,GACC,GACZ,CACT,CAAC;AACN,CAAC;AASD,MAAM,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,GAAG,aAAa,EAAE,IAAI,GAAG,KAAK,EAAoB;IAC/F,OAAO,CACH,cACI,SAAS,EAAE,IAAI,CACX,4FAA4F,EAC5F,SAAS,IAAI,aAAa,EAC1B,IAAI,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE,CAC9C,YAEA,QAAQ,GACP,CACT,CAAC;AACN,CAAC;AAMD,MAAM,UAAU,SAAS,CAAC,EAAE,QAAQ,EAAE,SAAS,GAAG,EAAE,EAAkB;IAClE,OAAO,cAAK,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,YAAG,QAAQ,GAAO,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import React, { useEffect } from "react";
|
|
4
|
+
import { Styles } from "./styles.js";
|
|
5
|
+
function numberToString(value) {
|
|
6
|
+
if (value == null || isNaN(value)) {
|
|
7
|
+
return '';
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
return value.toString();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The value of this input is always a number. It can be undefined or NaN. If NaN the input value will not be updated with the NaN one.
|
|
15
|
+
* If undefined the input will be updated to be empty.
|
|
16
|
+
* The onChange callback is called whenever the value changes. If the input cannot be parsed as a number
|
|
17
|
+
* it will be returned as NaN.
|
|
18
|
+
*/
|
|
19
|
+
const NumberInput = React.forwardRef(({ value, onChange, className, noScroll = false, noSpinners = false, ...others }, ref) => {
|
|
20
|
+
// we need to store the state here in string
|
|
21
|
+
const [textValue, setTextValue] = React.useState(numberToString(value));
|
|
22
|
+
const _onChange = (ev) => {
|
|
23
|
+
const value = ev.target.value;
|
|
24
|
+
setTextValue(value);
|
|
25
|
+
if (value === '') {
|
|
26
|
+
onChange && onChange(undefined, value);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const num = parseFloat(value);
|
|
30
|
+
onChange && onChange(num, value);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
// we do not update if not empty and NaN
|
|
35
|
+
if (value == null || !isNaN(value)) {
|
|
36
|
+
const text = numberToString(value);
|
|
37
|
+
setTextValue(text);
|
|
38
|
+
}
|
|
39
|
+
}, [value]);
|
|
40
|
+
return (_jsx("input", { onWheel: noScroll ? event => { event.target.blur(); } : others.onWheel, type: 'number', value: textValue, onChange: _onChange, className: clsx(className, Styles.INPUT, { "no-spinners": noSpinners }, noSpinners && "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"), ref: ref, ...others }));
|
|
41
|
+
});
|
|
42
|
+
export { NumberInput };
|
|
43
|
+
//# sourceMappingURL=NumberInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../../../src/core/components/NumberInput.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAe,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,SAAS,cAAc,CAAC,KAAyB;IAC7C,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,EAAE,CAAC;IACd,CAAC;SAAM,CAAC;QACJ,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC5B,CAAC;AACL,CAAC;AASD;;;;;GAKG;AACH,MAAM,WAA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AAE,SAAS,EACnB,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,EAClE,UAAU,IAAI,sHAAsH,CACvI,EACD,GAAG,EAAE,GAAG,KACJ,MAAM,GACZ,CAEL,CAAA;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
const PORTAL_ID = '--tailwind-portal';
|
|
5
|
+
export function Portal({ children }) {
|
|
6
|
+
const tempNode = useRef(null);
|
|
7
|
+
const [portalEl, setPortalEl] = useState(null);
|
|
8
|
+
// hack to have the Portal not generating hydration errors (content mismatch) on SSR / CSR
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (tempNode.current) { // we are on the browser -> we an use the portal
|
|
11
|
+
const doc = tempNode.current.ownerDocument;
|
|
12
|
+
let portalEl = doc.getElementById(PORTAL_ID);
|
|
13
|
+
if (!portalEl) {
|
|
14
|
+
portalEl = doc.createElement('DIV');
|
|
15
|
+
portalEl.id = PORTAL_ID;
|
|
16
|
+
doc.body.appendChild(portalEl);
|
|
17
|
+
}
|
|
18
|
+
setPortalEl(portalEl);
|
|
19
|
+
}
|
|
20
|
+
}, [tempNode.current]);
|
|
21
|
+
if (portalEl) {
|
|
22
|
+
return createPortal(children, portalEl);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return _jsx("span", { ref: tempNode });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=Portal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Portal.js","sourceRoot":"","sources":["../../../../src/core/components/Portal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAA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|
|
5
|
+
renderOption(item) {
|
|
6
|
+
return this.labelOf(item);
|
|
7
|
+
}
|
|
8
|
+
findById(items, id) {
|
|
9
|
+
return items.find(item => this.idOf(item) === id);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export function RadioGroup({ checkColor, cols = "grid-cols-1", gap = "gap-2", value, onChange, options, checkIcon: CheckIcon = DefaultCheckIcon, adapter }) {
|
|
13
|
+
const [selected, setSelected] = useState(value);
|
|
14
|
+
const onSelect = (option) => {
|
|
15
|
+
setSelected(option);
|
|
16
|
+
onChange(option);
|
|
17
|
+
};
|
|
18
|
+
const selectedId = selected ? adapter.idOf(selected) : undefined;
|
|
19
|
+
return (_jsx("div", { className: clsx("grid", cols, gap), children: options.map(option => {
|
|
20
|
+
const key = adapter.idOf(option);
|
|
21
|
+
return (_jsx(RadioOption, { checkColor: checkColor, isSelected: key === selectedId, option: option, adapter: adapter, onSelect: onSelect, CheckIcon: CheckIcon }, key));
|
|
22
|
+
}) }));
|
|
23
|
+
}
|
|
24
|
+
function RadioOption({ checkColor, CheckIcon, adapter, isSelected, option, onSelect }) {
|
|
25
|
+
const [isHighlighted, setIsHighlighted] = useState(false);
|
|
26
|
+
return (_jsxs("div", { className: "flex gap-1 cursor-pointer items-center", onClick: () => onSelect(option), onMouseEnter: () => setIsHighlighted(true), onMouseLeave: () => setIsHighlighted(false), children: [_jsx("div", { className: "", children: _jsx(CheckIcon, { size: 24, isChecked: isSelected, isHighlighted: isHighlighted, color: checkColor }) }), _jsx("div", { children: adapter.renderOption(option) })] }));
|
|
27
|
+
}
|
|
28
|
+
function DefaultCheckIcon({ size, isChecked, isHighlighted, color = "currentColor" }) {
|
|
29
|
+
//https://www.svgrepo.com/svg/309414/checkbox-checked
|
|
30
|
+
//https://www.svgrepo.com/svg/309415/checkbox-unchecked
|
|
31
|
+
const opacity = isHighlighted ? 1 : 0.6;
|
|
32
|
+
return isChecked ? (_jsx("svg", { width: `${size}px`, height: `${size}px`, viewBox: "0 0 24 24", version: "1.1", children: _jsx("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: _jsx("g", { id: "ic_fluent_checkbox_checked_24_regular", fill: color, fillRule: "nonzero", opacity: opacity, children: _jsx("path", { d: "M18.25,3 C19.7687831,3 21,4.23121694 21,5.75 L21,18.25 C21,19.7687831 19.7687831,21 18.25,21 L5.75,21 C4.23121694,21 3,19.7687831 3,18.25 L3,5.75 C3,4.23121694 4.23121694,3 5.75,3 L18.25,3 Z M18.25,4.5 L5.75,4.5 C5.05964406,4.5 4.5,5.05964406 4.5,5.75 L4.5,18.25 C4.5,18.9403559 5.05964406,19.5 5.75,19.5 L18.25,19.5 C18.9403559,19.5 19.5,18.9403559 19.5,18.25 L19.5,5.75 C19.5,5.05964406 18.9403559,4.5 18.25,4.5 Z M10,14.4393398 L16.4696699,7.96966991 C16.7625631,7.6767767 17.2374369,7.6767767 17.5303301,7.96966991 C17.7965966,8.23593648 17.8208027,8.65260016 17.6029482,8.94621165 L17.5303301,9.03033009 L10.5303301,16.0303301 C10.2640635,16.2965966 9.84739984,16.3208027 9.55378835,16.1029482 L9.46966991,16.0303301 L6.46966991,13.0303301 C6.1767767,12.7374369 6.1767767,12.2625631 6.46966991,11.9696699 C6.73593648,11.7034034 7.15260016,11.6791973 7.44621165,11.8970518 L7.53033009,11.9696699 L10,14.4393398 L16.4696699,7.96966991 L10,14.4393398 Z" }) }) }) })) : (_jsx("svg", { width: `${size}px`, height: `${size}px`, viewBox: "0 0 24 24", version: "1.1", children: _jsx("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: _jsx("g", { id: "ic_fluent_checkbox_unchecked_24_regular", fill: color, fillRule: "nonzero", opacity: opacity, children: _jsx("path", { d: "M5.75,3 L18.25,3 C19.7687831,3 21,4.23121694 21,5.75 L21,18.25 C21,19.7687831 19.7687831,21 18.25,21 L5.75,21 C4.23121694,21 3,19.7687831 3,18.25 L3,5.75 C3,4.23121694 4.23121694,3 5.75,3 Z M5.75,4.5 C5.05964406,4.5 4.5,5.05964406 4.5,5.75 L4.5,18.25 C4.5,18.9403559 5.05964406,19.5 5.75,19.5 L18.25,19.5 C18.9403559,19.5 19.5,18.9403559 19.5,18.25 L19.5,5.75 C19.5,5.05964406 18.9403559,4.5 18.25,4.5 L5.75,4.5 Z" }) }) }) }));
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../../src/core/components/RadioGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,OAAgB,kBAAkB;IAGpC,YAAY,CAAC,IAAO;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IACD,QAAQ,CAAC,KAAU,EAAE,EAAU;QAC3B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IACtD,CAAC;CACJ;AAYD,MAAM,UAAU,UAAU,CAAU,EAAE,UAAU,EAAE,IAAI,GAAG,aAAa,EAAE,GAAG,GAAG,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,gBAAgB,EAAE,OAAO,EAA4B;IACzL,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,CAAC,MAAe,EAAE,EAAE;QACjC,WAAW,CAAC,MAAM,CAAC,CAAC;QACpB,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrB,CAAC,CAAA;IACD,MAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,IAA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AAE,KAAK,GAAG,cAAc,EAAkB;IAChG,qDAAqD;IACrD,uDAAuD;IACvD,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACxC,OAAO,SAAS,CAAC,CAAC,CAAC,CACf,cAAK,KAAK,EAAE,GAAG,IAAI,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,OAAO,EAAC,WAAW,EAAC,OAAO,EAAC,KAAK,YAC3E,YAAG,MAAM,EAAC,MAAM,EAAC,WAAW,EAAC,GAAG,EAAC,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,SAAS,YAC3D,YAAG,EAAE,EAAC,uCAAuC,EAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,YAC1F,eAAM,CAAC,EAAC,47BAA47B,GAAG,GACv8B,GACJ,GACF,CACT,CAAC,CAAC,CAAC,CACA,cAAK,KAAK,EAAE,GAAG,IAAI,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,OAAO,EAAC,WAAW,EAAC,OAAO,EAAC,KAAK,YAC3E,YAAG,MAAM,EAAC,MAAM,EAAC,WAAW,EAAC,GAAG,EAAC,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,SAAS,YAC3D,YAAG,EAAE,EAAC,yCAAyC,EAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,YAC5F,eAAM,CAAC,EAAC,+ZAA+Z,GAAG,GAC1a,GACJ,GACF,CACT,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from "@headlessui/react";
|
|
3
|
+
import { X } from "lucide-react";
|
|
4
|
+
import { Check, ChevronsUpDownIcon } from "lucide-react";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { useState, useEffect, useRef } from "react";
|
|
7
|
+
import { Button } from "./Button";
|
|
8
|
+
import { Center } from "./Center";
|
|
9
|
+
function getFilterByFn(filterBy) {
|
|
10
|
+
if (!filterBy) {
|
|
11
|
+
return (o) => String(o).toLowerCase();
|
|
12
|
+
}
|
|
13
|
+
else if (typeof filterBy === 'string') {
|
|
14
|
+
return (o) => String(o[filterBy]).toLowerCase();
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return filterBy;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function SelectBox({ clearTitle, ClearIcon = X, showFilter, filterBy, isClearable, disabled, by, options, value, onChange, className, addNew, addNewLabel, placeholder, optionLabel = (option) => String(option), label }) {
|
|
21
|
+
const [filter, setFilter] = useState();
|
|
22
|
+
const buttonRef = useRef(null);
|
|
23
|
+
const [buttonWidth, setButtonWidth] = useState();
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (buttonRef.current) {
|
|
26
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
27
|
+
setButtonWidth(entries[0].contentRect.width);
|
|
28
|
+
});
|
|
29
|
+
resizeObserver.observe(buttonRef.current);
|
|
30
|
+
return () => resizeObserver.disconnect();
|
|
31
|
+
}
|
|
32
|
+
}, []);
|
|
33
|
+
const onClear = (e) => {
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
e.stopPropagation();
|
|
36
|
+
if (isClearable) {
|
|
37
|
+
onChange(undefined);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const onFilterChange = (e) => {
|
|
41
|
+
setFilter(e.target.value);
|
|
42
|
+
};
|
|
43
|
+
let filteredOptions = options || [];
|
|
44
|
+
if (showFilter === undefined) {
|
|
45
|
+
showFilter = filteredOptions?.length >= 10;
|
|
46
|
+
}
|
|
47
|
+
if (showFilter && filter) {
|
|
48
|
+
const filterLc = filter.toLowerCase();
|
|
49
|
+
const filterFn = getFilterByFn(filterBy);
|
|
50
|
+
filteredOptions = filteredOptions.filter(o => filterFn(o).includes(filterLc));
|
|
51
|
+
}
|
|
52
|
+
const onFilterKeyDown = (e) => {
|
|
53
|
+
if (e.key !== "Escape"
|
|
54
|
+
&& e.key !== "Enter"
|
|
55
|
+
&& e.key !== "ArrowDown"
|
|
56
|
+
&& e.key !== "ArrowUp") {
|
|
57
|
+
e.stopPropagation();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return (_jsx(Listbox, { value: value || null, onChange: onChange, by: by, disabled: disabled, children: () => (_jsx("div", { className: 'overflow-y-visible ' + className, children: _jsxs("div", { className: "relative", children: [_jsxs(ListboxButton, { ref: buttonRef, className: "relative w-full cursor-default rounded-md bg-white py-1.5 text-left text-gray-900 shadow-2xs ring-1 ring-inset ring-gray-300 focus:outline-hidden focus:ring-2 focus:ring-indigo-600 dark:ring-slate-600 dark:text-slate-50 dark:bg-slate-800 sm:text-sm sm:leading-6 hover:cursor-pointer", children: [label && _jsx("div", { className: 'w-full text-gray-500 text-left px-2', children: label }), _jsx("span", { className: "block truncate pl-3 pr-14", children: value ? optionLabel(value) : placeholder }), isClearable && value != null && _jsx("span", { className: "absolute inset-y-0 right-0 mr-5 flex items-center pr-2", onClick: onClear, children: _jsx(ClearIcon, { title: clearTitle, className: "size-5 text-gray-400 hover:text-red-500 cursor-pointer", "aria-hidden": "true" }) }), !disabled &&
|
|
61
|
+
_jsx("span", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2", children: _jsx(ChevronsUpDownIcon, { className: "size-5 text-gray-400", "aria-hidden": "true" }) })] }), _jsxs(ListboxOptions, { anchor: "bottom", style: { width: buttonWidth, zIndex: 100000000 }, className: "absolute z-10 mt-1 overflow-auto rounded-md bg-white dark:ring-slate-600 dark:text-slate-50 dark:bg-slate-800 py-1 text-base shadow-lg ring-1 ring-gray-300 ring-opacity-5 focus:outline-hidden sm:text-sm", children: [showFilter &&
|
|
62
|
+
_jsx("div", { className: "p-1", children: _jsx("input", { type: "text", value: filter || '', onKeyDown: onFilterKeyDown, onChange: onFilterChange, className: "w-full p-1 border border-gray-300 rounded-md dark:bg-slate-700 dark:text-slate-50", placeholder: "Filter..." }) }), _jsx("div", { className: "overflow-y-auto max-h-60", children: filteredOptions.map((option, i) => _jsx(ListOption, { option: option, optionLabel: optionLabel, className: "hover:cursor-pointer" }, i)) }), addNew &&
|
|
63
|
+
_jsx(Center, { className: "font-semibold py-2 border-t", children: _jsx(Button, { variant: 'secondary', onClick: addNew, children: addNewLabel }) })] })] }) })) }));
|
|
64
|
+
}
|
|
65
|
+
export function ListOption({ option, optionLabel, onClick, className }) {
|
|
66
|
+
return (_jsx(ListboxOption, { className: ({ active }) => clsx(active ? 'bg-indigo-600 text-white dark:bg-indigo-800 dark:text-white' : 'text-gray-900 dark:text-slate-50', 'relative cursor-default select-none py-2 pl-3 pr-9', className), value: option, onClick: onClick, children: ({ selected, active }) => (_jsxs(_Fragment, { children: [_jsx("div", { className: clsx(selected ? 'font-semibold' : 'font-inherit', 'block truncate'), children: optionLabel(option) }), selected ? (_jsx("div", { className: clsx(active ? 'text-white' : 'text-indigo-600', 'absolute inset-y-0 right-0 flex items-center pr-4'), children: _jsx(Check, { className: "size-5", "aria-hidden": "true" }) })) : null] })) }));
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=SelectBox.js.map
|