@appcorp/stellar-solutions-modules 0.1.34 → 0.1.35

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.
Files changed (157) hide show
  1. package/README.md +128 -19
  2. package/components/theme-switcher.d.ts +4 -0
  3. package/components/theme-switcher.js +60 -0
  4. package/components/ui/badge.d.ts +9 -0
  5. package/components/ui/badge.js +82 -0
  6. package/components/ui/button.d.ts +10 -0
  7. package/components/ui/button.js +91 -0
  8. package/components/ui/checkbox.d.ts +9 -0
  9. package/components/ui/checkbox.js +87 -0
  10. package/components/ui/drawer.d.ts +13 -0
  11. package/components/ui/drawer.js +115 -0
  12. package/components/ui/dropdown-menu.d.ts +25 -0
  13. package/components/ui/dropdown-menu.js +148 -0
  14. package/components/ui/enhanced-table-footer-action.d.ts +34 -0
  15. package/components/ui/enhanced-table-footer-action.js +117 -0
  16. package/components/ui/enhanced-table-footer-page.d.ts +32 -0
  17. package/components/ui/enhanced-table-footer-page.js +140 -0
  18. package/components/ui/enhanced-table-footer-pagination.d.ts +38 -0
  19. package/components/ui/enhanced-table-footer-pagination.js +122 -0
  20. package/components/ui/enhanced-table-header-action.d.ts +7 -0
  21. package/components/ui/enhanced-table-header-action.js +21 -0
  22. package/components/ui/enhanced-table-header-search.d.ts +12 -0
  23. package/components/ui/enhanced-table-header-search.js +17 -0
  24. package/components/ui/enhanced-table.d.ts +65 -0
  25. package/components/ui/enhanced-table.js +87 -0
  26. package/components/ui/input.d.ts +8 -0
  27. package/components/ui/input.js +86 -0
  28. package/components/ui/label.d.ts +7 -0
  29. package/components/ui/label.js +68 -0
  30. package/components/ui/popover.d.ts +7 -0
  31. package/components/ui/popover.js +82 -0
  32. package/components/ui/select.d.ts +15 -0
  33. package/components/ui/select.js +127 -0
  34. package/components/ui/sonner.d.ts +4 -0
  35. package/components/ui/sonner.js +54 -0
  36. package/components/ui/switch.d.ts +9 -0
  37. package/components/ui/switch.js +89 -0
  38. package/components/ui/table.d.ts +10 -0
  39. package/components/ui/table.js +101 -0
  40. package/global-modules/bank/actions.d.ts +200 -0
  41. package/global-modules/bank/actions.js +124 -0
  42. package/global-modules/bank/bank.d.ts +2 -0
  43. package/global-modules/bank/bank.js +87 -0
  44. package/global-modules/bank/constants.d.ts +45 -0
  45. package/global-modules/bank/constants.js +98 -0
  46. package/global-modules/bank/context.d.ts +41 -0
  47. package/global-modules/bank/context.js +419 -0
  48. package/global-modules/bank/drawer.d.ts +31 -0
  49. package/global-modules/bank/drawer.js +114 -0
  50. package/global-modules/bank/form.d.ts +22 -0
  51. package/global-modules/bank/form.js +68 -0
  52. package/global-modules/bank/reducer.d.ts +25 -0
  53. package/global-modules/bank/reducer.js +161 -0
  54. package/global-modules/bank/types.d.ts +217 -0
  55. package/global-modules/bank/types.js +81 -0
  56. package/global-modules/bank/validate.d.ts +13 -0
  57. package/global-modules/bank/validate.js +22 -0
  58. package/global-modules/branch/actions.d.ts +154 -37
  59. package/global-modules/branch/actions.js +148 -6
  60. package/global-modules/branch/branch.d.ts +2 -2
  61. package/global-modules/branch/branch.js +46 -32
  62. package/global-modules/branch/constants.d.ts +34 -24
  63. package/global-modules/branch/constants.js +101 -122
  64. package/global-modules/branch/context.d.ts +33 -2
  65. package/global-modules/branch/context.js +195 -164
  66. package/global-modules/branch/drawer.d.ts +26 -3
  67. package/global-modules/branch/drawer.js +101 -6
  68. package/global-modules/branch/form.d.ts +15 -1
  69. package/global-modules/branch/form.js +54 -71
  70. package/global-modules/branch/reducer.d.ts +23 -2
  71. package/global-modules/branch/reducer.js +148 -118
  72. package/global-modules/branch/types.d.ts +196 -69
  73. package/global-modules/branch/types.js +66 -7
  74. package/global-modules/branch/validate.d.ts +1 -1
  75. package/global-modules/branch/validate.js +15 -11
  76. package/global-modules/payment-mode/actions.d.ts +154 -37
  77. package/global-modules/payment-mode/actions.js +148 -6
  78. package/global-modules/payment-mode/constants.d.ts +34 -17
  79. package/global-modules/payment-mode/constants.js +90 -66
  80. package/global-modules/payment-mode/context.d.ts +33 -2
  81. package/global-modules/payment-mode/context.js +185 -163
  82. package/global-modules/payment-mode/drawer.d.ts +26 -3
  83. package/global-modules/payment-mode/drawer.js +104 -9
  84. package/global-modules/payment-mode/form.d.ts +16 -2
  85. package/global-modules/payment-mode/form.js +45 -74
  86. package/global-modules/payment-mode/payment-mode.d.ts +25 -2
  87. package/global-modules/payment-mode/payment-mode.js +90 -23
  88. package/global-modules/payment-mode/reducer.d.ts +23 -2
  89. package/global-modules/payment-mode/reducer.js +140 -114
  90. package/global-modules/payment-mode/types.d.ts +327 -112
  91. package/global-modules/payment-mode/types.js +162 -11
  92. package/global-modules/payment-mode/validate.d.ts +1 -1
  93. package/global-modules/payment-mode/validate.js +7 -5
  94. package/global-modules/preferences/actions.d.ts +126 -27
  95. package/global-modules/preferences/actions.js +128 -4
  96. package/global-modules/preferences/constants.d.ts +46 -31
  97. package/global-modules/preferences/constants.js +129 -66
  98. package/global-modules/preferences/context.d.ts +2 -2
  99. package/global-modules/preferences/context.js +43 -43
  100. package/global-modules/preferences/currency.js +15 -10
  101. package/global-modules/preferences/preferences.d.ts +2 -2
  102. package/global-modules/preferences/preferences.js +3 -5
  103. package/global-modules/preferences/validate.d.ts +1 -1
  104. package/global-modules/preferences/validate.js +7 -7
  105. package/global-modules/tax/actions.d.ts +155 -38
  106. package/global-modules/tax/actions.js +149 -7
  107. package/global-modules/tax/constants.d.ts +31 -39
  108. package/global-modules/tax/constants.js +83 -114
  109. package/global-modules/tax/context.d.ts +33 -2
  110. package/global-modules/tax/context.js +146 -132
  111. package/global-modules/tax/drawer.d.ts +26 -3
  112. package/global-modules/tax/drawer.js +101 -6
  113. package/global-modules/tax/form.d.ts +20 -3
  114. package/global-modules/tax/form.js +101 -74
  115. package/global-modules/tax/reducer.d.ts +23 -2
  116. package/global-modules/tax/reducer.js +143 -24
  117. package/global-modules/tax/tax.d.ts +25 -2
  118. package/global-modules/tax/tax.js +92 -28
  119. package/global-modules/tax/types.d.ts +332 -102
  120. package/global-modules/tax/types.js +179 -11
  121. package/global-modules/tax/validate.d.ts +1 -1
  122. package/global-modules/tax/validate.js +9 -8
  123. package/hooks/use-rtl.d.ts +44 -0
  124. package/hooks/use-rtl.js +75 -0
  125. package/lib/themes.d.ts +147 -0
  126. package/lib/themes.js +150 -0
  127. package/lib/toast-utils.d.ts +44 -0
  128. package/lib/toast-utils.js +212 -0
  129. package/lib/utils.d.ts +2 -0
  130. package/lib/utils.js +12 -0
  131. package/package.json +21 -4
  132. package/supabase/supabase.d.ts +80 -1
  133. package/supabase/supabase.js +281 -6
  134. package/global-modules/branch/form-elements.d.ts +0 -3
  135. package/global-modules/branch/form-elements.js +0 -41
  136. package/global-modules/payment-mode/form-elements.d.ts +0 -3
  137. package/global-modules/payment-mode/form-elements.js +0 -41
  138. package/global-modules/preferences/bank.d.ts +0 -2
  139. package/global-modules/preferences/bank.js +0 -11
  140. package/global-modules/preferences/branch-drawer.js +0 -36
  141. package/global-modules/preferences/branch-form-elements.js +0 -30
  142. package/global-modules/preferences/branch-form.d.ts +0 -0
  143. package/global-modules/preferences/branch-form.js +0 -33
  144. package/global-modules/preferences/branch.d.ts +0 -0
  145. package/global-modules/preferences/branch.js +0 -106
  146. package/global-modules/preferences/payment-mode-drawer.d.ts +0 -0
  147. package/global-modules/preferences/payment-mode-drawer.js +0 -36
  148. package/global-modules/preferences/payment-mode-form-elements.d.ts +0 -0
  149. package/global-modules/preferences/payment-mode-form-elements.js +0 -30
  150. package/global-modules/preferences/payment-mode-form.d.ts +0 -0
  151. package/global-modules/preferences/payment-mode-form.js +0 -33
  152. package/global-modules/preferences/payment-mode.d.ts +0 -0
  153. package/global-modules/preferences/payment-mode.js +0 -94
  154. package/global-modules/tax/form-elements.d.ts +0 -3
  155. package/global-modules/tax/form-elements.js +0 -41
  156. /package/{global-modules/preferences/branch-drawer.d.ts → constants.d.ts} +0 -0
  157. /package/{global-modules/preferences/branch-form-elements.d.ts → constants.js} +0 -0
@@ -1,30 +0,0 @@
1
- // /* eslint-disable */
2
- // import React from 'react';
3
- // import { vistaFormSchema } from '@appcorp/app-corp-vista/utils/form-schema';
4
- // import { VistaFormElements } from '@appcorp/app-corp-vista/type/vista-form-elements';
5
- // export const renderPaymentModeFormElements = (
6
- // elementProps: VistaFormElements,
7
- // ) => {
8
- // const elementsArray = Object.entries(vistaFormSchema)
9
- // .flatMap(([key, config]) => {
10
- // const Component = config;
11
- // return (elementProps[key as keyof VistaFormElements] || [])
12
- // ?.filter((props: any) => props.enabled)
13
- // ?.map((props: any) => ({
14
- // Component,
15
- // key,
16
- // order: props.order,
17
- // props,
18
- // }));
19
- // })
20
- // ?.sort((a, b) => a.order - b.order);
21
- // return (
22
- // <div className="grid grid-cols-1 gap-4">
23
- // {elementsArray?.map(({ key, Component, props }, index) => (
24
- // <div key={`${key}-${index}`}>
25
- // <Component {...props} />
26
- // </div>
27
- // ))}
28
- // </div>
29
- // );
30
- // };
File without changes
@@ -1,33 +0,0 @@
1
- // import React, { FC, useMemo } from 'react';
2
- // import { VistaTextInputV1Props } from '@appcorp/app-corp-vista/type/vista-text-input-type';
3
- // import { VISTA_FORM_ELEMENTS } from '@appcorp/app-corp-vista/utils/form-schema';
4
- // import { VistaFormElements } from '@appcorp/app-corp-vista/type/vista-form-elements';
5
- // import { usePreferenceStateContext } from './context';
6
- // import { renderPaymentModeFormElements } from './payment-mode-form-elements';
7
- // import { VistaComboboxV1Props } from '@appcorp/app-corp-vista/type/vista-combobox-type';
8
- // interface Props {
9
- // translationMap: {[key: string]: string};
10
- // }
11
- // export const PaymentModeForm: FC<Props> = ({ translationMap }) => {
12
- // const { paymentModeDynamicFormElements } = usePreferenceStateContext();
13
- // const updated = useMemo(() => {
14
- // const elements: VistaFormElements = { ...paymentModeDynamicFormElements };
15
- // const textInputElements: VistaTextInputV1Props[] | undefined = elements[VISTA_FORM_ELEMENTS.TEXT_INPUT_V1]?.sort((a, b) => a.order - b.order);
16
- // if (textInputElements) {
17
- // textInputElements?.forEach(({ label }, i) => {
18
- // if (translationMap[label as string] === undefined) return label;
19
- // textInputElements[i].label = translationMap[label as string];
20
- // });
21
- // }
22
- // const comboboxElements: VistaComboboxV1Props[] | undefined = elements[VISTA_FORM_ELEMENTS.COMBOBOX_V1]?.sort((a, b) => a.order - b.order);
23
- // if (comboboxElements) {
24
- // comboboxElements?.forEach(({ label }, i) => {
25
- // if (translationMap[label as string] === undefined) return label;
26
- // comboboxElements[i].label = translationMap[label];
27
- // });
28
- // }
29
- // return elements;
30
- // // eslint-disable-next-line
31
- // }, []);
32
- // return <>{renderPaymentModeFormElements(updated)}</>;
33
- // };
File without changes
@@ -1,94 +0,0 @@
1
- // import React from "react";
2
- // import { VistaTableV1 } from "@appcorp/app-corp-vista/organisms/vista-table-v1/vista-table-v1";
3
- // import { PaymentModeDrawer } from "./payment-mode-drawer";
4
- // import { VistaToaster } from "@appcorp/app-corp-vista/utils/generate-toast";
5
- // import { useTranslations } from "next-intl";
6
- // import { usePreferenceStateContext } from "./context";
7
- // import {
8
- // calculatePages,
9
- // getAvailablePageLimits,
10
- // isNextButtonDisabled,
11
- // isPreviousButtonDisabled,
12
- // } from "@react-pakistan/util-functions";
13
- // import { paymentModeTableBodyCols } from "./constants";
14
- // export const PaymentMode = () => {
15
- // const {
16
- // paymentModeCount,
17
- // paymentModePageLimit,
18
- // paymentModeSearchQuery,
19
- // paymentModes,
20
- // paymentModeListLoading,
21
- // paymentModeHeaderActions,
22
- // paymentModeRowActions,
23
- // paymentModeCurrentPage,
24
- // } = usePreferenceStateContext();
25
- // const t = useTranslations('paymentModePage');
26
- // const translationMap = {
27
- // formLabelName: t('formLabelName'),
28
- // formLabelCountry: t('formLabelCountry'),
29
- // formLabelPhone: t('formLabelPhone'),
30
- // formLabelWebsite: t('formLabelWebsite'),
31
- // formLabelEmail: t('formLabelEmail'),
32
- // };
33
- // const tableHeadItems = [
34
- // {
35
- // label: t('tableColumnHeaderId'),
36
- // width: '5%',
37
- // },
38
- // {
39
- // label: t('tableColumnHeaderLabel'),
40
- // width: '30%',
41
- // },
42
- // {
43
- // label: t('tableColumnHeaderEnabled'),
44
- // width: '20%',
45
- // },
46
- // {
47
- // label: t('tableColumnHeaderIsDefault'),
48
- // width: '20%',
49
- // },
50
- // {
51
- // label: t('tableColumnHeaderActivity'),
52
- // width: '20%',
53
- // },
54
- // {
55
- // label: t('tableColumnHeaderActions'),
56
- // width: '5%',
57
- // },
58
- // ];
59
- // const totalPages = calculatePages(paymentModeCount, paymentModePageLimit);
60
- // return (
61
- // <>
62
- // <VistaTableV1
63
- // currentPage={paymentModeCount}
64
- // handleNextOnClick={() => void 0}
65
- // handleOnSelect={() => void 0}
66
- // handlePreviousOnClick={() => void 0}
67
- // handleSearchInput={() => void 0}
68
- // headerActions={paymentModeHeaderActions}
69
- // isNextDisabled={isNextButtonDisabled(paymentModeCurrentPage, totalPages)}
70
- // isPreviousDisabled={isPreviousButtonDisabled(paymentModeCurrentPage)}
71
- // listOptions={getAvailablePageLimits(paymentModeCount)}
72
- // loading={paymentModeListLoading}
73
- // nodeSelectKey="paymentModePageLimit"
74
- // pageLimit={paymentModePageLimit}
75
- // rowActions={paymentModeRowActions}
76
- // searchDisabled={false}
77
- // searchEnabled
78
- // searchId="payment-mode-search"
79
- // searchPlaceholder={t('tableHeaderSearchPlaceholder')}
80
- // searchValue={paymentModeSearchQuery}
81
- // selectKey1="option"
82
- // selectedItem={{ option: String(paymentModePageLimit) }}
83
- // tableBodyCols={paymentModeTableBodyCols}
84
- // tableBodyRows={paymentModes}
85
- // tableDescription={t('tableDescription')}
86
- // tableHeadItems={tableHeadItems}
87
- // tableHeading={t('tableTitle')}
88
- // totalPages={totalPages}
89
- // />
90
- // <PaymentModeDrawer translationMap={translationMap} />
91
- // <VistaToaster />
92
- // </>
93
- // );
94
- // };
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { VistaFormElements } from '@appcorp/app-corp-vista/type/vista-form-elements';
3
- export declare const renderFormElements: (elementProps: VistaFormElements) => React.JSX.Element;
@@ -1,41 +0,0 @@
1
- "use strict";
2
- /* eslint-disable */
3
- var __assign = (this && this.__assign) || function () {
4
- __assign = Object.assign || function(t) {
5
- for (var s, i = 1, n = arguments.length; i < n; i++) {
6
- s = arguments[i];
7
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
- t[p] = s[p];
9
- }
10
- return t;
11
- };
12
- return __assign.apply(this, arguments);
13
- };
14
- var __importDefault = (this && this.__importDefault) || function (mod) {
15
- return (mod && mod.__esModule) ? mod : { "default": mod };
16
- };
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.renderFormElements = void 0;
19
- var react_1 = __importDefault(require("react"));
20
- var form_schema_1 = require("@appcorp/app-corp-vista/utils/form-schema");
21
- var renderFormElements = function (elementProps) {
22
- var _a;
23
- var elementsArray = (_a = Object.entries(form_schema_1.vistaFormSchema)
24
- .flatMap(function (_a) {
25
- var _b, _c;
26
- var key = _a[0], config = _a[1];
27
- var Component = config;
28
- return (_c = (_b = (elementProps[key] || [])) === null || _b === void 0 ? void 0 : _b.filter(function (props) { return props.enabled; })) === null || _c === void 0 ? void 0 : _c.map(function (props) { return ({
29
- Component: Component,
30
- key: key,
31
- order: props.order,
32
- props: props,
33
- }); });
34
- })) === null || _a === void 0 ? void 0 : _a.sort(function (a, b) { return a.order - b.order; });
35
- return (react_1.default.createElement("div", { className: "grid grid-cols-1 gap-4" }, elementsArray === null || elementsArray === void 0 ? void 0 : elementsArray.map(function (_a, index) {
36
- var key = _a.key, Component = _a.Component, props = _a.props;
37
- return (react_1.default.createElement("div", { key: "".concat(key, "-").concat(index) },
38
- react_1.default.createElement(Component, __assign({}, props))));
39
- })));
40
- };
41
- exports.renderFormElements = renderFormElements;