@thebuoyant-tsdev/mui-ts-library 3.29.1 → 3.30.0
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/README.de.md +59 -1
- package/README.md +59 -1
- package/dist/components/chord-chart/ChordChart.js +112 -112
- package/dist/components/circle-packing-chart/CirclePackingChart.js +135 -135
- package/dist/components/color-picker/ColorPicker.js +217 -217
- package/dist/components/color-picker/PopoverColorPicker.js +7 -7
- package/dist/components/date-range-picker/DateRangePicker.js +9 -9
- package/dist/components/gantt-chart/GanttChart.js +18 -18
- package/dist/components/gantt-chart/GanttTaskDialog.js +43 -43
- package/dist/components/gantt-chart/GanttTaskPanel.js +128 -128
- package/dist/components/gantt-chart/GanttTimeline.js +16 -16
- package/dist/components/gantt-chart/GanttToolbar.js +24 -24
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +244 -244
- package/dist/components/json-editor/JsonEditor.js +9 -9
- package/dist/components/json-editor/JsonEditorContent.js +54 -54
- package/dist/components/json-editor/JsonEditorToolbar.js +12 -12
- package/dist/components/kanban-board/KanbanBoard.d.ts +2 -0
- package/dist/components/kanban-board/KanbanBoard.js +129 -0
- package/dist/components/kanban-board/KanbanBoard.types.d.ts +84 -0
- package/dist/components/kanban-board/KanbanBoard.types.js +19 -0
- package/dist/components/kanban-board/KanbanBoardCard.d.ts +13 -0
- package/dist/components/kanban-board/KanbanBoardCard.js +104 -0
- package/dist/components/kanban-board/KanbanBoardCardDialog.d.ts +23 -0
- package/dist/components/kanban-board/KanbanBoardCardDialog.js +120 -0
- package/dist/components/kanban-board/KanbanBoardColumn.d.ts +14 -0
- package/dist/components/kanban-board/KanbanBoardColumn.js +129 -0
- package/dist/components/kanban-board/kanbanBoardClasses.d.ts +47 -0
- package/dist/components/kanban-board/kanbanBoardClasses.js +18 -0
- package/dist/components/password-strength-meter/PasswordStrengthMeter.js +27 -27
- package/dist/components/radial-stacked-bar-chart/RadialStackedBarChart.js +48 -48
- package/dist/components/radial-tree-chart/RadialTreeChart.js +173 -173
- package/dist/components/rich-text-editor/RichTextEditor.js +32 -32
- package/dist/components/rich-text-editor/RichTextEditorColorPicker.js +20 -20
- package/dist/components/rich-text-editor/RichTextEditorEmojiPicker.js +12 -12
- package/dist/components/rich-text-editor/RichTextEditorImageDialog.js +11 -11
- package/dist/components/rich-text-editor/RichTextEditorLinkDialog.js +11 -11
- package/dist/components/rich-text-editor/RichTextEditorMarkdownDialog.js +14 -14
- package/dist/components/rich-text-editor/RichTextEditorMentionList.js +14 -14
- package/dist/components/rich-text-editor/RichTextEditorTableMenu.js +28 -28
- package/dist/components/rich-text-editor/RichTextEditorToolbar.js +35 -35
- package/dist/components/sql-editor/SqlEditor.js +24 -24
- package/dist/components/sql-editor/SqlEditorContent.js +16 -16
- package/dist/components/sql-editor/SqlEditorHistoryMenu.js +15 -15
- package/dist/components/sql-editor/SqlEditorToolbar.js +21 -21
- package/dist/components/sunburst-chart/SunburstChart.js +126 -126
- package/dist/components/tag-selection/TagSelection.js +18 -18
- package/dist/components/tag-selection/TagSelectionAutocomplete.js +120 -120
- package/dist/components/tag-selection/TagSelectionSelectedTags.js +10 -10
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +38 -35
- package/package.json +9 -2
|
@@ -2,8 +2,8 @@ import { muiTsStateClasses as e } from "../../utils/muiTsClasses.js";
|
|
|
2
2
|
import { colorPickerClasses as t } from "./colorPickerClasses.js";
|
|
3
3
|
import { clamp as n, hexToRgba as r, hslaToHsva as i, hsvaToHsla as a, hsvaToRgba as o, parseColorString as s, rgbaToHex as c, rgbaToHsva as l } from "./util/colorConversion.util.js";
|
|
4
4
|
import { DEFAULT_COLOR_PICKER_TRANSLATION as u } from "./ColorPicker.types.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Box as d, IconButton as ee, MenuItem as f, Select as te, TextField as p, Tooltip as ne, Typography as re, useTheme as ie } from "@mui/material";
|
|
6
|
+
import { useEffect as m, useRef as h, useState as g } from "react";
|
|
7
7
|
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
8
8
|
import ae from "@mui/icons-material/Colorize";
|
|
9
9
|
//#region src/components/color-picker/ColorPicker.tsx
|
|
@@ -33,21 +33,21 @@ function b(e) {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
function x({ value: e, onCommit: t, min: r, max: i, label: a, disabled: o, size: s, onBlurExtra: c, fullWidth: l }) {
|
|
36
|
-
let [u,
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
}, [e]), /* @__PURE__ */ _(
|
|
36
|
+
let [u, d] = g(String(Math.round(e)));
|
|
37
|
+
return m(() => {
|
|
38
|
+
d(String(Math.round(e)));
|
|
39
|
+
}, [e]), /* @__PURE__ */ _(p, {
|
|
40
40
|
size: s,
|
|
41
41
|
value: u,
|
|
42
42
|
disabled: o,
|
|
43
43
|
onChange: (e) => {
|
|
44
44
|
let a = e.target.value;
|
|
45
|
-
|
|
45
|
+
d(a);
|
|
46
46
|
let o = Number(a);
|
|
47
47
|
a.trim() !== "" && !Number.isNaN(o) && t(n(o, r, i));
|
|
48
48
|
},
|
|
49
49
|
onBlur: () => {
|
|
50
|
-
|
|
50
|
+
d(String(Math.round(e))), c?.();
|
|
51
51
|
},
|
|
52
52
|
slotProps: { htmlInput: {
|
|
53
53
|
"aria-label": a,
|
|
@@ -62,11 +62,11 @@ function x({ value: e, onCommit: t, min: r, max: i, label: a, disabled: o, size:
|
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
let
|
|
65
|
+
function S({ value: c, onChange: S, onChangeCommitted: C, defaultFormat: oe = "hex", format: w, onFormatChange: se, showAlpha: T = !0, showEyeDropper: ce = !0, showSliderSection: le = !0, showInputSection: ue = !0, savedColors: E, disabled: D = !1, colorGradientSize: O = "medium", inputSize: k = "medium", width: de = 280, name: A, translation: fe }) {
|
|
66
|
+
let j = ie(), M = {
|
|
67
67
|
...u,
|
|
68
|
-
...
|
|
69
|
-
}, [
|
|
68
|
+
...fe
|
|
69
|
+
}, [N, P] = g(() => {
|
|
70
70
|
let e = s(c);
|
|
71
71
|
return e ? l(e) : {
|
|
72
72
|
h: 0,
|
|
@@ -74,225 +74,225 @@ function oe({ value: c, onChange: oe, onChangeCommitted: S, defaultFormat: se =
|
|
|
74
74
|
v: 0,
|
|
75
75
|
a: 1
|
|
76
76
|
};
|
|
77
|
-
}), [
|
|
78
|
-
if (
|
|
79
|
-
|
|
77
|
+
}), [pe, me] = g(oe), F = w ?? pe, [he, I] = g(c);
|
|
78
|
+
if (he !== c) {
|
|
79
|
+
I(c);
|
|
80
80
|
let e = s(c);
|
|
81
|
-
e &&
|
|
81
|
+
e && P(l(e));
|
|
82
82
|
}
|
|
83
|
-
let { hex:
|
|
84
|
-
|
|
85
|
-
L
|
|
86
|
-
}, [
|
|
87
|
-
let
|
|
88
|
-
|
|
83
|
+
let { hex: ge, info: _e } = b(N), L = ge.slice(0, 7), [ve, R] = g(L);
|
|
84
|
+
m(() => {
|
|
85
|
+
R(L);
|
|
86
|
+
}, [L]);
|
|
87
|
+
let z = h(null), B = h(null), V = h(null), H = (e) => {
|
|
88
|
+
P(e);
|
|
89
89
|
let t = b(e);
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
if (
|
|
90
|
+
I(t.hex), S(t.hex, t.info);
|
|
91
|
+
}, U = (e) => {
|
|
92
|
+
if (H(e), C) {
|
|
93
93
|
let t = b(e);
|
|
94
|
-
|
|
94
|
+
C(t.hex, t.info);
|
|
95
95
|
}
|
|
96
|
-
},
|
|
97
|
-
if (!
|
|
98
|
-
let e = b(
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
if (
|
|
102
|
-
let t =
|
|
103
|
-
|
|
104
|
-
...
|
|
96
|
+
}, W = () => {
|
|
97
|
+
if (!C) return;
|
|
98
|
+
let e = b(N);
|
|
99
|
+
C(e.hex, e.info);
|
|
100
|
+
}, ye = O === "small" ? 130 : 160, G = O === "small" ? 20 : 24, K = O === "small" ? 10 : 12, q = O === "small" ? 13 : 16, J = (e) => {
|
|
101
|
+
if (D || !z.current) return;
|
|
102
|
+
let t = z.current.getBoundingClientRect(), r = n(e.clientX - t.left, 0, t.width), i = n(e.clientY - t.top, 0, t.height);
|
|
103
|
+
H({
|
|
104
|
+
...N,
|
|
105
105
|
s: r / t.width * 100,
|
|
106
106
|
v: 100 - i / t.height * 100
|
|
107
107
|
});
|
|
108
|
-
}, J = (e) => {
|
|
109
|
-
if (E || !z.current) return;
|
|
110
|
-
let t = z.current.getBoundingClientRect(), r = n(e.clientX - t.left, 0, t.width);
|
|
111
|
-
V({
|
|
112
|
-
...M,
|
|
113
|
-
h: r / t.width * 360
|
|
114
|
-
});
|
|
115
108
|
}, Y = (e) => {
|
|
116
|
-
if (
|
|
109
|
+
if (D || !B.current) return;
|
|
117
110
|
let t = B.current.getBoundingClientRect(), r = n(e.clientX - t.left, 0, t.width);
|
|
118
|
-
|
|
119
|
-
...
|
|
111
|
+
H({
|
|
112
|
+
...N,
|
|
113
|
+
h: r / t.width * 360
|
|
114
|
+
});
|
|
115
|
+
}, X = (e) => {
|
|
116
|
+
if (D || !V.current) return;
|
|
117
|
+
let t = V.current.getBoundingClientRect(), r = n(e.clientX - t.left, 0, t.width);
|
|
118
|
+
H({
|
|
119
|
+
...N,
|
|
120
120
|
a: r / t.width
|
|
121
121
|
});
|
|
122
|
-
},
|
|
123
|
-
if (!(
|
|
122
|
+
}, be = typeof window < "u" && !!window.EyeDropper, xe = async () => {
|
|
123
|
+
if (!(D || !window.EyeDropper)) try {
|
|
124
124
|
let e = r((await new window.EyeDropper().open()).sRGBHex);
|
|
125
|
-
e &&
|
|
125
|
+
e && U(l({
|
|
126
126
|
...e,
|
|
127
|
-
a:
|
|
127
|
+
a: N.a
|
|
128
128
|
}));
|
|
129
129
|
} catch {}
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
},
|
|
130
|
+
}, Se = (e) => {
|
|
131
|
+
w === void 0 && me(e), se?.(e);
|
|
132
|
+
}, Z = o(N), Q = a(N), $ = L, Ce = {
|
|
133
133
|
backgroundImage: "linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%)",
|
|
134
134
|
backgroundSize: "8px 8px",
|
|
135
135
|
backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0px"
|
|
136
136
|
};
|
|
137
|
-
return /* @__PURE__ */ v(
|
|
137
|
+
return /* @__PURE__ */ v(d, {
|
|
138
138
|
sx: {
|
|
139
|
-
width:
|
|
140
|
-
opacity:
|
|
139
|
+
width: de,
|
|
140
|
+
opacity: D ? .6 : 1,
|
|
141
141
|
display: "flex",
|
|
142
142
|
flexDirection: "column",
|
|
143
143
|
gap: 1
|
|
144
144
|
},
|
|
145
|
-
className: [t.root,
|
|
145
|
+
className: [t.root, D && e.disabled].filter(Boolean).join(" "),
|
|
146
146
|
children: [
|
|
147
|
-
/* @__PURE__ */ _(
|
|
148
|
-
ref:
|
|
147
|
+
/* @__PURE__ */ _(d, {
|
|
148
|
+
ref: z,
|
|
149
149
|
role: "slider",
|
|
150
|
-
tabIndex:
|
|
151
|
-
"aria-label":
|
|
152
|
-
"aria-valuetext": `${Math.round(
|
|
150
|
+
tabIndex: D ? -1 : 0,
|
|
151
|
+
"aria-label": M.gradientAreaLabel,
|
|
152
|
+
"aria-valuetext": `${Math.round(N.s)}, ${Math.round(N.v)}`,
|
|
153
153
|
onPointerDown: (e) => {
|
|
154
|
-
e.currentTarget.setPointerCapture?.(e.pointerId),
|
|
154
|
+
e.currentTarget.setPointerCapture?.(e.pointerId), J(e);
|
|
155
155
|
},
|
|
156
156
|
onPointerMove: (e) => {
|
|
157
|
-
e.buttons === 1 &&
|
|
157
|
+
e.buttons === 1 && J(e);
|
|
158
158
|
},
|
|
159
|
-
onPointerUp:
|
|
159
|
+
onPointerUp: W,
|
|
160
160
|
className: t.gradientArea,
|
|
161
161
|
sx: {
|
|
162
162
|
position: "relative",
|
|
163
163
|
width: "100%",
|
|
164
|
-
height:
|
|
165
|
-
borderRadius: `${
|
|
166
|
-
border: `1px solid ${
|
|
167
|
-
cursor:
|
|
164
|
+
height: ye,
|
|
165
|
+
borderRadius: `${j.shape.borderRadius}px`,
|
|
166
|
+
border: `1px solid ${j.palette.divider}`,
|
|
167
|
+
cursor: D ? "default" : "crosshair",
|
|
168
168
|
touchAction: "none",
|
|
169
|
-
background: `linear-gradient(to top, #000, rgba(0,0,0,0)), linear-gradient(to right, #fff, hsl(${
|
|
169
|
+
background: `linear-gradient(to top, #000, rgba(0,0,0,0)), linear-gradient(to right, #fff, hsl(${N.h}, 100%, 50%))`
|
|
170
170
|
},
|
|
171
|
-
children: /* @__PURE__ */ _(
|
|
171
|
+
children: /* @__PURE__ */ _(d, {
|
|
172
172
|
className: t.gradientThumb,
|
|
173
173
|
sx: {
|
|
174
174
|
position: "absolute",
|
|
175
|
-
left: y(
|
|
176
|
-
top: y(100 -
|
|
177
|
-
width:
|
|
178
|
-
height:
|
|
175
|
+
left: y(N.s, q),
|
|
176
|
+
top: y(100 - N.v, q),
|
|
177
|
+
width: q,
|
|
178
|
+
height: q,
|
|
179
179
|
borderRadius: "50%",
|
|
180
180
|
border: "2px solid #fff",
|
|
181
181
|
boxShadow: "0 0 0 1px rgba(0,0,0,0.3)",
|
|
182
182
|
transform: "translate(-50%, -50%)",
|
|
183
183
|
pointerEvents: "none",
|
|
184
|
-
backgroundColor:
|
|
184
|
+
backgroundColor: $
|
|
185
185
|
}
|
|
186
186
|
})
|
|
187
187
|
}),
|
|
188
|
-
|
|
188
|
+
le && /* @__PURE__ */ v(d, {
|
|
189
189
|
sx: {
|
|
190
190
|
display: "flex",
|
|
191
191
|
gap: 1,
|
|
192
192
|
alignItems: "center"
|
|
193
193
|
},
|
|
194
194
|
className: t.sliderSection,
|
|
195
|
-
children: [
|
|
196
|
-
title:
|
|
195
|
+
children: [ce && be && /* @__PURE__ */ _(ne, {
|
|
196
|
+
title: M.eyeDropperLabel,
|
|
197
197
|
children: /* @__PURE__ */ _("span", { children: /* @__PURE__ */ _(ee, {
|
|
198
198
|
size: "small",
|
|
199
|
-
onClick:
|
|
200
|
-
disabled:
|
|
201
|
-
"aria-label":
|
|
199
|
+
onClick: xe,
|
|
200
|
+
disabled: D,
|
|
201
|
+
"aria-label": M.eyeDropperLabel,
|
|
202
202
|
children: /* @__PURE__ */ _(ae, { fontSize: "small" })
|
|
203
203
|
}) })
|
|
204
|
-
}), /* @__PURE__ */ v(
|
|
204
|
+
}), /* @__PURE__ */ v(d, {
|
|
205
205
|
sx: {
|
|
206
206
|
flex: 1,
|
|
207
207
|
display: "flex",
|
|
208
208
|
flexDirection: "column",
|
|
209
209
|
gap: .75
|
|
210
210
|
},
|
|
211
|
-
children: [/* @__PURE__ */ _(
|
|
212
|
-
ref:
|
|
211
|
+
children: [/* @__PURE__ */ _(d, {
|
|
212
|
+
ref: B,
|
|
213
213
|
role: "slider",
|
|
214
|
-
tabIndex:
|
|
215
|
-
"aria-label":
|
|
214
|
+
tabIndex: D ? -1 : 0,
|
|
215
|
+
"aria-label": M.hueSliderLabel,
|
|
216
216
|
"aria-valuemin": 0,
|
|
217
217
|
"aria-valuemax": 360,
|
|
218
|
-
"aria-valuenow": Math.round(
|
|
218
|
+
"aria-valuenow": Math.round(N.h),
|
|
219
219
|
onPointerDown: (e) => {
|
|
220
|
-
e.currentTarget.setPointerCapture?.(e.pointerId),
|
|
220
|
+
e.currentTarget.setPointerCapture?.(e.pointerId), Y(e);
|
|
221
221
|
},
|
|
222
222
|
onPointerMove: (e) => {
|
|
223
|
-
e.buttons === 1 &&
|
|
223
|
+
e.buttons === 1 && Y(e);
|
|
224
224
|
},
|
|
225
|
-
onPointerUp:
|
|
225
|
+
onPointerUp: W,
|
|
226
226
|
className: t.hueSlider,
|
|
227
227
|
sx: {
|
|
228
228
|
position: "relative",
|
|
229
229
|
width: "100%",
|
|
230
|
-
height:
|
|
231
|
-
borderRadius:
|
|
232
|
-
cursor:
|
|
230
|
+
height: K,
|
|
231
|
+
borderRadius: K,
|
|
232
|
+
cursor: D ? "default" : "pointer",
|
|
233
233
|
touchAction: "none",
|
|
234
234
|
background: "linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red)"
|
|
235
235
|
},
|
|
236
|
-
children: /* @__PURE__ */ _(
|
|
236
|
+
children: /* @__PURE__ */ _(d, { sx: {
|
|
237
237
|
position: "absolute",
|
|
238
|
-
left: y(
|
|
238
|
+
left: y(N.h / 360 * 100, q),
|
|
239
239
|
top: "50%",
|
|
240
|
-
width:
|
|
241
|
-
height:
|
|
240
|
+
width: q,
|
|
241
|
+
height: q,
|
|
242
242
|
borderRadius: "50%",
|
|
243
243
|
border: "2px solid #fff",
|
|
244
244
|
boxShadow: "0 0 0 1px rgba(0,0,0,0.3)",
|
|
245
245
|
transform: "translate(-50%, -50%)",
|
|
246
246
|
pointerEvents: "none",
|
|
247
|
-
backgroundColor: `hsl(${
|
|
247
|
+
backgroundColor: `hsl(${N.h}, 100%, 50%)`
|
|
248
248
|
} })
|
|
249
|
-
}),
|
|
250
|
-
ref:
|
|
249
|
+
}), T && /* @__PURE__ */ v(d, {
|
|
250
|
+
ref: V,
|
|
251
251
|
role: "slider",
|
|
252
|
-
tabIndex:
|
|
253
|
-
"aria-label":
|
|
252
|
+
tabIndex: D ? -1 : 0,
|
|
253
|
+
"aria-label": M.alphaFieldLabel,
|
|
254
254
|
"aria-valuemin": 0,
|
|
255
255
|
"aria-valuemax": 100,
|
|
256
|
-
"aria-valuenow": Math.round(
|
|
256
|
+
"aria-valuenow": Math.round(N.a * 100),
|
|
257
257
|
onPointerDown: (e) => {
|
|
258
|
-
e.currentTarget.setPointerCapture?.(e.pointerId),
|
|
258
|
+
e.currentTarget.setPointerCapture?.(e.pointerId), X(e);
|
|
259
259
|
},
|
|
260
260
|
onPointerMove: (e) => {
|
|
261
|
-
e.buttons === 1 &&
|
|
261
|
+
e.buttons === 1 && X(e);
|
|
262
262
|
},
|
|
263
|
-
onPointerUp:
|
|
263
|
+
onPointerUp: W,
|
|
264
264
|
className: t.alphaSlider,
|
|
265
265
|
sx: {
|
|
266
266
|
position: "relative",
|
|
267
267
|
width: "100%",
|
|
268
|
-
height:
|
|
269
|
-
borderRadius:
|
|
270
|
-
cursor:
|
|
268
|
+
height: K,
|
|
269
|
+
borderRadius: K,
|
|
270
|
+
cursor: D ? "default" : "pointer",
|
|
271
271
|
touchAction: "none",
|
|
272
|
-
|
|
272
|
+
...Ce
|
|
273
273
|
},
|
|
274
|
-
children: [/* @__PURE__ */ _(
|
|
274
|
+
children: [/* @__PURE__ */ _(d, { sx: {
|
|
275
275
|
position: "absolute",
|
|
276
276
|
inset: 0,
|
|
277
|
-
borderRadius:
|
|
278
|
-
background: `linear-gradient(to right, transparent, ${
|
|
279
|
-
} }), /* @__PURE__ */ _(
|
|
277
|
+
borderRadius: K,
|
|
278
|
+
background: `linear-gradient(to right, transparent, ${$})`
|
|
279
|
+
} }), /* @__PURE__ */ _(d, { sx: {
|
|
280
280
|
position: "absolute",
|
|
281
|
-
left: y(
|
|
281
|
+
left: y(N.a * 100, q),
|
|
282
282
|
top: "50%",
|
|
283
|
-
width:
|
|
284
|
-
height:
|
|
283
|
+
width: q,
|
|
284
|
+
height: q,
|
|
285
285
|
borderRadius: "50%",
|
|
286
286
|
border: "2px solid #fff",
|
|
287
287
|
boxShadow: "0 0 0 1px rgba(0,0,0,0.3)",
|
|
288
288
|
transform: "translate(-50%, -50%)",
|
|
289
289
|
pointerEvents: "none",
|
|
290
|
-
backgroundColor:
|
|
290
|
+
backgroundColor: $
|
|
291
291
|
} })]
|
|
292
292
|
})]
|
|
293
293
|
})]
|
|
294
294
|
}),
|
|
295
|
-
|
|
295
|
+
ue && /* @__PURE__ */ v(d, {
|
|
296
296
|
sx: {
|
|
297
297
|
display: "flex",
|
|
298
298
|
flexDirection: "column",
|
|
@@ -300,7 +300,7 @@ function oe({ value: c, onChange: oe, onChangeCommitted: S, defaultFormat: se =
|
|
|
300
300
|
},
|
|
301
301
|
className: t.inputSection,
|
|
302
302
|
children: [
|
|
303
|
-
/* @__PURE__ */ v(
|
|
303
|
+
/* @__PURE__ */ v(d, {
|
|
304
304
|
sx: {
|
|
305
305
|
display: "flex",
|
|
306
306
|
gap: .75,
|
|
@@ -308,181 +308,181 @@ function oe({ value: c, onChange: oe, onChangeCommitted: S, defaultFormat: se =
|
|
|
308
308
|
},
|
|
309
309
|
children: [
|
|
310
310
|
/* @__PURE__ */ v(te, {
|
|
311
|
-
size:
|
|
312
|
-
value:
|
|
313
|
-
"aria-label":
|
|
314
|
-
disabled:
|
|
315
|
-
onChange: (e) =>
|
|
311
|
+
size: k,
|
|
312
|
+
value: F,
|
|
313
|
+
"aria-label": M.formatLabel,
|
|
314
|
+
disabled: D,
|
|
315
|
+
onChange: (e) => Se(e.target.value),
|
|
316
316
|
sx: {
|
|
317
317
|
minWidth: 80,
|
|
318
318
|
flexShrink: 0
|
|
319
319
|
},
|
|
320
320
|
children: [
|
|
321
|
-
/* @__PURE__ */ _(
|
|
321
|
+
/* @__PURE__ */ _(f, {
|
|
322
322
|
value: "hex",
|
|
323
323
|
children: "HEX"
|
|
324
324
|
}),
|
|
325
|
-
/* @__PURE__ */ _(
|
|
325
|
+
/* @__PURE__ */ _(f, {
|
|
326
326
|
value: "rgb",
|
|
327
327
|
children: "RGB"
|
|
328
328
|
}),
|
|
329
|
-
/* @__PURE__ */ _(
|
|
329
|
+
/* @__PURE__ */ _(f, {
|
|
330
330
|
value: "hsl",
|
|
331
331
|
children: "HSL"
|
|
332
332
|
})
|
|
333
333
|
]
|
|
334
334
|
}),
|
|
335
|
-
|
|
336
|
-
size:
|
|
337
|
-
value:
|
|
338
|
-
disabled:
|
|
335
|
+
F === "hex" && /* @__PURE__ */ _(p, {
|
|
336
|
+
size: k,
|
|
337
|
+
value: ve,
|
|
338
|
+
disabled: D,
|
|
339
339
|
onChange: (e) => {
|
|
340
340
|
let t = e.target.value;
|
|
341
|
-
|
|
341
|
+
R(t);
|
|
342
342
|
let n = r(t);
|
|
343
|
-
n &&
|
|
343
|
+
n && H(l({
|
|
344
344
|
...n,
|
|
345
|
-
a:
|
|
345
|
+
a: N.a
|
|
346
346
|
}));
|
|
347
347
|
},
|
|
348
348
|
onBlur: () => {
|
|
349
|
-
L
|
|
349
|
+
R(L), W();
|
|
350
350
|
},
|
|
351
|
-
slotProps: { htmlInput: { "aria-label":
|
|
351
|
+
slotProps: { htmlInput: { "aria-label": M.hexFieldLabel } },
|
|
352
352
|
sx: {
|
|
353
353
|
flex: 1,
|
|
354
354
|
minWidth: 0
|
|
355
355
|
}
|
|
356
356
|
}),
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
label:
|
|
360
|
-
value: Math.round(
|
|
357
|
+
F !== "hex" && /* @__PURE__ */ _(d, { sx: { flex: 1 } }),
|
|
358
|
+
T && /* @__PURE__ */ _(x, {
|
|
359
|
+
label: M.alphaFieldLabel,
|
|
360
|
+
value: Math.round(N.a * 100),
|
|
361
361
|
min: 0,
|
|
362
362
|
max: 100,
|
|
363
|
-
disabled:
|
|
364
|
-
size:
|
|
365
|
-
onBlurExtra:
|
|
366
|
-
onCommit: (e) =>
|
|
367
|
-
...
|
|
363
|
+
disabled: D,
|
|
364
|
+
size: k,
|
|
365
|
+
onBlurExtra: W,
|
|
366
|
+
onCommit: (e) => H({
|
|
367
|
+
...N,
|
|
368
368
|
a: e / 100
|
|
369
369
|
})
|
|
370
370
|
})
|
|
371
371
|
]
|
|
372
372
|
}),
|
|
373
|
-
|
|
373
|
+
F === "rgb" && /* @__PURE__ */ v(d, {
|
|
374
374
|
sx: {
|
|
375
375
|
display: "flex",
|
|
376
376
|
gap: .75
|
|
377
377
|
},
|
|
378
378
|
children: [
|
|
379
379
|
/* @__PURE__ */ _(x, {
|
|
380
|
-
label:
|
|
381
|
-
value:
|
|
380
|
+
label: M.redLabel,
|
|
381
|
+
value: Z.r,
|
|
382
382
|
min: 0,
|
|
383
383
|
max: 255,
|
|
384
|
-
disabled:
|
|
385
|
-
size:
|
|
386
|
-
onBlurExtra:
|
|
384
|
+
disabled: D,
|
|
385
|
+
size: k,
|
|
386
|
+
onBlurExtra: W,
|
|
387
387
|
fullWidth: !0,
|
|
388
|
-
onCommit: (e) =>
|
|
388
|
+
onCommit: (e) => H(l({
|
|
389
389
|
r: e,
|
|
390
|
-
g:
|
|
391
|
-
b:
|
|
392
|
-
a:
|
|
390
|
+
g: Z.g,
|
|
391
|
+
b: Z.b,
|
|
392
|
+
a: N.a
|
|
393
393
|
}))
|
|
394
394
|
}),
|
|
395
395
|
/* @__PURE__ */ _(x, {
|
|
396
|
-
label:
|
|
397
|
-
value:
|
|
396
|
+
label: M.greenLabel,
|
|
397
|
+
value: Z.g,
|
|
398
398
|
min: 0,
|
|
399
399
|
max: 255,
|
|
400
|
-
disabled:
|
|
401
|
-
size:
|
|
402
|
-
onBlurExtra:
|
|
400
|
+
disabled: D,
|
|
401
|
+
size: k,
|
|
402
|
+
onBlurExtra: W,
|
|
403
403
|
fullWidth: !0,
|
|
404
|
-
onCommit: (e) =>
|
|
405
|
-
r:
|
|
404
|
+
onCommit: (e) => H(l({
|
|
405
|
+
r: Z.r,
|
|
406
406
|
g: e,
|
|
407
|
-
b:
|
|
408
|
-
a:
|
|
407
|
+
b: Z.b,
|
|
408
|
+
a: N.a
|
|
409
409
|
}))
|
|
410
410
|
}),
|
|
411
411
|
/* @__PURE__ */ _(x, {
|
|
412
|
-
label:
|
|
413
|
-
value:
|
|
412
|
+
label: M.blueLabel,
|
|
413
|
+
value: Z.b,
|
|
414
414
|
min: 0,
|
|
415
415
|
max: 255,
|
|
416
|
-
disabled:
|
|
417
|
-
size:
|
|
418
|
-
onBlurExtra:
|
|
416
|
+
disabled: D,
|
|
417
|
+
size: k,
|
|
418
|
+
onBlurExtra: W,
|
|
419
419
|
fullWidth: !0,
|
|
420
|
-
onCommit: (e) =>
|
|
421
|
-
r:
|
|
422
|
-
g:
|
|
420
|
+
onCommit: (e) => H(l({
|
|
421
|
+
r: Z.r,
|
|
422
|
+
g: Z.g,
|
|
423
423
|
b: e,
|
|
424
|
-
a:
|
|
424
|
+
a: N.a
|
|
425
425
|
}))
|
|
426
426
|
})
|
|
427
427
|
]
|
|
428
428
|
}),
|
|
429
|
-
|
|
429
|
+
F === "hsl" && /* @__PURE__ */ v(d, {
|
|
430
430
|
sx: {
|
|
431
431
|
display: "flex",
|
|
432
432
|
gap: .75
|
|
433
433
|
},
|
|
434
434
|
children: [
|
|
435
435
|
/* @__PURE__ */ _(x, {
|
|
436
|
-
label:
|
|
437
|
-
value:
|
|
436
|
+
label: M.hueFieldLabel,
|
|
437
|
+
value: Q.h,
|
|
438
438
|
min: 0,
|
|
439
439
|
max: 360,
|
|
440
|
-
disabled:
|
|
441
|
-
size:
|
|
442
|
-
onBlurExtra:
|
|
440
|
+
disabled: D,
|
|
441
|
+
size: k,
|
|
442
|
+
onBlurExtra: W,
|
|
443
443
|
fullWidth: !0,
|
|
444
|
-
onCommit: (e) =>
|
|
445
|
-
...
|
|
444
|
+
onCommit: (e) => H({
|
|
445
|
+
...N,
|
|
446
446
|
h: e
|
|
447
447
|
})
|
|
448
448
|
}),
|
|
449
449
|
/* @__PURE__ */ _(x, {
|
|
450
|
-
label:
|
|
451
|
-
value:
|
|
450
|
+
label: M.saturationFieldLabel,
|
|
451
|
+
value: Q.s,
|
|
452
452
|
min: 0,
|
|
453
453
|
max: 100,
|
|
454
|
-
disabled:
|
|
455
|
-
size:
|
|
456
|
-
onBlurExtra:
|
|
454
|
+
disabled: D,
|
|
455
|
+
size: k,
|
|
456
|
+
onBlurExtra: W,
|
|
457
457
|
fullWidth: !0,
|
|
458
|
-
onCommit: (e) =>
|
|
459
|
-
h:
|
|
458
|
+
onCommit: (e) => H(i({
|
|
459
|
+
h: Q.h,
|
|
460
460
|
s: e,
|
|
461
|
-
l:
|
|
462
|
-
a:
|
|
461
|
+
l: Q.l,
|
|
462
|
+
a: Q.a
|
|
463
463
|
}))
|
|
464
464
|
}),
|
|
465
465
|
/* @__PURE__ */ _(x, {
|
|
466
|
-
label:
|
|
467
|
-
value:
|
|
466
|
+
label: M.lightnessFieldLabel,
|
|
467
|
+
value: Q.l,
|
|
468
468
|
min: 0,
|
|
469
469
|
max: 100,
|
|
470
|
-
disabled:
|
|
471
|
-
size:
|
|
472
|
-
onBlurExtra:
|
|
470
|
+
disabled: D,
|
|
471
|
+
size: k,
|
|
472
|
+
onBlurExtra: W,
|
|
473
473
|
fullWidth: !0,
|
|
474
|
-
onCommit: (e) =>
|
|
475
|
-
h:
|
|
476
|
-
s:
|
|
474
|
+
onCommit: (e) => H(i({
|
|
475
|
+
h: Q.h,
|
|
476
|
+
s: Q.s,
|
|
477
477
|
l: e,
|
|
478
|
-
a:
|
|
478
|
+
a: Q.a
|
|
479
479
|
}))
|
|
480
480
|
})
|
|
481
481
|
]
|
|
482
482
|
})
|
|
483
483
|
]
|
|
484
484
|
}),
|
|
485
|
-
|
|
485
|
+
E && E.length > 0 && /* @__PURE__ */ v(d, {
|
|
486
486
|
className: t.savedColors,
|
|
487
487
|
children: [/* @__PURE__ */ _(re, {
|
|
488
488
|
variant: "caption",
|
|
@@ -491,37 +491,37 @@ function oe({ value: c, onChange: oe, onChangeCommitted: S, defaultFormat: se =
|
|
|
491
491
|
display: "block",
|
|
492
492
|
mb: .5
|
|
493
493
|
},
|
|
494
|
-
children:
|
|
495
|
-
}), /* @__PURE__ */ _(
|
|
494
|
+
children: M.savedColorsLabel
|
|
495
|
+
}), /* @__PURE__ */ _(d, {
|
|
496
496
|
sx: {
|
|
497
497
|
display: "flex",
|
|
498
498
|
flexWrap: "wrap",
|
|
499
499
|
gap: .75
|
|
500
500
|
},
|
|
501
501
|
className: t.swatchList,
|
|
502
|
-
children:
|
|
502
|
+
children: E.map((e, n) => /* @__PURE__ */ _(d, {
|
|
503
503
|
component: "button",
|
|
504
504
|
type: "button",
|
|
505
|
-
disabled:
|
|
505
|
+
disabled: D,
|
|
506
506
|
"aria-label": e,
|
|
507
507
|
onClick: () => {
|
|
508
508
|
let t = s(e);
|
|
509
|
-
t &&
|
|
509
|
+
t && U(l(t));
|
|
510
510
|
},
|
|
511
511
|
className: t.swatch,
|
|
512
512
|
sx: {
|
|
513
|
-
width:
|
|
514
|
-
height:
|
|
513
|
+
width: G,
|
|
514
|
+
height: G,
|
|
515
515
|
p: 0,
|
|
516
516
|
borderRadius: .5,
|
|
517
|
-
border: `1px solid ${
|
|
518
|
-
cursor:
|
|
517
|
+
border: `1px solid ${j.palette.divider}`,
|
|
518
|
+
cursor: D ? "default" : "pointer",
|
|
519
519
|
flexShrink: 0,
|
|
520
|
-
|
|
520
|
+
...Ce,
|
|
521
521
|
backgroundSize: "6px 6px",
|
|
522
|
-
"&:hover":
|
|
522
|
+
"&:hover": D ? void 0 : { borderColor: j.palette.primary.main }
|
|
523
523
|
},
|
|
524
|
-
children: /* @__PURE__ */ _(
|
|
524
|
+
children: /* @__PURE__ */ _(d, { sx: {
|
|
525
525
|
width: "100%",
|
|
526
526
|
height: "100%",
|
|
527
527
|
borderRadius: .5,
|
|
@@ -530,13 +530,13 @@ function oe({ value: c, onChange: oe, onChangeCommitted: S, defaultFormat: se =
|
|
|
530
530
|
}, `${e}-${n}`))
|
|
531
531
|
})]
|
|
532
532
|
}),
|
|
533
|
-
|
|
533
|
+
A && /* @__PURE__ */ _("input", {
|
|
534
534
|
type: "hidden",
|
|
535
|
-
name:
|
|
536
|
-
value:
|
|
535
|
+
name: A,
|
|
536
|
+
value: _e.hex
|
|
537
537
|
})
|
|
538
538
|
]
|
|
539
539
|
});
|
|
540
540
|
}
|
|
541
541
|
//#endregion
|
|
542
|
-
export {
|
|
542
|
+
export { S as ColorPicker };
|