@kingteza/crud-component 1.0.65 → 1.1.0

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 (236) hide show
  1. package/package.json +21 -11
  2. package/release.config.cjs +27 -0
  3. package/App.d.ts +0 -25
  4. package/Play.d.ts +0 -2
  5. package/common/appearance/Hider.cjs.js +0 -1
  6. package/common/appearance/Hider.d.ts +0 -6
  7. package/common/appearance/Hider.es.js +0 -5
  8. package/common/appearance/index.d.ts +0 -1
  9. package/common/button/Button.cjs.js +0 -1
  10. package/common/button/Button.d.ts +0 -11
  11. package/common/button/Button.es.js +0 -57
  12. package/common/button/CloneButtonTable.cjs.js +0 -1
  13. package/common/button/CloneButtonTable.d.ts +0 -6
  14. package/common/button/CloneButtonTable.es.js +0 -19
  15. package/common/button/DeleteButtonTable.cjs.js +0 -1
  16. package/common/button/DeleteButtonTable.d.ts +0 -13
  17. package/common/button/DeleteButtonTable.es.js +0 -64
  18. package/common/button/ExportButton.cjs.js +0 -1
  19. package/common/button/ExportButton.d.ts +0 -4
  20. package/common/button/ExportButton.es.js +0 -26
  21. package/common/button/HideButtonTable.cjs.js +0 -1
  22. package/common/button/HideButtonTable.d.ts +0 -13
  23. package/common/button/HideButtonTable.es.js +0 -67
  24. package/common/button/ImportButton.cjs.js +0 -1
  25. package/common/button/ImportButton.d.ts +0 -9
  26. package/common/button/ImportButton.es.js +0 -55
  27. package/common/button/NewButton.cjs.js +0 -1
  28. package/common/button/NewButton.d.ts +0 -12
  29. package/common/button/NewButton.es.js +0 -23
  30. package/common/button/PrintButton.cjs.js +0 -1
  31. package/common/button/PrintButton.d.ts +0 -12
  32. package/common/button/PrintButton.es.js +0 -25
  33. package/common/button/RefreshButton.cjs.js +0 -1
  34. package/common/button/RefreshButton.d.ts +0 -11
  35. package/common/button/RefreshButton.es.js +0 -23
  36. package/common/button/UnHideButton.cjs.js +0 -1
  37. package/common/button/UnHideButton.d.ts +0 -14
  38. package/common/button/UnHideButton.es.js +0 -69
  39. package/common/button/UpdateButtonTable.cjs.js +0 -1
  40. package/common/button/UpdateButtonTable.d.ts +0 -6
  41. package/common/button/UpdateButtonTable.es.js +0 -19
  42. package/common/button/ViewButtonTable.cjs.js +0 -1
  43. package/common/button/ViewButtonTable.d.ts +0 -6
  44. package/common/button/ViewButtonTable.es.js +0 -19
  45. package/common/button/index.d.ts +0 -14
  46. package/common/check-box/CheckBox.cjs.js +0 -1
  47. package/common/check-box/CheckBox.d.ts +0 -9
  48. package/common/check-box/CheckBox.es.js +0 -40
  49. package/common/check-box/index.d.ts +0 -2
  50. package/common/date-picker/DatePicker.cjs.js +0 -1
  51. package/common/date-picker/DatePicker.d.ts +0 -37
  52. package/common/date-picker/DatePicker.es.js +0 -87
  53. package/common/date-picker/TimePicker.cjs.js +0 -1
  54. package/common/date-picker/TimePicker.d.ts +0 -34
  55. package/common/date-picker/TimePicker.es.js +0 -77
  56. package/common/date-picker/index.d.ts +0 -3
  57. package/common/description/DescList.cjs.js +0 -1
  58. package/common/description/DescList.d.ts +0 -18
  59. package/common/description/DescList.es.js +0 -16
  60. package/common/description/DescriptionComponent.d.ts +0 -7
  61. package/common/description/index.d.ts +0 -3
  62. package/common/icon/KIcon.cjs.js +0 -1
  63. package/common/icon/KIcon.d.ts +0 -9
  64. package/common/icon/KIcon.es.js +0 -11
  65. package/common/index.cjs.js +0 -1
  66. package/common/index.d.ts +0 -20
  67. package/common/index.es.js +0 -78
  68. package/common/layout/VerticalSpace.cjs.js +0 -1
  69. package/common/layout/VerticalSpace.d.ts +0 -5
  70. package/common/layout/VerticalSpace.es.js +0 -6
  71. package/common/layout/index.d.ts +0 -2
  72. package/common/loading/LoadingIndicator.cjs.js +0 -1
  73. package/common/loading/LoadingIndicator.d.ts +0 -6
  74. package/common/loading/LoadingIndicator.es.js +0 -23
  75. package/common/loading/index.d.ts +0 -2
  76. package/common/picker/ImagePicker.cjs.js +0 -1
  77. package/common/picker/ImagePicker.d.ts +0 -56
  78. package/common/picker/ImagePicker.es.js +0 -320
  79. package/common/picker/index.d.ts +0 -2
  80. package/common/radio/RadioGroupComponent.cjs.js +0 -1
  81. package/common/radio/RadioGroupComponent.d.ts +0 -18
  82. package/common/radio/RadioGroupComponent.es.js +0 -19
  83. package/common/radio/index.d.ts +0 -2
  84. package/common/report/SelectFieldInReport.cjs.js +0 -1
  85. package/common/report/SelectFieldInReport.d.ts +0 -16
  86. package/common/report/SelectFieldInReport.es.js +0 -30
  87. package/common/report/index.d.ts +0 -3
  88. package/common/rich/index.cjs.js +0 -1
  89. package/common/rich/index.d.ts +0 -10
  90. package/common/rich/index.es.js +0 -66
  91. package/common/select/CustomSelectOption.cjs.js +0 -1
  92. package/common/select/CustomSelectOption.d.ts +0 -7
  93. package/common/select/CustomSelectOption.es.js +0 -13
  94. package/common/select/SelectComponent.cjs.js +0 -1
  95. package/common/select/SelectComponent.d.ts +0 -21
  96. package/common/select/SelectComponent.es.js +0 -85
  97. package/common/select/index.d.ts +0 -3
  98. package/common/show-more/index.cjs.js +0 -1
  99. package/common/show-more/index.d.ts +0 -4
  100. package/common/show-more/index.es.js +0 -8
  101. package/common/tab/TabViewWithRoute.cjs.js +0 -1
  102. package/common/tab/TabViewWithRoute.d.ts +0 -13
  103. package/common/tab/TabViewWithRoute.es.js +0 -38
  104. package/common/tab/index.d.ts +0 -2
  105. package/common/table/index.d.ts +0 -3
  106. package/common/table/table.cjs.js +0 -1
  107. package/common/table/table.d.ts +0 -19
  108. package/common/table/table.es.js +0 -40
  109. package/common/tag/StatusTag.cjs.js +0 -1
  110. package/common/tag/StatusTag.d.ts +0 -14
  111. package/common/tag/StatusTag.es.js +0 -29
  112. package/common/tag/index.d.ts +0 -2
  113. package/common/text/index.cjs.js +0 -1
  114. package/common/text/index.d.ts +0 -3
  115. package/common/text/index.es.js +0 -5
  116. package/common/text/title/TitleWithHeadTitle.d.ts +0 -7
  117. package/common/text/title/index.cjs.js +0 -1
  118. package/common/text/title/index.d.ts +0 -1
  119. package/common/text/title/index.es.js +0 -5
  120. package/common/text-field/NumberField.cjs.js +0 -1
  121. package/common/text-field/NumberField.d.ts +0 -13
  122. package/common/text-field/NumberField.es.js +0 -82
  123. package/common/text-field/PhoneNumberField.cjs.js +0 -1
  124. package/common/text-field/PhoneNumberField.d.ts +0 -4
  125. package/common/text-field/PhoneNumberField.es.js +0 -18
  126. package/common/text-field/TextArea.cjs.js +0 -1
  127. package/common/text-field/TextArea.d.ts +0 -17
  128. package/common/text-field/TextArea.es.js +0 -46
  129. package/common/text-field/TextField.cjs.js +0 -1
  130. package/common/text-field/TextField.d.ts +0 -27
  131. package/common/text-field/TextField.es.js +0 -72
  132. package/common/text-field/index.d.ts +0 -5
  133. package/common/tooltip/TooltipComponent.cjs.js +0 -1
  134. package/common/tooltip/TooltipComponent.d.ts +0 -5
  135. package/common/tooltip/TooltipComponent.es.js +0 -9
  136. package/common/tooltip/index.d.ts +0 -2
  137. package/common/wizard/WizardResult.cjs.js +0 -1
  138. package/common/wizard/WizardResult.d.ts +0 -16
  139. package/common/wizard/WizardResult.es.js +0 -58
  140. package/common/wizard/WizardViewForm.cjs.js +0 -1
  141. package/common/wizard/WizardViewForm.d.ts +0 -24
  142. package/common/wizard/WizardViewForm.es.js +0 -74
  143. package/common/wizard/index.d.ts +0 -3
  144. package/crud/CrudComponent.cjs.js +0 -1
  145. package/crud/CrudComponent.d.ts +0 -244
  146. package/crud/CrudComponent.es.js +0 -123
  147. package/crud/CrudField.cjs.js +0 -1
  148. package/crud/CrudField.d.ts +0 -4
  149. package/crud/CrudField.es.js +0 -449
  150. package/crud/CrudForm.cjs.js +0 -1
  151. package/crud/CrudForm.d.ts +0 -14
  152. package/crud/CrudForm.es.js +0 -103
  153. package/crud/CrudFormWizard.cjs.js +0 -1
  154. package/crud/CrudFormWizard.d.ts +0 -14
  155. package/crud/CrudFormWizard.es.js +0 -140
  156. package/crud/CrudReportComponent.cjs.js +0 -4
  157. package/crud/CrudReportComponent.d.ts +0 -44
  158. package/crud/CrudReportComponent.es.js +0 -255
  159. package/crud/CrudSearchComponent.cjs.js +0 -1
  160. package/crud/CrudSearchComponent.d.ts +0 -21
  161. package/crud/CrudSearchComponent.es.js +0 -96
  162. package/crud/CrudTextAreaComponent.cjs.js +0 -1
  163. package/crud/CrudTextAreaComponent.d.ts +0 -22
  164. package/crud/CrudTextAreaComponent.es.js +0 -52
  165. package/crud/FileCrudField.cjs.js +0 -1
  166. package/crud/FileCrudField.d.ts +0 -25
  167. package/crud/FileCrudField.es.js +0 -219
  168. package/crud/ImageCrudField.cjs.js +0 -1
  169. package/crud/ImageCrudField.d.ts +0 -38
  170. package/crud/ImageCrudField.es.js +0 -113
  171. package/crud/actions/index.cjs.js +0 -1
  172. package/crud/actions/index.d.ts +0 -26
  173. package/crud/actions/index.es.js +0 -83
  174. package/crud/import/CrudImportButton.cjs.js +0 -1
  175. package/crud/import/CrudImportButton.d.ts +0 -3
  176. package/crud/import/CrudImportButton.es.js +0 -30
  177. package/crud/import/CrudImportComponent.cjs.js +0 -2
  178. package/crud/import/CrudImportComponent.d.ts +0 -14
  179. package/crud/import/CrudImportComponent.es.js +0 -222
  180. package/crud/index.d.ts +0 -23
  181. package/crud/modal/index.cjs.js +0 -1
  182. package/crud/modal/index.d.ts +0 -24
  183. package/crud/modal/index.es.js +0 -146
  184. package/crud/view/CrudDecListView.cjs.js +0 -1
  185. package/crud/view/CrudDecListView.d.ts +0 -15
  186. package/crud/view/CrudDecListView.es.js +0 -57
  187. package/crud/view/CrudViewer.cjs.js +0 -1
  188. package/crud/view/CrudViewer.d.ts +0 -43
  189. package/crud/view/CrudViewer.es.js +0 -304
  190. package/crud/view/CrudViewerUtil.cjs.js +0 -1
  191. package/crud/view/CrudViewerUtil.d.ts +0 -2
  192. package/crud/view/CrudViewerUtil.es.js +0 -98
  193. package/crud/view/index.d.ts +0 -5
  194. package/hooks/NavigatorHooks.cjs.js +0 -1
  195. package/hooks/NavigatorHooks.d.ts +0 -1
  196. package/hooks/NavigatorHooks.es.js +0 -9
  197. package/icons/FlipHIcon.cjs.js +0 -1
  198. package/icons/FlipHIcon.d.ts +0 -3
  199. package/icons/FlipHIcon.es.js +0 -28
  200. package/icons/FlipVIcon.cjs.js +0 -1
  201. package/icons/FlipVIcon.d.ts +0 -3
  202. package/icons/FlipVIcon.es.js +0 -28
  203. package/index.cjs.js +0 -1
  204. package/index.d.ts +0 -4
  205. package/index.es.js +0 -46
  206. package/locale/hooks/translation-constants.cjs.js +0 -1
  207. package/locale/hooks/translation-constants.d.ts +0 -1
  208. package/locale/hooks/translation-constants.es.js +0 -4
  209. package/locale/index.cjs.js +0 -1
  210. package/locale/index.d.ts +0 -85
  211. package/locale/index.es.js +0 -57
  212. package/locale/translations/en.cjs.js +0 -1
  213. package/locale/translations/en.d.ts +0 -63
  214. package/locale/translations/en.es.js +0 -65
  215. package/main.d.ts +0 -0
  216. package/types/DialogComponentProp.d.ts +0 -8
  217. package/types/Id.d.ts +0 -10
  218. package/util/CrudUtil.cjs.js +0 -1
  219. package/util/CrudUtil.d.ts +0 -5
  220. package/util/CrudUtil.es.js +0 -8
  221. package/util/DateUtil.cjs.js +0 -1
  222. package/util/DateUtil.d.ts +0 -7
  223. package/util/DateUtil.es.js +0 -18
  224. package/util/ImageUtil.cjs.js +0 -1
  225. package/util/ImageUtil.d.ts +0 -14
  226. package/util/ImageUtil.es.js +0 -63
  227. package/util/NumberUtil.cjs.js +0 -1
  228. package/util/NumberUtil.d.ts +0 -17
  229. package/util/NumberUtil.es.js +0 -60
  230. package/util/ValidationUtil.cjs.js +0 -1
  231. package/util/ValidationUtil.d.ts +0 -14
  232. package/util/ValidationUtil.es.js +0 -63
  233. package/util/index.cjs.js +0 -1
  234. package/util/index.d.ts +0 -4
  235. package/util/index.es.js +0 -10
  236. package/vite-env.d.ts +0 -1
package/locale/index.d.ts DELETED
@@ -1,85 +0,0 @@
1
- import { TRANSLATION_NAMESPACE } from '../locale/hooks/translation-constants';
2
- import { default as en } from './translations/en';
3
- import { i18n as i18nType } from 'i18next';
4
- import { UseTranslationOptions } from 'react-i18next';
5
- export declare const defaultTranslations: {
6
- en: {
7
- "crud-component": {
8
- str: {
9
- delete: string;
10
- clone: string;
11
- update: string;
12
- new: string;
13
- back: string;
14
- next: string;
15
- save: string;
16
- import: string;
17
- cancel: string;
18
- print: string;
19
- hide: string;
20
- no: string;
21
- action: string;
22
- remove: string;
23
- view: string;
24
- ok: string;
25
- yes: string;
26
- warning: string;
27
- success: string;
28
- error: string;
29
- retry: string;
30
- previous: string;
31
- unhide: string;
32
- downloadCsvTemplate: string;
33
- importCsvFile: string;
34
- export: string;
35
- goBack: string;
36
- refresh: string;
37
- fileUploadMessage1: string;
38
- fileUploadMessage2: string;
39
- rotateLeft: string;
40
- rotateRight: string;
41
- flipHorizontal: string;
42
- flipVertical: string;
43
- };
44
- err: {
45
- save: string;
46
- validation: {
47
- required: string;
48
- minLength8: string;
49
- percentage: string;
50
- maximumValueExceeded: string;
51
- invalidNic: string;
52
- invalid: string;
53
- };
54
- notFound: string;
55
- };
56
- message: {
57
- loading: {
58
- saving: string;
59
- };
60
- uploadButtonText: string;
61
- };
62
- qus: {
63
- importWithIssues: string;
64
- doYouWantToDelete: string;
65
- doYouWantToHide: string;
66
- doYouWantToUnhide: string;
67
- };
68
- };
69
- };
70
- };
71
- export type LibTranslations = typeof en;
72
- export interface SetupI18nOptions {
73
- translations?: Record<string, {
74
- [TRANSLATION_NAMESPACE]: LibTranslations;
75
- }>;
76
- language?: string;
77
- i18nInstance?: i18nType;
78
- }
79
- export declare let i18nInstance: i18nType;
80
- export declare const setupI18n: (options?: SetupI18nOptions) => i18nType;
81
- export declare const updateTranslations: (language: string, translations: Record<string, any>, i18nInstance?: i18nType) => void;
82
- export declare const useTranslationLib: (options?: Omit<UseTranslationOptions<string>, "i18n">) => import('react-i18next').UseTranslationResponse<"crud-component", string>;
83
- export declare const useTranslationLibNoNS: (options?: Omit<UseTranslationOptions<string>, "i18n">) => import('react-i18next').UseTranslationResponse<"translation", string>;
84
- export declare const t: (key: string, options?: any) => string | import('node_modules/i18next/typescript/helpers').$SpecialObject | import('i18next').TFunctionDetailedResult<string | import('node_modules/i18next/typescript/helpers').$SpecialObject, any>;
85
- export declare const tWithOrWithoutNS: (key: string, options?: any) => string | import('node_modules/i18next/typescript/helpers').$SpecialObject | import('i18next').TFunctionDetailedResult<string | import('node_modules/i18next/typescript/helpers').$SpecialObject, any>;
@@ -1,57 +0,0 @@
1
- import { TRANSLATION_NAMESPACE as s } from "./hooks/translation-constants.es.js";
2
- import T from "./translations/en.es.js";
3
- import i from "i18next";
4
- import { initReactI18next as m, useTranslation as u } from "react-i18next";
5
- const p = {
6
- en: {
7
- [s]: T
8
- }
9
- };
10
- let e = i;
11
- const E = (t = {}) => {
12
- const {
13
- translations: n = p,
14
- language: r = "en",
15
- i18nInstance: a
16
- } = t, o = a || i;
17
- return e = o, o.isInitialized ? Object.entries(n).forEach(([c, l]) => {
18
- Object.entries(l).forEach(([d, f]) => {
19
- o.addResourceBundle(c, d, f, !0, !0);
20
- });
21
- }) : o.use(m).init({
22
- resources: n,
23
- lng: r,
24
- fallbackLng: "en",
25
- ns: s,
26
- interpolation: {
27
- escapeValue: !1
28
- }
29
- }), i;
30
- }, L = (t, n, r) => {
31
- (r || i).addResourceBundle(
32
- t,
33
- s,
34
- n,
35
- !0,
36
- !0
37
- );
38
- }, O = (t) => u(s, { ...t, i18n: e }), R = (t) => u(void 0, { ...t, i18n: e }), N = (t, n) => e == null ? void 0 : e.t(t, {
39
- ns: s,
40
- ...n
41
- }), S = (t, n) => {
42
- const r = N(t, n);
43
- return r || (e == null ? void 0 : e.t(t, {
44
- ns: void 0,
45
- ...n
46
- }));
47
- };
48
- export {
49
- p as defaultTranslations,
50
- e as i18nInstance,
51
- E as setupI18n,
52
- N as t,
53
- S as tWithOrWithoutNS,
54
- L as updateTranslations,
55
- O as useTranslationLib,
56
- R as useTranslationLibNoNS
57
- };
@@ -1 +0,0 @@
1
- "use strict";const e={str:{delete:"Delete",clone:"Clone",update:"Update",new:"New",back:"Back",next:"Next",save:"Save",import:"Import",cancel:"Cancel",print:"Print",hide:"Hide",no:"No",action:"Action",remove:"Remove",view:"View",ok:"Ok",yes:"Yes",warning:"Warning",success:"Success",error:"Error",retry:"Retry",previous:"Previous",unhide:"Unhide",downloadCsvTemplate:"Download CSV Template",importCsvFile:"Import CSV File",export:"Export",goBack:"Go Back",refresh:"Refresh",fileUploadMessage1:"Drag file here or ",fileUploadMessage2:"Click to Upload",rotateLeft:"Rotate Left",rotateRight:"Rotate Right",flipHorizontal:"Flip Horizontal",flipVertical:"Flip Vertical"},err:{save:"An error occurred while saving",validation:{required:"is required",minLength8:"must be at least 8 characters",percentage:"must be a percentage",maximumValueExceeded:"must be less than %maxValue%",invalidNic:"must be a valid NIC",invalid:"must be a valid"},notFound:"Not Found"},message:{loading:{saving:"Saving"},uploadButtonText:"Click to Upload"},qus:{importWithIssues:"Some fields have issues. Do you want to proceed with the import?",doYouWantToDelete:"Do you want to delete?",doYouWantToHide:"Do you want to hide?",doYouWantToUnhide:"Do you want to unhide?"}};module.exports=e;
@@ -1,63 +0,0 @@
1
- declare const _default: {
2
- str: {
3
- delete: string;
4
- clone: string;
5
- update: string;
6
- new: string;
7
- back: string;
8
- next: string;
9
- save: string;
10
- import: string;
11
- cancel: string;
12
- print: string;
13
- hide: string;
14
- no: string;
15
- action: string;
16
- remove: string;
17
- view: string;
18
- ok: string;
19
- yes: string;
20
- warning: string;
21
- success: string;
22
- error: string;
23
- retry: string;
24
- previous: string;
25
- unhide: string;
26
- downloadCsvTemplate: string;
27
- importCsvFile: string;
28
- export: string;
29
- goBack: string;
30
- refresh: string;
31
- fileUploadMessage1: string;
32
- fileUploadMessage2: string;
33
- rotateLeft: string;
34
- rotateRight: string;
35
- flipHorizontal: string;
36
- flipVertical: string;
37
- };
38
- err: {
39
- save: string;
40
- validation: {
41
- required: string;
42
- minLength8: string;
43
- percentage: string;
44
- maximumValueExceeded: string;
45
- invalidNic: string;
46
- invalid: string;
47
- };
48
- notFound: string;
49
- };
50
- message: {
51
- loading: {
52
- saving: string;
53
- };
54
- uploadButtonText: string;
55
- };
56
- qus: {
57
- importWithIssues: string;
58
- doYouWantToDelete: string;
59
- doYouWantToHide: string;
60
- doYouWantToUnhide: string;
61
- };
62
- };
63
- export default _default;
@@ -1,65 +0,0 @@
1
- const e = {
2
- str: {
3
- delete: "Delete",
4
- clone: "Clone",
5
- update: "Update",
6
- new: "New",
7
- back: "Back",
8
- next: "Next",
9
- save: "Save",
10
- import: "Import",
11
- cancel: "Cancel",
12
- print: "Print",
13
- hide: "Hide",
14
- no: "No",
15
- action: "Action",
16
- remove: "Remove",
17
- view: "View",
18
- ok: "Ok",
19
- yes: "Yes",
20
- warning: "Warning",
21
- success: "Success",
22
- error: "Error",
23
- retry: "Retry",
24
- previous: "Previous",
25
- unhide: "Unhide",
26
- downloadCsvTemplate: "Download CSV Template",
27
- importCsvFile: "Import CSV File",
28
- export: "Export",
29
- goBack: "Go Back",
30
- refresh: "Refresh",
31
- fileUploadMessage1: "Drag file here or ",
32
- fileUploadMessage2: "Click to Upload",
33
- rotateLeft: "Rotate Left",
34
- rotateRight: "Rotate Right",
35
- flipHorizontal: "Flip Horizontal",
36
- flipVertical: "Flip Vertical"
37
- },
38
- err: {
39
- save: "An error occurred while saving",
40
- validation: {
41
- required: "is required",
42
- minLength8: "must be at least 8 characters",
43
- percentage: "must be a percentage",
44
- maximumValueExceeded: "must be less than %maxValue%",
45
- invalidNic: "must be a valid NIC",
46
- invalid: "must be a valid"
47
- },
48
- notFound: "Not Found"
49
- },
50
- message: {
51
- loading: {
52
- saving: "Saving"
53
- },
54
- uploadButtonText: "Click to Upload"
55
- },
56
- qus: {
57
- importWithIssues: "Some fields have issues. Do you want to proceed with the import?",
58
- doYouWantToDelete: "Do you want to delete?",
59
- doYouWantToHide: "Do you want to hide?",
60
- doYouWantToUnhide: "Do you want to unhide?"
61
- }
62
- };
63
- export {
64
- e as default
65
- };
package/main.d.ts DELETED
File without changes
@@ -1,8 +0,0 @@
1
- /**
2
- * This is the common type for dialog props
3
- */
4
- export interface DialogProps<U = {}, CLOSE = boolean | undefined, OPEN = CLOSE> {
5
- open: OPEN | undefined;
6
- onCloseMethod: (val: CLOSE) => void;
7
- updatingItem?: U;
8
- }
package/types/Id.d.ts DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * We can use this interface to indicate the id like
3
- * { id: string }
4
- */
5
- export default interface IdProps {
6
- id: string;
7
- }
8
- export interface IdPropsOp {
9
- id?: string;
10
- }
@@ -1 +0,0 @@
1
- "use strict";class s{static getRealName(t,e="name"){return typeof t=="object"?t[e]:t}}module.exports=s;
@@ -1,5 +0,0 @@
1
- import { InitialCrudField, SelectCrudField } from 'src/crud';
2
- declare class CrudUtil {
3
- static getRealName<T>(name: InitialCrudField<T>["name"] | SelectCrudField<T>["name"], extract?: "name" | "upsertFieldName"): any;
4
- }
5
- export default CrudUtil;
@@ -1,8 +0,0 @@
1
- class l {
2
- static getRealName(t, e = "name") {
3
- return typeof t == "object" ? t[e] : t;
4
- }
5
- }
6
- export {
7
- l as default
8
- };
@@ -1 +0,0 @@
1
- "use strict";const t=require("dayjs"),a=require("../locale/index.cjs.js"),o=n=>{var e;return t(n).locale(((e=a.i18nInstance)==null?void 0:e.language)??"en").format("YYYY-MM-DD HH:mm")},s=n=>{var e;return t(n).locale(((e=a.i18nInstance)==null?void 0:e.language)??"en").format("YYYY-MM-DD HH:mm:ss")},c=n=>{var e;return t(n).locale(((e=a.i18nInstance)==null?void 0:e.language)??"en").format("YYYY-MM-DD")},m=(n,e="HH:mm:ss")=>{var r;return t(n).locale(((r=a.i18nInstance)==null?void 0:r.language)??"en").format(e)},i={formatDateTime:o,formatDate:c,formatDateTimeWithSecond:s,formatTime:m};module.exports=i;
@@ -1,7 +0,0 @@
1
- declare const _default: {
2
- formatDateTime: (d?: Date) => string;
3
- formatDate: (d?: Date) => string;
4
- formatDateTimeWithSecond: (d?: Date) => string;
5
- formatTime: (d?: Date, format?: string) => string;
6
- };
7
- export default _default;
@@ -1,18 +0,0 @@
1
- import e from "dayjs";
2
- import { i18nInstance as o } from "../locale/index.es.js";
3
- const n = (t) => {
4
- var a;
5
- return e(t).locale(((a = o) == null ? void 0 : a.language) ?? "en").format("YYYY-MM-DD HH:mm");
6
- }, r = (t) => {
7
- var a;
8
- return e(t).locale(((a = o) == null ? void 0 : a.language) ?? "en").format("YYYY-MM-DD HH:mm:ss");
9
- }, l = (t) => {
10
- var a;
11
- return e(t).locale(((a = o) == null ? void 0 : a.language) ?? "en").format("YYYY-MM-DD");
12
- }, s = (t, a = "HH:mm:ss") => {
13
- var m;
14
- return e(t).locale(((m = o) == null ? void 0 : m.language) ?? "en").format(a);
15
- }, f = { formatDateTime: n, formatDate: l, formatDateTimeWithSecond: r, formatTime: s };
16
- export {
17
- f as default
18
- };
@@ -1 +0,0 @@
1
- "use strict";const c=require("browser-image-compression");class g{async resizeImage(t){const e=await c(t,{maxSizeMB:1,maxWidthOrHeight:1920,useWebWorker:!0}),a=t.uid;return Object.assign(e,{uid:a,lastModifiedDate:new Date})}async getImageData(t){const e=await this.getImageData0(t);if(e){const a=new Image;a.src=e.data;const o=await new Promise(n=>{a.onload=function(){n({height:a.height,width:a.width})}});return Object.assign(e,o),e}else return null}async getImageData0(t){try{if(t.startsWith("data:image/")){const e=t.match(/^data:image\/(png|jpeg|jpg);base64,(.*)$/);if(!e)throw new Error("Invalid base64 image data");return{data:t,type:e[1]}}else{const e=await fetch(t);if(!e.ok)throw new Error("Network response was not ok");const a=await e.blob();return new Promise((o,n)=>{const s=new FileReader;s.onloadend=function(){const r=s.result,i=r.match(/^data:image\/(png|jpeg|jpg);base64,/);i?o({data:r,type:i[1]}):n(new Error("Could not determine image type"))},s.onerror=n,s.readAsDataURL(a)})}}catch(e){return console.warn(e),null}}}const d=new g;module.exports=d;
@@ -1,14 +0,0 @@
1
- import { RcFile } from 'antd/lib/upload';
2
- export type ImageDataReturn = {
3
- data: string;
4
- type: 'png' | 'jpeg' | 'jpg';
5
- width: number;
6
- height: number;
7
- } | null;
8
- declare class ImageUtl {
9
- resizeImage(file: RcFile): Promise<RcFile>;
10
- getImageData(uriOrBase64: string): Promise<ImageDataReturn>;
11
- getImageData0(uriOrBase64: string): Promise<ImageDataReturn>;
12
- }
13
- declare const _default: ImageUtl;
14
- export default _default;
@@ -1,63 +0,0 @@
1
- import c from "browser-image-compression";
2
- class g {
3
- async resizeImage(t) {
4
- const e = await c(t, {
5
- maxSizeMB: 1,
6
- maxWidthOrHeight: 1920,
7
- useWebWorker: !0
8
- }), a = t.uid;
9
- return Object.assign(e, {
10
- uid: a,
11
- lastModifiedDate: /* @__PURE__ */ new Date()
12
- });
13
- }
14
- async getImageData(t) {
15
- const e = await this.getImageData0(t);
16
- if (e) {
17
- const a = new Image();
18
- a.src = e.data;
19
- const o = await new Promise(
20
- (n) => {
21
- a.onload = function() {
22
- n({
23
- height: a.height,
24
- width: a.width
25
- });
26
- };
27
- }
28
- );
29
- return Object.assign(e, o), e;
30
- } else
31
- return null;
32
- }
33
- async getImageData0(t) {
34
- try {
35
- if (t.startsWith("data:image/")) {
36
- const e = t.match(/^data:image\/(png|jpeg|jpg);base64,(.*)$/);
37
- if (!e)
38
- throw new Error("Invalid base64 image data");
39
- return { data: t, type: e[1] };
40
- } else {
41
- const e = await fetch(t);
42
- if (!e.ok) throw new Error("Network response was not ok");
43
- const a = await e.blob();
44
- return new Promise((o, n) => {
45
- const s = new FileReader();
46
- s.onloadend = function() {
47
- const r = s.result, i = r.match(/^data:image\/(png|jpeg|jpg);base64,/);
48
- i ? o({
49
- data: r,
50
- type: i[1]
51
- }) : n(new Error("Could not determine image type"));
52
- }, s.onerror = n, s.readAsDataURL(a);
53
- });
54
- }
55
- } catch (e) {
56
- return console.warn(e), null;
57
- }
58
- }
59
- }
60
- const l = new g();
61
- export {
62
- l as default
63
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i={minimumFractionDigits:2,maximumFractionDigits:2},a={minimumFractionDigits:0,maximumFractionDigits:0};function u(t=0){return(+t).toLocaleString("en",i)}function c(t=0,n=2){const r=e(t,n);return isNaN(r)?void 0:r}function e(t=0,n=2){switch(t=+t,(typeof n!="number"||n<0)&&(n=2),n){case 0:return Math.round(t);case 1:return Math.round(t*10)/10;case 2:return Math.round(t*100)/100;case 3:return Math.round(t*1e3)/1e3;case 4:return Math.round(t*1e4)/1e4;default:{const r=Math.pow(10,n);return Math.round(t*r)/r}}}function s(t=0,n=!1){const r=Math.floor(t);return n?r.toLocaleString("en",a):r.toString()}function d(t=1e9){return Math.floor(Math.random()*(t+1))}function o(t){const n=Number(t);return isNaN(n)?0:n}function l(t=0){const n=t.toString();if(!n.includes("."))return t;const r=n.replace(/\.?0+$/,"");return Number(r)}const f={toInt:s,round:e,toMoney:u,randInt:d,withoutNan:o,removeTrailingZeros:l,roundNoNan:c};exports.default=f;exports.withoutNan=o;
@@ -1,17 +0,0 @@
1
- declare function toMoney(num?: number): string;
2
- declare function roundNoNan(num?: number, pow?: number): number | undefined;
3
- declare function round(num?: number, pow?: number): number;
4
- declare function toInt(num?: number, formatted?: boolean): string;
5
- declare function randInt(max?: number): number;
6
- export declare function withoutNan(value: number): number;
7
- declare function removeTrailingZeros(num?: number): number;
8
- declare const _default: {
9
- toInt: typeof toInt;
10
- round: typeof round;
11
- toMoney: typeof toMoney;
12
- randInt: typeof randInt;
13
- withoutNan: typeof withoutNan;
14
- removeTrailingZeros: typeof removeTrailingZeros;
15
- roundNoNan: typeof roundNoNan;
16
- };
17
- export default _default;
@@ -1,60 +0,0 @@
1
- const o = {
2
- minimumFractionDigits: 2,
3
- maximumFractionDigits: 2
4
- }, i = { minimumFractionDigits: 0, maximumFractionDigits: 0 };
5
- function a(t = 0) {
6
- return (+t).toLocaleString("en", o);
7
- }
8
- function u(t = 0, n = 2) {
9
- const r = e(t, n);
10
- return isNaN(r) ? void 0 : r;
11
- }
12
- function e(t = 0, n = 2) {
13
- switch (t = +t, (typeof n != "number" || n < 0) && (n = 2), n) {
14
- case 0:
15
- return Math.round(t);
16
- case 1:
17
- return Math.round(t * 10) / 10;
18
- case 2:
19
- return Math.round(t * 100) / 100;
20
- case 3:
21
- return Math.round(t * 1e3) / 1e3;
22
- case 4:
23
- return Math.round(t * 1e4) / 1e4;
24
- default: {
25
- const r = Math.pow(10, n);
26
- return Math.round(t * r) / r;
27
- }
28
- }
29
- }
30
- function c(t = 0, n = !1) {
31
- const r = Math.floor(t);
32
- return n ? r.toLocaleString("en", i) : r.toString();
33
- }
34
- function s(t = 1e9) {
35
- return Math.floor(Math.random() * (t + 1));
36
- }
37
- function d(t) {
38
- const n = Number(t);
39
- return isNaN(n) ? 0 : n;
40
- }
41
- function f(t = 0) {
42
- const n = t.toString();
43
- if (!n.includes("."))
44
- return t;
45
- const r = n.replace(/\.?0+$/, "");
46
- return Number(r);
47
- }
48
- const m = {
49
- toInt: c,
50
- round: e,
51
- toMoney: a,
52
- randInt: s,
53
- withoutNan: d,
54
- removeTrailingZeros: f,
55
- roundNoNan: u
56
- };
57
- export {
58
- m as default,
59
- d as withoutNan
60
- };
@@ -1 +0,0 @@
1
- "use strict";const s=require("./NumberUtil.cjs.js"),n=require("../locale/index.cjs.js"),o=e=>[{required:!0,message:`${e} ${n.t("err.validation.required")}`}],d=()=>[{min:8,message:n.t("err.validation.minLength8")}],m=()=>[{type:"number",validator(e,t,r){const i=Number(t),a=n.t("err.validation.percentage");isNaN(i)&&t||i<0||i>100?r(a):r()},message:n.t("err.validation.percentage")}],u=e=>[{max:Number(e),min:0,type:"number",message:n.t("err.validation.maximumValueExceeded").replace("%maxValue%",s.default.toMoney(e))}],l=()=>[{validator:(e,t,r)=>{const i=n.t("err.validation.invalidNic");return(t.length===12||t.length===10)&&t.search(/^([0-9]{9}[x|X|v|V])|([0-9]{12})$/)!==-1?r():r(i)}}],g=e=>[{message:`${n.t("err.validation.invalid")} ${e}`,pattern:/^(?:0|94|\+94|0094)?(?:(11|21|23|24|25|26|27|31|32|33|34|35|36|37|38|41|45|47|51|52|54|55|57|63|65|66|67|81|91)(0|2|3|4|5|7|9)|7(0|1|2|4|5|6|7|8)\d)\d{6}$/}],c=()=>[{message:n.t("err.validation.positiveNumber"),type:"number",validator(t,r,i){r<=0?i(t.message):i()}}],v={percentageValidation:m,required:o,maxValidation:u,passwordValidation:d,nicValidation:l,phoneValidation:g,positiveNumberValidation:c};module.exports=v;
@@ -1,14 +0,0 @@
1
- import { Rule } from 'antd/lib/form';
2
- declare const _default: {
3
- percentageValidation: () => Rule[];
4
- required: (modelName: string) => {
5
- required: boolean;
6
- message: string;
7
- }[];
8
- maxValidation: (max: number) => Rule[];
9
- passwordValidation: () => Rule[];
10
- nicValidation: () => Rule[];
11
- phoneValidation: (modelName: string) => Rule[];
12
- positiveNumberValidation: () => Rule[];
13
- };
14
- export default _default;
@@ -1,63 +0,0 @@
1
- import s from "./NumberUtil.es.js";
2
- import { t as a } from "../locale/index.es.js";
3
- const o = (e) => [
4
- {
5
- required: !0,
6
- message: `${e} ${a("err.validation.required")}`
7
- }
8
- ], m = () => [
9
- {
10
- min: 8,
11
- message: a("err.validation.minLength8")
12
- }
13
- ], d = () => [
14
- {
15
- type: "number",
16
- validator(e, r, t) {
17
- const i = Number(r), n = a("err.validation.percentage");
18
- isNaN(i) && r || i < 0 || i > 100 ? t(n) : t();
19
- },
20
- message: a("err.validation.percentage")
21
- }
22
- ], u = (e) => [
23
- {
24
- max: Number(e),
25
- min: 0,
26
- type: "number",
27
- message: a("err.validation.maximumValueExceeded").replace(
28
- "%maxValue%",
29
- s.toMoney(e)
30
- )
31
- }
32
- ], l = () => [
33
- {
34
- validator: (e, r, t) => {
35
- const i = a("err.validation.invalidNic");
36
- return (r.length === 12 || r.length === 10) && r.search(/^([0-9]{9}[x|X|v|V])|([0-9]{12})$/) !== -1 ? t() : t(i);
37
- }
38
- }
39
- ], g = (e) => [
40
- {
41
- message: `${a("err.validation.invalid")} ${e}`,
42
- pattern: /^(?:0|94|\+94|0094)?(?:(11|21|23|24|25|26|27|31|32|33|34|35|36|37|38|41|45|47|51|52|54|55|57|63|65|66|67|81|91)(0|2|3|4|5|7|9)|7(0|1|2|4|5|6|7|8)\d)\d{6}$/
43
- }
44
- ], p = () => [
45
- {
46
- message: a("err.validation.positiveNumber"),
47
- type: "number",
48
- validator(r, t, i) {
49
- t <= 0 ? i(r.message) : i();
50
- }
51
- }
52
- ], V = {
53
- percentageValidation: d,
54
- required: o,
55
- maxValidation: u,
56
- passwordValidation: m,
57
- nicValidation: l,
58
- phoneValidation: g,
59
- positiveNumberValidation: p
60
- };
61
- export {
62
- V as default
63
- };
package/util/index.cjs.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./DateUtil.cjs.js"),e=require("./NumberUtil.cjs.js"),i=require("./ImageUtil.cjs.js"),l=require("./ValidationUtil.cjs.js");exports.DateUtil=t;exports.NumberUtil=e.default;exports.ImageUtil=i;exports.ValidationUtil=l;
package/util/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export { default as DateUtil } from './DateUtil';
2
- export { default as NumberUtil } from './NumberUtil';
3
- export { default as ImageUtil } from './ImageUtil';
4
- export { default as ValidationUtil } from './ValidationUtil';
package/util/index.es.js DELETED
@@ -1,10 +0,0 @@
1
- import { default as e } from "./DateUtil.es.js";
2
- import { default as o } from "./NumberUtil.es.js";
3
- import { default as f } from "./ImageUtil.es.js";
4
- import { default as m } from "./ValidationUtil.es.js";
5
- export {
6
- e as DateUtil,
7
- f as ImageUtil,
8
- o as NumberUtil,
9
- m as ValidationUtil
10
- };
package/vite-env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />