@pnkx-lib/ui 1.1.15 → 1.1.17

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
+ };