@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.
- package/dist/trees.es.js +3939 -3561
- package/dist/trees.umd.js +10 -10
- package/package.json +2 -2
- package/src/index.css +0 -16
- package/src/lib-components/forms/BaseInput.vue +90 -75
- package/src/lib-components/forms/Checkbox.vue +50 -34
- package/src/lib-components/forms/DateRangePicker.vue +56 -32
- package/src/lib-components/forms/FieldsetLegend.vue +28 -8
- package/src/lib-components/forms/InputHelp.vue +2 -4
- package/src/lib-components/forms/InputLabel.vue +27 -12
- package/src/lib-components/forms/MultiCheckboxes.vue +117 -74
- package/src/lib-components/forms/Radio.vue +79 -66
- package/src/lib-components/forms/RadioCards.vue +72 -70
- package/src/lib-components/forms/Select.vue +59 -56
- package/src/lib-components/forms/TextArea.vue +54 -47
- package/src/lib-components/forms/Toggle.vue +61 -18
- package/src/lib-components/forms/YesOrNoRadio.vue +75 -67
- package/src/lib-components/lists/DynamicTable.vue +43 -20
- package/types/composables/forms.d.ts +118 -0
- package/types/helpers/Debounce.d.ts +1 -1
- package/types/lib-components/forms/BaseInput.vue.d.ts +58 -34
- package/types/lib-components/forms/Checkbox.vue.d.ts +50 -29
- package/types/lib-components/forms/DateRangePicker.vue.d.ts +71 -39
- package/types/lib-components/forms/FieldsetLegend.vue.d.ts +30 -31
- package/types/lib-components/forms/InputHelp.vue.d.ts +19 -27
- package/types/lib-components/forms/InputLabel.vue.d.ts +28 -32
- package/types/lib-components/forms/MultiCheckboxes.vue.d.ts +77 -56
- package/types/lib-components/forms/Radio.vue.d.ts +64 -56
- package/types/lib-components/forms/RadioCards.vue.d.ts +68 -71
- package/types/lib-components/forms/Select.vue.d.ts +55 -44
- package/types/lib-components/forms/TextArea.vue.d.ts +50 -32
- package/types/lib-components/forms/Toggle.vue.d.ts +29 -24
- package/types/lib-components/forms/YesOrNoRadio.vue.d.ts +51 -38
- package/types/lib-components/indicators/XYSpinner.vue.d.ts +1 -1
- package/types/lib-components/layout/DateFilter.vue.d.ts +28 -20
- package/types/lib-components/layout/SidebarLayout.vue.d.ts +38 -32
- package/types/lib-components/layout/StackedLayout.vue.d.ts +45 -33
- package/types/lib-components/lists/Cards.vue.d.ts +14 -17
- package/types/lib-components/lists/DataTable.vue.d.ts +31 -31
- package/types/lib-components/lists/DetailList.vue.d.ts +38 -34
- package/types/lib-components/lists/DownloadCell.vue.d.ts +18 -15
- package/types/lib-components/lists/DynamicTable.vue.d.ts +32 -32
- package/types/lib-components/lists/StaticTable.vue.d.ts +21 -0
- package/types/lib-components/lists/StaticTableActionSlot.vue.d.ts +27 -0
- package/types/lib-components/lists/Table.vue.d.ts +39 -0
- package/types/lib-components/lists/TableActionButtons.vue.d.ts +11 -23
- package/types/lib-components/navigation/ActionsDropdown.vue.d.ts +11 -23
- package/types/lib-components/navigation/ActionsDropdownCallback.vue.d.ts +18 -0
- package/types/lib-components/navigation/ActionsDropdownEmit.vue.d.ts +22 -0
- package/types/lib-components/navigation/Paginator.vue.d.ts +12 -15
- package/types/lib-components/navigation/Steps.vue.d.ts +54 -39
- package/types/lib-components/navigation/Tabs.vue.d.ts +34 -34
- package/types/lib-components/overlays/ContentModal.vue.d.ts +22 -28
- package/types/lib-components/overlays/Modal.vue.d.ts +48 -43
- package/types/lib-components/overlays/Popover/Popover.vue.d.ts +23 -31
- package/types/lib-components/overlays/Popover/PopoverContent.vue.d.ts +1 -1
- package/types/lib-components/overlays/Slideover.vue.d.ts +30 -22
- 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 {
|
|
4
|
+
import { defaultInputProps, useInputField } from "@/composables/forms"
|
|
5
|
+
import type { OptionsInput } from "@/composables/forms"
|
|
6
|
+
import { ref } from "vue"
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
|
29
|
-
|
|
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
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
:value="
|
|
61
|
-
v-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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 {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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 {
|
|
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
|
-
|
|
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
|
-
<
|
|
11
|
-
|
|
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 ? '
|
|
23
|
-
|
|
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
|
-
|
|
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
|
-
|
|
8
|
-
|
|
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
|
-
|
|
28
|
-
|
|
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-
|
|
34
|
-
:aria-labelledby="
|
|
35
|
-
:aria-describedby="help ? `${
|
|
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="
|
|
39
|
+
<div v-if="label">
|
|
38
40
|
<InputLabel
|
|
39
41
|
class="block my-auto"
|
|
40
|
-
:label="
|
|
42
|
+
:label="label"
|
|
41
43
|
tag="legend"
|
|
42
|
-
|
|
43
|
-
|
|
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="
|
|
49
|
-
:for="`${
|
|
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="`${
|
|
60
|
+
:id="`${nameAttr}-true`"
|
|
61
|
+
rel="targetInput"
|
|
53
62
|
type="radio"
|
|
54
|
-
class="
|
|
55
|
-
|
|
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="
|
|
58
|
-
v-bind="
|
|
59
|
-
|
|
60
|
-
|
|
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="
|
|
75
|
-
:for="`${
|
|
83
|
+
:class="isDisabled ? 'cursor-not-allowed' : 'cursor-pointer'"
|
|
84
|
+
:for="`${nameAttr}-false`"
|
|
76
85
|
>
|
|
77
86
|
<input
|
|
78
|
-
:id="`${
|
|
87
|
+
:id="`${nameAttr}-false`"
|
|
79
88
|
type="radio"
|
|
80
|
-
class="
|
|
81
|
-
|
|
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="
|
|
84
|
-
v-bind="
|
|
85
|
-
|
|
86
|
-
|
|
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="
|
|
177
|
+
<label for="table-search" class="sr-only">Search</label>
|
|
178
|
+
<div class="flex items-center gap-x-2">
|
|
179
179
|
<div
|
|
180
|
-
|
|
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
|
-
<
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
-
<
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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
|
|