@sbc-connect/nuxt-base 0.13.3 → 0.14.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @sbc-connect/nuxt-base
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#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.
8
+
9
+ - [#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
10
+
3
11
  ## 0.13.3
4
12
 
5
13
  ### Patch Changes
package/app/app.vue CHANGED
@@ -11,6 +11,7 @@ useHead({
11
11
 
12
12
  <template>
13
13
  <UApp :toaster="{ position: 'bottom-center' }">
14
+ <NuxtAnnouncer />
14
15
  <NuxtLayout>
15
16
  <NuxtPage />
16
17
  </NuxtLayout>
@@ -9,23 +9,39 @@ const props = defineProps<{
9
9
  const labelId = props.id + '-label'
10
10
  const model = defineModel<InputMenuProps['modelValue']>()
11
11
 
12
- const hasValue = computed(() => {
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.length > 0
34
+ return val.some(isPopulated)
21
35
  }
22
36
 
23
37
  if (typeof val === 'object') {
24
- return Object.keys(val).length > 0
38
+ return Object.values(val).some(isPopulated)
25
39
  }
26
40
 
27
- return val === 0 || !!val
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 left-0 z-10 px-2.5 pointer-events-none text-neutral transition-all duration-200 w-fit line-clamp-1',
39
- 'top-1/2 -translate-y-1/2',
40
- 'group-focus-within:top-3 group-focus-within:text-xs group-focus-within:text-primary',
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 ? 'top-3 text-xs' : '',
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">
@@ -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 v-for="btn in tombstone.bottomButtons" :key="btn.button?.label || btn.vNode?.key">
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"
@@ -10,6 +10,18 @@ declare module 'nuxt/schema' {
10
10
  }
11
11
  }
12
12
  }
13
+
14
+ interface AppConfig {
15
+ connect: {
16
+ header: {
17
+ localeSelect: boolean
18
+ whatsNew: boolean
19
+ }
20
+ footer: {
21
+ versions: string[]
22
+ }
23
+ }
24
+ }
13
25
  }
14
26
 
15
27
  export {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sbc-connect/nuxt-base",
3
3
  "type": "module",
4
- "version": "0.13.3",
4
+ "version": "0.14.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "github:bcgov/connect-nuxt"
@@ -10,27 +10,28 @@
10
10
  "main": "./nuxt.config.ts",
11
11
  "dependencies": {
12
12
  "@iconify-json/mdi": "1.2.3",
13
- "@launchdarkly/js-client-sdk": "4.6.5",
13
+ "@launchdarkly/js-client-sdk": "4.10.3",
14
14
  "@nuxt/ui": "4.7.1",
15
- "@nuxtjs/i18n": "10.3.0",
16
- "@vueuse/core": "14.3.0",
17
- "@vueuse/nuxt": "14.3.0",
18
- "dompurify": "3.4.5",
19
- "es-toolkit": "1.46.1",
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.0",
22
- "zod": "4.4.3"
21
+ "maska": "3.2.1",
22
+ "zod": "4.6.5"
23
23
  },
24
24
  "devDependencies": {
25
- "@axe-core/playwright": "4.11.3",
26
- "@types/luxon": "3.7.1",
27
- "dotenv": "^17.4.2",
28
- "nuxt": "4.4.8",
25
+ "@axe-core/playwright": "4.13.0",
26
+ "@types/luxon": "3.7.5",
27
+ "dotenv": "18.0.4",
28
+ "nuxt": "4.5.2",
29
29
  "typescript": "6.0.3",
30
- "vue-tsc": "3.3.1",
30
+ "vue-router": "^5.3.1",
31
+ "vue-tsc": "3.3.11",
31
32
  "@sbc-connect/eslint-config": "0.0.8",
32
- "@sbc-connect/playwright-config": "0.2.1",
33
- "@sbc-connect/vitest-config": "0.2.0"
33
+ "@sbc-connect/vitest-config": "0.2.0",
34
+ "@sbc-connect/playwright-config": "0.2.1"
34
35
  },
35
36
  "scripts": {
36
37
  "preinstall": "npx only-allow pnpm",