@kingteza/crud-component 1.0.25 → 1.0.26

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 (204) hide show
  1. package/README.md +89 -0
  2. package/package.json +4 -6
  3. package/App.d.ts +0 -2
  4. package/components/common/DatePicker/DatePicker.cjs +0 -1
  5. package/components/common/DatePicker/DatePicker.d.ts +0 -37
  6. package/components/common/DatePicker/DatePicker.js +0 -88
  7. package/components/common/DatePicker/TimePicker.cjs +0 -1
  8. package/components/common/DatePicker/TimePicker.d.ts +0 -34
  9. package/components/common/DatePicker/TimePicker.js +0 -78
  10. package/components/common/DatePicker/index.d.ts +0 -3
  11. package/components/common/appearance/Hider.cjs +0 -1
  12. package/components/common/appearance/Hider.d.ts +0 -6
  13. package/components/common/appearance/Hider.js +0 -5
  14. package/components/common/appearance/index.d.ts +0 -0
  15. package/components/common/button/Button.cjs +0 -1
  16. package/components/common/button/Button.d.ts +0 -12
  17. package/components/common/button/Button.js +0 -79
  18. package/components/common/button/CloneButtonTable.cjs +0 -1
  19. package/components/common/button/CloneButtonTable.d.ts +0 -6
  20. package/components/common/button/CloneButtonTable.js +0 -20
  21. package/components/common/button/DeleteButtonTable.cjs +0 -1
  22. package/components/common/button/DeleteButtonTable.d.ts +0 -13
  23. package/components/common/button/DeleteButtonTable.js +0 -68
  24. package/components/common/button/ExportButton.cjs +0 -1
  25. package/components/common/button/ExportButton.d.ts +0 -4
  26. package/components/common/button/ExportButton.js +0 -27
  27. package/components/common/button/HideButtonTable.cjs +0 -1
  28. package/components/common/button/HideButtonTable.d.ts +0 -13
  29. package/components/common/button/HideButtonTable.js +0 -68
  30. package/components/common/button/ImportButton.cjs +0 -1
  31. package/components/common/button/ImportButton.d.ts +0 -9
  32. package/components/common/button/ImportButton.js +0 -56
  33. package/components/common/button/NewButton.cjs +0 -1
  34. package/components/common/button/NewButton.d.ts +0 -12
  35. package/components/common/button/NewButton.js +0 -24
  36. package/components/common/button/PrintButton.cjs +0 -1
  37. package/components/common/button/PrintButton.d.ts +0 -12
  38. package/components/common/button/PrintButton.js +0 -26
  39. package/components/common/button/RefreshButton.cjs +0 -1
  40. package/components/common/button/RefreshButton.d.ts +0 -11
  41. package/components/common/button/RefreshButton.js +0 -24
  42. package/components/common/button/UnHideButton.cjs +0 -1
  43. package/components/common/button/UnHideButton.d.ts +0 -14
  44. package/components/common/button/UnHideButton.js +0 -70
  45. package/components/common/button/UpdateButtonTable.cjs +0 -1
  46. package/components/common/button/UpdateButtonTable.d.ts +0 -6
  47. package/components/common/button/UpdateButtonTable.js +0 -20
  48. package/components/common/button/ViewButtonTable.cjs +0 -1
  49. package/components/common/button/ViewButtonTable.d.ts +0 -6
  50. package/components/common/button/ViewButtonTable.js +0 -20
  51. package/components/common/button/index.d.ts +0 -14
  52. package/components/common/check-box/CheckBox.cjs +0 -1
  53. package/components/common/check-box/CheckBox.d.ts +0 -9
  54. package/components/common/check-box/CheckBox.js +0 -40
  55. package/components/common/check-box/index.d.ts +0 -2
  56. package/components/common/description/DescList.cjs +0 -1
  57. package/components/common/description/DescList.d.ts +0 -18
  58. package/components/common/description/DescList.js +0 -16
  59. package/components/common/description/DescriptionComponent.d.ts +0 -7
  60. package/components/common/description/index.d.ts +0 -3
  61. package/components/common/index.d.ts +0 -22
  62. package/components/common/layout/VerticalSpace.cjs +0 -1
  63. package/components/common/layout/VerticalSpace.d.ts +0 -5
  64. package/components/common/layout/VerticalSpace.js +0 -6
  65. package/components/common/layout/index.d.ts +0 -2
  66. package/components/common/loading/LoadingIndicator.cjs +0 -1
  67. package/components/common/loading/LoadingIndicator.d.ts +0 -6
  68. package/components/common/loading/LoadingIndicator.js +0 -24
  69. package/components/common/loading/index.d.ts +0 -2
  70. package/components/common/picker/ImagePicker.cjs +0 -1
  71. package/components/common/picker/ImagePicker.d.ts +0 -56
  72. package/components/common/picker/ImagePicker.js +0 -282
  73. package/components/common/picker/index.d.ts +0 -2
  74. package/components/common/radio/RadioGroupComponent.cjs +0 -1
  75. package/components/common/radio/RadioGroupComponent.d.ts +0 -18
  76. package/components/common/radio/RadioGroupComponent.js +0 -19
  77. package/components/common/radio/index.d.ts +0 -2
  78. package/components/common/report/SelectFieldInReport.cjs +0 -1
  79. package/components/common/report/SelectFieldInReport.d.ts +0 -16
  80. package/components/common/report/SelectFieldInReport.js +0 -30
  81. package/components/common/report/index.d.ts +0 -3
  82. package/components/common/select/CustomSelectOption.cjs +0 -1
  83. package/components/common/select/CustomSelectOption.d.ts +0 -7
  84. package/components/common/select/CustomSelectOption.js +0 -13
  85. package/components/common/select/SelectComponent.cjs +0 -1
  86. package/components/common/select/SelectComponent.d.ts +0 -21
  87. package/components/common/select/SelectComponent.js +0 -89
  88. package/components/common/select/index.d.ts +0 -3
  89. package/components/common/show-more/index.cjs +0 -1
  90. package/components/common/show-more/index.d.ts +0 -4
  91. package/components/common/show-more/index.js +0 -8
  92. package/components/common/tab/TabViewWithRoute.cjs +0 -1
  93. package/components/common/tab/TabViewWithRoute.d.ts +0 -13
  94. package/components/common/tab/TabViewWithRoute.js +0 -38
  95. package/components/common/tab/index.d.ts +0 -2
  96. package/components/common/table/index.d.ts +0 -3
  97. package/components/common/table/table.cjs +0 -1
  98. package/components/common/table/table.d.ts +0 -19
  99. package/components/common/table/table.js +0 -40
  100. package/components/common/tag/StatusTag.cjs +0 -1
  101. package/components/common/tag/StatusTag.d.ts +0 -14
  102. package/components/common/tag/StatusTag.js +0 -30
  103. package/components/common/tag/index.d.ts +0 -2
  104. package/components/common/text/index.cjs +0 -1
  105. package/components/common/text/index.d.ts +0 -3
  106. package/components/common/text/index.js +0 -5
  107. package/components/common/text/title/TitleWithHeadTitle.d.ts +0 -7
  108. package/components/common/text/title/index.cjs +0 -1
  109. package/components/common/text/title/index.d.ts +0 -1
  110. package/components/common/text/title/index.js +0 -5
  111. package/components/common/text-field/NumberField.cjs +0 -1
  112. package/components/common/text-field/NumberField.d.ts +0 -13
  113. package/components/common/text-field/NumberField.js +0 -83
  114. package/components/common/text-field/PhoneNumberField.cjs +0 -1
  115. package/components/common/text-field/PhoneNumberField.d.ts +0 -4
  116. package/components/common/text-field/PhoneNumberField.js +0 -18
  117. package/components/common/text-field/TextArea.cjs +0 -1
  118. package/components/common/text-field/TextArea.d.ts +0 -17
  119. package/components/common/text-field/TextArea.js +0 -47
  120. package/components/common/text-field/TextField.cjs +0 -1
  121. package/components/common/text-field/TextField.d.ts +0 -27
  122. package/components/common/text-field/TextField.js +0 -73
  123. package/components/common/text-field/index.d.ts +0 -5
  124. package/components/common/tooltip/TooltipComponent.cjs +0 -1
  125. package/components/common/tooltip/TooltipComponent.d.ts +0 -5
  126. package/components/common/tooltip/TooltipComponent.js +0 -9
  127. package/components/common/tooltip/index.d.ts +0 -2
  128. package/components/common/wizard/WizardResult.cjs +0 -1
  129. package/components/common/wizard/WizardResult.d.ts +0 -16
  130. package/components/common/wizard/WizardResult.js +0 -60
  131. package/components/common/wizard/WizardViewForm.cjs +0 -1
  132. package/components/common/wizard/WizardViewForm.d.ts +0 -24
  133. package/components/common/wizard/WizardViewForm.js +0 -74
  134. package/components/common/wizard/index.d.ts +0 -3
  135. package/components/crud/CrudComponent.cjs +0 -1
  136. package/components/crud/CrudComponent.d.ts +0 -237
  137. package/components/crud/CrudComponent.js +0 -210
  138. package/components/crud/CrudField.cjs +0 -1
  139. package/components/crud/CrudField.d.ts +0 -4
  140. package/components/crud/CrudField.js +0 -459
  141. package/components/crud/CrudForm.cjs +0 -1
  142. package/components/crud/CrudForm.d.ts +0 -14
  143. package/components/crud/CrudForm.js +0 -91
  144. package/components/crud/CrudFormWizard.cjs +0 -1
  145. package/components/crud/CrudFormWizard.d.ts +0 -14
  146. package/components/crud/CrudFormWizard.js +0 -140
  147. package/components/crud/CrudReportComponent.cjs +0 -4
  148. package/components/crud/CrudReportComponent.d.ts +0 -44
  149. package/components/crud/CrudReportComponent.js +0 -255
  150. package/components/crud/CrudSearchComponent.cjs +0 -1
  151. package/components/crud/CrudSearchComponent.d.ts +0 -21
  152. package/components/crud/CrudSearchComponent.js +0 -95
  153. package/components/crud/FileCrudField.cjs +0 -1
  154. package/components/crud/FileCrudField.d.ts +0 -25
  155. package/components/crud/FileCrudField.js +0 -220
  156. package/components/crud/ImageCrudField.cjs +0 -1
  157. package/components/crud/ImageCrudField.d.ts +0 -38
  158. package/components/crud/ImageCrudField.js +0 -113
  159. package/components/crud/import/CrudImportButton.cjs +0 -1
  160. package/components/crud/import/CrudImportButton.d.ts +0 -3
  161. package/components/crud/import/CrudImportButton.js +0 -31
  162. package/components/crud/import/CrudImportComponent.cjs +0 -2
  163. package/components/crud/import/CrudImportComponent.d.ts +0 -14
  164. package/components/crud/import/CrudImportComponent.js +0 -223
  165. package/components/crud/index.d.ts +0 -15
  166. package/components/crud/view/CrudDecListView.cjs +0 -1
  167. package/components/crud/view/CrudDecListView.d.ts +0 -14
  168. package/components/crud/view/CrudDecListView.js +0 -42
  169. package/components/crud/view/CrudViewer.cjs +0 -1
  170. package/components/crud/view/CrudViewer.d.ts +0 -43
  171. package/components/crud/view/CrudViewer.js +0 -217
  172. package/components/crud/view/CrudViewerUtil.cjs +0 -1
  173. package/components/crud/view/CrudViewerUtil.d.ts +0 -2
  174. package/components/crud/view/CrudViewerUtil.js +0 -57
  175. package/components/crud/view/index.d.ts +0 -5
  176. package/index.cjs +0 -1
  177. package/index.d.ts +0 -4
  178. package/index.js +0 -32
  179. package/locale/hooks/translation-constants.cjs +0 -1
  180. package/locale/hooks/translation-constants.d.ts +0 -1
  181. package/locale/hooks/translation-constants.js +0 -4
  182. package/locale/index.cjs +0 -1
  183. package/locale/index.d.ts +0 -74
  184. package/locale/index.js +0 -37
  185. package/locale/translations/en.cjs +0 -1
  186. package/locale/translations/en.d.ts +0 -58
  187. package/locale/translations/en.js +0 -60
  188. package/main.d.ts +0 -0
  189. package/util/DateUtil.cjs +0 -1
  190. package/util/DateUtil.d.ts +0 -7
  191. package/util/DateUtil.js +0 -6
  192. package/util/ImageUtil.cjs +0 -1
  193. package/util/ImageUtil.d.ts +0 -14
  194. package/util/ImageUtil.js +0 -63
  195. package/util/NumberUtil.cjs +0 -1
  196. package/util/NumberUtil.d.ts +0 -17
  197. package/util/NumberUtil.js +0 -60
  198. package/util/ValidationUtil.cjs +0 -1
  199. package/util/ValidationUtil.d.ts +0 -14
  200. package/util/ValidationUtil.js +0 -60
  201. package/util/index.cjs +0 -1
  202. package/util/index.d.ts +0 -4
  203. package/util/index.js +0 -10
  204. package/vite-env.d.ts +0 -1
@@ -1,60 +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
- },
34
- err: {
35
- save: "An error occurred while saving",
36
- validation: {
37
- required: "is required",
38
- minLength8: "must be at least 8 characters",
39
- percentage: "must be a percentage",
40
- maximumValueExceeded: "must be less than %maxValue%",
41
- invalidNic: "must be a valid NIC",
42
- invalid: "must be a valid"
43
- },
44
- notFound: "Not Found"
45
- },
46
- message: {
47
- loading: {
48
- saving: "Saving"
49
- }
50
- },
51
- qus: {
52
- importWithIssues: "Some fields have issues. Do you want to proceed with the import?",
53
- doYouWantToDelete: "Do you want to delete?",
54
- doYouWantToHide: "Do you want to hide?",
55
- doYouWantToUnhide: "Do you want to unhide?"
56
- }
57
- };
58
- export {
59
- e as default
60
- };
package/main.d.ts DELETED
File without changes
package/util/DateUtil.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";const e=require("dayjs"),a=require("i18next"),o=t=>e(t).locale(a.language).format("YYYY-MM-DD HH:mm"),m=t=>e(t).locale(a.language).format("YYYY-MM-DD HH:mm:ss"),n=t=>e(t).locale(a.language).format("YYYY-MM-DD"),s=(t,r="HH:mm:ss")=>e(t).locale(a.language).format(r),c={formatDateTime:o,formatDate:n,formatDateTimeWithSecond:m,formatTime:s};module.exports=c;
@@ -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;
package/util/DateUtil.js DELETED
@@ -1,6 +0,0 @@
1
- import t from "dayjs";
2
- import o from "i18next";
3
- const m = (a) => t(a).locale(o.language).format("YYYY-MM-DD HH:mm"), r = (a) => t(a).locale(o.language).format("YYYY-MM-DD HH:mm:ss"), n = (a) => t(a).locale(o.language).format("YYYY-MM-DD"), l = (a, e = "HH:mm:ss") => t(a).locale(o.language).format(e), s = { formatDateTime: m, formatDate: n, formatDateTimeWithSecond: r, formatTime: l };
4
- export {
5
- s as default
6
- };
@@ -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;
package/util/ImageUtil.js DELETED
@@ -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 i=require("i18next"),a=require("./NumberUtil.cjs"),o=e=>[{required:!0,message:`${e} ${i.t("err.validation.required")}`}],s=()=>[{min:8,message:i.t("err.validation.minLength8")}],d=()=>[{type:"number",validator(e,r,t){const n=Number(r);isNaN(n)&&r||n<0||n>100?t(i.t("err.validation.percentage")):t()},message:i.t("err.validation.percentage")}],u=e=>[{max:Number(e),min:0,type:"number",message:i.t("err.validation.maximumValueExceeded").replace("%maxValue%",a.default.toMoney(e))}],l=()=>[{validator:(e,r,t)=>(r.length===12||r.length===10)&&r.search(/^([0-9]{9}[x|X|v|V])|([0-9]{12})$/)!==-1?t():t(i.t("err.validation.invalidNic"))}],m=e=>[{message:`${i.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}$/}],v=()=>[{message:`${i.t("err.validation.positiveNumber")}`,type:"number",validator(e,r,t){r<=0?t(e.message):t()}}],g={percentageValidation:d,required:o,maxValidation:u,passwordValidation:s,nicValidation:l,phoneValidation:m,positiveNumberValidation:v};module.exports=g;
@@ -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,60 +0,0 @@
1
- import { t as r } from "i18next";
2
- import n from "./NumberUtil.js";
3
- const o = (e) => [
4
- {
5
- required: !0,
6
- message: `${e} ${r("err.validation.required")}`
7
- }
8
- ], s = () => [
9
- {
10
- min: 8,
11
- message: r("err.validation.minLength8")
12
- }
13
- ], d = () => [
14
- {
15
- type: "number",
16
- validator(e, t, i) {
17
- const a = Number(t);
18
- isNaN(a) && t ? i(r("err.validation.percentage")) : a < 0 || a > 100 ? i(r("err.validation.percentage")) : i();
19
- },
20
- message: r("err.validation.percentage")
21
- }
22
- ], m = (e) => [
23
- {
24
- max: Number(e),
25
- min: 0,
26
- type: "number",
27
- message: r("err.validation.maximumValueExceeded").replace(
28
- "%maxValue%",
29
- n.toMoney(e)
30
- )
31
- }
32
- ], l = () => [
33
- {
34
- validator: (e, t, i) => t.length === 12 || t.length === 10 ? t.search(/^([0-9]{9}[x|X|v|V])|([0-9]{12})$/) !== -1 ? i() : i(r("err.validation.invalidNic")) : i(r("err.validation.invalidNic"))
35
- }
36
- ], u = (e) => [
37
- {
38
- message: `${r("err.validation.invalid")} ${e}`,
39
- 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}$/
40
- }
41
- ], v = () => [
42
- {
43
- message: `${r("err.validation.positiveNumber")}`,
44
- type: "number",
45
- validator(e, t, i) {
46
- t <= 0 ? i(e.message) : i();
47
- }
48
- }
49
- ], V = {
50
- percentageValidation: d,
51
- required: o,
52
- maxValidation: m,
53
- passwordValidation: s,
54
- nicValidation: l,
55
- phoneValidation: u,
56
- positiveNumberValidation: v
57
- };
58
- export {
59
- V as default
60
- };
package/util/index.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./DateUtil.cjs"),e=require("./NumberUtil.cjs"),i=require("./ImageUtil.cjs"),l=require("./ValidationUtil.cjs");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.js DELETED
@@ -1,10 +0,0 @@
1
- import { default as e } from "./DateUtil.js";
2
- import { default as o } from "./NumberUtil.js";
3
- import { default as f } from "./ImageUtil.js";
4
- import { default as m } from "./ValidationUtil.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" />