@signal24/vue-foundation 4.30.10 → 4.31.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.
Files changed (83) hide show
  1. package/.oxlintrc.json +39 -0
  2. package/CLAUDE.md +64 -0
  3. package/README.md +43 -0
  4. package/demo/vite.config.ts +2 -2
  5. package/dist/src/vite-plugins/index.js +0 -1
  6. package/dist/tsconfig.app.tsbuildinfo +1 -1
  7. package/dist/vue-foundation.es.js +12 -11
  8. package/docs/.vitepress/config.ts +118 -0
  9. package/docs/.vitepress/theme/DemoContainer.vue +62 -0
  10. package/docs/.vitepress/theme/VfSetup.vue +13 -0
  11. package/docs/.vitepress/theme/index.ts +18 -0
  12. package/docs/.vitepress/theme/style.css +220 -0
  13. package/docs/components/overlay.md +95 -0
  14. package/docs/components/toast.md +59 -0
  15. package/docs/components/vf-ajax-select.md +47 -0
  16. package/docs/components/vf-alert-modal.md +79 -0
  17. package/docs/components/vf-ez-smart-select.md +45 -0
  18. package/docs/components/vf-modal.md +86 -0
  19. package/docs/components/vf-smart-select.md +110 -0
  20. package/docs/demos/components/DemoAlertHelpers.vue +55 -0
  21. package/docs/demos/components/DemoContextMenu.vue +44 -0
  22. package/docs/demos/components/DemoOverlay.vue +41 -0
  23. package/docs/demos/components/DemoToast.vue +46 -0
  24. package/docs/demos/components/DemoVfAjaxSelect.vue +30 -0
  25. package/docs/demos/components/DemoVfEzSmartSelect.vue +32 -0
  26. package/docs/demos/components/DemoVfModal.vue +31 -0
  27. package/docs/demos/components/DemoVfSmartSelect.vue +81 -0
  28. package/docs/demos/directives/DemoAutofocus.vue +43 -0
  29. package/docs/demos/directives/DemoConfirmButton.vue +43 -0
  30. package/docs/demos/directives/DemoDateInput.vue +24 -0
  31. package/docs/demos/directives/DemoDatetime.vue +105 -0
  32. package/docs/demos/directives/DemoDisabled.vue +35 -0
  33. package/docs/demos/directives/DemoDuration.vue +26 -0
  34. package/docs/demos/directives/DemoHotkey.vue +42 -0
  35. package/docs/demos/directives/DemoInfiniteScroll.vue +30 -0
  36. package/docs/demos/directives/DemoReadonly.vue +26 -0
  37. package/docs/demos/directives/DemoStickyMinWidth.vue +76 -0
  38. package/docs/demos/directives/DemoTooltip.vue +43 -0
  39. package/docs/demos/filters/DemoFilters.vue +47 -0
  40. package/docs/demos/helpers/DemoErrorHandling.vue +51 -0
  41. package/docs/demos/helpers/DemoMasking.vue +24 -0
  42. package/docs/demos/hooks/DemoInfiniteScroll.vue +32 -0
  43. package/docs/demos/hooks/DemoResizeWatcher.vue +25 -0
  44. package/docs/directives/v-autofocus.md +24 -0
  45. package/docs/directives/v-confirm-button.md +44 -0
  46. package/docs/directives/v-date-input.md +26 -0
  47. package/docs/directives/v-datetime.md +58 -0
  48. package/docs/directives/v-disabled.md +28 -0
  49. package/docs/directives/v-duration.md +42 -0
  50. package/docs/directives/v-hotkey.md +28 -0
  51. package/docs/directives/v-infinite-scroll.md +26 -0
  52. package/docs/directives/v-readonly.md +24 -0
  53. package/docs/directives/v-sticky-min-width.md +29 -0
  54. package/docs/directives/v-tooltip.md +49 -0
  55. package/docs/filters/index.md +184 -0
  56. package/docs/guide/css-reference.md +88 -0
  57. package/docs/guide/getting-started.md +68 -0
  58. package/docs/guide/overlay-system.md +114 -0
  59. package/docs/helpers/array-utils.md +30 -0
  60. package/docs/helpers/context-menu.md +76 -0
  61. package/docs/helpers/delay.md +27 -0
  62. package/docs/helpers/error-handling.md +100 -0
  63. package/docs/helpers/masking.md +104 -0
  64. package/docs/helpers/number-utils.md +17 -0
  65. package/docs/helpers/object-utils.md +130 -0
  66. package/docs/helpers/openapi.md +65 -0
  67. package/docs/helpers/string-utils.md +65 -0
  68. package/docs/hooks/use-infinite-scroll.md +89 -0
  69. package/docs/hooks/use-resize-watcher.md +64 -0
  70. package/docs/index.md +24 -0
  71. package/docs/types/index.md +113 -0
  72. package/docs/vite-plugins/openapi-generator.md +101 -0
  73. package/lefthook.yml +12 -0
  74. package/package.json +22 -23
  75. package/src/components/overlay-container.ts +0 -1
  76. package/src/components/vf-ajax-select.vue +1 -3
  77. package/src/directives/duration.ts +1 -1
  78. package/src/directives/tooltip.ts +9 -2
  79. package/src/helpers/error.ts +2 -1
  80. package/src/vite-plugins/index.ts +0 -1
  81. package/tsconfig.node.json +2 -1
  82. package/vite.config.ts +2 -2
  83. package/eslint.config.mjs +0 -70
package/.oxlintrc.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "plugins": ["typescript", "unicorn", "oxc", "vitest", "promise", "import"],
3
+ "env": {
4
+ "builtin": true,
5
+ "es2025": true,
6
+ "commonjs": true,
7
+ "node": true
8
+ },
9
+ "ignorePatterns": ["dist/", ".yarn/", "src/openapi-client-generated/"],
10
+ "rules": {
11
+ "no-array-constructor": "error",
12
+ "no-case-declarations": "error",
13
+ "no-empty": "error",
14
+ "no-fallthrough": "error",
15
+ "no-prototype-builtins": "error",
16
+ "no-redeclare": "error",
17
+ "no-regex-spaces": "error",
18
+ "no-unused-expressions": "error",
19
+ "no-var": "error",
20
+ "prefer-rest-params": "error",
21
+ "prefer-spread": "error",
22
+ "typescript/ban-ts-comment": "error",
23
+ "typescript/no-empty-object-type": "error",
24
+ "typescript/no-explicit-any": "error",
25
+ "typescript/no-namespace": "error",
26
+ "typescript/no-require-imports": "error",
27
+ "typescript/no-unnecessary-type-constraint": "error",
28
+ "typescript/no-unsafe-function-type": "error",
29
+ "typescript/prefer-namespace-keyword": "error"
30
+ },
31
+ "overrides": [
32
+ {
33
+ "files": ["tests/**/*.spec.ts"],
34
+ "rules": {
35
+ "typescript/no-explicit-any": "off"
36
+ }
37
+ }
38
+ ]
39
+ }
package/CLAUDE.md ADDED
@@ -0,0 +1,64 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code when working with this repository.
4
+
5
+ ## Project Overview
6
+
7
+ `@signal24/vue-foundation` is a Vue 3 component library (components, directives, helpers, hooks) distributed as an ES module with TypeScript types. See `README.md` for full API documentation.
8
+
9
+ ## Commands
10
+
11
+ ```bash
12
+ yarn build # Clean dist, Vite build, generate types
13
+ yarn build:watch # Rebuild on file changes
14
+ yarn demo # Run demo app for testing components
15
+ yarn dev # Vite dev server
16
+ yarn test:unit # Run unit tests (Vitest)
17
+ yarn test:types # Type checking (vue-tsc)
18
+ yarn lint # ESLint with auto-fix
19
+ yarn format # Prettier
20
+ ```
21
+
22
+ ## Architecture
23
+
24
+ ```
25
+ src/
26
+ index.ts # Main entry, exports everything, installVf()
27
+ config.ts # Global options (configureVf)
28
+ types.ts # Utility types (Branded, PickRequired, etc.)
29
+ components/ # Vue components + overlay system
30
+ overlay-container.ts # Core overlay management (presentOverlay, etc.)
31
+ overlay-anchor.vue # Positioned overlays
32
+ overlay-types.ts # Anchor option types
33
+ vf-modal.vue # Base modal shell
34
+ vf-alert-modal.vue # Alert/confirm dialog
35
+ alert-helpers.ts # showAlert, showConfirm, showWait, etc.
36
+ modal-helpers.ts # vfModalRef()
37
+ vf-toast.vue # Toast notification
38
+ toast-helpers.ts # showToast()
39
+ vf-smart-select.vue # Searchable select with generics
40
+ vf-ez-smart-select.vue # Simplified smart select
41
+ vf-ajax-select.vue # Async-loading select
42
+ directives/ # v-autofocus, v-tooltip, v-hotkey, v-datetime, etc.
43
+ index.ts # registerDirectives() + type augmentation
44
+ helpers/ # Pure utility functions
45
+ hooks/ # Composition API hooks (infinite-scroll, resize-watcher)
46
+ filters/ # Display formatting (createFilters)
47
+ vite-plugins/ # OpenAPI client generator Vite plugin
48
+ ```
49
+
50
+ ## Key Patterns
51
+
52
+ - **Overlay system**: Components with a `callback` prop are shown via `presentOverlay()`, which wraps them in a Promise. The callback prop is injected automatically.
53
+ - **Error convention**: `UserError` = user-facing (shown directly), other errors = system errors (wrapped with support text). `handleErrorAndAlert()` dispatches to the global error handler and shows an alert.
54
+ - **Masking**: `maskForm()` / `maskComponent()` disable UI during async ops and return an unmask function.
55
+ - **Directives**: All registered in `registerDirectives()`. State is stored on elements via Symbols.
56
+ - **Generics**: `VfSmartSelect` and `VfAjaxSelect` use Vue 3.3+ `defineProps` with generics.
57
+
58
+ ## Build Details
59
+
60
+ - Vite library mode, ES format only
61
+ - External deps: `vue`, `@vue/shared`, `date-fns`, `lodash`, `@signal24/openapi-client-codegen`
62
+ - SCSS with `api: 'modern-compiler'`
63
+ - Vite-plugins have separate tsconfig (`tsconfig.vite-plugins.json`)
64
+ - Main branch is `develop`
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # @signal24/vue-foundation
2
+
3
+ A Vue 3 component library providing common components, directives, helpers, and hooks for building applications. Distributed as an ES module with full TypeScript type definitions.
4
+
5
+ ## Documentation
6
+
7
+ Full documentation and live interactive demos: **[signal24.github.io/vue-foundation](https://signal24.github.io/vue-foundation/)**
8
+
9
+ ## Quick Start
10
+
11
+ ```bash
12
+ yarn add @signal24/vue-foundation
13
+ # Peer dependencies
14
+ yarn add vue date-fns lodash
15
+ ```
16
+
17
+ ```typescript
18
+ import { createApp } from 'vue';
19
+ import { installVf, configureVf, OverlayContainer } from '@signal24/vue-foundation';
20
+ import '@signal24/vue-foundation/dist/vue-foundation.css';
21
+
22
+ import App from './App.vue';
23
+
24
+ const app = createApp(App);
25
+ installVf(app);
26
+ configureVf({});
27
+ app.mount('#app');
28
+ ```
29
+
30
+ See the [Getting Started guide](https://signal24.github.io/vue-foundation/guide/getting-started) for full setup instructions.
31
+
32
+ ## What's Included
33
+
34
+ - **Components** — Modal system, searchable selects, toast notifications, overlay management
35
+ - **Directives** — v-tooltip, v-hotkey, v-datetime, v-confirm-button, v-infinite-scroll, and more
36
+ - **Helpers** — Error handling, form masking, context menus, string/number/object utilities
37
+ - **Hooks** — useInfiniteScroll, useResizeWatcher
38
+ - **Filters** — Display formatting via createFilters()
39
+ - **Types** — Branded types, PickRequired, PickOptional, and more
40
+
41
+ ## License
42
+
43
+ MIT
@@ -1,8 +1,8 @@
1
1
  import { fileURLToPath, URL } from 'node:url';
2
2
 
3
- import eslintPlugin from '@nabla/vite-plugin-eslint';
4
3
  import { openapiClientGeneratorPlugin } from '@signal24/vue-foundation/vite-plugins';
5
4
  import vue from '@vitejs/plugin-vue';
5
+ import oxlintPlugin from 'vite-plugin-oxlint';
6
6
  import { defineConfig } from 'vite';
7
7
 
8
8
  // https://vitejs.dev/config/
@@ -14,7 +14,7 @@ export default defineConfig({
14
14
  // without that, we lose context tracking through otel and Sentry errors and traces are no longer correlated
15
15
  target: 'es2015'
16
16
  },
17
- plugins: [vue(), eslintPlugin(), openapiClientGeneratorPlugin()],
17
+ plugins: [vue(), oxlintPlugin(), openapiClientGeneratorPlugin()],
18
18
  resolve: {
19
19
  alias: {
20
20
  '@': fileURLToPath(new URL('../src', import.meta.url))
@@ -1,2 +1 @@
1
- // todo: dunno why this needs .JS, but Vite panics with ERR_MODULE_NOT_FOUND if we don't
2
1
  export * from './vite-openapi-plugin.js';