@coopdigital/react 1.30.1 → 1.31.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/components/Author/Author.d.ts +3 -1
- package/dist/components/Author/Author.js +1 -1
- package/dist/components/Author/index.d.ts +2 -2
- package/dist/components/Author/index.js +2 -2
- package/dist/components/Combobox/Combobox.d.ts +1 -1
- package/dist/components/Combobox/Combobox.js +29 -8
- package/dist/components/Combobox/{combobox-utils.js → combobox-internal.js} +4 -2
- package/dist/components/DateInput/DateInput.context.js +7 -0
- package/dist/components/DateInput/DateInput.d.ts +104 -0
- package/dist/components/DateInput/DateInput.js +128 -0
- package/dist/components/DateInput/dateinput-internal.d.ts +6 -0
- package/dist/components/DateInput/dateinput-internal.js +82 -0
- package/dist/components/DateInput/dateinput-utils.d.ts +66 -0
- package/dist/components/DateInput/dateinput-utils.js +91 -0
- package/dist/components/DateInput/index.d.ts +3 -0
- package/dist/components/DateInput/index.js +6 -0
- package/dist/components/Field/Field.context.js +1 -1
- package/dist/components/Field/Field.js +1 -1
- package/dist/components/FieldMarkers/{fieldmarkers-utils.js → fieldmarkers-internal.js} +1 -1
- package/dist/components/Fieldset/Fieldset.js +1 -1
- package/dist/components/Form/Form.d.ts +7 -1
- package/dist/components/Form/Form.js +2 -1
- package/dist/components/Squircle/Squircle.d.ts +3 -1
- package/dist/components/Squircle/Squircle.js +1 -1
- package/dist/components/Squircle/index.d.ts +2 -2
- package/dist/components/Squircle/index.js +2 -2
- package/dist/components/Textarea/Textarea.js +14 -4
- package/dist/components/ValidationSummary/ValidationSummary.d.ts +1 -1
- package/dist/components/ValidationSummary/ValidationSummary.js +1 -1
- package/dist/components/ValidationSummary/{validationsummary-utils.d.ts → validationsummary-internal.d.ts} +1 -1
- package/dist/components/ValidationSummary/{validationsummary-utils.js → validationsummary-internal.js} +3 -2
- package/dist/components/icons/AccountCircleFilledIcon.d.ts +2 -1
- package/dist/components/icons/AccountCircleIcon.d.ts +2 -1
- package/dist/components/icons/AccountFilledIcon.d.ts +2 -1
- package/dist/components/icons/AccountIcon.d.ts +2 -1
- package/dist/components/icons/AddIcon.d.ts +2 -1
- package/dist/components/icons/AppsFilledIcon.d.ts +2 -1
- package/dist/components/icons/AppsIcon.d.ts +2 -1
- package/dist/components/icons/ArrowDownIcon.d.ts +2 -1
- package/dist/components/icons/ArrowLeftIcon.d.ts +2 -1
- package/dist/components/icons/ArrowRightIcon.d.ts +2 -1
- package/dist/components/icons/ArrowUpIcon.d.ts +2 -1
- package/dist/components/icons/BackspaceFilledIcon.d.ts +2 -1
- package/dist/components/icons/BackspaceIcon.d.ts +2 -1
- package/dist/components/icons/BasketFilledIcon.d.ts +2 -1
- package/dist/components/icons/BasketIcon.d.ts +2 -1
- package/dist/components/icons/BellFilledIcon.d.ts +2 -1
- package/dist/components/icons/BellIcon.d.ts +2 -1
- package/dist/components/icons/BroomIcon.d.ts +2 -1
- package/dist/components/icons/CalendarFilledIcon.d.ts +2 -1
- package/dist/components/icons/CalendarIcon.d.ts +2 -1
- package/dist/components/icons/CashFilledIcon.d.ts +2 -1
- package/dist/components/icons/CashIcon.d.ts +2 -1
- package/dist/components/icons/ChevronDownIcon.d.ts +2 -1
- package/dist/components/icons/ChevronLeftIcon.d.ts +2 -1
- package/dist/components/icons/ChevronRightIcon.d.ts +2 -1
- package/dist/components/icons/ChevronUpIcon.d.ts +2 -1
- package/dist/components/icons/CircleBurgerFilledIcon.d.ts +2 -1
- package/dist/components/icons/CircleBurgerIcon.d.ts +2 -1
- package/dist/components/icons/ClipboardFilledIcon.d.ts +2 -1
- package/dist/components/icons/ClipboardIcon.d.ts +2 -1
- package/dist/components/icons/ClockFilledIcon.d.ts +2 -1
- package/dist/components/icons/ClockIcon.d.ts +2 -1
- package/dist/components/icons/CloseAltFilledIcon.d.ts +2 -1
- package/dist/components/icons/CloseAltIcon.d.ts +2 -1
- package/dist/components/icons/CogIcon.d.ts +2 -1
- package/dist/components/icons/CommunityFilledIcon.d.ts +2 -1
- package/dist/components/icons/CommunityIcon.d.ts +2 -1
- package/dist/components/icons/ComputerIcon.d.ts +2 -1
- package/dist/components/icons/ContactFilledIcon.d.ts +2 -1
- package/dist/components/icons/ContactIcon.d.ts +2 -1
- package/dist/components/icons/ContactlessFilledIcon.d.ts +2 -1
- package/dist/components/icons/ContactlessIcon.d.ts +2 -1
- package/dist/components/icons/CoopLiveIcon.d.ts +2 -1
- package/dist/components/icons/CoopLocationFilledIcon.d.ts +2 -1
- package/dist/components/icons/CoopLogoIcon.d.ts +2 -1
- package/dist/components/icons/CoopMembershipCardFilledIcon.d.ts +2 -1
- package/dist/components/icons/CreditCardFilledIcon.d.ts +2 -1
- package/dist/components/icons/CreditCardIcon.d.ts +2 -1
- package/dist/components/icons/CrossIcon.d.ts +2 -1
- package/dist/components/icons/DocumentIcon.d.ts +2 -1
- package/dist/components/icons/DownloadIcon.d.ts +2 -1
- package/dist/components/icons/EnterStoreIcon.d.ts +2 -1
- package/dist/components/icons/ExitStoreIcon.d.ts +2 -1
- package/dist/components/icons/EyeFilledIcon.d.ts +2 -1
- package/dist/components/icons/EyeIcon.d.ts +2 -1
- package/dist/components/icons/EyeStrikeFilledIcon.d.ts +2 -1
- package/dist/components/icons/EyeStrikeIcon.d.ts +2 -1
- package/dist/components/icons/FeedbackFilledIcon.d.ts +2 -1
- package/dist/components/icons/FeedbackIcon.d.ts +2 -1
- package/dist/components/icons/FilterIcon.d.ts +2 -1
- package/dist/components/icons/GiftCardFilledIcon.d.ts +2 -1
- package/dist/components/icons/GiftCardIcon.d.ts +2 -1
- package/dist/components/icons/GiftFilledIcon.d.ts +2 -1
- package/dist/components/icons/GiftIcon.d.ts +2 -1
- package/dist/components/icons/HelpFilledIcon.d.ts +2 -1
- package/dist/components/icons/HelpIcon.d.ts +2 -1
- package/dist/components/icons/HomeFilledIcon.d.ts +2 -1
- package/dist/components/icons/HomeIcon.d.ts +2 -1
- package/dist/components/icons/HowDoIAssistantIcon.d.ts +2 -1
- package/dist/components/icons/InfoIcon.d.ts +2 -1
- package/dist/components/icons/KebabIcon.d.ts +2 -1
- package/dist/components/icons/LoadingIcon.d.ts +2 -1
- package/dist/components/icons/LocationFilledIcon.d.ts +2 -1
- package/dist/components/icons/LocationIcon.d.ts +2 -1
- package/dist/components/icons/LogoutIcon.d.ts +2 -1
- package/dist/components/icons/MailIcon.d.ts +2 -1
- package/dist/components/icons/MenuIcon.d.ts +2 -1
- package/dist/components/icons/MessageIcon.d.ts +2 -1
- package/dist/components/icons/MinusIcon.d.ts +2 -1
- package/dist/components/icons/NotesFilledIcon.d.ts +2 -1
- package/dist/components/icons/NotesIcon.d.ts +2 -1
- package/dist/components/icons/OpenNewIcon.d.ts +2 -1
- package/dist/components/icons/OwnBagIcon.d.ts +2 -1
- package/dist/components/icons/PadlockIcon.d.ts +2 -1
- package/dist/components/icons/PencilIcon.d.ts +2 -1
- package/dist/components/icons/PhoneIcon.d.ts +2 -1
- package/dist/components/icons/PowerIcon.d.ts +2 -1
- package/dist/components/icons/SaveFilledIcon.d.ts +2 -1
- package/dist/components/icons/SaveIcon.d.ts +2 -1
- package/dist/components/icons/ScooterIcon.d.ts +2 -1
- package/dist/components/icons/SearchFilledIcon.d.ts +2 -1
- package/dist/components/icons/SearchIcon.d.ts +2 -1
- package/dist/components/icons/SendIcon.d.ts +2 -1
- package/dist/components/icons/SpannerIcon.d.ts +2 -1
- package/dist/components/icons/StarFilledIcon.d.ts +2 -1
- package/dist/components/icons/StarIcon.d.ts +2 -1
- package/dist/components/icons/TickAltFilledIcon.d.ts +2 -1
- package/dist/components/icons/TickAltIcon.d.ts +2 -1
- package/dist/components/icons/TickIcon.d.ts +2 -1
- package/dist/components/icons/TruckIcon.d.ts +2 -1
- package/dist/components/icons/UserWipeIcon.d.ts +2 -1
- package/dist/components/icons/VoucherFilledIcon.d.ts +2 -1
- package/dist/components/icons/VoucherIcon.d.ts +2 -1
- package/dist/components/icons/WarningCircleFilledIcon.d.ts +2 -1
- package/dist/components/icons/WarningCircleIcon.d.ts +2 -1
- package/dist/components/icons/WarningFilledIcon.d.ts +2 -1
- package/dist/components/icons/WarningIcon.d.ts +2 -1
- package/dist/components/icons/WifiIcon.d.ts +2 -1
- package/dist/components/icons/WriteIcon.d.ts +2 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/useFormReset.d.ts +6 -0
- package/dist/hooks/useFormReset.js +19 -0
- package/dist/hooks/useSlots.d.ts +2 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.js +6 -4
- package/dist/types/index.js +4 -0
- package/dist/utils/slots.d.ts +1 -1
- package/dist/utils/slots.js +20 -12
- package/package.json +22 -18
- package/src/components/Author/Author.tsx +1 -1
- package/src/components/Combobox/Combobox.context.ts +3 -1
- package/src/components/Combobox/Combobox.tsx +57 -24
- package/src/components/Combobox/combobox-internal.ts +60 -0
- package/src/components/Combobox/combobox-utils.ts +1 -41
- package/src/components/Combobox/index.ts +1 -0
- package/src/components/DateInput/DateInput.context.ts +25 -0
- package/src/components/DateInput/DateInput.tsx +252 -0
- package/src/components/DateInput/dateinput-internal.ts +176 -0
- package/src/components/DateInput/dateinput-utils.ts +194 -0
- package/src/components/DateInput/index.ts +6 -0
- package/src/components/Field/Field.context.ts +1 -1
- package/src/components/Field/Field.tsx +1 -1
- package/src/components/Fieldset/Fieldset.tsx +5 -1
- package/src/components/Form/Form.tsx +9 -1
- package/src/components/Squircle/Squircle.tsx +1 -1
- package/src/components/Textarea/Textarea.tsx +19 -4
- package/src/components/ValidationSummary/ValidationSummary.context.ts +1 -1
- package/src/components/ValidationSummary/ValidationSummary.tsx +1 -1
- package/src/components/ValidationSummary/{validationsummary-utils.ts → validationsummary-internal.ts} +9 -8
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useFormReset.ts +28 -0
- package/src/index.ts +1 -0
- package/src/utils/slots.ts +37 -23
- /package/src/components/FieldMarkers/{fieldmarkers-utils.ts → fieldmarkers-internal.ts} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DATE_ERROR_MESSAGES, DATE_PARTS, getAutoComplete, validateDate, validateDateParts, validateDob } from "./dateinput-utils.js";
|
|
2
|
+
import { DateInput, DateInputDay, DateInputMonth, DateInputYear } from "./DateInput.js";
|
|
3
|
+
//#region src/components/DateInput/index.ts
|
|
4
|
+
var DateInput_default = DateInput;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { DATE_ERROR_MESSAGES, DATE_PARTS, DateInput, DateInputDay, DateInputMonth, DateInputYear, DateInput_default as default, getAutoComplete, validateDate, validateDateParts, validateDob };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { joinIds } from "../FieldMarkers/fieldmarkers-
|
|
2
|
+
import { joinIds } from "../FieldMarkers/fieldmarkers-internal.js";
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
4
4
|
//#region src/components/Field/Field.context.ts
|
|
5
5
|
const FieldContext = createContext(null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useId as useId$1 } from "../../hooks/useId.js";
|
|
3
3
|
import { forEachSlot, getSlotProp } from "../../utils/slots.js";
|
|
4
|
-
import { getMarkerIds } from "../FieldMarkers/fieldmarkers-
|
|
4
|
+
import { getMarkerIds } from "../FieldMarkers/fieldmarkers-internal.js";
|
|
5
5
|
import { FieldContext, useField } from "./Field.context.js";
|
|
6
6
|
import { Error } from "../FieldMarkers/Error.js";
|
|
7
7
|
import { Hint } from "../FieldMarkers/Hint.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region src/components/FieldMarkers/fieldmarkers-
|
|
1
|
+
//#region src/components/FieldMarkers/fieldmarkers-internal.ts
|
|
2
2
|
const joinIds = (...ids) => ids.filter(Boolean).join(" ") || void 0;
|
|
3
3
|
const getMarkerIds = (markers, baseId) => {
|
|
4
4
|
const hintId = markers.hint?.id ?? `${baseId}_hint`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useId } from "../../hooks/useId.js";
|
|
3
3
|
import { forEachSlot, getSlotProp } from "../../utils/slots.js";
|
|
4
|
-
import { getMarkerIds, joinIds } from "../FieldMarkers/fieldmarkers-
|
|
4
|
+
import { getMarkerIds, joinIds } from "../FieldMarkers/fieldmarkers-internal.js";
|
|
5
5
|
import { Error } from "../FieldMarkers/Error.js";
|
|
6
6
|
import { Hint } from "../FieldMarkers/Hint.js";
|
|
7
7
|
import { FieldsetContext, useFieldset } from "./Fieldset.context.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StandardSizes } from "../../types/index.js";
|
|
1
2
|
import { FormHTMLAttributes, JSX, ReactNode, Ref } from "react";
|
|
2
3
|
//#region src/components/Form/Form.d.ts
|
|
3
4
|
export interface FormProps extends FormHTMLAttributes<HTMLFormElement> {
|
|
@@ -7,9 +8,14 @@ export interface FormProps extends FormHTMLAttributes<HTMLFormElement> {
|
|
|
7
8
|
className?: string;
|
|
8
9
|
/** Specify a custom React ref for this component. */
|
|
9
10
|
ref?: Ref<HTMLFormElement>;
|
|
11
|
+
/** Specify the spacing.
|
|
12
|
+
*
|
|
13
|
+
* Default: `md`
|
|
14
|
+
*/
|
|
15
|
+
spacing?: StandardSizes;
|
|
10
16
|
}
|
|
11
17
|
declare const Form: {
|
|
12
|
-
({ children, className, ref, ...props }: FormProps): JSX.Element;
|
|
18
|
+
({ children, className, ref, spacing, ...props }: FormProps): JSX.Element;
|
|
13
19
|
slot: {
|
|
14
20
|
name: string;
|
|
15
21
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/Form/Form.tsx
|
|
4
|
-
const Form = ({ children, className, ref, ...props }) => {
|
|
4
|
+
const Form = ({ children, className, ref, spacing, ...props }) => {
|
|
5
5
|
const componentProps = {
|
|
6
6
|
className: clsx("coop-form", className),
|
|
7
|
+
"data-spacing": spacing ?? void 0,
|
|
7
8
|
...props
|
|
8
9
|
};
|
|
9
10
|
return /* @__PURE__ */ jsx("form", {
|
|
@@ -22,5 +22,7 @@ declare const Squircle: {
|
|
|
22
22
|
name: string;
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
+
declare const SquircleSvg: ({ size, ...props }: SquircleSvgProps) => JSX.Element;
|
|
26
|
+
declare const SquircleText: ({ children, className, ...props }: HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
25
27
|
//#endregion
|
|
26
|
-
export { Squircle, Squircle as default };
|
|
28
|
+
export { Squircle, Squircle as default, SquircleSvg, SquircleText };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Squircle, SquircleProps, SquircleSvgProps } from "./Squircle.js";
|
|
2
|
-
export { Squircle, Squircle as default, SquircleProps, SquircleSvgProps };
|
|
1
|
+
import { Squircle, SquircleProps, SquircleSvg, SquircleSvgProps, SquircleText } from "./Squircle.js";
|
|
2
|
+
export { Squircle, Squircle as default, SquircleProps, SquircleSvg, SquircleSvgProps, SquircleText };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Squircle } from "./Squircle.js";
|
|
1
|
+
import { Squircle, SquircleSvg, SquircleText } from "./Squircle.js";
|
|
2
2
|
//#region src/components/Squircle/index.ts
|
|
3
3
|
var Squircle_default = Squircle;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { Squircle, Squircle_default as default };
|
|
5
|
+
export { Squircle, SquircleSvg, SquircleText, Squircle_default as default };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { getDescribedBy, getFieldError, useField } from "../Field/Field.context.js";
|
|
3
3
|
import { useDebounce } from "../../hooks/useDebounce.js";
|
|
4
|
+
import { useFormReset } from "../../hooks/useFormReset.js";
|
|
4
5
|
import clsx from "clsx";
|
|
5
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { useState } from "react";
|
|
7
|
+
import { useRef, useState } from "react";
|
|
8
|
+
import mergeRefs from "merge-refs";
|
|
7
9
|
//#region src/components/Textarea/Textarea.tsx
|
|
8
10
|
const DEBOUNCE_DELAY = 750;
|
|
11
|
+
const lengthOf = (text) => String(text ?? "").length;
|
|
9
12
|
const charCountMessage = (remaining) => {
|
|
10
13
|
return `You have ${Math.abs(remaining).toLocaleString()} ${Math.abs(remaining) === 1 ? "character" : "characters"} ${remaining < 0 ? "too many" : "remaining"}`;
|
|
11
14
|
};
|
|
@@ -27,19 +30,26 @@ const Textarea = ({ "aria-describedby": ariaDescribedBy, className, cols = 30, c
|
|
|
27
30
|
rows,
|
|
28
31
|
...props
|
|
29
32
|
};
|
|
30
|
-
const
|
|
33
|
+
const internalRef = useRef(null);
|
|
34
|
+
const controlled = props.value !== void 0;
|
|
35
|
+
const [typedLength, setTypedLength] = useState(() => lengthOf(props.defaultValue));
|
|
36
|
+
const length = controlled ? lengthOf(props.value) : typedLength;
|
|
37
|
+
const remaining = maxLength == null ? void 0 : maxLength - length;
|
|
31
38
|
const debouncedRemaining = useDebounce(remaining, DEBOUNCE_DELAY);
|
|
39
|
+
useFormReset(internalRef, () => {
|
|
40
|
+
if (!controlled) setTypedLength(lengthOf(props.defaultValue));
|
|
41
|
+
});
|
|
32
42
|
const showCounter = !disabled && counter && maxLength && remaining != null && debouncedRemaining != null;
|
|
33
43
|
const handleChange = (e) => {
|
|
34
44
|
userOnChange?.(e);
|
|
35
|
-
if (
|
|
45
|
+
if (!controlled && e.target) setTypedLength(e.target.value.length);
|
|
36
46
|
};
|
|
37
47
|
return /* @__PURE__ */ jsxs("div", {
|
|
38
48
|
className: "coop-textarea-wrapper",
|
|
39
49
|
children: [/* @__PURE__ */ jsx("textarea", {
|
|
40
50
|
...componentProps,
|
|
41
51
|
onChange: handleChange,
|
|
42
|
-
ref
|
|
52
|
+
ref: mergeRefs(internalRef, ref)
|
|
43
53
|
}), showCounter && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("small", {
|
|
44
54
|
"aria-hidden": "true",
|
|
45
55
|
className: "coop-textarea-counter",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldError } from "./validationsummary-
|
|
1
|
+
import { FieldError } from "./validationsummary-internal.js";
|
|
2
2
|
import React, { HTMLAttributes, JSX, ReactNode, Ref, RefObject } from "react";
|
|
3
3
|
//#region src/components/ValidationSummary/ValidationSummary.d.ts
|
|
4
4
|
export interface ValidationSummaryProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { getSlotProp } from "../../utils/slots.js";
|
|
3
3
|
import { useSlots } from "../../hooks/useSlots.js";
|
|
4
|
-
import { getFieldElement, getFieldOrder, getForm, sanitizeFieldId, sortErrorsByFieldOrder } from "./validationsummary-
|
|
4
|
+
import { getFieldElement, getFieldOrder, getForm, sanitizeFieldId, sortErrorsByFieldOrder } from "./validationsummary-internal.js";
|
|
5
5
|
import { ValidationSummaryContext, useValidationSummary } from "./ValidationSummary.context.js";
|
|
6
6
|
import clsx from "clsx";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region src/components/ValidationSummary/validationsummary-
|
|
1
|
+
//#region src/components/ValidationSummary/validationsummary-internal.ts
|
|
2
2
|
const sanitizeFieldId = (id) => id?.startsWith("#") ? id.slice(1) : id;
|
|
3
3
|
const getFieldKeys = (field, id) => [
|
|
4
4
|
...id ? [sanitizeFieldId(id)] : [],
|
|
@@ -6,11 +6,12 @@ const getFieldKeys = (field, id) => [
|
|
|
6
6
|
field
|
|
7
7
|
];
|
|
8
8
|
const VISIBLE_CONTROL = "input:not([type=\"hidden\"]), select, textarea";
|
|
9
|
+
const INVALID_CONTROL = `:is(${VISIBLE_CONTROL})[aria-invalid="true"]`;
|
|
9
10
|
const isHiddenInput = (el) => el instanceof HTMLInputElement && el.type === "hidden";
|
|
10
11
|
const getVisibleControl = (form, el) => {
|
|
11
12
|
for (let node = el.parentElement; node && node !== form; node = node.parentElement) {
|
|
12
13
|
const control = node.querySelector(VISIBLE_CONTROL);
|
|
13
|
-
if (control) return control;
|
|
14
|
+
if (control) return node.querySelector(INVALID_CONTROL) ?? control;
|
|
14
15
|
}
|
|
15
16
|
return el;
|
|
16
17
|
};
|