@ansible/ansible-ui-framework 0.0.375 → 0.0.377

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. package/cjs/BulkActionDialog.d.ts +1 -1
  2. package/cjs/BulkActionDialog.js +2 -2
  3. package/cjs/BulkConfirmationDialog.d.ts +1 -1
  4. package/cjs/BulkConfirmationDialog.js +2 -2
  5. package/cjs/{cells → PageCells}/BytesCell.d.ts +0 -0
  6. package/cjs/{cells → PageCells}/BytesCell.js +0 -0
  7. package/cjs/{cells → PageCells}/CapacityCell.d.ts +0 -0
  8. package/cjs/{cells → PageCells}/CapacityCell.js +0 -0
  9. package/cjs/{cells → PageCells}/CopyCell.d.ts +0 -0
  10. package/cjs/{cells → PageCells}/CopyCell.js +0 -0
  11. package/cjs/{cells → PageCells}/DateTimeCell.d.ts +0 -0
  12. package/cjs/{cells → PageCells}/DateTimeCell.js +0 -0
  13. package/cjs/{cells → PageCells}/ElapsedTimeCell.d.ts +0 -0
  14. package/cjs/{cells → PageCells}/ElapsedTimeCell.js +0 -0
  15. package/cjs/{cells → PageCells}/LabelsCell.d.ts +0 -0
  16. package/cjs/{cells → PageCells}/LabelsCell.js +0 -0
  17. package/cjs/{cells → PageCells}/TextCell.d.ts +0 -0
  18. package/cjs/{cells → PageCells}/TextCell.js +0 -0
  19. package/cjs/PageColumnModal.d.ts +1 -1
  20. package/cjs/PageDataList.d.ts +1 -1
  21. package/cjs/PageDataList.js +1 -1
  22. package/cjs/PageForm/FormPage.d.ts +17 -0
  23. package/cjs/PageForm/FormPage.js +73 -0
  24. package/cjs/PageForm/Inputs/PageFormCheckbox.d.ts +9 -0
  25. package/cjs/PageForm/Inputs/PageFormCheckbox.js +24 -0
  26. package/cjs/PageForm/{PageFormSelectOption.d.ts → Inputs/PageFormSelectOption.d.ts} +3 -3
  27. package/cjs/PageForm/{PageFormSelectOption.js → Inputs/PageFormSelectOption.js} +1 -1
  28. package/cjs/PageForm/Inputs/PageFormSlider.d.ts +12 -0
  29. package/cjs/PageForm/Inputs/PageFormSlider.js +36 -0
  30. package/cjs/PageForm/Inputs/PageFormSwitch.d.ts +9 -0
  31. package/cjs/PageForm/Inputs/PageFormSwitch.js +34 -0
  32. package/cjs/PageForm/Inputs/PageFormTextArea.d.ts +11 -0
  33. package/cjs/PageForm/Inputs/PageFormTextArea.js +27 -0
  34. package/cjs/PageForm/Inputs/PageFormTextInput.d.ts +11 -0
  35. package/cjs/PageForm/Inputs/PageFormTextInput.js +48 -0
  36. package/cjs/PageForm/Inputs/PageFormTextSelect.d.ts +14 -0
  37. package/cjs/PageForm/Inputs/PageFormTextSelect.js +42 -0
  38. package/cjs/PageForm/PageForm.d.ts +3 -126
  39. package/cjs/PageForm/PageForm.js +3 -283
  40. package/cjs/PageForm/PageFormAlerts.d.ts +2 -0
  41. package/cjs/PageForm/PageFormAlerts.js +14 -0
  42. package/cjs/PageForm/PageFormButtons.d.ts +6 -0
  43. package/cjs/PageForm/PageFormButtons.js +28 -0
  44. package/cjs/PageForm/PageFormFromSchema.d.ts +6 -0
  45. package/cjs/PageForm/PageFormFromSchema.js +67 -0
  46. package/cjs/PageForm/PageFormInputPopover.d.ts +8 -0
  47. package/cjs/PageForm/PageFormInputPopover.js +2 -0
  48. package/cjs/{PagePagination.d.ts → PageTable/PagePagination.d.ts} +0 -0
  49. package/cjs/{PagePagination.js → PageTable/PagePagination.js} +2 -2
  50. package/cjs/{PageTable.d.ts → PageTable/PageTable.d.ts} +2 -2
  51. package/cjs/{PageTable.js → PageTable/PageTable.js} +12 -12
  52. package/cjs/{PageTableCard.d.ts → PageTable/PageTableCard.d.ts} +2 -2
  53. package/cjs/{PageTableCard.js → PageTable/PageTableCard.js} +3 -3
  54. package/cjs/{PageTableCards.d.ts → PageTable/PageTableCards.d.ts} +0 -0
  55. package/cjs/{PageTableCards.js → PageTable/PageTableCards.js} +1 -1
  56. package/cjs/{PageTableDetails.d.ts → PageTable/PageTableDetails.d.ts} +0 -0
  57. package/cjs/{PageTableDetails.js → PageTable/PageTableDetails.js} +1 -1
  58. package/cjs/{PageTableList.d.ts → PageTable/PageTableList.d.ts} +1 -1
  59. package/cjs/{PageTableList.js → PageTable/PageTableList.js} +2 -2
  60. package/cjs/{PageTableViewType.d.ts → PageTable/PageTableViewType.d.ts} +0 -0
  61. package/cjs/{PageTableViewType.js → PageTable/PageTableViewType.js} +0 -0
  62. package/cjs/{PageToolbar.d.ts → PageTable/PageToolbar.d.ts} +1 -1
  63. package/cjs/{PageToolbar.js → PageTable/PageToolbar.js} +7 -7
  64. package/cjs/{useTableItems.d.ts → PageTable/useTableItems.d.ts} +0 -0
  65. package/cjs/{useTableItems.js → PageTable/useTableItems.js} +0 -0
  66. package/cjs/index.d.ts +13 -13
  67. package/cjs/index.js +13 -13
  68. package/cjs/useInMemoryView.d.ts +3 -3
  69. package/cjs/useInMemoryView.js +1 -1
  70. package/cjs/useSelectDialog.d.ts +3 -3
  71. package/cjs/useSelectDialog.js +1 -1
  72. package/cjs/useSelectMultipleDialog.d.ts +3 -3
  73. package/cjs/useSelectMultipleDialog.js +1 -1
  74. package/package.json +1 -1
@@ -1,134 +1,11 @@
1
1
  import { JSONSchema6 } from 'json-schema';
2
2
  import { CSSProperties, ReactNode } from 'react';
3
- import { DeepPartial, ErrorOption, FieldPath, FieldValues, SubmitHandler, UseFormReturn } from 'react-hook-form';
4
- import { PartialDeep } from 'type-fest';
5
- import { PageHeaderProps } from '../PageHeader';
6
- export type FormPageProps<T extends object> = PageHeaderProps & {
7
- children?: ReactNode;
8
- defaultValues?: PartialDeep<T>;
9
- onSubmit: SubmitHandler<PartialDeep<T>>;
10
- schema?: unknown;
11
- isVertical?: boolean;
12
- onCancel?: () => void;
13
- submitText?: string;
14
- hideHeader?: boolean;
15
- noPadding?: boolean;
16
- form: UseFormReturn;
17
- };
18
- export declare function FormPage<T extends object>(props: FormPageProps<T>): JSX.Element;
19
- export declare function FormPageAlerts(): JSX.Element;
20
- export declare function FormPageButtons(props: {
21
- submitText: string;
22
- cancelText: string;
23
- onCancel: () => void;
24
- }): JSX.Element;
25
- export declare function FormInputCheckbox(props: {
26
- label: string;
27
- name: string;
28
- helperText?: string;
29
- required?: boolean;
30
- description?: ReactNode;
31
- body?: ReactNode;
32
- }): JSX.Element;
33
- export declare function FormTextInput(props: {
34
- id?: string;
35
- label: string;
36
- name: string;
37
- helperText?: string;
38
- required?: boolean;
39
- secret?: boolean;
40
- autoFocus?: boolean;
41
- placeholder?: string;
42
- }): JSX.Element;
43
- export declare function FormTextArea(props: {
44
- id?: string;
45
- label: string;
46
- name: string;
47
- helperText?: string;
48
- required?: boolean;
49
- secret?: boolean;
50
- autoFocus?: boolean;
51
- placeholder?: string;
52
- }): JSX.Element;
53
- export declare function FormNumberInput(props: {
54
- id?: string;
55
- label: string;
56
- name: string;
57
- helperText?: string;
58
- required?: boolean;
59
- autoFocus?: boolean;
60
- min?: number;
61
- max?: number;
62
- valueLabel?: string;
63
- }): JSX.Element;
64
- export declare function FormBooleanInput(props: {
65
- id?: string;
66
- label: string;
67
- name: string;
68
- helperText?: string;
69
- required?: boolean;
70
- autoFocus?: boolean;
71
- }): JSX.Element;
72
- export interface FormInputPopover {
73
- title?: string;
74
- body?: string[];
75
- link?: {
76
- label: string;
77
- url: string;
78
- };
79
- }
80
- export interface FormSelectOption<T> {
81
- group?: string;
82
- label: string;
83
- description?: string;
84
- value: T;
85
- }
86
- export interface FormSelectProps<T> {
87
- id?: string;
88
- name: string;
89
- label: string;
90
- popover?: FormInputPopover;
91
- placeholder?: string;
92
- help?: string;
93
- required?: boolean;
94
- footer?: {
95
- label?: string;
96
- click?: () => void;
97
- };
98
- create?: boolean;
99
- options: FormSelectOption<T>[];
100
- }
101
- export declare function FormSelect<T>(props: FormSelectProps<T>): JSX.Element;
102
- export declare function FormSelectInput(props: {
103
- label: string;
104
- name: string;
105
- helperText?: string;
106
- required?: boolean;
107
- children?: ReactNode;
108
- footer?: ReactNode;
109
- }): JSX.Element;
110
- export declare function FormTextSelect<T>(props: {
111
- id?: string;
112
- label: string;
113
- name: string;
114
- helperText?: string;
115
- required?: boolean;
116
- secret?: boolean;
117
- autoFocus?: boolean;
118
- placeholder?: string;
119
- selectTitle?: string;
120
- selectValue?: (item: T) => string | number;
121
- selectOpen?: (callback: (item: T) => void, title: string) => void;
122
- }): JSX.Element;
123
- export declare function FormSchema(props: {
124
- schema: JSONSchema6;
125
- base?: string;
126
- }): JSX.Element;
3
+ import { DeepPartial, ErrorOption, FieldPath, FieldValues } from 'react-hook-form';
127
4
  export declare function PageForm<T extends object>(props: {
128
5
  schema?: JSONSchema6;
129
6
  children?: ReactNode;
130
7
  submitText: string;
131
- onSubmit: FormPageSubmitHandler<T>;
8
+ onSubmit: PageFormSubmitHandler<T>;
132
9
  cancelText: string;
133
10
  onCancel?: () => void;
134
11
  defaultValue?: DeepPartial<T>;
@@ -136,7 +13,7 @@ export declare function PageForm<T extends object>(props: {
136
13
  singleColumn?: boolean;
137
14
  disableScrolling?: boolean;
138
15
  }): JSX.Element;
139
- export type FormPageSubmitHandler<T extends FieldValues> = (data: T, setError: (error: string) => void, setFieldError: (fieldName: FieldPath<T>, error: ErrorOption) => void) => Promise<unknown>;
16
+ export type PageFormSubmitHandler<T extends FieldValues> = (data: T, setError: (error: string) => void, setFieldError: (fieldName: FieldPath<T>, error: ErrorOption) => void) => Promise<unknown>;
140
17
  export declare function PageFormSubmitButton(props: {
141
18
  children: ReactNode;
142
19
  style?: CSSProperties;
@@ -26,297 +26,17 @@ var __read = (this && this.__read) || function (o, n) {
26
26
  }
27
27
  return ar;
28
28
  };
29
- var __importDefault = (this && this.__importDefault) || function (mod) {
30
- return (mod && mod.__esModule) ? mod : { "default": mod };
31
- };
32
29
  Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.PageFormCancelButton = exports.PageFormSubmitButton = exports.PageForm = exports.FormSchema = exports.FormTextSelect = exports.FormSelectInput = exports.FormSelect = exports.FormBooleanInput = exports.FormNumberInput = exports.FormTextArea = exports.FormTextInput = exports.FormInputCheckbox = exports.FormPageButtons = exports.FormPageAlerts = exports.FormPage = void 0;
30
+ exports.PageFormCancelButton = exports.PageFormSubmitButton = exports.PageForm = void 0;
34
31
  var jsx_runtime_1 = require("react/jsx-runtime");
35
32
  var ajv_1 = require("@hookform/resolvers/ajv");
36
33
  var react_core_1 = require("@patternfly/react-core");
37
- var react_icons_1 = require("@patternfly/react-icons");
38
- var fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
39
34
  var react_1 = require("react");
40
35
  var react_hook_form_1 = require("react-hook-form");
41
36
  var Scrollable_1 = require("../components/Scrollable");
42
37
  var useBreakPoint_1 = require("../components/useBreakPoint");
43
- var PageHeader_1 = require("../PageHeader");
44
38
  var Settings_1 = require("../Settings");
45
- var PageFormSelectOption_1 = require("./PageFormSelectOption");
46
- function FormPage(props) {
47
- // const methods = useForm<PartialDeep<T>>({
48
- // defaultValues: props.defaultValues,
49
- // resolver: ajvResolver(props.schema, { strict: false }),
50
- // })
51
- var children = react_1.Children.toArray(props.children);
52
- var inputs = children.filter(function (child) {
53
- if (!(0, react_1.isValidElement)(child))
54
- return false;
55
- if (child.type === FormPageAlerts)
56
- return false;
57
- if (child.type === FormPageButtons)
58
- return false;
59
- return true;
60
- });
61
- var buttons = children.find(function (child) {
62
- if (!(0, react_1.isValidElement)(child))
63
- return false;
64
- if (child.type === FormPageButtons)
65
- return true;
66
- return false;
67
- });
68
- var _a = __read((0, react_1.useContext)(Settings_1.SettingsContext), 1), settings = _a[0];
69
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!props.hideHeader && (0, jsx_runtime_1.jsx)(PageHeader_1.PageHeader, __assign({}, props)), (0, jsx_runtime_1.jsxs)(react_core_1.Form
70
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
71
- , __assign({
72
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
73
- onSubmit: props.form.handleSubmit(props.onSubmit), isHorizontal: props.isVertical ? false : settings.formLayout === 'horizontal', style: {
74
- display: 'flex',
75
- flexDirection: 'column',
76
- flexGrow: 1,
77
- overflow: 'hidden',
78
- } }, { children: [(0, jsx_runtime_1.jsx)(Scrollable_1.Scrollable, __assign({ style: { height: '100%', flexGrow: 1 } }, { children: (0, jsx_runtime_1.jsx)(react_core_1.PageSection, __assign({ padding: { default: props.noPadding ? 'noPadding' : 'padding' }, isWidthLimited: true }, { children: (0, jsx_runtime_1.jsx)(react_core_1.FormSection, { children: inputs }) })) })), buttons] }))] }));
79
- }
80
- exports.FormPage = FormPage;
81
- function FormPageAlerts() {
82
- var errors = (0, react_hook_form_1.useFormState)().errors;
83
- var isMd = (0, useBreakPoint_1.useBreakpoint)('md');
84
- return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: errors && Object.keys(errors).length > 0 && ((0, jsx_runtime_1.jsx)(react_core_1.Alert, { title: "Please fix validation errors.", isInline: true, style: { width: '100%', paddingLeft: isMd ? 190 : undefined }, variant: "danger" })) }));
85
- }
86
- exports.FormPageAlerts = FormPageAlerts;
87
- function FormPageButtons(props) {
88
- var errors = (0, react_hook_form_1.useFormState)().errors;
89
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(FormPageAlerts, {}), (0, jsx_runtime_1.jsx)(react_core_1.PageSection, __assign({ isFilled: true, style: {
90
- display: 'flex',
91
- flexDirection: 'column',
92
- maxHeight: '100%',
93
- borderTop: 'thin solid var(--pf-global--BorderColor--100)',
94
- }, variant: "light" }, { children: (0, jsx_runtime_1.jsxs)(react_core_1.ActionGroup, __assign({ style: { marginTop: 0 } }, { children: [errors && Object.keys(errors).length > 0 ? ((0, jsx_runtime_1.jsx)(react_core_1.Tooltip, __assign({ content: 'Please fix validation errors' }, { children: (0, jsx_runtime_1.jsx)(react_core_1.Button, __assign({ type: "submit", isAriaDisabled: true }, { children: props.submitText })) }))) : ((0, jsx_runtime_1.jsx)(react_core_1.Button, __assign({ type: "submit" }, { children: props.submitText }))), (0, jsx_runtime_1.jsx)(react_core_1.Button, __assign({ type: "button", variant: "link", onClick: props.onCancel }, { children: props.cancelText }))] })) }))] }));
95
- }
96
- exports.FormPageButtons = FormPageButtons;
97
- function FormInputCheckbox(props) {
98
- var control = (0, react_hook_form_1.useFormContext)().control;
99
- var field = (0, react_hook_form_1.useController)({ control: control, name: props.name }).field;
100
- var id = props.name;
101
- return ((0, jsx_runtime_1.jsx)(react_core_1.Checkbox, __assign({ label: props.label, id: id, "aria-describedby": "".concat(id, "-helper"), description: props.description, body: field.value ? props.body : undefined }, field, { isChecked: !!field.value })));
102
- }
103
- exports.FormInputCheckbox = FormInputCheckbox;
104
- function FormTextInput(props) {
105
- var _a;
106
- var _b = (0, react_hook_form_1.useFormContext)(), register = _b.register, isSubmitting = _b.formState.isSubmitting;
107
- var registration = register(props.name);
108
- var fieldState = (0, react_hook_form_1.useController)({ name: props.name }).fieldState;
109
- var error = fieldState.error;
110
- var id = (_a = props.id) !== null && _a !== void 0 ? _a : props.name;
111
- var _c = __read((0, react_1.useState)(false), 2), showSecret = _c[0], setShowSecret = _c[1];
112
- return ((0, jsx_runtime_1.jsx)(react_core_1.FormGroup, __assign({ id: "".concat(id, "-form-group"), fieldId: id, label: props.label, helperText: props.helperText, isRequired: props.required, validated: (error === null || error === void 0 ? void 0 : error.message) ? 'error' : undefined, helperTextInvalid: error === null || error === void 0 ? void 0 : error.message }, { children: (0, jsx_runtime_1.jsxs)(react_core_1.InputGroup, { children: [(0, jsx_runtime_1.jsx)(react_core_1.TextInput, __assign({ id: id, type: props.secret && !showSecret ? 'password' : 'text', "aria-describedby": "".concat(id, "-form-group"), isRequired: props.required, validated: (error === null || error === void 0 ? void 0 : error.message) ? 'error' : undefined, autoFocus: props.autoFocus, placeholder: props.placeholder }, registration, { onChange: function (v, e) {
113
- void registration.onChange(e);
114
- }, isReadOnly: isSubmitting })), props.secret && ((0, jsx_runtime_1.jsx)(react_core_1.Button, __assign({ variant: "control", onClick: function () { return setShowSecret(!showSecret); }, "aria-label": "Options menu", isDisabled: isSubmitting }, { children: showSecret ? (0, jsx_runtime_1.jsx)(react_icons_1.EyeIcon, {}) : (0, jsx_runtime_1.jsx)(react_icons_1.EyeSlashIcon, {}) })))] }) })));
115
- }
116
- exports.FormTextInput = FormTextInput;
117
- function FormTextArea(props) {
118
- var _a;
119
- var _b = (0, react_hook_form_1.useFormContext)(), register = _b.register, isSubmitting = _b.formState.isSubmitting;
120
- var registration = register(props.name);
121
- var fieldState = (0, react_hook_form_1.useController)({ name: props.name }).fieldState;
122
- var error = fieldState.error;
123
- var id = (_a = props.id) !== null && _a !== void 0 ? _a : props.name;
124
- return ((0, jsx_runtime_1.jsx)(react_core_1.FormGroup, __assign({ id: "".concat(id, "-form-group"), fieldId: id, label: props.label, helperText: props.helperText, isRequired: props.required, validated: (error === null || error === void 0 ? void 0 : error.message) ? 'error' : undefined, helperTextInvalid: error === null || error === void 0 ? void 0 : error.message }, { children: (0, jsx_runtime_1.jsx)(react_core_1.TextArea, __assign({ id: id, type: props.secret ? 'password' : 'text', "aria-describedby": "".concat(id, "-form-group"), isRequired: props.required, validated: (error === null || error === void 0 ? void 0 : error.message) ? 'error' : undefined, autoFocus: props.autoFocus, placeholder: props.placeholder }, registration, { onChange: function (v, e) { return void registration.onChange(e); }, resizeOrientation: "vertical", isReadOnly: isSubmitting })) })));
125
- }
126
- exports.FormTextArea = FormTextArea;
127
- function FormNumberInput(props) {
128
- var _a, _b, _c;
129
- var isSubmitting = (0, react_hook_form_1.useFormContext)().formState.isSubmitting;
130
- var _d = (0, react_hook_form_1.useController)({ name: props.name }), field = _d.field, fieldState = _d.fieldState;
131
- var error = fieldState.error;
132
- var id = (_a = props.id) !== null && _a !== void 0 ? _a : props.name;
133
- var max = (_b = props.max) !== null && _b !== void 0 ? _b : 100;
134
- var min = (_c = props.min) !== null && _c !== void 0 ? _c : 1;
135
- var value = Number(field.value);
136
- return ((0, jsx_runtime_1.jsx)(react_core_1.FormGroup, __assign({ id: "".concat(id, "-form-group"), fieldId: id, label: props.label, helperText: props.helperText, isRequired: props.required, validated: (error === null || error === void 0 ? void 0 : error.message) ? 'error' : undefined, helperTextInvalid: error === null || error === void 0 ? void 0 : error.message }, { children: (0, jsx_runtime_1.jsxs)(react_core_1.Flex, __assign({ alignItems: { default: 'alignItemsFlexStart' } }, { children: [(0, jsx_runtime_1.jsxs)(react_core_1.Flex, __assign({ alignItems: { default: 'alignItemsFlexStart' }, spaceItems: { default: 'spaceItemsSm' } }, { children: [(0, jsx_runtime_1.jsx)(react_core_1.FlexItem, __assign({ style: { paddingTop: 6, minWidth: 20, textAlign: 'right' } }, { children: Math.floor((max - min) * value + min) })), props.valueLabel && ((0, jsx_runtime_1.jsx)(react_core_1.FlexItem, __assign({ style: { paddingTop: 6, minWidth: 40 } }, { children: props.valueLabel })))] })), (0, jsx_runtime_1.jsx)(react_core_1.FlexItem, __assign({ grow: { default: 'grow' } }, { children: (0, jsx_runtime_1.jsx)(react_core_1.Slider, { id: id, "aria-describedby": "".concat(id, "-form-group"),
137
- // isRequired={props.required}
138
- // validated={error?.message ? 'error' : undefined}
139
- autoFocus: props.autoFocus,
140
- // {...registration}
141
- value: (max - min) * value + min, onChange: function (v) { return field.onChange((v - min) / (max - min)); }, max: max, min: min,
142
- // innerRef={registration.ref}
143
- isDisabled: isSubmitting, showBoundaries: false }) }))] })) })));
144
- }
145
- exports.FormNumberInput = FormNumberInput;
146
- function FormBooleanInput(props) {
147
- var _a;
148
- var isSubmitting = (0, react_hook_form_1.useFormContext)().formState.isSubmitting;
149
- var _b = (0, react_hook_form_1.useController)({ name: props.name }), field = _b.field, fieldState = _b.fieldState;
150
- var error = fieldState.error;
151
- var id = (_a = props.id) !== null && _a !== void 0 ? _a : props.name;
152
- return ((0, jsx_runtime_1.jsx)(react_core_1.FormGroup, __assign({ id: "".concat(id, "-form-group"), fieldId: id, label: props.label, helperText: props.helperText, isRequired: props.required, validated: (error === null || error === void 0 ? void 0 : error.message) ? 'error' : undefined, helperTextInvalid: error === null || error === void 0 ? void 0 : error.message }, { children: (0, jsx_runtime_1.jsx)(react_core_1.Switch, { id: id, "aria-describedby": "".concat(id, "-form-group"),
153
- // isRequired={props.required}
154
- // validated={error?.message ? 'error' : undefined}
155
- autoFocus: props.autoFocus,
156
- // placeholder={props.placeholder}
157
- // {...registration}
158
- isChecked: typeof field.value === 'boolean' ? field.value : false, onChange: function (e) { return field.onChange(e); },
159
- // innerRef={registration.ref}
160
- isDisabled: isSubmitting }) })));
161
- }
162
- exports.FormBooleanInput = FormBooleanInput;
163
- function FormSelect(props) {
164
- var _a, _b;
165
- var _c = (0, react_hook_form_1.useController)({ name: props.name }), field = _c.field, fieldError = _c.fieldState.error;
166
- var _d = __read((0, react_1.useState)(false), 2), open = _d[0], setOpen = _d[1];
167
- var id = (_a = props.id) !== null && _a !== void 0 ? _a : props.name;
168
- var error = fieldError !== undefined && fieldError.message;
169
- var options = props.options;
170
- options.sort(function (l, r) {
171
- var _a, _b, _c, _d;
172
- if (((_a = l.group) !== null && _a !== void 0 ? _a : '') < ((_b = r.group) !== null && _b !== void 0 ? _b : ''))
173
- return -1;
174
- if (((_c = l.group) !== null && _c !== void 0 ? _c : '') > ((_d = r.group) !== null && _d !== void 0 ? _d : ''))
175
- return 1;
176
- if (l.label < r.label)
177
- return -1;
178
- if (l.label > r.label)
179
- return 1;
180
- return 0;
181
- });
182
- var selectedIndex = options.findIndex(function (option) { return (0, fast_deep_equal_1.default)(option.value, field.value); });
183
- var groups = options.reduce(function (groups, option) {
184
- var _a;
185
- var group = (_a = option.group) !== null && _a !== void 0 ? _a : '';
186
- var optionsArray = groups[group];
187
- if (!optionsArray) {
188
- optionsArray = [];
189
- groups[group] = optionsArray;
190
- }
191
- optionsArray.push(option);
192
- return groups;
193
- }, {});
194
- var isGrouped = Object.keys(groups).length > 1 ||
195
- (Object.keys(groups).length === 1 && Object.keys(groups)[0] !== '');
196
- var onSelect = (0, react_1.useCallback)(function (_event, value) {
197
- if (typeof value !== 'string') {
198
- value = value.toString();
199
- }
200
- var selectedIndex = Number(value);
201
- var selected = options[selectedIndex].value;
202
- field.onChange(selected);
203
- setOpen(false);
204
- }, [field, options]);
205
- var index = 0;
206
- return ((0, jsx_runtime_1.jsx)(react_core_1.FormGroup, __assign({ id: "".concat(id, "-form-group"), fieldId: id, label: props.label, helperTextInvalid: error, helperText: props.help, isRequired: props.required, validated: error ? 'error' : undefined }, { children: (0, jsx_runtime_1.jsx)(react_core_1.Select, __assign({ id: id, variant: react_core_1.SelectVariant.single, "aria-describedby": "".concat(id, "-helper"), validated: error ? 'error' : undefined }, field, { isOpen: open, onToggle: function () { return setOpen(!open); }, selections: selectedIndex === -1 ? '' : selectedIndex.toString(), onSelect: onSelect, isCreatable: props.create, isInputFilterPersisted: props.create, placeholderText: props.placeholder, isGrouped: isGrouped, ref: field.ref, footer: ((_b = props.footer) === null || _b === void 0 ? void 0 : _b.label) && ((0, jsx_runtime_1.jsx)(react_core_1.Button, __assign({ variant: "link", isInline: true, onClick: function () {
207
- var _a, _b;
208
- setOpen(false);
209
- (_b = (_a = props.footer) === null || _a === void 0 ? void 0 : _a.click) === null || _b === void 0 ? void 0 : _b.call(_a);
210
- } }, { children: props.footer.label }))), maxHeight: 280 }, { children: !isGrouped
211
- ? options.map(function (option, index) { return ((0, jsx_runtime_1.jsx)(react_core_1.SelectOption, __assign({ value: index.toString(), label: option.label, description: option.description }, { children: option.label }), index)); })
212
- : Object.keys(groups).map(function (group) { return ((0, jsx_runtime_1.jsx)(react_core_1.SelectGroup, __assign({ label: group }, { children: groups[group].map(function (option) { return ((0, jsx_runtime_1.jsx)(react_core_1.SelectOption, __assign({ value: (index++).toString(), label: option.label, description: option.description }, { children: option.label }), index)); }) }), group)); }) })) })));
213
- }
214
- exports.FormSelect = FormSelect;
215
- function FormSelectInput(props) {
216
- var control = (0, react_hook_form_1.useFormContext)().control;
217
- var _a = (0, react_hook_form_1.useController)({ control: control, name: props.name }), field = _a.field, error = _a.fieldState.error;
218
- var menuItems = react_1.Children.toArray(props.children)
219
- .filter(function (child) { return (0, react_1.isValidElement)(child) && child.type === react_core_1.SelectOption; })
220
- .map(function (child) {
221
- if ((0, react_1.isValidElement)(child) && child.type === react_core_1.SelectOption) {
222
- return ((0, jsx_runtime_1.jsx)(react_core_1.MenuItem, { children: child.props.children }, child.props.value));
223
- }
224
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
225
- });
226
- var _b = __read((0, react_1.useState)(false), 2), open = _b[0], setOpen = _b[1];
227
- var id = props.name;
228
- var errorMessage;
229
- switch (error === null || error === void 0 ? void 0 : error.type) {
230
- case 'required':
231
- errorMessage = props.label + ' is required.';
232
- break;
233
- default:
234
- errorMessage = error === null || error === void 0 ? void 0 : error.type;
235
- break;
236
- }
237
- return ((0, jsx_runtime_1.jsx)(react_core_1.FormGroup, __assign({ fieldId: id, label: props.label, helperTextInvalid: errorMessage, helperText: props.helperText, isRequired: props.required, validated: errorMessage ? 'error' : undefined }, { children: (0, jsx_runtime_1.jsxs)(react_core_1.TextInputGroup, { children: [(0, jsx_runtime_1.jsx)(react_core_1.TextInputGroupMain, __assign({}, field)), (0, jsx_runtime_1.jsx)(react_core_1.TextInputGroupUtilities, { children: (0, jsx_runtime_1.jsx)(react_core_1.Button, __assign({ variant: "plain", onClick: function () { return setOpen(!open); }, "aria-label": "Options menu" }, { children: (0, jsx_runtime_1.jsx)(react_icons_1.CaretDownIcon, {}) })) }), open && ((0, jsx_runtime_1.jsx)(react_core_1.Menu, __assign({ style: { position: 'absolute', right: 0, top: 36, width: '100%' } }, { children: menuItems })))] }) })));
238
- }
239
- exports.FormSelectInput = FormSelectInput;
240
- function FormTextSelect(props) {
241
- var _a;
242
- var _b = (0, react_hook_form_1.useFormContext)(), register = _b.register, setValue = _b.setValue, isSubmitting = _b.formState.isSubmitting;
243
- var registration = register(props.name);
244
- var fieldState = (0, react_hook_form_1.useController)({ name: props.name }).fieldState;
245
- var error = fieldState.error;
246
- var id = (_a = props.id) !== null && _a !== void 0 ? _a : props.name;
247
- id = id.split('.').join('-');
248
- return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: (0, jsx_runtime_1.jsx)(react_core_1.FormGroup, __assign({ id: "".concat(id, "-form-group"), fieldId: id, label: props.label, helperText: props.helperText, isRequired: props.required, validated: (error === null || error === void 0 ? void 0 : error.message) ? 'error' : undefined, helperTextInvalid: error === null || error === void 0 ? void 0 : error.message }, { children: (0, jsx_runtime_1.jsxs)(react_core_1.InputGroup, { children: [(0, jsx_runtime_1.jsx)(react_core_1.TextInput, __assign({ id: id, type: props.secret ? 'password' : 'text', "aria-describedby": "".concat(id, "-form-group"), isRequired: props.required, validated: (error === null || error === void 0 ? void 0 : error.message) ? 'error' : undefined, autoFocus: props.autoFocus, placeholder: props.placeholder }, registration, { onChange: function (v, e) {
249
- void registration.onChange(e);
250
- },
251
- // innerRef={registration.ref}
252
- isReadOnly: isSubmitting })), (0, jsx_runtime_1.jsx)(react_core_1.Button, __assign({ variant: "control", onClick: function () {
253
- var _a;
254
- return (_a = props.selectOpen) === null || _a === void 0 ? void 0 : _a.call(props, function (item) {
255
- if (props.selectValue) {
256
- var value = props.selectValue(item);
257
- setValue(props.name, value, { shouldValidate: true });
258
- }
259
- }, props.selectTitle);
260
- }, "aria-label": "Options menu", isDisabled: isSubmitting }, { children: (0, jsx_runtime_1.jsx)(react_icons_1.SearchIcon, {}) }))] }) })) }));
261
- }
262
- exports.FormTextSelect = FormTextSelect;
263
- function FormSchema(props) {
264
- var schema = props.schema;
265
- var base = props.base ? props.base + '.' : '';
266
- var p = [];
267
- for (var propertyName in schema.properties) {
268
- var property = schema.properties[propertyName];
269
- switch (property) {
270
- case true:
271
- case false:
272
- continue;
273
- }
274
- var title = typeof property.title === 'string' ? property.title : propertyName;
275
- var placeholder = property.placeholder;
276
- placeholder = typeof placeholder === 'string' ? placeholder : undefined;
277
- var required = Array.isArray(schema.required) && schema.required.includes(propertyName);
278
- switch (property.type) {
279
- case 'string': {
280
- switch (property.variant) {
281
- case 'select': {
282
- if ('options' in property) {
283
- var formSelectProps = property;
284
- p.push((0, jsx_runtime_1.jsx)(PageFormSelectOption_1.PageFormSelectOption, { name: base + propertyName, label: title, placeholder: placeholder, isRequired: required, options: formSelectProps.options, footer: formSelectProps.footer }, base + propertyName));
285
- }
286
- else {
287
- p.push((0, jsx_runtime_1.jsx)(FormTextSelect, { name: base + propertyName, label: title, placeholder: placeholder, required: required, selectTitle: property.selectTitle, selectValue: property.selectValue, selectOpen: property.selectOpen }, base + propertyName));
288
- }
289
- break;
290
- }
291
- case 'textarea':
292
- p.push((0, jsx_runtime_1.jsx)(FormTextArea, { name: base + propertyName, label: title, placeholder: placeholder, required: required }, base + propertyName));
293
- break;
294
- case 'secret':
295
- p.push((0, jsx_runtime_1.jsx)(FormTextInput, { name: base + propertyName, label: title, placeholder: placeholder, required: required, secret: true }, base + propertyName));
296
- break;
297
- default:
298
- p.push((0, jsx_runtime_1.jsx)(FormTextInput, { name: base + propertyName, label: title, placeholder: placeholder, required: required }, base + propertyName));
299
- break;
300
- }
301
- break;
302
- }
303
- case 'number': {
304
- p.push((0, jsx_runtime_1.jsx)(FormNumberInput, { name: base + propertyName, label: title, required: required, min: property.min, max: property.max, valueLabel: property.valueLabel }, base + propertyName));
305
- break;
306
- }
307
- case 'boolean': {
308
- p.push((0, jsx_runtime_1.jsx)(FormBooleanInput, { name: base + propertyName, label: title, required: required }, base + propertyName));
309
- break;
310
- }
311
- case 'object': {
312
- p.push((0, jsx_runtime_1.jsx)(FormSchema, { schema: property, base: base + propertyName }, propertyName));
313
- break;
314
- }
315
- }
316
- }
317
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: p });
318
- }
319
- exports.FormSchema = FormSchema;
39
+ var PageFormFromSchema_1 = require("./PageFormFromSchema");
320
40
  function PageForm(props) {
321
41
  var schema = props.schema, defaultValue = props.defaultValue;
322
42
  var form = (0, react_hook_form_1.useForm)({
@@ -352,7 +72,7 @@ function PageForm(props) {
352
72
  flexGrow: 1,
353
73
  overflow: props.disableScrolling ? undefined : 'hidden',
354
74
  gap: 0,
355
- } }, { children: [props.disableScrolling ? ((0, jsx_runtime_1.jsx)("div", __assign({ style: { maxWidth: maxWidth, padding: 24 } }, { children: (0, jsx_runtime_1.jsxs)(react_core_1.Grid, __assign({ hasGutter: true, span: 12, sm: sm, md: md, lg: lg, xl: xl, xl2: xl2 }, { children: [props.schema && (0, jsx_runtime_1.jsx)(FormSchema, { schema: props.schema }), props.children] })) }))) : ((0, jsx_runtime_1.jsx)(Scrollable_1.Scrollable, __assign({ style: { height: '100%', flexGrow: 1 } }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ style: { maxWidth: maxWidth, padding: 24 } }, { children: (0, jsx_runtime_1.jsxs)(react_core_1.Grid, __assign({ hasGutter: true, span: 12, sm: sm, md: md, lg: lg, xl: xl, xl2: xl2 }, { children: [props.schema && (0, jsx_runtime_1.jsx)(FormSchema, { schema: props.schema }), props.children] })) })) }))), error && ((0, jsx_runtime_1.jsx)(react_core_1.Alert, { variant: "danger", title: error !== null && error !== void 0 ? error : '', isInline: true, style: { paddingLeft: isMd && props.onCancel ? 190 : undefined } })), props.onCancel ? ((0, jsx_runtime_1.jsx)("div", __assign({ style: {
75
+ } }, { children: [props.disableScrolling ? ((0, jsx_runtime_1.jsx)("div", __assign({ style: { maxWidth: maxWidth, padding: 24 } }, { children: (0, jsx_runtime_1.jsxs)(react_core_1.Grid, __assign({ hasGutter: true, span: 12, sm: sm, md: md, lg: lg, xl: xl, xl2: xl2 }, { children: [props.schema && (0, jsx_runtime_1.jsx)(PageFormFromSchema_1.FormSchema, { schema: props.schema }), props.children] })) }))) : ((0, jsx_runtime_1.jsx)(Scrollable_1.Scrollable, __assign({ style: { height: '100%', flexGrow: 1 } }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ style: { maxWidth: maxWidth, padding: 24 } }, { children: (0, jsx_runtime_1.jsxs)(react_core_1.Grid, __assign({ hasGutter: true, span: 12, sm: sm, md: md, lg: lg, xl: xl, xl2: xl2 }, { children: [props.schema && (0, jsx_runtime_1.jsx)(PageFormFromSchema_1.FormSchema, { schema: props.schema }), props.children] })) })) }))), error && ((0, jsx_runtime_1.jsx)(react_core_1.Alert, { variant: "danger", title: error !== null && error !== void 0 ? error : '', isInline: true, style: { paddingLeft: isMd && props.onCancel ? 190 : undefined } })), props.onCancel ? ((0, jsx_runtime_1.jsx)("div", __assign({ style: {
356
76
  backgroundColor: settings.theme === 'dark' ? 'var(--pf-global--BackgroundColor--400)' : undefined,
357
77
  padding: 24,
358
78
  } }, { children: (0, jsx_runtime_1.jsxs)(react_core_1.ActionGroup, __assign({ style: { marginTop: 0 } }, { children: [(0, jsx_runtime_1.jsx)(PageFormSubmitButton, { children: props.submitText }), props.onCancel && ((0, jsx_runtime_1.jsx)(PageFormCancelButton, __assign({ onCancel: props.onCancel }, { children: props.cancelText })))] })) }))) : ((0, jsx_runtime_1.jsx)(PageFormSubmitButton, __assign({ style: { marginTop: 48 } }, { children: props.submitText })))] })) }))
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function PageFormAlerts(): JSX.Element;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PageFormAlerts = void 0;
4
+ var jsx_runtime_1 = require("react/jsx-runtime");
5
+ var react_core_1 = require("@patternfly/react-core");
6
+ var react_1 = require("react");
7
+ var react_hook_form_1 = require("react-hook-form");
8
+ var useBreakPoint_1 = require("../components/useBreakPoint");
9
+ function PageFormAlerts() {
10
+ var errors = (0, react_hook_form_1.useFormState)().errors;
11
+ var isMd = (0, useBreakPoint_1.useBreakpoint)('md');
12
+ return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: errors && Object.keys(errors).length > 0 && ((0, jsx_runtime_1.jsx)(react_core_1.Alert, { title: "Please fix validation errors.", isInline: true, style: { width: '100%', paddingLeft: isMd ? 190 : undefined }, variant: "danger" })) }));
13
+ }
14
+ exports.PageFormAlerts = PageFormAlerts;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare function PageFormButtons(props: {
3
+ submitText: string;
4
+ cancelText: string;
5
+ onCancel: () => void;
6
+ }): JSX.Element;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.PageFormButtons = void 0;
15
+ var jsx_runtime_1 = require("react/jsx-runtime");
16
+ var react_core_1 = require("@patternfly/react-core");
17
+ var react_hook_form_1 = require("react-hook-form");
18
+ var PageFormAlerts_1 = require("./PageFormAlerts");
19
+ function PageFormButtons(props) {
20
+ var errors = (0, react_hook_form_1.useFormState)().errors;
21
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(PageFormAlerts_1.PageFormAlerts, {}), (0, jsx_runtime_1.jsx)(react_core_1.PageSection, __assign({ isFilled: true, style: {
22
+ display: 'flex',
23
+ flexDirection: 'column',
24
+ maxHeight: '100%',
25
+ borderTop: 'thin solid var(--pf-global--BorderColor--100)',
26
+ }, variant: "light" }, { children: (0, jsx_runtime_1.jsxs)(react_core_1.ActionGroup, __assign({ style: { marginTop: 0 } }, { children: [errors && Object.keys(errors).length > 0 ? ((0, jsx_runtime_1.jsx)(react_core_1.Tooltip, __assign({ content: 'Please fix validation errors' }, { children: (0, jsx_runtime_1.jsx)(react_core_1.Button, __assign({ type: "submit", isAriaDisabled: true }, { children: props.submitText })) }))) : ((0, jsx_runtime_1.jsx)(react_core_1.Button, __assign({ type: "submit" }, { children: props.submitText }))), (0, jsx_runtime_1.jsx)(react_core_1.Button, __assign({ type: "button", variant: "link", onClick: props.onCancel }, { children: props.cancelText }))] })) }))] }));
27
+ }
28
+ exports.PageFormButtons = PageFormButtons;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { JSONSchema6 } from 'json-schema';
3
+ export declare function FormSchema(props: {
4
+ schema: JSONSchema6;
5
+ base?: string;
6
+ }): JSX.Element;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormSchema = void 0;
4
+ var jsx_runtime_1 = require("react/jsx-runtime");
5
+ var PageFormSelectOption_1 = require("./Inputs/PageFormSelectOption");
6
+ var PageFormSlider_1 = require("./Inputs/PageFormSlider");
7
+ var PageFormSwitch_1 = require("./Inputs/PageFormSwitch");
8
+ var PageFormTextArea_1 = require("./Inputs/PageFormTextArea");
9
+ var PageFormTextInput_1 = require("./Inputs/PageFormTextInput");
10
+ var PageFormTextSelect_1 = require("./Inputs/PageFormTextSelect");
11
+ function FormSchema(props) {
12
+ var schema = props.schema;
13
+ var base = props.base ? props.base + '.' : '';
14
+ var p = [];
15
+ for (var propertyName in schema.properties) {
16
+ var property = schema.properties[propertyName];
17
+ switch (property) {
18
+ case true:
19
+ case false:
20
+ continue;
21
+ }
22
+ var title = typeof property.title === 'string' ? property.title : propertyName;
23
+ var placeholder = property.placeholder;
24
+ placeholder = typeof placeholder === 'string' ? placeholder : undefined;
25
+ var required = Array.isArray(schema.required) && schema.required.includes(propertyName);
26
+ switch (property.type) {
27
+ case 'string': {
28
+ switch (property.variant) {
29
+ case 'select': {
30
+ if ('options' in property) {
31
+ var formSelectProps = property;
32
+ p.push((0, jsx_runtime_1.jsx)(PageFormSelectOption_1.PageFormSelectOption, { name: base + propertyName, label: title, placeholder: placeholder, isRequired: required, options: formSelectProps.options, footer: formSelectProps.footer }, base + propertyName));
33
+ }
34
+ else {
35
+ p.push((0, jsx_runtime_1.jsx)(PageFormTextSelect_1.FormTextSelect, { name: base + propertyName, label: title, placeholder: placeholder, required: required, selectTitle: property.selectTitle, selectValue: property.selectValue, selectOpen: property.selectOpen }, base + propertyName));
36
+ }
37
+ break;
38
+ }
39
+ case 'textarea':
40
+ p.push((0, jsx_runtime_1.jsx)(PageFormTextArea_1.PageFormTextArea, { name: base + propertyName, label: title, placeholder: placeholder, required: required }, base + propertyName));
41
+ break;
42
+ case 'secret':
43
+ p.push((0, jsx_runtime_1.jsx)(PageFormTextInput_1.PageFormTextInput, { name: base + propertyName, label: title, placeholder: placeholder, required: required, secret: true }, base + propertyName));
44
+ break;
45
+ default:
46
+ p.push((0, jsx_runtime_1.jsx)(PageFormTextInput_1.PageFormTextInput, { name: base + propertyName, label: title, placeholder: placeholder, required: required }, base + propertyName));
47
+ break;
48
+ }
49
+ break;
50
+ }
51
+ case 'number': {
52
+ p.push((0, jsx_runtime_1.jsx)(PageFormSlider_1.PageFormSlider, { name: base + propertyName, label: title, required: required, min: property.min, max: property.max, valueLabel: property.valueLabel }, base + propertyName));
53
+ break;
54
+ }
55
+ case 'boolean': {
56
+ p.push((0, jsx_runtime_1.jsx)(PageFormSwitch_1.PageFormSwitch, { name: base + propertyName, label: title, required: required }, base + propertyName));
57
+ break;
58
+ }
59
+ case 'object': {
60
+ p.push((0, jsx_runtime_1.jsx)(FormSchema, { schema: property, base: base + propertyName }, propertyName));
61
+ break;
62
+ }
63
+ }
64
+ }
65
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: p });
66
+ }
67
+ exports.FormSchema = FormSchema;
@@ -0,0 +1,8 @@
1
+ export interface PageFormInputPopover {
2
+ title?: string;
3
+ body?: string[];
4
+ link?: {
5
+ label: string;
6
+ url: string;
7
+ };
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -15,8 +15,8 @@ exports.PagePagination = void 0;
15
15
  var jsx_runtime_1 = require("react/jsx-runtime");
16
16
  var react_core_1 = require("@patternfly/react-core");
17
17
  var react_1 = require("react");
18
- var useBreakPoint_1 = require("./components/useBreakPoint");
19
- var Settings_1 = require("./Settings");
18
+ var useBreakPoint_1 = require("../components/useBreakPoint");
19
+ var Settings_1 = require("../Settings");
20
20
  function PagePagination(props) {
21
21
  var setPage = props.setPage, setPerPage = props.setPerPage;
22
22
  var onSetPage = (0, react_1.useCallback)(function (_event, page) { return setPage(page); }, [setPage]);
@@ -1,6 +1,6 @@
1
1
  import { Dispatch, ReactNode, SetStateAction } from 'react';
2
- import { IPageAction } from './PageActions/PageAction';
3
- import { PageHeaderProps } from './PageHeader';
2
+ import { IPageAction } from '../PageActions/PageAction';
3
+ import { PageHeaderProps } from '../PageHeader';
4
4
  import { PageTableViewType } from './PageTableViewType';
5
5
  import { IToolbarFilter } from './PageToolbar';
6
6
  export type TablePageProps<T extends object> = PageHeaderProps & PageTableProps<T> & {