@mirai/core 0.4.72 → 0.4.73
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 +31 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -92,7 +92,6 @@ Additionally, the bracket binding system provides two different functionalities:
|
|
|
92
92
|
- **Single brackets**: Used for binding component state variables, allowing dynamic values to be inserted into UI elements.
|
|
93
93
|
- **Double brackets**: Used to bind dictionary keys, making it easy to inject structured data, such as predefined text, into templates or UI components.
|
|
94
94
|
|
|
95
|
-
|
|
96
95
|
This system is useful for separating presentation logic from data and allows for more flexibility when developing components.
|
|
97
96
|
|
|
98
97
|
Example of bracket binding:
|
|
@@ -218,7 +217,6 @@ Here’s an example of the CSS variables available for customization:
|
|
|
218
217
|
|
|
219
218
|
These CSS variables offer a wide range of customization options, from changing colors and borders to adjusting text and layout. By using them, you can tailor the `<Chat>` component to fit perfectly within the design of your website.
|
|
220
219
|
|
|
221
|
-
|
|
222
220
|
## 2.5 `<Checkout>`
|
|
223
221
|
|
|
224
222
|
The `<Checkout>` component is the main reservation window, where users can enter their personal details, choose payment methods, and set notifications for the hotel. It also provides a summary of the reservation before the user proceeds with the booking process.
|
|
@@ -250,7 +248,6 @@ Additionally, like other components, the `<Deals>` component offers some light v
|
|
|
250
248
|
|
|
251
249
|
## 2.7 `<Environment>`
|
|
252
250
|
|
|
253
|
-
|
|
254
251
|
The `<Environment>` component allows you to modify the environment in which the other Mirai components are running. The environment is defined as the combination of language and currency. This component lets you adjust three properties:
|
|
255
252
|
|
|
256
253
|
- `data-currency:bool`: Controls the visibility of the currency selector (true/false).
|
|
@@ -274,7 +271,7 @@ The `<Finder>` component displays the general accommodation search interface. He
|
|
|
274
271
|
You can customize specific properties using HTML data attributes:
|
|
275
272
|
|
|
276
273
|
- `data-icon="true"`: Displays an icon on the button instead of the localized search text.
|
|
277
|
-
-
|
|
274
|
+
- `data-inline="false"`: Displays each input in the same format as an `<InputField>`.
|
|
278
275
|
- `data-layout="column"`: Displays the component in a column layout (automatically applies on mobile devices).
|
|
279
276
|
|
|
280
277
|
You can also adjust various visual properties using the CSS variables exposed by the component:
|
|
@@ -321,6 +318,36 @@ The following CSS variables are available for customization:
|
|
|
321
318
|
|
|
322
319
|
These variables allow you to control the padding, dimensions, and other styling aspects of the calendar, occupation selector, and places fields, offering greater flexibility to align the component with your website’s design.
|
|
323
320
|
|
|
321
|
+
### Events
|
|
322
|
+
|
|
323
|
+
The component has in and out events. For change the state you need to publish the event `setStore`. And for know the state changes you need to subscribe the event `finderChange`.
|
|
324
|
+
|
|
325
|
+
Use of `setStore` event:
|
|
326
|
+
|
|
327
|
+
```javascript
|
|
328
|
+
window.Mirai.Event.publish('setStore', {
|
|
329
|
+
chainSelectorValue: 111222,
|
|
330
|
+
calendar: [new Date(), new Date()],
|
|
331
|
+
hsri: '02080',
|
|
332
|
+
//type 1: guest,type 2: adult, type 3: children
|
|
333
|
+
occupation: [
|
|
334
|
+
{ ages: [null, null], amount: 2, type: 2 },
|
|
335
|
+
{ ages: [3], amount: 1, type: 3 },
|
|
336
|
+
],
|
|
337
|
+
promocode: 'TEST',
|
|
338
|
+
});
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
You can send one or all values
|
|
342
|
+
|
|
343
|
+
Use of `finderChange` event:
|
|
344
|
+
|
|
345
|
+
```javascript
|
|
346
|
+
window.Mirai.Event.subscribe('finderChange', ({ field, previousValue, value } = {}) => {
|
|
347
|
+
//field can be: place, calendar, occupation, promocode
|
|
348
|
+
});
|
|
349
|
+
```
|
|
350
|
+
|
|
324
351
|
## 2.9 `<Header>`
|
|
325
352
|
|
|
326
353
|
The `<Header>` component is another new addition to the Mirai component suite. It allows you to create a header for your pages that can include:
|
|
@@ -447,7 +474,6 @@ The `<Signup>` component displays the registration form for the Mirai platform.
|
|
|
447
474
|
<div data-mirai-component="signup"></div>
|
|
448
475
|
```
|
|
449
476
|
|
|
450
|
-
|
|
451
477
|
# 3. Development
|
|
452
478
|
|
|
453
479
|
You have to follow the next steps:
|