@finema/core 1.4.36 → 1.4.38

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.36",
3
+ "version": "1.4.38",
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.36";
5
+ const version = "1.4.38";
6
6
 
7
7
  const colors = {
8
8
  black: "#20243E",
@@ -105,7 +105,6 @@
105
105
  v-else-if="option.type === INPUT_TYPES.UPLOAD_DROPZONE"
106
106
  :class="option.class"
107
107
  :form="form"
108
- :request-options="option.props.requestOptions"
109
108
  v-bind="getFieldBinding(option)"
110
109
  v-on="option.on ?? {}"
111
110
  />
@@ -3,9 +3,11 @@
3
3
  <UInput
4
4
  v-model="value"
5
5
  :disabled="wrapperProps.isDisabled"
6
+ :leading-icon="leadingIcon"
7
+ :trailing-icon="trailingIcon"
6
8
  :name="name"
7
9
  :placeholder="wrapperProps.placeholder"
8
- :type="isShowPassword ? 'text' : props.type || 'text'"
10
+ :type="isShowPassword ? 'text' : type || 'text'"
9
11
  :autofocus="!!autoFocus"
10
12
  :icon="icon"
11
13
  :readonly="isReadonly"
@@ -1,8 +1,8 @@
1
1
  import { type IFieldProps, type IFormFieldBase, type INPUT_TYPES } from '#core/components/Form/types';
2
2
  export interface ITextFieldProps extends IFieldProps {
3
3
  type?: 'text' | 'password' | 'email';
4
- prependIcon?: any;
5
- appendIcon?: any;
4
+ leadingIcon?: any;
5
+ trailingIcon?: any;
6
6
  icon?: string;
7
7
  }
8
8
  export type ITextField = IFormFieldBase<INPUT_TYPES.TEXT | INPUT_TYPES.PASSWORD | INPUT_TYPES.EMAIL, ITextFieldProps, {
@@ -1,5 +1,8 @@
1
+ import { type OptionalParams } from 'js-file-downloader';
1
2
  export declare class FileHelper {
2
3
  static toBase64: (file: File) => Promise<string>;
3
4
  static readFileAsync: (file: File) => Promise<string>;
4
5
  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>;
5
8
  }
@@ -1,3 +1,4 @@
1
+ import JsFileDownloader from "js-file-downloader";
1
2
  export class FileHelper {
2
3
  static toBase64 = async (file) => {
3
4
  return new Promise((resolve, reject) => {
@@ -26,4 +27,32 @@ export class FileHelper {
26
27
  const blob = await res.blob();
27
28
  return new File([blob], filename, { type: "image/png" });
28
29
  };
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
+ };
29
58
  }
package/package.json CHANGED
@@ -1,86 +1,87 @@
1
- {
2
- "name": "@finema/core",
3
- "version": "1.4.36",
4
- "repository": "https://gitlab.finema.co/finema/ui-kit",
5
- "license": "MIT",
6
- "author": "Finema Dev Core Team",
7
- "type": "module",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/types.d.ts",
11
- "import": "./dist/module.mjs",
12
- "require": "./dist/module.cjs"
13
- }
14
- },
15
- "main": "./dist/module.cjs",
16
- "types": "./dist/types.d.ts",
17
- "files": [
18
- "dist"
19
- ],
20
- "engines": {
21
- "node": ">=18.0.0"
22
- },
23
- "scripts": {
24
- "prepack": "nuxt-module-build build",
25
- "dev": "nuxi dev playground",
26
- "dev:build": "nuxi build playground",
27
- "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
28
- "lint": "eslint . --cache",
29
- "lint:fix": "eslint . --fix --cache",
30
- "test": "vitest run",
31
- "test:watch": "vitest watch",
32
- "release": "release-it --ci",
33
- "prepare": "husky install"
34
- },
35
- "dependencies": {
36
- "@nuxt/kit": "^3.7.4",
37
- "@nuxt/ui": "^2.13.0",
38
- "@pinia/nuxt": "^0.5.1",
39
- "@vee-validate/nuxt": "^4.12.4",
40
- "@vee-validate/zod": "^4.12.4",
41
- "@vuepic/vue-datepicker": "^7.4.1",
42
- "axios": "^1.6.5",
43
- "date-fns": "^3.2.0",
44
- "i18next": "^23.7.16",
45
- "lodash-es": "^4.17.21",
46
- "nuxt-security": "^1.0.0",
47
- "pinia": "^2.1.7",
48
- "qrcode.vue": "^3.4.1",
49
- "url-join": "^5.0.0",
50
- "zod": "^3.22.4",
51
- "zod-i18n-map": "^2.25.0"
52
- },
53
- "devDependencies": {
54
- "@finema/eslint-config": "^1.2.0",
55
- "@nuxt/devtools": "latest",
56
- "@nuxt/eslint-config": "^0.2.0",
57
- "@nuxt/module-builder": "^0.5.4",
58
- "@nuxt/schema": "^3.7.4",
59
- "@nuxt/test-utils": "^3.9.0",
60
- "@release-it/conventional-changelog": "^8.0.1",
61
- "@types/lodash-es": "^4.17.12",
62
- "@types/node": "^20.10.8",
63
- "@vue/test-utils": "^2.4.3",
64
- "changelogen": "^0.5.5",
65
- "eslint": "^8.56.0",
66
- "happy-dom": "^13.0.0",
67
- "husky": "^8.0.3",
68
- "lint-staged": "^15.2.0",
69
- "nuxt": "^3.9.1",
70
- "playwright-core": "^1.40.1",
71
- "prettier": "^3.1.1",
72
- "release-it": "^17.0.1",
73
- "sass": "^1.69.5",
74
- "stylelint": "^16.1.0",
75
- "stylelint-config-prettier-scss": "^1.0.0",
76
- "stylelint-config-standard-scss": "^13.0.0",
77
- "vitest": "^1.1.3"
78
- },
79
- "resolutions": {
80
- "vue": "3.3.13"
81
- },
82
- "lint-staged": {
83
- "*.{ts,vue,tsx,js}": "eslint --fix --cache",
84
- "*.{html,json}": "prettier --write"
85
- }
86
- }
1
+ {
2
+ "name": "@finema/core",
3
+ "version": "1.4.38",
4
+ "repository": "https://gitlab.finema.co/finema/ui-kit",
5
+ "license": "MIT",
6
+ "author": "Finema Dev Core Team",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/types.d.ts",
11
+ "import": "./dist/module.mjs",
12
+ "require": "./dist/module.cjs"
13
+ }
14
+ },
15
+ "main": "./dist/module.cjs",
16
+ "types": "./dist/types.d.ts",
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "engines": {
21
+ "node": ">=18.0.0"
22
+ },
23
+ "scripts": {
24
+ "prepack": "nuxt-module-build build",
25
+ "dev": "nuxi dev playground",
26
+ "dev:build": "nuxi build playground",
27
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
28
+ "lint": "eslint . --cache",
29
+ "lint:fix": "eslint . --fix --cache",
30
+ "test": "vitest run",
31
+ "test:watch": "vitest watch",
32
+ "release": "release-it --ci",
33
+ "prepare": "husky install"
34
+ },
35
+ "dependencies": {
36
+ "@nuxt/kit": "^3.7.4",
37
+ "@nuxt/ui": "^2.13.0",
38
+ "@pinia/nuxt": "^0.5.1",
39
+ "@vee-validate/nuxt": "^4.12.4",
40
+ "@vee-validate/zod": "^4.12.4",
41
+ "@vuepic/vue-datepicker": "^7.4.1",
42
+ "axios": "^1.6.5",
43
+ "date-fns": "^3.2.0",
44
+ "i18next": "^23.7.16",
45
+ "js-file-downloader": "^1.1.25",
46
+ "lodash-es": "^4.17.21",
47
+ "nuxt-security": "^1.0.0",
48
+ "pinia": "^2.1.7",
49
+ "qrcode.vue": "^3.4.1",
50
+ "url-join": "^5.0.0",
51
+ "zod": "^3.22.4",
52
+ "zod-i18n-map": "^2.25.0"
53
+ },
54
+ "devDependencies": {
55
+ "@finema/eslint-config": "^1.2.0",
56
+ "@nuxt/devtools": "latest",
57
+ "@nuxt/eslint-config": "^0.2.0",
58
+ "@nuxt/module-builder": "^0.5.4",
59
+ "@nuxt/schema": "^3.7.4",
60
+ "@nuxt/test-utils": "^3.9.0",
61
+ "@release-it/conventional-changelog": "^8.0.1",
62
+ "@types/lodash-es": "^4.17.12",
63
+ "@types/node": "^20.10.8",
64
+ "@vue/test-utils": "^2.4.3",
65
+ "changelogen": "^0.5.5",
66
+ "eslint": "^8.56.0",
67
+ "happy-dom": "^13.0.0",
68
+ "husky": "^8.0.3",
69
+ "lint-staged": "^15.2.0",
70
+ "nuxt": "^3.9.1",
71
+ "playwright-core": "^1.40.1",
72
+ "prettier": "^3.1.1",
73
+ "release-it": "^17.0.1",
74
+ "sass": "^1.69.5",
75
+ "stylelint": "^16.1.0",
76
+ "stylelint-config-prettier-scss": "^1.0.0",
77
+ "stylelint-config-standard-scss": "^13.0.0",
78
+ "vitest": "^1.1.3"
79
+ },
80
+ "resolutions": {
81
+ "vue": "3.3.13"
82
+ },
83
+ "lint-staged": {
84
+ "*.{ts,vue,tsx,js}": "eslint --fix --cache",
85
+ "*.{html,json}": "prettier --write"
86
+ }
87
+ }