@overmap-ai/forms 1.0.32-react-flow-david-fixes.41 → 1.0.33-toast-migration.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/dist/form/Observable/index.d.ts +1 -0
- package/dist/form/UUIDFile/UUIDFile.d.ts +5 -0
- package/dist/form/UUIDFile/index.d.ts +1 -0
- package/dist/form/{fields/UploadField → UUIDPromise}/UUIDPromise.d.ts +3 -3
- package/dist/form/UUIDPromise/index.d.ts +2 -0
- package/dist/form/UUIDPromise/utils.d.ts +4 -0
- package/dist/form/builder/Root.d.ts +1 -1
- package/dist/form/builder/components/CreateFieldDropdownMenu.d.ts +8 -0
- package/dist/form/builder/components/FieldBuilder.d.ts +2 -2
- package/dist/form/builder/components/FieldBuilderWithActions.d.ts +9 -0
- package/dist/form/builder/components/index.d.ts +2 -1
- package/dist/form/builder/hooks.d.ts +1 -1
- package/dist/form/builder/list/FieldSectionWithActions.d.ts +1 -1
- package/dist/form/builder/utils.d.ts +2 -2
- package/dist/form/components/DisplayFile.d.ts +9 -0
- package/dist/form/components/index.d.ts +1 -0
- package/dist/form/conditions/BaseCondition/BaseCondition.d.ts +7 -8
- package/dist/form/conditions/BaseCondition/typings.d.ts +4 -4
- package/dist/form/conditions/BooleanFieldCondition/BooleanFieldCondition.d.ts +4 -6
- package/dist/form/conditions/CheckboxListFieldCondition/CheckboxListFieldCondition.d.ts +4 -6
- package/dist/form/conditions/ConditionManager/ConditionManager.d.ts +15 -0
- package/dist/form/conditions/ConditionManager/hooks.d.ts +4 -0
- package/dist/form/conditions/ConditionManager/index.d.ts +3 -0
- package/dist/form/conditions/ConditionManager/typings.d.ts +2 -0
- package/dist/form/conditions/DateFieldCondition/DateFieldCondition.d.ts +5 -7
- package/dist/form/conditions/MultiSelectFieldCondition/MultiSelectFieldCondition.d.ts +4 -14
- package/dist/form/conditions/MultiStringFieldCondition/MultiStringFieldCondition.d.ts +4 -6
- package/dist/form/conditions/NumberFieldCondition/NumberFieldCondition.d.ts +4 -17
- package/dist/form/conditions/OTPFieldCondition/OTPFieldCondition.d.ts +4 -6
- package/dist/form/conditions/PassFailFieldCondition/PassFailFieldCondition.d.ts +18 -0
- package/dist/form/conditions/PassFailFieldCondition/PassFailFieldConditionCell.d.ts +6 -0
- package/dist/form/conditions/PassFailFieldCondition/index.d.ts +3 -0
- package/dist/form/conditions/PassFailFieldCondition/typings.d.ts +4 -0
- package/dist/form/conditions/RadioFieldCondition/RadioFieldCondition.d.ts +4 -6
- package/dist/form/conditions/RatingFieldCondition/RatingFieldCondition.d.ts +21 -0
- package/dist/form/conditions/RatingFieldCondition/RatingFieldConditionCell.d.ts +6 -0
- package/dist/form/conditions/RatingFieldCondition/index.d.ts +3 -0
- package/dist/form/conditions/RatingFieldCondition/typings.d.ts +4 -0
- package/dist/form/conditions/ScanFieldCondition/ScanFieldCondition.d.ts +4 -6
- package/dist/form/conditions/SelectFieldCondition/SelectFieldCondition.d.ts +4 -6
- package/dist/form/conditions/StringFieldCondition/StringFieldCondition.d.ts +4 -6
- package/dist/form/conditions/TextFieldCondition/TextFieldCondition.d.ts +4 -6
- package/dist/form/conditions/UploadFieldCondition/UploadFieldCondition.d.ts +8 -8
- package/dist/form/conditions/constants.d.ts +32 -0
- package/dist/form/conditions/index.d.ts +3 -0
- package/dist/form/conditions/typings.d.ts +6 -3
- package/dist/form/conditions/utils.d.ts +4 -5
- package/dist/form/fields/BaseField/BaseField.d.ts +6 -7
- package/dist/form/fields/BaseField/typings.d.ts +3 -4
- package/dist/form/fields/BaseFormElement/BaseFormElement.d.ts +9 -9
- package/dist/form/fields/BaseFormElement/typings.d.ts +3 -3
- package/dist/form/fields/BaseOptionsField/BaseOptionsField.d.ts +7 -7
- package/dist/form/fields/BaseOptionsField/typings.d.ts +2 -2
- package/dist/form/fields/BaseStringField/BaseStringField.d.ts +4 -4
- package/dist/form/fields/BaseStringField/typings.d.ts +1 -1
- package/dist/form/fields/BooleanField/BooleanField.d.ts +3 -4
- package/dist/form/fields/BooleanField/BooleanInput.d.ts +1 -1
- package/dist/form/fields/CheckboxListField/CheckboxListField.d.ts +2 -2
- package/dist/form/fields/DateField/DateField.d.ts +2 -2
- package/dist/form/fields/DateField/DateInput.d.ts +1 -1
- package/dist/form/fields/FieldSection/FieldSection.d.ts +6 -8
- package/dist/form/fields/FieldSection/typings.d.ts +2 -2
- package/dist/form/fields/MultiSelectField/MultiSelectField.d.ts +2 -2
- package/dist/form/fields/MultiSelectField/MultiSelectInput.d.ts +1 -1
- package/dist/form/fields/MultiStringField/MultiStringField.d.ts +2 -2
- package/dist/form/fields/MultiStringField/MultiStringInput.d.ts +1 -1
- package/dist/form/fields/NumberField/NumberField.d.ts +2 -2
- package/dist/form/fields/NumberField/NumberInput.d.ts +1 -1
- package/dist/form/fields/OneTimePasswordField/OTPField.d.ts +2 -2
- package/dist/form/fields/OneTimePasswordField/typings.d.ts +1 -1
- package/dist/form/fields/PassFailField/PassFailField.d.ts +30 -0
- package/dist/form/fields/PassFailField/PassFailInput.d.ts +7 -0
- package/dist/form/fields/PassFailField/constants.d.ts +7 -0
- package/dist/form/fields/PassFailField/index.d.ts +5 -0
- package/dist/form/fields/PassFailField/typings.d.ts +17 -0
- package/dist/form/fields/PassFailField/utils.d.ts +7 -0
- package/dist/form/fields/RadioField/RadioField.d.ts +2 -2
- package/dist/form/fields/RadioField/RadioInput.d.ts +1 -1
- package/dist/form/fields/RatingField/RatingField.d.ts +32 -0
- package/dist/form/fields/RatingField/RatingInput.d.ts +7 -0
- package/dist/form/fields/RatingField/index.d.ts +3 -0
- package/dist/form/fields/RatingField/typings.d.ts +4 -0
- package/dist/form/fields/ScanField/ScanField.d.ts +2 -2
- package/dist/form/fields/ScanField/ScanInput.d.ts +1 -1
- package/dist/form/fields/SelectField/SelectField.d.ts +2 -2
- package/dist/form/fields/SelectField/SelectInput.d.ts +1 -1
- package/dist/form/fields/StringField/StringField.d.ts +1 -1
- package/dist/form/fields/StringField/StringInput.d.ts +1 -1
- package/dist/form/fields/TextField/TextField.d.ts +1 -1
- package/dist/form/fields/TextField/TextInput.d.ts +1 -1
- package/dist/form/fields/UploadField/UploadField.d.ts +11 -10
- package/dist/form/fields/UploadField/UploadInput.d.ts +1 -1
- package/dist/form/fields/UploadField/index.d.ts +0 -1
- package/dist/form/fields/UploadField/utils.d.ts +0 -3
- package/dist/form/fields/components/InputWithLabel.d.ts +1 -1
- package/dist/form/fields/constants.d.ts +7 -3
- package/dist/form/fields/hooks.d.ts +1 -1
- package/dist/form/fields/index.d.ts +2 -0
- package/dist/form/fields/typings.d.ts +14 -16
- package/dist/form/fields/utils.d.ts +7 -2
- package/dist/form/index.d.ts +3 -0
- package/dist/form/modifiers/file.d.ts +3 -2
- package/dist/form/modifiers/index.d.ts +1 -0
- package/dist/form/modifiers/passFailStatus.d.ts +6 -0
- package/dist/form/modifiers/utils.d.ts +1 -1
- package/dist/form/schema/FieldSchema.d.ts +7 -6
- package/dist/form/typings.d.ts +6 -2
- package/dist/form/utils.d.ts +5 -11
- package/dist/forms.js +2185 -742
- package/dist/forms.js.map +1 -0
- package/dist/forms.umd.cjs +2183 -740
- package/dist/forms.umd.cjs.map +1 -0
- package/package.json +37 -51
- package/dist/form/builder/components/FieldWithActions.d.ts +0 -10
- /package/dist/form/{observable → Observable}/Observable.d.ts +0 -0
package/dist/forms.umd.cjs
CHANGED
|
@@ -5,11 +5,609 @@
|
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @license lucide-react v0.542.0 - ISC
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the ISC license.
|
|
12
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
15
|
+
const toCamelCase = (string) => string.replace(
|
|
16
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
17
|
+
(match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
|
|
18
|
+
);
|
|
19
|
+
const toPascalCase = (string) => {
|
|
20
|
+
const camelCase = toCamelCase(string);
|
|
21
|
+
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
22
|
+
};
|
|
23
|
+
const mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
24
|
+
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
25
|
+
}).join(" ").trim();
|
|
26
|
+
const hasA11yProp = (props) => {
|
|
27
|
+
for (const prop in props) {
|
|
28
|
+
if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @license lucide-react v0.542.0 - ISC
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the ISC license.
|
|
37
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/
|
|
39
|
+
var defaultAttributes = {
|
|
40
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
41
|
+
width: 24,
|
|
42
|
+
height: 24,
|
|
43
|
+
viewBox: "0 0 24 24",
|
|
44
|
+
fill: "none",
|
|
45
|
+
stroke: "currentColor",
|
|
46
|
+
strokeWidth: 2,
|
|
47
|
+
strokeLinecap: "round",
|
|
48
|
+
strokeLinejoin: "round"
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* @license lucide-react v0.542.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/
|
|
56
|
+
const Icon = React.forwardRef(
|
|
57
|
+
({
|
|
58
|
+
color = "currentColor",
|
|
59
|
+
size = 24,
|
|
60
|
+
strokeWidth = 2,
|
|
61
|
+
absoluteStrokeWidth,
|
|
62
|
+
className = "",
|
|
63
|
+
children,
|
|
64
|
+
iconNode,
|
|
65
|
+
...rest
|
|
66
|
+
}, ref) => React.createElement(
|
|
67
|
+
"svg",
|
|
68
|
+
{
|
|
69
|
+
ref,
|
|
70
|
+
...defaultAttributes,
|
|
71
|
+
width: size,
|
|
72
|
+
height: size,
|
|
73
|
+
stroke: color,
|
|
74
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
75
|
+
className: mergeClasses("lucide", className),
|
|
76
|
+
...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
|
|
77
|
+
...rest
|
|
78
|
+
},
|
|
79
|
+
[
|
|
80
|
+
...iconNode.map(([tag, attrs]) => React.createElement(tag, attrs)),
|
|
81
|
+
...Array.isArray(children) ? children : [children]
|
|
82
|
+
]
|
|
83
|
+
)
|
|
84
|
+
);
|
|
85
|
+
/**
|
|
86
|
+
* @license lucide-react v0.542.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/
|
|
91
|
+
const createLucideIcon = (iconName, iconNode) => {
|
|
92
|
+
const Component = React.forwardRef(
|
|
93
|
+
({ className, ...props }, ref) => React.createElement(Icon, {
|
|
94
|
+
ref,
|
|
95
|
+
iconNode,
|
|
96
|
+
className: mergeClasses(
|
|
97
|
+
`lucide-${toKebabCase(toPascalCase(iconName))}`,
|
|
98
|
+
`lucide-${iconName}`,
|
|
99
|
+
className
|
|
100
|
+
),
|
|
101
|
+
...props
|
|
102
|
+
})
|
|
103
|
+
);
|
|
104
|
+
Component.displayName = toPascalCase(iconName);
|
|
105
|
+
return Component;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* @license lucide-react v0.542.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/
|
|
113
|
+
const __iconNode$D = [
|
|
114
|
+
["path", { d: "M3 12h18", key: "1i2n21" }],
|
|
115
|
+
["path", { d: "M3 18h18", key: "1h113x" }],
|
|
116
|
+
["path", { d: "M3 6h18", key: "d0wm0j" }]
|
|
117
|
+
];
|
|
118
|
+
const AlignJustify = createLucideIcon("align-justify", __iconNode$D);
|
|
119
|
+
/**
|
|
120
|
+
* @license lucide-react v0.542.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/
|
|
125
|
+
const __iconNode$C = [
|
|
126
|
+
["path", { d: "m3 16 4 4 4-4", key: "1co6wj" }],
|
|
127
|
+
["path", { d: "M7 20V4", key: "1yoxec" }],
|
|
128
|
+
["path", { d: "m21 8-4-4-4 4", key: "1c9v7m" }],
|
|
129
|
+
["path", { d: "M17 4v16", key: "7dpous" }]
|
|
130
|
+
];
|
|
131
|
+
const ArrowDownUp = createLucideIcon("arrow-down-up", __iconNode$C);
|
|
132
|
+
/**
|
|
133
|
+
* @license lucide-react v0.542.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/
|
|
138
|
+
const __iconNode$B = [
|
|
139
|
+
["path", { d: "M8 3 4 7l4 4", key: "9rb6wj" }],
|
|
140
|
+
["path", { d: "M4 7h16", key: "6tx8e3" }],
|
|
141
|
+
["path", { d: "m16 21 4-4-4-4", key: "siv7j2" }],
|
|
142
|
+
["path", { d: "M20 17H4", key: "h6l3hr" }]
|
|
143
|
+
];
|
|
144
|
+
const ArrowLeftRight = createLucideIcon("arrow-left-right", __iconNode$B);
|
|
145
|
+
/**
|
|
146
|
+
* @license lucide-react v0.542.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/
|
|
151
|
+
const __iconNode$A = [
|
|
152
|
+
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
153
|
+
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
154
|
+
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
155
|
+
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
156
|
+
];
|
|
157
|
+
const Calendar = createLucideIcon("calendar", __iconNode$A);
|
|
158
|
+
/**
|
|
159
|
+
* @license lucide-react v0.542.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/
|
|
164
|
+
const __iconNode$z = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
165
|
+
const Check = createLucideIcon("check", __iconNode$z);
|
|
166
|
+
/**
|
|
167
|
+
* @license lucide-react v0.542.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/
|
|
172
|
+
const __iconNode$y = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
173
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$y);
|
|
174
|
+
/**
|
|
175
|
+
* @license lucide-react v0.542.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/
|
|
180
|
+
const __iconNode$x = [
|
|
181
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
182
|
+
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
183
|
+
];
|
|
184
|
+
const CircleCheck = createLucideIcon("circle-check", __iconNode$x);
|
|
185
|
+
/**
|
|
186
|
+
* @license lucide-react v0.542.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/
|
|
191
|
+
const __iconNode$w = [
|
|
192
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
193
|
+
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }]
|
|
194
|
+
];
|
|
195
|
+
const CircleDot = createLucideIcon("circle-dot", __iconNode$w);
|
|
196
|
+
/**
|
|
197
|
+
* @license lucide-react v0.542.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/
|
|
202
|
+
const __iconNode$v = [
|
|
203
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
204
|
+
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
|
205
|
+
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
206
|
+
];
|
|
207
|
+
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$v);
|
|
208
|
+
/**
|
|
209
|
+
* @license lucide-react v0.542.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/
|
|
214
|
+
const __iconNode$u = [
|
|
215
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
216
|
+
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
217
|
+
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
218
|
+
];
|
|
219
|
+
const CircleX = createLucideIcon("circle-x", __iconNode$u);
|
|
220
|
+
/**
|
|
221
|
+
* @license lucide-react v0.542.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/
|
|
226
|
+
const __iconNode$t = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
|
|
227
|
+
const Circle = createLucideIcon("circle", __iconNode$t);
|
|
228
|
+
/**
|
|
229
|
+
* @license lucide-react v0.542.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/
|
|
234
|
+
const __iconNode$s = [
|
|
235
|
+
["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
|
|
236
|
+
[
|
|
237
|
+
"path",
|
|
238
|
+
{
|
|
239
|
+
d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",
|
|
240
|
+
key: "116196"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
["path", { d: "M12 11h4", key: "1jrz19" }],
|
|
244
|
+
["path", { d: "M12 16h4", key: "n85exb" }],
|
|
245
|
+
["path", { d: "M8 11h.01", key: "1dfujw" }],
|
|
246
|
+
["path", { d: "M8 16h.01", key: "18s6g9" }]
|
|
247
|
+
];
|
|
248
|
+
const ClipboardList = createLucideIcon("clipboard-list", __iconNode$s);
|
|
249
|
+
/**
|
|
250
|
+
* @license lucide-react v0.542.0 - ISC
|
|
251
|
+
*
|
|
252
|
+
* This source code is licensed under the ISC license.
|
|
253
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
+
*/
|
|
255
|
+
const __iconNode$r = [
|
|
256
|
+
["path", { d: "m12 15 2 2 4-4", key: "2c609p" }],
|
|
257
|
+
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
258
|
+
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
259
|
+
];
|
|
260
|
+
const CopyCheck = createLucideIcon("copy-check", __iconNode$r);
|
|
261
|
+
/**
|
|
262
|
+
* @license lucide-react v0.542.0 - ISC
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the ISC license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/
|
|
267
|
+
const __iconNode$q = [
|
|
268
|
+
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
269
|
+
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
270
|
+
];
|
|
271
|
+
const Copy = createLucideIcon("copy", __iconNode$q);
|
|
272
|
+
/**
|
|
273
|
+
* @license lucide-react v0.542.0 - ISC
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the ISC license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/
|
|
278
|
+
const __iconNode$p = [
|
|
279
|
+
["path", { d: "M12 15V3", key: "m9g1x1" }],
|
|
280
|
+
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
281
|
+
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
|
|
282
|
+
];
|
|
283
|
+
const Download = createLucideIcon("download", __iconNode$p);
|
|
284
|
+
/**
|
|
285
|
+
* @license lucide-react v0.542.0 - ISC
|
|
286
|
+
*
|
|
287
|
+
* This source code is licensed under the ISC license.
|
|
288
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
+
*/
|
|
290
|
+
const __iconNode$o = [
|
|
291
|
+
["path", { d: "M12 17h.01", key: "p32p05" }],
|
|
292
|
+
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z", key: "1mlx9k" }],
|
|
293
|
+
["path", { d: "M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3", key: "mhlwft" }]
|
|
294
|
+
];
|
|
295
|
+
const FileQuestionMark = createLucideIcon("file-question-mark", __iconNode$o);
|
|
296
|
+
/**
|
|
297
|
+
* @license lucide-react v0.542.0 - ISC
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the ISC license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/
|
|
302
|
+
const __iconNode$n = [
|
|
303
|
+
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
304
|
+
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
305
|
+
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
306
|
+
];
|
|
307
|
+
const FileWarning = createLucideIcon("file-warning", __iconNode$n);
|
|
308
|
+
/**
|
|
309
|
+
* @license lucide-react v0.542.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/
|
|
314
|
+
const __iconNode$m = [
|
|
315
|
+
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
316
|
+
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
|
|
317
|
+
];
|
|
318
|
+
const File$1 = createLucideIcon("file", __iconNode$m);
|
|
319
|
+
/**
|
|
320
|
+
* @license lucide-react v0.542.0 - ISC
|
|
321
|
+
*
|
|
322
|
+
* This source code is licensed under the ISC license.
|
|
323
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
+
*/
|
|
325
|
+
const __iconNode$l = [
|
|
326
|
+
["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
|
|
327
|
+
["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
|
|
328
|
+
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
|
|
329
|
+
["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
|
|
330
|
+
];
|
|
331
|
+
const GitBranch = createLucideIcon("git-branch", __iconNode$l);
|
|
332
|
+
/**
|
|
333
|
+
* @license lucide-react v0.542.0 - ISC
|
|
334
|
+
*
|
|
335
|
+
* This source code is licensed under the ISC license.
|
|
336
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
+
*/
|
|
338
|
+
const __iconNode$k = [
|
|
339
|
+
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
340
|
+
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
341
|
+
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
342
|
+
["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
|
|
343
|
+
];
|
|
344
|
+
const Hash = createLucideIcon("hash", __iconNode$k);
|
|
345
|
+
/**
|
|
346
|
+
* @license lucide-react v0.542.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/
|
|
351
|
+
const __iconNode$j = [
|
|
352
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
353
|
+
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
354
|
+
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
355
|
+
];
|
|
356
|
+
const Image = createLucideIcon("image", __iconNode$j);
|
|
357
|
+
/**
|
|
358
|
+
* @license lucide-react v0.542.0 - ISC
|
|
359
|
+
*
|
|
360
|
+
* This source code is licensed under the ISC license.
|
|
361
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
+
*/
|
|
363
|
+
const __iconNode$i = [
|
|
364
|
+
["rect", { width: "18", height: "7", x: "3", y: "3", rx: "1", key: "f1a2em" }],
|
|
365
|
+
["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }],
|
|
366
|
+
["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }]
|
|
367
|
+
];
|
|
368
|
+
const LayoutPanelTop = createLucideIcon("layout-panel-top", __iconNode$i);
|
|
369
|
+
/**
|
|
370
|
+
* @license lucide-react v0.542.0 - ISC
|
|
371
|
+
*
|
|
372
|
+
* This source code is licensed under the ISC license.
|
|
373
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
+
*/
|
|
375
|
+
const __iconNode$h = [
|
|
376
|
+
["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
|
|
377
|
+
["path", { d: "m3 7 2 2 4-4", key: "1obspn" }],
|
|
378
|
+
["path", { d: "M13 6h8", key: "15sg57" }],
|
|
379
|
+
["path", { d: "M13 12h8", key: "h98zly" }],
|
|
380
|
+
["path", { d: "M13 18h8", key: "oe0vm4" }]
|
|
381
|
+
];
|
|
382
|
+
const ListChecks = createLucideIcon("list-checks", __iconNode$h);
|
|
383
|
+
/**
|
|
384
|
+
* @license lucide-react v0.542.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the ISC license.
|
|
387
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/
|
|
389
|
+
const __iconNode$g = [
|
|
390
|
+
["rect", { x: "3", y: "5", width: "6", height: "6", rx: "1", key: "1defrl" }],
|
|
391
|
+
["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
|
|
392
|
+
["path", { d: "M13 6h8", key: "15sg57" }],
|
|
393
|
+
["path", { d: "M13 12h8", key: "h98zly" }],
|
|
394
|
+
["path", { d: "M13 18h8", key: "oe0vm4" }]
|
|
395
|
+
];
|
|
396
|
+
const ListTodo = createLucideIcon("list-todo", __iconNode$g);
|
|
397
|
+
/**
|
|
398
|
+
* @license lucide-react v0.542.0 - ISC
|
|
399
|
+
*
|
|
400
|
+
* This source code is licensed under the ISC license.
|
|
401
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
+
*/
|
|
403
|
+
const __iconNode$f = [
|
|
404
|
+
["path", { d: "M3 12h.01", key: "nlz23k" }],
|
|
405
|
+
["path", { d: "M3 18h.01", key: "1tta3j" }],
|
|
406
|
+
["path", { d: "M3 6h.01", key: "1rqtza" }],
|
|
407
|
+
["path", { d: "M8 12h13", key: "1za7za" }],
|
|
408
|
+
["path", { d: "M8 18h13", key: "1lx6n3" }],
|
|
409
|
+
["path", { d: "M8 6h13", key: "ik3vkj" }]
|
|
410
|
+
];
|
|
411
|
+
const List = createLucideIcon("list", __iconNode$f);
|
|
412
|
+
/**
|
|
413
|
+
* @license lucide-react v0.542.0 - ISC
|
|
414
|
+
*
|
|
415
|
+
* This source code is licensed under the ISC license.
|
|
416
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
+
*/
|
|
418
|
+
const __iconNode$e = [
|
|
419
|
+
["path", { d: "M8 3H5a2 2 0 0 0-2 2v3", key: "1dcmit" }],
|
|
420
|
+
["path", { d: "M21 8V5a2 2 0 0 0-2-2h-3", key: "1e4gt3" }],
|
|
421
|
+
["path", { d: "M3 16v3a2 2 0 0 0 2 2h3", key: "wsl5sc" }],
|
|
422
|
+
["path", { d: "M16 21h3a2 2 0 0 0 2-2v-3", key: "18trek" }]
|
|
423
|
+
];
|
|
424
|
+
const Maximize = createLucideIcon("maximize", __iconNode$e);
|
|
425
|
+
/**
|
|
426
|
+
* @license lucide-react v0.542.0 - ISC
|
|
427
|
+
*
|
|
428
|
+
* This source code is licensed under the ISC license.
|
|
429
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
+
*/
|
|
431
|
+
const __iconNode$d = [["path", { d: "M5 12h14", key: "1ays0h" }]];
|
|
432
|
+
const Minus = createLucideIcon("minus", __iconNode$d);
|
|
433
|
+
/**
|
|
434
|
+
* @license lucide-react v0.542.0 - ISC
|
|
435
|
+
*
|
|
436
|
+
* This source code is licensed under the ISC license.
|
|
437
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
438
|
+
*/
|
|
439
|
+
const __iconNode$c = [
|
|
440
|
+
["path", { d: "M8 18L12 22L16 18", key: "cskvfv" }],
|
|
441
|
+
["path", { d: "M12 2V22", key: "r89rzk" }]
|
|
442
|
+
];
|
|
443
|
+
const MoveDown = createLucideIcon("move-down", __iconNode$c);
|
|
444
|
+
/**
|
|
445
|
+
* @license lucide-react v0.542.0 - ISC
|
|
446
|
+
*
|
|
447
|
+
* This source code is licensed under the ISC license.
|
|
448
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
449
|
+
*/
|
|
450
|
+
const __iconNode$b = [
|
|
451
|
+
["path", { d: "M8 6L12 2L16 6", key: "1yvkyx" }],
|
|
452
|
+
["path", { d: "M12 2V22", key: "r89rzk" }]
|
|
453
|
+
];
|
|
454
|
+
const MoveUp = createLucideIcon("move-up", __iconNode$b);
|
|
455
|
+
/**
|
|
456
|
+
* @license lucide-react v0.542.0 - ISC
|
|
457
|
+
*
|
|
458
|
+
* This source code is licensed under the ISC license.
|
|
459
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
+
*/
|
|
461
|
+
const __iconNode$a = [
|
|
462
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
463
|
+
["path", { d: "M12 5v14", key: "s699le" }]
|
|
464
|
+
];
|
|
465
|
+
const Plus = createLucideIcon("plus", __iconNode$a);
|
|
466
|
+
/**
|
|
467
|
+
* @license lucide-react v0.542.0 - ISC
|
|
468
|
+
*
|
|
469
|
+
* This source code is licensed under the ISC license.
|
|
470
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
+
*/
|
|
472
|
+
const __iconNode$9 = [
|
|
473
|
+
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }],
|
|
474
|
+
["path", { d: "M12 12h.01", key: "1mp3jc" }],
|
|
475
|
+
["path", { d: "M17 12h.01", key: "1m0b6t" }],
|
|
476
|
+
["path", { d: "M7 12h.01", key: "eqddd0" }]
|
|
477
|
+
];
|
|
478
|
+
const RectangleEllipsis = createLucideIcon("rectangle-ellipsis", __iconNode$9);
|
|
479
|
+
/**
|
|
480
|
+
* @license lucide-react v0.542.0 - ISC
|
|
481
|
+
*
|
|
482
|
+
* This source code is licensed under the ISC license.
|
|
483
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
484
|
+
*/
|
|
485
|
+
const __iconNode$8 = [
|
|
486
|
+
["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
|
|
487
|
+
["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
|
|
488
|
+
["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
|
|
489
|
+
["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }]
|
|
490
|
+
];
|
|
491
|
+
const Scan = createLucideIcon("scan", __iconNode$8);
|
|
492
|
+
/**
|
|
493
|
+
* @license lucide-react v0.542.0 - ISC
|
|
494
|
+
*
|
|
495
|
+
* This source code is licensed under the ISC license.
|
|
496
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
497
|
+
*/
|
|
498
|
+
const __iconNode$7 = [
|
|
499
|
+
[
|
|
500
|
+
"path",
|
|
501
|
+
{
|
|
502
|
+
d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
|
|
503
|
+
key: "1i5ecw"
|
|
504
|
+
}
|
|
505
|
+
],
|
|
506
|
+
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
507
|
+
];
|
|
508
|
+
const Settings = createLucideIcon("settings", __iconNode$7);
|
|
509
|
+
/**
|
|
510
|
+
* @license lucide-react v0.542.0 - ISC
|
|
511
|
+
*
|
|
512
|
+
* This source code is licensed under the ISC license.
|
|
513
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
514
|
+
*/
|
|
515
|
+
const __iconNode$6 = [
|
|
516
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
517
|
+
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
518
|
+
];
|
|
519
|
+
const SquareCheck = createLucideIcon("square-check", __iconNode$6);
|
|
520
|
+
/**
|
|
521
|
+
* @license lucide-react v0.542.0 - ISC
|
|
522
|
+
*
|
|
523
|
+
* This source code is licensed under the ISC license.
|
|
524
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
525
|
+
*/
|
|
526
|
+
const __iconNode$5 = [
|
|
527
|
+
["path", { d: "M5 3a2 2 0 0 0-2 2", key: "y57alp" }],
|
|
528
|
+
["path", { d: "M19 3a2 2 0 0 1 2 2", key: "18rm91" }],
|
|
529
|
+
["path", { d: "M21 19a2 2 0 0 1-2 2", key: "1j7049" }],
|
|
530
|
+
["path", { d: "M5 21a2 2 0 0 1-2-2", key: "sbafld" }],
|
|
531
|
+
["path", { d: "M9 3h1", key: "1yesri" }],
|
|
532
|
+
["path", { d: "M9 21h1", key: "15o7lz" }],
|
|
533
|
+
["path", { d: "M14 3h1", key: "1ec4yj" }],
|
|
534
|
+
["path", { d: "M14 21h1", key: "v9vybs" }],
|
|
535
|
+
["path", { d: "M3 9v1", key: "1r0deq" }],
|
|
536
|
+
["path", { d: "M21 9v1", key: "mxsmne" }],
|
|
537
|
+
["path", { d: "M3 14v1", key: "vnatye" }],
|
|
538
|
+
["path", { d: "M21 14v1", key: "169vum" }]
|
|
539
|
+
];
|
|
540
|
+
const SquareDashed = createLucideIcon("square-dashed", __iconNode$5);
|
|
541
|
+
/**
|
|
542
|
+
* @license lucide-react v0.542.0 - ISC
|
|
543
|
+
*
|
|
544
|
+
* This source code is licensed under the ISC license.
|
|
545
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
546
|
+
*/
|
|
547
|
+
const __iconNode$4 = [
|
|
548
|
+
[
|
|
549
|
+
"path",
|
|
550
|
+
{
|
|
551
|
+
d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",
|
|
552
|
+
key: "r04s7s"
|
|
553
|
+
}
|
|
554
|
+
]
|
|
555
|
+
];
|
|
556
|
+
const Star = createLucideIcon("star", __iconNode$4);
|
|
557
|
+
/**
|
|
558
|
+
* @license lucide-react v0.542.0 - ISC
|
|
559
|
+
*
|
|
560
|
+
* This source code is licensed under the ISC license.
|
|
561
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
562
|
+
*/
|
|
563
|
+
const __iconNode$3 = [
|
|
564
|
+
["path", { d: "M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6", key: "1528k5" }],
|
|
565
|
+
["path", { d: "M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7", key: "13ksps" }],
|
|
566
|
+
["path", { d: "M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1", key: "1n9rhb" }],
|
|
567
|
+
["path", { d: "M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1", key: "1mj8rg" }],
|
|
568
|
+
["path", { d: "M9 6v12", key: "velyjx" }]
|
|
569
|
+
];
|
|
570
|
+
const TextCursorInput = createLucideIcon("text-cursor-input", __iconNode$3);
|
|
571
|
+
/**
|
|
572
|
+
* @license lucide-react v0.542.0 - ISC
|
|
573
|
+
*
|
|
574
|
+
* This source code is licensed under the ISC license.
|
|
575
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
576
|
+
*/
|
|
577
|
+
const __iconNode$2 = [
|
|
578
|
+
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
579
|
+
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
580
|
+
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
581
|
+
];
|
|
582
|
+
const Trash = createLucideIcon("trash", __iconNode$2);
|
|
583
|
+
/**
|
|
584
|
+
* @license lucide-react v0.542.0 - ISC
|
|
585
|
+
*
|
|
586
|
+
* This source code is licensed under the ISC license.
|
|
587
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
588
|
+
*/
|
|
589
|
+
const __iconNode$1 = [
|
|
590
|
+
["path", { d: "M12 3v12", key: "1x0j5s" }],
|
|
591
|
+
["path", { d: "m17 8-5-5-5 5", key: "7q97r8" }],
|
|
592
|
+
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }]
|
|
593
|
+
];
|
|
594
|
+
const Upload = createLucideIcon("upload", __iconNode$1);
|
|
595
|
+
/**
|
|
596
|
+
* @license lucide-react v0.542.0 - ISC
|
|
597
|
+
*
|
|
598
|
+
* This source code is licensed under the ISC license.
|
|
599
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
600
|
+
*/
|
|
601
|
+
const __iconNode = [
|
|
602
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
603
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
604
|
+
];
|
|
605
|
+
const X = createLucideIcon("x", __iconNode);
|
|
8
606
|
const FileCard = React.memo(
|
|
9
607
|
React.forwardRef((props, ref) => {
|
|
10
608
|
const { file, className, error, rightSlot, ...rest } = props;
|
|
11
609
|
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Card, { className: classVarianceAuthority.cx(className, "flex w-full items-center gap-2 text-sm"), ref, ...rest, children: [
|
|
12
|
-
error ? /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
610
|
+
error ? /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: FileQuestionMark }) : /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: File$1, color: "var(--base-a11)" }),
|
|
13
611
|
!error ? file ? /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: "truncate", children: file.name }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Spinner, {}) }) : /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { accentColor: "danger", className: "truncate", children: error }),
|
|
14
612
|
rightSlot
|
|
15
613
|
] });
|
|
@@ -67,12 +665,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
67
665
|
}
|
|
68
666
|
class BaseField extends BaseFormElement {
|
|
69
667
|
constructor(options) {
|
|
70
|
-
const { label, description = null, required, image,
|
|
668
|
+
const { label, description = null, required, image, ...base } = options;
|
|
71
669
|
super(base);
|
|
72
670
|
__publicField(this, "label");
|
|
73
671
|
__publicField(this, "description");
|
|
74
672
|
__publicField(this, "required");
|
|
75
|
-
__publicField(this, "fieldValidators");
|
|
76
673
|
__publicField(this, "image");
|
|
77
674
|
/**
|
|
78
675
|
* By default, validation doesn't execute on `onChange` events when editing fields
|
|
@@ -85,7 +682,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
85
682
|
this.description = description;
|
|
86
683
|
this.required = required;
|
|
87
684
|
this.image = image;
|
|
88
|
-
this.fieldValidators = fieldValidators;
|
|
89
685
|
}
|
|
90
686
|
getError(value) {
|
|
91
687
|
if (this.required && this.isValueBlank(value)) {
|
|
@@ -111,24 +707,22 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
111
707
|
label: this.label,
|
|
112
708
|
description: this.description,
|
|
113
709
|
required: this.required,
|
|
114
|
-
image: this.image
|
|
115
|
-
fieldValidators: this.fieldValidators
|
|
710
|
+
image: this.image
|
|
116
711
|
};
|
|
117
712
|
}
|
|
118
713
|
setOptions(options) {
|
|
119
|
-
const { label, description = null, required, image,
|
|
714
|
+
const { label, description = null, required, image, ...base } = options;
|
|
120
715
|
this.label = label ?? this.label;
|
|
121
716
|
this.description = description ?? this.description;
|
|
122
717
|
this.required = required ?? this.required;
|
|
123
718
|
this.image = image ?? this.image;
|
|
124
|
-
this.fieldValidators = fieldValidators ?? this.fieldValidators;
|
|
125
719
|
super.setOptions(base);
|
|
126
720
|
}
|
|
127
721
|
isValueBlank(value) {
|
|
128
722
|
return this.areValuesEqual(value, this.blankValue());
|
|
129
723
|
}
|
|
130
724
|
getFieldValidators() {
|
|
131
|
-
return [
|
|
725
|
+
return [];
|
|
132
726
|
}
|
|
133
727
|
}
|
|
134
728
|
__publicField(BaseField, "fieldTypeName");
|
|
@@ -172,15 +766,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
172
766
|
variant: "ghost",
|
|
173
767
|
children: [
|
|
174
768
|
/* @__PURE__ */ jsxRuntime.jsxs(blocks.Tooltip.Root, { children: [
|
|
175
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Tooltip.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { onClick: handleCopy, "aria-label": "copy to clipboard", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
769
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Tooltip.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { onClick: handleCopy, "aria-label": "copy to clipboard", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Copy }) }) }),
|
|
176
770
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.Tooltip.Content, { size: "sm", children: "Copy" })
|
|
177
771
|
] }),
|
|
178
772
|
/* @__PURE__ */ jsxRuntime.jsxs(blocks.Tooltip.Root, { children: [
|
|
179
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Tooltip.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { onClick: handleDownload, "aria-label": "download", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
773
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Tooltip.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { onClick: handleDownload, "aria-label": "download", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Download }) }) }),
|
|
180
774
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.Tooltip.Content, { size: "sm", children: "Download" })
|
|
181
775
|
] }),
|
|
182
776
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.Separator, { orientation: "vertical", size: "sm" }),
|
|
183
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Overlay.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { onClick: onClose, "aria-label": "close", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
777
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Overlay.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { onClick: onClose, "aria-label": "close", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: X }) }) })
|
|
184
778
|
]
|
|
185
779
|
}
|
|
186
780
|
),
|
|
@@ -219,7 +813,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
219
813
|
] });
|
|
220
814
|
});
|
|
221
815
|
ImageViewerProvider.displayName = "FileViewerProvider";
|
|
222
|
-
const InputWithLabel = (props) => {
|
|
816
|
+
const InputWithLabel = React.memo((props) => {
|
|
223
817
|
const { className, label, children, severity, inputId, labelId, image } = props;
|
|
224
818
|
const [resolvedImage, setResolvedImage] = React.useState(void 0);
|
|
225
819
|
const openImageViewer = useImageViewer();
|
|
@@ -251,7 +845,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
251
845
|
!!label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: classVarianceAuthority.cx(className, "w-max max-w-full"), htmlFor: inputId, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { accentColor: color, size: "sm", id: labelId, className: "text-wrap", children: label }) }),
|
|
252
846
|
children
|
|
253
847
|
] });
|
|
254
|
-
};
|
|
848
|
+
});
|
|
255
849
|
const InputWithLabelAndHelpText = (props) => {
|
|
256
850
|
const { children, ...restProps } = props;
|
|
257
851
|
return /* @__PURE__ */ jsxRuntime.jsx(InputWithHelpText, { ...restProps, children });
|
|
@@ -278,14 +872,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
278
872
|
const label = field.required ? `${field.label} *` : field.label;
|
|
279
873
|
const fieldPropsWithValidation = React.useMemo(() => {
|
|
280
874
|
const handleChange = (value) => {
|
|
281
|
-
helpers.setValue(value, false)
|
|
875
|
+
void helpers.setValue(value, false);
|
|
282
876
|
onValuesChange == null ? void 0 : onValuesChange(field.identifier, value);
|
|
283
877
|
if (touched || !field.onlyValidateAfterTouched) {
|
|
284
878
|
helpers.setError(field.getError(value));
|
|
285
879
|
}
|
|
286
880
|
};
|
|
287
881
|
const handleBlur = (value) => {
|
|
288
|
-
void helpers.setTouched(true, false)
|
|
882
|
+
void helpers.setTouched(true, false);
|
|
289
883
|
helpers.setError(field.getError(value));
|
|
290
884
|
};
|
|
291
885
|
return {
|
|
@@ -418,7 +1012,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
418
1012
|
"aria-label": "Add option",
|
|
419
1013
|
disabled: !!internalError || disabled,
|
|
420
1014
|
onClick: addOption,
|
|
421
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
1015
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Plus })
|
|
422
1016
|
}
|
|
423
1017
|
)
|
|
424
1018
|
] })
|
|
@@ -465,7 +1059,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
465
1059
|
onClick: () => {
|
|
466
1060
|
handleDeleteOption(index);
|
|
467
1061
|
},
|
|
468
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
1062
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: X })
|
|
469
1063
|
}
|
|
470
1064
|
)
|
|
471
1065
|
]
|
|
@@ -653,7 +1247,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
653
1247
|
accentColor: "primary",
|
|
654
1248
|
variant: "surface",
|
|
655
1249
|
disabled,
|
|
656
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Checkbox.Indicator, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
1250
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Checkbox.Indicator, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Check }) })
|
|
657
1251
|
}
|
|
658
1252
|
)
|
|
659
1253
|
}
|
|
@@ -682,7 +1276,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
682
1276
|
});
|
|
683
1277
|
}
|
|
684
1278
|
static deserialize(data) {
|
|
685
|
-
if (data.type !== "boolean") throw new Error("Type mismatch.");
|
|
686
1279
|
return new _BooleanField(data);
|
|
687
1280
|
}
|
|
688
1281
|
serializeValue(value) {
|
|
@@ -795,8 +1388,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
795
1388
|
description: "Minimum value",
|
|
796
1389
|
integers: true,
|
|
797
1390
|
required: false,
|
|
798
|
-
identifier: `${path}minimum
|
|
799
|
-
fieldValidators: []
|
|
1391
|
+
identifier: `${path}minimum`
|
|
800
1392
|
}),
|
|
801
1393
|
showDirectly: false
|
|
802
1394
|
},
|
|
@@ -806,8 +1398,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
806
1398
|
description: "Maximum value",
|
|
807
1399
|
integers: true,
|
|
808
1400
|
required: false,
|
|
809
|
-
identifier: `${path}maximum
|
|
810
|
-
fieldValidators: []
|
|
1401
|
+
identifier: `${path}maximum`
|
|
811
1402
|
}),
|
|
812
1403
|
showDirectly: false
|
|
813
1404
|
},
|
|
@@ -932,7 +1523,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
932
1523
|
identifier: `${path}minimum_length`,
|
|
933
1524
|
minimum: 0,
|
|
934
1525
|
maximum: 100,
|
|
935
|
-
fieldValidators: [],
|
|
936
1526
|
integers: true
|
|
937
1527
|
}),
|
|
938
1528
|
showDirectly: false
|
|
@@ -946,7 +1536,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
946
1536
|
minimum: 1,
|
|
947
1537
|
maximum: LONG_TEXT_FIELD_MAX_LENGTH,
|
|
948
1538
|
// TODO: depends on short vs long text
|
|
949
|
-
fieldValidators: [],
|
|
950
1539
|
// TODO: default: 500 (see: "Short text fields can hold up to 500 characters on a single line.")
|
|
951
1540
|
integers: true
|
|
952
1541
|
}),
|
|
@@ -1049,7 +1638,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1049
1638
|
onValuesChange: handleChange,
|
|
1050
1639
|
disabled,
|
|
1051
1640
|
children: field.options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex gap-2 items-center min-w-0", children: [
|
|
1052
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.CheckboxGroup.Item, { value: option.value, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.CheckboxGroup.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
1641
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.CheckboxGroup.Item, { value: option.value, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.CheckboxGroup.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Check }) }) }),
|
|
1053
1642
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "sm", accentColor: "base", className: "truncate", children: option.label })
|
|
1054
1643
|
] }, `${inputId}-${option.value}-${index}`))
|
|
1055
1644
|
}
|
|
@@ -1151,7 +1740,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1151
1740
|
month: "2-digit",
|
|
1152
1741
|
day: "2-digit"
|
|
1153
1742
|
}) : "yyyy-mm-dd",
|
|
1154
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
1743
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: ChevronDown })
|
|
1155
1744
|
]
|
|
1156
1745
|
}
|
|
1157
1746
|
) }),
|
|
@@ -1262,13 +1851,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1262
1851
|
disabled,
|
|
1263
1852
|
children: [
|
|
1264
1853
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: value && value.length > 0 ? value.join(", ") : field.placeholder ?? "Select one or more..." }),
|
|
1265
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
1854
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: ChevronDown })
|
|
1266
1855
|
]
|
|
1267
1856
|
}
|
|
1268
1857
|
) }),
|
|
1269
1858
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Scroll, { children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.MultiSelectGroup, { values: value, onValuesChange: handleChange, children: [
|
|
1270
1859
|
/* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.SelectAllItem, { children: [
|
|
1271
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.CheckboxItemIndicator, { children: (indeterminate) => indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
1860
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.CheckboxItemIndicator, { children: (indeterminate) => indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Minus }) : /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Check }) }),
|
|
1272
1861
|
"Select all"
|
|
1273
1862
|
] }),
|
|
1274
1863
|
field.options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1276,7 +1865,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1276
1865
|
{
|
|
1277
1866
|
value: option.value,
|
|
1278
1867
|
children: [
|
|
1279
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.SelectedIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
1868
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.SelectedIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Check }) }),
|
|
1280
1869
|
option.label
|
|
1281
1870
|
]
|
|
1282
1871
|
},
|
|
@@ -1382,12 +1971,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1382
1971
|
disabled,
|
|
1383
1972
|
children: [
|
|
1384
1973
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: currentOption ? currentOption.label : field.placeholder ?? "Select one..." }),
|
|
1385
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
1974
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: ChevronDown })
|
|
1386
1975
|
]
|
|
1387
1976
|
}
|
|
1388
1977
|
) }),
|
|
1389
1978
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Scroll, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.SelectGroup, { required: false, value: value ?? void 0, onValueChange: handleChange, children: field.options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.SelectItem, { value: option.value, children: [
|
|
1390
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.SelectedIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
1979
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.SelectedIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Check }) }),
|
|
1391
1980
|
option.label
|
|
1392
1981
|
] }, `${inputId}-${option.value}-${index}`)) }) }) })
|
|
1393
1982
|
] })
|
|
@@ -1473,17 +2062,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1473
2062
|
},
|
|
1474
2063
|
[field, helpers, touched]
|
|
1475
2064
|
);
|
|
1476
|
-
const handleBlur = React.useCallback(
|
|
1477
|
-
(
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
return;
|
|
1481
|
-
}
|
|
1482
|
-
onChange(internalValue);
|
|
1483
|
-
onBlur(internalValue);
|
|
1484
|
-
},
|
|
1485
|
-
[inputUuids, internalValue, onBlur, onChange]
|
|
1486
|
-
);
|
|
2065
|
+
const handleBlur = React.useCallback(() => {
|
|
2066
|
+
onChange(internalValue);
|
|
2067
|
+
onBlur(internalValue);
|
|
2068
|
+
}, [internalValue, onBlur, onChange]);
|
|
1487
2069
|
return /* @__PURE__ */ jsxRuntime.jsx(InputWithLabelAndHelpText, { helpText: computedHelpText, severity, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1488
2070
|
InputWithLabel,
|
|
1489
2071
|
{
|
|
@@ -1513,8 +2095,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1513
2095
|
accentColor: "base",
|
|
1514
2096
|
variant: "surface",
|
|
1515
2097
|
size: "sm",
|
|
2098
|
+
onBlur: handleBlur,
|
|
1516
2099
|
children: [
|
|
1517
|
-
inputUuids.map((inputUuid) => /* @__PURE__ */ jsxRuntime.jsx(blocks.OneTimePasswordField.Input, { id: inputUuid
|
|
2100
|
+
inputUuids.map((inputUuid) => /* @__PURE__ */ jsxRuntime.jsx(blocks.OneTimePasswordField.Input, { id: inputUuid }, inputUuid)),
|
|
1518
2101
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.OneTimePasswordField.HiddenInput, {})
|
|
1519
2102
|
]
|
|
1520
2103
|
}
|
|
@@ -1544,8 +2127,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1544
2127
|
required: false,
|
|
1545
2128
|
minimum: 1,
|
|
1546
2129
|
maximum: 16,
|
|
1547
|
-
identifier: `${path}length
|
|
1548
|
-
fieldValidators: []
|
|
2130
|
+
identifier: `${path}length`
|
|
1549
2131
|
}),
|
|
1550
2132
|
showDirectly: false
|
|
1551
2133
|
},
|
|
@@ -1581,7 +2163,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1581
2163
|
const validators = super.getFieldValidators();
|
|
1582
2164
|
const length = this.length;
|
|
1583
2165
|
validators.push((value) => {
|
|
1584
|
-
if (!this.isValueBlank(value) &&
|
|
2166
|
+
if (!this.isValueBlank(value) && value.length != length) {
|
|
1585
2167
|
return `Must be ${length} characters.`;
|
|
1586
2168
|
}
|
|
1587
2169
|
});
|
|
@@ -1641,6 +2223,565 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1641
2223
|
__publicField(_OTPField, "fieldTypeName", "OTP");
|
|
1642
2224
|
__publicField(_OTPField, "fieldTypeDescription", "Allows specifying a number within a given range.");
|
|
1643
2225
|
let OTPField = _OTPField;
|
|
2226
|
+
const passFailFieldStatusMapping = {
|
|
2227
|
+
pass: {
|
|
2228
|
+
label: "Pass",
|
|
2229
|
+
icon: CircleCheck
|
|
2230
|
+
},
|
|
2231
|
+
fail: {
|
|
2232
|
+
label: "Fail",
|
|
2233
|
+
icon: CircleX
|
|
2234
|
+
},
|
|
2235
|
+
na: {
|
|
2236
|
+
label: "N/A",
|
|
2237
|
+
icon: CircleQuestionMark
|
|
2238
|
+
}
|
|
2239
|
+
};
|
|
2240
|
+
const passFailFieldStatuses = Object.keys(passFailFieldStatusMapping);
|
|
2241
|
+
class UUIDFile extends File {
|
|
2242
|
+
constructor(uuid2, ...args) {
|
|
2243
|
+
super(...args);
|
|
2244
|
+
__publicField(this, "uuid");
|
|
2245
|
+
this.uuid = uuid2;
|
|
2246
|
+
}
|
|
2247
|
+
static from(uuid2, file) {
|
|
2248
|
+
return new UUIDFile(uuid2, [file], file.name, {
|
|
2249
|
+
lastModified: file.lastModified,
|
|
2250
|
+
type: file.type
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
class UUIDPromise extends Promise {
|
|
2255
|
+
constructor(executor, uuid2) {
|
|
2256
|
+
super(executor);
|
|
2257
|
+
__publicField(this, "_uuid");
|
|
2258
|
+
this._uuid = uuid2;
|
|
2259
|
+
}
|
|
2260
|
+
get uuid() {
|
|
2261
|
+
return this._uuid;
|
|
2262
|
+
}
|
|
2263
|
+
set uuid(uuid2) {
|
|
2264
|
+
this._uuid = uuid2;
|
|
2265
|
+
}
|
|
2266
|
+
static from(promise, uuid2) {
|
|
2267
|
+
return new UUIDPromise((resolve, reject) => {
|
|
2268
|
+
Promise.resolve(promise).then(resolve).catch(reject);
|
|
2269
|
+
}, uuid2);
|
|
2270
|
+
}
|
|
2271
|
+
// oxlint-disable-next-line no-thenable
|
|
2272
|
+
then(onFulfilled, onRejected) {
|
|
2273
|
+
const promise = super.then(onFulfilled, onRejected);
|
|
2274
|
+
promise.uuid = this.uuid;
|
|
2275
|
+
return promise;
|
|
2276
|
+
}
|
|
2277
|
+
catch(onRejected) {
|
|
2278
|
+
const promise = super.catch(onRejected);
|
|
2279
|
+
promise.uuid = this.uuid;
|
|
2280
|
+
return promise;
|
|
2281
|
+
}
|
|
2282
|
+
finally(onFinally) {
|
|
2283
|
+
const promise = super.finally(onFinally);
|
|
2284
|
+
promise.uuid = this.uuid;
|
|
2285
|
+
return promise;
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
function isFileAndPromiseArray(value) {
|
|
2289
|
+
if (!Array.isArray(value)) return false;
|
|
2290
|
+
return value.every((item) => item instanceof UUIDPromise || item instanceof UUIDFile);
|
|
2291
|
+
}
|
|
2292
|
+
function areFileAndPromiseArraysEqual(value1, value2) {
|
|
2293
|
+
if (!value1.every((promise1) => value2.some((promise2) => promise1.uuid === promise2.uuid))) return false;
|
|
2294
|
+
if (!value2.every((promise2) => value1.some((promise1) => promise1.uuid === promise2.uuid))) return false;
|
|
2295
|
+
return true;
|
|
2296
|
+
}
|
|
2297
|
+
const ImageCard = React.memo(
|
|
2298
|
+
React.forwardRef((props, forwardedRef) => {
|
|
2299
|
+
const { file, alt, error, rightSlot, className, ...rest } = props;
|
|
2300
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2301
|
+
blocks.Card,
|
|
2302
|
+
{
|
|
2303
|
+
className: classVarianceAuthority.cx(className, "relative flex h-[200px] w-full flex-col gap-2 overflow-hidden items-center"),
|
|
2304
|
+
ref: forwardedRef,
|
|
2305
|
+
...rest,
|
|
2306
|
+
children: [
|
|
2307
|
+
!file && !error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 grow flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Spinner, {}) }),
|
|
2308
|
+
!!file && !error && /* @__PURE__ */ jsxRuntime.jsx(blocks.Card, { className: "flex max-w-full grow items-center !p-0 justify-center overflow-hidden bg-clip-padding", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2309
|
+
"img",
|
|
2310
|
+
{
|
|
2311
|
+
className: "max-w-full object-cover",
|
|
2312
|
+
src: URL.createObjectURL(file),
|
|
2313
|
+
alt: alt ?? file.name
|
|
2314
|
+
}
|
|
2315
|
+
) }),
|
|
2316
|
+
(!!file || !!error) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2317
|
+
"div",
|
|
2318
|
+
{
|
|
2319
|
+
className: classVarianceAuthority.cx("flex w-full items-center gap-2 self-end", {
|
|
2320
|
+
"bg-transparent": !file
|
|
2321
|
+
}),
|
|
2322
|
+
children: [
|
|
2323
|
+
error ? /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: FileWarning }) : file && /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: File$1 }),
|
|
2324
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: "truncate", size: "sm", children: error ?? (file == null ? void 0 : file.name) }),
|
|
2325
|
+
rightSlot
|
|
2326
|
+
]
|
|
2327
|
+
}
|
|
2328
|
+
)
|
|
2329
|
+
]
|
|
2330
|
+
}
|
|
2331
|
+
);
|
|
2332
|
+
})
|
|
2333
|
+
);
|
|
2334
|
+
const convertBytesToLargestUnit = (bytes) => {
|
|
2335
|
+
const units = ["byte", "kilobyte", "megabyte"];
|
|
2336
|
+
let sizeInUnit = bytes;
|
|
2337
|
+
let unitIndex = 0;
|
|
2338
|
+
while (sizeInUnit > 1e3 && unitIndex < units.length - 1) {
|
|
2339
|
+
sizeInUnit /= 1e3;
|
|
2340
|
+
unitIndex++;
|
|
2341
|
+
}
|
|
2342
|
+
const formatter = new Intl.NumberFormat([], {
|
|
2343
|
+
// 0 for bytes and kilobytes, 1 for megabytes
|
|
2344
|
+
maximumFractionDigits: Math.max(0, unitIndex - 1),
|
|
2345
|
+
style: "unit",
|
|
2346
|
+
unit: units[unitIndex]
|
|
2347
|
+
});
|
|
2348
|
+
return formatter.format(sizeInUnit);
|
|
2349
|
+
};
|
|
2350
|
+
const DisplayFile = React.memo((props) => {
|
|
2351
|
+
const { file, onRemove, disabled } = props;
|
|
2352
|
+
const [resolvedFile, setResolvedFile] = React.useState(null);
|
|
2353
|
+
const [error, setError] = React.useState(null);
|
|
2354
|
+
const openImageViewer = useImageViewer();
|
|
2355
|
+
const { url, name } = React.useMemo(() => {
|
|
2356
|
+
let url2 = null;
|
|
2357
|
+
let name2;
|
|
2358
|
+
let size;
|
|
2359
|
+
if (resolvedFile == null ? void 0 : resolvedFile.type.startsWith("image/")) {
|
|
2360
|
+
url2 = URL.createObjectURL(resolvedFile);
|
|
2361
|
+
}
|
|
2362
|
+
if (resolvedFile) {
|
|
2363
|
+
name2 = resolvedFile.name;
|
|
2364
|
+
size = convertBytesToLargestUnit(resolvedFile.size);
|
|
2365
|
+
} else {
|
|
2366
|
+
name2 = "Downloading...";
|
|
2367
|
+
size = "...";
|
|
2368
|
+
}
|
|
2369
|
+
return { url: url2, name: name2, size };
|
|
2370
|
+
}, [resolvedFile]);
|
|
2371
|
+
React.useEffect(() => {
|
|
2372
|
+
if (file instanceof UUIDPromise) {
|
|
2373
|
+
file.then((file2) => {
|
|
2374
|
+
setResolvedFile(file2);
|
|
2375
|
+
}).catch((err) => {
|
|
2376
|
+
setError(err instanceof Error ? err.message : "Unknown error");
|
|
2377
|
+
});
|
|
2378
|
+
} else {
|
|
2379
|
+
setResolvedFile(file);
|
|
2380
|
+
}
|
|
2381
|
+
}, [file]);
|
|
2382
|
+
const handleDownload = React.useCallback(
|
|
2383
|
+
(event) => {
|
|
2384
|
+
event.stopPropagation();
|
|
2385
|
+
if (!resolvedFile) {
|
|
2386
|
+
throw new Error("Cannot download a file that is not resolved.");
|
|
2387
|
+
}
|
|
2388
|
+
const blob = new Blob([resolvedFile]);
|
|
2389
|
+
fileSaver.saveAs(blob, name);
|
|
2390
|
+
},
|
|
2391
|
+
[name, resolvedFile]
|
|
2392
|
+
);
|
|
2393
|
+
const handleDelete = React.useCallback(
|
|
2394
|
+
(e) => {
|
|
2395
|
+
e.stopPropagation();
|
|
2396
|
+
onRemove();
|
|
2397
|
+
},
|
|
2398
|
+
[onRemove]
|
|
2399
|
+
);
|
|
2400
|
+
const handleImageCardClick = React.useCallback(() => {
|
|
2401
|
+
if (!resolvedFile) return;
|
|
2402
|
+
openImageViewer((closeFileViewer) => ({
|
|
2403
|
+
file: resolvedFile,
|
|
2404
|
+
onDelete: !disabled ? () => {
|
|
2405
|
+
onRemove();
|
|
2406
|
+
closeFileViewer();
|
|
2407
|
+
} : void 0
|
|
2408
|
+
}));
|
|
2409
|
+
}, [disabled, onRemove, openImageViewer, resolvedFile]);
|
|
2410
|
+
const rightSlotContent = React.useMemo(
|
|
2411
|
+
() => /* @__PURE__ */ jsxRuntime.jsxs(blocks.ButtonGroup, { className: "flex grow justify-end", variant: "ghost", accentColor: "base", size: "sm", children: [
|
|
2412
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2413
|
+
blocks.IconButton,
|
|
2414
|
+
{
|
|
2415
|
+
"aria-label": `Download ${name}`,
|
|
2416
|
+
type: "button",
|
|
2417
|
+
onClick: handleDownload,
|
|
2418
|
+
disabled: !resolvedFile,
|
|
2419
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Download })
|
|
2420
|
+
}
|
|
2421
|
+
),
|
|
2422
|
+
!disabled && /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", "aria-label": `Remove ${name}`, disabled, onClick: handleDelete, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Trash }) })
|
|
2423
|
+
] }),
|
|
2424
|
+
[disabled, handleDelete, handleDownload, name, resolvedFile]
|
|
2425
|
+
);
|
|
2426
|
+
return url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2427
|
+
ImageCard,
|
|
2428
|
+
{
|
|
2429
|
+
className: "cursor-pointer",
|
|
2430
|
+
onClick: handleImageCardClick,
|
|
2431
|
+
file: resolvedFile,
|
|
2432
|
+
error: error ?? void 0,
|
|
2433
|
+
rightSlot: rightSlotContent
|
|
2434
|
+
}
|
|
2435
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(FileCard, { file: resolvedFile, error: error ?? void 0, rightSlot: rightSlotContent });
|
|
2436
|
+
});
|
|
2437
|
+
DisplayFile.displayName = "DisplayFile";
|
|
2438
|
+
const PassFailInput = React.memo((props) => {
|
|
2439
|
+
const [
|
|
2440
|
+
{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps, touched, helpers },
|
|
2441
|
+
{ disabled }
|
|
2442
|
+
] = useFormikInput(props);
|
|
2443
|
+
const { value, onChange, onBlur, name } = fieldProps;
|
|
2444
|
+
const [internalNotes, setInternalNotes] = React.useState("");
|
|
2445
|
+
const input = React.useRef(null);
|
|
2446
|
+
const computedHelpText = showInputOnly ? null : helpText;
|
|
2447
|
+
const computedLabel = showInputOnly ? "" : label;
|
|
2448
|
+
const showNotesAndFiles = value.status && field.showNotesAndFilesOn.includes(value.status);
|
|
2449
|
+
const handleStatusChange = React.useCallback(
|
|
2450
|
+
(status) => {
|
|
2451
|
+
const newValue = field.cleanValue({
|
|
2452
|
+
...value,
|
|
2453
|
+
status
|
|
2454
|
+
});
|
|
2455
|
+
onChange(newValue);
|
|
2456
|
+
onBlur(newValue);
|
|
2457
|
+
},
|
|
2458
|
+
[field, onBlur, onChange, value]
|
|
2459
|
+
);
|
|
2460
|
+
React.useEffect(() => {
|
|
2461
|
+
setInternalNotes(value.notes);
|
|
2462
|
+
}, [value]);
|
|
2463
|
+
const handleNotesChange = React.useCallback(
|
|
2464
|
+
(e) => {
|
|
2465
|
+
const notes = e.target.value;
|
|
2466
|
+
setInternalNotes(notes);
|
|
2467
|
+
if (touched || !field.onlyValidateAfterTouched) {
|
|
2468
|
+
helpers.setError(
|
|
2469
|
+
field.getError({
|
|
2470
|
+
...value,
|
|
2471
|
+
notes: internalNotes
|
|
2472
|
+
})
|
|
2473
|
+
);
|
|
2474
|
+
}
|
|
2475
|
+
},
|
|
2476
|
+
[field, helpers, internalNotes, touched, value]
|
|
2477
|
+
);
|
|
2478
|
+
const handleNotesBlur = React.useCallback(() => {
|
|
2479
|
+
const newValue = {
|
|
2480
|
+
...value,
|
|
2481
|
+
notes: internalNotes
|
|
2482
|
+
};
|
|
2483
|
+
onChange(newValue);
|
|
2484
|
+
onBlur(newValue);
|
|
2485
|
+
}, [internalNotes, onBlur, onChange, value]);
|
|
2486
|
+
const handleRemoveFile = React.useCallback(
|
|
2487
|
+
(index) => {
|
|
2488
|
+
const files = [...value.files];
|
|
2489
|
+
void files.splice(index, 1);
|
|
2490
|
+
onChange({
|
|
2491
|
+
...value,
|
|
2492
|
+
files
|
|
2493
|
+
});
|
|
2494
|
+
},
|
|
2495
|
+
[onChange, value]
|
|
2496
|
+
);
|
|
2497
|
+
const handleFileButtonClick = React.useCallback(() => {
|
|
2498
|
+
var _a2;
|
|
2499
|
+
(_a2 = input.current) == null ? void 0 : _a2.click();
|
|
2500
|
+
}, []);
|
|
2501
|
+
const handleFilesChange = React.useCallback(
|
|
2502
|
+
(e) => {
|
|
2503
|
+
const files = Array.from(e.target.files ?? []).map((file) => UUIDFile.from(uuid.v4(), file));
|
|
2504
|
+
const newValue = {
|
|
2505
|
+
...value,
|
|
2506
|
+
files: [...value.files, ...files]
|
|
2507
|
+
};
|
|
2508
|
+
onChange(newValue);
|
|
2509
|
+
onBlur(newValue);
|
|
2510
|
+
},
|
|
2511
|
+
[onBlur, onChange, value]
|
|
2512
|
+
);
|
|
2513
|
+
React.useEffect(() => {
|
|
2514
|
+
if (!input.current) return;
|
|
2515
|
+
const abortController = new AbortController();
|
|
2516
|
+
input.current.addEventListener(
|
|
2517
|
+
"cancel",
|
|
2518
|
+
() => {
|
|
2519
|
+
onBlur(value);
|
|
2520
|
+
},
|
|
2521
|
+
{
|
|
2522
|
+
signal: abortController.signal
|
|
2523
|
+
}
|
|
2524
|
+
);
|
|
2525
|
+
return () => {
|
|
2526
|
+
abortController.abort();
|
|
2527
|
+
};
|
|
2528
|
+
}, [onBlur, value]);
|
|
2529
|
+
const statusInputId = `${inputId}-status`;
|
|
2530
|
+
const notesInputId = `${inputId}-notes`;
|
|
2531
|
+
const filesInputId = `${inputId}-files`;
|
|
2532
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InputWithLabelAndHelpText, { helpText: computedHelpText, severity, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2533
|
+
InputWithLabel,
|
|
2534
|
+
{
|
|
2535
|
+
size,
|
|
2536
|
+
severity,
|
|
2537
|
+
inputId,
|
|
2538
|
+
labelId,
|
|
2539
|
+
label: computedLabel,
|
|
2540
|
+
image: showInputOnly ? void 0 : field.image,
|
|
2541
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
2542
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2543
|
+
blocks.RadioGroup.Root,
|
|
2544
|
+
{
|
|
2545
|
+
id: statusInputId,
|
|
2546
|
+
className: "flex gap-2",
|
|
2547
|
+
name,
|
|
2548
|
+
value: value.status,
|
|
2549
|
+
disabled,
|
|
2550
|
+
accentColor: "base",
|
|
2551
|
+
variant: "surface",
|
|
2552
|
+
size: "sm",
|
|
2553
|
+
onValueChange: handleStatusChange,
|
|
2554
|
+
children: passFailFieldStatuses.map((status) => {
|
|
2555
|
+
const { label: label2 } = passFailFieldStatusMapping[status];
|
|
2556
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex gap-2 items-center min-w-0", children: [
|
|
2557
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.RadioGroup.Item, { value: status, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RadioGroup.Indicator, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Circle, className: "fill-current" }) }) }),
|
|
2558
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "sm", accentColor: "base", className: "truncate", children: label2 })
|
|
2559
|
+
] }, `${inputId}-${status}`);
|
|
2560
|
+
})
|
|
2561
|
+
}
|
|
2562
|
+
),
|
|
2563
|
+
showNotesAndFiles && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2564
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2565
|
+
blocks.TextArea,
|
|
2566
|
+
{
|
|
2567
|
+
id: notesInputId,
|
|
2568
|
+
value: internalNotes,
|
|
2569
|
+
name,
|
|
2570
|
+
onChange: handleNotesChange,
|
|
2571
|
+
onBlur: handleNotesBlur,
|
|
2572
|
+
className: "field-sizing-content w-full min-h-12",
|
|
2573
|
+
placeholder: "Notes",
|
|
2574
|
+
resize: "vertical",
|
|
2575
|
+
accentColor: "base",
|
|
2576
|
+
variant: "surface",
|
|
2577
|
+
size: "sm",
|
|
2578
|
+
disabled
|
|
2579
|
+
}
|
|
2580
|
+
) }),
|
|
2581
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
2582
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2583
|
+
blocks.Button,
|
|
2584
|
+
{
|
|
2585
|
+
className: "w-max",
|
|
2586
|
+
size: "sm",
|
|
2587
|
+
variant: "soft",
|
|
2588
|
+
accentColor: "base",
|
|
2589
|
+
onClick: handleFileButtonClick,
|
|
2590
|
+
type: "button",
|
|
2591
|
+
disabled,
|
|
2592
|
+
children: [
|
|
2593
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Upload }),
|
|
2594
|
+
"Select files"
|
|
2595
|
+
]
|
|
2596
|
+
}
|
|
2597
|
+
),
|
|
2598
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2599
|
+
"input",
|
|
2600
|
+
{
|
|
2601
|
+
id: filesInputId,
|
|
2602
|
+
name,
|
|
2603
|
+
type: "file",
|
|
2604
|
+
ref: input,
|
|
2605
|
+
multiple: true,
|
|
2606
|
+
className: "hidden",
|
|
2607
|
+
onChange: handleFilesChange,
|
|
2608
|
+
value: ""
|
|
2609
|
+
}
|
|
2610
|
+
),
|
|
2611
|
+
value.files.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-max flex-col gap-2", children: value.files.map((file, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2612
|
+
DisplayFile,
|
|
2613
|
+
{
|
|
2614
|
+
file,
|
|
2615
|
+
onRemove: () => {
|
|
2616
|
+
handleRemoveFile(index);
|
|
2617
|
+
},
|
|
2618
|
+
disabled
|
|
2619
|
+
},
|
|
2620
|
+
index
|
|
2621
|
+
)) })
|
|
2622
|
+
] })
|
|
2623
|
+
] })
|
|
2624
|
+
] })
|
|
2625
|
+
}
|
|
2626
|
+
) });
|
|
2627
|
+
});
|
|
2628
|
+
PassFailInput.displayName = "PassFailInput";
|
|
2629
|
+
const isPassFailFieldStatus = (value) => {
|
|
2630
|
+
return typeof value === "string" && passFailFieldStatuses.includes(value);
|
|
2631
|
+
};
|
|
2632
|
+
const isSerializedPassFailFieldValue = (value) => {
|
|
2633
|
+
if (value === null || typeof value !== "object") return false;
|
|
2634
|
+
if (!("status" in value) || !isPassFailFieldStatus(value.status)) return false;
|
|
2635
|
+
if (!("notes" in value) || !(typeof value.notes === "string")) return false;
|
|
2636
|
+
if (!("files" in value) || !(Array.isArray(value.files) && value.files.length === 0)) return false;
|
|
2637
|
+
return true;
|
|
2638
|
+
};
|
|
2639
|
+
const isPassFailFieldValue = (value) => {
|
|
2640
|
+
if (value === null || typeof value !== "object") return false;
|
|
2641
|
+
if (!("status" in value) || !isPassFailFieldStatus(value.status)) return false;
|
|
2642
|
+
if (!("notes" in value) || !(typeof value.notes === "string")) return false;
|
|
2643
|
+
if (!("files" in value) || !isFileAndPromiseArray(value.files)) return false;
|
|
2644
|
+
return true;
|
|
2645
|
+
};
|
|
2646
|
+
const serializePassFailFieldValue = (value) => {
|
|
2647
|
+
return {
|
|
2648
|
+
status: value.status,
|
|
2649
|
+
notes: value.notes,
|
|
2650
|
+
files: []
|
|
2651
|
+
};
|
|
2652
|
+
};
|
|
2653
|
+
const deserializePassFailFieldValue = (value) => {
|
|
2654
|
+
return {
|
|
2655
|
+
status: value.status,
|
|
2656
|
+
notes: value.notes,
|
|
2657
|
+
files: []
|
|
2658
|
+
};
|
|
2659
|
+
};
|
|
2660
|
+
const arePassFieldValuesEqual = (value1, value2) => {
|
|
2661
|
+
if (value1.status !== value2.status) return false;
|
|
2662
|
+
if (value1.notes !== value2.notes) return false;
|
|
2663
|
+
if (!areFileAndPromiseArraysEqual(value1.files, value2.files)) return false;
|
|
2664
|
+
return true;
|
|
2665
|
+
};
|
|
2666
|
+
const _PassFailField = class _PassFailField extends BaseField {
|
|
2667
|
+
constructor(options) {
|
|
2668
|
+
const { showNotesAndFilesOn, ...rest } = options;
|
|
2669
|
+
super(rest);
|
|
2670
|
+
__publicField(this, "type", "pass-fail");
|
|
2671
|
+
__publicField(this, "onlyValidateAfterTouched", false);
|
|
2672
|
+
__publicField(this, "showNotesAndFilesOn");
|
|
2673
|
+
this.showNotesAndFilesOn = showNotesAndFilesOn;
|
|
2674
|
+
}
|
|
2675
|
+
static getFieldCreationSchema(parentPath = "") {
|
|
2676
|
+
const path = parentPath && `${parentPath}.`;
|
|
2677
|
+
return [
|
|
2678
|
+
{
|
|
2679
|
+
field: new MultiSelectField({
|
|
2680
|
+
identifier: `${path}showNotesAndFilesOn`,
|
|
2681
|
+
label: "Show notes and files on",
|
|
2682
|
+
description: "Show the notes and files on desired statuses.",
|
|
2683
|
+
options: passFailFieldStatuses.map((status) => {
|
|
2684
|
+
const { label } = passFailFieldStatusMapping[status];
|
|
2685
|
+
return {
|
|
2686
|
+
value: status,
|
|
2687
|
+
label
|
|
2688
|
+
};
|
|
2689
|
+
}),
|
|
2690
|
+
required: false
|
|
2691
|
+
}),
|
|
2692
|
+
showDirectly: false
|
|
2693
|
+
}
|
|
2694
|
+
];
|
|
2695
|
+
}
|
|
2696
|
+
serialize() {
|
|
2697
|
+
return {
|
|
2698
|
+
...super.serialize(),
|
|
2699
|
+
showNotesAndFilesOn: this.showNotesAndFilesOn
|
|
2700
|
+
};
|
|
2701
|
+
}
|
|
2702
|
+
getOptions() {
|
|
2703
|
+
return {
|
|
2704
|
+
...super.getOptions(),
|
|
2705
|
+
showNotesAndFilesOn: this.showNotesAndFilesOn
|
|
2706
|
+
};
|
|
2707
|
+
}
|
|
2708
|
+
duplicate(identifier) {
|
|
2709
|
+
return new _PassFailField({
|
|
2710
|
+
...this.getOptions(),
|
|
2711
|
+
identifier
|
|
2712
|
+
});
|
|
2713
|
+
}
|
|
2714
|
+
setOptions(options) {
|
|
2715
|
+
const { showNotesAndFilesOn, ...rest } = options;
|
|
2716
|
+
this.showNotesAndFilesOn = showNotesAndFilesOn ?? this.showNotesAndFilesOn;
|
|
2717
|
+
super.setOptions(rest);
|
|
2718
|
+
}
|
|
2719
|
+
getFieldValidators() {
|
|
2720
|
+
const validators = super.getFieldValidators();
|
|
2721
|
+
const showNotesAndFileOn = this.showNotesAndFilesOn;
|
|
2722
|
+
const blankValue = this.blankValue();
|
|
2723
|
+
if (showNotesAndFileOn.length > 0) {
|
|
2724
|
+
validators.push((value) => {
|
|
2725
|
+
if (!value.status || !showNotesAndFileOn.includes(value.status)) return;
|
|
2726
|
+
if (blankValue.notes === value.notes) {
|
|
2727
|
+
return "Notes is required.";
|
|
2728
|
+
}
|
|
2729
|
+
});
|
|
2730
|
+
validators.push((value) => {
|
|
2731
|
+
if (!value.status || !showNotesAndFileOn.includes(value.status)) return;
|
|
2732
|
+
if (areFileAndPromiseArraysEqual(blankValue.files, value.files)) {
|
|
2733
|
+
return "Files is required.";
|
|
2734
|
+
}
|
|
2735
|
+
});
|
|
2736
|
+
}
|
|
2737
|
+
return validators;
|
|
2738
|
+
}
|
|
2739
|
+
static deserialize(data) {
|
|
2740
|
+
return new _PassFailField({
|
|
2741
|
+
...data,
|
|
2742
|
+
showNotesAndFilesOn: data.showNotesAndFilesOn ?? false
|
|
2743
|
+
});
|
|
2744
|
+
}
|
|
2745
|
+
serializeValue(value) {
|
|
2746
|
+
return serializePassFailFieldValue(value);
|
|
2747
|
+
}
|
|
2748
|
+
deserializeValue(value) {
|
|
2749
|
+
return deserializePassFailFieldValue(value);
|
|
2750
|
+
}
|
|
2751
|
+
render(props) {
|
|
2752
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PassFailInput, { field: this, ...props });
|
|
2753
|
+
}
|
|
2754
|
+
isSerializedValueValid(value) {
|
|
2755
|
+
return isSerializedPassFailFieldValue(value);
|
|
2756
|
+
}
|
|
2757
|
+
isValueValid(value) {
|
|
2758
|
+
return isPassFailFieldValue(value);
|
|
2759
|
+
}
|
|
2760
|
+
areValuesEqual(value1, value2) {
|
|
2761
|
+
return arePassFieldValuesEqual(value1, value2);
|
|
2762
|
+
}
|
|
2763
|
+
blankValue() {
|
|
2764
|
+
return {
|
|
2765
|
+
status: null,
|
|
2766
|
+
notes: "",
|
|
2767
|
+
files: []
|
|
2768
|
+
};
|
|
2769
|
+
}
|
|
2770
|
+
cleanValue(value) {
|
|
2771
|
+
if (value.status && this.showNotesAndFilesOn.includes(value.status)) {
|
|
2772
|
+
return value;
|
|
2773
|
+
} else {
|
|
2774
|
+
return {
|
|
2775
|
+
status: value.status,
|
|
2776
|
+
notes: "",
|
|
2777
|
+
files: []
|
|
2778
|
+
};
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
};
|
|
2782
|
+
__publicField(_PassFailField, "fieldTypeName", "Pass - Fail");
|
|
2783
|
+
__publicField(_PassFailField, "fieldTypeDescription", "Track pass, fail, or N/A outcome.");
|
|
2784
|
+
let PassFailField = _PassFailField;
|
|
1644
2785
|
const RadioInput = React.memo((props) => {
|
|
1645
2786
|
const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, { disabled }] = useFormikInput(props);
|
|
1646
2787
|
const { name, onChange, onBlur, value } = fieldProps;
|
|
@@ -1666,68 +2807,207 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1666
2807
|
labelId,
|
|
1667
2808
|
label: computedLabel,
|
|
1668
2809
|
image: showInputOnly ? void 0 : field.image,
|
|
1669
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1670
|
-
blocks.RadioGroup.Root,
|
|
1671
|
-
{
|
|
1672
|
-
id: inputId,
|
|
1673
|
-
name,
|
|
1674
|
-
className: "flex flex-col gap-1",
|
|
1675
|
-
accentColor: "base",
|
|
1676
|
-
variant: "surface",
|
|
1677
|
-
size: "sm",
|
|
1678
|
-
value: value ?? "",
|
|
1679
|
-
onValueChange: handleChange,
|
|
1680
|
-
disabled,
|
|
1681
|
-
children: [
|
|
1682
|
-
field.options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex gap-2 items-center min-w-0", children: [
|
|
1683
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.RadioGroup.Item, { value: option.value, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RadioGroup.Indicator, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
1684
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "sm", accentColor: "base", className: "truncate", children: option.label })
|
|
1685
|
-
] }, `${inputId}-${option.value}-${index}`)),
|
|
1686
|
-
!!value && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1687
|
-
blocks.Button,
|
|
2810
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2811
|
+
blocks.RadioGroup.Root,
|
|
2812
|
+
{
|
|
2813
|
+
id: inputId,
|
|
2814
|
+
name,
|
|
2815
|
+
className: "flex flex-col gap-1",
|
|
2816
|
+
accentColor: "base",
|
|
2817
|
+
variant: "surface",
|
|
2818
|
+
size: "sm",
|
|
2819
|
+
value: value ?? "",
|
|
2820
|
+
onValueChange: handleChange,
|
|
2821
|
+
disabled,
|
|
2822
|
+
children: [
|
|
2823
|
+
field.options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex gap-2 items-center min-w-0", children: [
|
|
2824
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.RadioGroup.Item, { value: option.value, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RadioGroup.Indicator, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Circle, className: "fill-current" }) }) }),
|
|
2825
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "sm", accentColor: "base", className: "truncate", children: option.label })
|
|
2826
|
+
] }, `${inputId}-${option.value}-${index}`)),
|
|
2827
|
+
!!value && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2828
|
+
blocks.Button,
|
|
2829
|
+
{
|
|
2830
|
+
onClick: handleClear,
|
|
2831
|
+
className: "w-max -mx-2",
|
|
2832
|
+
type: "button",
|
|
2833
|
+
variant: "ghost",
|
|
2834
|
+
accentColor: "base",
|
|
2835
|
+
size: "sm",
|
|
2836
|
+
children: [
|
|
2837
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: X }),
|
|
2838
|
+
"Clear"
|
|
2839
|
+
]
|
|
2840
|
+
}
|
|
2841
|
+
)
|
|
2842
|
+
]
|
|
2843
|
+
}
|
|
2844
|
+
)
|
|
2845
|
+
}
|
|
2846
|
+
) });
|
|
2847
|
+
});
|
|
2848
|
+
RadioInput.displayName = "SelectInput";
|
|
2849
|
+
const _RadioField = class _RadioField extends BaseOptionsField {
|
|
2850
|
+
constructor(options) {
|
|
2851
|
+
super(options);
|
|
2852
|
+
__publicField(this, "type", "radio");
|
|
2853
|
+
__publicField(this, "onlyValidateAfterTouched", false);
|
|
2854
|
+
}
|
|
2855
|
+
serialize() {
|
|
2856
|
+
return super.serialize();
|
|
2857
|
+
}
|
|
2858
|
+
getOptions() {
|
|
2859
|
+
return super.getOptions();
|
|
2860
|
+
}
|
|
2861
|
+
duplicate(identifier) {
|
|
2862
|
+
return new _RadioField({
|
|
2863
|
+
...this.getOptions(),
|
|
2864
|
+
identifier
|
|
2865
|
+
});
|
|
2866
|
+
}
|
|
2867
|
+
setOptions(options) {
|
|
2868
|
+
super.setOptions(options);
|
|
2869
|
+
}
|
|
2870
|
+
static deserialize(data) {
|
|
2871
|
+
return new _RadioField(data);
|
|
2872
|
+
}
|
|
2873
|
+
serializeValue(value) {
|
|
2874
|
+
return value;
|
|
2875
|
+
}
|
|
2876
|
+
deserializeValue(value) {
|
|
2877
|
+
return value;
|
|
2878
|
+
}
|
|
2879
|
+
render(props) {
|
|
2880
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadioInput, { field: this, ...props });
|
|
2881
|
+
}
|
|
2882
|
+
isSerializedValueValid(value) {
|
|
2883
|
+
return typeof value === "string" || value === "null";
|
|
2884
|
+
}
|
|
2885
|
+
isValueValid(value) {
|
|
2886
|
+
return typeof value === "string" || value === "null";
|
|
2887
|
+
}
|
|
2888
|
+
blankValue() {
|
|
2889
|
+
return null;
|
|
2890
|
+
}
|
|
2891
|
+
areValuesEqual(value1, value2) {
|
|
2892
|
+
return value1 === value2;
|
|
2893
|
+
}
|
|
2894
|
+
};
|
|
2895
|
+
__publicField(_RadioField, "fieldTypeName", "Option list");
|
|
2896
|
+
__publicField(_RadioField, "fieldTypeDescription", "Allows the user to select a single option from a list of options.");
|
|
2897
|
+
let RadioField = _RadioField;
|
|
2898
|
+
const RatingInput = React.memo((props) => {
|
|
2899
|
+
const [{ inputId, labelId, size, severity, showInputOnly, field, helpText, label, fieldProps }, { disabled }] = useFormikInput(props);
|
|
2900
|
+
const { name, onChange, onBlur, value } = fieldProps;
|
|
2901
|
+
const computedHelpText = showInputOnly ? null : helpText;
|
|
2902
|
+
const computedLabel = showInputOnly ? "" : label;
|
|
2903
|
+
const handleChange = React.useCallback(
|
|
2904
|
+
(value2) => {
|
|
2905
|
+
onChange(value2);
|
|
2906
|
+
onBlur(value2);
|
|
2907
|
+
},
|
|
2908
|
+
[onBlur, onChange]
|
|
2909
|
+
);
|
|
2910
|
+
const handleClear = React.useCallback(() => {
|
|
2911
|
+
onChange(null);
|
|
2912
|
+
onBlur(null);
|
|
2913
|
+
}, [onBlur, onChange]);
|
|
2914
|
+
const ratingOptions = Array.from({ length: field.maxRating }, (_, i) => i + 1);
|
|
2915
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InputWithLabelAndHelpText, { helpText: computedHelpText, severity, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2916
|
+
InputWithLabel,
|
|
2917
|
+
{
|
|
2918
|
+
size,
|
|
2919
|
+
severity,
|
|
2920
|
+
inputId,
|
|
2921
|
+
labelId,
|
|
2922
|
+
label: computedLabel,
|
|
2923
|
+
image: showInputOnly ? void 0 : field.image,
|
|
2924
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-1 items-center", children: [
|
|
2925
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2926
|
+
blocks.Rating.Root,
|
|
2927
|
+
{
|
|
2928
|
+
id: inputId,
|
|
2929
|
+
name,
|
|
2930
|
+
className: "flex items-center gap-0.5",
|
|
2931
|
+
value,
|
|
2932
|
+
onValueChange: handleChange,
|
|
2933
|
+
disabled,
|
|
2934
|
+
children: ratingOptions.map((rating) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2935
|
+
blocks.Rating.Item,
|
|
1688
2936
|
{
|
|
1689
|
-
|
|
1690
|
-
className: "
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
}
|
|
1700
|
-
)
|
|
1701
|
-
]
|
|
1702
|
-
}
|
|
1703
|
-
)
|
|
2937
|
+
value: rating,
|
|
2938
|
+
className: "group size-7 flex cursor-pointer disabled:opacity-50 disabled:pointer-events-none items-center justify-center text-yellow-500 transition-colors",
|
|
2939
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Star, className: "group-data-[active=true]:fill-current size-full" })
|
|
2940
|
+
},
|
|
2941
|
+
`${inputId}-${rating}`
|
|
2942
|
+
))
|
|
2943
|
+
}
|
|
2944
|
+
),
|
|
2945
|
+
!disabled && value !== null && /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { onClick: handleClear, type: "button", variant: "ghost", accentColor: "base", size: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: X }) })
|
|
2946
|
+
] })
|
|
1704
2947
|
}
|
|
1705
2948
|
) });
|
|
1706
2949
|
});
|
|
1707
|
-
|
|
1708
|
-
const
|
|
2950
|
+
RatingInput.displayName = "RatingInput";
|
|
2951
|
+
const _RatingField = class _RatingField extends BaseField {
|
|
1709
2952
|
constructor(options) {
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
__publicField(this, "
|
|
2953
|
+
const { maxRating, ...rest } = options;
|
|
2954
|
+
super(rest);
|
|
2955
|
+
__publicField(this, "type", "rating");
|
|
2956
|
+
__publicField(this, "maxRating");
|
|
2957
|
+
this.maxRating = maxRating;
|
|
2958
|
+
}
|
|
2959
|
+
static getFieldCreationSchema(parentPath = "") {
|
|
2960
|
+
const path = parentPath && `${parentPath}.`;
|
|
2961
|
+
return [
|
|
2962
|
+
{
|
|
2963
|
+
field: new NumberField({
|
|
2964
|
+
label: "Max Rating",
|
|
2965
|
+
description: "Maximum rating value",
|
|
2966
|
+
integers: true,
|
|
2967
|
+
required: false,
|
|
2968
|
+
minimum: 1,
|
|
2969
|
+
maximum: 10,
|
|
2970
|
+
identifier: `${path}maxRating`
|
|
2971
|
+
}),
|
|
2972
|
+
showDirectly: false
|
|
2973
|
+
}
|
|
2974
|
+
];
|
|
2975
|
+
}
|
|
2976
|
+
getFieldValidators() {
|
|
2977
|
+
const validators = super.getFieldValidators();
|
|
2978
|
+
const max = this.maxRating;
|
|
2979
|
+
validators.push((value) => {
|
|
2980
|
+
if (typeof value === "number" && (value < 1 || value > max)) {
|
|
2981
|
+
return `Rating must be between 1 and ${max}.`;
|
|
2982
|
+
}
|
|
2983
|
+
});
|
|
2984
|
+
return validators;
|
|
1713
2985
|
}
|
|
1714
2986
|
serialize() {
|
|
1715
|
-
return
|
|
2987
|
+
return {
|
|
2988
|
+
...super.serialize(),
|
|
2989
|
+
maxRating: this.maxRating
|
|
2990
|
+
};
|
|
1716
2991
|
}
|
|
1717
2992
|
getOptions() {
|
|
1718
|
-
return
|
|
2993
|
+
return {
|
|
2994
|
+
...super.getOptions(),
|
|
2995
|
+
maxRating: this.maxRating
|
|
2996
|
+
};
|
|
1719
2997
|
}
|
|
1720
2998
|
duplicate(identifier) {
|
|
1721
|
-
return new
|
|
2999
|
+
return new _RatingField({
|
|
1722
3000
|
...this.getOptions(),
|
|
1723
3001
|
identifier
|
|
1724
3002
|
});
|
|
1725
3003
|
}
|
|
1726
3004
|
setOptions(options) {
|
|
1727
|
-
|
|
3005
|
+
const { maxRating, ...rest } = options;
|
|
3006
|
+
this.maxRating = maxRating ?? this.maxRating;
|
|
3007
|
+
super.setOptions(rest);
|
|
1728
3008
|
}
|
|
1729
3009
|
static deserialize(data) {
|
|
1730
|
-
return new
|
|
3010
|
+
return new _RatingField(data);
|
|
1731
3011
|
}
|
|
1732
3012
|
serializeValue(value) {
|
|
1733
3013
|
return value;
|
|
@@ -1736,24 +3016,24 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1736
3016
|
return value;
|
|
1737
3017
|
}
|
|
1738
3018
|
render(props) {
|
|
1739
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3019
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RatingInput, { field: this, ...props });
|
|
1740
3020
|
}
|
|
1741
3021
|
isSerializedValueValid(value) {
|
|
1742
|
-
return typeof value === "
|
|
3022
|
+
return typeof value === "number" || value === null;
|
|
1743
3023
|
}
|
|
1744
3024
|
isValueValid(value) {
|
|
1745
|
-
return typeof value === "
|
|
1746
|
-
}
|
|
1747
|
-
blankValue() {
|
|
1748
|
-
return null;
|
|
3025
|
+
return typeof value === "number" || value === null;
|
|
1749
3026
|
}
|
|
1750
3027
|
areValuesEqual(value1, value2) {
|
|
1751
3028
|
return value1 === value2;
|
|
1752
3029
|
}
|
|
3030
|
+
blankValue() {
|
|
3031
|
+
return null;
|
|
3032
|
+
}
|
|
1753
3033
|
};
|
|
1754
|
-
__publicField(
|
|
1755
|
-
__publicField(
|
|
1756
|
-
let
|
|
3034
|
+
__publicField(_RatingField, "fieldTypeName", "Rating");
|
|
3035
|
+
__publicField(_RatingField, "fieldTypeDescription", "Allows users to select a rating value.");
|
|
3036
|
+
let RatingField = _RatingField;
|
|
1757
3037
|
const ScannerContext = React.createContext(() => {
|
|
1758
3038
|
throw new Error("No ScannerProvider found");
|
|
1759
3039
|
});
|
|
@@ -24080,7 +25360,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
24080
25360
|
return PDF417CodewordDecoder2;
|
|
24081
25361
|
}()
|
|
24082
25362
|
);
|
|
24083
|
-
const global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
|
|
24084
25363
|
var PDF417ResultMetadata = (
|
|
24085
25364
|
/** @class */
|
|
24086
25365
|
function() {
|
|
@@ -24375,8 +25654,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
24375
25654
|
if (typeof window !== "undefined") {
|
|
24376
25655
|
return window["BigInt"] || null;
|
|
24377
25656
|
}
|
|
24378
|
-
if (typeof global
|
|
24379
|
-
return global
|
|
25657
|
+
if (typeof global !== "undefined") {
|
|
25658
|
+
return global["BigInt"] || null;
|
|
24380
25659
|
}
|
|
24381
25660
|
if (typeof self !== "undefined") {
|
|
24382
25661
|
return self["BigInt"] || null;
|
|
@@ -29870,7 +31149,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
29870
31149
|
]
|
|
29871
31150
|
]);
|
|
29872
31151
|
const Scanner = React.memo((props) => {
|
|
29873
|
-
const {
|
|
31152
|
+
const {
|
|
31153
|
+
children,
|
|
31154
|
+
open,
|
|
31155
|
+
onOpenChange,
|
|
31156
|
+
// oxlint-disable-line unbound-method
|
|
31157
|
+
defaultOpen,
|
|
31158
|
+
modal,
|
|
31159
|
+
...rest
|
|
31160
|
+
} = props;
|
|
29874
31161
|
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Overlay.Root, { open, onOpenChange, defaultOpen, modal, children: [
|
|
29875
31162
|
!!children && /* @__PURE__ */ jsxRuntime.jsx(blocks.Overlay.Trigger, { asChild: true, children }),
|
|
29876
31163
|
/* @__PURE__ */ jsxRuntime.jsxs(blocks.Overlay.Content, { children: [
|
|
@@ -29892,7 +31179,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
29892
31179
|
hints: SCANNER_HINTS
|
|
29893
31180
|
});
|
|
29894
31181
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex size-full flex-col justify-center overflow-hidden bg-(--color-background)", children: [
|
|
29895
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full justify-end p-4", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Overlay.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { "aria-label": "close", variant: "soft", accentColor: "base", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
31182
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full justify-end p-4", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Overlay.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { "aria-label": "close", variant: "soft", accentColor: "base", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: X }) }) }) }),
|
|
29896
31183
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grow w-full max-h-full overflow-hidden p-4", children: /* @__PURE__ */ jsxRuntime.jsx("video", { className: "size-full", ref }) })
|
|
29897
31184
|
] });
|
|
29898
31185
|
});
|
|
@@ -29999,7 +31286,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
29999
31286
|
accentColor: "base",
|
|
30000
31287
|
disabled,
|
|
30001
31288
|
children: [
|
|
30002
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
31289
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Maximize }),
|
|
30003
31290
|
"Scan"
|
|
30004
31291
|
]
|
|
30005
31292
|
}
|
|
@@ -30137,7 +31424,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
30137
31424
|
super.setOptions(options);
|
|
30138
31425
|
}
|
|
30139
31426
|
static deserialize(data) {
|
|
30140
|
-
if (data.type !== "string") throw new Error("Type mismatch.");
|
|
30141
31427
|
const { maximum_length, minimum_length, ...rest } = data;
|
|
30142
31428
|
return new _StringField({
|
|
30143
31429
|
...rest,
|
|
@@ -30247,107 +31533,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
30247
31533
|
__publicField(_TextField, "fieldTypeName", "Paragraph");
|
|
30248
31534
|
__publicField(_TextField, "fieldTypeDescription", `Paragraph fields can hold up to ${LONG_TEXT_FIELD_MAX_LENGTH} characters and can have multiple lines.`);
|
|
30249
31535
|
let TextField = _TextField;
|
|
30250
|
-
const ImageCard = React.memo(
|
|
30251
|
-
React.forwardRef((props, forwardedRef) => {
|
|
30252
|
-
const { file, alt, error, rightSlot, className, ...rest } = props;
|
|
30253
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30254
|
-
blocks.Card,
|
|
30255
|
-
{
|
|
30256
|
-
className: classVarianceAuthority.cx(className, "relative flex h-[200px] w-full flex-col gap-2 overflow-hidden items-center"),
|
|
30257
|
-
ref: forwardedRef,
|
|
30258
|
-
...rest,
|
|
30259
|
-
children: [
|
|
30260
|
-
!file && !error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 grow flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Spinner, {}) }),
|
|
30261
|
-
!!file && !error && /* @__PURE__ */ jsxRuntime.jsx(blocks.Card, { className: "flex max-w-full grow items-center !p-0 justify-center overflow-hidden bg-clip-padding", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30262
|
-
"img",
|
|
30263
|
-
{
|
|
30264
|
-
className: "max-w-full object-cover",
|
|
30265
|
-
src: URL.createObjectURL(file),
|
|
30266
|
-
alt: alt ?? file.name
|
|
30267
|
-
}
|
|
30268
|
-
) }),
|
|
30269
|
-
(!!file || !!error) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30270
|
-
"div",
|
|
30271
|
-
{
|
|
30272
|
-
className: classVarianceAuthority.cx("flex w-full items-center gap-2 self-end", {
|
|
30273
|
-
"bg-transparent": !file
|
|
30274
|
-
}),
|
|
30275
|
-
children: [
|
|
30276
|
-
error ? /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: "file-warning" }) : file && /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: "file" }),
|
|
30277
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: "truncate", size: "sm", children: error ?? (file == null ? void 0 : file.name) }),
|
|
30278
|
-
rightSlot
|
|
30279
|
-
]
|
|
30280
|
-
}
|
|
30281
|
-
)
|
|
30282
|
-
]
|
|
30283
|
-
}
|
|
30284
|
-
);
|
|
30285
|
-
})
|
|
30286
|
-
);
|
|
30287
|
-
class UUIDPromise extends Promise {
|
|
30288
|
-
constructor(executor, uuid2) {
|
|
30289
|
-
super(executor);
|
|
30290
|
-
__publicField(this, "_uuid");
|
|
30291
|
-
this._uuid = uuid2;
|
|
30292
|
-
}
|
|
30293
|
-
get uuid() {
|
|
30294
|
-
return this._uuid;
|
|
30295
|
-
}
|
|
30296
|
-
set uuid(uuid2) {
|
|
30297
|
-
this._uuid = uuid2;
|
|
30298
|
-
}
|
|
30299
|
-
static from(promise, uuid2) {
|
|
30300
|
-
return new UUIDPromise((resolve, reject) => {
|
|
30301
|
-
Promise.resolve(promise).then(resolve).catch(reject);
|
|
30302
|
-
}, uuid2);
|
|
30303
|
-
}
|
|
30304
|
-
then(onFulfilled, onRejected) {
|
|
30305
|
-
const promise = super.then(onFulfilled, onRejected);
|
|
30306
|
-
promise.uuid = this.uuid;
|
|
30307
|
-
return promise;
|
|
30308
|
-
}
|
|
30309
|
-
catch(onRejected) {
|
|
30310
|
-
const promise = super.catch(onRejected);
|
|
30311
|
-
promise.uuid = this.uuid;
|
|
30312
|
-
return promise;
|
|
30313
|
-
}
|
|
30314
|
-
finally(onFinally) {
|
|
30315
|
-
const promise = super.finally(onFinally);
|
|
30316
|
-
promise.uuid = this.uuid;
|
|
30317
|
-
return promise;
|
|
30318
|
-
}
|
|
30319
|
-
}
|
|
30320
|
-
const convertBytesToLargestUnit = (bytes) => {
|
|
30321
|
-
const units = ["byte", "kilobyte", "megabyte"];
|
|
30322
|
-
let sizeInUnit = bytes;
|
|
30323
|
-
let unitIndex = 0;
|
|
30324
|
-
while (sizeInUnit > 1e3 && unitIndex < units.length - 1) {
|
|
30325
|
-
sizeInUnit /= 1e3;
|
|
30326
|
-
unitIndex++;
|
|
30327
|
-
}
|
|
30328
|
-
const formatter = new Intl.NumberFormat([], {
|
|
30329
|
-
// 0 for bytes and kilobytes, 1 for megabytes
|
|
30330
|
-
maximumFractionDigits: Math.max(0, unitIndex - 1),
|
|
30331
|
-
style: "unit",
|
|
30332
|
-
unit: units[unitIndex]
|
|
30333
|
-
});
|
|
30334
|
-
return formatter.format(sizeInUnit);
|
|
30335
|
-
};
|
|
30336
|
-
function areFilesEqual(file1, file2) {
|
|
30337
|
-
return file1.name === file2.name && file1.size === file2.size && file1.type === file2.type;
|
|
30338
|
-
}
|
|
30339
|
-
function separateFilesFromPromises(filesOrPromises) {
|
|
30340
|
-
const files = [];
|
|
30341
|
-
const promises = [];
|
|
30342
|
-
for (const fileOrPromise of filesOrPromises) {
|
|
30343
|
-
if (fileOrPromise instanceof UUIDPromise) {
|
|
30344
|
-
promises.push(fileOrPromise);
|
|
30345
|
-
} else {
|
|
30346
|
-
files.push(fileOrPromise);
|
|
30347
|
-
}
|
|
30348
|
-
}
|
|
30349
|
-
return [files, promises];
|
|
30350
|
-
}
|
|
30351
31536
|
const UploadInput = React.memo((props) => {
|
|
30352
31537
|
var _a2;
|
|
30353
31538
|
const [{ inputId, labelId, label, size, severity, helpText, showInputOnly, field, fieldProps }, { disabled }] = useFormikInput(props);
|
|
@@ -30372,7 +31557,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
30372
31557
|
onBlur([]);
|
|
30373
31558
|
return;
|
|
30374
31559
|
}
|
|
30375
|
-
const fileArray = Array.from(files);
|
|
31560
|
+
const fileArray = Array.from(files).map((file) => UUIDFile.from(uuid.v4(), file));
|
|
30376
31561
|
const newValue = [...value, ...fileArray];
|
|
30377
31562
|
onChange(newValue);
|
|
30378
31563
|
onBlur(newValue);
|
|
@@ -30380,7 +31565,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
30380
31565
|
const handleRemove = React.useCallback(
|
|
30381
31566
|
(index) => {
|
|
30382
31567
|
const files = [...value];
|
|
30383
|
-
files.splice(index, 1);
|
|
31568
|
+
void files.splice(index, 1);
|
|
30384
31569
|
onChange(files);
|
|
30385
31570
|
},
|
|
30386
31571
|
[value, onChange]
|
|
@@ -30427,7 +31612,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
30427
31612
|
type: "button",
|
|
30428
31613
|
disabled,
|
|
30429
31614
|
children: [
|
|
30430
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
31615
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Upload }),
|
|
30431
31616
|
buttonText
|
|
30432
31617
|
]
|
|
30433
31618
|
}
|
|
@@ -30452,7 +31637,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
30452
31637
|
Array.isArray(value) && value.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-max flex-col gap-2", children: value.map((file, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
30453
31638
|
DisplayFile,
|
|
30454
31639
|
{
|
|
30455
|
-
field,
|
|
30456
31640
|
file,
|
|
30457
31641
|
onRemove: () => {
|
|
30458
31642
|
handleRemove(index);
|
|
@@ -30464,92 +31648,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
30464
31648
|
] });
|
|
30465
31649
|
});
|
|
30466
31650
|
UploadInput.displayName = "UploadInput";
|
|
30467
|
-
const DisplayFile = React.memo((props) => {
|
|
30468
|
-
const { file, field, onRemove, disabled } = props;
|
|
30469
|
-
const [resolvedFile, setResolvedFile] = React.useState(null);
|
|
30470
|
-
const openImageViewer = useImageViewer();
|
|
30471
|
-
const error = React.useMemo(() => resolvedFile && field.getError([resolvedFile]), [field, resolvedFile]);
|
|
30472
|
-
const { url, name } = React.useMemo(() => {
|
|
30473
|
-
let url2 = null;
|
|
30474
|
-
let name2;
|
|
30475
|
-
let size;
|
|
30476
|
-
if (resolvedFile == null ? void 0 : resolvedFile.type.startsWith("image/")) {
|
|
30477
|
-
url2 = URL.createObjectURL(resolvedFile);
|
|
30478
|
-
}
|
|
30479
|
-
if (resolvedFile) {
|
|
30480
|
-
name2 = resolvedFile.name;
|
|
30481
|
-
size = convertBytesToLargestUnit(resolvedFile.size);
|
|
30482
|
-
} else {
|
|
30483
|
-
name2 = "Downloading...";
|
|
30484
|
-
size = "...";
|
|
30485
|
-
}
|
|
30486
|
-
return { url: url2, name: name2, size };
|
|
30487
|
-
}, [resolvedFile]);
|
|
30488
|
-
React.useEffect(() => {
|
|
30489
|
-
if (file instanceof UUIDPromise) {
|
|
30490
|
-
file.then((file2) => {
|
|
30491
|
-
setResolvedFile(file2);
|
|
30492
|
-
}).catch(console.error);
|
|
30493
|
-
} else {
|
|
30494
|
-
setResolvedFile(file);
|
|
30495
|
-
}
|
|
30496
|
-
}, [file]);
|
|
30497
|
-
const handleDownload = React.useCallback(
|
|
30498
|
-
(event) => {
|
|
30499
|
-
event.stopPropagation();
|
|
30500
|
-
if (!resolvedFile) {
|
|
30501
|
-
throw new Error("Cannot download a file that is not resolved.");
|
|
30502
|
-
}
|
|
30503
|
-
const blob = new Blob([resolvedFile]);
|
|
30504
|
-
fileSaver.saveAs(blob, name);
|
|
30505
|
-
},
|
|
30506
|
-
[name, resolvedFile]
|
|
30507
|
-
);
|
|
30508
|
-
const handleDelete = React.useCallback(
|
|
30509
|
-
(e) => {
|
|
30510
|
-
e.stopPropagation();
|
|
30511
|
-
onRemove();
|
|
30512
|
-
},
|
|
30513
|
-
[onRemove]
|
|
30514
|
-
);
|
|
30515
|
-
const handleImageCardClick = React.useCallback(() => {
|
|
30516
|
-
if (!resolvedFile) return;
|
|
30517
|
-
openImageViewer((closeFileViewer) => ({
|
|
30518
|
-
file: resolvedFile,
|
|
30519
|
-
onDelete: !disabled ? () => {
|
|
30520
|
-
onRemove();
|
|
30521
|
-
closeFileViewer();
|
|
30522
|
-
} : void 0
|
|
30523
|
-
}));
|
|
30524
|
-
}, [disabled, onRemove, openImageViewer, resolvedFile]);
|
|
30525
|
-
const rightSlotContent = React.useMemo(
|
|
30526
|
-
() => /* @__PURE__ */ jsxRuntime.jsxs(blocks.ButtonGroup, { className: "flex grow justify-end", variant: "ghost", accentColor: "base", size: "sm", children: [
|
|
30527
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30528
|
-
blocks.IconButton,
|
|
30529
|
-
{
|
|
30530
|
-
"aria-label": `Download ${name}`,
|
|
30531
|
-
type: "button",
|
|
30532
|
-
onClick: handleDownload,
|
|
30533
|
-
disabled: !resolvedFile,
|
|
30534
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: "download" })
|
|
30535
|
-
}
|
|
30536
|
-
),
|
|
30537
|
-
!disabled && /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", "aria-label": `Remove ${name}`, disabled, onClick: handleDelete, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: "trash" }) })
|
|
30538
|
-
] }),
|
|
30539
|
-
[disabled, handleDelete, handleDownload, name, resolvedFile]
|
|
30540
|
-
);
|
|
30541
|
-
return url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
30542
|
-
ImageCard,
|
|
30543
|
-
{
|
|
30544
|
-
className: "cursor-pointer",
|
|
30545
|
-
onClick: handleImageCardClick,
|
|
30546
|
-
file: resolvedFile,
|
|
30547
|
-
error: error ?? void 0,
|
|
30548
|
-
rightSlot: rightSlotContent
|
|
30549
|
-
}
|
|
30550
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(FileCard, { file: resolvedFile, error: error ?? void 0, rightSlot: rightSlotContent });
|
|
30551
|
-
});
|
|
30552
|
-
DisplayFile.displayName = "DisplayFile";
|
|
30553
31651
|
const _UploadField = class _UploadField extends BaseField {
|
|
30554
31652
|
constructor(options) {
|
|
30555
31653
|
const { extensions, maximum_files, maximum_size, ...base } = options;
|
|
@@ -30629,7 +31727,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
30629
31727
|
const maxFileSizeInB = maxFileSizeInMB * 1e3 * 1e3;
|
|
30630
31728
|
const maxFiles = this.maxFiles || 1;
|
|
30631
31729
|
validators.push((value) => {
|
|
30632
|
-
if (value && value.some((file) => file instanceof
|
|
31730
|
+
if (value && value.some((file) => file instanceof UUIDFile && file.size > maxFileSizeInB)) {
|
|
30633
31731
|
return `Files must be at most ${maxFileSizeInMB}MB.`;
|
|
30634
31732
|
}
|
|
30635
31733
|
});
|
|
@@ -30686,16 +31784,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
30686
31784
|
}
|
|
30687
31785
|
isValueValid(value) {
|
|
30688
31786
|
if (!Array.isArray(value)) return false;
|
|
30689
|
-
return value.every((item) => item instanceof UUIDPromise || item instanceof
|
|
31787
|
+
return value.every((item) => item instanceof UUIDPromise || item instanceof UUIDFile);
|
|
30690
31788
|
}
|
|
30691
31789
|
areValuesEqual(value1, value2) {
|
|
30692
|
-
|
|
30693
|
-
const [files2, promises2] = separateFilesFromPromises(value2);
|
|
30694
|
-
if (!files1.every((file1) => files2.some((file2) => areFilesEqual(file1, file2)))) return false;
|
|
30695
|
-
if (!files2.every((file2) => files1.some((file1) => areFilesEqual(file1, file2)))) return false;
|
|
30696
|
-
if (!promises1.every((promise1) => promises2.some((promise2) => promise1.uuid === promise2.uuid))) return false;
|
|
30697
|
-
if (!promises2.every((promise2) => promises1.some((promise1) => promise1.uuid === promise2.uuid))) return false;
|
|
30698
|
-
return true;
|
|
31790
|
+
return areFileAndPromiseArraysEqual(value1, value2);
|
|
30699
31791
|
}
|
|
30700
31792
|
blankValue() {
|
|
30701
31793
|
return [];
|
|
@@ -30717,23 +31809,27 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
30717
31809
|
"multi-select": MultiSelectField,
|
|
30718
31810
|
radio: RadioField,
|
|
30719
31811
|
"checkbox-list": CheckboxListField,
|
|
30720
|
-
|
|
31812
|
+
"pass-fail": PassFailField,
|
|
31813
|
+
otp: OTPField,
|
|
31814
|
+
rating: RatingField
|
|
30721
31815
|
};
|
|
30722
31816
|
const fieldIcons = {
|
|
30723
|
-
boolean:
|
|
30724
|
-
date:
|
|
30725
|
-
"multi-string":
|
|
30726
|
-
number:
|
|
30727
|
-
qr:
|
|
30728
|
-
"multi-select":
|
|
30729
|
-
select:
|
|
30730
|
-
string:
|
|
30731
|
-
text:
|
|
30732
|
-
upload:
|
|
30733
|
-
section:
|
|
30734
|
-
radio:
|
|
30735
|
-
"checkbox-list":
|
|
30736
|
-
|
|
31817
|
+
boolean: SquareCheck,
|
|
31818
|
+
date: Calendar,
|
|
31819
|
+
"multi-string": List,
|
|
31820
|
+
number: Hash,
|
|
31821
|
+
qr: Scan,
|
|
31822
|
+
"multi-select": ListChecks,
|
|
31823
|
+
select: ListTodo,
|
|
31824
|
+
string: TextCursorInput,
|
|
31825
|
+
text: AlignJustify,
|
|
31826
|
+
upload: Upload,
|
|
31827
|
+
section: LayoutPanelTop,
|
|
31828
|
+
radio: CircleDot,
|
|
31829
|
+
"checkbox-list": CopyCheck,
|
|
31830
|
+
"pass-fail": ClipboardList,
|
|
31831
|
+
otp: RectangleEllipsis,
|
|
31832
|
+
rating: Star
|
|
30737
31833
|
};
|
|
30738
31834
|
const maxFileSizeMB = 50;
|
|
30739
31835
|
const maxFileSizeKB = maxFileSizeMB * 1e3;
|
|
@@ -30940,6 +32036,42 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
30940
32036
|
serialize: (filterValue) => filterValue,
|
|
30941
32037
|
deserialize: (filterValue) => filterValue
|
|
30942
32038
|
});
|
|
32039
|
+
const PassFailEqualsConditionModifier = ConditionModifier.create({
|
|
32040
|
+
id: "pass-fail-equals",
|
|
32041
|
+
modifierFn: (value, filterValue) => {
|
|
32042
|
+
return value === filterValue;
|
|
32043
|
+
},
|
|
32044
|
+
label: "is",
|
|
32045
|
+
serialize: (filterValue) => filterValue,
|
|
32046
|
+
deserialize: (filterValue) => filterValue
|
|
32047
|
+
});
|
|
32048
|
+
const PassFailNotEqualsConditionModifier = ConditionModifier.create({
|
|
32049
|
+
id: "pass-fail-not-equals",
|
|
32050
|
+
modifierFn: (value, filterValue) => {
|
|
32051
|
+
return value !== filterValue;
|
|
32052
|
+
},
|
|
32053
|
+
label: "is not",
|
|
32054
|
+
serialize: (filterValue) => filterValue,
|
|
32055
|
+
deserialize: (filterValue) => filterValue
|
|
32056
|
+
});
|
|
32057
|
+
const PassFailArrayIncludesConditionModifier = ConditionModifier.create({
|
|
32058
|
+
id: "pass-fail-array-includes",
|
|
32059
|
+
modifierFn: (value, filterValue) => {
|
|
32060
|
+
return filterValue.includes(value);
|
|
32061
|
+
},
|
|
32062
|
+
label: "is any of",
|
|
32063
|
+
serialize: (filterValue) => filterValue,
|
|
32064
|
+
deserialize: (filterValue) => filterValue
|
|
32065
|
+
});
|
|
32066
|
+
const PassFailArrayExcludesConditionModifier = ConditionModifier.create({
|
|
32067
|
+
id: "pass-fail-array-excludes",
|
|
32068
|
+
modifierFn: (value, filterValue) => {
|
|
32069
|
+
return !filterValue.includes(value);
|
|
32070
|
+
},
|
|
32071
|
+
label: "is none of",
|
|
32072
|
+
serialize: (filterValue) => filterValue,
|
|
32073
|
+
deserialize: (filterValue) => filterValue
|
|
32074
|
+
});
|
|
30943
32075
|
const StringEqualsConditionModifier = ConditionModifier.create({
|
|
30944
32076
|
id: "nullable-string-equals",
|
|
30945
32077
|
modifierFn: (value, filterValue) => {
|
|
@@ -31079,9 +32211,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31079
32211
|
__publicField(this, "apply", (value) => {
|
|
31080
32212
|
const modifier = this.modifiers[this.conditionModifier];
|
|
31081
32213
|
const conditionValue = this.getConditionValue();
|
|
31082
|
-
if (conditionValue
|
|
31083
|
-
if (!modifier.
|
|
31084
|
-
|
|
32214
|
+
if (conditionValue == void 0) return true;
|
|
32215
|
+
if (!modifier.isConditionValueValid(conditionValue)) return true;
|
|
32216
|
+
const transformedValue = this.transformValue(value);
|
|
32217
|
+
if (!modifier.isValueValid(transformedValue)) return false;
|
|
32218
|
+
return modifier.modifier.modifierFn(transformedValue, conditionValue);
|
|
31085
32219
|
});
|
|
31086
32220
|
this.id = id;
|
|
31087
32221
|
this.field = field;
|
|
@@ -31097,6 +32231,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31097
32231
|
conditionModifier: this.conditionModifier
|
|
31098
32232
|
};
|
|
31099
32233
|
}
|
|
32234
|
+
transformValue(value) {
|
|
32235
|
+
return value;
|
|
32236
|
+
}
|
|
31100
32237
|
}
|
|
31101
32238
|
const formId = "form-builder";
|
|
31102
32239
|
const UNLABELLED_FIELD_LABEL = "Unlabelled";
|
|
@@ -31109,12 +32246,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31109
32246
|
if (typeof children === "function") {
|
|
31110
32247
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
31111
32248
|
children(meta),
|
|
31112
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.SelectedIndicator, { className: "ml-[auto]", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
32249
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.SelectedIndicator, { className: "ml-[auto]", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Check }) })
|
|
31113
32250
|
] });
|
|
31114
32251
|
} else {
|
|
31115
32252
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
31116
32253
|
children,
|
|
31117
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.SelectedIndicator, { className: "ml-[auto]", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
32254
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.SelectedIndicator, { className: "ml-[auto]", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Check }) })
|
|
31118
32255
|
] });
|
|
31119
32256
|
}
|
|
31120
32257
|
},
|
|
@@ -31129,12 +32266,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31129
32266
|
if (typeof children === "function") {
|
|
31130
32267
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
31131
32268
|
children(meta),
|
|
31132
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.SelectedIndicator, { className: "ml-auto", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
32269
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.SelectedIndicator, { className: "ml-auto", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Check }) })
|
|
31133
32270
|
] });
|
|
31134
32271
|
} else {
|
|
31135
32272
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
31136
32273
|
children,
|
|
31137
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.SelectedIndicator, { className: "ml-auto", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
32274
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.SelectedIndicator, { className: "ml-auto", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Check }) })
|
|
31138
32275
|
] });
|
|
31139
32276
|
}
|
|
31140
32277
|
},
|
|
@@ -31149,12 +32286,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31149
32286
|
if (typeof children === "function") {
|
|
31150
32287
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
31151
32288
|
children(meta),
|
|
31152
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.CheckboxItemIndicator, { className: "ml-[auto]", children: (indeterminate) => indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
32289
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.CheckboxItemIndicator, { className: "ml-[auto]", children: (indeterminate) => indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Minus }) : /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Check }) })
|
|
31153
32290
|
] });
|
|
31154
32291
|
} else {
|
|
31155
32292
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
31156
32293
|
children,
|
|
31157
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.CheckboxItemIndicator, { className: "ml-[auto]", children: (indeterminate) => indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
32294
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.CheckboxItemIndicator, { className: "ml-[auto]", children: (indeterminate) => indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Minus }) : /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Check }) })
|
|
31158
32295
|
] });
|
|
31159
32296
|
}
|
|
31160
32297
|
},
|
|
@@ -31248,7 +32385,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31248
32385
|
variant: "soft",
|
|
31249
32386
|
type: "button",
|
|
31250
32387
|
onClick: handleAddValueClick,
|
|
31251
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
32388
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Plus })
|
|
31252
32389
|
}
|
|
31253
32390
|
)
|
|
31254
32391
|
] }),
|
|
@@ -31271,7 +32408,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31271
32408
|
onClick: () => {
|
|
31272
32409
|
handleRemoveValueClick(index);
|
|
31273
32410
|
},
|
|
31274
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
32411
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: X })
|
|
31275
32412
|
}
|
|
31276
32413
|
)
|
|
31277
32414
|
]
|
|
@@ -31331,7 +32468,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31331
32468
|
const handleRemoveFilter = React.useCallback(() => {
|
|
31332
32469
|
onClick(condition);
|
|
31333
32470
|
}, [condition, onClick]);
|
|
31334
|
-
return /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { onClick: handleRemoveFilter, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
32471
|
+
return /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { onClick: handleRemoveFilter, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: X }) });
|
|
31335
32472
|
};
|
|
31336
32473
|
RemoveConditionButton.displayName = "RemoveConditionButton";
|
|
31337
32474
|
const SelectFieldOptionMultiSelectGroup = React.memo((props) => {
|
|
@@ -31446,7 +32583,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31446
32583
|
/* @__PURE__ */ jsxRuntime.jsx(RemoveConditionButton, { condition, onClick: onRemove })
|
|
31447
32584
|
] });
|
|
31448
32585
|
};
|
|
31449
|
-
const modifiers$
|
|
32586
|
+
const modifiers$e = {
|
|
31450
32587
|
equals: createConditionModifierConfig({
|
|
31451
32588
|
modifier: BooleanEqualsConditionModifier,
|
|
31452
32589
|
isValueValid: (_value) => true,
|
|
@@ -31463,13 +32600,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31463
32600
|
class BooleanFieldCondition extends BaseCondition {
|
|
31464
32601
|
constructor(options) {
|
|
31465
32602
|
super(options);
|
|
31466
|
-
__publicField(this, "
|
|
31467
|
-
__publicField(this, "defaultConditionValue");
|
|
31468
|
-
__publicField(this, "modifiers", modifiers$c);
|
|
32603
|
+
__publicField(this, "modifiers", modifiers$e);
|
|
31469
32604
|
}
|
|
31470
32605
|
static deserialize(serializedCondition, field) {
|
|
31471
32606
|
const { conditionValue, conditionModifier, ...rest } = serializedCondition;
|
|
31472
|
-
const modifierConfig = modifiers$
|
|
32607
|
+
const modifierConfig = modifiers$e[conditionModifier];
|
|
31473
32608
|
let deserializedValue = void 0;
|
|
31474
32609
|
if (conditionValue !== void 0) {
|
|
31475
32610
|
deserializedValue = modifierConfig.modifier.deserialize(conditionValue);
|
|
@@ -31525,7 +32660,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31525
32660
|
/* @__PURE__ */ jsxRuntime.jsx(RemoveConditionButton, { condition, onClick: onRemove })
|
|
31526
32661
|
] });
|
|
31527
32662
|
};
|
|
31528
|
-
const modifiers$
|
|
32663
|
+
const modifiers$d = {
|
|
31529
32664
|
equals: createConditionModifierConfig({
|
|
31530
32665
|
modifier: StringArrayEqualsConditionModifier,
|
|
31531
32666
|
isValueValid: (_value) => true,
|
|
@@ -31560,13 +32695,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31560
32695
|
class CheckboxListFieldCondition extends BaseCondition {
|
|
31561
32696
|
constructor(options) {
|
|
31562
32697
|
super(options);
|
|
31563
|
-
__publicField(this, "
|
|
31564
|
-
__publicField(this, "defaultConditionValue");
|
|
31565
|
-
__publicField(this, "modifiers", modifiers$b);
|
|
32698
|
+
__publicField(this, "modifiers", modifiers$d);
|
|
31566
32699
|
}
|
|
31567
32700
|
static deserialize(serializedCondition, field) {
|
|
31568
32701
|
const { conditionValue, conditionModifier, ...rest } = serializedCondition;
|
|
31569
|
-
const modifierConfig = modifiers$
|
|
32702
|
+
const modifierConfig = modifiers$d[conditionModifier];
|
|
31570
32703
|
const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? modifierConfig.modifier.deserialize(conditionValue) : void 0;
|
|
31571
32704
|
return new CheckboxListFieldCondition({ field, conditionModifier, conditionValue: deserializedValue, ...rest });
|
|
31572
32705
|
}
|
|
@@ -31641,7 +32774,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31641
32774
|
/* @__PURE__ */ jsxRuntime.jsx(RemoveConditionButton, { condition, onClick: onRemove })
|
|
31642
32775
|
] });
|
|
31643
32776
|
};
|
|
31644
|
-
const modifiers$
|
|
32777
|
+
const modifiers$c = {
|
|
31645
32778
|
equals: createConditionModifierConfig({
|
|
31646
32779
|
modifier: DateEqualsConditionModifier,
|
|
31647
32780
|
isValueValid: (value) => value instanceof Date,
|
|
@@ -31682,13 +32815,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31682
32815
|
class DateFieldCondition extends BaseCondition {
|
|
31683
32816
|
constructor(options) {
|
|
31684
32817
|
super(options);
|
|
31685
|
-
__publicField(this, "
|
|
31686
|
-
__publicField(this, "defaultConditionValue");
|
|
31687
|
-
__publicField(this, "modifiers", modifiers$a);
|
|
32818
|
+
__publicField(this, "modifiers", modifiers$c);
|
|
31688
32819
|
}
|
|
31689
32820
|
static deserialize(serializedCondition, field) {
|
|
31690
32821
|
const { conditionValue, conditionModifier, ...rest } = serializedCondition;
|
|
31691
|
-
const modifierConfig = modifiers$
|
|
32822
|
+
const modifierConfig = modifiers$c[conditionModifier];
|
|
31692
32823
|
const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? (
|
|
31693
32824
|
// @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
|
|
31694
32825
|
modifierConfig.modifier.deserialize(conditionValue)
|
|
@@ -31744,7 +32875,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31744
32875
|
/* @__PURE__ */ jsxRuntime.jsx(RemoveConditionButton, { condition, onClick: onRemove })
|
|
31745
32876
|
] });
|
|
31746
32877
|
};
|
|
31747
|
-
const modifiers$
|
|
32878
|
+
const modifiers$b = {
|
|
31748
32879
|
equals: createConditionModifierConfig({
|
|
31749
32880
|
modifier: StringArrayEqualsConditionModifier,
|
|
31750
32881
|
isValueValid: (_value) => true,
|
|
@@ -31779,13 +32910,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31779
32910
|
class MultiSelectFieldCondition extends BaseCondition {
|
|
31780
32911
|
constructor(options) {
|
|
31781
32912
|
super(options);
|
|
31782
|
-
__publicField(this, "
|
|
31783
|
-
__publicField(this, "defaultConditionModifier", "equals");
|
|
31784
|
-
__publicField(this, "modifiers", modifiers$9);
|
|
32913
|
+
__publicField(this, "modifiers", modifiers$b);
|
|
31785
32914
|
}
|
|
31786
32915
|
static deserialize(serializedCondition, field) {
|
|
31787
32916
|
const { conditionValue, conditionModifier, ...rest } = serializedCondition;
|
|
31788
|
-
const modifierConfig = modifiers$
|
|
32917
|
+
const modifierConfig = modifiers$b[conditionModifier];
|
|
31789
32918
|
const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? modifierConfig.modifier.deserialize(conditionValue) : void 0;
|
|
31790
32919
|
return new MultiSelectFieldCondition({ field, conditionModifier, conditionValue: deserializedValue, ...rest });
|
|
31791
32920
|
}
|
|
@@ -31829,7 +32958,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31829
32958
|
/* @__PURE__ */ jsxRuntime.jsx(RemoveConditionButton, { condition, onClick: onRemove })
|
|
31830
32959
|
] });
|
|
31831
32960
|
};
|
|
31832
|
-
const modifiers$
|
|
32961
|
+
const modifiers$a = {
|
|
31833
32962
|
equals: createConditionModifierConfig({
|
|
31834
32963
|
modifier: StringArrayEqualsConditionModifier,
|
|
31835
32964
|
isValueValid: (_value) => true,
|
|
@@ -31864,13 +32993,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31864
32993
|
class MultiStringFieldCondition extends BaseCondition {
|
|
31865
32994
|
constructor(options) {
|
|
31866
32995
|
super(options);
|
|
31867
|
-
__publicField(this, "
|
|
31868
|
-
__publicField(this, "defaultConditionModifier", "equals");
|
|
31869
|
-
__publicField(this, "modifiers", modifiers$8);
|
|
32996
|
+
__publicField(this, "modifiers", modifiers$a);
|
|
31870
32997
|
}
|
|
31871
32998
|
static deserialize(serializedCondition, field) {
|
|
31872
32999
|
const { conditionValue, conditionModifier, ...rest } = serializedCondition;
|
|
31873
|
-
const modifierConfig = modifiers$
|
|
33000
|
+
const modifierConfig = modifiers$a[conditionModifier];
|
|
31874
33001
|
const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? modifierConfig.modifier.deserialize(conditionValue) : void 0;
|
|
31875
33002
|
return new MultiStringFieldCondition({ field, conditionModifier, conditionValue: deserializedValue, ...rest });
|
|
31876
33003
|
}
|
|
@@ -31949,7 +33076,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
31949
33076
|
/* @__PURE__ */ jsxRuntime.jsx(RemoveConditionButton, { condition, onClick: onRemove })
|
|
31950
33077
|
] });
|
|
31951
33078
|
};
|
|
31952
|
-
const modifiers$
|
|
33079
|
+
const modifiers$9 = {
|
|
31953
33080
|
equals: createConditionModifierConfig({
|
|
31954
33081
|
modifier: NumberEqualsConditionModifier,
|
|
31955
33082
|
isValueValid: (value) => typeof value === "number",
|
|
@@ -32002,13 +33129,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32002
33129
|
class NumberFieldCondition extends BaseCondition {
|
|
32003
33130
|
constructor(options) {
|
|
32004
33131
|
super(options);
|
|
32005
|
-
__publicField(this, "
|
|
32006
|
-
__publicField(this, "defaultConditionModifier", "equals");
|
|
32007
|
-
__publicField(this, "modifiers", modifiers$7);
|
|
33132
|
+
__publicField(this, "modifiers", modifiers$9);
|
|
32008
33133
|
}
|
|
32009
33134
|
static deserialize(serializedCondition, field) {
|
|
32010
33135
|
const { conditionValue, conditionModifier, ...rest } = serializedCondition;
|
|
32011
|
-
const modifierConfig = modifiers$
|
|
33136
|
+
const modifierConfig = modifiers$9[conditionModifier];
|
|
32012
33137
|
const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? (
|
|
32013
33138
|
// @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
|
|
32014
33139
|
modifierConfig.modifier.deserialize(conditionValue)
|
|
@@ -32052,7 +33177,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32052
33177
|
/* @__PURE__ */ jsxRuntime.jsx(RemoveConditionButton, { condition, onClick: onRemove })
|
|
32053
33178
|
] });
|
|
32054
33179
|
};
|
|
32055
|
-
const modifiers$
|
|
33180
|
+
const modifiers$8 = {
|
|
32056
33181
|
equals: createConditionModifierConfig({
|
|
32057
33182
|
modifier: StringEqualsConditionModifier,
|
|
32058
33183
|
isValueValid: (_value) => true,
|
|
@@ -32081,13 +33206,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32081
33206
|
class OTPFieldCondition extends BaseCondition {
|
|
32082
33207
|
constructor(options) {
|
|
32083
33208
|
super(options);
|
|
32084
|
-
__publicField(this, "
|
|
32085
|
-
__publicField(this, "defaultConditionModifier", "equals");
|
|
32086
|
-
__publicField(this, "modifiers", modifiers$6);
|
|
33209
|
+
__publicField(this, "modifiers", modifiers$8);
|
|
32087
33210
|
}
|
|
32088
33211
|
static deserialize(serializedCondition, field) {
|
|
32089
33212
|
const { conditionValue, conditionModifier, ...rest } = serializedCondition;
|
|
32090
|
-
const modifierConfig = modifiers$
|
|
33213
|
+
const modifierConfig = modifiers$8[conditionModifier];
|
|
32091
33214
|
const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? modifierConfig.modifier.deserialize(conditionValue) : void 0;
|
|
32092
33215
|
return new OTPFieldCondition({ field, conditionModifier, conditionValue: deserializedValue, ...rest });
|
|
32093
33216
|
}
|
|
@@ -32095,6 +33218,117 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32095
33218
|
return /* @__PURE__ */ jsxRuntime.jsx(OTPFieldConditionCell, { condition: this, ...props }, this.id);
|
|
32096
33219
|
}
|
|
32097
33220
|
}
|
|
33221
|
+
const PassFailFieldConditionCell = (props) => {
|
|
33222
|
+
const { condition, onRemove } = props;
|
|
33223
|
+
const field = condition.field;
|
|
33224
|
+
const conditionValue = condition.getConditionValue();
|
|
33225
|
+
const conditionModifier = condition.getConditionModifier();
|
|
33226
|
+
const getFilterValueUi = () => {
|
|
33227
|
+
switch (conditionModifier) {
|
|
33228
|
+
case "equals":
|
|
33229
|
+
case "notEquals": {
|
|
33230
|
+
const equalsModifier = condition.modifiers.equals;
|
|
33231
|
+
const equalsFilterValue = conditionValue !== void 0 && equalsModifier.isConditionValueValid(conditionValue) ? conditionValue : void 0;
|
|
33232
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Root, { children: [
|
|
33233
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.ClickTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Button, { type: "button", className: "min-w-0 shrink-1 grow", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: equalsFilterValue !== void 0 ? equalsFilterValue ? passFailFieldStatusMapping[equalsFilterValue].label : "empty" : "..." }) }) }),
|
|
33234
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Content, { size: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33235
|
+
blocks.Menu.SelectGroup,
|
|
33236
|
+
{
|
|
33237
|
+
required: false,
|
|
33238
|
+
value: equalsFilterValue,
|
|
33239
|
+
onValueChange: condition.setConditionValue,
|
|
33240
|
+
children: passFailFieldStatuses.map((status) => {
|
|
33241
|
+
const { label } = passFailFieldStatusMapping[status];
|
|
33242
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectItemTemplate, { value: status, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: label }) }, status);
|
|
33243
|
+
})
|
|
33244
|
+
}
|
|
33245
|
+
) })
|
|
33246
|
+
] });
|
|
33247
|
+
}
|
|
33248
|
+
case "includes":
|
|
33249
|
+
case "excludes": {
|
|
33250
|
+
const includesModifier = condition.modifiers.includes;
|
|
33251
|
+
const includesModifierFilterValue = conditionValue !== void 0 && includesModifier.isConditionValueValid(conditionValue) ? conditionValue : void 0;
|
|
33252
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Root, { children: [
|
|
33253
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.ClickTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Button, { type: "button", children: includesModifierFilterValue ? `${includesModifierFilterValue.length} statuses` : "..." }) }),
|
|
33254
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Content, { size: "sm", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
33255
|
+
blocks.Menu.MultiSelectGroup,
|
|
33256
|
+
{
|
|
33257
|
+
values: includesModifierFilterValue ?? EMPTY_ARRAY,
|
|
33258
|
+
onValuesChange: condition.setConditionValue,
|
|
33259
|
+
children: [
|
|
33260
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectAllItemTemplate, { children: "Select all" }),
|
|
33261
|
+
passFailFieldStatuses.map((status) => {
|
|
33262
|
+
const { label, icon } = passFailFieldStatusMapping[status];
|
|
33263
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(MultiSelectItemTemplate, { value: status, children: [
|
|
33264
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon }),
|
|
33265
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: label })
|
|
33266
|
+
] }, status);
|
|
33267
|
+
})
|
|
33268
|
+
]
|
|
33269
|
+
}
|
|
33270
|
+
) })
|
|
33271
|
+
] });
|
|
33272
|
+
}
|
|
33273
|
+
}
|
|
33274
|
+
};
|
|
33275
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.ButtonGroup, { className: "flex w-max max-w-full min-w-0 gap-0.5", size: "sm", variant: "fill", accentColor: "base", children: [
|
|
33276
|
+
/* @__PURE__ */ jsxRuntime.jsxs(blocks.Badge, { className: "min-w-0 shrink-1", size: "sm", variant: "fill", accentColor: "base", children: [
|
|
33277
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: fieldIcons[field.type] }),
|
|
33278
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: field.label || UNLABELLED_FIELD_LABEL })
|
|
33279
|
+
] }),
|
|
33280
|
+
/* @__PURE__ */ jsxRuntime.jsx(ConditionModifierDropdown, { condition, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Button, { type: "button", children: condition.modifiers[conditionModifier].modifier.label }) }),
|
|
33281
|
+
getFilterValueUi(),
|
|
33282
|
+
/* @__PURE__ */ jsxRuntime.jsx(RemoveConditionButton, { condition, onClick: onRemove })
|
|
33283
|
+
] });
|
|
33284
|
+
};
|
|
33285
|
+
const modifiers$7 = {
|
|
33286
|
+
equals: createConditionModifierConfig({
|
|
33287
|
+
modifier: PassFailEqualsConditionModifier,
|
|
33288
|
+
isValueValid: (value) => value !== null,
|
|
33289
|
+
isConditionValueValid: (conditionValue) => typeof conditionValue === "string",
|
|
33290
|
+
isSerializedValueValid: (serializedConditionValue) => typeof serializedConditionValue === "string"
|
|
33291
|
+
}),
|
|
33292
|
+
notEquals: createConditionModifierConfig({
|
|
33293
|
+
modifier: PassFailNotEqualsConditionModifier,
|
|
33294
|
+
isValueValid: (value) => value !== null,
|
|
33295
|
+
isConditionValueValid: (conditionValue) => typeof conditionValue === "string",
|
|
33296
|
+
isSerializedValueValid: (serializedConditionValue) => typeof serializedConditionValue === "string"
|
|
33297
|
+
}),
|
|
33298
|
+
includes: createConditionModifierConfig({
|
|
33299
|
+
modifier: PassFailArrayIncludesConditionModifier,
|
|
33300
|
+
isValueValid: (value) => value !== null,
|
|
33301
|
+
isConditionValueValid: (conditionValue) => Array.isArray(conditionValue),
|
|
33302
|
+
isSerializedValueValid: (serializedConditionValue) => Array.isArray(serializedConditionValue)
|
|
33303
|
+
}),
|
|
33304
|
+
excludes: createConditionModifierConfig({
|
|
33305
|
+
modifier: PassFailArrayExcludesConditionModifier,
|
|
33306
|
+
isValueValid: (value) => value !== null,
|
|
33307
|
+
isConditionValueValid: (conditionValue) => Array.isArray(conditionValue),
|
|
33308
|
+
isSerializedValueValid: (serializedConditionValue) => Array.isArray(serializedConditionValue)
|
|
33309
|
+
})
|
|
33310
|
+
};
|
|
33311
|
+
class PassFailFieldCondition extends BaseCondition {
|
|
33312
|
+
constructor(options) {
|
|
33313
|
+
super(options);
|
|
33314
|
+
__publicField(this, "modifiers", modifiers$7);
|
|
33315
|
+
}
|
|
33316
|
+
static deserialize(serializedCondition, field) {
|
|
33317
|
+
const { conditionValue, conditionModifier, ...rest } = serializedCondition;
|
|
33318
|
+
const modifierConfig = modifiers$7[conditionModifier];
|
|
33319
|
+
const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? (
|
|
33320
|
+
// @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
|
|
33321
|
+
modifierConfig.modifier.deserialize(conditionValue)
|
|
33322
|
+
) : void 0;
|
|
33323
|
+
return new PassFailFieldCondition({ field, conditionModifier, conditionValue: deserializedValue, ...rest });
|
|
33324
|
+
}
|
|
33325
|
+
transformValue(value) {
|
|
33326
|
+
return value.status;
|
|
33327
|
+
}
|
|
33328
|
+
render(props) {
|
|
33329
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PassFailFieldConditionCell, { condition: this, ...props }, this.id);
|
|
33330
|
+
}
|
|
33331
|
+
}
|
|
32098
33332
|
const RadioFieldConditionCell = (props) => {
|
|
32099
33333
|
const { condition, onRemove } = props;
|
|
32100
33334
|
const field = condition.field;
|
|
@@ -32115,16 +33349,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32115
33349
|
}
|
|
32116
33350
|
return mapping;
|
|
32117
33351
|
}, [normalizedOptions]);
|
|
32118
|
-
const handleValuesChange = React.useCallback(
|
|
32119
|
-
(values) => {
|
|
32120
|
-
if (values.length > 0) {
|
|
32121
|
-
condition.setConditionValue(values);
|
|
32122
|
-
} else {
|
|
32123
|
-
condition.setConditionValue([]);
|
|
32124
|
-
}
|
|
32125
|
-
},
|
|
32126
|
-
[condition]
|
|
32127
|
-
);
|
|
32128
33352
|
const getFilterValueUi = () => {
|
|
32129
33353
|
switch (conditionModifier) {
|
|
32130
33354
|
case "equals":
|
|
@@ -32154,8 +33378,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32154
33378
|
SelectFieldOptionMultiSelectGroup,
|
|
32155
33379
|
{
|
|
32156
33380
|
selectFieldOptions: field.options,
|
|
32157
|
-
values: includesModifierFilterValue ??
|
|
32158
|
-
onValuesChange:
|
|
33381
|
+
values: includesModifierFilterValue ?? EMPTY_ARRAY,
|
|
33382
|
+
onValuesChange: condition.setConditionValue
|
|
32159
33383
|
}
|
|
32160
33384
|
) })
|
|
32161
33385
|
] });
|
|
@@ -32172,7 +33396,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32172
33396
|
/* @__PURE__ */ jsxRuntime.jsx(RemoveConditionButton, { condition, onClick: onRemove })
|
|
32173
33397
|
] });
|
|
32174
33398
|
};
|
|
32175
|
-
const modifiers$
|
|
33399
|
+
const modifiers$6 = {
|
|
32176
33400
|
equals: createConditionModifierConfig({
|
|
32177
33401
|
modifier: StringEqualsConditionModifier,
|
|
32178
33402
|
isValueValid: (value) => typeof value === "string",
|
|
@@ -32201,13 +33425,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32201
33425
|
class RadioFieldCondition extends BaseCondition {
|
|
32202
33426
|
constructor(options) {
|
|
32203
33427
|
super(options);
|
|
32204
|
-
__publicField(this, "
|
|
32205
|
-
__publicField(this, "defaultConditionModifier", "equals");
|
|
32206
|
-
__publicField(this, "modifiers", modifiers$5);
|
|
33428
|
+
__publicField(this, "modifiers", modifiers$6);
|
|
32207
33429
|
}
|
|
32208
33430
|
static deserialize(serializedCondition, field) {
|
|
32209
33431
|
const { conditionValue, conditionModifier, ...rest } = serializedCondition;
|
|
32210
|
-
const modifierConfig = modifiers$
|
|
33432
|
+
const modifierConfig = modifiers$6[conditionModifier];
|
|
32211
33433
|
const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? (
|
|
32212
33434
|
// @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
|
|
32213
33435
|
modifierConfig.modifier.deserialize(conditionValue)
|
|
@@ -32218,6 +33440,146 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32218
33440
|
return /* @__PURE__ */ jsxRuntime.jsx(RadioFieldConditionCell, { condition: this, ...props }, this.id);
|
|
32219
33441
|
}
|
|
32220
33442
|
}
|
|
33443
|
+
const RatingFieldConditionCell = (props) => {
|
|
33444
|
+
const { condition, onRemove } = props;
|
|
33445
|
+
const field = condition.field;
|
|
33446
|
+
const conditionValue = condition.getConditionValue();
|
|
33447
|
+
const conditionModifier = condition.getConditionModifier();
|
|
33448
|
+
const getFilterValueUi = () => {
|
|
33449
|
+
switch (conditionModifier) {
|
|
33450
|
+
case "equals":
|
|
33451
|
+
case "notEquals":
|
|
33452
|
+
case "greaterThanOrEquals":
|
|
33453
|
+
case "lessThanOrEquals":
|
|
33454
|
+
case "greaterThan":
|
|
33455
|
+
case "lessThan": {
|
|
33456
|
+
const modifier = condition.modifiers[conditionModifier];
|
|
33457
|
+
const filterValue = conditionValue !== void 0 && modifier.isConditionValueValid(conditionValue) ? conditionValue : void 0;
|
|
33458
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
33459
|
+
NumberInputPopover,
|
|
33460
|
+
{
|
|
33461
|
+
value: filterValue ?? null,
|
|
33462
|
+
onValueChange: (value) => condition.setConditionValue(value ?? void 0),
|
|
33463
|
+
size: "sm",
|
|
33464
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Button, { type: "button", className: "truncate", children: filterValue !== void 0 ? filterValue : "..." })
|
|
33465
|
+
}
|
|
33466
|
+
);
|
|
33467
|
+
}
|
|
33468
|
+
case "inRange":
|
|
33469
|
+
case "notInRange": {
|
|
33470
|
+
const inRangeModifier = condition.modifiers.inRange;
|
|
33471
|
+
const rangeFilterValue = conditionValue !== void 0 && inRangeModifier.isConditionValueValid(conditionValue) ? conditionValue : void 0;
|
|
33472
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
33473
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
33474
|
+
NumberInputPopover,
|
|
33475
|
+
{
|
|
33476
|
+
value: (rangeFilterValue == null ? void 0 : rangeFilterValue.from) ?? null,
|
|
33477
|
+
onValueChange: (value) => {
|
|
33478
|
+
condition.setConditionValue({
|
|
33479
|
+
from: value,
|
|
33480
|
+
to: (rangeFilterValue == null ? void 0 : rangeFilterValue.to) ?? null
|
|
33481
|
+
});
|
|
33482
|
+
},
|
|
33483
|
+
size: "sm",
|
|
33484
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Button, { className: "truncate", children: (rangeFilterValue == null ? void 0 : rangeFilterValue.from) ?? "..." })
|
|
33485
|
+
}
|
|
33486
|
+
),
|
|
33487
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
33488
|
+
NumberInputPopover,
|
|
33489
|
+
{
|
|
33490
|
+
value: (rangeFilterValue == null ? void 0 : rangeFilterValue.to) ?? null,
|
|
33491
|
+
onValueChange: (value) => {
|
|
33492
|
+
condition.setConditionValue({
|
|
33493
|
+
from: (rangeFilterValue == null ? void 0 : rangeFilterValue.from) ?? null,
|
|
33494
|
+
to: value
|
|
33495
|
+
});
|
|
33496
|
+
},
|
|
33497
|
+
size: "sm",
|
|
33498
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Button, { className: "truncate", children: (rangeFilterValue == null ? void 0 : rangeFilterValue.to) ?? "..." })
|
|
33499
|
+
}
|
|
33500
|
+
)
|
|
33501
|
+
] });
|
|
33502
|
+
}
|
|
33503
|
+
}
|
|
33504
|
+
};
|
|
33505
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.ButtonGroup, { className: "flex w-max max-w-full min-w-0 gap-0.5", size: "sm", variant: "fill", accentColor: "base", children: [
|
|
33506
|
+
/* @__PURE__ */ jsxRuntime.jsxs(blocks.Badge, { className: "min-w-0 shrink-1", size: "sm", variant: "fill", accentColor: "base", children: [
|
|
33507
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: fieldIcons[field.type] }),
|
|
33508
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: field.label || UNLABELLED_FIELD_LABEL })
|
|
33509
|
+
] }),
|
|
33510
|
+
/* @__PURE__ */ jsxRuntime.jsx(ConditionModifierDropdown, { condition, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Button, { type: "button", children: condition.modifiers[conditionModifier].modifier.label }) }),
|
|
33511
|
+
getFilterValueUi(),
|
|
33512
|
+
/* @__PURE__ */ jsxRuntime.jsx(RemoveConditionButton, { condition, onClick: onRemove })
|
|
33513
|
+
] });
|
|
33514
|
+
};
|
|
33515
|
+
const modifiers$5 = {
|
|
33516
|
+
equals: createConditionModifierConfig({
|
|
33517
|
+
modifier: NumberEqualsConditionModifier,
|
|
33518
|
+
isValueValid: (value) => typeof value === "number",
|
|
33519
|
+
isConditionValueValid: (conditionValue) => typeof conditionValue === "number",
|
|
33520
|
+
isSerializedValueValid: (conditionValue) => typeof conditionValue === "number"
|
|
33521
|
+
}),
|
|
33522
|
+
notEquals: createConditionModifierConfig({
|
|
33523
|
+
modifier: NumberNotEqualsConditionModifier,
|
|
33524
|
+
isValueValid: (value) => typeof value === "number",
|
|
33525
|
+
isConditionValueValid: (conditionValue) => typeof conditionValue === "number",
|
|
33526
|
+
isSerializedValueValid: (conditionValue) => typeof conditionValue === "number"
|
|
33527
|
+
}),
|
|
33528
|
+
lessThan: createConditionModifierConfig({
|
|
33529
|
+
modifier: NumberLessThanConditionModifier,
|
|
33530
|
+
isValueValid: (value) => typeof value === "number",
|
|
33531
|
+
isConditionValueValid: (conditionValue) => typeof conditionValue === "number",
|
|
33532
|
+
isSerializedValueValid: (conditionValue) => typeof conditionValue === "number"
|
|
33533
|
+
}),
|
|
33534
|
+
lessThanOrEquals: createConditionModifierConfig({
|
|
33535
|
+
modifier: NumberLessThanOrEqualsConditionModifier,
|
|
33536
|
+
isValueValid: (value) => typeof value === "number",
|
|
33537
|
+
isConditionValueValid: (conditionValue) => typeof conditionValue === "number",
|
|
33538
|
+
isSerializedValueValid: (conditionValue) => typeof conditionValue === "number"
|
|
33539
|
+
}),
|
|
33540
|
+
greaterThan: createConditionModifierConfig({
|
|
33541
|
+
modifier: NumberGreaterThanConditionModifier,
|
|
33542
|
+
isValueValid: (value) => typeof value === "number",
|
|
33543
|
+
isConditionValueValid: (conditionValue) => typeof conditionValue === "number",
|
|
33544
|
+
isSerializedValueValid: (conditionValue) => typeof conditionValue === "number"
|
|
33545
|
+
}),
|
|
33546
|
+
greaterThanOrEquals: createConditionModifierConfig({
|
|
33547
|
+
modifier: NumberGreaterThanOrEqualsConditionModifier,
|
|
33548
|
+
isValueValid: (value) => typeof value === "number",
|
|
33549
|
+
isConditionValueValid: (conditionValue) => typeof conditionValue === "number",
|
|
33550
|
+
isSerializedValueValid: (conditionValue) => typeof conditionValue === "number"
|
|
33551
|
+
}),
|
|
33552
|
+
inRange: createConditionModifierConfig({
|
|
33553
|
+
modifier: NumberRangeInConditionModifier,
|
|
33554
|
+
isValueValid: (value) => typeof value === "number",
|
|
33555
|
+
isConditionValueValid: (conditionValue) => typeof conditionValue === "object",
|
|
33556
|
+
isSerializedValueValid: (conditionValue) => typeof conditionValue === "object"
|
|
33557
|
+
}),
|
|
33558
|
+
notInRange: createConditionModifierConfig({
|
|
33559
|
+
modifier: NumberRangeNotInConditionModifier,
|
|
33560
|
+
isValueValid: (value) => typeof value === "number",
|
|
33561
|
+
isConditionValueValid: (conditionValue) => typeof conditionValue === "object",
|
|
33562
|
+
isSerializedValueValid: (conditionValue) => typeof conditionValue === "object"
|
|
33563
|
+
})
|
|
33564
|
+
};
|
|
33565
|
+
class RatingFieldCondition extends BaseCondition {
|
|
33566
|
+
constructor(options) {
|
|
33567
|
+
super(options);
|
|
33568
|
+
__publicField(this, "modifiers", modifiers$5);
|
|
33569
|
+
}
|
|
33570
|
+
static deserialize(serializedCondition, field) {
|
|
33571
|
+
const { conditionValue, conditionModifier, ...rest } = serializedCondition;
|
|
33572
|
+
const modifierConfig = modifiers$5[conditionModifier];
|
|
33573
|
+
const deserializedValue = conditionValue !== void 0 && modifierConfig.isSerializedValueValid(conditionValue) ? (
|
|
33574
|
+
// @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
|
|
33575
|
+
modifierConfig.modifier.deserialize(conditionValue)
|
|
33576
|
+
) : void 0;
|
|
33577
|
+
return new RatingFieldCondition({ field, conditionModifier, conditionValue: deserializedValue, ...rest });
|
|
33578
|
+
}
|
|
33579
|
+
render(props) {
|
|
33580
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RatingFieldConditionCell, { condition: this, ...props }, this.id);
|
|
33581
|
+
}
|
|
33582
|
+
}
|
|
32221
33583
|
const ScanFieldConditionCell = (props) => {
|
|
32222
33584
|
const { condition, onRemove } = props;
|
|
32223
33585
|
const field = condition.field;
|
|
@@ -32280,8 +33642,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32280
33642
|
class ScanFieldCondition extends BaseCondition {
|
|
32281
33643
|
constructor(options) {
|
|
32282
33644
|
super(options);
|
|
32283
|
-
__publicField(this, "defaultConditionValue");
|
|
32284
|
-
__publicField(this, "defaultConditionModifier", "equals");
|
|
32285
33645
|
__publicField(this, "modifiers", modifiers$4);
|
|
32286
33646
|
}
|
|
32287
33647
|
static deserialize(serializedCondition, field) {
|
|
@@ -32400,8 +33760,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32400
33760
|
class SelectFieldCondition extends BaseCondition {
|
|
32401
33761
|
constructor(options) {
|
|
32402
33762
|
super(options);
|
|
32403
|
-
__publicField(this, "defaultConditionValue");
|
|
32404
|
-
__publicField(this, "defaultConditionModifier", "equals");
|
|
32405
33763
|
__publicField(this, "modifiers", modifiers$3);
|
|
32406
33764
|
}
|
|
32407
33765
|
static deserialize(serializedCondition, field) {
|
|
@@ -32479,8 +33837,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32479
33837
|
class StringFieldCondition extends BaseCondition {
|
|
32480
33838
|
constructor(options) {
|
|
32481
33839
|
super(options);
|
|
32482
|
-
__publicField(this, "defaultConditionValue");
|
|
32483
|
-
__publicField(this, "defaultConditionModifier", "equals");
|
|
32484
33840
|
__publicField(this, "modifiers", modifiers$2);
|
|
32485
33841
|
}
|
|
32486
33842
|
static deserialize(serializedCondition, field) {
|
|
@@ -32555,8 +33911,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32555
33911
|
class TextFieldCondition extends BaseCondition {
|
|
32556
33912
|
constructor(options) {
|
|
32557
33913
|
super(options);
|
|
32558
|
-
__publicField(this, "defaultConditionValue");
|
|
32559
|
-
__publicField(this, "defaultConditionModifier", "equals");
|
|
32560
33914
|
__publicField(this, "modifiers", modifiers$1);
|
|
32561
33915
|
}
|
|
32562
33916
|
static deserialize(serializedCondition, field) {
|
|
@@ -32627,8 +33981,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32627
33981
|
class UploadFieldCondition extends BaseCondition {
|
|
32628
33982
|
constructor(options) {
|
|
32629
33983
|
super(options);
|
|
32630
|
-
__publicField(this, "defaultConditionValue");
|
|
32631
|
-
__publicField(this, "defaultConditionModifier", "equals");
|
|
32632
33984
|
__publicField(this, "modifiers", modifiers);
|
|
32633
33985
|
}
|
|
32634
33986
|
static deserialize(serializedCondition, field) {
|
|
@@ -32641,43 +33993,35 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32641
33993
|
return /* @__PURE__ */ jsxRuntime.jsx(UploadFieldConditionCell, { condition: this, ...props }, this.id);
|
|
32642
33994
|
}
|
|
32643
33995
|
}
|
|
32644
|
-
const
|
|
32645
|
-
|
|
32646
|
-
|
|
32647
|
-
|
|
32648
|
-
|
|
32649
|
-
|
|
32650
|
-
|
|
32651
|
-
|
|
32652
|
-
|
|
32653
|
-
|
|
32654
|
-
|
|
32655
|
-
|
|
32656
|
-
|
|
32657
|
-
|
|
32658
|
-
|
|
32659
|
-
|
|
32660
|
-
|
|
32661
|
-
|
|
32662
|
-
|
|
32663
|
-
|
|
32664
|
-
|
|
32665
|
-
return ScanFieldCondition.deserialize(serializedCondition, field);
|
|
32666
|
-
case "radio":
|
|
32667
|
-
return RadioFieldCondition.deserialize(serializedCondition, field);
|
|
32668
|
-
case "checkbox-list":
|
|
32669
|
-
return CheckboxListFieldCondition.deserialize(serializedCondition, field);
|
|
32670
|
-
case "otp":
|
|
32671
|
-
return OTPFieldCondition.deserialize(serializedCondition, field);
|
|
32672
|
-
}
|
|
33996
|
+
const ConditionTypeToClsMapping = {
|
|
33997
|
+
date: DateFieldCondition,
|
|
33998
|
+
number: NumberFieldCondition,
|
|
33999
|
+
boolean: BooleanFieldCondition,
|
|
34000
|
+
select: SelectFieldCondition,
|
|
34001
|
+
string: StringFieldCondition,
|
|
34002
|
+
text: TextFieldCondition,
|
|
34003
|
+
upload: UploadFieldCondition,
|
|
34004
|
+
qr: ScanFieldCondition,
|
|
34005
|
+
"multi-string": MultiStringFieldCondition,
|
|
34006
|
+
"multi-select": MultiSelectFieldCondition,
|
|
34007
|
+
radio: RadioFieldCondition,
|
|
34008
|
+
"checkbox-list": CheckboxListFieldCondition,
|
|
34009
|
+
"pass-fail": PassFailFieldCondition,
|
|
34010
|
+
otp: OTPFieldCondition,
|
|
34011
|
+
rating: RatingFieldCondition
|
|
34012
|
+
};
|
|
34013
|
+
const deserializeCondition = (field, serializedCondition) => {
|
|
34014
|
+
if (field.type !== serializedCondition.type)
|
|
34015
|
+
throw new Error(`field and condition type mismatch ${field.type} !== ${serializedCondition.type}`);
|
|
34016
|
+
return ConditionTypeToClsMapping[serializedCondition.type].deserialize(serializedCondition, field);
|
|
32673
34017
|
};
|
|
32674
|
-
const deserializeConditions = (
|
|
34018
|
+
const deserializeConditions = (fields, serializedConditions) => {
|
|
32675
34019
|
const fieldsMapping = {};
|
|
32676
34020
|
for (const field of fields) {
|
|
32677
34021
|
fieldsMapping[field.identifier] = field;
|
|
32678
34022
|
}
|
|
32679
34023
|
return serializedConditions.map(
|
|
32680
|
-
(serializedCondition) => deserializeCondition(
|
|
34024
|
+
(serializedCondition) => deserializeCondition(fieldsMapping[serializedCondition.fieldId], serializedCondition)
|
|
32681
34025
|
);
|
|
32682
34026
|
};
|
|
32683
34027
|
const applyConditions = (conditions, values) => {
|
|
@@ -32685,35 +34029,53 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32685
34029
|
return condition.apply(values[condition.field.identifier]);
|
|
32686
34030
|
}) : true;
|
|
32687
34031
|
};
|
|
32688
|
-
|
|
32689
|
-
|
|
32690
|
-
|
|
32691
|
-
|
|
32692
|
-
|
|
32693
|
-
|
|
32694
|
-
|
|
32695
|
-
|
|
32696
|
-
|
|
32697
|
-
|
|
32698
|
-
|
|
32699
|
-
|
|
32700
|
-
|
|
32701
|
-
return MultiStringField.deserialize(serializedField);
|
|
32702
|
-
case "multi-select":
|
|
32703
|
-
return MultiSelectField.deserialize(serializedField);
|
|
32704
|
-
case "upload":
|
|
32705
|
-
return UploadField.deserialize(serializedField);
|
|
32706
|
-
case "qr":
|
|
32707
|
-
return ScanField.deserialize(serializedField);
|
|
32708
|
-
case "radio":
|
|
32709
|
-
return RadioField.deserialize(serializedField);
|
|
32710
|
-
case "checkbox-list":
|
|
32711
|
-
return CheckboxListField.deserialize(serializedField);
|
|
32712
|
-
case "string":
|
|
32713
|
-
return StringField.deserialize(serializedField);
|
|
32714
|
-
case "otp":
|
|
32715
|
-
return OTPField.deserialize(serializedField);
|
|
34032
|
+
class ConditionManager extends Observable {
|
|
34033
|
+
constructor(conditions) {
|
|
34034
|
+
super();
|
|
34035
|
+
__publicField(this, "conditions");
|
|
34036
|
+
__publicField(this, "conditionObserver", () => {
|
|
34037
|
+
this.conditions = [...this.conditions];
|
|
34038
|
+
this.notify(this);
|
|
34039
|
+
});
|
|
34040
|
+
__publicField(this, "initConditions", (conditions) => {
|
|
34041
|
+
for (const c of conditions) c.observe(this.conditionObserver);
|
|
34042
|
+
return conditions;
|
|
34043
|
+
});
|
|
34044
|
+
this.conditions = this.initConditions(conditions);
|
|
32716
34045
|
}
|
|
34046
|
+
getConditions() {
|
|
34047
|
+
return this.conditions;
|
|
34048
|
+
}
|
|
34049
|
+
addCondition(condition) {
|
|
34050
|
+
this.conditions = this.initConditions([...this.conditions, condition]);
|
|
34051
|
+
this.notify(this);
|
|
34052
|
+
}
|
|
34053
|
+
addConditions(conditions) {
|
|
34054
|
+
this.conditions = this.initConditions([...this.conditions, ...conditions]);
|
|
34055
|
+
this.notify(this);
|
|
34056
|
+
}
|
|
34057
|
+
removeCondition(condition) {
|
|
34058
|
+
this.conditions = this.initConditions(this.conditions.filter((c) => c.id !== condition.id));
|
|
34059
|
+
this.notify(this);
|
|
34060
|
+
}
|
|
34061
|
+
removeConditions(conditions) {
|
|
34062
|
+
const conditionIds = new Set(conditions.map((c) => c.id));
|
|
34063
|
+
this.conditions = this.initConditions(this.conditions.filter((c) => !conditionIds.has(c.id)));
|
|
34064
|
+
this.notify(this);
|
|
34065
|
+
}
|
|
34066
|
+
applyConditions(values) {
|
|
34067
|
+
return applyConditions(this.conditions, values);
|
|
34068
|
+
}
|
|
34069
|
+
}
|
|
34070
|
+
const useConditionManager = (conditions, onConditionsChange) => {
|
|
34071
|
+
return React.useMemo(() => {
|
|
34072
|
+
const ret = new ConditionManager(conditions);
|
|
34073
|
+
ret.observe((conditionManager) => onConditionsChange(conditionManager.getConditions()));
|
|
34074
|
+
return ret;
|
|
34075
|
+
}, [conditions, onConditionsChange]);
|
|
34076
|
+
};
|
|
34077
|
+
const deserializeField = (serializedField) => {
|
|
34078
|
+
return FieldTypeToClsMapping[serializedField.type].deserialize(serializedField);
|
|
32717
34079
|
};
|
|
32718
34080
|
function deserializeFields(fields) {
|
|
32719
34081
|
return fields.map(deserialize);
|
|
@@ -32788,6 +34150,85 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32788
34150
|
}
|
|
32789
34151
|
return ret;
|
|
32790
34152
|
}
|
|
34153
|
+
function extractFilesAndPromisesFromFieldValues(fields, values) {
|
|
34154
|
+
const cleanValues = cleanFieldValues(fields, values);
|
|
34155
|
+
const valuesRet = {};
|
|
34156
|
+
const filesRet = {};
|
|
34157
|
+
for (const field of fields) {
|
|
34158
|
+
if (!(field.identifier in cleanValues)) continue;
|
|
34159
|
+
const value = cleanValues[field.identifier];
|
|
34160
|
+
switch (field.type) {
|
|
34161
|
+
case "upload":
|
|
34162
|
+
if (!field.isValueValid(value)) break;
|
|
34163
|
+
filesRet[field.identifier] = value;
|
|
34164
|
+
valuesRet[field.identifier] = [];
|
|
34165
|
+
break;
|
|
34166
|
+
case "pass-fail":
|
|
34167
|
+
if (!field.isValueValid(value)) break;
|
|
34168
|
+
filesRet[field.identifier] = value.files;
|
|
34169
|
+
valuesRet[field.identifier] = {
|
|
34170
|
+
...value,
|
|
34171
|
+
files: []
|
|
34172
|
+
};
|
|
34173
|
+
break;
|
|
34174
|
+
default:
|
|
34175
|
+
valuesRet[field.identifier] = values[field.identifier];
|
|
34176
|
+
}
|
|
34177
|
+
}
|
|
34178
|
+
return [valuesRet, filesRet];
|
|
34179
|
+
}
|
|
34180
|
+
function insertFilesAndPromisesToFieldValues(fields, values, filesAndPromises) {
|
|
34181
|
+
const ret = {};
|
|
34182
|
+
for (const field of fields) {
|
|
34183
|
+
if (!(field.identifier in values)) continue;
|
|
34184
|
+
const value = values[field.identifier];
|
|
34185
|
+
switch (field.type) {
|
|
34186
|
+
case "upload":
|
|
34187
|
+
if (!field.isValueValid(value)) break;
|
|
34188
|
+
ret[field.identifier] = filesAndPromises[field.identifier] ?? [];
|
|
34189
|
+
break;
|
|
34190
|
+
case "pass-fail":
|
|
34191
|
+
if (!field.isValueValid(value)) break;
|
|
34192
|
+
ret[field.identifier] = {
|
|
34193
|
+
...value,
|
|
34194
|
+
files: filesAndPromises[field.identifier] ?? []
|
|
34195
|
+
};
|
|
34196
|
+
break;
|
|
34197
|
+
default:
|
|
34198
|
+
if (!field.isValueValid(value)) break;
|
|
34199
|
+
ret[field.identifier] = value;
|
|
34200
|
+
}
|
|
34201
|
+
}
|
|
34202
|
+
return ret;
|
|
34203
|
+
}
|
|
34204
|
+
const initializeFieldValues = (fields, values) => {
|
|
34205
|
+
const ret = {};
|
|
34206
|
+
for (const field of fields) {
|
|
34207
|
+
const value = values[field.identifier];
|
|
34208
|
+
ret[field.identifier] = value !== void 0 ? value : field.blankValue();
|
|
34209
|
+
}
|
|
34210
|
+
return ret;
|
|
34211
|
+
};
|
|
34212
|
+
const changedFieldValues = (fields, values1, values2) => {
|
|
34213
|
+
const ret = {};
|
|
34214
|
+
for (const field of fields) {
|
|
34215
|
+
const value1 = values1[field.identifier];
|
|
34216
|
+
const value2 = values2[field.identifier];
|
|
34217
|
+
if (field.areValuesEqual(value1, value2)) continue;
|
|
34218
|
+
ret[field.identifier] = value2;
|
|
34219
|
+
}
|
|
34220
|
+
return ret;
|
|
34221
|
+
};
|
|
34222
|
+
const unchangedFieldValues = (fields, values1, values2) => {
|
|
34223
|
+
const ret = {};
|
|
34224
|
+
for (const field of fields) {
|
|
34225
|
+
const value1 = values1[field.identifier];
|
|
34226
|
+
const value2 = values2[field.identifier];
|
|
34227
|
+
if (!field.areValuesEqual(value1, value2)) continue;
|
|
34228
|
+
ret[field.identifier] = value2;
|
|
34229
|
+
}
|
|
34230
|
+
return ret;
|
|
34231
|
+
};
|
|
32791
34232
|
const RendererContext = React.createContext({});
|
|
32792
34233
|
const FieldSectionLayout = React.memo((props) => {
|
|
32793
34234
|
const { fieldSection: section, ...rest } = props;
|
|
@@ -32864,14 +34305,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32864
34305
|
fields: this.fields.map((field) => field.serialize())
|
|
32865
34306
|
};
|
|
32866
34307
|
}
|
|
32867
|
-
static deserialize(data) {
|
|
32868
|
-
const fields = data.fields.map(deserializeField);
|
|
32869
|
-
const conditions = {};
|
|
32870
|
-
for (const [sectionId, serializedConditions] of Object.entries(data.conditions)) {
|
|
32871
|
-
conditions[sectionId] = deserializeConditions(serializedConditions, fields);
|
|
32872
|
-
}
|
|
32873
|
-
return new _FieldSection({ ...data, fields, conditions });
|
|
32874
|
-
}
|
|
32875
34308
|
getOptions() {
|
|
32876
34309
|
return {
|
|
32877
34310
|
...super.getOptions(),
|
|
@@ -32909,12 +34342,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32909
34342
|
getFields() {
|
|
32910
34343
|
return this.fields;
|
|
32911
34344
|
}
|
|
32912
|
-
addField(field) {
|
|
32913
|
-
|
|
32914
|
-
|
|
32915
|
-
|
|
32916
|
-
addFields(fields) {
|
|
32917
|
-
this.fields = this.initFields([...this.fields, ...fields]);
|
|
34345
|
+
addField(field, index) {
|
|
34346
|
+
const copy = [...this.fields];
|
|
34347
|
+
copy.splice(index ?? this.fields.length, 0, field);
|
|
34348
|
+
this.fields = this.initFields(copy);
|
|
32918
34349
|
this.notify(this);
|
|
32919
34350
|
}
|
|
32920
34351
|
moveField(sourceIndex, targetIndex) {
|
|
@@ -32933,16 +34364,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32933
34364
|
this.conditions = newConditions;
|
|
32934
34365
|
this.notify(this);
|
|
32935
34366
|
}
|
|
32936
|
-
removeFields(fields) {
|
|
32937
|
-
const fieldIdentifiers = new Set(fields.map(({ identifier }) => identifier));
|
|
32938
|
-
this.fields = this.initFields(this.fields.filter(({ identifier }) => !fieldIdentifiers.has(identifier)));
|
|
32939
|
-
const newConditions = {};
|
|
32940
|
-
for (const [sectionId, conditions] of Object.entries(this.conditions)) {
|
|
32941
|
-
newConditions[sectionId] = conditions.filter(({ field }) => !fieldIdentifiers.has(field.identifier));
|
|
32942
|
-
}
|
|
32943
|
-
this.conditions = newConditions;
|
|
32944
|
-
this.notify(this);
|
|
32945
|
-
}
|
|
32946
34367
|
getConditions(identifier) {
|
|
32947
34368
|
return this.conditions[identifier];
|
|
32948
34369
|
}
|
|
@@ -32979,7 +34400,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32979
34400
|
return new Set(Object.keys(this.conditions));
|
|
32980
34401
|
}
|
|
32981
34402
|
addConditional(identifier) {
|
|
32982
|
-
this.conditions = this.initConditions({
|
|
34403
|
+
this.conditions = this.initConditions({
|
|
34404
|
+
...this.conditions,
|
|
34405
|
+
[identifier]: []
|
|
34406
|
+
});
|
|
32983
34407
|
this.notify(this);
|
|
32984
34408
|
}
|
|
32985
34409
|
removeConditional(identifier) {
|
|
@@ -32995,6 +34419,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32995
34419
|
};
|
|
32996
34420
|
__publicField(_FieldSection, "fieldTypeName", "Section");
|
|
32997
34421
|
__publicField(_FieldSection, "fieldTypeDescription", "Sections can be useful for grouping fields together. They can also be conditionally shown or hidden.");
|
|
34422
|
+
__publicField(_FieldSection, "deserialize", (data) => {
|
|
34423
|
+
const fields = data.fields.map(deserializeField);
|
|
34424
|
+
const conditions = {};
|
|
34425
|
+
for (const [sectionId, serializedConditions] of Object.entries(data.conditions)) {
|
|
34426
|
+
conditions[sectionId] = deserializeConditions(fields, serializedConditions);
|
|
34427
|
+
}
|
|
34428
|
+
return new _FieldSection({ ...data, fields, conditions });
|
|
34429
|
+
});
|
|
32998
34430
|
let FieldSection = _FieldSection;
|
|
32999
34431
|
class FieldSchema extends Observable {
|
|
33000
34432
|
constructor(fields) {
|
|
@@ -33022,27 +34454,20 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33022
34454
|
getFieldSections() {
|
|
33023
34455
|
return this.fieldSections;
|
|
33024
34456
|
}
|
|
33025
|
-
addFieldSection(
|
|
33026
|
-
|
|
33027
|
-
|
|
33028
|
-
|
|
33029
|
-
addFieldSections(fields) {
|
|
33030
|
-
this.fieldSections = this.initFields([...this.fieldSections, ...fields]);
|
|
34457
|
+
addFieldSection(fieldSection, index) {
|
|
34458
|
+
const copy = [...this.fieldSections];
|
|
34459
|
+
copy.splice(index ?? this.fieldSections.length, 0, fieldSection);
|
|
34460
|
+
this.fieldSections = this.initFields(copy);
|
|
33031
34461
|
this.notify(this);
|
|
33032
34462
|
}
|
|
33033
|
-
removeFieldSection(
|
|
33034
|
-
const newFields = this.fieldSections.filter((f) => f.identifier !==
|
|
33035
|
-
for (const
|
|
33036
|
-
|
|
34463
|
+
removeFieldSection(fieldSection) {
|
|
34464
|
+
const newFields = this.fieldSections.filter((f) => f.identifier !== fieldSection.identifier);
|
|
34465
|
+
for (const field of newFields) {
|
|
34466
|
+
field.removeConditional(field.identifier);
|
|
33037
34467
|
}
|
|
33038
34468
|
this.fieldSections = this.initFields(newFields);
|
|
33039
34469
|
this.notify(this);
|
|
33040
34470
|
}
|
|
33041
|
-
removeFieldSections(fields) {
|
|
33042
|
-
const fieldsIds = new Set(fields.map((f) => f.identifier));
|
|
33043
|
-
this.fieldSections = this.initFields(this.fieldSections.filter((f) => !fieldsIds.has(f.identifier)));
|
|
33044
|
-
this.notify(this);
|
|
33045
|
-
}
|
|
33046
34471
|
moveFieldSection(sourceIndex, targetIndex) {
|
|
33047
34472
|
const newFields = [...this.fieldSections];
|
|
33048
34473
|
const [removedElement] = newFields.splice(sourceIndex, 1);
|
|
@@ -33056,44 +34481,70 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33056
34481
|
serializeValues(values) {
|
|
33057
34482
|
return serializeFieldValues(this.getFields(), values);
|
|
33058
34483
|
}
|
|
34484
|
+
deserializeConditions(conditions) {
|
|
34485
|
+
return deserializeConditions(this.getFields(), conditions);
|
|
34486
|
+
}
|
|
34487
|
+
initializeValues(values) {
|
|
34488
|
+
return initializeFieldValues(this.getFields(), values);
|
|
34489
|
+
}
|
|
33059
34490
|
}
|
|
33060
34491
|
const FieldSchemaContext = React.createContext(new FieldSchema([]));
|
|
33061
34492
|
const FormBuilderContext = React.createContext({});
|
|
34493
|
+
const useFieldTypeItems = (onSelect = () => null) => {
|
|
34494
|
+
return React.useMemo(() => {
|
|
34495
|
+
const entries = Object.entries(FieldTypeToClsMapping);
|
|
34496
|
+
return entries.map(([type, fieldClass]) => ({
|
|
34497
|
+
children: fieldClass.fieldTypeName,
|
|
34498
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: fieldIcons[type] }),
|
|
34499
|
+
value: type,
|
|
34500
|
+
onSelect: () => {
|
|
34501
|
+
onSelect(type);
|
|
34502
|
+
}
|
|
34503
|
+
}));
|
|
34504
|
+
}, [onSelect]);
|
|
34505
|
+
};
|
|
34506
|
+
const CreateFieldDropdownMenu = React.memo((props) => {
|
|
34507
|
+
const { children, variant, size, accentColor, onSelectFieldType, ...rest } = props;
|
|
34508
|
+
const fieldTypeItems = useFieldTypeItems(onSelectFieldType);
|
|
34509
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Root, { ...rest, children: [
|
|
34510
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.ClickTrigger, { children }),
|
|
34511
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Content, { variant, size, accentColor, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Scroll, { children: fieldTypeItems.flat().map((item) => /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Item, { onSelect: item.onSelect, children: [
|
|
34512
|
+
item.icon,
|
|
34513
|
+
item.children
|
|
34514
|
+
] }, item.value)) }) })
|
|
34515
|
+
] });
|
|
34516
|
+
});
|
|
34517
|
+
CreateFieldDropdownMenu.displayName = "CreateFieldDropdownMenu";
|
|
33062
34518
|
const createField = (type) => {
|
|
33063
34519
|
switch (type) {
|
|
33064
34520
|
case "text":
|
|
33065
|
-
return new TextField({
|
|
34521
|
+
return new TextField({ label: "", required: false, identifier: uuid.v4() });
|
|
33066
34522
|
case "boolean":
|
|
33067
34523
|
return new BooleanField({
|
|
33068
|
-
fieldValidators: [],
|
|
33069
34524
|
label: "",
|
|
33070
34525
|
required: false,
|
|
33071
34526
|
identifier: uuid.v4()
|
|
33072
34527
|
});
|
|
33073
34528
|
case "number":
|
|
33074
34529
|
return new NumberField({
|
|
33075
|
-
fieldValidators: [],
|
|
33076
34530
|
label: "",
|
|
33077
34531
|
required: false,
|
|
33078
34532
|
identifier: uuid.v4()
|
|
33079
34533
|
});
|
|
33080
34534
|
case "date":
|
|
33081
34535
|
return new DateField({
|
|
33082
|
-
fieldValidators: [],
|
|
33083
34536
|
label: "",
|
|
33084
34537
|
required: false,
|
|
33085
34538
|
identifier: uuid.v4()
|
|
33086
34539
|
});
|
|
33087
34540
|
case "string":
|
|
33088
34541
|
return new StringField({
|
|
33089
|
-
fieldValidators: [],
|
|
33090
34542
|
label: "",
|
|
33091
34543
|
required: false,
|
|
33092
34544
|
identifier: uuid.v4()
|
|
33093
34545
|
});
|
|
33094
34546
|
case "select":
|
|
33095
34547
|
return new SelectField({
|
|
33096
|
-
fieldValidators: [],
|
|
33097
34548
|
label: "",
|
|
33098
34549
|
options: [],
|
|
33099
34550
|
required: false,
|
|
@@ -33101,14 +34552,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33101
34552
|
});
|
|
33102
34553
|
case "multi-string":
|
|
33103
34554
|
return new MultiStringField({
|
|
33104
|
-
fieldValidators: [],
|
|
33105
34555
|
label: "",
|
|
33106
34556
|
required: false,
|
|
33107
34557
|
identifier: uuid.v4()
|
|
33108
34558
|
});
|
|
33109
34559
|
case "multi-select":
|
|
33110
34560
|
return new MultiSelectField({
|
|
33111
|
-
fieldValidators: [],
|
|
33112
34561
|
label: "",
|
|
33113
34562
|
options: [],
|
|
33114
34563
|
required: false,
|
|
@@ -33116,21 +34565,20 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33116
34565
|
});
|
|
33117
34566
|
case "upload":
|
|
33118
34567
|
return new UploadField({
|
|
33119
|
-
fieldValidators: [],
|
|
33120
34568
|
label: "",
|
|
33121
34569
|
required: false,
|
|
33122
|
-
identifier: uuid.v4()
|
|
34570
|
+
identifier: uuid.v4(),
|
|
34571
|
+
maximum_files: 6,
|
|
34572
|
+
maximum_size: maxFileSizeMB
|
|
33123
34573
|
});
|
|
33124
34574
|
case "qr":
|
|
33125
34575
|
return new ScanField({
|
|
33126
|
-
fieldValidators: [],
|
|
33127
34576
|
label: "",
|
|
33128
34577
|
required: false,
|
|
33129
34578
|
identifier: uuid.v4()
|
|
33130
34579
|
});
|
|
33131
34580
|
case "radio":
|
|
33132
34581
|
return new RadioField({
|
|
33133
|
-
fieldValidators: [],
|
|
33134
34582
|
label: "",
|
|
33135
34583
|
options: [],
|
|
33136
34584
|
required: false,
|
|
@@ -33138,21 +34586,34 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33138
34586
|
});
|
|
33139
34587
|
case "checkbox-list":
|
|
33140
34588
|
return new CheckboxListField({
|
|
33141
|
-
fieldValidators: [],
|
|
33142
34589
|
label: "",
|
|
33143
34590
|
options: [],
|
|
33144
34591
|
required: false,
|
|
33145
34592
|
identifier: uuid.v4()
|
|
33146
34593
|
});
|
|
34594
|
+
case "pass-fail":
|
|
34595
|
+
return new PassFailField({
|
|
34596
|
+
label: "",
|
|
34597
|
+
required: false,
|
|
34598
|
+
identifier: uuid.v4(),
|
|
34599
|
+
showNotesAndFilesOn: ["fail"]
|
|
34600
|
+
// TODO: what defaults
|
|
34601
|
+
});
|
|
33147
34602
|
case "otp":
|
|
33148
34603
|
return new OTPField({
|
|
33149
|
-
fieldValidators: [],
|
|
33150
34604
|
label: "",
|
|
33151
34605
|
validationType: "none",
|
|
33152
34606
|
required: false,
|
|
33153
34607
|
identifier: uuid.v4(),
|
|
33154
34608
|
length: 6
|
|
33155
34609
|
});
|
|
34610
|
+
case "rating":
|
|
34611
|
+
return new RatingField({
|
|
34612
|
+
label: "",
|
|
34613
|
+
required: false,
|
|
34614
|
+
identifier: uuid.v4(),
|
|
34615
|
+
maxRating: 5
|
|
34616
|
+
});
|
|
33156
34617
|
}
|
|
33157
34618
|
};
|
|
33158
34619
|
const createCondition = (field) => {
|
|
@@ -33236,6 +34697,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33236
34697
|
conditionModifier: "equals",
|
|
33237
34698
|
field
|
|
33238
34699
|
});
|
|
34700
|
+
case "pass-fail":
|
|
34701
|
+
return new PassFailFieldCondition({
|
|
34702
|
+
id: uuid.v4(),
|
|
34703
|
+
conditionValue: void 0,
|
|
34704
|
+
conditionModifier: "equals",
|
|
34705
|
+
field
|
|
34706
|
+
});
|
|
33239
34707
|
case "otp":
|
|
33240
34708
|
return new OTPFieldCondition({
|
|
33241
34709
|
id: uuid.v4(),
|
|
@@ -33243,6 +34711,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33243
34711
|
conditionModifier: "equals",
|
|
33244
34712
|
field
|
|
33245
34713
|
});
|
|
34714
|
+
case "rating":
|
|
34715
|
+
return new RatingFieldCondition({
|
|
34716
|
+
id: uuid.v4(),
|
|
34717
|
+
conditionValue: void 0,
|
|
34718
|
+
conditionModifier: "equals",
|
|
34719
|
+
field
|
|
34720
|
+
});
|
|
33246
34721
|
}
|
|
33247
34722
|
};
|
|
33248
34723
|
const getFieldCreationSchema = (type, path) => {
|
|
@@ -33263,8 +34738,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33263
34738
|
return TextField.getFieldCreationSchema(path);
|
|
33264
34739
|
case "upload":
|
|
33265
34740
|
return UploadField.getFieldCreationSchema(path);
|
|
34741
|
+
case "pass-fail":
|
|
34742
|
+
return PassFailField.getFieldCreationSchema(path);
|
|
33266
34743
|
case "otp":
|
|
33267
34744
|
return OTPField.getFieldCreationSchema(path);
|
|
34745
|
+
case "rating":
|
|
34746
|
+
return RatingField.getFieldCreationSchema(path);
|
|
33268
34747
|
default:
|
|
33269
34748
|
return;
|
|
33270
34749
|
}
|
|
@@ -33282,7 +34761,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33282
34761
|
accentColor: "base",
|
|
33283
34762
|
...hasError && { color: SEVERITY_COLOR_MAPPING.danger },
|
|
33284
34763
|
children: [
|
|
33285
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
34764
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Settings }),
|
|
33286
34765
|
"Settings"
|
|
33287
34766
|
]
|
|
33288
34767
|
},
|
|
@@ -33293,7 +34772,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33293
34772
|
});
|
|
33294
34773
|
FieldSettingsPopover.displayName = "FieldSettingsPopover";
|
|
33295
34774
|
const FieldBuilder = React.memo((props) => {
|
|
33296
|
-
const { parentPath,
|
|
34775
|
+
const { parentPath, fieldIndex, field } = props;
|
|
33297
34776
|
const { errors } = formik.useFormikContext();
|
|
33298
34777
|
const openImageViewer = useImageViewer();
|
|
33299
34778
|
const { disableRequiredFields } = React.use(FormBuilderContext);
|
|
@@ -33309,17 +34788,16 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33309
34788
|
const handleImageDelete = React.useCallback(() => {
|
|
33310
34789
|
field.setOptions({ image: void 0 });
|
|
33311
34790
|
}, [field]);
|
|
33312
|
-
const type = field.type;
|
|
33313
34791
|
const [directlyShownFields, popoverFields] = React.useMemo(() => {
|
|
33314
34792
|
const directlyShownFields2 = [];
|
|
33315
34793
|
const popoverFields2 = [];
|
|
33316
|
-
const fieldObject = getFieldCreationSchema(field.type, `${parentPath}.${
|
|
34794
|
+
const fieldObject = getFieldCreationSchema(field.type, `${parentPath}.${fieldIndex}`) ?? [];
|
|
33317
34795
|
for (const item of fieldObject) {
|
|
33318
34796
|
if (item.showDirectly) directlyShownFields2.push(item.field);
|
|
33319
34797
|
else popoverFields2.push(item.field);
|
|
33320
34798
|
}
|
|
33321
34799
|
return [directlyShownFields2, popoverFields2];
|
|
33322
|
-
}, [field, parentPath,
|
|
34800
|
+
}, [field, parentPath, fieldIndex]);
|
|
33323
34801
|
const directlyShownInputs = useFieldInputs(directlyShownFields, {
|
|
33324
34802
|
formId,
|
|
33325
34803
|
disabled: false
|
|
@@ -33344,7 +34822,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33344
34822
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 w-full justify-between", children: [
|
|
33345
34823
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
33346
34824
|
/* @__PURE__ */ jsxRuntime.jsxs(blocks.Badge, { accentColor: "base", variant: "soft", size: "sm", children: [
|
|
33347
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: fieldIcons[type] }),
|
|
34825
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: fieldIcons[field.type] }),
|
|
33348
34826
|
fieldTypeName
|
|
33349
34827
|
] }),
|
|
33350
34828
|
!disableRequiredFields && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -33354,7 +34832,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33354
34832
|
checked: field.required,
|
|
33355
34833
|
onCheckedChange: (required) => field.setOptions({ required: !!required }),
|
|
33356
34834
|
size: "sm",
|
|
33357
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Checkbox.Indicator, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
34835
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Checkbox.Indicator, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Check }) })
|
|
33358
34836
|
}
|
|
33359
34837
|
),
|
|
33360
34838
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "sm", accentColor: "base", children: "Required" })
|
|
@@ -33382,7 +34860,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33382
34860
|
"aria-label": "delete",
|
|
33383
34861
|
onClick: handleImageDelete,
|
|
33384
34862
|
size: "sm",
|
|
33385
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
34863
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Trash })
|
|
33386
34864
|
}
|
|
33387
34865
|
)
|
|
33388
34866
|
] }),
|
|
@@ -33413,46 +34891,25 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33413
34891
|
] });
|
|
33414
34892
|
});
|
|
33415
34893
|
FieldBuilder.displayName = "FieldBuilder";
|
|
33416
|
-
const
|
|
33417
|
-
const {
|
|
33418
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Root, { ...rest, children: [
|
|
33419
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.ClickTrigger, { children }),
|
|
33420
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Content, { variant, size, accentColor, children: fields.map((field) => {
|
|
33421
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Item, { onSelect: () => onSelectField(field), children: [
|
|
33422
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: fieldIcons[field.type] }),
|
|
33423
|
-
field.label || UNLABELLED_FIELD_LABEL
|
|
33424
|
-
] }, field.identifier);
|
|
33425
|
-
}) })
|
|
33426
|
-
] });
|
|
33427
|
-
});
|
|
33428
|
-
FieldDropdownMenu.displayName = "IssueDataFilterMenu";
|
|
33429
|
-
const FieldSectionDropdownMenu = React.memo((props) => {
|
|
33430
|
-
const { children, variant, size, accentColor, fieldSections, onSelectFieldCondition, ...rest } = props;
|
|
33431
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Root, { ...rest, children: [
|
|
33432
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.ClickTrigger, { children }),
|
|
33433
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Content, { variant, size, accentColor, children: fieldSections.map((fieldSection) => {
|
|
33434
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Item, { onSelect: () => onSelectFieldCondition(fieldSection), children: [
|
|
33435
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: fieldIcons[fieldSection.type] }),
|
|
33436
|
-
fieldSection.label || UNLABELLED_SECTION_LABEL
|
|
33437
|
-
] }, fieldSection.identifier);
|
|
33438
|
-
}) })
|
|
33439
|
-
] });
|
|
33440
|
-
});
|
|
33441
|
-
FieldSectionDropdownMenu.displayName = "IssueDataFilterMenu";
|
|
33442
|
-
const FieldWithActions = React.memo((props) => {
|
|
33443
|
-
const { field, fieldSection, index, sectionIndex, remove } = props;
|
|
33444
|
-
const { showError } = blocks.useToast();
|
|
34894
|
+
const FieldBuilderWithActions = React.memo((props) => {
|
|
34895
|
+
const { field, fieldSection, fieldIndex, sectionIndex } = props;
|
|
33445
34896
|
const fileInputRef = React.useRef(null);
|
|
33446
34897
|
const parentPath = `fields.${sectionIndex}.fields`;
|
|
34898
|
+
const handleAddField = React.useCallback(
|
|
34899
|
+
(type) => {
|
|
34900
|
+
fieldSection.addField(createField(type), fieldIndex + 1);
|
|
34901
|
+
},
|
|
34902
|
+
[fieldIndex, fieldSection]
|
|
34903
|
+
);
|
|
33447
34904
|
const duplicateField = React.useCallback(() => {
|
|
33448
34905
|
fieldSection.addField(field.duplicate(uuid.v4()));
|
|
33449
34906
|
}, [field, fieldSection]);
|
|
33450
34907
|
const moveField = React.useCallback(
|
|
33451
34908
|
(direction) => {
|
|
33452
34909
|
const targetIndex = direction === "up" ? sectionIndex - 1 : sectionIndex + 1;
|
|
33453
|
-
fieldSection.moveField(
|
|
34910
|
+
fieldSection.moveField(fieldIndex, targetIndex);
|
|
33454
34911
|
},
|
|
33455
|
-
[fieldSection,
|
|
34912
|
+
[fieldSection, fieldIndex, sectionIndex]
|
|
33456
34913
|
);
|
|
33457
34914
|
const uploadImage = React.useCallback(
|
|
33458
34915
|
(event) => {
|
|
@@ -33461,7 +34918,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33461
34918
|
const file = files.item(0);
|
|
33462
34919
|
if (!file) return;
|
|
33463
34920
|
if (file.size > maxFileSizeB) {
|
|
33464
|
-
|
|
34921
|
+
blocks.toast.error({
|
|
33465
34922
|
title: "File upload error",
|
|
33466
34923
|
description: `The file ${file.name} exceeded the maximum file size`
|
|
33467
34924
|
});
|
|
@@ -33471,7 +34928,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33471
34928
|
image: file
|
|
33472
34929
|
});
|
|
33473
34930
|
},
|
|
33474
|
-
[field
|
|
34931
|
+
[field]
|
|
33475
34932
|
);
|
|
33476
34933
|
const handleMoveUp = React.useCallback(() => {
|
|
33477
34934
|
moveField("up");
|
|
@@ -33484,21 +34941,48 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33484
34941
|
(_a2 = fileInputRef.current) == null ? void 0 : _a2.click();
|
|
33485
34942
|
}, []);
|
|
33486
34943
|
const handleRemove = React.useCallback(() => {
|
|
33487
|
-
|
|
33488
|
-
}, [field,
|
|
34944
|
+
fieldSection.removeField(field);
|
|
34945
|
+
}, [field, fieldSection]);
|
|
33489
34946
|
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Card, { className: "flex items-center justify-between gap-4 w-full", children: [
|
|
33490
|
-
/* @__PURE__ */ jsxRuntime.jsx(FieldBuilder, {
|
|
34947
|
+
/* @__PURE__ */ jsxRuntime.jsx(FieldBuilder, { fieldIndex, field, parentPath }),
|
|
33491
34948
|
/* @__PURE__ */ jsxRuntime.jsxs(blocks.ButtonGroup, { className: "flex-col gap-0.5 flex", variant: "ghost", accentColor: "base", size: "sm", children: [
|
|
33492
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button",
|
|
33493
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick:
|
|
33494
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick:
|
|
33495
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick:
|
|
33496
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick:
|
|
34949
|
+
/* @__PURE__ */ jsxRuntime.jsx(CreateFieldDropdownMenu, { onSelectFieldType: handleAddField, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Plus }) }) }),
|
|
34950
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleMoveUp, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: MoveUp }) }),
|
|
34951
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleMoveDown, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: MoveDown }) }),
|
|
34952
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: duplicateField, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Copy }) }),
|
|
34953
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleUploadImage, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Image }) }),
|
|
34954
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleRemove, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Trash }) })
|
|
33497
34955
|
] }),
|
|
33498
34956
|
/* @__PURE__ */ jsxRuntime.jsx("input", { className: "hidden", ref: fileInputRef, type: "file", accept: "image/*", onChange: uploadImage })
|
|
33499
34957
|
] });
|
|
33500
34958
|
});
|
|
33501
|
-
|
|
34959
|
+
FieldBuilderWithActions.displayName = "FieldBuilderWithActions";
|
|
34960
|
+
const FieldDropdownMenu = React.memo((props) => {
|
|
34961
|
+
const { children, variant, size, accentColor, fields, onSelectField, ...rest } = props;
|
|
34962
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Root, { ...rest, children: [
|
|
34963
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.ClickTrigger, { children }),
|
|
34964
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Content, { variant, size, accentColor, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Scroll, { children: fields.map((field) => {
|
|
34965
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Item, { onSelect: () => onSelectField(field), children: [
|
|
34966
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: fieldIcons[field.type] }),
|
|
34967
|
+
field.label || UNLABELLED_FIELD_LABEL
|
|
34968
|
+
] }, field.identifier);
|
|
34969
|
+
}) }) })
|
|
34970
|
+
] });
|
|
34971
|
+
});
|
|
34972
|
+
FieldDropdownMenu.displayName = "IssueDataFilterMenu";
|
|
34973
|
+
const FieldSectionDropdownMenu = React.memo((props) => {
|
|
34974
|
+
const { children, variant, size, accentColor, fieldSections, onSelectFieldCondition, ...rest } = props;
|
|
34975
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Root, { ...rest, children: [
|
|
34976
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.ClickTrigger, { children }),
|
|
34977
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Content, { variant, size, accentColor, children: fieldSections.map((fieldSection) => {
|
|
34978
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Item, { onSelect: () => onSelectFieldCondition(fieldSection), children: [
|
|
34979
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: fieldIcons[fieldSection.type] }),
|
|
34980
|
+
fieldSection.label || UNLABELLED_SECTION_LABEL
|
|
34981
|
+
] }, fieldSection.identifier);
|
|
34982
|
+
}) })
|
|
34983
|
+
] });
|
|
34984
|
+
});
|
|
34985
|
+
FieldSectionDropdownMenu.displayName = "IssueDataFilterMenu";
|
|
33502
34986
|
const FieldSectionConditionEdgeComponent = React.memo((props) => {
|
|
33503
34987
|
const { id, sourceX, sourceY, targetX, targetY, style, markerEnd, data } = props;
|
|
33504
34988
|
const { targetSection, sourceSection, layoutDirection } = data;
|
|
@@ -33552,7 +35036,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33552
35036
|
variant: "surface",
|
|
33553
35037
|
size: "xs",
|
|
33554
35038
|
accentColor: "base",
|
|
33555
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
35039
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Plus })
|
|
33556
35040
|
}
|
|
33557
35041
|
) }),
|
|
33558
35042
|
/* @__PURE__ */ jsxRuntime.jsxs(blocks.Tooltip.Root, { children: [
|
|
@@ -33566,7 +35050,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33566
35050
|
accentColor: "base",
|
|
33567
35051
|
color: "danger",
|
|
33568
35052
|
onClick: handleDelete,
|
|
33569
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
35053
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Trash })
|
|
33570
35054
|
}
|
|
33571
35055
|
) }),
|
|
33572
35056
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.Tooltip.Content, { size: "sm", children: "Remove conditional logic" })
|
|
@@ -33582,27 +35066,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33582
35066
|
] });
|
|
33583
35067
|
});
|
|
33584
35068
|
FieldSectionConditionEdgeComponent.displayName = "FieldSectionConditionEdgeComponent";
|
|
33585
|
-
const useFieldTypeItems = (onSelect = () => null) => {
|
|
33586
|
-
return React.useMemo(() => {
|
|
33587
|
-
const entries = Object.entries(FieldTypeToClsMapping);
|
|
33588
|
-
return entries.map(([type, fieldClass]) => ({
|
|
33589
|
-
children: fieldClass.fieldTypeName,
|
|
33590
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: fieldIcons[type] }),
|
|
33591
|
-
value: type,
|
|
33592
|
-
onSelect: () => {
|
|
33593
|
-
onSelect(type);
|
|
33594
|
-
}
|
|
33595
|
-
}));
|
|
33596
|
-
}, [onSelect]);
|
|
33597
|
-
};
|
|
33598
35069
|
const FieldSectionNodeComponent = React.memo((props) => {
|
|
33599
35070
|
const { data, selected } = props;
|
|
33600
35071
|
const { fieldSection, index: sectionIndex, layoutDirection } = data;
|
|
33601
35072
|
const fieldSchema = React.use(FieldSchemaContext);
|
|
33602
|
-
const
|
|
35073
|
+
const handleRemoveSection = React.useCallback(() => {
|
|
33603
35074
|
fieldSchema.removeFieldSection(fieldSection);
|
|
33604
35075
|
}, [fieldSchema, fieldSection]);
|
|
33605
|
-
const
|
|
35076
|
+
const handleAddField = React.useCallback(
|
|
33606
35077
|
(type) => {
|
|
33607
35078
|
fieldSection.addField(createField(type));
|
|
33608
35079
|
},
|
|
@@ -33616,13 +35087,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33616
35087
|
const handleDuplicate = React.useCallback(() => {
|
|
33617
35088
|
fieldSchema.addFieldSection(fieldSection.duplicate(uuid.v4()));
|
|
33618
35089
|
}, [fieldSchema, fieldSection]);
|
|
33619
|
-
const fieldTypeItems = useFieldTypeItems(addField);
|
|
33620
|
-
const removeField = React.useCallback(
|
|
33621
|
-
(field) => {
|
|
33622
|
-
fieldSection.removeField(field);
|
|
33623
|
-
},
|
|
33624
|
-
[fieldSection]
|
|
33625
|
-
);
|
|
33626
35090
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
33627
35091
|
blocks.Card,
|
|
33628
35092
|
{
|
|
@@ -33656,25 +35120,18 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33656
35120
|
] }),
|
|
33657
35121
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
33658
35122
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { weight: "bold", children: "Fields" }),
|
|
33659
|
-
/* @__PURE__ */ jsxRuntime.jsxs(blocks.
|
|
33660
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.
|
|
33661
|
-
|
|
33662
|
-
|
|
33663
|
-
] }) }),
|
|
33664
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Scroll, { children: fieldTypeItems.flat().map((item) => /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Item, { onSelect: item.onSelect, children: [
|
|
33665
|
-
item.icon,
|
|
33666
|
-
item.children
|
|
33667
|
-
] }, item.value)) }) })
|
|
33668
|
-
] })
|
|
35123
|
+
/* @__PURE__ */ jsxRuntime.jsx(CreateFieldDropdownMenu, { onSelectFieldType: handleAddField, children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Button, { type: "button", variant: "soft", size: "sm", accentColor: "base", children: [
|
|
35124
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Plus }),
|
|
35125
|
+
" Add field"
|
|
35126
|
+
] }) })
|
|
33669
35127
|
] }),
|
|
33670
35128
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-3", children: fieldSection.fields.map((child, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
33671
|
-
|
|
35129
|
+
FieldBuilderWithActions,
|
|
33672
35130
|
{
|
|
33673
35131
|
field: child,
|
|
33674
35132
|
fieldSection,
|
|
33675
|
-
index,
|
|
33676
|
-
sectionIndex
|
|
33677
|
-
remove: removeField
|
|
35133
|
+
fieldIndex: index,
|
|
35134
|
+
sectionIndex
|
|
33678
35135
|
},
|
|
33679
35136
|
child.identifier
|
|
33680
35137
|
)) })
|
|
@@ -33695,9 +35152,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33695
35152
|
size: "xs",
|
|
33696
35153
|
onClick: (e) => e.stopPropagation(),
|
|
33697
35154
|
children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.ButtonGroup, { className: "flex flex-col gap-2", variant: "surface", size: "xs", accentColor: "base", children: [
|
|
33698
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleAddBranch, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
33699
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleDuplicate, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
33700
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick:
|
|
35155
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleAddBranch, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: GitBranch }) }),
|
|
35156
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleDuplicate, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Copy }) }),
|
|
35157
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleRemoveSection, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Trash }) })
|
|
33701
35158
|
] })
|
|
33702
35159
|
}
|
|
33703
35160
|
)
|
|
@@ -33914,7 +35371,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33914
35371
|
}
|
|
33915
35372
|
),
|
|
33916
35373
|
/* @__PURE__ */ jsxRuntime.jsx(react.Panel, { position: "top-left", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.ButtonGroup, { className: "flex items-center justify-end gap-2", size: "sm", children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Button, { type: "button", variant: "surface", onClick: handleAddSection, children: [
|
|
33917
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
35374
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Plus }),
|
|
33918
35375
|
" Add section"
|
|
33919
35376
|
] }) }) }),
|
|
33920
35377
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Panel, { position: "top-right", className: "flex flex-col items-center gap-2", children: [
|
|
@@ -33928,16 +35385,16 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33928
35385
|
value: layoutDirection,
|
|
33929
35386
|
onValueChange: setLayoutDirection,
|
|
33930
35387
|
children: [
|
|
33931
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.ToggleGroup.IconItem, { className: "rounded-b-none", value: "LR", type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
33932
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.ToggleGroup.IconItem, { className: "rounded-t-none", value: "TB", type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
35388
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.ToggleGroup.IconItem, { className: "rounded-b-none", value: "LR", type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: ArrowLeftRight }) }),
|
|
35389
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.ToggleGroup.IconItem, { className: "rounded-t-none", value: "TB", type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: ArrowDownUp }) })
|
|
33933
35390
|
]
|
|
33934
35391
|
}
|
|
33935
35392
|
),
|
|
33936
35393
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.Separator, { size: "sm" }),
|
|
33937
35394
|
/* @__PURE__ */ jsxRuntime.jsxs(blocks.ButtonGroup, { className: "flex flex-col ", size: "sm", accentColor: "base", variant: "soft", children: [
|
|
33938
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { className: "rounded-b-none", onClick: () => reactFlow == null ? void 0 : reactFlow.zoomIn(), type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
33939
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { onClick: () => reactFlow == null ? void 0 : reactFlow.zoomOut(), radius: "none", type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
33940
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { className: "rounded-t-none", onClick: () => reactFlow == null ? void 0 : reactFlow.fitView(), type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
35395
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { className: "rounded-b-none", onClick: () => reactFlow == null ? void 0 : reactFlow.zoomIn(), type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Plus }) }),
|
|
35396
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { onClick: () => reactFlow == null ? void 0 : reactFlow.zoomOut(), radius: "none", type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Minus }) }),
|
|
35397
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { className: "rounded-t-none", onClick: () => reactFlow == null ? void 0 : reactFlow.fitView(), type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: SquareDashed }) })
|
|
33941
35398
|
] })
|
|
33942
35399
|
] }),
|
|
33943
35400
|
/* @__PURE__ */ jsxRuntime.jsx(react.Panel, { position: "bottom-right", children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.ButtonGroup, { className: "flex items-center justify-end gap-2", size: "sm", children: [
|
|
@@ -33975,7 +35432,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33975
35432
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: fieldIcons.section }),
|
|
33976
35433
|
sourceFieldSection.label ?? UNLABELLED_SECTION_LABEL
|
|
33977
35434
|
] }),
|
|
33978
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleDelete, variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
35435
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleDelete, variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Trash }) })
|
|
33979
35436
|
] }),
|
|
33980
35437
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-max w-full flex-wrap gap-2", children: [
|
|
33981
35438
|
conditions.map((condition) => {
|
|
@@ -33983,7 +35440,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33983
35440
|
onRemove: handleDeleteCondition
|
|
33984
35441
|
});
|
|
33985
35442
|
}),
|
|
33986
|
-
/* @__PURE__ */ jsxRuntime.jsx(FieldDropdownMenu, { fields: sourceFieldSection.fields, onSelectField: handleSelectField, align: "start", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", size: "sm", variant: "soft", accentColor: "base", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
35443
|
+
/* @__PURE__ */ jsxRuntime.jsx(FieldDropdownMenu, { fields: sourceFieldSection.fields, onSelectField: handleSelectField, align: "start", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", size: "sm", variant: "soft", accentColor: "base", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Plus }) }) })
|
|
33987
35444
|
] })
|
|
33988
35445
|
] });
|
|
33989
35446
|
});
|
|
@@ -34045,7 +35502,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34045
35502
|
fieldSections: validFieldSections,
|
|
34046
35503
|
onSelectFieldCondition: handleAddConditional,
|
|
34047
35504
|
children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Button, { type: "button", variant: "soft", size: "sm", className: "w-max", children: [
|
|
34048
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
35505
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Plus }),
|
|
34049
35506
|
"Add condition"
|
|
34050
35507
|
] })
|
|
34051
35508
|
}
|
|
@@ -34065,15 +35522,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34065
35522
|
});
|
|
34066
35523
|
FieldSectionBuilder.displayName = "FieldSectionBuilder";
|
|
34067
35524
|
const FieldSectionWithActions = React.memo((props) => {
|
|
34068
|
-
const { fieldSection,
|
|
35525
|
+
const { fieldSection, sectionIndex } = props;
|
|
34069
35526
|
const fieldSchema = React.use(FieldSchemaContext);
|
|
34070
|
-
const
|
|
34071
|
-
(field) => {
|
|
34072
|
-
fieldSection.removeField(field);
|
|
34073
|
-
},
|
|
34074
|
-
[fieldSection]
|
|
34075
|
-
);
|
|
34076
|
-
const removeSection = React.useCallback(() => {
|
|
35527
|
+
const handleRemoveSection = React.useCallback(() => {
|
|
34077
35528
|
fieldSchema.removeFieldSection(fieldSection);
|
|
34078
35529
|
}, [fieldSchema, fieldSection]);
|
|
34079
35530
|
const moveSection = React.useCallback(
|
|
@@ -34086,7 +35537,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34086
35537
|
const duplicateSection = React.useCallback(() => {
|
|
34087
35538
|
fieldSchema.addFieldSection(fieldSection.duplicate(uuid.v4()));
|
|
34088
35539
|
}, [fieldSchema, fieldSection]);
|
|
34089
|
-
const
|
|
35540
|
+
const handleAddField = React.useCallback(
|
|
34090
35541
|
(type) => {
|
|
34091
35542
|
fieldSection.addField(createField(type));
|
|
34092
35543
|
},
|
|
@@ -34098,42 +35549,34 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34098
35549
|
const handleMoveDown = React.useCallback(() => {
|
|
34099
35550
|
moveSection("down");
|
|
34100
35551
|
}, [moveSection]);
|
|
34101
|
-
const fieldTypeItems = useFieldTypeItems(handleCreateField);
|
|
34102
35552
|
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Card, { variant: "outline", className: "flex items-center justify-between gap-4 w-full", children: [
|
|
34103
35553
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex grow flex-col gap-4 w-full", children: [
|
|
34104
35554
|
/* @__PURE__ */ jsxRuntime.jsx(FieldSectionBuilder, { fieldSection }),
|
|
34105
35555
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 w-full", children: [
|
|
34106
35556
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 justify-between", children: [
|
|
34107
35557
|
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { accentColor: "base", size: "md", children: "Fields" }),
|
|
34108
|
-
/* @__PURE__ */ jsxRuntime.jsxs(blocks.
|
|
34109
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.
|
|
34110
|
-
|
|
34111
|
-
|
|
34112
|
-
] }) }),
|
|
34113
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Menu.Scroll, { children: fieldTypeItems.flat().map((item) => /* @__PURE__ */ jsxRuntime.jsxs(blocks.Menu.Item, { onSelect: item.onSelect, children: [
|
|
34114
|
-
item.icon,
|
|
34115
|
-
item.children
|
|
34116
|
-
] }, item.value)) }) })
|
|
34117
|
-
] })
|
|
35558
|
+
/* @__PURE__ */ jsxRuntime.jsx(CreateFieldDropdownMenu, { onSelectFieldType: handleAddField, children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Button, { type: "button", variant: "soft", size: "sm", children: [
|
|
35559
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Plus }),
|
|
35560
|
+
" Add field"
|
|
35561
|
+
] }) })
|
|
34118
35562
|
] }),
|
|
34119
35563
|
fieldSection.fields.map((child, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
34120
|
-
|
|
35564
|
+
FieldBuilderWithActions,
|
|
34121
35565
|
{
|
|
34122
35566
|
field: child,
|
|
34123
35567
|
fieldSection,
|
|
34124
|
-
index,
|
|
34125
|
-
sectionIndex
|
|
34126
|
-
remove: removeField
|
|
35568
|
+
fieldIndex: index,
|
|
35569
|
+
sectionIndex
|
|
34127
35570
|
},
|
|
34128
35571
|
child.identifier
|
|
34129
35572
|
))
|
|
34130
35573
|
] })
|
|
34131
35574
|
] }),
|
|
34132
35575
|
/* @__PURE__ */ jsxRuntime.jsxs(blocks.ButtonGroup, { className: "flex-col gap-0.5 flex", variant: "ghost", accentColor: "base", size: "sm", children: [
|
|
34133
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleMoveUp, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
34134
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleMoveDown, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
34135
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: duplicateSection, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
34136
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick:
|
|
35576
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleMoveUp, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: MoveUp }) }),
|
|
35577
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleMoveDown, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: MoveDown }) }),
|
|
35578
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: duplicateSection, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Copy }) }),
|
|
35579
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { type: "button", onClick: handleRemoveSection, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Trash }) })
|
|
34137
35580
|
] })
|
|
34138
35581
|
] });
|
|
34139
35582
|
});
|
|
@@ -34182,7 +35625,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34182
35625
|
}
|
|
34183
35626
|
),
|
|
34184
35627
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
34185
|
-
fieldSchema.fieldSections.map((fieldSection, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
35628
|
+
fieldSchema.fieldSections.map((fieldSection, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
35629
|
+
FieldSectionWithActions,
|
|
35630
|
+
{
|
|
35631
|
+
fieldSection,
|
|
35632
|
+
sectionIndex: index
|
|
35633
|
+
},
|
|
35634
|
+
fieldSection.identifier
|
|
35635
|
+
)),
|
|
34186
35636
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
34187
35637
|
blocks.Button,
|
|
34188
35638
|
{
|
|
@@ -34193,7 +35643,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34193
35643
|
size: "sm",
|
|
34194
35644
|
onClick: handleCreateEmptySection,
|
|
34195
35645
|
children: [
|
|
34196
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
35646
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Plus }),
|
|
34197
35647
|
" Add section"
|
|
34198
35648
|
]
|
|
34199
35649
|
}
|
|
@@ -34229,59 +35679,31 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34229
35679
|
}
|
|
34230
35680
|
if (Object.keys(errors).length > 0) return errors;
|
|
34231
35681
|
};
|
|
34232
|
-
const
|
|
34233
|
-
const
|
|
34234
|
-
|
|
34235
|
-
const value = values[field.identifier];
|
|
34236
|
-
ret[field.identifier] = value !== void 0 ? value : field.blankValue();
|
|
34237
|
-
}
|
|
34238
|
-
return ret;
|
|
34239
|
-
};
|
|
34240
|
-
const changedFieldValues = (fields, values1, values2) => {
|
|
34241
|
-
const ret = {};
|
|
34242
|
-
for (const field of fields) {
|
|
34243
|
-
const value1 = values1[field.identifier];
|
|
34244
|
-
const value2 = values2[field.identifier];
|
|
34245
|
-
if (field.areValuesEqual(value1, value2)) continue;
|
|
34246
|
-
ret[field.identifier] = value2;
|
|
34247
|
-
}
|
|
34248
|
-
return ret;
|
|
34249
|
-
};
|
|
34250
|
-
const unchangedFieldValues = (fields, values1, values2) => {
|
|
34251
|
-
const ret = {};
|
|
35682
|
+
const cleanFields = (fields, values) => {
|
|
35683
|
+
const errors = {};
|
|
35684
|
+
const sectionElements = fields.filter((f) => f instanceof FieldSection);
|
|
34252
35685
|
for (const field of fields) {
|
|
34253
|
-
|
|
34254
|
-
|
|
34255
|
-
|
|
34256
|
-
|
|
35686
|
+
if (field instanceof FieldSection) {
|
|
35687
|
+
const conditionalSections = sectionElements.filter((section) => field.identifier in section.conditions);
|
|
35688
|
+
const conditionMet = conditionalSections.length > 0 ? conditionalSections.some(
|
|
35689
|
+
(conditionalSection) => applyConditions(conditionalSection.getConditions(field.identifier), values)
|
|
35690
|
+
) : true;
|
|
35691
|
+
if (conditionMet) continue;
|
|
35692
|
+
} else {
|
|
35693
|
+
if (!(field instanceof BaseField)) {
|
|
35694
|
+
throw new Error("Invalid field type");
|
|
35695
|
+
}
|
|
35696
|
+
const id = field.identifier;
|
|
35697
|
+
const error = field.getError(get(values, id));
|
|
35698
|
+
if (error) set(errors, id, error);
|
|
35699
|
+
}
|
|
34257
35700
|
}
|
|
34258
|
-
return
|
|
34259
|
-
};
|
|
34260
|
-
const isArrayOfFiles = (value) => {
|
|
34261
|
-
return Array.isArray(value) && value[0] instanceof File;
|
|
34262
|
-
};
|
|
34263
|
-
const separateFilesFromFieldValues = (values) => {
|
|
34264
|
-
const files = {};
|
|
34265
|
-
const newValues = {};
|
|
34266
|
-
for (const key in values) {
|
|
34267
|
-
const value = values[key];
|
|
34268
|
-
if (value instanceof File) {
|
|
34269
|
-
files[key] = [value];
|
|
34270
|
-
} else if (isArrayOfFiles(value)) {
|
|
34271
|
-
files[key] = value;
|
|
34272
|
-
} else if (value !== void 0) {
|
|
34273
|
-
newValues[key] = value;
|
|
34274
|
-
}
|
|
34275
|
-
}
|
|
34276
|
-
return { values: newValues, files };
|
|
35701
|
+
if (Object.keys(errors).length > 0) return errors;
|
|
34277
35702
|
};
|
|
34278
|
-
const
|
|
35703
|
+
const separateImagesFromFields = async (fields) => {
|
|
34279
35704
|
const images = {};
|
|
34280
35705
|
const newFields = [];
|
|
34281
35706
|
for (const section of fields) {
|
|
34282
|
-
if (section.type !== "section") {
|
|
34283
|
-
throw new Error(`Expected ISerializedField type to be a section. Got ${section.type} instead.`);
|
|
34284
|
-
}
|
|
34285
35707
|
const { fields: sectionFields } = section;
|
|
34286
35708
|
const newSectionFields = [];
|
|
34287
35709
|
for (const field of sectionFields) {
|
|
@@ -34303,16 +35725,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34303
35725
|
}
|
|
34304
35726
|
return { fields: newFields, images };
|
|
34305
35727
|
};
|
|
34306
|
-
async function
|
|
34307
|
-
const
|
|
35728
|
+
async function awaitFilesAndPromises(values) {
|
|
35729
|
+
const ret = {};
|
|
34308
35730
|
for (const [key, value] of Object.entries(values)) {
|
|
34309
|
-
|
|
34310
|
-
valuesWithoutFiles[key] = await Promise.all(value);
|
|
34311
|
-
} else {
|
|
34312
|
-
valuesWithoutFiles[key] = value;
|
|
34313
|
-
}
|
|
35731
|
+
ret[key] = await Promise.all(value);
|
|
34314
35732
|
}
|
|
34315
|
-
return
|
|
35733
|
+
return ret;
|
|
34316
35734
|
}
|
|
34317
35735
|
const FormRenderer = React.memo(
|
|
34318
35736
|
React.forwardRef((props, ref) => {
|
|
@@ -34341,9 +35759,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34341
35759
|
}, [schema.fields, values]);
|
|
34342
35760
|
const handleSubmit = React.useCallback(
|
|
34343
35761
|
(values2) => {
|
|
34344
|
-
onSubmit == null ? void 0 : onSubmit(
|
|
35762
|
+
void (onSubmit == null ? void 0 : onSubmit(
|
|
34345
35763
|
excludeUnchangedFields ? changedFieldValues(flattenFields(schema.fields), initialValues, values2) : values2
|
|
34346
|
-
);
|
|
35764
|
+
));
|
|
34347
35765
|
},
|
|
34348
35766
|
[excludeUnchangedFields, initialValues, onSubmit, schema.fields]
|
|
34349
35767
|
);
|
|
@@ -34408,13 +35826,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34408
35826
|
variant: "soft",
|
|
34409
35827
|
onClick: onCancel,
|
|
34410
35828
|
children: [
|
|
34411
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
35829
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: X }),
|
|
34412
35830
|
cancelText
|
|
34413
35831
|
]
|
|
34414
35832
|
}
|
|
34415
35833
|
),
|
|
34416
35834
|
/* @__PURE__ */ jsxRuntime.jsxs(blocks.Button, { ...buttonProps, type: "submit", accentColor: "primary", variant: "surface", children: [
|
|
34417
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon:
|
|
35835
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.LuIcon, { icon: Check }),
|
|
34418
35836
|
submitText
|
|
34419
35837
|
] })
|
|
34420
35838
|
] })
|
|
@@ -34453,43 +35871,39 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34453
35871
|
enableReinitialize = false,
|
|
34454
35872
|
disableRequiredFields = false
|
|
34455
35873
|
} = props;
|
|
34456
|
-
const
|
|
34457
|
-
|
|
34458
|
-
|
|
34459
|
-
|
|
34460
|
-
|
|
34461
|
-
|
|
34462
|
-
|
|
34463
|
-
|
|
34464
|
-
|
|
34465
|
-
|
|
34466
|
-
|
|
34467
|
-
const
|
|
34468
|
-
|
|
34469
|
-
|
|
34470
|
-
|
|
34471
|
-
|
|
34472
|
-
|
|
34473
|
-
|
|
34474
|
-
|
|
34475
|
-
|
|
34476
|
-
|
|
34477
|
-
|
|
34478
|
-
|
|
34479
|
-
|
|
34480
|
-
|
|
34481
|
-
|
|
34482
|
-
|
|
34483
|
-
|
|
34484
|
-
|
|
34485
|
-
|
|
34486
|
-
|
|
34487
|
-
|
|
34488
|
-
|
|
34489
|
-
}
|
|
34490
|
-
},
|
|
34491
|
-
[showError]
|
|
34492
|
-
);
|
|
35874
|
+
const validate = React.useCallback((form) => {
|
|
35875
|
+
var _a2;
|
|
35876
|
+
const errors = {};
|
|
35877
|
+
if (!form.title) {
|
|
35878
|
+
errors.title = "Title is required.";
|
|
35879
|
+
}
|
|
35880
|
+
if (!form.fields || form.fields.length === 0) {
|
|
35881
|
+
errors.fields = "At least one field is required.";
|
|
35882
|
+
}
|
|
35883
|
+
const fieldsToValidate = [];
|
|
35884
|
+
for (const [sectionIndex, section] of form.fields.entries())
|
|
35885
|
+
for (const [fieldIndex, field] of section.fields.entries()) {
|
|
35886
|
+
const fieldSettings = ((_a2 = getFieldCreationSchema(field.type, `fields.${sectionIndex}.fields.${fieldIndex}`)) == null ? void 0 : _a2.map(
|
|
35887
|
+
({ field: field2 }) => field2
|
|
35888
|
+
)) ?? [];
|
|
35889
|
+
fieldsToValidate.push(...fieldSettings);
|
|
35890
|
+
}
|
|
35891
|
+
const values = {};
|
|
35892
|
+
for (const field of fieldsToValidate) {
|
|
35893
|
+
values[field.identifier] = get(form, field.identifier);
|
|
35894
|
+
}
|
|
35895
|
+
const fieldErrors = validateFields(fieldsToValidate, values);
|
|
35896
|
+
if (fieldErrors) {
|
|
35897
|
+
errors.fields = fieldErrors.fields;
|
|
35898
|
+
}
|
|
35899
|
+
if (Object.keys(errors).length > 0) {
|
|
35900
|
+
blocks.toast.error({
|
|
35901
|
+
title: "Some form settings are invalid",
|
|
35902
|
+
description: "Please check settings highlighted in red."
|
|
35903
|
+
});
|
|
35904
|
+
return errors;
|
|
35905
|
+
}
|
|
35906
|
+
}, []);
|
|
34493
35907
|
const initialValues = React.useMemo(
|
|
34494
35908
|
() => ({
|
|
34495
35909
|
title: initialTitle ?? "",
|
|
@@ -34508,7 +35922,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34508
35922
|
});
|
|
34509
35923
|
const observer = React.useCallback(
|
|
34510
35924
|
(fieldSchema) => {
|
|
34511
|
-
formik$1.setFieldValue("fields", fieldSchema.serialize());
|
|
35925
|
+
void formik$1.setFieldValue("fields", fieldSchema.serialize());
|
|
34512
35926
|
},
|
|
34513
35927
|
[formik$1]
|
|
34514
35928
|
);
|
|
@@ -34549,6 +35963,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34549
35963
|
exports2.CheckboxListFieldCondition = CheckboxListFieldCondition;
|
|
34550
35964
|
exports2.CheckboxListFieldConditionCell = CheckboxListFieldConditionCell;
|
|
34551
35965
|
exports2.CheckboxListInput = CheckboxListInput;
|
|
35966
|
+
exports2.ConditionManager = ConditionManager;
|
|
34552
35967
|
exports2.DateAfterConditionModifier = DateAfterConditionModifier;
|
|
34553
35968
|
exports2.DateBeforeConditionModifier = DateBeforeConditionModifier;
|
|
34554
35969
|
exports2.DateEqualsConditionModifier = DateEqualsConditionModifier;
|
|
@@ -34599,10 +36014,23 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34599
36014
|
exports2.OTPFieldCondition = OTPFieldCondition;
|
|
34600
36015
|
exports2.OTPFieldConditionCell = OTPFieldConditionCell;
|
|
34601
36016
|
exports2.OTPInput = OTPInput;
|
|
36017
|
+
exports2.Observable = Observable;
|
|
36018
|
+
exports2.PassFailArrayExcludesConditionModifier = PassFailArrayExcludesConditionModifier;
|
|
36019
|
+
exports2.PassFailArrayIncludesConditionModifier = PassFailArrayIncludesConditionModifier;
|
|
36020
|
+
exports2.PassFailEqualsConditionModifier = PassFailEqualsConditionModifier;
|
|
36021
|
+
exports2.PassFailField = PassFailField;
|
|
36022
|
+
exports2.PassFailFieldCondition = PassFailFieldCondition;
|
|
36023
|
+
exports2.PassFailFieldConditionCell = PassFailFieldConditionCell;
|
|
36024
|
+
exports2.PassFailInput = PassFailInput;
|
|
36025
|
+
exports2.PassFailNotEqualsConditionModifier = PassFailNotEqualsConditionModifier;
|
|
34602
36026
|
exports2.RadioField = RadioField;
|
|
34603
36027
|
exports2.RadioFieldCondition = RadioFieldCondition;
|
|
34604
36028
|
exports2.RadioFieldConditionCell = RadioFieldConditionCell;
|
|
34605
36029
|
exports2.RadioInput = RadioInput;
|
|
36030
|
+
exports2.RatingField = RatingField;
|
|
36031
|
+
exports2.RatingFieldCondition = RatingFieldCondition;
|
|
36032
|
+
exports2.RatingFieldConditionCell = RatingFieldConditionCell;
|
|
36033
|
+
exports2.RatingInput = RatingInput;
|
|
34606
36034
|
exports2.SEVERITY_COLOR_MAPPING = SEVERITY_COLOR_MAPPING;
|
|
34607
36035
|
exports2.SHORT_TEXT_FIELD_MAX_LENGTH = SHORT_TEXT_FIELD_MAX_LENGTH;
|
|
34608
36036
|
exports2.ScanField = ScanField;
|
|
@@ -34634,15 +36062,19 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34634
36062
|
exports2.TextFieldCondition = TextFieldCondition;
|
|
34635
36063
|
exports2.TextFieldConditionCell = TextFieldConditionCell;
|
|
34636
36064
|
exports2.TextInput = TextInput;
|
|
36065
|
+
exports2.UUIDFile = UUIDFile;
|
|
34637
36066
|
exports2.UUIDPromise = UUIDPromise;
|
|
34638
36067
|
exports2.UploadField = UploadField;
|
|
34639
36068
|
exports2.UploadFieldCondition = UploadFieldCondition;
|
|
34640
36069
|
exports2.UploadFieldConditionCell = UploadFieldConditionCell;
|
|
34641
36070
|
exports2.UploadInput = UploadInput;
|
|
34642
36071
|
exports2.applyConditions = applyConditions;
|
|
34643
|
-
exports2.
|
|
36072
|
+
exports2.areFileAndPromiseArraysEqual = areFileAndPromiseArraysEqual;
|
|
36073
|
+
exports2.arePassFieldValuesEqual = arePassFieldValuesEqual;
|
|
36074
|
+
exports2.awaitFilesAndPromises = awaitFilesAndPromises;
|
|
34644
36075
|
exports2.changedFieldValues = changedFieldValues;
|
|
34645
36076
|
exports2.cleanFieldValues = cleanFieldValues;
|
|
36077
|
+
exports2.cleanFields = cleanFields;
|
|
34646
36078
|
exports2.cleanSerializedFieldValues = cleanSerializedFieldValues;
|
|
34647
36079
|
exports2.createCondition = createCondition;
|
|
34648
36080
|
exports2.createConditionModifierConfig = createConditionModifierConfig;
|
|
@@ -34654,18 +36086,28 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34654
36086
|
exports2.deserializeFieldValues = deserializeFieldValues;
|
|
34655
36087
|
exports2.deserializeFields = deserializeFields;
|
|
34656
36088
|
exports2.deserializeOnlyFields = deserializeOnlyFields;
|
|
36089
|
+
exports2.deserializePassFailFieldValue = deserializePassFailFieldValue;
|
|
36090
|
+
exports2.extractFilesAndPromisesFromFieldValues = extractFilesAndPromisesFromFieldValues;
|
|
34657
36091
|
exports2.fieldIcons = fieldIcons;
|
|
34658
36092
|
exports2.flattenFields = flattenFields;
|
|
34659
36093
|
exports2.getFieldsMapping = getFieldsMapping;
|
|
34660
36094
|
exports2.initializeFieldValues = initializeFieldValues;
|
|
36095
|
+
exports2.insertFilesAndPromisesToFieldValues = insertFilesAndPromisesToFieldValues;
|
|
36096
|
+
exports2.isFileAndPromiseArray = isFileAndPromiseArray;
|
|
36097
|
+
exports2.isPassFailFieldStatus = isPassFailFieldStatus;
|
|
36098
|
+
exports2.isPassFailFieldValue = isPassFailFieldValue;
|
|
36099
|
+
exports2.isSerializedPassFailFieldValue = isSerializedPassFailFieldValue;
|
|
34661
36100
|
exports2.isStringArray = isStringArray;
|
|
34662
36101
|
exports2.maxFileSizeB = maxFileSizeB;
|
|
34663
36102
|
exports2.maxFileSizeKB = maxFileSizeKB;
|
|
34664
36103
|
exports2.maxFileSizeMB = maxFileSizeMB;
|
|
34665
|
-
exports2.
|
|
34666
|
-
exports2.
|
|
36104
|
+
exports2.passFailFieldStatusMapping = passFailFieldStatusMapping;
|
|
36105
|
+
exports2.passFailFieldStatuses = passFailFieldStatuses;
|
|
36106
|
+
exports2.separateImagesFromFields = separateImagesFromFields;
|
|
34667
36107
|
exports2.serializeFieldValues = serializeFieldValues;
|
|
36108
|
+
exports2.serializePassFailFieldValue = serializePassFailFieldValue;
|
|
34668
36109
|
exports2.unchangedFieldValues = unchangedFieldValues;
|
|
36110
|
+
exports2.useConditionManager = useConditionManager;
|
|
34669
36111
|
exports2.useFieldInput = useFieldInput;
|
|
34670
36112
|
exports2.useFieldInputs = useFieldInputs;
|
|
34671
36113
|
exports2.useFormikInput = useFormikInput;
|
|
@@ -34674,3 +36116,4 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34674
36116
|
exports2.validateFields = validateFields;
|
|
34675
36117
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
34676
36118
|
});
|
|
36119
|
+
//# sourceMappingURL=forms.umd.cjs.map
|