Skip to content

Commit 7236c75

Browse files
author
antoine
committed
geolocation + improve form tabs
1 parent 4399112 commit 7236c75

File tree

21 files changed

+247
-387
lines changed

21 files changed

+247
-387
lines changed

demo/app/Sharp/TestForm/TestForm.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ public function buildFormFields(FieldsContainer $formFields): void
9393
->setLabel('Geolocation')
9494
->setApiKey(env('GMAPS_KEY'))
9595
->setGoogleMapsMapId(env('GMAPS_MAP_ID'))
96-
// ->setMapsProvider('osm')
97-
// ->setGeocodingProvider('osm')
98-
->setMapsProvider('gmaps')
99-
->setGeocodingProvider('gmaps')
96+
->setMapsProvider('osm')
97+
->setGeocodingProvider('osm')
98+
// ->setMapsProvider('gmaps')
99+
// ->setGeocodingProvider('gmaps')
100100
// ->setDisplayUnitDecimalDegrees()
101101
->setDisplayUnitDegreesMinutesSeconds()
102102
->setGeocoding()

docs/guide/upgrading/9.0.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,26 @@ class PostBlockList extends SharpEntityList
495495

496496
You can of course instead declare a real Filter.
497497

498+
## SharpFormGeolocationField using Google Maps API must now provide a Map ID
499+
500+
Sharp 9.x now uses Advanced Markers which requires a [Map ID](https://developers.google.com/maps/documentation/get-map-id), register it with the following method of the field :
501+
502+
```php
503+
class PostForm extends SharpForm
504+
{
505+
public function buildFormFields(FieldsContainer $formFields): void
506+
{
507+
$formFields->addField(
508+
SharpFormGeolocationField::make('position')
509+
->setMapsProvider('gmaps')
510+
->setApiKey('...')
511+
->setGoogleMapsMapId('...') // new method
512+
);
513+
}
514+
}
515+
```
516+
517+
498518
## SharpFormAutocompleteFormField was split in two subclasses for local and remote cases
499519

500520
This isn’t a breaking change, since `SharpFormAutocompleteFormField::make($key, $mode)` is still supported, but deprecated. You should migrate to the new `SharpFormAutocompleteLocalField` and `SharpFormAutocompleteRemoteField` classes.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"filesize": "^10.1.0",
9090
"font-awesome-filetypes": "^2.1.0",
9191
"fuse.js": "^2.6.2",
92-
"leaflet": "^1.4.0",
92+
"leaflet": "^1.9.4",
9393
"lodash": "^4.17.21",
9494
"lucide-vue-next": "^0.363.0",
9595
"moment": "^2.19.1",

resources/css/app.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
@layer base {
1313
html {
14-
scrollbar-gutter: stable;
14+
/*scrollbar-gutter: stable;*/
1515
}
1616
[type="search"]::-webkit-search-decoration,
1717
[type="search"]::-webkit-search-cancel-button {

resources/js/Layouts/Layout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ provide('menuBoundary', menuBoundary);
5151
</script>
5252

5353
<template>
54-
<ConfigProvider :scroll-body="false">
54+
<ConfigProvider>
5555
<div class="min-h-screen w-full md:grid-cols-[220px_1fr]" :class="[
5656
'min-[1244px]:grid-cols-[280px_1fr]', // collapse only before 1024px+220px to prevent EL layout shift
5757
showDesktopLeftNav ? 'md:grid' : 'xl:grid'

resources/js/components/ui/RootCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<template>
88
<div class="@container">
99
<div :class="[noPadding ? 'px-0' : 'max-lg:@[66rem]:px-4 lg:@[67rem]:px-6']">
10-
<div class="@container max-w-5xl mx-auto px-0 2xl:max-w-[87rem] @[67rem]:max-w-[87rem]">
11-
<Card class="rounded-none border-x-0 *:px-4 lg:*:px-6 @5xl:border-x @5xl:rounded-lg">
10+
<div class="@container/root-card max-w-5xl mx-auto px-0 2xl:max-w-[87rem] @[67rem]:max-w-[87rem]">
11+
<Card class="rounded-none border-x-0 *:px-4 lg:*:px-6 @5xl/root-card:border-x @5xl/root-card:rounded-lg">
1212
<slot />
1313
</Card>
1414
</div>

resources/js/components/ui/dialog/DialogFooter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const props = defineProps<{ class?: HTMLAttributes['class'] }>()
99
<div
1010
:class="
1111
cn(
12-
'flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2',
12+
'flex flex-col-reverse gap-y-2 sm:flex-row sm:justify-end sm:gap-x-2',
1313
props.class,
1414
)
1515
"

resources/js/components/ui/dialog/DialogHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const props = defineProps<{
99

1010
<template>
1111
<div
12-
:class="cn('flex flex-col gap-y-1.5 text-center sm:text-left', props.class)"
12+
:class="cn('flex flex-col gap-y-1.5', props.class)"
1313
>
1414
<slot />
1515
</div>

resources/js/form/components/Form.vue

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,25 +103,27 @@
103103
<component :is="inline ? 'div' : RootCard">
104104
<template v-if="!inline">
105105
<CardHeader>
106-
<div class="flex items-start">
107-
<CardTitle class="flex-1">
106+
<div class="flex items-start gap-x-4">
107+
<CardTitle class="-mt-0.5 flex-1 truncate text-2xl/7">
108108
<slot name="title" />
109109
</CardTitle>
110110
<template v-if="form.layout.tabbed && form.layout.tabs.length > 1">
111111
<div>
112-
<div class="sm:hidden">
112+
<div class="@3xl/root-card:hidden">
113113
<Select v-model="selectedTabSlug">
114114
<SelectTrigger>
115115
<SelectValue />
116116
</SelectTrigger>
117-
<template v-for="tab in form.layout.tabs">
118-
<SelectItem :value="slugify(tab.title)">
119-
{{ tab.title }}
120-
</SelectItem>
121-
</template>
117+
<SelectContent>
118+
<template v-for="tab in form.layout.tabs">
119+
<SelectItem :value="slugify(tab.title)">
120+
{{ tab.title }}
121+
</SelectItem>
122+
</template>
123+
</SelectContent>
122124
</Select>
123125
</div>
124-
<div class="hidden sm:block">
126+
<div class="hidden @3xl/root-card:block">
125127
<TabsList>
126128
<template v-for="tab in form.layout.tabs">
127129
<TabsTrigger :value="slugify(tab.title)">
@@ -136,8 +138,8 @@
136138
</TabsList>
137139
</div>
138140
</div>
141+
<div class="flex-1 hidden @4xl/root-card:block"></div>
139142
</template>
140-
<div class="flex-1"></div>
141143
</div>
142144
</CardHeader>
143145
</template>

0 commit comments

Comments
 (0)