jcicl 1.0.17 → 1.0.18

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,260 @@
1
+ import * as D from "react";
2
+ import { g as V, a as _, s as C, r as $, b as A, P as e, c as G, d as H } from "./DefaultPropsProvider.js";
3
+ import { u as J } from "./useFormControl.js";
4
+ import { jsxs as K, jsx as M } from "react/jsx-runtime";
5
+ import { B as Q } from "./ButtonBase.js";
6
+ import { u as W } from "./useControlled.js";
7
+ import { r as X } from "./TransitionGroupContext.js";
8
+ function Y(s) {
9
+ return V("PrivateSwitchBase", s);
10
+ }
11
+ _("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
12
+ const Z = (s) => {
13
+ const {
14
+ classes: t,
15
+ checked: d,
16
+ disabled: c,
17
+ edge: n
18
+ } = s, l = {
19
+ root: ["root", d && "checked", c && "disabled", n && `edge${G(n)}`],
20
+ input: ["input"]
21
+ };
22
+ return H(l, Y, t);
23
+ }, ee = C(Q)({
24
+ padding: 9,
25
+ borderRadius: "50%",
26
+ variants: [{
27
+ props: {
28
+ edge: "start",
29
+ size: "small"
30
+ },
31
+ style: {
32
+ marginLeft: -3
33
+ }
34
+ }, {
35
+ props: ({
36
+ edge: s,
37
+ ownerState: t
38
+ }) => s === "start" && t.size !== "small",
39
+ style: {
40
+ marginLeft: -12
41
+ }
42
+ }, {
43
+ props: {
44
+ edge: "end",
45
+ size: "small"
46
+ },
47
+ style: {
48
+ marginRight: -3
49
+ }
50
+ }, {
51
+ props: ({
52
+ edge: s,
53
+ ownerState: t
54
+ }) => s === "end" && t.size !== "small",
55
+ style: {
56
+ marginRight: -12
57
+ }
58
+ }]
59
+ }), oe = C("input", {
60
+ shouldForwardProp: $
61
+ })({
62
+ cursor: "inherit",
63
+ position: "absolute",
64
+ opacity: 0,
65
+ width: "100%",
66
+ height: "100%",
67
+ top: 0,
68
+ left: 0,
69
+ margin: 0,
70
+ padding: 0,
71
+ zIndex: 1
72
+ }), se = /* @__PURE__ */ D.forwardRef(function(t, d) {
73
+ const {
74
+ autoFocus: c,
75
+ checked: n,
76
+ checkedIcon: l,
77
+ className: w,
78
+ defaultChecked: p,
79
+ disabled: F,
80
+ disableFocusRipple: f = !1,
81
+ edge: R = !1,
82
+ icon: S,
83
+ id: x,
84
+ inputProps: P,
85
+ inputRef: I,
86
+ name: q,
87
+ onBlur: h,
88
+ onChange: m,
89
+ onFocus: b,
90
+ readOnly: v,
91
+ required: z = !1,
92
+ tabIndex: N,
93
+ type: r,
94
+ value: g,
95
+ ...O
96
+ } = t, [y, j] = W({
97
+ controlled: n,
98
+ default: !!p,
99
+ name: "SwitchBase",
100
+ state: "checked"
101
+ }), a = J(), E = (o) => {
102
+ b && b(o), a && a.onFocus && a.onFocus(o);
103
+ }, T = (o) => {
104
+ h && h(o), a && a.onBlur && a.onBlur(o);
105
+ }, U = (o) => {
106
+ if (o.nativeEvent.defaultPrevented)
107
+ return;
108
+ const B = o.target.checked;
109
+ j(B), m && m(o, B);
110
+ };
111
+ let i = F;
112
+ a && typeof i > "u" && (i = a.disabled);
113
+ const L = r === "checkbox" || r === "radio", u = {
114
+ ...t,
115
+ checked: y,
116
+ disabled: i,
117
+ disableFocusRipple: f,
118
+ edge: R
119
+ }, k = Z(u);
120
+ return /* @__PURE__ */ K(ee, {
121
+ component: "span",
122
+ className: A(k.root, w),
123
+ centerRipple: !0,
124
+ focusRipple: !f,
125
+ disabled: i,
126
+ tabIndex: null,
127
+ role: void 0,
128
+ onFocus: E,
129
+ onBlur: T,
130
+ ownerState: u,
131
+ ref: d,
132
+ ...O,
133
+ children: [/* @__PURE__ */ M(oe, {
134
+ autoFocus: c,
135
+ checked: n,
136
+ defaultChecked: p,
137
+ className: k.input,
138
+ disabled: i,
139
+ id: L ? x : void 0,
140
+ name: q,
141
+ onChange: U,
142
+ readOnly: v,
143
+ ref: I,
144
+ required: z,
145
+ ownerState: u,
146
+ tabIndex: N,
147
+ type: r,
148
+ ...r === "checkbox" && g === void 0 ? {} : {
149
+ value: g
150
+ },
151
+ ...P
152
+ }), y ? l : S]
153
+ });
154
+ });
155
+ process.env.NODE_ENV !== "production" && (se.propTypes = {
156
+ /**
157
+ * If `true`, the `input` element is focused during the first mount.
158
+ */
159
+ autoFocus: e.bool,
160
+ /**
161
+ * If `true`, the component is checked.
162
+ */
163
+ checked: e.bool,
164
+ /**
165
+ * The icon to display when the component is checked.
166
+ */
167
+ checkedIcon: e.node.isRequired,
168
+ /**
169
+ * Override or extend the styles applied to the component.
170
+ */
171
+ classes: e.object,
172
+ /**
173
+ * @ignore
174
+ */
175
+ className: e.string,
176
+ /**
177
+ * @ignore
178
+ */
179
+ defaultChecked: e.bool,
180
+ /**
181
+ * If `true`, the component is disabled.
182
+ */
183
+ disabled: e.bool,
184
+ /**
185
+ * If `true`, the keyboard focus ripple is disabled.
186
+ * @default false
187
+ */
188
+ disableFocusRipple: e.bool,
189
+ /**
190
+ * If given, uses a negative margin to counteract the padding on one
191
+ * side (this is often helpful for aligning the left or right
192
+ * side of the icon with content above or below, without ruining the border
193
+ * size and shape).
194
+ * @default false
195
+ */
196
+ edge: e.oneOf(["end", "start", !1]),
197
+ /**
198
+ * The icon to display when the component is unchecked.
199
+ */
200
+ icon: e.node.isRequired,
201
+ /**
202
+ * The id of the `input` element.
203
+ */
204
+ id: e.string,
205
+ /**
206
+ * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
207
+ */
208
+ inputProps: e.object,
209
+ /**
210
+ * Pass a ref to the `input` element.
211
+ */
212
+ inputRef: X,
213
+ /*
214
+ * @ignore
215
+ */
216
+ name: e.string,
217
+ /**
218
+ * @ignore
219
+ */
220
+ onBlur: e.func,
221
+ /**
222
+ * Callback fired when the state is changed.
223
+ *
224
+ * @param {object} event The event source of the callback.
225
+ * You can pull out the new checked state by accessing `event.target.checked` (boolean).
226
+ */
227
+ onChange: e.func,
228
+ /**
229
+ * @ignore
230
+ */
231
+ onFocus: e.func,
232
+ /**
233
+ * It prevents the user from changing the value of the field
234
+ * (not from interacting with the field).
235
+ */
236
+ readOnly: e.bool,
237
+ /**
238
+ * If `true`, the `input` element is required.
239
+ */
240
+ required: e.bool,
241
+ /**
242
+ * The system prop that allows defining system overrides as well as additional CSS styles.
243
+ */
244
+ sx: e.object,
245
+ /**
246
+ * @ignore
247
+ */
248
+ tabIndex: e.oneOfType([e.number, e.string]),
249
+ /**
250
+ * The input component prop `type`.
251
+ */
252
+ type: e.string.isRequired,
253
+ /**
254
+ * The value of the component.
255
+ */
256
+ value: e.any
257
+ });
258
+ export {
259
+ se as S
260
+ };
@@ -8,11 +8,12 @@ import { m as ue } from "./memoTheme.js";
8
8
  import { c as ro } from "./createSimplePaletteValueFilter.js";
9
9
  import { e as It, u as Nt } from "./index.js";
10
10
  import { a as Ee, u as oo, r as Pe, c as wo } from "./TransitionGroupContext.js";
11
+ import { c as Co } from "./createChainedFunction.js";
11
12
  import { P as Ft } from "./Paper.js";
12
13
  import { c as Mt } from "./chainPropTypes.js";
13
14
  import { i as kt } from "./integerPropType.js";
14
15
  import { e as Yo } from "./elementTypeAcceptingRef.js";
15
- import { u as Co } from "./useControlled.js";
16
+ import { u as Po } from "./useControlled.js";
16
17
  import { c as Lt } from "./createSvgIcon.js";
17
18
  import { G as jt } from "./emotion-react.browser.esm.js";
18
19
  function At(o) {
@@ -80,12 +81,6 @@ function $t({
80
81
  props: o
81
82
  });
82
83
  }
83
- function Po(...o) {
84
- return o.reduce((t, n) => n == null ? t : function(...s) {
85
- t.apply(this, s), n.apply(this, s);
86
- }, () => {
87
- });
88
- }
89
84
  function Jo(o, t = 166) {
90
85
  let n;
91
86
  function r(...s) {
@@ -4094,8 +4089,8 @@ function Un(o) {
4094
4089
  v(!0), l && l(), s && F();
4095
4090
  };
4096
4091
  return {
4097
- onEnter: Po(x, d == null ? void 0 : d.props.onEnter),
4098
- onExited: Po(E, d == null ? void 0 : d.props.onExited)
4092
+ onEnter: Co(x, d == null ? void 0 : d.props.onEnter),
4093
+ onExited: Co(E, d == null ? void 0 : d.props.onExited)
4099
4094
  };
4100
4095
  },
4101
4096
  rootRef: b,
@@ -5450,11 +5445,11 @@ const pr = (o) => {
5450
5445
  value: x,
5451
5446
  variant: E = "standard",
5452
5447
  ...V
5453
- } = t, [L, re] = Co({
5448
+ } = t, [L, re] = Po({
5454
5449
  controlled: x,
5455
5450
  default: y,
5456
5451
  name: "Select"
5457
- }), [ve, se] = Co({
5452
+ }), [ve, se] = Po({
5458
5453
  controlled: F,
5459
5454
  default: h,
5460
5455
  name: "Select"
@@ -0,0 +1,9 @@
1
+ function u(...i) {
2
+ return i.reduce((n, t) => t == null ? n : function(...e) {
3
+ n.apply(this, e), t.apply(this, e);
4
+ }, () => {
5
+ });
6
+ }
7
+ export {
8
+ u as c
9
+ };
@@ -8,7 +8,7 @@ export type FormField = {
8
8
  options?: DropdownOption[];
9
9
  limit?: number;
10
10
  defaultValue?: string | number;
11
- } & Partial<AllInputProps>;
11
+ };
12
12
  export type FormFieldsProps = {
13
13
  title?: string;
14
14
  fields: FormField[];
@@ -19,6 +19,6 @@ export type FormFieldsProps = {
19
19
  checkboxContainer?: boolean;
20
20
  formDefaults: Record<string, any>;
21
21
  onChange: (key: string, e: React.ChangeEvent<HTMLInputElement>, type?: string) => void;
22
- };
22
+ } & Partial<AllInputProps>;
23
23
  declare const FormFields: React.FC<FormFieldsProps>;
24
24
  export default FormFields;
@@ -1,11 +1,12 @@
1
1
  import { LabeledInputProps } from '../../../../../../../../../src/components/composite/LabeledInput';
2
2
  import { LabeledCurrencyInputProps } from '../../../../../../../../../src/components/composite/LabeledCurrencyInput';
3
3
  import { LabeledCheckboxProps } from '../../../../../../../../../src/components/composite/LabeledCheckbox';
4
+ import { LabeledRadioProps } from '../../../../../../../../../src/components/composite/LabeledRadio';
4
5
  import { LabeledDropdownProps } from '../../../../../../../../../src/components/composite/LabeledDropdown';
5
6
  import { LabeledTextAreaProps } from '../../../../../../../../../src/components/composite/LabeledTextArea/LabeledTextArea';
6
- export type AllInputProps = LabeledInputProps & LabeledCheckboxProps & LabeledDropdownProps & LabeledCurrencyInputProps & LabeledTextAreaProps;
7
+ export type AllInputProps = LabeledInputProps & LabeledCheckboxProps & LabeledRadioProps & LabeledDropdownProps & LabeledCurrencyInputProps & LabeledTextAreaProps;
7
8
  export type FormInputProps = AllInputProps & {
8
- type?: 'text' | 'dropdown' | 'date' | 'number' | 'checkbox' | 'radio' | 'textarea' | 'currency';
9
+ type?: 'text' | 'dropdown' | 'date' | 'number' | 'checkbox' | 'radio' | 'textarea' | 'currency' | 'multiDropdown';
9
10
  };
10
- export declare const FormInput: React.FC<LabeledInputProps>;
11
+ export declare const FormInput: React.FC<FormInputProps>;
11
12
  export default FormInput;
@@ -1,14 +1,15 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { LabeledInput as o } from "../LabeledInput/LabeledInput.js";
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { LabeledInput as t } from "../LabeledInput/LabeledInput.js";
3
3
  import { LabeledCurrencyInput as m } from "../LabeledCurrencyInput/LabeledCurrencyInput.js";
4
- import { LabeledCheckbox as f } from "../LabeledCheckbox/LabeledCheckbox.js";
5
- import { LabeledDropdown as a } from "../LabeledDropdown/LabeledDropdown.js";
6
- import { LabeledTextArea as d } from "../LabeledTextArea/LabeledTextArea.js";
7
- const i = (r) => {
4
+ import { LabeledCheckbox as a } from "../LabeledCheckbox/LabeledCheckbox.js";
5
+ import { LabeledRadio as d } from "../LabeledRadio/LabeledRadio.js";
6
+ import { LabeledDropdown as f } from "../LabeledDropdown/LabeledDropdown.js";
7
+ import { LabeledTextArea as n } from "../LabeledTextArea/LabeledTextArea.js";
8
+ const p = (r) => {
8
9
  const { type: e = "text" } = r;
9
- return e === "dropdown" || e === "multiDropdown" ? /* @__PURE__ */ t(a, { ...r }) : e === "checkbox" ? /* @__PURE__ */ t(f, { ...r }) : e === "currency" ? /* @__PURE__ */ t(m, { ...r }) : e === "textarea" ? /* @__PURE__ */ t(d, { ...r }) : /* @__PURE__ */ t(o, { ...r, type: e });
10
+ return e === "dropdown" || e === "multiDropdown" ? /* @__PURE__ */ o(f, { ...r }) : e === "checkbox" ? /* @__PURE__ */ o(a, { ...r }) : e === "radio" ? /* @__PURE__ */ o(d, { ...r }) : e === "currency" ? /* @__PURE__ */ o(m, { ...r }) : e === "textarea" ? /* @__PURE__ */ o(n, { ...r }) : /* @__PURE__ */ o(t, { ...r, type: e });
10
11
  };
11
12
  export {
12
- i as FormInput,
13
- i as default
13
+ p as FormInput,
14
+ p as default
14
15
  };