@finema/core 1.4.77 → 1.4.79

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.77",
3
+ "version": "1.4.79",
4
4
  "configKey": "core",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.7.4"
package/dist/module.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineNuxtModule, createResolver, installModule, addPlugin, addComponentsDir, addImportsDir } from '@nuxt/kit';
2
2
 
3
3
  const name = "@finema/core";
4
- const version = "1.4.77";
4
+ const version = "1.4.79";
5
5
 
6
6
  const colors = {
7
7
  black: "#20243E",
@@ -18,6 +18,13 @@
18
18
  v-bind="getFieldBinding(option)"
19
19
  v-on="option.on ?? {}"
20
20
  />
21
+ <FormInputNumber
22
+ v-else-if="option.type === INPUT_TYPES.NUMBER"
23
+ :class="option.class"
24
+ :form="form"
25
+ v-bind="getFieldBinding(option)"
26
+ v-on="option.on ?? {}"
27
+ />
21
28
  <FormInputText
22
29
  v-else-if="option.type === INPUT_TYPES.PASSWORD"
23
30
  :class="option.class"
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <UInput
4
+ v-model.number="value"
5
+ type="number"
6
+ :disabled="wrapperProps.isDisabled"
7
+ :leading-icon="leadingIcon"
8
+ :trailing-icon="trailingIcon"
9
+ :name="name"
10
+ :placeholder="wrapperProps.placeholder"
11
+ :autofocus="!!autoFocus"
12
+ :icon="icon"
13
+ :readonly="isReadonly"
14
+ :ui="_deepMerge({}, ui, { icon: { trailing: { pointer: '' } } })"
15
+ />
16
+ </FieldWrapper>
17
+ </template>
18
+ <script lang="ts" setup>
19
+ import { _deepMerge } from '#imports'
20
+ import { useFieldHOC } from '#core/composables/useForm'
21
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
22
+ import type { INumberFieldProps } from '#core/components/Form/InputNumber/types'
23
+
24
+ const props = withDefaults(defineProps<INumberFieldProps>(), {})
25
+
26
+ const { value, wrapperProps } = useFieldHOC<number>(props)
27
+ </script>
@@ -0,0 +1,10 @@
1
+ import { type IFieldProps, type IFormFieldBase, type INPUT_TYPES } from '#core/components/Form/types';
2
+ export interface INumberFieldProps extends IFieldProps {
3
+ leadingIcon?: any;
4
+ trailingIcon?: any;
5
+ icon?: string;
6
+ }
7
+ export type INumberField = IFormFieldBase<INPUT_TYPES.NUMBER, INumberFieldProps, {
8
+ change?: (value: string) => void;
9
+ blur?: (value: string) => void;
10
+ }>;
@@ -3,6 +3,12 @@
3
3
  <UInput
4
4
  v-if="type === 'password'"
5
5
  v-model="value"
6
+ v-maska:[maskOptions]
7
+ :data-maska="mask"
8
+ :data-maska-tokens="maskTokens"
9
+ :data-maska-tokens-replace="maskTokensReplace"
10
+ :data-maska-reversed="maskReversed"
11
+ :data-maska-eager="maskEager"
6
12
  :disabled="wrapperProps.isDisabled"
7
13
  :leading-icon="leadingIcon"
8
14
  :trailing-icon="trailingIcon"
@@ -27,6 +33,12 @@
27
33
  <UInput
28
34
  v-else
29
35
  v-model="value"
36
+ v-maska:[maskOptions]
37
+ :data-maska="mask"
38
+ :data-maska-tokens="maskTokens"
39
+ :data-maska-tokens-replace="maskTokensReplace"
40
+ :data-maska-reversed="maskReversed"
41
+ :data-maska-eager="maskEager"
30
42
  :disabled="wrapperProps.isDisabled"
31
43
  :leading-icon="leadingIcon"
32
44
  :trailing-icon="trailingIcon"
@@ -45,6 +57,7 @@ import { _deepMerge, ref } from '#imports'
45
57
  import { type ITextFieldProps } from '#core/components/Form/InputText/types'
46
58
  import { useFieldHOC } from '#core/composables/useForm'
47
59
  import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
60
+ import { vMaska } from 'maska'
48
61
 
49
62
  const props = withDefaults(defineProps<ITextFieldProps>(), {})
50
63
 
@@ -1,9 +1,16 @@
1
1
  import { type IFieldProps, type IFormFieldBase, type INPUT_TYPES } from '#core/components/Form/types';
2
+ import type { MaskInputOptions, MaskTokens, MaskType } from 'maska';
2
3
  export interface ITextFieldProps extends IFieldProps {
3
4
  type?: 'text' | 'password' | 'email';
4
5
  leadingIcon?: any;
5
6
  trailingIcon?: any;
6
7
  icon?: string;
8
+ mask?: MaskType;
9
+ maskOptions?: MaskInputOptions;
10
+ maskTokens?: MaskTokens | string;
11
+ maskEager?: boolean;
12
+ maskTokensReplace?: boolean;
13
+ maskReversed?: boolean;
7
14
  }
8
15
  export type ITextField = IFormFieldBase<INPUT_TYPES.TEXT | INPUT_TYPES.PASSWORD | INPUT_TYPES.EMAIL, ITextFieldProps, {
9
16
  change?: (value: string) => void;
@@ -12,8 +12,10 @@ import { type IUploadFileClassicField } from '#core/components/Form/InputUploadF
12
12
  import { type IUploadFileField } from '#core/components/Form/InputUploadFileClassicAuto/types';
13
13
  import { type IUploadDropzoneField } from '#core/components/Form/InputUploadDropzone/types';
14
14
  import { type IUploadDropzoneAutoField } from '#core/components/Form/InputUploadDropzoneAuto/types';
15
+ import type { INumberField } from '#core/components/Form/InputNumber/types';
15
16
  export declare const enum INPUT_TYPES {
16
17
  TEXT = "TEXT",
18
+ NUMBER = "NUMBER",
17
19
  TEXTAREA = "TEXTAREA",
18
20
  PASSWORD = "PASSWORD",
19
21
  EMAIL = "EMAIL",
@@ -56,4 +58,4 @@ export interface IFormFieldBase<I extends INPUT_TYPES, P extends IFieldProps, O>
56
58
  props: P;
57
59
  on?: O;
58
60
  }
59
- export type IFormField = ITextField | IStaticField | ICheckboxField | IRadioField | ISelectField | IToggleField | ITextareaField | IDateTimeField | IUploadFileClassicField | IUploadFileField | IUploadDropzoneField | IUploadDropzoneAutoField;
61
+ export type IFormField = ITextField | INumberField | IStaticField | ICheckboxField | IRadioField | ISelectField | IToggleField | ITextareaField | IDateTimeField | IUploadFileClassicField | IUploadFileField | IUploadDropzoneField | IUploadDropzoneAutoField;
@@ -1,5 +1,6 @@
1
1
  export var INPUT_TYPES = /* @__PURE__ */ ((INPUT_TYPES2) => {
2
2
  INPUT_TYPES2["TEXT"] = "TEXT";
3
+ INPUT_TYPES2["NUMBER"] = "NUMBER";
3
4
  INPUT_TYPES2["TEXTAREA"] = "TEXTAREA";
4
5
  INPUT_TYPES2["PASSWORD"] = "PASSWORD";
5
6
  INPUT_TYPES2["EMAIL"] = "EMAIL";
@@ -3,10 +3,12 @@ import z from "zod";
3
3
  import { zodI18nMap } from "zod-i18n-map";
4
4
  import i18next from "i18next";
5
5
  import en from "zod-i18n-map/locales/en/zod.json";
6
+ import { vMaska } from "maska";
6
7
  export default defineNuxtPlugin((nuxtApp) => {
7
8
  if (process.env.NODE_ENV !== "production") {
8
9
  console.log("Plugin injected by @finema/core module!");
9
10
  }
11
+ nuxtApp.vueApp.directive("maska", vMaska);
10
12
  i18next.init({
11
13
  lng: "th",
12
14
  resources: {
package/package.json CHANGED
@@ -1,88 +1,89 @@
1
- {
2
- "name": "@finema/core",
3
- "version": "1.4.77",
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.10.3",
37
- "@nuxt/ui": "^2.14.0",
38
- "@pinia/nuxt": "^0.5.1",
39
- "@vee-validate/nuxt": "^4.12.5",
40
- "@vee-validate/zod": "^4.12.5",
41
- "@vuepic/vue-datepicker": "^8.1.1",
42
- "axios": "^1.6.7",
43
- "date-fns": "^3.3.1",
44
- "i18next": "^23.10.0",
45
- "nuxt-security": "^1.2.0",
46
- "pinia": "^2.1.7",
47
- "qrcode.vue": "^3.4.1",
48
- "url-join": "^5.0.0",
49
- "zod": "^3.22.4",
50
- "nuxt-lodash": "^2.5.3",
51
- "zod-i18n-map": "^2.27.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.5",
58
- "@nuxt/schema": "^3.10.3",
59
- "@nuxt/test-utils": "^3.11.0",
60
- "@release-it/conventional-changelog": "^8.0.1",
61
- "@types/node": "^20.10.17",
62
- "@vue/test-utils": "^2.4.3",
63
- "changelogen": "^0.5.5",
64
- "eslint": "^8.56.0",
65
- "happy-dom": "^13.0.0",
66
- "husky": "^8.0.3",
67
- "lint-staged": "^15.2.0",
68
- "nuxt": "^3.10.3",
69
- "playwright-core": "^1.40.1",
70
- "prettier": "^3.1.1",
71
- "release-it": "^17.0.1",
72
- "sass": "^1.69.5",
73
- "stylelint": "^16.1.0",
74
- "stylelint-config-prettier-scss": "^1.0.0",
75
- "stylelint-config-standard-scss": "^13.0.0",
76
- "vitest": "^1.2.2",
77
- "vue": "3.4.8"
78
- },
79
- "lint-staged": {
80
- "*.{ts,vue,tsx,js}": "eslint --fix --cache",
81
- "*.{html,json}": "prettier --write"
82
- },
83
- "pnpm": {
84
- "overrides": {
85
- "vue": "3.4.8"
86
- }
87
- }
88
- }
1
+ {
2
+ "name": "@finema/core",
3
+ "version": "1.4.79",
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.10.3",
37
+ "@nuxt/ui": "^2.14.0",
38
+ "@pinia/nuxt": "^0.5.1",
39
+ "@vee-validate/nuxt": "^4.12.5",
40
+ "@vee-validate/zod": "^4.12.5",
41
+ "@vuepic/vue-datepicker": "^8.1.1",
42
+ "axios": "^1.6.7",
43
+ "date-fns": "^3.3.1",
44
+ "i18next": "^23.10.0",
45
+ "maska": "^2.1.11",
46
+ "nuxt-lodash": "^2.5.3",
47
+ "nuxt-security": "^1.2.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.27.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.5",
59
+ "@nuxt/schema": "^3.10.3",
60
+ "@nuxt/test-utils": "^3.11.0",
61
+ "@release-it/conventional-changelog": "^8.0.1",
62
+ "@types/node": "^20.10.17",
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.10.3",
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.2.2",
78
+ "vue": "3.4.8"
79
+ },
80
+ "lint-staged": {
81
+ "*.{ts,vue,tsx,js}": "eslint --fix --cache",
82
+ "*.{html,json}": "prettier --write"
83
+ },
84
+ "pnpm": {
85
+ "overrides": {
86
+ "vue": "3.4.8"
87
+ }
88
+ }
89
+ }