Basic Search Bar Element

Usage no npm install needed!

<script type="module">
  import sdlSrchBar from '';



Basic Search Bar Element

Install the Polymer-CLI

First, make sure you have the Polymer CLI and npm (packaged with Node.js) installed. Run npm install to install your element's dependencies, then run polymer serve to serve your element locally.

Viewing Your Element In Development Mode

$ cd sdl-srch-bar
$ polymer serve

Build the sdl-srch-bar demo & component

$ ./sdlMake 

Once you run this build there will be two build directories created: build-demo & build-component

Run the es6 version of the Demo


Include sdl-srch-bar-loader.js to use as stand-alone component

See File: sdl-srch-bar/build-component/es6-bundled/demo/index.html

<!doctype html>
<html lang="en">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">

    <title>sdl-srch-bar demo</title>
    <script type="module" src="../../sdl-srch-bar-loader.js"></script>

          <sdl-srch-bar id='srch-bar1' ajaxUrl='data/srch-data.txt'>  

              <input name="input1" label="Filter Search">
        <div id="message1"></div>

    addEventListener('DOMContentLoaded', function(){ 

        var srch1 = document.querySelector('#srch-bar1');

          srch1.addEventListener("changed", function(e) {
            var message = document.querySelector('#message1');
            message.innerHTML = "<b><u>'changed' event fired:</u></b>&nbsp;&nbsp;&nbsp;";
            message.innerHTML += "<br>e.detail.formData = " + JSON.stringify(e.detail.formData);
            message.innerHTML += "<br>e.detail.payload = " + JSON.stringify(e.detail.payload);
          }, false);

        }, 1000);

      }, false);