@vuu-ui/vuu-data-react 4.2.10 → 4.3.0-beta.2

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.
Files changed (32) hide show
  1. package/package.json +15 -14
  2. package/src/data-editing/EditForm.js +1 -1
  3. package/src/data-editing/index.js +1 -1
  4. package/src/index.js +1 -1
  5. package/types/data-editing/index.d.ts +2 -1
  6. package/types/index.d.ts +1 -1
  7. package/src/data-editing/get-data-item-edit-control.js +0 -127
  8. package/src/hooks/useTypeaheadSuggestions.js +0 -50
  9. package/types/data-editing/get-data-item-edit-control.d.ts +0 -49
  10. package/types/hooks/useTypeaheadSuggestions.d.ts +0 -4
  11. package/types/src/data-editing/EditForm.d.ts +0 -5
  12. package/types/src/data-editing/UnsavedChangesReport.d.ts +0 -6
  13. package/types/src/data-editing/edit-rule-validation-checker.d.ts +0 -4
  14. package/types/src/data-editing/edit-validation-rules.d.ts +0 -1
  15. package/types/src/data-editing/form-edit-state.d.ts +0 -7
  16. package/types/src/data-editing/get-data-item-edit-control.d.ts +0 -37
  17. package/types/src/data-editing/index.d.ts +0 -6
  18. package/types/src/data-editing/useEditForm.d.ts +0 -21
  19. package/types/src/datasource-provider/VuuDataSourceProvider.d.ts +0 -17
  20. package/types/src/datasource-provider/index.d.ts +0 -1
  21. package/types/src/datasource-provider/useAutoLoginToVuuServer.d.ts +0 -20
  22. package/types/src/hooks/useLookupValues.d.ts +0 -5
  23. package/types/src/hooks/useSessionDataSource.d.ts +0 -8
  24. package/types/src/hooks/useTypeaheadSuggestions.d.ts +0 -4
  25. package/types/src/hooks/useVisualLinks.d.ts +0 -2
  26. package/types/src/hooks/useVuuMenuActions.d.ts +0 -39
  27. package/types/src/hooks/useVuuTables.d.ts +0 -2
  28. package/types/src/index.d.ts +0 -10
  29. package/types/src/lost-connection-indicator/LostConnectionIndicator.d.ts +0 -1
  30. package/types/src/lost-connection-indicator/useLostConnection.d.ts +0 -1
  31. package/types/src/session-editing-form/SessionEditingForm.d.ts +0 -24
  32. package/types/src/session-editing-form/index.d.ts +0 -1
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.2.10",
2
+ "version": "4.3.0-beta.2",
3
3
  "main": "./src/index.js",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
@@ -9,21 +9,22 @@
9
9
  "type-defs": "node ../../scripts/build-type-defs.mjs"
10
10
  },
11
11
  "devDependencies": {
12
- "@vuu-ui/vuu-data-types": "4.2.10",
13
- "@vuu-ui/vuu-filter-types": "4.2.10",
14
- "@vuu-ui/vuu-protocol-types": "4.2.10",
15
- "@vuu-ui/vuu-table-types": "4.2.10"
12
+ "@vuu-ui/vuu-data-types": "4.3.0-beta.2",
13
+ "@vuu-ui/vuu-filter-types": "4.3.0-beta.2",
14
+ "@vuu-ui/vuu-protocol-types": "4.3.0-beta.2",
15
+ "@vuu-ui/vuu-table-types": "4.3.0-beta.2"
16
16
  },
17
17
  "dependencies": {
18
- "@vuu-ui/vuu-context-menu": "4.2.10",
19
- "@vuu-ui/vuu-data-remote": "4.2.10",
20
- "@vuu-ui/vuu-filter-parser": "4.2.10",
21
- "@vuu-ui/vuu-filters": "4.2.10",
22
- "@vuu-ui/vuu-layout": "4.2.10",
23
- "@vuu-ui/vuu-notifications": "4.2.10",
24
- "@vuu-ui/vuu-ui-controls": "4.2.10",
25
- "@vuu-ui/vuu-utils": "4.2.10",
26
- "@vuu-ui/vuu-table": "4.2.10",
18
+ "@vuu-ui/vuu-context-menu": "4.3.0-beta.2",
19
+ "@vuu-ui/vuu-data-editing": "4.3.0-beta.2",
20
+ "@vuu-ui/vuu-data-remote": "4.3.0-beta.2",
21
+ "@vuu-ui/vuu-filter-parser": "4.3.0-beta.2",
22
+ "@vuu-ui/vuu-filters": "4.3.0-beta.2",
23
+ "@vuu-ui/vuu-layout": "4.3.0-beta.2",
24
+ "@vuu-ui/vuu-notifications": "4.3.0-beta.2",
25
+ "@vuu-ui/vuu-ui-controls": "4.3.0-beta.2",
26
+ "@vuu-ui/vuu-utils": "4.3.0-beta.2",
27
+ "@vuu-ui/vuu-table": "4.3.0-beta.2",
27
28
  "@salt-ds/core": "1.74.0",
28
29
  "@salt-ds/styles": "0.4.2",
29
30
  "@salt-ds/window": "0.1.2"
@@ -6,7 +6,7 @@ import clsx from "clsx";
6
6
  import { registerRules } from "./edit-validation-rules.js";
7
7
  import { useEditForm } from "./useEditForm.js";
8
8
  import EditForm from "./EditForm.css";
9
- import { getDataItemEditControl } from "./get-data-item-edit-control.js";
9
+ import { getDataItemEditControl } from "@vuu-ui/vuu-data-editing";
10
10
  const classBase = "EditForm";
11
11
  registerRules();
12
12
  const EditForm_EditForm = ({ className, dataSource, formFieldDescriptors, onSubmit: onSubmitProp, ...htmlAttributes })=>{
@@ -1,6 +1,6 @@
1
- export * from "./get-data-item-edit-control.js";
2
1
  export * from "./EditForm.js";
3
2
  export * from "./edit-rule-validation-checker.js";
4
3
  export * from "./UnsavedChangesReport.js";
5
4
  export * from "./useEditForm.js";
6
5
  export * from "./form-edit-state.js";
6
+ export { getDataItemEditControl } from "@vuu-ui/vuu-data-editing";
package/src/index.js CHANGED
@@ -3,7 +3,7 @@ export * from "./datasource-provider/index.js";
3
3
  export * from "./session-editing-form/index.js";
4
4
  export { useLookupValues } from "./hooks/useLookupValues.js";
5
5
  export { useSessionDataSource } from "./hooks/useSessionDataSource.js";
6
- export { getTypeaheadParams, useTypeaheadSuggestions } from "./hooks/useTypeaheadSuggestions.js";
6
+ export { getTypeaheadParams, useTypeaheadSuggestions } from "@vuu-ui/vuu-utils";
7
7
  export { useVisualLinks } from "./hooks/useVisualLinks.js";
8
8
  export { isRowMenu, isSelectionMenu, useVuuMenuActions } from "./hooks/useVuuMenuActions.js";
9
9
  export { useVuuTables } from "./hooks/useVuuTables.js";
@@ -1,4 +1,5 @@
1
- export * from "./get-data-item-edit-control";
1
+ /** @deprecated import from @vuu-ui/vuu-data-editing */
2
+ export { getDataItemEditControl, type DataItemEditControlProps, type DataItemEditControlPurpose, type DataItemEditControlVariant, type ValidationStatus, } from "@vuu-ui/vuu-data-editing";
2
3
  export * from "./EditForm";
3
4
  export * from "./edit-rule-validation-checker";
4
5
  export * from "./UnsavedChangesReport";
package/types/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export * from "./data-editing";
2
2
  export * from "./datasource-provider";
3
3
  export { useLookupValues } from "./hooks/useLookupValues";
4
4
  export { useSessionDataSource } from "./hooks/useSessionDataSource";
5
- export { getTypeaheadParams, useTypeaheadSuggestions, } from "./hooks/useTypeaheadSuggestions";
5
+ export { getTypeaheadParams, useTypeaheadSuggestions, } from "@vuu-ui/vuu-utils";
6
6
  export { useVisualLinks } from "./hooks/useVisualLinks";
7
7
  export { isRowMenu, isSelectionMenu, useVuuMenuActions, type MenuActionConfig, } from "./hooks/useVuuMenuActions";
8
8
  export { useVuuTables } from "./hooks/useVuuTables";
@@ -1,127 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { VuuDatePicker, VuuInput, VuuTimePicker, VuuTypeaheadInput } from "@vuu-ui/vuu-ui-controls";
3
- import { EpochTimestamp, getTemporalInfo, isDataValueEditable, isTimeDataValueWithMilliseconds, isValidTimeString, isValidTimeStringMillis, parseTemporalInput } from "@vuu-ui/vuu-utils";
4
- import { ToggleFilter } from "@vuu-ui/vuu-filters";
5
- const showToggleFilter = ({ serverDataType }, variant, values, table)=>{
6
- if ("toggle" === variant) {
7
- if ("boolean" === serverDataType) return true;
8
- if ("char" === serverDataType && values?.length) return true;
9
- if ("string" === serverDataType && table && values?.length) return true;
10
- }
11
- return false;
12
- };
13
- const timeOfDayPattern = /^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?$/;
14
- const toEpochTimestamp = (value, { encoding })=>{
15
- if (("string" == typeof value || "number" == typeof value) && !timeOfDayPattern.test(`${value}`)) return EpochTimestamp.fromWire(value, encoding);
16
- };
17
- const pad = (n)=>`${n}`.padStart(2, "0");
18
- function toTimeString(value, timestamp, { timeZone }, milliseconds = false) {
19
- if (timestamp) {
20
- const { hour, minute, second, millisecond } = timestamp.getFields(timeZone);
21
- const timeString = `${pad(hour)}:${pad(minute)}:${pad(second)}`;
22
- return milliseconds ? `${timeString}.${`${millisecond}`.padStart(3, "0")}` : timeString;
23
- } else if ("string" == typeof value) if (milliseconds) {
24
- const timeString = 8 === value.length ? `${value}.000` : value.slice(0, 12);
25
- if (isValidTimeStringMillis(timeString)) return timeString;
26
- } else {
27
- const timeString = value.slice(0, 8);
28
- if (isValidTimeString(timeString)) return timeString;
29
- }
30
- }
31
- const BOOLEAN_TOGGLE_VALUES = [
32
- true,
33
- false
34
- ];
35
- const getDataItemEditControl = ({ InputProps, TypeaheadProps, appearance, className, commitOnBlur, commitWhenCleared, dataDescriptor, editOperation = "update", errorMessage, labels, onCommit, table, values, variant })=>{
36
- const dataVariant = variant && "toggle" !== variant ? variant : void 0;
37
- const temporalInfo = getTemporalInfo(dataDescriptor);
38
- if (!isDataValueEditable(dataDescriptor, editOperation, true)) return /*#__PURE__*/ jsx(VuuInput, {
39
- variant: "secondary",
40
- ...InputProps,
41
- onCommit: onCommit,
42
- readOnly: true,
43
- "data-edit-control": true
44
- });
45
- else if (temporalInfo?.kind === "time") {
46
- const { value, onChange } = InputProps?.inputProps ?? {};
47
- const baseValue = toEpochTimestamp(value, temporalInfo);
48
- const handleCommitTime = (evt, timeString)=>{
49
- if (baseValue) {
50
- const timestamp = parseTemporalInput(timeString, temporalInfo, baseValue);
51
- onCommit(evt, timestamp ? `${timestamp.toWire(temporalInfo.encoding)}` : "");
52
- } else onCommit(evt, timeString);
53
- };
54
- return isTimeDataValueWithMilliseconds(dataDescriptor) ? /*#__PURE__*/ jsx(VuuTimePicker, {
55
- className: className,
56
- milliseconds: true,
57
- value: "" === value ? "" : toTimeString(value, baseValue, temporalInfo, true),
58
- onChange: onChange,
59
- onCommit: handleCommitTime,
60
- "data-edit-control": true
61
- }) : /*#__PURE__*/ jsx(VuuTimePicker, {
62
- className: className,
63
- value: "" === value ? "" : toTimeString(value, baseValue, temporalInfo),
64
- onChange: onChange,
65
- onCommit: handleCommitTime,
66
- "data-edit-control": true
67
- });
68
- } else if (temporalInfo) {
69
- const baseValue = toEpochTimestamp(InputProps?.inputProps?.value, temporalInfo);
70
- const handleCommitDate = (evt, startOfDayMillis)=>{
71
- let timestamp = EpochTimestamp.fromMillis(startOfDayMillis);
72
- if (baseValue && "datetime" === temporalInfo.kind) {
73
- const { year, month, day } = timestamp.getFields(temporalInfo.timeZone);
74
- const { hour, minute, second, millisecond } = baseValue.getFields(temporalInfo.timeZone);
75
- timestamp = EpochTimestamp.fromFields({
76
- year,
77
- month,
78
- day,
79
- hour,
80
- minute,
81
- second,
82
- millisecond
83
- }, temporalInfo.timeZone, baseValue.subMilliNanos);
84
- }
85
- onCommit(evt, `${timestamp.toWire(temporalInfo.encoding)}`);
86
- };
87
- return /*#__PURE__*/ jsx(VuuDatePicker, {
88
- className: className,
89
- onCommit: handleCommitDate,
90
- timeZone: temporalInfo.timeZone,
91
- value: baseValue,
92
- "data-edit-control": true
93
- });
94
- } else if (showToggleFilter(dataDescriptor, variant, values, table)) return /*#__PURE__*/ jsx(ToggleFilter, {
95
- appearance: "transparent" !== appearance ? appearance : void 0,
96
- className: className,
97
- column: dataDescriptor.name,
98
- "data-edit-control": true,
99
- disableTypeahead: "string" !== dataDescriptor.serverDataType,
100
- labels: labels,
101
- onCommit: onCommit,
102
- table: table,
103
- values: values?.length ? values : BOOLEAN_TOGGLE_VALUES,
104
- value: InputProps?.inputProps?.value ?? "all"
105
- });
106
- else if ("string" === dataDescriptor.serverDataType && table) return /*#__PURE__*/ jsx(VuuTypeaheadInput, {
107
- ...InputProps,
108
- ...TypeaheadProps,
109
- className: className,
110
- column: dataDescriptor.name,
111
- "data-edit-control": true,
112
- "data-variant": dataVariant,
113
- onCommit: onCommit,
114
- table: table
115
- });
116
- return /*#__PURE__*/ jsx(VuuInput, {
117
- variant: "secondary",
118
- ...InputProps,
119
- className: className,
120
- commitOnBlur: commitOnBlur,
121
- commitWhenCleared: commitWhenCleared,
122
- onCommit: onCommit,
123
- errorMessage: errorMessage,
124
- "data-edit-control": true
125
- });
126
- };
127
- export { getDataItemEditControl };
@@ -1,50 +0,0 @@
1
- import { useDataSource } from "@vuu-ui/vuu-utils";
2
- import { useCallback } from "react";
3
- const getTypeaheadParams = (table, column, text = "", selectedValues = [])=>{
4
- if ("" !== text && !selectedValues.includes(text.toLowerCase())) return [
5
- table,
6
- column,
7
- text
8
- ];
9
- return [
10
- table,
11
- column
12
- ];
13
- };
14
- const useTypeaheadSuggestions = ()=>{
15
- const dataSource = useDataSource(false);
16
- return useCallback(async ([{ module, table }, column, starts])=>{
17
- if (void 0 === dataSource) {
18
- console.warn("[useTypeaheadSuggestions] no dataSource provided (use DataSourceProvider)");
19
- return false;
20
- }
21
- const rpcMessage = void 0 === starts ? {
22
- params: {
23
- column,
24
- module,
25
- table
26
- },
27
- rpcName: "getUniqueFieldValues",
28
- type: "RPC_REQUEST"
29
- } : {
30
- params: {
31
- column,
32
- module,
33
- starts,
34
- table
35
- },
36
- rpcName: "getUniqueFieldValuesStartingWith",
37
- type: "RPC_REQUEST"
38
- };
39
- try {
40
- const response = await dataSource.rpcRequest?.(rpcMessage);
41
- if (response?.type === "SUCCESS_RESULT") return response.data;
42
- else return false;
43
- } catch (err) {
44
- return false;
45
- }
46
- }, [
47
- dataSource
48
- ]);
49
- };
50
- export { getTypeaheadParams, useTypeaheadSuggestions };
@@ -1,49 +0,0 @@
1
- import type { DataValueDescriptor, TableSchemaTable } from "@vuu-ui/vuu-data-types";
2
- import { type VuuTypeaheadInputProps } from "@vuu-ui/vuu-ui-controls";
3
- import { type CommitHandler } from "@vuu-ui/vuu-utils";
4
- import type { ButtonAppearance, InputProps } from "@salt-ds/core";
5
- import { type ToggleFilterValue } from "@vuu-ui/vuu-filters";
6
- /**
7
- * variant can be used to provide a rendering hint to the filter control rendered.
8
- * 'toggle' for A ToggleButtonGroup, only suitable for up to 3 value choices
9
- * 'search' to render a search icon and require at least one character to be entered.
10
- * 'pick' to show a dropdown list, even before any text is entered, best for smaller lists
11
- */
12
- export type FilterControlVariant = "search" | "pick" | "toggle";
13
- export interface DataItemEditControlProps {
14
- InputProps?: Partial<InputProps>;
15
- TypeaheadProps?: Pick<VuuTypeaheadInputProps, "highlightFirstSuggestion" | "minCharacterCountToTriggerSuggestions" | "selectOnTab">;
16
- /**
17
- * Appearance only currently honored bu ToggleFilter
18
- */
19
- appearance?: ButtonAppearance;
20
- className?: string;
21
- commitOnBlur?: boolean;
22
- commitWhenCleared?: boolean;
23
- /**
24
- * A table column or form field Descriptor.
25
- */
26
- dataDescriptor: DataValueDescriptor;
27
- editOperation?: "insert" | "update";
28
- errorMessage?: string;
29
- /**
30
- * Optional labels, only used with 'toggle' variant. If provided, must
31
- * have same number of items as values. Defaults to values.
32
- */
33
- labels?: string[];
34
- onCommit: CommitHandler<HTMLElement>;
35
- table?: TableSchemaTable;
36
- /**
37
- * Where provided, only these values will be offered as suggestions.
38
- * They will be validated against server with Typeahead service, so
39
- * unavailable options are not offered.
40
- * Recommended for toggle filters, not usually necessary for other
41
- * filter variants. Boolean values are supported for toggle filters on
42
- * boolean columns, where values default to [true, false]. A toggle filter
43
- * on a char column requires values, which are not validated.
44
- */
45
- values?: ToggleFilterValue[];
46
- variant?: FilterControlVariant;
47
- }
48
- export type ValidationStatus = "initial" | true | string;
49
- export declare const getDataItemEditControl: ({ InputProps, TypeaheadProps, appearance, className, commitOnBlur, commitWhenCleared, dataDescriptor, editOperation, errorMessage, labels, onCommit, table, values, variant, }: DataItemEditControlProps) => import("react").JSX.Element;
@@ -1,4 +0,0 @@
1
- import { SuggestionFetcher, TableSchemaTable } from "@vuu-ui/vuu-data-types";
2
- import { TypeaheadParams } from "@vuu-ui/vuu-protocol-types";
3
- export declare const getTypeaheadParams: (table: TableSchemaTable, column: string, text?: string, selectedValues?: string[]) => TypeaheadParams;
4
- export declare const useTypeaheadSuggestions: () => SuggestionFetcher;
@@ -1,5 +0,0 @@
1
- import { HTMLAttributes } from "react";
2
- import { EditFormHookProps } from "./useEditForm";
3
- export interface EditFormProps extends EditFormHookProps, Omit<HTMLAttributes<HTMLDivElement>, "onSubmit"> {
4
- }
5
- export declare const EditForm: ({ className, dataSource, formFieldDescriptors, onSubmit: onSubmitProp, ...htmlAttributes }: EditFormProps) => import("react").JSX.Element;
@@ -1,6 +0,0 @@
1
- import { Entity } from "@vuu-ui/vuu-utils";
2
- export interface UnsavedChangesReportProps<T extends Entity = Entity> {
3
- entity: T;
4
- editedEntity: T;
5
- }
6
- export declare const UnsavedChangesReport: ({ entity, editedEntity, }: UnsavedChangesReportProps) => import("react").JSX.Element;
@@ -1,4 +0,0 @@
1
- import type { DataValueDescriptor, DataValueValidationChecker, EditPhase, EditRuleValidationSuccessResult, EditValidationRule } from "@vuu-ui/vuu-data-types";
2
- export declare const OK: EditRuleValidationSuccessResult;
3
- export declare function getEditValidationRules(descriptor: DataValueDescriptor, editPhase: EditPhase | "*"): EditValidationRule[];
4
- export declare const buildValidationChecker: (rules: EditValidationRule[]) => DataValueValidationChecker;
@@ -1 +0,0 @@
1
- export declare const registerRules: () => void;
@@ -1,7 +0,0 @@
1
- import { Entity } from "@vuu-ui/vuu-utils";
2
- export type FormEditState = {
3
- isClean: boolean;
4
- editedFields: string[];
5
- };
6
- export declare const CLEAN_FORM: FormEditState;
7
- export declare const buildFormEditState: (entity: Entity | undefined, newEntity: Entity) => FormEditState;
@@ -1,37 +0,0 @@
1
- import type { DataValueDescriptor, TableSchemaTable } from "@vuu-ui/vuu-data-types";
2
- import { type VuuTypeaheadInputProps } from "@vuu-ui/vuu-ui-controls";
3
- import { type CommitHandler } from "@vuu-ui/vuu-utils";
4
- import type { InputProps } from "@salt-ds/core";
5
- /**
6
- * variant can be used to provide a rendering hint to the filter control rendered.
7
- * 'toggle' for A ToggleButtonGroup, only suitable for up to 3 value choices
8
- * 'search' to render a search icon and require at least one character to be entered.
9
- * 'pick' to show a dropdown list, even before any text is entered, best for smaller lists
10
- */
11
- export type FilterControlVariant = "search" | "pick" | "toggle";
12
- export interface DataItemEditControlProps {
13
- InputProps?: Partial<InputProps>;
14
- TypeaheadProps?: Pick<VuuTypeaheadInputProps, "highlightFirstSuggestion" | "minCharacterCountToTriggerSuggestions" | "selectOnTab">;
15
- className?: string;
16
- commitOnBlur?: boolean;
17
- commitWhenCleared?: boolean;
18
- /**
19
- * A table column or form field Descriptor.
20
- */
21
- dataDescriptor: DataValueDescriptor;
22
- editOperation?: "insert" | "update";
23
- errorMessage?: string;
24
- onCommit: CommitHandler<HTMLElement>;
25
- table?: TableSchemaTable;
26
- /**
27
- * Where provided, only these values will be offered as suggestions.
28
- * They will be validated against server with Typeahead service, so
29
- * unavailable options are not offered.
30
- * Recommended for toggle filters, not usually necessary for other
31
- * filter variants.
32
- */
33
- values?: string[];
34
- variant?: FilterControlVariant;
35
- }
36
- export type ValidationStatus = "initial" | true | string;
37
- export declare const getDataItemEditControl: ({ InputProps, TypeaheadProps, className, commitOnBlur, commitWhenCleared, dataDescriptor, editOperation, errorMessage, onCommit, table, values, variant, }: DataItemEditControlProps) => import("react").JSX.Element;
@@ -1,6 +0,0 @@
1
- export * from "./get-data-item-edit-control";
2
- export * from "./EditForm";
3
- export * from "./edit-rule-validation-checker";
4
- export * from "./UnsavedChangesReport";
5
- export * from "./useEditForm";
6
- export * from "./form-edit-state";
@@ -1,21 +0,0 @@
1
- import type { DataSource, DataValueDescriptor } from "@vuu-ui/vuu-data-types";
2
- import { CommitHandler, Entity } from "@vuu-ui/vuu-utils";
3
- import { FocusEventHandler, SyntheticEvent } from "react";
4
- export interface EditFormHookProps {
5
- dataSource?: DataSource;
6
- formFieldDescriptors: DataValueDescriptor[];
7
- onSubmit?: () => void;
8
- }
9
- export declare const useEditForm: ({ dataSource, formFieldDescriptors, onSubmit, }: EditFormHookProps) => {
10
- editedFields: string[];
11
- editEntity: Entity | undefined;
12
- errorMessages: Record<string, string>;
13
- formFieldsContainerRef: import("react").RefObject<HTMLDivElement | null>;
14
- isClean: boolean;
15
- ok: boolean;
16
- onCancel: () => Promise<void>;
17
- onChange: (evt: SyntheticEvent<HTMLInputElement>) => void;
18
- onCommit: CommitHandler<HTMLElement>;
19
- onFocus: FocusEventHandler;
20
- onSubmit: () => Promise<void>;
21
- };
@@ -1,17 +0,0 @@
1
- import { ReactNode } from "react";
2
- /**
3
- * DataSource Providers inject a DataSource constructor, made available
4
- * to clients via the useData hook. This provider offers the standard
5
- * VuuDataSource, which will source data from a remote vuu server.
6
- *
7
- * In production code, it will generally be used without props, authentication
8
- * and connection to vuu server will be handled elsewhere. The props are
9
- * useful for rendering standalone components.
10
- */
11
- export declare const VuuDataSourceProvider: ({ authenticate, autoConnect, autoLogin, children, websocketUrl, }: {
12
- authenticate?: boolean;
13
- autoConnect?: boolean;
14
- autoLogin?: boolean;
15
- children: ReactNode;
16
- websocketUrl?: string;
17
- }) => import("react").JSX.Element;
@@ -1 +0,0 @@
1
- export * from "./VuuDataSourceProvider";
@@ -1,20 +0,0 @@
1
- export declare const useAutoLoginToVuuServer: ({ authenticate, autoConnect, secure, token: tokenProp, user, websocketUrl, }?: {
2
- /**
3
- * if true, auth url on vuuserver will be used to get token
4
- * auth url is "/api/authn"
5
- */
6
- authenticate?: boolean;
7
- /**
8
- * true by default, will go ahead and open websocket connection
9
- */
10
- autoConnect?: boolean;
11
- autoLogin?: boolean;
12
- secure?: boolean;
13
- /**
14
- * use with no authenticate step, to provide auth token.
15
- * Used when vuu server is performing no token check
16
- */
17
- token?: string;
18
- user?: string;
19
- websocketUrl?: string;
20
- }) => import("react").JSX.Element | undefined;
@@ -1,5 +0,0 @@
1
- import { ColumnDescriptor, ListOption } from "@vuu-ui/vuu-table-types";
2
- export declare const useLookupValues: (column: ColumnDescriptor, initialValueProp: number | string) => {
3
- initialValue: ListOption | null;
4
- values: ListOption[];
5
- };
@@ -1,8 +0,0 @@
1
- import type { DataSource, DataSourceConfigChangeHandler, DataSourceConstructorProps } from "@vuu-ui/vuu-data-types";
2
- export interface SessionStateHookProps {
3
- onConfigChange?: DataSourceConfigChangeHandler;
4
- }
5
- export declare const useSessionDataSource: (props?: SessionStateHookProps) => {
6
- clearDataSource: (sessionKey: string, unsubscribe?: boolean) => void;
7
- getDataSource: (sessionKey: string, dataSourceConstructorProps?: DataSourceConstructorProps) => DataSource;
8
- };
@@ -1,4 +0,0 @@
1
- import { SuggestionFetcher, TableSchemaTable } from "@vuu-ui/vuu-data-types";
2
- import { TypeaheadParams } from "@vuu-ui/vuu-protocol-types";
3
- export declare const getTypeaheadParams: (table: TableSchemaTable, column: string, text?: string, selectedValues?: string[]) => TypeaheadParams;
4
- export declare const useTypeaheadSuggestions: () => SuggestionFetcher;
@@ -1,2 +0,0 @@
1
- import type { DataSource } from "@vuu-ui/vuu-data-types";
2
- export declare const useVisualLinks: (dataSource: DataSource) => void;
@@ -1,39 +0,0 @@
1
- import { type MenuActionHandler } from "@vuu-ui/vuu-context-menu";
2
- import { DataSource, DataSourceVisualLinkCreatedMessage, RpcResponseHandler } from "@vuu-ui/vuu-data-types";
3
- import type { LinkDescriptorWithLabel, VuuDataRowDto, VuuMenu, VuuMenuItem, VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
4
- import type { ColumnDescriptor, TableContextMenuDef } from "@vuu-ui/vuu-table-types";
5
- export interface MenuActionConfig {
6
- vuuMenu?: VuuMenu;
7
- visualLink?: DataSourceVisualLinkCreatedMessage;
8
- visualLinks?: LinkDescriptorWithLabel[];
9
- }
10
- export interface VuuMenuActionHookProps {
11
- /**
12
- * By default, vuuMenuActions will be handled automatically. When activated, a
13
- * message will be sent to server and response will be handled here too.
14
- * This prop allows client to provide a custom handler for a menu Item. This will
15
- * take priority and if handler returns true, no further processing for the menu
16
- * item will be handled by Vuu. This can also be used to prevent an item from being
17
- * actioned, even when no custom handling is intended. If the handler returns false,
18
- * Vuu will process the menuItem.
19
- */
20
- clientSideMenuActionHandler?: MenuActionHandler;
21
- dataSource?: DataSource;
22
- menuActionConfig?: MenuActionConfig;
23
- onRpcResponse?: RpcResponseHandler;
24
- }
25
- export interface VuuCellContextMenuItemOptions extends VuuMenuItem {
26
- rowKey: string;
27
- field: string;
28
- value: VuuRowDataItemType;
29
- }
30
- export interface VuuRowContextMenuItemOptions extends VuuMenuItem {
31
- rowKey: string;
32
- row: VuuDataRowDto;
33
- }
34
- export interface VuuSelectedRowsContextMenuItemOptions extends VuuMenuItem {
35
- columns: ColumnDescriptor[];
36
- }
37
- export declare const isRowMenu: (options: VuuMenuItem) => options is VuuRowContextMenuItemOptions;
38
- export declare const isSelectionMenu: (options: VuuMenuItem) => options is VuuSelectedRowsContextMenuItemOptions;
39
- export declare const useVuuMenuActions: ({ clientSideMenuActionHandler, dataSource, onRpcResponse, }: VuuMenuActionHookProps) => TableContextMenuDef;
@@ -1,2 +0,0 @@
1
- import type { TableSchema } from "@vuu-ui/vuu-data-types";
2
- export declare const useVuuTables: () => TableSchema[] | undefined;
@@ -1,10 +0,0 @@
1
- export * from "./data-editing";
2
- export * from "./datasource-provider";
3
- export { useLookupValues } from "./hooks/useLookupValues";
4
- export { useSessionDataSource } from "./hooks/useSessionDataSource";
5
- export { getTypeaheadParams, useTypeaheadSuggestions, } from "./hooks/useTypeaheadSuggestions";
6
- export { useVisualLinks } from "./hooks/useVisualLinks";
7
- export { isRowMenu, isSelectionMenu, useVuuMenuActions, type MenuActionConfig, } from "./hooks/useVuuMenuActions";
8
- export { useVuuTables } from "./hooks/useVuuTables";
9
- export { useLostConnection } from "./lost-connection-indicator/useLostConnection";
10
- export * from "./session-editing-form";
@@ -1 +0,0 @@
1
- export declare const LostConnectionIndicator: () => import("react").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const useLostConnection: () => void;
@@ -1,24 +0,0 @@
1
- import { DataSource, TableSchema } from "@vuu-ui/vuu-data-types";
2
- import { VuuColumnDataType } from "@vuu-ui/vuu-protocol-types";
3
- import { HTMLAttributes } from "react";
4
- export type FormFieldDescriptor = {
5
- isKeyField?: boolean;
6
- label?: string;
7
- name: string;
8
- type: VuuColumnDataType;
9
- description: string;
10
- readonly?: boolean;
11
- required?: boolean;
12
- };
13
- export type FormConfig = {
14
- title: string;
15
- key: string;
16
- fields: FormFieldDescriptor[];
17
- };
18
- export interface SessionEditingFormProps extends HTMLAttributes<HTMLDivElement> {
19
- config: FormConfig;
20
- onClose?: () => void;
21
- dataSource?: DataSource;
22
- schema?: TableSchema;
23
- }
24
- export declare const SessionEditingForm: ({ className, config: { fields, key: keyField }, dataSource: dataSourceProp, id: idProp, onClose, schema, ...htmlAttributes }: SessionEditingFormProps) => import("react").JSX.Element;
@@ -1 +0,0 @@
1
- export * from "./SessionEditingForm";