bukazu-portal-react 3.6.4 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +197 -11
- package/build/de-BevgK7MP.js +1 -0
- package/build/es-Duc9j_9n.js +1 -0
- package/build/fr-BYrK3HPZ.js +1 -0
- package/build/index-ByTgT_lE.js +783 -0
- package/build/index.css +1 -1
- package/build/it-6vx2ia4b.js +1 -0
- package/build/nl-DR0uGSJ0.js +1 -0
- package/build/portal.es.js +1 -23631
- package/build/portal.umd.js +108 -152
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -1,22 +1,208 @@
|
|
|
1
|
-
#
|
|
1
|
+
# bukazu-portal-react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A React component library that embeds the [Bukazu](https://www.bukazu.com) booking portal — calendar, search, and reviews modules — directly into any React application.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What is Bukazu?
|
|
8
|
+
|
|
9
|
+
[Bukazu](https://www.bukazu.com) is an online booking and property-management platform for holiday rentals. It provides a fully-managed back-end (availability calendars, pricing, booking forms, guest reviews) and exposes that data through a GraphQL API. This library is the official front-end component that lets you surface Bukazu data on your own website without building the UI from scratch.
|
|
10
|
+
|
|
11
|
+
### Modules included
|
|
12
|
+
|
|
13
|
+
| Module | Description |
|
|
14
|
+
|--------|-------------|
|
|
15
|
+
| **Calendar** | Interactive availability calendar with arrival/departure highlighting, pricing, discount indicators, and an embedded booking form |
|
|
16
|
+
| **Search** | Filterable property search with grid/list view, pagination, and customisable filter fields |
|
|
17
|
+
| **Reviews** | Display guest reviews and aggregate score for a specific property |
|
|
18
|
+
|
|
19
|
+
---
|
|
4
20
|
|
|
5
21
|
## Installation
|
|
6
22
|
|
|
7
23
|
```bash
|
|
8
|
-
|
|
24
|
+
npm install bukazu-portal-react
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Then import the bundled stylesheet once in your application entry point:
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import 'bukazu-portal-react/index.css';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
The default export is the `Portal` component. Pass your **portal code** (and optionally an **object code**) to load the correct module.
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import Portal from 'bukazu-portal-react';
|
|
41
|
+
import 'bukazu-portal-react/index.css';
|
|
42
|
+
|
|
43
|
+
function App() {
|
|
44
|
+
return (
|
|
45
|
+
<Portal
|
|
46
|
+
portalCode="YOUR_PORTAL_CODE"
|
|
47
|
+
objectCode="YOUR_OBJECT_CODE"
|
|
48
|
+
locale="en"
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
9
52
|
```
|
|
10
53
|
|
|
11
|
-
|
|
54
|
+
---
|
|
12
55
|
|
|
13
|
-
|
|
14
|
-
import { Portal } from 'bukazu-portal-react';
|
|
56
|
+
## Usage by Module
|
|
15
57
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
58
|
+
### Calendar (availability + booking form)
|
|
59
|
+
|
|
60
|
+
Render the calendar for a specific property by supplying both `portalCode` and `objectCode`. No `pageType` is needed — the calendar is the default when an `objectCode` is present.
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
<Portal
|
|
64
|
+
portalCode="YOUR_PORTAL_CODE"
|
|
65
|
+
objectCode="YOUR_OBJECT_CODE"
|
|
66
|
+
locale="en"
|
|
67
|
+
/>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Search
|
|
71
|
+
|
|
72
|
+
Render the property search page by omitting `objectCode`. You can pre-populate filter values via the `filters` prop.
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
<Portal
|
|
76
|
+
portalCode="YOUR_PORTAL_CODE"
|
|
77
|
+
locale="en"
|
|
78
|
+
filters={{
|
|
79
|
+
persons_min: '2',
|
|
80
|
+
arrival_date: '2024-07-01',
|
|
81
|
+
departure_date: '2024-07-14'
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
21
84
|
```
|
|
22
85
|
|
|
86
|
+
### Reviews
|
|
87
|
+
|
|
88
|
+
Render the reviews page for a specific property by passing `objectCode` together with `pageType="reviews"`.
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
<Portal
|
|
92
|
+
portalCode="YOUR_PORTAL_CODE"
|
|
93
|
+
objectCode="YOUR_OBJECT_CODE"
|
|
94
|
+
pageType="reviews"
|
|
95
|
+
locale="en"
|
|
96
|
+
/>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Props
|
|
102
|
+
|
|
103
|
+
| Prop | Type | Required | Default | Description |
|
|
104
|
+
|------|------|----------|---------|-------------|
|
|
105
|
+
| `portalCode` | `string` | ✅ | — | Your Bukazu portal identifier. Find it in your Bukazu back-office. |
|
|
106
|
+
| `objectCode` | `string` | — | — | The property code. Required for the Calendar and Reviews modules. |
|
|
107
|
+
| `pageType` | `string` | — | — | Set to `"reviews"` to render the Reviews module. |
|
|
108
|
+
| `locale` | `string` | — | `"en"` | Display language. Supported values: `en`, `nl`, `de`, `fr`, `es`, `it`. |
|
|
109
|
+
| `filters` | `FiltersType` | — | `{}` | Pre-set filter values for the Search module (see below). |
|
|
110
|
+
| `api_url` | `string` | — | `https://api.bukazu.com/graphql` | Override the GraphQL endpoint (useful for staging environments). |
|
|
111
|
+
|
|
112
|
+
### `filters` object
|
|
113
|
+
|
|
114
|
+
All filter keys are optional strings/arrays.
|
|
115
|
+
|
|
116
|
+
| Key | Type | Description |
|
|
117
|
+
|-----|------|-------------|
|
|
118
|
+
| `arrival_date` | `string` | Pre-selected arrival date (`YYYY-MM-DD`) |
|
|
119
|
+
| `departure_date` | `string` | Pre-selected departure date (`YYYY-MM-DD`) |
|
|
120
|
+
| `persons_min` | `string` | Minimum number of persons |
|
|
121
|
+
| `persons_max` | `string` | Maximum number of persons |
|
|
122
|
+
| `bedrooms_min` | `string` | Minimum number of bedrooms |
|
|
123
|
+
| `bathrooms_min` | `string` | Minimum number of bathrooms |
|
|
124
|
+
| `weekprice_max` | `string` | Maximum weekly price |
|
|
125
|
+
| `countries` | `any` | Filter by country |
|
|
126
|
+
| `regions` | `any` | Filter by region |
|
|
127
|
+
| `cities` | `string` | Filter by city |
|
|
128
|
+
| `properties` | `any[]` | Filter by property characteristics |
|
|
129
|
+
| `extra_search` | `string` | Free-text search term |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Colour Customisation
|
|
134
|
+
|
|
135
|
+
Colours are defined in your Bukazu back-office and applied automatically as CSS custom properties on the page root. You can also override them in your own stylesheet:
|
|
136
|
+
|
|
137
|
+
```css
|
|
138
|
+
:root {
|
|
139
|
+
--bukazu-button: #0055a5; /* primary action button */
|
|
140
|
+
--bukazu-button_cta: #e94e1b; /* call-to-action button */
|
|
141
|
+
--bukazu-arrival: #c8f5c8; /* arrival day highlight */
|
|
142
|
+
--bukazu-departure: #ffd6d6; /* departure day highlight */
|
|
143
|
+
--bukazu-booked: #d6d6d6; /* booked / unavailable */
|
|
144
|
+
--bukazu-cell: #f0f8ff; /* available day cell */
|
|
145
|
+
--bukazu-discount: #fff3cd; /* discounted price cell */
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Supported Languages
|
|
152
|
+
|
|
153
|
+
Pass one of the following BCP-47 locale codes to the `locale` prop:
|
|
154
|
+
|
|
155
|
+
| Code | Language |
|
|
156
|
+
|------|----------|
|
|
157
|
+
| `en` | English (default) |
|
|
158
|
+
| `nl` | Dutch |
|
|
159
|
+
| `de` | German |
|
|
160
|
+
| `fr` | French |
|
|
161
|
+
| `es` | Spanish |
|
|
162
|
+
| `it` | Italian |
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Integration Troubleshooting
|
|
167
|
+
|
|
168
|
+
The component performs basic validation on startup and will display an error message in place of the portal if any of the following conditions are detected.
|
|
169
|
+
|
|
170
|
+
### Common errors
|
|
171
|
+
|
|
172
|
+
| Symptom | Cause | Solution |
|
|
173
|
+
|---------|-------|----------|
|
|
174
|
+
| *"No portal code is specified"* | `portalCode` prop is missing or empty | Supply the portal code from your Bukazu back-office |
|
|
175
|
+
| *"Invalid locale"* | An unsupported locale string was passed | Use one of: `en`, `nl`, `de`, `fr`, `es`, `it` |
|
|
176
|
+
| *"is not a valid page"* | `pageType` has an unrecognised value | Only `"reviews"` is a valid `pageType`; omit the prop for the default modules |
|
|
177
|
+
| Blank / nothing rendered | CSS stylesheet not imported | Add `import 'bukazu-portal-react/index.css'` to your entry point |
|
|
178
|
+
| API errors in the console | Invalid portal or object code | Double-check the codes in your Bukazu back-office |
|
|
179
|
+
|
|
180
|
+
### Reporting Issues
|
|
181
|
+
|
|
182
|
+
If you encounter a bug or have a feature request, please [open an issue](https://github.com/BUKAZU/React-portal/issues) on GitHub and include:
|
|
183
|
+
|
|
184
|
+
1. The version of `bukazu-portal-react` you are using (`npm list bukazu-portal-react`)
|
|
185
|
+
2. Your React version
|
|
186
|
+
3. A minimal reproducible example
|
|
187
|
+
4. Any console errors or network errors from the browser DevTools
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Bundle Analysis
|
|
192
|
+
|
|
193
|
+
The production build uses [Terser](https://terser.org/) for advanced minification (with console/debugger stripping and Safari 10 mangling compatibility) and reports gzip sizes for all output files.
|
|
194
|
+
|
|
195
|
+
To generate an interactive visual bundle report, run:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
npm run build:analyze
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
This builds the library with `ANALYZE=true`, which activates [`rollup-plugin-visualizer`](https://github.com/btd/rollup-plugin-visualizer) and writes a `build/stats.html` report. The report opens automatically in your browser and shows the size breakdown of every module in the bundle (including gzip and Brotli sizes), making it easy to identify large dependencies that are candidates for further size reduction.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## License
|
|
206
|
+
|
|
207
|
+
MIT © [Bukazu](https://www.bukazu.com)
|
|
208
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e,a as t,c as n,d as a}from"./index-ByTgT_lE.js";const i={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},o={date:e({formats:{full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},defaultWidth:"full"}),time:e({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:e({formats:{full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},r={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},s={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},h={narrow:s.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:s.wide},d={code:"de",formatDistance:(e,t,n)=>{let a;const o=n?.addSuffix?i[e].withPreposition:i[e].standalone;return a="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:"vor "+a:a},formatLong:o,formatRelative:(e,t,n,a)=>r[e],localize:{ordinalNumber:e=>Number(e)+".",era:t({values:{narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},defaultWidth:"wide"}),quarter:t({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:t({values:s,formattingValues:h,defaultWidth:"wide"}),day:t({values:{narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},defaultWidth:"wide"}),dayPeriod:t({values:{narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},defaultWidth:"wide",formattingValues:{narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:a({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:n({matchPatterns:{narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^v/i,/^n/i]},defaultParseWidth:"any"}),quarter:n({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:n({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:n({matchPatterns:{narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:n({matchPatterns:{narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},defaultMatchWidth:"wide",parsePatterns:{any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}};export{d as de,d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e,a,c as o,d as t}from"./index-ByTgT_lE.js";const n={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},i={date:e({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:e({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:e({formats:{full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},d={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},r={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},s={code:"es",formatDistance:(e,a,o)=>{let t;const i=n[e];return t="string"==typeof i?i:1===a?i.one:i.other.replace("{{count}}",a.toString()),o?.addSuffix?o.comparison&&o.comparison>0?"en "+t:"hace "+t:t},formatLong:i,formatRelative:(e,a,o,t)=>1!==a.getHours()?r[e]:d[e],localize:{ordinalNumber:(e,a)=>Number(e)+"º",era:a({values:{narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},defaultWidth:"wide"}),quarter:a({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:a({values:{narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},defaultWidth:"wide"}),day:a({values:{narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},defaultWidth:"wide"}),dayPeriod:a({values:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:t({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:o({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},defaultParseWidth:"any"}),quarter:o({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:o({matchPatterns:{narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},defaultParseWidth:"any"}),day:o({matchPatterns:{narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:o({matchPatterns:{narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:1}};export{s as default,s as es};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e,a as i,c as a,d as t}from"./index-ByTgT_lE.js";const n={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},r={date:e({formats:{full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:e({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:e({formats:{full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},o={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},s=["MMM","MMMM"],m={code:"fr",formatDistance:(e,i,a)=>{let t;const r=n[e];return t="string"==typeof r?r:1===i?r.one:r.other.replace("{{count}}",String(i)),a?.addSuffix?a.comparison&&a.comparison>0?"dans "+t:"il y a "+t:t},formatLong:r,formatRelative:(e,i,a,t)=>o[e],localize:{preprocessor:(e,i)=>{if(1===e.getDate())return i;return i.some(e=>e.isToken&&s.includes(e.value))?i.map(e=>e.isToken&&"do"===e.value?{isToken:!0,value:"d"}:e):i},ordinalNumber:(e,i)=>{const a=Number(e),t=i?.unit;if(0===a)return"0";let n;return n=1===a?t&&["year","week","hour","minute","second"].includes(t)?"ère":"er":"ème",a+n},era:i({values:{narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},defaultWidth:"wide"}),quarter:i({values:{narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:i({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},defaultWidth:"wide"}),day:i({values:{narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},defaultWidth:"wide"}),dayPeriod:i({values:{narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},defaultWidth:"wide"})},match:{ordinalNumber:t({matchPattern:/^(\d+)(ième|ère|ème|er|e)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:a({matchPatterns:{narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^av/i,/^ap/i]},defaultParseWidth:"any"}),quarter:a({matchPatterns:{narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:a({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:a({matchPatterns:{narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:a({matchPatterns:{narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}};export{m as default,m as fr};
|