@canonical/react-ds-core-form 0.9.0-experimental.20 → 0.9.0-experimental.21
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/README.md +3 -0
- package/dist/esm/ui/Field/common/Wrapper/withConditionalDisplay.js +20 -0
- package/dist/esm/ui/Field/common/Wrapper/withConditionalDisplay.js.map +1 -0
- package/dist/esm/ui/Field/common/Wrapper/withWrapper.js +2 -2
- package/dist/esm/ui/Field/common/Wrapper/withWrapper.js.map +1 -1
- package/dist/esm/ui/middleware/index.js +0 -1
- package/dist/esm/ui/middleware/index.js.map +1 -1
- package/dist/types/ui/Field/common/Wrapper/withConditionalDisplay.d.ts +6 -0
- package/dist/types/ui/Field/common/Wrapper/withConditionalDisplay.d.ts.map +1 -0
- package/dist/types/ui/Field/common/Wrapper/withWrapper.d.ts +5 -3
- package/dist/types/ui/Field/common/Wrapper/withWrapper.d.ts.map +1 -1
- package/dist/types/ui/Field/inputs/Checkbox/Checkbox.d.ts +12 -7
- package/dist/types/ui/Field/inputs/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/types/ui/Field/inputs/Combobox/Combobox.d.ts +11 -4
- package/dist/types/ui/Field/inputs/Combobox/Combobox.d.ts.map +1 -1
- package/dist/types/ui/Field/inputs/Hidden/Hidden.d.ts +12 -7
- package/dist/types/ui/Field/inputs/Hidden/Hidden.d.ts.map +1 -1
- package/dist/types/ui/Field/inputs/Range/Range.d.ts +12 -7
- package/dist/types/ui/Field/inputs/Range/Range.d.ts.map +1 -1
- package/dist/types/ui/Field/inputs/Select/Select.d.ts +12 -7
- package/dist/types/ui/Field/inputs/Select/Select.d.ts.map +1 -1
- package/dist/types/ui/Field/inputs/SimpleChoices/SimpleChoices.d.ts +11 -4
- package/dist/types/ui/Field/inputs/SimpleChoices/SimpleChoices.d.ts.map +1 -1
- package/dist/types/ui/Field/inputs/Text/Text.d.ts +12 -7
- package/dist/types/ui/Field/inputs/Text/Text.d.ts.map +1 -1
- package/dist/types/ui/Field/inputs/Textarea/Textarea.d.ts +12 -7
- package/dist/types/ui/Field/inputs/Textarea/Textarea.d.ts.map +1 -1
- package/dist/types/ui/Field/types.d.ts +5 -0
- package/dist/types/ui/Field/types.d.ts.map +1 -1
- package/dist/types/ui/middleware/index.d.ts +0 -1
- package/dist/types/ui/middleware/index.d.ts.map +1 -1
- package/package.json +29 -25
- package/dist/esm/ui/middleware/addConditionalDisplay.js +0 -19
- package/dist/esm/ui/middleware/addConditionalDisplay.js.map +0 -1
- package/dist/types/ui/middleware/addConditionalDisplay.d.ts +0 -4
- package/dist/types/ui/middleware/addConditionalDisplay.d.ts.map +0 -1
package/README.md
CHANGED
@@ -6,3 +6,6 @@ The collection of Form Components in the DS25.
|
|
6
6
|
|
7
7
|
This package uses the same build as `ds-core` in the same folder. All comments made on the README.md file apply here.
|
8
8
|
|
9
|
+
## Notes
|
10
|
+
|
11
|
+
+ This package uses MSW to mock back-end requests - in particular related to field-level middleware. For that purpose, this package exposes a unique command, `init:msw` which populates the public folder with the service worker necessary to intercept requests with our mock API. This script only has to be run once, but is nevertheless kept on the package.json for reference.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { useFormContext } from "react-hook-form";
|
3
|
+
// TODO improve typing of P
|
4
|
+
const withConditionalDisplay = (WrappedComponent) => {
|
5
|
+
const ConditionalComponent = (props) => {
|
6
|
+
const { condition, ...otherProps } = props;
|
7
|
+
if (!condition)
|
8
|
+
return React.createElement(WrappedComponent, props);
|
9
|
+
const [dependencies, conditionFunction] = condition;
|
10
|
+
const { watch } = useFormContext();
|
11
|
+
const depValues = watch(dependencies);
|
12
|
+
const shouldRender = conditionFunction(depValues);
|
13
|
+
if (!shouldRender)
|
14
|
+
return null;
|
15
|
+
return React.createElement(WrappedComponent, otherProps);
|
16
|
+
};
|
17
|
+
return ConditionalComponent;
|
18
|
+
};
|
19
|
+
export default withConditionalDisplay;
|
20
|
+
//# sourceMappingURL=withConditionalDisplay.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"withConditionalDisplay.js","sourceRoot":"","sources":["../../../../../../src/ui/Field/common/Wrapper/withConditionalDisplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMjD,2BAA2B;AAC3B,MAAM,sBAAsB,GAAG,CAC7B,gBAAqD,EACrD,EAAE;IACF,MAAM,oBAAoB,GAAG,CAC3B,KAAoD,EACpD,EAAE;QACF,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;QAC3C,IAAI,CAAC,SAAS;YACZ,OAAO,KAAK,CAAC,aAAa,CAAC,gBAAgB,EAAE,KAAuB,CAAC,CAAC;QACxE,MAAM,CAAC,YAAY,EAAE,iBAAiB,CAAC,GAAG,SAAS,CAAC;QAEpD,MAAM,EAAE,KAAK,EAAE,GAAG,cAAc,EAAE,CAAC;QACnC,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;QACtC,MAAM,YAAY,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,YAAY;YAAE,OAAO,IAAI,CAAC;QAC/B,OAAO,KAAK,CAAC,aAAa,CAAC,gBAAgB,EAAE,UAA4B,CAAC,CAAC;IAC7E,CAAC,CAAC;IACF,OAAO,oBAAoB,CAAC;AAC9B,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import { useMemo } from "react";
|
3
3
|
import DefaultWrapper from "./Wrapper.js";
|
4
|
+
import withConditionalDisplay from "./withConditionalDisplay.js";
|
4
5
|
const withWrapper = (Component, options, Wrapper = DefaultWrapper) => {
|
5
6
|
const MemoizedComponent = React.memo(Component);
|
6
7
|
function WrappedComponent({ middleware = [], WrapperComponent = Wrapper, ...props }) {
|
@@ -22,8 +23,7 @@ const withWrapper = (Component, options, Wrapper = DefaultWrapper) => {
|
|
22
23
|
// } as WrapperProps<ComponentProps>; // The typing should be ComponentWrapperProps, but it would require an overload
|
23
24
|
return React.createElement(WrapperComponent, finalProps);
|
24
25
|
}
|
25
|
-
|
26
|
-
return WrappedComponent;
|
26
|
+
return withConditionalDisplay(WrappedComponent);
|
27
27
|
};
|
28
28
|
export default withWrapper;
|
29
29
|
//# sourceMappingURL=withWrapper.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"withWrapper.js","sourceRoot":"","sources":["../../../../../../src/ui/Field/common/Wrapper/withWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAQhC,OAAO,cAAc,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"withWrapper.js","sourceRoot":"","sources":["../../../../../../src/ui/Field/common/Wrapper/withWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAQhC,OAAO,cAAc,MAAM,cAAc,CAAC;AAC1C,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AAOjE,MAAM,WAAW,GAAG,CAKlB,SAA8C,EAC9C,OAAwC,EACxC,UAA6D,cAAc,EAG3E,EAAE;IACF,MAAM,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAEhD,SAAS,gBAAgB,CAAC,EACxB,UAAU,GAAG,EAAE,EACf,gBAAgB,GAAG,OAAO,EAC1B,GAAG,KAAK,EACsC;QAC9C,8DAA8D;QAC9D,wFAAwF;QAExF,MAAM,iBAAiB,GAAG,OAAO,CAC/B,GAAG,EAAE;QACH,gEAAgE;QAChE,6BAA6B;QAC7B,UAAU;aACP,OAAO,EAAE;aACT,MAAM,CACL,CAAC,oBAAoB,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,oBAAoB,CAAC,EACxD,iBAAiB,CAClB,EACL,CAAC,UAAU,CAAC,CACb,CAAC;QAEF,gDAAgD;QAChD,MAAM,UAAU,GAAG;YACjB,gCAAgC;YAChC,SAAS,EAAE,iBAAiB;YAC5B,GAAG,KAAK;YACR,GAAG,OAAO;SACX,CAAC;QACF,qHAAqH;QAErH,OAAO,KAAK,CAAC,aAAa,CACxB,gBAAgB,EAChB,UAA0C,CAC3C,CAAC;IACJ,CAAC;IACD,OAAO,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/middleware/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/middleware/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import type { BaseInputProps, WrappedComponentProps } from "../../types.js";
|
3
|
+
type WrappedComponentPropsInternal<ComponentProps extends BaseInputProps> = Omit<WrappedComponentProps<ComponentProps>, "Component">;
|
4
|
+
declare const withConditionalDisplay: <ComponentProps extends BaseInputProps>(WrappedComponent: React.ComponentType<ComponentProps>) => (props: WrappedComponentPropsInternal<ComponentProps>) => React.ReactElement<ComponentProps, string | React.JSXElementConstructor<any>> | null;
|
5
|
+
export default withConditionalDisplay;
|
6
|
+
//# sourceMappingURL=withConditionalDisplay.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"withConditionalDisplay.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/common/Wrapper/withConditionalDisplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5E,KAAK,6BAA6B,CAAC,cAAc,SAAS,cAAc,IACtE,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC,CAAC;AAG3D,QAAA,MAAM,sBAAsB,GAAI,cAAc,SAAS,cAAc,EACnE,kBAAkB,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,aAG5C,6BAA6B,CAAC,cAAc,CAAC,yFAcvD,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
import type { BaseInputProps, BaseWrapperProps, WrappedComponentProps, WrapperProps } from "../../types.js";
|
3
|
-
type WrappedComponentPropsInternal<ComponentProps extends BaseInputProps> = Omit<WrappedComponentProps<ComponentProps>, "Component"
|
4
|
-
|
2
|
+
import type { BaseInputProps, BaseWrapperProps, Condition, WrappedComponentProps, WrapperProps } from "../../types.js";
|
3
|
+
type WrappedComponentPropsInternal<ComponentProps extends BaseInputProps> = Omit<WrappedComponentProps<ComponentProps>, "Component"> & {
|
4
|
+
condition?: Condition;
|
5
|
+
};
|
6
|
+
declare const withWrapper: <ComponentProps extends BaseInputProps, ComponentWrapperProps extends BaseWrapperProps<ComponentProps> = WrapperProps<ComponentProps>>(Component: React.ComponentType<ComponentProps>, options?: Partial<ComponentWrapperProps>, Wrapper?: React.ComponentType<WrapperProps<ComponentProps>>) => (props: "id" | "label" | "style" | "className" | "description" | "isOptional" | "nestedRegisterProps" | "unregisterOnUnmount" | "mockLabel" | "middleware" | "WrapperComponent" | "condition" | Exclude<Exclude<keyof ComponentProps, "Component">, "Component"> extends infer T extends keyof WrappedComponentProps<WrappedComponentPropsInternal<ComponentProps>> ? { [P in T]: WrappedComponentProps<WrappedComponentPropsInternal<ComponentProps>>[P]; } : never) => React.ReactElement<WrappedComponentPropsInternal<ComponentProps>, string | React.JSXElementConstructor<any>> | null;
|
5
7
|
export default withWrapper;
|
6
8
|
//# sourceMappingURL=withWrapper.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"withWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/common/Wrapper/withWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"withWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/common/Wrapper/withWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,qBAAqB,EACrB,YAAY,EACb,MAAM,gBAAgB,CAAC;AAIxB,KAAK,6BAA6B,CAAC,cAAc,SAAS,cAAc,IACtE,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC,GAAG;IACzD,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEJ,QAAA,MAAM,WAAW,GACf,cAAc,SAAS,cAAc,EACrC,qBAAqB,SACnB,gBAAgB,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC,cAAc,CAAC,EAEjE,WAAW,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,EAC9C,UAAU,OAAO,CAAC,qBAAqB,CAAC,EACxC,UAAS,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,cAAc,CAAC,CAAkB,ikBA0C5E,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type React from "react";
|
2
2
|
import type { CheckboxProps } from "./types.js";
|
3
3
|
import "./styles.css";
|
4
|
-
declare const _default: (
|
4
|
+
declare const _default: (props: {
|
5
5
|
name: string;
|
6
6
|
max?: number | string | undefined | undefined;
|
7
7
|
required?: boolean | undefined | undefined;
|
@@ -164,7 +164,7 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
164
164
|
onBlurCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
165
165
|
onChange?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
166
166
|
onChangeCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
167
|
-
onBeforeInput?: React.
|
167
|
+
onBeforeInput?: React.InputEventHandler<HTMLInputElement> | undefined;
|
168
168
|
onBeforeInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
169
169
|
onInput?: React.FormEventHandler<HTMLInputElement> | undefined;
|
170
170
|
onInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
@@ -214,8 +214,6 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
214
214
|
onProgressCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
215
215
|
onRateChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
216
216
|
onRateChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
217
|
-
onResize?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
218
|
-
onResizeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
219
217
|
onSeeked?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
220
218
|
onSeekedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
221
219
|
onSeeking?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
@@ -321,8 +319,15 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
321
319
|
unregisterOnUnmount?: boolean | undefined;
|
322
320
|
registerProps?: import("react-hook-form").RegisterOptions | undefined;
|
323
321
|
mockLabel?: boolean | undefined;
|
324
|
-
middleware?: import("../../types.js").Middleware<CheckboxProps>[]
|
325
|
-
|
326
|
-
})
|
322
|
+
middleware?: (import("../../types.js").Middleware<CheckboxProps>[] & import("../../types.js").Middleware<Omit<import("../../types.js").WrappedComponentProps<CheckboxProps>, "Component"> & {
|
323
|
+
condition?: import("../../types.js").Condition;
|
324
|
+
}>[]) | undefined;
|
325
|
+
WrapperComponent?: (React.ComponentType<import("../../types.js").WrapperProps<CheckboxProps>> & React.ComponentType<import("../../types.js").WrapperProps<Omit<import("../../types.js").WrappedComponentProps<CheckboxProps>, "Component"> & {
|
326
|
+
condition?: import("../../types.js").Condition;
|
327
|
+
}>>) | undefined;
|
328
|
+
condition?: import("../../types.js").Condition | undefined;
|
329
|
+
}) => React.ReactElement<Omit<import("../../types.js").WrappedComponentProps<CheckboxProps>, "Component"> & {
|
330
|
+
condition?: import("../../types.js").Condition;
|
331
|
+
}, string | React.JSXElementConstructor<any>> | null;
|
327
332
|
export default _default;
|
328
333
|
//# sourceMappingURL=Checkbox.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,cAAc,CAAC
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BtB,wBAAqC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type React from "react";
|
2
2
|
import type { ComboboxProps } from "./types.js";
|
3
3
|
import "./styles.css";
|
4
|
-
declare const _default: (
|
4
|
+
declare const _default: (props: {
|
5
5
|
name: string;
|
6
6
|
id?: string | undefined;
|
7
7
|
label?: string | undefined;
|
@@ -20,8 +20,13 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
20
20
|
unregisterOnUnmount?: boolean | undefined;
|
21
21
|
registerProps?: import("react-hook-form").RegisterOptions | undefined;
|
22
22
|
mockLabel?: boolean | undefined;
|
23
|
-
middleware?: import("../../types.js").Middleware<ComboboxProps>[]
|
24
|
-
|
23
|
+
middleware?: (import("../../types.js").Middleware<ComboboxProps>[] & import("../../types.js").Middleware<Omit<import("../../types.js").WrappedComponentProps<ComboboxProps>, "Component"> & {
|
24
|
+
condition?: import("../../types.js").Condition;
|
25
|
+
}>[]) | undefined;
|
26
|
+
WrapperComponent?: (React.ComponentType<import("../../types.js").WrapperProps<ComboboxProps>> & React.ComponentType<import("../../types.js").WrapperProps<Omit<import("../../types.js").WrappedComponentProps<ComboboxProps>, "Component"> & {
|
27
|
+
condition?: import("../../types.js").Condition;
|
28
|
+
}>>) | undefined;
|
29
|
+
condition?: import("../../types.js").Condition | undefined;
|
25
30
|
isMultiple?: boolean | undefined;
|
26
31
|
convertItemToString?: typeof import("./utils/convertItemToString.js").default | undefined;
|
27
32
|
valueKey?: keyof import("../../types.js").Option | undefined;
|
@@ -31,6 +36,8 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
31
36
|
inputValue: string;
|
32
37
|
}) => void) | undefined;
|
33
38
|
openOnReset?: boolean | undefined;
|
34
|
-
}) => React.ReactElement
|
39
|
+
}) => React.ReactElement<Omit<import("../../types.js").WrappedComponentProps<ComboboxProps>, "Component"> & {
|
40
|
+
condition?: import("../../types.js").Condition;
|
41
|
+
}, string | React.JSXElementConstructor<any>> | null;
|
35
42
|
export default _default;
|
36
43
|
//# sourceMappingURL=Combobox.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Combobox/Combobox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,cAAc,CAAC
|
1
|
+
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Combobox/Combobox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBtB,wBAAoD"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type React from "react";
|
2
2
|
import type { HiddenProps } from "./types.js";
|
3
|
-
declare const _default: (
|
3
|
+
declare const _default: (props: {
|
4
4
|
name: string;
|
5
5
|
max?: number | string | undefined | undefined;
|
6
6
|
required?: boolean | undefined | undefined;
|
@@ -163,7 +163,7 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
163
163
|
onBlurCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
164
164
|
onChange?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
165
165
|
onChangeCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
166
|
-
onBeforeInput?: React.
|
166
|
+
onBeforeInput?: React.InputEventHandler<HTMLInputElement> | undefined;
|
167
167
|
onBeforeInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
168
168
|
onInput?: React.FormEventHandler<HTMLInputElement> | undefined;
|
169
169
|
onInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
@@ -213,8 +213,6 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
213
213
|
onProgressCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
214
214
|
onRateChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
215
215
|
onRateChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
216
|
-
onResize?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
217
|
-
onResizeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
218
216
|
onSeeked?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
219
217
|
onSeekedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
220
218
|
onSeeking?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
@@ -320,8 +318,15 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
320
318
|
unregisterOnUnmount?: boolean | undefined;
|
321
319
|
registerProps?: import("react-hook-form").RegisterOptions | undefined;
|
322
320
|
mockLabel?: boolean | undefined;
|
323
|
-
middleware?: import("../../types.js").Middleware<HiddenProps>[]
|
324
|
-
|
325
|
-
})
|
321
|
+
middleware?: (import("../../types.js").Middleware<HiddenProps>[] & import("../../types.js").Middleware<Omit<import("../../types.js").WrappedComponentProps<HiddenProps>, "Component"> & {
|
322
|
+
condition?: import("../../types.js").Condition;
|
323
|
+
}>[]) | undefined;
|
324
|
+
WrapperComponent?: (React.ComponentType<import("../../types.js").WrapperProps<HiddenProps>> & React.ComponentType<import("../../types.js").WrapperProps<Omit<import("../../types.js").WrappedComponentProps<HiddenProps>, "Component"> & {
|
325
|
+
condition?: import("../../types.js").Condition;
|
326
|
+
}>>) | undefined;
|
327
|
+
condition?: import("../../types.js").Condition | undefined;
|
328
|
+
}) => React.ReactElement<Omit<import("../../types.js").WrappedComponentProps<HiddenProps>, "Component"> & {
|
329
|
+
condition?: import("../../types.js").Condition;
|
330
|
+
}, string | React.JSXElementConstructor<any>> | null;
|
326
331
|
export default _default;
|
327
332
|
//# sourceMappingURL=Hidden.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Hidden.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Hidden/Hidden.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC
|
1
|
+
{"version":3,"file":"Hidden.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Hidden/Hidden.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6B9C,wBAAsE"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type React from "react";
|
2
2
|
import type { RangeProps } from "./types.js";
|
3
3
|
import "./styles.css";
|
4
|
-
declare const _default: (
|
4
|
+
declare const _default: (props: {
|
5
5
|
name: string;
|
6
6
|
max: number;
|
7
7
|
required?: boolean | undefined | undefined;
|
@@ -164,7 +164,7 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
164
164
|
onBlurCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
165
165
|
onChange?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
166
166
|
onChangeCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
167
|
-
onBeforeInput?: React.
|
167
|
+
onBeforeInput?: React.InputEventHandler<HTMLInputElement> | undefined;
|
168
168
|
onBeforeInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
169
169
|
onInput?: React.FormEventHandler<HTMLInputElement> | undefined;
|
170
170
|
onInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
@@ -214,8 +214,6 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
214
214
|
onProgressCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
215
215
|
onRateChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
216
216
|
onRateChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
217
|
-
onResize?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
218
|
-
onResizeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
219
217
|
onSeeked?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
220
218
|
onSeekedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
221
219
|
onSeeking?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
@@ -321,8 +319,15 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
321
319
|
unregisterOnUnmount?: boolean | undefined;
|
322
320
|
registerProps?: import("react-hook-form").RegisterOptions | undefined;
|
323
321
|
mockLabel?: boolean | undefined;
|
324
|
-
middleware?: import("../../types.js").Middleware<RangeProps>[]
|
325
|
-
|
326
|
-
})
|
322
|
+
middleware?: (import("../../types.js").Middleware<RangeProps>[] & import("../../types.js").Middleware<Omit<import("../../types.js").WrappedComponentProps<RangeProps>, "Component"> & {
|
323
|
+
condition?: import("../../types.js").Condition;
|
324
|
+
}>[]) | undefined;
|
325
|
+
WrapperComponent?: (React.ComponentType<import("../../types.js").WrapperProps<RangeProps>> & React.ComponentType<import("../../types.js").WrapperProps<Omit<import("../../types.js").WrappedComponentProps<RangeProps>, "Component"> & {
|
326
|
+
condition?: import("../../types.js").Condition;
|
327
|
+
}>>) | undefined;
|
328
|
+
condition?: import("../../types.js").Condition | undefined;
|
329
|
+
}) => React.ReactElement<Omit<import("../../types.js").WrappedComponentProps<RangeProps>, "Component"> & {
|
330
|
+
condition?: import("../../types.js").Condition;
|
331
|
+
}, string | React.JSXElementConstructor<any>> | null;
|
327
332
|
export default _default;
|
328
333
|
//# sourceMappingURL=Range.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Range.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Range/Range.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,cAAc,CAAC
|
1
|
+
{"version":3,"file":"Range.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Range/Range.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CtB,wBAA8C"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type React from "react";
|
2
2
|
import type { SelectProps } from "./types.js";
|
3
3
|
import "./styles.css";
|
4
|
-
declare const _default: (
|
4
|
+
declare const _default: (props: {
|
5
5
|
name: string;
|
6
6
|
required?: boolean | undefined | undefined;
|
7
7
|
id?: string | undefined;
|
@@ -143,7 +143,7 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
143
143
|
onBlurCapture?: React.FocusEventHandler<HTMLSelectElement> | undefined;
|
144
144
|
onChange?: React.ChangeEventHandler<HTMLSelectElement> | undefined;
|
145
145
|
onChangeCapture?: React.FormEventHandler<HTMLSelectElement> | undefined;
|
146
|
-
onBeforeInput?: React.
|
146
|
+
onBeforeInput?: React.InputEventHandler<HTMLSelectElement> | undefined;
|
147
147
|
onBeforeInputCapture?: React.FormEventHandler<HTMLSelectElement> | undefined;
|
148
148
|
onInput?: React.FormEventHandler<HTMLSelectElement> | undefined;
|
149
149
|
onInputCapture?: React.FormEventHandler<HTMLSelectElement> | undefined;
|
@@ -193,8 +193,6 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
193
193
|
onProgressCapture?: React.ReactEventHandler<HTMLSelectElement> | undefined;
|
194
194
|
onRateChange?: React.ReactEventHandler<HTMLSelectElement> | undefined;
|
195
195
|
onRateChangeCapture?: React.ReactEventHandler<HTMLSelectElement> | undefined;
|
196
|
-
onResize?: React.ReactEventHandler<HTMLSelectElement> | undefined;
|
197
|
-
onResizeCapture?: React.ReactEventHandler<HTMLSelectElement> | undefined;
|
198
196
|
onSeeked?: React.ReactEventHandler<HTMLSelectElement> | undefined;
|
199
197
|
onSeekedCapture?: React.ReactEventHandler<HTMLSelectElement> | undefined;
|
200
198
|
onSeeking?: React.ReactEventHandler<HTMLSelectElement> | undefined;
|
@@ -300,8 +298,15 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
300
298
|
unregisterOnUnmount?: boolean | undefined;
|
301
299
|
registerProps?: import("react-hook-form").RegisterOptions | undefined;
|
302
300
|
mockLabel?: boolean | undefined;
|
303
|
-
middleware?: import("../../types.js").Middleware<SelectProps>[]
|
304
|
-
|
305
|
-
})
|
301
|
+
middleware?: (import("../../types.js").Middleware<SelectProps>[] & import("../../types.js").Middleware<Omit<import("../../types.js").WrappedComponentProps<SelectProps>, "Component"> & {
|
302
|
+
condition?: import("../../types.js").Condition;
|
303
|
+
}>[]) | undefined;
|
304
|
+
WrapperComponent?: (React.ComponentType<import("../../types.js").WrapperProps<SelectProps>> & React.ComponentType<import("../../types.js").WrapperProps<Omit<import("../../types.js").WrappedComponentProps<SelectProps>, "Component"> & {
|
305
|
+
condition?: import("../../types.js").Condition;
|
306
|
+
}>>) | undefined;
|
307
|
+
condition?: import("../../types.js").Condition | undefined;
|
308
|
+
}) => React.ReactElement<Omit<import("../../types.js").WrappedComponentProps<SelectProps>, "Component"> & {
|
309
|
+
condition?: import("../../types.js").Condition;
|
310
|
+
}, string | React.JSXElementConstructor<any>> | null;
|
306
311
|
export default _default;
|
307
312
|
//# sourceMappingURL=Select.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Select/Select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,cAAc,CAAC
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Select/Select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CtB,wBAAgD"}
|
@@ -2,7 +2,7 @@ import type React from "react";
|
|
2
2
|
import type { WrapperProps } from "../../types.js";
|
3
3
|
import type { SimpleChoicesProps } from "./types.js";
|
4
4
|
import "./styles.css";
|
5
|
-
declare const _default: (
|
5
|
+
declare const _default: (props: {
|
6
6
|
name: string;
|
7
7
|
id?: string | undefined;
|
8
8
|
label?: string | undefined;
|
@@ -20,9 +20,16 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
20
20
|
unregisterOnUnmount?: boolean | undefined;
|
21
21
|
registerProps?: import("react-hook-form").RegisterOptions | undefined;
|
22
22
|
mockLabel?: boolean | undefined;
|
23
|
-
middleware?: import("../../types.js").Middleware<SimpleChoicesProps>[]
|
24
|
-
|
23
|
+
middleware?: (import("../../types.js").Middleware<SimpleChoicesProps>[] & import("../../types.js").Middleware<Omit<import("../../types.js").WrappedComponentProps<SimpleChoicesProps>, "Component"> & {
|
24
|
+
condition?: import("../../types.js").Condition;
|
25
|
+
}>[]) | undefined;
|
26
|
+
WrapperComponent?: (React.ComponentType<WrapperProps<SimpleChoicesProps>> & React.ComponentType<WrapperProps<Omit<import("../../types.js").WrappedComponentProps<SimpleChoicesProps>, "Component"> & {
|
27
|
+
condition?: import("../../types.js").Condition;
|
28
|
+
}>>) | undefined;
|
29
|
+
condition?: import("../../types.js").Condition | undefined;
|
25
30
|
isMultiple?: boolean | undefined;
|
26
|
-
}) => React.ReactElement
|
31
|
+
}) => React.ReactElement<Omit<import("../../types.js").WrappedComponentProps<SimpleChoicesProps>, "Component"> & {
|
32
|
+
condition?: import("../../types.js").Condition;
|
33
|
+
}, string | React.JSXElementConstructor<any>> | null;
|
27
34
|
export default _default;
|
28
35
|
//# sourceMappingURL=SimpleChoices.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SimpleChoices.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/SimpleChoices/SimpleChoices.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAe,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,cAAc,CAAC
|
1
|
+
{"version":3,"file":"SimpleChoices.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/SimpleChoices/SimpleChoices.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAe,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EtB,wBAIE"}
|
@@ -7,7 +7,7 @@ import "./styles.css";
|
|
7
7
|
*/
|
8
8
|
declare const Text: ({ id, className, style, inputType, name, prefix, suffix, registerProps, ...otherProps }: TextProps) => React.ReactElement;
|
9
9
|
export type MyComp = typeof Text;
|
10
|
-
declare const _default: (
|
10
|
+
declare const _default: (props: {
|
11
11
|
name: string;
|
12
12
|
max?: number | string | undefined | undefined;
|
13
13
|
required?: boolean | undefined | undefined;
|
@@ -171,7 +171,7 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
171
171
|
onBlurCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
172
172
|
onChange?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
173
173
|
onChangeCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
174
|
-
onBeforeInput?: React.
|
174
|
+
onBeforeInput?: React.InputEventHandler<HTMLInputElement> | undefined;
|
175
175
|
onBeforeInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
176
176
|
onInput?: React.FormEventHandler<HTMLInputElement> | undefined;
|
177
177
|
onInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
@@ -221,8 +221,6 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
221
221
|
onProgressCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
222
222
|
onRateChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
223
223
|
onRateChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
224
|
-
onResize?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
225
|
-
onResizeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
226
224
|
onSeeked?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
227
225
|
onSeekedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
228
226
|
onSeeking?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
@@ -328,9 +326,16 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
328
326
|
unregisterOnUnmount?: boolean | undefined;
|
329
327
|
registerProps?: import("react-hook-form").RegisterOptions | undefined;
|
330
328
|
mockLabel?: boolean | undefined;
|
331
|
-
middleware?: import("../../types.js").Middleware<TextProps>[]
|
332
|
-
|
329
|
+
middleware?: (import("../../types.js").Middleware<TextProps>[] & import("../../types.js").Middleware<Omit<import("../../types.js").WrappedComponentProps<TextProps>, "Component"> & {
|
330
|
+
condition?: import("../../types.js").Condition;
|
331
|
+
}>[]) | undefined;
|
332
|
+
WrapperComponent?: (React.ComponentType<import("../../types.js").WrapperProps<TextProps>> & React.ComponentType<import("../../types.js").WrapperProps<Omit<import("../../types.js").WrappedComponentProps<TextProps>, "Component"> & {
|
333
|
+
condition?: import("../../types.js").Condition;
|
334
|
+
}>>) | undefined;
|
335
|
+
condition?: import("../../types.js").Condition | undefined;
|
333
336
|
suffix?: React.ReactNode;
|
334
|
-
}) => React.ReactElement
|
337
|
+
}) => React.ReactElement<Omit<import("../../types.js").WrappedComponentProps<TextProps>, "Component"> & {
|
338
|
+
condition?: import("../../types.js").Condition;
|
339
|
+
}, string | React.JSXElementConstructor<any>> | null;
|
335
340
|
export default _default;
|
336
341
|
//# sourceMappingURL=Text.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,cAAc,CAAC;AAKtB;;;GAGG;AACH,QAAA,MAAM,IAAI,GAAI,yFAUX,SAAS,KAAG,KAAK,CAAC,YAkBpB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,OAAO,IAAI,CAAC
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,cAAc,CAAC;AAKtB;;;GAGG;AACH,QAAA,MAAM,IAAI,GAAI,yFAUX,SAAS,KAAG,KAAK,CAAC,YAkBpB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,OAAO,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjC,wBAA4C"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type React from "react";
|
2
2
|
import type { TextareaProps } from "./types.js";
|
3
3
|
import "./styles.css";
|
4
|
-
declare const _default: (
|
4
|
+
declare const _default: (props: {
|
5
5
|
name: string;
|
6
6
|
required?: boolean | undefined | undefined;
|
7
7
|
id?: string | undefined;
|
@@ -147,7 +147,7 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
147
147
|
onBlurCapture?: React.FocusEventHandler<HTMLTextAreaElement> | undefined;
|
148
148
|
onChange?: React.ChangeEventHandler<HTMLTextAreaElement> | undefined;
|
149
149
|
onChangeCapture?: React.FormEventHandler<HTMLTextAreaElement> | undefined;
|
150
|
-
onBeforeInput?: React.
|
150
|
+
onBeforeInput?: React.InputEventHandler<HTMLTextAreaElement> | undefined;
|
151
151
|
onBeforeInputCapture?: React.FormEventHandler<HTMLTextAreaElement> | undefined;
|
152
152
|
onInput?: React.FormEventHandler<HTMLTextAreaElement> | undefined;
|
153
153
|
onInputCapture?: React.FormEventHandler<HTMLTextAreaElement> | undefined;
|
@@ -197,8 +197,6 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
197
197
|
onProgressCapture?: React.ReactEventHandler<HTMLTextAreaElement> | undefined;
|
198
198
|
onRateChange?: React.ReactEventHandler<HTMLTextAreaElement> | undefined;
|
199
199
|
onRateChangeCapture?: React.ReactEventHandler<HTMLTextAreaElement> | undefined;
|
200
|
-
onResize?: React.ReactEventHandler<HTMLTextAreaElement> | undefined;
|
201
|
-
onResizeCapture?: React.ReactEventHandler<HTMLTextAreaElement> | undefined;
|
202
200
|
onSeeked?: React.ReactEventHandler<HTMLTextAreaElement> | undefined;
|
203
201
|
onSeekedCapture?: React.ReactEventHandler<HTMLTextAreaElement> | undefined;
|
204
202
|
onSeeking?: React.ReactEventHandler<HTMLTextAreaElement> | undefined;
|
@@ -305,8 +303,15 @@ declare const _default: ({ middleware, WrapperComponent, ...props }: {
|
|
305
303
|
unregisterOnUnmount?: boolean | undefined;
|
306
304
|
registerProps?: import("react-hook-form").RegisterOptions | undefined;
|
307
305
|
mockLabel?: boolean | undefined;
|
308
|
-
middleware?: import("../../types.js").Middleware<TextareaProps>[]
|
309
|
-
|
310
|
-
})
|
306
|
+
middleware?: (import("../../types.js").Middleware<TextareaProps>[] & import("../../types.js").Middleware<Omit<import("../../types.js").WrappedComponentProps<TextareaProps>, "Component"> & {
|
307
|
+
condition?: import("../../types.js").Condition;
|
308
|
+
}>[]) | undefined;
|
309
|
+
WrapperComponent?: (React.ComponentType<import("../../types.js").WrapperProps<TextareaProps>> & React.ComponentType<import("../../types.js").WrapperProps<Omit<import("../../types.js").WrappedComponentProps<TextareaProps>, "Component"> & {
|
310
|
+
condition?: import("../../types.js").Condition;
|
311
|
+
}>>) | undefined;
|
312
|
+
condition?: import("../../types.js").Condition | undefined;
|
313
|
+
}) => React.ReactElement<Omit<import("../../types.js").WrappedComponentProps<TextareaProps>, "Component"> & {
|
314
|
+
condition?: import("../../types.js").Condition;
|
315
|
+
}, string | React.JSXElementConstructor<any>> | null;
|
311
316
|
export default _default;
|
312
317
|
//# sourceMappingURL=Textarea.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Textarea/Textarea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,cAAc,CAAC
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Field/inputs/Textarea/Textarea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCtB,wBAAoD"}
|
@@ -53,6 +53,7 @@ export type WrapperProps<ComponentProps> = BaseWrapperProps<ComponentProps> & {
|
|
53
53
|
mockLabel?: boolean;
|
54
54
|
} & ComponentProps;
|
55
55
|
export type Middleware<ComponentProps> = (Component: React.ComponentType<ComponentProps>) => React.ComponentType<ComponentProps>;
|
56
|
+
export type Condition = [string[], (depsValues: unknown[]) => boolean];
|
56
57
|
export type WrapperHOCAdditionalProps<ComponentProps extends BaseInputProps, ComponentWrapperProps extends BaseWrapperProps<ComponentProps> = WrapperProps<ComponentProps>> = {
|
57
58
|
/**
|
58
59
|
* middleware to apply to the input
|
@@ -62,6 +63,10 @@ export type WrapperHOCAdditionalProps<ComponentProps extends BaseInputProps, Com
|
|
62
63
|
* An optional wrapper component to render around the input.
|
63
64
|
*/
|
64
65
|
WrapperComponent?: React.ComponentType<ComponentWrapperProps>;
|
66
|
+
/**
|
67
|
+
* A condition to determine whether to render the component or not.
|
68
|
+
*/
|
69
|
+
condition?: Condition;
|
65
70
|
};
|
66
71
|
export type WrappedComponentProps<ComponentProps extends BaseInputProps, ComponentWrapperProps extends BaseWrapperProps<ComponentProps> = WrapperProps<ComponentProps>> = ComponentWrapperProps & WrapperHOCAdditionalProps<ComponentProps, ComponentWrapperProps>;
|
67
72
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ui/Field/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,aAAa,EACd,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,oBAAoB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"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/middleware/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@canonical/react-ds-core-form",
|
3
|
-
"version": "0.9.0-experimental.
|
3
|
+
"version": "0.9.0-experimental.21",
|
4
4
|
"type": "module",
|
5
5
|
"module": "dist/esm/index.js",
|
6
6
|
"types": "dist/types/index.d.ts",
|
@@ -35,39 +35,43 @@
|
|
35
35
|
"test": "bun run test:vitest",
|
36
36
|
"test:watch": "bun run test:vitest:watch",
|
37
37
|
"test:vitest": "vitest run",
|
38
|
-
"test:vitest:watch": "vitest"
|
38
|
+
"test:vitest:watch": "vitest",
|
39
|
+
"init:msw": "npx msw init public/"
|
39
40
|
},
|
40
41
|
"dependencies": {
|
41
|
-
"@canonical/react-ds-core": "^0.9.0-experimental.
|
42
|
-
"@canonical/storybook-config": "^0.9.0-experimental.
|
43
|
-
"@canonical/styles": "^0.9.0-experimental.
|
42
|
+
"@canonical/react-ds-core": "^0.9.0-experimental.21",
|
43
|
+
"@canonical/storybook-config": "^0.9.0-experimental.21",
|
44
|
+
"@canonical/styles": "^0.9.0-experimental.21",
|
44
45
|
"downshift": "^9.0.9",
|
45
|
-
"react": "^19.
|
46
|
-
"react-dom": "^19.
|
47
|
-
"react-hook-form": "^7.
|
46
|
+
"react": "^19.1.0",
|
47
|
+
"react-dom": "^19.1.0",
|
48
|
+
"react-hook-form": "^7.57.0"
|
48
49
|
},
|
49
50
|
"devDependencies": {
|
50
51
|
"@biomejs/biome": "^1.9.4",
|
51
52
|
"@canonical/biome-config": "^0.9.0-experimental.12",
|
52
|
-
"@canonical/typescript-config-react": "^0.9.0-experimental.
|
53
|
-
"@chromatic-com/storybook": "^
|
54
|
-
"@storybook/blocks": "^8.4.7",
|
55
|
-
"@storybook/react": "^8.4.7",
|
56
|
-
"@storybook/test": "^8.4.7",
|
53
|
+
"@canonical/typescript-config-react": "^0.9.0-experimental.21",
|
54
|
+
"@chromatic-com/storybook": "^4.0.0",
|
57
55
|
"@testing-library/jest-dom": "^6.6.3",
|
58
|
-
"@testing-library/react": "^16.
|
59
|
-
"@types/node": "^
|
60
|
-
"@types/react": "^19.
|
61
|
-
"@types/react-dom": "^19.
|
62
|
-
"@vitejs/plugin-react": "^4.
|
56
|
+
"@testing-library/react": "^16.3.0",
|
57
|
+
"@types/node": "^24.0.0",
|
58
|
+
"@types/react": "^19.1.8",
|
59
|
+
"@types/react-dom": "^19.1.6",
|
60
|
+
"@vitejs/plugin-react": "^4.5.2",
|
63
61
|
"copyfiles": "^2.4.1",
|
64
|
-
"globals": "^16.
|
65
|
-
"jsdom": "^26.
|
66
|
-
"
|
67
|
-
"
|
68
|
-
"
|
62
|
+
"globals": "^16.2.0",
|
63
|
+
"jsdom": "^26.1.0",
|
64
|
+
"msw": "^2.10.2",
|
65
|
+
"storybook": "^9.0.8",
|
66
|
+
"typescript": "^5.8.3",
|
67
|
+
"vite": "^6.3.5",
|
69
68
|
"vite-tsconfig-paths": "^5.1.4",
|
70
|
-
"vitest": "^3.
|
69
|
+
"vitest": "^3.2.3"
|
71
70
|
},
|
72
|
-
"
|
71
|
+
"msw": {
|
72
|
+
"workerDirectory": [
|
73
|
+
"public"
|
74
|
+
]
|
75
|
+
},
|
76
|
+
"gitHead": "f83d38235c8d92c3dc8abf5e0e37fb659658788b"
|
73
77
|
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { createElement } from "react";
|
2
|
-
import { useFormContext } from "react-hook-form";
|
3
|
-
function addConditionalDisplay(dependencies,
|
4
|
-
// biome-ignore lint/suspicious/noExplicitAny: TODO
|
5
|
-
conditionFunction) {
|
6
|
-
return (WrappedComponent) => {
|
7
|
-
return function ExtendedComponent(props) {
|
8
|
-
const { watch } = useFormContext();
|
9
|
-
const depsValues = watch(dependencies);
|
10
|
-
const shouldDisplay = conditionFunction(depsValues);
|
11
|
-
if (shouldDisplay) {
|
12
|
-
return createElement(WrappedComponent, props);
|
13
|
-
}
|
14
|
-
return null;
|
15
|
-
};
|
16
|
-
};
|
17
|
-
}
|
18
|
-
export default addConditionalDisplay;
|
19
|
-
//# sourceMappingURL=addConditionalDisplay.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"addConditionalDisplay.js","sourceRoot":"","sources":["../../../../src/ui/middleware/addConditionalDisplay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,SAAS,qBAAqB,CAC5B,YAAsB;AACtB,mDAAmD;AACnD,iBAAiD;IAGjD,OAAO,CAAC,gBAAgB,EAAE,EAAE;QAC1B,OAAO,SAAS,iBAAiB,CAAC,KAAK;YACrC,MAAM,EAAE,KAAK,EAAE,GAAG,cAAc,EAAE,CAAC;YACnC,MAAM,UAAU,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;YACvC,MAAM,aAAa,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;YAEpD,IAAI,aAAa,EAAE,CAAC;gBAClB,OAAO,aAAa,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;YAChD,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,qBAAqB,CAAC"}
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import type { Middleware } from "ui/Field/types.js";
|
2
|
-
declare function addConditionalDisplay(dependencies: string[], conditionFunction: (depsValues: any[]) => boolean): Middleware<any>;
|
3
|
-
export default addConditionalDisplay;
|
4
|
-
//# sourceMappingURL=addConditionalDisplay.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"addConditionalDisplay.d.ts","sourceRoot":"","sources":["../../../../src/ui/middleware/addConditionalDisplay.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,iBAAS,qBAAqB,CAC5B,YAAY,EAAE,MAAM,EAAE,EAEtB,iBAAiB,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,OAAO,GAEhD,UAAU,CAAC,GAAG,CAAC,CAajB;AAED,eAAe,qBAAqB,CAAC"}
|