@kingteza/crud-component 1.0.11 → 1.0.13
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 +10 -3
- 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 -4
- package/dist/_virtual/index2.cjs +0 -1
- package/dist/_virtual/index2.js +0 -4
- package/dist/_virtual/index3.cjs +0 -1
- package/dist/_virtual/index3.js +0 -4
- package/dist/_virtual/index4.cjs +0 -1
- package/dist/_virtual/index4.js +0 -2
- 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 -7
- package/dist/_virtual/index7.cjs +0 -1
- package/dist/_virtual/index7.js +0 -7
- package/dist/_virtual/index8.cjs +0 -1
- package/dist/_virtual/index8.js +0 -7
- package/dist/_virtual/index9.cjs +0 -1
- package/dist/_virtual/index9.js +0 -4
- 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.production.min.cjs +0 -1
- package/dist/_virtual/react-is.production.min.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.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 -88
- package/dist/src/components/common/DatePicker/TimePicker.cjs +0 -1
- package/dist/src/components/common/DatePicker/TimePicker.js +0 -78
- 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 -64
- 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 -40
- 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 -24
- package/dist/src/components/common/picker/ImagePicker.cjs +0 -1
- package/dist/src/components/common/picker/ImagePicker.js +0 -285
- package/dist/src/components/common/radio/RadioGroupComponent.cjs +0 -1
- package/dist/src/components/common/radio/RadioGroupComponent.js +0 -19
- package/dist/src/components/common/report/SelectFieldInReport.cjs +0 -1
- package/dist/src/components/common/report/SelectFieldInReport.js +0 -30
- 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 -89
- 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 -37
- 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 -83
- 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 -47
- package/dist/src/components/common/text-field/TextField.cjs +0 -1
- package/dist/src/components/common/text-field/TextField.js +0 -73
- 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 -210
- package/dist/src/components/crud/CrudField.cjs +0 -1
- package/dist/src/components/crud/CrudField.js +0 -459
- package/dist/src/components/crud/CrudForm.cjs +0 -1
- package/dist/src/components/crud/CrudForm.js +0 -91
- package/dist/src/components/crud/CrudFormWizard.cjs +0 -1
- package/dist/src/components/crud/CrudFormWizard.js +0 -142
- package/dist/src/components/crud/CrudReportComponent.cjs +0 -4
- package/dist/src/components/crud/CrudReportComponent.js +0 -255
- package/dist/src/components/crud/CrudSearchComponent.cjs +0 -1
- package/dist/src/components/crud/CrudSearchComponent.js +0 -95
- package/dist/src/components/crud/FileCrudField.cjs +0 -1
- package/dist/src/components/crud/FileCrudField.js +0 -227
- package/dist/src/components/crud/ImageCrudField.cjs +0 -1
- package/dist/src/components/crud/ImageCrudField.js +0 -113
- 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 -222
- 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 -58
- 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,217 +0,0 @@
|
|
|
1
|
-
import { j as r } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { Modal as k } from "antd";
|
|
3
|
-
import H from "../../common/button/CloneButtonTable.js";
|
|
4
|
-
import U from "../../common/button/DeleteButtonTable.js";
|
|
5
|
-
import { ExportButton as F } from "../../common/button/ExportButton.js";
|
|
6
|
-
import rr from "../../common/button/HideButtonTable.js";
|
|
7
|
-
import { RefreshButton as or } from "../../common/button/RefreshButton.js";
|
|
8
|
-
import tr from "../../common/button/UpdateButtonTable.js";
|
|
9
|
-
import sr from "../../common/button/ViewButtonTable.js";
|
|
10
|
-
import mr from "../../common/layout/VerticalSpace.js";
|
|
11
|
-
import ur from "../../common/table/table.js";
|
|
12
|
-
import { useMemo as L, useState as _, useEffect as nr, useCallback as er } from "react";
|
|
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 { useTranslation as jr } from "../../../../node_modules/react-i18next/dist/es/useTranslation.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 } = jr(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
|
-
nr(() => {
|
|
67
|
-
v && x((o) => {
|
|
68
|
-
if (o)
|
|
69
|
-
return v.find((t) => t[s] === o[s]);
|
|
70
|
-
});
|
|
71
|
-
}, [v, s, m]);
|
|
72
|
-
const O = er(
|
|
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
|
-
tr,
|
|
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(H, { value: o, onClick: (u) => T(u) }),
|
|
88
|
-
S && /* @__PURE__ */ r.jsx(
|
|
89
|
-
F,
|
|
90
|
-
{
|
|
91
|
-
value: o,
|
|
92
|
-
onClick: async (u) => await S(u)
|
|
93
|
-
}
|
|
94
|
-
),
|
|
95
|
-
p && /* @__PURE__ */ r.jsx(
|
|
96
|
-
rr,
|
|
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
|
-
U,
|
|
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
|
-
k,
|
|
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(mr, { children: [
|
|
176
|
-
!!C && /* @__PURE__ */ r.jsx(or, { onClick: C }),
|
|
177
|
-
/* @__PURE__ */ r.jsx(
|
|
178
|
-
ur,
|
|
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(sr, { 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 l=require("../../../../_virtual/jsx-runtime.cjs"),m=require("antd"),x=require("../../common/show-more/index.cjs"),j=require("../FileCrudField.cjs"),v=require("../ImageCrudField.cjs"),y=require("../../../locale/hooks/translation-constants.cjs"),C=require("../../../../node_modules/i18next/dist/esm/i18next.cjs"),r=require("../../../util/DateUtil.cjs"),s=require("../../../util/NumberUtil.cjs"),g=require("../../../../node_modules/@ant-design/icons/es/icons/CheckOutlined.cjs"),d=require("../../../../node_modules/@ant-design/icons/es/icons/CloseOutlined.cjs");function q({type:a,render:i,...n}){return a==="object"?(t,u,e)=>typeof i=="function"?i(t,u,e):"":a==="select"?(t,u,e)=>{const o=n;let c=o.multiple?Array.isArray(t)?t.map(f=>f==null?void 0:f[o.innerFieldLabel??"name"]):void 0:t==null?void 0:t[o.innerFieldLabel??"name"];return(!c&&typeof t=="string"||typeof t=="number")&&(c=t),typeof i=="function"?i(c,u,e):Array.isArray(c)?c.join(", "):c}:a==="number"?(t,u,e)=>typeof i=="function"?i(t,u,e):n!=null&&n.int?s.default.toInt(t,n.formatted):s.default.toMoney(t):a==="enum"?(t,u,e)=>{var c;const o=C.t(((c=n==null?void 0:n.translation)==null?void 0:c[t??""])??t,{ns:y.TRANSLATION_NAMESPACE});return typeof i=="function"?i(t,u,e):o}:a==="date"?(t,u,e)=>{if(!t)return"-";const o=n!=null&&n.formatTime?r.formatDateTime(t):r.formatDate(t);return typeof i=="function"?i(t,u,e):o}:a==="checkbox"?(t,u,e)=>typeof i=="function"?i(t,u,e):t?l.jsxRuntimeExports.jsx(g,{}):l.jsxRuntimeExports.jsx(d,{}):a==="image"?(t,u,e)=>typeof i=="function"?i(t,u,e):l.jsxRuntimeExports.jsx(v.ImageCrudCellValue,{value:t,provider:n.provider}):a==="file"?(t,u,e)=>typeof i=="function"?i(t,u,e):l.jsxRuntimeExports.jsx(j.FileCrudCellValue,{value:t,provider:n.provider}):a==="time"?(t,u,e)=>{if(!t)return"-";const o=n==null?void 0:n.format,c=n==null?void 0:n.use12Hours,f=r.formatTime(t,o||(c?"hh:mm:ss A":void 0));return typeof i=="function"?i(t,u,e):f}:a==="color"?(t,u,e)=>typeof i=="function"?i(t,u,e):typeof t=="string"&&t.startsWith("#")?l.jsxRuntimeExports.jsx(m.Tooltip,{title:t,children:l.jsxRuntimeExports.jsx(m.Avatar,{style:{backgroundColor:t}})}):String(t):a==="textarea"?(t,u,e)=>{const o=(n==null?void 0:n.truncated)??1;return typeof i=="function"?i(t,u,e):o?l.jsxRuntimeExports.jsx(x.ShowMore,{lines:o===!0?1:o,children:t}):t}:typeof i=="function"?i:t=>t}exports.getRendererValueCrudViewer=q;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { j as c } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { Tooltip as x, Avatar as j } from "antd";
|
|
3
|
-
import { ShowMore as y } from "../../common/show-more/index.js";
|
|
4
|
-
import { FileCrudCellValue as A } from "../FileCrudField.js";
|
|
5
|
-
import { ImageCrudCellValue as b } from "../ImageCrudField.js";
|
|
6
|
-
import { TRANSLATION_NAMESPACE as e } from "../../../locale/hooks/translation-constants.js";
|
|
7
|
-
import { t as g } from "../../../../node_modules/i18next/dist/esm/i18next.js";
|
|
8
|
-
import r from "../../../util/DateUtil.js";
|
|
9
|
-
import v from "../../../util/NumberUtil.js";
|
|
10
|
-
import h from "../../../../node_modules/@ant-design/icons/es/icons/CheckOutlined.js";
|
|
11
|
-
import C from "../../../../node_modules/@ant-design/icons/es/icons/CloseOutlined.js";
|
|
12
|
-
function M({
|
|
13
|
-
type: u,
|
|
14
|
-
render: i,
|
|
15
|
-
...o
|
|
16
|
-
}) {
|
|
17
|
-
return u === "object" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : "" : u === "select" ? (t, f, n) => {
|
|
18
|
-
const m = o;
|
|
19
|
-
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"];
|
|
20
|
-
return (!a && typeof t == "string" || typeof t == "number") && (a = t), typeof i == "function" ? i(a, f, n) : Array.isArray(a) ? a.join(", ") : a;
|
|
21
|
-
} : 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) => {
|
|
22
|
-
var a;
|
|
23
|
-
const m = g(
|
|
24
|
-
((a = o == null ? void 0 : o.translation) == null ? void 0 : a[t ?? ""]) ?? t,
|
|
25
|
-
{ ns: e }
|
|
26
|
-
);
|
|
27
|
-
return typeof i == "function" ? i(t, f, n) : m;
|
|
28
|
-
} : u === "date" ? (t, f, n) => {
|
|
29
|
-
if (!t) return "-";
|
|
30
|
-
const m = o != null && o.formatTime ? r.formatDateTime(t) : r.formatDate(t);
|
|
31
|
-
return typeof i == "function" ? i(t, f, n) : m;
|
|
32
|
-
} : u === "checkbox" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : t ? /* @__PURE__ */ c.jsx(h, {}) : /* @__PURE__ */ c.jsx(C, {}) : u === "image" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : /* @__PURE__ */ c.jsx(
|
|
33
|
-
b,
|
|
34
|
-
{
|
|
35
|
-
value: t,
|
|
36
|
-
provider: o.provider
|
|
37
|
-
}
|
|
38
|
-
) : u === "file" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : /* @__PURE__ */ c.jsx(
|
|
39
|
-
A,
|
|
40
|
-
{
|
|
41
|
-
value: t,
|
|
42
|
-
provider: o.provider
|
|
43
|
-
}
|
|
44
|
-
) : u === "time" ? (t, f, n) => {
|
|
45
|
-
if (!t) return "-";
|
|
46
|
-
const m = o == null ? void 0 : o.format, a = o == null ? void 0 : o.use12Hours, l = r.formatTime(
|
|
47
|
-
t,
|
|
48
|
-
m || (a ? "hh:mm:ss A" : void 0)
|
|
49
|
-
);
|
|
50
|
-
return typeof i == "function" ? i(t, f, n) : l;
|
|
51
|
-
} : u === "color" ? (t, f, n) => typeof i == "function" ? i(t, f, n) : typeof t == "string" && t.startsWith("#") ? /* @__PURE__ */ c.jsx(x, { title: t, children: /* @__PURE__ */ c.jsx(j, { style: { backgroundColor: t } }) }) : String(t) : u === "textarea" ? (t, f, n) => {
|
|
52
|
-
const m = (o == null ? void 0 : o.truncated) ?? 1;
|
|
53
|
-
return typeof i == "function" ? i(t, f, n) : m ? /* @__PURE__ */ c.jsx(y, { lines: m === !0 ? 1 : m, children: t }) : t;
|
|
54
|
-
} : typeof i == "function" ? i : (t) => t;
|
|
55
|
-
}
|
|
56
|
-
export {
|
|
57
|
-
M as getRendererValueCrudViewer
|
|
58
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("../../node_modules/react-responsive/dist/esm/index.cjs");function n(){const i=e.useMediaQuery({minWidth:768}),s=e.useMediaQuery({maxWidth:767});return{isDesktop:i,isMobile:s}}module.exports=n;
|
|
@@ -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 a=require("./hooks/translation-constants.cjs"),u=require("./translations/en.cjs"),n=require("../../node_modules/i18next/dist/esm/i18next.cjs"),o=require("../../node_modules/react-i18next/dist/es/initReactI18next.cjs"),s={en:{[a.TRANSLATION_NAMESPACE]:u}},i=(e={})=>{const{translations:t=s,language:r="en"}=e;return n.default.use(o.initReactI18next).init({resources:t,lng:r,fallbackLng:"en",ns:a.TRANSLATION_NAMESPACE,interpolation:{escapeValue:!1}}),n.default},l=(e,t)=>{n.default.addResourceBundle(e,a.TRANSLATION_NAMESPACE,t,!0,!0)};exports.defaultTranslations=s;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 "../../node_modules/i18next/dist/esm/i18next.js";
|
|
4
|
-
import { initReactI18next as s } from "../../node_modules/react-i18next/dist/es/initReactI18next.js";
|
|
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";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?"}};module.exports=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";const e=require("../../_virtual/dayjs.min.cjs"),a=require("../../node_modules/i18next/dist/esm/i18next.cjs"),o=t=>e(t).locale(a.default.language).format("YYYY-MM-DD HH:mm"),m=t=>e(t).locale(a.default.language).format("YYYY-MM-DD HH:mm:ss"),n=t=>e(t).locale(a.default.language).format("YYYY-MM-DD"),l=(t,r="HH:mm:ss")=>e(t).locale(a.default.language).format(r),s={formatDateTime:o,formatDate:n,formatDateTimeWithSecond:m,formatTime:l};module.exports=s;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import t from "../../_virtual/dayjs.min.js";
|
|
2
|
-
import e from "../../node_modules/i18next/dist/esm/i18next.js";
|
|
3
|
-
const m = (a) => t(a).locale(e.language).format("YYYY-MM-DD HH:mm"), r = (a) => t(a).locale(e.language).format("YYYY-MM-DD HH:mm:ss"), n = (a) => t(a).locale(e.language).format("YYYY-MM-DD"), l = (a, o = "HH:mm:ss") => t(a).locale(e.language).format(o), c = { formatDateTime: m, formatDate: n, formatDateTimeWithSecond: r, formatTime: l };
|
|
4
|
-
export {
|
|
5
|
-
c as default
|
|
6
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const c=require("../../node_modules/browser-image-compression/dist/browser-image-compression.cjs");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 r=await new Promise(n=>{a.onload=function(){n({height:a.height,width:a.width})}});return Object.assign(e,r),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((r,n)=>{const s=new FileReader;s.onloadend=function(){const o=s.result,i=o.match(/^data:image\/(png|jpeg|jpg);base64,/);i?r({data:o,type:i[1]}):n(new Error("Could not determine image type"))},s.onerror=n,s.readAsDataURL(a)})}}catch(e){return console.warn(e),null}}}const d=new g;module.exports=d;
|
|
@@ -1,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";const i=require("../../node_modules/i18next/dist/esm/i18next.cjs"),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,60 +0,0 @@
|
|
|
1
|
-
import { t as r } from "../../node_modules/i18next/dist/esm/i18next.js";
|
|
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>
|