@kingteza/crud-component 1.2.1 → 1.2.2
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/dist/Play.d.ts +2 -0
- package/dist/README.md +89 -0
- package/dist/common/appearance/Hider.cjs.js +1 -0
- package/dist/common/appearance/Hider.d.ts +6 -0
- package/dist/common/appearance/Hider.es.js +5 -0
- package/dist/common/appearance/index.d.ts +1 -0
- package/dist/common/button/Button.cjs.js +1 -0
- package/dist/common/button/Button.d.ts +11 -0
- package/dist/common/button/Button.es.js +57 -0
- package/dist/common/button/CloneButtonTable.cjs.js +1 -0
- package/dist/common/button/CloneButtonTable.d.ts +6 -0
- package/dist/common/button/CloneButtonTable.es.js +19 -0
- package/dist/common/button/DeleteButtonTable.cjs.js +1 -0
- package/dist/common/button/DeleteButtonTable.d.ts +13 -0
- package/dist/common/button/DeleteButtonTable.es.js +64 -0
- package/dist/common/button/ExportButton.cjs.js +1 -0
- package/dist/common/button/ExportButton.d.ts +4 -0
- package/dist/common/button/ExportButton.es.js +26 -0
- package/dist/common/button/HideButtonTable.cjs.js +1 -0
- package/dist/common/button/HideButtonTable.d.ts +13 -0
- package/dist/common/button/HideButtonTable.es.js +67 -0
- package/dist/common/button/ImportButton.cjs.js +1 -0
- package/dist/common/button/ImportButton.d.ts +9 -0
- package/dist/common/button/ImportButton.es.js +55 -0
- package/dist/common/button/NewButton.cjs.js +1 -0
- package/dist/common/button/NewButton.d.ts +12 -0
- package/dist/common/button/NewButton.es.js +23 -0
- package/dist/common/button/PrintButton.cjs.js +1 -0
- package/dist/common/button/PrintButton.d.ts +12 -0
- package/dist/common/button/PrintButton.es.js +25 -0
- package/dist/common/button/RefreshButton.cjs.js +1 -0
- package/dist/common/button/RefreshButton.d.ts +11 -0
- package/dist/common/button/RefreshButton.es.js +23 -0
- package/dist/common/button/UnHideButton.cjs.js +1 -0
- package/dist/common/button/UnHideButton.d.ts +14 -0
- package/dist/common/button/UnHideButton.es.js +69 -0
- package/dist/common/button/UpdateButtonTable.cjs.js +1 -0
- package/dist/common/button/UpdateButtonTable.d.ts +6 -0
- package/dist/common/button/UpdateButtonTable.es.js +19 -0
- package/dist/common/button/ViewButtonTable.cjs.js +1 -0
- package/dist/common/button/ViewButtonTable.d.ts +6 -0
- package/dist/common/button/ViewButtonTable.es.js +19 -0
- package/dist/common/button/index.d.ts +14 -0
- package/dist/common/check-box/CheckBox.cjs.js +1 -0
- package/dist/common/check-box/CheckBox.d.ts +9 -0
- package/dist/common/check-box/CheckBox.es.js +40 -0
- package/dist/common/check-box/index.d.ts +2 -0
- package/dist/common/date-picker/DatePicker.cjs.js +1 -0
- package/dist/common/date-picker/DatePicker.d.ts +37 -0
- package/dist/common/date-picker/DatePicker.es.js +87 -0
- package/dist/common/date-picker/TimePicker.cjs.js +1 -0
- package/dist/common/date-picker/TimePicker.d.ts +34 -0
- package/dist/common/date-picker/TimePicker.es.js +77 -0
- package/dist/common/date-picker/index.d.ts +3 -0
- package/dist/common/description/DescList.cjs.js +1 -0
- package/dist/common/description/DescList.d.ts +18 -0
- package/dist/common/description/DescList.es.js +16 -0
- package/dist/common/description/DescriptionComponent.d.ts +7 -0
- package/dist/common/description/index.d.ts +3 -0
- package/dist/common/icon/KIcon.cjs.js +1 -0
- package/dist/common/icon/KIcon.d.ts +9 -0
- package/dist/common/icon/KIcon.es.js +11 -0
- package/dist/common/index.cjs.js +1 -0
- package/dist/common/index.d.ts +20 -0
- package/dist/common/index.es.js +78 -0
- package/dist/common/layout/VerticalSpace.cjs.js +1 -0
- package/dist/common/layout/VerticalSpace.d.ts +5 -0
- package/dist/common/layout/VerticalSpace.es.js +6 -0
- package/dist/common/layout/index.d.ts +2 -0
- package/dist/common/loading/LoadingIndicator.cjs.js +1 -0
- package/dist/common/loading/LoadingIndicator.d.ts +6 -0
- package/dist/common/loading/LoadingIndicator.es.js +23 -0
- package/dist/common/loading/index.d.ts +2 -0
- package/dist/common/picker/ImagePicker.cjs.js +1 -0
- package/dist/common/picker/ImagePicker.d.ts +56 -0
- package/dist/common/picker/ImagePicker.es.js +320 -0
- package/dist/common/picker/index.d.ts +2 -0
- package/dist/common/radio/RadioGroupComponent.cjs.js +1 -0
- package/dist/common/radio/RadioGroupComponent.d.ts +18 -0
- package/dist/common/radio/RadioGroupComponent.es.js +19 -0
- package/dist/common/radio/index.d.ts +2 -0
- package/dist/common/report/SelectFieldInReport.cjs.js +1 -0
- package/dist/common/report/SelectFieldInReport.d.ts +16 -0
- package/dist/common/report/SelectFieldInReport.es.js +30 -0
- package/dist/common/report/index.d.ts +3 -0
- package/dist/common/rich/index.cjs.js +1 -0
- package/dist/common/rich/index.d.ts +10 -0
- package/dist/common/rich/index.es.js +66 -0
- package/dist/common/select/CustomSelectOption.cjs.js +1 -0
- package/dist/common/select/CustomSelectOption.d.ts +7 -0
- package/dist/common/select/CustomSelectOption.es.js +13 -0
- package/dist/common/select/SelectComponent.cjs.js +1 -0
- package/dist/common/select/SelectComponent.d.ts +21 -0
- package/dist/common/select/SelectComponent.es.js +85 -0
- package/dist/common/select/index.d.ts +3 -0
- package/dist/common/show-more/index.cjs.js +1 -0
- package/dist/common/show-more/index.d.ts +4 -0
- package/dist/common/show-more/index.es.js +8 -0
- package/dist/common/tab/TabViewWithRoute.cjs.js +1 -0
- package/dist/common/tab/TabViewWithRoute.d.ts +13 -0
- package/dist/common/tab/TabViewWithRoute.es.js +38 -0
- package/dist/common/tab/index.d.ts +2 -0
- package/dist/common/table/index.d.ts +3 -0
- package/dist/common/table/table.cjs.js +1 -0
- package/dist/common/table/table.d.ts +19 -0
- package/dist/common/table/table.es.js +40 -0
- package/dist/common/tag/StatusTag.cjs.js +1 -0
- package/dist/common/tag/StatusTag.d.ts +14 -0
- package/dist/common/tag/StatusTag.es.js +29 -0
- package/dist/common/tag/index.d.ts +2 -0
- package/dist/common/text/index.cjs.js +1 -0
- package/dist/common/text/index.d.ts +3 -0
- package/dist/common/text/index.es.js +5 -0
- package/dist/common/text/title/TitleWithHeadTitle.d.ts +7 -0
- package/dist/common/text/title/index.cjs.js +1 -0
- package/dist/common/text/title/index.d.ts +1 -0
- package/dist/common/text/title/index.es.js +5 -0
- package/dist/common/text-field/NumberField.cjs.js +1 -0
- package/dist/common/text-field/NumberField.d.ts +13 -0
- package/dist/common/text-field/NumberField.es.js +83 -0
- package/dist/common/text-field/PhoneNumberField.cjs.js +1 -0
- package/dist/common/text-field/PhoneNumberField.d.ts +4 -0
- package/dist/common/text-field/PhoneNumberField.es.js +18 -0
- package/dist/common/text-field/TextArea.cjs.js +1 -0
- package/dist/common/text-field/TextArea.d.ts +17 -0
- package/dist/common/text-field/TextArea.es.js +46 -0
- package/dist/common/text-field/TextField.cjs.js +1 -0
- package/dist/common/text-field/TextField.d.ts +27 -0
- package/dist/common/text-field/TextField.es.js +72 -0
- package/dist/common/text-field/index.d.ts +5 -0
- package/dist/common/tooltip/TooltipComponent.cjs.js +1 -0
- package/dist/common/tooltip/TooltipComponent.d.ts +5 -0
- package/dist/common/tooltip/TooltipComponent.es.js +9 -0
- package/dist/common/tooltip/index.d.ts +2 -0
- package/dist/common/wizard/WizardResult.cjs.js +1 -0
- package/dist/common/wizard/WizardResult.d.ts +16 -0
- package/dist/common/wizard/WizardResult.es.js +58 -0
- package/dist/common/wizard/WizardViewForm.cjs.js +1 -0
- package/dist/common/wizard/WizardViewForm.d.ts +24 -0
- package/dist/common/wizard/WizardViewForm.es.js +74 -0
- package/dist/common/wizard/index.d.ts +3 -0
- package/dist/context/WindowDimension.cjs.js +1 -0
- package/dist/context/WindowDimension.d.ts +4 -0
- package/dist/context/WindowDimension.es.js +8 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/crud/CrudComponent.cjs.js +1 -0
- package/dist/crud/CrudComponent.d.ts +245 -0
- package/dist/crud/CrudComponent.es.js +123 -0
- package/dist/crud/CrudField.cjs.js +1 -0
- package/dist/crud/CrudField.d.ts +4 -0
- package/dist/crud/CrudField.es.js +461 -0
- package/dist/crud/CrudForm.cjs.js +1 -0
- package/dist/crud/CrudForm.d.ts +14 -0
- package/dist/crud/CrudForm.es.js +103 -0
- package/dist/crud/CrudFormWizard.cjs.js +1 -0
- package/dist/crud/CrudFormWizard.d.ts +14 -0
- package/dist/crud/CrudFormWizard.es.js +140 -0
- package/dist/crud/CrudReportComponent.cjs.js +4 -0
- package/dist/crud/CrudReportComponent.d.ts +44 -0
- package/dist/crud/CrudReportComponent.es.js +255 -0
- package/dist/crud/CrudSearchComponent.cjs.js +1 -0
- package/dist/crud/CrudSearchComponent.d.ts +21 -0
- package/dist/crud/CrudSearchComponent.es.js +96 -0
- package/dist/crud/CrudTextAreaComponent.cjs.js +1 -0
- package/dist/crud/CrudTextAreaComponent.d.ts +22 -0
- package/dist/crud/CrudTextAreaComponent.es.js +52 -0
- package/dist/crud/FileCrudField.cjs.js +1 -0
- package/dist/crud/FileCrudField.d.ts +25 -0
- package/dist/crud/FileCrudField.es.js +221 -0
- package/dist/crud/ImageCrudField.cjs.js +1 -0
- package/dist/crud/ImageCrudField.d.ts +38 -0
- package/dist/crud/ImageCrudField.es.js +115 -0
- package/dist/crud/actions/index.cjs.js +1 -0
- package/dist/crud/actions/index.d.ts +26 -0
- package/dist/crud/actions/index.es.js +88 -0
- package/dist/crud/import/CrudImportButton.cjs.js +1 -0
- package/dist/crud/import/CrudImportButton.d.ts +3 -0
- package/dist/crud/import/CrudImportButton.es.js +30 -0
- package/dist/crud/import/CrudImportComponent.cjs.js +2 -0
- package/dist/crud/import/CrudImportComponent.d.ts +14 -0
- package/dist/crud/import/CrudImportComponent.es.js +222 -0
- package/dist/crud/index.d.ts +23 -0
- package/dist/crud/modal/index.cjs.js +1 -0
- package/dist/crud/modal/index.d.ts +24 -0
- package/dist/crud/modal/index.es.js +146 -0
- package/dist/crud/view/CrudDecListView.cjs.js +1 -0
- package/dist/crud/view/CrudDecListView.d.ts +15 -0
- package/dist/crud/view/CrudDecListView.es.js +57 -0
- package/dist/crud/view/CrudViewer.cjs.js +1 -0
- package/dist/crud/view/CrudViewer.d.ts +43 -0
- package/dist/crud/view/CrudViewer.es.js +304 -0
- package/dist/crud/view/CrudViewerUtil.cjs.js +1 -0
- package/dist/crud/view/CrudViewerUtil.d.ts +2 -0
- package/dist/crud/view/CrudViewerUtil.es.js +98 -0
- package/dist/crud/view/index.d.ts +5 -0
- package/dist/crud-component.css +6 -0
- package/dist/hooks/NavigatorHooks.cjs.js +1 -0
- package/dist/hooks/NavigatorHooks.d.ts +1 -0
- package/dist/hooks/NavigatorHooks.es.js +9 -0
- package/dist/icons/FlipHIcon.cjs.js +1 -0
- package/dist/icons/FlipHIcon.d.ts +3 -0
- package/dist/icons/FlipHIcon.es.js +28 -0
- package/dist/icons/FlipVIcon.cjs.js +1 -0
- package/dist/icons/FlipVIcon.d.ts +3 -0
- package/dist/icons/FlipVIcon.es.js +28 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +46 -0
- package/dist/locale/hooks/translation-constants.cjs.js +1 -0
- package/dist/locale/hooks/translation-constants.d.ts +1 -0
- package/dist/locale/hooks/translation-constants.es.js +4 -0
- package/dist/locale/index.cjs.js +1 -0
- package/dist/locale/index.d.ts +85 -0
- package/dist/locale/index.es.js +57 -0
- package/dist/locale/translations/en.cjs.js +1 -0
- package/dist/locale/translations/en.d.ts +63 -0
- package/dist/locale/translations/en.es.js +65 -0
- package/dist/package.json +122 -0
- package/dist/types/DialogComponentProp.d.ts +8 -0
- package/dist/types/Id.d.ts +10 -0
- package/dist/util/CrudUtil.cjs.js +1 -0
- package/dist/util/CrudUtil.d.ts +5 -0
- package/dist/util/CrudUtil.es.js +8 -0
- package/dist/util/DateUtil.cjs.js +1 -0
- package/dist/util/DateUtil.d.ts +7 -0
- package/dist/util/DateUtil.es.js +18 -0
- package/dist/util/ImageUtil.cjs.js +1 -0
- package/dist/util/ImageUtil.d.ts +14 -0
- package/dist/util/ImageUtil.es.js +63 -0
- package/dist/util/NumberUtil.cjs.js +1 -0
- package/dist/util/NumberUtil.d.ts +17 -0
- package/dist/util/NumberUtil.es.js +60 -0
- package/dist/util/ValidationUtil.cjs.js +1 -0
- package/dist/util/ValidationUtil.d.ts +14 -0
- package/dist/util/ValidationUtil.es.js +63 -0
- package/dist/util/index.cjs.js +1 -0
- package/dist/util/index.d.ts +4 -0
- package/dist/util/index.es.js +10 -0
- package/dist/vite-env.d.ts +1 -0
- package/package.json +4 -12
- package/release.config.cjs +0 -27
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { TRANSLATION_NAMESPACE as o } from "./locale/hooks/translation-constants.es.js";
|
|
2
|
+
import { setupI18n as d, updateTranslations as l } from "./locale/index.es.js";
|
|
3
|
+
import { default as u } from "./crud/CrudComponent.es.js";
|
|
4
|
+
import { ColorCrudFieldComponent as m, default as f, SelectCrudFieldComponent as p } from "./crud/CrudField.es.js";
|
|
5
|
+
import { default as n } from "./crud/CrudFormWizard.es.js";
|
|
6
|
+
import { default as x } from "./crud/CrudReportComponent.es.js";
|
|
7
|
+
import { default as V } from "./crud/CrudSearchComponent.es.js";
|
|
8
|
+
import { FileDownloadProvider as A, FileUploadProvider as c, ImageCellValue as g, ImageCrudCellValue as w, default as S } from "./crud/ImageCrudField.es.js";
|
|
9
|
+
import { FileCellValue as P, FileCrudCellValue as R, default as T } from "./crud/FileCrudField.es.js";
|
|
10
|
+
import { default as D } from "./crud/import/CrudImportComponent.es.js";
|
|
11
|
+
import { default as L } from "./crud/import/CrudImportButton.es.js";
|
|
12
|
+
import { default as h } from "./crud/actions/index.es.js";
|
|
13
|
+
import { default as B } from "./crud/view/CrudViewer.es.js";
|
|
14
|
+
import { CrudForm as U, CrudFormFields as W } from "./crud/CrudForm.es.js";
|
|
15
|
+
import { default as b } from "./crud/modal/index.es.js";
|
|
16
|
+
import { CrudDecListView as k } from "./crud/view/CrudDecListView.es.js";
|
|
17
|
+
import { getRendererValueCrudViewer as y } from "./crud/view/CrudViewerUtil.es.js";
|
|
18
|
+
export {
|
|
19
|
+
m as ColorCrudFieldComponent,
|
|
20
|
+
h as CrudActions,
|
|
21
|
+
u as CrudComponent,
|
|
22
|
+
k as CrudDecListView,
|
|
23
|
+
f as CrudField,
|
|
24
|
+
U as CrudForm,
|
|
25
|
+
W as CrudFormFields,
|
|
26
|
+
n as CrudFormWizard,
|
|
27
|
+
L as CrudImportButton,
|
|
28
|
+
D as CrudImportComponent,
|
|
29
|
+
b as CrudModal,
|
|
30
|
+
x as CrudReportComponent,
|
|
31
|
+
V as CrudSearchComponent,
|
|
32
|
+
B as CrudViewer,
|
|
33
|
+
P as FileCellValue,
|
|
34
|
+
R as FileCrudCellValue,
|
|
35
|
+
T as FileCrudField,
|
|
36
|
+
A as FileDownloadProvider,
|
|
37
|
+
c as FileUploadProvider,
|
|
38
|
+
g as ImageCellValue,
|
|
39
|
+
w as ImageCrudCellValue,
|
|
40
|
+
S as ImageCrudField,
|
|
41
|
+
p as SelectCrudFieldComponent,
|
|
42
|
+
o as TRANSLATION_NAMESPACE,
|
|
43
|
+
y as getRendererValueCrudViewer,
|
|
44
|
+
d as setupI18n,
|
|
45
|
+
l as updateTranslations
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="crud-component";exports.TRANSLATION_NAMESPACE=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TRANSLATION_NAMESPACE = "crud-component";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./hooks/translation-constants.cjs.js"),I=require("./translations/en.cjs.js"),r=require("i18next"),o=require("react-i18next"),u={en:{[i.TRANSLATION_NAMESPACE]:I}};exports.i18nInstance=r;const S=(n={})=>{const{translations:t=u,language:e="en",i18nInstance:s}=n,a=s||r;return exports.i18nInstance=a,a.isInitialized?Object.entries(t).forEach(([l,T])=>{Object.entries(T).forEach(([N,A])=>{a.addResourceBundle(l,N,A,!0,!0)})}):a.use(o.initReactI18next).init({resources:t,lng:e,fallbackLng:"en",ns:i.TRANSLATION_NAMESPACE,interpolation:{escapeValue:!1}}),r},d=(n,t,e)=>{(e||r).addResourceBundle(n,i.TRANSLATION_NAMESPACE,t,!0,!0)},E=n=>o.useTranslation(i.TRANSLATION_NAMESPACE,{...n,i18n:exports.i18nInstance}),L=n=>o.useTranslation(void 0,{...n,i18n:exports.i18nInstance}),c=(n,t)=>{var e;return(e=exports.i18nInstance)==null?void 0:e.t(n,{ns:i.TRANSLATION_NAMESPACE,...t})},O=(n,t)=>{var s;const e=c(n,t);return e||((s=exports.i18nInstance)==null?void 0:s.t(n,{ns:void 0,...t}))};exports.defaultTranslations=u;exports.setupI18n=S;exports.t=c;exports.tWithOrWithoutNS=O;exports.updateTranslations=d;exports.useTranslationLib=E;exports.useTranslationLibNoNS=L;
|
|
@@ -0,0 +1,85 @@
|
|
|
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>;
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1,63 @@
|
|
|
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;
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kingteza/crud-component",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "1.2.1",
|
|
5
|
+
"description": "React CRUD component library with Ant Design",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"react",
|
|
8
|
+
"crud",
|
|
9
|
+
"antd",
|
|
10
|
+
"typescript",
|
|
11
|
+
"types",
|
|
12
|
+
"typings"
|
|
13
|
+
],
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"author": "Kingteza",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/kingteza/crud-component"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist/",
|
|
23
|
+
"README.md",
|
|
24
|
+
"package.json"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"scripts": {
|
|
29
|
+
"dev": "vite",
|
|
30
|
+
"clean": "rm -rf dist",
|
|
31
|
+
"build": "npm run clean && tsc && vite build && cp package.json README.md .npmignore dist/",
|
|
32
|
+
"release": "semantic-release",
|
|
33
|
+
"release:dry-run": "semantic-release --dry-run",
|
|
34
|
+
"lint": "eslint .",
|
|
35
|
+
"tsc": "tsc",
|
|
36
|
+
"preview": "vite preview"
|
|
37
|
+
},
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./index.d.ts",
|
|
41
|
+
"import": "./index.es.js",
|
|
42
|
+
"require": "./index.cjs.js"
|
|
43
|
+
},
|
|
44
|
+
"./common": {
|
|
45
|
+
"types": "./common/index.d.ts",
|
|
46
|
+
"import": "./common/index.es.js",
|
|
47
|
+
"require": "./common/index.cjs.js"
|
|
48
|
+
},
|
|
49
|
+
"./util": {
|
|
50
|
+
"types": "./util/index.d.ts",
|
|
51
|
+
"import": "./util/index.es.js",
|
|
52
|
+
"require": "./util/index.cjs.js"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=22.14.0"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"@ant-design/icons": "^5.5.2",
|
|
63
|
+
"@dnd-kit/core": "^6.3.1",
|
|
64
|
+
"@dnd-kit/modifiers": "^9.0.0",
|
|
65
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
66
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
67
|
+
"@iconify/react": "^6.0.1",
|
|
68
|
+
"bootstrap-css-only": "^4.4.1",
|
|
69
|
+
"browser-image-compression": "^2.0.2",
|
|
70
|
+
"dayjs": "^1.11.13",
|
|
71
|
+
"file-saver": "^2.0.5",
|
|
72
|
+
"i18next": "^24.2.0",
|
|
73
|
+
"mime": "^4.0.6",
|
|
74
|
+
"papaparse": "^5.4.1",
|
|
75
|
+
"path-browserify": "^1.0.1",
|
|
76
|
+
"react-advanced-cropper": "^0.20.1",
|
|
77
|
+
"react-highlight-words": "^0.20.0",
|
|
78
|
+
"react-i18next": "^15.2.0",
|
|
79
|
+
"react-quill": "^2.0.0",
|
|
80
|
+
"react-responsive": "^10.0.0",
|
|
81
|
+
"react-show-more-text": "^1.7.1",
|
|
82
|
+
"uuid": "^11.0.3"
|
|
83
|
+
},
|
|
84
|
+
"devDependencies": {
|
|
85
|
+
"@anolilab/semantic-release-pnpm": "^2.0.4",
|
|
86
|
+
"@eslint/js": "^9.17.0",
|
|
87
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
88
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
89
|
+
"@semantic-release/git": "^10.0.1",
|
|
90
|
+
"@semantic-release/npm": "^13.1.1",
|
|
91
|
+
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
92
|
+
"@types/file-saver": "^2.0.7",
|
|
93
|
+
"@types/papaparse": "^5.3.15",
|
|
94
|
+
"@types/path-browserify": "^1.0.3",
|
|
95
|
+
"@types/react": "^18.3.18",
|
|
96
|
+
"@types/react-dom": "^18.3.5",
|
|
97
|
+
"@types/react-show-more-text": "^1.4.5",
|
|
98
|
+
"@types/uuid": "^10.0.0",
|
|
99
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
100
|
+
"antd": "^5.22.7",
|
|
101
|
+
"eslint": "^9.17.0",
|
|
102
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
103
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
104
|
+
"globals": "^15.14.0",
|
|
105
|
+
"react": "^18.3.1",
|
|
106
|
+
"react-dom": "^18.3.1",
|
|
107
|
+
"react-router-dom": "^7.0.2",
|
|
108
|
+
"semantic-release": "^25.0.1",
|
|
109
|
+
"tsup": "^8.3.5",
|
|
110
|
+
"typescript": "~5.6.2",
|
|
111
|
+
"typescript-eslint": "^8.18.2",
|
|
112
|
+
"vite": "^6.0.5",
|
|
113
|
+
"vite-plugin-dts": "^4.4.0",
|
|
114
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
115
|
+
},
|
|
116
|
+
"peerDependencies": {
|
|
117
|
+
"antd": ">=5.22.6",
|
|
118
|
+
"react": ">=18.3.1",
|
|
119
|
+
"react-dom": ">=18.3.1",
|
|
120
|
+
"react-router-dom": ">=6.3.0"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";class s{static getRealName(t,e="name"){return typeof t=="object"?t[e]:t}}module.exports=s;
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1,14 @@
|
|
|
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;
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1,17 @@
|
|
|
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;
|