diff --git a/app/components/home.html b/app/components/home.html index 0b3fda7..8833a8d 100644 --- a/app/components/home.html +++ b/app/components/home.html @@ -1,66 +1,131 @@ -
- -
-
- +
+ +
+ +

+ International Migrant Stock +

+ Home + Statistics +
+
- -
-
- Open Menu -
-
- - -

MENU

-
- Close Menu -
-
- - -
-
- -
\ No newline at end of file +
+ + + + diff --git a/app/css/custom.css b/app/css/custom.css index 7e9ab7a..d91b491 100644 --- a/app/css/custom.css +++ b/app/css/custom.css @@ -3,63 +3,109 @@ DISPLAY *******************************************************************/ .hide { - display: none; - !important; + display: none !important; } -.displaynone { +.display-none { display: none; - -webkit-animation: slide-down .5s ease-out; - -moz-animation: slide-down .5s ease-out; + -webkit-animation: slide-down 0.5s ease-out; + -moz-animation: slide-down 0.5s ease-out; } .display-flex { display: flex; } +.display-block { + display: block; +} + .position-absolute { position: absolute; } -.parent-size{ +.parent-size { width: 100%; height: 100%; } -.width-100{ +.width-100 { width: 100%; } + +.width-90 { + width: 90%; +} + +.width-80 { + width: 80%; +} + +.width-20 { + width: 20%; +} + +.height-100 { + height: 100%; +} + +.height-80 { + height: 80%; +} + +.height-20 { + height: 20%; +} /****************************************************************** FONTS *******************************************************************/ .text-center { - text-align: center!important; + text-align: center !important; } -.text-bold{ +.text-bold { font-weight: bold; } +.font-size-medium { + font-size: medium !important; +} + +.font-size-small { + font-size: small !important; +} /****************************************************************** MARGINS *******************************************************************/ +.margin-auto { + margin: auto !important; +} + +.margin-none { + margin: 0 !important; +} + .margin-top-15-px { margin-top: 15px; } .margin-top-20-px { - margin-top: 20px!important; + margin-top: 20px !important; +} + +.margin-top-10-px { + margin-top: 10px !important; } .margin-right-10-px { margin-right: 10px; } -.margin-left--8-px { - margin-left: -8px; +.margin-left-20px { + margin-left: 20px !important; } .margin-lr-auto { @@ -67,12 +113,28 @@ MARGINS margin-right: auto; } +/****************************************************************** +MARGINS +*******************************************************************/ + +.padding-left-20px { + padding-left: 20px; +} + +.padding-top-bottom-5px { + padding: 0 5px 0 5px !important; +} + /****************************************************************** COLOR *******************************************************************/ .color-white { - color: #FFFFFF!important; + color: #ffffff !important; +} + +.color-lightgray { + color: #b0b0b0 !important; } .color-black { @@ -80,9 +142,12 @@ COLOR } .color-darkcyan { - color: #0093c4!important; + color: #63b3d4 !important; } +.color-darkgray { + color: #1d1f1f; +} /****************************************************************** OTHER *******************************************************************/ @@ -108,43 +173,46 @@ OTHER } .zindex-0 { - z-index: 0!important; + z-index: 0 !important; } .zindex-100 { - z-index: 100!important; + z-index: 100 !important; } .position-fixed { - position: fixed!important; + position: fixed !important; +} + +.border-radius-10px { + border-radius: 10px !important; } +.vertical-align-middle { + vertical-align: middle; +} /****************************************************************** BACKGROUND *******************************************************************/ -.background-transparent { - background-color: transparent!important; +.background-gray { + background-color: #2d2e2e !important; } -.background-transparent-white { - background-color: #ffffff5c!important; -} - -.background-transparent-gray { - background-color: #0000002e!important; +.background-darkteal { + background-color: #191f24 !important; } .background-darkcyan { - background-color: #0093c4!important; + background-color: #0093c4 !important; } -.background-darkcyan-50-opacity { - background-color: #0093c49c!important +.background-dark { + background-color: #000000; } .background-white { - background-color: #FFFFFF!important; + background-color: #ffffff !important; } /****************************************************************** @@ -152,5 +220,13 @@ POSITION *******************************************************************/ .clear-float { - clear: both; + float: none !important; +} + +.float-right { + float: right; +} + +.float-left { + float: left; } diff --git a/app/css/home.css b/app/css/home.css index 2a8245c..db9b633 100644 --- a/app/css/home.css +++ b/app/css/home.css @@ -1,37 +1,45 @@ -#map-container{ - width: 100%; - height: 100vh; -} - -#home-button{ +#home-button { position: absolute; left: 0; top: 0; z-index: 10; } -#open-menu-button{ - background-color: #0093c4; +#open-menu-button { + background-color: #2d2e2e; position: absolute; left: 0; - top: 60px; - /*padding: 10px 5px 10px 5px;*/ + top: 80px; border-bottom-right-radius: 10px; border-top-right-radius: 10px; z-index: 10; } -#open-menu-button:hover{ +#open-menu-button:hover { padding-left: 10px; padding-right: 10px; } -#open-menu-icon{ +#open-menu-icon { width: 20px; padding: 15px 1px 12px 3px; } -#home-button-icon{ +#home-button-icon { width: 20px; padding: 15px 1px 12px 3px; -} \ No newline at end of file +} + +.full-height { + height: 100vh; +} + +.feed-container { + background-color: #707070; + padding: 10px 20px; + border-radius: 16px; + color: white; + margin-left: 10px; + font-size: x-large; + margin-right: 10px; +} diff --git a/app/css/menu.css b/app/css/menu.css index 4b1a090..332a0f8 100644 --- a/app/css/menu.css +++ b/app/css/menu.css @@ -1,50 +1,124 @@ +.md-track-ticks { + background-color: #0093c4 !important; +} + +.md-sign { + background-color: #0093c4 !important; +} + +.md-sign:after { + border-top-color: #0093c4 !important; +} + +.md-thumb:after { + background-color: #0093c4 !important; + border: 1px solid #0093c4; +} + +.menu-list-icon { + width: 15px; + height: 15px; +} -#change-floor-container md-input-container{ +.search-input { width: 100%; + font-size: large; + border: none; + outline: none; } -#change-grid-container .md-subheader-inner{ - padding: 0!important; +.filters-container { + border: 4px solid #0093c4 !important; + padding: 10px !important; + width: 80% !important; + min-height: 5em; + margin-bottom: 30px; } -#change-grid-container .md-track-ticks{ - background-color: lightgray!important; +.menu-divider { + height: 2px; + margin: 20px 0 20px 0 !important; + background-color: #2d2e2e; + border: 0; } -#change-grid-container .md-sign{ - background-color: #0093c4!important; +.radio-button-class { + margin: auto !important; + width: 30% !important; + border-right: 1px solid black !important; + color: #000000 !important; + background-color: #ffffff !important; + border-radius: 0 !important; } -#change-grid-container .md-sign:after{ - border-top-color: #0093c4!important; +.button-clicked { + color: #ffffff !important; + background-color: #0093c4 !important; } -#change-grid-container .md-thumb:after{ - background-color: #0093c4!important; - border: 1px solid #0093c4; +.first-radius { + border-top-left-radius: 10px !important; + border-bottom-left-radius: 10px !important; } -#menu-container .md-button:not([disabled]):hover{ - background-color: #8bf6ff30; +.last-radius { + border-top-right-radius: 10px !important; + border-bottom-right-radius: 10px !important; } -#menu-container .md-button:not([disabled]):hover .menu-icon{ - transform: scale(2.0) +#source-selector md-select-value { + color: #0093c4 !important; + border-bottom: 1px solid #0093c4; } -#menu-container .md-select-value{ - color: #0093c4; +#source-selector .md-select-icon { + background: #191f24 url("../img/search.png") no-repeat 90% 50%; + color: #191f24; + text-align: left; + margin: 0 0 0 0; +} + +#destination-selector md-select-value { + color: #0093c4 !important; border-bottom: 1px solid #0093c4; } -.menu-list-icon{ - width: 15px; - height: 15px; +#destination-selector .md-select-icon { + background: #191f24 url("../img/search.png") no-repeat 90% 50%; + color: #191f24; + text-align: left; + margin: 0 0 0 0; } -.search-input{ - width: 100%; - font-size: large; +.header-search-box { border: none; outline: none; -} \ No newline at end of file + height: 100%; + width: 100%; + padding: 0; +} + +.select-header-search-box { + box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(0, 0, 0, 0.14), + 0 0 0 0 rgba(0, 0, 0, 0.12); + padding-left: 16px; + height: 48px; + cursor: pointer; + position: relative; + display: flex; + width: auto; +} + +.svg-magnitude { + width: 20%; + height: 50px; +} + +.rz-tick-value { + color: #191f24; +} + +.rz-tick-legend { + color: #0093c4; + transform: rotate(45deg) !important; +} diff --git a/app/img/anagrafica-icon.ico b/app/img/anagrafica-icon.ico deleted file mode 100644 index db65746..0000000 Binary files a/app/img/anagrafica-icon.ico and /dev/null differ diff --git a/app/img/close-menu.png b/app/img/close-menu.png index e7633b9..8f711d7 100644 Binary files a/app/img/close-menu.png and b/app/img/close-menu.png differ diff --git a/app/img/home/come.png b/app/img/home/come.png new file mode 100644 index 0000000..3fb8f42 Binary files /dev/null and b/app/img/home/come.png differ diff --git a/app/img/home/down.png b/app/img/home/down.png new file mode 100644 index 0000000..42f4fbc Binary files /dev/null and b/app/img/home/down.png differ diff --git a/sketch/Mask_Group_1.png b/app/img/home/logo.png similarity index 100% rename from sketch/Mask_Group_1.png rename to app/img/home/logo.png diff --git a/app/img/home/up.png b/app/img/home/up.png new file mode 100644 index 0000000..3662ba7 Binary files /dev/null and b/app/img/home/up.png differ diff --git a/app/img/map.png b/app/img/map.png new file mode 100644 index 0000000..77e0640 Binary files /dev/null and b/app/img/map.png differ diff --git a/app/img/search.png b/app/img/search.png new file mode 100644 index 0000000..d38aa31 Binary files /dev/null and b/app/img/search.png differ diff --git a/app/js/controllers/home_controller.js b/app/js/controllers/home_controller.js index d71426d..296109a 100644 --- a/app/js/controllers/home_controller.js +++ b/app/js/controllers/home_controller.js @@ -1,19 +1,51 @@ -(function() { - 'use strict'; +(function () { + "use strict"; // reloading the angular module - angular.module('main').controller('homeController', homeController); + angular.module("main").controller("homeController", homeController); /** * Function that handlle the user login */ - homeController.$inject = ['$scope'] + homeController.$inject = ["$scope"]; function homeController($scope) { - d3.csv("app/data/fifa-world-cup.csv", data => { + d3.csv("app/data/fifa-world-cup.csv", (data) => { console.log(data); - }) - .catch(error => alert("Couldn't load fifa dataset: " + error)); + }).catch((error) => alert("Couldn't load fifa dataset: " + error)); + + $scope.feeds = [ + { + title: "Burundi", + image: "app/img/home/down.png", + value: "4.232 M", + }, + { + title: "Italy", + image: "app/img/home/up.png", + value: "4.232 M", + }, + { + title: "Kenya", + image: "app/img/home/down.png", + value: "4.232 M", + }, + { + title: "France", + image: "app/img/home/down.png", + value: "4.232 M", + }, + { + title: "Germany", + image: "app/img/home/up.png", + value: "432 M", + }, + { + title: "Marocco", + image: "app/img/home/up.png", + value: "432 M", + }, + ]; } -})(); \ No newline at end of file +})(); diff --git a/app/js/controllers/menu_controller.js b/app/js/controllers/menu_controller.js index f378fd1..080b90a 100644 --- a/app/js/controllers/menu_controller.js +++ b/app/js/controllers/menu_controller.js @@ -1,33 +1,86 @@ -(function() { - 'use strict'; +(function () { + "use strict"; //reloading angular module - let main = angular.module('main'); + let main = angular.module("main"); //CONTROLLERS - main.controller('menuController', menuController); + main.controller("menuController", menuController); /** * Function that handle the menu interaction * @type {string[]} */ - menuController.$inject = ['$scope', '$mdSidenav']; + menuController.$inject = ["$scope", "$mdSidenav"]; function menuController($scope, $mdSidenav) { + $scope.isSideMenuOpened = true; + $scope.searchSource = ""; + $scope.searchDestination = ""; + $scope.selectedSourceCountries = []; + $scope.selectedDestinationCountries = []; + $scope.slider = { + min: 1, + max: 9, + options: { + floor: 0, + ceil: 6, + showTicksValues: true, + stepsArray: [ + { value: 1, legend: "1990" }, + { value: 3, legend: "1995" }, + { value: 5, legend: "2000" }, + { value: 7, legend: "2005" }, + { value: 9, legend: "2010" }, + { value: 9, legend: "2015" }, + { value: 9, legend: "2017" }, + ], + }, + }; - /** - * Function that open and close the menu - */ - $scope.toggleLeft = () => { - $mdSidenav('left').toggle(); - }; - - /** - * Function that shows the location table - */ - $scope.testItem = () => { - - }; - + + /** + * Function that open and close the menu + */ + $scope.toggleMenu = () => { + $scope.isSideMenuOpened = $scope.isSideMenuOpened ? false : true; + }; + + $scope.clearSearch = () => { + $scope.searchSource = ""; + }; + + $scope.updateSearch = (event) => { + event.stopPropagation(); + }; + + $scope.genreButtons = [ + { value: "male", text: "Male" }, + { value: "female", text: "Female" }, + { value: "all", text: "All" }, + ]; + + $scope.sectionButtons = [ + { value: "continent", text: "Continent" }, + { value: "region", text: "Region" }, + { value: "country", text: "Country" }, + ]; + + $scope.countries = [ + { continent: "europe", name: "France" }, + { continent: "europe", name: "Italy" }, + { continent: "europe", name: "Spain" }, + { continent: "europe", name: "Finland" }, + { continent: "europe", name: "Portugal" }, + { continent: "africa", name: "Nigeria" }, + { continent: "africa", name: "Kenya" }, + { continent: "africa", name: "Etiopia" }, + { continent: "africa", name: "marocco" }, + { continent: "africa", name: "Uganda" }, + ]; + /** + * Function that shows the location table + */ + $scope.testItem = () => {}; } -})(); \ No newline at end of file +})(); diff --git a/app/js/directives/feed.js b/app/js/directives/feed.js new file mode 100644 index 0000000..3c792cb --- /dev/null +++ b/app/js/directives/feed.js @@ -0,0 +1,18 @@ +angular.module("feed-chip", []).directive("feedChip", function () { + return { + require: "ngModel", + replace: true, + scope: { + model: "=ngModel", + feed: "=", + }, + template: + '
' + + '
' + + '{{feed.title}}' + + '' + + "{{feed.value}}" + + "
" + + "
", + }; +}); diff --git a/app/js/directives/radio_buttons.js b/app/js/directives/radio_buttons.js new file mode 100644 index 0000000..bd1b1ad --- /dev/null +++ b/app/js/directives/radio_buttons.js @@ -0,0 +1,45 @@ +angular + .module("radio-button", []) + .directive("radioButtonGroup", function ($parse) { + return { + restrict: "E", + require: "ngModel", + scope: { + model: "=ngModel", + buttons: "=", + radioButtonsClass: "=", + }, + template: + ' ' + + " {{button.text}} " + + "", + controller: [ + "$scope", + function ($scope) { + $scope.handleButtonClicked = function (value) { + $scope.value = value; + }; + $scope.isActive = function (value) { + return $scope.value === value; + }; + }, + ], + link: function (scope, element, attributes, ngModel) { + element.on("click", (e) => { + scope.$apply(() => { + ngModel.$setViewValue(scope.value); + }); + }); + + scope.$watch("model", (newVal) => { + element.removeClass("button-clicked"); + if (newVal === scope.value) { + element.addClass("button-clicked"); + } + }); + }, + }; + }); diff --git a/app/js/index.js b/app/js/index.js index 9784d92..ad5b1ce 100644 --- a/app/js/index.js +++ b/app/js/index.js @@ -1,27 +1,32 @@ -(function() { - 'use strict'; +(function () { + "use strict"; // loading framework and dependencies - let main = angular.module('main', ['ngMaterial', 'ui.router']); + let main = angular.module("main", [ + "ngMaterial", + "ui.router", + "radio-button", + "rzSlider", + "feed-chip", + ]); // configurating the routing main.config(RoutesConfiguration); - RoutesConfiguration.$inject = ['$stateProvider', '$urlRouterProvider']; + RoutesConfiguration.$inject = ["$stateProvider", "$urlRouterProvider"]; function RoutesConfiguration($stateProvider, $urlRouterProvider) { - // setting the default page for the routing - $urlRouterProvider.otherwise('/home'); + $urlRouterProvider.otherwise("/home"); // setting the routing pages $stateProvider - // defining routing to the login page - .state('home', { - url: '/home', - templateUrl: components_folder + 'home.html', - controller: 'homeController as homeCtrl', - resolve: {} - }) + // defining routing to the login page + .state("home", { + url: "/home", + templateUrl: components_folder + "home.html", + controller: "homeController as homeCtrl", + resolve: {}, + }); } -})(); \ No newline at end of file +})(); diff --git a/index.html b/index.html index 851d030..8c02cc0 100644 --- a/index.html +++ b/index.html @@ -1,44 +1,49 @@ + - - + + EarthQuake - - - - + + + + - + + + + -
- - - - - - + + + + + + + + diff --git a/node_modules/angularjs-slider/dist/rzslider.css b/node_modules/angularjs-slider/dist/rzslider.css new file mode 100644 index 0000000..6ed453a --- /dev/null +++ b/node_modules/angularjs-slider/dist/rzslider.css @@ -0,0 +1,284 @@ +/*! angularjs-slider - v7.0.0 - + (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - + https://github.com/angular-slider/angularjs-slider - + 2019-02-23 */ +.rzslider { + position: relative; + display: inline-block; + width: 100%; + height: 4px; + margin: 35px 0 15px 0; + vertical-align: middle; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.rzslider.noanimate * { + transition: none !important; +} + +.rzslider.with-legend { + margin-bottom: 40px; +} + +.rzslider[disabled] { + cursor: not-allowed; +} + +.rzslider[disabled] .rz-pointer { + cursor: not-allowed; + background-color: #d8e0f3; +} + +.rzslider[disabled] .rz-draggable { + cursor: not-allowed; +} + +.rzslider[disabled] .rz-selection { + background: #8b91a2; +} + +.rzslider[disabled] .rz-tick { + cursor: not-allowed; +} + +.rzslider[disabled] .rz-tick.rz-selected { + background: #8b91a2; +} + +.rzslider span { + position: absolute; + display: inline-block; + white-space: nowrap; +} + +.rzslider .rz-base { + width: 100%; + height: 100%; + padding: 0; +} + +.rzslider .rz-bar-wrapper { + left: 0; + z-index: 1; + width: 100%; + height: 32px; + padding-top: 16px; + margin-top: -16px; + box-sizing: border-box; + transition: all linear 0.3s; +} + +.rzslider .rz-draggable { + cursor: move; +} + +.rzslider .rz-bar { + left: 0; + z-index: 1; + width: 100%; + height: 4px; + background: #d8e0f3; + border-radius: 2px; +} + +.rzslider .rz-bar-wrapper.rz-transparent .rz-bar { + background: transparent; +} + +.rzslider .rz-bar-wrapper.rz-left-out-selection .rz-bar { + background: #df002d; +} + +.rzslider .rz-bar-wrapper.rz-right-out-selection .rz-bar { + background: #03a688; +} + +.rzslider .rz-selection { + z-index: 2; + background: #0db9f0; + border-radius: 2px; + transition: background-color linear 0.3s; +} + +.rzslider .rz-restricted { + z-index: 3; + background: #ff0000; + border-radius: 2px; +} + +.rzslider .rz-pointer { + top: -14px; + z-index: 3; + width: 32px; + height: 32px; + cursor: pointer; + background-color: #0db9f0; + border-radius: 16px; + transition: all linear 0.3s; +} + +.rzslider .rz-pointer:after { + position: absolute; + top: 12px; + left: 12px; + width: 8px; + height: 8px; + background: #ffffff; + border-radius: 4px; + content: ''; +} + +.rzslider .rz-pointer:hover:after { + background-color: #ffffff; +} + +.rzslider .rz-pointer.rz-active { + z-index: 4; +} + +.rzslider .rz-pointer.rz-active:after { + background-color: #451aff; +} + +.rzslider .rz-bubble { + bottom: 16px; + padding: 1px 3px; + color: #55637d; + cursor: default; + transition: all linear 0.3s; +} + +.rzslider .rz-bubble.rz-limit { + color: #55637d; + transition: none; +} + +.rzslider .rz-ticks { + position: absolute; + top: -3px; + left: 0; + z-index: 1; + width: 100%; + height: 0; + margin: 0; + list-style: none; + box-sizing: border-box; +} + +.rzslider .rz-ticks-values-under .rz-tick-value { + top: auto; + bottom: -32px; +} + +.rzslider .rz-tick { + position: absolute; + top: 0; + left: 0; + width: 10px; + height: 10px; + margin-left: 11px; + text-align: center; + cursor: pointer; + background: #d8e0f3; + border-radius: 50%; + transition: background-color linear 0.3s; +} + +.rzslider .rz-tick.rz-selected { + background: #0db9f0; +} + +.rzslider .rz-tick-value { + position: absolute; + top: -30px; + transform: translate(-50%, 0); +} + +.rzslider .rz-tick-legend { + position: absolute; + top: 24px; + max-width: 50px; + white-space: normal; + transform: translate(-50%, 0); +} + +.rzslider.rz-vertical { + position: relative; + width: 4px; + height: 100%; + padding: 0; + margin: 0 20px; + vertical-align: baseline; +} + +.rzslider.rz-vertical .rz-base { + width: 100%; + height: 100%; + padding: 0; +} + +.rzslider.rz-vertical .rz-bar-wrapper { + top: auto; + left: 0; + width: 32px; + height: 100%; + padding: 0 0 0 16px; + margin: 0 0 0 -16px; +} + +.rzslider.rz-vertical .rz-bar { + bottom: 0; + left: auto; + width: 4px; + height: 100%; +} + +.rzslider.rz-vertical .rz-pointer { + top: auto; + bottom: 0; + left: -14px !important; +} + +.rzslider.rz-vertical .rz-bubble { + bottom: 0; + left: 16px !important; + margin-left: 3px; +} + +.rzslider.rz-vertical .rz-ticks { + top: 0; + left: -3px; + z-index: 1; + width: 0; + height: 100%; +} + +.rzslider.rz-vertical .rz-tick { + margin-top: 11px; + margin-left: auto; + vertical-align: middle; +} + +.rzslider.rz-vertical .rz-tick-value { + top: auto; + left: 24px; + transform: translate(0, -28%); +} + +.rzslider.rz-vertical .rz-tick-legend { + top: auto; + right: 24px; + max-width: none; + white-space: nowrap; + transform: translate(0, -28%); +} + +.rzslider.rz-vertical .rz-ticks-values-under .rz-tick-value { + right: 24px; + bottom: auto; + left: auto; +} +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ6c2xpZGVyLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O2NBR2M7QUFDZDtFQUNFLG1CQUFtQjtFQUNuQixzQkFBc0I7RUFDdEIsWUFBWTtFQUNaLFlBQVk7RUFDWixzQkFBc0I7RUFDdEIsdUJBQXVCO0VBQ3ZCLDBCQUFrQjtLQUFsQix1QkFBa0I7TUFBbEIsc0JBQWtCO1VBQWxCLGtCQUFrQjtDQUNuQjs7QUFFRDtFQUNFLDRCQUE0QjtDQUM3Qjs7QUFFRDtFQUNFLG9CQUFvQjtDQUNyQjs7QUFFRDtFQUNFLG9CQUFvQjtDQUNyQjs7QUFFRDtFQUNFLG9CQUFvQjtFQUNwQiwwQkFBMEI7Q0FDM0I7O0FBRUQ7RUFDRSxvQkFBb0I7Q0FDckI7O0FBRUQ7RUFDRSxvQkFBb0I7Q0FDckI7O0FBRUQ7RUFDRSxvQkFBb0I7Q0FDckI7O0FBRUQ7RUFDRSxvQkFBb0I7Q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\ No newline at end of file diff --git a/node_modules/angularjs-slider/dist/rzslider.d.ts b/node_modules/angularjs-slider/dist/rzslider.d.ts new file mode 100644 index 0000000..3797a94 --- /dev/null +++ b/node_modules/angularjs-slider/dist/rzslider.d.ts @@ -0,0 +1,213 @@ +/** + * Typescript type definition file. + */ + +import * as angular from "angular"; + +declare module "angular" { + export namespace RzSlider { + type RzLabelType = "model"|"high"|"floor"|"ceil"|"tick-value"; + type RzPointerType = "min"|"max"; + type RzCallback = (id: string, modelValue: number, highValue: number, pointerType: "min"|"max") => void; + type RzTranslate = (value: number, sliderId: string, label: RzLabelType) => string; + + /** RZ slider options typing */ + interface RzOptions { + /** Number (defaults to 0): Minimum value for a slider. */ + floor?: number; + /** Number (defaults to rz-slider-modelvalue): Maximum value for a slider. */ + ceil?: number; + /** Number (defaults to 1): Step between each value. */ + step?: number; + /** Number (defaults to 0): The precision to display values with. The toFixed() is used internally for this. */ + precision?: number; + /** Number (defaults to null): The minimum value authorized on the slider. */ + minLimit?: number; + /** Number (defaults to null): The maximum value authorized on the slider. */ + maxLimit?: number; + /** + * Object(defaults to null): Has two _Number_ properties, _from_ and _to_ that determine + * the bounds of an area that is not authorized for values. _Applies to range slider only._ + */ + restrictedRange?: { from: number, to: number } + /** Number (defaults to null): The minimum range authorized on the slider. Applies to range slider only. */ + minRange?: number; + /** Number (defaults to null): The maximum range authorized on the slider. Applies to range slider only. */ + maxRange?: number; + /** + * Boolean (defaults to false): Set to true to have a push behavior. When the min handle goes above the max, + * the max is moved as well (and vice-versa). The range between min and max is defined by the step option + * (defaults to 1) and can also be override by the minRange option. Applies to range slider only. + */ + pushRange?: boolean; + /** + * Custom translate function. Use this if you want to translate values displayed on the slider. + * sliderId can be used to determine the slider for which we are translating the value. + * label is a string that can take the following values: + * 'model': the model label + * 'high': the high label + * 'floor': the floor label + * 'ceil': the ceil label + * 'tick-value': the ticks labels + */ + translate?: RzTranslate; + /** + * Function(value, sliderId): Use to display legend under ticks. The function will be called with each tick + * value and returned content will be displayed under the tick as a legend. If the returned value is null, + * then no legend is displayed under the corresponding tick. + */ + getLegend?: (value: number, sliderId: string) => string; + /** + * Any (defaults to null): If you want to use the same translate function for several sliders, + * just set the id to anything you want, and it will be passed to the translate(value, sliderId) + * function as a second argument. + */ + id?: string; + /** + * Array: If you want to display a slider with non linear/number steps. Just pass an array with each slider + * value and that's it; the floor, ceil and step settings of the slider will be computed automatically. + * By default, the rz-slider-model and rz-slider-high values will be the value of the selected item in the stepsArray. + * They can also be bound to the index of the selected item by setting the bindIndexForStepsArray option to true. + * + * stepsArray can also be an array of objects like: + * [ + * {value: 'A'}, // the display value will be *A* + * {value: 10, legend: 'Legend for 10'} // the display value will be 10 and a legend will be displayed under the corresponding tick. + * ] + */ + stepsArray?: any[]; + /** + * Boolean (defaults to false): Set to true to bind the index of the selected item to rz-slider-model and rz-slider-high. + * (This was the default behavior prior to 4.0). + */ + bindIndexForStepsArray?: boolean; + /** Boolean (defaults to false): When set to true and using a range slider, the range can be dragged by the selection bar. Applies to range slider only. */ + draggableRange?: boolean; + /** Boolean (defaults to false): Same as draggableRange but the slider range can't be changed. Applies to range slider only. */ + draggableRangeOnly?: boolean; + /** Boolean (defaults to false): Set to true to always show the selection bar before the slider handle. */ + showSelectionBar?: boolean; + /** Boolean (defaults to false): Set to true to always show the selection bar after the slider handle. */ + showSelectionBarEnd?: boolean; + /** Boolean (defaults to false): Only for range slider. Set to true to visualize in different colour the areas on the left/right (top/bottom for vertical range slider) of selection bar between the handles. */ + showOuterSelectionBars?: boolean; + /** Number (defaults to null): Set a number to draw the selection bar between this value and the slider handle. */ + showSelectionBarFromValue?: number; + /** + * Function(value) or Function(minVal, maxVal) (defaults to null): Function that returns the current color of the + * selection bar. If your color won't changed, don't use this option but set it through CSS. If the returned color + * depends on a model value (either rzScopeModelor 'rzSliderHigh), you should use the argument passed to the function. + * Indeed, when the function is called, there is no certainty that the model has already been updated. + */ + getSelectionBarColor?: (minVal: number, maxVal?: number) => string; + /** Function(value) (defaults to null): Function that returns the color of a tick. showTicks must be enabled. */ + getTickColor?: (value: number) => string; + /** + * Function(value, pointerType) (defaults to null): Function that returns the current color of a pointer. + * If your color won't changed, don't use this option but set it through CSS. If the returned color depends + * on a model value (either rzScopeModelor 'rzSliderHigh), you should use the argument passed to the function. + * Indeed, when the function is called, there is no certainty that the model has already been updated. + * To handle range slider pointers independently, you should evaluate pointerType within the given function + * where "min" stands for rzScopeModel and "max" for rzScopeHigh values. + */ + getPointerColor?: (value: number, pointerType: RzPointerType) => string; + /** Boolean (defaults to false): Set to true to hide pointer labels */ + hidePointerLabels?: boolean; + /** Boolean (defaults to false): Set to true to hide min / max labels */ + hideLimitLabels?: boolean; + /** Boolean (defaults to true): Set to false to disable the auto- hiding behavior of the limit labels. */ + autoHideLimitLabels?: boolean; + /** Boolean (defaults to false): Set to true to make the slider read-only. */ + readOnly?: boolean; + /** Boolean (defaults to false): Set to true to disable the slider. */ + disabled?: boolean; + /** + * Number in ms (defaults to 350): Internally, a throttle function (See http://underscorejs.org/#throttle) is used + * when the model or high values of the slider are changed from outside the slider. This is to prevent from re-rendering + * the slider too many times in a row. interval is the number of milliseconds to wait between two updates of the slider. + */ + interval?: number; + /** Boolean or Number (defaults to false): Set to true to display a tick for each step of the slider. Set an integer to display ticks at intermediate positions. */ + showTicks?: boolean | number; + /** Boolean or Number (defaults to false): Set to true to display a tick and the step value for each step of the slider. Set an integer to display ticks and the step value at intermediate positions. */ + showTicksValues?: boolean | number; + /** Array (defaults to null): Use to display ticks at specific positions. The array contains the index of the ticks that should be displayed. For example, [0, 1, 5] will display a tick for the first, second and sixth values. */ + ticksArray?: number[]; + /** Function(value) (defaults to null): (requires angular-ui bootstrap) Used to display a tooltip when a tick is hovered. Set to a function that returns the tooltip content for a given value. */ + ticksTooltip?: (value: number) => string; + /** Function(value) (defaults to null): Same as ticksTooltip but for ticks values. */ + ticksValuesTooltip?: (value: number) => string; + /** Number (defaults to 1): If you display the slider in an element that uses transform: scale(0.5), set the scale value to 2 so that the slider is rendered properly and the events are handled correctly. */ + scale?: number; + /** Boolean (defaults to true): Set to true to force the value to be rounded to the step, even when modified from the outside.. When set to false, if the model values are modified from outside the slider, they are not rounded and can be between two steps. */ + enforceStep?: boolean; + /** Boolean (defaults to false): Set to true to round the rzSliderModel and rzSliderHigh to the slider range even when modified from outside the slider. When set to false, if the model values are modified from outside the slider, they are not rounded but they are still rendered properly on the slider. */ + enforceRange?: boolean; + /** Boolean (defaults to false): Set to true to prevent to user from switching the min and max handles. Applies to range slider only. */ + noSwitching?: boolean; + /** Boolean (defaults to false): Set to true to only bind events on slider handles. */ + onlyBindHandles?: boolean; + /** Boolean (defaults to true): Set to true to keep the slider labels inside the slider bounds. */ + boundPointerLabels?: boolean; + /** Boolean (defaults to false): Set to true to merge the range labels if they are the same. For instance, if min and max are 50, the label will be "50 - 50" if mergeRangeLabelsIfSame: false, else "50". */ + mergeRangeLabelsIfSame?: boolean; + /** String (defaults to ' - '): Separator to use when the labels overlap. For instance, if min and max are -1 and 1, the label will be "-1 .. 1" if `labelOverlapSeparator: ' .. '`. */ + labelOverlapSeparator?: string; + /** Function(sliderId, modelValue, highValue, pointerType): Function to be called when a slider update is started. If an id was set in the options, then it's passed to this callback. This callback is called before any update on the model. pointerType is either 'min' or 'max' depending on which handle is used. */ + onStart?: RzCallback; + /** + * Function to be called when rz-slider-model or rz-slider-high change. If an id was set in the options, + * then it's passed to this callback. pointerType is either 'min' or 'max' depending + * on which handle is used. + */ + onChange?: RzCallback; + /** Function(sliderId, modelValue, highValue, pointerType): Function to be called when a slider update is ended. If an id was set in the options, then it's passed to this callback. pointerType is either 'min' or 'max' depending on which handle is used. */ + onEnd?: RzCallback; + /** Boolean (defaults to false): Set to true to show graphs right to left. If vertical is true it will be from top to bottom and left / right arrow functions reversed. */ + rightToLeft?: boolean; + /** + * Boolean (defaults to false): Set to true to display the slider vertically. The slider will take the full height of its parent. + * Changing this value at runtime is not currently supported. + */ + vertical?: boolean; + /** + * Boolean (defaults to true): Handles are focusable (on click or with tab) and can be modified using the following keyboard controls: + * - Left/bottom arrows: -1 + * - Right/top arrows: +1 + * - Page-down: -10% + * - Page-up: +10% + * - Home: minimum value + * - End: maximum value + */ + keyboardSupport?: boolean; + /** + * Boolean (defaults to false): Set to true to reverse keyboard navigation: + * - Right/top arrows: -1 + * - Left/bottom arrows: +1 + * - Page-up: -10% + * - Page-down: +10% + * - End: minimum value + * - Home: maximum value + */ + reversedControls?: boolean; + /** Object (default to null): The properties defined in this object will be exposed in the slider template under custom.X. */ + customTemplateScope?: any; + /** Boolean (defaults to false): Set to true to use a logarithmic scale to display the slider. */ + logScale?: boolean; + /** Function(val, minVal, maxVal): percent: Function that returns the position on the slider for a given value.The position must be a percentage between 0 and 1. */ + customValueToPosition?: (val: number, minVal: number, maxVal: number) => number; + /** Function(percent, minVal, maxVal): value: Function that returns the value for a given position on the slider. The position is a percentage between 0 and 1. */ + customPositionToValue?: (percent: number, minVal: number, maxVal: number) => number; + /** Object(default to null): Use to display the selection bar as a gradient. The given object must contain from and to properties which are colors. */ + selectionBarGradient?: {from: string, to: string}; + /** String(default to null): Use to add a label directly to the slider(s) for accessibility. Adds the aria-label attribute. */ + ariaLabel?: string; + /** String(default to null): Use to add a label directly to the slider(s) for accessibility. Adds the aria-label attribute. */ + ariaLabelHigh?: string; + /** String(default to null): Use instead of ariaLabel and ariaLabelHigh to reference the id of an element which will be used to label the slider(s). Adds the aria-labelledby attribute. */ + ariaLabelledBy?: string; + /** String(default to null): Use instead of ariaLabel and ariaLabelHigh to reference the id of an element which will be used to label the slider(s). Adds the aria-labelledby attribute. */ + ariaLabelledByHigh?: string; + } + } +} diff --git a/node_modules/angularjs-slider/dist/rzslider.js b/node_modules/angularjs-slider/dist/rzslider.js new file mode 100644 index 0000000..21610d6 --- /dev/null +++ b/node_modules/angularjs-slider/dist/rzslider.js @@ -0,0 +1,2779 @@ +/*! angularjs-slider - v7.0.0 - + (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - + https://github.com/angular-slider/angularjs-slider - + 2019-02-23 */ +/*jslint unparam: true */ +/*global angular: false, console: false, define, module */ +;(function(root, factory) { + 'use strict' + /* istanbul ignore next */ + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['angular'], factory) + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + // to support bundler like browserify + var angularObj = angular || require('angular') + if ((!angularObj || !angularObj.module) && typeof angular != 'undefined') { + angularObj = angular + } + module.exports = factory(angularObj) + } else { + // Browser globals (root is window) + factory(root.angular) + } +})(this, function(angular) { + 'use strict' + var module = angular + .module('rzSlider', []) + .factory('RzSliderOptions', function() { + var defaultOptions = { + floor: 0, + ceil: null, //defaults to rz-slider-model + step: 1, + precision: 0, + minRange: null, + maxRange: null, + restrictedRange: null, + pushRange: false, + minLimit: null, + maxLimit: null, + id: null, + translate: null, + getLegend: null, + stepsArray: null, + bindIndexForStepsArray: false, + draggableRange: false, + draggableRangeOnly: false, + showSelectionBar: false, + showSelectionBarEnd: false, + showSelectionBarFromValue: null, + showOuterSelectionBars: false, + hidePointerLabels: false, + hideLimitLabels: false, + autoHideLimitLabels: true, + readOnly: false, + disabled: false, + interval: 350, + showTicks: false, + showTicksValues: false, + ticksArray: null, + ticksTooltip: null, + ticksValuesTooltip: null, + vertical: false, + getSelectionBarColor: null, + getTickColor: null, + getPointerColor: null, + keyboardSupport: true, + scale: 1, + enforceStep: true, + enforceRange: false, + noSwitching: false, + onlyBindHandles: false, + disableAnimation: false, + onStart: null, + onChange: null, + onEnd: null, + rightToLeft: false, + reversedControls: false, + boundPointerLabels: true, + mergeRangeLabelsIfSame: false, + labelOverlapSeparator: ' - ', + customTemplateScope: null, + logScale: false, + customValueToPosition: null, + customPositionToValue: null, + selectionBarGradient: null, + ariaLabel: null, + ariaLabelledBy: null, + ariaLabelHigh: null, + ariaLabelledByHigh: null, + } + var globalOptions = {} + + var factory = {} + /** + * `options({})` allows global configuration of all sliders in the + * application. + * + * var app = angular.module( 'App', ['rzSlider'], function( RzSliderOptions ) { + * // show ticks for all sliders + * RzSliderOptions.options( { showTicks: true } ); + * }); + */ + factory.options = function(value) { + angular.extend(globalOptions, value) + } + + factory.getOptions = function(options) { + return angular.extend({}, defaultOptions, globalOptions, options) + } + + return factory + }) + .factory('rzThrottle', ['$timeout', function($timeout) { + /** + * rzThrottle + * + * Taken from underscore project + * + * @param {Function} func + * @param {number} wait + * @param {ThrottleOptions} options + * @returns {Function} + */ + return function(func, wait, options) { + 'use strict' + /* istanbul ignore next */ + var getTime = + Date.now || + function() { + return new Date().getTime() + } + var context, args, result + var timeout = null + var previous = 0 + options = options || {} + var later = function() { + previous = getTime() + timeout = null + result = func.apply(context, args) + context = args = null + } + return function() { + var now = getTime() + var remaining = wait - (now - previous) + context = this + args = arguments + if (remaining <= 0) { + $timeout.cancel(timeout) + timeout = null + previous = now + result = func.apply(context, args) + context = args = null + } else if (!timeout && options.trailing !== false) { + timeout = $timeout(later, remaining) + } + return result + } + } + }]) + .factory('RzSlider', ['$timeout', '$document', '$window', '$compile', 'RzSliderOptions', 'rzThrottle', function( + $timeout, + $document, + $window, + $compile, + RzSliderOptions, + rzThrottle + ) { + 'use strict' + + /** + * Slider + * + * @param {ngScope} scope The AngularJS scope + * @param {Element} sliderElem The slider directive element wrapped in jqLite + * @constructor + */ + var Slider = function(scope, sliderElem) { + /** + * The slider's scope + * + * @type {ngScope} + */ + this.scope = scope + + /** + * The slider inner low value (linked to rzSliderModel) + * @type {number} + */ + this.lowValue = 0 + + /** + * The slider inner high value (linked to rzSliderHigh) + * @type {number} + */ + this.highValue = 0 + + /** + * Slider element wrapped in jqLite + * + * @type {jqLite} + */ + this.sliderElem = sliderElem + + /** + * Slider type + * + * @type {boolean} Set to true for range slider + */ + this.range = + this.scope.rzSliderModel !== undefined && + this.scope.rzSliderHigh !== undefined + + /** + * Values recorded when first dragging the bar + * + * @type {Object} + */ + this.dragging = { + active: false, + value: 0, + difference: 0, + position: 0, + lowLimit: 0, + highLimit: 0, + } + + /** + * property that handle position (defaults to left for horizontal) + * @type {string} + */ + this.positionProperty = 'left' + + /** + * property that handle dimension (defaults to width for horizontal) + * @type {string} + */ + this.dimensionProperty = 'width' + + /** + * Half of the width or height of the slider handles + * + * @type {number} + */ + this.handleHalfDim = 0 + + /** + * Maximum position the slider handle can have + * + * @type {number} + */ + this.maxPos = 0 + + /** + * Precision + * + * @type {number} + */ + this.precision = 0 + + /** + * Step + * + * @type {number} + */ + this.step = 1 + + /** + * The name of the handle we are currently tracking + * + * @type {string} + */ + this.tracking = '' + + /** + * Minimum value (floor) of the model + * + * @type {number} + */ + this.minValue = 0 + + /** + * Maximum value (ceiling) of the model + * + * @type {number} + */ + this.maxValue = 0 + + /** + * The delta between min and max value + * + * @type {number} + */ + this.valueRange = 0 + + /** + * If showTicks/showTicksValues options are number. + * In this case, ticks values should be displayed below the slider. + * @type {boolean} + */ + this.intermediateTicks = false + + /** + * Set to true if init method already executed + * + * @type {boolean} + */ + this.initHasRun = false + + /** + * Used to call onStart on the first keydown event + * + * @type {boolean} + */ + this.firstKeyDown = false + + /** + * Internal flag to prevent watchers to be called when the sliders value are modified internally. + * @type {boolean} + */ + this.internalChange = false + + /** + * Internal flag to keep track of the visibility of combo label + * @type {boolean} + */ + this.cmbLabelShown = false + + /** + * Internal variable to keep track of the focus element + */ + this.currentFocusElement = null + + /** + * Internal variable to know if we are already moving + */ + this.moving = false + + // Slider DOM elements wrapped in jqLite + this.fullBar = null // The whole slider bar + this.selBar = null // Highlight between two handles + this.minH = null // Left slider handle + this.maxH = null // Right slider handle + this.flrLab = null // Floor label + this.ceilLab = null // Ceiling label + this.minLab = null // Label above the low value + this.maxLab = null // Label above the high value + this.cmbLab = null // Combined label + this.ticks = null // The ticks + + // Initialize slider + this.init() + } + + // Add instance methods + Slider.prototype = { + /** + * Initialize slider + * + * @returns {undefined} + */ + init: function() { + var thrLow, + thrHigh, + self = this + + var calcDimFn = function() { + self.calcViewDimensions() + } + + this.applyOptions() + this.syncLowValue() + if (this.range) this.syncHighValue() + this.initElemHandles() + this.manageElementsStyle() + this.setDisabledState() + this.calcViewDimensions() + this.setMinAndMax() + this.updateRestrictionBar() + this.addAccessibility() + this.updateCeilLab() + this.updateFloorLab() + this.initHandles() + this.manageEventsBindings() + + // Recalculate slider view dimensions + this.scope.$on('reCalcViewDimensions', calcDimFn) + + // Recalculate stuff if view port dimensions have changed + angular.element($window).on('resize', calcDimFn) + + this.initHasRun = true + + if (this.options.disableAnimation) { + this.sliderElem.addClass('noanimate') + } + + // Watch for changes to the model + thrLow = rzThrottle(function() { + self.onLowHandleChange() + }, self.options.interval) + + thrHigh = rzThrottle(function() { + self.onHighHandleChange() + }, self.options.interval) + + this.scope.$on('rzSliderForceRender', function() { + self.resetLabelsValue() + thrLow() + if (self.range) { + thrHigh() + } + self.resetSlider() + }) + + // Watchers (order is important because in case of simultaneous change, + // watchers will be called in the same order) + this.scope.$watchCollection('rzSliderOptions()', function( + newValue, + oldValue + ) { + if (newValue === oldValue) return + self.applyOptions() // need to be called before synchronizing the values + self.syncLowValue() + if (self.range) self.syncHighValue() + self.resetSlider() + }) + + this.scope.$watch('rzSliderModel', function(newValue, oldValue) { + if (self.internalChange) return + if (newValue === oldValue) return + thrLow() + }) + + this.scope.$watch('rzSliderHigh', function(newValue, oldValue) { + if (self.internalChange) return + if (newValue === oldValue) return + if (newValue != null) thrHigh() + if ( + (self.range && newValue == null) || + (!self.range && newValue != null) + ) { + self.applyOptions() + self.resetSlider() + } + }) + + this.scope.$on('$destroy', function() { + self.unbindEvents() + angular.element($window).off('resize', calcDimFn) + self.currentFocusElement = null + }) + }, + + findStepIndex: function(modelValue) { + var index = 0 + for (var i = 0; i < this.options.stepsArray.length; i++) { + var step = this.options.stepsArray[i] + if (step === modelValue) { + index = i + break + } else if (angular.isDate(step)) { + if (step.getTime() === modelValue.getTime()) { + index = i + break + } + } else if (angular.isObject(step)) { + if ( + (angular.isDate(step.value) && + step.value.getTime() === modelValue.getTime()) || + step.value === modelValue + ) { + index = i + break + } + } + } + return index + }, + + syncLowValue: function() { + if (this.options.stepsArray) { + if (!this.options.bindIndexForStepsArray) + this.lowValue = this.findStepIndex(this.scope.rzSliderModel) + else this.lowValue = this.scope.rzSliderModel + } else this.lowValue = this.scope.rzSliderModel + }, + + syncHighValue: function() { + if (this.options.stepsArray) { + if (!this.options.bindIndexForStepsArray) + this.highValue = this.findStepIndex(this.scope.rzSliderHigh) + else this.highValue = this.scope.rzSliderHigh + } else this.highValue = this.scope.rzSliderHigh + }, + + getStepValue: function(sliderValue) { + var step = this.options.stepsArray[sliderValue] + if (angular.isDate(step)) return step + if (angular.isObject(step)) return step.value + return step + }, + + applyLowValue: function() { + if (this.options.stepsArray) { + if (!this.options.bindIndexForStepsArray) + this.scope.rzSliderModel = this.getStepValue(this.lowValue) + else this.scope.rzSliderModel = this.lowValue + } else this.scope.rzSliderModel = this.lowValue + }, + + applyHighValue: function() { + if (this.options.stepsArray) { + if (!this.options.bindIndexForStepsArray) + this.scope.rzSliderHigh = this.getStepValue(this.highValue) + else this.scope.rzSliderHigh = this.highValue + } else this.scope.rzSliderHigh = this.highValue + }, + + /* + * Reflow the slider when the low handle changes (called with throttle) + */ + onLowHandleChange: function() { + this.syncLowValue() + if (this.range) this.syncHighValue() + this.setMinAndMax() + this.updateLowHandle(this.valueToPosition(this.lowValue)) + this.updateSelectionBar() + this.updateTicksScale() + this.updateAriaAttributes() + if (this.range) { + this.updateCmbLabel() + } + }, + + /* + * Reflow the slider when the high handle changes (called with throttle) + */ + onHighHandleChange: function() { + this.syncLowValue() + this.syncHighValue() + this.setMinAndMax() + this.updateHighHandle(this.valueToPosition(this.highValue)) + this.updateSelectionBar() + this.updateTicksScale() + this.updateCmbLabel() + this.updateAriaAttributes() + }, + + /** + * Read the user options and apply them to the slider model + */ + applyOptions: function() { + var sliderOptions + if (this.scope.rzSliderOptions) + sliderOptions = this.scope.rzSliderOptions() + else sliderOptions = {} + + this.options = RzSliderOptions.getOptions(sliderOptions) + + if (this.options.step <= 0) this.options.step = 1 + + this.range = + this.scope.rzSliderModel !== undefined && + this.scope.rzSliderHigh !== undefined + this.options.draggableRange = + this.range && this.options.draggableRange + this.options.draggableRangeOnly = + this.range && this.options.draggableRangeOnly + if (this.options.draggableRangeOnly) { + this.options.draggableRange = true + } + + this.options.showTicks = + this.options.showTicks || + this.options.showTicksValues || + !!this.options.ticksArray + this.scope.showTicks = this.options.showTicks //scope is used in the template + if ( + angular.isNumber(this.options.showTicks) || + this.options.ticksArray + ) + this.intermediateTicks = true + + this.options.showSelectionBar = + this.options.showSelectionBar || + this.options.showSelectionBarEnd || + this.options.showSelectionBarFromValue !== null + + if (this.options.stepsArray) { + this.parseStepsArray() + } else { + if (this.options.translate) this.customTrFn = this.options.translate + else + this.customTrFn = function(value) { + return String(value) + } + + this.getLegend = this.options.getLegend + } + + if (this.options.vertical) { + this.positionProperty = 'bottom' + this.dimensionProperty = 'height' + } else { + this.positionProperty = 'left' + this.dimensionProperty = 'width' + } + + if (this.options.customTemplateScope) + this.scope.custom = this.options.customTemplateScope + }, + + parseStepsArray: function() { + this.options.floor = 0 + this.options.ceil = this.options.stepsArray.length - 1 + this.options.step = 1 + + if (this.options.translate) { + this.customTrFn = this.options.translate + } else { + this.customTrFn = function(modelValue) { + if (this.options.bindIndexForStepsArray) + return this.getStepValue(modelValue) + return modelValue + } + } + + this.getLegend = function(index) { + var step = this.options.stepsArray[index] + if (angular.isObject(step)) return step.legend + return null + } + }, + + /** + * Resets slider + * + * @returns {undefined} + */ + resetSlider: function() { + this.resetLabelsValue() + this.manageElementsStyle() + this.addAccessibility() + this.setMinAndMax() + this.updateCeilLab() + this.updateFloorLab() + this.unbindEvents() + this.manageEventsBindings() + this.setDisabledState() + this.calcViewDimensions() + this.updateRestrictionBar() + this.refocusPointerIfNeeded() + }, + + refocusPointerIfNeeded: function() { + if (this.currentFocusElement) { + this.onPointerFocus( + this.currentFocusElement.pointer, + this.currentFocusElement.ref + ) + this.focusElement(this.currentFocusElement.pointer) + } + }, + + /** + * Set the slider children to variables for easy access + * + * Run only once during initialization + * + * @returns {undefined} + */ + initElemHandles: function() { + // Assign all slider elements to object properties for easy access + angular.forEach( + this.sliderElem.children(), + function(elem, index) { + var jElem = angular.element(elem) + + switch (index) { + case 0: + this.leftOutSelBar = jElem + break + case 1: + this.rightOutSelBar = jElem + break + case 2: + this.fullBar = jElem + break + case 3: + this.selBar = jElem + break + case 4: + this.restrictedBar = jElem + break + case 5: + this.minH = jElem + break + case 6: + this.maxH = jElem + break + case 7: + this.flrLab = jElem + break + case 8: + this.ceilLab = jElem + break + case 9: + this.minLab = jElem + break + case 10: + this.maxLab = jElem + break + case 11: + this.cmbLab = jElem + break + case 12: + this.ticks = jElem + break + } + }, + this + ) + + // Initialize position cache properties + this.selBar.rzsp = 0 + this.minH.rzsp = 0 + this.maxH.rzsp = 0 + this.flrLab.rzsp = 0 + this.ceilLab.rzsp = 0 + this.minLab.rzsp = 0 + this.maxLab.rzsp = 0 + this.cmbLab.rzsp = 0 + }, + + /** + * Update each elements style based on options + */ + manageElementsStyle: function() { + if (!this.range) this.maxH.css('display', 'none') + else this.maxH.css('display', '') + + this.alwaysHide( + this.flrLab, + this.options.showTicksValues || this.options.hideLimitLabels + ) + this.alwaysHide( + this.ceilLab, + this.options.showTicksValues || this.options.hideLimitLabels + ) + + var hideLabelsForTicks = + this.options.showTicksValues && !this.intermediateTicks + this.alwaysHide( + this.minLab, + hideLabelsForTicks || this.options.hidePointerLabels + ) + this.alwaysHide( + this.maxLab, + hideLabelsForTicks || !this.range || this.options.hidePointerLabels + ) + this.alwaysHide( + this.cmbLab, + hideLabelsForTicks || !this.range || this.options.hidePointerLabels + ) + this.alwaysHide( + this.selBar, + !this.range && !this.options.showSelectionBar + ) + this.alwaysHide( + this.leftOutSelBar, + !this.range || !this.options.showOuterSelectionBars + ) + this.alwaysHide(this.restrictedBar, !this.options.restrictedRange) + this.alwaysHide( + this.rightOutSelBar, + !this.range || !this.options.showOuterSelectionBars + ) + + if (this.range && this.options.showOuterSelectionBars) { + this.fullBar.addClass('rz-transparent') + } + + if (this.options.vertical) { + this.sliderElem.addClass('rz-vertical') + } else { + this.sliderElem.removeClass('rz-vertical') + } + + if (this.options.draggableRange) this.selBar.addClass('rz-draggable') + else this.selBar.removeClass('rz-draggable') + + if (this.intermediateTicks && this.options.showTicksValues) + this.ticks.addClass('rz-ticks-values-under') + }, + + alwaysHide: function(el, hide) { + el.rzAlwaysHide = hide + if (hide) this.hideEl(el) + else this.showEl(el) + }, + + /** + * Manage the events bindings based on readOnly and disabled options + * + * @returns {undefined} + */ + manageEventsBindings: function() { + if (this.options.disabled || this.options.readOnly) + this.unbindEvents() + else this.bindEvents() + }, + + /** + * Set the disabled state based on rzSliderDisabled + * + * @returns {undefined} + */ + setDisabledState: function() { + if (this.options.disabled) { + this.sliderElem.attr('disabled', 'disabled') + } else { + this.sliderElem.attr('disabled', null) + } + }, + + /** + * Reset label values + * + * @return {undefined} + */ + resetLabelsValue: function() { + this.minLab.rzsv = undefined + this.maxLab.rzsv = undefined + this.flrLab.rzsv = undefined + this.ceilLab.rzsv = undefined + this.cmbLab.rzsv = undefined + this.resetPosition(this.flrLab) + this.resetPosition(this.ceilLab) + this.resetPosition(this.cmbLab) + this.resetPosition(this.minLab) + this.resetPosition(this.maxLab) + }, + + /** + * Initialize slider handles positions and labels + * + * Run only once during initialization and every time view port changes size + * + * @returns {undefined} + */ + initHandles: function() { + this.updateLowHandle(this.valueToPosition(this.lowValue)) + + /* + the order here is important since the selection bar should be + updated after the high handle but before the combined label + */ + if (this.range) + this.updateHighHandle(this.valueToPosition(this.highValue)) + this.updateSelectionBar() + if (this.range) this.updateCmbLabel() + + this.updateTicksScale() + }, + + /** + * Translate value to human readable format + * + * @param {number|string} value + * @param {jqLite} label + * @param {String} which + * @param {boolean} [useCustomTr] + * @returns {undefined} + */ + translateFn: function(value, label, which, useCustomTr) { + useCustomTr = useCustomTr === undefined ? true : useCustomTr + + var valStr = '', + getDimension = false, + noLabelInjection = label.hasClass('no-label-injection') + + if (useCustomTr) { + if (this.options.stepsArray && !this.options.bindIndexForStepsArray) + value = this.getStepValue(value) + valStr = String(this.customTrFn(value, this.options.id, which)) + } else { + valStr = String(value) + } + + if ( + label.rzsv === undefined || + label.rzsv.length !== valStr.length || + (label.rzsv.length > 0 && label.rzsd === 0) + ) { + getDimension = true + label.rzsv = valStr + } + + if (!noLabelInjection) { + label.html(valStr) + } + this.scope[which + 'Label'] = valStr + + // Update width only when length of the label have changed + if (getDimension) { + this.getDimension(label) + } + }, + + /** + * Set maximum and minimum values for the slider and ensure the model and high + * value match these limits + * @returns {undefined} + */ + setMinAndMax: function() { + this.step = +this.options.step + this.precision = +this.options.precision + + this.minValue = this.options.floor + if (this.options.logScale && this.minValue === 0) + throw Error("Can't use floor=0 with logarithmic scale") + + if (this.options.enforceStep) { + this.lowValue = this.roundStep(this.lowValue) + if (this.range) this.highValue = this.roundStep(this.highValue) + } + + if (this.options.ceil != null) this.maxValue = this.options.ceil + else + this.maxValue = this.options.ceil = this.range + ? this.highValue + : this.lowValue + + if (this.options.enforceRange) { + this.lowValue = this.sanitizeValue(this.lowValue) + if (this.range) this.highValue = this.sanitizeValue(this.highValue) + } + + this.applyLowValue() + if (this.range) this.applyHighValue() + + this.valueRange = this.maxValue - this.minValue + }, + + /** + * Adds accessibility attributes + * + * Run only once during initialization + * + * @returns {undefined} + */ + addAccessibility: function() { + this.minH.attr('role', 'slider') + this.updateAriaAttributes() + if ( + this.options.keyboardSupport && + !(this.options.readOnly || this.options.disabled) + ) + this.minH.attr('tabindex', '0') + else this.minH.attr('tabindex', '') + if (this.options.vertical) { + this.minH.attr('aria-orientation', 'vertical') + } else { + this.minH.attr('aria-orientation', 'horizontal') + } + if (this.options.ariaLabel) + this.minH.attr('aria-label', this.options.ariaLabel) + else if (this.options.ariaLabelledBy) + this.minH.attr('aria-labelledby', this.options.ariaLabelledBy) + + if (this.range) { + this.maxH.attr('role', 'slider') + if ( + this.options.keyboardSupport && + !(this.options.readOnly || this.options.disabled) + ) + this.maxH.attr('tabindex', '0') + else this.maxH.attr('tabindex', '') + if (this.options.vertical) + this.maxH.attr('aria-orientation', 'vertical') + else this.maxH.attr('aria-orientation', 'horizontal') + if (this.options.ariaLabelHigh) + this.maxH.attr('aria-label', this.options.ariaLabelHigh) + else if (this.options.ariaLabelledByHigh) + this.maxH.attr('aria-labelledby', this.options.ariaLabelledByHigh) + } + }, + + /** + * Updates aria attributes according to current values + */ + updateAriaAttributes: function() { + this.minH.attr({ + 'aria-valuenow': this.scope.rzSliderModel, + 'aria-valuetext': this.customTrFn( + this.scope.rzSliderModel, + this.options.id, + 'model' + ), + 'aria-valuemin': this.minValue, + 'aria-valuemax': this.maxValue, + }) + if (this.range) { + this.maxH.attr({ + 'aria-valuenow': this.scope.rzSliderHigh, + 'aria-valuetext': this.customTrFn( + this.scope.rzSliderHigh, + this.options.id, + 'high' + ), + 'aria-valuemin': this.minValue, + 'aria-valuemax': this.maxValue, + }) + } + }, + + /** + * Calculate dimensions that are dependent on view port size + * + * Run once during initialization and every time view port changes size. + * + * @returns {undefined} + */ + calcViewDimensions: function() { + var handleWidth = this.getDimension(this.minH) + + this.handleHalfDim = handleWidth / 2 + this.barDimension = this.getDimension(this.fullBar) + + this.maxPos = this.barDimension - handleWidth + + this.getDimension(this.sliderElem) + this.sliderElem.rzsp = this.sliderElem[0].getBoundingClientRect()[ + this.positionProperty + ] + + if (this.initHasRun) { + this.updateFloorLab() + this.updateCeilLab() + this.initHandles() + var self = this + $timeout(function() { + self.updateTicksScale() + }) + } + }, + + /** + * Update the ticks position + * + * @returns {undefined} + */ + updateTicksScale: function() { + if (!this.options.showTicks) return + + var ticksArray = this.options.ticksArray || this.getTicksArray(), + translate = this.options.vertical ? 'translateY' : 'translateX', + self = this + + if (this.options.rightToLeft) ticksArray.reverse() + + this.scope.ticks = ticksArray.map(function(value) { + var legend = null + if (angular.isObject(value)) { + legend = value.legend + value = value.value + } + + var position = self.valueToPosition(value) + + if (self.options.vertical) position = self.maxPos - position + + var translation = translate + '(' + Math.round(position) + 'px)' + var tick = { + legend: legend, + selected: self.isTickSelected(value), + style: { + '-webkit-transform': translation, + '-moz-transform': translation, + '-o-transform': translation, + '-ms-transform': translation, + transform: translation, + }, + } + if (tick.selected && self.options.getSelectionBarColor) { + tick.style['background-color'] = self.getSelectionBarColor() + } + if (!tick.selected && self.options.getTickColor) { + tick.style['background-color'] = self.getTickColor(value) + } + if (self.options.ticksTooltip) { + tick.tooltip = self.options.ticksTooltip(value) + tick.tooltipPlacement = self.options.vertical ? 'right' : 'top' + } + if ( + self.options.showTicksValues === true || + value % self.options.showTicksValues === 0 + ) { + tick.value = self.getDisplayValue(value, 'tick-value') + if (self.options.ticksValuesTooltip) { + tick.valueTooltip = self.options.ticksValuesTooltip(value) + tick.valueTooltipPlacement = self.options.vertical + ? 'right' + : 'top' + } + } + if (self.getLegend) { + legend = self.getLegend(value, self.options.id) + if (legend) tick.legend = legend + } + return tick + }) + }, + + getTicksArray: function() { + var step = this.step, + ticksArray = [] + if (this.intermediateTicks) step = this.options.showTicks + for ( + var value = this.minValue; + value <= this.maxValue; + value += step + ) { + ticksArray.push(value) + } + return ticksArray + }, + + isTickSelected: function(value) { + if (!this.range) { + if (this.options.showSelectionBarFromValue !== null) { + var center = this.options.showSelectionBarFromValue + if ( + this.lowValue > center && + value >= center && + value <= this.lowValue + ) + return true + else if ( + this.lowValue < center && + value <= center && + value >= this.lowValue + ) + return true + } else if (this.options.showSelectionBarEnd) { + if (value >= this.lowValue) return true + } else if (this.options.showSelectionBar && value <= this.lowValue) + return true + } + if (this.range && value >= this.lowValue && value <= this.highValue) + return true + return false + }, + + /** + * Update position of the floor label + * + * @returns {undefined} + */ + updateFloorLab: function() { + this.translateFn(this.minValue, this.flrLab, 'floor') + this.getDimension(this.flrLab) + var position = this.options.rightToLeft + ? this.barDimension - this.flrLab.rzsd + : 0 + this.setPosition(this.flrLab, position) + }, + + /** + * Update position of the ceiling label + * + * @returns {undefined} + */ + updateCeilLab: function() { + this.translateFn(this.maxValue, this.ceilLab, 'ceil') + this.getDimension(this.ceilLab) + var position = this.options.rightToLeft + ? 0 + : this.barDimension - this.ceilLab.rzsd + this.setPosition(this.ceilLab, position) + }, + + /** + * Update slider handles and label positions + * + * @param {string} which + * @param {number} newPos + */ + updateHandles: function(which, newPos) { + if (which === 'lowValue') this.updateLowHandle(newPos) + else this.updateHighHandle(newPos) + + this.updateSelectionBar() + this.updateTicksScale() + if (this.range) this.updateCmbLabel() + }, + + /** + * Helper function to work out the position for handle labels depending on RTL or not + * + * @param {string} labelName maxLab or minLab + * @param newPos + * + * @returns {number} + */ + getHandleLabelPos: function(labelName, newPos) { + var labelRzsd = this[labelName].rzsd, + nearHandlePos = newPos - labelRzsd / 2 + this.handleHalfDim, + endOfBarPos = this.barDimension - labelRzsd + + if (!this.options.boundPointerLabels) return nearHandlePos + + if ( + (this.options.rightToLeft && labelName === 'minLab') || + (!this.options.rightToLeft && labelName === 'maxLab') + ) { + return Math.min(nearHandlePos, endOfBarPos) + } else { + return Math.min(Math.max(nearHandlePos, 0), endOfBarPos) + } + }, + + /** + * Update low slider handle position and label + * + * @param {number} newPos + * @returns {undefined} + */ + updateLowHandle: function(newPos) { + this.setPosition(this.minH, newPos) + this.translateFn(this.lowValue, this.minLab, 'model') + this.setPosition( + this.minLab, + this.getHandleLabelPos('minLab', newPos) + ) + + if (this.options.getPointerColor) { + var pointercolor = this.getPointerColor('min') + this.scope.minPointerStyle = { + backgroundColor: pointercolor, + } + } + + if (this.options.autoHideLimitLabels) { + this.shFloorCeil() + } + }, + + /** + * Update high slider handle position and label + * + * @param {number} newPos + * @returns {undefined} + */ + updateHighHandle: function(newPos) { + this.setPosition(this.maxH, newPos) + this.translateFn(this.highValue, this.maxLab, 'high') + this.setPosition( + this.maxLab, + this.getHandleLabelPos('maxLab', newPos) + ) + + if (this.options.getPointerColor) { + var pointercolor = this.getPointerColor('max') + this.scope.maxPointerStyle = { + backgroundColor: pointercolor, + } + } + if (this.options.autoHideLimitLabels) { + this.shFloorCeil() + } + }, + + /** + * Show/hide floor/ceiling label + * + * @returns {undefined} + */ + shFloorCeil: function() { + // Show based only on hideLimitLabels if pointer labels are hidden + if (this.options.hidePointerLabels) { + return + } + var flHidden = false, + clHidden = false, + isMinLabAtFloor = this.isLabelBelowFloorLab(this.minLab), + isMinLabAtCeil = this.isLabelAboveCeilLab(this.minLab), + isMaxLabAtCeil = this.isLabelAboveCeilLab(this.maxLab), + isCmbLabAtFloor = this.isLabelBelowFloorLab(this.cmbLab), + isCmbLabAtCeil = this.isLabelAboveCeilLab(this.cmbLab) + + if (isMinLabAtFloor) { + flHidden = true + this.hideEl(this.flrLab) + } else { + flHidden = false + this.showEl(this.flrLab) + } + + if (isMinLabAtCeil) { + clHidden = true + this.hideEl(this.ceilLab) + } else { + clHidden = false + this.showEl(this.ceilLab) + } + + if (this.range) { + var hideCeil = this.cmbLabelShown ? isCmbLabAtCeil : isMaxLabAtCeil + var hideFloor = this.cmbLabelShown + ? isCmbLabAtFloor + : isMinLabAtFloor + + if (hideCeil) { + this.hideEl(this.ceilLab) + } else if (!clHidden) { + this.showEl(this.ceilLab) + } + + // Hide or show floor label + if (hideFloor) { + this.hideEl(this.flrLab) + } else if (!flHidden) { + this.showEl(this.flrLab) + } + } + }, + + isLabelBelowFloorLab: function(label) { + var isRTL = this.options.rightToLeft, + pos = label.rzsp, + dim = label.rzsd, + floorPos = this.flrLab.rzsp, + floorDim = this.flrLab.rzsd + return isRTL + ? pos + dim >= floorPos - 2 + : pos <= floorPos + floorDim + 2 + }, + + isLabelAboveCeilLab: function(label) { + var isRTL = this.options.rightToLeft, + pos = label.rzsp, + dim = label.rzsd, + ceilPos = this.ceilLab.rzsp, + ceilDim = this.ceilLab.rzsd + return isRTL ? pos <= ceilPos + ceilDim + 2 : pos + dim >= ceilPos - 2 + }, + + /** + * Update restricted area bar + * + * @returns {undefined} + */ + updateRestrictionBar: function() { + var position = 0, + dimension = 0 + if (this.options.restrictedRange) { + var from = this.valueToPosition(this.options.restrictedRange.from), + to = this.valueToPosition(this.options.restrictedRange.to) + dimension = Math.abs(to - from) + position = this.options.rightToLeft + ? to + this.handleHalfDim + : from + this.handleHalfDim + this.setDimension(this.restrictedBar, dimension) + this.setPosition(this.restrictedBar, position) + } + }, + + /** + * Update slider selection bar, combined label and range label + * + * @returns {undefined} + */ + updateSelectionBar: function() { + var position = 0, + dimension = 0, + isSelectionBarFromRight = this.options.rightToLeft + ? !this.options.showSelectionBarEnd + : this.options.showSelectionBarEnd, + positionForRange = this.options.rightToLeft + ? this.maxH.rzsp + this.handleHalfDim + : this.minH.rzsp + this.handleHalfDim + + if (this.range) { + dimension = Math.abs(this.maxH.rzsp - this.minH.rzsp) + position = positionForRange + } else { + if (this.options.showSelectionBarFromValue !== null) { + var center = this.options.showSelectionBarFromValue, + centerPosition = this.valueToPosition(center), + isModelGreaterThanCenter = this.options.rightToLeft + ? this.lowValue <= center + : this.lowValue > center + if (isModelGreaterThanCenter) { + dimension = this.minH.rzsp - centerPosition + position = centerPosition + this.handleHalfDim + } else { + dimension = centerPosition - this.minH.rzsp + position = this.minH.rzsp + this.handleHalfDim + } + } else if (isSelectionBarFromRight) { + dimension = + Math.abs(this.maxPos - this.minH.rzsp) + this.handleHalfDim + position = this.minH.rzsp + this.handleHalfDim + } else { + dimension = this.minH.rzsp + this.handleHalfDim + position = 0 + } + } + this.setDimension(this.selBar, dimension) + this.setPosition(this.selBar, position) + if (this.range && this.options.showOuterSelectionBars) { + if (this.options.rightToLeft) { + this.setDimension(this.rightOutSelBar, position) + this.setPosition(this.rightOutSelBar, 0) + this.setDimension( + this.leftOutSelBar, + this.getDimension(this.fullBar) - (position + dimension) + ) + this.setPosition(this.leftOutSelBar, position + dimension) + } else { + this.setDimension(this.leftOutSelBar, position) + this.setPosition(this.leftOutSelBar, 0) + this.setDimension( + this.rightOutSelBar, + this.getDimension(this.fullBar) - (position + dimension) + ) + this.setPosition(this.rightOutSelBar, position + dimension) + } + } + if (this.options.getSelectionBarColor) { + var color = this.getSelectionBarColor() + this.scope.barStyle = { + backgroundColor: color, + } + } else if (this.options.selectionBarGradient) { + var offset = + this.options.showSelectionBarFromValue !== null + ? this.valueToPosition(this.options.showSelectionBarFromValue) + : 0, + reversed = (offset - position > 0) ^ isSelectionBarFromRight, + direction = this.options.vertical + ? reversed + ? 'bottom' + : 'top' + : reversed + ? 'left' + : 'right' + this.scope.barStyle = { + backgroundImage: + 'linear-gradient(to ' + + direction + + ', ' + + this.options.selectionBarGradient.from + + ' 0%,' + + this.options.selectionBarGradient.to + + ' 100%)', + } + if (this.options.vertical) { + this.scope.barStyle.backgroundPosition = + 'center ' + + (offset + + dimension + + position + + (reversed ? -this.handleHalfDim : 0)) + + 'px' + this.scope.barStyle.backgroundSize = + '100% ' + (this.barDimension - this.handleHalfDim) + 'px' + } else { + this.scope.barStyle.backgroundPosition = + offset - + position + + (reversed ? this.handleHalfDim : 0) + + 'px center' + this.scope.barStyle.backgroundSize = + this.barDimension - this.handleHalfDim + 'px 100%' + } + } + }, + + /** + * Wrapper around the getSelectionBarColor of the user to pass to + * correct parameters + */ + getSelectionBarColor: function() { + if (this.range) + return this.options.getSelectionBarColor( + this.scope.rzSliderModel, + this.scope.rzSliderHigh + ) + return this.options.getSelectionBarColor(this.scope.rzSliderModel) + }, + + /** + * Wrapper around the getPointerColor of the user to pass to + * correct parameters + */ + getPointerColor: function(pointerType) { + if (pointerType === 'max') { + return this.options.getPointerColor( + this.scope.rzSliderHigh, + pointerType + ) + } + return this.options.getPointerColor( + this.scope.rzSliderModel, + pointerType + ) + }, + + /** + * Wrapper around the getTickColor of the user to pass to + * correct parameters + */ + getTickColor: function(value) { + return this.options.getTickColor(value) + }, + + /** + * Update combined label position and value + * + * @returns {undefined} + */ + updateCmbLabel: function() { + var isLabelOverlap = null + if (this.options.rightToLeft) { + isLabelOverlap = + this.minLab.rzsp - this.minLab.rzsd - 10 <= this.maxLab.rzsp + } else { + isLabelOverlap = + this.minLab.rzsp + this.minLab.rzsd + 10 >= this.maxLab.rzsp + } + + if (isLabelOverlap) { + var lowTr = this.getDisplayValue(this.lowValue, 'model'), + highTr = this.getDisplayValue(this.highValue, 'high'), + labelVal = '' + if (this.options.mergeRangeLabelsIfSame && lowTr === highTr) { + labelVal = lowTr + } else { + labelVal = this.options.rightToLeft + ? highTr + this.options.labelOverlapSeparator + lowTr + : lowTr + this.options.labelOverlapSeparator + highTr + } + + this.translateFn(labelVal, this.cmbLab, 'cmb', false) + var pos = this.options.boundPointerLabels + ? Math.min( + Math.max( + this.selBar.rzsp + + this.selBar.rzsd / 2 - + this.cmbLab.rzsd / 2, + 0 + ), + this.barDimension - this.cmbLab.rzsd + ) + : this.selBar.rzsp + this.selBar.rzsd / 2 - this.cmbLab.rzsd / 2 + + this.setPosition(this.cmbLab, pos) + this.cmbLabelShown = true + this.hideEl(this.minLab) + this.hideEl(this.maxLab) + this.showEl(this.cmbLab) + } else { + this.cmbLabelShown = false + this.updateHighHandle(this.valueToPosition(this.highValue)) + this.updateLowHandle(this.valueToPosition(this.lowValue)) + this.showEl(this.maxLab) + this.showEl(this.minLab) + this.hideEl(this.cmbLab) + } + if (this.options.autoHideLimitLabels) { + this.shFloorCeil() + } + }, + + /** + * Return the translated value if a translate function is provided else the original value + * @param value + * @param which if it's min or max handle + * @returns {*} + */ + getDisplayValue: function(value, which) { + if (this.options.stepsArray && !this.options.bindIndexForStepsArray) { + value = this.getStepValue(value) + } + return this.customTrFn(value, this.options.id, which) + }, + + /** + * Round value to step and precision based on minValue + * + * @param {number} value + * @param {number} customStep a custom step to override the defined step + * @returns {number} + */ + roundStep: function(value, customStep) { + var step = customStep ? customStep : this.step, + steppedDifference = parseFloat( + (value - this.minValue) / step + ).toPrecision(12) + steppedDifference = Math.round(+steppedDifference) * step + var newValue = (this.minValue + steppedDifference).toFixed( + this.precision + ) + return +newValue + }, + + /** + * Hide element + * + * @param element + * @returns {jqLite} The jqLite wrapped DOM element + */ + hideEl: function(element) { + return element.css({ + visibility: 'hidden', + }) + }, + + /** + * Show element + * + * @param element The jqLite wrapped DOM element + * @returns {jqLite} The jqLite + */ + showEl: function(element) { + if (!!element.rzAlwaysHide) { + return element + } + + return element.css({ + visibility: 'visible', + }) + }, + + /** + * Set element left/top position depending on whether slider is horizontal or vertical + * + * @param {jqLite} elem The jqLite wrapped DOM element + * @param {number} pos + * @returns {number} + */ + setPosition: function(elem, pos) { + elem.rzsp = pos + var css = {} + css[this.positionProperty] = Math.round(pos) + 'px' + elem.css(css) + return pos + }, + + resetPosition: function(elem) { + elem.css({ + left: null, + bottom: null, + }) + }, + + /** + * Get element width/height depending on whether slider is horizontal or vertical + * + * @param {jqLite} elem The jqLite wrapped DOM element + * @returns {number} + */ + getDimension: function(elem) { + var val = elem[0].getBoundingClientRect() + if (this.options.vertical) + elem.rzsd = (val.bottom - val.top) * this.options.scale + else elem.rzsd = (val.right - val.left) * this.options.scale + return elem.rzsd + }, + + /** + * Set element width/height depending on whether slider is horizontal or vertical + * + * @param {jqLite} elem The jqLite wrapped DOM element + * @param {number} dim + * @returns {number} + */ + setDimension: function(elem, dim) { + elem.rzsd = dim + var css = {} + css[this.dimensionProperty] = Math.round(dim) + 'px' + elem.css(css) + return dim + }, + + /** + * Returns a value that is within slider range + * + * @param {number} val + * @returns {number} + */ + sanitizeValue: function(val) { + return Math.min(Math.max(val, this.minValue), this.maxValue) + }, + + /** + * Translate value to pixel position + * + * @param {number} val + * @returns {number} + */ + valueToPosition: function(val) { + var fn = this.linearValueToPosition + if (this.options.customValueToPosition) + fn = this.options.customValueToPosition + else if (this.options.logScale) fn = this.logValueToPosition + + val = this.sanitizeValue(val) + var percent = fn(val, this.minValue, this.maxValue) || 0 + if (this.options.rightToLeft) percent = 1 - percent + return percent * this.maxPos + }, + + linearValueToPosition: function(val, minVal, maxVal) { + var range = maxVal - minVal + return (val - minVal) / range + }, + + logValueToPosition: function(val, minVal, maxVal) { + val = Math.log(val) + minVal = Math.log(minVal) + maxVal = Math.log(maxVal) + var range = maxVal - minVal + return (val - minVal) / range + }, + + /** + * Translate position to model value + * + * @param {number} position + * @returns {number} + */ + positionToValue: function(position) { + var percent = position / this.maxPos + if (this.options.rightToLeft) percent = 1 - percent + var fn = this.linearPositionToValue + if (this.options.customPositionToValue) + fn = this.options.customPositionToValue + else if (this.options.logScale) fn = this.logPositionToValue + return fn(percent, this.minValue, this.maxValue) || 0 + }, + + linearPositionToValue: function(percent, minVal, maxVal) { + return percent * (maxVal - minVal) + minVal + }, + + logPositionToValue: function(percent, minVal, maxVal) { + minVal = Math.log(minVal) + maxVal = Math.log(maxVal) + var value = percent * (maxVal - minVal) + minVal + return Math.exp(value) + }, + + getEventAttr: function(event, attr) { + return event.originalEvent === undefined + ? event[attr] + : event.originalEvent[attr] + }, + + // Events + /** + * Get the X-coordinate or Y-coordinate of an event + * + * @param {Object} event The event + * @param targetTouchId The identifier of the touch with the X/Y coordinates + * @returns {number} + */ + getEventXY: function(event, targetTouchId) { + /* http://stackoverflow.com/a/12336075/282882 */ + //noinspection JSLint + var clientXY = this.options.vertical ? 'clientY' : 'clientX' + if (event[clientXY] !== undefined) { + return event[clientXY] + } + + var touches = this.getEventAttr(event, 'touches') + + if (targetTouchId !== undefined) { + for (var i = 0; i < touches.length; i++) { + if (touches[i].identifier === targetTouchId) { + return touches[i][clientXY] + } + } + } + + // If no target touch or the target touch was not found in the event + // returns the coordinates of the first touch + return touches[0][clientXY] + }, + + /** + * Compute the event position depending on whether the slider is horizontal or vertical + * @param event + * @param targetTouchId If targetTouchId is provided it will be considered the position of that + * @returns {number} + */ + getEventPosition: function(event, targetTouchId) { + var sliderPos = this.sliderElem.rzsp, + eventPos = 0 + if (this.options.vertical) + eventPos = -this.getEventXY(event, targetTouchId) + sliderPos + else eventPos = this.getEventXY(event, targetTouchId) - sliderPos + return eventPos * this.options.scale - this.handleHalfDim // #346 handleHalfDim is already scaled + }, + + /** + * Get event names for move and event end + * + * @param {Event} event The event + * + * @return {{moveEvent: string, endEvent: string}} + */ + getEventNames: function(event) { + var eventNames = { + moveEvent: '', + endEvent: '', + } + + if (this.getEventAttr(event, 'touches')) { + eventNames.moveEvent = 'touchmove' + eventNames.endEvent = 'touchend' + } else { + eventNames.moveEvent = 'mousemove' + eventNames.endEvent = 'mouseup' + } + + return eventNames + }, + + /** + * Get the handle closest to an event. + * + * @param event {Event} The event + * @returns {jqLite} The handle closest to the event. + */ + getNearestHandle: function(event) { + if (!this.range) { + return this.minH + } + var position = this.getEventPosition(event), + distanceMin = Math.abs(position - this.minH.rzsp), + distanceMax = Math.abs(position - this.maxH.rzsp) + if (distanceMin < distanceMax) return this.minH + else if (distanceMin > distanceMax) return this.maxH + else if (!this.options.rightToLeft) + //if event is at the same distance from min/max then if it's at left of minH, we return minH else maxH + return position < this.minH.rzsp ? this.minH : this.maxH + //reverse in rtl + else return position > this.minH.rzsp ? this.minH : this.maxH + }, + + /** + * Wrapper function to focus an angular element + * + * @param el {AngularElement} the element to focus + */ + focusElement: function(el) { + var DOM_ELEMENT = 0 + el[DOM_ELEMENT].focus() + }, + + /** + * Bind mouse and touch events to slider handles + * + * @returns {undefined} + */ + bindEvents: function() { + var barTracking, barStart, barMove + + if (this.options.draggableRange) { + barTracking = 'rzSliderDrag' + barStart = this.onDragStart + barMove = this.onDragMove + } else { + barTracking = 'lowValue' + barStart = this.onStart + barMove = this.onMove + } + + if (!this.options.onlyBindHandles) { + this.selBar.on( + 'mousedown', + angular.bind(this, barStart, null, barTracking) + ) + this.selBar.on( + 'mousedown', + angular.bind(this, barMove, this.selBar) + ) + } + + if (this.options.draggableRangeOnly) { + this.minH.on( + 'mousedown', + angular.bind(this, barStart, null, barTracking) + ) + this.maxH.on( + 'mousedown', + angular.bind(this, barStart, null, barTracking) + ) + } else { + this.minH.on( + 'mousedown', + angular.bind(this, this.onStart, this.minH, 'lowValue') + ) + if (this.range) { + this.maxH.on( + 'mousedown', + angular.bind(this, this.onStart, this.maxH, 'highValue') + ) + } + if (!this.options.onlyBindHandles) { + this.fullBar.on( + 'mousedown', + angular.bind(this, this.onStart, null, null) + ) + this.fullBar.on( + 'mousedown', + angular.bind(this, this.onMove, this.fullBar) + ) + this.ticks.on( + 'mousedown', + angular.bind(this, this.onStart, null, null) + ) + this.ticks.on( + 'mousedown', + angular.bind(this, this.onTickClick, this.ticks) + ) + } + } + + if (!this.options.onlyBindHandles) { + this.selBar.on( + 'touchstart', + angular.bind(this, barStart, null, barTracking) + ) + this.selBar.on( + 'touchstart', + angular.bind(this, barMove, this.selBar) + ) + } + if (this.options.draggableRangeOnly) { + this.minH.on( + 'touchstart', + angular.bind(this, barStart, null, barTracking) + ) + this.maxH.on( + 'touchstart', + angular.bind(this, barStart, null, barTracking) + ) + } else { + this.minH.on( + 'touchstart', + angular.bind(this, this.onStart, this.minH, 'lowValue') + ) + if (this.range) { + this.maxH.on( + 'touchstart', + angular.bind(this, this.onStart, this.maxH, 'highValue') + ) + } + if (!this.options.onlyBindHandles) { + this.fullBar.on( + 'touchstart', + angular.bind(this, this.onStart, null, null) + ) + this.fullBar.on( + 'touchstart', + angular.bind(this, this.onMove, this.fullBar) + ) + this.ticks.on( + 'touchstart', + angular.bind(this, this.onStart, null, null) + ) + this.ticks.on( + 'touchstart', + angular.bind(this, this.onTickClick, this.ticks) + ) + } + } + + if (this.options.keyboardSupport) { + this.minH.on( + 'focus', + angular.bind(this, this.onPointerFocus, this.minH, 'lowValue') + ) + if (this.range) { + this.maxH.on( + 'focus', + angular.bind(this, this.onPointerFocus, this.maxH, 'highValue') + ) + } + } + }, + + /** + * Unbind mouse and touch events to slider handles + * + * @returns {undefined} + */ + unbindEvents: function() { + this.minH.off() + this.maxH.off() + this.fullBar.off() + this.selBar.off() + this.ticks.off() + }, + + /** + * onStart event handler + * + * @param {?Object} pointer The jqLite wrapped DOM element; if null, the closest handle is used + * @param {?string} ref The name of the handle being changed; if null, the closest handle's value is modified + * @param {Event} event The event + * @returns {undefined} + */ + onStart: function(pointer, ref, event) { + var ehMove, + ehEnd, + eventNames = this.getEventNames(event) + + event.stopPropagation() + event.preventDefault() + + // We have to do this in case the HTML where the sliders are on + // have been animated into view. + this.calcViewDimensions() + + if (pointer) { + this.tracking = ref + } else { + pointer = this.getNearestHandle(event) + this.tracking = pointer === this.minH ? 'lowValue' : 'highValue' + } + + pointer.addClass('rz-active') + + if (this.options.keyboardSupport) this.focusElement(pointer) + + ehMove = angular.bind( + this, + this.dragging.active ? this.onDragMove : this.onMove, + pointer + ) + ehEnd = angular.bind(this, this.onEnd, ehMove) + + $document.on(eventNames.moveEvent, ehMove) + $document.on(eventNames.endEvent, ehEnd) + this.endHandlerToBeRemovedOnEnd = ehEnd + + this.callOnStart() + + var changedTouches = this.getEventAttr(event, 'changedTouches') + if (changedTouches) { + // Store the touch identifier + if (!this.touchId) { + this.isDragging = true + this.touchId = changedTouches[0].identifier + } + } + }, + + /** + * onMove event handler + * + * @param {jqLite} pointer + * @param {Event} event The event + * @param {boolean} fromTick if the event occured on a tick or not + * @returns {undefined} + */ + onMove: function(pointer, event, fromTick) { + if (!this.options.disableAnimation) { + if (this.moving) { + this.sliderElem.addClass('noanimate') + } + } + this.moving = true + var changedTouches = this.getEventAttr(event, 'changedTouches') + var touchForThisSlider + if (changedTouches) { + for (var i = 0; i < changedTouches.length; i++) { + if (changedTouches[i].identifier === this.touchId) { + touchForThisSlider = changedTouches[i] + break + } + } + } + + if (changedTouches && !touchForThisSlider) { + return + } + + var newPos = this.getEventPosition( + event, + touchForThisSlider ? touchForThisSlider.identifier : undefined + ), + newValue, + ceilValue = this.options.rightToLeft + ? this.minValue + : this.maxValue, + flrValue = this.options.rightToLeft ? this.maxValue : this.minValue + + if (newPos <= 0) { + newValue = flrValue + } else if (newPos >= this.maxPos) { + newValue = ceilValue + } else { + newValue = this.positionToValue(newPos) + if (fromTick && angular.isNumber(this.options.showTicks)) + newValue = this.roundStep(newValue, this.options.showTicks) + else newValue = this.roundStep(newValue) + } + this.positionTrackingHandle(newValue) + }, + + /** + * onEnd event handler + * + * @param {Event} event The event + * @param {Function} ehMove The bound move event handler + * @returns {undefined} + */ + onEnd: function(ehMove, event) { + this.moving = false + if (!this.options.disableAnimation) { + this.sliderElem.removeClass('noanimate') + } + var changedTouches = this.getEventAttr(event, 'changedTouches') + if (changedTouches && changedTouches[0].identifier !== this.touchId) { + return + } + this.isDragging = false + this.touchId = null + + if (!this.options.keyboardSupport) { + this.minH.removeClass('rz-active') + this.maxH.removeClass('rz-active') + this.tracking = '' + } + this.dragging.active = false + + var eventName = this.getEventNames(event) + $document.off(eventName.moveEvent, ehMove) + $document.off(eventName.endEvent, this.endHandlerToBeRemovedOnEnd) + this.endHandlerToBeRemovedOnEnd = null + this.callOnEnd() + }, + + onTickClick: function(pointer, event) { + this.onMove(pointer, event, true) + }, + + onPointerFocus: function(pointer, ref) { + this.tracking = ref + pointer.one('blur', angular.bind(this, this.onPointerBlur, pointer)) + pointer.on('keydown', angular.bind(this, this.onKeyboardEvent)) + pointer.on('keyup', angular.bind(this, this.onKeyUp)) + this.firstKeyDown = true + pointer.addClass('rz-active') + + this.currentFocusElement = { + pointer: pointer, + ref: ref, + } + }, + + onKeyUp: function() { + this.firstKeyDown = true + this.callOnEnd() + }, + + onPointerBlur: function(pointer) { + pointer.off('keydown') + pointer.off('keyup') + pointer.removeClass('rz-active') + if (!this.isDragging) { + this.tracking = '' + this.currentFocusElement = null + } + }, + + /** + * Key actions helper function + * + * @param {number} currentValue value of the slider + * + * @returns {?Object} action value mappings + */ + getKeyActions: function(currentValue) { + var increaseStep = currentValue + this.step, + decreaseStep = currentValue - this.step, + increasePage = currentValue + this.valueRange / 10, + decreasePage = currentValue - this.valueRange / 10 + + if (this.options.reversedControls) { + increaseStep = currentValue - this.step + decreaseStep = currentValue + this.step + increasePage = currentValue - this.valueRange / 10 + decreasePage = currentValue + this.valueRange / 10 + } + + //Left to right default actions + var actions = { + UP: increaseStep, + DOWN: decreaseStep, + LEFT: decreaseStep, + RIGHT: increaseStep, + PAGEUP: increasePage, + PAGEDOWN: decreasePage, + HOME: this.options.reversedControls ? this.maxValue : this.minValue, + END: this.options.reversedControls ? this.minValue : this.maxValue, + } + //right to left means swapping right and left arrows + if (this.options.rightToLeft) { + actions.LEFT = increaseStep + actions.RIGHT = decreaseStep + // right to left and vertical means we also swap up and down + if (this.options.vertical) { + actions.UP = decreaseStep + actions.DOWN = increaseStep + } + } + return actions + }, + + onKeyboardEvent: function(event) { + var currentValue = this[this.tracking], + keyCode = event.keyCode || event.which, + keys = { + 38: 'UP', + 40: 'DOWN', + 37: 'LEFT', + 39: 'RIGHT', + 33: 'PAGEUP', + 34: 'PAGEDOWN', + 36: 'HOME', + 35: 'END', + }, + actions = this.getKeyActions(currentValue), + key = keys[keyCode], + action = actions[key] + if (action == null || this.tracking === '') return + event.preventDefault() + + if (this.firstKeyDown) { + this.firstKeyDown = false + this.callOnStart() + } + + var self = this + $timeout(function() { + var newValue = self.roundStep(self.sanitizeValue(action)) + if (!self.options.draggableRangeOnly) { + self.positionTrackingHandle(newValue) + } else { + var difference = self.highValue - self.lowValue, + newMinValue, + newMaxValue + if (self.tracking === 'lowValue') { + newMinValue = newValue + newMaxValue = newValue + difference + if (newMaxValue > self.maxValue) { + newMaxValue = self.maxValue + newMinValue = newMaxValue - difference + } + } else { + newMaxValue = newValue + newMinValue = newValue - difference + if (newMinValue < self.minValue) { + newMinValue = self.minValue + newMaxValue = newMinValue + difference + } + } + self.positionTrackingBar(newMinValue, newMaxValue) + } + }) + }, + + /** + * onDragStart event handler + * + * Handles dragging of the middle bar. + * + * @param {Object} pointer The jqLite wrapped DOM element + * @param {string} ref One of the refLow, refHigh values + * @param {Event} event The event + * @returns {undefined} + */ + onDragStart: function(pointer, ref, event) { + var position = this.getEventPosition(event) + this.dragging = { + active: true, + value: this.positionToValue(position), + difference: this.highValue - this.lowValue, + lowLimit: this.options.rightToLeft + ? this.minH.rzsp - position + : position - this.minH.rzsp, + highLimit: this.options.rightToLeft + ? position - this.maxH.rzsp + : this.maxH.rzsp - position, + } + + this.onStart(pointer, ref, event) + }, + + /** + * getValue helper function + * + * gets max or min value depending on whether the newPos is outOfBounds above or below the bar and rightToLeft + * + * @param {string} type 'max' || 'min' The value we are calculating + * @param {number} newPos The new position + * @param {boolean} outOfBounds Is the new position above or below the max/min? + * @param {boolean} isAbove Is the new position above the bar if out of bounds? + * + * @returns {number} + */ + getValue: function(type, newPos, outOfBounds, isAbove) { + var isRTL = this.options.rightToLeft, + value = null + + if (type === 'min') { + if (outOfBounds) { + if (isAbove) { + value = isRTL + ? this.minValue + : this.maxValue - this.dragging.difference + } else { + value = isRTL + ? this.maxValue - this.dragging.difference + : this.minValue + } + } else { + value = isRTL + ? this.positionToValue(newPos + this.dragging.lowLimit) + : this.positionToValue(newPos - this.dragging.lowLimit) + } + } else { + if (outOfBounds) { + if (isAbove) { + value = isRTL + ? this.minValue + this.dragging.difference + : this.maxValue + } else { + value = isRTL + ? this.maxValue + : this.minValue + this.dragging.difference + } + } else { + if (isRTL) { + value = + this.positionToValue(newPos + this.dragging.lowLimit) + + this.dragging.difference + } else { + value = + this.positionToValue(newPos - this.dragging.lowLimit) + + this.dragging.difference + } + } + } + return this.roundStep(value) + }, + + /** + * onDragMove event handler + * + * Handles dragging of the middle bar. + * + * @param {jqLite} pointer + * @param {Event} event The event + * @returns {undefined} + */ + onDragMove: function(pointer, event) { + if (!this.options.disableAnimation) { + if (this.moving) { + this.sliderElem.addClass('noanimate') + } + } + this.moving = true + var newPos = this.getEventPosition(event), + newMinValue, + newMaxValue, + ceilLimit, + flrLimit, + isUnderFlrLimit, + isOverCeilLimit, + flrH, + ceilH + + if (this.options.rightToLeft) { + ceilLimit = this.dragging.lowLimit + flrLimit = this.dragging.highLimit + flrH = this.maxH + ceilH = this.minH + } else { + ceilLimit = this.dragging.highLimit + flrLimit = this.dragging.lowLimit + flrH = this.minH + ceilH = this.maxH + } + isUnderFlrLimit = newPos <= flrLimit + isOverCeilLimit = newPos >= this.maxPos - ceilLimit + + if (isUnderFlrLimit) { + if (flrH.rzsp === 0) return + newMinValue = this.getValue('min', newPos, true, false) + newMaxValue = this.getValue('max', newPos, true, false) + } else if (isOverCeilLimit) { + if (ceilH.rzsp === this.maxPos) return + newMaxValue = this.getValue('max', newPos, true, true) + newMinValue = this.getValue('min', newPos, true, true) + } else { + newMinValue = this.getValue('min', newPos, false) + newMaxValue = this.getValue('max', newPos, false) + } + this.positionTrackingBar(newMinValue, newMaxValue) + }, + + /** + * Set the new value and position for the entire bar + * + * @param {number} newMinValue the new minimum value + * @param {number} newMaxValue the new maximum value + */ + positionTrackingBar: function(newMinValue, newMaxValue) { + if ( + this.options.minLimit != null && + newMinValue < this.options.minLimit + ) { + newMinValue = this.options.minLimit + newMaxValue = newMinValue + this.dragging.difference + } + if ( + this.options.maxLimit != null && + newMaxValue > this.options.maxLimit + ) { + newMaxValue = this.options.maxLimit + newMinValue = newMaxValue - this.dragging.difference + } + + this.lowValue = newMinValue + this.highValue = newMaxValue + this.applyLowValue() + if (this.range) this.applyHighValue() + this.applyModel(true) + this.updateHandles('lowValue', this.valueToPosition(newMinValue)) + this.updateHandles('highValue', this.valueToPosition(newMaxValue)) + }, + + /** + * Set the new value and position to the current tracking handle + * + * @param {number} newValue new model value + */ + positionTrackingHandle: function(newValue) { + var valueChanged = false + newValue = this.applyMinMaxLimit(newValue) + newValue = this.applyRestrictedRange(newValue) + if (this.range) { + if (this.options.pushRange) { + newValue = this.applyPushRange(newValue) + valueChanged = true + } else { + if (this.options.noSwitching) { + if (this.tracking === 'lowValue' && newValue > this.highValue) + newValue = this.applyMinMaxRange(this.highValue) + else if ( + this.tracking === 'highValue' && + newValue < this.lowValue + ) + newValue = this.applyMinMaxRange(this.lowValue) + } + newValue = this.applyMinMaxRange(newValue) + /* This is to check if we need to switch the min and max handles */ + if (this.tracking === 'lowValue' && newValue > this.highValue) { + this.lowValue = this.highValue + this.applyLowValue() + this.applyModel() + this.updateHandles(this.tracking, this.maxH.rzsp) + this.updateAriaAttributes() + this.tracking = 'highValue' + this.minH.removeClass('rz-active') + this.maxH.addClass('rz-active') + if (this.options.keyboardSupport) this.focusElement(this.maxH) + valueChanged = true + } else if ( + this.tracking === 'highValue' && + newValue < this.lowValue + ) { + this.highValue = this.lowValue + this.applyHighValue() + this.applyModel() + this.updateHandles(this.tracking, this.minH.rzsp) + this.updateAriaAttributes() + this.tracking = 'lowValue' + this.maxH.removeClass('rz-active') + this.minH.addClass('rz-active') + if (this.options.keyboardSupport) this.focusElement(this.minH) + valueChanged = true + } + } + } + + if (this[this.tracking] !== newValue) { + this[this.tracking] = newValue + if (this.tracking === 'lowValue') this.applyLowValue() + else this.applyHighValue() + this.applyModel() + this.updateHandles(this.tracking, this.valueToPosition(newValue)) + this.updateAriaAttributes() + valueChanged = true + } + + if (valueChanged) this.applyModel(true) + }, + + applyMinMaxLimit: function(newValue) { + if (this.options.minLimit != null && newValue < this.options.minLimit) + return this.options.minLimit + if (this.options.maxLimit != null && newValue > this.options.maxLimit) + return this.options.maxLimit + return newValue + }, + + applyMinMaxRange: function(newValue) { + var oppositeValue = + this.tracking === 'lowValue' ? this.highValue : this.lowValue, + difference = Math.abs(newValue - oppositeValue) + if (this.options.minRange != null) { + if (difference < this.options.minRange) { + if (this.tracking === 'lowValue') + return this.highValue - this.options.minRange + else return this.lowValue + this.options.minRange + } + } + if (this.options.maxRange != null) { + if (difference > this.options.maxRange) { + if (this.tracking === 'lowValue') + return this.highValue - this.options.maxRange + else return this.lowValue + this.options.maxRange + } + } + return newValue + }, + + applyRestrictedRange: function(newValue) { + if ( + this.options.restrictedRange != null && + newValue > this.options.restrictedRange.from && + newValue < this.options.restrictedRange.to + ) { + var halfWidth = + (this.options.restrictedRange.to - + this.options.restrictedRange.from) / + 2 + if (this.tracking === 'lowValue') { + return newValue > this.options.restrictedRange.from + halfWidth + ? this.options.restrictedRange.to + : this.options.restrictedRange.from + } + if (this.tracking === 'highValue') { + return newValue < this.options.restrictedRange.to - halfWidth + ? this.options.restrictedRange.from + : this.options.restrictedRange.to + } + } + return newValue + }, + + applyPushRange: function(newValue) { + var difference = + this.tracking === 'lowValue' + ? this.highValue - newValue + : newValue - this.lowValue, + minRange = + this.options.minRange !== null + ? this.options.minRange + : this.options.step, + maxRange = this.options.maxRange + // if smaller than minRange + if (difference < minRange) { + if (this.tracking === 'lowValue') { + this.highValue = Math.min(newValue + minRange, this.maxValue) + newValue = this.highValue - minRange + this.applyHighValue() + this.updateHandles( + 'highValue', + this.valueToPosition(this.highValue) + ) + } else { + this.lowValue = Math.max(newValue - minRange, this.minValue) + newValue = this.lowValue + minRange + this.applyLowValue() + this.updateHandles( + 'lowValue', + this.valueToPosition(this.lowValue) + ) + } + this.updateAriaAttributes() + } else if (maxRange !== null && difference > maxRange) { + // if greater than maxRange + if (this.tracking === 'lowValue') { + this.highValue = newValue + maxRange + this.applyHighValue() + this.updateHandles( + 'highValue', + this.valueToPosition(this.highValue) + ) + } else { + this.lowValue = newValue - maxRange + this.applyLowValue() + this.updateHandles( + 'lowValue', + this.valueToPosition(this.lowValue) + ) + } + this.updateAriaAttributes() + } + return newValue + }, + + /** + * Apply the model values using scope.$apply. + * We wrap it with the internalChange flag to avoid the watchers to be called + */ + applyModel: function(callOnChange) { + this.internalChange = true + this.scope.$apply() + callOnChange && this.callOnChange() + this.internalChange = false + }, + + /** + * Call the onStart callback if defined + * The callback call is wrapped in a $evalAsync to ensure that its result will be applied to the scope. + * + * @returns {undefined} + */ + callOnStart: function() { + if (this.options.onStart) { + var self = this, + pointerType = this.tracking === 'lowValue' ? 'min' : 'max' + this.scope.$evalAsync(function() { + self.options.onStart( + self.options.id, + self.scope.rzSliderModel, + self.scope.rzSliderHigh, + pointerType + ) + }) + } + }, + + /** + * Call the onChange callback if defined + * The callback call is wrapped in a $evalAsync to ensure that its result will be applied to the scope. + * + * @returns {undefined} + */ + callOnChange: function() { + if (this.options.onChange) { + var self = this, + pointerType = this.tracking === 'lowValue' ? 'min' : 'max' + this.scope.$evalAsync(function() { + self.options.onChange( + self.options.id, + self.scope.rzSliderModel, + self.scope.rzSliderHigh, + pointerType + ) + }) + } + }, + + /** + * Call the onEnd callback if defined + * The callback call is wrapped in a $evalAsync to ensure that its result will be applied to the scope. + * + * @returns {undefined} + */ + callOnEnd: function() { + if (this.options.onEnd) { + var self = this, + pointerType = this.tracking === 'lowValue' ? 'min' : 'max' + this.scope.$evalAsync(function() { + self.options.onEnd( + self.options.id, + self.scope.rzSliderModel, + self.scope.rzSliderHigh, + pointerType + ) + }) + } + this.scope.$emit('slideEnded') + }, + } + + return Slider + }]) + .directive('rzslider', ['RzSlider', function(RzSlider) { + 'use strict' + + return { + restrict: 'AE', + replace: true, + scope: { + rzSliderModel: '=?', + rzSliderHigh: '=?', + rzSliderOptions: '&?', + rzSliderTplUrl: '@', + }, + + /** + * Return template URL + * + * @param {jqLite} elem + * @param {Object} attrs + * @return {string} + */ + templateUrl: function(elem, attrs) { + //noinspection JSUnresolvedVariable + return attrs.rzSliderTplUrl || 'rzSliderTpl.html' + }, + + link: function(scope, elem) { + scope.slider = new RzSlider(scope, elem) //attach on scope so we can test it + }, + } + }]) + + // IDE assist + + /** + * @name ngScope + * + * @property {number} rzSliderModel + * @property {number} rzSliderHigh + * @property {Object} rzSliderOptions + */ + + /** + * @name jqLite + * + * @property {number|undefined} rzsp rzslider label position position + * @property {number|undefined} rzsd rzslider element dimension + * @property {string|undefined} rzsv rzslider label value/text + * @property {Function} css + * @property {Function} text + */ + + /** + * @name Event + * @property {Array} touches + * @property {Event} originalEvent + */ + + /** + * @name ThrottleOptions + * + * @property {boolean} leading + * @property {boolean} trailing + */ + + module.run(['$templateCache', function($templateCache) { + 'use strict'; + + $templateCache.put('rzSliderTpl.html', + "
  • {{ t.value }} {{ t.legend }}
" + ); + +}]); + + return module.name +}) +; \ No newline at end of file diff --git a/node_modules/angularjs-slider/dist/rzslider.min.css b/node_modules/angularjs-slider/dist/rzslider.min.css new file mode 100644 index 0000000..71b178e --- /dev/null +++ b/node_modules/angularjs-slider/dist/rzslider.min.css @@ -0,0 +1,2 @@ +/*! angularjs-slider - v7.0.0 - (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - https://github.com/angular-slider/angularjs-slider - 2019-02-23 */ +.rzslider{position:relative;display:inline-block;width:100%;height:4px;margin:35px 0 15px 0;vertical-align:middle;user-select:none}.rzslider.noanimate *{transition:none!important}.rzslider.with-legend{margin-bottom:40px}.rzslider[disabled]{cursor:not-allowed}.rzslider[disabled] .rz-pointer{cursor:not-allowed;background-color:#d8e0f3}.rzslider[disabled] .rz-draggable{cursor:not-allowed}.rzslider[disabled] .rz-selection{background:#8b91a2}.rzslider[disabled] .rz-tick{cursor:not-allowed}.rzslider[disabled] .rz-tick.rz-selected{background:#8b91a2}.rzslider span{position:absolute;display:inline-block;white-space:nowrap}.rzslider .rz-base{width:100%;height:100%;padding:0}.rzslider .rz-bar-wrapper{left:0;z-index:1;width:100%;height:32px;padding-top:16px;margin-top:-16px;box-sizing:border-box;transition:all linear .3s}.rzslider .rz-draggable{cursor:move}.rzslider .rz-bar{left:0;z-index:1;width:100%;height:4px;background:#d8e0f3;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.rzslider .rz-bar-wrapper.rz-transparent .rz-bar{background:transparent}.rzslider .rz-bar-wrapper.rz-left-out-selection .rz-bar{background:#df002d}.rzslider .rz-bar-wrapper.rz-right-out-selection .rz-bar{background:#03a688}.rzslider .rz-selection{z-index:2;background:#0db9f0;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;transition:background-color linear .3s}.rzslider .rz-restricted{z-index:3;background:#f00;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.rzslider .rz-pointer{top:-14px;z-index:3;width:32px;height:32px;cursor:pointer;background-color:#0db9f0;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px;transition:all linear .3s}.rzslider .rz-pointer:after{position:absolute;top:12px;left:12px;width:8px;height:8px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;content:''}.rzslider .rz-pointer:hover:after{background-color:#fff}.rzslider .rz-pointer.rz-active{z-index:4}.rzslider .rz-pointer.rz-active:after{background-color:#451aff}.rzslider .rz-bubble{bottom:16px;padding:1px 3px;color:#55637d;cursor:default;transition:all linear .3s}.rzslider .rz-bubble.rz-limit{color:#55637d;transition:none}.rzslider .rz-ticks{position:absolute;top:-3px;left:0;z-index:1;width:100%;height:0;margin:0;list-style:none;box-sizing:border-box}.rzslider .rz-ticks-values-under .rz-tick-value{top:auto;bottom:-32px}.rzslider .rz-tick{position:absolute;top:0;left:0;width:10px;height:10px;margin-left:11px;text-align:center;cursor:pointer;background:#d8e0f3;border-radius:50%;transition:background-color linear .3s}.rzslider .rz-tick.rz-selected{background:#0db9f0}.rzslider .rz-tick-value{position:absolute;top:-30px;transform:translate(-50%,0)}.rzslider .rz-tick-legend{position:absolute;top:24px;max-width:50px;white-space:normal;transform:translate(-50%,0)}.rzslider.rz-vertical{position:relative;width:4px;height:100%;padding:0;margin:0 20px;vertical-align:baseline}.rzslider.rz-vertical .rz-base{width:100%;height:100%;padding:0}.rzslider.rz-vertical .rz-bar-wrapper{top:auto;left:0;width:32px;height:100%;padding:0 0 0 16px;margin:0 0 0 -16px}.rzslider.rz-vertical .rz-bar{bottom:0;left:auto;width:4px;height:100%}.rzslider.rz-vertical .rz-pointer{top:auto;bottom:0;left:-14px!important}.rzslider.rz-vertical .rz-bubble{bottom:0;left:16px!important;margin-left:3px}.rzslider.rz-vertical .rz-ticks{top:0;left:-3px;z-index:1;width:0;height:100%}.rzslider.rz-vertical .rz-tick{margin-top:11px;margin-left:auto;vertical-align:middle}.rzslider.rz-vertical .rz-tick-value{top:auto;left:24px;transform:translate(0,-28%)}.rzslider.rz-vertical .rz-tick-legend{top:auto;right:24px;max-width:none;white-space:nowrap;transform:translate(0,-28%)}.rzslider.rz-vertical .rz-ticks-values-under .rz-tick-value{right:24px;bottom:auto;left:auto} \ No newline at end of file diff --git a/node_modules/angularjs-slider/dist/rzslider.min.js b/node_modules/angularjs-slider/dist/rzslider.min.js new file mode 100644 index 0000000..227d17e --- /dev/null +++ b/node_modules/angularjs-slider/dist/rzslider.min.js @@ -0,0 +1,3 @@ +/*! angularjs-slider - v7.0.0 - (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - https://github.com/angular-slider/angularjs-slider - 2019-02-23 */ +!function(a,b){"use strict";if("function"==typeof define&&define.amd)define(["angular"],b);else if("object"==typeof module&&module.exports){var c=angular||require("angular");c&&c.module||"undefined"==typeof angular||(c=angular),module.exports=b(c)}else b(a.angular)}(this,function(a){"use strict";var b=a.module("rzSlider",[]).factory("RzSliderOptions",function(){var b={floor:0,ceil:null,step:1,precision:0,minRange:null,maxRange:null,restrictedRange:null,pushRange:!1,minLimit:null,maxLimit:null,id:null,translate:null,getLegend:null,stepsArray:null,bindIndexForStepsArray:!1,draggableRange:!1,draggableRangeOnly:!1,showSelectionBar:!1,showSelectionBarEnd:!1,showSelectionBarFromValue:null,showOuterSelectionBars:!1,hidePointerLabels:!1,hideLimitLabels:!1,autoHideLimitLabels:!0,readOnly:!1,disabled:!1,interval:350,showTicks:!1,showTicksValues:!1,ticksArray:null,ticksTooltip:null,ticksValuesTooltip:null,vertical:!1,getSelectionBarColor:null,getTickColor:null,getPointerColor:null,keyboardSupport:!0,scale:1,enforceStep:!0,enforceRange:!1,noSwitching:!1,onlyBindHandles:!1,disableAnimation:!1,onStart:null,onChange:null,onEnd:null,rightToLeft:!1,reversedControls:!1,boundPointerLabels:!0,mergeRangeLabelsIfSame:!1,labelOverlapSeparator:" - ",customTemplateScope:null,logScale:!1,customValueToPosition:null,customPositionToValue:null,selectionBarGradient:null,ariaLabel:null,ariaLabelledBy:null,ariaLabelHigh:null,ariaLabelledByHigh:null},c={},d={};return d.options=function(b){a.extend(c,b)},d.getOptions=function(d){return a.extend({},b,c,d)},d}).factory("rzThrottle",["$timeout",function(a){return function(b,c,d){var e,f,g,h=Date.now||function(){return(new Date).getTime()},i=null,j=0;d=d||{};var k=function(){j=h(),i=null,g=b.apply(e,f),e=f=null};return function(){var l=h(),m=c-(l-j);return e=this,f=arguments,0>=m?(a.cancel(i),i=null,j=l,g=b.apply(e,f),e=f=null):i||d.trailing===!1||(i=a(k,m)),g}}}]).factory("RzSlider",["$timeout","$document","$window","$compile","RzSliderOptions","rzThrottle",function(b,c,d,e,f,g){var h=function(a,b){this.scope=a,this.lowValue=0,this.highValue=0,this.sliderElem=b,this.range=void 0!==this.scope.rzSliderModel&&void 0!==this.scope.rzSliderHigh,this.dragging={active:!1,value:0,difference:0,position:0,lowLimit:0,highLimit:0},this.positionProperty="left",this.dimensionProperty="width",this.handleHalfDim=0,this.maxPos=0,this.precision=0,this.step=1,this.tracking="",this.minValue=0,this.maxValue=0,this.valueRange=0,this.intermediateTicks=!1,this.initHasRun=!1,this.firstKeyDown=!1,this.internalChange=!1,this.cmbLabelShown=!1,this.currentFocusElement=null,this.moving=!1,this.fullBar=null,this.selBar=null,this.minH=null,this.maxH=null,this.flrLab=null,this.ceilLab=null,this.minLab=null,this.maxLab=null,this.cmbLab=null,this.ticks=null,this.init()};return h.prototype={init:function(){var b,c,e=this,f=function(){e.calcViewDimensions()};this.applyOptions(),this.syncLowValue(),this.range&&this.syncHighValue(),this.initElemHandles(),this.manageElementsStyle(),this.setDisabledState(),this.calcViewDimensions(),this.setMinAndMax(),this.updateRestrictionBar(),this.addAccessibility(),this.updateCeilLab(),this.updateFloorLab(),this.initHandles(),this.manageEventsBindings(),this.scope.$on("reCalcViewDimensions",f),a.element(d).on("resize",f),this.initHasRun=!0,this.options.disableAnimation&&this.sliderElem.addClass("noanimate"),b=g(function(){e.onLowHandleChange()},e.options.interval),c=g(function(){e.onHighHandleChange()},e.options.interval),this.scope.$on("rzSliderForceRender",function(){e.resetLabelsValue(),b(),e.range&&c(),e.resetSlider()}),this.scope.$watchCollection("rzSliderOptions()",function(a,b){a!==b&&(e.applyOptions(),e.syncLowValue(),e.range&&e.syncHighValue(),e.resetSlider())}),this.scope.$watch("rzSliderModel",function(a,c){e.internalChange||a!==c&&b()}),this.scope.$watch("rzSliderHigh",function(a,b){e.internalChange||a!==b&&(null!=a&&c(),(e.range&&null==a||!e.range&&null!=a)&&(e.applyOptions(),e.resetSlider()))}),this.scope.$on("$destroy",function(){e.unbindEvents(),a.element(d).off("resize",f),e.currentFocusElement=null})},findStepIndex:function(b){for(var c=0,d=0;d0&&0===b.rzsd)&&(f=!0,b.rzsv=e),g||b.html(e),this.scope[c+"Label"]=e,f&&this.getDimension(b)},setMinAndMax:function(){if(this.step=+this.options.step,this.precision=+this.options.precision,this.minValue=this.options.floor,this.options.logScale&&0===this.minValue)throw Error("Can't use floor=0 with logarithmic scale");this.options.enforceStep&&(this.lowValue=this.roundStep(this.lowValue),this.range&&(this.highValue=this.roundStep(this.highValue))),null!=this.options.ceil?this.maxValue=this.options.ceil:this.maxValue=this.options.ceil=this.range?this.highValue:this.lowValue,this.options.enforceRange&&(this.lowValue=this.sanitizeValue(this.lowValue),this.range&&(this.highValue=this.sanitizeValue(this.highValue))),this.applyLowValue(),this.range&&this.applyHighValue(),this.valueRange=this.maxValue-this.minValue},addAccessibility:function(){this.minH.attr("role","slider"),this.updateAriaAttributes(),!this.options.keyboardSupport||this.options.readOnly||this.options.disabled?this.minH.attr("tabindex",""):this.minH.attr("tabindex","0"),this.options.vertical?this.minH.attr("aria-orientation","vertical"):this.minH.attr("aria-orientation","horizontal"),this.options.ariaLabel?this.minH.attr("aria-label",this.options.ariaLabel):this.options.ariaLabelledBy&&this.minH.attr("aria-labelledby",this.options.ariaLabelledBy),this.range&&(this.maxH.attr("role","slider"),!this.options.keyboardSupport||this.options.readOnly||this.options.disabled?this.maxH.attr("tabindex",""):this.maxH.attr("tabindex","0"),this.options.vertical?this.maxH.attr("aria-orientation","vertical"):this.maxH.attr("aria-orientation","horizontal"),this.options.ariaLabelHigh?this.maxH.attr("aria-label",this.options.ariaLabelHigh):this.options.ariaLabelledByHigh&&this.maxH.attr("aria-labelledby",this.options.ariaLabelledByHigh))},updateAriaAttributes:function(){this.minH.attr({"aria-valuenow":this.scope.rzSliderModel,"aria-valuetext":this.customTrFn(this.scope.rzSliderModel,this.options.id,"model"),"aria-valuemin":this.minValue,"aria-valuemax":this.maxValue}),this.range&&this.maxH.attr({"aria-valuenow":this.scope.rzSliderHigh,"aria-valuetext":this.customTrFn(this.scope.rzSliderHigh,this.options.id,"high"),"aria-valuemin":this.minValue,"aria-valuemax":this.maxValue})},calcViewDimensions:function(){var a=this.getDimension(this.minH);if(this.handleHalfDim=a/2,this.barDimension=this.getDimension(this.fullBar),this.maxPos=this.barDimension-a,this.getDimension(this.sliderElem),this.sliderElem.rzsp=this.sliderElem[0].getBoundingClientRect()[this.positionProperty],this.initHasRun){this.updateFloorLab(),this.updateCeilLab(),this.initHandles();var c=this;b(function(){c.updateTicksScale()})}},updateTicksScale:function(){if(this.options.showTicks){var b=this.options.ticksArray||this.getTicksArray(),c=this.options.vertical?"translateY":"translateX",d=this;this.options.rightToLeft&&b.reverse(),this.scope.ticks=b.map(function(b){var e=null;a.isObject(b)&&(e=b.legend,b=b.value);var f=d.valueToPosition(b);d.options.vertical&&(f=d.maxPos-f);var g=c+"("+Math.round(f)+"px)",h={legend:e,selected:d.isTickSelected(b),style:{"-webkit-transform":g,"-moz-transform":g,"-o-transform":g,"-ms-transform":g,transform:g}};return h.selected&&d.options.getSelectionBarColor&&(h.style["background-color"]=d.getSelectionBarColor()),!h.selected&&d.options.getTickColor&&(h.style["background-color"]=d.getTickColor(b)),d.options.ticksTooltip&&(h.tooltip=d.options.ticksTooltip(b),h.tooltipPlacement=d.options.vertical?"right":"top"),(d.options.showTicksValues===!0||b%d.options.showTicksValues===0)&&(h.value=d.getDisplayValue(b,"tick-value"),d.options.ticksValuesTooltip&&(h.valueTooltip=d.options.ticksValuesTooltip(b),h.valueTooltipPlacement=d.options.vertical?"right":"top")),d.getLegend&&(e=d.getLegend(b,d.options.id),e&&(h.legend=e)),h})}},getTicksArray:function(){var a=this.step,b=[];this.intermediateTicks&&(a=this.options.showTicks);for(var c=this.minValue;c<=this.maxValue;c+=a)b.push(c);return b},isTickSelected:function(a){if(!this.range)if(null!==this.options.showSelectionBarFromValue){var b=this.options.showSelectionBarFromValue;if(this.lowValue>b&&a>=b&&a<=this.lowValue)return!0;if(this.lowValue=a&&a>=this.lowValue)return!0}else if(this.options.showSelectionBarEnd){if(a>=this.lowValue)return!0}else if(this.options.showSelectionBar&&a<=this.lowValue)return!0;return this.range&&a>=this.lowValue&&a<=this.highValue?!0:!1},updateFloorLab:function(){this.translateFn(this.minValue,this.flrLab,"floor"),this.getDimension(this.flrLab);var a=this.options.rightToLeft?this.barDimension-this.flrLab.rzsd:0;this.setPosition(this.flrLab,a)},updateCeilLab:function(){this.translateFn(this.maxValue,this.ceilLab,"ceil"),this.getDimension(this.ceilLab);var a=this.options.rightToLeft?0:this.barDimension-this.ceilLab.rzsd;this.setPosition(this.ceilLab,a)},updateHandles:function(a,b){"lowValue"===a?this.updateLowHandle(b):this.updateHighHandle(b),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCmbLabel()},getHandleLabelPos:function(a,b){var c=this[a].rzsd,d=b-c/2+this.handleHalfDim,e=this.barDimension-c;return this.options.boundPointerLabels?this.options.rightToLeft&&"minLab"===a||!this.options.rightToLeft&&"maxLab"===a?Math.min(d,e):Math.min(Math.max(d,0),e):d},updateLowHandle:function(a){if(this.setPosition(this.minH,a),this.translateFn(this.lowValue,this.minLab,"model"),this.setPosition(this.minLab,this.getHandleLabelPos("minLab",a)),this.options.getPointerColor){var b=this.getPointerColor("min");this.scope.minPointerStyle={backgroundColor:b}}this.options.autoHideLimitLabels&&this.shFloorCeil()},updateHighHandle:function(a){if(this.setPosition(this.maxH,a),this.translateFn(this.highValue,this.maxLab,"high"),this.setPosition(this.maxLab,this.getHandleLabelPos("maxLab",a)),this.options.getPointerColor){var b=this.getPointerColor("max");this.scope.maxPointerStyle={backgroundColor:b}}this.options.autoHideLimitLabels&&this.shFloorCeil()},shFloorCeil:function(){if(!this.options.hidePointerLabels){var a=!1,b=!1,c=this.isLabelBelowFloorLab(this.minLab),d=this.isLabelAboveCeilLab(this.minLab),e=this.isLabelAboveCeilLab(this.maxLab),f=this.isLabelBelowFloorLab(this.cmbLab),g=this.isLabelAboveCeilLab(this.cmbLab);if(c?(a=!0,this.hideEl(this.flrLab)):(a=!1,this.showEl(this.flrLab)),d?(b=!0,this.hideEl(this.ceilLab)):(b=!1,this.showEl(this.ceilLab)),this.range){var h=this.cmbLabelShown?g:e,i=this.cmbLabelShown?f:c;h?this.hideEl(this.ceilLab):b||this.showEl(this.ceilLab),i?this.hideEl(this.flrLab):a||this.showEl(this.flrLab)}}},isLabelBelowFloorLab:function(a){var b=this.options.rightToLeft,c=a.rzsp,d=a.rzsd,e=this.flrLab.rzsp,f=this.flrLab.rzsd;return b?c+d>=e-2:e+f+2>=c},isLabelAboveCeilLab:function(a){var b=this.options.rightToLeft,c=a.rzsp,d=a.rzsd,e=this.ceilLab.rzsp,f=this.ceilLab.rzsd;return b?e+f+2>=c:c+d>=e-2},updateRestrictionBar:function(){var a=0,b=0;if(this.options.restrictedRange){var c=this.valueToPosition(this.options.restrictedRange.from),d=this.valueToPosition(this.options.restrictedRange.to);b=Math.abs(d-c),a=this.options.rightToLeft?d+this.handleHalfDim:c+this.handleHalfDim,this.setDimension(this.restrictedBar,b),this.setPosition(this.restrictedBar,a)}},updateSelectionBar:function(){var a=0,b=0,c=this.options.rightToLeft?!this.options.showSelectionBarEnd:this.options.showSelectionBarEnd,d=this.options.rightToLeft?this.maxH.rzsp+this.handleHalfDim:this.minH.rzsp+this.handleHalfDim;if(this.range)b=Math.abs(this.maxH.rzsp-this.minH.rzsp),a=d;else if(null!==this.options.showSelectionBarFromValue){var e=this.options.showSelectionBarFromValue,f=this.valueToPosition(e),g=this.options.rightToLeft?this.lowValue<=e:this.lowValue>e;g?(b=this.minH.rzsp-f,a=f+this.handleHalfDim):(b=f-this.minH.rzsp,a=this.minH.rzsp+this.handleHalfDim)}else c?(b=Math.abs(this.maxPos-this.minH.rzsp)+this.handleHalfDim,a=this.minH.rzsp+this.handleHalfDim):(b=this.minH.rzsp+this.handleHalfDim,a=0);if(this.setDimension(this.selBar,b),this.setPosition(this.selBar,a),this.range&&this.options.showOuterSelectionBars&&(this.options.rightToLeft?(this.setDimension(this.rightOutSelBar,a),this.setPosition(this.rightOutSelBar,0),this.setDimension(this.leftOutSelBar,this.getDimension(this.fullBar)-(a+b)),this.setPosition(this.leftOutSelBar,a+b)):(this.setDimension(this.leftOutSelBar,a),this.setPosition(this.leftOutSelBar,0),this.setDimension(this.rightOutSelBar,this.getDimension(this.fullBar)-(a+b)),this.setPosition(this.rightOutSelBar,a+b))),this.options.getSelectionBarColor){var h=this.getSelectionBarColor();this.scope.barStyle={backgroundColor:h}}else if(this.options.selectionBarGradient){var i=null!==this.options.showSelectionBarFromValue?this.valueToPosition(this.options.showSelectionBarFromValue):0,j=i-a>0^c,k=this.options.vertical?j?"bottom":"top":j?"left":"right";this.scope.barStyle={backgroundImage:"linear-gradient(to "+k+", "+this.options.selectionBarGradient.from+" 0%,"+this.options.selectionBarGradient.to+" 100%)"},this.options.vertical?(this.scope.barStyle.backgroundPosition="center "+(i+b+a+(j?-this.handleHalfDim:0))+"px",this.scope.barStyle.backgroundSize="100% "+(this.barDimension-this.handleHalfDim)+"px"):(this.scope.barStyle.backgroundPosition=i-a+(j?this.handleHalfDim:0)+"px center",this.scope.barStyle.backgroundSize=this.barDimension-this.handleHalfDim+"px 100%")}},getSelectionBarColor:function(){return this.range?this.options.getSelectionBarColor(this.scope.rzSliderModel,this.scope.rzSliderHigh):this.options.getSelectionBarColor(this.scope.rzSliderModel)},getPointerColor:function(a){return"max"===a?this.options.getPointerColor(this.scope.rzSliderHigh,a):this.options.getPointerColor(this.scope.rzSliderModel,a)},getTickColor:function(a){return this.options.getTickColor(a)},updateCmbLabel:function(){var a=null;if(a=this.options.rightToLeft?this.minLab.rzsp-this.minLab.rzsd-10<=this.maxLab.rzsp:this.minLab.rzsp+this.minLab.rzsd+10>=this.maxLab.rzsp){var b=this.getDisplayValue(this.lowValue,"model"),c=this.getDisplayValue(this.highValue,"high"),d="";d=this.options.mergeRangeLabelsIfSame&&b===c?b:this.options.rightToLeft?c+this.options.labelOverlapSeparator+b:b+this.options.labelOverlapSeparator+c,this.translateFn(d,this.cmbLab,"cmb",!1);var e=this.options.boundPointerLabels?Math.min(Math.max(this.selBar.rzsp+this.selBar.rzsd/2-this.cmbLab.rzsd/2,0),this.barDimension-this.cmbLab.rzsd):this.selBar.rzsp+this.selBar.rzsd/2-this.cmbLab.rzsd/2;this.setPosition(this.cmbLab,e),this.cmbLabelShown=!0,this.hideEl(this.minLab),this.hideEl(this.maxLab),this.showEl(this.cmbLab)}else this.cmbLabelShown=!1,this.updateHighHandle(this.valueToPosition(this.highValue)),this.updateLowHandle(this.valueToPosition(this.lowValue)),this.showEl(this.maxLab),this.showEl(this.minLab),this.hideEl(this.cmbLab);this.options.autoHideLimitLabels&&this.shFloorCeil()},getDisplayValue:function(a,b){return this.options.stepsArray&&!this.options.bindIndexForStepsArray&&(a=this.getStepValue(a)),this.customTrFn(a,this.options.id,b)},roundStep:function(a,b){var c=b?b:this.step,d=parseFloat((a-this.minValue)/c).toPrecision(12);d=Math.round(+d)*c;var e=(this.minValue+d).toFixed(this.precision);return+e},hideEl:function(a){return a.css({visibility:"hidden"})},showEl:function(a){return a.rzAlwaysHide?a:a.css({visibility:"visible"})},setPosition:function(a,b){a.rzsp=b;var c={};return c[this.positionProperty]=Math.round(b)+"px",a.css(c),b},resetPosition:function(a){a.css({left:null,bottom:null})},getDimension:function(a){var b=a[0].getBoundingClientRect();return this.options.vertical?a.rzsd=(b.bottom-b.top)*this.options.scale:a.rzsd=(b.right-b.left)*this.options.scale,a.rzsd},setDimension:function(a,b){a.rzsd=b;var c={};return c[this.dimensionProperty]=Math.round(b)+"px",a.css(c),b},sanitizeValue:function(a){return Math.min(Math.max(a,this.minValue),this.maxValue)},valueToPosition:function(a){var b=this.linearValueToPosition;this.options.customValueToPosition?b=this.options.customValueToPosition:this.options.logScale&&(b=this.logValueToPosition),a=this.sanitizeValue(a);var c=b(a,this.minValue,this.maxValue)||0;return this.options.rightToLeft&&(c=1-c),c*this.maxPos},linearValueToPosition:function(a,b,c){var d=c-b;return(a-b)/d},logValueToPosition:function(a,b,c){a=Math.log(a),b=Math.log(b),c=Math.log(c);var d=c-b;return(a-b)/d},positionToValue:function(a){var b=a/this.maxPos;this.options.rightToLeft&&(b=1-b);var c=this.linearPositionToValue;return this.options.customPositionToValue?c=this.options.customPositionToValue:this.options.logScale&&(c=this.logPositionToValue),c(b,this.minValue,this.maxValue)||0},linearPositionToValue:function(a,b,c){return a*(c-b)+b},logPositionToValue:function(a,b,c){b=Math.log(b),c=Math.log(c);var d=a*(c-b)+b;return Math.exp(d)},getEventAttr:function(a,b){return void 0===a.originalEvent?a[b]:a.originalEvent[b]},getEventXY:function(a,b){var c=this.options.vertical?"clientY":"clientX";if(void 0!==a[c])return a[c];var d=this.getEventAttr(a,"touches");if(void 0!==b)for(var e=0;ec?this.minH:c>d?this.maxH:this.options.rightToLeft?b>this.minH.rzsp?this.minH:this.maxH:b=i?h=k:i>=this.maxPos?h=j:(h=this.positionToValue(i),h=d&&a.isNumber(this.options.showTicks)?this.roundStep(h,this.options.showTicks):this.roundStep(h)),this.positionTrackingHandle(h)}},onEnd:function(a,b){this.moving=!1,this.options.disableAnimation||this.sliderElem.removeClass("noanimate");var d=this.getEventAttr(b,"changedTouches");if(!d||d[0].identifier===this.touchId){this.isDragging=!1,this.touchId=null,this.options.keyboardSupport||(this.minH.removeClass("rz-active"),this.maxH.removeClass("rz-active"),this.tracking=""),this.dragging.active=!1;var e=this.getEventNames(b);c.off(e.moveEvent,a),c.off(e.endEvent,this.endHandlerToBeRemovedOnEnd),this.endHandlerToBeRemovedOnEnd=null,this.callOnEnd()}},onTickClick:function(a,b){this.onMove(a,b,!0)},onPointerFocus:function(b,c){this.tracking=c,b.one("blur",a.bind(this,this.onPointerBlur,b)),b.on("keydown",a.bind(this,this.onKeyboardEvent)),b.on("keyup",a.bind(this,this.onKeyUp)),this.firstKeyDown=!0,b.addClass("rz-active"),this.currentFocusElement={pointer:b,ref:c}},onKeyUp:function(){this.firstKeyDown=!0,this.callOnEnd()},onPointerBlur:function(a){a.off("keydown"),a.off("keyup"),a.removeClass("rz-active"),this.isDragging||(this.tracking="",this.currentFocusElement=null)},getKeyActions:function(a){var b=a+this.step,c=a-this.step,d=a+this.valueRange/10,e=a-this.valueRange/10;this.options.reversedControls&&(b=a-this.step,c=a+this.step,d=a-this.valueRange/10,e=a+this.valueRange/10);var f={UP:b,DOWN:c,LEFT:c,RIGHT:b,PAGEUP:d,PAGEDOWN:e,HOME:this.options.reversedControls?this.maxValue:this.minValue,END:this.options.reversedControls?this.minValue:this.maxValue};return this.options.rightToLeft&&(f.LEFT=b,f.RIGHT=c,this.options.vertical&&(f.UP=c,f.DOWN=b)),f},onKeyboardEvent:function(a){var c=this[this.tracking],d=a.keyCode||a.which,e={38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",33:"PAGEUP",34:"PAGEDOWN",36:"HOME",35:"END"},f=this.getKeyActions(c),g=e[d],h=f[g];if(null!=h&&""!==this.tracking){a.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.callOnStart());var i=this;b(function(){var a=i.roundStep(i.sanitizeValue(h));if(i.options.draggableRangeOnly){var b,c,d=i.highValue-i.lowValue;"lowValue"===i.tracking?(b=a,c=a+d,c>i.maxValue&&(c=i.maxValue,b=c-d)):(c=a,b=a-d,b=k,h=k>=this.maxPos-e,g){if(0===i.rzsp)return;c=this.getValue("min",k,!0,!1),d=this.getValue("max",k,!0,!1)}else if(h){if(j.rzsp===this.maxPos)return;d=this.getValue("max",k,!0,!0),c=this.getValue("min",k,!0,!0)}else c=this.getValue("min",k,!1),d=this.getValue("max",k,!1);this.positionTrackingBar(c,d)},positionTrackingBar:function(a,b){null!=this.options.minLimit&&athis.options.maxLimit&&(b=this.options.maxLimit,a=b-this.dragging.difference), +this.lowValue=a,this.highValue=b,this.applyLowValue(),this.range&&this.applyHighValue(),this.applyModel(!0),this.updateHandles("lowValue",this.valueToPosition(a)),this.updateHandles("highValue",this.valueToPosition(b))},positionTrackingHandle:function(a){var b=!1;a=this.applyMinMaxLimit(a),a=this.applyRestrictedRange(a),this.range&&(this.options.pushRange?(a=this.applyPushRange(a),b=!0):(this.options.noSwitching&&("lowValue"===this.tracking&&a>this.highValue?a=this.applyMinMaxRange(this.highValue):"highValue"===this.tracking&&athis.highValue?(this.lowValue=this.highValue,this.applyLowValue(),this.applyModel(),this.updateHandles(this.tracking,this.maxH.rzsp),this.updateAriaAttributes(),this.tracking="highValue",this.minH.removeClass("rz-active"),this.maxH.addClass("rz-active"),this.options.keyboardSupport&&this.focusElement(this.maxH),b=!0):"highValue"===this.tracking&&athis.options.maxLimit?this.options.maxLimit:a},applyMinMaxRange:function(a){var b="lowValue"===this.tracking?this.highValue:this.lowValue,c=Math.abs(a-b);return null!=this.options.minRange&&cthis.options.maxRange?"lowValue"===this.tracking?this.highValue-this.options.maxRange:this.lowValue+this.options.maxRange:a},applyRestrictedRange:function(a){if(null!=this.options.restrictedRange&&a>this.options.restrictedRange.from&&athis.options.restrictedRange.from+b?this.options.restrictedRange.to:this.options.restrictedRange.from;if("highValue"===this.tracking)return ab?("lowValue"===this.tracking?(this.highValue=Math.min(a+c,this.maxValue),a=this.highValue-c,this.applyHighValue(),this.updateHandles("highValue",this.valueToPosition(this.highValue))):(this.lowValue=Math.max(a-c,this.minValue),a=this.lowValue+c,this.applyLowValue(),this.updateHandles("lowValue",this.valueToPosition(this.lowValue))),this.updateAriaAttributes()):null!==d&&b>d&&("lowValue"===this.tracking?(this.highValue=a+d,this.applyHighValue(),this.updateHandles("highValue",this.valueToPosition(this.highValue))):(this.lowValue=a-d,this.applyLowValue(),this.updateHandles("lowValue",this.valueToPosition(this.lowValue))),this.updateAriaAttributes()),a},applyModel:function(a){this.internalChange=!0,this.scope.$apply(),a&&this.callOnChange(),this.internalChange=!1},callOnStart:function(){if(this.options.onStart){var a=this,b="lowValue"===this.tracking?"min":"max";this.scope.$evalAsync(function(){a.options.onStart(a.options.id,a.scope.rzSliderModel,a.scope.rzSliderHigh,b)})}},callOnChange:function(){if(this.options.onChange){var a=this,b="lowValue"===this.tracking?"min":"max";this.scope.$evalAsync(function(){a.options.onChange(a.options.id,a.scope.rzSliderModel,a.scope.rzSliderHigh,b)})}},callOnEnd:function(){if(this.options.onEnd){var a=this,b="lowValue"===this.tracking?"min":"max";this.scope.$evalAsync(function(){a.options.onEnd(a.options.id,a.scope.rzSliderModel,a.scope.rzSliderHigh,b)})}this.scope.$emit("slideEnded")}},h}]).directive("rzslider",["RzSlider",function(a){return{restrict:"AE",replace:!0,scope:{rzSliderModel:"=?",rzSliderHigh:"=?",rzSliderOptions:"&?",rzSliderTplUrl:"@"},templateUrl:function(a,b){return b.rzSliderTplUrl||"rzSliderTpl.html"},link:function(b,c){b.slider=new a(b,c)}}}]);return b.run(["$templateCache",function(a){a.put("rzSliderTpl.html",'
  • {{ t.value }} {{ t.legend }}
')}]),b.name}); \ No newline at end of file diff --git a/node_modules/angularjs-slider/dist/rzslider.scss b/node_modules/angularjs-slider/dist/rzslider.scss new file mode 100644 index 0000000..6ed453a --- /dev/null +++ b/node_modules/angularjs-slider/dist/rzslider.scss @@ -0,0 +1,284 @@ +/*! angularjs-slider - v7.0.0 - + (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - + https://github.com/angular-slider/angularjs-slider - + 2019-02-23 */ +.rzslider { + position: relative; + display: inline-block; + width: 100%; + height: 4px; + margin: 35px 0 15px 0; + vertical-align: middle; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.rzslider.noanimate * { + transition: none !important; +} + +.rzslider.with-legend { + margin-bottom: 40px; +} + +.rzslider[disabled] { + cursor: not-allowed; +} + +.rzslider[disabled] .rz-pointer { + cursor: not-allowed; + background-color: #d8e0f3; +} + +.rzslider[disabled] .rz-draggable { + cursor: not-allowed; +} + +.rzslider[disabled] .rz-selection { + background: #8b91a2; +} + +.rzslider[disabled] .rz-tick { + cursor: not-allowed; +} + +.rzslider[disabled] .rz-tick.rz-selected { + background: #8b91a2; +} + +.rzslider span { + position: absolute; + display: inline-block; + white-space: nowrap; +} + +.rzslider .rz-base { + width: 100%; + height: 100%; + padding: 0; +} + +.rzslider .rz-bar-wrapper { + left: 0; + z-index: 1; + width: 100%; + height: 32px; + padding-top: 16px; + margin-top: -16px; + box-sizing: border-box; + transition: all linear 0.3s; +} + +.rzslider .rz-draggable { + cursor: move; +} + +.rzslider .rz-bar { + left: 0; + z-index: 1; + width: 100%; + height: 4px; + background: #d8e0f3; + border-radius: 2px; +} + +.rzslider .rz-bar-wrapper.rz-transparent .rz-bar { + background: transparent; +} + +.rzslider .rz-bar-wrapper.rz-left-out-selection .rz-bar { + background: #df002d; +} + +.rzslider .rz-bar-wrapper.rz-right-out-selection .rz-bar { + background: #03a688; +} + +.rzslider .rz-selection { + z-index: 2; + background: #0db9f0; + border-radius: 2px; + transition: background-color linear 0.3s; +} + +.rzslider .rz-restricted { + z-index: 3; + background: #ff0000; + border-radius: 2px; +} + +.rzslider .rz-pointer { + top: -14px; + z-index: 3; + width: 32px; + height: 32px; + cursor: pointer; + background-color: #0db9f0; + border-radius: 16px; + transition: all linear 0.3s; +} + +.rzslider .rz-pointer:after { + position: absolute; + top: 12px; + left: 12px; + width: 8px; + height: 8px; + background: #ffffff; + border-radius: 4px; + content: ''; +} + +.rzslider .rz-pointer:hover:after { + background-color: #ffffff; +} + +.rzslider .rz-pointer.rz-active { + z-index: 4; +} + +.rzslider .rz-pointer.rz-active:after { + background-color: #451aff; +} + +.rzslider .rz-bubble { + bottom: 16px; + padding: 1px 3px; + color: #55637d; + cursor: default; + transition: all linear 0.3s; +} + +.rzslider .rz-bubble.rz-limit { + color: #55637d; + transition: none; +} + +.rzslider .rz-ticks { + position: absolute; + top: -3px; + left: 0; + z-index: 1; + width: 100%; + height: 0; + margin: 0; + list-style: none; + box-sizing: border-box; +} + +.rzslider .rz-ticks-values-under .rz-tick-value { + top: auto; + bottom: -32px; +} + +.rzslider .rz-tick { + position: absolute; + top: 0; + left: 0; + width: 10px; + height: 10px; + margin-left: 11px; + text-align: center; + cursor: pointer; + background: #d8e0f3; + border-radius: 50%; + transition: background-color linear 0.3s; +} + +.rzslider .rz-tick.rz-selected { + background: #0db9f0; +} + +.rzslider .rz-tick-value { + position: absolute; + top: -30px; + transform: translate(-50%, 0); +} + +.rzslider .rz-tick-legend { + position: absolute; + top: 24px; + max-width: 50px; + white-space: normal; + transform: translate(-50%, 0); +} + +.rzslider.rz-vertical { + position: relative; + width: 4px; + height: 100%; + padding: 0; + margin: 0 20px; + vertical-align: baseline; +} + +.rzslider.rz-vertical .rz-base { + width: 100%; + height: 100%; + padding: 0; +} + +.rzslider.rz-vertical .rz-bar-wrapper { + top: auto; + left: 0; + width: 32px; + height: 100%; + padding: 0 0 0 16px; + margin: 0 0 0 -16px; +} + +.rzslider.rz-vertical .rz-bar { + bottom: 0; + left: auto; + width: 4px; + height: 100%; +} + +.rzslider.rz-vertical .rz-pointer { + top: auto; + bottom: 0; + left: -14px !important; +} + +.rzslider.rz-vertical .rz-bubble { + bottom: 0; + left: 16px !important; + margin-left: 3px; +} + +.rzslider.rz-vertical .rz-ticks { + top: 0; + left: -3px; + z-index: 1; + width: 0; + height: 100%; +} + +.rzslider.rz-vertical .rz-tick { + margin-top: 11px; + margin-left: auto; + vertical-align: middle; +} + +.rzslider.rz-vertical .rz-tick-value { + top: auto; + left: 24px; + transform: translate(0, -28%); +} + +.rzslider.rz-vertical .rz-tick-legend { + top: auto; + right: 24px; + max-width: none; + white-space: nowrap; + transform: translate(0, -28%); +} + +.rzslider.rz-vertical .rz-ticks-values-under .rz-tick-value { + right: 24px; + bottom: auto; + left: auto; +} +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ6c2xpZGVyLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O2NBR2M7QUFDZDtFQUNFLG1CQUFtQjtFQUNuQixzQkFBc0I7RUFDdEIsWUFBWTtFQUNaLFlBQVk7RUFDWixzQkFBc0I7RUFDdEIsdUJBQXVCO0VBQ3ZCLDBCQUFrQjtLQUFsQix1QkFBa0I7TUFBbEIsc0JBQWtCO1VBQWxCLGtCQUFrQjtDQUNuQjs7QUFFRDtFQUNFLDRCQUE0QjtDQUM3Qjs7QUFFRDtFQUNFLG9CQUFvQjtDQUNyQjs7QUFFRDtFQUNFLG9CQUFvQjtDQUNyQjs7QUFFRDtFQUNFLG9CQUFvQjtFQUNwQiwwQkFBMEI7Q0FDM0I7O0FBRUQ7RUFDRSxvQkFBb0I7Q0FDckI7O0FBRUQ7RUFDRSxvQkFBb0I7Q0FDckI7O0FBRUQ7RUFDRSxvQkFBb0I7Q0FDckI7O0FBRUQ7RUFDRSxvQkFBb0I7Q0FDckI7O0FBRUQ7RUFDRSxtQkFBbUI7RUFDbkIsc0JBQXNCO0VBQ3RCLG9CQUFvQjtDQUNyQjs7QUFFRDtFQUNFLFlBQVk7RUFDWixhQUFhO0VBQ2IsV0FBVztDQUNaOztBQUVEO0VBQ0UsUUFBUTtFQUNSLFdBQVc7RUFDWCxZQUFZO0VBQ1osYUFBYTtFQUNiLGtCQUFrQjtFQUNsQixrQkFBa0I7RUFDbEIsdUJBQXVCO0VBQ3ZCLDRCQUE0QjtDQUM3Qjs7QUFFRDtFQUNFLGFBQWE7Q0FDZDs7QUFFRDtFQUNFLFFBQVE7RUFDUixXQUFX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tM3B4O1xuICB6LWluZGV4OiAxO1xuICB3aWR0aDogMDtcbiAgaGVpZ2h0OiAxMDAlO1xufVxuXG4ucnpzbGlkZXIucnotdmVydGljYWwgLnJ6LXRpY2sge1xuICBtYXJnaW4tdG9wOiAxMXB4O1xuICBtYXJnaW4tbGVmdDogYXV0bztcbiAgdmVydGljYWwtYWxpZ246IG1pZGRsZTtcbn1cblxuLnJ6c2xpZGVyLnJ6LXZlcnRpY2FsIC5yei10aWNrLXZhbHVlIHtcbiAgdG9wOiBhdXRvO1xuICBsZWZ0OiAyNHB4O1xuICB0cmFuc2Zvcm06IHRyYW5zbGF0ZSgwLCAtMjglKTtcbn1cblxuLnJ6c2xpZGVyLnJ6LXZlcnRpY2FsIC5yei10aWNrLWxlZ2VuZCB7XG4gIHRvcDogYXV0bztcbiAgcmlnaHQ6IDI0cHg7XG4gIG1heC13aWR0aDogbm9uZTtcbiAgd2hpdGUtc3BhY2U6IG5vd3JhcDtcbiAgdHJhbnNmb3JtOiB0cmFuc2xhdGUoMCwgLTI4JSk7XG59XG5cbi5yenNsaWRlci5yei12ZXJ0aWNhbCAucnotdGlja3MtdmFsdWVzLXVuZGVyIC5yei10aWNrLXZhbHVlIHtcbiAgcmlnaHQ6IDI0cHg7XG4gIGJvdHRvbTogYXV0bztcbiAgbGVmdDogYXV0bztcbn0iXX0= */ \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..2bc986b --- /dev/null +++ b/package-lock.json @@ -0,0 +1,11 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "angularjs-slider": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/angularjs-slider/-/angularjs-slider-7.0.0.tgz", + "integrity": "sha512-qNWPARWEktSthHj0/SAMVhy+3AIRnyVCXRK58gXT+3uRORXu/3QJ2L9MjCZvA9yeZxFceEYMOrtK8sSsTKobUw==" + } + } +}