@sbc-connect/nuxt-base 0.13.3 → 0.15.0
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/CHANGELOG.md +14 -0
- package/app/app.config.ts +39 -12
- package/app/app.vue +1 -0
- package/app/assets/css/connect-base-tw.css +4 -0
- package/app/components/Connect/Breadcrumb.vue +9 -5
- package/app/components/Connect/FloatingLabel.vue +1 -1
- package/app/components/Connect/Footer.vue +2 -2
- package/app/components/Connect/Header/LogoHomeLink.vue +1 -1
- package/app/components/Connect/Header/WhatsNew.vue +1 -1
- package/app/components/Connect/Input/DatePicker.vue +4 -4
- package/app/components/Connect/Input/Menu.vue +27 -11
- package/app/components/Connect/Input/index.vue +1 -1
- package/app/components/Connect/Layout/Sidebar.vue +2 -2
- package/app/components/Connect/PageSection.vue +1 -1
- package/app/components/Connect/Slideover/WhatsNew.vue +2 -2
- package/app/components/Connect/SystemBanner.vue +1 -1
- package/app/components/Connect/Tombstone/index.vue +5 -2
- package/app/types/base-app-config.d.ts +12 -0
- package/i18n/locales/en-CA.ts +3 -0
- package/package.json +18 -18
- package/app/components/Connect/Input/Date.vue +0 -104
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @sbc-connect/nuxt-base
|
|
2
2
|
|
|
3
|
+
## 0.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#206](https://github.com/bcgov/connect-nuxt/pull/206) [`f19c40c`](https://github.com/bcgov/connect-nuxt/commit/f19c40c3702a53ef3a01a22b7068301f5d328122) Thanks [@deetz99](https://github.com/deetz99)! - Update Nuxt, Nuxt UI, JSDom and Pinia Colada to latest. Delete ConnectInputDate, replaced by ConnectInputDatePicker. Resolve theme issues after Nuxt UI update.
|
|
8
|
+
|
|
9
|
+
## 0.14.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#203](https://github.com/bcgov/connect-nuxt/pull/203) [`fedf109`](https://github.com/bcgov/connect-nuxt/commit/fedf109afdefa2869325afb9c7a268767c0e3d38) Thanks [@deetz99](https://github.com/deetz99)! - Add NuxtAnnouncer to app.vue. Update ConnectInputMenu hasValue check.
|
|
14
|
+
|
|
15
|
+
- [#203](https://github.com/bcgov/connect-nuxt/pull/203) [`fedf109`](https://github.com/bcgov/connect-nuxt/commit/fedf109afdefa2869325afb9c7a268767c0e3d38) Thanks [@deetz99](https://github.com/deetz99)! - Update dependencies
|
|
16
|
+
|
|
3
17
|
## 0.13.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/app/app.config.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
|
+
const colors = [
|
|
3
|
+
'primary',
|
|
4
|
+
'secondary',
|
|
5
|
+
'success',
|
|
6
|
+
'info',
|
|
7
|
+
'warning',
|
|
8
|
+
'error'
|
|
9
|
+
]
|
|
10
|
+
|
|
2
11
|
export default defineAppConfig({
|
|
3
12
|
connect: {
|
|
4
13
|
header: {
|
|
@@ -49,6 +58,11 @@ export default defineAppConfig({
|
|
|
49
58
|
false: {
|
|
50
59
|
link: 'text-secondary underline font-medium'
|
|
51
60
|
}
|
|
61
|
+
},
|
|
62
|
+
color: {
|
|
63
|
+
secondary: {
|
|
64
|
+
link: 'outline-secondary/100 focus-visible:outline-2 outline-offset-2'
|
|
65
|
+
}
|
|
52
66
|
}
|
|
53
67
|
},
|
|
54
68
|
compoundVariants: [
|
|
@@ -60,25 +74,32 @@ export default defineAppConfig({
|
|
|
60
74
|
link: 'hover:text-secondary hover:underline transition-colors'
|
|
61
75
|
}
|
|
62
76
|
}
|
|
63
|
-
]
|
|
77
|
+
],
|
|
78
|
+
defaultVariants: {
|
|
79
|
+
color: 'secondary'
|
|
80
|
+
}
|
|
64
81
|
},
|
|
65
82
|
button: {
|
|
66
83
|
compoundVariants: [
|
|
67
84
|
{
|
|
68
85
|
color: 'primary',
|
|
69
86
|
variant: 'solid',
|
|
70
|
-
class: 'font-bold
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
color: 'primary',
|
|
74
|
-
variant: 'ghost',
|
|
75
|
-
class: 'text-(--ui-primary) hover:bg-(--ui-primary)/10 active:bg-(--ui-primary)/25 focus:outline-none focus-visible:bg-(--ui-primary)/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent'
|
|
87
|
+
class: 'font-bold hover:bg-(--ui-primary)/75 disabled:bg-(--ui-primary) aria-disabled:bg-(--ui-primary) outline-offset-2'
|
|
76
88
|
},
|
|
77
|
-
{
|
|
78
|
-
color
|
|
89
|
+
...colors.map(color => ({
|
|
90
|
+
color,
|
|
91
|
+
class: `outline-${color}/100`
|
|
92
|
+
})),
|
|
93
|
+
...colors.map(color => ({
|
|
94
|
+
color,
|
|
95
|
+
variant: 'solid',
|
|
96
|
+
class: 'outline-offset-2'
|
|
97
|
+
})),
|
|
98
|
+
...colors.map(color => ({
|
|
99
|
+
color,
|
|
79
100
|
variant: 'outline',
|
|
80
|
-
class:
|
|
81
|
-
}
|
|
101
|
+
class: `ring-${color}/100`
|
|
102
|
+
}))
|
|
82
103
|
],
|
|
83
104
|
slots: {
|
|
84
105
|
base: 'cursor-pointer'
|
|
@@ -232,6 +253,9 @@ export default defineAppConfig({
|
|
|
232
253
|
},
|
|
233
254
|
variants: {
|
|
234
255
|
size: {
|
|
256
|
+
bcGov: {
|
|
257
|
+
root: 'text-sm'
|
|
258
|
+
},
|
|
235
259
|
xs: {
|
|
236
260
|
root: 'text-xs'
|
|
237
261
|
},
|
|
@@ -255,7 +279,7 @@ export default defineAppConfig({
|
|
|
255
279
|
}
|
|
256
280
|
},
|
|
257
281
|
defaultVariants: {
|
|
258
|
-
size: '
|
|
282
|
+
size: 'bcGov'
|
|
259
283
|
}
|
|
260
284
|
},
|
|
261
285
|
icons: {
|
|
@@ -332,6 +356,9 @@ export default defineAppConfig({
|
|
|
332
356
|
variant: 'bcGov'
|
|
333
357
|
}
|
|
334
358
|
},
|
|
359
|
+
link: {
|
|
360
|
+
base: 'outline-primary/100 focus-visible:outline-2 outline-offset-2'
|
|
361
|
+
},
|
|
335
362
|
skeleton: {
|
|
336
363
|
base: 'bg-gray-200'
|
|
337
364
|
},
|
package/app/app.vue
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
@import "tailwindcss";
|
|
2
2
|
@import "@nuxt/ui";
|
|
3
3
|
|
|
4
|
+
/* safelist so we can map across colors in the app config */
|
|
5
|
+
@source inline("outline-{primary,secondary,success,info,warning,error}/100");
|
|
6
|
+
@source inline("ring-{primary,secondary,success,info,warning,error}/100");
|
|
7
|
+
|
|
4
8
|
/* Customize Nuxt UI default tokens */
|
|
5
9
|
/* Follows https://sites.google.com/bcdevexchange.org/designsystem/foundation-styles/colours */
|
|
6
10
|
:root {
|
|
@@ -23,7 +23,7 @@ const breadcrumbs = computed<ConnectBreadcrumb[]>(() => {
|
|
|
23
23
|
}
|
|
24
24
|
})
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
const backHref = computed(() => {
|
|
27
27
|
const bcLength = breadcrumbs.value.length
|
|
28
28
|
|
|
29
29
|
if (bcLength > 1) {
|
|
@@ -32,7 +32,7 @@ function resolveBackHref() {
|
|
|
32
32
|
} else {
|
|
33
33
|
return ''
|
|
34
34
|
}
|
|
35
|
-
}
|
|
35
|
+
})
|
|
36
36
|
</script>
|
|
37
37
|
|
|
38
38
|
<template>
|
|
@@ -46,14 +46,17 @@ function resolveBackHref() {
|
|
|
46
46
|
class="app-inner-container flex items-center gap-3"
|
|
47
47
|
>
|
|
48
48
|
<UButton
|
|
49
|
-
class="
|
|
49
|
+
:class="[
|
|
50
|
+
'size-[28px] rounded-full px-1 bg-secondary',
|
|
51
|
+
'hover:bg-secondary/75 disabled:bg-secondary outline-secondary/100'
|
|
52
|
+
]"
|
|
50
53
|
:disabled="breadcrumbs.length < 2"
|
|
51
54
|
color="secondary"
|
|
52
55
|
icon="i-mdi-arrow-left"
|
|
53
56
|
:aria-label="$t('connect.label.goBack')"
|
|
54
|
-
:to="
|
|
57
|
+
:to="backHref"
|
|
55
58
|
:ui="{
|
|
56
|
-
leadingIcon: 'text-primary'
|
|
59
|
+
leadingIcon: 'text-primary'
|
|
57
60
|
}"
|
|
58
61
|
/>
|
|
59
62
|
<div class="w-[1px] bg-shade h-[24px]" />
|
|
@@ -62,6 +65,7 @@ function resolveBackHref() {
|
|
|
62
65
|
aria-label=""
|
|
63
66
|
:items="breadcrumbs"
|
|
64
67
|
separator-icon="i-mdi-chevron-right"
|
|
68
|
+
color="secondary"
|
|
65
69
|
/>
|
|
66
70
|
</nav>
|
|
67
71
|
</div>
|
|
@@ -61,7 +61,7 @@ const appVersions = computed<string[]>(() => {
|
|
|
61
61
|
:class="[
|
|
62
62
|
'flex-col gap-2 border-r-0 pr-2 last:mr-0',
|
|
63
63
|
'last:border-r-0 sm:mr-2 sm:inline-block sm:flex-none',
|
|
64
|
-
'sm:border-r sm:first:ml-2 border-line-muted'
|
|
64
|
+
'sm:border-r sm:first:ml-2 border-line-muted'
|
|
65
65
|
]"
|
|
66
66
|
>
|
|
67
67
|
<NuxtLink
|
|
@@ -70,7 +70,7 @@ const appVersions = computed<string[]>(() => {
|
|
|
70
70
|
:class="[
|
|
71
71
|
'rounded p-1 text-sm text-secondary',
|
|
72
72
|
'hover:underline focus:outline-none',
|
|
73
|
-
'focus-visible:ring-2 focus-visible:ring-secondary'
|
|
73
|
+
'focus-visible:ring-2 focus-visible:ring-secondary'
|
|
74
74
|
]"
|
|
75
75
|
>
|
|
76
76
|
{{ $t(link.label) }}
|
|
@@ -10,7 +10,7 @@ const localePath = useLocalePath()
|
|
|
10
10
|
'flex items-center gap-4 rounded-md',
|
|
11
11
|
'px-2 transition-colors duration-300',
|
|
12
12
|
'ease-in-out hover:bg-secondary/[0.1]',
|
|
13
|
-
'focus:outline-none focus-visible:ring-2 focus-visible:ring-secondary'
|
|
13
|
+
'focus:outline-none focus-visible:ring-2 focus-visible:ring-secondary'
|
|
14
14
|
]"
|
|
15
15
|
:aria-label="$t('connect.header.homeLink')"
|
|
16
16
|
>
|
|
@@ -312,7 +312,7 @@ function clearDate() {
|
|
|
312
312
|
:color="error ? 'error' : 'neutral'"
|
|
313
313
|
variant="ghost"
|
|
314
314
|
class="date-action-button"
|
|
315
|
-
:aria-label="$t('label.clearDate')"
|
|
315
|
+
:aria-label="$t('connect.label.clearDate')"
|
|
316
316
|
@keydown.enter.prevent.stop="clearDate"
|
|
317
317
|
@click="clearDate"
|
|
318
318
|
/>
|
|
@@ -326,7 +326,7 @@ function clearDate() {
|
|
|
326
326
|
onOpenAutoFocus,
|
|
327
327
|
onCloseAutoFocus,
|
|
328
328
|
onFocusOutside: ignoreInputInteraction,
|
|
329
|
-
onInteractOutside: ignoreInputInteraction
|
|
329
|
+
onInteractOutside: ignoreInputInteraction
|
|
330
330
|
}"
|
|
331
331
|
>
|
|
332
332
|
<UButton
|
|
@@ -337,13 +337,13 @@ function clearDate() {
|
|
|
337
337
|
:color="error && !dateInput ? 'error' : 'neutral'"
|
|
338
338
|
variant="ghost"
|
|
339
339
|
class="date-action-button"
|
|
340
|
-
:aria-label="$t('label.openCalendar')"
|
|
340
|
+
:aria-label="$t('connect.label.openCalendar')"
|
|
341
341
|
@keydown.enter.prevent.stop="isCalendarOpen = !isCalendarOpen"
|
|
342
342
|
/>
|
|
343
343
|
<template #content>
|
|
344
344
|
<div ref="calendarContentRef">
|
|
345
345
|
<UCalendar
|
|
346
|
-
:aria-label="$t('label.chooseDate')"
|
|
346
|
+
:aria-label="$t('connect.label.chooseDate')"
|
|
347
347
|
:model-value="calendarValue"
|
|
348
348
|
:min-value="calendarMinValue"
|
|
349
349
|
:max-value="calendarMaxValue"
|
|
@@ -9,23 +9,39 @@ const props = defineProps<{
|
|
|
9
9
|
const labelId = props.id + '-label'
|
|
10
10
|
const model = defineModel<InputMenuProps['modelValue']>()
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
const val = model.value
|
|
14
|
-
|
|
12
|
+
function isPopulated(val: unknown): boolean {
|
|
15
13
|
if (val === null || val === undefined) {
|
|
16
14
|
return false
|
|
17
15
|
}
|
|
18
16
|
|
|
17
|
+
if (typeof val === 'string') {
|
|
18
|
+
return val.trim().length > 0
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (typeof val === 'number') {
|
|
22
|
+
return !Number.isNaN(val)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (typeof val === 'boolean' || typeof val === 'bigint') {
|
|
26
|
+
return true
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (val instanceof Date) {
|
|
30
|
+
return !Number.isNaN(val.getTime())
|
|
31
|
+
}
|
|
32
|
+
|
|
19
33
|
if (Array.isArray(val)) {
|
|
20
|
-
return val.
|
|
34
|
+
return val.some(isPopulated)
|
|
21
35
|
}
|
|
22
36
|
|
|
23
37
|
if (typeof val === 'object') {
|
|
24
|
-
return Object.
|
|
38
|
+
return Object.values(val).some(isPopulated)
|
|
25
39
|
}
|
|
26
40
|
|
|
27
|
-
return
|
|
28
|
-
}
|
|
41
|
+
return false
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const hasValue = computed(() => isPopulated(model.value))
|
|
29
45
|
|
|
30
46
|
defineOptions({ inheritAttrs: false })
|
|
31
47
|
</script>
|
|
@@ -35,11 +51,11 @@ defineOptions({ inheritAttrs: false })
|
|
|
35
51
|
<span
|
|
36
52
|
:id="labelId"
|
|
37
53
|
:class="[
|
|
38
|
-
'absolute
|
|
39
|
-
'top-1/2 -translate-y-1/2',
|
|
40
|
-
'group-focus-within:
|
|
54
|
+
'absolute text-neutral transition-transform duration-200 ease-out origin-left text-base line-clamp-1',
|
|
55
|
+
'top-1/2 left-2.5 z-10 pointer-events-none -translate-y-1/2',
|
|
56
|
+
'group-focus-within:translate-y-[-115%] group-focus-within:scale-75 group-focus-within:text-primary',
|
|
41
57
|
'group-has-aria-invalid:text-error',
|
|
42
|
-
hasValue ? '
|
|
58
|
+
hasValue ? 'translate-y-[-115%] scale-75' : ''
|
|
43
59
|
]"
|
|
44
60
|
>
|
|
45
61
|
{{ label }}
|
|
@@ -14,7 +14,7 @@ const showSideMenu = ref(true)
|
|
|
14
14
|
size="xs"
|
|
15
15
|
:icon="showSideMenu ? 'i-mdi-minus' : 'i-mdi-plus'"
|
|
16
16
|
data-testid="connect-sidebar-toggle-btn"
|
|
17
|
-
@click="showSideMenu = !showSideMenu"
|
|
17
|
+
@click="() => { showSideMenu = !showSideMenu }"
|
|
18
18
|
/>
|
|
19
19
|
<ConnectTransitionCollapse>
|
|
20
20
|
<div v-if="showSideMenu">
|
|
@@ -28,7 +28,7 @@ const showSideMenu = ref(true)
|
|
|
28
28
|
label: 'text-base',
|
|
29
29
|
link: 'cursor-pointer',
|
|
30
30
|
linkLabel: 'text-neutral-highlighted',
|
|
31
|
-
root: 'bg-white rounded p-3'
|
|
31
|
+
root: 'bg-white rounded p-3'
|
|
32
32
|
}"
|
|
33
33
|
/>
|
|
34
34
|
</div>
|
|
@@ -14,13 +14,13 @@ defineProps<{
|
|
|
14
14
|
:close="{
|
|
15
15
|
color: 'neutral',
|
|
16
16
|
variant: 'ghost',
|
|
17
|
-
class: 'cursor-pointer hover:bg-shade/50 focus-visible:bg-transparent focus-visible:ring-2 rounded-full'
|
|
17
|
+
class: 'cursor-pointer hover:bg-shade/50 focus-visible:bg-transparent focus-visible:ring-2 rounded-full'
|
|
18
18
|
}"
|
|
19
19
|
:ui="{
|
|
20
20
|
header: 'bg-brand-inverted',
|
|
21
21
|
title: 'text-brand',
|
|
22
22
|
body: 'flex-1 overflow-y-auto p-0 sm:p-0',
|
|
23
|
-
description: 'sr-only'
|
|
23
|
+
description: 'sr-only'
|
|
24
24
|
}"
|
|
25
25
|
>
|
|
26
26
|
<template #body>
|
|
@@ -28,7 +28,7 @@ onMounted(async () => {
|
|
|
28
28
|
:ui="{
|
|
29
29
|
root: 'rounded-none bg-brand-inverted px-0 sm:px-0 app-inner-container',
|
|
30
30
|
wrapper: 'bg-brand-inverted',
|
|
31
|
-
close: 'mt-2 text-neutral-highlighted'
|
|
31
|
+
close: 'mt-2 text-neutral-highlighted'
|
|
32
32
|
}"
|
|
33
33
|
@update:open="close = true"
|
|
34
34
|
>
|
|
@@ -85,7 +85,10 @@ async function handleButtonAction(button: ButtonProps, event: MouseEvent) {
|
|
|
85
85
|
v-if="tombstone.bottomButtons.length"
|
|
86
86
|
class="flex flex-wrap gap-2"
|
|
87
87
|
>
|
|
88
|
-
<template
|
|
88
|
+
<template
|
|
89
|
+
v-for="btn in tombstone.bottomButtons"
|
|
90
|
+
:key="btn.button?.label || btn.vNode?.key || undefined"
|
|
91
|
+
>
|
|
89
92
|
<component :is="btn.vNode" v-if="btn.vNode" />
|
|
90
93
|
<UButton
|
|
91
94
|
v-else-if="btn.button"
|
|
@@ -93,7 +96,7 @@ async function handleButtonAction(button: ButtonProps, event: MouseEvent) {
|
|
|
93
96
|
...btn.button,
|
|
94
97
|
onClick(event) {
|
|
95
98
|
handleButtonAction(btn.button!, event)
|
|
96
|
-
}
|
|
99
|
+
}
|
|
97
100
|
}"
|
|
98
101
|
/>
|
|
99
102
|
</template>
|
package/i18n/locales/en-CA.ts
CHANGED
|
@@ -22,6 +22,8 @@ export default {
|
|
|
22
22
|
bcApp: 'A BC Online Application',
|
|
23
23
|
bcGovLogo: 'Government of British Columbia Logo',
|
|
24
24
|
cancel: 'Cancel',
|
|
25
|
+
chooseDate: 'Choose Date',
|
|
26
|
+
clearDate: 'Clear Date',
|
|
25
27
|
close: 'Close',
|
|
26
28
|
contactInformation: 'Contact Information',
|
|
27
29
|
copyright: 'Copyright',
|
|
@@ -32,6 +34,7 @@ export default {
|
|
|
32
34
|
home: 'Home',
|
|
33
35
|
hoursOfOperation: 'Hours of Operation',
|
|
34
36
|
localeSelect: 'Select a Language, current language: English',
|
|
37
|
+
openCalendar: 'Open Calendar',
|
|
35
38
|
privacy: 'Privacy',
|
|
36
39
|
whatsNew: "What's New",
|
|
37
40
|
whatsNewAria: "What's New, {count} unread",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sbc-connect/nuxt-base",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "github:bcgov/connect-nuxt"
|
|
@@ -10,27 +10,27 @@
|
|
|
10
10
|
"main": "./nuxt.config.ts",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@iconify-json/mdi": "1.2.3",
|
|
13
|
-
"@launchdarkly/js-client-sdk": "4.
|
|
14
|
-
"@nuxt/ui": "4.
|
|
15
|
-
"@nuxtjs/i18n": "10.
|
|
16
|
-
"@vueuse/core": "
|
|
17
|
-
"@vueuse/nuxt": "
|
|
18
|
-
"dompurify": "3.4.
|
|
19
|
-
"es-toolkit": "1.
|
|
13
|
+
"@launchdarkly/js-client-sdk": "4.10.3",
|
|
14
|
+
"@nuxt/ui": "4.11.3",
|
|
15
|
+
"@nuxtjs/i18n": "10.6.0",
|
|
16
|
+
"@vueuse/core": "15.0.0",
|
|
17
|
+
"@vueuse/nuxt": "15.0.0",
|
|
18
|
+
"dompurify": "3.4.16",
|
|
19
|
+
"es-toolkit": "1.52.0",
|
|
20
20
|
"luxon": "3.7.2",
|
|
21
|
-
"maska": "3.2.
|
|
22
|
-
"zod": "4.
|
|
21
|
+
"maska": "3.2.1",
|
|
22
|
+
"zod": "4.6.5"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@axe-core/playwright": "4.
|
|
26
|
-
"@types/luxon": "3.7.
|
|
27
|
-
"dotenv": "
|
|
28
|
-
"nuxt": "4.
|
|
25
|
+
"@axe-core/playwright": "4.13.0",
|
|
26
|
+
"@types/luxon": "3.7.6",
|
|
27
|
+
"dotenv": "18.0.7",
|
|
28
|
+
"nuxt": "4.6.1",
|
|
29
29
|
"typescript": "6.0.3",
|
|
30
|
-
"vue-
|
|
31
|
-
"
|
|
32
|
-
"@sbc-connect/
|
|
33
|
-
"@sbc-connect/
|
|
30
|
+
"vue-router": "5.4.0",
|
|
31
|
+
"vue-tsc": "3.3.13",
|
|
32
|
+
"@sbc-connect/vitest-config": "0.2.0",
|
|
33
|
+
"@sbc-connect/playwright-config": "0.2.1"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"preinstall": "npx only-allow pnpm",
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
// https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/
|
|
4
|
-
// https://whatsock.com/Templates/Datepickers/Basic,%20Auto%20Open/index.htm
|
|
5
|
-
import type { ConnectInput, UCalendar } from '#components'
|
|
6
|
-
import { CalendarDate } from '@internationalized/date'
|
|
7
|
-
import { DateTime } from 'luxon'
|
|
8
|
-
|
|
9
|
-
// FUTURE: update props as needed (min/max/disabled days)
|
|
10
|
-
defineProps<{
|
|
11
|
-
label: string
|
|
12
|
-
id: string
|
|
13
|
-
}>()
|
|
14
|
-
|
|
15
|
-
const emit = defineEmits<{
|
|
16
|
-
blur: []
|
|
17
|
-
}>()
|
|
18
|
-
|
|
19
|
-
const externalModel = defineModel<string | null | undefined>({ required: true })
|
|
20
|
-
|
|
21
|
-
const localModel = computed({
|
|
22
|
-
get() {
|
|
23
|
-
if (externalModel.value) {
|
|
24
|
-
const dt = DateTime.fromISO(externalModel.value, { zone: 'America/Vancouver' })
|
|
25
|
-
if (dt.isValid) {
|
|
26
|
-
return new CalendarDate(dt.year, dt.month, dt.day)
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return undefined
|
|
30
|
-
},
|
|
31
|
-
set(v) {
|
|
32
|
-
if (v) {
|
|
33
|
-
externalModel.value = DateTime.fromObject({
|
|
34
|
-
year: v.year,
|
|
35
|
-
month: v.month,
|
|
36
|
-
day: v.day
|
|
37
|
-
}).toISODate()
|
|
38
|
-
} else {
|
|
39
|
-
externalModel.value = null
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const open = ref(false)
|
|
45
|
-
const calendarRef = useTemplateRef('calendar-ref')
|
|
46
|
-
const inputRef = useTemplateRef<InstanceType<typeof ConnectInput>>('input-ref')
|
|
47
|
-
|
|
48
|
-
function focusCalendar() {
|
|
49
|
-
const button = (calendarRef.value as any)?.$el?.querySelector('button')
|
|
50
|
-
if (button) {
|
|
51
|
-
(button as HTMLButtonElement).focus()
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function focusInput() {
|
|
56
|
-
inputRef.value?.input?.inputRef?.focus()
|
|
57
|
-
open.value = false
|
|
58
|
-
emit('blur')
|
|
59
|
-
}
|
|
60
|
-
</script>
|
|
61
|
-
|
|
62
|
-
<template>
|
|
63
|
-
<UPopover
|
|
64
|
-
v-model:open="open"
|
|
65
|
-
:content="{
|
|
66
|
-
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
67
|
-
onEscapeKeyDown: () => {
|
|
68
|
-
focusInput()
|
|
69
|
-
},
|
|
70
|
-
side: 'bottom',
|
|
71
|
-
align: 'start',
|
|
72
|
-
}"
|
|
73
|
-
@update:open="(v) => {
|
|
74
|
-
if (!v) {
|
|
75
|
-
$emit('blur')
|
|
76
|
-
}
|
|
77
|
-
}"
|
|
78
|
-
>
|
|
79
|
-
<template #default>
|
|
80
|
-
<div class="w-full group">
|
|
81
|
-
<ConnectInput
|
|
82
|
-
:id
|
|
83
|
-
ref="input-ref"
|
|
84
|
-
v-model="externalModel"
|
|
85
|
-
:label
|
|
86
|
-
mask="####-##-##"
|
|
87
|
-
trailing-icon="i-mdi-calendar"
|
|
88
|
-
@focus="open = true"
|
|
89
|
-
@click.stop="open = true"
|
|
90
|
-
@keydown.down.prevent="focusCalendar"
|
|
91
|
-
/>
|
|
92
|
-
</div>
|
|
93
|
-
</template>
|
|
94
|
-
|
|
95
|
-
<template #content>
|
|
96
|
-
<UCalendar
|
|
97
|
-
ref="calendar-ref"
|
|
98
|
-
v-model="localModel"
|
|
99
|
-
class="p-2"
|
|
100
|
-
@update:model-value="focusInput"
|
|
101
|
-
/>
|
|
102
|
-
</template>
|
|
103
|
-
</UPopover>
|
|
104
|
-
</template>
|