@opencxh/ui-kit 3.172.0 → 3.175.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/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1171 -1156
- package/dist/index.js.map +1 -1
- package/dist/src/forms/Form.d.ts +20 -2
- package/dist/src/index.d.ts +1 -1
- package/dist/src/test/setup.d.ts +0 -0
- package/package.json +6 -2
package/dist/src/forms/Form.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InvokeOptions } from '@opencxh/domain';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
export type FormFieldType = "text" | "email" | "password" | "number" | "tel" | "url" | "color" | "textarea" | "select" | "segmented" | "checkbox" | "radio" | "date" | "file" | "folder" | "custom" | "array";
|
|
4
4
|
/**
|
|
@@ -148,6 +148,15 @@ export interface FormButtonProps {
|
|
|
148
148
|
/** Additional CSS classes */
|
|
149
149
|
className?: string;
|
|
150
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* The sliver of an app SDK that `Form` needs: one call to the server. Nothing here knows
|
|
153
|
+
* about the rest of the SDK, which is the point.
|
|
154
|
+
*/
|
|
155
|
+
export interface FormInvoker {
|
|
156
|
+
http: {
|
|
157
|
+
invoke<T = any>(options: InvokeOptions): Promise<T>;
|
|
158
|
+
};
|
|
159
|
+
}
|
|
151
160
|
export interface FormProps<T = Record<string, any>> {
|
|
152
161
|
/** Form groups */
|
|
153
162
|
groups: FormGroup<T>[];
|
|
@@ -184,7 +193,16 @@ export interface FormProps<T = Record<string, any>> {
|
|
|
184
193
|
*/
|
|
185
194
|
ref?: React.RefObject<HTMLFormElement | null>;
|
|
186
195
|
/** SDK instance */
|
|
187
|
-
|
|
196
|
+
/**
|
|
197
|
+
* A handle that can call the server, for the storage fields (`storage`, `folder`).
|
|
198
|
+
*
|
|
199
|
+
* Typed as the one method used rather than as the whole `InternalSDK`. That type moved
|
|
200
|
+
* to `@opencxh/app-sdk` — it is that package's promise, not part of the vocabulary —
|
|
201
|
+
* and ui-kit has no dependency on it, nor should it need one to render a form. Asking
|
|
202
|
+
* for what it uses also keeps the storage fields' eventual move out of here (they are
|
|
203
|
+
* slated to become a federated resource) from being blocked by a type import.
|
|
204
|
+
*/
|
|
205
|
+
sdk?: FormInvoker;
|
|
188
206
|
}
|
|
189
207
|
/**
|
|
190
208
|
* Generic Form component with groups, validation, and conditional rendering
|
package/dist/src/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export { Switch, type SwitchProps } from './input/Switch';
|
|
|
23
23
|
export { StorageInput, type StorageInputProps } from './input/StorageInput';
|
|
24
24
|
export { TextArea, type TextAreaProps } from './input/TextArea';
|
|
25
25
|
export { TextField, type TextFieldProps } from './input/TextField';
|
|
26
|
-
export { Form, FormSection, type FormButtonProps, type FormFieldType, type FormGroup, type FormGroupItem, type FormProps } from './forms/Form';
|
|
26
|
+
export { Form, FormSection, type FormButtonProps, type FormFieldType, type FormGroup, type FormGroupItem, type FormInvoker, type FormProps } from './forms/Form';
|
|
27
27
|
export { autofillProps, type AutofillProps } from './forms/autofill';
|
|
28
28
|
export { Dropdown, type DropdownOption, type DropdownProps } from './overlays/Dropdown';
|
|
29
29
|
export { ConfirmDialog, type ConfirmDialogProps } from './overlays/ConfirmDialog';
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencxh/ui-kit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.175.1",
|
|
4
4
|
"description": "Theme-aware UI component library for OpenCXH platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -37,6 +37,9 @@
|
|
|
37
37
|
"remark-gfm": "^4.0.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
41
|
+
"@testing-library/react": "^16.3.0",
|
|
42
|
+
"@testing-library/user-event": "^14.6.1",
|
|
40
43
|
"@types/react": "^19.1.8",
|
|
41
44
|
"@types/react-dom": "^19.2.3",
|
|
42
45
|
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
|
@@ -45,10 +48,11 @@
|
|
|
45
48
|
"eslint": "^9.15.0",
|
|
46
49
|
"eslint-plugin-react": "^7.37.2",
|
|
47
50
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
51
|
+
"jsdom": "^26.1.0",
|
|
48
52
|
"typescript": "6.0.3",
|
|
49
53
|
"vite": "7.1.7",
|
|
50
54
|
"vite-plugin-dts": "^5.0.3",
|
|
51
|
-
"vitest": "^
|
|
55
|
+
"vitest": "^4.0.18"
|
|
52
56
|
},
|
|
53
57
|
"peerDependencies": {
|
|
54
58
|
"react": ">=19.2.4",
|