@globalbrain/sefirot 3.28.0 → 3.28.2

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.
@@ -1,5 +1,6 @@
1
1
  import { type Ref, ref } from 'vue'
2
2
  import { Http } from '../http/Http'
3
+ import { tryOnMounted } from './Utils'
3
4
 
4
5
  export interface Query<Data = any> {
5
6
  loading: Ref<boolean>
@@ -30,8 +31,8 @@ export function useQuery<Data = any>(
30
31
  const loading = ref(false)
31
32
  const data = ref<Data | undefined>()
32
33
 
33
- if (options.immediate !== false && !import.meta.env.SSR) {
34
- execute()
34
+ if (options.immediate !== false) {
35
+ tryOnMounted(execute)
35
36
  }
36
37
 
37
38
  async function execute(): Promise<Data> {
@@ -1,4 +1,4 @@
1
- import { type ComputedRef, type MaybeRefOrGetter, computed, toValue, useSlots } from 'vue'
1
+ import { type ComputedRef, type MaybeRefOrGetter, computed, getCurrentInstance, onMounted, toValue, useSlots } from 'vue'
2
2
  import { isArray, isString } from '../support/Utils'
3
3
 
4
4
  export type WhenCondition<T> = MaybeRefOrGetter<T>
@@ -61,3 +61,11 @@ export function useSlotValue(name = 'default'): ComputedRef<string | null> {
61
61
  return v !== '' ? v : null
62
62
  })
63
63
  }
64
+
65
+ export function tryOnMounted(fn: () => void): void {
66
+ if (getCurrentInstance()) {
67
+ onMounted(fn)
68
+ } else if (!import.meta.env.SSR) {
69
+ fn()
70
+ }
71
+ }
@@ -35,6 +35,7 @@ declare module 'vue' {
35
35
  SControlActionBar: typeof SControlActionBar
36
36
  SControlActionBarButton: typeof SControlActionBarButton
37
37
  SControlActionBarClose: typeof SControlActionBarClose
38
+ SControlActionBarCollapse: typeof SControlActionBarCollapse
38
39
  SControlActionMenu: typeof SControlActionMenu
39
40
  SControlButton: typeof SControlButton
40
41
  SControlCenter: typeof SControlCenter
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
- "version": "3.28.0",
4
- "packageManager": "pnpm@8.14.3",
3
+ "version": "3.28.2",
4
+ "packageManager": "pnpm@8.15.1",
5
5
  "description": "Vue Components for Global Brain Design System.",
6
6
  "author": "Kia Ishii <ka.ishii@globalbrains.com>",
7
7
  "license": "MIT",
@@ -72,7 +72,7 @@
72
72
  },
73
73
  "devDependencies": {
74
74
  "@globalbrain/eslint-config": "^1.5.2",
75
- "@histoire/plugin-vue": "^0.17.8",
75
+ "@histoire/plugin-vue": "^0.17.9",
76
76
  "@iconify-icons/ph": "^1.2.5",
77
77
  "@iconify-icons/ri": "^1.2.10",
78
78
  "@iconify/vue": "^4.1.1",
@@ -80,18 +80,18 @@
80
80
  "@types/body-scroll-lock": "^3.1.2",
81
81
  "@types/lodash-es": "^4.17.12",
82
82
  "@types/markdown-it": "^13.0.7",
83
- "@types/node": "^20.11.6",
83
+ "@types/node": "^20.11.16",
84
84
  "@vitejs/plugin-vue": "^5.0.3",
85
- "@vitest/coverage-v8": "^1.2.1",
86
- "@vue/test-utils": "^2.4.3",
85
+ "@vitest/coverage-v8": "^1.2.2",
86
+ "@vue/test-utils": "^2.4.4",
87
87
  "@vuelidate/core": "^2.0.3",
88
88
  "@vuelidate/validators": "^2.0.4",
89
89
  "@vueuse/core": "^10.7.2",
90
90
  "body-scroll-lock": "4.0.0-beta.0",
91
91
  "eslint": "^8.56.0",
92
92
  "fuse.js": "^7.0.0",
93
- "happy-dom": "^13.3.1",
94
- "histoire": "^0.17.8",
93
+ "happy-dom": "^13.3.8",
94
+ "histoire": "^0.17.9",
95
95
  "lodash-es": "^4.17.21",
96
96
  "markdown-it": "^14.0.0",
97
97
  "normalize.css": "^8.0.1",
@@ -103,8 +103,8 @@
103
103
  "typescript": "~5.3.3",
104
104
  "v-calendar": "^3.1.2",
105
105
  "vite": "^5.0.12",
106
- "vitepress": "1.0.0-rc.40",
107
- "vitest": "^1.2.1",
106
+ "vitepress": "1.0.0-rc.41",
107
+ "vitest": "^1.2.2",
108
108
  "vue": "^3.4.15",
109
109
  "vue-router": "^4.2.5",
110
110
  "vue-tsc": "^1.8.27"