@xy-planning-network/trees 0.4.0 → 0.4.3
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 +1282 -399
- package/dist/trees.umd.js +6 -6
- package/package.json +1 -1
- package/src/lib-components/forms/BaseInput.vue +2 -0
- package/src/lib-components/forms/Checkbox.vue +17 -10
- package/src/lib-components/forms/FieldsetLegend.vue +14 -0
- package/src/lib-components/forms/InputHelp.vue +1 -1
- package/src/lib-components/forms/InputLabel.vue +6 -1
- package/src/lib-components/forms/MultiCheckboxes.vue +93 -31
- package/src/lib-components/forms/Radio.vue +81 -34
- package/src/lib-components/forms/Select.vue +2 -2
- package/src/lib-components/forms/TextArea.vue +2 -0
- package/src/lib-components/forms/Toggle.vue +2 -0
- package/src/lib-components/forms/YesOrNoRadio.vue +69 -40
- package/src/lib-components/navigation/Paginator.vue +15 -19
- package/src/lib-components/overlays/Popover/Popover.vue +229 -0
- package/src/lib-components/overlays/Popover/PopoverContent.vue +8 -0
- package/src/lib-components/overlays/Tooltip.vue +34 -0
- package/types/helpers/Debounce.d.ts +1 -0
- package/types/helpers/Slots.d.ts +2 -0
- package/types/helpers/Throttle.d.ts +1 -0
- package/types/lib-components/forms/Checkbox.vue.d.ts +8 -0
- package/types/lib-components/forms/FieldsetLegend.vue.d.ts +2 -0
- package/types/lib-components/forms/InputLabel.vue.d.ts +8 -0
- package/types/lib-components/forms/MultiCheckboxes.vue.d.ts +32 -7
- package/types/lib-components/forms/Radio.vue.d.ts +26 -13
- package/types/lib-components/forms/YesOrNoRadio.vue.d.ts +8 -0
- package/types/lib-components/index.d.ts +11 -1
- package/types/lib-components/overlays/Popover/Popover.vue.d.ts +23 -0
- package/types/lib-components/overlays/Popover/PopoverContent.vue.d.ts +2 -0
- package/types/lib-components/overlays/Tooltip.vue.d.ts +23 -0
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import InputLabel from "./InputLabel.vue"
|
|
3
|
+
import InputHelp from "./InputHelp.vue"
|
|
3
4
|
import Uniques from "@/helpers/Uniques"
|
|
4
5
|
import { useAttrs } from "vue"
|
|
5
6
|
|
|
6
|
-
// TODO: checkbox should support the help text prop - possibly as a tooltip
|
|
7
|
-
// TODO: aria-labelledby may be superfluous here since the input is wrapped in a label
|
|
8
7
|
withDefaults(
|
|
9
8
|
defineProps<{
|
|
10
9
|
label?: string
|
|
10
|
+
help?: string
|
|
11
11
|
modelValue: boolean
|
|
12
12
|
}>(),
|
|
13
13
|
{
|
|
14
14
|
label: "",
|
|
15
|
+
help: "",
|
|
15
16
|
}
|
|
16
17
|
)
|
|
17
18
|
const emits = defineEmits(["update:modelValue"])
|
|
@@ -19,28 +20,34 @@ const attrs = useAttrs()
|
|
|
19
20
|
const uuid = (attrs.id as string) || Uniques.CreateIdAttribute()
|
|
20
21
|
</script>
|
|
21
22
|
<template>
|
|
22
|
-
<div>
|
|
23
|
-
<
|
|
23
|
+
<div class="relative flex items-start">
|
|
24
|
+
<div class="flex items-center h-5">
|
|
24
25
|
<input
|
|
26
|
+
:id="uuid"
|
|
25
27
|
:aria-labelledby="label ? `${uuid}-label` : undefined"
|
|
28
|
+
:aria-describedby="help ? `${uuid}-help` : undefined"
|
|
26
29
|
:checked="modelValue"
|
|
27
30
|
class="focus:ring-blue-500 h-4 w-4 text-blue-500 border-gray-600 rounded disabled:opacity-50 disabled:cursor-not-allowed"
|
|
28
|
-
:id="uuid"
|
|
29
31
|
type="checkbox"
|
|
30
32
|
v-bind="{
|
|
31
|
-
...$attrs,
|
|
32
33
|
onChange: ($event) => {
|
|
33
34
|
emits('update:modelValue', ($event.target as HTMLInputElement).checked)
|
|
34
35
|
},
|
|
36
|
+
...$attrs,
|
|
35
37
|
}"
|
|
36
38
|
/>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="ml-3">
|
|
37
41
|
<InputLabel
|
|
38
|
-
class="
|
|
42
|
+
class="mt-auto"
|
|
43
|
+
:disabled="
|
|
44
|
+
$attrs.hasOwnProperty('disabled') && $attrs.disabled !== false
|
|
45
|
+
"
|
|
39
46
|
:id="`${uuid}-label`"
|
|
40
47
|
:for="uuid"
|
|
41
48
|
:label="label"
|
|
42
|
-
|
|
43
|
-
></
|
|
44
|
-
</
|
|
49
|
+
/>
|
|
50
|
+
<InputHelp class="-mt-1" :id="`${uuid}-help`" :text="help"></InputHelp>
|
|
51
|
+
</div>
|
|
45
52
|
</div>
|
|
46
53
|
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { hasSlotContent } from "@/helpers/Slots"
|
|
3
|
+
</script>
|
|
4
|
+
<template>
|
|
5
|
+
<legend
|
|
6
|
+
v-if="hasSlotContent($slots.default)"
|
|
7
|
+
v-bind="{
|
|
8
|
+
...$attrs,
|
|
9
|
+
class: 'text-base font-medium leading-tight text-gray-900',
|
|
10
|
+
}"
|
|
11
|
+
>
|
|
12
|
+
<slot />
|
|
13
|
+
</legend>
|
|
14
|
+
</template>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
withDefaults(
|
|
3
3
|
defineProps<{
|
|
4
|
+
disabled?: boolean
|
|
4
5
|
label?: string
|
|
5
6
|
tag?: string
|
|
6
7
|
}>(),
|
|
7
8
|
{
|
|
9
|
+
disabled: false,
|
|
8
10
|
label: "",
|
|
9
11
|
tag: "label",
|
|
10
12
|
}
|
|
@@ -14,9 +16,12 @@ withDefaults(
|
|
|
14
16
|
<component
|
|
15
17
|
:is="tag"
|
|
16
18
|
v-if="label"
|
|
19
|
+
:class="{
|
|
20
|
+
'block my-1 text-sm font-semibold leading-snug text-gray-900': true,
|
|
21
|
+
'opacity-75': disabled,
|
|
22
|
+
}"
|
|
17
23
|
v-bind="{
|
|
18
24
|
...$attrs,
|
|
19
|
-
class: 'block my-1 text-sm font-semibold leading-snug text-gray-900',
|
|
20
25
|
}"
|
|
21
26
|
>{{ label }}</component
|
|
22
27
|
>
|
|
@@ -1,55 +1,117 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import Uniques from "@/helpers/Uniques"
|
|
3
|
-
import {
|
|
3
|
+
import { computed, useAttrs, useSlots } from "vue"
|
|
4
|
+
import FieldsetLegend from "./FieldsetLegend.vue"
|
|
4
5
|
import InputLabel from "./InputLabel.vue"
|
|
6
|
+
import InputHelp from "./InputHelp.vue"
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
type CheckboxValue = string | number
|
|
9
|
+
type ModelValue = CheckboxValue[]
|
|
8
10
|
|
|
9
11
|
const props = withDefaults(
|
|
10
12
|
defineProps<{
|
|
11
13
|
options: {
|
|
14
|
+
disabled?: boolean
|
|
15
|
+
help?: string
|
|
12
16
|
label: string
|
|
13
|
-
value:
|
|
17
|
+
value: CheckboxValue
|
|
14
18
|
}[]
|
|
19
|
+
help?: string
|
|
15
20
|
legend?: string
|
|
16
|
-
modelValue:
|
|
21
|
+
modelValue: ModelValue
|
|
22
|
+
columns?: 2 | 3 | 4
|
|
17
23
|
}>(),
|
|
18
24
|
{
|
|
25
|
+
help: "",
|
|
19
26
|
legend: "",
|
|
27
|
+
columns: undefined,
|
|
20
28
|
}
|
|
21
29
|
)
|
|
22
30
|
|
|
23
|
-
const
|
|
31
|
+
const emit = defineEmits<{
|
|
32
|
+
(e: "update:modelValue", modelValue: ModelValue): void
|
|
33
|
+
}>()
|
|
24
34
|
const attrs = useAttrs()
|
|
35
|
+
const slots = useSlots()
|
|
25
36
|
const uuid = (attrs.id as string) || Uniques.CreateIdAttribute()
|
|
26
|
-
const
|
|
37
|
+
const hasLegend = computed(() => {
|
|
38
|
+
return props.legend !== "" || slots.legend !== undefined
|
|
39
|
+
})
|
|
40
|
+
const onChange = (checked: boolean, val: CheckboxValue) => {
|
|
41
|
+
let updateModelValue = [...props.modelValue]
|
|
42
|
+
|
|
43
|
+
if (checked) {
|
|
44
|
+
updateModelValue.push(val)
|
|
45
|
+
} else {
|
|
46
|
+
updateModelValue.splice(updateModelValue.indexOf(val), 1)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
emit("update:modelValue", updateModelValue)
|
|
50
|
+
}
|
|
27
51
|
</script>
|
|
28
52
|
<template>
|
|
29
|
-
<fieldset
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
<fieldset
|
|
54
|
+
class="space-y-5"
|
|
55
|
+
:aria-labelledby="hasLegend ? `${uuid}-legend` : undefined"
|
|
56
|
+
:aria-describedby="help ? `${uuid}-help` : undefined"
|
|
57
|
+
>
|
|
58
|
+
<div class="space-y-0.5">
|
|
59
|
+
<FieldsetLegend :id="`${uuid}-legend`">
|
|
60
|
+
<div v-if="legend">{{ legend }}</div>
|
|
61
|
+
<slot v-if="$slots.legend" name="legend"></slot>
|
|
62
|
+
</FieldsetLegend>
|
|
63
|
+
<InputHelp tag="p" :text="help" :id="`${uuid}-help`" />
|
|
64
|
+
</div>
|
|
65
|
+
<div
|
|
66
|
+
class="grid gap-4"
|
|
67
|
+
:class="{
|
|
68
|
+
'sm:grid sm:gap-y-4 sm:gap-x-5 sm:space-y-0': columns !== undefined,
|
|
69
|
+
'sm:grid-cols-2': columns === 2,
|
|
70
|
+
'sm:grid-cols-3': columns === 3,
|
|
71
|
+
'sm:grid-cols-4': columns === 4,
|
|
72
|
+
}"
|
|
73
|
+
>
|
|
74
|
+
<div
|
|
75
|
+
v-for="(option, index) in options"
|
|
76
|
+
:key="option.value"
|
|
77
|
+
class="flex items-start"
|
|
78
|
+
>
|
|
79
|
+
<div class="flex items-center h-5">
|
|
80
|
+
<input
|
|
81
|
+
:id="uuid"
|
|
82
|
+
:aria-labelledby="`${uuid}-${index}-label`"
|
|
83
|
+
:aria-describedby="
|
|
84
|
+
option?.help && option.help ? `${uuid}-${index}-help` : undefined
|
|
85
|
+
"
|
|
86
|
+
:checked="modelValue.includes(option.value)"
|
|
87
|
+
:disabled="option.disabled === true ? true : undefined"
|
|
88
|
+
class="focus:ring-blue-500 h-4 w-4 text-blue-500 border-gray-600 rounded disabled:opacity-50 disabled:cursor-not-allowed"
|
|
89
|
+
type="checkbox"
|
|
90
|
+
v-bind="{
|
|
91
|
+
onChange: ($event) => { onChange(($event.target as HTMLInputElement).checked, option.value) },
|
|
92
|
+
...$attrs,
|
|
93
|
+
}"
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
<div class="ml-3">
|
|
97
|
+
<InputLabel
|
|
98
|
+
class="mt-auto"
|
|
99
|
+
:disabled="
|
|
100
|
+
($attrs.hasOwnProperty('disabled') &&
|
|
101
|
+
$attrs.disabled !== false) ||
|
|
102
|
+
option.disabled === true
|
|
103
|
+
"
|
|
104
|
+
:id="`${uuid}-${index}-label`"
|
|
105
|
+
:for="uuid"
|
|
106
|
+
:label="option.label"
|
|
107
|
+
/>
|
|
108
|
+
<InputHelp
|
|
109
|
+
class="-mt-1"
|
|
110
|
+
:id="`${uuid}-${index}-help`"
|
|
111
|
+
:text="option.help"
|
|
112
|
+
/>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
53
115
|
</div>
|
|
54
116
|
</fieldset>
|
|
55
117
|
</template>
|
|
@@ -1,58 +1,105 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import Uniques from "@/helpers/Uniques"
|
|
3
|
-
import { useAttrs } from "vue"
|
|
3
|
+
import { computed, useAttrs, useSlots } from "vue"
|
|
4
|
+
import FieldsetLegend from "./FieldsetLegend.vue"
|
|
5
|
+
import InputHelp from "./InputHelp.vue"
|
|
4
6
|
import InputLabel from "./InputLabel.vue"
|
|
5
7
|
|
|
6
|
-
// TODO: add horizontal layout support
|
|
7
8
|
const props = withDefaults(
|
|
8
9
|
defineProps<{
|
|
9
10
|
options: {
|
|
11
|
+
disabled?: boolean
|
|
12
|
+
help?: string
|
|
10
13
|
label: string
|
|
11
|
-
value: string
|
|
14
|
+
value: string | number
|
|
12
15
|
}[]
|
|
16
|
+
help?: string
|
|
13
17
|
legend?: string
|
|
14
|
-
modelValue?: string
|
|
15
|
-
|
|
18
|
+
modelValue?: string | number
|
|
19
|
+
columns?: 2 | 3 | 4
|
|
16
20
|
}>(),
|
|
17
21
|
{
|
|
22
|
+
help: "",
|
|
18
23
|
legend: "",
|
|
19
|
-
modelValue:
|
|
20
|
-
|
|
24
|
+
modelValue: undefined,
|
|
25
|
+
columns: undefined,
|
|
21
26
|
}
|
|
22
27
|
)
|
|
23
28
|
const emits = defineEmits(["update:modelValue"])
|
|
24
29
|
const attrs = useAttrs()
|
|
30
|
+
const slots = useSlots()
|
|
25
31
|
const uuid = (attrs.id as string) || Uniques.CreateIdAttribute()
|
|
32
|
+
const hasLegend = computed(() => {
|
|
33
|
+
return props.legend !== "" || slots.legend !== undefined
|
|
34
|
+
})
|
|
26
35
|
</script>
|
|
27
36
|
<template>
|
|
28
|
-
<fieldset
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
<fieldset
|
|
38
|
+
class="space-y-5"
|
|
39
|
+
:aria-labelledby="hasLegend ? `${uuid}-legend` : undefined"
|
|
40
|
+
:aria-describedby="help ? `${uuid}-help` : undefined"
|
|
41
|
+
>
|
|
42
|
+
<div class="space-y-0.5">
|
|
43
|
+
<FieldsetLegend :id="`${uuid}-legend`">
|
|
44
|
+
<div v-if="legend">{{ legend }}</div>
|
|
45
|
+
<slot v-if="$slots.legend" name="legend"></slot>
|
|
46
|
+
</FieldsetLegend>
|
|
47
|
+
<InputHelp tag="p" :text="help" :id="`${uuid}-help`" />
|
|
48
|
+
</div>
|
|
49
|
+
<div
|
|
50
|
+
class="grid gap-4"
|
|
51
|
+
:class="{
|
|
52
|
+
'sm:grid sm:gap-y-4 sm:gap-x-5 sm:space-y-0': columns !== undefined,
|
|
53
|
+
'sm:grid-cols-2': columns === 2,
|
|
54
|
+
'sm:grid-cols-3': columns === 3,
|
|
55
|
+
'sm:grid-cols-4': columns === 4,
|
|
56
|
+
}"
|
|
34
57
|
>
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
:
|
|
38
|
-
|
|
58
|
+
<div
|
|
59
|
+
v-for="(option, index) in options"
|
|
60
|
+
:key="option.value"
|
|
61
|
+
class="flex items-start"
|
|
39
62
|
>
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
<div class="flex items-center h-5">
|
|
64
|
+
<input
|
|
65
|
+
:aria-describedby="
|
|
66
|
+
option?.help && option.help ? `${uuid}-${index}-help` : undefined
|
|
67
|
+
"
|
|
68
|
+
:aria-labelledby="`${uuid}-${index}-label`"
|
|
69
|
+
:checked="modelValue === option.value"
|
|
70
|
+
class="w-4 h-4 border-gray-600 focus:ring-blue-500 text-xy-blue disabled:opacity-50 disabled:cursor-not-allowed"
|
|
71
|
+
:disabled="option.disabled === true ? true : undefined"
|
|
72
|
+
:id="`${uuid}-${index}`"
|
|
73
|
+
:name="uuid"
|
|
74
|
+
type="radio"
|
|
75
|
+
:value="option.value"
|
|
76
|
+
v-bind="{
|
|
77
|
+
onChange: () => {
|
|
78
|
+
emits('update:modelValue', option.value)
|
|
79
|
+
},
|
|
80
|
+
...$attrs,
|
|
81
|
+
}"
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="ml-3">
|
|
85
|
+
<InputLabel
|
|
86
|
+
class="mt-auto"
|
|
87
|
+
:disabled="
|
|
88
|
+
($attrs.hasOwnProperty('disabled') &&
|
|
89
|
+
$attrs.disabled !== false) ||
|
|
90
|
+
option.disabled === true
|
|
91
|
+
"
|
|
92
|
+
:id="`${uuid}-${index}-label`"
|
|
93
|
+
:for="uuid"
|
|
94
|
+
:label="option.label"
|
|
95
|
+
/>
|
|
96
|
+
<InputHelp
|
|
97
|
+
class="-mt-1"
|
|
98
|
+
:id="`${uuid}-${index}-help`"
|
|
99
|
+
:text="option.help"
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
57
104
|
</fieldset>
|
|
58
105
|
</template>
|
|
@@ -29,9 +29,9 @@ const classes = computed((): string => {
|
|
|
29
29
|
return (
|
|
30
30
|
{
|
|
31
31
|
standard:
|
|
32
|
-
"mt-1 block w-full border border-gray-600 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",
|
|
32
|
+
"mt-1 block w-full border border-gray-600 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm disabled:opacity-70 disabled:cursor-not-allowed",
|
|
33
33
|
compressed:
|
|
34
|
-
"appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-600 text-gray-900 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm",
|
|
34
|
+
"appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-600 text-gray-900 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm disabled:opacity-70 disabled:cursor-not-allowed",
|
|
35
35
|
} as any
|
|
36
36
|
)[props.design]
|
|
37
37
|
})
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { Switch } from "@headlessui/vue"
|
|
3
3
|
|
|
4
|
+
// TODO: disabled support, possibly label and help support - determine current usage first
|
|
5
|
+
|
|
4
6
|
withDefaults(defineProps<{ modelValue: boolean }>(), { modelValue: false })
|
|
5
7
|
const emits = defineEmits(["update:modelValue"])
|
|
6
8
|
</script>
|
|
@@ -6,11 +6,13 @@ import InputLabel from "./InputLabel.vue"
|
|
|
6
6
|
const props = withDefaults(
|
|
7
7
|
defineProps<{
|
|
8
8
|
modelValue?: boolean
|
|
9
|
+
help?: string
|
|
9
10
|
legend?: string
|
|
10
11
|
name?: string
|
|
11
12
|
}>(),
|
|
12
13
|
{
|
|
13
14
|
modelValue: undefined,
|
|
15
|
+
help: "",
|
|
14
16
|
legend: "",
|
|
15
17
|
name: "",
|
|
16
18
|
}
|
|
@@ -26,45 +28,72 @@ const onChange = (e: Event) => {
|
|
|
26
28
|
}
|
|
27
29
|
</script>
|
|
28
30
|
<template>
|
|
29
|
-
<fieldset
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
31
|
+
<fieldset
|
|
32
|
+
class="space-y-3"
|
|
33
|
+
:aria-labelledby="legend ? `${uuid}-legend` : undefined"
|
|
34
|
+
:aria-describedby="help ? `${uuid}-help` : undefined"
|
|
35
|
+
>
|
|
36
|
+
<div class="space-y-0.5">
|
|
37
|
+
<InputLabel
|
|
38
|
+
class="block my-auto"
|
|
39
|
+
:label="legend"
|
|
40
|
+
tag="legend"
|
|
41
|
+
></InputLabel>
|
|
42
|
+
<InputHelp tag="p" :text="help" :id="`${uuid}-help`" />
|
|
43
|
+
</div>
|
|
44
|
+
<div>
|
|
45
|
+
<label
|
|
46
|
+
class="inline-flex items-center"
|
|
47
|
+
:class="{ 'cursor-not-allowed': $attrs.disabled }"
|
|
48
|
+
:for="`${hasNameAttr ? name : uuid}-true`"
|
|
49
|
+
>
|
|
50
|
+
<input
|
|
51
|
+
type="radio"
|
|
52
|
+
class="w-4 h-4 border-gray-600 focus:ring-blue-500 text-xy-blue disabled:opacity-50 disabled:cursor-not-allowed"
|
|
53
|
+
:id="`${hasNameAttr ? name : uuid}-true`"
|
|
54
|
+
:name="hasNameAttr ? name : uuid"
|
|
55
|
+
:value="true"
|
|
56
|
+
:checked="modelValue === true"
|
|
57
|
+
v-bind="{
|
|
58
|
+
...$attrs,
|
|
59
|
+
onChange: onChange,
|
|
60
|
+
}"
|
|
61
|
+
/>
|
|
62
|
+
<InputLabel
|
|
63
|
+
class="ml-2"
|
|
64
|
+
:disabled="
|
|
65
|
+
$attrs.hasOwnProperty('disabled') && $attrs.disabled !== false
|
|
66
|
+
"
|
|
67
|
+
label="Yes"
|
|
68
|
+
tag="span"
|
|
69
|
+
></InputLabel>
|
|
70
|
+
</label>
|
|
71
|
+
<label
|
|
72
|
+
class="inline-flex items-center ml-6"
|
|
73
|
+
:class="{ 'cursor-not-allowed': $attrs.disabled }"
|
|
74
|
+
:for="`${hasNameAttr ? name : uuid}-false`"
|
|
75
|
+
>
|
|
76
|
+
<input
|
|
77
|
+
type="radio"
|
|
78
|
+
class="w-4 h-4 border-gray-600 focus:ring-blue-500 text-xy-blue disabled:opacity-50 disabled:cursor-not-allowed"
|
|
79
|
+
:id="`${hasNameAttr ? name : uuid}-false`"
|
|
80
|
+
:name="hasNameAttr ? name : uuid"
|
|
81
|
+
:value="false"
|
|
82
|
+
:checked="modelValue === false"
|
|
83
|
+
v-bind="{
|
|
84
|
+
...$attrs,
|
|
85
|
+
onChange: onChange,
|
|
86
|
+
}"
|
|
87
|
+
/>
|
|
88
|
+
<InputLabel
|
|
89
|
+
class="ml-2"
|
|
90
|
+
:disabled="
|
|
91
|
+
$attrs.hasOwnProperty('disabled') && $attrs.disabled !== false
|
|
92
|
+
"
|
|
93
|
+
label="No"
|
|
94
|
+
tag="span"
|
|
95
|
+
></InputLabel>
|
|
96
|
+
</label>
|
|
97
|
+
</div>
|
|
69
98
|
</fieldset>
|
|
70
99
|
</template>
|