@xy-planning-network/trees 0.13.3-dev-1 → 0.13.3-dev-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xy-planning-network/trees",
3
- "version": "0.13.3-dev-1",
3
+ "version": "0.13.3-dev-3",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "repository": "github:xy-planning-network/trees",
@@ -35,7 +35,7 @@ const { aria, errorState, inputID, isRequired, onInvalid, validate } =
35
35
  useInputField(props)
36
36
 
37
37
  const updateModelState = (value: { minDate: number; maxDate: number }) => {
38
- modelState.value = value
38
+ modelState.value = { ...value }
39
39
  }
40
40
 
41
41
  const wrapper = useTemplateRef("wrapper")
@@ -7,9 +7,9 @@ import {
7
7
  TransitionRoot,
8
8
  } from "@headlessui/vue"
9
9
  import { XIcon } from "@heroicons/vue/outline"
10
- import { watch } from "vue"
10
+ import { computed, useSlots, watch } from "vue"
11
11
 
12
- withDefaults(
12
+ const props = withDefaults(
13
13
  defineProps<{
14
14
  destructive?: boolean
15
15
  disabled?: boolean
@@ -37,6 +37,12 @@ const submit = () => {
37
37
  emit("submit")
38
38
  }
39
39
 
40
+ const slots = useSlots()
41
+
42
+ const hasButtons = computed(() => {
43
+ return props.submitText || slots.buttons
44
+ })
45
+
40
46
  watch(open, (isOpen) => {
41
47
  if (!isOpen) {
42
48
  emit("close")
@@ -91,7 +97,7 @@ watch(open, (isOpen) => {
91
97
  <div
92
98
  class="bg-white rounded-t-xy sm:rounded-t-xy-lg"
93
99
  :class="
94
- !submitText && 'rounded-b-xy sm:rounded-b-xy-lg shadow-xl'
100
+ !hasButtons && 'rounded-b-xy sm:rounded-b-xy-lg shadow-xl'
95
101
  "
96
102
  >
97
103
  <!--Close Button-->
@@ -125,7 +131,7 @@ watch(open, (isOpen) => {
125
131
 
126
132
  <!--Button-->
127
133
  <div
128
- v-if="submitText || $slots['buttons']"
134
+ v-if="hasButtons"
129
135
  class="bg-gray-50 flex flex-col gap-3 px-4 py-3 rounded-b-xy shadow-xl sm:py-4 sm:px-8 sm:flex sm:flex-row-reverse sm:rounded-b-xy-lg"
130
136
  >
131
137
  <template v-if="submitText">