2.0.79 • Published 8 months ago

buk-search-widget v2.0.79

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months 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.79

8 months ago

2.0.77

8 months ago

2.0.78

8 months ago

2.0.75

8 months ago

2.0.76

8 months ago

2.0.73

8 months ago

2.0.74

8 months ago

2.0.71

8 months ago

2.0.72

8 months ago

2.0.70

9 months ago

2.0.69

9 months ago

2.0.6-4.alpha

10 months ago

2.0.62-alpha.1

10 months ago

2.0.6-3.alpha

10 months ago

2.0.6-5.alpha

10 months ago

2.0.68

10 months ago

2.0.66

10 months ago

2.0.67

10 months ago

2.0.65

10 months ago

2.0.59-alpha

12 months ago

2.0.60-alpha

12 months ago

2.0.58-alpha

12 months ago

2.0.57-alpha

1 year ago

2.0.56-alpha

1 year ago

2.0.55-alpha

1 year ago

2.0.54-alpha

1 year ago

2.0.53-alpha

1 year ago

2.0.52-alpha

1 year ago

2.0.51

1 year ago

2.0.50

1 year ago

2.0.49

1 year ago

2.0.47

1 year ago

2.0.46-alpha

1 year ago

2.0.47-alpha

1 year ago

2.0.31-alpha

2 years ago

2.0.42-alpha

2 years ago

2.0.37-alpha

2 years ago

2.0.34

2 years ago

2.0.31

2 years ago

2.0.32

2 years ago

2.0.30

2 years ago

2.0.34-alpha

2 years ago

2.0.30-alpha.2

2 years ago

2.0.35-alpha

2 years ago

2.0.39

2 years ago

2.0.39-alpha

2 years ago

2.0.41-alpha

2 years ago

2.0.36-alpha

2 years ago

2.0.32-alpha

2 years ago

2.0.40-alpha

2 years ago

2.0.33-alpha

2 years ago

2.0.43-alpha

2 years ago

2.0.29

2 years ago

2.0.30-alpha.1

2 years ago

2.0.27-alpha.2

2 years ago

2.0.27-alpha.3

2 years ago

2.0.27-alpha.4

2 years ago

2.0.27

2 years ago

2.0.26

2 years ago

2.0.24

2 years ago

2.0.25

2 years ago

2.0.22

2 years ago

2.0.21

2 years ago

2.0.15

2 years ago

2.0.16

2 years ago

2.0.11

2 years ago

2.0.12

2 years ago

2.0.19

2 years ago

2.0.17

2 years ago

2.0.18

2 years ago

2.0.20

2 years ago

1.0.16

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.10

2 years ago

1.0.11

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago