@luomus/laji-form 14.3.6 → 14.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/laji-form.js +1 -1
- package/dist/styles.css +2 -1
- package/lib/components/LajiForm.js +2 -0
- package/lib/components/fields/AsArrayField.d.ts +292 -0
- package/lib/components/fields/AsArrayField.js +39 -0
- package/lib/components/fields/ImageArrayField.d.ts +20 -1
- package/lib/components/fields/ImageArrayField.js +7 -4
- package/lib/components/fields/PdfArrayField.d.ts +21 -0
- package/lib/components/fields/PdfArrayField.js +40 -0
- package/lib/components/templates/ArrayFieldTemplate.js +1 -1
- package/lib/components/templates/TitleField.js +2 -2
- package/lib/themes/bs5.js +1 -1
- package/lib/translations.json +5 -0
- package/package.json +4 -2
- package/cypress/fixtures/example.json +0 -5
- package/cypress/screenshots/nafi.cy.ts/NAFI (MHL.6) -- selecting species name with keyboard navigation -- and closes suggestion list (failed).png +0 -0
- package/cypress/screenshots/nafi.cy.ts/NAFI (MHL.6) -- selecting species name with keyboard navigation -- and is marked as suggested (failed).png +0 -0
- package/llol +0 -10
- package/llol.pdf +0 -10
- package/q +0 -196
package/dist/styles.css
CHANGED
|
@@ -2559,7 +2559,8 @@ min-height: 20px;
|
|
|
2559
2559
|
.laji-form .col-lg-1, .laji-form .col-lg-10, .laji-form .col-lg-11, .laji-form .col-lg-12, .laji-form .col-lg-2, .laji-form .col-lg-3, .laji-form .col-lg-4, .laji-form .col-lg-5, .laji-form .col-lg-6, .laji-form .col-lg-7, .laji-form .col-lg-8, .laji-form .col-lg-9,
|
|
2560
2560
|
.laji-form .col-md-1, .laji-form .col-md-10, .laji-form .col-md-11, .laji-form .col-md-12, .laji-form .col-md-2, .laji-form .col-md-3, .laji-form .col-md-4, .laji-form .col-md-5, .laji-form .col-md-6, .laji-form .col-md-7, .laji-form .col-md-8, .laji-form .col-md-9,
|
|
2561
2561
|
.laji-form .col-sm-1, .laji-form .col-sm-10, .laji-form .col-sm-11, .laji-form .col-sm-12, .laji-form .col-sm-2, .laji-form .col-sm-3, .laji-form .col-sm-4, .laji-form .col-sm-5, .laji-form .col-sm-6, .laji-form .col-sm-7, .laji-form .col-sm-8, .laji-form .col-sm-9,
|
|
2562
|
-
.laji-form .col-xs-1, .laji-form .col-xs-10, .laji-form .col-xs-11, .laji-form .col-xs-12, .laji-form .col-xs-2, .laji-form .col-xs-3, .laji-form .col-xs-4, .laji-form .col-xs-5, .laji-form .col-xs-6, .laji-form .col-xs-7, .laji-form .col-xs-8, .laji-form .col-xs-9
|
|
2562
|
+
.laji-form .col-xs-1, .laji-form .col-xs-10, .laji-form .col-xs-11, .laji-form .col-xs-12, .laji-form .col-xs-2, .laji-form .col-xs-3, .laji-form .col-xs-4, .laji-form .col-xs-5, .laji-form .col-xs-6, .laji-form .col-xs-7, .laji-form .col-xs-8, .laji-form .col-xs-9,
|
|
2563
|
+
.laji-form .col-1, .laji-form .col-10, .laji-form .col-11, .laji-form .col-12, .laji-form .col-2, .laji-form .col-3, .laji-form .col-4, .laji-form .col-5, .laji-form .col-6, .laji-form .col-7, .laji-form .col-8, .laji-form .col-9 {
|
|
2563
2564
|
padding-right:3px;
|
|
2564
2565
|
padding-left:3px;
|
|
2565
2566
|
}
|
|
@@ -101,6 +101,8 @@ const fields = importLocalComponents("fields", [
|
|
|
101
101
|
"SortArrayField",
|
|
102
102
|
"InputWithDefaultValueButtonField",
|
|
103
103
|
"MultiTagArrayField",
|
|
104
|
+
"PdfArrayField",
|
|
105
|
+
"AsArrayField",
|
|
104
106
|
{ "InputTransformerField": "ConditionalOnChangeField" },
|
|
105
107
|
{ "ConditionalField": "ConditionalUiSchemaField" },
|
|
106
108
|
{ "UnitRapidField": "UnitShorthandField" },
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as PropTypes from "prop-types";
|
|
3
|
+
import { FieldProps } from "../LajiForm";
|
|
4
|
+
export default class AsArrayField extends React.Component<FieldProps> {
|
|
5
|
+
static propTypes: {
|
|
6
|
+
schema: PropTypes.Validator<PropTypes.InferProps<{
|
|
7
|
+
type: PropTypes.Requireable<string>;
|
|
8
|
+
}>>;
|
|
9
|
+
formData: PropTypes.Requireable<string | number | boolean | object>;
|
|
10
|
+
};
|
|
11
|
+
static getName(): string;
|
|
12
|
+
getStateFromProps(props: FieldProps): {
|
|
13
|
+
formData: any[];
|
|
14
|
+
schema: {
|
|
15
|
+
title: any;
|
|
16
|
+
type: string;
|
|
17
|
+
items: any;
|
|
18
|
+
maxItems: number;
|
|
19
|
+
};
|
|
20
|
+
onChange: (formData: any[]) => void;
|
|
21
|
+
uiSchema: any;
|
|
22
|
+
errorSchema: any;
|
|
23
|
+
formContext: import("../LajiForm").FormContext;
|
|
24
|
+
idSchema: import("@rjsf/utils").IdSchema<any>;
|
|
25
|
+
onBlur: (id: string, value: any) => void;
|
|
26
|
+
onFocus: (id: string, value: any) => void;
|
|
27
|
+
autofocus?: boolean | undefined;
|
|
28
|
+
disabled: boolean;
|
|
29
|
+
hideError?: boolean | undefined;
|
|
30
|
+
readonly: boolean;
|
|
31
|
+
required?: boolean | undefined;
|
|
32
|
+
name: string;
|
|
33
|
+
idPrefix?: string | undefined;
|
|
34
|
+
idSeparator?: string | undefined;
|
|
35
|
+
rawErrors?: string[] | undefined;
|
|
36
|
+
registry: import("@rjsf/utils").Registry<any, any, import("../LajiForm").FormContext>;
|
|
37
|
+
hidden?: boolean | undefined;
|
|
38
|
+
dir?: string | undefined;
|
|
39
|
+
slot?: string | undefined;
|
|
40
|
+
style?: React.CSSProperties | undefined;
|
|
41
|
+
title?: string | undefined;
|
|
42
|
+
color?: string | undefined;
|
|
43
|
+
translate?: "yes" | "no" | undefined;
|
|
44
|
+
prefix?: string | undefined;
|
|
45
|
+
children?: React.ReactNode;
|
|
46
|
+
id?: string | undefined;
|
|
47
|
+
defaultChecked?: boolean | undefined;
|
|
48
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
49
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
50
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
51
|
+
accessKey?: string | undefined;
|
|
52
|
+
className?: string | undefined;
|
|
53
|
+
contentEditable?: "inherit" | (boolean | "false" | "true") | undefined;
|
|
54
|
+
contextMenu?: string | undefined;
|
|
55
|
+
draggable?: (boolean | "false" | "true") | undefined;
|
|
56
|
+
lang?: string | undefined;
|
|
57
|
+
placeholder?: string | undefined;
|
|
58
|
+
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
59
|
+
tabIndex?: number | undefined;
|
|
60
|
+
radioGroup?: string | undefined;
|
|
61
|
+
role?: React.AriaRole | undefined;
|
|
62
|
+
about?: string | undefined;
|
|
63
|
+
datatype?: string | undefined;
|
|
64
|
+
inlist?: any;
|
|
65
|
+
property?: string | undefined;
|
|
66
|
+
resource?: string | undefined;
|
|
67
|
+
typeof?: string | undefined;
|
|
68
|
+
vocab?: string | undefined;
|
|
69
|
+
autoCapitalize?: string | undefined;
|
|
70
|
+
autoCorrect?: string | undefined;
|
|
71
|
+
autoSave?: string | undefined;
|
|
72
|
+
itemProp?: string | undefined;
|
|
73
|
+
itemScope?: boolean | undefined;
|
|
74
|
+
itemType?: string | undefined;
|
|
75
|
+
itemID?: string | undefined;
|
|
76
|
+
itemRef?: string | undefined;
|
|
77
|
+
results?: number | undefined;
|
|
78
|
+
security?: string | undefined;
|
|
79
|
+
unselectable?: "on" | "off" | undefined;
|
|
80
|
+
inputMode?: "search" | "numeric" | "none" | "text" | "tel" | "url" | "email" | "decimal" | undefined;
|
|
81
|
+
is?: string | undefined;
|
|
82
|
+
'aria-activedescendant'?: string | undefined;
|
|
83
|
+
'aria-atomic'?: boolean | "false" | "true" | undefined;
|
|
84
|
+
'aria-autocomplete'?: "both" | "none" | "inline" | "list" | undefined;
|
|
85
|
+
'aria-busy'?: boolean | "false" | "true" | undefined;
|
|
86
|
+
'aria-checked'?: boolean | "mixed" | "false" | "true" | undefined;
|
|
87
|
+
'aria-colcount'?: number | undefined;
|
|
88
|
+
'aria-colindex'?: number | undefined;
|
|
89
|
+
'aria-colspan'?: number | undefined;
|
|
90
|
+
'aria-controls'?: string | undefined;
|
|
91
|
+
'aria-current'?: boolean | "time" | "page" | "false" | "true" | "step" | "location" | "date" | undefined;
|
|
92
|
+
'aria-describedby'?: string | undefined;
|
|
93
|
+
'aria-details'?: string | undefined;
|
|
94
|
+
'aria-disabled'?: boolean | "false" | "true" | undefined;
|
|
95
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
|
|
96
|
+
'aria-errormessage'?: string | undefined;
|
|
97
|
+
'aria-expanded'?: boolean | "false" | "true" | undefined;
|
|
98
|
+
'aria-flowto'?: string | undefined;
|
|
99
|
+
'aria-grabbed'?: boolean | "false" | "true" | undefined;
|
|
100
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "listbox" | "grid" | "false" | "true" | "tree" | undefined;
|
|
101
|
+
'aria-hidden'?: boolean | "false" | "true" | undefined;
|
|
102
|
+
'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
103
|
+
'aria-keyshortcuts'?: string | undefined;
|
|
104
|
+
'aria-label'?: string | undefined;
|
|
105
|
+
'aria-labelledby'?: string | undefined;
|
|
106
|
+
'aria-level'?: number | undefined;
|
|
107
|
+
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
108
|
+
'aria-modal'?: boolean | "false" | "true" | undefined;
|
|
109
|
+
'aria-multiline'?: boolean | "false" | "true" | undefined;
|
|
110
|
+
'aria-multiselectable'?: boolean | "false" | "true" | undefined;
|
|
111
|
+
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
|
112
|
+
'aria-owns'?: string | undefined;
|
|
113
|
+
'aria-placeholder'?: string | undefined;
|
|
114
|
+
'aria-posinset'?: number | undefined;
|
|
115
|
+
'aria-pressed'?: boolean | "mixed" | "false" | "true" | undefined;
|
|
116
|
+
'aria-readonly'?: boolean | "false" | "true" | undefined;
|
|
117
|
+
'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
118
|
+
'aria-required'?: boolean | "false" | "true" | undefined;
|
|
119
|
+
'aria-roledescription'?: string | undefined;
|
|
120
|
+
'aria-rowcount'?: number | undefined;
|
|
121
|
+
'aria-rowindex'?: number | undefined;
|
|
122
|
+
'aria-rowspan'?: number | undefined;
|
|
123
|
+
'aria-selected'?: boolean | "false" | "true" | undefined;
|
|
124
|
+
'aria-setsize'?: number | undefined;
|
|
125
|
+
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
126
|
+
'aria-valuemax'?: number | undefined;
|
|
127
|
+
'aria-valuemin'?: number | undefined;
|
|
128
|
+
'aria-valuenow'?: number | undefined;
|
|
129
|
+
'aria-valuetext'?: string | undefined;
|
|
130
|
+
dangerouslySetInnerHTML?: {
|
|
131
|
+
__html: string;
|
|
132
|
+
} | undefined;
|
|
133
|
+
onCopy?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
134
|
+
onCopyCapture?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
135
|
+
onCut?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
136
|
+
onCutCapture?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
137
|
+
onPaste?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
138
|
+
onPasteCapture?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
139
|
+
onCompositionEnd?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
140
|
+
onCompositionEndCapture?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
141
|
+
onCompositionStart?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
142
|
+
onCompositionStartCapture?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
143
|
+
onCompositionUpdate?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
144
|
+
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
145
|
+
onFocusCapture?: React.FocusEventHandler<HTMLElement> | undefined;
|
|
146
|
+
onBlurCapture?: React.FocusEventHandler<HTMLElement> | undefined;
|
|
147
|
+
onChangeCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
148
|
+
onBeforeInput?: React.FormEventHandler<HTMLElement> | undefined;
|
|
149
|
+
onBeforeInputCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
150
|
+
onInput?: React.FormEventHandler<HTMLElement> | undefined;
|
|
151
|
+
onInputCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
152
|
+
onReset?: React.FormEventHandler<HTMLElement> | undefined;
|
|
153
|
+
onResetCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
154
|
+
onSubmit?: React.FormEventHandler<HTMLElement> | undefined;
|
|
155
|
+
onSubmitCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
156
|
+
onInvalid?: React.FormEventHandler<HTMLElement> | undefined;
|
|
157
|
+
onInvalidCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
158
|
+
onLoad?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
159
|
+
onLoadCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
160
|
+
onError?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
161
|
+
onErrorCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
162
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
163
|
+
onKeyDownCapture?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
164
|
+
onKeyPress?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
165
|
+
onKeyPressCapture?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
166
|
+
onKeyUp?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
167
|
+
onKeyUpCapture?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
168
|
+
onAbort?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
169
|
+
onAbortCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
170
|
+
onCanPlay?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
171
|
+
onCanPlayCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
172
|
+
onCanPlayThrough?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
173
|
+
onCanPlayThroughCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
174
|
+
onDurationChange?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
175
|
+
onDurationChangeCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
176
|
+
onEmptied?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
177
|
+
onEmptiedCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
178
|
+
onEncrypted?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
179
|
+
onEncryptedCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
180
|
+
onEnded?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
181
|
+
onEndedCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
182
|
+
onLoadedData?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
183
|
+
onLoadedDataCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
184
|
+
onLoadedMetadata?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
185
|
+
onLoadedMetadataCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
186
|
+
onLoadStart?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
187
|
+
onLoadStartCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
188
|
+
onPause?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
189
|
+
onPauseCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
190
|
+
onPlay?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
191
|
+
onPlayCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
192
|
+
onPlaying?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
193
|
+
onPlayingCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
194
|
+
onProgress?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
195
|
+
onProgressCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
196
|
+
onRateChange?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
197
|
+
onRateChangeCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
198
|
+
onSeeked?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
199
|
+
onSeekedCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
200
|
+
onSeeking?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
201
|
+
onSeekingCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
202
|
+
onStalled?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
203
|
+
onStalledCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
204
|
+
onSuspend?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
205
|
+
onSuspendCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
206
|
+
onTimeUpdate?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
207
|
+
onTimeUpdateCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
208
|
+
onVolumeChange?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
209
|
+
onVolumeChangeCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
210
|
+
onWaiting?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
211
|
+
onWaitingCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
212
|
+
onAuxClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
213
|
+
onAuxClickCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
214
|
+
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
215
|
+
onClickCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
216
|
+
onContextMenu?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
217
|
+
onContextMenuCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
218
|
+
onDoubleClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
219
|
+
onDoubleClickCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
220
|
+
onDrag?: React.DragEventHandler<HTMLElement> | undefined;
|
|
221
|
+
onDragCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
222
|
+
onDragEnd?: React.DragEventHandler<HTMLElement> | undefined;
|
|
223
|
+
onDragEndCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
224
|
+
onDragEnter?: React.DragEventHandler<HTMLElement> | undefined;
|
|
225
|
+
onDragEnterCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
226
|
+
onDragExit?: React.DragEventHandler<HTMLElement> | undefined;
|
|
227
|
+
onDragExitCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
228
|
+
onDragLeave?: React.DragEventHandler<HTMLElement> | undefined;
|
|
229
|
+
onDragLeaveCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
230
|
+
onDragOver?: React.DragEventHandler<HTMLElement> | undefined;
|
|
231
|
+
onDragOverCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
232
|
+
onDragStart?: React.DragEventHandler<HTMLElement> | undefined;
|
|
233
|
+
onDragStartCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
234
|
+
onDrop?: React.DragEventHandler<HTMLElement> | undefined;
|
|
235
|
+
onDropCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
236
|
+
onMouseDown?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
237
|
+
onMouseDownCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
238
|
+
onMouseEnter?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
239
|
+
onMouseLeave?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
240
|
+
onMouseMove?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
241
|
+
onMouseMoveCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
242
|
+
onMouseOut?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
243
|
+
onMouseOutCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
244
|
+
onMouseOver?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
245
|
+
onMouseOverCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
246
|
+
onMouseUp?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
247
|
+
onMouseUpCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
248
|
+
onSelect?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
249
|
+
onSelectCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
250
|
+
onTouchCancel?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
251
|
+
onTouchCancelCapture?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
252
|
+
onTouchEnd?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
253
|
+
onTouchEndCapture?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
254
|
+
onTouchMove?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
255
|
+
onTouchMoveCapture?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
256
|
+
onTouchStart?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
257
|
+
onTouchStartCapture?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
258
|
+
onPointerDown?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
259
|
+
onPointerDownCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
260
|
+
onPointerMove?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
261
|
+
onPointerMoveCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
262
|
+
onPointerUp?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
263
|
+
onPointerUpCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
264
|
+
onPointerCancel?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
265
|
+
onPointerCancelCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
266
|
+
onPointerEnter?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
267
|
+
onPointerEnterCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
268
|
+
onPointerLeave?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
269
|
+
onPointerLeaveCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
270
|
+
onPointerOver?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
271
|
+
onPointerOverCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
272
|
+
onPointerOut?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
273
|
+
onPointerOutCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
274
|
+
onGotPointerCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
275
|
+
onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
276
|
+
onLostPointerCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
277
|
+
onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
278
|
+
onScroll?: React.UIEventHandler<HTMLElement> | undefined;
|
|
279
|
+
onScrollCapture?: React.UIEventHandler<HTMLElement> | undefined;
|
|
280
|
+
onWheel?: React.WheelEventHandler<HTMLElement> | undefined;
|
|
281
|
+
onWheelCapture?: React.WheelEventHandler<HTMLElement> | undefined;
|
|
282
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
283
|
+
onAnimationStartCapture?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
284
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
285
|
+
onAnimationEndCapture?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
286
|
+
onAnimationIteration?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
287
|
+
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
288
|
+
onTransitionEnd?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
289
|
+
onTransitionEndCapture?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
290
|
+
};
|
|
291
|
+
onChange: (formData: any[]) => void;
|
|
292
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const React = require("react");
|
|
10
|
+
const PropTypes = require("prop-types");
|
|
11
|
+
const VirtualSchemaField_1 = require("../VirtualSchemaField");
|
|
12
|
+
let AsArrayField = class AsArrayField extends React.Component {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.onChange = (formData) => {
|
|
16
|
+
this.props.onChange(formData === null || formData === void 0 ? void 0 : formData[0]);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
static getName() { return "AsArrayField"; }
|
|
20
|
+
getStateFromProps(props) {
|
|
21
|
+
var _a;
|
|
22
|
+
return Object.assign(Object.assign({}, props), { formData: ((_a = props.formData) === null || _a === void 0 ? void 0 : _a.length) ? [props.formData[0]] : [], schema: {
|
|
23
|
+
title: props.schema.title,
|
|
24
|
+
type: "array",
|
|
25
|
+
items: Object.assign(Object.assign({}, props.schema), { title: undefined }),
|
|
26
|
+
maxItems: 1
|
|
27
|
+
}, onChange: this.onChange });
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
AsArrayField.propTypes = {
|
|
31
|
+
schema: PropTypes.shape({
|
|
32
|
+
type: PropTypes.oneOf(["array", "object", "string", "integer", "number", "boolean"])
|
|
33
|
+
}).isRequired,
|
|
34
|
+
formData: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string, PropTypes.number, PropTypes.bool])
|
|
35
|
+
};
|
|
36
|
+
AsArrayField = __decorate([
|
|
37
|
+
VirtualSchemaField_1.default
|
|
38
|
+
], AsArrayField);
|
|
39
|
+
exports.default = AsArrayField;
|
|
@@ -34,7 +34,7 @@ export default class ImageArrayField extends React.Component<FieldProps, ImageAr
|
|
|
34
34
|
renderModalMedia: () => JSX.Element;
|
|
35
35
|
formatValue(value: string[], options: any, props: FieldProps): string | null;
|
|
36
36
|
}
|
|
37
|
-
interface MediaArrayState {
|
|
37
|
+
export interface MediaArrayState {
|
|
38
38
|
tmpMedias: number[];
|
|
39
39
|
addModal?: any;
|
|
40
40
|
dragging?: boolean;
|
|
@@ -150,4 +150,23 @@ export declare function MediaArrayField<LFC extends Constructor<React.Component<
|
|
|
150
150
|
};
|
|
151
151
|
displayName: string;
|
|
152
152
|
} & LFC;
|
|
153
|
+
interface ThumbnailProps {
|
|
154
|
+
id?: string;
|
|
155
|
+
apiClient: ApiClient;
|
|
156
|
+
apiEndpoint?: string;
|
|
157
|
+
dataURL?: string;
|
|
158
|
+
loading?: boolean;
|
|
159
|
+
}
|
|
160
|
+
interface ThumbnailState {
|
|
161
|
+
url?: string;
|
|
162
|
+
}
|
|
163
|
+
export declare class Thumbnail extends React.PureComponent<ThumbnailProps, ThumbnailState> {
|
|
164
|
+
mounted: boolean;
|
|
165
|
+
constructor(props: ThumbnailProps);
|
|
166
|
+
componentDidMount(): void;
|
|
167
|
+
componentWillUnmount(): void;
|
|
168
|
+
UNSAFE_componentWillReceiveProps(props: ThumbnailProps): void;
|
|
169
|
+
updateURL: ({ id, apiClient, apiEndpoint }: ThumbnailProps) => void;
|
|
170
|
+
render(): JSX.Element | null;
|
|
171
|
+
}
|
|
153
172
|
export {};
|
|
@@ -17,7 +17,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
17
17
|
return t;
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.MediaArrayField = void 0;
|
|
20
|
+
exports.Thumbnail = exports.MediaArrayField = void 0;
|
|
21
21
|
const React = require("react");
|
|
22
22
|
const PropTypes = require("prop-types");
|
|
23
23
|
const immutability_helper_1 = require("immutability-helper");
|
|
@@ -505,6 +505,8 @@ function MediaArrayField(ComposedComponent) {
|
|
|
505
505
|
const { dragging } = this.state;
|
|
506
506
|
const { Row, Col } = this.context.theme;
|
|
507
507
|
const { DescriptionFieldTemplate } = this.props.registry.templates;
|
|
508
|
+
const mediaCount = (this.props.formData || []).length + (this.state.tmpMedias || []).length;
|
|
509
|
+
const showAdd = utils_1.isNullOrUndefined(this.props.schema.maxItems) || mediaCount < this.props.schema.maxItems;
|
|
508
510
|
return (React.createElement(Row, null,
|
|
509
511
|
React.createElement(Col, { xs: 12 },
|
|
510
512
|
React.createElement(TitleFieldTemplate, { title: title, schema: schema, uiSchema: uiSchema, id: idSchema.$id, registry: this.props.registry }),
|
|
@@ -512,7 +514,7 @@ function MediaArrayField(ComposedComponent) {
|
|
|
512
514
|
React.createElement("div", { className: `laji-form-medias ${this.CONTAINER_CLASS}` },
|
|
513
515
|
this.renderMedias(),
|
|
514
516
|
this.renderLoadingMedias(),
|
|
515
|
-
React.createElement(OverlayTrigger, { overlay: tooltip },
|
|
517
|
+
showAdd && React.createElement(OverlayTrigger, { overlay: tooltip },
|
|
516
518
|
React.createElement(react_dropzone_1.default, { accept: this.ACCEPT_FILE_TYPES, onDragEnter: this.onDragEnter, onDragLeave: this.onDragLeave, onDrop: this.onDrop, disabled: readonly || disabled, noKeyboard: true }, ({ getRootProps, getInputProps }) => {
|
|
517
519
|
const _a = getRootProps(), { onClick: _onClick } = _a, rootProps = __rest(_a, ["onClick"]);
|
|
518
520
|
const onClick = addModal ? this.defaultOnClick : _onClick;
|
|
@@ -663,10 +665,10 @@ exports.MediaArrayField = MediaArrayField;
|
|
|
663
665
|
class Thumbnail extends React.PureComponent {
|
|
664
666
|
constructor(props) {
|
|
665
667
|
super(props);
|
|
666
|
-
this.updateURL = ({ id, apiClient }) => {
|
|
668
|
+
this.updateURL = ({ id, apiClient, apiEndpoint = "images" }) => {
|
|
667
669
|
if (!id)
|
|
668
670
|
return;
|
|
669
|
-
apiClient.fetchCached(
|
|
671
|
+
apiClient.fetchCached(`/${apiEndpoint}/${id}`, undefined, { failSilently: true }).then((response) => {
|
|
670
672
|
if (!this.mounted)
|
|
671
673
|
return;
|
|
672
674
|
this.setState({ url: response.squareThumbnailURL });
|
|
@@ -694,3 +696,4 @@ class Thumbnail extends React.PureComponent {
|
|
|
694
696
|
: img;
|
|
695
697
|
}
|
|
696
698
|
}
|
|
699
|
+
exports.Thumbnail = Thumbnail;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { FieldProps } from "../LajiForm";
|
|
3
|
+
import { MediaArrayState } from "./ImageArrayField";
|
|
4
|
+
export default class PdfArrayField extends React.Component<FieldProps, MediaArrayState> {
|
|
5
|
+
ALLOWED_FILE_TYPES: string[];
|
|
6
|
+
ACCEPT_FILE_TYPES: string[];
|
|
7
|
+
MAX_FILE_SIZE: number;
|
|
8
|
+
KEY: string;
|
|
9
|
+
ENDPOINT: string;
|
|
10
|
+
GLYPH: string;
|
|
11
|
+
TRANSLATION_TAKE_NEW: string;
|
|
12
|
+
TRANSLATION_SELECT_FILE: string;
|
|
13
|
+
TRANSLATION_NO_MEDIA: string;
|
|
14
|
+
CONTAINER_CLASS: string;
|
|
15
|
+
METADATA_FORM_ID: string;
|
|
16
|
+
renderMedia: (id: string) => JSX.Element;
|
|
17
|
+
renderLoadingMedia: (id: string) => JSX.Element;
|
|
18
|
+
onMediaClick: (i: number) => any;
|
|
19
|
+
renderModalMedia: () => JSX.Element;
|
|
20
|
+
formatValue(value: string[], options: any, props: FieldProps): string | null;
|
|
21
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const React = require("react");
|
|
10
|
+
const ImageArrayField_1 = require("./ImageArrayField");
|
|
11
|
+
let PdfArrayField = class PdfArrayField extends React.Component {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.ALLOWED_FILE_TYPES = ["application/pdf"];
|
|
15
|
+
this.ACCEPT_FILE_TYPES = ["application/pdf"];
|
|
16
|
+
this.MAX_FILE_SIZE = 20000000;
|
|
17
|
+
this.KEY = "PDF";
|
|
18
|
+
this.ENDPOINT = "pdf";
|
|
19
|
+
this.GLYPH = "paperclip";
|
|
20
|
+
this.TRANSLATION_TAKE_NEW = "";
|
|
21
|
+
this.TRANSLATION_SELECT_FILE = "";
|
|
22
|
+
this.TRANSLATION_NO_MEDIA = "";
|
|
23
|
+
this.CONTAINER_CLASS = "pdf-container";
|
|
24
|
+
this.METADATA_FORM_ID = "MHL.1070";
|
|
25
|
+
this.renderMedia = (id) => React.createElement(ImageArrayField_1.Thumbnail, { id: id, apiClient: this.props.formContext.apiClient, apiEndpoint: this.ENDPOINT });
|
|
26
|
+
this.renderLoadingMedia = (id) => React.createElement(ImageArrayField_1.Thumbnail, { dataURL: id, loading: true, apiClient: this.props.formContext.apiClient, apiEndpoint: this.ENDPOINT });
|
|
27
|
+
this.onMediaClick = (i) => this.openModalFor(i);
|
|
28
|
+
this.renderModalMedia = () => React.createElement("img", { src: this.state.modalMediaSrc });
|
|
29
|
+
}
|
|
30
|
+
formatValue(value, options, props) {
|
|
31
|
+
const { translations } = props.formContext;
|
|
32
|
+
return value && value.length
|
|
33
|
+
? `${value.length} ${translations.HowManyFiles}`
|
|
34
|
+
: null;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
PdfArrayField = __decorate([
|
|
38
|
+
ImageArrayField_1.MediaArrayField
|
|
39
|
+
], PdfArrayField);
|
|
40
|
+
exports.default = PdfArrayField;
|
|
@@ -244,7 +244,7 @@ function handlesArrayKeys(ComposedComponent) {
|
|
|
244
244
|
this.customEventListeners.forEach(params => customEvents.remove(props.idSchema.$id, ...params));
|
|
245
245
|
}
|
|
246
246
|
},
|
|
247
|
-
_a.displayName = utils_1.getReactComponentName(ComposedComponent),
|
|
247
|
+
_a.displayName = utils_1.getReactComponentName(ComposedComponent) + "_handlesArrayKeys",
|
|
248
248
|
_a;
|
|
249
249
|
}
|
|
250
250
|
exports.handlesArrayKeys = handlesArrayKeys;
|
|
@@ -17,10 +17,10 @@ const TitleField = ({ title, id, formData, style, uiSchema = {}, registry = {} }
|
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
19
|
const helpComponent = help ? React.createElement(components_1.Help, null) : null;
|
|
20
|
-
let titleTextContent =
|
|
20
|
+
let titleTextContent = React.createElement("span", null,
|
|
21
21
|
React.createElement("span", { dangerouslySetInnerHTML: { __html: title } }),
|
|
22
22
|
" ",
|
|
23
|
-
helpComponent)
|
|
23
|
+
helpComponent);
|
|
24
24
|
if (help) {
|
|
25
25
|
const tooltipElem = (React.createElement(Tooltip, { id: id + "-tooltip" },
|
|
26
26
|
React.createElement("span", null,
|
package/lib/themes/bs5.js
CHANGED
|
@@ -50,7 +50,7 @@ Panel.Collapse = React.forwardRef((_a, ref) => {
|
|
|
50
50
|
Panel.Footer = react_bootstrap_5_1.Card.Footer;
|
|
51
51
|
const Glyphicon = React.forwardRef((_a, ref) => {
|
|
52
52
|
var { glyph } = _a, props = __rest(_a, ["glyph"]);
|
|
53
|
-
return (React.createElement(react_fontawesome_1.FontAwesomeIcon, Object.assign({ icon: glyphicon_fa_mapping_1.mapping[glyph] }, props, { ref: ref })));
|
|
53
|
+
return (React.createElement(react_fontawesome_1.FontAwesomeIcon, Object.assign({ className: "glyphicon", icon: glyphicon_fa_mapping_1.mapping[glyph] }, props, { ref: ref })));
|
|
54
54
|
});
|
|
55
55
|
const _Modal = react_bootstrap_5_1.Modal;
|
|
56
56
|
const _InputGroup = react_bootstrap_5_1.InputGroup;
|
package/lib/translations.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luomus/laji-form",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.8",
|
|
4
4
|
"description": "React module capable of building dynamic forms from Laji form json schemas",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"test": "HOST=127.0.0.1 PORT=8083 protractor protractor.conf.js",
|
|
19
19
|
"test:multi": "TEST_BROWSER=multi HOST=127.0.0.1 PORT=8083 protractor protractor.conf.js",
|
|
20
20
|
"test:ffox": "TEST_BROWSER=firefox HOST=127.0.0.1 PORT=8083 protractor protractor.conf.js",
|
|
21
|
-
"test:debug": "HOST=127.0.0.1 PORT=8083 HEADLESS=false node --inspect-brk node_modules/protractor/bin/protractor protractor.conf.js"
|
|
21
|
+
"test:debug": "HOST=127.0.0.1 PORT=8083 HEADLESS=false node --inspect-brk node_modules/protractor/bin/protractor protractor.conf.js",
|
|
22
|
+
"patch": "patch-package"
|
|
22
23
|
},
|
|
23
24
|
"keywords": [
|
|
24
25
|
"react-jsonschema-form",
|
|
@@ -69,6 +70,7 @@
|
|
|
69
70
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
70
71
|
"mini-css-extract-plugin": "^2.1.0",
|
|
71
72
|
"notus": "^0.3.2",
|
|
73
|
+
"patch-package": "^8.0.0",
|
|
72
74
|
"protractor": "^7.0.0",
|
|
73
75
|
"protractor-console-plugin": "^0.1.1",
|
|
74
76
|
"querystring": "^0.2.1",
|
|
Binary file
|
|
Binary file
|
package/llol
DELETED