aurelia-ui-toolkits / aurelia-kendoui-bridge

MIT License
117 stars 31 forks source link

Tutorials creation log #675

Open adriatic opened 7 years ago

adriatic commented 7 years ago

The content of the following six section is the skeleton for the actual tutorials documents.

  1. esnext navaigation skeleton

  2. typescript navigation skeleton

  3. webpack navigation skeleton

  4. esnext aspnetcore navigation skeleton

  5. typescript aspnetcore navigation skeleton

  6. typescript webpack navigation skeleton

adriatic commented 7 years ago

esnext navigation skeleton

  1. Kendo Core installation: https://aurelia-ui-toolkits.gitbooks.io/kendo-ui-sdk-installation/content/installation/installing%20kendo/advanced/core/jspm.html

  2. jnpm install css kendo-ui aurelia-kendoui-bridge

     Updating registry cache...
     Looking up npm:jquery
     Looking up github:systemjs/plugin-css
     Looking up github:kendo-labs/bower-kendo-ui
     Downloading github:kendo-labs/bower-kendo-ui@2016.3.1306
     ok   Installed jquery as npm:jquery@^3.1.1 (3.1.1)
     ok   Installed css as github:systemjs/plugin-css@^0.1.32 (0.1.32)
     ok   Installed kendo-ui as github:kendo-labs/bower-kendo-ui@^2016.3.1306 (2016.3.1306)
     Clearing configuration for npm:jquery@2.2.4
     Removing package files for npm:jquery@2.2.4
     Removing package files for github:systemjs/plugin-css@0.1.31
    
     The following existing package versions were altered by install deduping:
    
       jquery 2.2.4 -> 3.1.1
       systemjs/plugin-css 0.1.31 -> 0.1.32
    
     To keep existing dependencies locked during install, use the --lock option.
     ok   Install tree has no forks.
    
     ok   Install complete.
  3. Update config.js

    paths: {
       "*": "dist/*",
       "github:*": "jspm_packages/github/*",
       "npm:*": "jspm_packages/npm/*",
       "kendo.*": "jspm_packages/github/kendo-labs/bower-kendo-ui@2016.3.1306/js/kendo.*.js" <----
    },
  4. Add the autocomplete.js file

    import 'kendo-ui/js/kendo.autocomplete.min';
    
    export class autocomplete{
      constructor() {
        this.datasource = {
          transport: {
            read: {
              dataType: 'jsonp',
              url: '//demos.telerik.com/kendo-ui/service/Customers'
            }
          }
        };
      } 
    }
  5. Add the autocomplete.html file

    <template>
      <require from="aurelia-kendoui-bridge/autocomplete/autocomplete"></require>
      <require from="aurelia-kendoui-bridge/common/template"></require>
      <require from="kendo-ui/styles/kendo.common.min.css!"></require>
      <require from="kendo-ui/styles/kendo.bootstrap.min.css!"></require>
      <require from="./autocomplete.css"></require>
    
      <div id="example" style="margin-top: 20px; margin-left: 20px">
        <div class="demo-section k-content">
          <p><strong>Customers:</strong></p>
    
          <ak-autocomplete k-data-source.bind="datasource"
                          k-height.bind="400"
                          k-min-length.bind="1"
                          k-data-text-field="ContactName">
            <ak-template>
              <span class="k-state-default" style="background-image: url('http://demos.telerik.com/kendo-ui/content/web/Customers/${CustomerID}.jpg')"></span>
              <span class="k-state-default"><h3>${ContactName}</h3><p>${CompanyName}</p></span>
            </ak-template>
            <ak-template for='headerTemplate'>
              <div class="dropdown-header k-widget k-header">
                <span>Photo</span>
                <span>Contact info</span>
              </div>
            </ak-template>
    
            <input id="autocomplete-customizing-templates-customers" style="width: 50%"/>
          </ak-autocomplete>
    
          <p class="demo-hint">Start typing to find a customer. E.g. "Ann" </p>
        </div>
      </div>
    </template>
  6. Add the autocomplete.css file

    .dropdown-header {
            border-width: 0 0 1px 0;
            text-transform: uppercase;
        }
    
        .dropdown-header > span {
            display: inline-block;
            padding: 10px;
        }
    
        .dropdown-header > span:first-child {
            width: 50px;
        }
    
        .k-item {
            line-height: 1em;
            min-width: 300px;
        }
    
        /* Material Theme padding adjustment*/
    
        .k-material .k-item,
        .k-material .k-item.k-state-hover,
        .k-materialblack .k-item,
        .k-materialblack .k-item.k-state-hover {
            padding-left: 5px;
            border-left: 0;
        }
    
        .k-item > span {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            display: inline-block;
            vertical-align: top;
            margin: 20px 10px 10px 5px;
        }
    
        .k-item > span:first-child {
            -moz-box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            -webkit-box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            margin: 10px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-size: 100%;
            background-repeat: no-repeat;
        }
    
        h3 {
            font-size: 1.2em;
            font-weight: normal;
            margin: 0 0 1px 0;
            padding: 0;
        }
    
        p {
            margin: 0;
            padding: 0;
            font-size: .8em;
        }
    
  7. Load the kendoui bridge (add .plugin('aurelia-kendoui-bridge'); in main.js

  8. Add the following lines to autocomplete.html

    <require from="aurelia-kendoui-bridge/autocomplete/autocomplete"></require>
    <require from="aurelia-kendoui-bridge/common/template"></require>  
  9. Add the following to the autocomplete.js

    import 'kendo-ui/js/kendo.autocomplete.min';

    as well as

    { route: 'autocomplete',  name: 'autocomplete', moduleId: 'autocomplete', nav: true, title: 'Autocomplete' }
    
adriatic commented 7 years ago

typescript navigation skeleton

  1. Kendo Core installation: https://aurelia-ui-toolkits.gitbooks.io/kendo-ui-sdk-installation/content/installation/installing%20kendo/advanced/core/jspm.html

  2. jnpm install css kendo-ui aurelia-kendoui-bridge

  3. Update config.js

    paths: {
       "*": "dist/*",
       "github:*": "jspm_packages/github/*",
       "npm:*": "jspm_packages/npm/*",
       "kendo.*": "jspm_packages/github/kendo-labs/bower-kendo-ui@2016.3.1306/js/kendo.*.js" <----
    },
  4. Add the autocomplete.ts file

    import 'kendo-ui/js/kendo.autocomplete.min';
    
    export class autocomplete{
      private datasource: kendo.data.DataSource;
    
      constructor() {
        this.datasource = new kendo.data.DataSource({
          transport: {
            read: {
              dataType: 'jsonp',
              url: '//demos.telerik.com/kendo-ui/service/Customers'
            }
          }
        });
      } 
    }
  5. Add the autocomplete.html file

    template>
      <require from="aurelia-kendoui-bridge/autocomplete/autocomplete"></require>
      <require from="aurelia-kendoui-bridge/common/template"></require>
      <require from="kendo-ui/styles/kendo.common.min.css!"></require>
      <require from="kendo-ui/styles/kendo.bootstrap.min.css!"></require>
      <require from="./autocomplete.css"></require>
    
      <div id="example" style="margin-top: 20px; margin-left: 20px">
        <div class="demo-section k-content">
          <p><strong>Customers:</strong></p>
    
          <ak-autocomplete k-data-source.bind="datasource"
                          k-height.bind="400"
                          k-min-length.bind="1"
                          k-data-text-field="ContactName">
            <ak-template>
              <span class="k-state-default" style="background-image: url('http://demos.telerik.com/kendo-ui/content/web/Customers/${CustomerID}.jpg')"></span>
              <span class="k-state-default"><h3>${ContactName}</h3><p>${CompanyName}</p></span>
            </ak-template>
            <ak-template for='headerTemplate'>
              <div class="dropdown-header k-widget k-header">
                <span>Photo</span>
                <span>Contact info</span>
              </div>
            </ak-template>
    
            <input id="autocomplete-customizing-templates-customers" style="width: 50%"/>
          </ak-autocomplete>
    
          <p class="demo-hint">Start typing to find a customer. E.g. "Ann" </p>
        </div>
      </div>
    </template> 
  6. Add the autocomplete.css file

      .dropdown-header {
            border-width: 0 0 1px 0;
            text-transform: uppercase;
        }
    
        .dropdown-header > span {
            display: inline-block;
            padding: 10px;
        }
    
        .dropdown-header > span:first-child {
            width: 50px;
        }
    
        .k-item {
            line-height: 1em;
            min-width: 300px;
        }
    
        /* Material Theme padding adjustment*/
    
        .k-material .k-item,
        .k-material .k-item.k-state-hover,
        .k-materialblack .k-item,
        .k-materialblack .k-item.k-state-hover {
            padding-left: 5px;
            border-left: 0;
        }
    
        .k-item > span {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            display: inline-block;
            vertical-align: top;
            margin: 20px 10px 10px 5px;
        }
    
        .k-item > span:first-child {
            -moz-box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            -webkit-box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            margin: 10px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-size: 100%;
            background-repeat: no-repeat;
        }
    
        h3 {
            font-size: 1.2em;
            font-weight: normal;
            margin: 0 0 1px 0;
            padding: 0;
        }
    
        p {
            margin: 0;
            padding: 0;
            font-size: .8em;
        }
    
  7. Load the kendoui bridge (add .plugin('aurelia-kendoui-bridge'); in main.ts

  8. Add the following lines to autocomplete.html

    <require from="aurelia-kendoui-bridge/autocomplete/autocomplete"></require>
    <require from="aurelia-kendoui-bridge/common/template"></require>  
  9. Add the following to the autocomplete.ts

    import 'kendo-ui/js/kendo.autocomplete.min';
  10. Add the following do app.ts

    { route: 'autocomplete',  name: 'autocomplete', moduleId: 'autocomplete', nav: true, title: 'Autocomplete' }
    
adriatic commented 7 years ago

webpack navigation skeleton

  1. Kendo Core installation instructions used: https://aurelia-ui-toolkits.gitbooks.io/kendo-ui-sdk-installation/content/installation/installing%20kendo/advanced/core/webpack.html

  2. Add the following stylesheets to the head section of `index.html:

    <link rel="stylesheet" href="node_modules/kendo-ui-core/css/web/kendo.common.core.min.css">
    <link rel="stylesheet" href="node_modules/kendo-ui-core/css/web/kendo.default.min.css">
  3. run npm install kendo-ui-core aurelia-kendoui-bridge --save

  4. Add the following import to main.js: import "kendo-ui-core";

  5. Add the following to webpack.config.babel.js following to aurelia bundles

    kendo: [
       'aurelia-kendoui-bridge'
    ]
  6. Add the following to webpack.config.babel.js to generateConfig's entry property

    'aurelia-kendoui-bridge': ['aurelia-kendoui-bridge]'
  7. Add the autocomplete.js file

    export class autocomplete{
      constructor() {
        this.datasource = {
          transport: {
            read: {
              dataType: 'jsonp',
              url: '//demos.telerik.com/kendo-ui/service/Customers'
            }
          }
        };
      } 
    }
  8. Add the autocomplete.html file (note that kendo specific stylesheets are defined in index.html)

    <template>
      <require from="aurelia-kendoui-bridge/autocomplete/autocomplete"></require>
      <require from="aurelia-kendoui-bridge/common/template"></require>
      <require from="./autocomplete.css"></require>
    
      <div id="example" style="margin-top: 20px; margin-left: 20px">
        <div class="demo-section k-content">
          <p><strong>Customers:</strong></p>
    
          <ak-autocomplete k-data-source.bind="datasource"
                          k-height.bind="400"
                          k-min-length.bind="1"
                          k-data-text-field="ContactName">
            <ak-template>
              <span class="k-state-default" style="background-image: url('http://demos.telerik.com/kendo-ui/content/web/Customers/${CustomerID}.jpg')"></span>
              <span class="k-state-default"><h3>${ContactName}</h3><p>${CompanyName}</p></span>
            </ak-template>
            <ak-template for='headerTemplate'>
              <div class="dropdown-header k-widget k-header">
                <span>Photo</span>
                <span>Contact info</span>
              </div>
            </ak-template>
    
            <input id="autocomplete-customizing-templates-customers" style="width: 50%"/>
          </ak-autocomplete>
    
          <p class="demo-hint">Start typing to find a customer. E.g. "Ann" </p>
        </div>
      </div>
    </template>
  9. Add the autocomplete.css file

    .dropdown-header {
            border-width: 0 0 1px 0;
            text-transform: uppercase;
        }
    
        .dropdown-header > span {
            display: inline-block;
            padding: 10px;
        }
    
        .dropdown-header > span:first-child {
            width: 50px;
        }
    
        .k-item {
            line-height: 1em;
            min-width: 300px;
        }
    
        /* Material Theme padding adjustment*/
    
        .k-material .k-item,
        .k-material .k-item.k-state-hover,
        .k-materialblack .k-item,
        .k-materialblack .k-item.k-state-hover {
            padding-left: 5px;
            border-left: 0;
        }
    
        .k-item > span {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            display: inline-block;
            vertical-align: top;
            margin: 20px 10px 10px 5px;
        }
    
        .k-item > span:first-child {
            -moz-box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            -webkit-box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            margin: 10px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-size: 100%;
            background-repeat: no-repeat;
        }
    
        h3 {
            font-size: 1.2em;
            font-weight: normal;
            margin: 0 0 1px 0;
            padding: 0;
        }
    
        p {
            margin: 0;
            padding: 0;
            font-size: .8em;
        }
    
  10. Load the kendoui bridge (add .plugin('aurelia-kendoui-bridge'); in main.js

  11. Add the following lines to autocomplete.html

    <require from="aurelia-kendoui-bridge/autocomplete/autocomplete"></require>
    <require from="aurelia-kendoui-bridge/common/template"></require>  
  12. Add the following to the autocomplete.js

    { route: 'autocomplete',  name: 'autocomplete', moduleId: 'autocomplete', nav: true, title: 'Autocomplete' }
    
adriatic commented 7 years ago

esnext aspnetcore navigation skeleton

  1. Kendo Core installation: https://aurelia-ui-toolkits.gitbooks.io/kendo-ui-sdk-installation/content/installation/installing%20kendo/advanced/core/jspm.html

  2. jspm install css kendo-ui aurelia-kendoui-bridge (Note that at this point, the npm install && jspm install command was already executed to get the original app built)

  3. jspm install css kendo-ui aurelia-kendoui-bridge

  4. Update config.js (Note that this takes place in wwwroot/config.js file)

    paths: {
       "*": "dist/*",
       "github:*": "jspm_packages/github/*",
       "npm:*": "jspm_packages/npm/*",
       "kendo.*": "jspm_packages/github/kendo-labs/bower-kendo-ui@2016.3.1306/js/kendo.*.js" <----
    },
  5. Add the autocomplete.js file

    import 'kendo-ui/js/kendo.autocomplete.min';
    
    export class autocomplete{
      constructor() {
        this.datasource = {
          transport: {
            read: {
              dataType: 'jsonp',
              url: '//demos.telerik.com/kendo-ui/service/Customers'
            }
          }
        };
      } 
    }
  6. Add the autocomplete.html file

    <template>
      <require from="aurelia-kendoui-bridge/autocomplete/autocomplete"></require>
      <require from="aurelia-kendoui-bridge/common/template"></require>
      <require from="kendo-ui/styles/kendo.common.min.css!"></require>
      <require from="kendo-ui/styles/kendo.bootstrap.min.css!"></require>
      <require from="./autocomplete.css"></require>
    
      <div id="example" style="margin-top: 20px; margin-left: 20px">
        <div class="demo-section k-content">
          <p><strong>Customers:</strong></p>
    
          <ak-autocomplete k-data-source.bind="datasource"
                          k-height.bind="400"
                          k-min-length.bind="1"
                          k-data-text-field="ContactName">
            <ak-template>
              <span class="k-state-default" style="background-image: url('http://demos.telerik.com/kendo-ui/content/web/Customers/${CustomerID}.jpg')"></span>
              <span class="k-state-default"><h3>${ContactName}</h3><p>${CompanyName}</p></span>
            </ak-template>
            <ak-template for='headerTemplate'>
              <div class="dropdown-header k-widget k-header">
                <span>Photo</span>
                <span>Contact info</span>
              </div>
            </ak-template>
    
            <input id="autocomplete-customizing-templates-customers" style="width: 50%"/>
          </ak-autocomplete>
    
          <p class="demo-hint">Start typing to find a customer. E.g. "Ann" </p>
        </div>
      </div>
    </template>
  7. Add the autocomplete.css file

    .dropdown-header {
            border-width: 0 0 1px 0;
            text-transform: uppercase;
        }
    
        .dropdown-header > span {
            display: inline-block;
            padding: 10px;
        }
    
        .dropdown-header > span:first-child {
            width: 50px;
        }
    
        .k-item {
            line-height: 1em;
            min-width: 300px;
        }
    
        /* Material Theme padding adjustment*/
    
        .k-material .k-item,
        .k-material .k-item.k-state-hover,
        .k-materialblack .k-item,
        .k-materialblack .k-item.k-state-hover {
            padding-left: 5px;
            border-left: 0;
        }
    
        .k-item > span {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            display: inline-block;
            vertical-align: top;
            margin: 20px 10px 10px 5px;
        }
    
        .k-item > span:first-child {
            -moz-box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            -webkit-box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            margin: 10px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-size: 100%;
            background-repeat: no-repeat;
        }
    
        h3 {
            font-size: 1.2em;
            font-weight: normal;
            margin: 0 0 1px 0;
            padding: 0;
        }
    
        p {
            margin: 0;
            padding: 0;
            font-size: .8em;
        }
    
  8. Load the kendoui bridge (add .plugin('aurelia-kendoui-bridge'); in main.js

  9. Add the following lines to autocomplete.html

    <require from="aurelia-kendoui-bridge/autocomplete/autocomplete"></require>
    <require from="aurelia-kendoui-bridge/common/template"></require>  
  10. Add the following to the autocomplete.js

    import 'kendo-ui/js/kendo.autocomplete.min';

    as well as

    { route: 'autocomplete',  name: 'autocomplete', moduleId: 'autocomplete', nav: true, title: 'Autocomplete' }
    
adriatic commented 7 years ago

typescript aspnetcore navigation skeleton

Note: typings install kendo-ui --source=dt --global


  1. Kendo Core installation: https://aurelia-ui-toolkits.gitbooks.io/kendo-ui-sdk-installation/content/installation/installing%20kendo/advanced/core/jspm.html

  2. jspm install css kendo-ui aurelia-kendoui-bridge (Note that at this point, the npm install && jspm install command was already executed to get the original app built)

  3. Update config.js (Note that this takes place in wwwroot/config.js file)

    paths: {
       "*": "dist/*",
       "github:*": "jspm_packages/github/*",
       "npm:*": "jspm_packages/npm/*",
       "kendo.*": "jspm_packages/github/kendo-labs/bower-kendo-ui@2016.3.1306/js/kendo.*.js" <----
    },
  4. Add the autocomplete.js file

    import 'kendo-ui/js/kendo.autocomplete.min';
    
    export class autocomplete{
      private datasource: kendo.data.DataSource;
    
      constructor() {
        this.datasource = new kendo.data.DataSource({
          transport: {
            read: {
              dataType: 'jsonp',
              url: '//demos.telerik.com/kendo-ui/service/Customers'
            }
          }
        });
      } 
    }    
  5. Add the autocomplete.html file

    <template>
      <require from="aurelia-kendoui-bridge/autocomplete/autocomplete"></require>
      <require from="aurelia-kendoui-bridge/common/template"></require>
      <require from="kendo-ui/styles/kendo.common.min.css!"></require>
      <require from="kendo-ui/styles/kendo.bootstrap.min.css!"></require>
      <require from="./autocomplete.css"></require>
    
      <div id="example" style="margin-top: 20px; margin-left: 20px">
        <div class="demo-section k-content">
          <p><strong>Customers:</strong></p>
    
          <ak-autocomplete k-data-source.bind="datasource"
                          k-height.bind="400"
                          k-min-length.bind="1"
                          k-data-text-field="ContactName">
            <ak-template>
              <span class="k-state-default" style="background-image: url('http://demos.telerik.com/kendo-ui/content/web/Customers/${CustomerID}.jpg')"></span>
              <span class="k-state-default"><h3>${ContactName}</h3><p>${CompanyName}</p></span>
            </ak-template>
            <ak-template for='headerTemplate'>
              <div class="dropdown-header k-widget k-header">
                <span>Photo</span>
                <span>Contact info</span>
              </div>
            </ak-template>
    
            <input id="autocomplete-customizing-templates-customers" style="width: 50%"/>
          </ak-autocomplete>
    
          <p class="demo-hint">Start typing to find a customer. E.g. "Ann" </p>
        </div>
      </div>
    </template>
  6. Add the autocomplete.css file

    .dropdown-header {
            border-width: 0 0 1px 0;
            text-transform: uppercase;
        }
    
        .dropdown-header > span {
            display: inline-block;
            padding: 10px;
        }
    
        .dropdown-header > span:first-child {
            width: 50px;
        }
    
        .k-item {
            line-height: 1em;
            min-width: 300px;
        }
    
        /* Material Theme padding adjustment*/
    
        .k-material .k-item,
        .k-material .k-item.k-state-hover,
        .k-materialblack .k-item,
        .k-materialblack .k-item.k-state-hover {
            padding-left: 5px;
            border-left: 0;
        }
    
        .k-item > span {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            display: inline-block;
            vertical-align: top;
            margin: 20px 10px 10px 5px;
        }
    
        .k-item > span:first-child {
            -moz-box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            -webkit-box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            margin: 10px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-size: 100%;
            background-repeat: no-repeat;
        }
    
        h3 {
            font-size: 1.2em;
            font-weight: normal;
            margin: 0 0 1px 0;
            padding: 0;
        }
    
        p {
            margin: 0;
            padding: 0;
            font-size: .8em;
        }
    
  7. Load the kendoui bridge (add .plugin('aurelia-kendoui-bridge'); in main.js

  8. Add the following lines to autocomplete.html

    <require from="aurelia-kendoui-bridge/autocomplete/autocomplete"></require>
    <require from="aurelia-kendoui-bridge/common/template"></require>  
  9. Add the following to the autocomplete.ts

    import 'kendo-ui/js/kendo.autocomplete.min';

    as well as the following to app.ts

    { route: 'autocomplete',  name: 'autocomplete', moduleId: 'autocomplete', nav: true, title: 'Autocomplete' }
    
adriatic commented 7 years ago

typescript webpack navigation skeleton

  1. Kendo Core installation instructions used: https://aurelia-ui-toolkits.gitbooks.io/kendo-ui-sdk-installation/content/installation/installing%20kendo/advanced/core/webpack.html

  2. Add the following stylesheets to the head section of `index.html:

    <link rel="stylesheet" href="node_modules/kendo-ui-core/css/web/kendo.common.core.min.css">
    <link rel="stylesheet" href="node_modules/kendo-ui-core/css/web/kendo.default.min.css">
  3. run npm install kendo-ui-core aurelia-kendoui-bridge --save

  4. Add the following import to main.js: import "kendo-ui-core";

  5. Add the following to webpack.config.babel.js following to aurelia bundles

    kendo: [
       'aurelia-kendoui-bridge'
    ]
  6. Add the following to webpack.config.babel.js to generateConfig's entry property

    'aurelia-kendoui-bridge': ['aurelia-kendoui-bridge]'
  7. Add the autocomplete.js file

    import 'kendo-ui/js/kendo.autocomplete.min';
    
    export class autocomplete{
      constructor() {
        this.datasource = {
          transport: {
            read: {
              dataType: 'jsonp',
              url: '//demos.telerik.com/kendo-ui/service/Customers'
            }
          }
        };
      } 
    }
  8. Add the autocomplete.html file (note that kendo specific stylesheets are defined in index.html)

    <template>
      <require from="aurelia-kendoui-bridge/autocomplete/autocomplete"></require>
      <require from="aurelia-kendoui-bridge/common/template"></require>
      <require from="./autocomplete.css"></require>
    
      <div id="example" style="margin-top: 20px; margin-left: 20px">
        <div class="demo-section k-content">
          <p><strong>Customers:</strong></p>
    
          <ak-autocomplete k-data-source.bind="datasource"
                          k-height.bind="400"
                          k-min-length.bind="1"
                          k-data-text-field="ContactName">
            <ak-template>
              <span class="k-state-default" style="background-image: url('http://demos.telerik.com/kendo-ui/content/web/Customers/${CustomerID}.jpg')"></span>
              <span class="k-state-default"><h3>${ContactName}</h3><p>${CompanyName}</p></span>
            </ak-template>
            <ak-template for='headerTemplate'>
              <div class="dropdown-header k-widget k-header">
                <span>Photo</span>
                <span>Contact info</span>
              </div>
            </ak-template>
    
            <input id="autocomplete-customizing-templates-customers" style="width: 50%"/>
          </ak-autocomplete>
    
          <p class="demo-hint">Start typing to find a customer. E.g. "Ann" </p>
        </div>
      </div>
    </template>
  9. Add the autocomplete.css file

    .dropdown-header {
            border-width: 0 0 1px 0;
            text-transform: uppercase;
        }
    
        .dropdown-header > span {
            display: inline-block;
            padding: 10px;
        }
    
        .dropdown-header > span:first-child {
            width: 50px;
        }
    
        .k-item {
            line-height: 1em;
            min-width: 300px;
        }
    
        /* Material Theme padding adjustment*/
    
        .k-material .k-item,
        .k-material .k-item.k-state-hover,
        .k-materialblack .k-item,
        .k-materialblack .k-item.k-state-hover {
            padding-left: 5px;
            border-left: 0;
        }
    
        .k-item > span {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            display: inline-block;
            vertical-align: top;
            margin: 20px 10px 10px 5px;
        }
    
        .k-item > span:first-child {
            -moz-box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            -webkit-box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            box-shadow: inset 0 0 30px rgba(0,0,0,.3);
            margin: 10px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-size: 100%;
            background-repeat: no-repeat;
        }
    
        h3 {
            font-size: 1.2em;
            font-weight: normal;
            margin: 0 0 1px 0;
            padding: 0;
        }
    
        p {
            margin: 0;
            padding: 0;
            font-size: .8em;
        }
    
  10. Load the kendoui bridge (add .plugin('aurelia-kendoui-bridge'); in main.js

  11. Add the following lines to autocomplete.html

    <require from="aurelia-kendoui-bridge/autocomplete/autocomplete"></require>
    <require from="aurelia-kendoui-bridge/common/template"></require>  
  12. Add the following to the autocomplete.js

    { route: 'autocomplete',  name: 'autocomplete', moduleId: 'autocomplete', nav: true, title: 'Autocomplete' }
    
JeroenVinke commented 7 years ago

image

Seems to work fine