@finema/core 2.7.6 → 2.7.7

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/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.7.6",
3
+ "version": "2.7.7",
4
4
  "configKey": "core",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
package/dist/module.mjs CHANGED
@@ -3,7 +3,7 @@ import defu from 'defu';
3
3
  import * as theme from '../dist/runtime/theme/index.js';
4
4
 
5
5
  const name = "@finema/core";
6
- const version = "2.7.6";
6
+ const version = "2.7.7";
7
7
 
8
8
  const nuxtAppOptions = {
9
9
  head: {
@@ -1,31 +1,33 @@
1
- import { ref } from "vue";
1
+ import { reactive, toRef } from "vue";
2
2
  import { ObjectHelper } from "../utils/ObjectHelper.js";
3
3
  import {
4
4
  apiObjectHelper
5
5
  } from "../helpers/apiObjectHelper.js";
6
6
  export const useObjectLoader = (loaderOptions) => {
7
- const data = ref(null);
8
- const status = ref(ObjectHelper.createStatus());
9
- const options = ref({});
7
+ const state = reactive({
8
+ data: null,
9
+ status: ObjectHelper.createStatus(),
10
+ options: {}
11
+ });
10
12
  const clear = () => {
11
- status.value = ObjectHelper.createStatus();
12
- data.value = null;
13
+ state.status = ObjectHelper.createStatus();
14
+ state.data = null;
13
15
  };
14
16
  const run = async (payload = {}) => {
15
17
  await apiObjectHelper(
16
18
  () => ({
17
- data: data.value,
18
- status: status.value,
19
- options: options.value
19
+ data: state.data,
20
+ status: state.status,
21
+ options: state.options
20
22
  }),
21
- (_data) => {
22
- status.value = _data;
23
+ (_status) => {
24
+ state.status = _status;
23
25
  },
24
- (_data) => {
25
- options.value = _data;
26
+ (_options) => {
27
+ state.options = _options;
26
28
  },
27
29
  (_data) => {
28
- data.value = _data ?? null;
30
+ state.data = _data ?? null;
29
31
  },
30
32
  payload.data,
31
33
  {
@@ -35,15 +37,15 @@ export const useObjectLoader = (loaderOptions) => {
35
37
  );
36
38
  };
37
39
  const setLoading = () => {
38
- status.value = ObjectHelper.toLoadingStatus(status.value);
40
+ state.status = ObjectHelper.toLoadingStatus(state.status);
39
41
  };
40
42
  const setData = (_data) => {
41
- data.value = _data;
43
+ state.data = _data;
42
44
  };
43
45
  return {
44
- data,
45
- status,
46
- options,
46
+ data: toRef(state, "data"),
47
+ status: toRef(state, "status"),
48
+ options: toRef(state, "options"),
47
49
  run,
48
50
  clear,
49
51
  setLoading,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.7.6",
3
+ "version": "2.7.7",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@nuxt/kit": "^3.17.4",
41
41
  "@nuxt/ui": "^3.1.3",
42
- "@pinia/nuxt": "0.7.0",
42
+ "@pinia/nuxt": "^0.11.0",
43
43
  "@tiptap/extension-image": "^2.8.0",
44
44
  "@tiptap/extension-link": "^2.8.0",
45
45
  "@tiptap/extension-text-align": "^2.8.0",