2.0.56-alpha • Published 4 days ago

buk-search-widget v2.0.56-alpha

Weekly downloads
-
License
MIT
Repository
-
Last release
4 days ago

BUK Hotel Room Search Widget

The Hotel Room Search Widget is a TypeScript widget that enables users to search for hotel rooms on buktrips.com by location, check-in and check-out dates, and occupancy details. This document provides information on how to use the widget, customize it, and the license.

Installation

You can install the widget as an npm package:

npm i buk-search-widget

Alternatively, you can include the widget in your HTML file via a CDN:

<script src="https://unpkg.com/buk-search-widget/dist/index.js"></script>

Usage

To use the widget, you need to create an HTML form with the following fields:

  • buk-location: A text input field for the location.
  • buk-checkin: A date input field for the check-in date.
  • buk-checkout: A date input field for the check-out date.
  • buk-occupancy: A container element for the occupancy details. This element should have a data-widget="occupancy" attribute.
  • buk-search: A submit button for searching the hotel rooms.

Here's an example HTML form:

    <div class="buk-search-container">
      <form id="buk-search-form">
        <div class="buk-form-group">
          <label for="buk-location">Location</label>
          <input
            type="text"
            id="buk-location"
            name="buk-location"
            placeholder="Enter a location"
            required
          />
          <ul id="buk-suggestions"></ul>
          <div id="buk-location-error" class="buk-error-message"></div>
        </div>

        <div class="buk-form-group">
          <label for="buk-checkin">Check-in</label>
          <input type="date" id="buk-checkin" name="buk-checkin" required />
          <div id="buk-checkin-error" class="buk-error-message"></p>
        </div>

        <div class="buk-form-group">
          <label for="buk-checkout">Check-out</label>
          <input type="date" id="buk-checkout" name="buk-checkout" required />
          <div id="buk-checkout-error" class="buk-error-message"></p>
        </div>

        <div class="buk-form-group">
          <button
            type="button"
            id="buk-occupancy-dropdown"
            class="buk-occupancy-dropdown"
          >
            1 Room, 1 Adult
          </button>
          <div class="buk-occupancy-dropdown-content">
            <div id="buk-rooms-container"></div>
            <button type="button" id="buk-add-room">Add Room</button>
            <div id="buk-occupancy-error" class="buk-error-message"></p>
          </div>
        </div>

        <div class="buk-form-group">
          <button type="submit" id="buk-search-btn">Search</button>
        </div>
      </form>
    </div>

Customization

You can customize the widget by applying custom CSS styles to the HTML elements. Here are some of the CSS classes that you can use:

  • .buk-form-group: Applies to each form group element.
  • .buk-occupancy-dropdown: Applies to the occupancy dropdown container.
  • .buk-occupancy-dropdown-content: Applies to the occupancy dropdown content.
  • .buk-room-container: Applies to each room container element.
  • .buk-remove-room: Applies to each remove room button element.
  • .buk-age-select: Applies to each age select element.
  • .buk-error-message: Applies to the error messages.
  • buk-search-btn: Applies to Search button.

License

This widget is licensed under the MIT license.

2.0.58-alpha

4 days ago

2.0.57-alpha

10 days ago

2.0.56-alpha

10 days ago

2.0.55-alpha

18 days ago

2.0.54-alpha

25 days ago

2.0.53-alpha

25 days ago

2.0.52-alpha

3 months ago

2.0.51

5 months ago

2.0.50

5 months ago

2.0.49

5 months ago

2.0.47

5 months ago

2.0.46-alpha

5 months ago

2.0.47-alpha

5 months ago

2.0.31-alpha

10 months ago

2.0.42-alpha

8 months ago

2.0.37-alpha

9 months ago

2.0.34

9 months ago

2.0.31

10 months ago

2.0.32

10 months ago

2.0.30

10 months ago

2.0.34-alpha

9 months ago

2.0.30-alpha.2

10 months ago

2.0.35-alpha

9 months ago

2.0.39

8 months ago

2.0.39-alpha

9 months ago

2.0.41-alpha

8 months ago

2.0.36-alpha

9 months ago

2.0.32-alpha

10 months ago

2.0.40-alpha

8 months ago

2.0.33-alpha

9 months ago

2.0.43-alpha

6 months ago

2.0.29

10 months ago

2.0.30-alpha.1

10 months ago

2.0.27-alpha.2

10 months ago

2.0.27-alpha.3

10 months ago

2.0.27-alpha.4

10 months ago

2.0.27

10 months ago

2.0.26

11 months ago

2.0.24

11 months ago

2.0.25

11 months ago

2.0.22

11 months ago

2.0.21

11 months ago

2.0.15

11 months ago

2.0.16

11 months ago

2.0.11

11 months ago

2.0.12

11 months ago

2.0.19

11 months ago

2.0.17

11 months ago

2.0.18

11 months ago

2.0.20

11 months ago

1.0.16

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.9

1 year ago

2.0.10

1 year ago

1.0.11

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

2.0.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago