@xy-planning-network/trees 0.9.2 → 0.9.3-rc1
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/dist/trees.es.js +902 -882
- package/dist/trees.umd.js +6 -6
- package/package.json +1 -1
- package/src/lib-components/forms/BaseInput.vue +18 -3
- package/types/composables/forms.d.ts +7 -0
- package/types/helpers/Slots.d.ts +2 -0
- package/types/lib-components/lists/StaticTable.vue.d.ts +21 -0
- package/types/lib-components/lists/StaticTableActionSlot.vue.d.ts +27 -0
- package/types/lib-components/lists/Table.vue.d.ts +39 -0
- package/types/lib-components/navigation/ActionsDropdownCallback.vue.d.ts +18 -0
- package/types/lib-components/navigation/ActionsDropdownEmit.vue.d.ts +22 -0
- package/types/lib-components/overlays/AlertModal.vue.d.ts +68 -0
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
emailPattern,
|
|
9
9
|
looseToNumber,
|
|
10
10
|
phonePattern,
|
|
11
|
+
toDatetimeLocal,
|
|
11
12
|
} from "@/composables/forms"
|
|
12
13
|
import type { TextLikeInput } from "@/composables/forms"
|
|
13
14
|
import { computed, ref } from "vue"
|
|
@@ -57,14 +58,28 @@ const typeAttributes = computed(() => {
|
|
|
57
58
|
const onInput = (e: Event) => {
|
|
58
59
|
let val = (e.target as HTMLInputElement).value
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
switch (props.type) {
|
|
62
|
+
case "datetime-local":
|
|
63
|
+
val = val ? new Date(val).toISOString() : val
|
|
64
|
+
break
|
|
65
|
+
case "number":
|
|
66
|
+
val = looseToNumber(val)
|
|
67
|
+
break
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
modelState.value = val
|
|
65
71
|
|
|
66
72
|
inputValidation(e)
|
|
67
73
|
}
|
|
74
|
+
|
|
75
|
+
const inputValue = computed(() => {
|
|
76
|
+
switch (props.type) {
|
|
77
|
+
case "datetime-local":
|
|
78
|
+
return toDatetimeLocal(modelState.value)
|
|
79
|
+
default:
|
|
80
|
+
return modelState.value
|
|
81
|
+
}
|
|
82
|
+
})
|
|
68
83
|
</script>
|
|
69
84
|
|
|
70
85
|
<template>
|
|
@@ -91,7 +106,7 @@ const onInput = (e: Event) => {
|
|
|
91
106
|
]"
|
|
92
107
|
:placeholder="placeholder"
|
|
93
108
|
:type="type"
|
|
94
|
-
:value="
|
|
109
|
+
:value="inputValue"
|
|
95
110
|
v-bind="{ ...typeAttributes, ...$attrs }"
|
|
96
111
|
@input="onInput"
|
|
97
112
|
@invalid="onInvalid"
|
|
@@ -96,3 +96,10 @@ export declare const phonePattern: string;
|
|
|
96
96
|
* This is used for the .number modifier in v-model
|
|
97
97
|
*/
|
|
98
98
|
export declare const looseToNumber: (val: any) => any;
|
|
99
|
+
/**
|
|
100
|
+
* converts an RFC 3339 string to a datetime-local input value string
|
|
101
|
+
* used with BaseInput<type=datetime-local> as a v-model modifier
|
|
102
|
+
* @param dt RFC 3339 date string
|
|
103
|
+
* @returns string
|
|
104
|
+
*/
|
|
105
|
+
export declare const toDatetimeLocal: (dt: any) => string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TableColumn, TableRow } from "../../composables/table";
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
columns: TableColumn<TableRow>[];
|
|
4
|
+
rows: TableRow[];
|
|
5
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
6
|
+
columns?: unknown;
|
|
7
|
+
rows?: unknown;
|
|
8
|
+
} & {
|
|
9
|
+
columns: TableColumn<TableRow>[];
|
|
10
|
+
rows: TableRow[];
|
|
11
|
+
} & {}>, {}>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: import('vue').PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as TableTypes from "../../composables/table";
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
tableData: Omit<TableTypes.Static, "currentUser">;
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
5
|
+
tableData?: unknown;
|
|
6
|
+
} & {
|
|
7
|
+
tableData: Omit<TableTypes.Static, "currentUser">;
|
|
8
|
+
} & {}>, {}>, {
|
|
9
|
+
actions: (_: {
|
|
10
|
+
row: Record<string, unknown>;
|
|
11
|
+
}) => any;
|
|
12
|
+
}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
15
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
16
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
17
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
18
|
+
} : {
|
|
19
|
+
type: import('vue').PropType<T[K]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as TableTypes from "../../composables/table";
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
clickable?: boolean | undefined;
|
|
4
|
+
loader?: boolean | undefined;
|
|
5
|
+
tableData: TableTypes.Dynamic;
|
|
6
|
+
}>, {
|
|
7
|
+
clickable: boolean;
|
|
8
|
+
loader: boolean;
|
|
9
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
handleClick: (v: any) => void;
|
|
11
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
12
|
+
tableData?: unknown;
|
|
13
|
+
clickable?: unknown;
|
|
14
|
+
loader?: unknown;
|
|
15
|
+
} & {
|
|
16
|
+
tableData: TableTypes.Dynamic;
|
|
17
|
+
clickable: boolean;
|
|
18
|
+
loader: boolean;
|
|
19
|
+
} & {}> & {
|
|
20
|
+
onHandleClick?: ((v: any) => any) | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
clickable: boolean;
|
|
23
|
+
loader: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
28
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
29
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
30
|
+
} : {
|
|
31
|
+
type: import('vue').PropType<T[K]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
type __VLS_WithDefaults<P, D> = {
|
|
36
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
37
|
+
default: D[K];
|
|
38
|
+
} : P[K];
|
|
39
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ActionMenuItemCallback } from "../../composables/nav";
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
items: ActionMenuItemCallback[];
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
5
|
+
items?: unknown;
|
|
6
|
+
} & {
|
|
7
|
+
items: ActionMenuItemCallback[];
|
|
8
|
+
} & {}>, {}>;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
11
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
12
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
13
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
14
|
+
} : {
|
|
15
|
+
type: import('vue').PropType<T[K]>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ActionMenuEmit } from "../../composables/nav";
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
items: ActionMenuEmit[];
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
click: (v: string) => void;
|
|
6
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
7
|
+
items?: unknown;
|
|
8
|
+
} & {
|
|
9
|
+
items: ActionMenuEmit[];
|
|
10
|
+
} & {}> & {
|
|
11
|
+
onClick?: ((v: string) => any) | undefined;
|
|
12
|
+
}, {}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
15
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
16
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
17
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
18
|
+
} : {
|
|
19
|
+
type: import('vue').PropType<T[K]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
title: {
|
|
3
|
+
type: import("vue").PropType<string>;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: import("vue").PropType<boolean>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
content: {
|
|
11
|
+
type: import("vue").PropType<string | string[]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
kind: {
|
|
15
|
+
type: import("vue").PropType<"alert" | "warn" | "info" | "success">;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
sticky: {
|
|
19
|
+
type: import("vue").PropType<boolean>;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
cancelText: {
|
|
23
|
+
type: import("vue").PropType<string>;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
submitText: {
|
|
27
|
+
type: import("vue").PropType<string>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
+
submit: (e?: void | undefined) => void;
|
|
32
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
|
+
title: {
|
|
34
|
+
type: import("vue").PropType<string>;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
modelValue: {
|
|
38
|
+
type: import("vue").PropType<boolean>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
content: {
|
|
42
|
+
type: import("vue").PropType<string | string[]>;
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
45
|
+
kind: {
|
|
46
|
+
type: import("vue").PropType<"alert" | "warn" | "info" | "success">;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
sticky: {
|
|
50
|
+
type: import("vue").PropType<boolean>;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
cancelText: {
|
|
54
|
+
type: import("vue").PropType<string>;
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
submitText: {
|
|
58
|
+
type: import("vue").PropType<string>;
|
|
59
|
+
required: true;
|
|
60
|
+
};
|
|
61
|
+
}>> & {
|
|
62
|
+
onSubmit?: ((e?: void | undefined) => any) | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
title: string;
|
|
65
|
+
sticky: boolean;
|
|
66
|
+
cancelText: string;
|
|
67
|
+
}, {}>;
|
|
68
|
+
export default _default;
|