@pnkx-lib/ui 1.1.18 → 1.1.20

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.
@@ -0,0 +1,142 @@
1
+ import { j as e, C as T, g as j, L as E, E as y, T as P } from "./Switch-DAZukdDR.js";
2
+ import * as F from "react";
3
+ import { Select as R, Radio as M, Checkbox as N } from "antd";
4
+ class G extends F.PureComponent {
5
+ render() {
6
+ const { name: l, component: d, control: c, ...t } = this.props;
7
+ return /* @__PURE__ */ e.jsx(
8
+ T,
9
+ {
10
+ control: c,
11
+ name: l,
12
+ render: ({ field: r, formState: i }) => /* @__PURE__ */ e.jsx(d, { field: r, formState: i, ...t })
13
+ }
14
+ );
15
+ }
16
+ }
17
+ const $ = (h) => {
18
+ //! State
19
+ var s;
20
+ const {
21
+ field: l,
22
+ formState: d,
23
+ label: c,
24
+ required: t,
25
+ afterOnChange: r,
26
+ customStyleContainer: i,
27
+ ...g
28
+ } = h, { name: n, value: S, onChange: o, onBlur: b } = l || {}, { touchedFields: v, errors: C, isSubmitted: x } = d || {}, u = j(v, n), a = (s = j(C, n)) == null ? void 0 : s.message;
29
+ //! Function
30
+ const f = (m) => {
31
+ o == null || o(m), r == null || r(m);
32
+ }, p = () => a ? /* @__PURE__ */ e.jsx(
33
+ y,
34
+ {
35
+ errorMessage: a,
36
+ isTouched: u,
37
+ isSubmitted: x
38
+ }
39
+ ) : null;
40
+ //! Render
41
+ return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
42
+ c && /* @__PURE__ */ e.jsx(E, { label: c, required: t }),
43
+ /* @__PURE__ */ e.jsx(
44
+ R,
45
+ {
46
+ onChange: f,
47
+ onBlur: b,
48
+ value: S,
49
+ style: { width: "100%" },
50
+ optionLabelProp: "label",
51
+ status: (u || x) && a ? "error" : void 0,
52
+ ...g
53
+ }
54
+ ),
55
+ p()
56
+ ] });
57
+ }, q = (h) => {
58
+ //! State
59
+ var p;
60
+ const {
61
+ field: l,
62
+ formState: d,
63
+ customStyleRadio: c,
64
+ customStyleWrap: t = "",
65
+ afterOnChange: r,
66
+ options: i,
67
+ ...g
68
+ } = h, { name: n, value: S, onChange: o } = l || {}, { touchedFields: b, errors: v, isSubmitted: C } = d || {}, x = j(b, n), u = (p = j(v, n)) == null ? void 0 : p.message;
69
+ //! Function
70
+ const a = (s) => {
71
+ var m;
72
+ o == null || o(s), r == null || r((m = s == null ? void 0 : s.target) == null ? void 0 : m.value);
73
+ }, f = () => u ? /* @__PURE__ */ e.jsx(
74
+ y,
75
+ {
76
+ errorMessage: u,
77
+ isTouched: x,
78
+ isSubmitted: C
79
+ }
80
+ ) : null;
81
+ //! Render
82
+ return /* @__PURE__ */ e.jsxs("div", { className: t, children: [
83
+ /* @__PURE__ */ e.jsx(M.Group, { onChange: a, value: S, ...g, children: i.map((s) => /* @__PURE__ */ e.jsx(
84
+ M,
85
+ {
86
+ value: s.value,
87
+ className: c,
88
+ children: /* @__PURE__ */ e.jsxs(P.Text, { children: [
89
+ " ",
90
+ s.label
91
+ ] })
92
+ },
93
+ `${n}-${s.value}`
94
+ )) }),
95
+ f()
96
+ ] });
97
+ }, w = (h) => {
98
+ //! State
99
+ var s;
100
+ const {
101
+ field: l,
102
+ formState: d,
103
+ label: c,
104
+ afterOnChange: t,
105
+ customStyleContainer: r,
106
+ customStyleCheckbox: i,
107
+ ...g
108
+ } = h, { name: n, value: S, onChange: o, onBlur: b } = l || {}, { touchedFields: v, errors: C, isSubmitted: x } = d || {}, u = j(v, n), a = (s = j(C, n)) == null ? void 0 : s.message;
109
+ //! Function
110
+ const f = (m) => {
111
+ const k = m.target.checked;
112
+ o == null || o(k), t == null || t(k);
113
+ }, p = () => a ? /* @__PURE__ */ e.jsx(
114
+ y,
115
+ {
116
+ errorMessage: a,
117
+ isTouched: u,
118
+ isSubmitted: x
119
+ }
120
+ ) : null;
121
+ //! Render
122
+ return /* @__PURE__ */ e.jsxs("div", { className: r, children: [
123
+ /* @__PURE__ */ e.jsx(
124
+ N,
125
+ {
126
+ onBlur: b,
127
+ checked: !!S,
128
+ onChange: f,
129
+ className: i,
130
+ ...g,
131
+ children: /* @__PURE__ */ e.jsx(P.Text, { children: c })
132
+ }
133
+ ),
134
+ p()
135
+ ] });
136
+ };
137
+ export {
138
+ w as C,
139
+ G as P,
140
+ q as R,
141
+ $ as S
142
+ };
@@ -1,4 +1,4 @@
1
- import { j as O, I as Rt, _ as Nt, u as ds, c as ft, a as hs } from "./AntdIcon-BohCHsd5.js";
1
+ import { j as O, b as Rt, _ as Nt, u as ds, c as ft, d as hs } from "./Switch-DAZukdDR.js";
2
2
  import { Button as vs, Cascader as gs, Space as Ot, Card as to, Skeleton as ta, Table as ps, Empty as ms, Modal as bs, Tooltip as ys, Tabs as Ss, Popover as xs, Badge as Cs, Col as Es, Row as ws, Dropdown as Ts, Breadcrumb as Os, Flex as _s, Splitter as ra, Menu as It, Pagination as Ps, Steps as na } from "antd";
3
3
  import * as g from "react";
4
4
  import Ae, { useEffect as Ue, useContext as Ke, createContext as oa, version as ks, isValidElement as $s, useRef as Fe, useLayoutEffect as As, useState as ro } from "react";
@@ -928,8 +928,42 @@ var gc = function(t) {
928
928
  return r;
929
929
  }, va = gc({
930
930
  key: "css"
931
- }), mc = va.cx, bc = va.css;
932
- const Xt = (e) => Array.from({ length: e }).map((t, r) => /* @__PURE__ */ O.jsx(ta.Input, { size: "small", block: !0, active: !0 }, r)), yc = ({ type: e, skeletonButtonCount: t }) => e === "table" ? /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
931
+ }), mc = va.cx, bc = va.css, yc = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, name: "bars", theme: "outlined" }, Sc = function(t, r) {
932
+ return /* @__PURE__ */ g.createElement(Rt, Nt({}, t, {
933
+ ref: r,
934
+ icon: yc
935
+ }));
936
+ }, ga = /* @__PURE__ */ g.forwardRef(Sc);
937
+ process.env.NODE_ENV !== "production" && (ga.displayName = "BarsOutlined");
938
+ var xc = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z" } }] }, name: "filter", theme: "outlined" }, Cc = function(t, r) {
939
+ return /* @__PURE__ */ g.createElement(Rt, Nt({}, t, {
940
+ ref: r,
941
+ icon: xc
942
+ }));
943
+ }, pa = /* @__PURE__ */ g.forwardRef(Cc);
944
+ process.env.NODE_ENV !== "production" && (pa.displayName = "FilterOutlined");
945
+ var Ec = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, name: "left", theme: "outlined" }, wc = function(t, r) {
946
+ return /* @__PURE__ */ g.createElement(Rt, Nt({}, t, {
947
+ ref: r,
948
+ icon: Ec
949
+ }));
950
+ }, Ur = /* @__PURE__ */ g.forwardRef(wc);
951
+ process.env.NODE_ENV !== "production" && (Ur.displayName = "LeftOutlined");
952
+ var Tc = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, name: "right", theme: "outlined" }, Oc = function(t, r) {
953
+ return /* @__PURE__ */ g.createElement(Rt, Nt({}, t, {
954
+ ref: r,
955
+ icon: Tc
956
+ }));
957
+ }, Kr = /* @__PURE__ */ g.forwardRef(Oc);
958
+ process.env.NODE_ENV !== "production" && (Kr.displayName = "RightOutlined");
959
+ var _c = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, name: "search", theme: "outlined" }, Pc = function(t, r) {
960
+ return /* @__PURE__ */ g.createElement(Rt, Nt({}, t, {
961
+ ref: r,
962
+ icon: _c
963
+ }));
964
+ }, ma = /* @__PURE__ */ g.forwardRef(Pc);
965
+ process.env.NODE_ENV !== "production" && (ma.displayName = "SearchOutlined");
966
+ const Xt = (e) => Array.from({ length: e }).map((t, r) => /* @__PURE__ */ O.jsx(ta.Input, { size: "small", block: !0, active: !0 }, r)), kc = ({ type: e, skeletonButtonCount: t }) => e === "table" ? /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
933
967
  /* @__PURE__ */ O.jsxs(
934
968
  "div",
935
969
  {
@@ -946,14 +980,14 @@ const Xt = (e) => Array.from({ length: e }).map((t, r) => /* @__PURE__ */ O.jsx(
946
980
  }
947
981
  ),
948
982
  /* @__PURE__ */ O.jsx(to, { children: /* @__PURE__ */ O.jsx(Ot, { direction: "vertical", size: "middle", style: { width: "100%" }, children: Xt(10) }) }),
949
- /* @__PURE__ */ O.jsx("div", { style: { ...Sc.rightAlign, marginTop: 20 }, children: /* @__PURE__ */ O.jsx(ta.Input, { size: "small", active: !0 }) })
950
- ] }) : /* @__PURE__ */ O.jsx(to, { children: /* @__PURE__ */ O.jsx("div", { style: { display: "grid", rowGap: 8 }, children: Xt(3) }) }), Sc = {
983
+ /* @__PURE__ */ O.jsx("div", { style: { ...$c.rightAlign, marginTop: 20 }, children: /* @__PURE__ */ O.jsx(ta.Input, { size: "small", active: !0 }) })
984
+ ] }) : /* @__PURE__ */ O.jsx(to, { children: /* @__PURE__ */ O.jsx("div", { style: { display: "grid", rowGap: 8 }, children: Xt(3) }) }), $c = {
951
985
  rightAlign: {
952
986
  display: "flex",
953
987
  justifyContent: "flex-end",
954
988
  width: "100%"
955
989
  }
956
- }, xc = bc`
990
+ }, Ac = bc`
957
991
  .ant-table-cell::before {
958
992
  display: none !important;
959
993
  }
@@ -1015,7 +1049,7 @@ const Xt = (e) => Array.from({ length: e }).map((t, r) => /* @__PURE__ */ O.jsx(
1015
1049
  x.closest("a") || C == null || C(p);
1016
1050
  };
1017
1051
  }
1018
- return r ? /* @__PURE__ */ O.jsx(yc, { type: "table" }) : /* @__PURE__ */ O.jsx(
1052
+ return r ? /* @__PURE__ */ O.jsx(kc, { type: "table" }) : /* @__PURE__ */ O.jsx(
1019
1053
  ps,
1020
1054
  {
1021
1055
  rowKey: f,
@@ -1032,7 +1066,7 @@ const Xt = (e) => Array.from({ length: e }).map((t, r) => /* @__PURE__ */ O.jsx(
1032
1066
  emptyText: /* @__PURE__ */ O.jsx(ms, {})
1033
1067
  },
1034
1068
  rowClassName: (p, C) => `table-row-${C % 2 === 0 ? "even" : "odd"}`,
1035
- className: mc(xc, d),
1069
+ className: mc(Ac, d),
1036
1070
  ...m
1037
1071
  }
1038
1072
  );
@@ -1051,8 +1085,8 @@ const Xt = (e) => Array.from({ length: e }).map((t, r) => /* @__PURE__ */ O.jsx(
1051
1085
  }
1052
1086
  }, o = () => t, c = { setState: n, getState: o, getInitialState: () => l, subscribe: (s) => (r.add(s), () => r.delete(s)) }, l = t = e(n, o, c);
1053
1087
  return c;
1054
- }, Cc = (e) => e ? vo(e) : vo, Ec = (e) => e;
1055
- function wc(e, t = Ec) {
1088
+ }, Mc = (e) => e ? vo(e) : vo, jc = (e) => e;
1089
+ function Rc(e, t = jc) {
1056
1090
  const r = Ae.useSyncExternalStore(
1057
1091
  e.subscribe,
1058
1092
  () => t(e.getState()),
@@ -1061,9 +1095,9 @@ function wc(e, t = Ec) {
1061
1095
  return Ae.useDebugValue(r), r;
1062
1096
  }
1063
1097
  const go = (e) => {
1064
- const t = Cc(e), r = (n) => wc(t, n);
1098
+ const t = Mc(e), r = (n) => Rc(t, n);
1065
1099
  return Object.assign(r, t), r;
1066
- }, Tc = (e) => e ? go(e) : go, Oc = Tc((e) => ({
1100
+ }, Nc = (e) => e ? go(e) : go, Ic = Nc((e) => ({
1067
1101
  activeTabKey: void 0,
1068
1102
  // giá trị mặc định
1069
1103
  setActiveTabKey: (t) => e({ activeTabKey: t })
@@ -1074,7 +1108,7 @@ const go = (e) => {
1074
1108
  ...n
1075
1109
  }) => {
1076
1110
  var c;
1077
- const { activeTabKey: o, setActiveTabKey: a } = Oc(), i = (r == null ? void 0 : r.toString()) || ((c = e[0]) == null ? void 0 : c.key);
1111
+ const { activeTabKey: o, setActiveTabKey: a } = Ic(), i = (r == null ? void 0 : r.toString()) || ((c = e[0]) == null ? void 0 : c.key);
1078
1112
  return Ue(() => {
1079
1113
  !o && i && a(i);
1080
1114
  }, [o, i, a]), /* @__PURE__ */ O.jsx(
@@ -1091,43 +1125,7 @@ const go = (e) => {
1091
1125
  }, Sd = (e) => {
1092
1126
  const { containerClassName: t, popoverClassName: r, ...n } = e;
1093
1127
  return /* @__PURE__ */ O.jsx("div", { className: t, children: /* @__PURE__ */ O.jsx(xs, { className: r, ...n }) });
1094
- };
1095
- var _c = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, name: "bars", theme: "outlined" }, Pc = function(t, r) {
1096
- return /* @__PURE__ */ g.createElement(Rt, Nt({}, t, {
1097
- ref: r,
1098
- icon: _c
1099
- }));
1100
- }, ga = /* @__PURE__ */ g.forwardRef(Pc);
1101
- process.env.NODE_ENV !== "production" && (ga.displayName = "BarsOutlined");
1102
- var kc = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z" } }] }, name: "filter", theme: "outlined" }, $c = function(t, r) {
1103
- return /* @__PURE__ */ g.createElement(Rt, Nt({}, t, {
1104
- ref: r,
1105
- icon: kc
1106
- }));
1107
- }, pa = /* @__PURE__ */ g.forwardRef($c);
1108
- process.env.NODE_ENV !== "production" && (pa.displayName = "FilterOutlined");
1109
- var Ac = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, name: "left", theme: "outlined" }, Mc = function(t, r) {
1110
- return /* @__PURE__ */ g.createElement(Rt, Nt({}, t, {
1111
- ref: r,
1112
- icon: Ac
1113
- }));
1114
- }, Ur = /* @__PURE__ */ g.forwardRef(Mc);
1115
- process.env.NODE_ENV !== "production" && (Ur.displayName = "LeftOutlined");
1116
- var jc = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, name: "right", theme: "outlined" }, Rc = function(t, r) {
1117
- return /* @__PURE__ */ g.createElement(Rt, Nt({}, t, {
1118
- ref: r,
1119
- icon: jc
1120
- }));
1121
- }, Kr = /* @__PURE__ */ g.forwardRef(Rc);
1122
- process.env.NODE_ENV !== "production" && (Kr.displayName = "RightOutlined");
1123
- var Nc = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, name: "search", theme: "outlined" }, Ic = function(t, r) {
1124
- return /* @__PURE__ */ g.createElement(Rt, Nt({}, t, {
1125
- ref: r,
1126
- icon: Nc
1127
- }));
1128
- }, ma = /* @__PURE__ */ g.forwardRef(Ic);
1129
- process.env.NODE_ENV !== "production" && (ma.displayName = "SearchOutlined");
1130
- const xd = ({
1128
+ }, xd = ({
1131
1129
  initialValues: e,
1132
1130
  renderFilterFields: t,
1133
1131
  onSubmit: r,
@@ -5862,7 +5860,7 @@ export {
5862
5860
  md as M,
5863
5861
  Sd as P,
5864
5862
  Td as R,
5865
- yc as S,
5863
+ kc as S,
5866
5864
  pd as T,
5867
5865
  bd as a,
5868
5866
  yd as b,