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