react-listing-engine 0.6.3 → 0.6.5
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/README.md +37 -40
- package/dist/{chunk-KLKVHYH3.js → chunk-CGT3RHJ7.js} +1 -1
- package/dist/{chunk-3FOG7ENO.cjs → chunk-RXHR66FS.cjs} +1 -1
- package/dist/{components-provider-CjMxkxrP.d.ts → components-provider-FinfaqUT.d.cts} +13 -2
- package/dist/{components-provider-CF0Mo0B8.d.cts → components-provider-cWVWEDXC.d.ts} +13 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -10
- package/dist/index.d.ts +7 -10
- package/dist/index.js +1 -1
- package/dist/{listing-app-DDKZ6Inn.d.ts → listing-app-BMoMKD4c.d.cts} +12 -11
- package/dist/{listing-app-D2UB9ru3.d.cts → listing-app-BSJKGh7k.d.ts} +12 -11
- package/dist/map-provider.interface-DT-v1plm.d.cts +67 -0
- package/dist/map-provider.interface-DT-v1plm.d.ts +67 -0
- package/dist/maps/google/index.d.cts +1 -2
- package/dist/maps/google/index.d.ts +1 -2
- package/dist/shadcn/index.cjs +1 -1
- package/dist/shadcn/index.d.cts +5 -7
- package/dist/shadcn/index.d.ts +5 -7
- package/dist/shadcn/index.js +1 -1
- package/dist/styled/index.cjs +1 -1
- package/dist/styled/index.d.cts +3 -5
- package/dist/styled/index.d.ts +3 -5
- package/dist/styled/index.js +1 -1
- package/dist/styles.css +20 -7
- package/dist/testing/index.d.cts +1 -2
- package/dist/testing/index.d.ts +1 -2
- package/dist/{url-sync.controller-DX67JivW.d.ts → url-sync.controller-DK5W_0OZ.d.ts} +1 -1
- package/dist/{url-sync.controller-CsU_QxoS.d.cts → url-sync.controller-DXSIWgTa.d.cts} +1 -1
- package/package.json +1 -6
- package/dist/chunk-5FBI2WIM.js +0 -2
- package/dist/chunk-6PZHSHU3.js +0 -2
- package/dist/chunk-CHNUE46K.cjs +0 -2
- package/dist/chunk-LCQZIWBO.cjs +0 -2
- package/dist/entity-adapter.interface-BDgbSxhq.d.cts +0 -33
- package/dist/entity-adapter.interface-BDgbSxhq.d.ts +0 -33
- package/dist/listing-config-options.interface-ZJYY_ZvR.d.cts +0 -12
- package/dist/listing-config-options.interface-ZJYY_ZvR.d.ts +0 -12
- package/dist/map-provider.interface-BMnwW3ob.d.cts +0 -37
- package/dist/map-provider.interface-BxexMT3X.d.ts +0 -37
- package/dist/presets/rental/index.cjs +0 -2
- package/dist/presets/rental/index.d.cts +0 -266
- package/dist/presets/rental/index.d.ts +0 -266
- package/dist/presets/rental/index.js +0 -2
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ pnpm add react-listing-engine
|
|
|
27
27
|
|
|
28
28
|
## Quickstart
|
|
29
29
|
|
|
30
|
-
Minimal setup
|
|
30
|
+
Minimal setup — one dataset, one filter, Google Maps, and the styled `/shadcn` layout. Define your own entity + filter shapes and back them with an `EntityAdapter`:
|
|
31
31
|
|
|
32
32
|
```tsx
|
|
33
33
|
import {
|
|
@@ -36,26 +36,38 @@ import {
|
|
|
36
36
|
withDataset,
|
|
37
37
|
withFilters,
|
|
38
38
|
withMap,
|
|
39
|
+
type EntityAdapter,
|
|
40
|
+
type FilterControlProps,
|
|
39
41
|
} from 'react-listing-engine';
|
|
40
42
|
import { ListingComponentsProviderWithDefaults, ListingLayout } from 'react-listing-engine/shadcn';
|
|
41
43
|
import { googleProvider } from 'react-listing-engine/maps/google';
|
|
42
|
-
import {
|
|
43
|
-
propertiesDataset,
|
|
44
|
-
withRentalFilters,
|
|
45
|
-
type PropertiesApiPort,
|
|
46
|
-
type PropertyEntity,
|
|
47
|
-
type RentalFilters,
|
|
48
|
-
} from 'react-listing-engine/presets/rental';
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
interface Property { id: string; title: string; price: number; lat: number; lng: number }
|
|
46
|
+
interface Filters { q?: string }
|
|
47
|
+
|
|
48
|
+
// Your API-backed adapter: `list(filters, page)` for the results, `getPoints(filters, bounds)`
|
|
49
|
+
// for the map pins. The engine never makes an HTTP call itself.
|
|
50
|
+
declare const adapter: EntityAdapter<Property, Filters>;
|
|
51
|
+
|
|
52
|
+
const SearchControl = ({ onChange, value }: FilterControlProps<string>) => (
|
|
53
|
+
<input onChange={e => onChange(e.target.value)} placeholder="Search" value={value} />
|
|
54
|
+
);
|
|
51
55
|
|
|
52
56
|
export function PropertySearch() {
|
|
53
57
|
return (
|
|
54
|
-
<ListingProvider<
|
|
55
|
-
{...composeListingProviders<
|
|
56
|
-
withMap<
|
|
57
|
-
withDataset(
|
|
58
|
-
withFilters(
|
|
58
|
+
<ListingProvider<Property, Filters>
|
|
59
|
+
{...composeListingProviders<Filters>(
|
|
60
|
+
withMap<Filters>(googleProvider({ apiKey: process.env.NEXT_PUBLIC_GOOGLE_MAPS_KEY! })),
|
|
61
|
+
withDataset({ id: 'properties', adapter, marker: {} }),
|
|
62
|
+
withFilters<Filters>(reg =>
|
|
63
|
+
reg.add<string>({
|
|
64
|
+
key: 'q',
|
|
65
|
+
order: 0,
|
|
66
|
+
render: SearchControl,
|
|
67
|
+
toParams: v => ({ q: v || undefined }),
|
|
68
|
+
fromParams: f => f.q ?? '',
|
|
69
|
+
}),
|
|
70
|
+
),
|
|
59
71
|
)}
|
|
60
72
|
>
|
|
61
73
|
<ListingComponentsProviderWithDefaults>
|
|
@@ -66,13 +78,11 @@ export function PropertySearch() {
|
|
|
66
78
|
}
|
|
67
79
|
```
|
|
68
80
|
|
|
69
|
-
`propertiesApi` only needs to implement `PropertiesApiPort` (`list`, `search`, optional `getById`) against your own backend — the preset never makes an HTTP call itself.
|
|
70
|
-
|
|
71
81
|
## Customization tiers
|
|
72
82
|
|
|
73
83
|
The engine is layered so you can go as deep as you need and stop:
|
|
74
84
|
|
|
75
|
-
1. **Data** — implement `EntityAdapter<TEntity, TFilters>`
|
|
85
|
+
1. **Data** — implement `EntityAdapter<TEntity, TFilters>` against your own API. Nothing in the engine assumes a specific backend or entity shape.
|
|
76
86
|
2. **Structure** — compose the provider with `composeListingProviders(withMap(...), withDataset(...), withFilters(...), withUrlSync(...), withInitialFilters(...), withPrimaryDataset(...), withConfig(...))`. Mutate filters via `FilterRegistry` (`add`/`remove`/`reorder`/`replace`) and layers via `DatasetRegistry` (`add`/`get`/`has`/`list`/`visibleIds`).
|
|
77
87
|
3. **Presentation** — swap any slot via `ListingComponentsProvider` (or start from `ListingComponentsProviderWithDefaults` for the `/shadcn` look and override only what you need). Injectable slots: `Card`, `Marker`, `Popup`, `Sidebar`, `FilterPanel`, `Search`, `Empty`, `Loading`, `ResultHeader`, `Toolbar`. `Marker`/`Popup` are defined but not yet wired into the map's render output (see the Features note above) — every other slot renders as described.
|
|
78
88
|
4. **Layout** — skip `ListingLayout` entirely and arrange the structure-only compound components yourself: `ListingList`, `ListingMap`, `ListingFilters`, `ListingResultHeader`, `ListingToolbar`, `ListingPagination`.
|
|
@@ -93,23 +103,21 @@ const map = googleProvider({
|
|
|
93
103
|
- `loaderOptions` (optional) forwards extra `@googlemaps/js-api-loader` config (language, region, preloaded libraries); `key` is always taken from `apiKey` and can't be overridden there.
|
|
94
104
|
- `DatasetDefinition.clustering` (`{ maxZoom }` or `false`) is implemented by the shipped `googleProvider`: when set, that layer's markers are wrapped in a `MarkerClusterer` (from the OPTIONAL peer dependency `@googlemaps/markerclusterer` — install it to enable clustering; without it, `googleProvider` warns once and falls back to plain, unclustered markers, no crash) with a custom renderer that draws a solid red circle showing the cluster's count. No Mapbox provider ships either; `MapProvider` is the seam if you want to add one.
|
|
95
105
|
|
|
96
|
-
##
|
|
106
|
+
## Multiple marker layers
|
|
97
107
|
|
|
98
|
-
A second marker layer composes onto the same map with one more `withDataset` call:
|
|
108
|
+
A second marker layer (nearby businesses, schools, transit, …) composes onto the same map with one more `withDataset` call — its own `EntityAdapter` and marker:
|
|
99
109
|
|
|
100
110
|
```ts
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}),
|
|
107
|
-
)
|
|
111
|
+
withDataset({
|
|
112
|
+
id: 'businesses',
|
|
113
|
+
adapter: businessesAdapter, // your EntityAdapter for the second layer
|
|
114
|
+
marker: { iconUrl: b => categoryIcons[b.category] },
|
|
115
|
+
})
|
|
108
116
|
```
|
|
109
117
|
|
|
110
|
-
|
|
118
|
+
Additional datasets are **map-only** layers: only the primary dataset (the first one added, or whichever id you pass as `primaryDatasetId` via `withPrimaryDataset`) drives the results list and pagination — implementing `list` on a secondary dataset's adapter has no effect on the list/pagination unless that dataset is made primary.
|
|
111
119
|
|
|
112
|
-
**Filter
|
|
120
|
+
**Filter-shape caveat.** `ListingEngine.loadPoints` calls every visible layer's `getPoints` with the *primary* dataset's `TFilters` — there's a single filter state per engine, not one per layer. A secondary dataset whose filters have a genuinely different shape is **not** driven by the engine's filter state at all; the engine's filter object simply isn't in that shape by the time it reaches the layer's adapter. Filter such a layer at construction instead — close over the restriction in the adapter you hand to `withDataset` — rather than reading it from `useListingFilters()`.
|
|
113
121
|
|
|
114
122
|
## Styled adapter
|
|
115
123
|
|
|
@@ -126,7 +134,7 @@ It needs Tailwind to see its class names and the shadcn-style CSS variables to b
|
|
|
126
134
|
@import "tailwindcss";
|
|
127
135
|
@source "../node_modules/react-listing-engine/dist/**/*.{js,cjs}";
|
|
128
136
|
```
|
|
129
|
-
- or define the semantic tokens it reads yourself (`--color-background`, `--color-foreground`, `--color-card`, `--color-popover`, `--color-border`, `--color-primary`, `--color-secondary`, `--color-muted`, `--color-accent`, `--color-destructive`, plus `-foreground` variants), the same set any shadcn-based project already ships.
|
|
137
|
+
- or define the semantic tokens it reads yourself (`--color-background`, `--color-foreground`, `--color-card`, `--color-popover`, `--color-border`, `--color-primary`, `--color-secondary`, `--color-muted`, `--color-accent`, `--color-destructive`, plus `-foreground` variants), the same set any shadcn-based project already ships.
|
|
130
138
|
|
|
131
139
|
## Hooks
|
|
132
140
|
|
|
@@ -138,17 +146,6 @@ It needs Tailwind to see its class names and the shadcn-style CSS variables to b
|
|
|
138
146
|
- `useListingLayer(id)` — one dataset's visibility, points, and a `toggle()`.
|
|
139
147
|
- `useListingEvent(type | '*', handler)` — subscribe to engine events for the component's lifetime.
|
|
140
148
|
|
|
141
|
-
## Examples
|
|
142
|
-
|
|
143
|
-
[`examples/basic`](./examples/basic) is a Vite app with four scenarios, run locally (`pnpm install && pnpm dev` inside that folder):
|
|
144
|
-
|
|
145
|
-
- **Properties only** — one dataset, the shipped rental filters, and the styled `/shadcn` defaults.
|
|
146
|
-
- **Properties + businesses** — a second nearby-businesses marker layer composed alongside the properties dataset.
|
|
147
|
-
- **Custom components** — `ListingComponentsProvider` with an app-authored `Card` and `Empty` slot.
|
|
148
|
-
- **Custom filters** — `withFilters(reg => reg.add/remove/reorder)` mutating the shipped rental filter set.
|
|
149
|
-
|
|
150
|
-
Each scenario works without a Google Maps key (the map is simply not rendered; a notice explains why) — set `VITE_GOOGLE_MAPS_KEY` in `examples/basic/.env` to see the map layer too.
|
|
151
|
-
|
|
152
149
|
## Support
|
|
153
150
|
|
|
154
151
|
If `react-listing-engine` saves you time, consider sponsoring continued maintenance:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{A as de,B as pe,h as X,i as Y,j,k as ee,l as te,n as re,p as ie,q as x,s as k,u as oe,v as B,w as ne,x as se,y as le,z as ae}from"./chunk-R3FX2V3N.js";import{useEffect as Fe,useRef as _e}from"react";function ce(e,r){let t=k(),i=_e(r);i.current=r,Fe(()=>t.on(e,n=>i.current(n)),[t,e])}function L(e){return typeof e!="number"?e:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}import{Fragment as Ee,jsx as m,jsxs as ue}from"react/jsx-runtime";function Me(e){return e?"rle-card rle-card--selected":"rle-card"}function O({item:e,selected:r,onSelect:t}){let i=e??{},n=Me(r),s=ue(Ee,{children:[i.imageUrl?m("img",{src:i.imageUrl,alt:i.title??"",className:"rle-card-media"}):m("div",{className:"rle-card-media rle-card-media--placeholder","aria-hidden":"true"}),ue("div",{className:"rle-card-body",children:[i.title&&m("span",{className:"rle-card-title",children:i.title}),i.subtitle&&m("span",{className:"rle-card-address",children:i.subtitle}),i.badge&&m("div",{className:"rle-card-info",children:m("span",{className:"rle-card-info-item",children:i.badge})}),i.price!=null&&m("span",{className:"rle-card-price",children:L(i.price)})]})]});return t?m("button",{type:"button",onClick:t,"aria-pressed":r??!1,className:n,children:s}):m("article",{className:n,children:s})}import{jsx as I,jsxs as me}from"react/jsx-runtime";function H(e){return me("div",{role:"status",className:"rle-empty",children:[me("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"rle-empty-icon","aria-hidden":"true",children:[I("circle",{cx:"11",cy:"11",r:"7"}),I("path",{d:"m21 21-4.3-4.3"})]}),I("p",{className:"rle-empty-title",children:"No results"}),I("p",{className:"rle-empty-hint",children:"Try adjusting your filters or search terms."})]})}import{jsx as Re}from"react/jsx-runtime";function V({children:e}){return Re("div",{className:"rle-filter-panel",children:e})}import{jsx as F,jsxs as Te}from"react/jsx-runtime";function D(e){return F("div",{className:"rle-loading",role:"status","aria-busy":"true","aria-label":"Loading results",children:Array.from({length:3}).map((r,t)=>Te("div",{className:"rle-loading-item",children:[F("div",{className:"rle-skeleton",style:{aspectRatio:"4 / 3",width:"100%"}}),F("div",{className:"rle-skeleton",style:{height:16,width:"65%"}}),F("div",{className:"rle-skeleton",style:{height:12,width:"35%"}})]},t))})}import{jsx as Ae}from"react/jsx-runtime";function K({point:e}){let r=e.entity??{};return Ae("span",{className:"rle-pin",children:r.price!=null?L(r.price):""})}import{jsx as N,jsxs as W}from"react/jsx-runtime";function $({entity:e,onClose:r}){let t=e??{};return W("div",{className:"rle-popup",role:"group","aria-label":"Location details",children:[N("button",{type:"button",onClick:r,"aria-label":"Close",className:"rle-popup-close",children:W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[N("path",{d:"M18 6 6 18"}),N("path",{d:"m6 6 12 12"})]})}),W("div",{children:[t.title&&N("div",{className:"rle-card-title",children:t.title}),t.subtitle&&N("div",{className:"rle-card-address",children:t.subtitle}),t.price!=null&&N("div",{className:"rle-card-price",children:L(t.price)})]})]})}import{jsx as Be}from"react/jsx-runtime";function z({count:e,total:r}){let t=r!=null&&r!==e?`${e} of ${r} results`:`${e} results`;return Be("div",{className:"rle-result-header",children:t})}import{jsx as Oe}from"react/jsx-runtime";function U({value:e,onChange:r,placeholder:t}){return Oe("input",{type:"search",value:e,placeholder:t,onChange:i=>r(i.target.value),"aria-label":t??"Search",className:"rle-input"})}import{jsx as He}from"react/jsx-runtime";function Z({children:e}){return He("aside",{className:"rle-sidebar",children:e})}import{jsx as Ve}from"react/jsx-runtime";function q({children:e}){return Ve("div",{className:"rle-toolbar",children:e})}var fe={Card:O,Marker:K,Popup:$,Sidebar:Z,FilterPanel:V,Search:U,Empty:H,Loading:D,ResultHeader:z,Toolbar:q};import{jsx as o,jsxs as h}from"react/jsx-runtime";function ge({view:e,onViewChange:r}){return o("nav",{className:"rle-bottom-nav","aria-label":"Listing navigation",children:h("div",{className:"rle-viewtoggle",role:"group","aria-label":"View",children:[h("button",{type:"button",className:`rle-viewtoggle__btn${e==="list"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="list",onClick:()=>r("list"),children:[o(De,{}),"List"]}),h("button",{type:"button",className:`rle-viewtoggle__btn${e==="map"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="map",onClick:()=>r("map"),children:[o(Ke,{}),"Map"]})]})})}function ve(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),o("circle",{cx:"9",cy:"6",r:"2",fill:"currentColor",stroke:"none"}),o("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),o("circle",{cx:"15",cy:"12",r:"2",fill:"currentColor",stroke:"none"}),o("line",{x1:"4",y1:"18",x2:"20",y2:"18"}),o("circle",{cx:"11",cy:"18",r:"2",fill:"currentColor",stroke:"none"})]})}function De(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[o("line",{x1:"8",y1:"6",x2:"20",y2:"6"}),o("line",{x1:"8",y1:"12",x2:"20",y2:"12"}),o("line",{x1:"8",y1:"18",x2:"20",y2:"18"}),o("line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),o("line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),o("line",{x1:"4",y1:"18",x2:"4.01",y2:"18"})]})}function Ke(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[o("polygon",{points:"1 6 8 3 16 6 23 3 23 18 16 21 8 18 1 21 1 6"}),o("line",{x1:"8",y1:"3",x2:"8",y2:"18"}),o("line",{x1:"16",y1:"6",x2:"16",y2:"21"})]})}function ye(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),o("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}import{useEffect as G,useRef as We,useState as he}from"react";import{createPortal as $e}from"react-dom";import{Fragment as Ue,jsx as f,jsxs as _}from"react/jsx-runtime";function be({open:e,onOpenChange:r,title:t,children:i,footer:n}){let s=We(null),[l,c]=he(!1),[d,g]=he(!1);return G(()=>{if(!e){g(!1),c(!1);return}c(!0);let p=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(p)},[e]),G(()=>{if(!l)return;let p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[l]),G(()=>{if(!l)return;s.current?.focus();function p(v){v.key==="Escape"&&r(!1)}return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[l,r]),!l||typeof document>"u"?null:$e(_(Ue,{children:[f("div",{className:`rle-sheet-backdrop${d?" rle-sheet-backdrop--open":""}`,onClick:()=>r(!1),"aria-hidden":"true"}),_("div",{ref:s,className:`rle-sheet${d?" rle-sheet--open":""}`,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,children:[f("div",{className:"rle-sheet__handle","aria-hidden":"true"}),_("div",{className:"rle-sheet__header",children:[t&&f("div",{className:"rle-sheet__title",children:t}),f("button",{type:"button",className:"rle-sheet__close",onClick:()=>r(!1),"aria-label":"Close",children:f(ze,{})})]}),f("div",{className:"rle-sheet__body",children:i}),n&&f("div",{className:"rle-sheet__footer",children:n})]})]}),document.body)}function ze(){return _("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[f("path",{d:"M18 6 6 18"}),f("path",{d:"m6 6 12 12"})]})}import{useEffect as Se,useRef as Ze,useState as M}from"react";import{jsx as b,jsxs as Le}from"react/jsx-runtime";function Ne({search:e,onFiltersClick:r,filterCount:t=0,action:i}){let{Search:n}=x();return Le("header",{className:"rle-mobile-header",children:[e&&b("div",{className:"rle-mobile-header__search",children:b(n,{value:e.value,onChange:e.onChange,placeholder:e.placeholder})}),Le("button",{type:"button",className:"rle-mobile-header__btn",onClick:r,children:[b(ve,{}),b("span",{children:"Filters"}),t>0&&b("span",{className:"rle-mobile-header__count",children:t})]}),i&&b("button",{type:"button",className:"rle-mobile-header__btn rle-mobile-header__btn--icon",onClick:i.onClick,"aria-label":i.label,children:i.icon??b(ye,{})})]})}import{Fragment as Je,jsx as a,jsxs as y}from"react/jsx-runtime";var qe=a("div",{className:"rle-empty",children:"Map unavailable"});function Ge(){let e=Ze(null),[r,t]=M(!0),[i,n]=M(!0);return Se(()=>{let s=e.current;if(!s)return;let l=()=>{let{clientWidth:g,scrollLeft:p,scrollWidth:v}=s;t(p<=0),n(p+g>=v-1)};l(),s.addEventListener("scroll",l,{passive:!0});let c,d;return typeof ResizeObserver<"u"&&(c=new ResizeObserver(l),c.observe(s)),typeof MutationObserver<"u"&&(d=new MutationObserver(l),d.observe(s,{characterData:!0,childList:!0,subtree:!0})),()=>{s.removeEventListener("scroll",l),c?.disconnect(),d?.disconnect()}},[]),{atEnd:i,atStart:r,ref:e}}function we({search:e,toolbarEnd:r,mobileAction:t,autoFetch:i=!0,hasMap:n=!0,mapCenter:s,mapZoom:l,className:c}){let d=k(),{Search:g}=x(),p=ne(),{filters:v}=oe(),[P,E]=M("list"),[C,u]=M(!1),{atEnd:R,atStart:T,ref:A}=Ge(),S=e?{value:String(v[e.filterKey]??""),onChange:w=>{d.applyFilters({[e.filterKey]:w||void 0})},placeholder:e.placeholder}:void 0;Se(()=>{i!==!1&&d.applyFilters({})},[d,i]);let Ce=()=>{let w=d.filters.list().reduce((Ie,Q)=>Object.assign(Ie,Q.toParams(Q.fromParams({}))),{});d.applyFilters(w)},xe=d.filters.list().filter(w=>w.isActive?.(v)).length,ke=p.total??p.items.length;return y("div",{className:c?`rle-app ${c}`:"rle-app",children:[y("div",{className:"rle-filter-bar",children:[y("div",{className:"rle-filter-bar__scroll",ref:A,children:[S&&a("div",{className:"rle-filter-bar__search",children:a(g,{value:S.value,onChange:S.onChange,placeholder:S.placeholder})}),a(B,{className:"rle-filters-row",groupClassName:"rle-filter-group",hideLabels:!0}),y("div",{className:"rle-filter-bar__end",children:[a(de,{}),r]})]}),!T&&a("div",{className:"rle-filter-bar__fade rle-filter-bar__fade--start","aria-hidden":"true"}),!R&&a("div",{className:"rle-filter-bar__fade rle-filter-bar__fade--end","aria-hidden":"true"})]}),a(Ne,{search:S,onFiltersClick:()=>u(!0),filterCount:xe,action:t}),y("div",{className:`rle-body ${n?"rle-split":"rle-body--list-only"}`,"data-mobile-view":P,children:[y("div",{className:"rle-list",children:[a(se,{className:"rle-list-grid"}),a(ae,{})]}),n&&a("div",{className:"rle-map",children:a(le,{center:s,zoom:l,fallback:qe})})]}),n&&a(ge,{view:P,onViewChange:E}),a(be,{title:"Filters",open:C,onOpenChange:u,footer:y(Je,{children:[a("button",{type:"button",className:"rle-btn rle-btn--ghost",onClick:Ce,children:"Clear all"}),y("button",{type:"button",className:"rle-btn rle-btn--primary",onClick:()=>u(!1),children:["Show ",ke," results"]})]}),children:a(B,{className:"rle-filter-stack",groupClassName:"rle-filter-group"})})]})}import{useEffect as Qe,useRef as Xe,useState as Ye}from"react";import{jsx as J,jsxs as tt}from"react/jsx-runtime";function Pe(e){return"provider"in e}function je(e){let r=e!=null&&!Pe(e),t=r?e.apiKey:void 0,i=r?e.mapId:void 0,[n,s]=Ye(()=>!e||Pe(e)?{ready:!0,provider:e?.provider}:{ready:!1});return Qe(()=>{if(!t)return;let l=!1;return import("./maps/google/index.js").then(({googleProvider:c})=>{l||s({ready:!0,provider:c({apiKey:t,mapId:i})})}),()=>{l=!0}},[t,i]),n}function et({onFiltersChange:e}){let r=Xe(e);return r.current=e,ce("FiltersChanged",t=>{t.type==="FiltersChanged"&&r.current(t.filters)}),null}function pr(e){let{datasets:r,filters:t,map:i,components:n,initialFilters:s,onFiltersChange:l,mobileAction:c,search:d,toolbarEnd:g,config:p,autoFetch:v,className:P}=e,{ready:E,provider:C}=je(i);if(!E)return null;let u=[];for(let A of r)u.push(ee(A));t&&u.push(te(t)),C&&u.push(j(C)),s&&u.push(re(s)),p&&u.push(Y(p));let R=X(...u),T={...fe,...n};return tt(pe,{...R,children:[l&&J(et,{onFiltersChange:l}),J(ie,{...T,children:J(we,{className:P,search:d,toolbarEnd:g,mobileAction:c,autoFetch:v,hasMap:i!=null,mapCenter:i?.center,mapZoom:i?.zoom})})]})}export{ce as a,O as b,H as c,V as d,D as e,K as f,$ as g,z as h,U as i,Z as j,q as k,fe as l,ge as m,be as n,we as o,pr as p};
|
|
2
|
+
import{A as de,B as pe,h as X,i as Y,j,k as ee,l as te,n as re,p as ie,q as x,s as k,u as oe,v as B,w as ne,x as se,y as le,z as ae}from"./chunk-R3FX2V3N.js";import{useEffect as Fe,useRef as _e}from"react";function ce(e,t){let r=k(),i=_e(t);i.current=t,Fe(()=>r.on(e,n=>i.current(n)),[r,e])}function L(e){return typeof e!="number"?e:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}import{Fragment as Ee,jsx as m,jsxs as ue}from"react/jsx-runtime";function Me(e){return e?"rle-card rle-card--selected":"rle-card"}function O({item:e,selected:t,onSelect:r}){let i=e??{},n=Me(t),s=ue(Ee,{children:[i.imageUrl?m("img",{src:i.imageUrl,alt:i.title??"",className:"rle-card-media"}):m("div",{className:"rle-card-media rle-card-media--placeholder","aria-hidden":"true"}),ue("div",{className:"rle-card-body",children:[i.title&&m("span",{className:"rle-card-title",children:i.title}),i.subtitle&&m("span",{className:"rle-card-address",children:i.subtitle}),i.badge&&m("div",{className:"rle-card-info",children:m("span",{className:"rle-card-info-item",children:i.badge})}),i.price!=null&&m("span",{className:"rle-card-price",children:L(i.price)})]})]});return r?m("button",{type:"button",onClick:r,"aria-pressed":t??!1,className:n,children:s}):m("article",{className:n,children:s})}import{jsx as I,jsxs as me}from"react/jsx-runtime";function H(e){return me("div",{role:"status",className:"rle-empty",children:[me("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"rle-empty-icon","aria-hidden":"true",children:[I("circle",{cx:"11",cy:"11",r:"7"}),I("path",{d:"m21 21-4.3-4.3"})]}),I("p",{className:"rle-empty-title",children:"No results"}),I("p",{className:"rle-empty-hint",children:"Try adjusting your filters or search terms."})]})}import{jsx as Re}from"react/jsx-runtime";function V({children:e}){return Re("div",{className:"rle-filter-panel",children:e})}import{jsx as F,jsxs as Te}from"react/jsx-runtime";function D(e){return F("div",{className:"rle-loading",role:"status","aria-busy":"true","aria-label":"Loading results",children:Array.from({length:3}).map((t,r)=>Te("div",{className:"rle-loading-item",children:[F("div",{className:"rle-skeleton",style:{aspectRatio:"4 / 3",width:"100%"}}),F("div",{className:"rle-skeleton",style:{height:16,width:"65%"}}),F("div",{className:"rle-skeleton",style:{height:12,width:"35%"}})]},r))})}import{jsx as Ae}from"react/jsx-runtime";function K({point:e}){let t=e.entity??{};return Ae("span",{className:"rle-pin",children:t.price!=null?L(t.price):""})}import{jsx as N,jsxs as W}from"react/jsx-runtime";function $({entity:e,onClose:t}){let r=e??{};return W("div",{className:"rle-popup",role:"group","aria-label":"Location details",children:[N("button",{type:"button",onClick:t,"aria-label":"Close",className:"rle-popup-close",children:W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[N("path",{d:"M18 6 6 18"}),N("path",{d:"m6 6 12 12"})]})}),W("div",{children:[r.title&&N("div",{className:"rle-card-title",children:r.title}),r.subtitle&&N("div",{className:"rle-card-address",children:r.subtitle}),r.price!=null&&N("div",{className:"rle-card-price",children:L(r.price)})]})]})}import{jsx as Be}from"react/jsx-runtime";function z({count:e,total:t}){let r=t!=null&&t!==e?`${e} of ${t} results`:`${e} results`;return Be("div",{className:"rle-result-header",children:r})}import{jsx as Oe}from"react/jsx-runtime";function U({value:e,onChange:t,placeholder:r}){return Oe("input",{type:"search",value:e,placeholder:r,onChange:i=>t(i.target.value),"aria-label":r??"Search",className:"rle-input"})}import{jsx as He}from"react/jsx-runtime";function Z({children:e}){return He("aside",{className:"rle-sidebar",children:e})}import{jsx as Ve}from"react/jsx-runtime";function q({children:e}){return Ve("div",{className:"rle-toolbar",children:e})}var fe={Card:O,Marker:K,Popup:$,Sidebar:Z,FilterPanel:V,Search:U,Empty:H,Loading:D,ResultHeader:z,Toolbar:q};import{jsx as o,jsxs as h}from"react/jsx-runtime";function ve({view:e,onViewChange:t}){return o("nav",{className:"rle-bottom-nav","aria-label":"Listing navigation",children:h("div",{className:"rle-viewtoggle",role:"group","aria-label":"View",children:[h("button",{type:"button",className:`rle-viewtoggle__btn${e==="list"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="list",onClick:()=>t("list"),children:[o(De,{}),"List"]}),h("button",{type:"button",className:`rle-viewtoggle__btn${e==="map"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="map",onClick:()=>t("map"),children:[o(Ke,{}),"Map"]})]})})}function ge(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),o("circle",{cx:"9",cy:"6",r:"2",fill:"currentColor",stroke:"none"}),o("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),o("circle",{cx:"15",cy:"12",r:"2",fill:"currentColor",stroke:"none"}),o("line",{x1:"4",y1:"18",x2:"20",y2:"18"}),o("circle",{cx:"11",cy:"18",r:"2",fill:"currentColor",stroke:"none"})]})}function De(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[o("line",{x1:"8",y1:"6",x2:"20",y2:"6"}),o("line",{x1:"8",y1:"12",x2:"20",y2:"12"}),o("line",{x1:"8",y1:"18",x2:"20",y2:"18"}),o("line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),o("line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),o("line",{x1:"4",y1:"18",x2:"4.01",y2:"18"})]})}function Ke(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[o("polygon",{points:"1 6 8 3 16 6 23 3 23 18 16 21 8 18 1 21 1 6"}),o("line",{x1:"8",y1:"3",x2:"8",y2:"18"}),o("line",{x1:"16",y1:"6",x2:"16",y2:"21"})]})}function ye(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),o("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}import{useEffect as G,useRef as We,useState as he}from"react";import{createPortal as $e}from"react-dom";import{Fragment as Ue,jsx as f,jsxs as _}from"react/jsx-runtime";function be({open:e,onOpenChange:t,title:r,children:i,footer:n}){let s=We(null),[l,c]=he(!1),[d,v]=he(!1);return G(()=>{if(!e){v(!1),c(!1);return}c(!0);let p=requestAnimationFrame(()=>v(!0));return()=>cancelAnimationFrame(p)},[e]),G(()=>{if(!l)return;let p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[l]),G(()=>{if(!l)return;s.current?.focus();function p(g){g.key==="Escape"&&t(!1)}return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[l,t]),!l||typeof document>"u"?null:$e(_(Ue,{children:[f("div",{className:`rle-sheet-backdrop${d?" rle-sheet-backdrop--open":""}`,onClick:()=>t(!1),"aria-hidden":"true"}),_("div",{ref:s,className:`rle-sheet${d?" rle-sheet--open":""}`,role:"dialog","aria-modal":"true","aria-label":r,tabIndex:-1,children:[f("div",{className:"rle-sheet__handle","aria-hidden":"true"}),_("div",{className:"rle-sheet__header",children:[r&&f("div",{className:"rle-sheet__title",children:r}),f("button",{type:"button",className:"rle-sheet__close",onClick:()=>t(!1),"aria-label":"Close",children:f(ze,{})})]}),f("div",{className:"rle-sheet__body",children:i}),n&&f("div",{className:"rle-sheet__footer",children:n})]})]}),document.body)}function ze(){return _("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[f("path",{d:"M18 6 6 18"}),f("path",{d:"m6 6 12 12"})]})}import{useEffect as Se,useRef as Ze,useState as M}from"react";import{jsx as b,jsxs as Le}from"react/jsx-runtime";function Ne({search:e,onFiltersClick:t,filterCount:r=0,action:i}){let{Search:n}=x();return Le("header",{className:"rle-mobile-header",children:[e&&b("div",{className:"rle-mobile-header__search",children:b(n,{value:e.value,onChange:e.onChange,placeholder:e.placeholder})}),Le("button",{type:"button",className:"rle-mobile-header__btn",onClick:t,children:[b(ge,{}),b("span",{children:"Filters"}),r>0&&b("span",{className:"rle-mobile-header__count",children:r})]}),i&&b("button",{type:"button",className:"rle-mobile-header__btn rle-mobile-header__btn--icon",onClick:i.onClick,"aria-label":i.label,children:i.icon??b(ye,{})})]})}import{Fragment as Je,jsx as a,jsxs as y}from"react/jsx-runtime";var qe=a("div",{className:"rle-empty",children:"Map unavailable"});function Ge(){let e=Ze(null),[t,r]=M(!0),[i,n]=M(!0);return Se(()=>{let s=e.current;if(!s)return;let l=()=>{let{clientWidth:v,scrollLeft:p,scrollWidth:g}=s;r(p<=0),n(p+v>=g-1)};l(),s.addEventListener("scroll",l,{passive:!0});let c,d;return typeof ResizeObserver<"u"&&(c=new ResizeObserver(l),c.observe(s)),typeof MutationObserver<"u"&&(d=new MutationObserver(l),d.observe(s,{characterData:!0,childList:!0,subtree:!0})),()=>{s.removeEventListener("scroll",l),c?.disconnect(),d?.disconnect()}},[]),{atEnd:i,atStart:t,ref:e}}function we({search:e,toolbarEnd:t,mobileAction:r,autoFetch:i=!0,hasMap:n=!0,mapCenter:s,mapZoom:l,className:c}){let d=k(),{Search:v}=x(),p=ne(),{filters:g}=oe(),[P,E]=M("list"),[C,u]=M(!1),{atEnd:R,atStart:T,ref:A}=Ge(),S=e?{value:String(g[e.filterKey]??""),onChange:w=>{d.applyFilters({[e.filterKey]:w||void 0})},placeholder:e.placeholder}:void 0;Se(()=>{i!==!1&&d.applyFilters({})},[d,i]);let Ce=()=>{let w=d.filters.list().reduce((Ie,Q)=>Object.assign(Ie,Q.toParams(Q.fromParams({}))),{});d.applyFilters(w)},xe=d.filters.list().filter(w=>w.isActive?.(g)).length,ke=p.total??p.items.length;return y("div",{className:c?`rle-app ${c}`:"rle-app",children:[y("div",{className:"rle-filter-bar",children:[y("div",{className:"rle-filter-bar__scroll",ref:A,children:[S&&a("div",{className:"rle-filter-bar__search",children:a(v,{value:S.value,onChange:S.onChange,placeholder:S.placeholder})}),a(B,{className:"rle-filters-row",groupClassName:"rle-filter-group",hideLabels:!0})]}),!T&&a("div",{className:"rle-filter-bar__fade rle-filter-bar__fade--start","aria-hidden":"true"}),!R&&a("div",{className:"rle-filter-bar__fade rle-filter-bar__fade--end","aria-hidden":"true"})]}),a(Ne,{search:S,onFiltersClick:()=>u(!0),filterCount:xe,action:r}),y("div",{className:`rle-body ${n?"rle-split":"rle-body--list-only"}`,"data-mobile-view":P,children:[y("div",{className:"rle-list",children:[y("div",{className:"rle-list-header",children:[a(de,{}),t&&a("div",{className:"rle-list-header__toolbar",children:t})]}),a(se,{className:"rle-list-grid"}),a(ae,{})]}),n&&a("div",{className:"rle-map",children:a(le,{center:s,zoom:l,fallback:qe})})]}),n&&a(ve,{view:P,onViewChange:E}),a(be,{title:"Filters",open:C,onOpenChange:u,footer:y(Je,{children:[a("button",{type:"button",className:"rle-btn rle-btn--ghost",onClick:Ce,children:"Clear all"}),y("button",{type:"button",className:"rle-btn rle-btn--primary",onClick:()=>u(!1),children:["Show ",ke," results"]})]}),children:a(B,{className:"rle-filter-stack",groupClassName:"rle-filter-group"})})]})}import{useEffect as Qe,useRef as Xe,useState as Ye}from"react";import{jsx as J,jsxs as tt}from"react/jsx-runtime";function Pe(e){return"provider"in e}function je(e){let t=e!=null&&!Pe(e),r=t?e.apiKey:void 0,i=t?e.mapId:void 0,[n,s]=Ye(()=>!e||Pe(e)?{ready:!0,provider:e?.provider}:{ready:!1});return Qe(()=>{if(!r)return;let l=!1;return import("./maps/google/index.js").then(({googleProvider:c})=>{l||s({ready:!0,provider:c({apiKey:r,mapId:i})})}),()=>{l=!0}},[r,i]),n}function et({onFiltersChange:e}){let t=Xe(e);return t.current=e,ce("FiltersChanged",r=>{r.type==="FiltersChanged"&&t.current(r.filters)}),null}function pr(e){let{datasets:t,filters:r,map:i,components:n,initialFilters:s,onFiltersChange:l,mobileAction:c,search:d,toolbarEnd:v,config:p,autoFetch:g,className:P}=e,{ready:E,provider:C}=je(i);if(!E)return null;let u=[];for(let A of t)u.push(ee(A));r&&u.push(te(r)),C&&u.push(j(C)),s&&u.push(re(s)),p&&u.push(Y(p));let R=X(...u),T={...fe,...n};return tt(pe,{...R,children:[l&&J(et,{onFiltersChange:l}),J(ie,{...T,children:J(we,{className:P,search:d,toolbarEnd:v,mobileAction:c,autoFetch:g,hasMap:i!=null,mapCenter:i?.center,mapZoom:i?.zoom})})]})}export{ce as a,O as b,H as c,V as d,D as e,K as f,$ as g,z as h,U as i,Z as j,q as k,fe as l,ve as m,be as n,we as o,pr as p};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
-
var _chunkEYXV5OMYcjs = require('./chunk-EYXV5OMY.cjs');var _react = require('react');function ce(e,r){let t=_chunkEYXV5OMYcjs.s.call(void 0, ),i=_react.useRef.call(void 0, r);i.current=r,_react.useEffect.call(void 0, ()=>t.on(e,n=>i.current(n)),[t,e])}function L(e){return typeof e!="number"?e:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}var _jsxruntime = require('react/jsx-runtime');function Me(e){return e?"rle-card rle-card--selected":"rle-card"}function O({item:e,selected:r,onSelect:t}){let i=_nullishCoalesce(e, () => ({})),n=Me(r),s=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[i.imageUrl?_jsxruntime.jsx.call(void 0, "img",{src:i.imageUrl,alt:_nullishCoalesce(i.title, () => ("")),className:"rle-card-media"}):_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-media rle-card-media--placeholder","aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-card-body",children:[i.title&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-title",children:i.title}),i.subtitle&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-address",children:i.subtitle}),i.badge&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-info",children:_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-info-item",children:i.badge})}),i.price!=null&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-price",children:L(i.price)})]})]});return t?_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:t,"aria-pressed":_nullishCoalesce(r, () => (!1)),className:n,children:s}):_jsxruntime.jsx.call(void 0, "article",{className:n,children:s})}function H(e){return _jsxruntime.jsxs.call(void 0, "div",{role:"status",className:"rle-empty",children:[_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"rle-empty-icon","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "circle",{cx:"11",cy:"11",r:"7"}),_jsxruntime.jsx.call(void 0, "path",{d:"m21 21-4.3-4.3"})]}),_jsxruntime.jsx.call(void 0, "p",{className:"rle-empty-title",children:"No results"}),_jsxruntime.jsx.call(void 0, "p",{className:"rle-empty-hint",children:"Try adjusting your filters or search terms."})]})}function V({children:e}){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-panel",children:e})}function D(e){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-loading",role:"status","aria-busy":"true","aria-label":"Loading results",children:Array.from({length:3}).map((r,t)=>_jsxruntime.jsxs.call(void 0, "div",{className:"rle-loading-item",children:[_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{aspectRatio:"4 / 3",width:"100%"}}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{height:16,width:"65%"}}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{height:12,width:"35%"}})]},t))})}function K({point:e}){let r=_nullishCoalesce(e.entity, () => ({}));return _jsxruntime.jsx.call(void 0, "span",{className:"rle-pin",children:r.price!=null?L(r.price):""})}function $({entity:e,onClose:r}){let t=_nullishCoalesce(e, () => ({}));return _jsxruntime.jsxs.call(void 0, "div",{className:"rle-popup",role:"group","aria-label":"Location details",children:[_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:r,"aria-label":"Close",className:"rle-popup-close",children:_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M18 6 6 18"}),_jsxruntime.jsx.call(void 0, "path",{d:"m6 6 12 12"})]})}),_jsxruntime.jsxs.call(void 0, "div",{children:[t.title&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-title",children:t.title}),t.subtitle&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-address",children:t.subtitle}),t.price!=null&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-price",children:L(t.price)})]})]})}function z({count:e,total:r}){let t=r!=null&&r!==e?`${e} of ${r} results`:`${e} results`;return _jsxruntime.jsx.call(void 0, "div",{className:"rle-result-header",children:t})}function U({value:e,onChange:r,placeholder:t}){return _jsxruntime.jsx.call(void 0, "input",{type:"search",value:e,placeholder:t,onChange:i=>r(i.target.value),"aria-label":_nullishCoalesce(t, () => ("Search")),className:"rle-input"})}function Z({children:e}){return _jsxruntime.jsx.call(void 0, "aside",{className:"rle-sidebar",children:e})}function q({children:e}){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-toolbar",children:e})}var fe={Card:O,Marker:K,Popup:$,Sidebar:Z,FilterPanel:V,Search:U,Empty:H,Loading:D,ResultHeader:z,Toolbar:q};function ge({view:e,onViewChange:r}){return _jsxruntime.jsx.call(void 0, "nav",{className:"rle-bottom-nav","aria-label":"Listing navigation",children:_jsxruntime.jsxs.call(void 0, "div",{className:"rle-viewtoggle",role:"group","aria-label":"View",children:[_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:`rle-viewtoggle__btn${e==="list"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="list",onClick:()=>r("list"),children:[_jsxruntime.jsx.call(void 0, De,{}),"List"]}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:`rle-viewtoggle__btn${e==="map"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="map",onClick:()=>r("map"),children:[_jsxruntime.jsx.call(void 0, Ke,{}),"Map"]})]})})}function ve(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"6",x2:"20",y2:"6"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"9",cy:"6",r:"2",fill:"currentColor",stroke:"none"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"12",x2:"20",y2:"12"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"15",cy:"12",r:"2",fill:"currentColor",stroke:"none"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"18",x2:"20",y2:"18"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"11",cy:"18",r:"2",fill:"currentColor",stroke:"none"})]})}function De(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"6",x2:"20",y2:"6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"12",x2:"20",y2:"12"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"18",x2:"20",y2:"18"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"18",x2:"4.01",y2:"18"})]})}function Ke(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "polygon",{points:"1 6 8 3 16 6 23 3 23 18 16 21 8 18 1 21 1 6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"3",x2:"8",y2:"18"}),_jsxruntime.jsx.call(void 0, "line",{x1:"16",y1:"6",x2:"16",y2:"21"})]})}function ye(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"12",y1:"5",x2:"12",y2:"19"}),_jsxruntime.jsx.call(void 0, "line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}var _reactdom = require('react-dom');function be({open:e,onOpenChange:r,title:t,children:i,footer:n}){let s=_react.useRef.call(void 0, null),[l,c]=_react.useState.call(void 0, !1),[d,g]=_react.useState.call(void 0, !1);return _react.useEffect.call(void 0, ()=>{if(!e){g(!1),c(!1);return}c(!0);let p=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(p)},[e]),_react.useEffect.call(void 0, ()=>{if(!l)return;let p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[l]),_react.useEffect.call(void 0, ()=>{if(!l)return;_optionalChain([s, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.focus, 'call', _4 => _4()]);function p(v){v.key==="Escape"&&r(!1)}return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[l,r]),!l||typeof document>"u"?null:_reactdom.createPortal.call(void 0, _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "div",{className:`rle-sheet-backdrop${d?" rle-sheet-backdrop--open":""}`,onClick:()=>r(!1),"aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{ref:s,className:`rle-sheet${d?" rle-sheet--open":""}`,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,children:[_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__handle","aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-sheet__header",children:[t&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__title",children:t}),_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-sheet__close",onClick:()=>r(!1),"aria-label":"Close",children:_jsxruntime.jsx.call(void 0, ze,{})})]}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__body",children:i}),n&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__footer",children:n})]})]}),document.body)}function ze(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M18 6 6 18"}),_jsxruntime.jsx.call(void 0, "path",{d:"m6 6 12 12"})]})}function Ne({search:e,onFiltersClick:r,filterCount:t=0,action:i}){let{Search:n}=_chunkEYXV5OMYcjs.q.call(void 0, );return _jsxruntime.jsxs.call(void 0, "header",{className:"rle-mobile-header",children:[e&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-mobile-header__search",children:_jsxruntime.jsx.call(void 0, n,{value:e.value,onChange:e.onChange,placeholder:e.placeholder})}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:"rle-mobile-header__btn",onClick:r,children:[_jsxruntime.jsx.call(void 0, ve,{}),_jsxruntime.jsx.call(void 0, "span",{children:"Filters"}),t>0&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-mobile-header__count",children:t})]}),i&&_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-mobile-header__btn rle-mobile-header__btn--icon",onClick:i.onClick,"aria-label":i.label,children:_nullishCoalesce(i.icon, () => (_jsxruntime.jsx.call(void 0, ye,{})))})]})}var qe=_jsxruntime.jsx.call(void 0, "div",{className:"rle-empty",children:"Map unavailable"});function Ge(){let e=_react.useRef.call(void 0, null),[r,t]=_react.useState.call(void 0, !0),[i,n]=_react.useState.call(void 0, !0);return _react.useEffect.call(void 0, ()=>{let s=e.current;if(!s)return;let l=()=>{let{clientWidth:g,scrollLeft:p,scrollWidth:v}=s;t(p<=0),n(p+g>=v-1)};l(),s.addEventListener("scroll",l,{passive:!0});let c,d;return typeof ResizeObserver<"u"&&(c=new ResizeObserver(l),c.observe(s)),typeof MutationObserver<"u"&&(d=new MutationObserver(l),d.observe(s,{characterData:!0,childList:!0,subtree:!0})),()=>{s.removeEventListener("scroll",l),_optionalChain([c, 'optionalAccess', _5 => _5.disconnect, 'call', _6 => _6()]),_optionalChain([d, 'optionalAccess', _7 => _7.disconnect, 'call', _8 => _8()])}},[]),{atEnd:i,atStart:r,ref:e}}function we({search:e,toolbarEnd:r,mobileAction:t,autoFetch:i=!0,hasMap:n=!0,mapCenter:s,mapZoom:l,className:c}){let d=_chunkEYXV5OMYcjs.s.call(void 0, ),{Search:g}=_chunkEYXV5OMYcjs.q.call(void 0, ),p=_chunkEYXV5OMYcjs.w.call(void 0, ),{filters:v}=_chunkEYXV5OMYcjs.u.call(void 0, ),[P,E]=_react.useState.call(void 0, "list"),[C,u]=_react.useState.call(void 0, !1),{atEnd:R,atStart:T,ref:A}=Ge(),S=e?{value:String(_nullishCoalesce(v[e.filterKey], () => (""))),onChange:w=>{d.applyFilters({[e.filterKey]:w||void 0})},placeholder:e.placeholder}:void 0;_react.useEffect.call(void 0, ()=>{i!==!1&&d.applyFilters({})},[d,i]);let Ce=()=>{let w=d.filters.list().reduce((Ie,Q)=>Object.assign(Ie,Q.toParams(Q.fromParams({}))),{});d.applyFilters(w)},xe=d.filters.list().filter(w=>_optionalChain([w, 'access', _9 => _9.isActive, 'optionalCall', _10 => _10(v)])).length,ke=_nullishCoalesce(p.total, () => (p.items.length));return _jsxruntime.jsxs.call(void 0, "div",{className:c?`rle-app ${c}`:"rle-app",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar__scroll",ref:A,children:[S&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-bar__search",children:_jsxruntime.jsx.call(void 0, g,{value:S.value,onChange:S.onChange,placeholder:S.placeholder})}),_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.v,{className:"rle-filters-row",groupClassName:"rle-filter-group",hideLabels:!0}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar__end",children:[_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.A,{}),r]})]}),!T&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-bar__fade rle-filter-bar__fade--start","aria-hidden":"true"}),!R&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-bar__fade rle-filter-bar__fade--end","aria-hidden":"true"})]}),_jsxruntime.jsx.call(void 0, Ne,{search:S,onFiltersClick:()=>u(!0),filterCount:xe,action:t}),_jsxruntime.jsxs.call(void 0, "div",{className:`rle-body ${n?"rle-split":"rle-body--list-only"}`,"data-mobile-view":P,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-list",children:[_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.x,{className:"rle-list-grid"}),_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.z,{})]}),n&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-map",children:_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.y,{center:s,zoom:l,fallback:qe})})]}),n&&_jsxruntime.jsx.call(void 0, ge,{view:P,onViewChange:E}),_jsxruntime.jsx.call(void 0, be,{title:"Filters",open:C,onOpenChange:u,footer:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-btn rle-btn--ghost",onClick:Ce,children:"Clear all"}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:"rle-btn rle-btn--primary",onClick:()=>u(!1),children:["Show ",ke," results"]})]}),children:_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.v,{className:"rle-filter-stack",groupClassName:"rle-filter-group"})})]})}function Pe(e){return"provider"in e}function je(e){let r=e!=null&&!Pe(e),t=r?e.apiKey:void 0,i=r?e.mapId:void 0,[n,s]=_react.useState.call(void 0, ()=>!e||Pe(e)?{ready:!0,provider:_optionalChain([e, 'optionalAccess', _11 => _11.provider])}:{ready:!1});return _react.useEffect.call(void 0, ()=>{if(!t)return;let l=!1;return Promise.resolve().then(() => _interopRequireWildcard(require("./maps/google/index.cjs"))).then(({googleProvider:c})=>{l||s({ready:!0,provider:c({apiKey:t,mapId:i})})}),()=>{l=!0}},[t,i]),n}function et({onFiltersChange:e}){let r=_react.useRef.call(void 0, e);return r.current=e,ce("FiltersChanged",t=>{t.type==="FiltersChanged"&&r.current(t.filters)}),null}function pr(e){let{datasets:r,filters:t,map:i,components:n,initialFilters:s,onFiltersChange:l,mobileAction:c,search:d,toolbarEnd:g,config:p,autoFetch:v,className:P}=e,{ready:E,provider:C}=je(i);if(!E)return null;let u=[];for(let A of r)u.push(_chunkEYXV5OMYcjs.k.call(void 0, A));t&&u.push(_chunkEYXV5OMYcjs.l.call(void 0, t)),C&&u.push(_chunkEYXV5OMYcjs.j.call(void 0, C)),s&&u.push(_chunkEYXV5OMYcjs.n.call(void 0, s)),p&&u.push(_chunkEYXV5OMYcjs.i.call(void 0, p));let R=_chunkEYXV5OMYcjs.h.call(void 0, ...u),T={...fe,...n};return _jsxruntime.jsxs.call(void 0, _chunkEYXV5OMYcjs.B,{...R,children:[l&&_jsxruntime.jsx.call(void 0, et,{onFiltersChange:l}),_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.p,{...T,children:_jsxruntime.jsx.call(void 0, we,{className:P,search:d,toolbarEnd:g,mobileAction:c,autoFetch:v,hasMap:i!=null,mapCenter:_optionalChain([i, 'optionalAccess', _12 => _12.center]),mapZoom:_optionalChain([i, 'optionalAccess', _13 => _13.zoom])})})]})}exports.a = ce; exports.b = O; exports.c = H; exports.d = V; exports.e = D; exports.f = K; exports.g = $; exports.h = z; exports.i = U; exports.j = Z; exports.k = q; exports.l = fe; exports.m = ge; exports.n = be; exports.o = we; exports.p = pr;
|
|
2
|
+
var _chunkEYXV5OMYcjs = require('./chunk-EYXV5OMY.cjs');var _react = require('react');function ce(e,t){let r=_chunkEYXV5OMYcjs.s.call(void 0, ),i=_react.useRef.call(void 0, t);i.current=t,_react.useEffect.call(void 0, ()=>r.on(e,n=>i.current(n)),[r,e])}function L(e){return typeof e!="number"?e:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}var _jsxruntime = require('react/jsx-runtime');function Me(e){return e?"rle-card rle-card--selected":"rle-card"}function O({item:e,selected:t,onSelect:r}){let i=_nullishCoalesce(e, () => ({})),n=Me(t),s=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[i.imageUrl?_jsxruntime.jsx.call(void 0, "img",{src:i.imageUrl,alt:_nullishCoalesce(i.title, () => ("")),className:"rle-card-media"}):_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-media rle-card-media--placeholder","aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-card-body",children:[i.title&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-title",children:i.title}),i.subtitle&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-address",children:i.subtitle}),i.badge&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-info",children:_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-info-item",children:i.badge})}),i.price!=null&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-price",children:L(i.price)})]})]});return r?_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:r,"aria-pressed":_nullishCoalesce(t, () => (!1)),className:n,children:s}):_jsxruntime.jsx.call(void 0, "article",{className:n,children:s})}function H(e){return _jsxruntime.jsxs.call(void 0, "div",{role:"status",className:"rle-empty",children:[_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"rle-empty-icon","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "circle",{cx:"11",cy:"11",r:"7"}),_jsxruntime.jsx.call(void 0, "path",{d:"m21 21-4.3-4.3"})]}),_jsxruntime.jsx.call(void 0, "p",{className:"rle-empty-title",children:"No results"}),_jsxruntime.jsx.call(void 0, "p",{className:"rle-empty-hint",children:"Try adjusting your filters or search terms."})]})}function V({children:e}){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-panel",children:e})}function D(e){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-loading",role:"status","aria-busy":"true","aria-label":"Loading results",children:Array.from({length:3}).map((t,r)=>_jsxruntime.jsxs.call(void 0, "div",{className:"rle-loading-item",children:[_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{aspectRatio:"4 / 3",width:"100%"}}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{height:16,width:"65%"}}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{height:12,width:"35%"}})]},r))})}function K({point:e}){let t=_nullishCoalesce(e.entity, () => ({}));return _jsxruntime.jsx.call(void 0, "span",{className:"rle-pin",children:t.price!=null?L(t.price):""})}function $({entity:e,onClose:t}){let r=_nullishCoalesce(e, () => ({}));return _jsxruntime.jsxs.call(void 0, "div",{className:"rle-popup",role:"group","aria-label":"Location details",children:[_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:t,"aria-label":"Close",className:"rle-popup-close",children:_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M18 6 6 18"}),_jsxruntime.jsx.call(void 0, "path",{d:"m6 6 12 12"})]})}),_jsxruntime.jsxs.call(void 0, "div",{children:[r.title&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-title",children:r.title}),r.subtitle&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-address",children:r.subtitle}),r.price!=null&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-price",children:L(r.price)})]})]})}function z({count:e,total:t}){let r=t!=null&&t!==e?`${e} of ${t} results`:`${e} results`;return _jsxruntime.jsx.call(void 0, "div",{className:"rle-result-header",children:r})}function U({value:e,onChange:t,placeholder:r}){return _jsxruntime.jsx.call(void 0, "input",{type:"search",value:e,placeholder:r,onChange:i=>t(i.target.value),"aria-label":_nullishCoalesce(r, () => ("Search")),className:"rle-input"})}function Z({children:e}){return _jsxruntime.jsx.call(void 0, "aside",{className:"rle-sidebar",children:e})}function q({children:e}){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-toolbar",children:e})}var fe={Card:O,Marker:K,Popup:$,Sidebar:Z,FilterPanel:V,Search:U,Empty:H,Loading:D,ResultHeader:z,Toolbar:q};function ve({view:e,onViewChange:t}){return _jsxruntime.jsx.call(void 0, "nav",{className:"rle-bottom-nav","aria-label":"Listing navigation",children:_jsxruntime.jsxs.call(void 0, "div",{className:"rle-viewtoggle",role:"group","aria-label":"View",children:[_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:`rle-viewtoggle__btn${e==="list"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="list",onClick:()=>t("list"),children:[_jsxruntime.jsx.call(void 0, De,{}),"List"]}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:`rle-viewtoggle__btn${e==="map"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="map",onClick:()=>t("map"),children:[_jsxruntime.jsx.call(void 0, Ke,{}),"Map"]})]})})}function ge(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"6",x2:"20",y2:"6"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"9",cy:"6",r:"2",fill:"currentColor",stroke:"none"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"12",x2:"20",y2:"12"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"15",cy:"12",r:"2",fill:"currentColor",stroke:"none"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"18",x2:"20",y2:"18"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"11",cy:"18",r:"2",fill:"currentColor",stroke:"none"})]})}function De(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"6",x2:"20",y2:"6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"12",x2:"20",y2:"12"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"18",x2:"20",y2:"18"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"18",x2:"4.01",y2:"18"})]})}function Ke(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "polygon",{points:"1 6 8 3 16 6 23 3 23 18 16 21 8 18 1 21 1 6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"3",x2:"8",y2:"18"}),_jsxruntime.jsx.call(void 0, "line",{x1:"16",y1:"6",x2:"16",y2:"21"})]})}function ye(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"12",y1:"5",x2:"12",y2:"19"}),_jsxruntime.jsx.call(void 0, "line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}var _reactdom = require('react-dom');function be({open:e,onOpenChange:t,title:r,children:i,footer:n}){let s=_react.useRef.call(void 0, null),[l,c]=_react.useState.call(void 0, !1),[d,v]=_react.useState.call(void 0, !1);return _react.useEffect.call(void 0, ()=>{if(!e){v(!1),c(!1);return}c(!0);let p=requestAnimationFrame(()=>v(!0));return()=>cancelAnimationFrame(p)},[e]),_react.useEffect.call(void 0, ()=>{if(!l)return;let p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[l]),_react.useEffect.call(void 0, ()=>{if(!l)return;_optionalChain([s, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.focus, 'call', _4 => _4()]);function p(g){g.key==="Escape"&&t(!1)}return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[l,t]),!l||typeof document>"u"?null:_reactdom.createPortal.call(void 0, _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "div",{className:`rle-sheet-backdrop${d?" rle-sheet-backdrop--open":""}`,onClick:()=>t(!1),"aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{ref:s,className:`rle-sheet${d?" rle-sheet--open":""}`,role:"dialog","aria-modal":"true","aria-label":r,tabIndex:-1,children:[_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__handle","aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-sheet__header",children:[r&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__title",children:r}),_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-sheet__close",onClick:()=>t(!1),"aria-label":"Close",children:_jsxruntime.jsx.call(void 0, ze,{})})]}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__body",children:i}),n&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__footer",children:n})]})]}),document.body)}function ze(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M18 6 6 18"}),_jsxruntime.jsx.call(void 0, "path",{d:"m6 6 12 12"})]})}function Ne({search:e,onFiltersClick:t,filterCount:r=0,action:i}){let{Search:n}=_chunkEYXV5OMYcjs.q.call(void 0, );return _jsxruntime.jsxs.call(void 0, "header",{className:"rle-mobile-header",children:[e&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-mobile-header__search",children:_jsxruntime.jsx.call(void 0, n,{value:e.value,onChange:e.onChange,placeholder:e.placeholder})}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:"rle-mobile-header__btn",onClick:t,children:[_jsxruntime.jsx.call(void 0, ge,{}),_jsxruntime.jsx.call(void 0, "span",{children:"Filters"}),r>0&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-mobile-header__count",children:r})]}),i&&_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-mobile-header__btn rle-mobile-header__btn--icon",onClick:i.onClick,"aria-label":i.label,children:_nullishCoalesce(i.icon, () => (_jsxruntime.jsx.call(void 0, ye,{})))})]})}var qe=_jsxruntime.jsx.call(void 0, "div",{className:"rle-empty",children:"Map unavailable"});function Ge(){let e=_react.useRef.call(void 0, null),[t,r]=_react.useState.call(void 0, !0),[i,n]=_react.useState.call(void 0, !0);return _react.useEffect.call(void 0, ()=>{let s=e.current;if(!s)return;let l=()=>{let{clientWidth:v,scrollLeft:p,scrollWidth:g}=s;r(p<=0),n(p+v>=g-1)};l(),s.addEventListener("scroll",l,{passive:!0});let c,d;return typeof ResizeObserver<"u"&&(c=new ResizeObserver(l),c.observe(s)),typeof MutationObserver<"u"&&(d=new MutationObserver(l),d.observe(s,{characterData:!0,childList:!0,subtree:!0})),()=>{s.removeEventListener("scroll",l),_optionalChain([c, 'optionalAccess', _5 => _5.disconnect, 'call', _6 => _6()]),_optionalChain([d, 'optionalAccess', _7 => _7.disconnect, 'call', _8 => _8()])}},[]),{atEnd:i,atStart:t,ref:e}}function we({search:e,toolbarEnd:t,mobileAction:r,autoFetch:i=!0,hasMap:n=!0,mapCenter:s,mapZoom:l,className:c}){let d=_chunkEYXV5OMYcjs.s.call(void 0, ),{Search:v}=_chunkEYXV5OMYcjs.q.call(void 0, ),p=_chunkEYXV5OMYcjs.w.call(void 0, ),{filters:g}=_chunkEYXV5OMYcjs.u.call(void 0, ),[P,E]=_react.useState.call(void 0, "list"),[C,u]=_react.useState.call(void 0, !1),{atEnd:R,atStart:T,ref:A}=Ge(),S=e?{value:String(_nullishCoalesce(g[e.filterKey], () => (""))),onChange:w=>{d.applyFilters({[e.filterKey]:w||void 0})},placeholder:e.placeholder}:void 0;_react.useEffect.call(void 0, ()=>{i!==!1&&d.applyFilters({})},[d,i]);let Ce=()=>{let w=d.filters.list().reduce((Ie,Q)=>Object.assign(Ie,Q.toParams(Q.fromParams({}))),{});d.applyFilters(w)},xe=d.filters.list().filter(w=>_optionalChain([w, 'access', _9 => _9.isActive, 'optionalCall', _10 => _10(g)])).length,ke=_nullishCoalesce(p.total, () => (p.items.length));return _jsxruntime.jsxs.call(void 0, "div",{className:c?`rle-app ${c}`:"rle-app",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar__scroll",ref:A,children:[S&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-bar__search",children:_jsxruntime.jsx.call(void 0, v,{value:S.value,onChange:S.onChange,placeholder:S.placeholder})}),_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.v,{className:"rle-filters-row",groupClassName:"rle-filter-group",hideLabels:!0})]}),!T&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-bar__fade rle-filter-bar__fade--start","aria-hidden":"true"}),!R&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-bar__fade rle-filter-bar__fade--end","aria-hidden":"true"})]}),_jsxruntime.jsx.call(void 0, Ne,{search:S,onFiltersClick:()=>u(!0),filterCount:xe,action:r}),_jsxruntime.jsxs.call(void 0, "div",{className:`rle-body ${n?"rle-split":"rle-body--list-only"}`,"data-mobile-view":P,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-list",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-list-header",children:[_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.A,{}),t&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-list-header__toolbar",children:t})]}),_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.x,{className:"rle-list-grid"}),_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.z,{})]}),n&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-map",children:_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.y,{center:s,zoom:l,fallback:qe})})]}),n&&_jsxruntime.jsx.call(void 0, ve,{view:P,onViewChange:E}),_jsxruntime.jsx.call(void 0, be,{title:"Filters",open:C,onOpenChange:u,footer:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-btn rle-btn--ghost",onClick:Ce,children:"Clear all"}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:"rle-btn rle-btn--primary",onClick:()=>u(!1),children:["Show ",ke," results"]})]}),children:_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.v,{className:"rle-filter-stack",groupClassName:"rle-filter-group"})})]})}function Pe(e){return"provider"in e}function je(e){let t=e!=null&&!Pe(e),r=t?e.apiKey:void 0,i=t?e.mapId:void 0,[n,s]=_react.useState.call(void 0, ()=>!e||Pe(e)?{ready:!0,provider:_optionalChain([e, 'optionalAccess', _11 => _11.provider])}:{ready:!1});return _react.useEffect.call(void 0, ()=>{if(!r)return;let l=!1;return Promise.resolve().then(() => _interopRequireWildcard(require("./maps/google/index.cjs"))).then(({googleProvider:c})=>{l||s({ready:!0,provider:c({apiKey:r,mapId:i})})}),()=>{l=!0}},[r,i]),n}function et({onFiltersChange:e}){let t=_react.useRef.call(void 0, e);return t.current=e,ce("FiltersChanged",r=>{r.type==="FiltersChanged"&&t.current(r.filters)}),null}function pr(e){let{datasets:t,filters:r,map:i,components:n,initialFilters:s,onFiltersChange:l,mobileAction:c,search:d,toolbarEnd:v,config:p,autoFetch:g,className:P}=e,{ready:E,provider:C}=je(i);if(!E)return null;let u=[];for(let A of t)u.push(_chunkEYXV5OMYcjs.k.call(void 0, A));r&&u.push(_chunkEYXV5OMYcjs.l.call(void 0, r)),C&&u.push(_chunkEYXV5OMYcjs.j.call(void 0, C)),s&&u.push(_chunkEYXV5OMYcjs.n.call(void 0, s)),p&&u.push(_chunkEYXV5OMYcjs.i.call(void 0, p));let R=_chunkEYXV5OMYcjs.h.call(void 0, ...u),T={...fe,...n};return _jsxruntime.jsxs.call(void 0, _chunkEYXV5OMYcjs.B,{...R,children:[l&&_jsxruntime.jsx.call(void 0, et,{onFiltersChange:l}),_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.p,{...T,children:_jsxruntime.jsx.call(void 0, we,{className:P,search:d,toolbarEnd:v,mobileAction:c,autoFetch:g,hasMap:i!=null,mapCenter:_optionalChain([i, 'optionalAccess', _12 => _12.center]),mapZoom:_optionalChain([i, 'optionalAccess', _13 => _13.zoom])})})]})}exports.a = ce; exports.b = O; exports.c = H; exports.d = V; exports.e = D; exports.f = K; exports.g = $; exports.h = z; exports.i = U; exports.j = Z; exports.k = q; exports.l = fe; exports.m = ve; exports.n = be; exports.o = we; exports.p = pr;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as EntityAdapter, M as MapPoint } from './map-provider.interface-DT-v1plm.cjs';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ComponentType, ReactNode } from 'react';
|
|
4
4
|
|
|
@@ -34,6 +34,17 @@ interface DatasetDefinition<TEntity, TFilters> {
|
|
|
34
34
|
visible?: () => boolean;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
declare enum PaginationMode {
|
|
38
|
+
Paged = "paged",
|
|
39
|
+
Infinite = "infinite"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface IListingConfigOptions {
|
|
43
|
+
pagination: PaginationMode;
|
|
44
|
+
pageSize: number;
|
|
45
|
+
debounceMs: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
37
48
|
/**
|
|
38
49
|
* Framework-free registry for `FilterDefinition`s: programmatic add / remove /
|
|
39
50
|
* reorder / replace, plus folding raw control values into `TFilters`
|
|
@@ -117,4 +128,4 @@ declare function ListingComponentsProvider(props: Partial<IListingComponents> &
|
|
|
117
128
|
}): react.JSX.Element;
|
|
118
129
|
declare function useListingComponents(): IListingComponents;
|
|
119
130
|
|
|
120
|
-
export { type ClusterOptions as C, type DatasetDefinition as D, FilterRegistry as F, type
|
|
131
|
+
export { type ClusterOptions as C, type DatasetDefinition as D, FilterRegistry as F, type IListingConfigOptions as I, ListingComponentsProvider as L, type MarkerRenderer as M, PaginationMode as P, type IListingToolbarProps as a, type FilterControlProps as b, type FilterDefinition as c, type IListingCardProps as d, type IListingComponents as e, type IListingEmptyProps as f, type IListingFilterPanelProps as g, type IListingLoadingProps as h, type IListingMarkerProps as i, type IListingPopupProps as j, type IListingResultHeaderProps as k, type IListingSearchProps as l, type IListingSidebarProps as m, useListingComponents as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as EntityAdapter, M as MapPoint } from './map-provider.interface-DT-v1plm.js';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ComponentType, ReactNode } from 'react';
|
|
4
4
|
|
|
@@ -34,6 +34,17 @@ interface DatasetDefinition<TEntity, TFilters> {
|
|
|
34
34
|
visible?: () => boolean;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
declare enum PaginationMode {
|
|
38
|
+
Paged = "paged",
|
|
39
|
+
Infinite = "infinite"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface IListingConfigOptions {
|
|
43
|
+
pagination: PaginationMode;
|
|
44
|
+
pageSize: number;
|
|
45
|
+
debounceMs: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
37
48
|
/**
|
|
38
49
|
* Framework-free registry for `FilterDefinition`s: programmatic add / remove /
|
|
39
50
|
* reorder / replace, plus folding raw control values into `TFilters`
|
|
@@ -117,4 +128,4 @@ declare function ListingComponentsProvider(props: Partial<IListingComponents> &
|
|
|
117
128
|
}): react.JSX.Element;
|
|
118
129
|
declare function useListingComponents(): IListingComponents;
|
|
119
130
|
|
|
120
|
-
export { type ClusterOptions as C, type DatasetDefinition as D, FilterRegistry as F, type
|
|
131
|
+
export { type ClusterOptions as C, type DatasetDefinition as D, FilterRegistry as F, type IListingConfigOptions as I, ListingComponentsProvider as L, type MarkerRenderer as M, PaginationMode as P, type IListingToolbarProps as a, type FilterControlProps as b, type FilterDefinition as c, type IListingCardProps as d, type IListingComponents as e, type IListingEmptyProps as f, type IListingFilterPanelProps as g, type IListingLoadingProps as h, type IListingMarkerProps as i, type IListingPopupProps as j, type IListingResultHeaderProps as k, type IListingSearchProps as l, type IListingSidebarProps as m, useListingComponents as u };
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;"use client";
|
|
2
|
-
var
|
|
2
|
+
var _chunk2VUHLHHXcjs = require('./chunk-2VUHLHHX.cjs');var _chunkRXHR66FScjs = require('./chunk-RXHR66FS.cjs');var _chunkEYXV5OMYcjs = require('./chunk-EYXV5OMY.cjs');var y=(o=>(o.Paged="paged",o.Infinite="infinite",o))(y||{});var h=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(h||{});var d= (_class =class{__init() {this.listeners=new Set}constructor(e={}){;_class.prototype.__init.call(this);this.query={...e}}getQuery(){return{...this.query}}setQuery(e){this.query={...e},this.notify()}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(let e of[...this.listeners])e()}}, _class);var c=class{constructor(e={}){this.mode=_nullishCoalesce(e.mode, () => ("replace"))}getQuery(){if(typeof window>"u")return{};let e=new URLSearchParams(window.location.search),o={};for(let[i,s]of e)s!==""&&(o[i]=s);return o}setQuery(e){if(typeof window>"u")return;let o=new URLSearchParams;for(let[m,u]of Object.entries(e))u===void 0||u===""||o.set(m,u);let i=o.toString(),s=i?`?${i}`:"";if(s===window.location.search)return;let r=`${window.location.pathname}${s}${window.location.hash}`;this.mode==="push"?window.history.pushState(window.history.state,"",r):window.history.replaceState(window.history.state,"",r)}subscribe(e){return typeof window>"u"?()=>{}:(window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e)})}};var _jsxruntime = require('react/jsx-runtime');function _({children:t}){let{Toolbar:e}=_chunkEYXV5OMYcjs.q.call(void 0, );return _jsxruntime.jsx.call(void 0, e,{children:t})}var _react = require('react');function re(){let t=_chunkEYXV5OMYcjs.s.call(void 0, ),e=_chunkEYXV5OMYcjs.t.call(void 0, ),o=_react.useCallback.call(void 0, s=>t.loadPoints(s),[t]),i=_react.useCallback.call(void 0, (s,r)=>t.selectPoint(s,r),[t]);return{bounds:e.bounds,points:e.points,loadPoints:o,selectPoint:i}}function ue(t){let e=_chunkEYXV5OMYcjs.s.call(void 0, ),o=_chunkEYXV5OMYcjs.t.call(void 0, ),i=_react.useCallback.call(void 0, ()=>e.toggleLayer(t),[e,t]);return{visible:_nullishCoalesce(o.layers[t], () => (!0)),points:_nullishCoalesce(o.points[t], () => ([])),toggle:i}}exports.BrowserHistoryPort = c; exports.DatasetRegistry = _chunkEYXV5OMYcjs.c; exports.FilterRegistry = _chunkEYXV5OMYcjs.b; exports.ListingApp = _chunkRXHR66FScjs.p; exports.ListingComponentsProvider = _chunkEYXV5OMYcjs.p; exports.ListingConfig = _chunkEYXV5OMYcjs.f; exports.ListingEngine = _chunkEYXV5OMYcjs.g; exports.ListingEngineContext = _chunkEYXV5OMYcjs.r; exports.ListingEventType = h; exports.ListingFilters = _chunkEYXV5OMYcjs.v; exports.ListingList = _chunkEYXV5OMYcjs.x; exports.ListingMap = _chunkEYXV5OMYcjs.y; exports.ListingPagination = _chunkEYXV5OMYcjs.z; exports.ListingProvider = _chunkEYXV5OMYcjs.B; exports.ListingResultHeader = _chunkEYXV5OMYcjs.A; exports.ListingStore = _chunkEYXV5OMYcjs.a; exports.ListingToolbar = _; exports.MemoryHistoryPort = d; exports.PaginationMode = y; exports.TypedEmitter = _chunkEYXV5OMYcjs.d; exports.UrlSyncController = _chunk2VUHLHHXcjs.a; exports.composeListingProviders = _chunkEYXV5OMYcjs.h; exports.listingDefaultConfig = _chunkEYXV5OMYcjs.e; exports.useListing = _chunkEYXV5OMYcjs.s; exports.useListingComponents = _chunkEYXV5OMYcjs.q; exports.useListingEvent = _chunkRXHR66FScjs.a; exports.useListingFilters = _chunkEYXV5OMYcjs.u; exports.useListingLayer = ue; exports.useListingMap = re; exports.useListingResults = _chunkEYXV5OMYcjs.w; exports.useListingState = _chunkEYXV5OMYcjs.t; exports.withConfig = _chunkEYXV5OMYcjs.i; exports.withDataset = _chunkEYXV5OMYcjs.k; exports.withFilters = _chunkEYXV5OMYcjs.l; exports.withInitialFilters = _chunkEYXV5OMYcjs.n; exports.withMap = _chunkEYXV5OMYcjs.j; exports.withPrimaryDataset = _chunkEYXV5OMYcjs.o; exports.withUrlSync = _chunkEYXV5OMYcjs.m;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { P as Page, B as Bounds, E as EntityId, M as MapPoint, Q as QueryParams, L as LatLng } from './
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
7
|
-
import { P as PaginationMode, I as IListingConfigOptions } from './listing-config-options.interface-ZJYY_ZvR.cjs';
|
|
8
|
-
import { H as HistoryPort, U as UrlSyncController } from './url-sync.controller-CsU_QxoS.cjs';
|
|
9
|
-
export { a as UrlSyncEngine, b as UrlSyncOptions } from './url-sync.controller-CsU_QxoS.cjs';
|
|
1
|
+
import { P as Page, B as Bounds, E as EntityId, M as MapPoint, U as Unsubscribe, a as MapProvider, Q as QueryParams, L as LatLng } from './map-provider.interface-DT-v1plm.cjs';
|
|
2
|
+
export { b as EntityAdapter, c as MapHandle, d as MapInitOptions, e as PageRequest, R as RenderedLayer } from './map-provider.interface-DT-v1plm.cjs';
|
|
3
|
+
import { P as PaginationMode, D as DatasetDefinition, I as IListingConfigOptions, F as FilterRegistry, a as IListingToolbarProps } from './components-provider-FinfaqUT.cjs';
|
|
4
|
+
export { C as ClusterOptions, b as FilterControlProps, c as FilterDefinition, d as IListingCardProps, e as IListingComponents, f as IListingEmptyProps, g as IListingFilterPanelProps, h as IListingLoadingProps, i as IListingMarkerProps, j as IListingPopupProps, k as IListingResultHeaderProps, l as IListingSearchProps, m as IListingSidebarProps, L as ListingComponentsProvider, M as MarkerRenderer, u as useListingComponents } from './components-provider-FinfaqUT.cjs';
|
|
5
|
+
import { H as HistoryPort, U as UrlSyncController } from './url-sync.controller-DXSIWgTa.cjs';
|
|
6
|
+
export { a as UrlSyncEngine, b as UrlSyncOptions } from './url-sync.controller-DXSIWgTa.cjs';
|
|
10
7
|
import * as react from 'react';
|
|
11
8
|
import { ReactNode } from 'react';
|
|
12
|
-
export { L as ListingApp, a as ListingAppProps } from './listing-app-
|
|
9
|
+
export { L as ListingApp, a as ListingAppProps } from './listing-app-BMoMKD4c.cjs';
|
|
13
10
|
|
|
14
11
|
declare enum ListingEventType {
|
|
15
12
|
FiltersChanged = "FiltersChanged",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { P as Page, B as Bounds, E as EntityId, M as MapPoint, Q as QueryParams, L as LatLng } from './
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
7
|
-
import { P as PaginationMode, I as IListingConfigOptions } from './listing-config-options.interface-ZJYY_ZvR.js';
|
|
8
|
-
import { H as HistoryPort, U as UrlSyncController } from './url-sync.controller-DX67JivW.js';
|
|
9
|
-
export { a as UrlSyncEngine, b as UrlSyncOptions } from './url-sync.controller-DX67JivW.js';
|
|
1
|
+
import { P as Page, B as Bounds, E as EntityId, M as MapPoint, U as Unsubscribe, a as MapProvider, Q as QueryParams, L as LatLng } from './map-provider.interface-DT-v1plm.js';
|
|
2
|
+
export { b as EntityAdapter, c as MapHandle, d as MapInitOptions, e as PageRequest, R as RenderedLayer } from './map-provider.interface-DT-v1plm.js';
|
|
3
|
+
import { P as PaginationMode, D as DatasetDefinition, I as IListingConfigOptions, F as FilterRegistry, a as IListingToolbarProps } from './components-provider-cWVWEDXC.js';
|
|
4
|
+
export { C as ClusterOptions, b as FilterControlProps, c as FilterDefinition, d as IListingCardProps, e as IListingComponents, f as IListingEmptyProps, g as IListingFilterPanelProps, h as IListingLoadingProps, i as IListingMarkerProps, j as IListingPopupProps, k as IListingResultHeaderProps, l as IListingSearchProps, m as IListingSidebarProps, L as ListingComponentsProvider, M as MarkerRenderer, u as useListingComponents } from './components-provider-cWVWEDXC.js';
|
|
5
|
+
import { H as HistoryPort, U as UrlSyncController } from './url-sync.controller-DK5W_0OZ.js';
|
|
6
|
+
export { a as UrlSyncEngine, b as UrlSyncOptions } from './url-sync.controller-DK5W_0OZ.js';
|
|
10
7
|
import * as react from 'react';
|
|
11
8
|
import { ReactNode } from 'react';
|
|
12
|
-
export { L as ListingApp, a as ListingAppProps } from './listing-app-
|
|
9
|
+
export { L as ListingApp, a as ListingAppProps } from './listing-app-BSJKGh7k.js';
|
|
13
10
|
|
|
14
11
|
declare enum ListingEventType {
|
|
15
12
|
FiltersChanged = "FiltersChanged",
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as
|
|
2
|
+
import{a as S}from"./chunk-35KYEBAC.js";import{a as K,p as f}from"./chunk-CGT3RHJ7.js";import{A as J,B as N,a as P,b as L,c as x,d as b,e as v,f as Q,g as C,h as k,i as q,j as B,k as I,l as H,m as R,n as $,o as O,p as A,q as p,r as F,s as n,t as a,u as T,v as U,w as j,x as z,y as D,z as G}from"./chunk-R3FX2V3N.js";var y=(o=>(o.Paged="paged",o.Infinite="infinite",o))(y||{});var h=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(h||{});var d=class{query;listeners=new Set;constructor(e={}){this.query={...e}}getQuery(){return{...this.query}}setQuery(e){this.query={...e},this.notify()}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(let e of[...this.listeners])e()}};var c=class{mode;constructor(e={}){this.mode=e.mode??"replace"}getQuery(){if(typeof window>"u")return{};let e=new URLSearchParams(window.location.search),o={};for(let[i,s]of e)s!==""&&(o[i]=s);return o}setQuery(e){if(typeof window>"u")return;let o=new URLSearchParams;for(let[m,u]of Object.entries(e))u===void 0||u===""||o.set(m,u);let i=o.toString(),s=i?`?${i}`:"";if(s===window.location.search)return;let r=`${window.location.pathname}${s}${window.location.hash}`;this.mode==="push"?window.history.pushState(window.history.state,"",r):window.history.replaceState(window.history.state,"",r)}subscribe(e){return typeof window>"u"?()=>{}:(window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e)})}};import{jsx as w}from"react/jsx-runtime";function _({children:t}){let{Toolbar:e}=p();return w(e,{children:t})}import{useCallback as l}from"react";function re(){let t=n(),e=a(),o=l(s=>t.loadPoints(s),[t]),i=l((s,r)=>t.selectPoint(s,r),[t]);return{bounds:e.bounds,points:e.points,loadPoints:o,selectPoint:i}}import{useCallback as g}from"react";function ue(t){let e=n(),o=a(),i=g(()=>e.toggleLayer(t),[e,t]);return{visible:o.layers[t]??!0,points:o.points[t]??[],toggle:i}}export{c as BrowserHistoryPort,x as DatasetRegistry,L as FilterRegistry,f as ListingApp,A as ListingComponentsProvider,Q as ListingConfig,C as ListingEngine,F as ListingEngineContext,h as ListingEventType,U as ListingFilters,z as ListingList,D as ListingMap,G as ListingPagination,N as ListingProvider,J as ListingResultHeader,P as ListingStore,_ as ListingToolbar,d as MemoryHistoryPort,y as PaginationMode,b as TypedEmitter,S as UrlSyncController,k as composeListingProviders,v as listingDefaultConfig,n as useListing,p as useListingComponents,K as useListingEvent,T as useListingFilters,ue as useListingLayer,re as useListingMap,j as useListingResults,a as useListingState,q as withConfig,I as withDataset,H as withFilters,$ as withInitialFilters,B as withMap,O as withPrimaryDataset,R as withUrlSync};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { L as LatLng } from './
|
|
4
|
-
import {
|
|
5
|
-
import { D as DatasetDefinition, F as FilterRegistry, d as IListingComponents } from './components-provider-CjMxkxrP.js';
|
|
6
|
-
import { I as IListingConfigOptions } from './listing-config-options.interface-ZJYY_ZvR.js';
|
|
3
|
+
import { L as LatLng, a as MapProvider } from './map-provider.interface-DT-v1plm.cjs';
|
|
4
|
+
import { D as DatasetDefinition, F as FilterRegistry, e as IListingComponents, I as IListingConfigOptions } from './components-provider-FinfaqUT.cjs';
|
|
7
5
|
|
|
8
6
|
type BottomNavView = 'list' | 'map';
|
|
9
7
|
interface IBottomNavAction {
|
|
@@ -41,7 +39,7 @@ interface IStyledListingLayoutProps {
|
|
|
41
39
|
filterKey: string;
|
|
42
40
|
placeholder?: string;
|
|
43
41
|
};
|
|
44
|
-
/** Extra content rendered
|
|
42
|
+
/** Extra content rendered in `.rle-list-header` (above the list), to the right of `ListingResultHeader` (e.g. a sort control + save-search). */
|
|
45
43
|
toolbarEnd?: ReactNode;
|
|
46
44
|
/** Optional bottom-nav action button (e.g. "Add"), forwarded verbatim to `<BottomNav action={...} />`. Omit to render just Filters + the List|Map toggle. */
|
|
47
45
|
mobileAction?: IBottomNavAction;
|
|
@@ -71,11 +69,14 @@ interface IStyledListingLayoutProps {
|
|
|
71
69
|
* no Tailwind, no inline styles, no other stylesheet required.
|
|
72
70
|
*
|
|
73
71
|
* STRUCTURE (`.rle-app`):
|
|
74
|
-
* - `.rle-filter-bar` (desktop only, hidden below
|
|
75
|
-
* optional `Search` slot
|
|
76
|
-
* (`className="rle-filters-row"`,
|
|
77
|
-
*
|
|
78
|
-
*
|
|
72
|
+
* - `.rle-filter-bar` (desktop only, hidden below 1024px by CSS): the
|
|
73
|
+
* optional `Search` slot and `<ListingFilters>` laid out as a single
|
|
74
|
+
* horizontally-scrolling row (`className="rle-filters-row"`,
|
|
75
|
+
* `groupClassName="rle-filter-group"`) with edge fades. The result header +
|
|
76
|
+
* `toolbarEnd` are NOT here -- they sit in `.rle-list-header` above the list.
|
|
77
|
+
* - `.rle-list-header` (top of `.rle-list`): `<ListingResultHeader>` (title +
|
|
78
|
+
* count) at the left, `toolbarEnd` (sort control, save-search, ...) at the
|
|
79
|
+
* right -- a heading for the results, on every viewport.
|
|
79
80
|
* - `.rle-body.rle-split`: a CSS grid from 768px up (list column floors at
|
|
80
81
|
* 340px, caps at 42%; map takes the rest); below that, a single full-area
|
|
81
82
|
* panel with exactly one of `.rle-list`/`.rle-map` visible at a time via
|
|
@@ -130,7 +131,7 @@ interface ListingAppProps<TFilters> {
|
|
|
130
131
|
* `withDataset` doc comment.
|
|
131
132
|
*/
|
|
132
133
|
datasets: DatasetDefinition<any, TFilters>[];
|
|
133
|
-
/**
|
|
134
|
+
/** A `(reg) => { reg.add(...); }` callback that registers your filters -- forwarded verbatim to `withFilters`. */
|
|
134
135
|
filters?: (reg: FilterRegistry<TFilters>) => void;
|
|
135
136
|
/** A ready `MapProvider`, or `{ apiKey, mapId? }` to build a `googleProvider` internally. Omit for no map (the styled layout shows a "Map unavailable" fallback). */
|
|
136
137
|
map?: ListingAppMapProp;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { L as LatLng } from './
|
|
4
|
-
import {
|
|
5
|
-
import { D as DatasetDefinition, F as FilterRegistry, d as IListingComponents } from './components-provider-CF0Mo0B8.cjs';
|
|
6
|
-
import { I as IListingConfigOptions } from './listing-config-options.interface-ZJYY_ZvR.cjs';
|
|
3
|
+
import { L as LatLng, a as MapProvider } from './map-provider.interface-DT-v1plm.js';
|
|
4
|
+
import { D as DatasetDefinition, F as FilterRegistry, e as IListingComponents, I as IListingConfigOptions } from './components-provider-cWVWEDXC.js';
|
|
7
5
|
|
|
8
6
|
type BottomNavView = 'list' | 'map';
|
|
9
7
|
interface IBottomNavAction {
|
|
@@ -41,7 +39,7 @@ interface IStyledListingLayoutProps {
|
|
|
41
39
|
filterKey: string;
|
|
42
40
|
placeholder?: string;
|
|
43
41
|
};
|
|
44
|
-
/** Extra content rendered
|
|
42
|
+
/** Extra content rendered in `.rle-list-header` (above the list), to the right of `ListingResultHeader` (e.g. a sort control + save-search). */
|
|
45
43
|
toolbarEnd?: ReactNode;
|
|
46
44
|
/** Optional bottom-nav action button (e.g. "Add"), forwarded verbatim to `<BottomNav action={...} />`. Omit to render just Filters + the List|Map toggle. */
|
|
47
45
|
mobileAction?: IBottomNavAction;
|
|
@@ -71,11 +69,14 @@ interface IStyledListingLayoutProps {
|
|
|
71
69
|
* no Tailwind, no inline styles, no other stylesheet required.
|
|
72
70
|
*
|
|
73
71
|
* STRUCTURE (`.rle-app`):
|
|
74
|
-
* - `.rle-filter-bar` (desktop only, hidden below
|
|
75
|
-
* optional `Search` slot
|
|
76
|
-
* (`className="rle-filters-row"`,
|
|
77
|
-
*
|
|
78
|
-
*
|
|
72
|
+
* - `.rle-filter-bar` (desktop only, hidden below 1024px by CSS): the
|
|
73
|
+
* optional `Search` slot and `<ListingFilters>` laid out as a single
|
|
74
|
+
* horizontally-scrolling row (`className="rle-filters-row"`,
|
|
75
|
+
* `groupClassName="rle-filter-group"`) with edge fades. The result header +
|
|
76
|
+
* `toolbarEnd` are NOT here -- they sit in `.rle-list-header` above the list.
|
|
77
|
+
* - `.rle-list-header` (top of `.rle-list`): `<ListingResultHeader>` (title +
|
|
78
|
+
* count) at the left, `toolbarEnd` (sort control, save-search, ...) at the
|
|
79
|
+
* right -- a heading for the results, on every viewport.
|
|
79
80
|
* - `.rle-body.rle-split`: a CSS grid from 768px up (list column floors at
|
|
80
81
|
* 340px, caps at 42%; map takes the rest); below that, a single full-area
|
|
81
82
|
* panel with exactly one of `.rle-list`/`.rle-map` visible at a time via
|
|
@@ -130,7 +131,7 @@ interface ListingAppProps<TFilters> {
|
|
|
130
131
|
* `withDataset` doc comment.
|
|
131
132
|
*/
|
|
132
133
|
datasets: DatasetDefinition<any, TFilters>[];
|
|
133
|
-
/**
|
|
134
|
+
/** A `(reg) => { reg.add(...); }` callback that registers your filters -- forwarded verbatim to `withFilters`. */
|
|
134
135
|
filters?: (reg: FilterRegistry<TFilters>) => void;
|
|
135
136
|
/** A ready `MapProvider`, or `{ apiKey, mapId? }` to build a `googleProvider` internally. Omit for no map (the styled layout shows a "Map unavailable" fallback). */
|
|
136
137
|
map?: ListingAppMapProp;
|