@xy-planning-network/trees 0.4.5 → 0.4.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xy-planning-network/trees",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "repository": "github:xy-planning-network/trees",
@@ -62,54 +62,58 @@ const onChange = (checked: boolean, val: CheckboxValue) => {
62
62
  </FieldsetLegend>
63
63
  <InputHelp tag="p" :text="help" :id="`${uuid}-help`" />
64
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
- >
65
+ <div class="flex">
74
66
  <div
75
- v-for="(option, index) in options"
76
- :key="option.value"
77
- class="flex items-start"
67
+ class="grid gap-4"
68
+ :class="{
69
+ 'sm:grid sm:gap-y-4 sm:gap-x-5 sm:space-y-0': columns !== undefined,
70
+ 'sm:grid-cols-2': columns === 2,
71
+ 'sm:grid-cols-3': columns === 3,
72
+ 'sm:grid-cols-4': columns === 4,
73
+ }"
78
74
  >
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="{
75
+ <div
76
+ v-for="(option, index) in options"
77
+ :key="option.value"
78
+ class="flex items-start"
79
+ >
80
+ <div class="flex items-center h-5">
81
+ <input
82
+ :id="uuid"
83
+ :aria-labelledby="`${uuid}-${index}-label`"
84
+ :aria-describedby="
85
+ option?.help && option.help
86
+ ? `${uuid}-${index}-help`
87
+ : undefined
88
+ "
89
+ :checked="modelValue.includes(option.value)"
90
+ :disabled="option.disabled === true ? true : undefined"
91
+ class="focus:ring-blue-500 h-4 w-4 text-blue-500 border-gray-600 rounded disabled:opacity-50 disabled:cursor-not-allowed"
92
+ type="checkbox"
93
+ v-bind="{
91
94
  onChange: ($event) => { onChange(($event.target as HTMLInputElement).checked, option.value) },
92
95
  ...$attrs,
93
96
  }"
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
- />
97
+ />
98
+ </div>
99
+ <div class="ml-3">
100
+ <InputLabel
101
+ class="mt-auto"
102
+ :disabled="
103
+ ($attrs.hasOwnProperty('disabled') &&
104
+ $attrs.disabled !== false) ||
105
+ option.disabled === true
106
+ "
107
+ :id="`${uuid}-${index}-label`"
108
+ :for="uuid"
109
+ :label="option.label"
110
+ />
111
+ <InputHelp
112
+ class="-mt-1"
113
+ :id="`${uuid}-${index}-help`"
114
+ :text="option.help"
115
+ />
116
+ </div>
113
117
  </div>
114
118
  </div>
115
119
  </div>
@@ -46,58 +46,62 @@ const hasLegend = computed(() => {
46
46
  </FieldsetLegend>
47
47
  <InputHelp tag="p" :text="help" :id="`${uuid}-help`" />
48
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
- }"
57
- >
49
+ <div class="">
58
50
  <div
59
- v-for="(option, index) in options"
60
- :key="option.value"
61
- class="flex items-start"
51
+ class="grid gap-4"
52
+ :class="{
53
+ 'sm:grid sm:gap-y-4 sm:gap-x-5 sm:space-y-0': columns !== undefined,
54
+ 'sm:grid-cols-2': columns === 2,
55
+ 'sm:grid-cols-3': columns === 3,
56
+ 'sm:grid-cols-4': columns === 4,
57
+ }"
62
58
  >
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
- />
59
+ <div
60
+ v-for="(option, index) in options"
61
+ :key="option.value"
62
+ class="flex items-start"
63
+ >
64
+ <div class="flex items-center h-5">
65
+ <input
66
+ :aria-describedby="
67
+ option?.help && option.help
68
+ ? `${uuid}-${index}-help`
69
+ : undefined
70
+ "
71
+ :aria-labelledby="`${uuid}-${index}-label`"
72
+ :checked="modelValue === option.value"
73
+ class="w-4 h-4 border-gray-600 focus:ring-blue-500 text-xy-blue disabled:opacity-50 disabled:cursor-not-allowed"
74
+ :disabled="option.disabled === true ? true : undefined"
75
+ :id="`${uuid}-${index}`"
76
+ :name="uuid"
77
+ type="radio"
78
+ :value="option.value"
79
+ v-bind="{
80
+ onChange: () => {
81
+ emits('update:modelValue', option.value)
82
+ },
83
+ ...$attrs,
84
+ }"
85
+ />
86
+ </div>
87
+ <div class="ml-3">
88
+ <InputLabel
89
+ class="mt-auto"
90
+ :disabled="
91
+ ($attrs.hasOwnProperty('disabled') &&
92
+ $attrs.disabled !== false) ||
93
+ option.disabled === true
94
+ "
95
+ :id="`${uuid}-${index}-label`"
96
+ :for="uuid"
97
+ :label="option.label"
98
+ />
99
+ <InputHelp
100
+ class="-mt-1"
101
+ :id="`${uuid}-${index}-help`"
102
+ :text="option.help"
103
+ />
104
+ </div>
101
105
  </div>
102
106
  </div>
103
107
  </div>