@finema/core 1.4.46 → 1.4.48

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.4.46",
3
+ "version": "1.4.48",
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 'lodash-es';
3
3
 
4
4
  const name = "@finema/core";
5
- const version = "1.4.46";
5
+ const version = "1.4.48";
6
6
 
7
7
  const colors = {
8
8
  black: "#20243E",
@@ -119,12 +119,12 @@ export const apiFetchHelper = async (state, onUpdateStatus, onUpdateOptions, onU
119
119
  ...opts.fetch?.getRequestOptions?.(page, query, opts) ?? {}
120
120
  };
121
121
  const limit = reqOptions.params?.limit || config.limit_per_page;
122
+ reqOptions.params = ParamHelper.getParams(opts, reqOptions);
122
123
  reqOptions.params = {
123
124
  limit,
124
125
  page,
125
126
  q: (query || "").trim()
126
127
  };
127
- reqOptions.params = ParamHelper.getParams(opts, reqOptions);
128
128
  try {
129
129
  if (opts.isMock) {
130
130
  await new Promise((resolve) => {
@@ -1,8 +1,5 @@
1
- import { type OptionalParams } from 'js-file-downloader';
2
1
  export declare class FileHelper {
3
2
  static toBase64: (file: File) => Promise<string>;
4
3
  static readFileAsync: (file: File) => Promise<string>;
5
4
  static dataURLtoFile: (dataUrl: string, filename: string) => Promise<File>;
6
- static downloadURL: (url: string, filename?: string, params?: OptionalParams) => Promise<any>;
7
- static downloadFromURL: (url: string, filename?: string, params?: OptionalParams) => Promise<any>;
8
5
  }
@@ -1,4 +1,3 @@
1
- import JsFileDownloader from "js-file-downloader";
2
1
  export class FileHelper {
3
2
  static toBase64 = async (file) => {
4
3
  return new Promise((resolve, reject) => {
@@ -27,32 +26,4 @@ export class FileHelper {
27
26
  const blob = await res.blob();
28
27
  return new File([blob], filename, { type: "image/png" });
29
28
  };
30
- static downloadURL = async (url, filename = "", params = {}) => {
31
- const getExtension = () => {
32
- return url.split("?")[0].split(".").pop();
33
- };
34
- let finalFilename = filename && `${filename.trim().toLowerCase().replaceAll(" ", "-")}`;
35
- if (getExtension()) {
36
- finalFilename = `${finalFilename}.${getExtension()}`;
37
- }
38
- return new JsFileDownloader({
39
- url,
40
- filename: finalFilename,
41
- ...params
42
- });
43
- };
44
- static downloadFromURL = async (url, filename = "", params = {}) => {
45
- const getExtension = () => {
46
- return url.split("?")[0].split(".").pop();
47
- };
48
- let finalFilename = filename && `${filename.trim().toLowerCase().replaceAll(" ", "-")}`;
49
- if (getExtension()) {
50
- finalFilename = `${finalFilename}.${getExtension()}`;
51
- }
52
- return new JsFileDownloader({
53
- url,
54
- filename: finalFilename,
55
- ...params
56
- });
57
- };
58
29
  }
@@ -13,7 +13,58 @@ export class TimeHelper {
13
13
  newDateStr = addYears(dateStr, 543);
14
14
  }
15
15
  if (isThaiMonth) {
16
- options.locale = import("date-fns/locale/th");
16
+ options.locale = {
17
+ localize: {
18
+ code: "th",
19
+ month: (n) => {
20
+ const monthValues = {
21
+ narrow: [
22
+ "\u0E21.\u0E04.",
23
+ "\u0E01.\u0E1E.",
24
+ "\u0E21\u0E35.\u0E04.",
25
+ "\u0E40\u0E21.\u0E22.",
26
+ "\u0E1E.\u0E04.",
27
+ "\u0E21\u0E34.\u0E22.",
28
+ "\u0E01.\u0E04.",
29
+ "\u0E2A.\u0E04.",
30
+ "\u0E01.\u0E22.",
31
+ "\u0E15.\u0E04.",
32
+ "\u0E1E.\u0E22.",
33
+ "\u0E18.\u0E04."
34
+ ],
35
+ abbreviated: [
36
+ "\u0E21.\u0E04.",
37
+ "\u0E01.\u0E1E.",
38
+ "\u0E21\u0E35.\u0E04.",
39
+ "\u0E40\u0E21.\u0E22.",
40
+ "\u0E1E.\u0E04.",
41
+ "\u0E21\u0E34.\u0E22.",
42
+ "\u0E01.\u0E04.",
43
+ "\u0E2A.\u0E04.",
44
+ "\u0E01.\u0E22.",
45
+ "\u0E15.\u0E04.",
46
+ "\u0E1E.\u0E22.",
47
+ "\u0E18.\u0E04."
48
+ ],
49
+ wide: [
50
+ "\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21",
51
+ "\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C",
52
+ "\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21",
53
+ "\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19",
54
+ "\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21",
55
+ "\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19",
56
+ "\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21",
57
+ "\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21",
58
+ "\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19",
59
+ "\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21",
60
+ "\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19",
61
+ "\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21"
62
+ ]
63
+ };
64
+ return monthValues.abbreviated[n - 1];
65
+ }
66
+ }
67
+ };
17
68
  }
18
69
  return format(newDateStr, formatStr, options);
19
70
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.4.46",
3
+ "version": "1.4.48",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",
@@ -42,7 +42,6 @@
42
42
  "axios": "^1.6.5",
43
43
  "date-fns": "^3.2.0",
44
44
  "i18next": "^23.7.16",
45
- "js-file-downloader": "^1.1.25",
46
45
  "lodash-es": "^4.17.21",
47
46
  "nuxt-security": "^1.0.0",
48
47
  "pinia": "^2.1.7",