@feedmepos/mf-financing 0.0.8 → 0.0.20-dev

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.
@@ -2,5 +2,5 @@ import { type Financing } from "@/model/financing";
2
2
  type __VLS_Props = {
3
3
  financing: Financing;
4
4
  };
5
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
6
  export default _default;
@@ -0,0 +1,13 @@
1
+ import type { ValidationRule } from "@feedmepos/ui-library";
2
+ type __VLS_Props = {
3
+ modelValue: File | null;
4
+ label?: string;
5
+ rules?: ValidationRule[];
6
+ labelMark?: "required" | "optional" | "none";
7
+ };
8
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
+ "update:modelValue": (value: File | null) => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ "onUpdate:modelValue"?: ((value: File | null) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import type { ValidationRule } from "@feedmepos/ui-library";
2
+ type __VLS_Props = {
3
+ modelValue: File | null;
4
+ label?: string;
5
+ accept?: string;
6
+ rules?: ValidationRule[];
7
+ labelMark?: "required" | "optional" | "none";
8
+ };
9
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
10
+ "update:modelValue": (value: File | null) => any;
11
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
+ "onUpdate:modelValue"?: ((value: File | null) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ export default _default;
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-financing",
3
- "version": "0.0.8",
3
+ "version": "0.0.20-dev",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
+ "engines": {
9
+ "node": ">=24.5.0",
10
+ "pnpm": "10.29.2"
11
+ },
8
12
  "module": "./dist/app.js",
9
13
  "exports": {
10
14
  ".": {
@@ -13,21 +17,6 @@
13
17
  },
14
18
  "./style": "./dist/style.css"
15
19
  },
16
- "scripts": {
17
- "lint": "eslint --ext .ts,vue --ignore-path .gitignore . --fix",
18
- "dev": "vite --mode dev",
19
- "prod": "vite --mode prod",
20
- "preview": "vite preview",
21
- "test": "jest",
22
- "build:dts": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.app.json --outDir ./dist && mv ./dist/src/* dist",
23
- "build-types": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.app.json --outDir dist --composite false",
24
- "build:mf:dev": "vite build --mode fmmf:dev",
25
- "build:mf:prod": "vite build --mode fmmf:prod",
26
- "build-only:dev": "yarn build:mf:dev && yarn build:dts && yarn build-types && cp package.json ./dist",
27
- "build-only:prod": "yarn build:mf:prod && yarn build:dts && yarn build-types && cp package.json ./dist",
28
- "deploy:dev": "npm publish --@feedmepos:registry=https://registry.npmjs.org/ --access public --tag beta --no-git-checks .",
29
- "deploy:prod": "npm publish --@feedmepos:registry=https://registry.npmjs.org/ --access public --tag beta --no-git-checks ."
30
- },
31
20
  "dependencies": {
32
21
  "@casl/ability": "^3.2.0",
33
22
  "@feedmepos/core": "^2.6.0",
@@ -36,6 +25,7 @@
36
25
  "axios": "^0.27.2",
37
26
  "buffer": "^6.0.3",
38
27
  "change-case": "^4.1.2",
28
+ "dayjs": "^1.11.19",
39
29
  "dinero.js": "^1.9.1",
40
30
  "dotenv": "^16.0.3",
41
31
  "file-saver": "^2.0.5",
@@ -53,6 +43,7 @@
53
43
  "pinia": "^2.1.7",
54
44
  "qrcode.vue": "^3.6.0",
55
45
  "rasterizehtml": "^1.3.1",
46
+ "sentence-case": "^4.0.0",
56
47
  "uuid": "^9.0.0",
57
48
  "vue": "^3.2.25",
58
49
  "vue-advanced-cropper": "^2.8.6",
@@ -97,5 +88,20 @@
97
88
  "typescript": "~5.4.0",
98
89
  "vite": "^5.2.11",
99
90
  "vue-tsc": "^2.0.11"
91
+ },
92
+ "scripts": {
93
+ "lint": "eslint --ext .ts,vue --ignore-path .gitignore . --fix",
94
+ "dev": "vite --mode dev",
95
+ "prod": "vite --mode prod",
96
+ "preview": "vite preview",
97
+ "test": "jest",
98
+ "build:dts": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.app.json --outDir ./dist && mv ./dist/src/* dist",
99
+ "build-types": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.app.json --outDir dist --composite false",
100
+ "build:mf:dev": "vite build --mode fmmf:dev",
101
+ "build:mf:prod": "vite build --mode fmmf:prod",
102
+ "build:dev": "pnpm build:mf:dev && pnpm build:dts && pnpm build-types && cp package.json ./dist",
103
+ "build:prod": "pnpm build:mf:prod && pnpm build:dts && pnpm build-types && cp package.json ./dist",
104
+ "deploy:dev": "npm publish --@feedmepos:registry=https://registry.npmjs.org/ --access public --tag beta --no-git-checks .",
105
+ "deploy:prod": "npm publish --@feedmepos:registry=https://registry.npmjs.org/ --access public --tag beta --no-git-checks ."
100
106
  }
101
107
  }
@@ -1,45 +0,0 @@
1
- import { defineComponent as p, resolveComponent as i, openBlock as a, createElementBlock as c, createVNode as r, createElementVNode as d, renderSlot as u } from "vue";
2
- import "@feedmepos/ui-library";
3
- const k = {
4
- key: 0,
5
- class: "flex items-center justify-center min-h-[80vh]"
6
- }, b = {
7
- key: 1,
8
- class: "m-6"
9
- }, f = { class: "bg-white fm-corner-radius-md p-6" }, v = /* @__PURE__ */ p({
10
- __name: "Layout",
11
- props: {
12
- loading: { type: Boolean },
13
- title: {},
14
- description: {},
15
- onBack: { type: Function },
16
- actions: {}
17
- },
18
- setup(g) {
19
- return (e, t) => {
20
- const l = i("FmCircularProgress"), m = i("FmPageHead");
21
- return e.loading ? (a(), c("div", k, [
22
- r(l, { size: "xxl" })
23
- ])) : (a(), c("div", b, [
24
- r(m, {
25
- class: "flex-grow mb-6",
26
- title: e.title,
27
- description: e.description,
28
- "back-button": !!e.onBack,
29
- actions: e.actions && e.actions.map((n, o) => ({ ...n, value: `cta-${o}` })),
30
- "onClick:back": e.onBack,
31
- "onClick:action": t[0] || (t[0] = (n) => {
32
- var o, s;
33
- return (s = (o = e.actions) == null ? void 0 : o.at(parseInt(n.substring(4)))) == null ? void 0 : s.fn();
34
- })
35
- }, null, 8, ["title", "description", "back-button", "actions", "onClick:back"]),
36
- d("div", f, [
37
- u(e.$slots, "default")
38
- ])
39
- ]));
40
- };
41
- }
42
- });
43
- export {
44
- v as _
45
- };
@@ -1,164 +0,0 @@
1
- import { defineComponent as P, ref as f, computed as x, resolveComponent as m, openBlock as q, createBlock as E, unref as a, withCtx as p, createElementVNode as r, toDisplayString as c, createVNode as t } from "vue";
2
- import { _ as A } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
3
- import { useI18n as F } from "@feedmepos/mf-common";
4
- import { useRouter as k } from "vue-router";
5
- const C = { class: "max-w-3xl" }, U = { class: "mb-8" }, B = { class: "text-lg font-medium text-fm-color-typo-primary mb-4 pb-2 border-b border-fm-color-neutral-gray-200" }, D = { class: "grid grid-cols-1 md:grid-cols-2 gap-4" }, S = { class: "mb-8" }, T = { class: "text-lg font-medium text-fm-color-typo-primary mb-4 pb-2 border-b border-fm-color-neutral-gray-200" }, j = { class: "grid grid-cols-1 md:grid-cols-2 gap-4" }, w = { class: "mb-8" }, $ = { class: "text-lg font-medium text-fm-color-typo-primary mb-4 pb-2 border-b border-fm-color-neutral-gray-200" }, M = { class: "grid grid-cols-1 md:grid-cols-2 gap-4" }, R = { class: "flex justify-end gap-4 pt-4 border-t border-fm-color-neutral-gray-200" }, I = { class: "text-lg font-medium" }, O = { class: "text-fm-color-typo-secondary mb-6" }, z = { class: "flex justify-end gap-3" }, W = /* @__PURE__ */ P({
6
- __name: "Submission",
7
- setup(G) {
8
- const b = k(), { t: e } = F(), l = f({
9
- businessName: "",
10
- registrationNumber: "",
11
- contactName: "",
12
- contactEmail: "",
13
- contactPhone: "",
14
- loanAmount: void 0,
15
- loanPurpose: ""
16
- }), o = f({}), u = f(!1), v = x(() => l.value.businessName && l.value.registrationNumber && l.value.contactName && l.value.contactEmail && l.value.contactPhone && l.value.loanAmount && l.value.loanAmount > 0 && l.value.loanPurpose);
17
- function y() {
18
- return o.value = {}, l.value.businessName || (o.value.businessName = e("financing.apply.errors.required")), l.value.registrationNumber || (o.value.registrationNumber = e("financing.apply.errors.required")), l.value.contactName || (o.value.contactName = e("financing.apply.errors.required")), l.value.contactEmail ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l.value.contactEmail) || (o.value.contactEmail = e("financing.apply.errors.invalidEmail")) : o.value.contactEmail = e("financing.apply.errors.required"), l.value.contactPhone || (o.value.contactPhone = e("financing.apply.errors.required")), (!l.value.loanAmount || l.value.loanAmount <= 0) && (o.value.loanAmount = e("financing.apply.errors.invalidAmount")), l.value.loanPurpose || (o.value.loanPurpose = e("financing.apply.errors.required")), Object.keys(o.value).length === 0;
19
- }
20
- function h() {
21
- y() && (u.value = !0);
22
- }
23
- function N() {
24
- u.value = !1, b.push({ name: "mf-financing-application" });
25
- }
26
- function g() {
27
- b.push({ name: "mf-financing-application" });
28
- }
29
- return (H, n) => {
30
- const s = m("FmTextField"), _ = m("FmTextarea"), d = m("FmButton"), V = m("FmDialog");
31
- return q(), E(A, {
32
- title: a(e)("financing.apply.title"),
33
- description: a(e)("financing.apply.description"),
34
- "on-back": g,
35
- loading: !1
36
- }, {
37
- default: p(() => [
38
- r("div", C, [
39
- r("div", U, [
40
- r("h3", B, c(a(e)("financing.apply.sections.business")), 1),
41
- r("div", D, [
42
- t(s, {
43
- modelValue: l.value.businessName,
44
- "onUpdate:modelValue": n[0] || (n[0] = (i) => l.value.businessName = i),
45
- label: a(e)("financing.apply.fields.businessName"),
46
- placeholder: a(e)("financing.apply.fields.businessNamePlaceholder"),
47
- error: o.value.businessName,
48
- required: ""
49
- }, null, 8, ["modelValue", "label", "placeholder", "error"]),
50
- t(s, {
51
- modelValue: l.value.registrationNumber,
52
- "onUpdate:modelValue": n[1] || (n[1] = (i) => l.value.registrationNumber = i),
53
- label: a(e)("financing.apply.fields.registrationNumber"),
54
- placeholder: a(e)("financing.apply.fields.registrationNumberPlaceholder"),
55
- error: o.value.registrationNumber,
56
- required: ""
57
- }, null, 8, ["modelValue", "label", "placeholder", "error"])
58
- ])
59
- ]),
60
- r("div", S, [
61
- r("h3", T, c(a(e)("financing.apply.sections.contact")), 1),
62
- r("div", j, [
63
- t(s, {
64
- modelValue: l.value.contactName,
65
- "onUpdate:modelValue": n[2] || (n[2] = (i) => l.value.contactName = i),
66
- label: a(e)("financing.apply.fields.contactName"),
67
- placeholder: a(e)("financing.apply.fields.contactNamePlaceholder"),
68
- error: o.value.contactName,
69
- required: ""
70
- }, null, 8, ["modelValue", "label", "placeholder", "error"]),
71
- t(s, {
72
- modelValue: l.value.contactEmail,
73
- "onUpdate:modelValue": n[3] || (n[3] = (i) => l.value.contactEmail = i),
74
- label: a(e)("financing.apply.fields.contactEmail"),
75
- placeholder: a(e)("financing.apply.fields.contactEmailPlaceholder"),
76
- error: o.value.contactEmail,
77
- required: ""
78
- }, null, 8, ["modelValue", "label", "placeholder", "error"]),
79
- t(s, {
80
- modelValue: l.value.contactPhone,
81
- "onUpdate:modelValue": n[4] || (n[4] = (i) => l.value.contactPhone = i),
82
- label: a(e)("financing.apply.fields.contactPhone"),
83
- placeholder: a(e)("financing.apply.fields.contactPhonePlaceholder"),
84
- error: o.value.contactPhone,
85
- required: "",
86
- class: "md:col-span-2"
87
- }, null, 8, ["modelValue", "label", "placeholder", "error"])
88
- ])
89
- ]),
90
- r("div", w, [
91
- r("h3", $, c(a(e)("financing.apply.sections.loan")), 1),
92
- r("div", M, [
93
- t(s, {
94
- modelValue: l.value.loanAmount,
95
- "onUpdate:modelValue": n[5] || (n[5] = (i) => l.value.loanAmount = i),
96
- modelModifiers: { number: !0 },
97
- label: a(e)("financing.apply.fields.loanAmount"),
98
- placeholder: a(e)("financing.apply.fields.loanAmountPlaceholder"),
99
- error: o.value.loanAmount,
100
- type: "number",
101
- prefix: "RM",
102
- required: ""
103
- }, null, 8, ["modelValue", "label", "placeholder", "error"]),
104
- t(_, {
105
- modelValue: l.value.loanPurpose,
106
- "onUpdate:modelValue": n[6] || (n[6] = (i) => l.value.loanPurpose = i),
107
- label: a(e)("financing.apply.fields.loanPurpose"),
108
- placeholder: a(e)("financing.apply.fields.loanPurposePlaceholder"),
109
- error: o.value.loanPurpose,
110
- required: "",
111
- class: "md:col-span-2"
112
- }, null, 8, ["modelValue", "label", "placeholder", "error"])
113
- ])
114
- ]),
115
- r("div", R, [
116
- t(d, {
117
- variant: "secondary",
118
- label: a(e)("financing.apply.buttons.cancel"),
119
- onClick: g
120
- }, null, 8, ["label"]),
121
- t(d, {
122
- variant: "primary",
123
- label: a(e)("financing.apply.buttons.submit"),
124
- disabled: !v.value,
125
- onClick: h
126
- }, null, 8, ["label", "disabled"])
127
- ])
128
- ]),
129
- t(V, {
130
- modelValue: u.value,
131
- "onUpdate:modelValue": n[8] || (n[8] = (i) => u.value = i)
132
- }, {
133
- "dialog-button": p(() => n[9] || (n[9] = [
134
- r("span", null, null, -1)
135
- ])),
136
- "dialog-header": p(() => [
137
- r("div", I, c(a(e)("financing.apply.confirm.title")), 1)
138
- ]),
139
- default: p(() => [
140
- r("p", O, c(a(e)("financing.apply.confirm.message")), 1),
141
- r("div", z, [
142
- t(d, {
143
- variant: "secondary",
144
- label: a(e)("financing.apply.confirm.cancel"),
145
- onClick: n[7] || (n[7] = (i) => u.value = !1)
146
- }, null, 8, ["label"]),
147
- t(d, {
148
- variant: "primary",
149
- label: a(e)("financing.apply.confirm.confirm"),
150
- onClick: N
151
- }, null, 8, ["label"])
152
- ])
153
- ]),
154
- _: 1
155
- }, 8, ["modelValue"])
156
- ]),
157
- _: 1
158
- }, 8, ["title", "description"]);
159
- };
160
- }
161
- });
162
- export {
163
- W as default
164
- };