@wix/form-public 0.541.0 → 0.543.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/index.cjs +16 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import ReactDOM from 'react-dom';
|
|
|
7
7
|
import camelCase2 from 'lodash.camelcase';
|
|
8
8
|
import mapKeys from 'lodash.mapkeys';
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
10
|
-
import { CheckboxField, CheckboxButton, TextField, Input, ListBoxItem, Dialog, OverlayTriggerStateContext, ModalOverlay, Modal, SearchField, Group, RadioGroup as RadioGroup$1, Button, DropZone as DropZone$1, FileTrigger, useSlottedContext, PopoverContext, Popover, CollectionRendererContext, DefaultCollectionRenderer, ListBox, Autocomplete, RadioField, RadioButton, CheckboxGroup as CheckboxGroup$1, I18nProvider, DatePicker as DatePicker$1,
|
|
10
|
+
import { CheckboxField, CheckboxButton, TextField, Input, ListBoxItem, Dialog, OverlayTriggerStateContext, ModalOverlay, Modal, SearchField, Group, RadioGroup as RadioGroup$1, Button, DropZone as DropZone$1, FileTrigger, useSlottedContext, PopoverContext, Popover, CollectionRendererContext, DefaultCollectionRenderer, ListBox, Autocomplete, RadioField, RadioButton, CheckboxGroup as CheckboxGroup$1, I18nProvider, DatePicker as DatePicker$1, VisuallyHidden, Select, NumberField, TimeField, SelectValue, CalendarCell, Calendar as Calendar$1, CalendarMonthPicker, CalendarYearPicker, CalendarGrid, DatePickerStateContext, DateInput as DateInput$1, DateSegment, TimeFieldStateContext, ToggleButton, ToggleButtonGroup, Text as Text$1, ProgressBar, ComboBox, DialogTrigger, TextArea as TextArea$1, ComboBoxStateContext } from 'react-aria-components';
|
|
11
11
|
|
|
12
12
|
var __create = Object.create;
|
|
13
13
|
var __defProp = Object.defineProperty;
|
|
@@ -55793,6 +55793,8 @@ var Dropdown = ({ children }) => {
|
|
|
55793
55793
|
const [container, setContainer] = useState(null);
|
|
55794
55794
|
const selectedValue = value && options.some((option2) => (option2.value ?? option2.label) === value) ? value : defaultValue || null;
|
|
55795
55795
|
const { labelId } = useFieldAttributes();
|
|
55796
|
+
const { t } = useTranslation2();
|
|
55797
|
+
const requiredLabelId = `${labelId}-required`;
|
|
55796
55798
|
const handleChange = useCallback((selectedValue2) => {
|
|
55797
55799
|
if (!readOnly) {
|
|
55798
55800
|
onChange(typeof selectedValue2 === "string" ? selectedValue2 : null);
|
|
@@ -55818,10 +55820,12 @@ var Dropdown = ({ children }) => {
|
|
|
55818
55820
|
style: {
|
|
55819
55821
|
display: "contents"
|
|
55820
55822
|
}
|
|
55821
|
-
}), /* @__PURE__ */ React172.createElement(
|
|
55823
|
+
}), required ? /* @__PURE__ */ React172.createElement(VisuallyHidden, {
|
|
55824
|
+
id: requiredLabelId
|
|
55825
|
+
}, t("settings.required-indicator-text")) : null, /* @__PURE__ */ React172.createElement($72abaeab4d80592f$export$78efe591171d7d45, {
|
|
55822
55826
|
getContainer: () => container
|
|
55823
55827
|
}, /* @__PURE__ */ React172.createElement(Select, {
|
|
55824
|
-
"aria-labelledby": labelId,
|
|
55828
|
+
"aria-labelledby": required ? `${labelId} ${requiredLabelId}` : labelId,
|
|
55825
55829
|
value: selectedValue,
|
|
55826
55830
|
isOpen: isForcedOpen || isOpen && !disabled && !readOnly,
|
|
55827
55831
|
onOpenChange: isForcedOpen ? void 0 : handleOpenChange,
|
|
@@ -55909,12 +55913,19 @@ var useInvokeCallback = (callback) => {
|
|
|
55909
55913
|
// ../form-fields/dist/esm/ui/events-repeater/events-repeater-headless.js
|
|
55910
55914
|
var NO_ERRORS2 = [];
|
|
55911
55915
|
var NO_VALUES = {};
|
|
55912
|
-
var
|
|
55916
|
+
var EventsRepeaterLabel = ({ className }) => {
|
|
55917
|
+
return /* @__PURE__ */ React172.createElement(Label, {
|
|
55918
|
+
className
|
|
55919
|
+
}, null);
|
|
55920
|
+
};
|
|
55921
|
+
var GuestCount = ({ children, className, ...internal }) => {
|
|
55913
55922
|
const { guestLimit, guestCount, onGuestCountChange } = internal;
|
|
55914
55923
|
const { label, disabled, readOnly, onBlur, onFocus } = useFieldPropsV2();
|
|
55915
55924
|
const invokeBlur = useInvokeCallback(onBlur);
|
|
55925
|
+
const labelElement = findChildOfType(children, GuestCount.Label);
|
|
55916
55926
|
const controlElement = findChildOfType(children, GuestCount.Control);
|
|
55917
55927
|
return /* @__PURE__ */ React172.createElement(NumberField, {
|
|
55928
|
+
className,
|
|
55918
55929
|
"aria-label": label,
|
|
55919
55930
|
value: guestCount,
|
|
55920
55931
|
onChange: onGuestCountChange,
|
|
@@ -55925,7 +55936,7 @@ var GuestCount = ({ children, ...internal }) => {
|
|
|
55925
55936
|
isReadOnly: readOnly,
|
|
55926
55937
|
onBlur: invokeBlur,
|
|
55927
55938
|
onFocus
|
|
55928
|
-
}, controlElement);
|
|
55939
|
+
}, labelElement, controlElement);
|
|
55929
55940
|
};
|
|
55930
55941
|
var GuestCountControl = ({ children, className }) => {
|
|
55931
55942
|
const { disabled, readOnly } = useFieldPropsV2();
|
|
@@ -56065,6 +56076,7 @@ var Guest = ({ className, ...internal }) => {
|
|
|
56065
56076
|
fieldActions
|
|
56066
56077
|
}));
|
|
56067
56078
|
};
|
|
56079
|
+
GuestCount.Label = EventsRepeaterLabel;
|
|
56068
56080
|
GuestCount.Control = GuestCountControl;
|
|
56069
56081
|
GuestCount.Input = GuestCountInput;
|
|
56070
56082
|
GuestCount.Decrement = GuestCountDecrement;
|