@multiplatform.one/forms 7.7.6 → 7.8.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/dist/cjs/Button/index.cjs +0 -3
- package/dist/cjs/Button/index.native.js +0 -3
- package/dist/cjs/Button/index.native.js.map +1 -1
- package/dist/cjs/Chip/index.cjs +1 -1
- package/dist/cjs/Chip/index.native.js +1 -1
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/index.cjs +59 -14
- package/dist/cjs/FloatingPanel/index.native.js +16 -7
- package/dist/cjs/FloatingPanel/index.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/nestedAction.cjs +37 -0
- package/dist/cjs/FloatingPanel/nestedAction.native.js +42 -0
- package/dist/cjs/FloatingPanel/nestedAction.native.js.map +1 -0
- package/dist/cjs/InputParts/index.cjs +8 -6
- package/dist/cjs/InputParts/index.native.js +9 -9
- package/dist/cjs/InputParts/index.native.js.map +1 -1
- package/dist/cjs/Wheel/index.cjs +3 -3
- package/dist/cjs/Wheel/index.native.js +3 -3
- package/dist/cjs/Wheel/index.native.js.map +1 -1
- package/dist/cjs/fieldLayout.cjs +3 -3
- package/dist/cjs/fieldLayout.native.js +3 -3
- package/dist/cjs/fieldLayout.native.js.map +1 -1
- package/dist/cjs/fields/Checkbox/CheckboxFieldFrame.cjs +9 -2
- package/dist/cjs/fields/Checkbox/CheckboxFieldFrame.native.js +10 -1
- package/dist/cjs/fields/Checkbox/CheckboxFieldFrame.native.js.map +1 -1
- package/dist/cjs/fields/Combobox/index.cjs +36 -29
- package/dist/cjs/fields/Combobox/index.native.js +38 -38
- package/dist/cjs/fields/Combobox/index.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/Calendar.cjs +6 -1
- package/dist/cjs/fields/DatePicker/Calendar.native.js +6 -1
- package/dist/cjs/fields/DatePicker/Calendar.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/DateRangePicker.cjs +2 -2
- package/dist/cjs/fields/DatePicker/DateRangePicker.native.js +2 -2
- package/dist/cjs/fields/DatePicker/DateRangePicker.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/DatetimePicker.catalog.cjs +15 -12
- package/dist/cjs/fields/DatePicker/DatetimePicker.catalog.native.js +16 -12
- package/dist/cjs/fields/DatePicker/DatetimePicker.catalog.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/DatetimePicker.native.js +39 -14
- package/dist/cjs/fields/DatePicker/DatetimePicker.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/MonthPicker.cjs +10 -3
- package/dist/cjs/fields/DatePicker/MonthPicker.native.js +10 -3
- package/dist/cjs/fields/DatePicker/MonthPicker.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/MultiDatePicker.cjs +2 -2
- package/dist/cjs/fields/DatePicker/MultiDatePicker.native.js +2 -2
- package/dist/cjs/fields/DatePicker/MultiDatePicker.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/index.native.js +3 -0
- package/dist/cjs/fields/DatePicker/index.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/parts.cjs +26 -14
- package/dist/cjs/fields/DatePicker/parts.native.js +28 -14
- package/dist/cjs/fields/DatePicker/parts.native.js.map +1 -1
- package/dist/cjs/fields/Geolocation/GeolocationMap.native.js.map +1 -1
- package/dist/cjs/fields/Geolocation/geocoder.cjs +63 -0
- package/dist/cjs/fields/Geolocation/geocoder.native.js +68 -0
- package/dist/cjs/fields/Geolocation/geocoder.native.js.map +1 -0
- package/dist/cjs/fields/Geolocation/index.cjs +801 -152
- package/dist/cjs/fields/Geolocation/index.native.js +856 -167
- package/dist/cjs/fields/Geolocation/index.native.js.map +1 -1
- package/dist/cjs/fields/Geolocation/nativeSearchFocus.cjs +44 -0
- package/dist/cjs/fields/Geolocation/nativeSearchFocus.native.js +47 -0
- package/dist/cjs/fields/Geolocation/nativeSearchFocus.native.js.map +1 -0
- package/dist/cjs/fields/Icon/drawnSet.cjs +14 -3
- package/dist/cjs/fields/Icon/drawnSet.native.js +18 -3
- package/dist/cjs/fields/Icon/drawnSet.native.js.map +1 -1
- package/dist/cjs/fields/Icon/index.cjs +102 -27
- package/dist/cjs/fields/Icon/index.native.js +115 -31
- package/dist/cjs/fields/Icon/index.native.js.map +1 -1
- package/dist/cjs/fields/Input/index.cjs +5 -12
- package/dist/cjs/fields/Input/index.native.js +5 -13
- package/dist/cjs/fields/Input/index.native.js.map +1 -1
- package/dist/cjs/fields/PhoneInput/index.cjs +2 -2
- package/dist/cjs/fields/PhoneInput/index.native.js +2 -2
- package/dist/cjs/fields/PhoneInput/index.native.js.map +1 -1
- package/dist/cjs/fields/SearchInput/index.cjs +8 -9
- package/dist/cjs/fields/SearchInput/index.native.js +8 -9
- package/dist/cjs/fields/SearchInput/index.native.js.map +1 -1
- package/dist/cjs/fields/Select/index.cjs +42 -11
- package/dist/cjs/fields/Select/index.native.js +52 -20
- package/dist/cjs/fields/Select/index.native.js.map +1 -1
- package/dist/cjs/fields/Stepper/index.cjs +144 -31
- package/dist/cjs/fields/Stepper/index.native.js +151 -31
- package/dist/cjs/fields/Stepper/index.native.js.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.native.js +2 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/shared/focusManagement.cjs +24 -11
- package/dist/cjs/shared/focusManagement.native.js +24 -11
- package/dist/cjs/shared/focusManagement.native.js.map +1 -1
- package/dist/esm/AdaptivePopup/index.native.js.map +1 -1
- package/dist/esm/Button/index.mjs +0 -3
- package/dist/esm/Button/index.mjs.map +1 -1
- package/dist/esm/Button/index.native.js +0 -3
- package/dist/esm/Button/index.native.js.map +1 -1
- package/dist/esm/Chip/index.mjs +1 -1
- package/dist/esm/Chip/index.mjs.map +1 -1
- package/dist/esm/Chip/index.native.js +1 -1
- package/dist/esm/Chip/index.native.js.map +1 -1
- package/dist/esm/ContextualSaveBar/UnsavedChangesDialog.native.js.map +1 -1
- package/dist/esm/ContextualSaveBar/clientKnownIdentity.native.js.map +1 -1
- package/dist/esm/ContextualSaveBar/commitImmediateField.native.js.map +1 -1
- package/dist/esm/ContextualSaveBar/index.native.js.map +1 -1
- package/dist/esm/ContextualSaveBar/useUnsavedChangesGuard.native.js.map +1 -1
- package/dist/esm/ControlGroup/index.native.js.map +1 -1
- package/dist/esm/DescriptionList/index.native.js.map +1 -1
- package/dist/esm/ErrorSummary.native.js.map +1 -1
- package/dist/esm/FieldDisplay/editMode.native.js.map +1 -1
- package/dist/esm/FieldDisplay/formatters.native.js.map +1 -1
- package/dist/esm/FieldDisplay/index.native.js.map +1 -1
- package/dist/esm/FieldGroup.native.js.map +1 -1
- package/dist/esm/FloatingPanel/index.mjs +58 -15
- package/dist/esm/FloatingPanel/index.mjs.map +1 -1
- package/dist/esm/FloatingPanel/index.native.js +15 -8
- package/dist/esm/FloatingPanel/index.native.js.map +1 -1
- package/dist/esm/FloatingPanel/nestedAction.mjs +11 -0
- package/dist/esm/FloatingPanel/nestedAction.mjs.map +1 -0
- package/dist/esm/FloatingPanel/nestedAction.native.js +13 -0
- package/dist/esm/FloatingPanel/nestedAction.native.js.map +1 -0
- package/dist/esm/FloatingPanel/useFloatingPanel.native.js.map +1 -1
- package/dist/esm/Form/index.native.js.map +1 -1
- package/dist/esm/Form/validateOn.native.js.map +1 -1
- package/dist/esm/FormGrid.native.js.map +1 -1
- package/dist/esm/FormSection.native.js.map +1 -1
- package/dist/esm/InputParts/index.mjs +9 -7
- package/dist/esm/InputParts/index.mjs.map +1 -1
- package/dist/esm/InputParts/index.native.js +10 -10
- package/dist/esm/InputParts/index.native.js.map +1 -1
- package/dist/esm/Label/index.native.js.map +1 -1
- package/dist/esm/Skeleton/index.native.js.map +1 -1
- package/dist/esm/Spinner/SpinnerGlyph.native.js.map +1 -1
- package/dist/esm/Spinner/spinnerSize.native.js.map +1 -1
- package/dist/esm/Table/index.native.js.map +1 -1
- package/dist/esm/Wheel/haptic.native.js.map +1 -1
- package/dist/esm/Wheel/index.mjs +3 -3
- package/dist/esm/Wheel/index.mjs.map +1 -1
- package/dist/esm/Wheel/index.native.js +3 -3
- package/dist/esm/Wheel/index.native.js.map +1 -1
- package/dist/esm/actionLabel.native.js.map +1 -1
- package/dist/esm/fieldDefaults.native.js.map +1 -1
- package/dist/esm/fieldLayout.mjs +3 -3
- package/dist/esm/fieldLayout.mjs.map +1 -1
- package/dist/esm/fieldLayout.native.js +3 -3
- package/dist/esm/fieldLayout.native.js.map +1 -1
- package/dist/esm/fields/Barcode/BarcodePreview.native.js.map +1 -1
- package/dist/esm/fields/Barcode/code128.native.js.map +1 -1
- package/dist/esm/fields/Barcode/index.native.js.map +1 -1
- package/dist/esm/fields/Barcode/qr.native.js.map +1 -1
- package/dist/esm/fields/Barcode/scannerTypes.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/Checkbox.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/CheckboxBox.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/CheckboxCard.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/CheckboxFieldFrame.mjs +8 -1
- package/dist/esm/fields/Checkbox/CheckboxFieldFrame.mjs.map +1 -1
- package/dist/esm/fields/Checkbox/CheckboxFieldFrame.native.js +10 -1
- package/dist/esm/fields/Checkbox/CheckboxFieldFrame.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/CheckboxGroup.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/checkboxGroupContext.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/index.native.js.map +1 -1
- package/dist/esm/fields/ColorPicker/index.native.js.map +1 -1
- package/dist/esm/fields/ColorPicker/parts.native.js.map +1 -1
- package/dist/esm/fields/Combobox/authorOptions.native.js.map +1 -1
- package/dist/esm/fields/Combobox/index.mjs +36 -29
- package/dist/esm/fields/Combobox/index.mjs.map +1 -1
- package/dist/esm/fields/Combobox/index.native.js +38 -38
- package/dist/esm/fields/Combobox/index.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/Calendar.mjs +6 -1
- package/dist/esm/fields/DatePicker/Calendar.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/Calendar.native.js +6 -1
- package/dist/esm/fields/DatePicker/Calendar.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/DateRangePicker.mjs +2 -2
- package/dist/esm/fields/DatePicker/DateRangePicker.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/DateRangePicker.native.js +2 -2
- package/dist/esm/fields/DatePicker/DateRangePicker.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/DatetimePicker.catalog.mjs +15 -12
- package/dist/esm/fields/DatePicker/DatetimePicker.catalog.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/DatetimePicker.catalog.native.js +16 -12
- package/dist/esm/fields/DatePicker/DatetimePicker.catalog.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/DatetimePicker.native.js +39 -14
- package/dist/esm/fields/DatePicker/DatetimePicker.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/MonthPicker.mjs +10 -3
- package/dist/esm/fields/DatePicker/MonthPicker.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/MonthPicker.native.js +10 -3
- package/dist/esm/fields/DatePicker/MonthPicker.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/MultiDatePicker.mjs +2 -2
- package/dist/esm/fields/DatePicker/MultiDatePicker.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/MultiDatePicker.native.js +2 -2
- package/dist/esm/fields/DatePicker/MultiDatePicker.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/catalog.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/fieldValueSync.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/index.native.js +3 -0
- package/dist/esm/fields/DatePicker/index.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/parts.mjs +28 -16
- package/dist/esm/fields/DatePicker/parts.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/parts.native.js +30 -16
- package/dist/esm/fields/DatePicker/parts.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/utils.native.js.map +1 -1
- package/dist/esm/fields/Duration/durationMath.native.js.map +1 -1
- package/dist/esm/fields/Duration/index.native.js.map +1 -1
- package/dist/esm/fields/FileUpload/filePickerTypes.native.js.map +1 -1
- package/dist/esm/fields/FileUpload/index.native.js.map +1 -1
- package/dist/esm/fields/FileUpload/nativePickerLoader.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/GeolocationMap.mjs.map +1 -1
- package/dist/esm/fields/Geolocation/GeolocationMap.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/expoMapsLoader.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/geoValue.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/geocoder.mjs +33 -0
- package/dist/esm/fields/Geolocation/geocoder.mjs.map +1 -0
- package/dist/esm/fields/Geolocation/geocoder.native.js +35 -0
- package/dist/esm/fields/Geolocation/geocoder.native.js.map +1 -0
- package/dist/esm/fields/Geolocation/index.mjs +792 -149
- package/dist/esm/fields/Geolocation/index.mjs.map +1 -1
- package/dist/esm/fields/Geolocation/index.native.js +847 -164
- package/dist/esm/fields/Geolocation/index.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/mapMath.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/mapTypes.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/nativeSearchFocus.mjs +19 -0
- package/dist/esm/fields/Geolocation/nativeSearchFocus.mjs.map +1 -0
- package/dist/esm/fields/Geolocation/nativeSearchFocus.native.js +19 -0
- package/dist/esm/fields/Geolocation/nativeSearchFocus.native.js.map +1 -0
- package/dist/esm/fields/Icon/drawnSet.mjs +14 -3
- package/dist/esm/fields/Icon/drawnSet.mjs.map +1 -1
- package/dist/esm/fields/Icon/drawnSet.native.js +18 -3
- package/dist/esm/fields/Icon/drawnSet.native.js.map +1 -1
- package/dist/esm/fields/Icon/index.mjs +93 -18
- package/dist/esm/fields/Icon/index.mjs.map +1 -1
- package/dist/esm/fields/Icon/index.native.js +106 -22
- package/dist/esm/fields/Icon/index.native.js.map +1 -1
- package/dist/esm/fields/ImageField/index.native.js.map +1 -1
- package/dist/esm/fields/Input/index.mjs +5 -12
- package/dist/esm/fields/Input/index.mjs.map +1 -1
- package/dist/esm/fields/Input/index.native.js +5 -13
- package/dist/esm/fields/Input/index.native.js.map +1 -1
- package/dist/esm/fields/MentionInput/index.native.js.map +1 -1
- package/dist/esm/fields/OTPInput/index.native.js.map +1 -1
- package/dist/esm/fields/OTPInput/otpCellCss.native.js.map +1 -1
- package/dist/esm/fields/PhoneInput/dialCodes.native.js.map +1 -1
- package/dist/esm/fields/PhoneInput/index.mjs +2 -2
- package/dist/esm/fields/PhoneInput/index.mjs.map +1 -1
- package/dist/esm/fields/PhoneInput/index.native.js +2 -2
- package/dist/esm/fields/PhoneInput/index.native.js.map +1 -1
- package/dist/esm/fields/PhoneInput/phone.native.js.map +1 -1
- package/dist/esm/fields/Progress/index.native.js.map +1 -1
- package/dist/esm/fields/RadioGroup/index.native.js.map +1 -1
- package/dist/esm/fields/Rating/index.native.js.map +1 -1
- package/dist/esm/fields/Rating/ratingMath.native.js.map +1 -1
- package/dist/esm/fields/Rating/types.native.js.map +1 -1
- package/dist/esm/fields/SearchInput/index.mjs +9 -10
- package/dist/esm/fields/SearchInput/index.mjs.map +1 -1
- package/dist/esm/fields/SearchInput/index.native.js +9 -10
- package/dist/esm/fields/SearchInput/index.native.js.map +1 -1
- package/dist/esm/fields/Select/index.mjs +42 -11
- package/dist/esm/fields/Select/index.mjs.map +1 -1
- package/dist/esm/fields/Select/index.native.js +52 -20
- package/dist/esm/fields/Select/index.native.js.map +1 -1
- package/dist/esm/fields/Signature/index.native.js.map +1 -1
- package/dist/esm/fields/Slider/index.native.js.map +1 -1
- package/dist/esm/fields/Slider/jumpMotion.native.js.map +1 -1
- package/dist/esm/fields/Stepper/index.mjs +145 -32
- package/dist/esm/fields/Stepper/index.mjs.map +1 -1
- package/dist/esm/fields/Stepper/index.native.js +152 -32
- package/dist/esm/fields/Stepper/index.native.js.map +1 -1
- package/dist/esm/fields/Stepper/resolveStepperPlacement.native.js.map +1 -1
- package/dist/esm/fields/Switch/index.native.js.map +1 -1
- package/dist/esm/fields/TextArea/index.native.js.map +1 -1
- package/dist/esm/fields/TimePicker/catalog.native.js.map +1 -1
- package/dist/esm/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/esm/fields/TimeRangeScrubber/geometry.native.js.map +1 -1
- package/dist/esm/fields/TimeRangeScrubber/index.native.js.map +1 -1
- package/dist/esm/fields/ToggleGroup/index.native.js.map +1 -1
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/esm/fields/nativeDateTime/osDateTimeIosDisplay.native.js.map +1 -1
- package/dist/esm/fields/nativeSelect.native.js.map +1 -1
- package/dist/esm/fields/selectedOrder.native.js.map +1 -1
- package/dist/esm/formSpacing.native.js.map +1 -1
- package/dist/esm/hooks/useFocusManagement.native.js.map +1 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/requiredMarking.native.js.map +1 -1
- package/dist/esm/shared/TimeColumn.native.js.map +1 -1
- package/dist/esm/shared/capabilityPreflight.native.js.map +1 -1
- package/dist/esm/shared/colorRamps.native.js.map +1 -1
- package/dist/esm/shared/devWarn.native.js.map +1 -1
- package/dist/esm/shared/floatingList.native.js.map +1 -1
- package/dist/esm/shared/focusManagement.mjs +24 -11
- package/dist/esm/shared/focusManagement.mjs.map +1 -1
- package/dist/esm/shared/focusManagement.native.js +24 -11
- package/dist/esm/shared/focusManagement.native.js.map +1 -1
- package/dist/esm/shared/groupContext.native.js.map +1 -1
- package/dist/esm/shared/i18n.native.js.map +1 -1
- package/dist/esm/shared/pickerTriggerContract.native.js.map +1 -1
- package/dist/esm/shared/pressSlopProps.native.js.map +1 -1
- package/dist/esm/shared/t.native.js.map +1 -1
- package/dist/esm/shared/tableCellContext.native.js.map +1 -1
- package/dist/esm/shared/useDragScroll.native.js.map +1 -1
- package/dist/esm/shared/useKeyboardInset.native.js.map +1 -1
- package/dist/esm/shared/useSheetEscapeDismiss.native.js.map +1 -1
- package/dist/esm/shared/useWheelIncrement.native.js.map +1 -1
- package/dist/esm/shared/utils.native.js.map +1 -1
- package/dist/esm/shared/zIndex.native.js.map +1 -1
- package/dist/esm/themedPrimitives.native.js.map +1 -1
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/utils/LinkCell.native.js.map +1 -1
- package/dist/jsx/Button/index.mjs +0 -3
- package/dist/jsx/Button/index.mjs.map +1 -1
- package/dist/jsx/Button/index.native.js +0 -3
- package/dist/jsx/Button/index.native.js.map +1 -1
- package/dist/jsx/Chip/index.mjs +1 -1
- package/dist/jsx/Chip/index.mjs.map +1 -1
- package/dist/jsx/Chip/index.native.js +1 -1
- package/dist/jsx/Chip/index.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/index.mjs +58 -15
- package/dist/jsx/FloatingPanel/index.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/index.native.js +16 -7
- package/dist/jsx/FloatingPanel/index.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/nestedAction.mjs +11 -0
- package/dist/jsx/FloatingPanel/nestedAction.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/nestedAction.native.js +42 -0
- package/dist/jsx/FloatingPanel/nestedAction.native.js.map +1 -0
- package/dist/jsx/InputParts/index.mjs +9 -7
- package/dist/jsx/InputParts/index.mjs.map +1 -1
- package/dist/jsx/InputParts/index.native.js +9 -9
- package/dist/jsx/InputParts/index.native.js.map +1 -1
- package/dist/jsx/Wheel/index.mjs +3 -3
- package/dist/jsx/Wheel/index.mjs.map +1 -1
- package/dist/jsx/Wheel/index.native.js +3 -3
- package/dist/jsx/Wheel/index.native.js.map +1 -1
- package/dist/jsx/fieldLayout.mjs +3 -3
- package/dist/jsx/fieldLayout.mjs.map +1 -1
- package/dist/jsx/fieldLayout.native.js +3 -3
- package/dist/jsx/fieldLayout.native.js.map +1 -1
- package/dist/jsx/fields/Checkbox/CheckboxFieldFrame.mjs +8 -1
- package/dist/jsx/fields/Checkbox/CheckboxFieldFrame.mjs.map +1 -1
- package/dist/jsx/fields/Checkbox/CheckboxFieldFrame.native.js +10 -1
- package/dist/jsx/fields/Checkbox/CheckboxFieldFrame.native.js.map +1 -1
- package/dist/jsx/fields/Combobox/index.mjs +36 -29
- package/dist/jsx/fields/Combobox/index.mjs.map +1 -1
- package/dist/jsx/fields/Combobox/index.native.js +38 -38
- package/dist/jsx/fields/Combobox/index.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/Calendar.mjs +6 -1
- package/dist/jsx/fields/DatePicker/Calendar.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/Calendar.native.js +6 -1
- package/dist/jsx/fields/DatePicker/Calendar.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/DateRangePicker.mjs +2 -2
- package/dist/jsx/fields/DatePicker/DateRangePicker.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/DateRangePicker.native.js +2 -2
- package/dist/jsx/fields/DatePicker/DateRangePicker.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/DatetimePicker.catalog.mjs +15 -12
- package/dist/jsx/fields/DatePicker/DatetimePicker.catalog.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/DatetimePicker.catalog.native.js +16 -12
- package/dist/jsx/fields/DatePicker/DatetimePicker.catalog.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/DatetimePicker.native.js +39 -14
- package/dist/jsx/fields/DatePicker/DatetimePicker.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/MonthPicker.mjs +10 -3
- package/dist/jsx/fields/DatePicker/MonthPicker.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/MonthPicker.native.js +10 -3
- package/dist/jsx/fields/DatePicker/MonthPicker.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/MultiDatePicker.mjs +2 -2
- package/dist/jsx/fields/DatePicker/MultiDatePicker.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/MultiDatePicker.native.js +2 -2
- package/dist/jsx/fields/DatePicker/MultiDatePicker.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/index.native.js +3 -0
- package/dist/jsx/fields/DatePicker/index.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/parts.mjs +28 -16
- package/dist/jsx/fields/DatePicker/parts.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/parts.native.js +28 -14
- package/dist/jsx/fields/DatePicker/parts.native.js.map +1 -1
- package/dist/jsx/fields/Geolocation/GeolocationMap.mjs.map +1 -1
- package/dist/jsx/fields/Geolocation/GeolocationMap.native.js.map +1 -1
- package/dist/jsx/fields/Geolocation/geocoder.mjs +33 -0
- package/dist/jsx/fields/Geolocation/geocoder.mjs.map +1 -0
- package/dist/jsx/fields/Geolocation/geocoder.native.js +68 -0
- package/dist/jsx/fields/Geolocation/geocoder.native.js.map +1 -0
- package/dist/jsx/fields/Geolocation/index.mjs +792 -149
- package/dist/jsx/fields/Geolocation/index.mjs.map +1 -1
- package/dist/jsx/fields/Geolocation/index.native.js +856 -167
- package/dist/jsx/fields/Geolocation/index.native.js.map +1 -1
- package/dist/jsx/fields/Geolocation/nativeSearchFocus.mjs +19 -0
- package/dist/jsx/fields/Geolocation/nativeSearchFocus.mjs.map +1 -0
- package/dist/jsx/fields/Geolocation/nativeSearchFocus.native.js +47 -0
- package/dist/jsx/fields/Geolocation/nativeSearchFocus.native.js.map +1 -0
- package/dist/jsx/fields/Icon/drawnSet.mjs +14 -3
- package/dist/jsx/fields/Icon/drawnSet.mjs.map +1 -1
- package/dist/jsx/fields/Icon/drawnSet.native.js +18 -3
- package/dist/jsx/fields/Icon/drawnSet.native.js.map +1 -1
- package/dist/jsx/fields/Icon/index.mjs +93 -18
- package/dist/jsx/fields/Icon/index.mjs.map +1 -1
- package/dist/jsx/fields/Icon/index.native.js +115 -31
- package/dist/jsx/fields/Icon/index.native.js.map +1 -1
- package/dist/jsx/fields/Input/index.mjs +5 -12
- package/dist/jsx/fields/Input/index.mjs.map +1 -1
- package/dist/jsx/fields/Input/index.native.js +5 -13
- package/dist/jsx/fields/Input/index.native.js.map +1 -1
- package/dist/jsx/fields/PhoneInput/index.mjs +2 -2
- package/dist/jsx/fields/PhoneInput/index.mjs.map +1 -1
- package/dist/jsx/fields/PhoneInput/index.native.js +2 -2
- package/dist/jsx/fields/PhoneInput/index.native.js.map +1 -1
- package/dist/jsx/fields/SearchInput/index.mjs +9 -10
- package/dist/jsx/fields/SearchInput/index.mjs.map +1 -1
- package/dist/jsx/fields/SearchInput/index.native.js +8 -9
- package/dist/jsx/fields/SearchInput/index.native.js.map +1 -1
- package/dist/jsx/fields/Select/index.mjs +42 -11
- package/dist/jsx/fields/Select/index.mjs.map +1 -1
- package/dist/jsx/fields/Select/index.native.js +52 -20
- package/dist/jsx/fields/Select/index.native.js.map +1 -1
- package/dist/jsx/fields/Stepper/index.mjs +145 -32
- package/dist/jsx/fields/Stepper/index.mjs.map +1 -1
- package/dist/jsx/fields/Stepper/index.native.js +151 -31
- package/dist/jsx/fields/Stepper/index.native.js.map +1 -1
- package/dist/jsx/index.js +2 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +2 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +2 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/shared/focusManagement.mjs +24 -11
- package/dist/jsx/shared/focusManagement.mjs.map +1 -1
- package/dist/jsx/shared/focusManagement.native.js +24 -11
- package/dist/jsx/shared/focusManagement.native.js.map +1 -1
- package/package.json +8 -7
- package/src/Button/Button.labelInk.spec.tsx +21 -18
- package/src/Button/Button.outlinedChannel.spec.tsx +46 -0
- package/src/Button/Button.sizeLadder.spec.tsx +4 -3
- package/src/Button/Button.stories.tsx +20 -0
- package/src/Button/index.tsx +25 -4
- package/src/Chip/Chip.spec.tsx +3 -1
- package/src/Chip/index.tsx +1 -5
- package/src/FieldLayout.stories.tsx +41 -0
- package/src/FloatingPanel/FloatingPanel.native.spec.tsx +54 -0
- package/src/FloatingPanel/FloatingPanel.spec.tsx +109 -0
- package/src/FloatingPanel/index.native.tsx +24 -7
- package/src/FloatingPanel/index.tsx +80 -13
- package/src/FloatingPanel/nestedAction.spec.ts +36 -0
- package/src/FloatingPanel/nestedAction.ts +15 -0
- package/src/FloatingPanel/panelWidthContract.spec.ts +12 -15
- package/src/FormsIntegration.stories.tsx +2 -6
- package/src/InputParts/index.tsx +15 -5
- package/src/InputParts/layoutGap.spec.tsx +43 -0
- package/src/Wheel/Wheel.spec.tsx +16 -0
- package/src/Wheel/index.tsx +3 -3
- package/src/fieldLayout.spec.tsx +42 -1
- package/src/fieldLayout.tsx +9 -9
- package/src/fields/Checkbox/CheckboxFieldFrame.spec.tsx +18 -0
- package/src/fields/Checkbox/CheckboxFieldFrame.tsx +6 -1
- package/src/fields/Combobox/Combobox.spec.tsx +48 -1
- package/src/fields/Combobox/index.tsx +53 -39
- package/src/fields/DatePicker/Calendar.tsx +4 -1
- package/src/fields/DatePicker/DatePicker.stories.tsx +22 -1
- package/src/fields/DatePicker/DateRangePicker.tsx +4 -2
- package/src/fields/DatePicker/DatetimePicker.catalog.tsx +21 -19
- package/src/fields/DatePicker/DatetimePicker.native.spec.tsx +144 -0
- package/src/fields/DatePicker/DatetimePicker.native.tsx +57 -32
- package/src/fields/DatePicker/DatetimePicker.stories.tsx +22 -0
- package/src/fields/DatePicker/MonthPicker.tsx +8 -3
- package/src/fields/DatePicker/MultiDatePicker.tsx +4 -2
- package/src/fields/DatePicker/index.native.tsx +1 -0
- package/src/fields/DatePicker/parts.spec.tsx +56 -0
- package/src/fields/DatePicker/parts.tsx +33 -12
- package/src/fields/Geolocation/Geolocation.spec.tsx +287 -35
- package/src/fields/Geolocation/Geolocation.stories.tsx +141 -7
- package/src/fields/Geolocation/GeolocationMap.native.tsx +3 -0
- package/src/fields/Geolocation/GeolocationMap.tsx +4 -0
- package/src/fields/Geolocation/geocoder.spec.ts +59 -0
- package/src/fields/Geolocation/geocoder.ts +84 -0
- package/src/fields/Geolocation/geocoderSeam.spec.tsx +203 -0
- package/src/fields/Geolocation/index.tsx +912 -180
- package/src/fields/Geolocation/nativeSearchFocus.spec.ts +34 -0
- package/src/fields/Geolocation/nativeSearchFocus.ts +19 -0
- package/src/fields/Geolocation/salvage.spec.tsx +398 -0
- package/src/fields/Geolocation/storyProviders.spec.tsx +44 -0
- package/src/fields/Icon/Icon.spec.tsx +215 -1
- package/src/fields/Icon/Icon.stories.tsx +9 -1
- package/src/fields/Icon/drawnSet.tsx +39 -4
- package/src/fields/Icon/index.tsx +118 -18
- package/src/fields/Input/Input.copy.spec.tsx +1 -0
- package/src/fields/Input/Input.spec.tsx +50 -0
- package/src/fields/Input/Input.stories.tsx +1 -1
- package/src/fields/Input/index.tsx +7 -13
- package/src/fields/PhoneInput/index.tsx +2 -2
- package/src/fields/SearchInput/SearchInput.spec.tsx +14 -0
- package/src/fields/SearchInput/index.tsx +5 -6
- package/src/fields/Select/Select.spec.tsx +54 -0
- package/src/fields/Select/index.tsx +52 -17
- package/src/fields/Stepper/Stepper.spec.tsx +34 -1
- package/src/fields/Stepper/index.tsx +193 -33
- package/src/index.ts +9 -0
- package/src/shared/focusManagement.spec.tsx +68 -0
- package/src/shared/focusManagement.ts +20 -10
- package/types/Button/index.d.ts +22 -3
- package/types/Button/index.d.ts.map +1 -1
- package/types/Chip/index.d.ts.map +1 -1
- package/types/FloatingPanel/index.d.ts +11 -1
- package/types/FloatingPanel/index.d.ts.map +1 -1
- package/types/FloatingPanel/index.native.d.ts +2 -1
- package/types/FloatingPanel/index.native.d.ts.map +1 -1
- package/types/FloatingPanel/nestedAction.d.ts +13 -0
- package/types/FloatingPanel/nestedAction.d.ts.map +1 -0
- package/types/InputParts/index.d.ts.map +1 -1
- package/types/fields/Checkbox/CheckboxFieldFrame.d.ts +46 -2
- package/types/fields/Checkbox/CheckboxFieldFrame.d.ts.map +1 -1
- package/types/fields/Checkbox/index.d.ts +3 -3
- package/types/fields/Combobox/index.d.ts +3 -1
- package/types/fields/Combobox/index.d.ts.map +1 -1
- package/types/fields/DatePicker/Calendar.d.ts.map +1 -1
- package/types/fields/DatePicker/DateRangePicker.d.ts.map +1 -1
- package/types/fields/DatePicker/DatetimePicker.catalog.d.ts.map +1 -1
- package/types/fields/DatePicker/DatetimePicker.native.d.ts.map +1 -1
- package/types/fields/DatePicker/MonthPicker.d.ts.map +1 -1
- package/types/fields/DatePicker/MultiDatePicker.d.ts.map +1 -1
- package/types/fields/DatePicker/index.native.d.ts.map +1 -1
- package/types/fields/DatePicker/parts.d.ts.map +1 -1
- package/types/fields/Geolocation/GeolocationMap.d.ts +4 -0
- package/types/fields/Geolocation/GeolocationMap.d.ts.map +1 -1
- package/types/fields/Geolocation/GeolocationMap.native.d.ts +3 -0
- package/types/fields/Geolocation/GeolocationMap.native.d.ts.map +1 -1
- package/types/fields/Geolocation/geocoder.d.ts +53 -0
- package/types/fields/Geolocation/geocoder.d.ts.map +1 -0
- package/types/fields/Geolocation/index.d.ts +18 -2
- package/types/fields/Geolocation/index.d.ts.map +1 -1
- package/types/fields/Geolocation/nativeSearchFocus.d.ts +8 -0
- package/types/fields/Geolocation/nativeSearchFocus.d.ts.map +1 -0
- package/types/fields/Icon/drawnSet.d.ts.map +1 -1
- package/types/fields/Icon/index.d.ts.map +1 -1
- package/types/fields/Input/index.d.ts.map +1 -1
- package/types/fields/PhoneInput/index.d.ts.map +1 -1
- package/types/fields/RadioGroup/index.d.ts +2 -2
- package/types/fields/SearchInput/index.d.ts.map +1 -1
- package/types/fields/Select/index.d.ts.map +1 -1
- package/types/fields/Stepper/index.d.ts.map +1 -1
- package/types/fields/ToggleGroup/index.d.ts +1 -1
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -1
- package/types/shared/focusManagement.d.ts +2 -2
- package/types/shared/focusManagement.d.ts.map +1 -1
- package/src/router.d.ts +0 -16
|
@@ -25,7 +25,13 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
|
25
25
|
var Geolocation_exports = {};
|
|
26
26
|
__export(Geolocation_exports, {
|
|
27
27
|
Geolocation: () => Geolocation,
|
|
28
|
-
|
|
28
|
+
clampLat: () => import_geocoder2.clampLat,
|
|
29
|
+
clampLng: () => import_geocoder2.clampLng,
|
|
30
|
+
formatCoordPair: () => import_geocoder2.formatCoordPair,
|
|
31
|
+
formatPlace: () => import_geocoder2.formatPlace,
|
|
32
|
+
parseLatLngPair: () => import_geocoder2.parseLatLngPair,
|
|
33
|
+
preflightGeolocation: () => preflightGeolocation,
|
|
34
|
+
resolveGeocoder: () => import_geocoder2.resolveGeocoder
|
|
29
35
|
});
|
|
30
36
|
module.exports = __toCommonJS(Geolocation_exports);
|
|
31
37
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -37,14 +43,39 @@ var import_AdaptivePopup = require("../../AdaptivePopup/index.native.js");
|
|
|
37
43
|
var import_Button = require("../../Button/index.native.js");
|
|
38
44
|
var import_fieldLayout = require("../../fieldLayout.native.js");
|
|
39
45
|
var import_FloatingPanel = require("../../FloatingPanel/index.native.js");
|
|
40
|
-
var import_GeolocationMap = require("./GeolocationMap.native.js");
|
|
41
|
-
var import_geoValue = require("./geoValue.native.js");
|
|
42
46
|
var import_InputParts = require("../../InputParts/index.native.js");
|
|
43
47
|
var import_Skeleton = require("../../Skeleton/index.native.js");
|
|
48
|
+
var import_GeolocationMap = require("./GeolocationMap.native.js");
|
|
49
|
+
var import_nativeSearchFocus = require("./nativeSearchFocus.native.js");
|
|
50
|
+
var import_geoValue = require("./geoValue.native.js");
|
|
44
51
|
var import_capabilityPreflight = require("../../shared/capabilityPreflight.native.js");
|
|
45
52
|
var import_colorRamps = require("../../shared/colorRamps.native.js");
|
|
46
53
|
var import_t = require("../../shared/t.native.js");
|
|
54
|
+
var import_pressSlopProps = require("../../shared/pressSlopProps.native.js");
|
|
55
|
+
var import_tableCellContext = require("../../shared/tableCellContext.native.js");
|
|
56
|
+
var import_zIndex = require("../../shared/zIndex.native.js");
|
|
47
57
|
var import_utils = require("../../shared/utils.native.js");
|
|
58
|
+
var import_geocoder = require("./geocoder.native.js");
|
|
59
|
+
var import_geocoder2 = require("./geocoder.native.js");
|
|
60
|
+
function _instanceof(left, right) {
|
|
61
|
+
"@swc/helpers - instanceof";
|
|
62
|
+
|
|
63
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
64
|
+
return !!right[Symbol.hasInstance](left);
|
|
65
|
+
} else {
|
|
66
|
+
return left instanceof right;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function coordinateKey(param) {
|
|
70
|
+
var {
|
|
71
|
+
lat,
|
|
72
|
+
lng
|
|
73
|
+
} = param;
|
|
74
|
+
return `${lat},${lng}`;
|
|
75
|
+
}
|
|
76
|
+
var SEARCH_DEBOUNCE_MS = 300;
|
|
77
|
+
var COORD_LINE_HEIGHT = 28;
|
|
78
|
+
var RESULTS_PANEL_SHADOW = "0px 8px 28px rgba(0,0,0,0.12), 0px 2px 6px rgba(0,0,0,0.04)";
|
|
48
79
|
async function preflightGeolocation() {
|
|
49
80
|
if (typeof navigator === "undefined" || !navigator.geolocation) {
|
|
50
81
|
var insecure = typeof window !== "undefined" && window.isSecureContext === false;
|
|
@@ -77,15 +108,6 @@ function mapGeolocationError(err) {
|
|
|
77
108
|
}
|
|
78
109
|
return err.message || (0, import_t.t)("Failed to get location");
|
|
79
110
|
}
|
|
80
|
-
function clampLat(val) {
|
|
81
|
-
return Math.max(-90, Math.min(90, val));
|
|
82
|
-
}
|
|
83
|
-
function clampLng(val) {
|
|
84
|
-
return Math.max(-180, Math.min(180, val));
|
|
85
|
-
}
|
|
86
|
-
function formatCoordChip(lat, lng) {
|
|
87
|
-
return `${lat.toFixed(4)}, ${lng.toFixed(4)}`;
|
|
88
|
-
}
|
|
89
111
|
function tryParseCoord(text, clamp) {
|
|
90
112
|
var trimmed = text.trim();
|
|
91
113
|
if (trimmed === "" || trimmed === "-" || trimmed === "." || trimmed === "-.") return void 0;
|
|
@@ -133,8 +155,8 @@ function CoordinatesPanel(param) {
|
|
|
133
155
|
var flushDraft = (0, import_react2.useCallback)(function () {
|
|
134
156
|
var rawLat = Number.parseFloat(latTextRef.current);
|
|
135
157
|
var rawLng = Number.parseFloat(lngTextRef.current);
|
|
136
|
-
var nextLat = Number.isNaN(rawLat) ? committedRef.current.lat : clampLat(rawLat);
|
|
137
|
-
var nextLng = Number.isNaN(rawLng) ? committedRef.current.lng : clampLng(rawLng);
|
|
158
|
+
var nextLat = Number.isNaN(rawLat) ? committedRef.current.lat : (0, import_geocoder.clampLat)(rawLat);
|
|
159
|
+
var nextLng = Number.isNaN(rawLng) ? committedRef.current.lng : (0, import_geocoder.clampLng)(rawLng);
|
|
138
160
|
commitPair(nextLat, nextLng);
|
|
139
161
|
}, [commitPair]);
|
|
140
162
|
(0, import_react2.useEffect)(function () {
|
|
@@ -146,7 +168,7 @@ function CoordinatesPanel(param) {
|
|
|
146
168
|
var handleLatChange = function handleLatChange2(text) {
|
|
147
169
|
setLatText(text);
|
|
148
170
|
latTextRef.current = text;
|
|
149
|
-
var parsed = tryParseCoord(text, clampLat);
|
|
171
|
+
var parsed = tryParseCoord(text, import_geocoder.clampLat);
|
|
150
172
|
if (parsed !== void 0) {
|
|
151
173
|
commitPair(parsed, committedRef.current.lng);
|
|
152
174
|
}
|
|
@@ -154,7 +176,7 @@ function CoordinatesPanel(param) {
|
|
|
154
176
|
var handleLngChange = function handleLngChange2(text) {
|
|
155
177
|
setLngText(text);
|
|
156
178
|
lngTextRef.current = text;
|
|
157
|
-
var parsed = tryParseCoord(text, clampLng);
|
|
179
|
+
var parsed = tryParseCoord(text, import_geocoder.clampLng);
|
|
158
180
|
if (parsed !== void 0) {
|
|
159
181
|
commitPair(committedRef.current.lat, parsed);
|
|
160
182
|
}
|
|
@@ -242,8 +264,143 @@ function ExpandedMapView(param) {
|
|
|
242
264
|
});
|
|
243
265
|
}
|
|
244
266
|
var overlayFocusRing = (0, import_theme.ensureFocusVisibleRing)({
|
|
245
|
-
outlineOffset:
|
|
267
|
+
outlineOffset: 0
|
|
246
268
|
});
|
|
269
|
+
function ResultRow(param) {
|
|
270
|
+
var {
|
|
271
|
+
testID,
|
|
272
|
+
label,
|
|
273
|
+
description,
|
|
274
|
+
onPress,
|
|
275
|
+
disabled
|
|
276
|
+
} = param;
|
|
277
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
278
|
+
testID,
|
|
279
|
+
role: "option",
|
|
280
|
+
"aria-selected": false,
|
|
281
|
+
"aria-disabled": disabled || void 0,
|
|
282
|
+
...(import_tamagui.isWeb ? {
|
|
283
|
+
tabIndex: disabled ? -1 : 0,
|
|
284
|
+
onKeyDown: function onKeyDown(event) {
|
|
285
|
+
if (disabled) return;
|
|
286
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
287
|
+
event.preventDefault();
|
|
288
|
+
onPress();
|
|
289
|
+
} else if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
290
|
+
var _ref;
|
|
291
|
+
var _event_currentTarget_parentElement, _rows_;
|
|
292
|
+
event.preventDefault();
|
|
293
|
+
var rows = [...((_ref = (_event_currentTarget_parentElement = event.currentTarget.parentElement) === null || _event_currentTarget_parentElement === void 0 ? void 0 : _event_currentTarget_parentElement.querySelectorAll("[role='option']:not([aria-disabled='true'])")) !== null && _ref !== void 0 ? _ref : [])];
|
|
294
|
+
var index = rows.indexOf(event.currentTarget);
|
|
295
|
+
(_rows_ = rows[(index + (event.key === "ArrowDown" ? 1 : -1) + rows.length) % rows.length]) === null || _rows_ === void 0 ? void 0 : _rows_.focus();
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
} : {}),
|
|
299
|
+
minHeight: description ? 62 : 44,
|
|
300
|
+
justifyContent: "center",
|
|
301
|
+
paddingHorizontal: "$3",
|
|
302
|
+
paddingVertical: description ? "$2" : 0,
|
|
303
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
304
|
+
hoverStyle: disabled ? void 0 : {
|
|
305
|
+
backgroundColor: "$color3"
|
|
306
|
+
},
|
|
307
|
+
pressStyle: disabled ? void 0 : {
|
|
308
|
+
backgroundColor: "$color3"
|
|
309
|
+
},
|
|
310
|
+
onPress: disabled ? void 0 : onPress,
|
|
311
|
+
opacity: disabled ? 0.5 : 1,
|
|
312
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
313
|
+
fontSize: "$4",
|
|
314
|
+
lineHeight: 25,
|
|
315
|
+
color: "$color12",
|
|
316
|
+
children: label
|
|
317
|
+
}), description ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
318
|
+
fontSize: "$3",
|
|
319
|
+
lineHeight: 24,
|
|
320
|
+
color: import_colorRamps.formCommonColors.muted,
|
|
321
|
+
children: description
|
|
322
|
+
}) : null]
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
function StatusRow(param) {
|
|
326
|
+
var {
|
|
327
|
+
children,
|
|
328
|
+
testID
|
|
329
|
+
} = param;
|
|
330
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.XStack, {
|
|
331
|
+
testID,
|
|
332
|
+
minHeight: 44,
|
|
333
|
+
alignItems: "center",
|
|
334
|
+
paddingHorizontal: "$3",
|
|
335
|
+
role: "status",
|
|
336
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
337
|
+
fontSize: "$4",
|
|
338
|
+
lineHeight: 25,
|
|
339
|
+
color: import_colorRamps.formCommonColors.muted,
|
|
340
|
+
children
|
|
341
|
+
})
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
function SearchResultsList(param) {
|
|
345
|
+
var {
|
|
346
|
+
listId,
|
|
347
|
+
status,
|
|
348
|
+
query,
|
|
349
|
+
results,
|
|
350
|
+
pair,
|
|
351
|
+
onLocate,
|
|
352
|
+
onPick,
|
|
353
|
+
onPickPair,
|
|
354
|
+
locateDisabled
|
|
355
|
+
} = param;
|
|
356
|
+
var showLocate = status === "idle" || status === "results" || pair != null;
|
|
357
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
358
|
+
testID: "geolocation-results",
|
|
359
|
+
id: listId,
|
|
360
|
+
overflow: "hidden",
|
|
361
|
+
...(import_tamagui.isWeb ?
|
|
362
|
+
// role="listbox" is a valid ARIA role but outside RN's `Role` union;
|
|
363
|
+
// this web-only bag forwards it to the DOM node (house Record cast).
|
|
364
|
+
{
|
|
365
|
+
role: "listbox"
|
|
366
|
+
} : void 0),
|
|
367
|
+
children: [showLocate ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(ResultRow, {
|
|
368
|
+
testID: "geolocation-use-location",
|
|
369
|
+
label: (0, import_t.t)("Use my current location"),
|
|
370
|
+
onPress: onLocate,
|
|
371
|
+
disabled: locateDisabled
|
|
372
|
+
}) : null, status === "searching" ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(StatusRow, {
|
|
373
|
+
testID: "geolocation-search-status",
|
|
374
|
+
children: (0, import_t.t)("Searching\u2026")
|
|
375
|
+
}) : null, status === "error" ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(StatusRow, {
|
|
376
|
+
testID: "geolocation-search-status",
|
|
377
|
+
children: (0, import_t.t)("Search is unavailable \u2014 check your connection")
|
|
378
|
+
}) : null, status === "empty" && !pair ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(StatusRow, {
|
|
379
|
+
testID: "geolocation-search-status",
|
|
380
|
+
children: (0, import_t.t)('No places match "{{query}}"', {
|
|
381
|
+
query
|
|
382
|
+
})
|
|
383
|
+
}) : null, pair ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(ResultRow, {
|
|
384
|
+
testID: "geolocation-coord-result",
|
|
385
|
+
label: (0, import_t.t)("Go to {{pair}}", {
|
|
386
|
+
pair: (0, import_geocoder.formatCoordPair)(pair.lat, pair.lng)
|
|
387
|
+
}),
|
|
388
|
+
description: (0, import_t.t)("Exact coordinates \u2014 no address"),
|
|
389
|
+
onPress: function onPress() {
|
|
390
|
+
return onPickPair(pair.lat, pair.lng);
|
|
391
|
+
}
|
|
392
|
+
}) : null, status === "results" ? results.map(function (result, index) {
|
|
393
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(ResultRow, {
|
|
394
|
+
testID: `geolocation-result-${index}`,
|
|
395
|
+
label: result.label,
|
|
396
|
+
description: result.description,
|
|
397
|
+
onPress: function onPress() {
|
|
398
|
+
return onPick(result);
|
|
399
|
+
}
|
|
400
|
+
}, `${result.lat},${result.lng},${index}`);
|
|
401
|
+
}) : null]
|
|
402
|
+
});
|
|
403
|
+
}
|
|
247
404
|
function GeoMapSurface(param) {
|
|
248
405
|
var {
|
|
249
406
|
id,
|
|
@@ -288,7 +445,7 @@ function GeoMapSurface(param) {
|
|
|
288
445
|
};
|
|
289
446
|
var handleMapKeyDown = function handleMapKeyDown2(event) {
|
|
290
447
|
if (!interactive) return;
|
|
291
|
-
if (event.key === "Enter") {
|
|
448
|
+
if (event.key === "Enter" && hasValue) {
|
|
292
449
|
event.preventDefault();
|
|
293
450
|
setCoordsOpen(true);
|
|
294
451
|
return;
|
|
@@ -297,7 +454,7 @@ function GeoMapSurface(param) {
|
|
|
297
454
|
var step = event.shiftKey ? 0.01 : 1e-3;
|
|
298
455
|
var nextLat = coordinates.lat;
|
|
299
456
|
var nextLng = coordinates.lng;
|
|
300
|
-
if (event.key === "ArrowUp") nextLat = clampLat(nextLat + step);else if (event.key === "ArrowDown") nextLat = clampLat(nextLat - step);else if (event.key === "ArrowLeft") nextLng = clampLng(nextLng - step);else if (event.key === "ArrowRight") nextLng = clampLng(nextLng + step);else return;
|
|
457
|
+
if (event.key === "ArrowUp") nextLat = (0, import_geocoder.clampLat)(nextLat + step);else if (event.key === "ArrowDown") nextLat = (0, import_geocoder.clampLat)(nextLat - step);else if (event.key === "ArrowLeft") nextLng = (0, import_geocoder.clampLng)(nextLng - step);else if (event.key === "ArrowRight") nextLng = (0, import_geocoder.clampLng)(nextLng + step);else return;
|
|
301
458
|
event.preventDefault();
|
|
302
459
|
onMapChange(nextLat, nextLng);
|
|
303
460
|
};
|
|
@@ -308,7 +465,68 @@ function GeoMapSurface(param) {
|
|
|
308
465
|
disabled,
|
|
309
466
|
knobProps
|
|
310
467
|
}) : null;
|
|
311
|
-
|
|
468
|
+
var coordLine = readOnly || disabled ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.XStack, {
|
|
469
|
+
testID: "geolocation-coordline",
|
|
470
|
+
alignItems: "center",
|
|
471
|
+
minHeight: COORD_LINE_HEIGHT,
|
|
472
|
+
paddingHorizontal: "$2",
|
|
473
|
+
hitSlop: (0, import_theme.pressTargetHitSlop)(COORD_LINE_HEIGHT),
|
|
474
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
475
|
+
fontFamily: "$mono",
|
|
476
|
+
fontSize: 12,
|
|
477
|
+
lineHeight: 22,
|
|
478
|
+
color: import_colorRamps.formCommonColors.muted,
|
|
479
|
+
children: hasValue ? (0, import_geocoder.formatCoordPair)(mapLat, mapLng) : (0, import_t.t)("Enter coordinates")
|
|
480
|
+
})
|
|
481
|
+
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_FloatingPanel.FloatingPanel, {
|
|
482
|
+
open: coordsOpen,
|
|
483
|
+
onOpenChange: handleCoordsOpenChange,
|
|
484
|
+
disabled,
|
|
485
|
+
fitContent: false,
|
|
486
|
+
sizing: "fill",
|
|
487
|
+
contentPadding: "none",
|
|
488
|
+
trigger: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.XStack, {
|
|
489
|
+
testID: "geolocation-coordline",
|
|
490
|
+
alignItems: "center",
|
|
491
|
+
minHeight: COORD_LINE_HEIGHT,
|
|
492
|
+
paddingHorizontal: "$2",
|
|
493
|
+
cursor: "pointer",
|
|
494
|
+
...(0, import_pressSlopProps.pressSlopProps)(COORD_LINE_HEIGHT, true),
|
|
495
|
+
hoverStyle: {
|
|
496
|
+
backgroundColor: "$color3"
|
|
497
|
+
},
|
|
498
|
+
focusVisibleStyle: overlayFocusRing,
|
|
499
|
+
...(import_tamagui.isWeb ? {
|
|
500
|
+
tabIndex: 0,
|
|
501
|
+
role: "button",
|
|
502
|
+
"aria-label": (0, import_t.t)("Edit coordinates"),
|
|
503
|
+
onKeyDown: function onKeyDown(event) {
|
|
504
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
505
|
+
event.preventDefault();
|
|
506
|
+
setCoordsOpen(true);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
} : {}),
|
|
510
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
511
|
+
fontFamily: "$mono",
|
|
512
|
+
fontSize: 12,
|
|
513
|
+
lineHeight: 22,
|
|
514
|
+
color: import_colorRamps.formCommonColors.muted,
|
|
515
|
+
children: hasValue ? (0, import_geocoder.formatCoordPair)(mapLat, mapLng) : (0, import_t.t)("Enter coordinates")
|
|
516
|
+
})
|
|
517
|
+
}),
|
|
518
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(CoordinatesPanel, {
|
|
519
|
+
lat: mapLat,
|
|
520
|
+
lng: mapLng,
|
|
521
|
+
knobProps,
|
|
522
|
+
required,
|
|
523
|
+
hasError,
|
|
524
|
+
flushRef: coordsFlushRef,
|
|
525
|
+
onCommit: onCommitCoordinates
|
|
526
|
+
})
|
|
527
|
+
});
|
|
528
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
529
|
+
gap: "$2",
|
|
312
530
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
313
531
|
testID: "geolocation-map",
|
|
314
532
|
id,
|
|
@@ -330,7 +548,7 @@ function GeoMapSurface(param) {
|
|
|
330
548
|
tabIndex: 0,
|
|
331
549
|
role: "application",
|
|
332
550
|
"aria-label": (0, import_t.t)("Location map"),
|
|
333
|
-
"aria-valuetext": hasValue ?
|
|
551
|
+
"aria-valuetext": hasValue ? (0, import_geocoder.formatCoordPair)(mapLat, mapLng) : (0, import_t.t)("No location set"),
|
|
334
552
|
onKeyDown: handleMapKeyDown
|
|
335
553
|
} : {}),
|
|
336
554
|
children: [customMap !== null && customMap !== void 0 ? customMap : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_GeolocationMap.GeolocationMap, {
|
|
@@ -341,62 +559,34 @@ function GeoMapSurface(param) {
|
|
|
341
559
|
disabled,
|
|
342
560
|
readOnly,
|
|
343
561
|
hasValue
|
|
344
|
-
}),
|
|
345
|
-
|
|
562
|
+
}), !hasValue && !locateErrorOpen ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
563
|
+
testID: "geolocation-empty",
|
|
346
564
|
position: "absolute",
|
|
347
|
-
top:
|
|
348
|
-
|
|
565
|
+
top: 0,
|
|
566
|
+
right: 0,
|
|
567
|
+
bottom: 0,
|
|
568
|
+
left: 0,
|
|
349
569
|
zIndex: 2,
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
356
|
-
testID: "geolocation-coords-chip",
|
|
357
|
-
fontSize: "$1",
|
|
570
|
+
alignItems: "center",
|
|
571
|
+
justifyContent: "center",
|
|
572
|
+
gap: "$2",
|
|
573
|
+
pointerEvents: "box-none",
|
|
574
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
358
575
|
...knobProps.body,
|
|
359
576
|
color: import_colorRamps.formCommonColors.muted,
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
disabled,
|
|
371
|
-
fitContent: true,
|
|
372
|
-
sizing: "fill",
|
|
373
|
-
contentPadding: "none",
|
|
374
|
-
trigger: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Button.Button, {
|
|
375
|
-
size: "$2",
|
|
376
|
-
disabled,
|
|
377
|
-
backgroundColor: "$background",
|
|
378
|
-
opacity: 0.92,
|
|
379
|
-
testID: "geolocation-coords-chip",
|
|
380
|
-
"aria-label": (0, import_t.t)("Edit coordinates"),
|
|
381
|
-
focusVisibleStyle: overlayFocusRing,
|
|
382
|
-
onPress: import_tamagui.isWeb && !disabled ? function () {
|
|
383
|
-
return setCoordsOpen(true);
|
|
384
|
-
} : void 0,
|
|
385
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Button.Button.Text, {
|
|
386
|
-
children: hasValue ? formatCoordChip(mapLat, mapLng) : (0, import_t.t)("Set location")
|
|
387
|
-
})
|
|
388
|
-
}),
|
|
389
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(CoordinatesPanel, {
|
|
390
|
-
lat: mapLat,
|
|
391
|
-
lng: mapLng,
|
|
392
|
-
knobProps,
|
|
393
|
-
required,
|
|
394
|
-
hasError,
|
|
395
|
-
flushRef: coordsFlushRef,
|
|
396
|
-
onCommit: onCommitCoordinates
|
|
577
|
+
pointerEvents: "none",
|
|
578
|
+
children: (0, import_t.t)("No location set")
|
|
579
|
+
}), !readOnly && !disabled ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Button.Button, {
|
|
580
|
+
size: "$4",
|
|
581
|
+
onPress: onUseMyLocation,
|
|
582
|
+
disabled: locating,
|
|
583
|
+
testID: "geolocation-empty-locate",
|
|
584
|
+
"aria-label": (0, import_t.t)("Use my current location"),
|
|
585
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Button.Button.Text, {
|
|
586
|
+
children: (0, import_t.t)("Use my current location")
|
|
397
587
|
})
|
|
398
|
-
})
|
|
399
|
-
}), handleExpand && expandIcon && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
588
|
+
}) : null]
|
|
589
|
+
}) : null, handleExpand && expandIcon && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
400
590
|
position: "absolute",
|
|
401
591
|
top: "$2",
|
|
402
592
|
insetInlineEnd: "$2",
|
|
@@ -407,13 +597,12 @@ function GeoMapSurface(param) {
|
|
|
407
597
|
disabled,
|
|
408
598
|
onPress: handleExpand,
|
|
409
599
|
backgroundColor: "$background",
|
|
410
|
-
opacity: 0.92,
|
|
411
600
|
"aria-label": (0, import_t.t)("Expand map"),
|
|
412
601
|
focusVisibleStyle: overlayFocusRing,
|
|
602
|
+
hitSlop: (0, import_theme.pressTargetHitSlop)(32),
|
|
413
603
|
children: expandIcon
|
|
414
604
|
})
|
|
415
|
-
}),
|
|
416
|
-
!readOnly && !locateErrorOpen && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
605
|
+
}), !readOnly && !locateErrorOpen && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
417
606
|
position: "absolute",
|
|
418
607
|
bottom: "$2",
|
|
419
608
|
insetInlineEnd: "$2",
|
|
@@ -424,19 +613,14 @@ function GeoMapSurface(param) {
|
|
|
424
613
|
disabled: disabled || locating,
|
|
425
614
|
onPress: onUseMyLocation,
|
|
426
615
|
backgroundColor: "$background",
|
|
427
|
-
opacity: 0.92,
|
|
428
616
|
icon: locating ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Spinner, {
|
|
429
617
|
size: "small"
|
|
430
618
|
}) : locationIcon,
|
|
431
619
|
"aria-label": locating ? (0, import_t.t)("Locating") : (0, import_t.t)("Locate"),
|
|
432
|
-
focusVisibleStyle: overlayFocusRing
|
|
620
|
+
focusVisibleStyle: overlayFocusRing,
|
|
621
|
+
hitSlop: (0, import_theme.pressTargetHitSlop)(32)
|
|
433
622
|
})
|
|
434
|
-
}),
|
|
435
|
-
/*
|
|
436
|
-
LC-19: locate error stays on the map (Retry + Close) — never
|
|
437
|
-
mount-fail-unmount, never a layout-jumping sibling under the field.
|
|
438
|
-
*/
|
|
439
|
-
locateErrorOpen && /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
623
|
+
}), locateErrorOpen && /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
440
624
|
testID: "geolocation-locate-panel",
|
|
441
625
|
position: "absolute",
|
|
442
626
|
bottom: "$2",
|
|
@@ -469,7 +653,7 @@ function GeoMapSurface(param) {
|
|
|
469
653
|
})]
|
|
470
654
|
})]
|
|
471
655
|
})]
|
|
472
|
-
}), expandIcon && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_AdaptivePopup.AdaptivePopup, {
|
|
656
|
+
}), coordLine, expandIcon && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_AdaptivePopup.AdaptivePopup, {
|
|
473
657
|
open: expanded,
|
|
474
658
|
onOpenChange: setExpanded,
|
|
475
659
|
title: (0, import_t.t)("Select Location"),
|
|
@@ -485,9 +669,46 @@ function GeoMapSurface(param) {
|
|
|
485
669
|
})]
|
|
486
670
|
});
|
|
487
671
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
672
|
+
function CellFace(param) {
|
|
673
|
+
var {
|
|
674
|
+
address,
|
|
675
|
+
coordinates,
|
|
676
|
+
onOpen
|
|
677
|
+
} = param;
|
|
678
|
+
var glyphColor = (0, import_theme.useGlyphColor)();
|
|
679
|
+
var text = address ? address : coordinates ? (0, import_geocoder.formatCoordPair)(coordinates.lat, coordinates.lng) : (0, import_t.t)("No location set");
|
|
680
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {
|
|
681
|
+
testID: "geolocation-cell-face",
|
|
682
|
+
...(import_tamagui.isWeb && onOpen ? {
|
|
683
|
+
tabIndex: 0,
|
|
684
|
+
role: "button",
|
|
685
|
+
"aria-label": (0, import_t.t)("Edit location"),
|
|
686
|
+
onKeyDown: function onKeyDown(event) {
|
|
687
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
688
|
+
event.preventDefault();
|
|
689
|
+
onOpen();
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
} : {}),
|
|
693
|
+
alignItems: "center",
|
|
694
|
+
gap: "$2",
|
|
695
|
+
minHeight: 44,
|
|
696
|
+
minWidth: 0,
|
|
697
|
+
flex: 1,
|
|
698
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.MapPinIcon, {
|
|
699
|
+
size: 14,
|
|
700
|
+
color: glyphColor
|
|
701
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
702
|
+
fontSize: "$3",
|
|
703
|
+
lineHeight: 24,
|
|
704
|
+
color: "$color12",
|
|
705
|
+
numberOfLines: 1,
|
|
706
|
+
flex: 1,
|
|
707
|
+
minWidth: 0,
|
|
708
|
+
children: text
|
|
709
|
+
})]
|
|
710
|
+
});
|
|
711
|
+
}
|
|
491
712
|
function Geolocation(param) {
|
|
492
713
|
var {
|
|
493
714
|
name,
|
|
@@ -506,11 +727,14 @@ function Geolocation(param) {
|
|
|
506
727
|
onBlur,
|
|
507
728
|
disabled,
|
|
508
729
|
readOnly,
|
|
509
|
-
locationIcon
|
|
730
|
+
locationIcon,
|
|
510
731
|
expandIcon,
|
|
511
732
|
renderMap,
|
|
512
733
|
skeleton,
|
|
513
|
-
compact
|
|
734
|
+
compact,
|
|
735
|
+
geocode: geocodeProp,
|
|
736
|
+
reverseGeocode: reverseGeocodeProp,
|
|
737
|
+
geocoder
|
|
514
738
|
} = param;
|
|
515
739
|
var {
|
|
516
740
|
resolvedForm,
|
|
@@ -522,14 +746,87 @@ function Geolocation(param) {
|
|
|
522
746
|
compact
|
|
523
747
|
});
|
|
524
748
|
var resolvedValidators = (0, import_utils.useResolvedValidators)(required, validators, label, name);
|
|
749
|
+
var glyphColor = (0, import_theme.useGlyphColor)();
|
|
750
|
+
var resolvedLocationIcon = locationIcon === void 0 ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.NavigationArrowIcon, {
|
|
751
|
+
size: 16,
|
|
752
|
+
color: glyphColor
|
|
753
|
+
}) : locationIcon;
|
|
754
|
+
var inTableCell = (0, import_tableCellContext.useIsInTableCell)();
|
|
755
|
+
var viewportGtSm = (0, import_FloatingPanel.useViewportGtSm)();
|
|
756
|
+
var shouldUseSheet = !import_tamagui.isWeb || !viewportGtSm;
|
|
757
|
+
var {
|
|
758
|
+
geocode,
|
|
759
|
+
reverseGeocode
|
|
760
|
+
} = (0, import_geocoder.resolveGeocoder)({
|
|
761
|
+
geocode: geocodeProp,
|
|
762
|
+
reverseGeocode: reverseGeocodeProp,
|
|
763
|
+
geocoder
|
|
764
|
+
});
|
|
765
|
+
var searchEnabled = Boolean(geocode) && !disabled && !readOnly;
|
|
766
|
+
var listId = (0, import_react2.useId)();
|
|
525
767
|
var [locatePhase, setLocatePhase] = (0, import_react2.useState)("idle");
|
|
526
768
|
var [locateError, setLocateError] = (0, import_react2.useState)(null);
|
|
527
769
|
var [preflightError, setPreflightError] = (0, import_react2.useState)();
|
|
770
|
+
var [address, setAddress] = (0, import_react2.useState)(null);
|
|
771
|
+
var [query, setQuery] = (0, import_react2.useState)("");
|
|
772
|
+
var [resultsOpen, setResultsOpen] = (0, import_react2.useState)(false);
|
|
773
|
+
var [searchStatus, setSearchStatus] = (0, import_react2.useState)("idle");
|
|
774
|
+
var [results, setResults] = (0, import_react2.useState)([]);
|
|
775
|
+
var [cellOpen, setCellOpen] = (0, import_react2.useState)(false);
|
|
528
776
|
var preflightingRef = (0, import_react2.useRef)(false);
|
|
529
777
|
var onValueChangeRef = (0, import_react2.useRef)(function () {});
|
|
530
778
|
var currentValueRef = (0, import_react2.useRef)("");
|
|
779
|
+
var searchGenRef = (0, import_react2.useRef)(0);
|
|
780
|
+
var reverseGenRef = (0, import_react2.useRef)(0);
|
|
781
|
+
var searchRootRef = (0, import_react2.useRef)(null);
|
|
782
|
+
var searchInputRef = (0, import_react2.useRef)(null);
|
|
783
|
+
var sheetSearchInputRef = (0, import_react2.useRef)(null);
|
|
784
|
+
var closingSearchRef = (0, import_react2.useRef)(false);
|
|
785
|
+
var [nativeSearchFocus] = (0, import_react2.useState)(import_nativeSearchFocus.createNativeSearchFocus);
|
|
786
|
+
var skipResultsReturnFocusRef = (0, import_react2.useRef)(true);
|
|
787
|
+
var closeSearch = (0, import_react2.useCallback)(function () {
|
|
788
|
+
var restoreFocus = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
789
|
+
var _searchInputRef_current;
|
|
790
|
+
if (!import_tamagui.isWeb) nativeSearchFocus.dismiss();
|
|
791
|
+
closingSearchRef.current = true;
|
|
792
|
+
setResultsOpen(false);
|
|
793
|
+
if (import_tamagui.isWeb && restoreFocus) (_searchInputRef_current = searchInputRef.current) === null || _searchInputRef_current === void 0 ? void 0 : _searchInputRef_current.focus({
|
|
794
|
+
preventScroll: true
|
|
795
|
+
});
|
|
796
|
+
closingSearchRef.current = false;
|
|
797
|
+
}, [nativeSearchFocus]);
|
|
798
|
+
var queryIsAddressRef = (0, import_react2.useRef)(true);
|
|
799
|
+
var selectedPlaceRef = (0, import_react2.useRef)(null);
|
|
800
|
+
var locateGenRef = (0, import_react2.useRef)(0);
|
|
801
|
+
var interactiveRef = (0, import_react2.useRef)(!disabled && !readOnly);
|
|
802
|
+
interactiveRef.current = !disabled && !readOnly;
|
|
803
|
+
var cancelLocate = (0, import_react2.useCallback)(function () {
|
|
804
|
+
++locateGenRef.current;
|
|
805
|
+
setLocatePhase("idle");
|
|
806
|
+
setLocateError(null);
|
|
807
|
+
}, []);
|
|
808
|
+
(0, import_react2.useEffect)(function () {
|
|
809
|
+
if (disabled || readOnly) cancelLocate();
|
|
810
|
+
}, [disabled, readOnly, cancelLocate]);
|
|
811
|
+
(0, import_react2.useEffect)(function () {
|
|
812
|
+
return function () {
|
|
813
|
+
++locateGenRef.current;
|
|
814
|
+
++reverseGenRef.current;
|
|
815
|
+
++searchGenRef.current;
|
|
816
|
+
};
|
|
817
|
+
}, []);
|
|
818
|
+
var applyAddress = (0, import_react2.useCallback)(function (next, intoQuery) {
|
|
819
|
+
setAddress(next);
|
|
820
|
+
if (intoQuery) {
|
|
821
|
+
var _ref;
|
|
822
|
+
queryIsAddressRef.current = true;
|
|
823
|
+
setQuery((_ref = next === null || next === void 0 ? void 0 : next.label) !== null && _ref !== void 0 ? _ref : "");
|
|
824
|
+
}
|
|
825
|
+
}, []);
|
|
531
826
|
var requestPosition = (0, import_react2.useCallback)(function () {
|
|
532
827
|
var _navigator;
|
|
828
|
+
if (!interactiveRef.current) return;
|
|
829
|
+
var gen = ++locateGenRef.current;
|
|
533
830
|
if (!((_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.geolocation)) {
|
|
534
831
|
setLocateError((0, import_t.t)("Geolocation unavailable: not supported in this browser."));
|
|
535
832
|
setLocatePhase("error");
|
|
@@ -538,8 +835,11 @@ function Geolocation(param) {
|
|
|
538
835
|
setLocatePhase("locating");
|
|
539
836
|
setLocateError(null);
|
|
540
837
|
navigator.geolocation.getCurrentPosition(function (position) {
|
|
541
|
-
|
|
542
|
-
|
|
838
|
+
if (gen !== locateGenRef.current || !interactiveRef.current) return;
|
|
839
|
+
selectedPlaceRef.current = null;
|
|
840
|
+
queryIsAddressRef.current = true;
|
|
841
|
+
var lat = (0, import_geocoder.clampLat)(position.coords.latitude);
|
|
842
|
+
var lng = (0, import_geocoder.clampLng)(position.coords.longitude);
|
|
543
843
|
var previous = currentValueRef.current;
|
|
544
844
|
onValueChangeRef.current((0, import_geoValue.formatGeoValue)({
|
|
545
845
|
lat,
|
|
@@ -547,20 +847,25 @@ function Geolocation(param) {
|
|
|
547
847
|
}, (0, import_geoValue.detectGeoShape)(previous), previous));
|
|
548
848
|
setLocatePhase("idle");
|
|
549
849
|
setLocateError(null);
|
|
850
|
+
closeSearch();
|
|
851
|
+
setCellOpen(false);
|
|
550
852
|
}, function (err) {
|
|
853
|
+
if (gen !== locateGenRef.current || !interactiveRef.current) return;
|
|
551
854
|
setLocateError(mapGeolocationError(err));
|
|
552
855
|
setLocatePhase("error");
|
|
553
856
|
}, {
|
|
554
857
|
enableHighAccuracy: true,
|
|
555
858
|
timeout: 1e4
|
|
556
859
|
});
|
|
557
|
-
}, []);
|
|
860
|
+
}, [closeSearch]);
|
|
558
861
|
var startLocate = (0, import_react2.useCallback)(async function () {
|
|
559
862
|
if (disabled || readOnly) return;
|
|
560
863
|
if (preflightingRef.current || locatePhase === "locating") return;
|
|
561
864
|
preflightingRef.current = true;
|
|
865
|
+
var gen = ++locateGenRef.current;
|
|
562
866
|
try {
|
|
563
867
|
var result = await preflightGeolocation();
|
|
868
|
+
if (gen !== locateGenRef.current || !interactiveRef.current) return;
|
|
564
869
|
if (result.ok) {
|
|
565
870
|
setPreflightError(void 0);
|
|
566
871
|
requestPosition();
|
|
@@ -573,68 +878,427 @@ function Geolocation(param) {
|
|
|
573
878
|
preflightingRef.current = false;
|
|
574
879
|
}
|
|
575
880
|
}, [disabled, readOnly, locatePhase, requestPosition]);
|
|
881
|
+
var runReverse = (0, import_react2.useCallback)(async function (lat, lng) {
|
|
882
|
+
var gen = ++reverseGenRef.current;
|
|
883
|
+
if (lat === void 0 || lng === void 0) {
|
|
884
|
+
selectedPlaceRef.current = null;
|
|
885
|
+
applyAddress(null, queryIsAddressRef.current);
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
888
|
+
var key = coordinateKey({
|
|
889
|
+
lat,
|
|
890
|
+
lng
|
|
891
|
+
});
|
|
892
|
+
var selected = selectedPlaceRef.current;
|
|
893
|
+
if ((selected === null || selected === void 0 ? void 0 : selected.key) === key) {
|
|
894
|
+
applyAddress({
|
|
895
|
+
key,
|
|
896
|
+
label: (0, import_geocoder.formatPlace)(selected.place)
|
|
897
|
+
}, queryIsAddressRef.current);
|
|
898
|
+
return;
|
|
899
|
+
}
|
|
900
|
+
applyAddress(null, queryIsAddressRef.current);
|
|
901
|
+
if (!reverseGeocode) {
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
try {
|
|
905
|
+
var result = await reverseGeocode({
|
|
906
|
+
lat,
|
|
907
|
+
lng
|
|
908
|
+
});
|
|
909
|
+
if (gen !== reverseGenRef.current) return;
|
|
910
|
+
applyAddress(result ? {
|
|
911
|
+
key,
|
|
912
|
+
label: (0, import_geocoder.formatPlace)(result)
|
|
913
|
+
} : null, queryIsAddressRef.current);
|
|
914
|
+
} catch (unused) {
|
|
915
|
+
if (gen !== reverseGenRef.current) return;
|
|
916
|
+
applyAddress(null, queryIsAddressRef.current);
|
|
917
|
+
}
|
|
918
|
+
}, [reverseGeocode, applyAddress]);
|
|
919
|
+
var runSearch = (0, import_react2.useCallback)(async function (text) {
|
|
920
|
+
if (!geocode) return;
|
|
921
|
+
var gen = ++searchGenRef.current;
|
|
922
|
+
setSearchStatus("searching");
|
|
923
|
+
try {
|
|
924
|
+
var next = await geocode({
|
|
925
|
+
query: text
|
|
926
|
+
});
|
|
927
|
+
if (gen !== searchGenRef.current) return;
|
|
928
|
+
setResults(next);
|
|
929
|
+
setSearchStatus(next.length > 0 ? "results" : "empty");
|
|
930
|
+
} catch (unused) {
|
|
931
|
+
if (gen !== searchGenRef.current) return;
|
|
932
|
+
setResults([]);
|
|
933
|
+
setSearchStatus("error");
|
|
934
|
+
}
|
|
935
|
+
}, [geocode]);
|
|
936
|
+
(0, import_react2.useEffect)(function () {
|
|
937
|
+
++searchGenRef.current;
|
|
938
|
+
if (!searchEnabled || !resultsOpen) return;
|
|
939
|
+
var trimmed = query.trim();
|
|
940
|
+
if (queryIsAddressRef.current) return;
|
|
941
|
+
if (!trimmed) {
|
|
942
|
+
setSearchStatus("idle");
|
|
943
|
+
setResults([]);
|
|
944
|
+
return;
|
|
945
|
+
}
|
|
946
|
+
if ((0, import_geocoder.parseLatLngPair)(trimmed)) {
|
|
947
|
+
setSearchStatus("idle");
|
|
948
|
+
setResults([]);
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
var handle = setTimeout(function () {
|
|
952
|
+
void runSearch(trimmed);
|
|
953
|
+
}, SEARCH_DEBOUNCE_MS);
|
|
954
|
+
return function () {
|
|
955
|
+
clearTimeout(handle);
|
|
956
|
+
++searchGenRef.current;
|
|
957
|
+
};
|
|
958
|
+
}, [query, resultsOpen, searchEnabled, runSearch]);
|
|
959
|
+
(0, import_react2.useEffect)(function () {
|
|
960
|
+
if (!resultsOpen || shouldUseSheet) return;
|
|
961
|
+
var onDoc = function onDoc2(event) {
|
|
962
|
+
var root = searchRootRef.current;
|
|
963
|
+
if (root && _instanceof(event.target, Node) && root.contains(event.target)) return;
|
|
964
|
+
closeSearch(false);
|
|
965
|
+
};
|
|
966
|
+
var onKey = function onKey2(event) {
|
|
967
|
+
if (event.key === "Escape") closeSearch();
|
|
968
|
+
};
|
|
969
|
+
document.addEventListener("mousedown", onDoc);
|
|
970
|
+
document.addEventListener("keydown", onKey);
|
|
971
|
+
return function () {
|
|
972
|
+
document.removeEventListener("mousedown", onDoc);
|
|
973
|
+
document.removeEventListener("keydown", onKey);
|
|
974
|
+
};
|
|
975
|
+
}, [resultsOpen, shouldUseSheet, closeSearch]);
|
|
576
976
|
var makeHandlers = (0, import_react2.useCallback)(function (currentValue, onValueChange) {
|
|
577
977
|
onValueChangeRef.current = onValueChange;
|
|
578
978
|
currentValueRef.current = currentValue;
|
|
579
979
|
var coordinates = (0, import_geoValue.parseGeoValue)(currentValue);
|
|
580
980
|
var shape = (0, import_geoValue.detectGeoShape)(currentValue);
|
|
581
981
|
var write = function write2(lat, lng) {
|
|
982
|
+
cancelLocate();
|
|
582
983
|
onValueChange((0, import_geoValue.formatGeoValue)({
|
|
583
|
-
lat: clampLat(lat),
|
|
584
|
-
lng: clampLng(lng)
|
|
984
|
+
lat: (0, import_geocoder.clampLat)(lat),
|
|
985
|
+
lng: (0, import_geocoder.clampLng)(lng)
|
|
585
986
|
}, shape, currentValue));
|
|
586
987
|
};
|
|
587
988
|
return {
|
|
588
989
|
coordinates,
|
|
589
|
-
onCommitCoordinates:
|
|
590
|
-
|
|
990
|
+
onCommitCoordinates: function onCommitCoordinates(lat, lng) {
|
|
991
|
+
write(lat, lng);
|
|
992
|
+
selectedPlaceRef.current = null;
|
|
993
|
+
queryIsAddressRef.current = true;
|
|
994
|
+
},
|
|
995
|
+
onMapChange: function onMapChange(lat, lng) {
|
|
996
|
+
write(lat, lng);
|
|
997
|
+
selectedPlaceRef.current = null;
|
|
998
|
+
queryIsAddressRef.current = true;
|
|
999
|
+
},
|
|
591
1000
|
onUseMyLocation: function onUseMyLocation() {
|
|
592
1001
|
void startLocate();
|
|
593
1002
|
},
|
|
594
1003
|
onRetryLocate: function onRetryLocate() {
|
|
595
1004
|
requestPosition();
|
|
596
1005
|
},
|
|
597
|
-
onCloseLocate:
|
|
598
|
-
|
|
599
|
-
|
|
1006
|
+
onCloseLocate: cancelLocate,
|
|
1007
|
+
onPick: function onPick(result) {
|
|
1008
|
+
++reverseGenRef.current;
|
|
1009
|
+
var place = {
|
|
1010
|
+
...result,
|
|
1011
|
+
lat: (0, import_geocoder.clampLat)(result.lat),
|
|
1012
|
+
lng: (0, import_geocoder.clampLng)(result.lng)
|
|
1013
|
+
};
|
|
1014
|
+
selectedPlaceRef.current = {
|
|
1015
|
+
key: coordinateKey(place),
|
|
1016
|
+
place
|
|
1017
|
+
};
|
|
1018
|
+
write(result.lat, result.lng);
|
|
1019
|
+
queryIsAddressRef.current = true;
|
|
1020
|
+
setQuery((0, import_geocoder.formatPlace)(result));
|
|
1021
|
+
closeSearch();
|
|
1022
|
+
setCellOpen(false);
|
|
1023
|
+
setSearchStatus("idle");
|
|
1024
|
+
},
|
|
1025
|
+
onPickPair: function onPickPair(lat, lng) {
|
|
1026
|
+
write(lat, lng);
|
|
1027
|
+
selectedPlaceRef.current = null;
|
|
1028
|
+
queryIsAddressRef.current = true;
|
|
1029
|
+
closeSearch();
|
|
1030
|
+
setCellOpen(false);
|
|
1031
|
+
setSearchStatus("idle");
|
|
1032
|
+
},
|
|
1033
|
+
onClear: function onClear() {
|
|
1034
|
+
cancelLocate();
|
|
1035
|
+
++searchGenRef.current;
|
|
1036
|
+
++reverseGenRef.current;
|
|
1037
|
+
selectedPlaceRef.current = null;
|
|
1038
|
+
onValueChange("");
|
|
1039
|
+
applyAddress(null, true);
|
|
1040
|
+
setQuery("");
|
|
1041
|
+
setResults([]);
|
|
1042
|
+
setSearchStatus("idle");
|
|
600
1043
|
}
|
|
601
1044
|
};
|
|
602
|
-
}, [startLocate, requestPosition]);
|
|
1045
|
+
}, [startLocate, requestPosition, cancelLocate, applyAddress, closeSearch]);
|
|
603
1046
|
var mapHeight = (0, import_utils.getFieldHeight)(size !== null && size !== void 0 ? size : knobProps.sizeToken, compact ? 4 : 5);
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
1047
|
+
var displayError = error || preflightError;
|
|
1048
|
+
var renderSearch = function renderSearch2(handlers) {
|
|
1049
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1050
|
+
var showClear = Boolean(query) && !disabled && !readOnly;
|
|
1051
|
+
var inputRef = opts.sheetHeader ? sheetSearchInputRef : searchInputRef;
|
|
1052
|
+
var activateNativeSearch = function activateNativeSearch2() {
|
|
1053
|
+
var focusInput = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
1054
|
+
var _nativeInput_isFocused;
|
|
1055
|
+
nativeSearchFocus.activate();
|
|
1056
|
+
if (!searchEnabled || opts.editingCell) return;
|
|
1057
|
+
var nativeInput = inputRef.current;
|
|
1058
|
+
if (nativeInput === null || nativeInput === void 0 ? void 0 : (_nativeInput_isFocused = nativeInput.isFocused) === null || _nativeInput_isFocused === void 0 ? void 0 : _nativeInput_isFocused.call(nativeInput)) setResultsOpen(true);else if (focusInput) nativeInput === null || nativeInput === void 0 ? void 0 : nativeInput.focus();
|
|
1059
|
+
};
|
|
1060
|
+
var clearSearch = function clearSearch2() {
|
|
1061
|
+
var _inputRef_current;
|
|
1062
|
+
handlers.onClear();
|
|
1063
|
+
closingSearchRef.current = true;
|
|
1064
|
+
if (import_tamagui.isWeb) (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus({
|
|
1065
|
+
preventScroll: true
|
|
1066
|
+
});
|
|
1067
|
+
closingSearchRef.current = false;
|
|
1068
|
+
};
|
|
1069
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_InputParts.Input, {
|
|
1070
|
+
size: size || knobProps.sizeToken,
|
|
1071
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_InputParts.Input.Box, {
|
|
1072
|
+
disabled: disabled || !searchEnabled,
|
|
1073
|
+
// Keep the square Clear target pressable across the frame's border.
|
|
1074
|
+
style: {
|
|
1075
|
+
overflow: "visible"
|
|
1076
|
+
},
|
|
1077
|
+
...(opts.sheetHeader ? {
|
|
1078
|
+
borderWidth: 0,
|
|
1079
|
+
borderBottomWidth: 1,
|
|
1080
|
+
borderRadius: 0
|
|
1081
|
+
} : {}),
|
|
1082
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_InputParts.Input.Section, {
|
|
1083
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_InputParts.Input.Icon, {
|
|
1084
|
+
adornment: "leading",
|
|
1085
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.MagnifyingGlassIcon, {
|
|
1086
|
+
size: 16
|
|
1087
|
+
})
|
|
1088
|
+
})
|
|
1089
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_InputParts.Input.Section, {
|
|
1090
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_InputParts.Input.Area, {
|
|
1091
|
+
ref: inputRef,
|
|
1092
|
+
value: query,
|
|
1093
|
+
disabled: disabled || !searchEnabled,
|
|
1094
|
+
placeholder: (0, import_t.t)("Search address or place"),
|
|
1095
|
+
"aria-label": (0, import_t.t)("Search for a location"),
|
|
1096
|
+
role: "combobox",
|
|
1097
|
+
"aria-haspopup": "listbox",
|
|
1098
|
+
"aria-expanded": resultsOpen,
|
|
1099
|
+
"aria-controls": listId,
|
|
1100
|
+
"aria-autocomplete": "list",
|
|
1101
|
+
"data-testid": "geolocation-search",
|
|
1102
|
+
onChangeText: function onChangeText(text) {
|
|
1103
|
+
if (!import_tamagui.isWeb) nativeSearchFocus.activate();
|
|
1104
|
+
++searchGenRef.current;
|
|
1105
|
+
queryIsAddressRef.current = false;
|
|
1106
|
+
setResults([]);
|
|
1107
|
+
setSearchStatus("idle");
|
|
1108
|
+
setQuery(text);
|
|
1109
|
+
if (searchEnabled) setResultsOpen(true);
|
|
1110
|
+
},
|
|
1111
|
+
onKeyDown: function onKeyDown(event) {
|
|
1112
|
+
if (event.key === "ArrowDown") {
|
|
1113
|
+
var _document_getElementById_querySelector, _document_getElementById;
|
|
1114
|
+
if (searchEnabled) setResultsOpen(true);
|
|
1115
|
+
event.preventDefault();
|
|
1116
|
+
(_document_getElementById = document.getElementById(listId)) === null || _document_getElementById === void 0 ? void 0 : (_document_getElementById_querySelector = _document_getElementById.querySelector("[role='option']:not([aria-disabled='true'])")) === null || _document_getElementById_querySelector === void 0 ? void 0 : _document_getElementById_querySelector.focus();
|
|
1117
|
+
}
|
|
1118
|
+
},
|
|
1119
|
+
onClick: function onClick() {
|
|
1120
|
+
if (searchEnabled) setResultsOpen(true);
|
|
1121
|
+
},
|
|
1122
|
+
...(!import_tamagui.isWeb ? {
|
|
1123
|
+
onPressIn: function onPressIn() {
|
|
1124
|
+
return activateNativeSearch();
|
|
1125
|
+
},
|
|
1126
|
+
onAccessibilityTap: function onAccessibilityTap() {
|
|
1127
|
+
return activateNativeSearch(true);
|
|
1128
|
+
},
|
|
1129
|
+
onBlur: function onBlur2() {
|
|
1130
|
+
return nativeSearchFocus.blur(!!opts.sheetHeader, resultsOpen);
|
|
1131
|
+
}
|
|
1132
|
+
} : {}),
|
|
1133
|
+
onFocus: function onFocus() {
|
|
1134
|
+
if (searchEnabled && !opts.editingCell && !closingSearchRef.current && (import_tamagui.isWeb || nativeSearchFocus.canOpen(!!opts.sheetHeader))) setResultsOpen(true);
|
|
1135
|
+
}
|
|
1136
|
+
})
|
|
1137
|
+
}), showClear ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_InputParts.Input.Section, {
|
|
1138
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_InputParts.Input.Button, {
|
|
1139
|
+
glyphRing: true,
|
|
1140
|
+
onPress: clearSearch,
|
|
1141
|
+
onKeyDown: function onKeyDown(event) {
|
|
1142
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
1143
|
+
event.preventDefault();
|
|
1144
|
+
event.stopPropagation();
|
|
1145
|
+
clearSearch();
|
|
1146
|
+
}
|
|
1147
|
+
},
|
|
1148
|
+
"aria-label": (0, import_t.t)("Clear location"),
|
|
1149
|
+
testID: "geolocation-search-clear",
|
|
1150
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_InputParts.Input.Icon, {
|
|
1151
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.XIcon, {
|
|
1152
|
+
size: 14
|
|
1153
|
+
})
|
|
1154
|
+
})
|
|
1155
|
+
})
|
|
1156
|
+
}) : null]
|
|
614
1157
|
})
|
|
615
1158
|
});
|
|
616
|
-
}
|
|
617
|
-
var
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
1159
|
+
};
|
|
1160
|
+
var renderResults = function renderResults2(handlers) {
|
|
1161
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(SearchResultsList, {
|
|
1162
|
+
listId,
|
|
1163
|
+
status: searchStatus,
|
|
1164
|
+
query: query.trim(),
|
|
1165
|
+
results,
|
|
1166
|
+
pair: (0, import_geocoder.parseLatLngPair)(query),
|
|
1167
|
+
onLocate: handlers.onUseMyLocation,
|
|
1168
|
+
onPick: handlers.onPick,
|
|
1169
|
+
onPickPair: handlers.onPickPair,
|
|
1170
|
+
locateDisabled: disabled || locatePhase === "locating"
|
|
621
1171
|
});
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
1172
|
+
};
|
|
1173
|
+
var renderFormBody = function renderFormBody1(currentValue, onValueChange) {
|
|
1174
|
+
var editingCell = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false,
|
|
1175
|
+
resolvedError = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : displayError;
|
|
1176
|
+
var _ref, _ref1;
|
|
1177
|
+
var handlers = makeHandlers(currentValue, onValueChange);
|
|
1178
|
+
var coordinates = handlers.coordinates;
|
|
1179
|
+
var key = coordinates ? coordinateKey(coordinates) : null;
|
|
1180
|
+
var selected = selectedPlaceRef.current;
|
|
1181
|
+
var displayAddress = (_ref = (_ref1 = (selected === null || selected === void 0 ? void 0 : selected.key) === key ? (0, import_geocoder.formatPlace)(selected.place) : null) !== null && _ref1 !== void 0 ? _ref1 : (address === null || address === void 0 ? void 0 : address.key) === key ? address.label : null) !== null && _ref !== void 0 ? _ref : coordinates ? (0, import_geocoder.formatCoordPair)(coordinates.lat, coordinates.lng) : null;
|
|
1182
|
+
if (inTableCell && !editingCell) {
|
|
1183
|
+
var face = /* @__PURE__ */(0, import_jsx_runtime.jsx)(CellFace, {
|
|
1184
|
+
address: displayAddress,
|
|
1185
|
+
coordinates,
|
|
1186
|
+
onOpen: !disabled && !readOnly ? function () {
|
|
1187
|
+
return setCellOpen(true);
|
|
1188
|
+
} : void 0
|
|
1189
|
+
});
|
|
1190
|
+
if (readOnly || disabled) return face;
|
|
1191
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_FloatingPanel.FloatingPanel, {
|
|
1192
|
+
open: cellOpen,
|
|
1193
|
+
onOpenChange: setCellOpen,
|
|
1194
|
+
disabled,
|
|
1195
|
+
fitContent: false,
|
|
1196
|
+
contentPadding: "none",
|
|
1197
|
+
trigger: face,
|
|
1198
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
1199
|
+
minWidth: 260,
|
|
1200
|
+
maxWidth: 420,
|
|
1201
|
+
children: renderFormBody(currentValue, onValueChange, true, resolvedError)
|
|
1202
|
+
})
|
|
1203
|
+
});
|
|
1204
|
+
}
|
|
1205
|
+
if (readOnly) {
|
|
1206
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
1207
|
+
gap: "$2",
|
|
1208
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.XStack, {
|
|
1209
|
+
testID: "geolocation-readonly-address",
|
|
1210
|
+
alignItems: "center",
|
|
1211
|
+
gap: "$2",
|
|
1212
|
+
minHeight: 25,
|
|
1213
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.MapPinIcon, {
|
|
1214
|
+
size: 14,
|
|
1215
|
+
color: glyphColor
|
|
1216
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
1217
|
+
fontSize: "$4",
|
|
1218
|
+
lineHeight: 25,
|
|
1219
|
+
color: "$color12",
|
|
1220
|
+
children: displayAddress !== null && displayAddress !== void 0 ? displayAddress : (0, import_t.t)("No location set")
|
|
1221
|
+
})]
|
|
1222
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(GeoMapSurface, {
|
|
1223
|
+
id,
|
|
1224
|
+
coordinates,
|
|
1225
|
+
onCommitCoordinates: handlers.onCommitCoordinates,
|
|
1226
|
+
onUseMyLocation: handlers.onUseMyLocation,
|
|
1227
|
+
onRetryLocate: handlers.onRetryLocate,
|
|
1228
|
+
onCloseLocate: handlers.onCloseLocate,
|
|
1229
|
+
onMapChange: handlers.onMapChange,
|
|
1230
|
+
disabled: !!disabled,
|
|
1231
|
+
readOnly: true,
|
|
1232
|
+
locatePhase,
|
|
1233
|
+
locateError,
|
|
1234
|
+
knobProps,
|
|
1235
|
+
locationIcon: resolvedLocationIcon,
|
|
1236
|
+
expandIcon,
|
|
1237
|
+
renderMap,
|
|
1238
|
+
required,
|
|
1239
|
+
hasError: !!resolvedError,
|
|
1240
|
+
mapHeight
|
|
1241
|
+
})]
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1244
|
+
var resultsPanel = resultsOpen && searchEnabled ? shouldUseSheet ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_FloatingPanel.FloatingPanel, {
|
|
1245
|
+
open: resultsOpen,
|
|
1246
|
+
onOpenChange: function onOpenChange(open) {
|
|
1247
|
+
return open ? setResultsOpen(true) : closeSearch();
|
|
1248
|
+
},
|
|
1249
|
+
onNativeShow: function onNativeShow() {
|
|
1250
|
+
var _sheetSearchInputRef_current;
|
|
1251
|
+
return (_sheetSearchInputRef_current = sheetSearchInputRef.current) === null || _sheetSearchInputRef_current === void 0 ? void 0 : _sheetSearchInputRef_current.focus();
|
|
1252
|
+
},
|
|
1253
|
+
skipReturnFocusRef: skipResultsReturnFocusRef,
|
|
1254
|
+
sheet: true,
|
|
1255
|
+
sheetFill: true,
|
|
1256
|
+
scrollable: true,
|
|
1257
|
+
contentPadding: "none",
|
|
1258
|
+
header: renderSearch(handlers, {
|
|
1259
|
+
sheetHeader: true
|
|
1260
|
+
}),
|
|
1261
|
+
trigger: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
1262
|
+
testID: "geolocation-sheet-trigger",
|
|
1263
|
+
height: 1,
|
|
1264
|
+
width: "100%"
|
|
1265
|
+
}),
|
|
1266
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
1267
|
+
testID: "geolocation-results-sheet",
|
|
1268
|
+
children: renderResults(handlers)
|
|
1269
|
+
})
|
|
1270
|
+
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
1271
|
+
position: "absolute",
|
|
1272
|
+
top: "100%",
|
|
1273
|
+
left: 0,
|
|
1274
|
+
right: 0,
|
|
1275
|
+
zIndex: import_zIndex.zIndex.dropdown,
|
|
1276
|
+
backgroundColor: "$color1",
|
|
1277
|
+
borderWidth: 1,
|
|
1278
|
+
borderColor: import_colorRamps.formInputColors.border.base,
|
|
1279
|
+
borderRadius: knobProps.borderRadius.borderRadius,
|
|
1280
|
+
overflow: "hidden",
|
|
1281
|
+
style: {
|
|
1282
|
+
boxShadow: RESULTS_PANEL_SHADOW
|
|
1283
|
+
},
|
|
1284
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.ScrollView, {
|
|
1285
|
+
maxHeight: mapHeight * 1.5,
|
|
1286
|
+
children: renderResults(handlers)
|
|
1287
|
+
})
|
|
1288
|
+
}) : null;
|
|
1289
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
1290
|
+
gap: "$2",
|
|
1291
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
1292
|
+
ref: searchRootRef,
|
|
1293
|
+
position: "relative",
|
|
1294
|
+
testID: "geolocation-search-anchor",
|
|
1295
|
+
"data-sheet": shouldUseSheet ? "true" : "false",
|
|
1296
|
+
children: [renderSearch(handlers, {
|
|
1297
|
+
editingCell
|
|
1298
|
+
}), resultsPanel]
|
|
1299
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(GeoMapSurface, {
|
|
636
1300
|
id,
|
|
637
|
-
coordinates
|
|
1301
|
+
coordinates,
|
|
638
1302
|
onCommitCoordinates: handlers.onCommitCoordinates,
|
|
639
1303
|
onUseMyLocation: handlers.onUseMyLocation,
|
|
640
1304
|
onRetryLocate: handlers.onRetryLocate,
|
|
@@ -645,15 +1309,60 @@ function Geolocation(param) {
|
|
|
645
1309
|
locatePhase,
|
|
646
1310
|
locateError,
|
|
647
1311
|
knobProps,
|
|
648
|
-
locationIcon,
|
|
1312
|
+
locationIcon: resolvedLocationIcon,
|
|
649
1313
|
expandIcon,
|
|
650
1314
|
renderMap,
|
|
651
1315
|
required,
|
|
652
|
-
hasError: !!
|
|
1316
|
+
hasError: !!resolvedError,
|
|
653
1317
|
mapHeight
|
|
1318
|
+
})]
|
|
1319
|
+
});
|
|
1320
|
+
};
|
|
1321
|
+
if (skeleton) {
|
|
1322
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_fieldLayout.FieldLayout, {
|
|
1323
|
+
id,
|
|
1324
|
+
label,
|
|
1325
|
+
size,
|
|
1326
|
+
knobProps,
|
|
1327
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
1328
|
+
gap: "$2",
|
|
1329
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Skeleton.Skeleton, {
|
|
1330
|
+
variant: "rounded",
|
|
1331
|
+
width: "100%",
|
|
1332
|
+
height: 44
|
|
1333
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Skeleton.Skeleton, {
|
|
1334
|
+
variant: "rounded",
|
|
1335
|
+
width: "100%",
|
|
1336
|
+
height: mapHeight
|
|
1337
|
+
})]
|
|
654
1338
|
})
|
|
655
1339
|
});
|
|
656
1340
|
}
|
|
1341
|
+
var wrap = function wrap2(currentValue, onValueChange, resolvedError, fieldBlur) {
|
|
1342
|
+
var coordinates = (0, import_geoValue.parseGeoValue)(currentValue);
|
|
1343
|
+
var taughtHelper = helperText !== null && helperText !== void 0 ? helperText : !coordinates && !readOnly ? (0, import_t.t)("Search, tap the map, or use your location.") : void 0;
|
|
1344
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_fieldLayout.FieldLayout, {
|
|
1345
|
+
id,
|
|
1346
|
+
label,
|
|
1347
|
+
labelProps,
|
|
1348
|
+
error: resolvedError !== null && resolvedError !== void 0 ? resolvedError : displayError,
|
|
1349
|
+
helperText: inTableCell ? void 0 : taughtHelper,
|
|
1350
|
+
required,
|
|
1351
|
+
size,
|
|
1352
|
+
knobProps,
|
|
1353
|
+
onBlur: fieldBlur !== null && fieldBlur !== void 0 ? fieldBlur : onBlur,
|
|
1354
|
+
disabled,
|
|
1355
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(GeolocationValueSync, {
|
|
1356
|
+
value: currentValue,
|
|
1357
|
+
runReverse
|
|
1358
|
+
}), renderFormBody(currentValue, onValueChange, false, resolvedError)]
|
|
1359
|
+
});
|
|
1360
|
+
};
|
|
1361
|
+
if (!resolvedForm || !name) {
|
|
1362
|
+
return wrap(value || "", function (v) {
|
|
1363
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(v);
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
657
1366
|
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_fieldLayout.Field, {
|
|
658
1367
|
form: resolvedForm,
|
|
659
1368
|
name,
|
|
@@ -661,44 +1370,24 @@ function Geolocation(param) {
|
|
|
661
1370
|
validators: resolvedValidators,
|
|
662
1371
|
children: function children(field) {
|
|
663
1372
|
var resolvedError = (0, import_utils.getFieldError)(field, displayError);
|
|
664
|
-
|
|
1373
|
+
return wrap(field.state.value || "", function (v) {
|
|
665
1374
|
field.handleChange(v);
|
|
666
1375
|
onChange === null || onChange === void 0 ? void 0 : onChange(v);
|
|
667
|
-
});
|
|
668
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_fieldLayout.FieldLayout, {
|
|
669
|
-
id,
|
|
670
|
-
label,
|
|
671
|
-
labelProps,
|
|
672
|
-
error: resolvedError,
|
|
673
|
-
helperText,
|
|
674
|
-
required,
|
|
675
|
-
size,
|
|
676
|
-
knobProps,
|
|
677
|
-
onBlur: (0, import_utils.mergeFieldHandler)(field, "handleBlur", onBlur),
|
|
678
|
-
// LC-40: see standalone branch — FieldLayout carries dimWhole.
|
|
679
|
-
disabled,
|
|
680
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(GeoMapSurface, {
|
|
681
|
-
id,
|
|
682
|
-
coordinates: handlers2.coordinates,
|
|
683
|
-
onCommitCoordinates: handlers2.onCommitCoordinates,
|
|
684
|
-
onUseMyLocation: handlers2.onUseMyLocation,
|
|
685
|
-
onRetryLocate: handlers2.onRetryLocate,
|
|
686
|
-
onCloseLocate: handlers2.onCloseLocate,
|
|
687
|
-
onMapChange: handlers2.onMapChange,
|
|
688
|
-
disabled: !!disabled,
|
|
689
|
-
readOnly: !!readOnly,
|
|
690
|
-
locatePhase,
|
|
691
|
-
locateError,
|
|
692
|
-
knobProps,
|
|
693
|
-
locationIcon,
|
|
694
|
-
expandIcon,
|
|
695
|
-
renderMap,
|
|
696
|
-
required,
|
|
697
|
-
hasError: !!resolvedError,
|
|
698
|
-
mapHeight
|
|
699
|
-
})
|
|
700
|
-
});
|
|
1376
|
+
}, resolvedError, (0, import_utils.mergeFieldHandler)(field, "handleBlur", onBlur));
|
|
701
1377
|
}
|
|
702
1378
|
});
|
|
703
1379
|
}
|
|
1380
|
+
function GeolocationValueSync(param) {
|
|
1381
|
+
var {
|
|
1382
|
+
value,
|
|
1383
|
+
runReverse
|
|
1384
|
+
} = param;
|
|
1385
|
+
var coords = (0, import_geoValue.parseGeoValue)(value);
|
|
1386
|
+
var key = coords ? coordinateKey(coords) : "";
|
|
1387
|
+
(0, import_react2.useEffect)(function () {
|
|
1388
|
+
var next = (0, import_geoValue.parseGeoValue)(value);
|
|
1389
|
+
void runReverse(next === null || next === void 0 ? void 0 : next.lat, next === null || next === void 0 ? void 0 : next.lng);
|
|
1390
|
+
}, [key, value, runReverse]);
|
|
1391
|
+
return null;
|
|
1392
|
+
}
|
|
704
1393
|
//# sourceMappingURL=index.native.js.map
|