@luomus/laji-form 14.3.8 → 15.0.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/cypress/fixtures/example.json +5 -0
  3. closes suggestion list (failed).png +0 -0
  4. is marked as suggested (failed).png +0 -0
  5. package/dist/laji-form.js +1 -1
  6. package/lib/components/LajiForm.js +0 -1
  7. package/lib/components/fields/ImageArrayField.js +2 -4
  8. package/lib/components/fields/NamedPlaceSaverField.js +1 -1
  9. package/lib/components/fields/SectionArrayField.js +5 -1
  10. package/lib/components/fields/SingleActiveArrayField.js +1 -1
  11. package/lib/components/fields/UnitShorthandField.js +2 -2
  12. package/lib/components/templates/ArrayFieldTemplate.js +3 -2
  13. package/lib/components/templates/FieldTemplate.js +2 -2
  14. package/lib/utils.d.ts +6 -2
  15. package/lib/utils.js +13 -13
  16. package/llol +10 -0
  17. package/llol.pdf +10 -0
  18. package/migrate.sh +33 -0
  19. package/package.json +14 -21
  20. package/playwright-report/index.html +62 -0
  21. package/playwright.config.ts +77 -0
  22. package/q +196 -0
  23. package/rename.sh +24 -0
  24. package/test-export/test-utils.d.ts +176 -150
  25. package/test-export/test-utils.js +210 -218
  26. package/trip-report.spec.ts +594 -0
  27. package/tsconfig.test.json +1 -1
  28. package/lib/components/fields/AsArrayField.d.ts +0 -292
  29. package/lib/components/fields/AsArrayField.js +0 -39
  30. package/test-export/array-spec.d.ts +0 -1
  31. package/test-export/array-spec.js +0 -204
  32. package/test-export/bird-point-count-spec.d.ts +0 -1
  33. package/test-export/bird-point-count-spec.js +0 -62
  34. package/test-export/collection-contest-form-spec.d.ts +0 -1
  35. package/test-export/collection-contest-form-spec.js +0 -38
  36. package/test-export/dataset-form-spec.d.ts +0 -1
  37. package/test-export/dataset-form-spec.js +0 -50
  38. package/test-export/date-time-widget-spec.d.ts +0 -1
  39. package/test-export/date-time-widget-spec.js +0 -188
  40. package/test-export/geocoder-spec.d.ts +0 -1
  41. package/test-export/geocoder-spec.js +0 -135
  42. package/test-export/image-array-spec.d.ts +0 -1
  43. package/test-export/image-array-spec.js +0 -94
  44. package/test-export/inject-field-spec.d.ts +0 -1
  45. package/test-export/inject-field-spec.js +0 -148
  46. package/test-export/internal-uuids-spec.d.ts +0 -1
  47. package/test-export/internal-uuids-spec.js +0 -157
  48. package/test-export/invasive-species-eradication-np-spec.d.ts +0 -1
  49. package/test-export/invasive-species-eradication-np-spec.js +0 -18
  50. package/test-export/invasive-species-eradication-spec.d.ts +0 -1
  51. package/test-export/invasive-species-eradication-spec.js +0 -25
  52. package/test-export/line-transect-spec.d.ts +0 -1
  53. package/test-export/line-transect-spec.js +0 -121
  54. package/test-export/mobile-form-spec.d.ts +0 -1
  55. package/test-export/mobile-form-spec.js +0 -84
  56. package/test-export/nafi-spec.d.ts +0 -1
  57. package/test-export/nafi-spec.js +0 -85
  58. package/test-export/select-widget-spec.d.ts +0 -1
  59. package/test-export/select-widget-spec.js +0 -68
  60. package/test-export/single-item-array-field-spec.d.ts +0 -1
  61. package/test-export/single-item-array-field-spec.js +0 -92
  62. package/test-export/syke-butterfly-spec.d.ts +0 -1
  63. package/test-export/syke-butterfly-spec.js +0 -163
  64. package/test-export/transaction-form-spec.d.ts +0 -1
  65. package/test-export/transaction-form-spec.js +0 -63
  66. package/test-export/trip-report-autosuggest-spec.d.ts +0 -1
  67. package/test-export/trip-report-autosuggest-spec.js +0 -272
  68. package/test-export/trip-report-spec.d.ts +0 -1
  69. package/test-export/trip-report-spec.js +0 -456
  70. package/test-export/unit-list-shorthand-array-field-spec.d.ts +0 -1
  71. package/test-export/unit-list-shorthand-array-field-spec.js +0 -71
  72. package/test-export/validation-spec.d.ts +0 -1
  73. package/test-export/validation-spec.js +0 -336
  74. package/test-export/water-bird-spec.d.ts +0 -1
  75. package/test-export/water-bird-spec.js +0 -30
  76. package/test-export/wbc-spec.d.ts +0 -1
  77. package/test-export/wbc-spec.js +0 -82
@@ -1,292 +0,0 @@
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
- }
@@ -1,39 +0,0 @@
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;
@@ -1 +0,0 @@
1
- export {};
@@ -1,204 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const test_utils_1 = require("./test-utils");
13
- const protractor_1 = require("protractor");
14
- describe("Array", () => {
15
- let form;
16
- describe("copy button", () => {
17
- const uiSchemaForCopy = (type, filter) => ({
18
- "ui:options": {
19
- "buttons": [{
20
- fn: "copy", type, filter
21
- }]
22
- }
23
- });
24
- beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
25
- form = yield test_utils_1.createForm();
26
- }));
27
- describe("nested object", () => {
28
- const schema = {
29
- type: "array",
30
- items: {
31
- type: "object",
32
- properties: {
33
- a: { type: "string" },
34
- b: { type: "string" },
35
- 1: {
36
- type: "object",
37
- properties: {
38
- a: { type: "string" },
39
- b: { type: "string" },
40
- 2: {
41
- type: "object",
42
- properties: {
43
- a: { type: "string" },
44
- b: { type: "string" },
45
- default: { type: "string", default: "default" },
46
- 3: {
47
- type: "object",
48
- properties: {
49
- a: { type: "string" },
50
- b: { type: "string" },
51
- default: { type: "string", default: "default" },
52
- }
53
- }
54
- }
55
- }
56
- }
57
- }
58
- }
59
- }
60
- };
61
- const allButDefaultFilled = [{
62
- a: "foo",
63
- b: "foo",
64
- 1: {
65
- a: "foo",
66
- b: "foo",
67
- 2: {
68
- a: "foo",
69
- b: "foo",
70
- 3: {
71
- a: "foo",
72
- b: "foo",
73
- }
74
- }
75
- }
76
- }];
77
- it("works with whitelist", () => __awaiter(void 0, void 0, void 0, function* () {
78
- yield form.setState({ schema, formData: allButDefaultFilled, uiSchema: uiSchemaForCopy("whitelist", ["a", "/1/a", "/1/2/a"]) });
79
- yield form.$locateButton("", "copy").click();
80
- expect((yield form.getChangedData())[1]).toEqual({
81
- a: "foo",
82
- 1: {
83
- a: "foo",
84
- 2: {
85
- a: "foo",
86
- default: "default",
87
- 3: {
88
- default: "default"
89
- }
90
- }
91
- }
92
- });
93
- }));
94
- it("works with blacklist", () => __awaiter(void 0, void 0, void 0, function* () {
95
- yield form.setState({ schema, formData: allButDefaultFilled, uiSchema: uiSchemaForCopy("blacklist", ["a", "/1/a", "/1/2/a"]) });
96
- yield form.$locateButton("", "copy").click();
97
- expect((yield form.getChangedData())[1]).toEqual({
98
- a: null,
99
- b: "foo",
100
- 1: {
101
- a: null,
102
- b: "foo",
103
- 2: {
104
- a: null,
105
- b: "foo",
106
- default: "default",
107
- 3: {
108
- a: "foo",
109
- b: "foo",
110
- default: "default"
111
- }
112
- }
113
- }
114
- });
115
- }));
116
- });
117
- describe("copying form nonexisting array item", () => {
118
- const schema = {
119
- type: "array",
120
- items: {
121
- type: "object",
122
- properties: {
123
- arr: {
124
- type: "array",
125
- items: {
126
- type: "object",
127
- properties: {
128
- a: { type: "string" },
129
- b: { type: "string" },
130
- default: { type: "string", default: "default" }
131
- }
132
- }
133
- }
134
- }
135
- }
136
- };
137
- const formData = [{
138
- arr: [{
139
- a: "foo",
140
- b: "foo"
141
- }]
142
- }];
143
- it("works with whitelist", () => __awaiter(void 0, void 0, void 0, function* () {
144
- yield form.setState({ schema, formData, uiSchema: uiSchemaForCopy("whitelist", ["/arr/0/a", "/arr/1/b"]) });
145
- yield form.$locateButton("", "copy").click();
146
- expect((yield form.getChangedData())[1]).toEqual({
147
- arr: [
148
- {
149
- a: "foo",
150
- default: "default"
151
- },
152
- {
153
- b: null,
154
- default: "default"
155
- }
156
- ]
157
- });
158
- }));
159
- it("works with blacklist", () => __awaiter(void 0, void 0, void 0, function* () {
160
- yield form.setState({ schema, formData, uiSchema: uiSchemaForCopy("blacklist", ["/arr/0/a", "/arr/1/b"]) });
161
- yield form.$locateButton("", "copy").click();
162
- expect((yield form.getChangedData())[1]).toEqual({
163
- arr: [
164
- {
165
- a: null,
166
- b: "foo",
167
- default: "default"
168
- },
169
- {
170
- b: null,
171
- default: "default"
172
- }
173
- ]
174
- });
175
- }));
176
- });
177
- });
178
- describe("keyboard shortcut", () => {
179
- let form;
180
- beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
181
- const shortcuts = { "alt+i": { fn: "insert" } };
182
- const props = { schema: { type: "array", items: { type: "string" } }, uiSchema: { "ui:shortcuts": shortcuts } };
183
- form = yield test_utils_1.createForm(props);
184
- }));
185
- afterEach(() => __awaiter(void 0, void 0, void 0, function* () {
186
- yield form.setState({ formData: [] });
187
- }));
188
- describe("insert", () => {
189
- it("works", () => __awaiter(void 0, void 0, void 0, function* () {
190
- yield form.$locateButton("", "add").click();
191
- expect(yield form.$locate("0").isDisplayed()).toBe(true);
192
- yield protractor_1.browser.driver.switchTo().activeElement().sendKeys(protractor_1.protractor.Key.chord(protractor_1.protractor.Key.ALT, "i"));
193
- expect(yield form.$locate("1").isDisplayed()).toBe(true);
194
- }));
195
- it("keeps entered value", () => __awaiter(void 0, void 0, void 0, function* () {
196
- yield form.$locateButton("", "add").click();
197
- yield protractor_1.browser.driver.switchTo().activeElement().sendKeys("test");
198
- yield protractor_1.browser.driver.switchTo().activeElement().sendKeys(protractor_1.protractor.Key.chord(protractor_1.protractor.Key.ALT, "i"));
199
- expect(yield form.$locate("1").isDisplayed()).toBe(true);
200
- expect(yield form.$getInputWidget("0").getAttribute("value")).toBe("test");
201
- }));
202
- });
203
- });
204
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const test_utils_1 = require("./test-utils");
13
- const protractor_1 = require("protractor");
14
- describe("Bird point count (MHL.75)", () => {
15
- let form;
16
- let $addUnit;
17
- beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
18
- form = yield test_utils_1.createForm({ id: "MHL.75" });
19
- $addUnit = form.$locateButton("gatherings.0.units", "add");
20
- }));
21
- it("adds gathering", () => __awaiter(void 0, void 0, void 0, function* () {
22
- yield test_utils_1.putForeignMarkerToMap();
23
- expect(yield test_utils_1.isDisplayed(form.$locate("gatherings.0"))).toBe(true);
24
- }));
25
- it("adds unit", () => __awaiter(void 0, void 0, void 0, function* () {
26
- yield $addUnit.click();
27
- expect(yield test_utils_1.isDisplayed(form.$locate("gatherings.0.units.0"))).toBe(true);
28
- }));
29
- it("unit pair count doesn't lose value when typed and new unit entered by shortcut key", () => __awaiter(void 0, void 0, void 0, function* () {
30
- const text = "123";
31
- yield form.$getInputWidget("gatherings.0.units.0.unitFact.pairCountInner").sendKeys(text);
32
- yield protractor_1.browser.driver.switchTo().activeElement().sendKeys(protractor_1.protractor.Key.chord(protractor_1.protractor.Key.ALT, "u"));
33
- expect(yield form.$getInputWidget("gatherings.0.units.0.unitFact.pairCountInner").getAttribute("value")).toBe(text);
34
- // Cleanup
35
- yield form.$locateButton("gatherings.0.units.0", "delete").click();
36
- yield form.$locateButton("gatherings.0.units.0", "delete").click();
37
- }));
38
- it("when two units and 1st is removed, the autosuggest input value updated to the value of the 1st", () => __awaiter(void 0, void 0, void 0, function* () {
39
- const taxonAutosuggest1 = form.getTaxonAutosuggestWidget("gatherings.0.units.0.identifications.0.taxonVerbatim");
40
- const taxonAutosuggest2 = form.getTaxonAutosuggestWidget("gatherings.0.units.1.identifications.0.taxonVerbatim");
41
- const mockQueue = yield form.createMockResponseQueue("/autocomplete/taxon");
42
- const peippoMock = yield mockQueue.create();
43
- const mustarastasMock = yield mockQueue.create();
44
- yield $addUnit.click();
45
- yield test_utils_1.updateValue(taxonAutosuggest1.$input, "peippo");
46
- yield peippoMock.resolve([{
47
- key: "MX.36237",
48
- value: "peippo",
49
- }]);
50
- yield taxonAutosuggest1.waitForPopoverToHide();
51
- yield $addUnit.click();
52
- yield test_utils_1.updateValue(taxonAutosuggest2.$input, "mustarastas");
53
- yield mustarastasMock.resolve([{
54
- key: "MX.33106",
55
- value: "mustarastas",
56
- }]);
57
- yield taxonAutosuggest2.waitForPopoverToHide();
58
- yield mockQueue.remove();
59
- yield form.$locateButton("gatherings.0.units.0", "delete").click();
60
- expect(yield taxonAutosuggest1.$input.getAttribute("value")).toBe("mustarastas");
61
- }));
62
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,38 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const test_utils_1 = require("./test-utils");
13
- describe("Collection contest form (MHL.25)", () => {
14
- let form;
15
- describe("Without data", () => {
16
- beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
17
- form = yield test_utils_1.createForm({ id: "MHL.25" });
18
- }));
19
- it("adds observation", () => __awaiter(void 0, void 0, void 0, function* () {
20
- yield form.$locateButton("gatherings", "add").click();
21
- }));
22
- it("shows gathering date and hides unit date", () => __awaiter(void 0, void 0, void 0, function* () {
23
- expect(yield form.$locate("gatherings.0.dateBegin").isDisplayed()).toBe(true);
24
- expect(yield form.$locate("gatherings.0.units.0.unitGathering.dateBegin").isPresent()).toBe(false);
25
- }));
26
- describe("injected date field", () => {
27
- let dateWidget;
28
- it("is date widget", () => __awaiter(void 0, void 0, void 0, function* () {
29
- dateWidget = form.getDateWidget("gatherings.0.dateBegin");
30
- expect(yield dateWidget.$input.isDisplayed()).toBe(true);
31
- }));
32
- it("onChange works", () => __awaiter(void 0, void 0, void 0, function* () {
33
- yield dateWidget.buttons.$today.click();
34
- expect((yield dateWidget.$input.getAttribute("value")).length).not.toBe(0);
35
- }));
36
- });
37
- });
38
- });
@@ -1 +0,0 @@
1
- export {};