@appcorp/stellar-solutions-invoice-module 0.1.61 → 0.1.62
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/base-modules/payment/form.js +14 -23
- package/i18n/navigation.d.ts +4 -4
- package/package.json +7 -5
|
@@ -21,16 +21,14 @@ var next_intl_1 = require("next-intl");
|
|
|
21
21
|
var input_1 = require("@appcorp/shadcn/components/input");
|
|
22
22
|
var textarea_1 = require("@appcorp/shadcn/components/textarea");
|
|
23
23
|
var combobox_1 = require("@appcorp/shadcn/components/combobox");
|
|
24
|
+
var enhanced_dropzone_1 = require("@appcorp/shadcn/components/enhanced-dropzone");
|
|
24
25
|
var context_1 = require("./context");
|
|
25
|
-
var context_2 = require("@appcorp/stellar-solutions-modules/global-modules/
|
|
26
|
-
var context_3 = require("@appcorp/stellar-solutions-modules/global-modules/payment-mode/context");
|
|
27
|
-
var types_1 = require("./types");
|
|
26
|
+
var context_2 = require("@appcorp/stellar-solutions-modules/global-modules/payment-mode/context");
|
|
28
27
|
var PaymentForm = function (_a) {
|
|
29
28
|
var isRTL = _a.isRTL;
|
|
30
29
|
var t = (0, next_intl_1.useTranslations)("payment");
|
|
31
30
|
var _b = (0, context_1.usePaymentStateContext)(), amount = _b.amount, attachment = _b.attachment, balance = _b.balance, currency = _b.currency, date = _b.date, description = _b.description, errors = _b.errors, handleChange = _b.handleChange, paymentModeId = _b.paymentModeId, paymentType = _b.paymentType, ref = _b.ref;
|
|
32
|
-
var
|
|
33
|
-
var _c = (0, context_3.usePaymentModeStateContext)(), paymentModes = _c.paymentModes, paymentModesLoading = _c.listLoading;
|
|
31
|
+
var _c = (0, context_2.usePaymentModeStateContext)(), paymentModes = _c.paymentModes, paymentModesLoading = _c.listLoading;
|
|
34
32
|
// Helper function to translate validation error keys
|
|
35
33
|
var getTranslatedError = function (key) {
|
|
36
34
|
if (!errors[key])
|
|
@@ -54,27 +52,15 @@ var PaymentForm = function (_a) {
|
|
|
54
52
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
55
53
|
react_1.default.createElement(input_1.Input, { id: "amount", type: "text", label: t("formLabelAmount"), value: amount || "", onChange: function (e) { return handleChange("amount", e.target.value); }, placeholder: t("formPlaceholderAmount"), info: t("formInfoAmount"), error: getTranslatedError("amount"), required: true })),
|
|
56
54
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
57
|
-
react_1.default.createElement(input_1.Input, { id: "balance", type: "text", label: t("formLabelBalance"), value: balance || "", onChange: function (e) { return handleChange("balance", e.target.value); }, placeholder: t("formPlaceholderBalance"), info: t("formInfoBalance"), error: getTranslatedError("balance") })),
|
|
55
|
+
react_1.default.createElement(input_1.Input, { id: "balance", type: "text", label: t("formLabelBalance"), value: balance || "", onChange: function (e) { return handleChange("balance", e.target.value); }, placeholder: t("formPlaceholderBalance"), info: t("formInfoBalance"), error: getTranslatedError("balance"), required: true })),
|
|
58
56
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
59
|
-
react_1.default.createElement(
|
|
60
|
-
{
|
|
61
|
-
label: t("paymentTypeFullAmount"),
|
|
62
|
-
value: types_1.PAYMENT_TYPE.FULL_AMOUNT,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
label: t("paymentTypePartialAmount"),
|
|
66
|
-
value: types_1.PAYMENT_TYPE.PARTIAL_AMOUNT,
|
|
67
|
-
},
|
|
68
|
-
], placeholder: t("formPlaceholderPaymentType"), info: t("formInfoPaymentType"), error: getTranslatedError("paymentType"), required: true })),
|
|
57
|
+
react_1.default.createElement(input_1.Input, { id: "paymentType", type: "text", label: t("formLabelPaymentType"), value: paymentType || "", readOnly: true, placeholder: t("formPlaceholderPaymentType"), info: t("formInfoPaymentType"), error: getTranslatedError("paymentType"), required: true })),
|
|
69
58
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
70
|
-
react_1.default.createElement(
|
|
71
|
-
label: "".concat(c.code, " - ").concat(c.label),
|
|
72
|
-
value: c.code,
|
|
73
|
-
}); }), placeholder: t("formPlaceholderCurrency"), info: t("formInfoCurrency"), error: getTranslatedError("currency"), required: true })),
|
|
59
|
+
react_1.default.createElement(input_1.Input, { id: "currency", type: "text", label: t("formLabelCurrency"), value: currency || "", readOnly: true, placeholder: t("formPlaceholderCurrency"), info: t("formInfoCurrency"), error: getTranslatedError("currency"), required: true })),
|
|
74
60
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
75
61
|
react_1.default.createElement(combobox_1.Combobox, { id: "paymentModeId", label: t("formLabelPaymentMode"), value: paymentModeId || "", onValueChange: function (value) { return handleChange("paymentModeId", value); }, loading: paymentModesLoading, options: (paymentModes || [])
|
|
76
|
-
.slice()
|
|
77
|
-
.filter(
|
|
62
|
+
// .slice()
|
|
63
|
+
// .filter((mode) => mode.enabled)
|
|
78
64
|
.sort(function (a, b) { return a.label.localeCompare(b.label); })
|
|
79
65
|
.map(function (mode) { return ({
|
|
80
66
|
label: mode.label,
|
|
@@ -83,7 +69,12 @@ var PaymentForm = function (_a) {
|
|
|
83
69
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
84
70
|
react_1.default.createElement(input_1.Input, { id: "ref", type: "text", label: t("formLabelRef"), value: ref || "", onChange: function (e) { return handleChange("ref", e.target.value); }, placeholder: t("formPlaceholderRef"), info: t("formInfoRef"), error: getTranslatedError("ref") })),
|
|
85
71
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
86
|
-
react_1.default.createElement(
|
|
72
|
+
react_1.default.createElement(enhanced_dropzone_1.EnhancedDropzone, { id: "attachment", label: t("formLabelAttachment"), value: attachment ? [attachment] : [], onChange: function (files) {
|
|
73
|
+
if (files.length > 0) {
|
|
74
|
+
// Handle file upload - you may want to upload to server and get URL
|
|
75
|
+
handleChange("attachment", files[0].name);
|
|
76
|
+
}
|
|
77
|
+
}, onRemoveRemote: function () { return handleChange("attachment", ""); }, info: t("formInfoAttachment"), error: getTranslatedError("attachment"), maxFiles: 1 })),
|
|
87
78
|
react_1.default.createElement("div", { className: "space-y-2" },
|
|
88
79
|
react_1.default.createElement(textarea_1.Textarea, { id: "description", label: t("formLabelDescription"), value: description || "", onChange: function (e) { return handleChange("description", e.target.value); }, placeholder: t("formPlaceholderDescription"), info: t("formInfoDescription"), error: getTranslatedError("description"), rows: 3 })))));
|
|
89
80
|
};
|
package/i18n/navigation.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare const locales: readonly ["en", "ur"];
|
|
2
2
|
export declare const localePrefix = "as-needed";
|
|
3
3
|
export declare const Link: import("react").ForwardRefExoticComponent<Omit<{
|
|
4
|
+
target?: import("react").HTMLAttributeAnchorTarget | undefined;
|
|
5
|
+
replace?: boolean | undefined;
|
|
6
|
+
id?: string | undefined | undefined;
|
|
4
7
|
slot?: string | undefined | undefined;
|
|
5
8
|
style?: import("react").CSSProperties | undefined;
|
|
6
9
|
title?: string | undefined | undefined;
|
|
@@ -8,14 +11,13 @@ export declare const Link: import("react").ForwardRefExoticComponent<Omit<{
|
|
|
8
11
|
onError?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
9
12
|
children?: import("react").ReactNode;
|
|
10
13
|
ref?: import("react").Ref<HTMLAnchorElement> | undefined;
|
|
11
|
-
replace?: boolean | undefined;
|
|
12
14
|
prefix?: string | undefined | undefined;
|
|
13
15
|
key?: import("react").Key | null | undefined;
|
|
14
16
|
as?: (string | import("url").UrlObject) | undefined;
|
|
15
17
|
scroll?: boolean | undefined;
|
|
16
18
|
shallow?: boolean | undefined;
|
|
17
19
|
passHref?: boolean | undefined;
|
|
18
|
-
prefetch?: boolean | "auto" | null |
|
|
20
|
+
prefetch?: boolean | "auto" | null | undefined;
|
|
19
21
|
legacyBehavior?: boolean | undefined;
|
|
20
22
|
onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
21
23
|
onTouchStart?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
@@ -27,7 +29,6 @@ export declare const Link: import("react").ForwardRefExoticComponent<Omit<{
|
|
|
27
29
|
hrefLang?: string | undefined | undefined;
|
|
28
30
|
media?: string | undefined | undefined;
|
|
29
31
|
ping?: string | undefined | undefined;
|
|
30
|
-
target?: import("react").HTMLAttributeAnchorTarget | undefined;
|
|
31
32
|
type?: string | undefined | undefined;
|
|
32
33
|
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
33
34
|
defaultChecked?: boolean | undefined | undefined;
|
|
@@ -44,7 +45,6 @@ export declare const Link: import("react").ForwardRefExoticComponent<Omit<{
|
|
|
44
45
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
45
46
|
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
46
47
|
hidden?: boolean | undefined | undefined;
|
|
47
|
-
id?: string | undefined | undefined;
|
|
48
48
|
lang?: string | undefined | undefined;
|
|
49
49
|
nonce?: string | undefined | undefined;
|
|
50
50
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appcorp/stellar-solutions-invoice-module",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.62",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"automate": "./automate.sh",
|
|
6
6
|
"build": "yarn clean && yarn build:ts && cp package.json lib && cp README.md lib && cp yarn.lock lib",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"upgrade:own": "ncu -f '@appcorp/app-corp-vista, @appcorp/shadcn, @appcorp/stellar-solutions-company-module, @appcorp/stellar-solutions-modules, @appcorp/stellar-solutions-product-module, @react-pakistan/util-functions' -u"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@appcorp/app-corp-vista": "^0.3.
|
|
23
|
-
"@appcorp/shadcn": "^1.0.
|
|
22
|
+
"@appcorp/app-corp-vista": "^0.3.65",
|
|
23
|
+
"@appcorp/shadcn": "^1.0.38",
|
|
24
24
|
"@appcorp/stellar-solutions-company-module": "^0.1.40",
|
|
25
25
|
"@appcorp/stellar-solutions-modules": "^0.1.63",
|
|
26
|
-
"@appcorp/stellar-solutions-product-module": "^0.2.
|
|
26
|
+
"@appcorp/stellar-solutions-product-module": "^0.2.19",
|
|
27
27
|
"@eslint/eslintrc": "^3",
|
|
28
28
|
"@headlessui/react": "^2",
|
|
29
29
|
"@heroicons/react": "^2",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@radix-ui/react-separator": "^1",
|
|
36
36
|
"@radix-ui/react-slot": "^1",
|
|
37
37
|
"@radix-ui/react-switch": "^1",
|
|
38
|
-
"@react-pakistan/util-functions": "^1.24.
|
|
38
|
+
"@react-pakistan/util-functions": "^1.24.86",
|
|
39
39
|
"@supabase/supabase-js": "^2",
|
|
40
40
|
"@tailwindcss/forms": "^0",
|
|
41
41
|
"@tailwindcss/postcss": "^4",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"cmdk": "^1.1.1",
|
|
48
48
|
"date-fns": "^4",
|
|
49
49
|
"dayjs": "^1",
|
|
50
|
+
"embla-carousel-react": "^8.6.0",
|
|
50
51
|
"eslint": "^9",
|
|
51
52
|
"eslint-config-next": "^15",
|
|
52
53
|
"husky": "^9",
|
|
@@ -58,6 +59,7 @@
|
|
|
58
59
|
"react": "^19",
|
|
59
60
|
"react-copy-to-clipboard": "^5",
|
|
60
61
|
"react-dom": "^19",
|
|
62
|
+
"react-dropzone": "^14.3.8",
|
|
61
63
|
"react-hot-toast": "^2",
|
|
62
64
|
"react-photo-view": "^1",
|
|
63
65
|
"react-slick": "^0",
|