@vuu-ui/vuu-data-editing 3.3.15 → 3.3.17

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.3.15",
2
+ "version": "3.3.17",
3
3
  "description": "Shared data editing APIs and React components for VUU UI",
4
4
  "main": "./src/index.js",
5
5
  "author": "heswell",
@@ -12,13 +12,13 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@salt-ds/core": "1.54.1",
15
- "@vuu-ui/vuu-ui-controls": "3.3.15",
16
- "@vuu-ui/vuu-utils": "3.3.15"
15
+ "@vuu-ui/vuu-ui-controls": "3.3.17",
16
+ "@vuu-ui/vuu-utils": "3.3.17"
17
17
  },
18
18
  "devDependencies": {
19
- "@vuu-ui/vuu-data-types": "3.3.15",
20
- "@vuu-ui/vuu-protocol-types": "3.3.15",
21
- "@vuu-ui/vuu-table-types": "3.3.15"
19
+ "@vuu-ui/vuu-data-types": "3.3.17",
20
+ "@vuu-ui/vuu-protocol-types": "3.3.17",
21
+ "@vuu-ui/vuu-table-types": "3.3.17"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": "^19.2.3"
@@ -0,0 +1,12 @@
1
+ import type { DataRow } from "@vuu-ui/vuu-table-types";
2
+ export type TextFieldType = "email" | "password";
3
+ export type EditFieldType = "checkbox" | TextFieldType;
4
+ export interface EditFieldProps {
5
+ dataRow: DataRow;
6
+ label: string;
7
+ name: string;
8
+ readOnly?: boolean;
9
+ required?: boolean;
10
+ type?: EditFieldType;
11
+ }
12
+ export declare const EditField: ({ dataRow, label, name, readOnly, required, type, }: EditFieldProps) => import("react").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
2
+ import type { RuntimeColumnDescriptor, TableCellEditHandler } from "@vuu-ui/vuu-table-types";
3
+ import { type ChangeEventHandler, type FocusEventHandler, type KeyboardEvent } from "react";
4
+ import type { TextFieldType } from "./EditField";
5
+ export interface EditFieldHookProps<T extends VuuRowDataItemType = VuuRowDataItemType> {
6
+ column: Pick<RuntimeColumnDescriptor, "clientSideEditValidationCheck" | "label" | "name">;
7
+ value?: T;
8
+ onEdit?: TableCellEditHandler;
9
+ textType?: TextFieldType;
10
+ type?: "string" | "number" | "boolean";
11
+ }
12
+ export declare const useEditField: <T extends string | number | boolean = string>({ column, value, onEdit, textType, type, }: EditFieldHookProps<T>) => {
13
+ editing: boolean;
14
+ inputProps: {
15
+ onBlur: FocusEventHandler<HTMLElement>;
16
+ onFocus: FocusEventHandler<HTMLElement>;
17
+ type: TextFieldType | undefined;
18
+ };
19
+ onChange: ChangeEventHandler;
20
+ onKeyDown: (evt: KeyboardEvent<HTMLElement>) => Promise<void>;
21
+ previousValue: string | undefined;
22
+ value: string;
23
+ warningMessage: string | undefined;
24
+ };
@@ -0,0 +1,13 @@
1
+ import type { CopyOption, DataSource } from "@vuu-ui/vuu-data-types";
2
+ import { EditSession } from ".";
3
+ export interface EditableHookProps {
4
+ copyOption?: CopyOption;
5
+ dataSource: DataSource;
6
+ onCancel: () => void;
7
+ onSave: () => void;
8
+ }
9
+ export declare const useEditable: ({ copyOption, dataSource, onCancel, onSave }: EditableHookProps) => {
10
+ editSession: EditSession;
11
+ onCancel: () => Promise<void>;
12
+ onSave: (force?: boolean) => Promise<void>;
13
+ };