@xy-planning-network/trees 0.12.2 → 0.12.4

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.12.2",
3
+ "version": "0.12.4",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "repository": "github:xy-planning-network/trees",
@@ -4,7 +4,7 @@ import InputHelp from "./InputHelp.vue"
4
4
  import InputError from "./InputError.vue"
5
5
  import flatpickr from "flatpickr"
6
6
  import "flatpickr/dist/flatpickr.min.css"
7
- import { onMounted } from "vue"
7
+ import { onMounted, useTemplateRef } from "vue"
8
8
  import {
9
9
  defaultInputProps,
10
10
  defaultModelOpts,
@@ -17,7 +17,7 @@ defineOptions({
17
17
  })
18
18
 
19
19
  // maxDate/startDate should be used or maxRange.
20
- // The props combination of maxDate/startDate and maxRange
20
+ // The props combination of maxDate/startDate and maxRange
21
21
  // will have unexpected results.
22
22
  const props = withDefaults(defineProps<DateRangeInput>(), {
23
23
  ...defaultInputProps,
@@ -38,9 +38,12 @@ const updateModelState = (value: { minDate: number; maxDate: number }) => {
38
38
  modelState.value = value
39
39
  }
40
40
 
41
+ const wrapper = useTemplateRef("wrapper")
42
+
41
43
  onMounted(() => {
42
44
  const opts: flatpickr.Options.Options = {
43
45
  allowInput: true,
46
+ appendTo: wrapper.value || undefined,
44
47
  dateFormat: "m-d-Y",
45
48
  mode: "range",
46
49
  maxDate: props.maxDate,
@@ -60,6 +63,7 @@ onMounted(() => {
60
63
  })
61
64
  }
62
65
  },
66
+ static: true,
63
67
  }
64
68
 
65
69
  // Handle initial values if set
@@ -100,7 +104,7 @@ onMounted(() => {
100
104
  </script>
101
105
 
102
106
  <template>
103
- <div>
107
+ <div ref="wrapper">
104
108
  <InputLabel
105
109
  :id="aria.labelledby"
106
110
  class="mb-2"
@@ -130,3 +134,9 @@ onMounted(() => {
130
134
  <InputError :id="aria.errormessage" class="mt-0.5" :text="errorState" />
131
135
  </div>
132
136
  </template>
137
+
138
+ <style lang="postcss">
139
+ .flatpickr-wrapper {
140
+ display: block;
141
+ }
142
+ </style>
@@ -75,8 +75,8 @@ const sortDir = ref(props.defaultSortDir)
75
75
 
76
76
  const loadAndRender = (): void => {
77
77
  const params: Record<string, unknown> = {
78
- maxDate: dateRange.value.maxDate,
79
- minDate: dateRange.value.minDate,
78
+ maxDate: dateRange.value.maxDate || null,
79
+ minDate: dateRange.value.minDate || null,
80
80
  page: pagination.value.page,
81
81
  perPage: pagination.value.perPage,
82
82
  q: "",
@@ -36,8 +36,8 @@ defineEmits<{
36
36
 
37
37
  const loadAndRender = (): void => {
38
38
  const params = {
39
- minDate: dateRange.value.minDate,
40
- maxDate: dateRange.value.maxDate,
39
+ minDate: dateRange.value.minDate || null,
40
+ maxDate: dateRange.value.maxDate || null,
41
41
  page: pagination.value.page,
42
42
  perPage: pagination.value.perPage,
43
43
  sort: currentSort.value,
@@ -25,5 +25,7 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {},
25
25
  startDate: string | number | Date;
26
26
  help: string;
27
27
  placeholder: string;
28
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {
29
+ wrapper: HTMLDivElement;
30
+ }, any>;
29
31
  export default _default;