@finema/core 1.3.35 → 1.3.36

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": "1.3.35",
3
+ "version": "1.3.36",
4
4
  "configKey": "core",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.7.4"
package/dist/module.mjs CHANGED
@@ -2,7 +2,7 @@ import { defineNuxtModule, createResolver, installModule, addPlugin, addComponen
2
2
  import { merge } from 'lodash-es';
3
3
 
4
4
  const name = "@finema/core";
5
- const version = "1.3.35";
5
+ const version = "1.3.36";
6
6
 
7
7
  const colors = {
8
8
  black: "#20243E",
@@ -68,6 +68,24 @@ const colors = {
68
68
  };
69
69
 
70
70
  const _merge = merge;
71
+ const isObj = (item) => item && typeof item === "object" && !Array.isArray(item);
72
+ const _deepMerge = (target, ...sources) => {
73
+ if (!sources.length)
74
+ return target;
75
+ const source = sources.shift();
76
+ if (isObj(target) && isObj(source)) {
77
+ for (const key in source) {
78
+ if (isObj(source[key])) {
79
+ if (!target[key])
80
+ Object.assign(target, { [key]: {} });
81
+ _deepMerge(target[key], source[key]);
82
+ } else {
83
+ Object.assign(target, { [key]: source[key] });
84
+ }
85
+ }
86
+ }
87
+ return _deepMerge(target, ...sources);
88
+ };
71
89
 
72
90
  const pagination = {
73
91
  default: {
@@ -183,64 +201,70 @@ const module = defineNuxtModule({
183
201
  pagination
184
202
  });
185
203
  nuxt.options.appConfig.ui.strategy = "override";
186
- nuxt.options.runtimeConfig = {
187
- ...nuxt.options.runtimeConfig,
188
- public: {
189
- baseAPI: process.env.APP_BASE_API,
190
- baseAPIMock: process.env.APP_BASE_API_MOCK,
191
- baseInternalAPI: process.env.APP_BASE_INTERNAL_API,
192
- port: process.env.PORT || "3000"
193
- }
194
- };
195
- nuxt.options.app = {
196
- ...nuxt.options.app,
197
- head: {
198
- htmlAttrs: {
199
- lang: "en"
200
- },
201
- meta: [
202
- { charset: "utf-8" },
203
- {
204
- name: "viewport",
205
- content: "width=device-width, initial-scale=1"
206
- },
207
- {
208
- id: "description",
209
- name: "description",
210
- content: ""
211
- },
212
- {
213
- name: "format-detection",
214
- content: "telephone=no"
215
- }
216
- ],
217
- link: [
218
- {
219
- rel: "preconnect",
220
- href: "https://fonts.googleapis.com"
221
- },
222
- {
223
- rel: "preconnect",
224
- href: "https://fonts.gstatic.com",
225
- crossorigin: ""
226
- },
227
- {
228
- rel: "dns-prefetch",
229
- href: "https://www.google-analytics.com/"
230
- },
231
- {
232
- rel: "preconnect",
233
- href: "https://www.google-analytics.com/",
234
- crossorigin: ""
204
+ nuxt.options.runtimeConfig = _deepMerge(
205
+ {},
206
+ {
207
+ public: {
208
+ baseAPI: process.env.APP_BASE_API,
209
+ baseAPIMock: process.env.APP_BASE_API_MOCK,
210
+ baseInternalAPI: process.env.APP_BASE_INTERNAL_API,
211
+ port: process.env.PORT || "3000"
212
+ }
213
+ },
214
+ nuxt.options.runtimeConfig
215
+ );
216
+ nuxt.options.app = _deepMerge(
217
+ {},
218
+ {
219
+ head: {
220
+ htmlAttrs: {
221
+ lang: "en"
235
222
  },
236
- {
237
- rel: "icon",
238
- type: "image/x-icon",
239
- href: "/favicon.ico"
240
- }
241
- ]
242
- }
243
- };
223
+ meta: [
224
+ { charset: "utf-8" },
225
+ {
226
+ name: "viewport",
227
+ content: "width=device-width, initial-scale=1"
228
+ },
229
+ {
230
+ id: "description",
231
+ name: "description",
232
+ content: ""
233
+ },
234
+ {
235
+ name: "format-detection",
236
+ content: "telephone=no"
237
+ }
238
+ ],
239
+ link: [
240
+ {
241
+ rel: "preconnect",
242
+ href: "https://fonts.googleapis.com"
243
+ },
244
+ {
245
+ rel: "preconnect",
246
+ href: "https://fonts.gstatic.com",
247
+ crossorigin: ""
248
+ },
249
+ {
250
+ rel: "dns-prefetch",
251
+ href: "https://www.google-analytics.com/"
252
+ },
253
+ {
254
+ rel: "preconnect",
255
+ href: "https://www.google-analytics.com/",
256
+ crossorigin: ""
257
+ },
258
+ {
259
+ rel: "icon",
260
+ type: "image/x-icon",
261
+ href: "/favicon.ico"
262
+ }
263
+ ]
264
+ }
265
+ },
266
+ nuxt.options.app
267
+ );
244
268
  await installModule("@pinia/nuxt");
245
269
  await installModule("@vee-validate/nuxt", {
246
270
  // disable or enable auto imports
@@ -1,13 +1,13 @@
1
- <template><img class="h-12" :src="getValue" /></template>
2
- <script lang="ts" setup>
3
- import { computed } from 'vue'
4
- import { type IColumn } from '#core/components/Table/types'
5
-
6
- const props = defineProps<{
7
- value: any
8
- row: any
9
- column: IColumn
10
- }>()
11
-
12
- const getValue = computed(() => props.value)
13
- </script>
1
+ <template><img class="h-12" :src="getValue" /></template>
2
+ <script lang="ts" setup>
3
+ import { computed } from 'vue'
4
+ import { type IColumn } from '#core/components/Table/types'
5
+
6
+ const props = defineProps<{
7
+ value: any
8
+ row: any
9
+ column: IColumn
10
+ }>()
11
+
12
+ const getValue = computed(() => props.value)
13
+ </script>
@@ -1,14 +1,14 @@
1
- <template>{{ getValue }}</template>
2
- <script lang="ts" setup>
3
- import { StringHelper } from '../../utils/StringHelper'
4
- import { computed } from 'vue'
5
- import { type IColumn } from '#core/components/Table/types'
6
-
7
- const props = defineProps<{
8
- value: any
9
- row: any
10
- column: IColumn
11
- }>()
12
-
13
- const getValue = computed(() => StringHelper.withComma(props.value))
14
- </script>
1
+ <template>{{ getValue }}</template>
2
+ <script lang="ts" setup>
3
+ import { StringHelper } from '../../utils/StringHelper'
4
+ import { computed } from 'vue'
5
+ import { type IColumn } from '#core/components/Table/types'
6
+
7
+ const props = defineProps<{
8
+ value: any
9
+ row: any
10
+ column: IColumn
11
+ }>()
12
+
13
+ const getValue = computed(() => StringHelper.withComma(props.value))
14
+ </script>
@@ -108,3 +108,4 @@ export declare const _fromPairs: {
108
108
  export declare const _xor: <T>(...arrays: (import("lodash").List<T> | null | undefined)[]) => T[];
109
109
  export declare const _clone: (object: any) => any;
110
110
  export declare const _debounce: <T extends (...args: any[]) => any>(func: T, wait?: number) => import("lodash").DebouncedFunc<T>;
111
+ export declare const _deepMerge: (target: any, ...sources: any[]) => any;
@@ -67,3 +67,21 @@ export const _clone = (object) => {
67
67
  export const _debounce = (func, wait = 150) => {
68
68
  return debounce(func, wait);
69
69
  };
70
+ const isObj = (item) => item && typeof item === "object" && !Array.isArray(item);
71
+ export const _deepMerge = (target, ...sources) => {
72
+ if (!sources.length)
73
+ return target;
74
+ const source = sources.shift();
75
+ if (isObj(target) && isObj(source)) {
76
+ for (const key in source) {
77
+ if (isObj(source[key])) {
78
+ if (!target[key])
79
+ Object.assign(target, { [key]: {} });
80
+ _deepMerge(target[key], source[key]);
81
+ } else {
82
+ Object.assign(target, { [key]: source[key] });
83
+ }
84
+ }
85
+ }
86
+ return _deepMerge(target, ...sources);
87
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.3.35",
3
+ "version": "1.3.36",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Development Team",