@signal24/vue-foundation 4.16.1 → 4.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/demo/components/demo-root.vue +21 -0
  2. package/demo/components/demo-vf-smart-select.vue +28 -0
  3. package/demo/index.html +14 -0
  4. package/demo/index.ts +10 -0
  5. package/demo/vite.config.ts +23 -0
  6. package/dist/demo/components/demo-root.vue.d.ts +2 -0
  7. package/dist/demo/components/demo-vf-smart-select.vue.d.ts +2 -0
  8. package/dist/demo/index.d.ts +1 -0
  9. package/dist/demo/vite.config.d.ts +2 -0
  10. package/dist/src/components/index.d.ts +5 -5
  11. package/dist/src/components/overlay-anchor.vue.d.ts +6 -8
  12. package/dist/src/components/overlay-container.d.ts +1 -1
  13. package/dist/src/components/toast-helpers.d.ts +1 -1
  14. package/dist/src/components/vf-ajax-select.vue.d.ts +26 -0
  15. package/dist/src/components/{alert-modal.vue.d.ts → vf-alert-modal.vue.d.ts} +1 -1
  16. package/dist/src/components/{ez-smart-select.vue.d.ts → vf-ez-smart-select.vue.d.ts} +14 -6
  17. package/dist/src/components/{modal.vue.d.ts → vf-modal.vue.d.ts} +9 -11
  18. package/dist/src/components/vf-smart-select.vue.d.ts +47 -0
  19. package/dist/src/components/{toast.vue.d.ts → vf-toast.vue.d.ts} +1 -1
  20. package/dist/vue-foundation.es.js +828 -894
  21. package/eslint.config.mjs +67 -0
  22. package/package.json +14 -12
  23. package/src/components/alert-helpers.ts +1 -1
  24. package/src/components/index.ts +5 -5
  25. package/src/components/overlay-container.ts +5 -1
  26. package/src/components/toast-helpers.ts +1 -1
  27. package/src/components/vf-ajax-select.vue +61 -0
  28. package/src/components/{alert-modal.vue → vf-alert-modal.vue} +5 -5
  29. package/src/components/{ez-smart-select.vue → vf-ez-smart-select.vue} +12 -8
  30. package/src/components/{modal.vue → vf-modal.vue} +3 -3
  31. package/src/components/vf-smart-select.vue +587 -0
  32. package/src/directives/duration.ts +3 -3
  33. package/src/filters/index.ts +1 -0
  34. package/src/helpers/array.ts +1 -0
  35. package/src/helpers/error.ts +4 -0
  36. package/src/helpers/object.ts +1 -0
  37. package/tsconfig.app.json +1 -1
  38. package/tsconfig.node.json +1 -1
  39. package/tsconfig.vitest.json +2 -2
  40. package/.eslintrc.cjs +0 -35
  41. package/dist/src/components/ajax-select.vue.d.ts +0 -19
  42. package/dist/src/components/smart-select.vue.d.ts +0 -115
  43. package/src/components/ajax-select.vue +0 -75
  44. package/src/components/smart-select.vue +0 -609
  45. /package/src/components/{toast.vue → vf-toast.vue} +0 -0
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <div id="vf-demo">
3
+ <select v-model="selectedDemo">
4
+ <option :value="null" disabled selected>Select a demo</option>
5
+ <option v-for="demo in demos" :key="demo" :value="demo">{{ demo }}</option>
6
+ </select>
7
+
8
+ <DemoVfSmartSelect v-if="selectedDemo === 'VfSmartSelect'" />
9
+ </div>
10
+ </template>
11
+
12
+ <script lang="ts" setup>
13
+ import { ref } from 'vue';
14
+
15
+ import DemoVfSmartSelect from './demo-vf-smart-select.vue';
16
+
17
+ const demos = ['VfSmartSelect'] as const;
18
+ const selectedDemo = ref<(typeof demos)[number] | null>();
19
+ </script>
20
+
21
+ <style lang="scss" scoped></style>
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <div id="demo-vf-smart-select">
3
+ <VfSmartSelect v-model="selectedOption" :options="options" label-field="label" />
4
+ </div>
5
+ </template>
6
+
7
+ <script lang="ts" setup>
8
+ import { ref } from 'vue';
9
+
10
+ import VfSmartSelect from '@/components/vf-smart-select.vue';
11
+
12
+ const options = [
13
+ { value: '1', label: 'Option 1' },
14
+ { value: '2', label: 'Option 2' },
15
+ { value: '3', label: 'Option 3' },
16
+ { value: '4', label: 'Option 4' },
17
+ { value: '5', label: 'Option 5' },
18
+ { value: '6', label: 'Option 6' },
19
+ { value: '7', label: 'Option 7' },
20
+ { value: '8', label: 'Option 8' },
21
+ { value: '9', label: 'Option 9' },
22
+ { value: '10', label: 'Option 10' }
23
+ ];
24
+
25
+ const selectedOption = ref<(typeof options)[number] | null>(null);
26
+ </script>
27
+
28
+ <style lang="scss" scoped></style>
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta http-equiv="Cache-control" content="no-cache" />
7
+ <meta http-equiv="Expires" content="-1" />
8
+ <title>Vue-Foundation Demo</title>
9
+ </head>
10
+ <body>
11
+ <div id="app"></div>
12
+ <script type="module" src="/index.ts"></script>
13
+ </body>
14
+ </html>
package/demo/index.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { createApp } from 'vue';
2
+
3
+ import { configureVf } from '@/config';
4
+
5
+ import DemoRoot from './components/demo-root.vue';
6
+
7
+ const app = createApp(DemoRoot);
8
+ configureVf({});
9
+
10
+ app.mount(document.body);
@@ -0,0 +1,23 @@
1
+ import { fileURLToPath, URL } from 'node:url';
2
+
3
+ import eslintPlugin from '@nabla/vite-plugin-eslint';
4
+ import { openapiClientGeneratorPlugin } from '@signal24/vue-foundation/vite-plugins';
5
+ import vue from '@vitejs/plugin-vue';
6
+ import { defineConfig } from 'vite';
7
+
8
+ // https://vitejs.dev/config/
9
+ export default defineConfig({
10
+ build: {
11
+ sourcemap: true,
12
+
13
+ // note we have to use ES2015 to downgrade async/await to Promises so that Zone.js can monkey patch them
14
+ // without that, we lose context tracking through otel and Sentry errors and traces are no longer correlated
15
+ target: 'es2015'
16
+ },
17
+ plugins: [vue(), eslintPlugin(), openapiClientGeneratorPlugin()],
18
+ resolve: {
19
+ alias: {
20
+ '@': fileURLToPath(new URL('../src', import.meta.url))
21
+ }
22
+ }
23
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
@@ -1,8 +1,8 @@
1
- import VfAjaxSelect from './ajax-select.vue';
2
- import VfAlertModal from './alert-modal.vue';
3
- import VfEzSmartSelect from './ez-smart-select.vue';
4
- import VfModal from './modal.vue';
5
- import VfSmartSelect from './smart-select.vue';
1
+ import VfAjaxSelect from './vf-ajax-select.vue';
2
+ import VfAlertModal from './vf-alert-modal.vue';
3
+ import VfEzSmartSelect from './vf-ez-smart-select.vue';
4
+ import VfModal from './vf-modal.vue';
5
+ import VfSmartSelect from './vf-smart-select.vue';
6
6
  export * from './alert-helpers';
7
7
  export * from './overlay-container';
8
8
  export * from './toast-helpers';
@@ -1,22 +1,20 @@
1
1
  import type { OverlayAnchorOptions } from './overlay-types';
2
- declare var __VLS_0: {};
3
- declare var __VLS_inheritedAttrs: {};
4
- declare const __VLS_templateResult: {
2
+ declare function __VLS_template(): {
5
3
  slots: {
6
- default?(_: typeof __VLS_0): any;
4
+ default?(_: {}): any;
7
5
  };
8
6
  refs: {};
9
- attrs: Partial<typeof __VLS_inheritedAttrs>;
7
+ attrs: Partial<{}>;
10
8
  };
11
- type __VLS_Slots = typeof __VLS_templateResult['slots'];
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
10
  declare const __VLS_component: import("vue").DefineComponent<{
13
11
  overlayId: string;
14
12
  anchor: OverlayAnchorOptions;
15
13
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
16
14
  overlayId: string;
17
15
  anchor: OverlayAnchorOptions;
18
- } & {}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}>;
19
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_Slots>;
16
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
20
18
  export default _default;
21
19
  type __VLS_WithTemplateSlots<T, S> = T & {
22
20
  new (): {
@@ -15,7 +15,7 @@ export interface OverlayInjection<C extends OverlayComponent, R extends Componen
15
15
  }
16
16
  export declare const OverlayContainer: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
17
17
  [key: string]: any;
18
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}>;
18
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
19
19
  export type Vue__ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props, RawBindings, D, C, M> = ComponentPublicInstance<any>, Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = {
20
20
  __isFragment?: never;
21
21
  __isTeleport?: never;
@@ -1,2 +1,2 @@
1
- import { type IToastOptions } from './toast.vue';
1
+ import { type IToastOptions } from './vf-toast.vue';
2
2
  export declare function showToast(options: IToastOptions): () => void;
@@ -0,0 +1,26 @@
1
+ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
2
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
3
+ readonly "onUpdate:modelValue"?: ((args_0: T) => any) | undefined;
4
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<{}> & Readonly<{
5
+ "onUpdate:modelValue"?: ((args_0: T) => any) | undefined;
6
+ }>, never>, "onUpdate:modelValue"> & {
7
+ modelValue: T;
8
+ loadFn: () => Promise<T[]>;
9
+ nullText?: string;
10
+ loadingText?: string;
11
+ displayKey?: keyof T;
12
+ preprocesor?: (option: T) => string;
13
+ }> & import("vue").PublicProps;
14
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
15
+ attrs: any;
16
+ slots: {};
17
+ emit: (evt: "update:modelValue", args_0: T) => void;
18
+ }>) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
19
+ [key: string]: any;
20
+ }> & {
21
+ __ctx?: Awaited<typeof __VLS_setup>;
22
+ };
23
+ export default _default;
24
+ type __VLS_PrettifyLocal<T> = {
25
+ [K in keyof T]: T[K];
26
+ } & {};
@@ -14,5 +14,5 @@ declare const _default: import("vue").DefineComponent<{
14
14
  message: string | Error;
15
15
  shouldConfirm?: boolean;
16
16
  callback: (ok: boolean) => void;
17
- } & {}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}>;
17
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
18
  export default _default;
@@ -1,18 +1,26 @@
1
+ interface IComputedOption {
2
+ value: string;
3
+ label: string;
4
+ }
1
5
  declare const _default: import("vue").DefineComponent<{
2
6
  modelValue: string | null | undefined;
3
7
  nullTitle?: string;
4
8
  placeholder?: string;
5
- options: Record<string, string> | string[];
6
- formatter?: (value: any) => string;
9
+ options: {
10
+ [K: string]: string;
11
+ } | string[];
12
+ formatter?: (item: IComputedOption) => string;
7
13
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
14
  "update:modelValue": (value: string | null) => any;
9
15
  }, string, import("vue").PublicProps, Readonly<{
10
16
  modelValue: string | null | undefined;
11
17
  nullTitle?: string;
12
18
  placeholder?: string;
13
- options: Record<string, string> | string[];
14
- formatter?: (value: any) => string;
15
- } & {
19
+ options: {
20
+ [K: string]: string;
21
+ } | string[];
22
+ formatter?: (item: IComputedOption) => string;
23
+ }> & Readonly<{
16
24
  "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
17
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}>;
25
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
26
  export default _default;
@@ -2,21 +2,19 @@ declare function mask(): () => void;
2
2
  declare function unmask(): void;
3
3
  declare function hide(): () => void;
4
4
  declare function unhide(): void;
5
- declare var __VLS_1: {};
6
- declare var __VLS_inheritedAttrs: {};
7
- declare const __VLS_templateResult: {
5
+ declare function __VLS_template(): {
8
6
  slots: {
9
7
  header?(_: {}): any;
10
- default?(_: typeof __VLS_1): any;
8
+ default?(_: {}): any;
11
9
  footer?(_: {}): any;
12
10
  };
13
11
  refs: {
14
- overlay: import("vue").HTMLAttributes & import("vue").ReservedProps;
15
- form: import("vue").FormHTMLAttributes & import("vue").ReservedProps;
12
+ overlay: HTMLDivElement;
13
+ form: HTMLFormElement;
16
14
  };
17
- attrs: Partial<typeof __VLS_inheritedAttrs>;
15
+ attrs: Partial<{}>;
18
16
  };
19
- type __VLS_Slots = typeof __VLS_templateResult['slots'];
17
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
20
18
  declare const __VLS_component: import("vue").DefineComponent<{
21
19
  id?: string;
22
20
  closeOnMaskClick?: boolean;
@@ -36,10 +34,10 @@ declare const __VLS_component: import("vue").DefineComponent<{
36
34
  scrolls?: boolean;
37
35
  closeX?: boolean;
38
36
  class?: string | string[];
39
- } & {
37
+ }> & Readonly<{
40
38
  onFormSubmit?: ((...args: any[]) => any) | undefined;
41
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}>;
42
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_Slots>;
39
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
40
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
43
41
  export default _default;
44
42
  type __VLS_WithTemplateSlots<T, S> = T & {
45
43
  new (): {
@@ -0,0 +1,47 @@
1
+ declare const _default: <T, V = T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
2
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
3
+ readonly "onUpdate:modelValue"?: ((args_0: V) => any) | undefined;
4
+ readonly onOptionsLoaded?: ((args_0: T[]) => any) | undefined;
5
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<{}> & Readonly<{
6
+ "onUpdate:modelValue"?: ((args_0: V) => any) | undefined;
7
+ onOptionsLoaded?: ((args_0: T[]) => any) | undefined;
8
+ }>, never>, "onUpdate:modelValue" | "onOptionsLoaded"> & {
9
+ modelValue: V | null;
10
+ loadOptions?: (searchText: string | null) => Promise<T[]>;
11
+ options?: T[];
12
+ prependOptions?: T[];
13
+ appendOptions?: T[];
14
+ onCreateItem?: (searchText: string) => void;
15
+ preload?: boolean;
16
+ remoteSearch?: boolean;
17
+ searchFields?: (keyof T)[];
18
+ placeholder?: string;
19
+ keyField?: keyof T;
20
+ keyExtractor?: (option: T) => string | symbol;
21
+ valueField?: keyof T;
22
+ valueExtractor?: (option: T) => V;
23
+ labelField?: keyof T;
24
+ formatter?: (option: T) => string;
25
+ subtitleFormatter?: (option: T) => string;
26
+ nullTitle?: string;
27
+ noResultsText?: string;
28
+ disabled?: boolean;
29
+ optionsListId?: string;
30
+ debug?: boolean;
31
+ required?: boolean;
32
+ }> & import("vue").PublicProps;
33
+ expose(exposed: import("vue").ShallowUnwrapRef<{
34
+ addRemoteOption: (option: T) => void;
35
+ }>): void;
36
+ attrs: any;
37
+ slots: {};
38
+ emit: ((evt: "update:modelValue", args_0: V) => void) & ((evt: "optionsLoaded", args_0: T[]) => void);
39
+ }>) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
40
+ [key: string]: any;
41
+ }> & {
42
+ __ctx?: Awaited<typeof __VLS_setup>;
43
+ };
44
+ export default _default;
45
+ type __VLS_PrettifyLocal<T> = {
46
+ [K in keyof T]: T[K];
47
+ } & {};
@@ -9,5 +9,5 @@ declare const _default: import("vue").DefineComponent<IToastOptions & {
9
9
  callback: () => void;
10
10
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IToastOptions & {
11
11
  callback: () => void;
12
- } & {}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}>;
12
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
13
  export default _default;