@kingteza/crud-component 1.0.23 → 1.0.24
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/package.json +19 -19
- package/dist/App.d.ts +0 -2
- package/dist/components/common/DatePicker/DatePicker.cjs +0 -1
- package/dist/components/common/DatePicker/DatePicker.d.ts +0 -37
- package/dist/components/common/DatePicker/DatePicker.js +0 -88
- package/dist/components/common/DatePicker/TimePicker.cjs +0 -1
- package/dist/components/common/DatePicker/TimePicker.d.ts +0 -34
- package/dist/components/common/DatePicker/TimePicker.js +0 -78
- package/dist/components/common/DatePicker/index.d.ts +0 -3
- package/dist/components/common/appearance/Hider.cjs +0 -1
- package/dist/components/common/appearance/Hider.d.ts +0 -6
- package/dist/components/common/appearance/Hider.js +0 -5
- package/dist/components/common/appearance/index.d.ts +0 -0
- package/dist/components/common/button/Button.cjs +0 -1
- package/dist/components/common/button/Button.d.ts +0 -12
- package/dist/components/common/button/Button.js +0 -79
- package/dist/components/common/button/CloneButtonTable.cjs +0 -1
- package/dist/components/common/button/CloneButtonTable.d.ts +0 -6
- package/dist/components/common/button/CloneButtonTable.js +0 -20
- package/dist/components/common/button/DeleteButtonTable.cjs +0 -1
- package/dist/components/common/button/DeleteButtonTable.d.ts +0 -13
- package/dist/components/common/button/DeleteButtonTable.js +0 -68
- package/dist/components/common/button/ExportButton.cjs +0 -1
- package/dist/components/common/button/ExportButton.d.ts +0 -4
- package/dist/components/common/button/ExportButton.js +0 -27
- package/dist/components/common/button/HideButtonTable.cjs +0 -1
- package/dist/components/common/button/HideButtonTable.d.ts +0 -13
- package/dist/components/common/button/HideButtonTable.js +0 -68
- package/dist/components/common/button/ImportButton.cjs +0 -1
- package/dist/components/common/button/ImportButton.d.ts +0 -9
- package/dist/components/common/button/ImportButton.js +0 -56
- package/dist/components/common/button/NewButton.cjs +0 -1
- package/dist/components/common/button/NewButton.d.ts +0 -12
- package/dist/components/common/button/NewButton.js +0 -24
- package/dist/components/common/button/PrintButton.cjs +0 -1
- package/dist/components/common/button/PrintButton.d.ts +0 -12
- package/dist/components/common/button/PrintButton.js +0 -26
- package/dist/components/common/button/RefreshButton.cjs +0 -1
- package/dist/components/common/button/RefreshButton.d.ts +0 -11
- package/dist/components/common/button/RefreshButton.js +0 -24
- package/dist/components/common/button/UnHideButton.cjs +0 -1
- package/dist/components/common/button/UnHideButton.d.ts +0 -14
- package/dist/components/common/button/UnHideButton.js +0 -70
- package/dist/components/common/button/UpdateButtonTable.cjs +0 -1
- package/dist/components/common/button/UpdateButtonTable.d.ts +0 -6
- package/dist/components/common/button/UpdateButtonTable.js +0 -20
- package/dist/components/common/button/ViewButtonTable.cjs +0 -1
- package/dist/components/common/button/ViewButtonTable.d.ts +0 -6
- package/dist/components/common/button/ViewButtonTable.js +0 -20
- package/dist/components/common/button/index.d.ts +0 -14
- package/dist/components/common/check-box/CheckBox.cjs +0 -1
- package/dist/components/common/check-box/CheckBox.d.ts +0 -9
- package/dist/components/common/check-box/CheckBox.js +0 -40
- package/dist/components/common/check-box/index.d.ts +0 -2
- package/dist/components/common/description/DescList.cjs +0 -1
- package/dist/components/common/description/DescList.d.ts +0 -18
- package/dist/components/common/description/DescList.js +0 -16
- package/dist/components/common/description/DescriptionComponent.d.ts +0 -7
- package/dist/components/common/description/index.d.ts +0 -3
- package/dist/components/common/index.d.ts +0 -22
- package/dist/components/common/layout/VerticalSpace.cjs +0 -1
- package/dist/components/common/layout/VerticalSpace.d.ts +0 -5
- package/dist/components/common/layout/VerticalSpace.js +0 -6
- package/dist/components/common/layout/index.d.ts +0 -2
- package/dist/components/common/loading/LoadingIndicator.cjs +0 -1
- package/dist/components/common/loading/LoadingIndicator.d.ts +0 -6
- package/dist/components/common/loading/LoadingIndicator.js +0 -24
- package/dist/components/common/loading/index.d.ts +0 -2
- package/dist/components/common/picker/ImagePicker.cjs +0 -1
- package/dist/components/common/picker/ImagePicker.d.ts +0 -56
- package/dist/components/common/picker/ImagePicker.js +0 -282
- package/dist/components/common/picker/index.d.ts +0 -2
- package/dist/components/common/radio/RadioGroupComponent.cjs +0 -1
- package/dist/components/common/radio/RadioGroupComponent.d.ts +0 -18
- package/dist/components/common/radio/RadioGroupComponent.js +0 -19
- package/dist/components/common/radio/index.d.ts +0 -2
- package/dist/components/common/report/SelectFieldInReport.cjs +0 -1
- package/dist/components/common/report/SelectFieldInReport.d.ts +0 -16
- package/dist/components/common/report/SelectFieldInReport.js +0 -30
- package/dist/components/common/report/index.d.ts +0 -3
- package/dist/components/common/select/CustomSelectOption.cjs +0 -1
- package/dist/components/common/select/CustomSelectOption.d.ts +0 -7
- package/dist/components/common/select/CustomSelectOption.js +0 -13
- package/dist/components/common/select/SelectComponent.cjs +0 -1
- package/dist/components/common/select/SelectComponent.d.ts +0 -21
- package/dist/components/common/select/SelectComponent.js +0 -89
- package/dist/components/common/select/index.d.ts +0 -3
- package/dist/components/common/show-more/index.cjs +0 -1
- package/dist/components/common/show-more/index.d.ts +0 -4
- package/dist/components/common/show-more/index.js +0 -8
- package/dist/components/common/tab/TabViewWithRoute.cjs +0 -1
- package/dist/components/common/tab/TabViewWithRoute.d.ts +0 -13
- package/dist/components/common/tab/TabViewWithRoute.js +0 -38
- package/dist/components/common/tab/index.d.ts +0 -2
- package/dist/components/common/table/index.d.ts +0 -3
- package/dist/components/common/table/table.cjs +0 -1
- package/dist/components/common/table/table.d.ts +0 -19
- package/dist/components/common/table/table.js +0 -40
- package/dist/components/common/tag/StatusTag.cjs +0 -1
- package/dist/components/common/tag/StatusTag.d.ts +0 -14
- package/dist/components/common/tag/StatusTag.js +0 -30
- package/dist/components/common/tag/index.d.ts +0 -2
- package/dist/components/common/text/index.cjs +0 -1
- package/dist/components/common/text/index.d.ts +0 -3
- package/dist/components/common/text/index.js +0 -5
- package/dist/components/common/text/title/TitleWithHeadTitle.d.ts +0 -7
- package/dist/components/common/text/title/index.cjs +0 -1
- package/dist/components/common/text/title/index.d.ts +0 -1
- package/dist/components/common/text/title/index.js +0 -5
- package/dist/components/common/text-field/NumberField.cjs +0 -1
- package/dist/components/common/text-field/NumberField.d.ts +0 -13
- package/dist/components/common/text-field/NumberField.js +0 -83
- package/dist/components/common/text-field/PhoneNumberField.cjs +0 -1
- package/dist/components/common/text-field/PhoneNumberField.d.ts +0 -4
- package/dist/components/common/text-field/PhoneNumberField.js +0 -18
- package/dist/components/common/text-field/TextArea.cjs +0 -1
- package/dist/components/common/text-field/TextArea.d.ts +0 -17
- package/dist/components/common/text-field/TextArea.js +0 -47
- package/dist/components/common/text-field/TextField.cjs +0 -1
- package/dist/components/common/text-field/TextField.d.ts +0 -27
- package/dist/components/common/text-field/TextField.js +0 -73
- package/dist/components/common/text-field/index.d.ts +0 -5
- package/dist/components/common/tooltip/TooltipComponent.cjs +0 -1
- package/dist/components/common/tooltip/TooltipComponent.d.ts +0 -5
- package/dist/components/common/tooltip/TooltipComponent.js +0 -9
- package/dist/components/common/tooltip/index.d.ts +0 -2
- package/dist/components/common/wizard/WizardResult.cjs +0 -1
- package/dist/components/common/wizard/WizardResult.d.ts +0 -16
- package/dist/components/common/wizard/WizardResult.js +0 -60
- package/dist/components/common/wizard/WizardViewForm.cjs +0 -1
- package/dist/components/common/wizard/WizardViewForm.d.ts +0 -24
- package/dist/components/common/wizard/WizardViewForm.js +0 -74
- package/dist/components/common/wizard/index.d.ts +0 -3
- package/dist/components/crud/CrudComponent.cjs +0 -1
- package/dist/components/crud/CrudComponent.d.ts +0 -237
- package/dist/components/crud/CrudComponent.js +0 -210
- package/dist/components/crud/CrudField.cjs +0 -1
- package/dist/components/crud/CrudField.d.ts +0 -4
- package/dist/components/crud/CrudField.js +0 -459
- package/dist/components/crud/CrudForm.cjs +0 -1
- package/dist/components/crud/CrudForm.d.ts +0 -14
- package/dist/components/crud/CrudForm.js +0 -91
- package/dist/components/crud/CrudFormWizard.cjs +0 -1
- package/dist/components/crud/CrudFormWizard.d.ts +0 -14
- package/dist/components/crud/CrudFormWizard.js +0 -140
- package/dist/components/crud/CrudReportComponent.cjs +0 -4
- package/dist/components/crud/CrudReportComponent.d.ts +0 -44
- package/dist/components/crud/CrudReportComponent.js +0 -255
- package/dist/components/crud/CrudSearchComponent.cjs +0 -1
- package/dist/components/crud/CrudSearchComponent.d.ts +0 -21
- package/dist/components/crud/CrudSearchComponent.js +0 -95
- package/dist/components/crud/FileCrudField.cjs +0 -1
- package/dist/components/crud/FileCrudField.d.ts +0 -25
- package/dist/components/crud/FileCrudField.js +0 -220
- package/dist/components/crud/ImageCrudField.cjs +0 -1
- package/dist/components/crud/ImageCrudField.d.ts +0 -38
- package/dist/components/crud/ImageCrudField.js +0 -113
- package/dist/components/crud/import/CrudImportButton.cjs +0 -1
- package/dist/components/crud/import/CrudImportButton.d.ts +0 -3
- package/dist/components/crud/import/CrudImportButton.js +0 -31
- package/dist/components/crud/import/CrudImportComponent.cjs +0 -2
- package/dist/components/crud/import/CrudImportComponent.d.ts +0 -14
- package/dist/components/crud/import/CrudImportComponent.js +0 -223
- package/dist/components/crud/index.d.ts +0 -15
- package/dist/components/crud/view/CrudDecListView.cjs +0 -1
- package/dist/components/crud/view/CrudDecListView.d.ts +0 -14
- package/dist/components/crud/view/CrudDecListView.js +0 -42
- package/dist/components/crud/view/CrudViewer.cjs +0 -1
- package/dist/components/crud/view/CrudViewer.d.ts +0 -43
- package/dist/components/crud/view/CrudViewer.js +0 -217
- package/dist/components/crud/view/CrudViewerUtil.cjs +0 -1
- package/dist/components/crud/view/CrudViewerUtil.d.ts +0 -2
- package/dist/components/crud/view/CrudViewerUtil.js +0 -57
- package/dist/components/crud/view/index.d.ts +0 -5
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -32
- package/dist/locale/hooks/translation-constants.cjs +0 -1
- package/dist/locale/hooks/translation-constants.d.ts +0 -1
- package/dist/locale/hooks/translation-constants.js +0 -4
- package/dist/locale/index.cjs +0 -1
- package/dist/locale/index.d.ts +0 -74
- package/dist/locale/index.js +0 -37
- package/dist/locale/translations/en.cjs +0 -1
- package/dist/locale/translations/en.d.ts +0 -58
- package/dist/locale/translations/en.js +0 -60
- package/dist/main.d.ts +0 -0
- package/dist/util/DateUtil.cjs +0 -1
- package/dist/util/DateUtil.d.ts +0 -7
- package/dist/util/DateUtil.js +0 -6
- package/dist/util/ImageUtil.cjs +0 -1
- package/dist/util/ImageUtil.d.ts +0 -14
- package/dist/util/ImageUtil.js +0 -63
- package/dist/util/NumberUtil.cjs +0 -1
- package/dist/util/NumberUtil.d.ts +0 -17
- package/dist/util/NumberUtil.js +0 -60
- package/dist/util/ValidationUtil.cjs +0 -1
- package/dist/util/ValidationUtil.d.ts +0 -14
- package/dist/util/ValidationUtil.js +0 -60
- package/dist/util/index.cjs +0 -1
- package/dist/util/index.d.ts +0 -4
- package/dist/util/index.js +0 -10
- package/dist/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/dist/main.d.ts
DELETED
|
File without changes
|
package/dist/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;
|
package/dist/util/DateUtil.d.ts
DELETED
package/dist/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
|
-
};
|
package/dist/util/ImageUtil.cjs
DELETED
|
@@ -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;
|
package/dist/util/ImageUtil.d.ts
DELETED
|
@@ -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/dist/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
|
-
};
|
package/dist/util/NumberUtil.cjs
DELETED
|
@@ -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;
|
package/dist/util/NumberUtil.js
DELETED
|
@@ -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/dist/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/dist/util/index.d.ts
DELETED
package/dist/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/dist/vite-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|