@xy-planning-network/trees 0.10.4 → 0.10.5
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 +4 -3
- package/dist/trees.umd.js +2 -2
- package/package.json +1 -1
- package/src/lib-components/forms/MultiCheckboxes.vue +10 -13
- package/src/lib-components/overlays/ContentModal.vue +3 -1
- package/types/lib-components/indicators/InlineAlert.vue.d.ts +1 -1
- package/types/lib-components/overlays/ContentModal.vue.d.ts +5 -0
package/package.json
CHANGED
|
@@ -45,33 +45,30 @@ const selectionCount = computed(() => {
|
|
|
45
45
|
})
|
|
46
46
|
|
|
47
47
|
const minCount = computed(() => {
|
|
48
|
-
return props.min ||
|
|
48
|
+
return props.min || null
|
|
49
49
|
})
|
|
50
50
|
|
|
51
51
|
const maxCount = computed(() => {
|
|
52
|
-
return
|
|
53
|
-
props.max ||
|
|
54
|
-
props.options.filter((opt) => {
|
|
55
|
-
return !opt.disabled
|
|
56
|
-
}).length
|
|
57
|
-
)
|
|
52
|
+
return props.max || null
|
|
58
53
|
})
|
|
59
54
|
|
|
60
55
|
const countError = computed(() => {
|
|
61
56
|
// min not reached, no max is set
|
|
62
|
-
if (selectionCount.value < minCount.value
|
|
57
|
+
if (minCount.value !== null && selectionCount.value < minCount.value) {
|
|
63
58
|
return `Please select at least ${minCount.value} of these options.`
|
|
64
59
|
}
|
|
65
60
|
|
|
66
61
|
// max is reached, no min set
|
|
67
|
-
if (selectionCount.value > maxCount.value
|
|
62
|
+
if (maxCount.value !== null && selectionCount.value > maxCount.value) {
|
|
68
63
|
return `Please limit your selection to ${maxCount.value} of these options.`
|
|
69
64
|
}
|
|
70
65
|
|
|
71
|
-
// min and max are both set and out of range
|
|
66
|
+
// min and max are both set and at least on of them is out of range
|
|
72
67
|
if (
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
minCount.value !== null &&
|
|
69
|
+
maxCount.value !== null &&
|
|
70
|
+
(selectionCount.value < minCount.value ||
|
|
71
|
+
selectionCount.value > maxCount.value)
|
|
75
72
|
) {
|
|
76
73
|
return `Please select between ${minCount.value} and ${maxCount.value} of these options.`
|
|
77
74
|
}
|
|
@@ -100,7 +97,7 @@ const setValidationError = () => {
|
|
|
100
97
|
<FieldsetLegend
|
|
101
98
|
:id="aria.labelledby"
|
|
102
99
|
:label="label"
|
|
103
|
-
:required="minCount
|
|
100
|
+
:required="minCount ? true : false"
|
|
104
101
|
/>
|
|
105
102
|
<InputHelp
|
|
106
103
|
v-if="help"
|
|
@@ -10,9 +10,11 @@ import {
|
|
|
10
10
|
withDefaults(
|
|
11
11
|
defineProps<{
|
|
12
12
|
modelValue: boolean
|
|
13
|
+
btnText?: string
|
|
13
14
|
title?: string
|
|
14
15
|
}>(),
|
|
15
16
|
{
|
|
17
|
+
btnText: "Go back",
|
|
16
18
|
title: "",
|
|
17
19
|
}
|
|
18
20
|
)
|
|
@@ -84,7 +86,7 @@ const updateModelValue = (value: boolean) => {
|
|
|
84
86
|
class="inline-flex justify-center w-full xy-btn"
|
|
85
87
|
@click="updateModelValue(false)"
|
|
86
88
|
>
|
|
87
|
-
|
|
89
|
+
{{ btnText }}
|
|
88
90
|
</button>
|
|
89
91
|
</div>
|
|
90
92
|
</div>
|
|
@@ -40,8 +40,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
40
40
|
"onClick:secondary"?: ((e: Event) => any) | undefined;
|
|
41
41
|
}, {
|
|
42
42
|
title: string;
|
|
43
|
-
btnLink: string;
|
|
44
43
|
btnText: string;
|
|
44
|
+
btnLink: string;
|
|
45
45
|
dismissable: boolean;
|
|
46
46
|
secondaryBtnLink: string;
|
|
47
47
|
secondaryBtnText: string;
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
2
2
|
modelValue: boolean;
|
|
3
|
+
btnText?: string | undefined;
|
|
3
4
|
title?: string | undefined;
|
|
4
5
|
}>, {
|
|
6
|
+
btnText: string;
|
|
5
7
|
title: string;
|
|
6
8
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
9
|
"update:modelValue": (val: boolean) => void;
|
|
8
10
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
9
11
|
modelValue: boolean;
|
|
12
|
+
btnText?: string | undefined;
|
|
10
13
|
title?: string | undefined;
|
|
11
14
|
}>, {
|
|
15
|
+
btnText: string;
|
|
12
16
|
title: string;
|
|
13
17
|
}>>> & {
|
|
14
18
|
"onUpdate:modelValue"?: ((val: boolean) => any) | undefined;
|
|
15
19
|
}, {
|
|
16
20
|
title: string;
|
|
21
|
+
btnText: string;
|
|
17
22
|
}, {}>, {
|
|
18
23
|
icon?(_: {}): any;
|
|
19
24
|
default?(_: {}): any;
|