react-hook-form-cloudscape 1.0.1-dev.1 → 1.1.0-dev.1
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 +5 -2
- package/components/cards/cards.d.ts +9 -0
- package/components/cards/cards.js +14 -0
- package/components/cards/cards.js.map +1 -0
- package/components/cards/index.d.ts +1 -0
- package/components/cards/index.js +2 -0
- package/components/cards/index.js.map +1 -0
- package/components/components/cards/cards.d.ts +9 -0
- package/components/components/cards/index.d.ts +1 -0
- package/components/components/index.d.ts +1 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/index.js.map +1 -1
- package/package.json +1 -1
- package/react-hook-form-cloudscape.es.js +390 -369
- package/react-hook-form-cloudscape.es.js.map +1 -1
- package/react-hook-form-cloudscape.umd.js +8 -8
- package/react-hook-form-cloudscape.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
A React library that simplifies the integration of [`react-hook-form`](https://github.com/react-hook-form/react-hook-form) with [`Cloudscape Design System`](https://github.com/cloudscape-design/components). It provides a set of pre-built, controlled input components that handle validation, allowing you to focus on building complex form logic with minimal effort.
|
|
4
4
|
|
|
5
5
|
<p align="left">
|
|
6
|
-
<a href="https://
|
|
6
|
+
<a href="https://www.npmjs.com/package/react-hook-form-cloudscape" target="_blank">
|
|
7
|
+
<img alt="npmjs" src="https://img.shields.io/npm/v/react-hook-form-cloudscape">
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://securityscorecards.dev/viewer/?uri=github.com/abudayah/react-hook-form-cloudscape" target="_blank">
|
|
7
10
|
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/abudayah/react-hook-form-cloudscape/badge">
|
|
8
11
|
</a>
|
|
9
12
|
</p>
|
|
@@ -43,7 +46,7 @@ function App {
|
|
|
43
46
|
|
|
44
47
|
## Demo
|
|
45
48
|
|
|
46
|
-

|
|
49
|
+

|
|
47
50
|
|
|
48
51
|
## Getting help
|
|
49
52
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CardsProps } from '@cloudscape-design/components';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
4
|
+
export interface ControlledCardsProps<T extends FieldValues> extends Omit<Required<Pick<CardsProps, 'trackBy'>> & Required<Pick<CardsProps, 'selectionType'>> & CardsProps, 'value'> {
|
|
5
|
+
name: Path<T>;
|
|
6
|
+
control?: Control<T>;
|
|
7
|
+
}
|
|
8
|
+
export declare const CCards: <TFieldValues extends FieldValues>({ name, control, onSelectionChange, ...props }: ControlledCardsProps<TFieldValues>) => React.JSX.Element;
|
|
9
|
+
export default CCards;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { Cards } from '@cloudscape-design/components';
|
|
3
|
+
import React, { useCallback } from 'react';
|
|
4
|
+
import { Controller } from 'react-hook-form';
|
|
5
|
+
export const CCards = (_a) => {
|
|
6
|
+
var { name, control, onSelectionChange } = _a, props = __rest(_a, ["name", "control", "onSelectionChange"]);
|
|
7
|
+
const handleOnChange = useCallback((formOnChange, e) => {
|
|
8
|
+
formOnChange(e.detail.selectedItems);
|
|
9
|
+
onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(e);
|
|
10
|
+
}, [onSelectionChange]);
|
|
11
|
+
return (React.createElement(Controller, { name: name, control: control, render: ({ field: { onChange, value } }) => (React.createElement(Cards, Object.assign({ onSelectionChange: handleOnChange.bind(null, onChange), selectedItems: value }, props))) }));
|
|
12
|
+
};
|
|
13
|
+
export default CCards;
|
|
14
|
+
//# sourceMappingURL=cards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cards.js","sourceRoot":"","sources":["../../src/components/cards/cards.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAwC,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,UAAU,EAA8B,MAAM,iBAAiB,CAAC;AAWzE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAmC,EAKpB,EAAE,EAAE;QALgB,EACvD,IAAI,EACJ,OAAO,EACP,iBAAiB,OAEkB,EADhC,KAAK,cAJ+C,wCAKxD,CADS;IAER,MAAM,cAAc,GAAG,WAAW,CAChC,CACE,YAAqD,EACrD,CAA2E,EAC3E,EAAE;QACF,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QACrC,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,CAAC,CAAC,CAAC;IACzB,CAAC,EACD,CAAC,iBAAiB,CAAC,CACpB,CAAC;IAEF,OAAO,CACL,oBAAC,UAAU,IACT,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAC1C,oBAAC,KAAK,kBAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,aAAa,EAAE,KAAK,IAAM,KAAK,EAAI,CACnG,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CCards } from './cards';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/cards/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CardsProps } from '@cloudscape-design/components';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
4
|
+
export interface ControlledCardsProps<T extends FieldValues> extends Omit<Required<Pick<CardsProps, 'trackBy'>> & Required<Pick<CardsProps, 'selectionType'>> & CardsProps, 'value'> {
|
|
5
|
+
name: Path<T>;
|
|
6
|
+
control?: Control<T>;
|
|
7
|
+
}
|
|
8
|
+
export declare const CCards: <TFieldValues extends FieldValues>({ name, control, onSelectionChange, ...props }: ControlledCardsProps<TFieldValues>) => React.JSX.Element;
|
|
9
|
+
export default CCards;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CCards } from './cards';
|
package/components/index.d.ts
CHANGED
package/components/index.js
CHANGED
package/components/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-hook-form-cloudscape",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0-dev.1",
|
|
4
4
|
"description": "A React Hook Form wrapper designed for effortless integration of validations into Cloudscape forms and inputs",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "react-hook-form-cloudscape.umd.js",
|