@appcorp/stellar-solutions-invoice-module 0.1.6 → 0.1.7
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.
|
@@ -87,7 +87,7 @@ exports.staticCompanySection = (_a = {},
|
|
|
87
87
|
handleOnChange: function () { return void 0; },
|
|
88
88
|
label: 'Company',
|
|
89
89
|
listItems: [],
|
|
90
|
-
nodeQueryKey: '',
|
|
90
|
+
nodeQueryKey: 'companyQuery',
|
|
91
91
|
nodeSelectKey: 'companyId',
|
|
92
92
|
order: 1,
|
|
93
93
|
query: '',
|
|
@@ -107,8 +107,8 @@ exports.staticCompanySection = (_a = {},
|
|
|
107
107
|
order: 4,
|
|
108
108
|
query: '',
|
|
109
109
|
required: true,
|
|
110
|
-
selectKey1: '
|
|
111
|
-
selectedItem: {
|
|
110
|
+
selectKey1: 'option',
|
|
111
|
+
selectedItem: { option: 'PKR' },
|
|
112
112
|
},
|
|
113
113
|
// {
|
|
114
114
|
// enabled: false,
|
|
@@ -519,7 +519,7 @@ var useInvoiceState = function () {
|
|
|
519
519
|
});
|
|
520
520
|
};
|
|
521
521
|
var dynamicCompanyFormElements = (0, react_1.useMemo)(function () {
|
|
522
|
-
var _a, _b
|
|
522
|
+
var _a, _b;
|
|
523
523
|
var elements = __assign({}, constants_1.staticCompanySection);
|
|
524
524
|
var textInputElements = (_a = elements[form_schema_1.VISTA_FORM_ELEMENTS.TEXT_INPUT_V1]) === null || _a === void 0 ? void 0 : _a.sort(function (a, b) { return a.order - b.order; });
|
|
525
525
|
if (textInputElements) {
|
|
@@ -533,51 +533,17 @@ var useInvoiceState = function () {
|
|
|
533
533
|
textInputElements[2].handleOnChange = handleChange;
|
|
534
534
|
textInputElements[2].error = state.errors.note;
|
|
535
535
|
textInputElements[3].value = state.ref || (0, util_functions_1.generateRef)({ refLength: 5 });
|
|
536
|
-
var comboboxElements_1 = (_b = elements[form_schema_1.VISTA_FORM_ELEMENTS.COMBOBOX_V1]) === null || _b === void 0 ? void 0 : _b.sort(function (a, b) { return a.order - b.order; });
|
|
537
|
-
if (comboboxElements_1) {
|
|
538
|
-
comboboxElements_1[0].selectedItem = {};
|
|
539
|
-
comboboxElements_1[0].listItems = companies;
|
|
540
|
-
}
|
|
541
|
-
return elements;
|
|
542
|
-
}
|
|
543
|
-
var textAreaElements = (_c = elements[form_schema_1.VISTA_FORM_ELEMENTS.TEXT_AREA_V1]) === null || _c === void 0 ? void 0 : _c.sort(function (a, b) { return a.order - b.order; });
|
|
544
|
-
if (textAreaElements) {
|
|
545
|
-
textAreaElements === null || textAreaElements === void 0 ? void 0 : textAreaElements.forEach(function (_a, i) {
|
|
546
|
-
var id = _a.id;
|
|
547
|
-
textAreaElements[i].value = state[id];
|
|
548
|
-
textAreaElements[i].handleOnChange = handleChange;
|
|
549
|
-
textAreaElements[i].error = state.errors.description;
|
|
550
|
-
});
|
|
551
536
|
}
|
|
552
|
-
var
|
|
553
|
-
if (selectElements) {
|
|
554
|
-
selectElements === null || selectElements === void 0 ? void 0 : selectElements.forEach(function (_a, i) {
|
|
555
|
-
var nodeSelectKey = _a.nodeSelectKey;
|
|
556
|
-
selectElements[i].handleOnChange = handleSelectChange;
|
|
557
|
-
selectElements[i].selectedItem = { option: state[nodeSelectKey] };
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
var comboboxElements = (_e = elements[form_schema_1.VISTA_FORM_ELEMENTS.COMBOBOX_V1]) === null || _e === void 0 ? void 0 : _e.sort(function (a, b) { return a.order - b.order; });
|
|
537
|
+
var comboboxElements = (_b = elements[form_schema_1.VISTA_FORM_ELEMENTS.COMBOBOX_V1]) === null || _b === void 0 ? void 0 : _b.sort(function (a, b) { return a.order - b.order; });
|
|
561
538
|
if (comboboxElements) {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}
|
|
571
|
-
var uploadElements = (_f = elements[form_schema_1.VISTA_FORM_ELEMENTS.UPLOAD_V1]) === null || _f === void 0 ? void 0 : _f.sort(function (a, b) { return a.order - b.order; });
|
|
572
|
-
if (uploadElements) {
|
|
573
|
-
// uploadElements?.forEach((_, i) => {
|
|
574
|
-
// uploadElements[i].imageUrls = state.images;
|
|
575
|
-
// uploadElements[i].handleOnChange = handleFileChange;
|
|
576
|
-
// uploadElements[i].handleClearImage = () => dispatch({
|
|
577
|
-
// type: INVOICE_ACTION_TYPES.SET_INPUT_FIELD,
|
|
578
|
-
// payload: { key: 'images', value: [] },
|
|
579
|
-
// });
|
|
580
|
-
// });
|
|
539
|
+
comboboxElements[0].selectedItem = { id: state.companyId };
|
|
540
|
+
comboboxElements[0].listItems = companies;
|
|
541
|
+
comboboxElements[0].query = state.companyQuery;
|
|
542
|
+
comboboxElements[0].handleOnChange = handleSelectChange;
|
|
543
|
+
comboboxElements[0].handleInputOnChange = handleChange;
|
|
544
|
+
comboboxElements[0].handleOnBlur = handleChange;
|
|
545
|
+
comboboxElements[1].selectedItem = { option: state.currency };
|
|
546
|
+
comboboxElements[1].listItems = [];
|
|
581
547
|
}
|
|
582
548
|
return elements;
|
|
583
549
|
}, [state, handleChange, companies]);
|