@appcorp/stellar-solutions-invoice-module 0.1.1 → 0.1.3
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/invoice/constants.js +3 -3
- package/base-modules/invoice/invoice.js +2 -2
- package/package.json +1 -1
- package/base-modules/product/actions.d.ts +0 -113
- package/base-modules/product/actions.js +0 -22
- package/base-modules/product/constants.d.ts +0 -33
- package/base-modules/product/constants.js +0 -204
- package/base-modules/product/context.d.ts +0 -10
- package/base-modules/product/context.js +0 -557
- package/base-modules/product/drawer.d.ts +0 -8
- package/base-modules/product/drawer.js +0 -19
- package/base-modules/product/form-elements.d.ts +0 -2
- package/base-modules/product/form-elements.js +0 -41
- package/base-modules/product/form.d.ts +0 -8
- package/base-modules/product/form.js +0 -107
- package/base-modules/product/product.d.ts +0 -10
- package/base-modules/product/product.js +0 -80
- package/base-modules/product/reducer.d.ts +0 -4
- package/base-modules/product/reducer.js +0 -88
- package/base-modules/product/types.d.ts +0 -87
- package/base-modules/product/types.js +0 -28
- package/base-modules/product/validate.d.ts +0 -36
- package/base-modules/product/validate.js +0 -17
- package/base-modules/product-category/actions.d.ts +0 -90
- package/base-modules/product-category/actions.js +0 -19
- package/base-modules/product-category/constants.d.ts +0 -28
- package/base-modules/product-category/constants.js +0 -74
- package/base-modules/product-category/context.d.ts +0 -10
- package/base-modules/product-category/context.js +0 -390
- package/base-modules/product-category/drawer.d.ts +0 -8
- package/base-modules/product-category/drawer.js +0 -19
- package/base-modules/product-category/form-elements.d.ts +0 -2
- package/base-modules/product-category/form-elements.js +0 -41
- package/base-modules/product-category/form.d.ts +0 -8
- package/base-modules/product-category/form.js +0 -81
- package/base-modules/product-category/product-category.d.ts +0 -10
- package/base-modules/product-category/product-category.js +0 -53
- package/base-modules/product-category/reducer.d.ts +0 -4
- package/base-modules/product-category/reducer.js +0 -73
- package/base-modules/product-category/types.d.ts +0 -59
- package/base-modules/product-category/types.js +0 -11
- package/base-modules/product-category/validate.d.ts +0 -12
- package/base-modules/product-category/validate.js +0 -11
|
@@ -385,9 +385,9 @@ exports.staticProductSection = (_d = {},
|
|
|
385
385
|
],
|
|
386
386
|
_d);
|
|
387
387
|
exports.INVOICE_API_ROUTES = {
|
|
388
|
-
INVOICES: '/api/invoices',
|
|
389
|
-
INVOICE: '/api/invoice',
|
|
390
|
-
INVOICE_BY_ID: '/api/invoice/invoice-by-id',
|
|
388
|
+
INVOICES: '/api/quotes-invoices',
|
|
389
|
+
INVOICE: '/api/quote-invoice',
|
|
390
|
+
INVOICE_BY_ID: '/api/quote-invoice/quote-invoice-by-id',
|
|
391
391
|
};
|
|
392
392
|
exports.tableBodyCols = [
|
|
393
393
|
{
|
|
@@ -18,7 +18,7 @@ require("slick-carousel/slick/slick-theme.css");
|
|
|
18
18
|
var InvoicePage = function () {
|
|
19
19
|
var _a = (0, context_1.useInvoiceStateContext)(), count = _a.count, currentPage = _a.currentPage, pageLimit = _a.pageLimit, handleNextClick = _a.handleNextClick, handlePreviousClick = _a.handlePreviousClick,
|
|
20
20
|
// toggleDrawerOpen,
|
|
21
|
-
headerActions = _a.headerActions, handlePageLimit = _a.handlePageLimit, searchQuery = _a.searchQuery, searchOnChange = _a.searchOnChange, rowActions = _a.rowActions, invoices = _a.invoices;
|
|
21
|
+
headerActions = _a.headerActions, handlePageLimit = _a.handlePageLimit, searchQuery = _a.searchQuery, searchOnChange = _a.searchOnChange, rowActions = _a.rowActions, invoices = _a.invoices, listLoading = _a.listLoading;
|
|
22
22
|
var t = (0, next_intl_1.useTranslations)('invoicePage');
|
|
23
23
|
var translationMap = {
|
|
24
24
|
formLabelName: 'formLabelName',
|
|
@@ -83,7 +83,7 @@ var InvoicePage = function () {
|
|
|
83
83
|
];
|
|
84
84
|
var totalPagePerRecord = (0, util_functions_1.calculatePages)(count, pageLimit);
|
|
85
85
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
86
|
-
react_1.default.createElement(vista_table_v1_1.VistaTableV1, { currentPage: count, isNextDisabled: (0, util_functions_1.isNextButtonDisabled)(currentPage, totalPagePerRecord), isPreviousDisabled: (0, util_functions_1.isPreviousButtonDisabled)(currentPage), handleNextOnClick: handleNextClick, handlePreviousOnClick: handlePreviousClick, tableDescription: t('subTitle'), tableHeading: t('title'), totalPages: totalPagePerRecord, headerActions: headerActions, handleOnSelect: function () { return handlePageLimit; }, selectKey1: "label", nodeSelectKey: "pageLimit", selectedItem: { label: String(pageLimit) }, listOptions: (0, util_functions_1.getAvailablePageLimits)(count), searchEnabled: true, searchValue: searchQuery, searchPlaceholder: "Enter ID or Name...", searchDisabled: false, searchId: "inventory-search", handleSearchInput: searchOnChange, loading:
|
|
86
|
+
react_1.default.createElement(vista_table_v1_1.VistaTableV1, { currentPage: count, isNextDisabled: (0, util_functions_1.isNextButtonDisabled)(currentPage, totalPagePerRecord), isPreviousDisabled: (0, util_functions_1.isPreviousButtonDisabled)(currentPage), handleNextOnClick: handleNextClick, handlePreviousOnClick: handlePreviousClick, tableDescription: t('subTitle'), tableHeading: t('title'), totalPages: totalPagePerRecord, headerActions: headerActions, handleOnSelect: function () { return handlePageLimit; }, selectKey1: "label", nodeSelectKey: "pageLimit", selectedItem: { label: String(pageLimit) }, listOptions: (0, util_functions_1.getAvailablePageLimits)(count), searchEnabled: true, searchValue: searchQuery, searchPlaceholder: "Enter ID or Name...", searchDisabled: false, searchId: "inventory-search", handleSearchInput: searchOnChange, loading: listLoading, pageLimit: pageLimit, rowActions: rowActions, tableBodyCols: constants_1.tableBodyCols, tableBodyRows: invoices, tableHeadItems: tableHeadItems }),
|
|
87
87
|
react_1.default.createElement(drawer_1.Drawer, { translationMap: translationMap }),
|
|
88
88
|
react_1.default.createElement(generate_toast_1.VistaToaster, null)));
|
|
89
89
|
};
|
package/package.json
CHANGED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { ProductCategoryBE } from '@react-pakistan/util-functions/api/stellar-solutions/type';
|
|
2
|
-
import { PRODUCT_DRAWER, PRODUCT_MODAL, ProductTypeBE } from './types';
|
|
3
|
-
export declare enum PRODUCT_ACTION_TYPES {
|
|
4
|
-
CLEAR_ERRORS = "CLEAR_ERRORS",
|
|
5
|
-
RESET_FORM = "RESET_FORM",
|
|
6
|
-
SET_COUNT = "SET_COUNT",
|
|
7
|
-
SET_CURRENT_PAGE = "SET_CURRENT_PAGE",
|
|
8
|
-
SET_DISABLE_SAVE_BUTTON = "SET_DISABLE_SAVE_BUTTON",
|
|
9
|
-
SET_DRAWER = "SET_DRAWER",
|
|
10
|
-
SET_ERRORS = "SET_ERRORS",
|
|
11
|
-
SET_FORM = "SET_FORM",
|
|
12
|
-
SET_INPUT_FIELD = "SET_INPUT_FIELD",
|
|
13
|
-
SET_INPUT_IMAGES = "SET_INPUT_IMAGES",
|
|
14
|
-
SET_MODAL = "SET_MODAL",
|
|
15
|
-
SET_PAGE_LIMIT = "SET_PAGE_LIMIT",
|
|
16
|
-
SET_PRODUCTS = "SET_PRODUCTS",
|
|
17
|
-
SET_PRODUCT_CATEGORIES = "SET_PRODUCT_CATEGORIES",
|
|
18
|
-
SET_PRODUCT_CATEGORY_QUERY = "SET_PRODUCT_CATEGORY_QUERY",
|
|
19
|
-
SET_SEARCH_QUERY = "SET_SEARCH_QUERY"
|
|
20
|
-
}
|
|
21
|
-
export type ClearErrorAction = {
|
|
22
|
-
type: PRODUCT_ACTION_TYPES.CLEAR_ERRORS;
|
|
23
|
-
};
|
|
24
|
-
export type ResetFormAction = {
|
|
25
|
-
type: PRODUCT_ACTION_TYPES.RESET_FORM;
|
|
26
|
-
};
|
|
27
|
-
export type SetCountAction = {
|
|
28
|
-
type: PRODUCT_ACTION_TYPES.SET_COUNT;
|
|
29
|
-
payload: {
|
|
30
|
-
count: number;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
export type SetDisableSaveButtonAction = {
|
|
34
|
-
type: PRODUCT_ACTION_TYPES.SET_DISABLE_SAVE_BUTTON;
|
|
35
|
-
payload: {
|
|
36
|
-
disableSaveButton: boolean;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
export type SetCurrentPageAction = {
|
|
40
|
-
type: PRODUCT_ACTION_TYPES.SET_CURRENT_PAGE;
|
|
41
|
-
payload: {
|
|
42
|
-
currentPage: number;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
export type SetErrorsAction = {
|
|
46
|
-
type: PRODUCT_ACTION_TYPES.SET_ERRORS;
|
|
47
|
-
payload: {
|
|
48
|
-
[key: string]: string;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
export type SetInputFieldAction = {
|
|
52
|
-
type: PRODUCT_ACTION_TYPES.SET_INPUT_FIELD;
|
|
53
|
-
payload: {
|
|
54
|
-
key: keyof ProductTypeBE;
|
|
55
|
-
value: string | string[] | boolean | number | number[];
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export type SetInputImagesAction = {
|
|
59
|
-
type: PRODUCT_ACTION_TYPES.SET_INPUT_IMAGES;
|
|
60
|
-
payload: {
|
|
61
|
-
key: keyof ProductTypeBE;
|
|
62
|
-
value: string[];
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
export type SetPageLimitAction = {
|
|
66
|
-
type: PRODUCT_ACTION_TYPES.SET_PAGE_LIMIT;
|
|
67
|
-
payload: {
|
|
68
|
-
pageLimit: number;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
export type SetProductsAction = {
|
|
72
|
-
type: PRODUCT_ACTION_TYPES.SET_PRODUCTS;
|
|
73
|
-
payload: {
|
|
74
|
-
products: ProductTypeBE[];
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
export type SetSearchQueryAction = {
|
|
78
|
-
type: PRODUCT_ACTION_TYPES.SET_SEARCH_QUERY;
|
|
79
|
-
payload: {
|
|
80
|
-
searchQuery: string;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
export type SetFormAction = {
|
|
84
|
-
type: PRODUCT_ACTION_TYPES.SET_FORM;
|
|
85
|
-
payload: {
|
|
86
|
-
form: ProductTypeBE;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
export type SetDrawerAction = {
|
|
90
|
-
type: PRODUCT_ACTION_TYPES.SET_DRAWER;
|
|
91
|
-
payload: {
|
|
92
|
-
drawer: PRODUCT_DRAWER | null;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
export type SetModalAction = {
|
|
96
|
-
type: PRODUCT_ACTION_TYPES.SET_MODAL;
|
|
97
|
-
payload: {
|
|
98
|
-
modal: PRODUCT_MODAL | null;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
export type SetProductCategoryQueryAction = {
|
|
102
|
-
type: PRODUCT_ACTION_TYPES.SET_PRODUCT_CATEGORY_QUERY;
|
|
103
|
-
payload: {
|
|
104
|
-
productCategoryQuery: string;
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
export type SetProductCategoriesAction = {
|
|
108
|
-
type: PRODUCT_ACTION_TYPES.SET_PRODUCT_CATEGORIES;
|
|
109
|
-
payload: {
|
|
110
|
-
productCategories: ProductCategoryBE[];
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
export type ProductActions = SetInputFieldAction | ClearErrorAction | ResetFormAction | SetErrorsAction | SetCurrentPageAction | SetDisableSaveButtonAction | SetPageLimitAction | SetSearchQueryAction | SetProductsAction | SetCountAction | SetFormAction | SetDrawerAction | SetModalAction | SetInputImagesAction | SetProductCategoryQueryAction | SetProductCategoriesAction;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PRODUCT_ACTION_TYPES = void 0;
|
|
4
|
-
var PRODUCT_ACTION_TYPES;
|
|
5
|
-
(function (PRODUCT_ACTION_TYPES) {
|
|
6
|
-
PRODUCT_ACTION_TYPES["CLEAR_ERRORS"] = "CLEAR_ERRORS";
|
|
7
|
-
PRODUCT_ACTION_TYPES["RESET_FORM"] = "RESET_FORM";
|
|
8
|
-
PRODUCT_ACTION_TYPES["SET_COUNT"] = "SET_COUNT";
|
|
9
|
-
PRODUCT_ACTION_TYPES["SET_CURRENT_PAGE"] = "SET_CURRENT_PAGE";
|
|
10
|
-
PRODUCT_ACTION_TYPES["SET_DISABLE_SAVE_BUTTON"] = "SET_DISABLE_SAVE_BUTTON";
|
|
11
|
-
PRODUCT_ACTION_TYPES["SET_DRAWER"] = "SET_DRAWER";
|
|
12
|
-
PRODUCT_ACTION_TYPES["SET_ERRORS"] = "SET_ERRORS";
|
|
13
|
-
PRODUCT_ACTION_TYPES["SET_FORM"] = "SET_FORM";
|
|
14
|
-
PRODUCT_ACTION_TYPES["SET_INPUT_FIELD"] = "SET_INPUT_FIELD";
|
|
15
|
-
PRODUCT_ACTION_TYPES["SET_INPUT_IMAGES"] = "SET_INPUT_IMAGES";
|
|
16
|
-
PRODUCT_ACTION_TYPES["SET_MODAL"] = "SET_MODAL";
|
|
17
|
-
PRODUCT_ACTION_TYPES["SET_PAGE_LIMIT"] = "SET_PAGE_LIMIT";
|
|
18
|
-
PRODUCT_ACTION_TYPES["SET_PRODUCTS"] = "SET_PRODUCTS";
|
|
19
|
-
PRODUCT_ACTION_TYPES["SET_PRODUCT_CATEGORIES"] = "SET_PRODUCT_CATEGORIES";
|
|
20
|
-
PRODUCT_ACTION_TYPES["SET_PRODUCT_CATEGORY_QUERY"] = "SET_PRODUCT_CATEGORY_QUERY";
|
|
21
|
-
PRODUCT_ACTION_TYPES["SET_SEARCH_QUERY"] = "SET_SEARCH_QUERY";
|
|
22
|
-
})(PRODUCT_ACTION_TYPES || (exports.PRODUCT_ACTION_TYPES = PRODUCT_ACTION_TYPES = {}));
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { VISTA_TABLE_CELL_TYPE } from '@appcorp/app-corp-vista/type/vista-table-type';
|
|
2
|
-
import { VistaFormElements } from '@appcorp/app-corp-vista/type/vista-form-elements';
|
|
3
|
-
export declare const pageLimit: number;
|
|
4
|
-
export declare const DEFAULT_RANGES: {
|
|
5
|
-
totalRange: number[];
|
|
6
|
-
};
|
|
7
|
-
export declare const formInfo: {
|
|
8
|
-
buyPrice: string;
|
|
9
|
-
salePrice: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const staticFormElements: VistaFormElements;
|
|
12
|
-
export declare const PRODUCT_API_ROUTES: {
|
|
13
|
-
PRODUCTS: string;
|
|
14
|
-
PRODUCT: string;
|
|
15
|
-
PRODUCT_BY_ID: string;
|
|
16
|
-
};
|
|
17
|
-
export declare const tableBodyCols: ({
|
|
18
|
-
componentType: VISTA_TABLE_CELL_TYPE;
|
|
19
|
-
key: string;
|
|
20
|
-
} | {
|
|
21
|
-
componentType: VISTA_TABLE_CELL_TYPE;
|
|
22
|
-
key: string[];
|
|
23
|
-
})[];
|
|
24
|
-
export declare const messages: {
|
|
25
|
-
buyPrice: string;
|
|
26
|
-
currency: string;
|
|
27
|
-
error: string;
|
|
28
|
-
name: string;
|
|
29
|
-
productCategoryId: string;
|
|
30
|
-
quantity: string;
|
|
31
|
-
salePrice: string;
|
|
32
|
-
success: string;
|
|
33
|
-
};
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
"use strict";
|
|
3
|
-
var _a;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.messages = exports.tableBodyCols = exports.PRODUCT_API_ROUTES = exports.staticFormElements = exports.formInfo = exports.DEFAULT_RANGES = exports.pageLimit = void 0;
|
|
6
|
-
var form_schema_1 = require("@appcorp/app-corp-vista/utils/form-schema");
|
|
7
|
-
var vista_table_type_1 = require("@appcorp/app-corp-vista/type/vista-table-type");
|
|
8
|
-
exports.pageLimit = Number(process.env.NEXT_PUBLIC_PAGE_LIMIT);
|
|
9
|
-
exports.DEFAULT_RANGES = {
|
|
10
|
-
totalRange: [10, 3000],
|
|
11
|
-
};
|
|
12
|
-
exports.formInfo = {
|
|
13
|
-
buyPrice: 'The price incurred to manufacture or acquire the unit of this product.',
|
|
14
|
-
salePrice: 'The price at which this product is being sold in the market.'
|
|
15
|
-
};
|
|
16
|
-
exports.staticFormElements = (_a = {},
|
|
17
|
-
_a[form_schema_1.VISTA_FORM_ELEMENTS.TEXT_INPUT_V1] = [
|
|
18
|
-
{
|
|
19
|
-
enabled: true,
|
|
20
|
-
error: '',
|
|
21
|
-
handleOnChange: function () { return void 0; },
|
|
22
|
-
id: 'name',
|
|
23
|
-
label: 'formLabelName',
|
|
24
|
-
order: 1,
|
|
25
|
-
placeholder: 'Name goes here...',
|
|
26
|
-
required: true,
|
|
27
|
-
type: 'text',
|
|
28
|
-
value: '',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
enabled: true,
|
|
32
|
-
error: '',
|
|
33
|
-
handleOnChange: function () { return void 0; },
|
|
34
|
-
id: 'buyPrice',
|
|
35
|
-
info: exports.formInfo.buyPrice,
|
|
36
|
-
label: 'formLabelBuyPrice',
|
|
37
|
-
order: 2,
|
|
38
|
-
placeholder: 'Buy Price goes here...',
|
|
39
|
-
required: true,
|
|
40
|
-
type: 'text',
|
|
41
|
-
value: '',
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
enabled: true,
|
|
45
|
-
error: '',
|
|
46
|
-
handleOnChange: function () { return void 0; },
|
|
47
|
-
id: 'salePrice',
|
|
48
|
-
info: exports.formInfo.salePrice,
|
|
49
|
-
label: 'formLabelSalePrice',
|
|
50
|
-
order: 3,
|
|
51
|
-
placeholder: 'Sale Price goes here...',
|
|
52
|
-
required: true,
|
|
53
|
-
type: 'text',
|
|
54
|
-
value: '',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
enabled: true,
|
|
58
|
-
error: '',
|
|
59
|
-
handleOnChange: function () { return void 0; },
|
|
60
|
-
id: 'quantity',
|
|
61
|
-
label: 'formLabelQuantity',
|
|
62
|
-
order: 4,
|
|
63
|
-
placeholder: 'Quantity goes here...',
|
|
64
|
-
required: true,
|
|
65
|
-
type: 'text',
|
|
66
|
-
value: '',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
enabled: true,
|
|
70
|
-
error: '',
|
|
71
|
-
handleOnChange: function () { return void 0; },
|
|
72
|
-
id: 'ref',
|
|
73
|
-
label: 'formLabelRef',
|
|
74
|
-
order: 6,
|
|
75
|
-
placeholder: 'Ref goes here...',
|
|
76
|
-
required: false,
|
|
77
|
-
type: 'text',
|
|
78
|
-
value: '',
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
_a[form_schema_1.VISTA_FORM_ELEMENTS.TEXT_AREA_V1] = [
|
|
82
|
-
{
|
|
83
|
-
enabled: true,
|
|
84
|
-
error: '',
|
|
85
|
-
handleOnChange: function () { return void 0; },
|
|
86
|
-
id: 'description',
|
|
87
|
-
label: 'formLabelDescription',
|
|
88
|
-
order: 7,
|
|
89
|
-
placeholder: 'Description goes here...',
|
|
90
|
-
required: false,
|
|
91
|
-
value: '',
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
_a[form_schema_1.VISTA_FORM_ELEMENTS.SELECT_V1] = [
|
|
95
|
-
{
|
|
96
|
-
enabled: true,
|
|
97
|
-
handleOnChange: function () { return void 0; },
|
|
98
|
-
label: 'formLabelCurrency',
|
|
99
|
-
listItems: [{ id: 'currency-1', option: 'PKR' }, { id: 'currency-2', option: 'CAD' }],
|
|
100
|
-
nodeSelectKey: 'currency',
|
|
101
|
-
order: 5,
|
|
102
|
-
required: true,
|
|
103
|
-
selectKey1: 'option',
|
|
104
|
-
selectedItem: { option: 'PKR' },
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
_a[form_schema_1.VISTA_FORM_ELEMENTS.DIVIDER_V4] = [
|
|
108
|
-
{
|
|
109
|
-
enabled: true,
|
|
110
|
-
label: 'Relationship',
|
|
111
|
-
order: 9,
|
|
112
|
-
}
|
|
113
|
-
],
|
|
114
|
-
_a[form_schema_1.VISTA_FORM_ELEMENTS.UPLOAD_V1] = [
|
|
115
|
-
{
|
|
116
|
-
disabled: false,
|
|
117
|
-
enabled: true,
|
|
118
|
-
fileInfo: 'JPG, PNG, WEBP - 1MB max',
|
|
119
|
-
handleClearImage: function () { return void 0; },
|
|
120
|
-
handleOnChange: function () { return void 0; },
|
|
121
|
-
id: 'attachments',
|
|
122
|
-
imageUrls: [],
|
|
123
|
-
label: 'formLabelImage',
|
|
124
|
-
multiple: true,
|
|
125
|
-
order: 8,
|
|
126
|
-
required: false,
|
|
127
|
-
type: 'file',
|
|
128
|
-
},
|
|
129
|
-
],
|
|
130
|
-
_a[form_schema_1.VISTA_FORM_ELEMENTS.COMBOBOX_V1] = [
|
|
131
|
-
{
|
|
132
|
-
disabled: false,
|
|
133
|
-
enabled: true,
|
|
134
|
-
handleInputOnChange: function () { return void 0; },
|
|
135
|
-
handleOnBlur: function () { return void 0; },
|
|
136
|
-
handleOnChange: function () { return void 0; },
|
|
137
|
-
label: 'formLabelProductCategory',
|
|
138
|
-
listItems: [{ id: 'category-1', option: 'Category1' }, { id: 'category-2', option: 'Category2' }],
|
|
139
|
-
nodeQueryKey: '',
|
|
140
|
-
nodeSelectKey: 'productCategoryId',
|
|
141
|
-
order: 11,
|
|
142
|
-
query: '',
|
|
143
|
-
selectKey1: 'option',
|
|
144
|
-
selectedItem: { id: 'category-2' },
|
|
145
|
-
},
|
|
146
|
-
],
|
|
147
|
-
_a);
|
|
148
|
-
exports.PRODUCT_API_ROUTES = {
|
|
149
|
-
PRODUCTS: '/api/products',
|
|
150
|
-
PRODUCT: '/api/product',
|
|
151
|
-
PRODUCT_BY_ID: '/api/product/product-by-id',
|
|
152
|
-
};
|
|
153
|
-
exports.tableBodyCols = [
|
|
154
|
-
{
|
|
155
|
-
componentType: vista_table_type_1.VISTA_TABLE_CELL_TYPE.ID,
|
|
156
|
-
key: 'id',
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
componentType: vista_table_type_1.VISTA_TABLE_CELL_TYPE.BOLD_TEXT,
|
|
160
|
-
key: 'name',
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
componentType: vista_table_type_1.VISTA_TABLE_CELL_TYPE.TEXT,
|
|
164
|
-
key: 'description',
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
componentType: vista_table_type_1.VISTA_TABLE_CELL_TYPE.TEXT,
|
|
168
|
-
key: 'currency',
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
componentType: vista_table_type_1.VISTA_TABLE_CELL_TYPE.TEXT,
|
|
172
|
-
key: 'salePrice',
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
componentType: vista_table_type_1.VISTA_TABLE_CELL_TYPE.TEXT,
|
|
176
|
-
key: 'buyPrice',
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
componentType: vista_table_type_1.VISTA_TABLE_CELL_TYPE.OBJECT,
|
|
180
|
-
key: ['productCategory', 'name'],
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
componentType: vista_table_type_1.VISTA_TABLE_CELL_TYPE.TEXT,
|
|
184
|
-
key: 'ref',
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
componentType: vista_table_type_1.VISTA_TABLE_CELL_TYPE.TEXT,
|
|
188
|
-
key: 'quantity',
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
componentType: vista_table_type_1.VISTA_TABLE_CELL_TYPE.ACTIONS,
|
|
192
|
-
key: 'action',
|
|
193
|
-
},
|
|
194
|
-
];
|
|
195
|
-
exports.messages = {
|
|
196
|
-
buyPrice: 'Buy Price should be more than 1 unit',
|
|
197
|
-
currency: 'Please select a currency unit for this product',
|
|
198
|
-
error: 'Error occurred, please try again',
|
|
199
|
-
name: 'Product category name is required',
|
|
200
|
-
productCategoryId: 'Product Category Id is required',
|
|
201
|
-
quantity: 'Quantity should be more than 1 unit',
|
|
202
|
-
salePrice: 'Sale Price should be more than 1 unit',
|
|
203
|
-
success: 'Operation successful!',
|
|
204
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, { FC, ReactNode } from 'react';
|
|
2
|
-
import { ProductContextType, ProductState } from './types';
|
|
3
|
-
type State = ProductContextType & ProductState;
|
|
4
|
-
interface StateProviderProps {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const ProductStateContext: React.Context<State>;
|
|
8
|
-
export declare const ProductStateContextProvider: FC<StateProviderProps>;
|
|
9
|
-
export declare const useProductStateContext: () => State;
|
|
10
|
-
export {};
|