@uxf/form 11.72.0 → 11.74.0
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 +3 -1
- package/package.json +4 -2
- package/translations/translations.d.ts +389 -0
- package/translations/translations.js +55 -0
- package/_code-generator/form-code-generator.d.ts +0 -16
- package/_code-generator/form-code-generator.js +0 -69
- package/avatar-file-input/avatar-file-input.d.ts +0 -14
- package/avatar-file-input/avatar-file-input.js +0 -38
- package/avatar-file-input/avatar-file-input.stories.d.ts +0 -8
- package/avatar-file-input/avatar-file-input.stories.js +0 -23
- package/avatar-file-input/index.d.ts +0 -1
- package/avatar-file-input/index.js +0 -17
- package/bin/form-code-generator.d.ts +0 -2
- package/bin/form-code-generator.js +0 -55
- package/checkbox-button/checkbox-button.d.ts +0 -14
- package/checkbox-button/checkbox-button.js +0 -38
- package/checkbox-button/checkbox-button.stories.d.ts +0 -8
- package/checkbox-button/checkbox-button.stories.js +0 -24
- package/checkbox-button/index.d.ts +0 -1
- package/checkbox-button/index.js +0 -17
- package/checkbox-input/checkbox-input.d.ts +0 -14
- package/checkbox-input/checkbox-input.js +0 -38
- package/checkbox-input/checkbox-input.stories.d.ts +0 -8
- package/checkbox-input/checkbox-input.stories.js +0 -24
- package/checkbox-input/index.d.ts +0 -1
- package/checkbox-input/index.js +0 -17
- package/checkbox-list/checkbox-list.d.ts +0 -19
- package/checkbox-list/checkbox-list.js +0 -36
- package/checkbox-list/checkbox-list.stories.d.ts +0 -2
- package/checkbox-list/checkbox-list.stories.js +0 -22
- package/checkbox-list/index.d.ts +0 -1
- package/checkbox-list/index.js +0 -17
- package/color-radio-group/color-radio-group.d.ts +0 -13
- package/color-radio-group/color-radio-group.js +0 -38
- package/color-radio-group/color-radio-group.stories.d.ts +0 -8
- package/color-radio-group/color-radio-group.stories.js +0 -62
- package/color-radio-group/index.d.ts +0 -1
- package/color-radio-group/index.js +0 -17
- package/combobox/combobox.d.ts +0 -13
- package/combobox/combobox.js +0 -44
- package/combobox/combobox.stories.d.ts +0 -8
- package/combobox/combobox.stories.js +0 -30
- package/combobox/index.d.ts +0 -1
- package/combobox/index.js +0 -17
- package/components.d.ts +0 -127
- package/components.js +0 -154
- package/date-picker-input/date-picker-input.d.ts +0 -15
- package/date-picker-input/date-picker-input.js +0 -89
- package/date-picker-input/date-picker-input.stories.d.ts +0 -8
- package/date-picker-input/date-picker-input.stories.js +0 -31
- package/date-picker-input/index.d.ts +0 -1
- package/date-picker-input/index.js +0 -17
- package/date-range-picker-input/date-range-picker-input.d.ts +0 -12
- package/date-range-picker-input/date-range-picker-input.js +0 -106
- package/date-range-picker-input/date-range-picker-input.stories.d.ts +0 -8
- package/date-range-picker-input/date-range-picker-input.stories.js +0 -25
- package/date-range-picker-input/index.d.ts +0 -1
- package/date-range-picker-input/index.js +0 -17
- package/datetime-picker-input/datetime-picker-input.d.ts +0 -15
- package/datetime-picker-input/datetime-picker-input.js +0 -90
- package/datetime-picker-input/datetime-picker-input.stories.d.ts +0 -2
- package/datetime-picker-input/datetime-picker-input.stories.js +0 -28
- package/datetime-picker-input/index.d.ts +0 -1
- package/datetime-picker-input/index.js +0 -17
- package/dropzone/dropzone-input.d.ts +0 -13
- package/dropzone/dropzone-input.js +0 -59
- package/dropzone/dropzone-list.d.ts +0 -11
- package/dropzone/dropzone-list.js +0 -23
- package/dropzone/dropzone.stories.d.ts +0 -2
- package/dropzone/dropzone.stories.js +0 -50
- package/dropzone/index.d.ts +0 -9
- package/dropzone/index.js +0 -6
- package/file-input/file-input.d.ts +0 -14
- package/file-input/file-input.js +0 -38
- package/file-input/file-input.stories.d.ts +0 -8
- package/file-input/file-input.stories.js +0 -31
- package/file-input/index.d.ts +0 -1
- package/file-input/index.js +0 -17
- package/form/form.d.ts +0 -19
- package/form/form.js +0 -25
- package/form/form.stories.d.ts +0 -8
- package/form/form.stories.js +0 -24
- package/form/index.d.ts +0 -1
- package/form/index.js +0 -17
- package/form-id-context/form-context.d.ts +0 -7
- package/form-id-context/form-context.js +0 -12
- package/form-id-context/form-id-context.d.ts +0 -2
- package/form-id-context/form-id-context.js +0 -7
- package/form-id-context/index.d.ts +0 -1
- package/form-id-context/index.js +0 -17
- package/form-renderer/big-test-schema.d.ts +0 -33
- package/form-renderer/big-test-schema.js +0 -295
- package/form-renderer/field/base-field.d.ts +0 -4
- package/form-renderer/field/base-field.js +0 -70
- package/form-renderer/field/embedded.d.ts +0 -4
- package/form-renderer/field/embedded.js +0 -19
- package/form-renderer/field/one-to-many.d.ts +0 -4
- package/form-renderer/field/one-to-many.js +0 -50
- package/form-renderer/form-renderer.d.ts +0 -16
- package/form-renderer/form-renderer.js +0 -26
- package/form-renderer/form-renderer.stories.d.ts +0 -2
- package/form-renderer/form-renderer.stories.js +0 -23
- package/form-renderer/index.d.ts +0 -2
- package/form-renderer/index.js +0 -18
- package/form-renderer/mapper.d.ts +0 -2
- package/form-renderer/mapper.js +0 -30
- package/form-renderer/types.d.ts +0 -39
- package/form-renderer/types.js +0 -2
- package/gps-input/gps-input.d.ts +0 -20
- package/gps-input/gps-input.js +0 -154
- package/gps-input/gps-input.stories.d.ts +0 -8
- package/gps-input/gps-input.stories.js +0 -22
- package/gps-input/index.d.ts +0 -1
- package/gps-input/index.js +0 -17
- package/money-input/index.d.ts +0 -1
- package/money-input/index.js +0 -17
- package/money-input/money-input.d.ts +0 -24
- package/money-input/money-input.js +0 -108
- package/money-input/money-input.stories.d.ts +0 -2
- package/money-input/money-input.stories.js +0 -15
- package/multi-combobox/index.d.ts +0 -1
- package/multi-combobox/index.js +0 -17
- package/multi-combobox/multi-combobox.d.ts +0 -13
- package/multi-combobox/multi-combobox.js +0 -44
- package/multi-combobox/multi-combobox.stories.d.ts +0 -8
- package/multi-combobox/multi-combobox.stories.js +0 -54
- package/multi-select/index.d.ts +0 -1
- package/multi-select/index.js +0 -17
- package/multi-select/multi-select.d.ts +0 -13
- package/multi-select/multi-select.js +0 -39
- package/multi-select/multi-select.stories.d.ts +0 -8
- package/multi-select/multi-select.stories.js +0 -47
- package/number-input/index.d.ts +0 -1
- package/number-input/index.js +0 -17
- package/number-input/number-input.d.ts +0 -17
- package/number-input/number-input.js +0 -72
- package/number-input/number-input.stories.d.ts +0 -8
- package/number-input/number-input.stories.js +0 -24
- package/password-input/index.d.ts +0 -1
- package/password-input/index.js +0 -17
- package/password-input/password-input.d.ts +0 -15
- package/password-input/password-input.js +0 -93
- package/password-input/password-input.stories.d.ts +0 -8
- package/password-input/password-input.stories.js +0 -23
- package/radio-group/index.d.ts +0 -1
- package/radio-group/index.js +0 -17
- package/radio-group/radio-group.d.ts +0 -13
- package/radio-group/radio-group.js +0 -38
- package/radio-group/radio-group.stories.d.ts +0 -8
- package/radio-group/radio-group.stories.js +0 -38
- package/readmes.d.ts +0 -28
- package/readmes.js +0 -59
- package/select/index.d.ts +0 -1
- package/select/index.js +0 -17
- package/select/select.d.ts +0 -13
- package/select/select.js +0 -39
- package/select/select.stories.d.ts +0 -8
- package/select/select.stories.js +0 -44
- package/storybook/form-data-printer.d.ts +0 -6
- package/storybook/form-data-printer.js +0 -12
- package/storybook/storybook-form.d.ts +0 -8
- package/storybook/storybook-form.js +0 -42
- package/text-input/index.d.ts +0 -1
- package/text-input/index.js +0 -17
- package/text-input/text-input.d.ts +0 -33
- package/text-input/text-input.js +0 -57
- package/text-input/text-input.stories.d.ts +0 -8
- package/text-input/text-input.stories.js +0 -26
- package/textarea/index.d.ts +0 -1
- package/textarea/index.js +0 -17
- package/textarea/textarea.d.ts +0 -13
- package/textarea/textarea.js +0 -58
- package/textarea/textarea.stories.d.ts +0 -8
- package/textarea/textarea.stories.js +0 -22
- package/time-picker-input/index.d.ts +0 -1
- package/time-picker-input/index.js +0 -17
- package/time-picker-input/time-picker-input.d.ts +0 -14
- package/time-picker-input/time-picker-input.js +0 -77
- package/time-picker-input/time-picker-input.stories.d.ts +0 -8
- package/time-picker-input/time-picker-input.stories.js +0 -25
- package/toggle/index.d.ts +0 -1
- package/toggle/index.js +0 -17
- package/toggle/toggle.d.ts +0 -14
- package/toggle/toggle.js +0 -38
- package/toggle/toggle.stories.d.ts +0 -8
- package/toggle/toggle.stories.js +0 -23
- package/types.d.ts +0 -4
- package/types.js +0 -2
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useFormContext = exports.FormContextProvider = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const FormContext = (0, react_1.createContext)({
|
|
6
|
-
formId: "",
|
|
7
|
-
isFormDisabled: false,
|
|
8
|
-
isFormReadOnly: false,
|
|
9
|
-
});
|
|
10
|
-
exports.FormContextProvider = FormContext.Provider;
|
|
11
|
-
const useFormContext = () => (0, react_1.useContext)(FormContext);
|
|
12
|
-
exports.useFormContext = useFormContext;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useFormIdContext = void 0;
|
|
4
|
-
const form_context_1 = require("./form-context");
|
|
5
|
-
/** @deprecated use useFormContext().formId */
|
|
6
|
-
const useFormIdContext = () => (0, form_context_1.useFormContext)().formId;
|
|
7
|
-
exports.useFormIdContext = useFormIdContext;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./form-id-context";
|
package/form-id-context/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./form-id-context"), exports);
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export declare const schema: {
|
|
2
|
-
fields: ({
|
|
3
|
-
name: string;
|
|
4
|
-
type: string;
|
|
5
|
-
label: string;
|
|
6
|
-
required: boolean;
|
|
7
|
-
readOnly: boolean;
|
|
8
|
-
editable: boolean;
|
|
9
|
-
autocomplete: string;
|
|
10
|
-
options: null;
|
|
11
|
-
fields: never[];
|
|
12
|
-
} | {
|
|
13
|
-
name: string;
|
|
14
|
-
type: string;
|
|
15
|
-
label: string;
|
|
16
|
-
required: boolean;
|
|
17
|
-
readOnly: boolean;
|
|
18
|
-
editable: boolean;
|
|
19
|
-
autocomplete: null;
|
|
20
|
-
options: null;
|
|
21
|
-
fields: {
|
|
22
|
-
name: string;
|
|
23
|
-
type: string;
|
|
24
|
-
label: string;
|
|
25
|
-
required: boolean;
|
|
26
|
-
readOnly: boolean;
|
|
27
|
-
editable: boolean;
|
|
28
|
-
autocomplete: null;
|
|
29
|
-
options: null;
|
|
30
|
-
fields: never[];
|
|
31
|
-
}[];
|
|
32
|
-
})[];
|
|
33
|
-
};
|
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.schema = void 0;
|
|
4
|
-
exports.schema = {
|
|
5
|
-
fields: [
|
|
6
|
-
{
|
|
7
|
-
name: "id",
|
|
8
|
-
type: "integer",
|
|
9
|
-
label: "Id",
|
|
10
|
-
required: true,
|
|
11
|
-
readOnly: true,
|
|
12
|
-
editable: true,
|
|
13
|
-
autocomplete: null,
|
|
14
|
-
options: null,
|
|
15
|
-
fields: [],
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
name: "textRequired",
|
|
19
|
-
type: "string",
|
|
20
|
-
label: "Text required",
|
|
21
|
-
required: true,
|
|
22
|
-
readOnly: false,
|
|
23
|
-
editable: true,
|
|
24
|
-
autocomplete: null,
|
|
25
|
-
options: null,
|
|
26
|
-
fields: [],
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: "textNotRequired",
|
|
30
|
-
type: "string",
|
|
31
|
-
label: "Text optional",
|
|
32
|
-
required: false,
|
|
33
|
-
readOnly: false,
|
|
34
|
-
editable: true,
|
|
35
|
-
autocomplete: null,
|
|
36
|
-
options: null,
|
|
37
|
-
fields: [],
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: "longTextRequired",
|
|
41
|
-
type: "text",
|
|
42
|
-
label: "LongText required",
|
|
43
|
-
required: true,
|
|
44
|
-
readOnly: false,
|
|
45
|
-
editable: true,
|
|
46
|
-
autocomplete: null,
|
|
47
|
-
options: null,
|
|
48
|
-
fields: [],
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: "longTextNotRequired",
|
|
52
|
-
type: "text",
|
|
53
|
-
label: "LongText optional",
|
|
54
|
-
required: false,
|
|
55
|
-
readOnly: false,
|
|
56
|
-
editable: true,
|
|
57
|
-
autocomplete: null,
|
|
58
|
-
options: null,
|
|
59
|
-
fields: [],
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: "imageNotRequired",
|
|
63
|
-
type: "image",
|
|
64
|
-
label: "Image optional",
|
|
65
|
-
required: false,
|
|
66
|
-
readOnly: false,
|
|
67
|
-
editable: true,
|
|
68
|
-
autocomplete: null,
|
|
69
|
-
options: null,
|
|
70
|
-
fields: [],
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: "fileNotRequired",
|
|
74
|
-
type: "file",
|
|
75
|
-
label: "File optional",
|
|
76
|
-
required: false,
|
|
77
|
-
readOnly: false,
|
|
78
|
-
editable: true,
|
|
79
|
-
autocomplete: null,
|
|
80
|
-
options: null,
|
|
81
|
-
fields: [],
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: "images",
|
|
85
|
-
type: "images",
|
|
86
|
-
label: "Images",
|
|
87
|
-
required: false,
|
|
88
|
-
readOnly: false,
|
|
89
|
-
editable: true,
|
|
90
|
-
autocomplete: null,
|
|
91
|
-
options: null,
|
|
92
|
-
fields: [],
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: "dateRequired",
|
|
96
|
-
type: "date",
|
|
97
|
-
label: "Date required",
|
|
98
|
-
required: true,
|
|
99
|
-
readOnly: false,
|
|
100
|
-
editable: true,
|
|
101
|
-
autocomplete: null,
|
|
102
|
-
options: null,
|
|
103
|
-
fields: [],
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
name: "dateNotRequired",
|
|
107
|
-
type: "date",
|
|
108
|
-
label: "Date optional",
|
|
109
|
-
required: false,
|
|
110
|
-
readOnly: false,
|
|
111
|
-
editable: true,
|
|
112
|
-
autocomplete: null,
|
|
113
|
-
options: null,
|
|
114
|
-
fields: [],
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: "dateTimeRequired",
|
|
118
|
-
type: "datetime",
|
|
119
|
-
label: "DateTime required",
|
|
120
|
-
required: true,
|
|
121
|
-
readOnly: false,
|
|
122
|
-
editable: true,
|
|
123
|
-
autocomplete: null,
|
|
124
|
-
options: null,
|
|
125
|
-
fields: [],
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: "dateTimeNotRequired",
|
|
129
|
-
type: "datetime",
|
|
130
|
-
label: "DateTime optional",
|
|
131
|
-
required: false,
|
|
132
|
-
readOnly: false,
|
|
133
|
-
editable: true,
|
|
134
|
-
autocomplete: null,
|
|
135
|
-
options: null,
|
|
136
|
-
fields: [],
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
name: "timeRequired",
|
|
140
|
-
type: "time",
|
|
141
|
-
label: "Time required",
|
|
142
|
-
required: true,
|
|
143
|
-
readOnly: false,
|
|
144
|
-
editable: true,
|
|
145
|
-
autocomplete: null,
|
|
146
|
-
options: null,
|
|
147
|
-
fields: [],
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
name: "timeNotRequired",
|
|
151
|
-
type: "time",
|
|
152
|
-
label: "Time optional",
|
|
153
|
-
required: false,
|
|
154
|
-
readOnly: false,
|
|
155
|
-
editable: true,
|
|
156
|
-
autocomplete: null,
|
|
157
|
-
options: null,
|
|
158
|
-
fields: [],
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
name: "integerRequired",
|
|
162
|
-
type: "integer",
|
|
163
|
-
label: "Integer required",
|
|
164
|
-
required: true,
|
|
165
|
-
readOnly: false,
|
|
166
|
-
editable: true,
|
|
167
|
-
autocomplete: null,
|
|
168
|
-
options: null,
|
|
169
|
-
fields: [],
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
name: "integerNotRequired",
|
|
173
|
-
type: "integer",
|
|
174
|
-
label: "Integer optional",
|
|
175
|
-
required: false,
|
|
176
|
-
readOnly: false,
|
|
177
|
-
editable: true,
|
|
178
|
-
autocomplete: null,
|
|
179
|
-
options: null,
|
|
180
|
-
fields: [],
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
name: "isBooleanNotRequired",
|
|
184
|
-
type: "boolean",
|
|
185
|
-
label: "Boolean optional",
|
|
186
|
-
required: false,
|
|
187
|
-
readOnly: false,
|
|
188
|
-
editable: true,
|
|
189
|
-
autocomplete: null,
|
|
190
|
-
options: null,
|
|
191
|
-
fields: [],
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
name: "manyToManyBigTest",
|
|
195
|
-
type: "manyToMany",
|
|
196
|
-
label: "ManyToMany",
|
|
197
|
-
required: false,
|
|
198
|
-
readOnly: false,
|
|
199
|
-
editable: true,
|
|
200
|
-
autocomplete: "big-test",
|
|
201
|
-
options: null,
|
|
202
|
-
fields: [],
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
name: "manyToOneBigTest",
|
|
206
|
-
type: "manyToOne",
|
|
207
|
-
label: "ManyToOne",
|
|
208
|
-
required: false,
|
|
209
|
-
readOnly: false,
|
|
210
|
-
editable: true,
|
|
211
|
-
autocomplete: "big-test",
|
|
212
|
-
options: null,
|
|
213
|
-
fields: [],
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
name: "embedded",
|
|
217
|
-
type: "embedded",
|
|
218
|
-
label: "Embedded",
|
|
219
|
-
required: true,
|
|
220
|
-
readOnly: false,
|
|
221
|
-
editable: true,
|
|
222
|
-
autocomplete: null,
|
|
223
|
-
options: null,
|
|
224
|
-
fields: [
|
|
225
|
-
{
|
|
226
|
-
name: "value",
|
|
227
|
-
type: "integer",
|
|
228
|
-
label: "value",
|
|
229
|
-
required: true,
|
|
230
|
-
readOnly: false,
|
|
231
|
-
editable: true,
|
|
232
|
-
autocomplete: null,
|
|
233
|
-
options: null,
|
|
234
|
-
fields: [],
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
name: "label",
|
|
238
|
-
type: "string",
|
|
239
|
-
label: "label",
|
|
240
|
-
required: true,
|
|
241
|
-
readOnly: false,
|
|
242
|
-
editable: true,
|
|
243
|
-
autocomplete: null,
|
|
244
|
-
options: null,
|
|
245
|
-
fields: [],
|
|
246
|
-
},
|
|
247
|
-
],
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
name: "oneToMany",
|
|
251
|
-
type: "oneToMany",
|
|
252
|
-
label: "OneToMany",
|
|
253
|
-
required: true,
|
|
254
|
-
readOnly: false,
|
|
255
|
-
editable: true,
|
|
256
|
-
autocomplete: null,
|
|
257
|
-
options: null,
|
|
258
|
-
fields: [
|
|
259
|
-
{
|
|
260
|
-
name: "id",
|
|
261
|
-
type: "integer",
|
|
262
|
-
label: "Id",
|
|
263
|
-
required: true,
|
|
264
|
-
readOnly: true,
|
|
265
|
-
editable: true,
|
|
266
|
-
autocomplete: null,
|
|
267
|
-
options: null,
|
|
268
|
-
fields: [],
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
name: "value",
|
|
272
|
-
type: "integer",
|
|
273
|
-
label: "Big test one to many value",
|
|
274
|
-
required: true,
|
|
275
|
-
readOnly: false,
|
|
276
|
-
editable: true,
|
|
277
|
-
autocomplete: null,
|
|
278
|
-
options: null,
|
|
279
|
-
fields: [],
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
name: "label",
|
|
283
|
-
type: "string",
|
|
284
|
-
label: "Big test one to many label",
|
|
285
|
-
required: true,
|
|
286
|
-
readOnly: false,
|
|
287
|
-
editable: true,
|
|
288
|
-
autocomplete: null,
|
|
289
|
-
options: null,
|
|
290
|
-
fields: [],
|
|
291
|
-
},
|
|
292
|
-
],
|
|
293
|
-
},
|
|
294
|
-
],
|
|
295
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BaseField = BaseField;
|
|
7
|
-
const autocomplete_1 = require("@uxf/core/api/autocomplete");
|
|
8
|
-
const upload_file_1 = require("@uxf/core/api/upload-file");
|
|
9
|
-
const empty_array_1 = require("@uxf/core/constants/empty-array");
|
|
10
|
-
const checkbox_input_1 = require("@uxf/form/checkbox-input");
|
|
11
|
-
const combobox_1 = require("@uxf/form/combobox");
|
|
12
|
-
const date_picker_input_1 = require("@uxf/form/date-picker-input");
|
|
13
|
-
const datetime_picker_input_1 = require("@uxf/form/datetime-picker-input");
|
|
14
|
-
const dropzone_input_1 = require("@uxf/form/dropzone/dropzone-input");
|
|
15
|
-
const dropzone_list_1 = require("@uxf/form/dropzone/dropzone-list");
|
|
16
|
-
const file_input_1 = require("@uxf/form/file-input");
|
|
17
|
-
const multi_combobox_1 = require("@uxf/form/multi-combobox");
|
|
18
|
-
const number_input_1 = require("@uxf/form/number-input");
|
|
19
|
-
const select_1 = require("@uxf/form/select");
|
|
20
|
-
const text_input_1 = require("@uxf/form/text-input");
|
|
21
|
-
const textarea_1 = require("@uxf/form/textarea");
|
|
22
|
-
const time_picker_input_1 = require("@uxf/form/time-picker-input");
|
|
23
|
-
const label_1 = require("@uxf/ui/label");
|
|
24
|
-
const react_1 = __importDefault(require("react"));
|
|
25
|
-
const defaultUploadHandler = (0, upload_file_1.createUploadHandler)("default");
|
|
26
|
-
// eslint-disable-next-line complexity
|
|
27
|
-
function BaseField(props) {
|
|
28
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
29
|
-
const { editable, label, name, readOnly, type } = props.fieldSchema;
|
|
30
|
-
const fieldName = `${(_a = props.prefix) !== null && _a !== void 0 ? _a : ""}${name}`;
|
|
31
|
-
const isDisabled = readOnly || (props.isEditing && !editable);
|
|
32
|
-
const isRequired = !isDisabled && props.fieldSchema.required;
|
|
33
|
-
const autocompleteHandler = (_c = (_b = props.overrides) === null || _b === void 0 ? void 0 : _b.autocomplete) !== null && _c !== void 0 ? _c : autocomplete_1.autocomplete;
|
|
34
|
-
const uploadHandler = (_e = (_d = props.overrides) === null || _d === void 0 ? void 0 : _d.upload) !== null && _e !== void 0 ? _e : defaultUploadHandler;
|
|
35
|
-
/*eslint complexity: ["error", 21]*/
|
|
36
|
-
switch (type) {
|
|
37
|
-
case "file":
|
|
38
|
-
case "logo":
|
|
39
|
-
case "image":
|
|
40
|
-
return (react_1.default.createElement(file_input_1.FileInput, { control: props.control, id: fieldName, isClearable: !isRequired, isDisabled: isDisabled, isRequired: isRequired, label: label, name: fieldName, onUploadFile: uploadHandler }));
|
|
41
|
-
case "enum":
|
|
42
|
-
return (react_1.default.createElement(select_1.Select, { control: props.control, isClearable: !isRequired, isDisabled: isDisabled, isRequired: isRequired, label: label, name: fieldName, options: (_f = props.fieldSchema.options) !== null && _f !== void 0 ? _f : empty_array_1.EMPTY_ARRAY }));
|
|
43
|
-
case "boolean":
|
|
44
|
-
return (react_1.default.createElement(checkbox_input_1.CheckboxInput, { control: props.control, isDisabled: isDisabled, isRequired: isRequired, label: label, name: fieldName }));
|
|
45
|
-
case "date":
|
|
46
|
-
return (react_1.default.createElement(date_picker_input_1.DatePickerInput, { control: props.control, isClearable: !isRequired, isDisabled: isDisabled, isRequired: isRequired, label: label, name: fieldName }));
|
|
47
|
-
case "datetime":
|
|
48
|
-
return (react_1.default.createElement(datetime_picker_input_1.DatetimePickerInput, { control: props.control, isClearable: !isRequired, isDisabled: isDisabled, isRequired: isRequired, label: label, name: fieldName }));
|
|
49
|
-
case "time":
|
|
50
|
-
return (react_1.default.createElement(time_picker_input_1.TimePickerInput, { control: props.control, isClearable: !isRequired, isDisabled: isDisabled, isRequired: isRequired, label: label, name: fieldName }));
|
|
51
|
-
case "files":
|
|
52
|
-
case "images":
|
|
53
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
54
|
-
react_1.default.createElement(label_1.Label, { isRequired: isRequired }, label),
|
|
55
|
-
react_1.default.createElement("div", { className: "mb-3" },
|
|
56
|
-
react_1.default.createElement(dropzone_input_1.DropzoneInput, { control: props.control, isRequired: isRequired, label: label, name: fieldName, onUploadFile: uploadHandler })),
|
|
57
|
-
react_1.default.createElement(dropzone_list_1.DropzoneList, { control: props.control, errorText: "Soubor se nepoda\u0159ilo nahr\u00E1t.", name: fieldName, onRemoveConfirm: (_g = props.overrides) === null || _g === void 0 ? void 0 : _g.onRemoveConfirm })));
|
|
58
|
-
case "manyToMany":
|
|
59
|
-
return (react_1.default.createElement(multi_combobox_1.MultiCombobox, { control: props.control, isDisabled: isDisabled, isRequired: isRequired, label: label, loadOptions: (term) => { var _a; return autocompleteHandler((_a = props.fieldSchema.autocomplete) !== null && _a !== void 0 ? _a : "", term); }, name: fieldName }));
|
|
60
|
-
case "manyToOne":
|
|
61
|
-
return (react_1.default.createElement(combobox_1.Combobox, { control: props.control, isClearable: !isRequired, isDisabled: isDisabled, isRequired: isRequired, label: label, loadOptions: (term) => { var _a; return autocompleteHandler((_a = props.fieldSchema.autocomplete) !== null && _a !== void 0 ? _a : "", term); }, name: fieldName }));
|
|
62
|
-
case "integer":
|
|
63
|
-
return (react_1.default.createElement(number_input_1.NumberInput, { control: props.control, isDisabled: isDisabled, isRequired: isRequired, label: label, name: fieldName }));
|
|
64
|
-
case "text":
|
|
65
|
-
return (react_1.default.createElement(textarea_1.Textarea, { control: props.control, isDisabled: isDisabled, isRequired: isRequired, label: label, name: fieldName }));
|
|
66
|
-
default:
|
|
67
|
-
return (react_1.default.createElement(text_input_1.TextInput, { control: props.control, isDisabled: isDisabled, isRequired: isRequired, label: label, name: fieldName }));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.default = BaseField;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
function Field(props) {
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
9
|
-
if (props.fieldSchema.fields === null) {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
return (react_1.default.createElement("div", { className: "grid gap-2" }, props.fieldSchema.fields.map((schema, i) => {
|
|
13
|
-
var _a;
|
|
14
|
-
const FieldComponent = (_a = props.fields[schema.type]) !== null && _a !== void 0 ? _a : props.fields.default;
|
|
15
|
-
return (react_1.default.createElement("div", { key: i },
|
|
16
|
-
react_1.default.createElement(FieldComponent, { ...props, fieldSchema: { ...schema, label: `${props.fieldSchema.label} ${schema.label}` }, prefix: `${props.fieldSchema.name}.` })));
|
|
17
|
-
})));
|
|
18
|
-
}
|
|
19
|
-
exports.default = Field;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const icon_button_1 = require("@uxf/ui/icon-button");
|
|
27
|
-
const react_1 = __importStar(require("react"));
|
|
28
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
29
|
-
function Field(props) {
|
|
30
|
-
const { fields, remove, append } = (0, react_hook_form_1.useFieldArray)({ control: props.control, name: props.fieldSchema.name });
|
|
31
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
32
|
-
react_1.default.createElement("p", { className: "mb-2 font-medium" }, props.fieldSchema.label),
|
|
33
|
-
react_1.default.createElement("div", { className: "grid gap-2" }, fields.map((name, index) => (react_1.default.createElement(react_1.Fragment, { key: name.id },
|
|
34
|
-
props.fieldSchema.fields.map((schema, i) => {
|
|
35
|
-
var _a;
|
|
36
|
-
if (schema.name === "id") {
|
|
37
|
-
return react_1.default.createElement("input", { key: `${schema.name}-${i}`, name: "id", type: "hidden" });
|
|
38
|
-
}
|
|
39
|
-
const FieldComponent = (_a = props.fields[schema.type]) !== null && _a !== void 0 ? _a : props.fields.default;
|
|
40
|
-
return (react_1.default.createElement("div", { key: `${schema.name}-${i}` },
|
|
41
|
-
react_1.default.createElement(FieldComponent, { ...props, fieldSchema: schema, prefix: props.prefix
|
|
42
|
-
? `${props.prefix}.${props.fieldSchema.name}.${index}.`
|
|
43
|
-
: `${props.fieldSchema.name}.${index}.` })));
|
|
44
|
-
}),
|
|
45
|
-
react_1.default.createElement("div", { className: "flex justify-end" },
|
|
46
|
-
react_1.default.createElement(icon_button_1.IconButton, { iconName: "trash", label: "Smazat polo\u017Eku", onClick: () => remove(index), variant: "secondary" })))))),
|
|
47
|
-
react_1.default.createElement("div", { className: "mt-2" },
|
|
48
|
-
react_1.default.createElement(icon_button_1.IconButton, { iconName: "plus", label: "P\u0159idat polo\u017Eku", onClick: () => append({ id: null }), variant: "secondary" }))));
|
|
49
|
-
}
|
|
50
|
-
exports.default = Field;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FormProps as UXFFormProps } from "@uxf/form/form";
|
|
2
|
-
import React, { FunctionComponent } from "react";
|
|
3
|
-
import { FieldValues, FormState } from "react-hook-form";
|
|
4
|
-
import { FormRendererFields, FormSchema } from "./types";
|
|
5
|
-
type SubmitButtonComponent<TFieldValues extends FieldValues = FieldValues> = FunctionComponent<{
|
|
6
|
-
formState: FormState<TFieldValues>;
|
|
7
|
-
}>;
|
|
8
|
-
interface FormRendererProps<T extends FieldValues> extends Omit<UXFFormProps<T>, "children"> {
|
|
9
|
-
className?: string;
|
|
10
|
-
schema: FormSchema;
|
|
11
|
-
fields: FormRendererFields;
|
|
12
|
-
isEditing?: boolean;
|
|
13
|
-
SubmitButton?: SubmitButtonComponent<T>;
|
|
14
|
-
}
|
|
15
|
-
export declare function FormRenderer<T extends FieldValues>(props: FormRendererProps<T>): React.JSX.Element;
|
|
16
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FormRenderer = FormRenderer;
|
|
7
|
-
const form_1 = require("@uxf/form/form");
|
|
8
|
-
const button_1 = require("@uxf/ui/button");
|
|
9
|
-
const react_1 = __importDefault(require("react"));
|
|
10
|
-
const BaseSubmitButton = (props) => {
|
|
11
|
-
const { isSubmitting } = props.formState;
|
|
12
|
-
return (react_1.default.createElement(button_1.Button, { isDisabled: isSubmitting, type: "submit" }, "Ulo\u017Eit"));
|
|
13
|
-
};
|
|
14
|
-
function FormRenderer(props) {
|
|
15
|
-
var _a;
|
|
16
|
-
const SubmitButton = (_a = props.SubmitButton) !== null && _a !== void 0 ? _a : BaseSubmitButton;
|
|
17
|
-
return (react_1.default.createElement(form_1.Form, { className: "uxf-form-renderer", formApi: props.formApi, id: props.id, onSubmit: props.onSubmit },
|
|
18
|
-
react_1.default.createElement("div", { className: "uxf-form-renderer__body" }, props.schema.fields.map((field, i) => {
|
|
19
|
-
var _a;
|
|
20
|
-
const Field = (_a = props.fields[field.type]) !== null && _a !== void 0 ? _a : props.fields.default;
|
|
21
|
-
return (react_1.default.createElement("div", { className: "p-4", key: i },
|
|
22
|
-
react_1.default.createElement(Field, { control: props.formApi.control, fieldSchema: field, fields: props.fields, isEditing: props.isEditing })));
|
|
23
|
-
})),
|
|
24
|
-
react_1.default.createElement("div", { className: "uxf-form-renderer__footer" },
|
|
25
|
-
react_1.default.createElement(SubmitButton, { formState: props.formApi.formState }))));
|
|
26
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.Example = Example;
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
10
|
-
const big_test_schema_1 = require("./big-test-schema");
|
|
11
|
-
const base_field_1 = __importDefault(require("./field/base-field"));
|
|
12
|
-
const embedded_1 = __importDefault(require("./field/embedded"));
|
|
13
|
-
const one_to_many_1 = __importDefault(require("./field/one-to-many"));
|
|
14
|
-
const form_renderer_1 = require("./form-renderer");
|
|
15
|
-
const fields = {
|
|
16
|
-
default: base_field_1.default,
|
|
17
|
-
embedded: embedded_1.default,
|
|
18
|
-
oneToMany: one_to_many_1.default,
|
|
19
|
-
};
|
|
20
|
-
function Example() {
|
|
21
|
-
const formApi = (0, react_hook_form_1.useForm)({ defaultValues: {} });
|
|
22
|
-
return react_1.default.createElement(form_renderer_1.FormRenderer, { fields: fields, formApi: formApi, id: "example-form", onSubmit: console.log, schema: big_test_schema_1.schema });
|
|
23
|
-
}
|
package/form-renderer/index.d.ts
DELETED
package/form-renderer/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./form-renderer"), exports);
|
|
18
|
-
__exportStar(require("./types"), exports);
|
package/form-renderer/mapper.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapToRequestObject = void 0;
|
|
4
|
-
const empty_array_1 = require("@uxf/core/constants/empty-array");
|
|
5
|
-
const mapToRequestObject = (values, schema) => {
|
|
6
|
-
var _a, _b;
|
|
7
|
-
const requestObject = { ...values };
|
|
8
|
-
for (const field of schema.fields) {
|
|
9
|
-
const { name, type } = field;
|
|
10
|
-
const value = requestObject[name];
|
|
11
|
-
switch (type) {
|
|
12
|
-
case "boolean":
|
|
13
|
-
requestObject[name] = Boolean(value);
|
|
14
|
-
break;
|
|
15
|
-
case "file":
|
|
16
|
-
case "image":
|
|
17
|
-
requestObject[name] = value ? value.id : value;
|
|
18
|
-
break;
|
|
19
|
-
case "content":
|
|
20
|
-
// TODO search string
|
|
21
|
-
requestObject[name] = value ? { data: (_a = value.data) !== null && _a !== void 0 ? _a : empty_array_1.EMPTY_ARRAY, search: (_b = value.search) !== null && _b !== void 0 ? _b : "" } : null;
|
|
22
|
-
break;
|
|
23
|
-
case "embedded":
|
|
24
|
-
requestObject[name] = (0, exports.mapToRequestObject)(value, field);
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return requestObject;
|
|
29
|
-
};
|
|
30
|
-
exports.mapToRequestObject = mapToRequestObject;
|