@kingteza/crud-component 1.30.0 → 1.31.0
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/common/report/SelectFieldInReport.cjs.js +1 -1
- package/dist/common/report/SelectFieldInReport.d.ts +2 -0
- package/dist/common/report/SelectFieldInReport.es.js +88 -25
- package/dist/crud/CrudReportComponent.cjs.js +1 -1
- package/dist/crud/CrudReportComponent.d.ts +3 -1
- package/dist/crud/CrudReportComponent.es.js +69 -66
- package/dist/locale/translations/en.cjs.js +1 -1
- package/dist/locale/translations/en.d.ts +1 -0
- package/dist/locale/translations/en.es.js +2 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("antd"),i=require("react"),I=require("../select/SelectComponent.cjs.js"),v=require("../../util/ValidationUtil.cjs.js"),V=({className:x,onSelect:p,label:r,required:a,name:l,mode:d,items:n,selectingMode:k})=>{const o=s.Form.useFormInstance(),[b,S]=i.useState(!0);i.useEffect(()=>{if(n&&b){const e=n.filter(h=>h.alreadySelected).map(h=>h.id);o==null||o.setFieldsValue({[l]:d==="multiple"?e:e==null?void 0:e[0]}),S(!1)}},[b,o,n,d,l]);const[F,u]=i.useState(!1),[f,C]=i.useState(void 0),O=i.useCallback(()=>{u(!1),o.setFieldsValue({[l]:f})},[f,o,l]),g=i.useCallback(()=>{u(!1),C(void 0)},[]),j=i.useCallback(()=>{C(o.getFieldValue(l)),u(!0)},[o,l]),c=k==="checkbox",y=i.useCallback(e=>{c&&e&&j()},[c,j]);return t.jsxs(t.Fragment,{children:[c&&t.jsx(s.Modal,{open:F,onCancel:O,onOk:g,destroyOnHidden:!0,title:r,children:t.jsx(s.Form.Item,{name:l,required:a,rules:[...a?v.required(r):[]],className:x,children:t.jsx(s.Checkbox.Group,{onChange:p,style:{width:"100%"},children:t.jsx(s.List,{size:"small",style:{width:"100%"},dataSource:n,renderItem:e=>t.jsx(s.List.Item,{style:{width:"100%"},children:t.jsx(s.List.Item.Meta,{avatar:t.jsx(s.Checkbox,{value:e.id,disabled:e.lock}),title:e.label})},e.id)})})})}),t.jsx(I,{required:a,label:r,mode:d,className:x,name:l,onSelect:p,items:n,showSearch:!1,...c?{open:!1,onOpenChange:y}:{},itemBuilder:e=>t.jsx(s.Select.Option,{value:e.id,disabled:e.lock,children:e.label},e.id)})]})};exports.SelectFieldInReport=V;
|
|
@@ -5,6 +5,7 @@ export interface ReportSelectFieldItems {
|
|
|
5
5
|
lock?: boolean;
|
|
6
6
|
alreadySelected?: boolean;
|
|
7
7
|
}
|
|
8
|
+
export type SelectFieldInReportSelectingMode = "checkbox" | "select";
|
|
8
9
|
export declare const SelectFieldInReport: FC<{
|
|
9
10
|
mode?: "multiple" | "tags" | undefined;
|
|
10
11
|
name: string;
|
|
@@ -13,4 +14,5 @@ export declare const SelectFieldInReport: FC<{
|
|
|
13
14
|
required?: boolean;
|
|
14
15
|
onSelect?: (val: any) => void;
|
|
15
16
|
items: ReportSelectFieldItems[];
|
|
17
|
+
selectingMode?: SelectFieldInReportSelectingMode;
|
|
16
18
|
}>;
|
|
@@ -1,30 +1,93 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
items: e,
|
|
24
|
-
itemBuilder: (t) => /* @__PURE__ */ s(m.Option, { value: t.id, disabled: t.lock, children: t.label }, t.id)
|
|
1
|
+
import { jsxs as w, Fragment as M, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Form as O, Modal as j, Checkbox as S, List as p, Select as B } from "antd";
|
|
3
|
+
import { useState as f, useEffect as z, useCallback as r } from "react";
|
|
4
|
+
import E from "../select/SelectComponent.es.js";
|
|
5
|
+
import G from "../../util/ValidationUtil.es.js";
|
|
6
|
+
const D = ({
|
|
7
|
+
className: h,
|
|
8
|
+
onSelect: C,
|
|
9
|
+
label: n,
|
|
10
|
+
required: c,
|
|
11
|
+
name: l,
|
|
12
|
+
mode: d,
|
|
13
|
+
items: i,
|
|
14
|
+
selectingMode: x
|
|
15
|
+
}) => {
|
|
16
|
+
const o = O.useFormInstance(), [k, I] = f(!0);
|
|
17
|
+
z(() => {
|
|
18
|
+
if (i && k) {
|
|
19
|
+
const e = i.filter((u) => u.alreadySelected).map((u) => u.id);
|
|
20
|
+
o == null || o.setFieldsValue({
|
|
21
|
+
[l]: d === "multiple" ? e : e == null ? void 0 : e[0]
|
|
22
|
+
}), I(!1);
|
|
25
23
|
}
|
|
24
|
+
}, [k, o, i, d, l]);
|
|
25
|
+
const [V, a] = f(!1), [F, b] = f(void 0), g = r(() => {
|
|
26
|
+
a(!1), o.setFieldsValue({
|
|
27
|
+
[l]: F
|
|
28
|
+
});
|
|
29
|
+
}, [F, o, l]), v = r(() => {
|
|
30
|
+
a(!1), b(void 0);
|
|
31
|
+
}, []), m = r(() => {
|
|
32
|
+
b(o.getFieldValue(l)), a(!0);
|
|
33
|
+
}, [o, l]), s = x === "checkbox", y = r(
|
|
34
|
+
(e) => {
|
|
35
|
+
s && e && m();
|
|
36
|
+
},
|
|
37
|
+
[s, m]
|
|
26
38
|
);
|
|
39
|
+
return /* @__PURE__ */ w(M, { children: [
|
|
40
|
+
s && /* @__PURE__ */ t(
|
|
41
|
+
j,
|
|
42
|
+
{
|
|
43
|
+
open: V,
|
|
44
|
+
onCancel: g,
|
|
45
|
+
onOk: v,
|
|
46
|
+
destroyOnHidden: !0,
|
|
47
|
+
title: n,
|
|
48
|
+
children: /* @__PURE__ */ t(
|
|
49
|
+
O.Item,
|
|
50
|
+
{
|
|
51
|
+
name: l,
|
|
52
|
+
required: c,
|
|
53
|
+
rules: [...c ? G.required(n) : []],
|
|
54
|
+
className: h,
|
|
55
|
+
children: /* @__PURE__ */ t(S.Group, { onChange: C, style: { width: "100%" }, children: /* @__PURE__ */ t(
|
|
56
|
+
p,
|
|
57
|
+
{
|
|
58
|
+
size: "small",
|
|
59
|
+
style: { width: "100%" },
|
|
60
|
+
dataSource: i,
|
|
61
|
+
renderItem: (e) => /* @__PURE__ */ t(p.Item, { style: { width: "100%" }, children: /* @__PURE__ */ t(
|
|
62
|
+
p.Item.Meta,
|
|
63
|
+
{
|
|
64
|
+
avatar: /* @__PURE__ */ t(S, { value: e.id, disabled: e.lock }),
|
|
65
|
+
title: e.label
|
|
66
|
+
}
|
|
67
|
+
) }, e.id)
|
|
68
|
+
}
|
|
69
|
+
) })
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ t(
|
|
75
|
+
E,
|
|
76
|
+
{
|
|
77
|
+
required: c,
|
|
78
|
+
label: n,
|
|
79
|
+
mode: d,
|
|
80
|
+
className: h,
|
|
81
|
+
name: l,
|
|
82
|
+
onSelect: C,
|
|
83
|
+
items: i,
|
|
84
|
+
showSearch: !1,
|
|
85
|
+
...s ? { open: !1, onOpenChange: y } : {},
|
|
86
|
+
itemBuilder: (e) => /* @__PURE__ */ t(B.Option, { value: e.id, disabled: e.lock, children: e.label }, e.id)
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
] });
|
|
27
90
|
};
|
|
28
91
|
export {
|
|
29
|
-
|
|
92
|
+
D as SelectFieldInReport
|
|
30
93
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),K=require("@ant-design/icons"),s=require("antd"),i=require("react"),x=require("./CrudField.cjs.js"),Q=require("./view/CrudViewer.cjs.js"),W=require("../common/report/SelectFieldInReport.cjs.js"),V=require("./view/CrudViewerUtil.cjs.js"),X=require("../locale/index.cjs.js"),Y=require("../common/select/SelectComponent.cjs.js"),v=require("../common/button/Button.cjs.js"),Z=require("../common/button/PrintButton.cjs.js"),A={lg:6,md:8,sm:12,xs:24},E={lg:12,md:16,sm:24,xs:24};function k({fields:d,data:u,idField:L,loadingData:f,onSubmit:g,paginateProps:G,size:M,onClickPrint:h,onClickExcelExport:y,minusHeight:O,extraSearchFields:R,searchOnMount:B,summary:U,showFieldsSelectingMode:_="checkbox"}){const{t:$}=X.useTranslationLib(),{searchable:z,selectable:c,sortable:q,defaultSort:p}=i.useMemo(()=>{var b,m,N,T,I;const e=[],r=[],o=[];let n;for(const l of d.filter(J=>!J.hidden))l.type==="image"||!l.report||((b=l.report)!=null&&b.searchable&&e.push(l),(m=l.report)!=null&&m.sortable&&(r.push(l),!n&&((N=l.report)!=null&&N.defaultSort)&&(n=l)),l.hideInTable||o.push({id:l.name,label:l.label,lock:(T=l.report)==null?void 0:T.lock,alreadySelected:(I=l.report)==null?void 0:I.alreadySelected}));return{defaultSort:n,searchable:e,sortable:r,selectable:o}},[d]),[S,F]=i.useState([]),j=i.useCallback(async({sortBy:e,sortByType:r,showFields:o=[],...n})=>{const b=[];e&&b.push({field:e,sort:r??"DESC"}),F(d.filter(m=>o.includes(m.name)).map(m=>({...m,hideInTable:!1}))),g({showFields:o,sortBy:b,...n})},[d,g]),[a]=s.Form.useForm(),[w,D]=i.useState(!1),[C,H]=i.useState(!0);return i.useEffect(()=>{if(B&&C){const e=setTimeout(()=>{a.validateFields().then(r=>{j(r)}),H(!1)},200);return()=>clearTimeout(e)}},[j,a,C,B]),i.useEffect(()=>{var r,o;!a.getFieldValue("sortBy")&&p&&a.setFieldsValue({sortBy:p.name,sortByType:typeof((r=p.report)==null?void 0:r.defaultSort)=="string"?(o=p.report)==null?void 0:o.defaultSort:"ASC"})},[p,a]),i.useEffect(()=>{if(w){const e=c.filter(r=>r.alreadySelected).map(r=>r.id);F(d.filter(r=>e.includes(r.name)).map(r=>({...r,hideInTable:!1}))),D(!1)}},[d,w,c]),t.jsxs(s.Space,{className:"w-100",direction:"vertical",children:[t.jsxs(s.Form,{form:a,layout:"vertical",onFinish:j,children:[t.jsxs(s.Row,{gutter:[8,8],children:[z.map(e=>{var r,o,n;return t.jsx(s.Col,{...e.grid??A,style:{alignSelf:"end"},children:(r=e.report)!=null&&r.customRender?e.report.customRender(a):e.type==="date"?t.jsx(x.default,{...e,type:"date",range:(o=e.report)==null?void 0:o.range,required:!!((n=e.report)!=null&&n.required),readonly:!1,fieldClassName:"mb-0"}):e.type==="select"?t.jsx(x.default,{...e,type:"select",multiple:!0,required:!1,readonly:!1,fieldClassName:"mb-0"}):t.jsx(x.default,{...e,readonly:!1,required:!1,fieldClassName:"mb-0"})},e.name)}),!!(c!=null&&c.length)&&t.jsx(s.Col,{...E,children:t.jsx(W.SelectFieldInReport,{items:c,name:"showFields",mode:"multiple",label:$("str.showFields"),className:"mb-0",selectingMode:_})}),!!q.length&&t.jsx(s.Col,{...A,children:t.jsx(Y,{label:"Sort By",name:"sortBy",items:q.map(e=>({id:e.name,label:e.label})),nameFieldInArray:"label",fieldId:"id",className:"mb-0",dropdownRender:e=>t.jsxs(t.Fragment,{children:[e,t.jsx(s.Form.Item,{name:"sortByType",noStyle:!0,className:"mt-3",children:t.jsx(s.Radio.Group,{className:"w-100",defaultValue:"DESC",optionType:"button",children:t.jsxs(s.Row,{children:[t.jsx(s.Col,{xs:12,children:t.jsx(s.Radio,{className:"w-100",style:{borderTopRightRadius:0,borderBottomRightRadius:0},value:"ASC",children:"Ascending"})}),t.jsx(s.Col,{xs:12,children:t.jsx(s.Radio,{className:"w-100",style:{borderTopLeftRadius:0,borderBottomLeftRadius:0},value:"DESC",children:"Descending"})})]})})})]})})}),R?R(a):null]}),t.jsx(v,{className:"mt-3",type:"primary",block:!0,htmlType:"submit",disabled:f,children:"Submit"})]}),t.jsxs(s.Space,{children:[!!h&&t.jsx(Z.PrintButton,{disabled:f||!u.length,onClick:()=>h==null?void 0:h({tableId:"#crud-table table",data:u,fields:S.map(e=>({...e,render:V.getRendererValueCrudViewer(e)}))})}),!!y&&t.jsx(v,{disabled:f||!u.length,onClick:()=>y==null?void 0:y({tableId:"#crud-table table",data:u,fields:S.map(e=>({...e,render:V.getRendererValueCrudViewer(e)}))}),icon:t.jsx(K.FileExcelOutlined,{}),className:`group ${f||!u.length?"":"crud-excel-export-btn"}`,children:"Excel"})]}),U,t.jsx(Q,{minusHeight:O,data:u,size:M,fields:S,idField:L,loadingData:f,paginateProps:G,viewable:!1})]})}module.exports=k;
|
|
@@ -2,6 +2,7 @@ import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
|
2
2
|
import { FormInstance } from 'antd/lib';
|
|
3
3
|
import { default as React, ReactElement } from 'react';
|
|
4
4
|
import { CrudFieldProps, CrudPaginateProps } from './CrudComponent';
|
|
5
|
+
import { SelectFieldInReportSelectingMode } from '../common/report/SelectFieldInReport';
|
|
5
6
|
export type CrudReportSubmitForm<T> = {
|
|
6
7
|
sortBy: {
|
|
7
8
|
field: keyof T;
|
|
@@ -39,6 +40,7 @@ export interface CrudReportComponentProps<T_Data, F_Search> {
|
|
|
39
40
|
minusHeight?: string;
|
|
40
41
|
extraSearchFields?: (form: FormInstance<any>) => ReactElement;
|
|
41
42
|
searchOnMount?: boolean;
|
|
43
|
+
showFieldsSelectingMode?: SelectFieldInReportSelectingMode;
|
|
42
44
|
}
|
|
43
|
-
declare function CrudReportComponent<T, F = T>({ fields, data, idField, loadingData, onSubmit, paginateProps, size, onClickPrint, onClickExcelExport, minusHeight, extraSearchFields, searchOnMount, summary, }: Readonly<CrudReportComponentProps<T, F>>): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
declare function CrudReportComponent<T, F = T>({ fields, data, idField, loadingData, onSubmit, paginateProps, size, onClickPrint, onClickExcelExport, minusHeight, extraSearchFields, searchOnMount, summary, showFieldsSelectingMode, }: Readonly<CrudReportComponentProps<T, F>>): import("react/jsx-runtime").JSX.Element;
|
|
44
46
|
export default CrudReportComponent;
|
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { FileExcelOutlined as
|
|
3
|
-
import { Form as B, Space as
|
|
4
|
-
import { useMemo as
|
|
1
|
+
import { jsxs as c, jsx as t, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { FileExcelOutlined as E } from "@ant-design/icons";
|
|
3
|
+
import { Form as B, Space as G, Row as M, Col as b, Radio as R } from "antd";
|
|
4
|
+
import { useMemo as P, useState as F, useCallback as ee, useEffect as w } from "react";
|
|
5
5
|
import N from "./CrudField.es.js";
|
|
6
|
-
import
|
|
7
|
-
import { SelectFieldInReport as
|
|
8
|
-
import { getRendererValueCrudViewer as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import re from "./view/CrudViewer.es.js";
|
|
7
|
+
import { SelectFieldInReport as te } from "../common/report/SelectFieldInReport.es.js";
|
|
8
|
+
import { getRendererValueCrudViewer as O } from "./view/CrudViewerUtil.es.js";
|
|
9
|
+
import { useTranslationLib as le } from "../locale/index.es.js";
|
|
10
|
+
import oe from "../common/select/SelectComponent.es.js";
|
|
11
|
+
import _ from "../common/button/Button.es.js";
|
|
12
|
+
import { PrintButton as se } from "../common/button/PrintButton.es.js";
|
|
13
|
+
const $ = { lg: 6, md: 8, sm: 12, xs: 24 }, ae = { lg: 12, md: 16, sm: 24, xs: 24 };
|
|
14
|
+
function ge({
|
|
14
15
|
fields: i,
|
|
15
|
-
data:
|
|
16
|
-
idField:
|
|
17
|
-
loadingData:
|
|
16
|
+
data: n,
|
|
17
|
+
idField: z,
|
|
18
|
+
loadingData: u,
|
|
18
19
|
onSubmit: T,
|
|
19
|
-
paginateProps:
|
|
20
|
-
size:
|
|
20
|
+
paginateProps: D,
|
|
21
|
+
size: H,
|
|
21
22
|
onClickPrint: h,
|
|
22
23
|
onClickExcelExport: y,
|
|
23
|
-
minusHeight:
|
|
24
|
+
minusHeight: J,
|
|
24
25
|
extraSearchFields: C,
|
|
25
26
|
searchOnMount: I,
|
|
26
|
-
summary:
|
|
27
|
+
summary: K,
|
|
28
|
+
showFieldsSelectingMode: Q = "checkbox"
|
|
27
29
|
}) {
|
|
28
|
-
const { searchable:
|
|
29
|
-
var f, m,
|
|
30
|
+
const { t: U } = le(), { searchable: W, selectable: d, sortable: v, defaultSort: p } = P(() => {
|
|
31
|
+
var f, m, L, j, x;
|
|
30
32
|
const e = [], r = [], o = [];
|
|
31
33
|
let a;
|
|
32
|
-
for (const l of i.filter((
|
|
33
|
-
l.type === "image" || !l.report || ((f = l.report) != null && f.searchable && e.push(l), (m = l.report) != null && m.sortable && (r.push(l), !a && ((
|
|
34
|
+
for (const l of i.filter((Z) => !Z.hidden))
|
|
35
|
+
l.type === "image" || !l.report || ((f = l.report) != null && f.searchable && e.push(l), (m = l.report) != null && m.sortable && (r.push(l), !a && ((L = l.report) != null && L.defaultSort) && (a = l)), l.hideInTable || o.push({
|
|
34
36
|
id: l.name,
|
|
35
37
|
label: l.label,
|
|
36
|
-
lock: (
|
|
37
|
-
alreadySelected: (
|
|
38
|
+
lock: (j = l.report) == null ? void 0 : j.lock,
|
|
39
|
+
alreadySelected: (x = l.report) == null ? void 0 : x.alreadySelected
|
|
38
40
|
}));
|
|
39
41
|
return {
|
|
40
42
|
defaultSort: a,
|
|
@@ -44,7 +46,7 @@ function be({
|
|
|
44
46
|
};
|
|
45
47
|
}, [i]), [S, V] = F(
|
|
46
48
|
[]
|
|
47
|
-
), g =
|
|
49
|
+
), g = ee(
|
|
48
50
|
async ({
|
|
49
51
|
sortBy: e,
|
|
50
52
|
sortByType: r,
|
|
@@ -60,13 +62,13 @@ function be({
|
|
|
60
62
|
), T({ showFields: o, sortBy: f, ...a });
|
|
61
63
|
},
|
|
62
64
|
[i, T]
|
|
63
|
-
), [s] = B.useForm(), [q,
|
|
65
|
+
), [s] = B.useForm(), [q, X] = F(!1), [A, Y] = F(!0);
|
|
64
66
|
return w(() => {
|
|
65
67
|
if (I && A) {
|
|
66
68
|
const e = setTimeout(() => {
|
|
67
69
|
s.validateFields().then((r) => {
|
|
68
70
|
g(r);
|
|
69
|
-
}),
|
|
71
|
+
}), Y(!1);
|
|
70
72
|
}, 200);
|
|
71
73
|
return () => clearTimeout(e);
|
|
72
74
|
}
|
|
@@ -78,20 +80,20 @@ function be({
|
|
|
78
80
|
});
|
|
79
81
|
}, [p, s]), w(() => {
|
|
80
82
|
if (q) {
|
|
81
|
-
const e =
|
|
83
|
+
const e = d.filter((r) => r.alreadySelected).map((r) => r.id);
|
|
82
84
|
V(
|
|
83
85
|
i.filter((r) => e.includes(r.name)).map((r) => ({ ...r, hideInTable: !1 }))
|
|
84
|
-
),
|
|
86
|
+
), X(!1);
|
|
85
87
|
}
|
|
86
|
-
}, [i, q,
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
|
|
88
|
+
}, [i, q, d]), /* @__PURE__ */ c(G, { className: "w-100", direction: "vertical", children: [
|
|
89
|
+
/* @__PURE__ */ c(B, { form: s, layout: "vertical", onFinish: g, children: [
|
|
90
|
+
/* @__PURE__ */ c(M, { gutter: [8, 8], children: [
|
|
91
|
+
W.map((e) => {
|
|
90
92
|
var r, o, a;
|
|
91
93
|
return /* @__PURE__ */ t(
|
|
92
94
|
b,
|
|
93
95
|
{
|
|
94
|
-
...e.grid ??
|
|
96
|
+
...e.grid ?? $,
|
|
95
97
|
style: { alignSelf: "end" },
|
|
96
98
|
children: (r = e.report) != null && r.customRender ? e.report.customRender(s) : e.type === "date" ? /* @__PURE__ */ t(
|
|
97
99
|
N,
|
|
@@ -126,18 +128,19 @@ function be({
|
|
|
126
128
|
e.name
|
|
127
129
|
);
|
|
128
130
|
}),
|
|
129
|
-
!!(
|
|
130
|
-
|
|
131
|
+
!!(d != null && d.length) && /* @__PURE__ */ t(b, { ...ae, children: /* @__PURE__ */ t(
|
|
132
|
+
te,
|
|
131
133
|
{
|
|
132
|
-
items:
|
|
134
|
+
items: d,
|
|
133
135
|
name: "showFields",
|
|
134
136
|
mode: "multiple",
|
|
135
|
-
label: "
|
|
136
|
-
className: "mb-0"
|
|
137
|
+
label: U("str.showFields"),
|
|
138
|
+
className: "mb-0",
|
|
139
|
+
selectingMode: Q
|
|
137
140
|
}
|
|
138
141
|
) }),
|
|
139
|
-
!!v.length && /* @__PURE__ */ t(b, {
|
|
140
|
-
|
|
142
|
+
!!v.length && /* @__PURE__ */ t(b, { ...$, children: /* @__PURE__ */ t(
|
|
143
|
+
oe,
|
|
141
144
|
{
|
|
142
145
|
label: "Sort By",
|
|
143
146
|
name: "sortBy",
|
|
@@ -145,7 +148,7 @@ function be({
|
|
|
145
148
|
nameFieldInArray: "label",
|
|
146
149
|
fieldId: "id",
|
|
147
150
|
className: "mb-0",
|
|
148
|
-
dropdownRender: (e) => /* @__PURE__ */
|
|
151
|
+
dropdownRender: (e) => /* @__PURE__ */ c(k, { children: [
|
|
149
152
|
e,
|
|
150
153
|
/* @__PURE__ */ t(B.Item, { name: "sortByType", noStyle: !0, className: "mt-3", children: /* @__PURE__ */ t(
|
|
151
154
|
R.Group,
|
|
@@ -153,7 +156,7 @@ function be({
|
|
|
153
156
|
className: "w-100",
|
|
154
157
|
defaultValue: "DESC",
|
|
155
158
|
optionType: "button",
|
|
156
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: /* @__PURE__ */ c(M, { children: [
|
|
157
160
|
/* @__PURE__ */ t(b, { xs: 12, children: /* @__PURE__ */ t(
|
|
158
161
|
R,
|
|
159
162
|
{
|
|
@@ -187,66 +190,66 @@ function be({
|
|
|
187
190
|
C ? C(s) : null
|
|
188
191
|
] }),
|
|
189
192
|
/* @__PURE__ */ t(
|
|
190
|
-
|
|
193
|
+
_,
|
|
191
194
|
{
|
|
192
195
|
className: "mt-3",
|
|
193
196
|
type: "primary",
|
|
194
197
|
block: !0,
|
|
195
198
|
htmlType: "submit",
|
|
196
|
-
disabled:
|
|
199
|
+
disabled: u,
|
|
197
200
|
children: "Submit"
|
|
198
201
|
}
|
|
199
202
|
)
|
|
200
203
|
] }),
|
|
201
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ c(G, { children: [
|
|
202
205
|
!!h && /* @__PURE__ */ t(
|
|
203
|
-
|
|
206
|
+
se,
|
|
204
207
|
{
|
|
205
|
-
disabled:
|
|
208
|
+
disabled: u || !n.length,
|
|
206
209
|
onClick: () => h == null ? void 0 : h({
|
|
207
210
|
tableId: "#crud-table table",
|
|
208
|
-
data:
|
|
211
|
+
data: n,
|
|
209
212
|
fields: S.map((e) => ({
|
|
210
213
|
...e,
|
|
211
|
-
render:
|
|
214
|
+
render: O(e)
|
|
212
215
|
}))
|
|
213
216
|
})
|
|
214
217
|
}
|
|
215
218
|
),
|
|
216
219
|
!!y && /* @__PURE__ */ t(
|
|
217
|
-
|
|
220
|
+
_,
|
|
218
221
|
{
|
|
219
|
-
disabled:
|
|
222
|
+
disabled: u || !n.length,
|
|
220
223
|
onClick: () => y == null ? void 0 : y({
|
|
221
224
|
tableId: "#crud-table table",
|
|
222
|
-
data:
|
|
225
|
+
data: n,
|
|
223
226
|
fields: S.map((e) => ({
|
|
224
227
|
...e,
|
|
225
|
-
render:
|
|
228
|
+
render: O(e)
|
|
226
229
|
}))
|
|
227
230
|
}),
|
|
228
|
-
icon: /* @__PURE__ */ t(
|
|
229
|
-
className: `group ${
|
|
231
|
+
icon: /* @__PURE__ */ t(E, {}),
|
|
232
|
+
className: `group ${u || !n.length ? "" : "crud-excel-export-btn"}`,
|
|
230
233
|
children: "Excel"
|
|
231
234
|
}
|
|
232
235
|
)
|
|
233
236
|
] }),
|
|
234
|
-
|
|
237
|
+
K,
|
|
235
238
|
/* @__PURE__ */ t(
|
|
236
|
-
|
|
239
|
+
re,
|
|
237
240
|
{
|
|
238
|
-
minusHeight:
|
|
239
|
-
data:
|
|
240
|
-
size:
|
|
241
|
+
minusHeight: J,
|
|
242
|
+
data: n,
|
|
243
|
+
size: H,
|
|
241
244
|
fields: S,
|
|
242
|
-
idField:
|
|
243
|
-
loadingData:
|
|
244
|
-
paginateProps:
|
|
245
|
+
idField: z,
|
|
246
|
+
loadingData: u,
|
|
247
|
+
paginateProps: D,
|
|
245
248
|
viewable: !1
|
|
246
249
|
}
|
|
247
250
|
)
|
|
248
251
|
] });
|
|
249
252
|
}
|
|
250
253
|
export {
|
|
251
|
-
|
|
254
|
+
ge as default
|
|
252
255
|
};
|
|
@@ -1 +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",skipCrop:"Skip Crop"},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;
|
|
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",skipCrop:"Skip Crop",showFields:"Show Fields"},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;
|