@algolia/satellite 2.9.1 → 2.11.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/cjs/Actions/Accordion/Accordion.js +1 -2
- package/dist/cjs/Actions/Accordion/Accordion.styles.d.ts +2 -2
- package/dist/cjs/Actions/Accordion/Accordion.styles.js +23 -23
- package/dist/cjs/Actions/Button/PolymorphicButton.js +1 -2
- package/dist/cjs/Actions/Button/styles.js +4 -4
- package/dist/cjs/Actions/IconButtonWithFeedback/IconButtonWithFeedback.js +1 -1
- package/dist/cjs/Actions/ToggleButton/ToggleButtonBase.js +2 -2
- package/dist/cjs/Actions/ToggleGroup/ToggleGroup.js +1 -2
- package/dist/cjs/Chat/ChatCodeDisplay/ChatCodeDisplay.js +2 -3
- package/dist/cjs/Chat/ChatCodeDisplay/ChatCodeDisplay.styles.d.ts +4 -4
- package/dist/cjs/Chat/ChatContextAccordion/ChatContextAccordion.styles.d.ts +2 -2
- package/dist/cjs/Chat/ChatContextContainer/ChatContextContainer.styles.d.ts +2 -2
- package/dist/cjs/Chat/ChatMessage/ChatMessage.js +1 -1
- package/dist/cjs/Chat/ChatMessage/ChatMessage.styles.d.ts +2 -2
- package/dist/cjs/Chat/ChatMessage/ChatMessage.styles.js +10 -10
- package/dist/cjs/Chat/ChatMessageError/ChatMessageError.styles.d.ts +3 -3
- package/dist/cjs/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +3 -3
- package/dist/cjs/Chat/ChatMessages/ChatMessages.styles.d.ts +2 -2
- package/dist/cjs/Chat/ChatPrompt/ChatPrompt.styles.d.ts +2 -2
- package/dist/cjs/Fields/AutoComplete/AutoComplete.js +14 -14
- package/dist/cjs/Fields/DatePicker/components/Popover.js +2 -3
- package/dist/cjs/Fields/Dropzone/Dropzone.js +5 -5
- package/dist/cjs/Fields/FilePicker/FilePicker.js +4 -4
- package/dist/cjs/Fields/Form/stories/AsynchronousValidation.js +17 -18
- package/dist/cjs/Fields/Form/stories/Complex.js +67 -68
- package/dist/cjs/Fields/Form/stories/DependentFieldsValidation.js +9 -10
- package/dist/cjs/Fields/Form/stories/DirtyFields.js +18 -19
- package/dist/cjs/Fields/Form/stories/DynamicFieldsValidation.js +19 -20
- package/dist/cjs/Fields/Form/stories/ExtraErrors.js +13 -14
- package/dist/cjs/Fields/Form/stories/FieldArrays.js +23 -24
- package/dist/cjs/Fields/Form/stories/JSONForms.js +79 -79
- package/dist/cjs/Fields/Form/stories/MultiStep.js +72 -73
- package/dist/cjs/Fields/Form/stories/ValidationStrategies.js +15 -16
- package/dist/cjs/Fields/Input/Input.js +10 -10
- package/dist/cjs/Fields/SelectableCard/SelectableCard.js +9 -9
- package/dist/cjs/Fields/Switch/Switch.tailwind.js +4 -1
- package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +2 -2
- package/dist/cjs/Icons/AmexCardIcon.d.ts +2 -0
- package/dist/cjs/Icons/AmexCardIcon.js +34 -0
- package/dist/cjs/Icons/DiscoverCardIcon.d.ts +2 -0
- package/dist/cjs/Icons/DiscoverCardIcon.js +34 -0
- package/dist/cjs/Icons/MasterCardIcon.d.ts +2 -0
- package/dist/cjs/Icons/MasterCardIcon.js +34 -0
- package/dist/cjs/Icons/VisaCardIcon.d.ts +2 -0
- package/dist/cjs/Icons/VisaCardIcon.js +34 -0
- package/dist/cjs/Icons/index.d.ts +5 -1
- package/dist/cjs/Icons/index.js +34 -0
- package/dist/cjs/Indicators/Avatars/utils.js +4 -4
- package/dist/cjs/Indicators/Badge/Badge.js +4 -4
- package/dist/cjs/Indicators/Banners/Alert/Alert.js +13 -13
- package/dist/cjs/Indicators/Banners/Promote/Promote.js +4 -4
- package/dist/cjs/Indicators/EmptyState/EmptyState.js +16 -16
- package/dist/cjs/Indicators/Medallion/Medallion.js +3 -3
- package/dist/cjs/Indicators/ProgressBar/ProgressBar.js +1 -2
- package/dist/cjs/Indicators/Separator/Separator.js +1 -2
- package/dist/cjs/Indicators/Tag/Tag.js +10 -10
- package/dist/cjs/Indicators/Toast/Toast.js +12 -13
- package/dist/cjs/Indicators/Toast/Toasts.js +2 -3
- package/dist/cjs/Layout/CollapsibleCard/CollapsibleCard.js +1 -2
- package/dist/cjs/Layout/FlexGrid/FlexGrid.js +11 -11
- package/dist/cjs/Layout/Tables/DataTable/DataTable.js +3 -3
- package/dist/cjs/Navigation/Stepper/Step.js +12 -12
- package/dist/cjs/Navigation/Tabs/components/LinkTab.js +6 -6
- package/dist/cjs/Overlay/MenuButton/MenuButton.d.ts +1 -1
- package/dist/cjs/Overlay/MenuButton/MenuButton.js +1 -2
- package/dist/cjs/Overlay/MenuButton/components/Content.js +1 -1
- package/dist/cjs/Overlay/MenuButton/components/CustomTrigger.js +1 -2
- package/dist/cjs/Overlay/MenuButton/components/DefaultTrigger.js +1 -2
- package/dist/cjs/Overlay/MenuButton/components/Divider.js +1 -2
- package/dist/cjs/Overlay/MenuButton/components/collapsible/CollapsibleItem.js +1 -2
- package/dist/cjs/Overlay/MenuButton/components/items/Item.js +1 -2
- package/dist/cjs/Overlay/MenuButton/components/items/LinkItem.js +1 -2
- package/dist/cjs/Overlay/MenuButton/components/items/RadioItem.js +1 -2
- package/dist/cjs/Overlay/MenuButton/components/items/ToggleItem.js +1 -2
- package/dist/cjs/Overlay/Modal/Modal.js +9 -10
- package/dist/cjs/Overlay/Popover/Popover.js +2 -3
- package/dist/cjs/Overlay/TooltipWrapper/TooltipWrapper.js +2 -3
- package/dist/cjs/utils/getTextFromReactNode.js +1 -1
- package/dist/cjs/utils/onlyText.js +2 -2
- package/dist/esm/Actions/Accordion/Accordion.styles.d.ts +2 -2
- package/dist/esm/Actions/Accordion/Accordion.styles.js +23 -23
- package/dist/esm/Actions/Button/styles.js +4 -4
- package/dist/esm/Actions/IconButtonWithFeedback/IconButtonWithFeedback.js +1 -1
- package/dist/esm/Actions/ToggleButton/ToggleButtonBase.js +2 -2
- package/dist/esm/Chat/ChatCodeDisplay/ChatCodeDisplay.js +1 -1
- package/dist/esm/Chat/ChatCodeDisplay/ChatCodeDisplay.styles.d.ts +4 -4
- package/dist/esm/Chat/ChatContextAccordion/ChatContextAccordion.styles.d.ts +2 -2
- package/dist/esm/Chat/ChatContextContainer/ChatContextContainer.styles.d.ts +2 -2
- package/dist/esm/Chat/ChatMessage/ChatMessage.js +1 -1
- package/dist/esm/Chat/ChatMessage/ChatMessage.styles.d.ts +2 -2
- package/dist/esm/Chat/ChatMessage/ChatMessage.styles.js +10 -10
- package/dist/esm/Chat/ChatMessageError/ChatMessageError.styles.d.ts +3 -3
- package/dist/esm/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +3 -3
- package/dist/esm/Chat/ChatMessages/ChatMessages.styles.d.ts +2 -2
- package/dist/esm/Chat/ChatPrompt/ChatPrompt.styles.d.ts +2 -2
- package/dist/esm/Fields/AutoComplete/AutoComplete.js +14 -14
- package/dist/esm/Fields/DatePicker/components/Popover.js +1 -1
- package/dist/esm/Fields/Dropzone/Dropzone.js +5 -5
- package/dist/esm/Fields/FilePicker/FilePicker.js +4 -4
- package/dist/esm/Fields/Form/stories/AsynchronousValidation.js +16 -16
- package/dist/esm/Fields/Form/stories/Complex.js +66 -66
- package/dist/esm/Fields/Form/stories/DependentFieldsValidation.js +8 -8
- package/dist/esm/Fields/Form/stories/DirtyFields.js +17 -17
- package/dist/esm/Fields/Form/stories/DynamicFieldsValidation.js +18 -18
- package/dist/esm/Fields/Form/stories/ExtraErrors.js +12 -12
- package/dist/esm/Fields/Form/stories/FieldArrays.js +22 -22
- package/dist/esm/Fields/Form/stories/JSONForms.js +79 -79
- package/dist/esm/Fields/Form/stories/MultiStep.js +71 -71
- package/dist/esm/Fields/Form/stories/ValidationStrategies.js +14 -14
- package/dist/esm/Fields/Input/Input.js +10 -10
- package/dist/esm/Fields/SelectableCard/SelectableCard.js +9 -9
- package/dist/esm/Fields/Switch/Switch.tailwind.js +4 -1
- package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +2 -2
- package/dist/esm/Icons/AmexCardIcon.d.ts +2 -0
- package/dist/esm/Icons/AmexCardIcon.js +27 -0
- package/dist/esm/Icons/DiscoverCardIcon.d.ts +2 -0
- package/dist/esm/Icons/DiscoverCardIcon.js +27 -0
- package/dist/esm/Icons/MasterCardIcon.d.ts +2 -0
- package/dist/esm/Icons/MasterCardIcon.js +27 -0
- package/dist/esm/Icons/VisaCardIcon.d.ts +2 -0
- package/dist/esm/Icons/VisaCardIcon.js +27 -0
- package/dist/esm/Icons/index.d.ts +5 -1
- package/dist/esm/Icons/index.js +5 -1
- package/dist/esm/Indicators/Avatars/utils.js +4 -4
- package/dist/esm/Indicators/Badge/Badge.js +4 -4
- package/dist/esm/Indicators/Banners/Alert/Alert.js +13 -13
- package/dist/esm/Indicators/Banners/Promote/Promote.js +4 -4
- package/dist/esm/Indicators/EmptyState/EmptyState.js +16 -16
- package/dist/esm/Indicators/Medallion/Medallion.js +3 -3
- package/dist/esm/Indicators/Tag/Tag.js +10 -10
- package/dist/esm/Indicators/Toast/Toast.js +11 -11
- package/dist/esm/Indicators/Toast/Toasts.js +1 -1
- package/dist/esm/Layout/FlexGrid/FlexGrid.js +11 -11
- package/dist/esm/Layout/Tables/DataTable/DataTable.js +3 -3
- package/dist/esm/Navigation/Stepper/Step.js +12 -12
- package/dist/esm/Navigation/Tabs/components/LinkTab.js +6 -6
- package/dist/esm/Overlay/MenuButton/MenuButton.d.ts +1 -1
- package/dist/esm/Overlay/MenuButton/components/Content.js +1 -1
- package/dist/esm/Overlay/Modal/Modal.js +8 -8
- package/dist/esm/Overlay/Popover/Popover.js +1 -1
- package/dist/esm/Overlay/TooltipWrapper/TooltipWrapper.js +1 -1
- package/dist/esm/utils/getTextFromReactNode.js +1 -1
- package/dist/esm/utils/onlyText.js +2 -2
- package/dist/satellite.min.css +1 -1
- package/package.json +19 -28
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject0, _templateObject1, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28;
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
@@ -152,7 +152,7 @@ export var RHFDirtyFieldsComponent = function RHFDirtyFieldsComponent() {
|
|
|
152
152
|
labelFor: "phoneNumber",
|
|
153
153
|
description: "Please enter your phone number",
|
|
154
154
|
state: getFieldState("phoneNumber"),
|
|
155
|
-
className: cx(stl(
|
|
155
|
+
className: cx(stl(_templateObject0 || (_templateObject0 = _taggedTemplateLiteral(["w-full"]))), isFieldDirty("phoneNumber") && stl(_templateObject1 || (_templateObject1 = _taggedTemplateLiteral(["text-xenon-500"])))),
|
|
156
156
|
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
157
157
|
id: "phoneNumber",
|
|
158
158
|
placeholder: "Phone number",
|
|
@@ -161,7 +161,7 @@ export var RHFDirtyFieldsComponent = function RHFDirtyFieldsComponent() {
|
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
}), /*#__PURE__*/_jsxs("div", {
|
|
164
|
-
className: stl(
|
|
164
|
+
className: stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["flex gap-2"]))),
|
|
165
165
|
children: [/*#__PURE__*/_jsx(FormSubmit, {
|
|
166
166
|
variant: "primary",
|
|
167
167
|
"aria-label": "Save updated changes",
|
|
@@ -178,13 +178,13 @@ export var RHFDirtyFieldsComponent = function RHFDirtyFieldsComponent() {
|
|
|
178
178
|
}), dirtyFieldsNb > 0 && /*#__PURE__*/_jsxs(Alert, {
|
|
179
179
|
variant: "accent",
|
|
180
180
|
icon: InfoIcon,
|
|
181
|
-
className: stl(
|
|
181
|
+
className: stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["w-full"]))),
|
|
182
182
|
children: [dirtyFieldsNb, " updated fields"]
|
|
183
183
|
})]
|
|
184
184
|
}), /*#__PURE__*/_jsx("hr", {
|
|
185
|
-
className: stl(
|
|
185
|
+
className: stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["text-grey-500"])))
|
|
186
186
|
}), /*#__PURE__*/_jsx("code", {
|
|
187
|
-
className: stl(
|
|
187
|
+
className: stl(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["whitespace-pre display-code"]))),
|
|
188
188
|
children: JSON.stringify(formData, null, 2)
|
|
189
189
|
})]
|
|
190
190
|
})
|
|
@@ -246,9 +246,9 @@ export var FormikDirtyFieldsComponent = function FormikDirtyFieldsComponent() {
|
|
|
246
246
|
}, 0);
|
|
247
247
|
useFormikAutoFocusOnError(formik);
|
|
248
248
|
return /*#__PURE__*/_jsx("div", {
|
|
249
|
-
className: stl(
|
|
249
|
+
className: stl(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["@container w-full flex justify-center"]))),
|
|
250
250
|
children: /*#__PURE__*/_jsxs("div", {
|
|
251
|
-
className: stl(
|
|
251
|
+
className: stl(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["flex flex-col gap-8 w-full @lg:w-1/2"]))),
|
|
252
252
|
children: [/*#__PURE__*/_jsxs(Form, {
|
|
253
253
|
onSubmit: function onSubmit(e) {
|
|
254
254
|
setRevalidationEnabled(true);
|
|
@@ -258,13 +258,13 @@ export var FormikDirtyFieldsComponent = function FormikDirtyFieldsComponent() {
|
|
|
258
258
|
setRevalidationEnabled(false);
|
|
259
259
|
formik.handleReset(e);
|
|
260
260
|
},
|
|
261
|
-
className: stl(
|
|
261
|
+
className: stl(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["flex flex-col items-start gap-6 min-w-72"]))),
|
|
262
262
|
children: [/*#__PURE__*/_jsx(FormErrorMessage, {}), /*#__PURE__*/_jsx(Field, {
|
|
263
263
|
label: "Name",
|
|
264
264
|
labelFor: "name",
|
|
265
265
|
description: "Please enter your name",
|
|
266
266
|
state: getFieldState("name"),
|
|
267
|
-
className: cx(stl(
|
|
267
|
+
className: cx(stl(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["w-full"]))), isFieldDirty("name") && stl(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["text-xenon-500"])))),
|
|
268
268
|
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
269
269
|
id: "name",
|
|
270
270
|
placeholder: "Name",
|
|
@@ -275,7 +275,7 @@ export var FormikDirtyFieldsComponent = function FormikDirtyFieldsComponent() {
|
|
|
275
275
|
labelFor: "email",
|
|
276
276
|
description: "Please enter your email",
|
|
277
277
|
state: getFieldState("email"),
|
|
278
|
-
className: cx(stl(
|
|
278
|
+
className: cx(stl(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["w-full"]))), isFieldDirty("email") && stl(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["text-xenon-500"])))),
|
|
279
279
|
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
280
280
|
id: "email",
|
|
281
281
|
placeholder: "Email",
|
|
@@ -286,7 +286,7 @@ export var FormikDirtyFieldsComponent = function FormikDirtyFieldsComponent() {
|
|
|
286
286
|
labelFor: "company",
|
|
287
287
|
description: "Please enter your company",
|
|
288
288
|
state: getFieldState("company"),
|
|
289
|
-
className: cx(stl(
|
|
289
|
+
className: cx(stl(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["w-full"]))), isFieldDirty("company") && stl(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["text-xenon-500"])))),
|
|
290
290
|
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
291
291
|
id: "company",
|
|
292
292
|
placeholder: "Company",
|
|
@@ -297,14 +297,14 @@ export var FormikDirtyFieldsComponent = function FormikDirtyFieldsComponent() {
|
|
|
297
297
|
labelFor: "phoneNumber",
|
|
298
298
|
description: "Please enter your phone number",
|
|
299
299
|
state: getFieldState("phoneNumber"),
|
|
300
|
-
className: cx(stl(
|
|
300
|
+
className: cx(stl(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["w-full"]))), isFieldDirty("phoneNumber") && stl(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["text-xenon-500"])))),
|
|
301
301
|
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
302
302
|
id: "phoneNumber",
|
|
303
303
|
placeholder: "Phone number",
|
|
304
304
|
required: true
|
|
305
305
|
}, formik.getFieldProps("phoneNumber")))
|
|
306
306
|
}), /*#__PURE__*/_jsxs("div", {
|
|
307
|
-
className: stl(
|
|
307
|
+
className: stl(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["flex gap-2"]))),
|
|
308
308
|
children: [/*#__PURE__*/_jsx(FormSubmit, {
|
|
309
309
|
variant: "primary",
|
|
310
310
|
"aria-label": "Save updated changes",
|
|
@@ -321,13 +321,13 @@ export var FormikDirtyFieldsComponent = function FormikDirtyFieldsComponent() {
|
|
|
321
321
|
}), dirtyFieldsNb > 0 && /*#__PURE__*/_jsxs(Alert, {
|
|
322
322
|
variant: "accent",
|
|
323
323
|
icon: InfoIcon,
|
|
324
|
-
className: stl(
|
|
324
|
+
className: stl(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["w-full"]))),
|
|
325
325
|
children: [dirtyFieldsNb, " updated fields"]
|
|
326
326
|
})]
|
|
327
327
|
}), /*#__PURE__*/_jsx("hr", {
|
|
328
|
-
className: stl(
|
|
328
|
+
className: stl(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["text-grey-500"])))
|
|
329
329
|
}), /*#__PURE__*/_jsx("code", {
|
|
330
|
-
className: stl(
|
|
330
|
+
className: stl(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["whitespace-pre display-code"]))),
|
|
331
331
|
children: JSON.stringify(formData, null, 2)
|
|
332
332
|
})]
|
|
333
333
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject0, _templateObject1, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28;
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
@@ -196,7 +196,7 @@ export var RHFDynamicFieldsValidationComponent = function RHFDynamicFieldsValida
|
|
|
196
196
|
labelFor: "schoolName",
|
|
197
197
|
description: "Please enter a school name",
|
|
198
198
|
state: getFieldState("schoolName"),
|
|
199
|
-
className: cx(stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["w-full"]))), profession !== "teacher" && stl(
|
|
199
|
+
className: cx(stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["w-full"]))), profession !== "teacher" && stl(_templateObject0 || (_templateObject0 = _taggedTemplateLiteral(["hidden"])))),
|
|
200
200
|
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
201
201
|
id: "schoolName",
|
|
202
202
|
placeholder: "Name",
|
|
@@ -214,7 +214,7 @@ export var RHFDynamicFieldsValidationComponent = function RHFDynamicFieldsValida
|
|
|
214
214
|
labelFor: "otherProfession",
|
|
215
215
|
description: "Please enter an other profession",
|
|
216
216
|
state: getFieldState("otherProfession"),
|
|
217
|
-
className: cx(stl(
|
|
217
|
+
className: cx(stl(_templateObject1 || (_templateObject1 = _taggedTemplateLiteral(["w-full"]))), profession !== "other" && stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["hidden"])))),
|
|
218
218
|
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
219
219
|
id: "otherProfession",
|
|
220
220
|
placeholder: "Profession",
|
|
@@ -223,7 +223,7 @@ export var RHFDynamicFieldsValidationComponent = function RHFDynamicFieldsValida
|
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
}), /*#__PURE__*/_jsxs("div", {
|
|
226
|
-
className: stl(
|
|
226
|
+
className: stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["flex gap-2"]))),
|
|
227
227
|
children: [/*#__PURE__*/_jsx(FormSubmit, {
|
|
228
228
|
variant: "primary",
|
|
229
229
|
"aria-label": "Save the form",
|
|
@@ -237,9 +237,9 @@ export var RHFDynamicFieldsValidationComponent = function RHFDynamicFieldsValida
|
|
|
237
237
|
})]
|
|
238
238
|
})]
|
|
239
239
|
}), /*#__PURE__*/_jsx("hr", {
|
|
240
|
-
className: stl(
|
|
240
|
+
className: stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["text-grey-500"])))
|
|
241
241
|
}), /*#__PURE__*/_jsx("code", {
|
|
242
|
-
className: stl(
|
|
242
|
+
className: stl(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["whitespace-pre display-code"]))),
|
|
243
243
|
children: JSON.stringify(formData, null, 2)
|
|
244
244
|
})]
|
|
245
245
|
})
|
|
@@ -311,9 +311,9 @@ export var FormikDynamicFieldsValidationComponent = function FormikDynamicFields
|
|
|
311
311
|
};
|
|
312
312
|
useFormikAutoFocusOnError(formik);
|
|
313
313
|
return /*#__PURE__*/_jsx("div", {
|
|
314
|
-
className: stl(
|
|
314
|
+
className: stl(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["@container w-full flex justify-center"]))),
|
|
315
315
|
children: /*#__PURE__*/_jsxs("div", {
|
|
316
|
-
className: stl(
|
|
316
|
+
className: stl(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["flex flex-col gap-8 w-full @lg:w-1/2"]))),
|
|
317
317
|
children: [/*#__PURE__*/_jsxs(Form, {
|
|
318
318
|
onSubmit: function onSubmit(e) {
|
|
319
319
|
setRevalidationEnabled(true);
|
|
@@ -323,13 +323,13 @@ export var FormikDynamicFieldsValidationComponent = function FormikDynamicFields
|
|
|
323
323
|
setRevalidationEnabled(false);
|
|
324
324
|
formik.handleReset(e);
|
|
325
325
|
},
|
|
326
|
-
className: stl(
|
|
326
|
+
className: stl(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["flex flex-col items-start gap-6 min-w-72"]))),
|
|
327
327
|
children: [/*#__PURE__*/_jsx(FormErrorMessage, {}), /*#__PURE__*/_jsx(Field, {
|
|
328
328
|
label: "Name",
|
|
329
329
|
labelFor: "name",
|
|
330
330
|
description: "Please enter your name",
|
|
331
331
|
state: getFieldState("name"),
|
|
332
|
-
className: stl(
|
|
332
|
+
className: stl(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["w-full"]))),
|
|
333
333
|
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
334
334
|
id: "name",
|
|
335
335
|
placeholder: "John Doe",
|
|
@@ -340,7 +340,7 @@ export var FormikDynamicFieldsValidationComponent = function FormikDynamicFields
|
|
|
340
340
|
labelFor: "email",
|
|
341
341
|
description: "Please enter your email",
|
|
342
342
|
state: getFieldState("email"),
|
|
343
|
-
className: stl(
|
|
343
|
+
className: stl(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["w-full"]))),
|
|
344
344
|
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
345
345
|
id: "email",
|
|
346
346
|
placeholder: "contact@example.com",
|
|
@@ -351,7 +351,7 @@ export var FormikDynamicFieldsValidationComponent = function FormikDynamicFields
|
|
|
351
351
|
labelFor: "profession",
|
|
352
352
|
description: "Please specify your profession",
|
|
353
353
|
state: getFieldState("profession"),
|
|
354
|
-
className: stl(
|
|
354
|
+
className: stl(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["w-full"]))),
|
|
355
355
|
children: /*#__PURE__*/_jsx(Select, _objectSpread(_objectSpread({
|
|
356
356
|
id: "profession",
|
|
357
357
|
required: true
|
|
@@ -368,7 +368,7 @@ export var FormikDynamicFieldsValidationComponent = function FormikDynamicFields
|
|
|
368
368
|
labelFor: "hospitalName",
|
|
369
369
|
description: "Please enter an hospital name",
|
|
370
370
|
state: getFieldState("hospitalName"),
|
|
371
|
-
className: cx(stl(
|
|
371
|
+
className: cx(stl(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["w-full"]))), formik.values.profession !== "doctor" && stl(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["hidden"])))),
|
|
372
372
|
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
373
373
|
id: "hospitalName",
|
|
374
374
|
placeholder: "Name",
|
|
@@ -379,7 +379,7 @@ export var FormikDynamicFieldsValidationComponent = function FormikDynamicFields
|
|
|
379
379
|
labelFor: "schoolName",
|
|
380
380
|
description: "Please enter a school name",
|
|
381
381
|
state: getFieldState("schoolName"),
|
|
382
|
-
className: cx(stl(
|
|
382
|
+
className: cx(stl(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["w-full"]))), formik.values.profession !== "teacher" && stl(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["hidden"])))),
|
|
383
383
|
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
384
384
|
id: "schoolName",
|
|
385
385
|
placeholder: "Name",
|
|
@@ -390,14 +390,14 @@ export var FormikDynamicFieldsValidationComponent = function FormikDynamicFields
|
|
|
390
390
|
labelFor: "otherProfession",
|
|
391
391
|
description: "Please enter an other profession",
|
|
392
392
|
state: getFieldState("otherProfession"),
|
|
393
|
-
className: cx(stl(
|
|
393
|
+
className: cx(stl(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["w-full"]))), formik.values.profession !== "other" && stl(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["hidden"])))),
|
|
394
394
|
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
395
395
|
id: "otherProfession",
|
|
396
396
|
placeholder: "Profession",
|
|
397
397
|
required: true
|
|
398
398
|
}, formik.getFieldProps("otherProfession")))
|
|
399
399
|
}), /*#__PURE__*/_jsxs("div", {
|
|
400
|
-
className: stl(
|
|
400
|
+
className: stl(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["flex gap-2"]))),
|
|
401
401
|
children: [/*#__PURE__*/_jsx(FormSubmit, {
|
|
402
402
|
variant: "primary",
|
|
403
403
|
"aria-label": "Save the form",
|
|
@@ -411,9 +411,9 @@ export var FormikDynamicFieldsValidationComponent = function FormikDynamicFields
|
|
|
411
411
|
})]
|
|
412
412
|
})]
|
|
413
413
|
}), /*#__PURE__*/_jsx("hr", {
|
|
414
|
-
className: stl(
|
|
414
|
+
className: stl(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["text-grey-500"])))
|
|
415
415
|
}), /*#__PURE__*/_jsx("code", {
|
|
416
|
-
className: stl(
|
|
416
|
+
className: stl(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["whitespace-pre display-code"]))),
|
|
417
417
|
children: JSON.stringify(formData, null, 2)
|
|
418
418
|
})]
|
|
419
419
|
})
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9,
|
|
5
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject0, _templateObject1, _templateObject10, _templateObject11, _templateObject12;
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
@@ -71,8 +71,8 @@ export var RHFExtraErrorsComponent = function RHFExtraErrorsComponent() {
|
|
|
71
71
|
children: /*#__PURE__*/_jsxs("div", {
|
|
72
72
|
className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["flex flex-col gap-8 w-full @lg:w-1/2"]))),
|
|
73
73
|
children: [/*#__PURE__*/_jsxs(Form, {
|
|
74
|
-
onSubmit: handleSubmit(
|
|
75
|
-
var _ref = _asyncToGenerator(
|
|
74
|
+
onSubmit: handleSubmit(/*#__PURE__*/function () {
|
|
75
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
|
76
76
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
77
77
|
while (1) switch (_context.prev = _context.next) {
|
|
78
78
|
case 0:
|
|
@@ -156,16 +156,16 @@ export var FormikExtraErrorsComponent = function FormikExtraErrorsComponent() {
|
|
|
156
156
|
revalidationEnabled = _useState8[0],
|
|
157
157
|
setRevalidationEnabled = _useState8[1];
|
|
158
158
|
var _useState9 = useState([]),
|
|
159
|
-
|
|
160
|
-
extraErrors =
|
|
161
|
-
setExtraErrors =
|
|
159
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
160
|
+
extraErrors = _useState0[0],
|
|
161
|
+
setExtraErrors = _useState0[1];
|
|
162
162
|
var formik = useFormik({
|
|
163
163
|
initialValues: initialFormData,
|
|
164
164
|
validateOnChange: revalidationEnabled,
|
|
165
165
|
validateOnBlur: revalidationEnabled,
|
|
166
166
|
validationSchema: yupSchema,
|
|
167
167
|
onSubmit: function () {
|
|
168
|
-
var _onSubmit = _asyncToGenerator(
|
|
168
|
+
var _onSubmit = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(values) {
|
|
169
169
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
170
170
|
while (1) switch (_context2.prev = _context2.next) {
|
|
171
171
|
case 0:
|
|
@@ -226,7 +226,7 @@ export var FormikExtraErrorsComponent = function FormikExtraErrorsComponent() {
|
|
|
226
226
|
setRevalidationEnabled(false);
|
|
227
227
|
formik.handleReset(e);
|
|
228
228
|
},
|
|
229
|
-
className: stl(
|
|
229
|
+
className: stl(_templateObject0 || (_templateObject0 = _taggedTemplateLiteral(["flex flex-col items-start gap-4 min-w-72"]))),
|
|
230
230
|
children: [/*#__PURE__*/_jsx(FormErrorMessage, {
|
|
231
231
|
extraErrors: extraErrors
|
|
232
232
|
}), /*#__PURE__*/_jsx(Field, {
|
|
@@ -234,14 +234,14 @@ export var FormikExtraErrorsComponent = function FormikExtraErrorsComponent() {
|
|
|
234
234
|
labelFor: "email",
|
|
235
235
|
description: "Please enter a valid email address",
|
|
236
236
|
state: getFieldState("email"),
|
|
237
|
-
className: stl(
|
|
237
|
+
className: stl(_templateObject1 || (_templateObject1 = _taggedTemplateLiteral(["w-full"]))),
|
|
238
238
|
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
239
239
|
id: "email",
|
|
240
240
|
placeholder: "Email",
|
|
241
241
|
required: true
|
|
242
242
|
}, formik.getFieldProps("email")))
|
|
243
243
|
}), /*#__PURE__*/_jsxs("div", {
|
|
244
|
-
className: stl(
|
|
244
|
+
className: stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["flex gap-2"]))),
|
|
245
245
|
children: [/*#__PURE__*/_jsx(FormSubmit, {
|
|
246
246
|
variant: "primary",
|
|
247
247
|
"aria-label": "Submit",
|
|
@@ -256,9 +256,9 @@ export var FormikExtraErrorsComponent = function FormikExtraErrorsComponent() {
|
|
|
256
256
|
})]
|
|
257
257
|
})]
|
|
258
258
|
}), /*#__PURE__*/_jsx("hr", {
|
|
259
|
-
className: stl(
|
|
259
|
+
className: stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["text-grey-500"])))
|
|
260
260
|
}), /*#__PURE__*/_jsx("code", {
|
|
261
|
-
className: stl(
|
|
261
|
+
className: stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["whitespace-pre"]))),
|
|
262
262
|
children: JSON.stringify(formData, null, 2)
|
|
263
263
|
})]
|
|
264
264
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject0, _templateObject1, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28;
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
@@ -211,9 +211,9 @@ var RHFFilter = function RHFFilter(_ref) {
|
|
|
211
211
|
className: stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["w-full flex flex-col items-start gap-6 bg-grey-100 border border-grey-200 rounded p-4"]))),
|
|
212
212
|
children: [fields.map(function (field, index) {
|
|
213
213
|
return /*#__PURE__*/_jsxs("div", {
|
|
214
|
-
className: stl(
|
|
214
|
+
className: stl(_templateObject0 || (_templateObject0 = _taggedTemplateLiteral(["w-full flex items-stretch gap-2 flex-col @xl:flex-row"]))),
|
|
215
215
|
children: [index > 0 && /*#__PURE__*/_jsx("div", {
|
|
216
|
-
className: stl(
|
|
216
|
+
className: stl(_templateObject1 || (_templateObject1 = _taggedTemplateLiteral(["mt-0 @xl:mt-8"]))),
|
|
217
217
|
children: "Or"
|
|
218
218
|
}), /*#__PURE__*/_jsx(Controller, {
|
|
219
219
|
name: "filterGroups.".concat(parentIndex, ".").concat(index, ".facet"),
|
|
@@ -224,7 +224,7 @@ var RHFFilter = function RHFFilter(_ref) {
|
|
|
224
224
|
label: "Facet",
|
|
225
225
|
labelFor: "filterGroups.".concat(parentIndex, ".").concat(index, ".facet"),
|
|
226
226
|
state: getFieldState("filterGroups.".concat(parentIndex, ".").concat(index, ".facet")),
|
|
227
|
-
className: stl(
|
|
227
|
+
className: stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["w-full"]))),
|
|
228
228
|
children: /*#__PURE__*/_jsx(AutoComplete, _objectSpread({
|
|
229
229
|
id: "filterGroups.".concat(parentIndex, ".").concat(index, ".facet"),
|
|
230
230
|
options: autocompleteFacets,
|
|
@@ -245,7 +245,7 @@ var RHFFilter = function RHFFilter(_ref) {
|
|
|
245
245
|
state: getFieldState("filterGroups.".concat(parentIndex, ".").concat(index, ".operator")),
|
|
246
246
|
children: /*#__PURE__*/_jsx(Select, _objectSpread(_objectSpread({
|
|
247
247
|
id: "filterGroups.".concat(parentIndex, ".").concat(index, ".operator"),
|
|
248
|
-
className: stl(
|
|
248
|
+
className: stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["w-min"]))),
|
|
249
249
|
required: true
|
|
250
250
|
}, field), {}, {
|
|
251
251
|
children: operators.map(function (operator) {
|
|
@@ -267,7 +267,7 @@ var RHFFilter = function RHFFilter(_ref) {
|
|
|
267
267
|
label: "Value",
|
|
268
268
|
labelFor: "filterGroups.".concat(parentIndex, ".").concat(index, ".value"),
|
|
269
269
|
state: getFieldState("filterGroups.".concat(parentIndex, ".").concat(index, ".value")),
|
|
270
|
-
className: stl(
|
|
270
|
+
className: stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["w-full"]))),
|
|
271
271
|
children: /*#__PURE__*/_jsx(AutoComplete, _objectSpread({
|
|
272
272
|
id: "filterGroups.".concat(parentIndex, ".").concat(index, ".value"),
|
|
273
273
|
options: getAutocompleteFacetValues((_filterGroup$index = filterGroup[index]) === null || _filterGroup$index === void 0 || (_filterGroup$index = _filterGroup$index.facet) === null || _filterGroup$index === void 0 ? void 0 : _filterGroup$index.label),
|
|
@@ -281,7 +281,7 @@ var RHFFilter = function RHFFilter(_ref) {
|
|
|
281
281
|
title: "Remove filter",
|
|
282
282
|
variant: "subtle",
|
|
283
283
|
icon: MinusIcon,
|
|
284
|
-
className: stl(
|
|
284
|
+
className: stl(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["shrink-0 mt-0 @lg:mt-8"]))),
|
|
285
285
|
disabled: fields.length === 1,
|
|
286
286
|
onClick: function onClick() {
|
|
287
287
|
return remove(index);
|
|
@@ -325,9 +325,9 @@ export var FormikFieldArraysComponent = function FormikFieldArraysComponent() {
|
|
|
325
325
|
revalidationEnabled = _useState6[0],
|
|
326
326
|
setRevalidationEnabled = _useState6[1];
|
|
327
327
|
return /*#__PURE__*/_jsx("div", {
|
|
328
|
-
className: stl(
|
|
328
|
+
className: stl(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["@container w-full flex justify-center"]))),
|
|
329
329
|
children: /*#__PURE__*/_jsxs("div", {
|
|
330
|
-
className: stl(
|
|
330
|
+
className: stl(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["flex flex-col gap-8 w-full"]))),
|
|
331
331
|
children: [/*#__PURE__*/_jsx(Formik, {
|
|
332
332
|
initialValues: initialFormData,
|
|
333
333
|
validateOnChange: revalidationEnabled,
|
|
@@ -365,7 +365,7 @@ export var FormikFieldArraysComponent = function FormikFieldArraysComponent() {
|
|
|
365
365
|
setRevalidationEnabled(false);
|
|
366
366
|
handleReset(e);
|
|
367
367
|
},
|
|
368
|
-
className: stl(
|
|
368
|
+
className: stl(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["flex flex-col items-start gap-6 min-w-72"]))),
|
|
369
369
|
children: [/*#__PURE__*/_jsx(FormErrorMessage, {}), /*#__PURE__*/_jsx(FieldArray, {
|
|
370
370
|
name: "filterGroups",
|
|
371
371
|
render: function render(_ref6) {
|
|
@@ -374,9 +374,9 @@ export var FormikFieldArraysComponent = function FormikFieldArraysComponent() {
|
|
|
374
374
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
375
375
|
children: [values.filterGroups.map(function (_, index) {
|
|
376
376
|
return /*#__PURE__*/_jsxs("div", {
|
|
377
|
-
className: stl(
|
|
377
|
+
className: stl(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["w-full flex flex-col gap-2"]))),
|
|
378
378
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
379
|
-
className: stl(
|
|
379
|
+
className: stl(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["w-full flex items-center justify-between"]))),
|
|
380
380
|
children: [/*#__PURE__*/_jsx("div", {
|
|
381
381
|
children: index === 0 ? "Only display items that match this group" : "And"
|
|
382
382
|
}), /*#__PURE__*/_jsx(IconButton, {
|
|
@@ -407,7 +407,7 @@ export var FormikFieldArraysComponent = function FormikFieldArraysComponent() {
|
|
|
407
407
|
});
|
|
408
408
|
}
|
|
409
409
|
}), /*#__PURE__*/_jsxs("div", {
|
|
410
|
-
className: stl(
|
|
410
|
+
className: stl(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["flex gap-2"]))),
|
|
411
411
|
children: [/*#__PURE__*/_jsx(FormSubmit, {
|
|
412
412
|
variant: "primary",
|
|
413
413
|
"aria-label": "Apply changes",
|
|
@@ -423,9 +423,9 @@ export var FormikFieldArraysComponent = function FormikFieldArraysComponent() {
|
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
425
|
}), /*#__PURE__*/_jsx("hr", {
|
|
426
|
-
className: stl(
|
|
426
|
+
className: stl(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["text-grey-500"])))
|
|
427
427
|
}), /*#__PURE__*/_jsx("code", {
|
|
428
|
-
className: stl(
|
|
428
|
+
className: stl(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["whitespace-pre display-code"]))),
|
|
429
429
|
children: JSON.stringify(formData, null, 2)
|
|
430
430
|
})]
|
|
431
431
|
})
|
|
@@ -459,19 +459,19 @@ var FormikFilter = function FormikFilter(_ref7) {
|
|
|
459
459
|
remove = _ref8.remove,
|
|
460
460
|
form = _ref8.form;
|
|
461
461
|
return /*#__PURE__*/_jsxs("div", {
|
|
462
|
-
className: stl(
|
|
462
|
+
className: stl(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["w-full flex flex-col items-start gap-6 bg-grey-100 border border-grey-200 rounded p-4"]))),
|
|
463
463
|
children: [formik.values.filterGroups[parentIndex].map(function (_, index) {
|
|
464
464
|
var _form$values$filterGr;
|
|
465
465
|
return /*#__PURE__*/_jsxs("div", {
|
|
466
|
-
className: stl(
|
|
466
|
+
className: stl(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["w-full flex items-stretch gap-2 flex-col @xl:flex-row"]))),
|
|
467
467
|
children: [index > 0 && /*#__PURE__*/_jsx("div", {
|
|
468
|
-
className: stl(
|
|
468
|
+
className: stl(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["mt-0 @xl:mt-8"]))),
|
|
469
469
|
children: "Or"
|
|
470
470
|
}), /*#__PURE__*/_jsx(Field, {
|
|
471
471
|
label: "Facet",
|
|
472
472
|
labelFor: "filterGroups.".concat(parentIndex, ".").concat(index, ".facet"),
|
|
473
473
|
state: getFieldState("filterGroups.".concat(parentIndex, ".").concat(index, ".facet")),
|
|
474
|
-
className: stl(
|
|
474
|
+
className: stl(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["w-full"]))),
|
|
475
475
|
children: /*#__PURE__*/_jsx(AutoComplete, _objectSpread(_objectSpread({
|
|
476
476
|
id: "filterGroups.".concat(parentIndex, ".").concat(index, ".facet"),
|
|
477
477
|
options: autocompleteFacets,
|
|
@@ -491,7 +491,7 @@ var FormikFilter = function FormikFilter(_ref7) {
|
|
|
491
491
|
state: getFieldState("filterGroups.".concat(parentIndex, ".").concat(index, ".operator")),
|
|
492
492
|
children: /*#__PURE__*/_jsx(Select, _objectSpread(_objectSpread({
|
|
493
493
|
id: "filterGroups.".concat(parentIndex, ".").concat(index, ".operator"),
|
|
494
|
-
className: stl(
|
|
494
|
+
className: stl(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["w-min"]))),
|
|
495
495
|
required: true
|
|
496
496
|
}, form.getFieldProps("filterGroups.".concat(parentIndex, ".").concat(index, ".operator"))), {}, {
|
|
497
497
|
children: operators.map(function (operator) {
|
|
@@ -505,7 +505,7 @@ var FormikFilter = function FormikFilter(_ref7) {
|
|
|
505
505
|
label: "Value",
|
|
506
506
|
labelFor: "filterGroups.".concat(parentIndex, ".").concat(index, ".value"),
|
|
507
507
|
state: getFieldState("filterGroups.".concat(parentIndex, ".").concat(index, ".value")),
|
|
508
|
-
className: stl(
|
|
508
|
+
className: stl(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["w-full"]))),
|
|
509
509
|
children: /*#__PURE__*/_jsx(AutoComplete, _objectSpread(_objectSpread({
|
|
510
510
|
id: "filterGroups.".concat(parentIndex, ".").concat(index, ".value"),
|
|
511
511
|
options: getAutocompleteFacetValues((_form$values$filterGr = form.values.filterGroups[parentIndex][index]) === null || _form$values$filterGr === void 0 || (_form$values$filterGr = _form$values$filterGr.facet) === null || _form$values$filterGr === void 0 ? void 0 : _form$values$filterGr.label),
|
|
@@ -523,7 +523,7 @@ var FormikFilter = function FormikFilter(_ref7) {
|
|
|
523
523
|
title: "Remove filter",
|
|
524
524
|
variant: "subtle",
|
|
525
525
|
icon: MinusIcon,
|
|
526
|
-
className: stl(
|
|
526
|
+
className: stl(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["shrink-0 mt-0 @lg:mt-8"]))),
|
|
527
527
|
disabled: form.values.filterGroups[parentIndex].length === 1,
|
|
528
528
|
onClick: function onClick() {
|
|
529
529
|
return remove(index);
|