denwa-react-shared 1.0.93 → 1.0.95

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.
Files changed (36) hide show
  1. package/dist/base-table-CEtpTXnb.cjs +1 -0
  2. package/dist/base-table-C__iDbuG.js +90 -0
  3. package/dist/denwa-react-shared.cjs.js +1 -132
  4. package/dist/denwa-react-shared.css +1 -1
  5. package/dist/denwa-react-shared.es.js +890 -31954
  6. package/dist/shared/lib/index.d.ts +1 -0
  7. package/dist/shared/lib/openapi-axios/const/defaultOptions.d.ts +5 -0
  8. package/dist/shared/lib/openapi-axios/const/methods.d.ts +18 -0
  9. package/dist/shared/lib/openapi-axios/index.d.ts +80 -0
  10. package/dist/shared/lib/openapi-axios/interpolate-params.d.ts +11 -0
  11. package/dist/shared/lib/openapi-axios/types/options.d.ts +27 -0
  12. package/dist/shared/lib/openapi-axios/types/requestParameters.d.ts +22 -0
  13. package/dist/shared/lib/openapi-axios/types/response.d.ts +100 -0
  14. package/dist/shared/lib/openapi-axios/types/schemeTypes.d.ts +69 -0
  15. package/dist/shared/lib/openapi-axios/types/serializer.d.ts +21 -0
  16. package/dist/shared/lib/openapi-axios/types/utils.d.ts +44 -0
  17. package/dist/shared/lib/openapi-axios/utils/querySerializer.d.ts +3 -0
  18. package/dist/shared/lib/openapi-axios/utils/response-converters/convertToAll.d.ts +5 -0
  19. package/dist/shared/lib/openapi-axios/utils/response-converters/convertToAxios.d.ts +5 -0
  20. package/dist/shared/lib/openapi-axios/utils/response-converters/convertToFetch.d.ts +5 -0
  21. package/dist/styles.module-B6UFYCUZ.cjs +1 -0
  22. package/dist/styles.module-DqoHspR8.js +775 -0
  23. package/dist/table-head-DEAS-Ubv.js +123 -0
  24. package/dist/table-head-DbVlLwY6.cjs +1 -0
  25. package/package.json +39 -24
  26. package/dist/base-table-CJaPkrQG.js +0 -8323
  27. package/dist/base-table-DQjDFH1p.cjs +0 -67
  28. package/dist/denwa-react-shared.umd.js +0 -703
  29. package/dist/space-BJ3vxIsm.cjs +0 -403
  30. package/dist/space-DbOTEMQH.js +0 -34936
  31. package/dist/spin-DmlDLEyA.js +0 -2711
  32. package/dist/spin-WHoLMfw5.cjs +0 -10
  33. package/dist/styles.module-C_XbqrB-.cjs +0 -95
  34. package/dist/styles.module-klEM0K92.js +0 -17512
  35. package/dist/table-head-DmPedLsO.cjs +0 -1
  36. package/dist/table-head-cgBo60N5.js +0 -588
@@ -0,0 +1 @@
1
+ let e=require("react/jsx-runtime"),t=require("antd"),n=require("@ant-design/icons");var r=({viewText:r,actionsText:i,editText:a,deleteText:o,columns:s,serverPagination:c,scroll:l,loading:u,dataSource:d,isHiddenUpdate:f,isCanRead:p,isCanUpdate:m,isCanDelete:h,isFixedActions:g,onView:_,onDropdownClick:v,onEdit:y,onDelete:b,onShowSizeChange:x,...S})=>{let C=d?.map(e=>{let t={};return Object.entries(e).forEach(([e,n])=>{t[e]=n||`-`}),t}),w=s??[],T=c?{current:c.page??1,pageSize:c.limit??1,total:c.count??0,pageSizeOptions:[10,20,50,100,200,500],showSizeChanger:!0,showQuickJumper:!0,onShowSizeChange:x,showTotal:(e,t)=>`${t[0]}-${t[1]} / ${e}`}:null,E=e=>{`id`in e&&typeof e.id==`string`&&_(e.id)},D=e=>{`id`in e&&typeof e.id==`string`&&v(e.id)},O=[];!f&&m&&O.push({key:`edit`,label:(0,e.jsx)(t.Button,{type:`link`,block:!0,onClick:y,children:a})}),h&&b&&O.push({key:`delete`,label:(0,e.jsx)(t.Button,{type:`link`,block:!0,danger:!0,onClick:b,children:o})});let k=[...w,{title:i,key:`action`,width:180,fixed:g?`right`:!1,render:n=>O.length?(0,e.jsx)(t.Dropdown.Button,{disabled:!p,menu:{items:O,onClick:()=>D(n)},onClick:()=>E(n),children:r}):(0,e.jsx)(t.Button,{disabled:!p,onClick:()=>E(n),children:r})}];return(0,e.jsx)(t.Table,{...S,className:`baseTable`,dataSource:C,columns:k,pagination:T?{...T,size:`small`}:!1,scroll:{...l,y:`50vh`,scrollToFirstRowOnChange:!0},loading:{spinning:!!u,indicator:(0,e.jsx)(n.LoadingOutlined,{style:{fontSize:36}})}})};exports.BaseTable=r;
@@ -0,0 +1,90 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Button as t, Dropdown as n, Table as r } from "antd";
3
+ import { LoadingOutlined as i } from "@ant-design/icons";
4
+ //#region src/shared/ui/base-table/index.tsx
5
+ var a = ({ viewText: a, actionsText: o, editText: s, deleteText: c, columns: l, serverPagination: u, scroll: d, loading: f, dataSource: p, isHiddenUpdate: m, isCanRead: h, isCanUpdate: g, isCanDelete: _, isFixedActions: v, onView: y, onDropdownClick: b, onEdit: x, onDelete: S, onShowSizeChange: C, ...w }) => {
6
+ let T = p?.map((e) => {
7
+ let t = {};
8
+ return Object.entries(e).forEach(([e, n]) => {
9
+ t[e] = n || "-";
10
+ }), t;
11
+ }), E = l ?? [], D = u ? {
12
+ current: u.page ?? 1,
13
+ pageSize: u.limit ?? 1,
14
+ total: u.count ?? 0,
15
+ pageSizeOptions: [
16
+ 10,
17
+ 20,
18
+ 50,
19
+ 100,
20
+ 200,
21
+ 500
22
+ ],
23
+ showSizeChanger: !0,
24
+ showQuickJumper: !0,
25
+ onShowSizeChange: C,
26
+ showTotal: (e, t) => `${t[0]}-${t[1]} / ${e}`
27
+ } : null, O = (e) => {
28
+ "id" in e && typeof e.id == "string" && y(e.id);
29
+ }, k = (e) => {
30
+ "id" in e && typeof e.id == "string" && b(e.id);
31
+ }, A = [];
32
+ !m && g && A.push({
33
+ key: "edit",
34
+ label: /* @__PURE__ */ e(t, {
35
+ type: "link",
36
+ block: !0,
37
+ onClick: x,
38
+ children: s
39
+ })
40
+ }), _ && S && A.push({
41
+ key: "delete",
42
+ label: /* @__PURE__ */ e(t, {
43
+ type: "link",
44
+ block: !0,
45
+ danger: !0,
46
+ onClick: S,
47
+ children: c
48
+ })
49
+ });
50
+ let j = [...E, {
51
+ title: o,
52
+ key: "action",
53
+ width: 180,
54
+ fixed: v ? "right" : !1,
55
+ render: (r) => A.length ? /* @__PURE__ */ e(n.Button, {
56
+ disabled: !h,
57
+ menu: {
58
+ items: A,
59
+ onClick: () => k(r)
60
+ },
61
+ onClick: () => O(r),
62
+ children: a
63
+ }) : /* @__PURE__ */ e(t, {
64
+ disabled: !h,
65
+ onClick: () => O(r),
66
+ children: a
67
+ })
68
+ }];
69
+ return /* @__PURE__ */ e(r, {
70
+ ...w,
71
+ className: "baseTable",
72
+ dataSource: T,
73
+ columns: j,
74
+ pagination: D ? {
75
+ ...D,
76
+ size: "small"
77
+ } : !1,
78
+ scroll: {
79
+ ...d,
80
+ y: "50vh",
81
+ scrollToFirstRowOnChange: !0
82
+ },
83
+ loading: {
84
+ spinning: !!f,
85
+ indicator: /* @__PURE__ */ e(i, { style: { fontSize: 36 } })
86
+ }
87
+ });
88
+ };
89
+ //#endregion
90
+ export { a as BaseTable };