@kingteza/crud-component 1.0.9 → 1.0.12
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/index.cjs +1 -1
- package/dist/util/index.cjs +1 -1
- package/package.json +18 -9
- package/dist/_virtual/FileSaver.min.cjs +0 -1
- package/dist/_virtual/FileSaver.min.js +0 -5
- package/dist/_virtual/FileSaver.min2.cjs +0 -1
- package/dist/_virtual/FileSaver.min2.js +0 -4
- package/dist/_virtual/ShowMoreText.cjs +0 -1
- package/dist/_virtual/ShowMoreText.js +0 -7
- package/dist/_virtual/ShowMoreText2.cjs +0 -1
- package/dist/_virtual/ShowMoreText2.js +0 -4
- package/dist/_virtual/Truncate.cjs +0 -1
- package/dist/_virtual/Truncate.js +0 -4
- package/dist/_virtual/_commonjsHelpers.cjs +0 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -8
- package/dist/_virtual/advancedFormat.cjs +0 -1
- package/dist/_virtual/advancedFormat.js +0 -7
- package/dist/_virtual/advancedFormat2.cjs +0 -1
- package/dist/_virtual/advancedFormat2.js +0 -4
- package/dist/_virtual/customParseFormat.cjs +0 -1
- package/dist/_virtual/customParseFormat.js +0 -7
- package/dist/_virtual/customParseFormat2.cjs +0 -1
- package/dist/_virtual/customParseFormat2.js +0 -4
- package/dist/_virtual/dayjs.min.cjs +0 -1
- package/dist/_virtual/dayjs.min.js +0 -7
- package/dist/_virtual/dayjs.min2.cjs +0 -1
- package/dist/_virtual/dayjs.min2.js +0 -4
- package/dist/_virtual/index.cjs +0 -1
- package/dist/_virtual/index.js +0 -7
- package/dist/_virtual/index10.cjs +0 -1
- package/dist/_virtual/index10.js +0 -7
- package/dist/_virtual/index11.cjs +0 -1
- package/dist/_virtual/index11.js +0 -7
- package/dist/_virtual/index12.cjs +0 -1
- package/dist/_virtual/index12.js +0 -4
- package/dist/_virtual/index13.cjs +0 -1
- package/dist/_virtual/index13.js +0 -4
- package/dist/_virtual/index2.cjs +0 -1
- package/dist/_virtual/index2.js +0 -5
- package/dist/_virtual/index3.cjs +0 -1
- package/dist/_virtual/index3.js +0 -7
- package/dist/_virtual/index4.cjs +0 -1
- package/dist/_virtual/index4.js +0 -4
- package/dist/_virtual/index5.cjs +0 -1
- package/dist/_virtual/index5.js +0 -4
- package/dist/_virtual/index6.cjs +0 -1
- package/dist/_virtual/index6.js +0 -4
- package/dist/_virtual/index7.cjs +0 -1
- package/dist/_virtual/index7.js +0 -4
- package/dist/_virtual/index8.cjs +0 -1
- package/dist/_virtual/index8.js +0 -2
- package/dist/_virtual/index9.cjs +0 -1
- package/dist/_virtual/index9.js +0 -7
- package/dist/_virtual/jsx-runtime.cjs +0 -1
- package/dist/_virtual/jsx-runtime.js +0 -5
- package/dist/_virtual/jsx-runtime2.cjs +0 -1
- package/dist/_virtual/jsx-runtime2.js +0 -4
- package/dist/_virtual/localeData.cjs +0 -1
- package/dist/_virtual/localeData.js +0 -7
- package/dist/_virtual/localeData2.cjs +0 -1
- package/dist/_virtual/localeData2.js +0 -4
- package/dist/_virtual/main.cjs +0 -1
- package/dist/_virtual/main.js +0 -7
- package/dist/_virtual/main2.cjs +0 -1
- package/dist/_virtual/main2.js +0 -4
- package/dist/_virtual/papaparse.min.cjs +0 -1
- package/dist/_virtual/papaparse.min.js +0 -7
- package/dist/_virtual/papaparse.min2.cjs +0 -1
- package/dist/_virtual/papaparse.min2.js +0 -4
- package/dist/_virtual/react-is.development.cjs +0 -1
- package/dist/_virtual/react-is.development.js +0 -4
- package/dist/_virtual/react-is.development2.cjs +0 -1
- package/dist/_virtual/react-is.development2.js +0 -4
- package/dist/_virtual/react-is.production.min.cjs +0 -1
- package/dist/_virtual/react-is.production.min.js +0 -4
- package/dist/_virtual/react-is.production.min2.cjs +0 -1
- package/dist/_virtual/react-is.production.min2.js +0 -4
- package/dist/_virtual/react-jsx-runtime.development.cjs +0 -1
- package/dist/_virtual/react-jsx-runtime.development.js +0 -4
- package/dist/_virtual/react-jsx-runtime.production.min.cjs +0 -1
- package/dist/_virtual/react-jsx-runtime.production.min.js +0 -4
- package/dist/_virtual/weekOfYear.cjs +0 -1
- package/dist/_virtual/weekOfYear.js +0 -7
- package/dist/_virtual/weekOfYear2.cjs +0 -1
- package/dist/_virtual/weekOfYear2.js +0 -4
- package/dist/_virtual/weekYear.cjs +0 -1
- package/dist/_virtual/weekYear.js +0 -7
- package/dist/_virtual/weekYear2.cjs +0 -1
- package/dist/_virtual/weekYear2.js +0 -4
- package/dist/_virtual/weekday.cjs +0 -1
- package/dist/_virtual/weekday.js +0 -7
- package/dist/_virtual/weekday2.cjs +0 -1
- package/dist/_virtual/weekday2.js +0 -4
- package/dist/common/index.cjs +0 -1
- package/dist/common/index.d.ts +0 -2
- package/dist/common/index.js +0 -75
- package/dist/context/WindowDimension.d.ts +0 -4
- package/dist/crud-component.css +0 -9
- package/dist/src/components/common/DatePicker/DatePicker.cjs +0 -1
- package/dist/src/components/common/DatePicker/DatePicker.js +0 -89
- package/dist/src/components/common/DatePicker/TimePicker.cjs +0 -1
- package/dist/src/components/common/DatePicker/TimePicker.js +0 -79
- package/dist/src/components/common/appearance/Hider.cjs +0 -1
- package/dist/src/components/common/appearance/Hider.js +0 -5
- package/dist/src/components/common/button/Button.cjs +0 -1
- package/dist/src/components/common/button/Button.js +0 -65
- package/dist/src/components/common/button/CloneButtonTable.cjs +0 -1
- package/dist/src/components/common/button/CloneButtonTable.js +0 -20
- package/dist/src/components/common/button/DeleteButtonTable.cjs +0 -1
- package/dist/src/components/common/button/DeleteButtonTable.js +0 -68
- package/dist/src/components/common/button/ExportButton.cjs +0 -1
- package/dist/src/components/common/button/ExportButton.js +0 -27
- package/dist/src/components/common/button/HideButtonTable.cjs +0 -1
- package/dist/src/components/common/button/HideButtonTable.js +0 -68
- package/dist/src/components/common/button/ImportButton.cjs +0 -1
- package/dist/src/components/common/button/ImportButton.js +0 -56
- package/dist/src/components/common/button/NewButton.cjs +0 -1
- package/dist/src/components/common/button/NewButton.js +0 -24
- package/dist/src/components/common/button/PrintButton.cjs +0 -1
- package/dist/src/components/common/button/PrintButton.js +0 -26
- package/dist/src/components/common/button/RefreshButton.cjs +0 -1
- package/dist/src/components/common/button/RefreshButton.js +0 -24
- package/dist/src/components/common/button/UnHideButton.cjs +0 -1
- package/dist/src/components/common/button/UnHideButton.js +0 -70
- package/dist/src/components/common/button/UpdateButtonTable.cjs +0 -1
- package/dist/src/components/common/button/UpdateButtonTable.js +0 -20
- package/dist/src/components/common/button/ViewButtonTable.cjs +0 -1
- package/dist/src/components/common/button/ViewButtonTable.js +0 -20
- package/dist/src/components/common/check-box/CheckBox.cjs +0 -1
- package/dist/src/components/common/check-box/CheckBox.js +0 -42
- package/dist/src/components/common/description/DescList.cjs +0 -1
- package/dist/src/components/common/description/DescList.js +0 -16
- package/dist/src/components/common/layout/VerticalSpace.cjs +0 -1
- package/dist/src/components/common/layout/VerticalSpace.js +0 -6
- package/dist/src/components/common/loading/LoadingIndicator.cjs +0 -1
- package/dist/src/components/common/loading/LoadingIndicator.js +0 -25
- package/dist/src/components/common/picker/ImagePicker.cjs +0 -1
- package/dist/src/components/common/picker/ImagePicker.js +0 -287
- package/dist/src/components/common/radio/RadioGroupComponent.cjs +0 -1
- package/dist/src/components/common/radio/RadioGroupComponent.js +0 -20
- package/dist/src/components/common/report/SelectFieldInReport.cjs +0 -1
- package/dist/src/components/common/report/SelectFieldInReport.js +0 -31
- package/dist/src/components/common/select/CustomSelectOption.cjs +0 -1
- package/dist/src/components/common/select/CustomSelectOption.js +0 -13
- package/dist/src/components/common/select/SelectComponent.cjs +0 -1
- package/dist/src/components/common/select/SelectComponent.js +0 -92
- package/dist/src/components/common/show-more/index.cjs +0 -1
- package/dist/src/components/common/show-more/index.js +0 -8
- package/dist/src/components/common/tab/TabViewWithRoute.cjs +0 -1
- package/dist/src/components/common/tab/TabViewWithRoute.js +0 -38
- package/dist/src/components/common/table/table.cjs +0 -1
- package/dist/src/components/common/table/table.js +0 -40
- package/dist/src/components/common/tag/StatusTag.cjs +0 -1
- package/dist/src/components/common/tag/StatusTag.js +0 -30
- package/dist/src/components/common/text/index.cjs +0 -1
- package/dist/src/components/common/text/index.js +0 -5
- package/dist/src/components/common/text/title/index.cjs +0 -1
- package/dist/src/components/common/text/title/index.js +0 -5
- package/dist/src/components/common/text-field/NumberField.cjs +0 -1
- package/dist/src/components/common/text-field/NumberField.js +0 -84
- package/dist/src/components/common/text-field/PhoneNumberField.cjs +0 -1
- package/dist/src/components/common/text-field/PhoneNumberField.js +0 -18
- package/dist/src/components/common/text-field/TextArea.cjs +0 -1
- package/dist/src/components/common/text-field/TextArea.js +0 -48
- package/dist/src/components/common/text-field/TextField.cjs +0 -1
- package/dist/src/components/common/text-field/TextField.js +0 -74
- package/dist/src/components/common/tooltip/TooltipComponent.cjs +0 -1
- package/dist/src/components/common/tooltip/TooltipComponent.js +0 -9
- package/dist/src/components/common/wizard/WizardResult.cjs +0 -1
- package/dist/src/components/common/wizard/WizardResult.js +0 -61
- package/dist/src/components/common/wizard/WizardViewForm.cjs +0 -1
- package/dist/src/components/common/wizard/WizardViewForm.js +0 -74
- package/dist/src/components/crud/CrudComponent.cjs +0 -1
- package/dist/src/components/crud/CrudComponent.js +0 -213
- package/dist/src/components/crud/CrudField.cjs +0 -1
- package/dist/src/components/crud/CrudField.js +0 -462
- package/dist/src/components/crud/CrudForm.cjs +0 -1
- package/dist/src/components/crud/CrudForm.js +0 -94
- package/dist/src/components/crud/CrudFormWizard.cjs +0 -1
- package/dist/src/components/crud/CrudFormWizard.js +0 -145
- package/dist/src/components/crud/CrudReportComponent.cjs +0 -4
- package/dist/src/components/crud/CrudReportComponent.js +0 -259
- package/dist/src/components/crud/CrudSearchComponent.cjs +0 -1
- package/dist/src/components/crud/CrudSearchComponent.js +0 -97
- package/dist/src/components/crud/FileCrudField.cjs +0 -1
- package/dist/src/components/crud/FileCrudField.js +0 -229
- package/dist/src/components/crud/ImageCrudField.cjs +0 -1
- package/dist/src/components/crud/ImageCrudField.js +0 -116
- package/dist/src/components/crud/import/CrudImportButton.cjs +0 -1
- package/dist/src/components/crud/import/CrudImportButton.js +0 -31
- package/dist/src/components/crud/import/CrudImportComponent.cjs +0 -2
- package/dist/src/components/crud/import/CrudImportComponent.js +0 -226
- package/dist/src/components/crud/view/CrudDecListView.cjs +0 -1
- package/dist/src/components/crud/view/CrudDecListView.js +0 -42
- package/dist/src/components/crud/view/CrudViewer.cjs +0 -1
- package/dist/src/components/crud/view/CrudViewer.js +0 -217
- package/dist/src/components/crud/view/CrudViewerUtil.cjs +0 -1
- package/dist/src/components/crud/view/CrudViewerUtil.js +0 -59
- package/dist/src/context/WindowDimension.cjs +0 -1
- package/dist/src/context/WindowDimension.js +0 -8
- package/dist/src/locale/hooks/translation-constants.cjs +0 -1
- package/dist/src/locale/hooks/translation-constants.js +0 -4
- package/dist/src/locale/index.cjs +0 -1
- package/dist/src/locale/index.js +0 -33
- package/dist/src/locale/translations/en.cjs +0 -1
- package/dist/src/locale/translations/en.js +0 -60
- package/dist/src/util/DateUtil.cjs +0 -1
- package/dist/src/util/DateUtil.js +0 -6
- package/dist/src/util/ImageUtil.cjs +0 -1
- package/dist/src/util/ImageUtil.js +0 -63
- package/dist/src/util/NumberUtil.cjs +0 -1
- package/dist/src/util/NumberUtil.js +0 -60
- package/dist/src/util/ValidationUtil.cjs +0 -1
- package/dist/src/util/ValidationUtil.js +0 -60
- package/dist/types/DialogComponentProp.d.ts +0 -8
- package/dist/types/Id.d.ts +0 -10
- package/dist/vite.svg +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../../_virtual/jsx-runtime.cjs"),D=require("../../common/button/CloneButtonTable.cjs"),k=require("../../common/button/DeleteButtonTable.cjs"),H=require("../../common/button/ExportButton.cjs"),U=require("../../common/button/HideButtonTable.cjs"),F=require("../../common/button/RefreshButton.cjs"),tt=require("../../common/button/UpdateButtonTable.cjs"),et=require("../../common/button/ViewButtonTable.cjs"),st=require("../../common/layout/VerticalSpace.cjs"),rt=require("../../common/table/table.cjs"),l=require("react"),ut=require("react-i18next"),nt=require("../../../locale/hooks/translation-constants.cjs"),ot=require("../CrudSearchComponent.cjs"),xt=require("./CrudDecListView.cjs"),_=require("./CrudViewerUtil.cjs"),ct=require("../../../../node_modules/antd/es/modal/index.cjs");function jt({idField:r="id",loadingData:L,fields:c,isDeleting:q,isHiding:d,viewable:o=!1,paginateProps:i,onDelete:a,onHide:v,onUpdate:R,data:E=[],extraAction:m,onClickUpdate:x,minusHeight:S,scroll:N,onClickClone:f,className:z,expandable:$,size:w,bordered:A,descListColumn:G,extraView:p,decListLayout:J,scrollToTop:lt,onClickRefresh:g,closeViewOnClickUpdate:b,onExport:B,confirmHiding:C,confirmDeleting:I,rowClassName:K,actionWidth:Q=190,...W}){const{t:X}=ut.useTranslation(nt.TRANSLATION_NAMESPACE),M=l.useMemo(()=>c.map(({hideInTable:e,hidden:s,width:j,name:n,label:Z,halign:P,...O})=>({title:Z,width:j,key:n,dataIndex:n,hidden:e||s,align:P??(O.type==="number"?"right":void 0),render:_.getRendererValueCrudViewer(O)})),[c]),[u,h]=l.useState(),[T,y]=l.useState();l.useEffect(()=>{E&&h(e=>{if(e)return E.find(s=>s[r]===e[r])})},[E,r,u]);const V=l.useCallback(e=>{var j;const s=m==null?void 0:m(e);return(Array.isArray(s)?(j=s==null?void 0:s.filter(Boolean))!=null&&j.length:s)||R||x||f||a?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[s,(R||x)&&t.jsxRuntimeExports.jsx(tt.default,{value:e,onClick:n=>{y(n[r]),x==null||x(e),b&&h(void 0)}}),f&&t.jsxRuntimeExports.jsx(D.default,{value:e,onClick:n=>f(n)}),B&&t.jsxRuntimeExports.jsx(H.ExportButton,{value:e,onClick:async n=>await B(n)}),v&&t.jsxRuntimeExports.jsx(U.default,{value:e,disabled:d,shouldConfirm:C,loading:d&&e[r]===T,onClick:async n=>{y(n[r]),await v({[r]:n[r]})}}),a&&t.jsxRuntimeExports.jsx(k.default,{value:e,disabled:q,shouldConfirm:I,loading:q&&e[r]===T,onClick:async n=>{y(n[r]),await a({[r]:n[r]})}})]}):void 0},[b,I,C,m,r,q,d,f,x,a,B,v,R,T]),Y=l.useMemo(()=>{let e=typeof o=="string"?u==null?void 0:u[o]:void 0;if(typeof e=="object"){const s=c.find(j=>j.name===o);e=_.getRendererValueCrudViewer(s)(e,u,0)}return e},[o,u,c]);return t.jsxRuntimeExports.jsxs("div",{children:[o&&t.jsxRuntimeExports.jsx(ct.default,{width:"100%",open:!!u,title:Y??t.jsxRuntimeExports.jsx("div",{children:" "}),footer:t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{}),closable:!0,onCancel:()=>h(void 0),children:!!u&&t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx(xt.CrudDecListView,{layout:J,descListColumn:G,data:u,fields:c,action:V(u)}),p==null?void 0:p(u)]},u==null?void 0:u[r])}),t.jsxRuntimeExports.jsx(ot.default,{fields:c,...W}),t.jsxRuntimeExports.jsxs(st.default,{children:[!!g&&t.jsxRuntimeExports.jsx(F.RefreshButton,{onClick:g}),t.jsxRuntimeExports.jsx(rt.default,{rowClassName:K,className:z,scroll:N??(S?{y:`calc(100vh - ${S})`}:void 0),id:"crud-table",dataSource:E,loading:L,bordered:A,size:w,expandable:$,pagination:i?{total:i.count,onChange:i.setPage,current:i.page,pageSize:i.pageSize}:void 0,columns:R||x||a||m||o?[...M,{title:X("str.action"),dataIndex:"",fixed:"right",width:Q,render:(e,s)=>t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[o&&t.jsxRuntimeExports.jsx(et.default,{value:s,onClick:h}),V(s)]})}]:M})]})]})}exports.default=jt;
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { j as r } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import k from "../../common/button/CloneButtonTable.js";
|
|
3
|
-
import H from "../../common/button/DeleteButtonTable.js";
|
|
4
|
-
import { ExportButton as U } from "../../common/button/ExportButton.js";
|
|
5
|
-
import F from "../../common/button/HideButtonTable.js";
|
|
6
|
-
import { RefreshButton as rr } from "../../common/button/RefreshButton.js";
|
|
7
|
-
import or from "../../common/button/UpdateButtonTable.js";
|
|
8
|
-
import tr from "../../common/button/ViewButtonTable.js";
|
|
9
|
-
import sr from "../../common/layout/VerticalSpace.js";
|
|
10
|
-
import mr from "../../common/table/table.js";
|
|
11
|
-
import { useMemo as L, useState as _, useEffect as ur, useCallback as nr } from "react";
|
|
12
|
-
import { useTranslation as er } from "react-i18next";
|
|
13
|
-
import { TRANSLATION_NAMESPACE as fr } from "../../../locale/hooks/translation-constants.js";
|
|
14
|
-
import cr from "../CrudSearchComponent.js";
|
|
15
|
-
import { CrudDecListView as lr } from "./CrudDecListView.js";
|
|
16
|
-
import { getRendererValueCrudViewer as V } from "./CrudViewerUtil.js";
|
|
17
|
-
import jr from "../../../../node_modules/antd/es/modal/index.js";
|
|
18
|
-
function Or({
|
|
19
|
-
idField: s = "id",
|
|
20
|
-
loadingData: $,
|
|
21
|
-
fields: f,
|
|
22
|
-
isDeleting: y,
|
|
23
|
-
isHiding: B,
|
|
24
|
-
viewable: n = !1,
|
|
25
|
-
paginateProps: l,
|
|
26
|
-
onDelete: j,
|
|
27
|
-
onHide: p,
|
|
28
|
-
onUpdate: h,
|
|
29
|
-
data: v = [],
|
|
30
|
-
extraAction: a,
|
|
31
|
-
onClickUpdate: e,
|
|
32
|
-
minusHeight: I,
|
|
33
|
-
scroll: q,
|
|
34
|
-
onClickClone: T,
|
|
35
|
-
className: A,
|
|
36
|
-
expandable: G,
|
|
37
|
-
size: J,
|
|
38
|
-
bordered: K,
|
|
39
|
-
descListColumn: Q,
|
|
40
|
-
extraView: i,
|
|
41
|
-
decListLayout: W,
|
|
42
|
-
scrollToTop: ar,
|
|
43
|
-
onClickRefresh: C,
|
|
44
|
-
closeViewOnClickUpdate: R,
|
|
45
|
-
onExport: S,
|
|
46
|
-
confirmHiding: E,
|
|
47
|
-
confirmDeleting: M,
|
|
48
|
-
rowClassName: X,
|
|
49
|
-
actionWidth: Y = 190,
|
|
50
|
-
...Z
|
|
51
|
-
}) {
|
|
52
|
-
const { t: d } = er(fr), N = L(
|
|
53
|
-
() => f.map(
|
|
54
|
-
({ hideInTable: o, hidden: t, width: c, name: u, label: w, halign: D, ...z }) => ({
|
|
55
|
-
title: w,
|
|
56
|
-
width: c,
|
|
57
|
-
key: u,
|
|
58
|
-
dataIndex: u,
|
|
59
|
-
hidden: o || t,
|
|
60
|
-
align: D ?? (z.type === "number" ? "right" : void 0),
|
|
61
|
-
render: V(z)
|
|
62
|
-
})
|
|
63
|
-
),
|
|
64
|
-
[f]
|
|
65
|
-
), [m, x] = _(), [b, g] = _();
|
|
66
|
-
ur(() => {
|
|
67
|
-
v && x((o) => {
|
|
68
|
-
if (o)
|
|
69
|
-
return v.find((t) => t[s] === o[s]);
|
|
70
|
-
});
|
|
71
|
-
}, [v, s, m]);
|
|
72
|
-
const O = nr(
|
|
73
|
-
(o) => {
|
|
74
|
-
var c;
|
|
75
|
-
const t = a == null ? void 0 : a(o);
|
|
76
|
-
return (Array.isArray(t) ? (c = t == null ? void 0 : t.filter(Boolean)) != null && c.length : t) || h || e || T || j ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
77
|
-
t,
|
|
78
|
-
(h || e) && /* @__PURE__ */ r.jsx(
|
|
79
|
-
or,
|
|
80
|
-
{
|
|
81
|
-
value: o,
|
|
82
|
-
onClick: (u) => {
|
|
83
|
-
g(u[s]), e == null || e(o), R && x(void 0);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
),
|
|
87
|
-
T && /* @__PURE__ */ r.jsx(k, { value: o, onClick: (u) => T(u) }),
|
|
88
|
-
S && /* @__PURE__ */ r.jsx(
|
|
89
|
-
U,
|
|
90
|
-
{
|
|
91
|
-
value: o,
|
|
92
|
-
onClick: async (u) => await S(u)
|
|
93
|
-
}
|
|
94
|
-
),
|
|
95
|
-
p && /* @__PURE__ */ r.jsx(
|
|
96
|
-
F,
|
|
97
|
-
{
|
|
98
|
-
value: o,
|
|
99
|
-
disabled: B,
|
|
100
|
-
shouldConfirm: E,
|
|
101
|
-
loading: B && o[s] === b,
|
|
102
|
-
onClick: async (u) => {
|
|
103
|
-
g(u[s]), await p({ [s]: u[s] });
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
),
|
|
107
|
-
j && /* @__PURE__ */ r.jsx(
|
|
108
|
-
H,
|
|
109
|
-
{
|
|
110
|
-
value: o,
|
|
111
|
-
disabled: y,
|
|
112
|
-
shouldConfirm: M,
|
|
113
|
-
loading: y && o[s] === b,
|
|
114
|
-
onClick: async (u) => {
|
|
115
|
-
g(u[s]), await j({ [s]: u[s] });
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
] }) : void 0;
|
|
120
|
-
},
|
|
121
|
-
[
|
|
122
|
-
R,
|
|
123
|
-
M,
|
|
124
|
-
E,
|
|
125
|
-
a,
|
|
126
|
-
s,
|
|
127
|
-
y,
|
|
128
|
-
B,
|
|
129
|
-
T,
|
|
130
|
-
e,
|
|
131
|
-
j,
|
|
132
|
-
S,
|
|
133
|
-
p,
|
|
134
|
-
h,
|
|
135
|
-
b
|
|
136
|
-
]
|
|
137
|
-
), P = L(() => {
|
|
138
|
-
let o = typeof n == "string" ? m == null ? void 0 : m[n] : void 0;
|
|
139
|
-
if (typeof o == "object") {
|
|
140
|
-
const t = f.find((c) => c.name === n);
|
|
141
|
-
o = V(t)(
|
|
142
|
-
o,
|
|
143
|
-
m,
|
|
144
|
-
0
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
return o;
|
|
148
|
-
}, [n, m, f]);
|
|
149
|
-
return /* @__PURE__ */ r.jsxs("div", { children: [
|
|
150
|
-
n && /* @__PURE__ */ r.jsx(
|
|
151
|
-
jr,
|
|
152
|
-
{
|
|
153
|
-
width: "100%",
|
|
154
|
-
open: !!m,
|
|
155
|
-
title: P ?? /* @__PURE__ */ r.jsx("div", { children: " " }),
|
|
156
|
-
footer: /* @__PURE__ */ r.jsx(r.Fragment, {}),
|
|
157
|
-
closable: !0,
|
|
158
|
-
onCancel: () => x(void 0),
|
|
159
|
-
children: !!m && /* @__PURE__ */ r.jsxs("div", { children: [
|
|
160
|
-
/* @__PURE__ */ r.jsx(
|
|
161
|
-
lr,
|
|
162
|
-
{
|
|
163
|
-
layout: W,
|
|
164
|
-
descListColumn: Q,
|
|
165
|
-
data: m,
|
|
166
|
-
fields: f,
|
|
167
|
-
action: O(m)
|
|
168
|
-
}
|
|
169
|
-
),
|
|
170
|
-
i == null ? void 0 : i(m)
|
|
171
|
-
] }, m == null ? void 0 : m[s])
|
|
172
|
-
}
|
|
173
|
-
),
|
|
174
|
-
/* @__PURE__ */ r.jsx(cr, { fields: f, ...Z }),
|
|
175
|
-
/* @__PURE__ */ r.jsxs(sr, { children: [
|
|
176
|
-
!!C && /* @__PURE__ */ r.jsx(rr, { onClick: C }),
|
|
177
|
-
/* @__PURE__ */ r.jsx(
|
|
178
|
-
mr,
|
|
179
|
-
{
|
|
180
|
-
rowClassName: X,
|
|
181
|
-
className: A,
|
|
182
|
-
scroll: q ?? (I ? {
|
|
183
|
-
y: `calc(100vh - ${I})`
|
|
184
|
-
} : void 0),
|
|
185
|
-
id: "crud-table",
|
|
186
|
-
dataSource: v,
|
|
187
|
-
loading: $,
|
|
188
|
-
bordered: K,
|
|
189
|
-
size: J,
|
|
190
|
-
expandable: G,
|
|
191
|
-
pagination: l ? {
|
|
192
|
-
total: l.count,
|
|
193
|
-
onChange: l.setPage,
|
|
194
|
-
current: l.page,
|
|
195
|
-
pageSize: l.pageSize
|
|
196
|
-
} : void 0,
|
|
197
|
-
columns: h || e || j || a || n ? [
|
|
198
|
-
...N,
|
|
199
|
-
{
|
|
200
|
-
title: d("str.action"),
|
|
201
|
-
dataIndex: "",
|
|
202
|
-
fixed: "right",
|
|
203
|
-
width: Y,
|
|
204
|
-
render: (o, t) => /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
205
|
-
n && /* @__PURE__ */ r.jsx(tr, { value: t, onClick: x }),
|
|
206
|
-
O(t)
|
|
207
|
-
] })
|
|
208
|
-
}
|
|
209
|
-
] : N
|
|
210
|
-
}
|
|
211
|
-
)
|
|
212
|
-
] })
|
|
213
|
-
] });
|
|
214
|
-
}
|
|
215
|
-
export {
|
|
216
|
-
Or as default
|
|
217
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../../_virtual/jsx-runtime.cjs"),s=require("../../common/show-more/index.cjs"),x=require("../FileCrudField.cjs"),d=require("../ImageCrudField.cjs"),j=require("../../../locale/hooks/translation-constants.cjs"),v=require("i18next"),r=require("../../../util/DateUtil.cjs"),m=require("../../../util/NumberUtil.cjs"),y=require("../../../../node_modules/@ant-design/icons/es/icons/CheckOutlined.cjs"),C=require("../../../../node_modules/@ant-design/icons/es/icons/CloseOutlined.cjs"),g=require("../../../../node_modules/antd/es/tooltip/index.cjs"),q=require("../../../../node_modules/antd/es/avatar/index.cjs");function R({type:a,render:i,...u}){return a==="object"?(t,n,e)=>typeof i=="function"?i(t,n,e):"":a==="select"?(t,n,e)=>{const o=u;let l=o.multiple?Array.isArray(t)?t.map(c=>c==null?void 0:c[o.innerFieldLabel??"name"]):void 0:t==null?void 0:t[o.innerFieldLabel??"name"];return(!l&&typeof t=="string"||typeof t=="number")&&(l=t),typeof i=="function"?i(l,n,e):Array.isArray(l)?l.join(", "):l}:a==="number"?(t,n,e)=>typeof i=="function"?i(t,n,e):u!=null&&u.int?m.default.toInt(t,u.formatted):m.default.toMoney(t):a==="enum"?(t,n,e)=>{var l;const o=v.t(((l=u==null?void 0:u.translation)==null?void 0:l[t??""])??t,{ns:j.TRANSLATION_NAMESPACE});return typeof i=="function"?i(t,n,e):o}:a==="date"?(t,n,e)=>{if(!t)return"-";const o=u!=null&&u.formatTime?r.default.formatDateTime(t):r.default.formatDate(t);return typeof i=="function"?i(t,n,e):o}:a==="checkbox"?(t,n,e)=>typeof i=="function"?i(t,n,e):t?f.jsxRuntimeExports.jsx(y.default,{}):f.jsxRuntimeExports.jsx(C.default,{}):a==="image"?(t,n,e)=>typeof i=="function"?i(t,n,e):f.jsxRuntimeExports.jsx(d.ImageCrudCellValue,{value:t,provider:u.provider}):a==="file"?(t,n,e)=>typeof i=="function"?i(t,n,e):f.jsxRuntimeExports.jsx(x.FileCrudCellValue,{value:t,provider:u.provider}):a==="time"?(t,n,e)=>{if(!t)return"-";const o=u==null?void 0:u.format,l=u==null?void 0:u.use12Hours,c=r.default.formatTime(t,o||(l?"hh:mm:ss A":void 0));return typeof i=="function"?i(t,n,e):c}:a==="color"?(t,n,e)=>typeof i=="function"?i(t,n,e):typeof t=="string"&&t.startsWith("#")?f.jsxRuntimeExports.jsx(g.default,{title:t,children:f.jsxRuntimeExports.jsx(q.default,{style:{backgroundColor:t}})}):String(t):a==="textarea"?(t,n,e)=>{const o=(u==null?void 0:u.truncated)??1;return typeof i=="function"?i(t,n,e):o?f.jsxRuntimeExports.jsx(s.ShowMore,{lines:o===!0?1:o,children:t}):t}:typeof i=="function"?i:t=>t}exports.getRendererValueCrudViewer=R;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { j as c } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { ShowMore as x } from "../../common/show-more/index.js";
|
|
3
|
-
import { FileCrudCellValue as j } from "../FileCrudField.js";
|
|
4
|
-
import { ImageCrudCellValue as y } from "../ImageCrudField.js";
|
|
5
|
-
import { TRANSLATION_NAMESPACE as A } from "../../../locale/hooks/translation-constants.js";
|
|
6
|
-
import { t as b } from "i18next";
|
|
7
|
-
import r from "../../../util/DateUtil.js";
|
|
8
|
-
import v from "../../../util/NumberUtil.js";
|
|
9
|
-
import e from "../../../../node_modules/@ant-design/icons/es/icons/CheckOutlined.js";
|
|
10
|
-
import g from "../../../../node_modules/@ant-design/icons/es/icons/CloseOutlined.js";
|
|
11
|
-
import h from "../../../../node_modules/antd/es/tooltip/index.js";
|
|
12
|
-
import C from "../../../../node_modules/antd/es/avatar/index.js";
|
|
13
|
-
function k({
|
|
14
|
-
type: u,
|
|
15
|
-
render: i,
|
|
16
|
-
...o
|
|
17
|
-
}) {
|
|
18
|
-
return u === "object" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : "" : u === "select" ? (t, f, n) => {
|
|
19
|
-
const m = o;
|
|
20
|
-
let a = m.multiple ? Array.isArray(t) ? t.map((l) => l == null ? void 0 : l[m.innerFieldLabel ?? "name"]) : void 0 : t == null ? void 0 : t[m.innerFieldLabel ?? "name"];
|
|
21
|
-
return (!a && typeof t == "string" || typeof t == "number") && (a = t), typeof i == "function" ? i(a, f, n) : Array.isArray(a) ? a.join(", ") : a;
|
|
22
|
-
} : u === "number" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : o != null && o.int ? v.toInt(t, o.formatted) : v.toMoney(t) : u === "enum" ? (t, f, n) => {
|
|
23
|
-
var a;
|
|
24
|
-
const m = b(
|
|
25
|
-
((a = o == null ? void 0 : o.translation) == null ? void 0 : a[t ?? ""]) ?? t,
|
|
26
|
-
{ ns: A }
|
|
27
|
-
);
|
|
28
|
-
return typeof i == "function" ? i(t, f, n) : m;
|
|
29
|
-
} : u === "date" ? (t, f, n) => {
|
|
30
|
-
if (!t) return "-";
|
|
31
|
-
const m = o != null && o.formatTime ? r.formatDateTime(t) : r.formatDate(t);
|
|
32
|
-
return typeof i == "function" ? i(t, f, n) : m;
|
|
33
|
-
} : u === "checkbox" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : t ? /* @__PURE__ */ c.jsx(e, {}) : /* @__PURE__ */ c.jsx(g, {}) : u === "image" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : /* @__PURE__ */ c.jsx(
|
|
34
|
-
y,
|
|
35
|
-
{
|
|
36
|
-
value: t,
|
|
37
|
-
provider: o.provider
|
|
38
|
-
}
|
|
39
|
-
) : u === "file" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : /* @__PURE__ */ c.jsx(
|
|
40
|
-
j,
|
|
41
|
-
{
|
|
42
|
-
value: t,
|
|
43
|
-
provider: o.provider
|
|
44
|
-
}
|
|
45
|
-
) : u === "time" ? (t, f, n) => {
|
|
46
|
-
if (!t) return "-";
|
|
47
|
-
const m = o == null ? void 0 : o.format, a = o == null ? void 0 : o.use12Hours, l = r.formatTime(
|
|
48
|
-
t,
|
|
49
|
-
m || (a ? "hh:mm:ss A" : void 0)
|
|
50
|
-
);
|
|
51
|
-
return typeof i == "function" ? i(t, f, n) : l;
|
|
52
|
-
} : u === "color" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : typeof t == "string" && t.startsWith("#") ? /* @__PURE__ */ c.jsx(h, { title: t, children: /* @__PURE__ */ c.jsx(C, { style: { backgroundColor: t } }) }) : String(t) : u === "textarea" ? (t, f, n) => {
|
|
53
|
-
const m = (o == null ? void 0 : o.truncated) ?? 1;
|
|
54
|
-
return typeof i == "function" ? i(t, f, n) : m ? /* @__PURE__ */ c.jsx(x, { lines: m === !0 ? 1 : m, children: t }) : t;
|
|
55
|
-
} : typeof i == "function" ? i : (t) => t;
|
|
56
|
-
}
|
|
57
|
-
export {
|
|
58
|
-
k as getRendererValueCrudViewer
|
|
59
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../node_modules/react-responsive/dist/esm/index.cjs");function s(){const i=e.useMediaQuery({minWidth:768}),t=e.useMediaQuery({maxWidth:767});return{isDesktop:i,isMobile:t}}exports.default=s;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="crud-component";exports.TRANSLATION_NAMESPACE=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./hooks/translation-constants.cjs"),o=require("./translations/en.cjs"),t=require("i18next"),u=require("react-i18next"),a={en:{[s.TRANSLATION_NAMESPACE]:o.default}},i=(e={})=>{const{translations:n=a,language:r="en"}=e;return t.use(u.initReactI18next).init({resources:n,lng:r,fallbackLng:"en",ns:s.TRANSLATION_NAMESPACE,interpolation:{escapeValue:!1}}),t},l=(e,n)=>{t.addResourceBundle(e,s.TRANSLATION_NAMESPACE,n,!0,!0)};exports.defaultTranslations=a;exports.setupI18n=i;exports.updateTranslations=l;
|
package/dist/src/locale/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { TRANSLATION_NAMESPACE as o } from "./hooks/translation-constants.js";
|
|
2
|
-
import a from "./translations/en.js";
|
|
3
|
-
import t from "i18next";
|
|
4
|
-
import { initReactI18next as s } from "react-i18next";
|
|
5
|
-
const i = {
|
|
6
|
-
en: {
|
|
7
|
-
[o]: a
|
|
8
|
-
}
|
|
9
|
-
}, m = (n = {}) => {
|
|
10
|
-
const { translations: e = i, language: r = "en" } = n;
|
|
11
|
-
return t.use(s).init({
|
|
12
|
-
resources: e,
|
|
13
|
-
lng: r,
|
|
14
|
-
fallbackLng: "en",
|
|
15
|
-
ns: o,
|
|
16
|
-
interpolation: {
|
|
17
|
-
escapeValue: !1
|
|
18
|
-
}
|
|
19
|
-
}), t;
|
|
20
|
-
}, f = (n, e) => {
|
|
21
|
-
t.addResourceBundle(
|
|
22
|
-
n,
|
|
23
|
-
o,
|
|
24
|
-
e,
|
|
25
|
-
!0,
|
|
26
|
-
!0
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
i as defaultTranslations,
|
|
31
|
-
m as setupI18n,
|
|
32
|
-
f as updateTranslations
|
|
33
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});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"},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"}},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?"}};exports.default=e;
|
|
@@ -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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../_virtual/dayjs.min.cjs"),a=require("i18next"),r=e=>t.default(e).locale(a.language).format("YYYY-MM-DD HH:mm"),l=e=>t.default(e).locale(a.language).format("YYYY-MM-DD HH:mm:ss"),u=e=>t.default(e).locale(a.language).format("YYYY-MM-DD"),n=(e,o="HH:mm:ss")=>t.default(e).locale(a.language).format(o),m={formatDateTime:r,formatDate:u,formatDateTimeWithSecond:l,formatTime:n};exports.default=m;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import a from "../../_virtual/dayjs.min.js";
|
|
2
|
-
import e from "i18next";
|
|
3
|
-
const m = (t) => a(t).locale(e.language).format("YYYY-MM-DD HH:mm"), r = (t) => a(t).locale(e.language).format("YYYY-MM-DD HH:mm:ss"), n = (t) => a(t).locale(e.language).format("YYYY-MM-DD"), l = (t, o = "HH:mm:ss") => a(t).locale(e.language).format(o), s = { formatDateTime: m, formatDate: n, formatDateTimeWithSecond: r, formatTime: l };
|
|
4
|
-
export {
|
|
5
|
-
s as default
|
|
6
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("../../node_modules/browser-image-compression/dist/browser-image-compression.cjs");class d{async resizeImage(t){const e=await c.default(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 g=new d;exports.default=g;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import c from "../../node_modules/browser-image-compression/dist/browser-image-compression.js";
|
|
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,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";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("i18next"),n=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 a=Number(r);isNaN(a)&&r||a<0||a>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%",n.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};exports.default=g;
|
|
@@ -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/types/Id.d.ts
DELETED
package/dist/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|