@xy-planning-network/trees 0.7.4 → 0.7.5-rc1

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.
Files changed (58) hide show
  1. package/dist/trees.es.js +3939 -3561
  2. package/dist/trees.umd.js +10 -10
  3. package/package.json +2 -2
  4. package/src/index.css +0 -16
  5. package/src/lib-components/forms/BaseInput.vue +90 -75
  6. package/src/lib-components/forms/Checkbox.vue +50 -34
  7. package/src/lib-components/forms/DateRangePicker.vue +56 -32
  8. package/src/lib-components/forms/FieldsetLegend.vue +28 -8
  9. package/src/lib-components/forms/InputHelp.vue +2 -4
  10. package/src/lib-components/forms/InputLabel.vue +27 -12
  11. package/src/lib-components/forms/MultiCheckboxes.vue +117 -74
  12. package/src/lib-components/forms/Radio.vue +79 -66
  13. package/src/lib-components/forms/RadioCards.vue +72 -70
  14. package/src/lib-components/forms/Select.vue +59 -56
  15. package/src/lib-components/forms/TextArea.vue +54 -47
  16. package/src/lib-components/forms/Toggle.vue +61 -18
  17. package/src/lib-components/forms/YesOrNoRadio.vue +75 -67
  18. package/src/lib-components/lists/DynamicTable.vue +43 -20
  19. package/types/composables/forms.d.ts +118 -0
  20. package/types/helpers/Debounce.d.ts +1 -1
  21. package/types/lib-components/forms/BaseInput.vue.d.ts +58 -34
  22. package/types/lib-components/forms/Checkbox.vue.d.ts +50 -29
  23. package/types/lib-components/forms/DateRangePicker.vue.d.ts +71 -39
  24. package/types/lib-components/forms/FieldsetLegend.vue.d.ts +30 -31
  25. package/types/lib-components/forms/InputHelp.vue.d.ts +19 -27
  26. package/types/lib-components/forms/InputLabel.vue.d.ts +28 -32
  27. package/types/lib-components/forms/MultiCheckboxes.vue.d.ts +77 -56
  28. package/types/lib-components/forms/Radio.vue.d.ts +64 -56
  29. package/types/lib-components/forms/RadioCards.vue.d.ts +68 -71
  30. package/types/lib-components/forms/Select.vue.d.ts +55 -44
  31. package/types/lib-components/forms/TextArea.vue.d.ts +50 -32
  32. package/types/lib-components/forms/Toggle.vue.d.ts +29 -24
  33. package/types/lib-components/forms/YesOrNoRadio.vue.d.ts +51 -38
  34. package/types/lib-components/indicators/XYSpinner.vue.d.ts +1 -1
  35. package/types/lib-components/layout/DateFilter.vue.d.ts +28 -20
  36. package/types/lib-components/layout/SidebarLayout.vue.d.ts +38 -32
  37. package/types/lib-components/layout/StackedLayout.vue.d.ts +45 -33
  38. package/types/lib-components/lists/Cards.vue.d.ts +14 -17
  39. package/types/lib-components/lists/DataTable.vue.d.ts +31 -31
  40. package/types/lib-components/lists/DetailList.vue.d.ts +38 -34
  41. package/types/lib-components/lists/DownloadCell.vue.d.ts +18 -15
  42. package/types/lib-components/lists/DynamicTable.vue.d.ts +32 -32
  43. package/types/lib-components/lists/StaticTable.vue.d.ts +21 -0
  44. package/types/lib-components/lists/StaticTableActionSlot.vue.d.ts +27 -0
  45. package/types/lib-components/lists/Table.vue.d.ts +39 -0
  46. package/types/lib-components/lists/TableActionButtons.vue.d.ts +11 -23
  47. package/types/lib-components/navigation/ActionsDropdown.vue.d.ts +11 -23
  48. package/types/lib-components/navigation/ActionsDropdownCallback.vue.d.ts +18 -0
  49. package/types/lib-components/navigation/ActionsDropdownEmit.vue.d.ts +22 -0
  50. package/types/lib-components/navigation/Paginator.vue.d.ts +12 -15
  51. package/types/lib-components/navigation/Steps.vue.d.ts +54 -39
  52. package/types/lib-components/navigation/Tabs.vue.d.ts +34 -34
  53. package/types/lib-components/overlays/ContentModal.vue.d.ts +22 -28
  54. package/types/lib-components/overlays/Modal.vue.d.ts +48 -43
  55. package/types/lib-components/overlays/Popover/Popover.vue.d.ts +23 -31
  56. package/types/lib-components/overlays/Popover/PopoverContent.vue.d.ts +1 -1
  57. package/types/lib-components/overlays/Slideover.vue.d.ts +30 -22
  58. package/types/lib-components/overlays/Tooltip.vue.d.ts +20 -28
@@ -1,65 +1,68 @@
1
1
  <script setup lang="ts">
2
- import Uniques from "@/helpers/Uniques"
3
2
  import InputLabel from "./InputLabel.vue"
4
3
  import InputHelp from "./InputHelp.vue"
5
- import { computed, useAttrs } from "vue"
4
+ import { defaultInputProps, useInputField } from "@/composables/forms"
5
+ import type { OptionsInput } from "@/composables/forms"
6
+ import { ref } from "vue"
6
7
 
7
- const props = withDefaults(
8
- defineProps<{
9
- design?: "standard" | "compressed"
10
- label?: string
11
- help?: string
12
- placeholder?: string
13
- options: { label: string; value: string | number }[]
14
- modelValue: string | number | undefined
15
- }>(),
16
- {
17
- design: "standard",
18
- label: "",
19
- help: "",
20
- placeholder: "Select an option",
21
- }
22
- )
23
-
24
- const emit = defineEmits(["update:modelValue"])
25
- const attrs = useAttrs()
26
- const uuid = (attrs.id as string) || Uniques.CreateIdAttribute()
8
+ defineOptions({
9
+ inheritAttrs: false,
10
+ })
27
11
 
28
- const classes = computed((): string => {
29
- return (
30
- {
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-xy-blue-500 focus:border-xy-blue sm:text-sm disabled:opacity-70 disabled:cursor-not-allowed",
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-xy-blue-500 focus:border-xy-blue focus:z-10 sm:text-sm disabled:opacity-70 disabled:cursor-not-allowed",
35
- } as any
36
- )[props.design]
12
+ const props = withDefaults(defineProps<OptionsInput>(), {
13
+ ...defaultInputProps,
14
+ placeholder: "Select an option",
37
15
  })
16
+
17
+ defineEmits(["update:modelValue", "update:error"])
18
+ const targetInput = ref<HTMLInputElement | null>(null)
19
+ const { inputID, isRequired, validate, modelState, errorState, onInvalid } =
20
+ useInputField({ props, targetInput })
21
+
22
+ const onChange = (e: Event) => {
23
+ modelState.value = (e.target as HTMLInputElement).value
24
+ validate(e)
25
+ }
38
26
  </script>
27
+
39
28
  <template>
40
- <InputLabel :id="`${uuid}-label`" :for="uuid" :label="label"></InputLabel>
41
- <select
42
- :id="uuid"
43
- :aria-labelledby="label ? `${uuid}-label` : undefined"
44
- :aria-describedby="help ? `${uuid}-help` : undefined"
45
- :class="classes"
46
- :value="modelValue"
47
- v-bind="{
48
- ...$attrs,
49
- onChange: ($event) => {
50
- emit('update:modelValue', ($event.target as HTMLInputElement).value)
51
- },
52
- }"
53
- >
54
- <option v-if="placeholder" value="" disabled selected>
55
- {{ placeholder }}
56
- </option>
57
- <option
58
- v-for="option in options"
59
- :key="option.value"
60
- :value="option.value"
61
- v-text="option.label"
62
- ></option>
63
- </select>
64
- <InputHelp :id="`${uuid}-help`" :text="help"></InputHelp>
29
+ <div>
30
+ <InputLabel
31
+ :id="`${inputID}-label`"
32
+ class="mb-2"
33
+ :for="inputID"
34
+ :label="label"
35
+ :required="isRequired"
36
+ />
37
+ <select
38
+ :id="inputID"
39
+ ref="targetInput"
40
+ :aria-labelledby="label ? `${inputID}-label` : undefined"
41
+ :aria-describedby="help ? `${inputID}-help` : undefined"
42
+ :class="[
43
+ 'block w-full rounded-md border-0 py-2 shadow-sm ring-1 ring-inset focus:ring-2 sm:text-sm sm:leading-6 pl-3 pr-10',
44
+ 'disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-700 disabled:ring-gray-200 disabled:opacity-100',
45
+ errorState
46
+ ? 'text-red-900 ring-red-700 placeholder:text-red-300 focus:ring-red-700'
47
+ : 'text-gray-900 ring-gray-300 placeholder:text-gray-400 focus:ring-xy-blue-500',
48
+ ]"
49
+ :value="modelState"
50
+ v-bind="$attrs"
51
+ @change="onChange"
52
+ @invalid="onInvalid"
53
+ >
54
+ <option value="" disabled selected v-text="placeholder" />
55
+ <option
56
+ v-for="option in options"
57
+ :key="option.value"
58
+ :value="option.value"
59
+ :disabled="option.disabled"
60
+ v-text="option.label"
61
+ />
62
+ </select>
63
+ <InputHelp :id="`${inputID}-help`" class="mt-1" :text="help" />
64
+ <div v-if="errorState" class="mt-0.5">
65
+ <p class="text-sm text-red-700">{{ errorState }}</p>
66
+ </div>
67
+ </div>
65
68
  </template>
@@ -1,54 +1,61 @@
1
1
  <script setup lang="ts">
2
- import Uniques from "@/helpers/Uniques"
3
2
  import InputLabel from "./InputLabel.vue"
4
3
  import InputHelp from "./InputHelp.vue"
5
- import { useAttrs } from "vue"
6
- withDefaults(
7
- defineProps<{
8
- help?: string
9
- label?: string
10
- modelValue?: string | number
11
- }>(),
12
- {
13
- help: "",
14
- label: "",
15
- modelValue: "",
16
- }
17
- )
18
- const attrs = useAttrs()
19
- const emit = defineEmits(["update:modelValue"])
20
- const uuid = (attrs.id as string) || Uniques.CreateIdAttribute()
4
+ import { useInputField, defaultInputProps } from "@/composables/forms"
5
+ import type { TextareaInput } from "@/composables/forms"
6
+ import { ref } from "vue"
7
+
8
+ defineOptions({
9
+ inheritAttrs: false,
10
+ })
11
+
12
+ const props = withDefaults(defineProps<TextareaInput>(), defaultInputProps)
13
+ defineEmits(["update:modelValue", "update:error"])
14
+ const targetInput = ref<HTMLInputElement | null>(null)
15
+ const {
16
+ inputID,
17
+ isRequired,
18
+ modelState,
19
+ errorState,
20
+ onInvalid,
21
+ inputValidation,
22
+ } = useInputField({ props, targetInput })
23
+
24
+ const onInput = (e: Event) => {
25
+ modelState.value = (e.target as HTMLInputElement).value
26
+ inputValidation(e)
27
+ }
21
28
  </script>
22
29
 
23
30
  <template>
24
- <InputLabel
25
- :id="`${uuid}-label`"
26
- class="block"
27
- :for="uuid"
28
- :label="label"
29
- ></InputLabel>
30
- <textarea
31
- :id="uuid"
32
- :aria-labelledby="label ? `${uuid}-label` : undefined"
33
- :aria-describedby="help ? `${uuid}-help` : undefined"
34
- :class="[
35
- 'mt-1',
36
- 'sm:text-sm',
37
- 'block',
38
- 'shadow-sm',
39
- 'focus:ring-xy-blue-500',
40
- 'focus:border-xy-blue',
41
- 'border-gray-600',
42
- 'rounded-md',
43
- 'w-full',
44
- 'disabled:opacity-70',
45
- 'disabled:cursor-not-allowed',
46
- ]"
47
- :value="modelValue"
48
- v-bind="$attrs"
49
- @input="
50
- emit('update:modelValue', ($event.target as HTMLInputElement).value)
51
- "
52
- />
53
- <InputHelp :id="`${uuid}-help`" :text="help"></InputHelp>
31
+ <div>
32
+ <InputLabel
33
+ :id="`${inputID}-label`"
34
+ class="mb-2"
35
+ :for="inputID"
36
+ :label="label"
37
+ :required="isRequired"
38
+ />
39
+ <textarea
40
+ :id="inputID"
41
+ ref="targetInput"
42
+ :aria-labelledby="label ? `${inputID}-label` : undefined"
43
+ :aria-describedby="help ? `${inputID}-help` : undefined"
44
+ :class="[
45
+ 'block w-full rounded-md border-0 py-2 shadow-sm ring-1 ring-inset focus:ring-2 sm:text-sm sm:leading-6',
46
+ 'disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-700 disabled:ring-gray-200',
47
+ errorState
48
+ ? 'text-red-900 ring-red-700 placeholder:text-red-300 focus:ring-red-700'
49
+ : 'text-gray-900 ring-gray-300 placeholder:text-gray-400 focus:ring-xy-blue-500',
50
+ ]"
51
+ :value="modelState || undefined"
52
+ v-bind="$attrs"
53
+ @input="onInput"
54
+ @invalid="onInvalid"
55
+ />
56
+ <InputHelp :id="`${inputID}-help`" class="mb-1" :text="help"></InputHelp>
57
+ <div v-if="errorState" class="mt-0.5">
58
+ <p class="text-sm text-red-700">{{ errorState }}</p>
59
+ </div>
60
+ </div>
54
61
  </template>
@@ -1,27 +1,70 @@
1
1
  <script setup lang="ts">
2
- import { Switch } from "@headlessui/vue"
2
+ import {
3
+ Switch,
4
+ SwitchGroup,
5
+ SwitchLabel,
6
+ SwitchDescription,
7
+ } from "@headlessui/vue"
8
+ import InputLabel from "@/lib-components/forms/InputLabel.vue"
9
+ import InputHelp from "@/lib-components/forms/InputHelp.vue"
10
+ import { hasAttribute } from "@/composables/forms"
11
+ import { computed, useAttrs } from "vue"
3
12
 
4
- // TODO: disabled support, possibly label and help support - determine current usage first
13
+ defineOptions({
14
+ inheritAttrs: false,
15
+ })
16
+
17
+ withDefaults(
18
+ defineProps<{
19
+ modelValue?: boolean
20
+ label?: string
21
+ help?: string
22
+ }>(),
23
+ {
24
+ label: "",
25
+ help: "",
26
+ }
27
+ )
5
28
 
6
- withDefaults(defineProps<{ modelValue: boolean }>(), { modelValue: false })
7
29
  const emits = defineEmits(["update:modelValue"])
30
+ const attrs = useAttrs()
31
+ const isDisabled = computed(() => {
32
+ return hasAttribute(attrs, "disabled")
33
+ })
8
34
  </script>
9
35
  <template>
10
- <Switch
11
- :class="[
12
- modelValue ? 'bg-xy-blue' : 'bg-gray-200',
13
- 'relative inline-flex shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-xy-blue-500',
14
- ]"
15
- :model-value="modelValue"
16
- @update:model-value="emits('update:modelValue', $event)"
17
- >
18
- <span class="sr-only">Use</span>
19
- <span
20
- aria-hidden="true"
36
+ <SwitchGroup as="div" class="flex items-start">
37
+ <Switch
21
38
  :class="[
22
- modelValue ? 'translate-x-5' : 'translate-x-0',
23
- 'pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200',
39
+ modelValue ? 'bg-xy-blue' : 'bg-gray-200',
40
+ isDisabled ? 'opacity-75 cursor-not-allowed' : 'cursor-pointer',
41
+ 'relative inline-flex shrink-0 h-6 w-11 border-2 border-transparent rounded-full transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-xy-blue-500',
24
42
  ]"
25
- />
26
- </Switch>
43
+ :disabled="isDisabled"
44
+ :model-value="modelValue"
45
+ @update:model-value="emits('update:modelValue', $event)"
46
+ >
47
+ <span v-if="!label" class="sr-only">Use</span>
48
+ <span
49
+ aria-hidden="true"
50
+ :class="[
51
+ modelValue ? 'translate-x-5' : 'translate-x-0',
52
+ 'pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200',
53
+ ]"
54
+ />
55
+ </Switch>
56
+
57
+ <div class="ml-3 mt-0.5">
58
+ <SwitchLabel v-if="label">
59
+ <InputLabel
60
+ :label="label"
61
+ :class="isDisabled ? 'cursor-not-allowed' : 'cursor-pointer'"
62
+ />
63
+ </SwitchLabel>
64
+
65
+ <SwitchDescription v-if="help">
66
+ <InputHelp :text="help" />
67
+ </SwitchDescription>
68
+ </div>
69
+ </SwitchGroup>
27
70
  </template>
@@ -1,99 +1,107 @@
1
1
  <script setup lang="ts">
2
- import Uniques from "@/helpers/Uniques"
3
- import { computed, useAttrs } from "vue"
4
2
  import InputLabel from "./InputLabel.vue"
5
3
  import InputHelp from "./InputHelp.vue"
4
+ import { useInputField, defaultInputProps } from "@/composables/forms"
5
+ import type { BooleanInput } from "@/composables/forms"
6
+ import { ref } from "vue"
6
7
 
7
- const props = withDefaults(
8
- defineProps<{
9
- modelValue?: boolean
10
- help?: string
11
- legend?: string
12
- name?: string
13
- }>(),
14
- {
15
- modelValue: undefined,
16
- help: "",
17
- legend: "",
18
- name: "",
19
- }
20
- )
21
- const emits = defineEmits(["update:modelValue"])
22
- const attrs = useAttrs()
23
- const uuid = (attrs.id as string) || Uniques.CreateIdAttribute()
24
- const hasNameAttr = computed((): boolean => {
25
- return typeof props.name === "string" && props.name !== ""
8
+ defineOptions({
9
+ inheritAttrs: false,
26
10
  })
27
- const onChange = (e: Event) => {
28
- emits("update:modelValue", (e.target as HTMLInputElement).value === "true")
11
+
12
+ const props = withDefaults(defineProps<BooleanInput>(), defaultInputProps)
13
+
14
+ defineEmits(["update:modelValue", "update:error"])
15
+ const targetInput = ref<HTMLInputElement | null>(null)
16
+ const {
17
+ inputID,
18
+ isDisabled,
19
+ isRequired,
20
+ nameAttr,
21
+ modelState,
22
+ errorState,
23
+ onInvalid,
24
+ validate,
25
+ } = useInputField({ props, targetInput })
26
+
27
+ const onChange = (e: Event, val: boolean) => {
28
+ modelState.value = val
29
+ validate(e)
29
30
  }
30
31
  </script>
32
+
31
33
  <template>
32
34
  <fieldset
33
- class="space-y-3"
34
- :aria-labelledby="legend ? `${uuid}-legend` : undefined"
35
- :aria-describedby="help ? `${uuid}-help` : undefined"
35
+ class="space-y-4"
36
+ :aria-labelledby="label ? `${inputID}-legend` : undefined"
37
+ :aria-describedby="help ? `${inputID}-help` : undefined"
36
38
  >
37
- <div v-if="legend || help" class="space-y-0.5">
39
+ <div v-if="label">
38
40
  <InputLabel
39
41
  class="block my-auto"
40
- :label="legend"
42
+ :label="label"
41
43
  tag="legend"
42
- ></InputLabel>
43
- <InputHelp :id="`${uuid}-help`" tag="p" :text="help" />
44
+ :required="isRequired"
45
+ />
46
+ <InputHelp v-if="help" :id="`${inputID}-help`" tag="p" :text="help" />
44
47
  </div>
48
+
49
+ <div v-if="errorState" class="mt-0.5">
50
+ <p class="text-sm text-red-700">{{ errorState }}</p>
51
+ </div>
52
+
45
53
  <div>
46
54
  <label
47
- class="inline-flex items-center"
48
- :class="{ 'cursor-not-allowed': $attrs.disabled }"
49
- :for="`${hasNameAttr ? name : uuid}-true`"
55
+ class="inline-flex items-center group"
56
+ :class="isDisabled ? 'cursor-not-allowed' : 'cursor-pointer'"
57
+ :for="`${nameAttr}-true`"
50
58
  >
51
59
  <input
52
- :id="`${hasNameAttr ? name : uuid}-true`"
60
+ :id="`${nameAttr}-true`"
61
+ rel="targetInput"
53
62
  type="radio"
54
- class="w-4 h-4 border-gray-600 focus:ring-xy-blue-500 text-xy-blue disabled:opacity-50 disabled:cursor-not-allowed"
55
- :name="hasNameAttr ? name : uuid"
63
+ :class="[
64
+ 'h-4 w-4 text-xy-blue cursor-pointer',
65
+ 'disabled:bg-gray-100 disabled:border-gray-200 disabled:cursor-not-allowed disabled:opacity-100',
66
+ 'checked:disabled:bg-xy-blue checked:disabled:border-xy-blue checked:disabled:opacity-50',
67
+ errorState
68
+ ? 'border-red-700 focus:ring-red-700'
69
+ : 'border-gray-300 focus:ring-xy-blue-500',
70
+ ]"
71
+ :name="nameAttr"
56
72
  :value="true"
57
- :checked="modelValue === true"
58
- v-bind="{
59
- ...$attrs,
60
- onChange: onChange,
61
- }"
73
+ :checked="modelState === true"
74
+ v-bind="$attrs"
75
+ @change="onChange($event, true)"
76
+ @invalid="onInvalid"
62
77
  />
63
- <InputLabel
64
- class="ml-2"
65
- :disabled="
66
- $attrs.hasOwnProperty('disabled') && $attrs.disabled !== false
67
- "
68
- label="Yes"
69
- tag="span"
70
- ></InputLabel>
78
+ <InputLabel class="ml-3" label="Yes" tag="span" />
71
79
  </label>
80
+
72
81
  <label
73
82
  class="inline-flex items-center ml-6"
74
- :class="{ 'cursor-not-allowed': $attrs.disabled }"
75
- :for="`${hasNameAttr ? name : uuid}-false`"
83
+ :class="isDisabled ? 'cursor-not-allowed' : 'cursor-pointer'"
84
+ :for="`${nameAttr}-false`"
76
85
  >
77
86
  <input
78
- :id="`${hasNameAttr ? name : uuid}-false`"
87
+ :id="`${nameAttr}-false`"
79
88
  type="radio"
80
- class="w-4 h-4 border-gray-600 focus:ring-xy-blue-500 text-xy-blue disabled:opacity-50 disabled:cursor-not-allowed"
81
- :name="hasNameAttr ? name : uuid"
89
+ :class="[
90
+ 'h-4 w-4 text-xy-blue cursor-pointer',
91
+ 'disabled:bg-gray-100 disabled:border-gray-200 disabled:cursor-not-allowed disabled:opacity-100',
92
+ 'checked:disabled:bg-xy-blue checked:disabled:border-xy-blue checked:disabled:opacity-50',
93
+ errorState
94
+ ? 'border-red-700 focus:ring-red-700'
95
+ : 'border-gray-300 focus:ring-xy-blue-500',
96
+ ]"
97
+ :name="nameAttr"
82
98
  :value="false"
83
- :checked="modelValue === false"
84
- v-bind="{
85
- ...$attrs,
86
- onChange: onChange,
87
- }"
99
+ :checked="modelState === false"
100
+ v-bind="$attrs"
101
+ @change="onChange($event, false)"
102
+ @invalid="onInvalid"
88
103
  />
89
- <InputLabel
90
- class="ml-2"
91
- :disabled="
92
- $attrs.hasOwnProperty('disabled') && $attrs.disabled !== false
93
- "
94
- label="No"
95
- tag="span"
96
- ></InputLabel>
104
+ <InputLabel class="ml-3" label="No" tag="span" />
97
105
  </label>
98
106
  </div>
99
107
  </fieldset>
@@ -174,16 +174,13 @@ loadAndRender()
174
174
  class="flex flex-col mb-4 space-y-4 lg:space-y-0 lg:flex-row lg:justify-between"
175
175
  >
176
176
  <div v-if="tableOptions.search" class="w-full max-w-lg lg:max-w-xs">
177
- <label for="search" class="sr-only">Search</label>
178
- <div class="relative">
177
+ <label for="table-search" class="sr-only">Search</label>
178
+ <div class="flex items-center gap-x-2">
179
179
  <div
180
- class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"
180
+ aria-hidden="true"
181
+ class="shrink-0 aspect-square rounded-full bg-gray-50 text-gray-400 h-10 w-10 flex items-center justify-center pointer-events-none"
181
182
  >
182
- <svg
183
- class="w-5 h-5 text-gray-400"
184
- fill="currentColor"
185
- viewBox="0 0 20 20"
186
- >
183
+ <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
187
184
  <path
188
185
  fill-rule="evenodd"
189
186
  d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z"
@@ -191,21 +188,47 @@ loadAndRender()
191
188
  />
192
189
  </svg>
193
190
  </div>
194
- <input
195
- v-model.trim="query"
196
- class="pl-10"
197
- type="search"
198
- placeholder="Search"
199
- @change="reloadTable()"
200
- />
191
+ <div class="flex-1">
192
+ <BaseInput
193
+ id="table-search"
194
+ v-model.trim="query"
195
+ type="search"
196
+ placeholder="Search"
197
+ @change="reloadTable()"
198
+ />
199
+ </div>
201
200
  </div>
202
201
  </div>
203
202
  <div v-if="tableOptions.dateSearch" class="w-full max-w-lg lg:max-w-xs">
204
- <DateRangePicker
205
- v-model="dateRange"
206
- v-bind="{ ...dateSearchProps }"
207
- @update:model-value="dateRangeChanged"
208
- />
203
+ <label for="table-date-range" class="sr-only">Date Range</label>
204
+ <div class="flex items-center gap-x-2">
205
+ <div
206
+ aria-hidden="true"
207
+ class="shrink-0 aspect-square rounded-full bg-gray-50 text-gray-400 h-10 w-10 flex items-center justify-center pointer-events-none"
208
+ >
209
+ <svg
210
+ class="h-5 w-5"
211
+ fill="none"
212
+ viewBox="0 0 24 24"
213
+ stroke="currentColor"
214
+ stroke-width="2"
215
+ >
216
+ <path
217
+ stroke-linecap="round"
218
+ stroke-linejoin="round"
219
+ d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
220
+ />
221
+ </svg>
222
+ </div>
223
+ <div class="flex-1">
224
+ <DateRangePicker
225
+ id="table-date-range"
226
+ v-model="dateRange"
227
+ v-bind="{ ...dateSearchProps }"
228
+ @update:model-value="dateRangeChanged"
229
+ />
230
+ </div>
231
+ </div>
209
232
  </div>
210
233
  </div>
211
234