@object-ui/fields 17.3.0 → 17.6.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/CHANGELOG.md +1655 -0
- package/README.md +1 -12
- package/dist/FieldEditWidget.d.ts +23 -3
- package/dist/currency.d.ts +46 -0
- package/dist/field-type-alias.d.ts +35 -1
- package/dist/index.cjs +4 -4
- package/dist/index.css +651 -0
- package/dist/index.d.ts +474 -85
- package/dist/index.js +5418 -5023
- package/dist/widgets/AddressField.d.ts +4 -12
- package/dist/widgets/AutoNumberField.d.ts +1 -1
- package/dist/widgets/AvatarField.d.ts +1 -1
- package/dist/widgets/BooleanField.d.ts +1 -1
- package/dist/widgets/CapabilityMultiSelectField.d.ts +1 -1
- package/dist/widgets/CheckboxesField.d.ts +1 -1
- package/dist/widgets/CodeField.d.ts +1 -1
- package/dist/widgets/ColorField.d.ts +1 -1
- package/dist/widgets/CurrencyField.d.ts +1 -1
- package/dist/widgets/DateField.d.ts +1 -1
- package/dist/widgets/DateTimeField.d.ts +1 -1
- package/dist/widgets/EmailField.d.ts +1 -1
- package/dist/widgets/FileField.d.ts +18 -2
- package/dist/widgets/FilterConditionField.d.ts +28 -1
- package/dist/widgets/FormulaField.d.ts +1 -1
- package/dist/widgets/FullscreenFieldEditor.d.ts +49 -152
- package/dist/widgets/GeolocationField.d.ts +1 -1
- package/dist/widgets/GridField.d.ts +68 -6
- package/dist/widgets/ImageField.d.ts +1 -1
- package/dist/widgets/LocationField.d.ts +1 -1
- package/dist/widgets/LookupField.d.ts +1 -1
- package/dist/widgets/MasterDetailField.d.ts +1 -1
- package/dist/widgets/MultiSelectField.d.ts +1 -1
- package/dist/widgets/NumberField.d.ts +1 -1
- package/dist/widgets/ObjectField.d.ts +1 -1
- package/dist/widgets/ObjectRefField.d.ts +1 -1
- package/dist/widgets/OptionsEmptyState.d.ts +21 -1
- package/dist/widgets/PasswordField.d.ts +1 -1
- package/dist/widgets/PercentField.d.ts +1 -1
- package/dist/widgets/PhoneField.d.ts +1 -1
- package/dist/widgets/QRCodeField.d.ts +1 -1
- package/dist/widgets/RadioField.d.ts +1 -1
- package/dist/widgets/RatingField.d.ts +1 -1
- package/dist/widgets/RecipientPickerField.d.ts +1 -1
- package/dist/widgets/RecordPickerDialog.d.ts +34 -10
- package/dist/widgets/RichTextField.d.ts +37 -1
- package/dist/widgets/SelectField.d.ts +26 -6
- package/dist/widgets/SignatureField.d.ts +32 -2
- package/dist/widgets/SliderField.d.ts +37 -2
- package/dist/widgets/SummaryField.d.ts +1 -1
- package/dist/widgets/TagsField.d.ts +1 -1
- package/dist/widgets/TextAreaField.d.ts +6 -2
- package/dist/widgets/TextField.d.ts +1 -1
- package/dist/widgets/TimeField.d.ts +1 -1
- package/dist/widgets/UrlField.d.ts +1 -1
- package/dist/widgets/UserField.d.ts +1 -1
- package/dist/widgets/VectorField.d.ts +1 -1
- package/dist/widgets/_cell-renderer-bridge.d.ts +1 -1
- package/dist/widgets/address-format.d.ts +88 -0
- package/dist/widgets/file-size-guard.d.ts +41 -0
- package/dist/widgets/lookupColumnDisplay.d.ts +93 -0
- package/dist/widgets/nativeDateValue.d.ts +37 -0
- package/dist/widgets/richTextDisplay.d.ts +80 -0
- package/dist/widgets/toDomProps.d.ts +30 -10
- package/dist/widgets/toHostGroupProps.d.ts +189 -0
- package/dist/widgets/types.d.ts +8 -3
- package/dist/widgets/useRecordQuery.d.ts +7 -1
- package/package.json +17 -14
- package/dist/FieldEditWidget.test.d.ts +0 -8
- package/dist/__tests__/DateCellRenderer.test.d.ts +0 -0
- package/dist/__tests__/NumberCellRenderer.test.d.ts +0 -0
- package/dist/__tests__/cell-truncation.test.d.ts +0 -0
- package/dist/__tests__/field-carrier-sdui.test.d.ts +0 -0
- package/dist/__tests__/lookupCellDisplayField.test.d.ts +0 -0
- package/dist/__tests__/lookupCellDisplayName.test.d.ts +0 -0
- package/dist/__tests__/lookupCellReferenceKey.test.d.ts +0 -0
- package/dist/__tests__/registry-collision.test.d.ts +0 -0
- package/dist/__tests__/resolveFieldCurrency.test.d.ts +0 -1
- package/dist/__tests__/spec-symbol-batch7.test.d.ts +0 -8
- package/dist/__tests__/validation-feedback.test.d.ts +0 -0
- package/dist/__tests__/widget-aria-invalid-e2e.test.d.ts +0 -0
- package/dist/__tests__/widget-aria-invalid-registry-e2e.test.d.ts +0 -0
- package/dist/__tests__/widget-dom-leak-e2e.test.d.ts +0 -0
- package/dist/__tests__/widget-props-contract.test.d.ts +0 -8
- package/dist/coerce-safe-value.test.d.ts +0 -1
- package/dist/complex-widgets.test.d.ts +0 -1
- package/dist/datetime-widgets.test.d.ts +0 -1
- package/dist/field-type-coverage.test.d.ts +0 -1
- package/dist/standard-widgets.test.d.ts +0 -0
- package/dist/widgets/AddressField.uniqueIds.test.d.ts +0 -0
- package/dist/widgets/CapabilityMultiSelectField.test.d.ts +0 -0
- package/dist/widgets/CharacterCount.d.ts +0 -56
- package/dist/widgets/CheckboxesField.cascade.test.d.ts +0 -0
- package/dist/widgets/GeolocationField.uniqueIds.test.d.ts +0 -0
- package/dist/widgets/GridField.test.d.ts +0 -1
- package/dist/widgets/ImageLightbox.test.d.ts +0 -1
- package/dist/widgets/LookupField.dependsOn.test.d.ts +0 -8
- package/dist/widgets/LookupField.gateHintLabel.test.d.ts +0 -8
- package/dist/widgets/LookupField.hydration.test.d.ts +0 -1
- package/dist/widgets/LookupField.idField.test.d.ts +0 -1
- package/dist/widgets/MultiSelectField.cascade.test.d.ts +0 -0
- package/dist/widgets/OptionsEmptyState.no-provider.test.d.ts +0 -0
- package/dist/widgets/OptionsEmptyState.test.d.ts +0 -0
- package/dist/widgets/PeoplePicker.test.d.ts +0 -8
- package/dist/widgets/PeoplePickerComponents.test.d.ts +0 -8
- package/dist/widgets/RadioField.cascade.test.d.ts +0 -0
- package/dist/widgets/RecipientPickerField.test.d.ts +0 -0
- package/dist/widgets/RecordPickerDialog.filterOptions.test.d.ts +0 -8
- package/dist/widgets/RecordPickerDialog.selectLabel.test.d.ts +0 -8
- package/dist/widgets/SelectField.cascade.test.d.ts +0 -0
- package/dist/widgets/TagsField.placeholder.no-provider.test.d.ts +0 -0
- package/dist/widgets/TagsField.placeholder.test.d.ts +0 -0
- package/dist/widgets/UserFieldPicker.test.d.ts +0 -8
- package/dist/widgets/__tests__/FilterConditionField.matchAll.test.d.ts +0 -8
- package/dist/widgets/__tests__/FilterConditionField.operators.test.d.ts +0 -8
- package/dist/widgets/__tests__/FullscreenFieldEditor.i18n.test.d.ts +0 -0
- package/dist/widgets/__tests__/FullscreenFieldEditor.no-provider.test.d.ts +0 -0
- package/dist/widgets/__tests__/RichTextField.fullscreenDisabled.test.d.ts +0 -0
- package/dist/widgets/__tests__/RichTextField.mobileFullscreen.test.d.ts +0 -0
- package/dist/widgets/__tests__/TextAreaField.characterCount.announcements.test.d.ts +0 -0
- package/dist/widgets/__tests__/TextAreaField.characterCount.i18n.test.d.ts +0 -0
- package/dist/widgets/__tests__/TextAreaField.characterCount.no-provider.test.d.ts +0 -0
- package/dist/widgets/__tests__/TextAreaField.fullscreenCharacterCount.i18n.test.d.ts +0 -0
- package/dist/widgets/__tests__/TextAreaField.fullscreenCharacterCount.test.d.ts +0 -0
- package/dist/widgets/__tests__/TextAreaField.fullscreenDisabled.test.d.ts +0 -0
- package/dist/widgets/__tests__/TextAreaField.mobileFullscreen.test.d.ts +0 -0
- package/dist/widgets/deriveLookupColumns.test.d.ts +0 -1
- package/dist/widgets/file-value.test.d.ts +0 -1
- package/dist/widgets/personDisplay.test.d.ts +0 -8
- package/dist/widgets/recentLookups.test.d.ts +0 -1
- package/dist/widgets/useRecordQuery.test.d.ts +0 -8
- package/dist/widgets/useUploadingSignal.test.d.ts +0 -1
- package/src/FieldEditWidget.test.ts +0 -133
- package/src/FieldEditWidget.tsx +0 -191
- package/src/__tests__/DateCellRenderer.test.tsx +0 -73
- package/src/__tests__/NumberCellRenderer.test.tsx +0 -60
- package/src/__tests__/cell-truncation.test.tsx +0 -96
- package/src/__tests__/field-carrier-sdui.test.tsx +0 -169
- package/src/__tests__/lookupCellDisplayField.test.tsx +0 -107
- package/src/__tests__/lookupCellDisplayName.test.tsx +0 -119
- package/src/__tests__/lookupCellReferenceKey.test.tsx +0 -57
- package/src/__tests__/registry-collision.test.ts +0 -91
- package/src/__tests__/resolveFieldCurrency.test.ts +0 -20
- package/src/__tests__/spec-symbol-batch7.test.ts +0 -126
- package/src/__tests__/validation-feedback.test.tsx +0 -361
- package/src/__tests__/widget-aria-invalid-e2e.test.tsx +0 -265
- package/src/__tests__/widget-aria-invalid-registry-e2e.test.tsx +0 -338
- package/src/__tests__/widget-dom-leak-e2e.test.tsx +0 -598
- package/src/__tests__/widget-props-contract.test.tsx +0 -142
- package/src/coerce-safe-value.test.ts +0 -34
- package/src/complex-widgets.test.tsx +0 -908
- package/src/currency.ts +0 -14
- package/src/datetime-widgets.test.tsx +0 -93
- package/src/field-type-alias.ts +0 -100
- package/src/field-type-coverage.test.ts +0 -67
- package/src/index.tsx +0 -2503
- package/src/standard-widgets.test.tsx +0 -357
- package/src/widgets/AddressField.tsx +0 -132
- package/src/widgets/AddressField.uniqueIds.test.tsx +0 -92
- package/src/widgets/AutoNumberField.tsx +0 -18
- package/src/widgets/AvatarField.tsx +0 -117
- package/src/widgets/BooleanField.tsx +0 -52
- package/src/widgets/CapabilityMultiSelectField.test.tsx +0 -168
- package/src/widgets/CapabilityMultiSelectField.tsx +0 -229
- package/src/widgets/CharacterCount.tsx +0 -263
- package/src/widgets/CheckboxesField.cascade.test.tsx +0 -143
- package/src/widgets/CheckboxesField.tsx +0 -136
- package/src/widgets/CodeField.tsx +0 -41
- package/src/widgets/ColorField.tsx +0 -53
- package/src/widgets/CurrencyField.tsx +0 -95
- package/src/widgets/DateField.tsx +0 -31
- package/src/widgets/DateTimeField.tsx +0 -37
- package/src/widgets/EmailField.tsx +0 -37
- package/src/widgets/FileField.tsx +0 -494
- package/src/widgets/FilterConditionField.tsx +0 -454
- package/src/widgets/FormulaField.tsx +0 -33
- package/src/widgets/FullscreenFieldEditor.tsx +0 -271
- package/src/widgets/GeolocationField.tsx +0 -167
- package/src/widgets/GeolocationField.uniqueIds.test.tsx +0 -88
- package/src/widgets/GridField.test.tsx +0 -406
- package/src/widgets/GridField.tsx +0 -966
- package/src/widgets/ImageCropperDialog.tsx +0 -245
- package/src/widgets/ImageField.tsx +0 -255
- package/src/widgets/ImageLightbox.test.tsx +0 -52
- package/src/widgets/ImageLightbox.tsx +0 -108
- package/src/widgets/LocationField.tsx +0 -57
- package/src/widgets/LookupField.dependsOn.test.tsx +0 -233
- package/src/widgets/LookupField.gateHintLabel.test.tsx +0 -135
- package/src/widgets/LookupField.hydration.test.tsx +0 -136
- package/src/widgets/LookupField.idField.test.tsx +0 -61
- package/src/widgets/LookupField.tsx +0 -1291
- package/src/widgets/MarkdownContent.tsx +0 -19
- package/src/widgets/MasterDetailField.tsx +0 -131
- package/src/widgets/MultiSelectField.cascade.test.tsx +0 -143
- package/src/widgets/MultiSelectField.tsx +0 -142
- package/src/widgets/NumberField.tsx +0 -49
- package/src/widgets/ObjectField.tsx +0 -94
- package/src/widgets/ObjectRefField.tsx +0 -121
- package/src/widgets/OptionsEmptyState.no-provider.test.tsx +0 -88
- package/src/widgets/OptionsEmptyState.test.tsx +0 -169
- package/src/widgets/OptionsEmptyState.tsx +0 -83
- package/src/widgets/PasswordField.tsx +0 -49
- package/src/widgets/PeoplePicker.test.tsx +0 -360
- package/src/widgets/PeoplePicker.tsx +0 -579
- package/src/widgets/PeoplePickerComponents.test.tsx +0 -104
- package/src/widgets/PercentField.tsx +0 -95
- package/src/widgets/PersonRow.tsx +0 -117
- package/src/widgets/PhoneField.tsx +0 -37
- package/src/widgets/QRCodeField.tsx +0 -103
- package/src/widgets/RadioField.cascade.test.tsx +0 -141
- package/src/widgets/RadioField.tsx +0 -111
- package/src/widgets/RatingField.tsx +0 -81
- package/src/widgets/RecipientPickerField.test.tsx +0 -157
- package/src/widgets/RecipientPickerField.tsx +0 -188
- package/src/widgets/RecordPickerDialog.filterOptions.test.tsx +0 -611
- package/src/widgets/RecordPickerDialog.selectLabel.test.tsx +0 -112
- package/src/widgets/RecordPickerDialog.tsx +0 -1316
- package/src/widgets/RichTextField.tsx +0 -176
- package/src/widgets/SelectField.cascade.test.tsx +0 -138
- package/src/widgets/SelectField.tsx +0 -162
- package/src/widgets/SelectionTray.tsx +0 -110
- package/src/widgets/SignatureField.tsx +0 -140
- package/src/widgets/SliderField.tsx +0 -39
- package/src/widgets/SummaryField.tsx +0 -31
- package/src/widgets/TagsField.placeholder.no-provider.test.tsx +0 -68
- package/src/widgets/TagsField.placeholder.test.tsx +0 -95
- package/src/widgets/TagsField.tsx +0 -88
- package/src/widgets/TextAreaField.tsx +0 -213
- package/src/widgets/TextField.tsx +0 -45
- package/src/widgets/TimeField.tsx +0 -31
- package/src/widgets/UrlField.tsx +0 -46
- package/src/widgets/UserField.tsx +0 -58
- package/src/widgets/UserFieldPicker.test.tsx +0 -78
- package/src/widgets/VectorField.tsx +0 -29
- package/src/widgets/__tests__/FilterConditionField.matchAll.test.ts +0 -66
- package/src/widgets/__tests__/FilterConditionField.operators.test.ts +0 -142
- package/src/widgets/__tests__/FullscreenFieldEditor.i18n.test.tsx +0 -248
- package/src/widgets/__tests__/FullscreenFieldEditor.no-provider.test.tsx +0 -116
- package/src/widgets/__tests__/RichTextField.fullscreenDisabled.test.tsx +0 -244
- package/src/widgets/__tests__/RichTextField.mobileFullscreen.test.tsx +0 -195
- package/src/widgets/__tests__/TextAreaField.characterCount.announcements.test.tsx +0 -417
- package/src/widgets/__tests__/TextAreaField.characterCount.i18n.test.tsx +0 -287
- package/src/widgets/__tests__/TextAreaField.characterCount.no-provider.test.tsx +0 -160
- package/src/widgets/__tests__/TextAreaField.fullscreenCharacterCount.i18n.test.tsx +0 -161
- package/src/widgets/__tests__/TextAreaField.fullscreenCharacterCount.test.tsx +0 -346
- package/src/widgets/__tests__/TextAreaField.fullscreenDisabled.test.tsx +0 -246
- package/src/widgets/__tests__/TextAreaField.mobileFullscreen.test.tsx +0 -175
- package/src/widgets/_cell-renderer-bridge.ts +0 -19
- package/src/widgets/deriveLookupColumns.test.ts +0 -112
- package/src/widgets/deriveLookupColumns.ts +0 -108
- package/src/widgets/file-value.test.ts +0 -230
- package/src/widgets/file-value.ts +0 -246
- package/src/widgets/openNativePicker.ts +0 -18
- package/src/widgets/personDisplay.test.ts +0 -113
- package/src/widgets/personDisplay.ts +0 -92
- package/src/widgets/recentLookups.test.ts +0 -45
- package/src/widgets/recentLookups.ts +0 -47
- package/src/widgets/toDomProps.ts +0 -175
- package/src/widgets/types.ts +0 -242
- package/src/widgets/useCascadingOptions.ts +0 -46
- package/src/widgets/useFieldTranslation.ts +0 -150
- package/src/widgets/useRecordQuery.test.ts +0 -174
- package/src/widgets/useRecordQuery.ts +0 -264
- package/src/widgets/useUploadingSignal.test.tsx +0 -62
- package/src/widgets/useUploadingSignal.ts +0 -20
- package/src/withFieldCarrier.tsx +0 -75
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import React, { useState } from 'react';
|
|
10
|
-
import {
|
|
11
|
-
cn,
|
|
12
|
-
Dialog,
|
|
13
|
-
DialogContent,
|
|
14
|
-
DialogDescription,
|
|
15
|
-
DialogHeader,
|
|
16
|
-
DialogTitle,
|
|
17
|
-
DialogFooter,
|
|
18
|
-
Button,
|
|
19
|
-
} from '@object-ui/components';
|
|
20
|
-
import { Maximize2, Check, X } from 'lucide-react';
|
|
21
|
-
import { useFieldTranslation } from './useFieldTranslation';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The fullscreen-edit affordance shared by every long-text widget: the "expand"
|
|
25
|
-
* button plus the full-height dialog it opens.
|
|
26
|
-
*
|
|
27
|
-
* ## Why this is shared rather than copied
|
|
28
|
-
*
|
|
29
|
-
* `ObjectFormSchema.mobile.fullscreenLongText` is ONE form-level promise, and
|
|
30
|
-
* `ObjectForm` projects it onto EVERY long-text field as `mobile_fullscreen`
|
|
31
|
-
* (`field:textarea` → `TextAreaField`, `field:markdown` / `field:html` →
|
|
32
|
-
* `RichTextField`). A user who turns the setting on gets one behaviour, so the
|
|
33
|
-
* behaviour has one implementation. objectui#3301 is what the other
|
|
34
|
-
* arrangement costs: the flag reached `RichTextField` for as long as the
|
|
35
|
-
* feature has existed and that widget simply never read it, so half the
|
|
36
|
-
* documented promise ("textarea/rich-text get an expand button") silently did
|
|
37
|
-
* nothing. A second hand-written copy of the state machine is the same failure
|
|
38
|
-
* with an extra step — it drifts, and nothing reports the drift.
|
|
39
|
-
*
|
|
40
|
-
* What is genuinely per-widget is the EDITOR, so that is the only thing
|
|
41
|
-
* injected: `children` renders it against the draft. Everything a user can
|
|
42
|
-
* observe about the *interaction* — when the affordance appears, that the
|
|
43
|
-
* dialog seeds from the committed value, that typing stays local until "Done",
|
|
44
|
-
* that "Cancel" discards — lives here, once.
|
|
45
|
-
*
|
|
46
|
-
* ## Draft semantics (unchanged from the original `TextAreaField` behaviour)
|
|
47
|
-
*
|
|
48
|
-
* The dialog edits a LOCAL draft seeded from `value` at open time and commits
|
|
49
|
-
* once, on "Done". It deliberately does not stream every keystroke to the host:
|
|
50
|
-
* these widgets sit in a react-hook-form field, and per-keystroke `onChange`
|
|
51
|
-
* during a modal edit would mark the form dirty (and fire validation) for an
|
|
52
|
-
* edit the user may still cancel. "Cancel" therefore needs no undo — nothing
|
|
53
|
-
* was written.
|
|
54
|
-
*
|
|
55
|
-
* ## `disabled` (objectui#3402)
|
|
56
|
-
*
|
|
57
|
-
* The dialog is a SECOND editing surface for the same value, so a field that is
|
|
58
|
-
* not interactive has to be not interactive here too. It was not: hosts landed
|
|
59
|
-
* `disabled` on their inline control only, this component never declared the
|
|
60
|
-
* prop at all, and a disabled long-text field therefore sat correctly greyed out
|
|
61
|
-
* next to a live expand button — click it, type anything, press "Done", and the
|
|
62
|
-
* edit went into form state through `onCommit`. Measured on `origin/main`
|
|
63
|
-
* before the fix: inline `disabled=true`, toggle `disabled=false`, dialog input
|
|
64
|
-
* `disabled=false`, `onChange` called with "EDITED WHILE DISABLED".
|
|
65
|
-
*
|
|
66
|
-
* The gate is shaped like the built-in path's (`FullscreenTextarea` in
|
|
67
|
-
* `components/src/renderers/form/form.tsx`, objectui#3400/PR #3401), because
|
|
68
|
-
* one form-level setting must keep producing one behaviour on both paths:
|
|
69
|
-
*
|
|
70
|
-
* - the toggle STAYS but is `disabled` — `disabled` means "not interactive,
|
|
71
|
-
* muted", not "shown plainly", which is `readonly`'s job (and `readonly`
|
|
72
|
-
* never reaches this component at all — see below);
|
|
73
|
-
* - `openFullscreen` refuses independently of the attribute, since a
|
|
74
|
-
* programmatic dispatch and a lost `pointer-events` rule both get past it;
|
|
75
|
-
* - the dialog locks on its OWN — `disabled` is not merely a static flag, it is
|
|
76
|
-
* also the form's `isSubmitting`, which flips to true while the dialog may
|
|
77
|
-
* already be open. At that moment the toggle is no longer the gate. So the
|
|
78
|
-
* editor is told (third `children` argument) and "Done" is disabled;
|
|
79
|
-
* - and `onCommit` is gated, because that is the single point where a value can
|
|
80
|
-
* leave this component for host state. Nothing native guards it: it is a
|
|
81
|
-
* click handler on a different control reading React state.
|
|
82
|
-
*
|
|
83
|
-
* "Cancel" and `Esc` stay live in every state — a dialog that goes disabled
|
|
84
|
-
* mid-edit must still be closable, or a submit in flight traps the user in it.
|
|
85
|
-
*
|
|
86
|
-
* ## Why there is no `readonly` prop
|
|
87
|
-
*
|
|
88
|
-
* Both hosts early-return a read-only DISPLAY before they compute the affordance
|
|
89
|
-
* (`TextAreaField.tsx`, `RichTextField.tsx`), so this component is never
|
|
90
|
-
* rendered for a read-only field and a `readonly` prop here would be declared
|
|
91
|
-
* with no producer — the shape this package keeps deleting (objectui#3232/#3233).
|
|
92
|
-
* A future host that renders an editor for read-only fields must add the prop
|
|
93
|
-
* AND the producer together; do not add it "for symmetry" beforehand.
|
|
94
|
-
*
|
|
95
|
-
* ## `testIdPrefix`
|
|
96
|
-
*
|
|
97
|
-
* Each host passes its own (`textarea`, `richtext`), yielding the same
|
|
98
|
-
* convention with a per-widget namespace: `<prefix>-fullscreen-toggle` /
|
|
99
|
-
* `-dialog` / `-save`. One form can contain both a textarea and a markdown
|
|
100
|
-
* field, so a single shared id would make a test unable to say which widget it
|
|
101
|
-
* had found. The editor's own test id belongs to `children` for the same
|
|
102
|
-
* reason.
|
|
103
|
-
*
|
|
104
|
-
* ## Copy (objectui#3404)
|
|
105
|
-
*
|
|
106
|
-
* Every string here goes through `useFieldTranslation()` and consumes the
|
|
107
|
-
* EXISTING `form.fullscreen.*` / `common.cancel` keys — the same ones the
|
|
108
|
-
* built-in branch consumes since objectui#3272. Nothing was missing from the
|
|
109
|
-
* ten locale packs; this path simply never read them, so a zh session opened a
|
|
110
|
-
* dialog reading `Cancel` / `Done` while a long-text field rendered by the
|
|
111
|
-
* built-in branch **in the same form** read 「取消 / 完成」.
|
|
112
|
-
*
|
|
113
|
-
* Sharing the keys rather than minting `fields.fullscreen.*` twins is the
|
|
114
|
-
* point: one form-level setting (`mobile.fullscreenLongText`) projects onto
|
|
115
|
-
* both render paths, so two copies of this copy could only drift.
|
|
116
|
-
*
|
|
117
|
-
* `useFieldTranslation` (not bare `useObjectTranslation`) because this widget
|
|
118
|
-
* is rendered without an `I18nProvider` by standalone/embedded hosts and by
|
|
119
|
-
* every bare-render test in this package. Measured before the change: with no
|
|
120
|
-
* provider mounted `useObjectTranslation().t('common.cancel')` returns
|
|
121
|
-
* `"common.cancel"` — the raw key — and the `{{label}}` interpolation collapses
|
|
122
|
-
* entirely. The safe hook's English defaults are byte-identical to the literals
|
|
123
|
-
* they replaced, so the provider-less rendering is unchanged.
|
|
124
|
-
*
|
|
125
|
-
* Focus management, `Esc`, the overlay and the close button are Radix's, via
|
|
126
|
-
* the repo's `Dialog` (`@object-ui/components`) — deliberately not re-answered
|
|
127
|
-
* here.
|
|
128
|
-
*/
|
|
129
|
-
export interface FullscreenFieldEditorProps {
|
|
130
|
-
/**
|
|
131
|
-
* The committed value. Seeds the draft each time the dialog opens — read at
|
|
132
|
-
* open time, not held, so a value that changes underneath while the dialog is
|
|
133
|
-
* closed is picked up on the next open.
|
|
134
|
-
*/
|
|
135
|
-
value: string;
|
|
136
|
-
/** Called once with the draft when the user confirms. */
|
|
137
|
-
onCommit: (next: string) => void;
|
|
138
|
-
/** Field label — the dialog title and part of the toggle's accessible name. */
|
|
139
|
-
label?: string;
|
|
140
|
-
/** Namespace for this widget's fullscreen test ids. See above. */
|
|
141
|
-
testIdPrefix: string;
|
|
142
|
-
/**
|
|
143
|
-
* The host field is not interactive (objectui#3402). Disables the toggle, the
|
|
144
|
-
* "Done" button and the write-back, and is handed to `children` so the host's
|
|
145
|
-
* own editor renders disabled too. See the `disabled` section above for why
|
|
146
|
-
* each of those is a separate line rather than belt-and-braces.
|
|
147
|
-
*
|
|
148
|
-
* **Producer**: the widget's `disabled` prop, which the form renderer computes
|
|
149
|
-
* as `disabled || fieldDisabled || isSubmitting || optionGroupGated` and
|
|
150
|
-
* forwards to registered widgets (`stripRegisteredFieldProps` does not strip
|
|
151
|
-
* it).
|
|
152
|
-
*/
|
|
153
|
-
disabled?: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* The editor itself, rendered inside the dialog body against the draft. The
|
|
156
|
-
* host passes the SAME editor it renders inline, so "fullscreen" is a size
|
|
157
|
-
* change rather than a second, poorer editing surface.
|
|
158
|
-
*
|
|
159
|
-
* The third argument is this component's `disabled`, and the host is expected
|
|
160
|
-
* to put it on the control it renders: only the host knows which element its
|
|
161
|
-
* editor's disabled state belongs on. Ignoring it is not a write-back hole —
|
|
162
|
-
* `onCommit` is gated here regardless — but it does leave a control that looks
|
|
163
|
-
* editable while the field is not, so both in-repo hosts apply it and their
|
|
164
|
-
* tests pin it.
|
|
165
|
-
*/
|
|
166
|
-
children: (
|
|
167
|
-
draft: string,
|
|
168
|
-
setDraft: (next: string) => void,
|
|
169
|
-
disabled: boolean,
|
|
170
|
-
) => React.ReactNode;
|
|
171
|
-
/** Optional footer status for the draft (e.g. a character counter). */
|
|
172
|
-
footer?: (draft: string) => React.ReactNode;
|
|
173
|
-
/**
|
|
174
|
-
* Extra classes for the toggle button. It is absolutely positioned by
|
|
175
|
-
* default and expects a `relative` ancestor; a host whose layout has a
|
|
176
|
-
* better home for it can re-place it here.
|
|
177
|
-
*/
|
|
178
|
-
toggleClassName?: string;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export function FullscreenFieldEditor({
|
|
182
|
-
value,
|
|
183
|
-
onCommit,
|
|
184
|
-
label,
|
|
185
|
-
testIdPrefix,
|
|
186
|
-
disabled = false,
|
|
187
|
-
children,
|
|
188
|
-
footer,
|
|
189
|
-
toggleClassName,
|
|
190
|
-
}: FullscreenFieldEditorProps) {
|
|
191
|
-
const { t } = useFieldTranslation();
|
|
192
|
-
const [open, setOpen] = useState(false);
|
|
193
|
-
const [draft, setDraft] = useState(value ?? '');
|
|
194
|
-
|
|
195
|
-
const openFullscreen = () => {
|
|
196
|
-
if (disabled) return;
|
|
197
|
-
setDraft(value ?? '');
|
|
198
|
-
setOpen(true);
|
|
199
|
-
};
|
|
200
|
-
const cancelFullscreen = () => setOpen(false);
|
|
201
|
-
const commitFullscreen = () => {
|
|
202
|
-
// THE gate: the one point where a value leaves this component for host
|
|
203
|
-
// state. `disabled` can flip to true while this dialog is open (it carries
|
|
204
|
-
// the form's `isSubmitting`), so this is checked here and not only on the
|
|
205
|
-
// way in. Closing is unconditional — see "Cancel and Esc stay live" above.
|
|
206
|
-
if (!disabled) onCommit(draft);
|
|
207
|
-
setOpen(false);
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
return (
|
|
211
|
-
<>
|
|
212
|
-
<button
|
|
213
|
-
type="button"
|
|
214
|
-
onClick={openFullscreen}
|
|
215
|
-
disabled={disabled}
|
|
216
|
-
className={cn(
|
|
217
|
-
'absolute top-1.5 right-1.5 inline-flex items-center justify-center size-7 rounded-md bg-background/80 text-muted-foreground hover:text-foreground hover:bg-background border shadow-sm transition-colors',
|
|
218
|
-
'disabled:opacity-50 disabled:pointer-events-none',
|
|
219
|
-
toggleClassName,
|
|
220
|
-
)}
|
|
221
|
-
aria-label={t('form.fullscreen.toggle', {
|
|
222
|
-
label: label ?? t('form.fullscreen.textFallback'),
|
|
223
|
-
})}
|
|
224
|
-
data-testid={`${testIdPrefix}-fullscreen-toggle`}
|
|
225
|
-
>
|
|
226
|
-
<Maximize2 className="size-3.5" />
|
|
227
|
-
</button>
|
|
228
|
-
|
|
229
|
-
<Dialog open={open} onOpenChange={setOpen}>
|
|
230
|
-
<DialogContent
|
|
231
|
-
className="sm:max-w-3xl h-[100dvh] sm:h-[80vh] max-h-[100dvh] sm:max-h-[80vh] flex flex-col p-0 gap-0"
|
|
232
|
-
data-testid={`${testIdPrefix}-fullscreen-dialog`}
|
|
233
|
-
>
|
|
234
|
-
<DialogHeader className="p-4 border-b">
|
|
235
|
-
<DialogTitle className="text-base">{label ?? t('form.fullscreen.title')}</DialogTitle>
|
|
236
|
-
{/*
|
|
237
|
-
Parity with the built-in branch (`form.tsx`), which has carried
|
|
238
|
-
this sr-only line since #3272. Without it Radix reports no
|
|
239
|
-
`descriptionPresent` and omits `aria-describedby` altogether, so
|
|
240
|
-
the registered path's dialog had no accessible description while
|
|
241
|
-
the identical built-in one did — and `form.fullscreen.description`
|
|
242
|
-
was a key with no consumer here. (The missing-Description console
|
|
243
|
-
warning older Radix versions emitted is NOT why: @radix-ui/react-dialog
|
|
244
|
-
1.1.23 contains no `console.*` call at all, verified before adding this.)
|
|
245
|
-
*/}
|
|
246
|
-
<DialogDescription className="sr-only">
|
|
247
|
-
{t('form.fullscreen.description')}
|
|
248
|
-
</DialogDescription>
|
|
249
|
-
</DialogHeader>
|
|
250
|
-
<div className="flex-1 min-h-0 p-4">{children(draft, setDraft, disabled)}</div>
|
|
251
|
-
<DialogFooter className="p-3 border-t flex-row justify-between sm:justify-end gap-2">
|
|
252
|
-
{footer?.(draft)}
|
|
253
|
-
<div className="flex gap-2 ml-auto">
|
|
254
|
-
<Button type="button" variant="ghost" onClick={cancelFullscreen}>
|
|
255
|
-
<X className="size-4 mr-1" /> {t('common.cancel')}
|
|
256
|
-
</Button>
|
|
257
|
-
<Button
|
|
258
|
-
type="button"
|
|
259
|
-
onClick={commitFullscreen}
|
|
260
|
-
disabled={disabled}
|
|
261
|
-
data-testid={`${testIdPrefix}-fullscreen-save`}
|
|
262
|
-
>
|
|
263
|
-
<Check className="size-4 mr-1" /> {t('form.fullscreen.done')}
|
|
264
|
-
</Button>
|
|
265
|
-
</div>
|
|
266
|
-
</DialogFooter>
|
|
267
|
-
</DialogContent>
|
|
268
|
-
</Dialog>
|
|
269
|
-
</>
|
|
270
|
-
);
|
|
271
|
-
}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import React, { useId } from 'react';
|
|
2
|
-
import { Input, Button, Label, EmptyValue } from '@object-ui/components';
|
|
3
|
-
import { MapPin, Crosshair } from 'lucide-react';
|
|
4
|
-
import { FieldWidgetComponentProps } from './types';
|
|
5
|
-
import { toDomProps } from './toDomProps';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Geolocation data structure
|
|
9
|
-
*/
|
|
10
|
-
export interface GeolocationValue {
|
|
11
|
-
latitude?: number;
|
|
12
|
-
longitude?: number;
|
|
13
|
-
accuracy?: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Geolocation field widget - provides a location picker with coordinates
|
|
18
|
-
* Supports manual entry and browser geolocation API
|
|
19
|
-
*/
|
|
20
|
-
export function GeolocationField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<GeolocationValue>) {
|
|
21
|
-
const [isLoading, setIsLoading] = React.useState(false);
|
|
22
|
-
const location = value || {};
|
|
23
|
-
// DOM pass-through (objectui#3318): the whitelist spread goes onto the FIRST
|
|
24
|
-
// sub-input (latitude); the composite's validation state goes onto BOTH
|
|
25
|
-
// focusable sub-inputs via `aria-invalid={!!error}`.
|
|
26
|
-
const domProps = toDomProps(props);
|
|
27
|
-
// Sub-input ids (objectui#3343): `useId()` prefix + sub-field name — the
|
|
28
|
-
// `groupId` paradigm of RadioField / CheckboxesField. Hardcoded literals
|
|
29
|
-
// ("latitude" / "longitude") collide as soon as a form renders two
|
|
30
|
-
// geolocation fields, and every label's htmlFor then resolves to the
|
|
31
|
-
// FIRST match.
|
|
32
|
-
const groupId = useId();
|
|
33
|
-
const subId = (name: keyof GeolocationValue) => `${groupId}-${name}`;
|
|
34
|
-
|
|
35
|
-
const handleFieldChange = (fieldName: keyof GeolocationValue, fieldValue: string) => {
|
|
36
|
-
onChange({
|
|
37
|
-
...location,
|
|
38
|
-
[fieldName]: fieldValue ? Number(fieldValue) : undefined,
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const getCurrentLocation = () => {
|
|
43
|
-
if (!navigator.geolocation) {
|
|
44
|
-
console.error('Geolocation is not supported by this browser');
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
setIsLoading(true);
|
|
49
|
-
navigator.geolocation.getCurrentPosition(
|
|
50
|
-
(position) => {
|
|
51
|
-
onChange({
|
|
52
|
-
latitude: position.coords.latitude,
|
|
53
|
-
longitude: position.coords.longitude,
|
|
54
|
-
accuracy: position.coords.accuracy,
|
|
55
|
-
});
|
|
56
|
-
setIsLoading(false);
|
|
57
|
-
},
|
|
58
|
-
(error) => {
|
|
59
|
-
console.error('Error getting location:', error.message);
|
|
60
|
-
setIsLoading(false);
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
enableHighAccuracy: true,
|
|
64
|
-
timeout: 5000,
|
|
65
|
-
maximumAge: 0,
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const formatLocation = (loc: GeolocationValue): string => {
|
|
71
|
-
if (!loc.latitude || !loc.longitude) return '';
|
|
72
|
-
return `${loc.latitude.toFixed(6)}, ${loc.longitude.toFixed(6)}`;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const openInMaps = () => {
|
|
76
|
-
if (!location.latitude || !location.longitude) return;
|
|
77
|
-
const url = `https://www.google.com/maps?q=${location.latitude},${location.longitude}`;
|
|
78
|
-
window.open(url, '_blank');
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
if (readonly) {
|
|
82
|
-
const formatted = formatLocation(location);
|
|
83
|
-
return (
|
|
84
|
-
<div className="flex items-center gap-2">
|
|
85
|
-
<MapPin className="w-4 h-4 text-muted-foreground" />
|
|
86
|
-
{formatted ? <span className="text-sm">{formatted}</span> : <EmptyValue />}
|
|
87
|
-
{location.latitude && location.longitude && (
|
|
88
|
-
<Button
|
|
89
|
-
type="button"
|
|
90
|
-
variant="link"
|
|
91
|
-
size="sm"
|
|
92
|
-
onClick={openInMaps}
|
|
93
|
-
className="p-0 h-auto"
|
|
94
|
-
>
|
|
95
|
-
View on map
|
|
96
|
-
</Button>
|
|
97
|
-
)}
|
|
98
|
-
</div>
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return (
|
|
103
|
-
<div className="space-y-3">
|
|
104
|
-
<div className="flex items-center gap-2">
|
|
105
|
-
<Button
|
|
106
|
-
type="button"
|
|
107
|
-
variant="outline"
|
|
108
|
-
size="sm"
|
|
109
|
-
onClick={getCurrentLocation}
|
|
110
|
-
disabled={readonly || isLoading}
|
|
111
|
-
>
|
|
112
|
-
<Crosshair className="w-4 h-4 mr-2" />
|
|
113
|
-
{isLoading ? 'Getting location...' : 'Use Current Location'}
|
|
114
|
-
</Button>
|
|
115
|
-
{location.latitude && location.longitude && (
|
|
116
|
-
<Button
|
|
117
|
-
type="button"
|
|
118
|
-
variant="link"
|
|
119
|
-
size="sm"
|
|
120
|
-
onClick={openInMaps}
|
|
121
|
-
>
|
|
122
|
-
<MapPin className="w-4 h-4 mr-2" />
|
|
123
|
-
View on map
|
|
124
|
-
</Button>
|
|
125
|
-
)}
|
|
126
|
-
</div>
|
|
127
|
-
|
|
128
|
-
<div className="grid grid-cols-2 gap-3">
|
|
129
|
-
<div>
|
|
130
|
-
<Label htmlFor={subId('latitude')} className="text-xs">Latitude</Label>
|
|
131
|
-
<Input
|
|
132
|
-
{...domProps}
|
|
133
|
-
id={subId('latitude')}
|
|
134
|
-
type="number"
|
|
135
|
-
value={location.latitude ?? ''}
|
|
136
|
-
onChange={(e) => handleFieldChange('latitude', e.target.value)}
|
|
137
|
-
placeholder="37.7749"
|
|
138
|
-
disabled={readonly || props.disabled}
|
|
139
|
-
step="any"
|
|
140
|
-
className={props.className}
|
|
141
|
-
aria-invalid={!!error}
|
|
142
|
-
/>
|
|
143
|
-
</div>
|
|
144
|
-
|
|
145
|
-
<div>
|
|
146
|
-
<Label htmlFor={subId('longitude')} className="text-xs">Longitude</Label>
|
|
147
|
-
<Input
|
|
148
|
-
id={subId('longitude')}
|
|
149
|
-
type="number"
|
|
150
|
-
value={location.longitude ?? ''}
|
|
151
|
-
onChange={(e) => handleFieldChange('longitude', e.target.value)}
|
|
152
|
-
placeholder="-122.4194"
|
|
153
|
-
disabled={readonly || props.disabled}
|
|
154
|
-
step="any"
|
|
155
|
-
aria-invalid={!!error}
|
|
156
|
-
/>
|
|
157
|
-
</div>
|
|
158
|
-
</div>
|
|
159
|
-
|
|
160
|
-
{location.accuracy && (
|
|
161
|
-
<p className="text-xs text-muted-foreground">
|
|
162
|
-
Accuracy: ±{location.accuracy.toFixed(0)}m
|
|
163
|
-
</p>
|
|
164
|
-
)}
|
|
165
|
-
</div>
|
|
166
|
-
);
|
|
167
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Unique sub-input ids for the composite `geolocation` widget
|
|
11
|
-
* (objectui#3343).
|
|
12
|
-
*
|
|
13
|
-
* The widget used to hardcode literal ids ("latitude" / "longitude") on its
|
|
14
|
-
* sub-inputs. Two geolocation fields in one form — e.g. origin + destination
|
|
15
|
-
* — then produced duplicate DOM ids, and every `Label htmlFor` resolved to
|
|
16
|
-
* the FIRST match in the document: each sub-label of the second field
|
|
17
|
-
* clicked/announced the first field's input.
|
|
18
|
-
*
|
|
19
|
-
* The fix follows the `groupId` paradigm of RadioField / CheckboxesField:
|
|
20
|
-
* a `useId()` prefix + the sub-field name. These tests pin it by rendering
|
|
21
|
-
* TWO instances in one form:
|
|
22
|
-
*
|
|
23
|
-
* 1. every `[id]` in the document is globally unique (red again if anyone
|
|
24
|
-
* reverts to hardcoded literals — both instances would emit
|
|
25
|
-
* id="latitude");
|
|
26
|
-
* 2. each sub-label of the SECOND instance resolves — via the exact
|
|
27
|
-
* mechanism browsers use for label activation, `for` → getElementById —
|
|
28
|
-
* to an input inside its OWN instance, and focusing it lands there.
|
|
29
|
-
*/
|
|
30
|
-
import { describe, it, expect, vi } from 'vitest';
|
|
31
|
-
import React from 'react';
|
|
32
|
-
import { render, within } from '@testing-library/react';
|
|
33
|
-
import '@testing-library/jest-dom';
|
|
34
|
-
import { GeolocationField } from './GeolocationField';
|
|
35
|
-
|
|
36
|
-
const field = { name: 'location', type: 'geolocation' } as any;
|
|
37
|
-
|
|
38
|
-
const SUB_LABELS = ['Latitude', 'Longitude'];
|
|
39
|
-
|
|
40
|
-
function renderTwoInOneForm() {
|
|
41
|
-
return render(
|
|
42
|
-
<form>
|
|
43
|
-
<div data-testid="geo-a">
|
|
44
|
-
<GeolocationField value={{}} onChange={vi.fn()} field={field} />
|
|
45
|
-
</div>
|
|
46
|
-
<div data-testid="geo-b">
|
|
47
|
-
<GeolocationField value={{}} onChange={vi.fn()} field={field} />
|
|
48
|
-
</div>
|
|
49
|
-
</form>,
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
describe('GeolocationField — unique sub-input ids (objectui#3343)', () => {
|
|
54
|
-
it('two geolocation fields in one form produce globally unique DOM ids', () => {
|
|
55
|
-
const { baseElement } = renderTwoInOneForm();
|
|
56
|
-
const ids = Array.from(baseElement.querySelectorAll('[id]')).map((el) => el.id);
|
|
57
|
-
// 2 sub-inputs per instance — both instances must actually render ids.
|
|
58
|
-
expect(ids.length).toBeGreaterThanOrEqual(4);
|
|
59
|
-
const duplicates = ids.filter((id, i) => ids.indexOf(id) !== i);
|
|
60
|
-
expect(duplicates).toEqual([]);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it("each sub-label of the SECOND field focuses that field's own input", () => {
|
|
64
|
-
const { getByTestId } = renderTwoInOneForm();
|
|
65
|
-
const first = getByTestId('geo-a');
|
|
66
|
-
const second = getByTestId('geo-b');
|
|
67
|
-
|
|
68
|
-
for (const text of SUB_LABELS) {
|
|
69
|
-
const label = within(second).getByText(text);
|
|
70
|
-
const forId = label.getAttribute('for');
|
|
71
|
-
expect(forId, `label "${text}" must carry htmlFor`).toBeTruthy();
|
|
72
|
-
|
|
73
|
-
// Exactly what the browser does on label click / SR announcement:
|
|
74
|
-
// resolve `for` against the document.
|
|
75
|
-
const control = document.getElementById(forId!);
|
|
76
|
-
expect(control, `htmlFor of "${text}" must resolve`).not.toBeNull();
|
|
77
|
-
expect(control!.tagName).toBe('INPUT');
|
|
78
|
-
expect(
|
|
79
|
-
second.contains(control),
|
|
80
|
-
`"${text}" must resolve into its OWN field, not the first one`,
|
|
81
|
-
).toBe(true);
|
|
82
|
-
expect(first.contains(control)).toBe(false);
|
|
83
|
-
|
|
84
|
-
(control as HTMLInputElement).focus();
|
|
85
|
-
expect(control).toHaveFocus();
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
});
|