From d9d45270f99d972917d1a627490cbd1cd572f0d6 Mon Sep 17 00:00:00 2001 From: Gordon McGuire Date: Mon, 23 May 2016 10:22:19 +0100 Subject: [PATCH] Updated demo app to use a clearer example. Updated README to mention the demo app and include a link to an example on plunker. Rebuilt the module. --- README.md | 33 +++++++++++++++---------- dist/so-multiselect.css | 2 +- dist/so-multiselect.js | 2 +- dist/so-multiselect.min.js | 2 +- other/example.png | Bin 12847 -> 14591 bytes src/demo/app.js | 22 ++++++++--------- src/demo/index.html | 49 ++++++++++++++++++++++++------------- 7 files changed, 66 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 4d0124d..1cd6e62 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ so-multiselect [![Build Status](https://travis-ci.org/gordonmcg-sonalake/so-multiselect.svg?branch=master)](https://travis-ci.org/gordonmcg-sonalake/so-multiselect) [![codecov coverage](https://img.shields.io/codecov/c/github/gordonmcg-sonalake/so-multiselect.svg?style=flat-square)](https://codecov.io/github/gordonmcg-sonalake/so-multiselect) [![MIT License](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)]() ================ -> Angular module that provides a multi-select dropdown list using checkboxes. +> Angular module that provides a multi-select dropdown list with checkboxes. ![so-multiselect](other/example.png) @@ -13,6 +13,13 @@ The required dependencies are: This module was built with the intention of using it alongside [UI Bootstrap](https://github.com/angular-ui/bootstrap). +Demo +----- + +For an example of `so-multiselect` in action, take a look at the demo app inside src/demo. + +Alternatively, you can find the same [example on plunker.](https://plnkr.co/edit/E3E5KpHdwemNaoXtWimB?p=preview) + Getting Started --------------- @@ -44,31 +51,31 @@ Set up your models in your controller: ```javascript -$scope.things = [{ - key: 't1', - name: 'Thing 1' +$scope.flavours = [{ + key: 'f1', + name: 'Strawberry' }, { - key: 't2', - name: 'Thing 2' + key: 'f2', + name: 'Classico' }, { - key: 't3', - name: 'Thing 3' + key: 'f3', + name: 'Mint' }]; -$scope.selectedItems = []; +$scope.chosenFlavours = []; -$scope.onThingsSelected = function(selectedItems) { - $scope.selectedItems = selectedItems; +$scope.onFlavourSelected = function(selectedItems) { + $scope.chosenFlavours = selectedItems; }; ``` Apply the directive to your HTML: ```html -
+
``` -* `items` takes a reference to the array of object to appear in the dropdown list, each object containing a `key` and `name`. +* `items` takes a reference to the array of object to appear in the dropdown list; each object must contain `key` and `name` attributes. * `name` is the value for the label that appears inside the trigger for the dropdown list. * `on-selected` takes a reference to the callback function you want to execute when an item is selected in the list. The `selectedItems` parameter contains an array of the selected objects. * `button-class` is an optional attirbute if you wish to add any extra CSS classes to the trigger for the dropdown list. diff --git a/dist/so-multiselect.css b/dist/so-multiselect.css index 38b735f..36a7c85 100644 --- a/dist/so-multiselect.css +++ b/dist/so-multiselect.css @@ -1,4 +1,4 @@ -/*! so-multiselect - 1.0.0 - 2016-05-17 +/*! so-multiselect - 1.0.0 - 2016-05-23 * Copyright (c) 2016 Sonalake; */ .multiselect-container .filter-wrap { diff --git a/dist/so-multiselect.js b/dist/so-multiselect.js index a2a9fef..d07be5a 100644 --- a/dist/so-multiselect.js +++ b/dist/so-multiselect.js @@ -1,4 +1,4 @@ -/*! so-multiselect - 1.0.0 - 2016-05-17 +/*! so-multiselect - 1.0.0 - 2016-05-23 * Copyright (c) 2016 Sonalake; */ (function(window, $, angular, undefined) { diff --git a/dist/so-multiselect.min.js b/dist/so-multiselect.min.js index c3c5a31..f74414b 100644 --- a/dist/so-multiselect.min.js +++ b/dist/so-multiselect.min.js @@ -1,4 +1,4 @@ -/*! so-multiselect - 1.0.0 - 2016-05-17 +/*! so-multiselect - 1.0.0 - 2016-05-23 * Copyright (c) 2016 Sonalake; */ !function(a,b,c,d){"use strict";c.module("multiselect.controllers",[]).controller("MultiSelectController",["$scope","$attrs","$parse","$filter","MultiSelectConfig","MultiSelectService",function(a,b,d,e,f,g){var h,i=this,j=a.$new(),k=f.openClass,l=c.noop,m=b.onToggle?d(b.onToggle):c.noop,n=!0;this.init=function(c){i.$element=c,b.isOpen&&(h=d(b.isOpen),l=h.assign,a.$watch(h,function(a){j.isOpen=!!a})),a.selectedItems()},this.toggle=function(a){return j.isOpen=arguments.length?!!a:!j.isOpen,j.isOpen},this.isOpen=function(){return j.isOpen},j.getToggleElement=function(){return i.toggleElement},j.getMenuElement=function(){return i.menuElement},j.focusToggleElement=function(){i.toggleElement&&i.toggleElement[0].focus()},a.itemSelected=function(b){a.filterItems[b]&&(a.filterItems[b].selected=!a.filterItems[b].selected)},a.selectedItemsString="All",a.selectedItems=function(){var b=e("filter")(a.filterItems,{selected:!0}),c="";if(0===b.length)c="All";else for(var d=0;d0&&d.init(b)}}}).directive("soMultiselectToggle",function(){return{restrict:"CA",require:"?^soMultiselect",link:function(a,b,d,e){if(e){var f=b.parent();e.toggleElement=b,e.menuElement=c.element(f.children()[1]);var g=function(c){c.preventDefault(),b.hasClass("disabled")||d.disabled||a.$apply(function(){e.toggle()})};b.bind("click",g),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(e.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",g)})}}}}),c.module("so.multiselect",["multiselect.controllers","multiselect.directive","multiselect.services"]).constant("MultiSelectConfig",{openClass:"open"}).run(["$templateCache",function(a){a.put("templates/multiselect.tpl.html",'
\n \n
    \n
  • \n {{item.name}}\n
  • \n
\n
\n')}]),c.module("multiselect.services",[]).service("MultiSelectService",["$document",function(a){var b=null,c=function(a){var c=b.getToggleElement(),d=b.getMenuElement();a&&c&&c[0].contains(a.target)||a&&d&&d[0].contains(a.target)||b.$apply(function(){b.isOpen=!1})},d=function(a){27===a.which&&(b.focusToggleElement(),c())};this.open=function(e){b||(a.bind("click",c),a.bind("keydown",d)),b&&b!==e&&(b.isOpen=!1),b=e},this.close=function(e){b===e&&(b=null,a.unbind("click",c),a.unbind("keydown",d))}}])}(window,window.$,window.angular); \ No newline at end of file diff --git a/other/example.png b/other/example.png index f75d71cd73f20491e9a9bf38f9ff5f9f4ed017a9..6a8c53cce0cb8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N19`DgHG~0?h&tNCWp^DK<(BEID25 zg^!LL11^-pe2*9S+vzCAwh*@RpdJlrF`#Yvy7yr-IU6zz_gMhmPYSqz?+mbfpnfwh z-~Bf56D-ZlQn!3EEhJ~t!~#YYKp>DFR^%WtYRrTS0_0h`rm+H`t*K(_JOB;@{s}im zMdYxrNLOtt)t!;L*8`aSsgBq745uQgXv_1 zzyP3aarIyF3{ER_0YO3TB*?2R?3IKw)!!wn{H{Q=QYoJz$~A7ZDJ1J z*geA@7ZM)QO!aImDc}h^g(KOijS{4EC7*~rMBFjbIs7S=F&7&Z{smJ-s%S8q&{b$X zhBfu)PKr`j8rwYt^G!3gE#8m(?HF zI?Gr~2hzqGK@cKG>i67lG)55y-t*;O#XPDEeo-R2@lGGUnUxM0it|+Q7Wy7zri7L9 zN4>VTtK4oh`FckJW~jEtzHYBX6!{4aU0OjwtbA4W<6y%yV=eh+Y=BFpOD3U_?W*^X z(0mL>P8ufBKbH-jmBSf>sVT;{b#aEGB09{9&_DfWBW5uc8d+xkAmrf;XsPlaS~_?* zEL;o}S|VJO5Wx0JZX5*W@DNACO&wbJw*VTdT5`;H z@V29|_((Hhv#}z8r?yXo@g=N(AF9s*s?F@t2gR1$^$@eW3KNpLC0{4yo$ zKa7gK$AZ;ks+K}MSl$YfgcWVRr{bo6r5y`a+S!5_%m0;jK3M$^>Q}b?N5kJ^-Mw}k XvCc$tSq#CRg1z}9tt3?~VI1^d^qGiR diff --git a/src/demo/app.js b/src/demo/app.js index 5cc25ea..3dcfbd9 100644 --- a/src/demo/app.js +++ b/src/demo/app.js @@ -3,25 +3,25 @@ angular.module('demo', [ ]) .controller('DemoCtrl', ['$scope', function ($scope) { - // the selector config - $scope.things = [{ - key: 't1', - name: 'Thing 1' + $scope.flavourList = [{ + key: 'f1', + name: 'Strawberry' }, { - key: 't2', - name: 'Thing 2' + key: 'f2', + name: 'Classico' }, { - key: 't3', - name: 'Thing 3' + key: 'f3', + name: 'Mint' }]; - $scope.items = []; + $scope.chosenFlavours = []; - $scope.onThingsSelected = function(selectedItem) { - $scope.items = selectedItem; + $scope.onFlavourSelected = function(selectedItem) { + $scope.chosenFlavours = selectedItem; }; + // relates to tabs and example code $scope.demo1 = { markup: true, javascript: false diff --git a/src/demo/index.html b/src/demo/index.html index 57e3360..5fdcb7f 100644 --- a/src/demo/index.html +++ b/src/demo/index.html @@ -46,6 +46,14 @@ .btn-grey:focus, .btn-grey:active:focus { outline: 0; } + + /** + * overwriting the default max-width so that we can see more + * of the value names. + */ + .multiselect-container .filter-wrap .filter-values { + max-width: 120px; + } @@ -57,14 +65,21 @@

Sonalake Multi-Select

Basic Demo

This is a basic demo set up. It gives a quick example of how to use so-multiselect.

-
+
+
+

Chosen Flavours: {{chosenFlavours.length}}

+
    +
  • + {{item.name}} +
  • +
+

@@ -84,31 +99,31 @@

Basic Demo

<div so-multiselect
-     items="things"
-     name="Thing"
-     on-selected="onThingsSelected(selectedItems)"
+     items="flavourList"
+     name="Flavours"
+     on-selected="onFlavourSelected(selectedItems)"
      button-class="btn-grey"
 ></div>
-<p>Items selected: <strong>{{items.length}}</strong></p>
+<p>Chosen Flavours: <strong>{{chosenFlavours.length}}</strong></p>
.controller('DemoCtrl', ['$scope', function ($scope) {
     // the selector config
-    $scope.things = [{
-        key: 't1',
-        name: 'Thing 1'
+    $scope.flavourList = [{
+        key: 'f1',
+        name: 'Strawberry'
     }, {
-        key: 't2',
-        name: 'Thing 2'
+        key: 'f2',
+        name: 'Classico'
     }, {
-        key: 't3',
-        name: 'Thing 3'
+        key: 'f3',
+        name: 'Mint'
     }];
 
-    $scope.items = [];
+    $scope.chosenFlavours = [];
 
-    $scope.onThingsSelected = function(selectedItem) {
-        $scope.items = selectedItem;
+    $scope.onFlavourSelected = function(selectedItem) {
+        $scope.chosenFlavours = selectedItem;
     };
 }])