jcicl 0.0.321 → 0.0.323
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/LabeledCheckbox/LabeledCheckbox.d.ts +5 -2
- package/LabeledCheckbox/LabeledCheckbox.js +93 -82
- package/LabeledCurrencyInput/LabeledCurrencyInput.d.ts +2 -2
- package/LabeledCurrencyInput/LabeledCurrencyInput.js +37 -26
- package/LabeledInput/LabeledInput.d.ts +2 -2
- package/LabeledInput/LabeledInput.js +26 -15
- package/package.json +1 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { CheckboxProps } from '@mui/material/Checkbox';
|
|
2
|
-
export
|
|
2
|
+
export interface StyleProps {
|
|
3
|
+
displayMode?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export type LabeledCheckboxProps = StyleProps & CheckboxProps & {
|
|
3
6
|
label: string;
|
|
4
7
|
colon?: boolean;
|
|
5
8
|
noLabel?: boolean;
|
|
6
|
-
}
|
|
9
|
+
};
|
|
7
10
|
export declare const LabeledCheckbox: React.FC<LabeledCheckboxProps>;
|
|
8
11
|
export default LabeledCheckbox;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsxs as z, jsx as
|
|
2
|
-
import { n as
|
|
3
|
-
import { c as
|
|
1
|
+
import { jsxs as z, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { n as te } from "../.chunks/emotion-styled.browser.esm.js";
|
|
3
|
+
import { c as T } from "../.chunks/emotion-react.browser.esm.js";
|
|
4
4
|
import ae from "../theme.js";
|
|
5
5
|
import * as v from "react";
|
|
6
|
-
import { g as
|
|
7
|
-
import { u as
|
|
8
|
-
import { B as
|
|
9
|
-
import { u as
|
|
10
|
-
import { r as
|
|
6
|
+
import { g as q, a as V, s as O, r as U, b as H, P as e, c as b, d as D, e as L, u as ne } from "../.chunks/DefaultPropsProvider.js";
|
|
7
|
+
import { u as se } from "../.chunks/useFormControl.js";
|
|
8
|
+
import { B as re } from "../.chunks/ButtonBase.js";
|
|
9
|
+
import { u as ce } from "../.chunks/useControlled.js";
|
|
10
|
+
import { r as _ } from "../.chunks/TransitionGroupContext.js";
|
|
11
11
|
import { c as P } from "../.chunks/createSvgIcon.js";
|
|
12
12
|
import { m as ie } from "../.chunks/memoTheme.js";
|
|
13
|
-
import { c as
|
|
13
|
+
import { c as E } from "../.chunks/createSimplePaletteValueFilter.js";
|
|
14
14
|
function le(o) {
|
|
15
|
-
return
|
|
15
|
+
return q("PrivateSwitchBase", o);
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
V("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
|
|
18
18
|
const de = (o) => {
|
|
19
19
|
const {
|
|
20
20
|
classes: t,
|
|
@@ -25,8 +25,8 @@ const de = (o) => {
|
|
|
25
25
|
root: ["root", a && "checked", s && "disabled", n && `edge${b(n)}`],
|
|
26
26
|
input: ["input"]
|
|
27
27
|
};
|
|
28
|
-
return
|
|
29
|
-
}, pe = O(
|
|
28
|
+
return D(l, le, t);
|
|
29
|
+
}, pe = O(re)({
|
|
30
30
|
padding: 9,
|
|
31
31
|
borderRadius: "50%",
|
|
32
32
|
variants: [{
|
|
@@ -63,7 +63,7 @@ const de = (o) => {
|
|
|
63
63
|
}
|
|
64
64
|
}]
|
|
65
65
|
}), ue = O("input", {
|
|
66
|
-
shouldForwardProp:
|
|
66
|
+
shouldForwardProp: U
|
|
67
67
|
})({
|
|
68
68
|
cursor: "inherit",
|
|
69
69
|
position: "absolute",
|
|
@@ -75,7 +75,7 @@ const de = (o) => {
|
|
|
75
75
|
margin: 0,
|
|
76
76
|
padding: 0,
|
|
77
77
|
zIndex: 1
|
|
78
|
-
}),
|
|
78
|
+
}), W = /* @__PURE__ */ v.forwardRef(function(t, a) {
|
|
79
79
|
const {
|
|
80
80
|
autoFocus: s,
|
|
81
81
|
checked: n,
|
|
@@ -88,77 +88,77 @@ const de = (o) => {
|
|
|
88
88
|
icon: w,
|
|
89
89
|
id: B,
|
|
90
90
|
inputProps: I,
|
|
91
|
-
inputRef:
|
|
92
|
-
name:
|
|
91
|
+
inputRef: y,
|
|
92
|
+
name: C,
|
|
93
93
|
onBlur: f,
|
|
94
94
|
onChange: h,
|
|
95
95
|
onFocus: F,
|
|
96
|
-
readOnly:
|
|
97
|
-
required:
|
|
98
|
-
tabIndex:
|
|
96
|
+
readOnly: G,
|
|
97
|
+
required: J = !1,
|
|
98
|
+
tabIndex: K,
|
|
99
99
|
type: x,
|
|
100
|
-
value:
|
|
101
|
-
...
|
|
102
|
-
} = t, [
|
|
100
|
+
value: $,
|
|
101
|
+
...Q
|
|
102
|
+
} = t, [j, X] = ce({
|
|
103
103
|
controlled: n,
|
|
104
104
|
default: !!d,
|
|
105
105
|
name: "SwitchBase",
|
|
106
106
|
state: "checked"
|
|
107
|
-
}), i =
|
|
108
|
-
F && F(
|
|
109
|
-
},
|
|
110
|
-
f && f(
|
|
111
|
-
},
|
|
112
|
-
if (
|
|
107
|
+
}), i = se(), Y = (r) => {
|
|
108
|
+
F && F(r), i && i.onFocus && i.onFocus(r);
|
|
109
|
+
}, Z = (r) => {
|
|
110
|
+
f && f(r), i && i.onBlur && i.onBlur(r);
|
|
111
|
+
}, ee = (r) => {
|
|
112
|
+
if (r.nativeEvent.defaultPrevented)
|
|
113
113
|
return;
|
|
114
|
-
const M =
|
|
115
|
-
|
|
114
|
+
const M = r.target.checked;
|
|
115
|
+
X(M), h && h(r, M);
|
|
116
116
|
};
|
|
117
117
|
let m = k;
|
|
118
118
|
i && typeof m > "u" && (m = i.disabled);
|
|
119
|
-
const
|
|
119
|
+
const oe = x === "checkbox" || x === "radio", R = {
|
|
120
120
|
...t,
|
|
121
|
-
checked:
|
|
121
|
+
checked: j,
|
|
122
122
|
disabled: m,
|
|
123
123
|
disableFocusRipple: g,
|
|
124
124
|
edge: u
|
|
125
125
|
}, N = de(R);
|
|
126
126
|
return /* @__PURE__ */ z(pe, {
|
|
127
127
|
component: "span",
|
|
128
|
-
className:
|
|
128
|
+
className: H(N.root, p),
|
|
129
129
|
centerRipple: !0,
|
|
130
130
|
focusRipple: !g,
|
|
131
131
|
disabled: m,
|
|
132
132
|
tabIndex: null,
|
|
133
133
|
role: void 0,
|
|
134
|
-
onFocus:
|
|
135
|
-
onBlur:
|
|
134
|
+
onFocus: Y,
|
|
135
|
+
onBlur: Z,
|
|
136
136
|
ownerState: R,
|
|
137
137
|
ref: a,
|
|
138
|
-
...
|
|
139
|
-
children: [/* @__PURE__ */
|
|
138
|
+
...Q,
|
|
139
|
+
children: [/* @__PURE__ */ c(ue, {
|
|
140
140
|
autoFocus: s,
|
|
141
141
|
checked: n,
|
|
142
142
|
defaultChecked: d,
|
|
143
143
|
className: N.input,
|
|
144
144
|
disabled: m,
|
|
145
|
-
id:
|
|
146
|
-
name:
|
|
147
|
-
onChange:
|
|
148
|
-
readOnly:
|
|
149
|
-
ref:
|
|
150
|
-
required:
|
|
145
|
+
id: oe ? B : void 0,
|
|
146
|
+
name: C,
|
|
147
|
+
onChange: ee,
|
|
148
|
+
readOnly: G,
|
|
149
|
+
ref: y,
|
|
150
|
+
required: J,
|
|
151
151
|
ownerState: R,
|
|
152
|
-
tabIndex:
|
|
152
|
+
tabIndex: K,
|
|
153
153
|
type: x,
|
|
154
|
-
...x === "checkbox" &&
|
|
155
|
-
value:
|
|
154
|
+
...x === "checkbox" && $ === void 0 ? {} : {
|
|
155
|
+
value: $
|
|
156
156
|
},
|
|
157
157
|
...I
|
|
158
|
-
}),
|
|
158
|
+
}), j ? l : w]
|
|
159
159
|
});
|
|
160
160
|
});
|
|
161
|
-
process.env.NODE_ENV !== "production" && (
|
|
161
|
+
process.env.NODE_ENV !== "production" && (W.propTypes = {
|
|
162
162
|
/**
|
|
163
163
|
* If `true`, the `input` element is focused during the first mount.
|
|
164
164
|
*/
|
|
@@ -215,7 +215,7 @@ process.env.NODE_ENV !== "production" && (_.propTypes = {
|
|
|
215
215
|
/**
|
|
216
216
|
* Pass a ref to the `input` element.
|
|
217
217
|
*/
|
|
218
|
-
inputRef:
|
|
218
|
+
inputRef: _,
|
|
219
219
|
/*
|
|
220
220
|
* @ignore
|
|
221
221
|
*/
|
|
@@ -261,17 +261,17 @@ process.env.NODE_ENV !== "production" && (_.propTypes = {
|
|
|
261
261
|
*/
|
|
262
262
|
value: e.any
|
|
263
263
|
});
|
|
264
|
-
const fe = P(/* @__PURE__ */
|
|
264
|
+
const fe = P(/* @__PURE__ */ c("path", {
|
|
265
265
|
d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
|
|
266
|
-
}), "CheckBoxOutlineBlank"), he = P(/* @__PURE__ */
|
|
266
|
+
}), "CheckBoxOutlineBlank"), he = P(/* @__PURE__ */ c("path", {
|
|
267
267
|
d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
|
268
|
-
}), "CheckBox"), me = P(/* @__PURE__ */
|
|
268
|
+
}), "CheckBox"), me = P(/* @__PURE__ */ c("path", {
|
|
269
269
|
d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"
|
|
270
270
|
}), "IndeterminateCheckBox");
|
|
271
271
|
function be(o) {
|
|
272
|
-
return
|
|
272
|
+
return q("MuiCheckbox", o);
|
|
273
273
|
}
|
|
274
|
-
const S =
|
|
274
|
+
const S = V("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "colorPrimary", "colorSecondary", "sizeSmall", "sizeMedium"]), ke = (o) => {
|
|
275
275
|
const {
|
|
276
276
|
classes: t,
|
|
277
277
|
indeterminate: a,
|
|
@@ -279,14 +279,14 @@ const S = q("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "col
|
|
|
279
279
|
size: n
|
|
280
280
|
} = o, l = {
|
|
281
281
|
root: ["root", a && "indeterminate", `color${b(s)}`, `size${b(n)}`]
|
|
282
|
-
}, p =
|
|
282
|
+
}, p = D(l, be, t);
|
|
283
283
|
return {
|
|
284
284
|
...t,
|
|
285
285
|
// forward the disabled and checked classes to the SwitchBase
|
|
286
286
|
...p
|
|
287
287
|
};
|
|
288
|
-
}, ge = O(
|
|
289
|
-
shouldForwardProp: (o) =>
|
|
288
|
+
}, ge = O(W, {
|
|
289
|
+
shouldForwardProp: (o) => U(o) || o === "classes",
|
|
290
290
|
name: "MuiCheckbox",
|
|
291
291
|
slot: "Root",
|
|
292
292
|
overridesResolver: (o, t) => {
|
|
@@ -306,20 +306,20 @@ const S = q("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "col
|
|
|
306
306
|
},
|
|
307
307
|
style: {
|
|
308
308
|
"&:hover": {
|
|
309
|
-
backgroundColor: o.vars ? `rgba(${o.vars.palette.action.activeChannel} / ${o.vars.palette.action.hoverOpacity})` :
|
|
309
|
+
backgroundColor: o.vars ? `rgba(${o.vars.palette.action.activeChannel} / ${o.vars.palette.action.hoverOpacity})` : L(o.palette.action.active, o.palette.action.hoverOpacity)
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
|
-
}, ...Object.entries(o.palette).filter(
|
|
312
|
+
}, ...Object.entries(o.palette).filter(E()).map(([t]) => ({
|
|
313
313
|
props: {
|
|
314
314
|
color: t,
|
|
315
315
|
disableRipple: !1
|
|
316
316
|
},
|
|
317
317
|
style: {
|
|
318
318
|
"&:hover": {
|
|
319
|
-
backgroundColor: o.vars ? `rgba(${o.vars.palette[t].mainChannel} / ${o.vars.palette.action.hoverOpacity})` :
|
|
319
|
+
backgroundColor: o.vars ? `rgba(${o.vars.palette[t].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : L(o.palette[t].main, o.palette.action.hoverOpacity)
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
})), ...Object.entries(o.palette).filter(
|
|
322
|
+
})), ...Object.entries(o.palette).filter(E()).map(([t]) => ({
|
|
323
323
|
props: {
|
|
324
324
|
color: t
|
|
325
325
|
},
|
|
@@ -345,14 +345,14 @@ const S = q("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "col
|
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
}]
|
|
348
|
-
}))),
|
|
349
|
-
const s =
|
|
348
|
+
}))), ye = /* @__PURE__ */ c(he, {}), Ce = /* @__PURE__ */ c(fe, {}), xe = /* @__PURE__ */ c(me, {}), A = /* @__PURE__ */ v.forwardRef(function(t, a) {
|
|
349
|
+
const s = ne({
|
|
350
350
|
props: t,
|
|
351
351
|
name: "MuiCheckbox"
|
|
352
352
|
}), {
|
|
353
|
-
checkedIcon: n =
|
|
353
|
+
checkedIcon: n = ye,
|
|
354
354
|
color: l = "primary",
|
|
355
|
-
icon: p =
|
|
355
|
+
icon: p = Ce,
|
|
356
356
|
indeterminate: d = !1,
|
|
357
357
|
indeterminateIcon: k = xe,
|
|
358
358
|
inputProps: g,
|
|
@@ -360,33 +360,33 @@ const S = q("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "col
|
|
|
360
360
|
disableRipple: w = !1,
|
|
361
361
|
className: B,
|
|
362
362
|
...I
|
|
363
|
-
} = s,
|
|
363
|
+
} = s, y = d ? k : p, C = d ? k : n, f = {
|
|
364
364
|
...s,
|
|
365
365
|
disableRipple: w,
|
|
366
366
|
color: l,
|
|
367
367
|
indeterminate: d,
|
|
368
368
|
size: u
|
|
369
369
|
}, h = ke(f);
|
|
370
|
-
return /* @__PURE__ */
|
|
370
|
+
return /* @__PURE__ */ c(ge, {
|
|
371
371
|
type: "checkbox",
|
|
372
372
|
inputProps: {
|
|
373
373
|
"data-indeterminate": d,
|
|
374
374
|
...g
|
|
375
375
|
},
|
|
376
|
-
icon: /* @__PURE__ */ v.cloneElement(
|
|
377
|
-
fontSize: C.props.fontSize ?? u
|
|
378
|
-
}),
|
|
379
|
-
checkedIcon: /* @__PURE__ */ v.cloneElement(y, {
|
|
376
|
+
icon: /* @__PURE__ */ v.cloneElement(y, {
|
|
380
377
|
fontSize: y.props.fontSize ?? u
|
|
381
378
|
}),
|
|
379
|
+
checkedIcon: /* @__PURE__ */ v.cloneElement(C, {
|
|
380
|
+
fontSize: C.props.fontSize ?? u
|
|
381
|
+
}),
|
|
382
382
|
ownerState: f,
|
|
383
383
|
ref: a,
|
|
384
|
-
className:
|
|
384
|
+
className: H(h.root, B),
|
|
385
385
|
...I,
|
|
386
386
|
classes: h
|
|
387
387
|
});
|
|
388
388
|
});
|
|
389
|
-
process.env.NODE_ENV !== "production" && (
|
|
389
|
+
process.env.NODE_ENV !== "production" && (A.propTypes = {
|
|
390
390
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
391
391
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
392
392
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
@@ -458,7 +458,7 @@ process.env.NODE_ENV !== "production" && (W.propTypes = {
|
|
|
458
458
|
/**
|
|
459
459
|
* Pass a ref to the `input` element.
|
|
460
460
|
*/
|
|
461
|
-
inputRef:
|
|
461
|
+
inputRef: _,
|
|
462
462
|
/**
|
|
463
463
|
* Callback fired when the state is changed.
|
|
464
464
|
*
|
|
@@ -487,8 +487,8 @@ process.env.NODE_ENV !== "production" && (W.propTypes = {
|
|
|
487
487
|
*/
|
|
488
488
|
value: e.any
|
|
489
489
|
});
|
|
490
|
-
const ve =
|
|
491
|
-
...
|
|
490
|
+
const ve = te("div")(({ displayMode: o }) => ({
|
|
491
|
+
...T`
|
|
492
492
|
display: flex;
|
|
493
493
|
flex-wrap: nowrap;
|
|
494
494
|
align-items: flex-end;
|
|
@@ -510,18 +510,29 @@ const ve = oe("div")(() => ({
|
|
|
510
510
|
.Mui-checked {
|
|
511
511
|
color: ${ae.colors.green} !important;
|
|
512
512
|
}
|
|
513
|
+
|
|
514
|
+
${o && T`
|
|
515
|
+
.Mui-disabled {
|
|
516
|
+
color: inherit !important;
|
|
517
|
+
-webkit-text-fill-color: inherit !important;
|
|
518
|
+
background-color: transparent !important;
|
|
519
|
+
opacity: 1 !important;
|
|
520
|
+
cursor: default !important;
|
|
521
|
+
}
|
|
522
|
+
`}
|
|
513
523
|
`
|
|
514
524
|
})), Me = ({
|
|
515
525
|
label: o,
|
|
516
526
|
colon: t = !0,
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
527
|
+
displayMode: a = !1,
|
|
528
|
+
noLabel: s = !1,
|
|
529
|
+
...n
|
|
530
|
+
}) => /* @__PURE__ */ z(ve, { displayMode: a, className: "jcLabeledCheckbox", children: [
|
|
531
|
+
!s && /* @__PURE__ */ z("span", { className: "jcCheckboxLabel", children: [
|
|
521
532
|
o,
|
|
522
533
|
t && ":"
|
|
523
534
|
] }),
|
|
524
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ c(A, { ...n })
|
|
525
536
|
] });
|
|
526
537
|
export {
|
|
527
538
|
Me as LabeledCheckbox,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { InputProps } from '../../../../../../../../../src/components/base/Input';
|
|
2
2
|
export interface StyleProps {
|
|
3
3
|
grid?: boolean;
|
|
4
|
+
displayMode?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export type LabeledCurrencyInputProps = InputProps & {
|
|
6
|
+
export type LabeledCurrencyInputProps = InputProps & StyleProps & {
|
|
6
7
|
label: string;
|
|
7
|
-
grid?: boolean;
|
|
8
8
|
noLabel?: boolean;
|
|
9
9
|
defaultValue?: string;
|
|
10
10
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { n as
|
|
4
|
-
import { c
|
|
5
|
-
import { Input as
|
|
6
|
-
const
|
|
7
|
-
...
|
|
1
|
+
import { jsxs as l, jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b } from "react";
|
|
3
|
+
import { n as h } from "../.chunks/emotion-styled.browser.esm.js";
|
|
4
|
+
import { c } from "../.chunks/emotion-react.browser.esm.js";
|
|
5
|
+
import { Input as w } from "../Input/Input.js";
|
|
6
|
+
const x = h("div")(({ grid: r, displayMode: n }) => ({
|
|
7
|
+
...c`
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-wrap: nowrap;
|
|
10
10
|
gap: 9px;
|
|
@@ -22,36 +22,47 @@ const I = w("div")(({ grid: r }) => ({
|
|
|
22
22
|
.MuiCurrencyInputBase-root {
|
|
23
23
|
width: ${r && "100%"};
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
${n && c`
|
|
27
|
+
.Mui-disabled {
|
|
28
|
+
color: inherit !important;
|
|
29
|
+
-webkit-text-fill-color: inherit !important;
|
|
30
|
+
background-color: transparent !important;
|
|
31
|
+
opacity: 1 !important;
|
|
32
|
+
cursor: default !important;
|
|
33
|
+
}
|
|
34
|
+
`}
|
|
25
35
|
`
|
|
26
|
-
})),
|
|
36
|
+
})), L = ({
|
|
27
37
|
label: r,
|
|
28
|
-
grid:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
grid: n = !0,
|
|
39
|
+
displayMode: m = !1,
|
|
40
|
+
noLabel: u = !1,
|
|
41
|
+
onChange: i,
|
|
42
|
+
defaultValue: o,
|
|
43
|
+
...f
|
|
33
44
|
}) => {
|
|
34
|
-
let
|
|
35
|
-
|
|
45
|
+
let e = (o == null ? void 0 : o.replace(/[^0-9.-]+/g, "")) ?? "";
|
|
46
|
+
e && (e = new Intl.NumberFormat("en-US", {
|
|
36
47
|
style: "decimal",
|
|
37
48
|
maximumFractionDigits: 2
|
|
38
|
-
}).format(Number(
|
|
39
|
-
const [
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
!
|
|
49
|
+
}).format(Number(e)));
|
|
50
|
+
const [d, a] = b(e);
|
|
51
|
+
return /* @__PURE__ */ l(x, { ...{ grid: n, displayMode: m }, className: "jcLabeledCurrencyInput", children: [
|
|
52
|
+
!u && /* @__PURE__ */ l("span", { children: [
|
|
42
53
|
r,
|
|
43
54
|
":"
|
|
44
55
|
] }),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
const { value:
|
|
56
|
+
/* @__PURE__ */ y(w, { ...f, onChange: (s) => {
|
|
57
|
+
const { value: g } = s.target, t = g.replace(/[^0-9.-]+/g, ""), p = new Intl.NumberFormat("en-US", {
|
|
47
58
|
style: "decimal",
|
|
48
59
|
maximumFractionDigits: 2
|
|
49
|
-
}).format(Number(
|
|
50
|
-
|
|
51
|
-
}, value: `$${
|
|
60
|
+
}).format(Number(t) || 0);
|
|
61
|
+
t && t.length > 1 && t[t.length - 1] === "." ? a(p + ".") : a(t ? p : ""), i && i(s);
|
|
62
|
+
}, value: `$${d}` })
|
|
52
63
|
] });
|
|
53
64
|
};
|
|
54
65
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
66
|
+
L as LabeledCurrencyInput,
|
|
67
|
+
L as default
|
|
57
68
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { InputProps } from '../../../../../../../../../src/components/base/Input';
|
|
2
2
|
export interface StyleProps {
|
|
3
3
|
grid?: boolean;
|
|
4
|
+
displayMode?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export type LabeledInputProps = InputProps & {
|
|
6
|
+
export type LabeledInputProps = InputProps & StyleProps & {
|
|
6
7
|
label?: string;
|
|
7
|
-
grid?: boolean;
|
|
8
8
|
noLabel?: boolean;
|
|
9
9
|
limit?: number;
|
|
10
10
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { n } from "../.chunks/emotion-styled.browser.esm.js";
|
|
3
|
-
import { c as
|
|
4
|
-
import { Input as
|
|
5
|
-
const f =
|
|
6
|
-
...
|
|
1
|
+
import { jsxs as r, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { n as l } from "../.chunks/emotion-styled.browser.esm.js";
|
|
3
|
+
import { c as a } from "../.chunks/emotion-react.browser.esm.js";
|
|
4
|
+
import { Input as d } from "../Input/Input.js";
|
|
5
|
+
const f = l("div")(({ grid: t, displayMode: o }) => ({
|
|
6
|
+
...a`
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-wrap: nowrap;
|
|
9
9
|
gap: 9px;
|
|
@@ -21,21 +21,32 @@ const f = n("div")(({ grid: t }) => ({
|
|
|
21
21
|
.MuiInputBase-root {
|
|
22
22
|
width: ${t && "100%"};
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
${o && a`
|
|
26
|
+
.Mui-disabled {
|
|
27
|
+
color: inherit !important;
|
|
28
|
+
-webkit-text-fill-color: inherit !important;
|
|
29
|
+
background-color: transparent !important;
|
|
30
|
+
opacity: 1 !important;
|
|
31
|
+
cursor: default !important;
|
|
32
|
+
}
|
|
33
|
+
`}
|
|
24
34
|
`
|
|
25
|
-
})),
|
|
35
|
+
})), x = ({
|
|
26
36
|
label: t,
|
|
27
37
|
grid: o = !0,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
displayMode: e = !1,
|
|
39
|
+
noLabel: i = !1,
|
|
40
|
+
limit: p,
|
|
41
|
+
...n
|
|
42
|
+
}) => /* @__PURE__ */ r(f, { grid: o, displayMode: e, className: "jcLabeledInput", children: [
|
|
43
|
+
!i && /* @__PURE__ */ r("span", { children: [
|
|
33
44
|
t,
|
|
34
45
|
":"
|
|
35
46
|
] }),
|
|
36
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ s(d, { ...n, slotProps: { htmlInput: { limit: p } } })
|
|
37
48
|
] });
|
|
38
49
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
x as LabeledInput,
|
|
51
|
+
x as default
|
|
41
52
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jcicl",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.323",
|
|
5
5
|
"description": "Component library for the websites of Johnson County Iowa",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://devops.jc.net/JCIT/Business%20Solutions%20Delivery/_git/JCComponentLibrary?path=%2FREADME.md&version=GBmaster",
|