@wix/form-public 0.506.0 → 0.508.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 +49 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +49 -19
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -53741,7 +53741,9 @@ var DROPDOWN_FIELD_TYPES = [
|
|
|
53741
53741
|
FIELD_TYPES.DATE_INPUT,
|
|
53742
53742
|
FIELD_TYPES.CONTACTS_BIRTHDATE,
|
|
53743
53743
|
FIELD_TYPES.DATE_TIME_INPUT,
|
|
53744
|
-
FIELD_TYPES.DEXT_DATE_TIME_INPUT
|
|
53744
|
+
FIELD_TYPES.DEXT_DATE_TIME_INPUT,
|
|
53745
|
+
FIELD_TYPES.DATE_PICKER,
|
|
53746
|
+
FIELD_TYPES.DEXT_DATE_PICKER
|
|
53745
53747
|
];
|
|
53746
53748
|
var PHONE_FIELD_TYPES = [
|
|
53747
53749
|
FIELD_TYPES.PHONE,
|
|
@@ -54098,6 +54100,8 @@ var DatePicker = ({ children }) => {
|
|
|
54098
54100
|
const { labelId } = useFieldAttributes();
|
|
54099
54101
|
const { regionalFormat } = useConfig();
|
|
54100
54102
|
const [container, setContainer] = useState(null);
|
|
54103
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
54104
|
+
const isForcedOpen = useIsForcedOpenDropdown(id6);
|
|
54101
54105
|
const handleChange = useCallback((dateValue2) => {
|
|
54102
54106
|
const stringValue = dateValueToString(dateValue2);
|
|
54103
54107
|
onChange(stringValue);
|
|
@@ -54131,8 +54135,12 @@ var DatePicker = ({ children }) => {
|
|
|
54131
54135
|
isReadOnly: readOnly,
|
|
54132
54136
|
isRequired: required,
|
|
54133
54137
|
onBlur,
|
|
54134
|
-
onFocus
|
|
54135
|
-
|
|
54138
|
+
onFocus,
|
|
54139
|
+
isOpen: isForcedOpen || isOpen,
|
|
54140
|
+
onOpenChange: isForcedOpen ? void 0 : setIsOpen
|
|
54141
|
+
}, controlElement, applyInternalProps(calendarElement, {
|
|
54142
|
+
isForcedOpen
|
|
54143
|
+
})))),
|
|
54136
54144
|
renderDescription: () => /* @__PURE__ */ React172.createElement(React172.Fragment, null, errorElement, descriptionElement)
|
|
54137
54145
|
});
|
|
54138
54146
|
};
|
|
@@ -54215,7 +54223,8 @@ var Trigger = ({ children, className }) => {
|
|
|
54215
54223
|
className
|
|
54216
54224
|
}, children);
|
|
54217
54225
|
};
|
|
54218
|
-
var Calendar = ({ children, className }) => {
|
|
54226
|
+
var Calendar = ({ children, className, ...internal }) => {
|
|
54227
|
+
const { isForcedOpen } = internal;
|
|
54219
54228
|
const { regionalFormat, isMobile: isMobile2 } = useConfig();
|
|
54220
54229
|
const { availability } = useFieldPropsV2();
|
|
54221
54230
|
const firstDayOfWeek = useMemo(() => getFirstDayOfTheWeek(regionalFormat), [
|
|
@@ -54237,7 +54246,10 @@ var Calendar = ({ children, className }) => {
|
|
|
54237
54246
|
return /* @__PURE__ */ React172.createElement(NonModalPopover, {
|
|
54238
54247
|
className,
|
|
54239
54248
|
containerPadding: 0
|
|
54240
|
-
}, /* @__PURE__ */ React172.createElement(
|
|
54249
|
+
}, /* @__PURE__ */ React172.createElement(CalendarDialog, {
|
|
54250
|
+
isForcedOpen
|
|
54251
|
+
}, /* @__PURE__ */ React172.createElement(Calendar$1, {
|
|
54252
|
+
autoFocus: isForcedOpen ? false : void 0,
|
|
54241
54253
|
firstDayOfWeek: convertFirstDayOfWeek(firstDayOfWeek),
|
|
54242
54254
|
isDateUnavailable
|
|
54243
54255
|
}, /* @__PURE__ */ React172.createElement("header", null, previousTriggerElement, /* @__PURE__ */ React172.createElement(CalendarMonthPicker, null, (aria) => applyInternalProps(monthTriggerElement, {
|
|
@@ -54260,12 +54272,15 @@ var Calendar = ({ children, className }) => {
|
|
|
54260
54272
|
date
|
|
54261
54273
|
})))));
|
|
54262
54274
|
};
|
|
54263
|
-
var
|
|
54275
|
+
var CalendarDialog = ({ isForcedOpen, children }) => isForcedOpen ? /* @__PURE__ */ React172.createElement("div", {
|
|
54276
|
+
role: "dialog"
|
|
54277
|
+
}, children) : /* @__PURE__ */ React172.createElement(Dialog, null, children);
|
|
54278
|
+
var Day3 = ({ children, className, ...internal }) => {
|
|
54264
54279
|
const { date } = internal;
|
|
54265
54280
|
return /* @__PURE__ */ React172.createElement(CalendarCell, {
|
|
54266
54281
|
className,
|
|
54267
54282
|
date
|
|
54268
|
-
});
|
|
54283
|
+
}, children);
|
|
54269
54284
|
};
|
|
54270
54285
|
var PreviousTrigger = ({ children, className }) => /* @__PURE__ */ React172.createElement(Button, {
|
|
54271
54286
|
slot: "previous",
|
|
@@ -55342,19 +55357,12 @@ var useInvokeCallback = (callback) => {
|
|
|
55342
55357
|
// ../form-fields/dist/esm/ui/events-repeater/events-repeater-headless.js
|
|
55343
55358
|
var NO_ERRORS2 = [];
|
|
55344
55359
|
var NO_VALUES = {};
|
|
55345
|
-
var GuestCount = ({ children,
|
|
55360
|
+
var GuestCount = ({ children, ...internal }) => {
|
|
55346
55361
|
const { guestLimit, guestCount, onGuestCountChange } = internal;
|
|
55347
|
-
const {
|
|
55348
|
-
const { inputId, ariaDescribedBy } = useFieldAttributes();
|
|
55362
|
+
const { label, disabled, readOnly, onBlur, onFocus } = useFieldPropsV2();
|
|
55349
55363
|
const invokeBlur = useInvokeCallback(onBlur);
|
|
55350
|
-
const
|
|
55351
|
-
useFocusFieldEvent(() => {
|
|
55352
|
-
ref.current?.focus();
|
|
55353
|
-
}, id6);
|
|
55354
|
-
const decrementElement = findChildOfType(children, GuestCount.Decrement);
|
|
55355
|
-
const incrementElement = findChildOfType(children, GuestCount.Increment);
|
|
55364
|
+
const controlElement = findChildOfType(children, GuestCount.Control);
|
|
55356
55365
|
return /* @__PURE__ */ React172.createElement(NumberField, {
|
|
55357
|
-
className: groupClassName,
|
|
55358
55366
|
"aria-label": label,
|
|
55359
55367
|
value: guestCount,
|
|
55360
55368
|
onChange: onGuestCountChange,
|
|
@@ -55365,13 +55373,33 @@ var GuestCount = ({ children, className, groupClassName, ...internal }) => {
|
|
|
55365
55373
|
isReadOnly: readOnly,
|
|
55366
55374
|
onBlur: invokeBlur,
|
|
55367
55375
|
onFocus
|
|
55368
|
-
},
|
|
55376
|
+
}, controlElement);
|
|
55377
|
+
};
|
|
55378
|
+
var GuestCountControl = ({ children, className }) => {
|
|
55379
|
+
const { disabled, readOnly } = useFieldPropsV2();
|
|
55380
|
+
const inputElement = findChildOfType(children, GuestCount.Input);
|
|
55381
|
+
const decrementElement = findChildOfType(children, GuestCount.Decrement);
|
|
55382
|
+
const incrementElement = findChildOfType(children, GuestCount.Increment);
|
|
55383
|
+
return /* @__PURE__ */ React172.createElement(Group, {
|
|
55384
|
+
className,
|
|
55385
|
+
isDisabled: disabled,
|
|
55386
|
+
isReadOnly: readOnly
|
|
55387
|
+
}, inputElement, incrementElement, decrementElement);
|
|
55388
|
+
};
|
|
55389
|
+
var GuestCountInput = ({ className }) => {
|
|
55390
|
+
const { id: id6 } = useFieldPropsV2();
|
|
55391
|
+
const { inputId, ariaDescribedBy } = useFieldAttributes();
|
|
55392
|
+
const ref = useRef(null);
|
|
55393
|
+
useFocusFieldEvent(() => {
|
|
55394
|
+
ref.current?.focus();
|
|
55395
|
+
}, id6);
|
|
55396
|
+
return /* @__PURE__ */ React172.createElement(Input, {
|
|
55369
55397
|
ref,
|
|
55370
55398
|
id: inputId,
|
|
55371
55399
|
"aria-describedby": ariaDescribedBy,
|
|
55372
55400
|
className,
|
|
55373
55401
|
inputMode: "numeric"
|
|
55374
|
-
})
|
|
55402
|
+
});
|
|
55375
55403
|
};
|
|
55376
55404
|
var GuestCountDecrement = ({ children, className }) => {
|
|
55377
55405
|
return /* @__PURE__ */ React172.createElement(Button, {
|
|
@@ -55480,6 +55508,8 @@ var Guest = ({ className, ...internal }) => {
|
|
|
55480
55508
|
fieldActions
|
|
55481
55509
|
}));
|
|
55482
55510
|
};
|
|
55511
|
+
GuestCount.Control = GuestCountControl;
|
|
55512
|
+
GuestCount.Input = GuestCountInput;
|
|
55483
55513
|
GuestCount.Decrement = GuestCountDecrement;
|
|
55484
55514
|
GuestCount.Increment = GuestCountIncrement;
|
|
55485
55515
|
GuestToggle.Input = SelectionIndicator;
|