diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..507d3c6 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: [ValentinH] diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..6028c0c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,26 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +Demo: https://jsfiddle.net/wm3ce8jb/ (fork this example and update the link) + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. diff --git a/.gitignore b/.gitignore index eefbe2b..b2fa3c1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ bower_components/ temp/ tests/coverage/ yarn.lock -cypress/videos \ No newline at end of file +cypress/videos +npm-debug.log +.history/ \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..5660f81 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +registry=https://registry.npmjs.org/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 345ad95..ed21eeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,98 +1,146 @@ +# 7.0.1 (2021-09-06) + +## Bug fix + +- chore(styles): add parentheses around division-like expr's (#679) + +# 7.0.0 (2019-02-23) + +## Feature + +- feat(transition): slider moves are now animated. (this can be disabled via the `disableAnimation` option) + +## Bug fix + +- fix(vertical): Support switching between horizontal and vertical + +## Breaking change + +The module name was renamed from `rzModule` to `rzSlider`. + +# 6.7.0 (2019-02-23) + +## Feature + +- feat(ticks): add the option to use ticksArray as array of objects (#662, thanks @vdiez) + +# 6.6.0 (2018-06-29) + +## Feature + +- feat(range): adds the `restrictedRange` option (#638, thanks @DanielReid) + +## ⚠️ Unwanted breaking change ⚠️ + +Sorry for this, but this version is breaking if you are using the `rz-slider-tpl-url` attribute. You need to update your template to have the correct number of elements. + +# 6.5.1 (2018-03-30) + +## Bug fix + +- revert: onStart: Remove stop propagation call so events will bubble up (#612) + +# 6.5.0 (2018-02-06) + +## Feature + +- feat(\$compile): adds labelOverlapSeparator as an option (#616) + # 6.4.4 (2018-01-24) ## Bug fix -* onStart: Remove stop propagation call so events will bubble up (#612) +- onStart: Remove stop propagation call so events will bubble up (#612) # 6.4.3 (2017-12-01) ## Bug fix -* Remove the semicolon at the end of the `dist/rzslider.css` file. It was introduced by previous release. +- Remove the semicolon at the end of the `dist/rzslider.css` file. It was introduced by previous release. # 6.4.2 (2017-11-30) ## Bug fix -* Add a semicolon at the end of the `dist/rzslider.js` file. It avoids errors when people concat this file with other libs without using the minified version. +- Add a semicolon at the end of the `dist/rzslider.js` file. It avoids errors when people concat this file with other libs without using the minified version. # 6.4.1 (2017-11-17) ## Bug fix -* Options: react to changes of options of Function type (#590) +- Options: react to changes of options of Function type (#590) # 6.4.0 (2017-08-12) ## Feature -* Add the `showOuterSelectionBars` option (#553). +- Add the `showOuterSelectionBars` option (#553). # 6.3.0 (2017-08-07) ## Feature -* Handle different values for `showTicks` and `showTicksValues` (#550). +- Handle different values for `showTicks` and `showTicksValues` (#550). # 6.2.3 (2017-07-08) ## Tooling -* Add Typescript definition file. +- Add Typescript definition file. # 6.2.2 (2017-05-16) ## Fixes -* Fix (again) onEnd event de-registration. +- Fix (again) onEnd event de-registration. # 6.2.1 (2017-05-15) ## Fixes -* Fix onEnd event being sent several times on non-mobiles devices (#536) +- Fix onEnd event being sent several times on non-mobiles devices (#536) # 6.2.0 (2017-05-25) ## New Feature -* Handle multi touch events on separate sliders (#535). Thanks @daniela-mateescu :) +- Handle multi touch events on separate sliders (#535). Thanks @daniela-mateescu :) # 6.1.2 (2017-05-15) ## Fixes -* Fix ticks and values at intermediate positions on IE (#531) +- Fix ticks and values at intermediate positions on IE (#531) # 6.1.1 (2017-03-29) ## Fixes -* Add vendor prefixes for transform property in JS code (#518) +- Add vendor prefixes for transform property in JS code (#518) # 6.1.0 (2017-03-06) ## Features -* Add labelling options for a11y (#505) +- Add labelling options for a11y (#505) # 6.0.2 (2017-03-02) ## Fixes -* Update the combined labels on separation (#502) +- Update the combined labels on separation (#502) # 6.0.1 (2017-02-14) ## Fixes -* Ensure model value is current when custom translate function runs for tick values +- Ensure model value is current when custom translate function runs for tick values # 6.0.0 (2017-01-02) ## Refactoring -* Refactor/simplify the css rules to ease the customisation. +- Refactor/simplify the css rules to ease the customisation. **You might want to check that all your custom styles are still correctly applied...** @@ -100,85 +148,85 @@ ## Features -* Add selectionBarGradient option to customize the selection bar (#473) +- Add selectionBarGradient option to customize the selection bar (#473) # 5.8.9 (2016-12-11) ## Improvement -* Add autoprefixer for CSS builds (#472) +- Add autoprefixer for CSS builds (#472) # 5.8.8 (2016-12-11) ## Fix -* Prevent angular being loaded twice when using with browserify (#474) +- Prevent angular being loaded twice when using with browserify (#474) # 5.8.7 (2016-11-09) ## Fix -* Add Math.round for positions and dimensions - thanks to @DmitryKrekota (#454) +- Add Math.round for positions and dimensions - thanks to @DmitryKrekota (#454) # 5.8.6 (2016-11-08) ## Fix -* Apply the pushRange with maxRange - thanks to @GuilloOme (#456) +- Apply the pushRange with maxRange - thanks to @GuilloOme (#456) # 5.8.5 (2016-11-05) ## Fix -* Fix overlapping max and ceil labels in some cases (#396) +- Fix overlapping max and ceil labels in some cases (#396) # 5.8.4 (2016-11-05) ## Improvement -* Refactor autoHiding algorithm for labels (fix #446) +- Refactor autoHiding algorithm for labels (fix #446) # 5.8.3 (2016-11-03) ## Improvement -* Generate a SCSS file (simple copy of the css file) in the dist folder so it can be imported (#449) +- Generate a SCSS file (simple copy of the css file) in the dist folder so it can be imported (#449) # 5.8.2 (2016-11-03) ## Fix -* Fix ceil label positioning (#448) +- Fix ceil label positioning (#448) # 5.8.1 (2016-10-27) ## Fix -* Enable using with Browserify (#436) +- Enable using with Browserify (#436) # 5.8.0 (2016-10-22) ## Features -* Handle Date object in stepsArray (#424 ) +- Handle Date object in stepsArray (#424 ) ## Fixes -* Fix style for disabled range slider and ticks (#394) -* Fix slider goes back when moved and scaled (#346) +- Fix style for disabled range slider and ticks (#394) +- Fix slider goes back when moved and scaled (#346) # 5.7.0 (2016-10-16) ## Features -* Add a `logScale` option to display the slider using a logarithmic scale (#280). -* Add `customValueToPosition` and `customPositionToValue` options to display the slider using a custom scale (#280). +- Add a `logScale` option to display the slider using a logarithmic scale (#280). +- Add `customValueToPosition` and `customPositionToValue` options to display the slider using a custom scale (#280). # 5.6.0 (2016-10-16) ## Features -* Add a `ticksArray` option to display ticks at specific positions (#426). +- Add a `ticksArray` option to display ticks at specific positions (#426). To enable this new feature, the way the ticks are rendered has been changed. Now each tick is positioned absolutely using a `transform: translate()` instruction. @@ -186,73 +234,73 @@ To enable this new feature, the way the ticks are rendered has been changed. Now ## Fix -* Prevent losing focus when slider is rerendered (#415). +- Prevent losing focus when slider is rerendered (#415). # 5.5.0 (2016-09-06) ## Features -* Add an `autoHideLimitLabels` to disable the auto-hiding of limit labels (#405). +- Add an `autoHideLimitLabels` to disable the auto-hiding of limit labels (#405). # 5.4.3 (2016-08-07) ## Fix -* Fix minLimit/maxLimit bugged for draggableRange (#384). +- Fix minLimit/maxLimit bugged for draggableRange (#384). # 5.4.2 (2016-08-02) ## Fix -* Fix minimum value goes below floor when using maxRange (#377). +- Fix minimum value goes below floor when using maxRange (#377). # 5.4.1 (2016-07-17) ## Fix -* Fix showing limit labels when pointer labels are always hidden (#373). +- Fix showing limit labels when pointer labels are always hidden (#373). # 5.4.0 (2016-07-13) ## Features -* Add function to customize color of ticks (#372). +- Add function to customize color of ticks (#372). # 5.3.0 (2016-07-11) ## Features -* Expose labels on scope in template (#358). +- Expose labels on scope in template (#358). # 5.2.0 (2016-07-07) ## Features -* Add a `customTemplateScope` option (#354). +- Add a `customTemplateScope` option (#354). # 5.1.1 (2016-07-06) ## Fix -* Fix the way to check when event properties are undefined (#365). +- Fix the way to check when event properties are undefined (#365). # 5.1.0 (2016-07-02) ## Features -* Add a `pushRange` option (#341). +- Add a `pushRange` option (#341). # 5.0.1 (2016-07-01) ## Fix -* Switch from using opacity to visibility to show/hide elements (#362). +- Switch from using opacity to visibility to show/hide elements (#362). # 5.0.0 (2016-06-30) ## Fix -* AMD/CommonJS exported module: export module name instead of module (#360). +- AMD/CommonJS exported module: export module name instead of module (#360). ## Breaking change @@ -262,34 +310,34 @@ Code that relies on the module object to be exported (accessing the name via .na ## Improvement -* Add a `bindIndexForStepsArray` option that enable to use `stepsArray` with the same behavior as before 4.0 (#345). +- Add a `bindIndexForStepsArray` option that enable to use `stepsArray` with the same behavior as before 4.0 (#345). ## Fix -* Hide floor/ceil label when overlapped on combo label (#357). -* Fix switching from steps array to regular steps (#361). +- Hide floor/ceil label when overlapped on combo label (#357). +- Fix switching from steps array to regular steps (#361). # 4.0.2 (2016-06-07) ## Improvement -* Add a `mergeRangeLabelsIfSame` option (#245). +- Add a `mergeRangeLabelsIfSame` option (#245). # 4.0.1 (2016-06-04) ## Improvement -* Add a pointerType arg for the callbacks (onStart, onChange and onEnd) to identify which handle is used (#339). +- Add a pointerType arg for the callbacks (onStart, onChange and onEnd) to identify which handle is used (#339). # 4.0.0 (2016-06-04) ## Improvement -* `stepsArray`: Bind rzSliderModel and rzSliderHigh to the actual value (#335). +- `stepsArray`: Bind rzSliderModel and rzSliderHigh to the actual value (#335). ## Breaking changes -* From now on, when using the `stepsArray` feature, you should directly provide the actual value to rzSliderModel and rzSliderHigh instead of passing the index of this value. +- From now on, when using the `stepsArray` feature, you should directly provide the actual value to rzSliderModel and rzSliderHigh instead of passing the index of this value. Thus, you need to update your config like in the following example: ```js @@ -314,13 +362,13 @@ vm.slider = { ## Features -* Add IE8 support (#314). -* Consolidate onStart, onChange and onEnd for keyboard (#319). -* Added `rz-floor` and `rz-ceil` classes to floor and ceil label to allow styling (#337). +- Add IE8 support (#314). +- Consolidate onStart, onChange and onEnd for keyboard (#319). +- Added `rz-floor` and `rz-ceil` classes to floor and ceil label to allow styling (#337). ## Breaking changes -* From now on, to allow the IE8 support, the directive is configured with `replace: true`. Thus, you need to update your custom CSS rules like in the following example: +- From now on, to allow the IE8 support, the directive is configured with `replace: true`. Thus, you need to update your custom CSS rules like in the following example: ```css /* before 3.0 version */ @@ -338,215 +386,215 @@ rzslider { ## Features -* Add `minLimit` and `maxLimit` options (#332). -* Add a `maxRange` option (#333). -* Add `boundPointerLabels` option (#323). +- Add `minLimit` and `maxLimit` options (#332). +- Add a `maxRange` option (#333). +- Add `boundPointerLabels` option (#323). # 2.13.0 (2016-04-24) ## Features -* Add a `getLegend` option (#318). -* Handle objects in `stepsArray` that can contain `value` and `legend` properties. +- Add a `getLegend` option (#318). +- Handle objects in `stepsArray` that can contain `value` and `legend` properties. # 2.12.0 (2016-04-22) ## Features -* Accept numbers for showTicks/showTicksValues to display ticks at intermediate positions (#264). +- Accept numbers for showTicks/showTicksValues to display ticks at intermediate positions (#264). # 2.11.0 (2016-04-01) ## Features -* Add a hidePointerLabels option (#273). +- Add a hidePointerLabels option (#273). ## Fix -* Position long labels on vertical sliders correctly (#306). +- Position long labels on vertical sliders correctly (#306). # 2.10.4 (2016-03-16) ## Fix -* Fix the floor limit when floor is different than 0 (#293). +- Fix the floor limit when floor is different than 0 (#293). # 2.10.3 (2016-03-14) ## Fix -* Prefix all CSS classes with rz- to prevent conflicts (#292). +- Prefix all CSS classes with rz- to prevent conflicts (#292). # 2.10.2 (2016-03-01) ## Bug fixes -* Remove the dist folder from gitignore. +- Remove the dist folder from gitignore. # 2.10.1 (2016-03-01) ## Bug fixes -* Republish the npm module since dist files were missing. +- Republish the npm module since dist files were missing. # 2.10.0 (2016-02-29) ## Features -* Added `rightToLeft` option for RTL support (#270). Thanks @Liam-Ryan :). +- Added `rightToLeft` option for RTL support (#270). Thanks @Liam-Ryan :). # 2.9.0 (2016-02-18) ## Features -* Change `rzSliderOptions` to use expression binding (#266). +- Change `rzSliderOptions` to use expression binding (#266). # 2.8.0 (2016-02-08) ## Features -* Add a `getPointerColor` option to dynamically change the pointers color (#253). +- Add a `getPointerColor` option to dynamically change the pointers color (#253). # 2.7.1 (2016-02-06) ## Fix -* Fix high label positioning when size is different than the ceil one. +- Fix high label positioning when size is different than the ceil one. # 2.7.0 (2016-02-06) ## Features -* Add an `enforceStep` option (defaults to true) (#246). -* Add a `showSelectionBarFromValue` options (#250). -* Use jqLite html() method to display label values so the translate function can return formated content (#251). -* Pass a label string as third arg to the `translate` function to differentiate the labels (#252). +- Add an `enforceStep` option (defaults to true) (#246). +- Add a `showSelectionBarFromValue` options (#250). +- Use jqLite html() method to display label values so the translate function can return formated content (#251). +- Pass a label string as third arg to the `translate` function to differentiate the labels (#252). ## Fix -* Improve combined label position and show only one value if min==max (#245). +- Improve combined label position and show only one value if min==max (#245). # 2.6.0 (2016-01-31) ## Features -* Add a `noSwitching` option to prevent the user from switching the min and max handles (#233). +- Add a `noSwitching` option to prevent the user from switching the min and max handles (#233). ## Bug fixes -* Refactor the internal `roundStep` function that was too strict (5d130f09d). +- Refactor the internal `roundStep` function that was too strict (5d130f09d). # 2.5.0 (2016-01-24) ## Features -* Add a `minRange` option to set a minimal range (#231). -* Pass the slider values to the `onStart`, `onChange` and `onEnd` callbacks. -* Rollback and improve the callback changes brought with 2.4.1 that were no applying the last update to the scope anymore. +- Add a `minRange` option to set a minimal range (#231). +- Pass the slider values to the `onStart`, `onChange` and `onEnd` callbacks. +- Rollback and improve the callback changes brought with 2.4.1 that were no applying the last update to the scope anymore. # 2.4.1 (2016-01-15) ## Performance improvements -* Remove the $timeout call in the init method (#223). -* Remove the $timeout call in the onStart callback. -* Remove the $timeout call in the onChange callback (#229). +- Remove the \$timeout call in the init method (#223). +- Remove the \$timeout call in the onStart callback. +- Remove the \$timeout call in the onChange callback (#229). # 2.4.0 (2015-12-30) ## Features -* Add an `enforceRange` options to round the `rzSliderModel` and `rzSliderHigh` to the slider range even when modified from outside the slider.(#208). -* Add a `ticksTooltip` option used to display a tooltip when a tick is hovered (#209). -* Add an `onlyBindHandles` option to only bind events on slider handles (#212). -* Add a `showSelectionBarEnd` option to display the selection bar after the value (#214). +- Add an `enforceRange` options to round the `rzSliderModel` and `rzSliderHigh` to the slider range even when modified from outside the slider.(#208). +- Add a `ticksTooltip` option used to display a tooltip when a tick is hovered (#209). +- Add an `onlyBindHandles` option to only bind events on slider handles (#212). +- Add a `showSelectionBarEnd` option to display the selection bar after the value (#214). ## Bug fixes -* Fix reset of maxH element (#204). -* Change the watchers order to prevent unwanted model modifications (#207). +- Fix reset of maxH element (#204). +- Change the watchers order to prevent unwanted model modifications (#207). # 2.3.0 (2015-12-22) ## Features -* Add keyboard support (activated by default with `keyboardSupport` set to true) (#191). -* Add a `draggableRangeOnly` options (#203). +- Add keyboard support (activated by default with `keyboardSupport` set to true) (#191). +- Add a `draggableRangeOnly` options (#203). # 2.2.0 (2015-12-17) ## Features -* Add a `getSelectionBarColor` option to dynamically change the selection bar color (#197). +- Add a `getSelectionBarColor` option to dynamically change the selection bar color (#197). ## Bug fixes -* Fix negative float values rendering (#190). +- Fix negative float values rendering (#190). # 2.1.0 (2015-11-29) ## Features -* Add a `vertical` options to display vertical sliders (#185). -* Pass the options.id to the onStart, onChange and onEnd callbacks (#182). -* Force labels to stay contained within element containing slider (#175). +- Add a `vertical` options to display vertical sliders (#185). +- Pass the options.id to the onStart, onChange and onEnd callbacks (#182). +- Force labels to stay contained within element containing slider (#175). ## Bug fixes -* add vendor-prefix to `display: flex` used by ticks (#160). +- add vendor-prefix to `display: flex` used by ticks (#160). # 2.0.0 (2015-11-12) ## Breaking changes -* All attributes except `rzSliderModel` and `rzSliderHigh` are moved to `rzSliderOptions`. (See the new documentation in ReadMe) +- All attributes except `rzSliderModel` and `rzSliderHigh` are moved to `rzSliderOptions`. (See the new documentation in ReadMe) ## Features -* Add a `rzSliderOptions` attribute to pass options to the slider. -* Add a `RzSliderOptions.options()` method to set global options. -* Add a `scale` option to fix sliders displayed in an element that uses `transform: scale(0.5)`. -* Add a `stepsArray` option (#163) -* Add an `id` option that is passed to the translate function as second arg (#161) -* Add a `ticksValuesTooltip` option that is used to display a tooltip on the ticks values (requires angular-ui bootstrap). +- Add a `rzSliderOptions` attribute to pass options to the slider. +- Add a `RzSliderOptions.options()` method to set global options. +- Add a `scale` option to fix sliders displayed in an element that uses `transform: scale(0.5)`. +- Add a `stepsArray` option (#163) +- Add an `id` option that is passed to the translate function as second arg (#161) +- Add a `ticksValuesTooltip` option that is used to display a tooltip on the ticks values (requires angular-ui bootstrap). # 1.1.0 (2015-11-07) ## Features -* Configurable update interval (#153) +- Configurable update interval (#153) ## Bug fixes -* Update floor label so that it hides correctly when using single slider. (#155) -* Fix ticks values when step is a float. -* Remove the delta checking in updateLowHandle because it leads to hard-to-debug bugs. +- Update floor label so that it hides correctly when using single slider. (#155) +- Fix ticks values when step is a float. +- Remove the delta checking in updateLowHandle because it leads to hard-to-debug bugs. # 1.0.0 (2015-10-13) -* Rename the NPM package from jusas-angularjs-slider to angularjs-slider because jusas was added by mistake during a PR.- Start to use semantic versioning. +- Rename the NPM package from jusas-angularjs-slider to angularjs-slider because jusas was added by mistake during a PR.- Start to use semantic versioning. # 0.1.36 (2015-10-12) ## Features -* Separate the LESS variables from the main file to ease versioning of local customisations. +- Separate the LESS variables from the main file to ease versioning of local customisations. # 0.1.35 (2015-10-08) ## Features -* Add enabled/disabled option for slider: `rz-slider-disabled="boolean"` +- Add enabled/disabled option for slider: `rz-slider-disabled="boolean"` # 0.1.34 (2015-10-03) ## Features -* Support ticks for range sliders and slider with always visible bars. +- Support ticks for range sliders and slider with always visible bars. # 0.1.33 (2015-10-02) ## Features -* Add a `rzSliderShowTicks` to show a tick on each step. -* Add a `rzSliderShowTicksValue` to show a tick and its value on each step. +- Add a `rzSliderShowTicks` to show a tick on each step. +- Add a `rzSliderShowTicksValue` to show a tick and its value on each step. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 94bfe68..73b2fc3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,16 +10,16 @@ This project use [Prettier](https://github.com/prettier/prettier) for its code f To contribute to the project, please follow these steps: -1. Get approval for the idea by filing an issue and talking with me about the changes -2. Fork the repo -3. Make a branch for your change -4. Run `npm install` -5. Run `npm run test` -6. Make your changes -7. Test your changes (if you need a new test file, please copy the `test-template.js` file in the tests/specs folder.) -8. Run `npm run build` to generate the dist files -9. Run `git add -A` to add your changes -10. Run `npm run commit` (**Do not** use `git commit`) - follow the prompts to create your git message +1. Get approval for the idea by filing an issue and talking with me about the changes +2. Fork the repo +3. Make a branch for your change +4. Run `yarn` +5. Run `yarn test` +6. Make your changes +7. Test your changes (if you need a new test file, please copy the `test-template.js` file in the tests/specs folder.) +8. Run `yarn build` to generate the dist files +9. Run `git add -A` to add your changes +10. Run `yarn commit` (**Do not** use `git commit`) - follow the prompts to create your git message 11. Push your changes with `git push` 12. Create the Pull Request (a demo showing what the PR does is always good so you can fork [this fiddle](http://jsfiddle.net/cwhgLcjv/)) 13. If there are several commits, please [rebase](https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request) and [squash](https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request#squash-your-changes) everything to only get one commit. diff --git a/Gruntfile.js b/Gruntfile.js index 1724ba9..8d403f2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -59,7 +59,7 @@ module.exports = function(grunt) { removeScriptTypeAttributes: true, removeStyleLinkTypeAttributes: true, }, - module: 'rzModule', + module: 'rzSlider', url: function(url) { return url.replace('src/', '') }, diff --git a/README.md b/README.md index 81bde8f..d75b95d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ ## AngularJS 1.X slider directive with no external dependencies +Looking for an Angular version (> 1.X)? We got you covered: https://github.com/angular-slider/ngx-slider (Thanks [@piotrdz](https://github.com/piotrdz) :heart: )! + +
+ Status: ![Maintenance](https://img.shields.io/maintenance/support-only/2017.svg?style=flat-square) [![npm version](https://img.shields.io/npm/v/angularjs-slider.svg?style=flat-square)](https://www.npmjs.com/package/angularjs-slider) @@ -12,18 +16,18 @@ Links: [![Join the chat at https://gitter.im/rzajac/angularjs-slider](https://img.shields.io/badge/GITTER-join%20chat-1dce73.svg?style=flat-square)](https://gitter.im/rzajac/angularjs-slider?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) -> I'm looking for a maintainer for this project. I have lost my [Open Source Stamina](https://medium.com/@kentcdodds/open-source-stamina-dafd063f9932#.sfay5wlzp) for this project and I will probably not push any code to this project anymore (unless, I find some motivation later). I will try to merge pull requests if some are submitted, but only if they are really clean. +> I'm looking for a maintainer for this project. I have lost my [Open Source Stamina](https://kentcdodds.com/blog/open-source-stamina) for this project and I will probably not push any code to this project anymore (unless, I find some motivation later). I will try to merge pull requests if some are submitted, but only if they are really clean. Slider directive implementation for AngularJS 1.X, without any dependencies: [http://angular-slider.github.io/angularjs-slider](http://angular-slider.github.io/angularjs-slider/index.html). -* Mobile friendly -* Fast -* Well documented -* Customizable -* Simple to use -* Keyboard support -* Compatibility with jQuery Lite, ie. with full jQuery ( Thanks Jusas! https://github.com/Jusas) -* Supports right to left +- Mobile friendly +- Fast +- Well documented +- Customizable +- Simple to use +- Keyboard support +- Compatibility with jQuery Lite, ie. with full jQuery ( Thanks Jusas! https://github.com/Jusas) +- Supports right to left **Horizontal** @@ -38,14 +42,14 @@ Slider directive implementation for AngularJS 1.X, without any dependencies: [ht ## Examples -* **Simple example for single slider:** [http://jsfiddle.net/cwhgLcjv](http://jsfiddle.net/cwhgLcjv/) -* **Simple example for double slider:** [http://jsfiddle.net/ye1kpfrj](http://jsfiddle.net/ye1kpfrj/) -* **Various examples:** [http://angular-slider.github.io/angularjs-slider](http://angular-slider.github.io/angularjs-slider/index.html) -* **Same examples with live code:** https://jsfiddle.net/ValentinH/954eve2L/ +- **Simple example for single slider:** [http://jsfiddle.net/ValentinH/qjvxn4fc/](http://jsfiddle.net/ValentinH/qjvxn4fc/) +- **Simple example for double slider:** [http://jsfiddle.net/ValentinH/hnyL2axs/](http://jsfiddle.net/ValentinH/hnyL2axs/) +- **Various examples:** [http://angular-slider.github.io/angularjs-slider](http://angular-slider.github.io/angularjs-slider/index.html) +- **Same examples with live code:** https://jsfiddle.net/ValentinH/954eve2L/ ## Reporting issues -Make sure the report is accompanied by a reproducible demo. The ideal demo is created by forking [our standard jsFiddle](http://jsfiddle.net/cwhgLcjv/), adding your own code and stripping it down to an absolute minimum needed to demonstrate the bug. +Make sure the report is accompanied by a reproducible demo. The ideal demo is created by forking [our standard jsFiddle](http://jsfiddle.net/ValentinH/qjvxn4fc/), adding your own code and stripping it down to an absolute minimum needed to demonstrate the bug. ## Common issues @@ -66,9 +70,9 @@ vm.refreshSlider = function() { if you get some flickering issues, you can try to replace to `$timeout` call by `$scope.$$postDigest` as suggested by @maknapp in [this issue](https://github.com/angular-slider/angularjs-slider/issues/79#issuecomment-219213647). -**ng-show-example**: http://jsfiddle.net/3jjye1cL/ +**ng-show-example**: http://jsfiddle.net/ValentinH/nzL6ax43/ -**UI-Boostrap tabs example**: http://jsfiddle.net/0f7sd7dw/ +**UI-Boostrap tabs example**: http://jsfiddle.net/ValentinH/bo23er5w/ ### Decimal value can't be typed in an input field linked to the slider @@ -84,6 +88,12 @@ By default, the slider value is always rounded to the nearest step. A side effec npm i angularjs-slider ``` +or + +``` +yarn add angularjs-slider +``` + #### Typescript Support Typescript definition files are provided with this project. To use them, be sure you have the angular type definition peer dependency installed. @@ -106,23 +116,23 @@ or Directly use (replace `X.X.X` by the version you want to use): -* `https://cdnjs.cloudflare.com/ajax/libs/angularjs-slider/X.X.X/rzslider.min.js` -* `https://cdnjs.cloudflare.com/ajax/libs/angularjs-slider/X.X.X/rzslider.min.css` +- `https://cdnjs.cloudflare.com/ajax/libs/angularjs-slider/X.X.X/rzslider.min.js` +- `https://cdnjs.cloudflare.com/ajax/libs/angularjs-slider/X.X.X/rzslider.min.css` ## Project integration ### Imports ```html - + - + ``` ### Module ```javascript -angular.module('yourApp', ['rzModule']) +angular.module('yourApp', ['rzSlider']) ``` ### Single slider @@ -209,11 +219,11 @@ $scope.slider = { The following variables are available in the template as scope variables. -* `floorLabel`: The value set to `floor` in `rz-slider-options` -* `ceilLabel`: The value set to `ceil` in `rz-slider-options` -* `modelLabel`: The value set to `rz-slider-model` -* `highLabel`: The value set to `rz-slider-high` -* `cmbLabel`: The text shown when the two handlers are close to each other. (e.g. "30-40") +- `floorLabel`: The value set to `floor` in `rz-slider-options` +- `ceilLabel`: The value set to `ceil` in `rz-slider-options` +- `modelLabel`: The value set to `rz-slider-model` +- `highLabel`: The value set to `rz-slider-high` +- `cmbLabel`: The text shown when the two handlers are close to each other. (e.g. "30-40") The library replaces the HTML contents of label elements in the template by default, if you want to stop this behaviour and tweak label HTML on your own, you need to set `no-label-injection` class on the elements you're customizing. @@ -233,6 +243,8 @@ The default options are: precision: 0, minLimit: null, maxLimit: null, + restrictedRange: null, + skipRestrictedRangesWithArrowKeys: null, minRange: null, maxRange: null, pushRange: false, @@ -275,6 +287,7 @@ The default options are: reversedControls: false, boundPointerLabels: true, mergeRangeLabelsIfSame: false, + labelOverlapSeparator: ' - ', customTemplateScope: null, logScale: false, customValueToPosition: null, @@ -283,7 +296,8 @@ The default options are: ariaLabel: null, ariaLabelledBy: null, ariaLabelHigh: null, - ariaLabelledByHigh: null + ariaLabelledByHigh: null, + disableAnimation: false } ``` @@ -293,12 +307,16 @@ The default options are: **step** - _Number (defaults to 1)_: Step between each value. -**precision** - _Number (defaults to 0)_: The precision to display values with. The `toFixed()` is used internally for this. +**precision** - _Number (defaults to 0)_: The precision to display values with (number of decimals to be displayed). The `toFixed()` is used internally for this. **minLimit** - _Number (defaults to null)_: The minimum value authorized on the slider. **maxLimit** - _Number (defaults to null)_: The maximum value authorized on the slider. +**restrictedRange** - _Object (defaults to null)_: Has two _Number_ properties, _from_ and _to_ that determine the bounds of an area that is not authorized for values. Can also use an array. _Applies to range slider only._ + +**skipRestrictedRangesWithArrowKeys** - _Boolean (defaults to null)_: Set to true to skip restricted ranges with arrow keys. + **minRange** - _Number (defaults to null)_: The minimum range authorized on the slider. _Applies to range slider only._ **maxRange** - _Number (defaults to null)_: The maximum range authorized on the slider. _Applies to range slider only._ @@ -308,11 +326,11 @@ The default options are: **translate** - _Function(value, sliderId, label)_: 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 +- _'model'_: the model label +- _'high'_: the high label +- _'floor'_: the floor label +- _'ceil'_: the ceil label +- _'tick-value'_: the ticks labels For example if you want to display dollar amounts instead of just numbers: @@ -393,7 +411,7 @@ Just pass an array with each slider value and that's it; the floor, ceil and ste **showTicksValues** - _Boolean or Number (defaults to false)_: Set to true to display a tick and the step value for each step of the slider. Set a number to display ticks and the step value at intermediate positions. This number corresponds to the step between each tick. -**ticksArray** - _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** - _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. It also supports the `{ value: 0, legend: 'Bad' }` format to display a legend for each tick. **ticksTooltip** - _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. @@ -413,6 +431,8 @@ Just pass an array with each slider value and that's it; the floor, ceil and ste **mergeRangeLabelsIfSame** - _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". +**labelOverlapSeparator** - _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: ' .. '`. + **onStart** - _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. **onChange** - _Function(sliderId, modelValue, highValue, pointerType)_: 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. @@ -426,21 +446,21 @@ _Changing this value at runtime is not currently supported._ **keyboardSupport** - _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 +- Left/bottom arrows: -1 +- Right/top arrows: +1 +- Page-down: -10% +- Page-up: +10% +- Home: minimum value +- End: maximum value **reversedControls** - _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 +- Right/top arrows: -1 +- Left/bottom arrows: +1 +- Page-up: -10% +- Page-down: +10% +- End: minimum value +- Home: maximum value **customTemplateScope** - _Object (default to null)_: The properties defined in this object will be exposed in the slider template under `custom.X`. @@ -458,12 +478,14 @@ For custom scales: **ariaLabelledBy and ariaLabelledByHigh** - _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. +**disableAnimation** - _Boolean (defaults to false)_: Set to true to disable slider animation. + ## Change default options If you want the change the default options for all the sliders displayed in your application, you can set them using the `RzSliderOptions.options()` method: ```js -angular.module('App', ['rzModule']).run(function(RzSliderOptions) { +angular.module('App', ['rzSlider']).run(function(RzSliderOptions) { // show ticks for all sliders RzSliderOptions.options({ showTicks: true }) }) diff --git a/bower.json b/bower.json index 806f600..e1e88c1 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angularjs-slider", - "version": "6.4.4", + "version": "7.0.1", "homepage": "https://github.com/angular-slider/angularjs-slider", "authors": [ "Rafal Zajac ", diff --git a/demo/demo.js b/demo/demo.js index 38c723d..0911e87 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -1,4 +1,4 @@ -var app = angular.module('rzSliderDemo', ['rzModule', 'ui.bootstrap']) +var app = angular.module('rzSliderDemo', ['rzSlider', 'ui.bootstrap']) app.controller('MainCtrl', function($scope, $rootScope, $timeout, $uibModal) { //Minimal slider config @@ -51,6 +51,37 @@ app.controller('MainCtrl', function($scope, $rootScope, $timeout, $uibModal) { }, } + $scope.restrictedRangeSlider = { + minValue: 10, + maxValue: 90, + options: { + restrictedRange: { + from: 30, + to: 70, + }, + floor: 0, + ceil: 100, + step: 1, + }, + } + + // Restricted range with multiple array and the feature skipRestrictedRangesWithArrowKeys + $scope.multipleRestrictedRangeSlider = { + minValue: 10, + maxValue: 90, + options: { + restrictedRange: [ + { from: 20, to: 30 }, + { from: 50, to: 60 }, + { from: 75, to: 85 }, + ], + skipRestrictedRangesWithArrowKeys: true, + floor: 0, + ceil: 100, + step: 1, + }, + } + //Range slider with minRange and maxRange config $scope.minMaxRangeSlider = { minValue: 40, @@ -450,11 +481,6 @@ app.controller('MainCtrl', function($scope, $rootScope, $timeout, $uibModal) { floor: 0, ceil: 10, vertical: true, - showSelectionBarEnd: true, - selectionBarGradient: { - from: 'white', - to: '#0db9f0', - }, }, } $scope.verticalSlider2 = { @@ -464,10 +490,6 @@ app.controller('MainCtrl', function($scope, $rootScope, $timeout, $uibModal) { floor: 0, ceil: 100, vertical: true, - selectionBarGradient: { - from: 'white', - to: '#0db9f0', - }, }, } $scope.verticalSlider3 = { @@ -644,6 +666,7 @@ app.controller('MainCtrl', function($scope, $rootScope, $timeout, $uibModal) { disabled: false, showTicks: false, showTicksValues: false, + vertical: false, }, } $scope.toggleHighValue = function() { diff --git a/demo/directiveInCustomTemplate.html b/demo/directiveInCustomTemplate.html index a2d001a..6009f92 100644 --- a/demo/directiveInCustomTemplate.html +++ b/demo/directiveInCustomTemplate.html @@ -1,8 +1,17 @@
+ + + + + + - - - + + + + + + {{floorLabel}} diff --git a/demo/index.html b/demo/index.html index b65f575..59c8798 100644 --- a/demo/index.html +++ b/demo/index.html @@ -54,6 +54,27 @@

Range slider with min limit set to 10 and max limit set to 90

> +
+

Range slider with restricted area from 30 to 70

+ +
+ +
+

Range slider with multiple restricted area from 20 to 30, 50 to 60 and 75 to 85 +
+ and the feature that skip restricted ranges with arrow keys +

+ +
+

Range slider with minimum range of 10 and maximum of 50

Slider with all options demo


- +
+
, Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - +/*! angularjs-slider - v7.1.0 - + (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - https://github.com/angular-slider/angularjs-slider - - 2018-01-22 */ + 2022-05-26 */ .rzslider { position: relative; display: inline-block; @@ -15,6 +15,10 @@ user-select: none; } +.rzslider.noanimate * { + transition: none !important; +} + .rzslider.with-legend { margin-bottom: 40px; } @@ -64,6 +68,7 @@ padding-top: 16px; margin-top: -16px; box-sizing: border-box; + transition: all linear 0.3s; } .rzslider .rz-draggable { @@ -95,6 +100,13 @@ 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 { @@ -105,6 +117,7 @@ cursor: pointer; background-color: #0db9f0; border-radius: 16px; + transition: all linear 0.3s; } .rzslider .rz-pointer:after { @@ -135,10 +148,12 @@ padding: 1px 3px; color: #55637d; cursor: default; + transition: all linear 0.3s; } .rzslider .rz-bubble.rz-limit { color: #55637d; + transition: none; } .rzslider .rz-ticks { @@ -169,6 +184,7 @@ cursor: pointer; background: #d8e0f3; border-radius: 50%; + transition: background-color linear 0.3s; } .rzslider .rz-tick.rz-selected { @@ -178,8 +194,7 @@ .rzslider .rz-tick-value { position: absolute; top: -30px; - -webkit-transform: translate(-50%, 0); - transform: translate(-50%, 0); + transform: translate(-50%, 0); } .rzslider .rz-tick-legend { @@ -187,8 +202,7 @@ top: 24px; max-width: 50px; white-space: normal; - -webkit-transform: translate(-50%, 0); - transform: translate(-50%, 0); + transform: translate(-50%, 0); } .rzslider.rz-vertical { @@ -251,8 +265,7 @@ .rzslider.rz-vertical .rz-tick-value { top: auto; left: 24px; - -webkit-transform: translate(0, -28%); - transform: translate(0, -28%); + transform: translate(0, -28%); } .rzslider.rz-vertical .rz-tick-legend { @@ -260,8 +273,7 @@ right: 24px; max-width: none; white-space: nowrap; - -webkit-transform: translate(0, -28%); - transform: translate(0, -28%); + transform: translate(0, -28%); } .rzslider.rz-vertical .rz-ticks-values-under .rz-tick-value { @@ -269,4 +281,4 @@ bottom: auto; left: auto; } -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ6c2xpZGVyLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O2NBR2M7QUFDZDtFQUNFLG1CQUFtQjtFQUNuQixzQkFBc0I7RUFDdEIsWUFBWTtFQUNaLFlBQVk7RUFDWixzQkFBc0I7RUFDdEIsdUJBQXVCO0VBQ3ZCLDBCQUFrQjtLQUFsQix1QkFBa0I7TUFBbEIsc0JBQWtCO1VBQWxCLGtCQUFrQjtDQUNuQjs7QUFFRDtFQUNFLG9CQUFvQjtDQUNyQjs7QUFFRDtFQUNFLG9CQUFvQjtDQUNyQjs7QUFFRDtFQUNFLG9CQUFvQjtFQUNwQiwwQkFBMEI7Q0FDM0I7O0FBRUQ7RUFDRSxvQkFBb0I7Q0FDckI7O0FBRUQ7RUFDRSxvQkFBb0I7Q0FDckI7O0FBRUQ7R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4gIGJvdHRvbTogYXV0bztcbiAgbGVmdDogYXV0bztcbn0iXX0= */ \ No newline at end of file diff --git a/dist/rzslider.d.ts b/dist/rzslider.d.ts index 9fc6185..e9ec697 100644 --- a/dist/rzslider.d.ts +++ b/dist/rzslider.d.ts @@ -25,7 +25,14 @@ declare module "angular" { minLimit?: number; /** Number (defaults to null): The maximum value authorized on the slider. */ maxLimit?: number; - /** Number (defaults to null): The minimum range authorized on the slider. Applies to range slider only. */ + /** + * 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 } | Array<{from: number, to: number}>; + /** Number (defaults to null): The minimum range authorized on the slider. Applies to range slider only. Can also use an array.*/ + skipRestrictedRangesWithArrowKeys?: boolean + /** Set to true to skip restricted ranges with arrow keys. */ minRange?: number; /** Number (defaults to null): The maximum range authorized on the slider. Applies to range slider only. */ maxRange?: number; @@ -70,7 +77,7 @@ declare module "angular" { * {value: 10, legend: 'Legend for 10'} // the display value will be 10 and a legend will be displayed under the corresponding tick. * ] */ - stepsArray?: any[]; + stepsArray?: number[] | Array<{value: number; legend?: string}>; /** * 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). @@ -126,8 +133,8 @@ declare module "angular" { 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[]; + /** 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. It also supports the { value: 0, legend: 'Bad' } format to display a legend for each tick. */ + ticksArray?: number[] | Array<{value: number; legend?: string}>; /** 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. */ @@ -146,6 +153,8 @@ declare module "angular" { 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; /** @@ -201,6 +210,8 @@ declare module "angular" { 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; + /** Boolean (defaults to false): Set to true to disable slider animation. */ + disableAnimation?: boolean; } } } diff --git a/dist/rzslider.js b/dist/rzslider.js index f84bdb1..c8fdfd5 100644 --- a/dist/rzslider.js +++ b/dist/rzslider.js @@ -1,7 +1,7 @@ -/*! angularjs-slider - v6.4.3 - - (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - +/*! angularjs-slider - v7.1.0 - + (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - https://github.com/angular-slider/angularjs-slider - - 2018-01-22 */ + 2022-05-26 */ /*jslint unparam: true */ /*global angular: false, console: false, define, module */ ;(function(root, factory) { @@ -27,7 +27,7 @@ })(this, function(angular) { 'use strict' var module = angular - .module('rzModule', []) + .module('rzSlider', []) .factory('RzSliderOptions', function() { var defaultOptions = { floor: 0, @@ -36,6 +36,8 @@ precision: 0, minRange: null, maxRange: null, + restrictedRange: null, + skipRestrictedRangesWithArrowKeys: null, pushRange: false, minLimit: null, maxLimit: null, @@ -71,6 +73,7 @@ enforceRange: false, noSwitching: false, onlyBindHandles: false, + disableAnimation: false, onStart: null, onChange: null, onEnd: null, @@ -78,6 +81,7 @@ reversedControls: false, boundPointerLabels: true, mergeRangeLabelsIfSame: false, + labelOverlapSeparator: ' - ', customTemplateScope: null, logScale: false, customValueToPosition: null, @@ -95,7 +99,7 @@ * `options({})` allows global configuration of all sliders in the * application. * - * var app = angular.module( 'App', ['rzModule'], function( RzSliderOptions ) { + * var app = angular.module( 'App', ['rzSlider'], function( RzSliderOptions ) { * // show ticks for all sliders * RzSliderOptions.options( { showTicks: true } ); * }); @@ -330,6 +334,11 @@ */ 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 @@ -370,6 +379,7 @@ this.setDisabledState() this.calcViewDimensions() this.setMinAndMax() + this.updateRestrictionBar() this.addAccessibility() this.updateCeilLab() this.updateFloorLab() @@ -384,6 +394,10 @@ this.initHasRun = true + if (this.options.disableAnimation) { + this.sliderElem.addClass('noanimate') + } + // Watch for changes to the model thrLow = rzThrottle(function() { self.onLowHandleChange() @@ -507,8 +521,8 @@ }, /* - * Reflow the slider when the low handle changes (called with throttle) - */ + * Reflow the slider when the low handle changes (called with throttle) + */ onLowHandleChange: function() { this.syncLowValue() if (this.range) this.syncHighValue() @@ -523,8 +537,8 @@ }, /* - * Reflow the slider when the high handle changes (called with throttle) - */ + * Reflow the slider when the high handle changes (called with throttle) + */ onHighHandleChange: function() { this.syncLowValue() this.syncHighValue() @@ -591,6 +605,9 @@ if (this.options.vertical) { this.positionProperty = 'bottom' this.dimensionProperty = 'height' + } else { + this.positionProperty = 'left' + this.dimensionProperty = 'width' } if (this.options.customTemplateScope) @@ -625,6 +642,7 @@ * @returns {undefined} */ resetSlider: function() { + this.resetLabelsValue() this.manageElementsStyle() this.addAccessibility() this.setMinAndMax() @@ -634,6 +652,7 @@ this.manageEventsBindings() this.setDisabledState() this.calcViewDimensions() + this.updateRestrictionBar() this.refocusPointerIfNeeded() }, @@ -647,6 +666,40 @@ } }, + /** + * Check if the restrictedRange option using multiple or not + * + * Run only once during initialization and only in case 4 + * + * @returns {undefined} + */ + + ensureRestrictedBarIsArray: function(elem) { + var jElem = angular.element(elem) + this.restrictedBar = [] + if (this.options.restrictedRange) { + // this.options.restrictedRange converting to an array even if it's not entered as array. + this.options.restrictedRange = !Array.isArray( + this.options.restrictedRange + ) + ? [this.options.restrictedRange] + : this.options.restrictedRange + this.restrictedBar[0] = jElem + var mainDiv = elem.parentElement + for (var i = 1; i < this.options.restrictedRange.length; i++) { + var sp = document.createElement('span') + sp.setAttribute('class', 'rz-bar-wrapper') + sp.innerHTML = + '' + mainDiv.appendChild(sp) + this.restrictedBar[i] = angular.element(sp) + } + } else { + elem.style.visibility = 'hidden' + this.restrictedBar = null + } + }, + /** * Set the slider children to variables for easy access * @@ -675,27 +728,30 @@ this.selBar = jElem break case 4: - this.minH = jElem + this.ensureRestrictedBarIsArray(elem) break case 5: - this.maxH = jElem + this.minH = jElem break case 6: - this.flrLab = jElem + this.maxH = jElem break case 7: - this.ceilLab = jElem + this.flrLab = jElem break case 8: - this.minLab = jElem + this.ceilLab = jElem break case 9: - this.maxLab = jElem + this.minLab = jElem break case 10: - this.cmbLab = jElem + this.maxLab = jElem break case 11: + this.cmbLab = jElem + break + case 12: this.ticks = jElem break } @@ -752,6 +808,16 @@ this.leftOutSelBar, !this.range || !this.options.showOuterSelectionBars ) + + // this.restrictedBar is everytime an array + for (var r in this.restrictedBar) { + if (this.restrictedBar[r]) + this.alwaysHide( + this.restrictedBar[r], + !this.options.restrictedRange[r] + ) + } + this.alwaysHide( this.rightOutSelBar, !this.range || !this.options.showOuterSelectionBars @@ -761,7 +827,11 @@ this.fullBar.addClass('rz-transparent') } - if (this.options.vertical) this.sliderElem.addClass('rz-vertical') + 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') @@ -808,6 +878,14 @@ 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) }, /** @@ -927,8 +1005,11 @@ ) this.minH.attr('tabindex', '0') else this.minH.attr('tabindex', '') - if (this.options.vertical) + 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) @@ -944,6 +1025,7 @@ 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) @@ -1025,12 +1107,19 @@ 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, @@ -1063,7 +1152,7 @@ } } if (self.getLegend) { - var legend = self.getLegend(value, self.options.id) + legend = self.getLegend(value, self.options.id) if (legend) tick.legend = legend } return tick @@ -1304,6 +1393,35 @@ 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) { + this.options.restrictedRange = !Array.isArray( + this.options.restrictedRange + ) + ? [this.options.restrictedRange] + : this.options.restrictedRange + for (var i in this.options.restrictedRange) { + var from = this.valueToPosition( + this.options.restrictedRange[i].from + ), + to = this.valueToPosition(this.options.restrictedRange[i].to) + dimension = Math.abs(to - from) + position = this.options.rightToLeft + ? to + this.handleHalfDim + : from + this.handleHalfDim + this.setDimension(this.restrictedBar[i], dimension) + this.setPosition(this.restrictedBar[i], position) + } + } + }, + /** * Update slider selection bar, combined label and range label * @@ -1378,8 +1496,12 @@ : 0, reversed = (offset - position > 0) ^ isSelectionBarFromRight, direction = this.options.vertical - ? reversed ? 'bottom' : 'top' - : reversed ? 'left' : 'right' + ? reversed + ? 'bottom' + : 'top' + : reversed + ? 'left' + : 'right' this.scope.barStyle = { backgroundImage: 'linear-gradient(to ' + @@ -1473,8 +1595,8 @@ labelVal = lowTr } else { labelVal = this.options.rightToLeft - ? highTr + ' - ' + lowTr - : lowTr + ' - ' + highTr + ? highTr + this.options.labelOverlapSeparator + lowTr + : lowTr + this.options.labelOverlapSeparator + highTr } this.translateFn(labelVal, this.cmbLab, 'cmb', false) @@ -1583,6 +1705,13 @@ return pos }, + resetPosition: function(elem) { + elem.css({ + left: null, + bottom: null, + }) + }, + /** * Get element width/height depending on whether slider is horizontal or vertical * @@ -1774,9 +1903,8 @@ 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 - else - //reverse in rtl - return position > this.minH.rzsp ? this.minH : this.maxH + //reverse in rtl + else return position > this.minH.rzsp ? this.minH : this.maxH }, /** @@ -1948,6 +2076,7 @@ ehEnd, eventNames = this.getEventNames(event) + event.stopPropagation() event.preventDefault() // We have to do this in case the HTML where the sliders are on @@ -1997,6 +2126,12 @@ * @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) { @@ -2043,6 +2178,10 @@ * @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 @@ -2097,6 +2236,55 @@ } }, + /** + * Skip restricted range function when arrow keys use + * + * @param {number} currentValue value of the slider + * @param {number} key arrow key used + * + * @returns {number} currentValue value of the slider + */ + + skipRestrictedRanges: function(key, currentValue) { + if ( + this.options.restrictedRange && + Array.isArray(this.options.restrictedRange) + ) { + for (var i in this.options.restrictedRange) { + var range = this.options.restrictedRange[i] + // if it first or last value + if ( + (range.from === 0 && + currentValue === 0 && + [37, 40].includes(key)) || // LEFT or DOWN + (range.to >= + this.options.restrictedRange[ + this.options.restrictedRange.length - 1 + ].to && + currentValue >= + this.options.restrictedRange[ + this.options.restrictedRange.length - 1 + ].to && + [38, 39].includes(key)) // UP or RIGHT + ) { + return currentValue + } + if (range.to > currentValue && currentValue > range.from) { + if ( + Math.abs(range.to - currentValue) > + Math.abs(range.from - currentValue) + ) { + currentValue = range.to + } else { + currentValue = range.from + } + } + } + } + + return currentValue + }, + /** * Key actions helper function * @@ -2142,9 +2330,9 @@ }, onKeyboardEvent: function(event) { - var currentValue = this[this.tracking], - keyCode = event.keyCode || event.which, - keys = { + var keyCode = event.keyCode || event.which + var currentValue = this[this.tracking] + var keys = { 38: 'UP', 40: 'DOWN', 37: 'LEFT', @@ -2168,6 +2356,9 @@ var self = this $timeout(function() { var newValue = self.roundStep(self.sanitizeValue(action)) + newValue = self.options.skipRestrictedRangesWithArrowKeys + ? self.skipRestrictedRanges(keyCode, newValue) + : newValue if (!self.options.draggableRangeOnly) { self.positionTrackingHandle(newValue) } else { @@ -2289,6 +2480,12 @@ * @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, @@ -2367,6 +2564,7 @@ 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) @@ -2454,6 +2652,34 @@ return newValue }, + applyRestrictedRange: function(newValue) { + for (var i in this.options.restrictedRange) { + if ( + this.options.restrictedRange[i] != null && + newValue > this.options.restrictedRange[i].from && + newValue < this.options.restrictedRange[i].to + ) { + var halfWidth = + (this.options.restrictedRange[i].to - + this.options.restrictedRange[i].from) / + 2 + if (this.tracking === 'lowValue') { + return newValue > + this.options.restrictedRange[i].from + halfWidth + ? this.options.restrictedRange[i].to + : this.options.restrictedRange[i].from + } + if (this.tracking === 'highValue') { + return newValue < this.options.restrictedRange[i].to - halfWidth + ? this.options.restrictedRange[i].from + : this.options.restrictedRange[i].to + } + } + } + + return newValue + }, + applyPushRange: function(newValue) { var difference = this.tracking === 'lowValue' @@ -2652,7 +2878,7 @@ 'use strict'; $templateCache.put('rzSliderTpl.html', - "
  • {{ t.value }} {{ t.legend }}
" + "
  • {{ t.value }} {{ t.legend }}
" ); }]); diff --git a/dist/rzslider.min.css b/dist/rzslider.min.css index fca827b..ab1f8c9 100644 --- a/dist/rzslider.min.css +++ b/dist/rzslider.min.css @@ -1,2 +1,2 @@ -/*! angularjs-slider - v6.4.3 - (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - https://github.com/angular-slider/angularjs-slider - 2018-01-22 */ -.rzslider{position:relative;display:inline-block;width:100%;height:4px;margin:35px 0 15px 0;vertical-align:middle;user-select:none}.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}.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}.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}.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}.rzslider .rz-bubble.rz-limit{color:#55637d}.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%}.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 +/*! angularjs-slider - v7.1.0 - (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - https://github.com/angular-slider/angularjs-slider - 2022-05-26 */ +.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/dist/rzslider.min.js b/dist/rzslider.min.js index a7b806f..e0e5927 100644 --- a/dist/rzslider.min.js +++ b/dist/rzslider.min.js @@ -1,3 +1,3 @@ -/*! angularjs-slider - v6.4.3 - (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - https://github.com/angular-slider/angularjs-slider - 2018-01-22 */ -!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("rzModule",[]).factory("RzSliderOptions",function(){var b={floor:0,ceil:null,step:1,precision:0,minRange:null,maxRange: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,onStart:null,onChange:null,onEnd:null,rightToLeft:!1,reversedControls:!1,boundPointerLabels:!0,mergeRangeLabelsIfSame:!1,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.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.addAccessibility(),this.updateCeilLab(),this.updateFloorLab(),this.initHandles(),this.manageEventsBindings(),this.scope.$on("reCalcViewDimensions",f),a.element(d).on("resize",f),this.initHasRun=!0,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.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.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 a=this.options.ticksArray||this.getTicksArray(),b=this.options.vertical?"translateY":"translateX",c=this;this.options.rightToLeft&&a.reverse(),this.scope.ticks=a.map(function(a){var d=c.valueToPosition(a);c.options.vertical&&(d=c.maxPos-d);var e=b+"("+Math.round(d)+"px)",f={selected:c.isTickSelected(a),style:{"-webkit-transform":e,"-moz-transform":e,"-o-transform":e,"-ms-transform":e,transform:e}};if(f.selected&&c.options.getSelectionBarColor&&(f.style["background-color"]=c.getSelectionBarColor()),!f.selected&&c.options.getTickColor&&(f.style["background-color"]=c.getTickColor(a)),c.options.ticksTooltip&&(f.tooltip=c.options.ticksTooltip(a),f.tooltipPlacement=c.options.vertical?"right":"top"),(c.options.showTicksValues===!0||a%c.options.showTicksValues===0)&&(f.value=c.getDisplayValue(a,"tick-value"),c.options.ticksValuesTooltip&&(f.valueTooltip=c.options.ticksValuesTooltip(a),f.valueTooltipPlacement=c.options.vertical?"right":"top")),c.getLegend){var g=c.getLegend(a,c.options.id);g&&(f.legend=g)}return f})}},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},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+" - "+b:b+" - "+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},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){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),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},applyPushRange:function(a){var b="lowValue"===this.tracking?this.highValue-a:a-this.lowValue,c=null!==this.options.minRange?this.options.minRange:this.options.step,d=this.options.maxRange;return c>b?("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 +/*! angularjs-slider - v7.1.0 - (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - https://github.com/angular-slider/angularjs-slider - 2022-05-26 */ +!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,skipRestrictedRangesWithArrowKeys: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;d',d.appendChild(f),this.restrictedBar[e]=a.element(f)}}else b.style.visibility="hidden",this.restrictedBar=null},initElemHandles:function(){a.forEach(this.sliderElem.children(),function(b,c){var d=a.element(b);switch(c){case 0:this.leftOutSelBar=d;break;case 1:this.rightOutSelBar=d;break;case 2:this.fullBar=d;break;case 3:this.selBar=d;break;case 4:this.ensureRestrictedBarIsArray(b);break;case 5:this.minH=d;break;case 6:this.maxH=d;break;case 7:this.flrLab=d;break;case 8:this.ceilLab=d;break;case 9:this.minLab=d;break;case 10:this.maxLab=d;break;case 11:this.cmbLab=d;break;case 12:this.ticks=d}},this),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},manageElementsStyle:function(){this.range?this.maxH.css("display",""):this.maxH.css("display","none"),this.alwaysHide(this.flrLab,this.options.showTicksValues||this.options.hideLimitLabels),this.alwaysHide(this.ceilLab,this.options.showTicksValues||this.options.hideLimitLabels);var a=this.options.showTicksValues&&!this.intermediateTicks;this.alwaysHide(this.minLab,a||this.options.hidePointerLabels),this.alwaysHide(this.maxLab,a||!this.range||this.options.hidePointerLabels),this.alwaysHide(this.cmbLab,a||!this.range||this.options.hidePointerLabels),this.alwaysHide(this.selBar,!this.range&&!this.options.showSelectionBar),this.alwaysHide(this.leftOutSelBar,!this.range||!this.options.showOuterSelectionBars);for(var b in this.restrictedBar)this.restrictedBar[b]&&this.alwaysHide(this.restrictedBar[b],!this.options.restrictedRange[b]);this.alwaysHide(this.rightOutSelBar,!this.range||!this.options.showOuterSelectionBars),this.range&&this.options.showOuterSelectionBars&&this.fullBar.addClass("rz-transparent"),this.options.vertical?this.sliderElem.addClass("rz-vertical"):this.sliderElem.removeClass("rz-vertical"),this.options.draggableRange?this.selBar.addClass("rz-draggable"):this.selBar.removeClass("rz-draggable"),this.intermediateTicks&&this.options.showTicksValues&&this.ticks.addClass("rz-ticks-values-under")},alwaysHide:function(a,b){a.rzAlwaysHide=b,b?this.hideEl(a):this.showEl(a)},manageEventsBindings:function(){this.options.disabled||this.options.readOnly?this.unbindEvents():this.bindEvents()},setDisabledState:function(){this.options.disabled?this.sliderElem.attr("disabled","disabled"):this.sliderElem.attr("disabled",null)},resetLabelsValue:function(){this.minLab.rzsv=void 0,this.maxLab.rzsv=void 0,this.flrLab.rzsv=void 0,this.ceilLab.rzsv=void 0,this.cmbLab.rzsv=void 0,this.resetPosition(this.flrLab),this.resetPosition(this.ceilLab),this.resetPosition(this.cmbLab),this.resetPosition(this.minLab),this.resetPosition(this.maxLab)},initHandles:function(){this.updateLowHandle(this.valueToPosition(this.lowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.highValue)),this.updateSelectionBar(),this.range&&this.updateCmbLabel(),this.updateTicksScale()},translateFn:function(a,b,c,d){d=void 0===d?!0:d;var e="",f=!1,g=b.hasClass("no-label-injection");d?(this.options.stepsArray&&!this.options.bindIndexForStepsArray&&(a=this.getStepValue(a)),e=String(this.customTrFn(a,this.options.id,c))):e=String(a),(void 0===b.rzsv||b.rzsv.length!==e.length||b.rzsv.length>0&&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){this.options.restrictedRange=Array.isArray(this.options.restrictedRange)?this.options.restrictedRange:[this.options.restrictedRange];for(var c in this.options.restrictedRange){var d=this.valueToPosition(this.options.restrictedRange[c].from),e=this.valueToPosition(this.options.restrictedRange[c].to);b=Math.abs(e-d),a=this.options.rightToLeft?e+this.handleHalfDim:d+this.handleHalfDim,this.setDimension(this.restrictedBar[c],b),this.setPosition(this.restrictedBar[c],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)},skipRestrictedRanges:function(a,b){if(this.options.restrictedRange&&Array.isArray(this.options.restrictedRange))for(var c in this.options.restrictedRange){var d=this.options.restrictedRange[c];if(0===d.from&&0===b&&[37,40].includes(a)||d.to>=this.options.restrictedRange[this.options.restrictedRange.length-1].to&&b>=this.options.restrictedRange[this.options.restrictedRange.length-1].to&&[38,39].includes(a))return b;d.to>b&&b>d.from&&(b=Math.abs(d.to-b)>Math.abs(d.from-b)?d.to:d.from)}return b},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=a.keyCode||a.which,d=this[this.tracking],e={38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",33:"PAGEUP",34:"PAGEDOWN",36:"HOME",35:"END"},f=this.getKeyActions(d),g=e[c],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(a=i.options.skipRestrictedRangesWithArrowKeys?i.skipRestrictedRanges(c,a):a,i.options.draggableRangeOnly){var b,d,e=i.highValue-i.lowValue;"lowValue"===i.tracking?(b=a,d=a+e,d>i.maxValue&&(d=i.maxValue,b=d-e)):(d=a,b=a-e,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){for(var b in this.options.restrictedRange)if(null!=this.options.restrictedRange[b]&&a>this.options.restrictedRange[b].from&&athis.options.restrictedRange[b].from+c?this.options.restrictedRange[b].to:this.options.restrictedRange[b].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/dist/rzslider.scss b/dist/rzslider.scss index 1410c90..5f60607 100644 --- a/dist/rzslider.scss +++ b/dist/rzslider.scss @@ -1,7 +1,7 @@ -/*! angularjs-slider - v6.4.3 - - (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - +/*! angularjs-slider - v7.1.0 - + (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - https://github.com/angular-slider/angularjs-slider - - 2018-01-22 */ + 2022-05-26 */ .rzslider { position: relative; display: inline-block; @@ -15,6 +15,10 @@ user-select: none; } +.rzslider.noanimate * { + transition: none !important; +} + .rzslider.with-legend { margin-bottom: 40px; } @@ -64,6 +68,7 @@ padding-top: 16px; margin-top: -16px; box-sizing: border-box; + transition: all linear 0.3s; } .rzslider .rz-draggable { @@ -95,6 +100,13 @@ 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 { @@ -105,6 +117,7 @@ cursor: pointer; background-color: #0db9f0; border-radius: 16px; + transition: all linear 0.3s; } .rzslider .rz-pointer:after { @@ -135,10 +148,12 @@ padding: 1px 3px; color: #55637d; cursor: default; + transition: all linear 0.3s; } .rzslider .rz-bubble.rz-limit { color: #55637d; + transition: none; } .rzslider .rz-ticks { @@ -169,6 +184,7 @@ cursor: pointer; background: #d8e0f3; border-radius: 50%; + transition: background-color linear 0.3s; } .rzslider .rz-tick.rz-selected { @@ -178,8 +194,7 @@ .rzslider .rz-tick-value { position: absolute; top: -30px; - -webkit-transform: translate(-50%, 0); - transform: translate(-50%, 0); + transform: translate(-50%, 0); } .rzslider .rz-tick-legend { @@ -187,8 +202,7 @@ top: 24px; max-width: 50px; white-space: normal; - -webkit-transform: translate(-50%, 0); - transform: translate(-50%, 0); + transform: translate(-50%, 0); } .rzslider.rz-vertical { @@ -251,8 +265,7 @@ .rzslider.rz-vertical .rz-tick-value { top: auto; left: 24px; - -webkit-transform: translate(0, -28%); - transform: translate(0, -28%); + transform: translate(0, -28%); } .rzslider.rz-vertical .rz-tick-legend { @@ -260,8 +273,7 @@ right: 24px; max-width: none; white-space: nowrap; - -webkit-transform: translate(0, -28%); - transform: translate(0, -28%); + transform: translate(0, -28%); } .rzslider.rz-vertical .rz-ticks-values-under .rz-tick-value { @@ -269,4 +281,4 @@ bottom: auto; left: auto; } -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ6c2xpZGVyLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O2NBR2M7QUFDZDtFQUNFLG1CQUFtQjtFQUNuQixzQkFBc0I7RUFDdEIsWUFBWTtFQUNaLFlBQVk7RUFDWixzQkFBc0I7RUFDdEIsdUJBQXVCO0VBQ3ZCLDBCQUFrQjtLQUFsQix1QkFBa0I7TUFBbEIsc0JBQWtCO1VBQWxCLGtCQUFrQjtDQUNuQjs7QUFFRDtFQUNFLG9CQUFvQjtDQUNyQjs7QUFFRDtFQUNFLG9CQUFvQjtDQUNyQjs7QUFFRDtFQUNFLG9CQUFvQjtFQUNwQiwwQkFBMEI7Q0FDM0I7O0FBRUQ7RUFDRSxvQkFBb0I7Q0FDckI7O0FBRUQ7RUFDRSxvQkFBb0I7Q0FDckI7O0FBRUQ7RUFDRSxvQkFBb0I7Q0FDckI7O0FBRUQ7RUFDRSxvQkFBb0I7Q0FDckI7O0FBRUQ7RUFDRSxtQ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template.md deleted file mode 100644 index b99c3b9..0000000 --- a/issue_template.md +++ /dev/null @@ -1,12 +0,0 @@ -### Steps to reproduce -1. -2. -3. - -Demo: http://jsfiddle.net/cwhgLcjv/ (fork this example and update the link) - -### Expected behaviour -Tell us what should happen - -### Actual behaviour -Tell us what happens instead diff --git a/package.json b/package.json index f8cc8c3..104e3ba 100644 --- a/package.json +++ b/package.json @@ -1,30 +1,34 @@ { "name": "angularjs-slider", - "version": "6.4.4", - "description": - "AngularJS slider directive with no external dependencies. Mobile friendly!.", + "version": "7.1.0", + "description": "AngularJS slider directive with no external dependencies. Mobile friendly!.", "main": "dist/rzslider.js", "types": "dist/rzslider.d.ts", "repository": { "type": "git", "url": "https://github.com/angular-slider/angularjs-slider" }, - "keywords": ["angular", "slider"], + "keywords": [ + "angular", + "slider" + ], + "publishConfig": { + "registry": "https://registry.npmjs.org/" + }, "scripts": { "start": "http-server ./ -c-1", "commit": "git-cz", "build": "grunt", "test": "grunt test", "report-coverage": "cat ./tests/coverage/lcov.info | codecov", - "format": - "prettier --single-quote --no-semi --write \"{src,tests,demo}/{,!(lib)/**}/*.{js,less,css}\"", - "precommit": "lint-staged", + "format": "prettier --write \"{src,tests,demo}/{,!(lib)/**}/*.{js,less,css}\"", + "precommit": "npm run build && git add dist && lint-staged", "e2e": "npm start & cypress run", "cypress:open": "cypress open" }, "lint-staged": { "{src,tests,demo}/{,!(lib)/**}/*.{js,less,css}": [ - "prettier --single-quote --no-semi --write", + "prettier --write", "git add" ] }, @@ -42,6 +46,7 @@ "cz-conventional-changelog": "^1.1.5", "grunt": "~0.4.2", "grunt-angular-templates": "^0.5.7", + "grunt-cli": "^1.2.0", "grunt-contrib-concat": "^0.5.1", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-mincss": "~0.3.2", @@ -67,15 +72,16 @@ "lint-staged": "^4.0.3", "mocha": "^3.1.2", "phantomjs": "^1.9.19", - "prettier": "^1.10.2", + "prettier": "^1.13.7", "recess": "~1.1.9", "sinon": "^1.17.2" }, - "author": - "Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu ", + "author": "Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu ", "license": "MIT", "readmeFilename": "README.md", - "czConfig": { - "path": "node_modules/cz-conventional-changelog" + "config": { + "commitizen": { + "path": "node_modules/cz-conventional-changelog" + } } } diff --git a/rzslider.d.ts b/rzslider.d.ts index 9fc6185..e9ec697 100644 --- a/rzslider.d.ts +++ b/rzslider.d.ts @@ -25,7 +25,14 @@ declare module "angular" { minLimit?: number; /** Number (defaults to null): The maximum value authorized on the slider. */ maxLimit?: number; - /** Number (defaults to null): The minimum range authorized on the slider. Applies to range slider only. */ + /** + * 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 } | Array<{from: number, to: number}>; + /** Number (defaults to null): The minimum range authorized on the slider. Applies to range slider only. Can also use an array.*/ + skipRestrictedRangesWithArrowKeys?: boolean + /** Set to true to skip restricted ranges with arrow keys. */ minRange?: number; /** Number (defaults to null): The maximum range authorized on the slider. Applies to range slider only. */ maxRange?: number; @@ -70,7 +77,7 @@ declare module "angular" { * {value: 10, legend: 'Legend for 10'} // the display value will be 10 and a legend will be displayed under the corresponding tick. * ] */ - stepsArray?: any[]; + stepsArray?: number[] | Array<{value: number; legend?: string}>; /** * 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). @@ -126,8 +133,8 @@ declare module "angular" { 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[]; + /** 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. It also supports the { value: 0, legend: 'Bad' } format to display a legend for each tick. */ + ticksArray?: number[] | Array<{value: number; legend?: string}>; /** 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. */ @@ -146,6 +153,8 @@ declare module "angular" { 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; /** @@ -201,6 +210,8 @@ declare module "angular" { 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; + /** Boolean (defaults to false): Set to true to disable slider animation. */ + disableAnimation?: boolean; } } } diff --git a/src/rzSliderTpl.html b/src/rzSliderTpl.html index 5b7bba1..2431f3e 100644 --- a/src/rzSliderTpl.html +++ b/src/rzSliderTpl.html @@ -15,21 +15,25 @@ - + + + + + - + - + - + - + - + - + - +
  • @@ -37,4 +41,4 @@ {{ t.legend }}
- \ No newline at end of file + diff --git a/src/rzslider.js b/src/rzslider.js index 83c08e2..8b10560 100644 --- a/src/rzslider.js +++ b/src/rzslider.js @@ -31,7 +31,7 @@ })(this, function(angular) { 'use strict' var module = angular - .module('rzModule', []) + .module('rzSlider', []) .factory('RzSliderOptions', function() { var defaultOptions = { floor: 0, @@ -40,6 +40,8 @@ precision: 0, minRange: null, maxRange: null, + restrictedRange: null, + skipRestrictedRangesWithArrowKeys: null, pushRange: false, minLimit: null, maxLimit: null, @@ -75,6 +77,7 @@ enforceRange: false, noSwitching: false, onlyBindHandles: false, + disableAnimation: false, onStart: null, onChange: null, onEnd: null, @@ -82,6 +85,7 @@ reversedControls: false, boundPointerLabels: true, mergeRangeLabelsIfSame: false, + labelOverlapSeparator: ' - ', customTemplateScope: null, logScale: false, customValueToPosition: null, @@ -99,7 +103,7 @@ * `options({})` allows global configuration of all sliders in the * application. * - * var app = angular.module( 'App', ['rzModule'], function( RzSliderOptions ) { + * var app = angular.module( 'App', ['rzSlider'], function( RzSliderOptions ) { * // show ticks for all sliders * RzSliderOptions.options( { showTicks: true } ); * }); @@ -334,6 +338,11 @@ */ 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 @@ -374,6 +383,7 @@ this.setDisabledState() this.calcViewDimensions() this.setMinAndMax() + this.updateRestrictionBar() this.addAccessibility() this.updateCeilLab() this.updateFloorLab() @@ -388,6 +398,10 @@ this.initHasRun = true + if (this.options.disableAnimation) { + this.sliderElem.addClass('noanimate') + } + // Watch for changes to the model thrLow = rzThrottle(function() { self.onLowHandleChange() @@ -511,8 +525,8 @@ }, /* - * Reflow the slider when the low handle changes (called with throttle) - */ + * Reflow the slider when the low handle changes (called with throttle) + */ onLowHandleChange: function() { this.syncLowValue() if (this.range) this.syncHighValue() @@ -527,8 +541,8 @@ }, /* - * Reflow the slider when the high handle changes (called with throttle) - */ + * Reflow the slider when the high handle changes (called with throttle) + */ onHighHandleChange: function() { this.syncLowValue() this.syncHighValue() @@ -595,6 +609,9 @@ if (this.options.vertical) { this.positionProperty = 'bottom' this.dimensionProperty = 'height' + } else { + this.positionProperty = 'left' + this.dimensionProperty = 'width' } if (this.options.customTemplateScope) @@ -629,6 +646,7 @@ * @returns {undefined} */ resetSlider: function() { + this.resetLabelsValue() this.manageElementsStyle() this.addAccessibility() this.setMinAndMax() @@ -638,6 +656,7 @@ this.manageEventsBindings() this.setDisabledState() this.calcViewDimensions() + this.updateRestrictionBar() this.refocusPointerIfNeeded() }, @@ -651,6 +670,40 @@ } }, + /** + * Check if the restrictedRange option using multiple or not + * + * Run only once during initialization and only in case 4 + * + * @returns {undefined} + */ + + ensureRestrictedBarIsArray: function(elem) { + var jElem = angular.element(elem) + this.restrictedBar = [] + if (this.options.restrictedRange) { + // this.options.restrictedRange converting to an array even if it's not entered as array. + this.options.restrictedRange = !Array.isArray( + this.options.restrictedRange + ) + ? [this.options.restrictedRange] + : this.options.restrictedRange + this.restrictedBar[0] = jElem + var mainDiv = elem.parentElement + for (var i = 1; i < this.options.restrictedRange.length; i++) { + var sp = document.createElement('span') + sp.setAttribute('class', 'rz-bar-wrapper') + sp.innerHTML = + '' + mainDiv.appendChild(sp) + this.restrictedBar[i] = angular.element(sp) + } + } else { + elem.style.visibility = 'hidden' + this.restrictedBar = null + } + }, + /** * Set the slider children to variables for easy access * @@ -679,27 +732,30 @@ this.selBar = jElem break case 4: - this.minH = jElem + this.ensureRestrictedBarIsArray(elem) break case 5: - this.maxH = jElem + this.minH = jElem break case 6: - this.flrLab = jElem + this.maxH = jElem break case 7: - this.ceilLab = jElem + this.flrLab = jElem break case 8: - this.minLab = jElem + this.ceilLab = jElem break case 9: - this.maxLab = jElem + this.minLab = jElem break case 10: - this.cmbLab = jElem + this.maxLab = jElem break case 11: + this.cmbLab = jElem + break + case 12: this.ticks = jElem break } @@ -756,6 +812,16 @@ this.leftOutSelBar, !this.range || !this.options.showOuterSelectionBars ) + + // this.restrictedBar is everytime an array + for (var r in this.restrictedBar) { + if (this.restrictedBar[r]) + this.alwaysHide( + this.restrictedBar[r], + !this.options.restrictedRange[r] + ) + } + this.alwaysHide( this.rightOutSelBar, !this.range || !this.options.showOuterSelectionBars @@ -765,7 +831,11 @@ this.fullBar.addClass('rz-transparent') } - if (this.options.vertical) this.sliderElem.addClass('rz-vertical') + 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') @@ -812,6 +882,14 @@ 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) }, /** @@ -931,8 +1009,11 @@ ) this.minH.attr('tabindex', '0') else this.minH.attr('tabindex', '') - if (this.options.vertical) + 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) @@ -948,6 +1029,7 @@ 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) @@ -1029,12 +1111,19 @@ 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, @@ -1067,7 +1156,7 @@ } } if (self.getLegend) { - var legend = self.getLegend(value, self.options.id) + legend = self.getLegend(value, self.options.id) if (legend) tick.legend = legend } return tick @@ -1308,6 +1397,35 @@ 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) { + this.options.restrictedRange = !Array.isArray( + this.options.restrictedRange + ) + ? [this.options.restrictedRange] + : this.options.restrictedRange + for (var i in this.options.restrictedRange) { + var from = this.valueToPosition( + this.options.restrictedRange[i].from + ), + to = this.valueToPosition(this.options.restrictedRange[i].to) + dimension = Math.abs(to - from) + position = this.options.rightToLeft + ? to + this.handleHalfDim + : from + this.handleHalfDim + this.setDimension(this.restrictedBar[i], dimension) + this.setPosition(this.restrictedBar[i], position) + } + } + }, + /** * Update slider selection bar, combined label and range label * @@ -1382,8 +1500,12 @@ : 0, reversed = (offset - position > 0) ^ isSelectionBarFromRight, direction = this.options.vertical - ? reversed ? 'bottom' : 'top' - : reversed ? 'left' : 'right' + ? reversed + ? 'bottom' + : 'top' + : reversed + ? 'left' + : 'right' this.scope.barStyle = { backgroundImage: 'linear-gradient(to ' + @@ -1477,8 +1599,8 @@ labelVal = lowTr } else { labelVal = this.options.rightToLeft - ? highTr + ' - ' + lowTr - : lowTr + ' - ' + highTr + ? highTr + this.options.labelOverlapSeparator + lowTr + : lowTr + this.options.labelOverlapSeparator + highTr } this.translateFn(labelVal, this.cmbLab, 'cmb', false) @@ -1587,6 +1709,13 @@ return pos }, + resetPosition: function(elem) { + elem.css({ + left: null, + bottom: null, + }) + }, + /** * Get element width/height depending on whether slider is horizontal or vertical * @@ -1778,9 +1907,8 @@ 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 - else - //reverse in rtl - return position > this.minH.rzsp ? this.minH : this.maxH + //reverse in rtl + else return position > this.minH.rzsp ? this.minH : this.maxH }, /** @@ -1952,6 +2080,7 @@ ehEnd, eventNames = this.getEventNames(event) + event.stopPropagation() event.preventDefault() // We have to do this in case the HTML where the sliders are on @@ -2001,6 +2130,12 @@ * @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) { @@ -2047,6 +2182,10 @@ * @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 @@ -2101,6 +2240,55 @@ } }, + /** + * Skip restricted range function when arrow keys use + * + * @param {number} currentValue value of the slider + * @param {number} key arrow key used + * + * @returns {number} currentValue value of the slider + */ + + skipRestrictedRanges: function(key, currentValue) { + if ( + this.options.restrictedRange && + Array.isArray(this.options.restrictedRange) + ) { + for (var i in this.options.restrictedRange) { + var range = this.options.restrictedRange[i] + // if it first or last value + if ( + (range.from === 0 && + currentValue === 0 && + [37, 40].includes(key)) || // LEFT or DOWN + (range.to >= + this.options.restrictedRange[ + this.options.restrictedRange.length - 1 + ].to && + currentValue >= + this.options.restrictedRange[ + this.options.restrictedRange.length - 1 + ].to && + [38, 39].includes(key)) // UP or RIGHT + ) { + return currentValue + } + if (range.to > currentValue && currentValue > range.from) { + if ( + Math.abs(range.to - currentValue) > + Math.abs(range.from - currentValue) + ) { + currentValue = range.to + } else { + currentValue = range.from + } + } + } + } + + return currentValue + }, + /** * Key actions helper function * @@ -2146,9 +2334,9 @@ }, onKeyboardEvent: function(event) { - var currentValue = this[this.tracking], - keyCode = event.keyCode || event.which, - keys = { + var keyCode = event.keyCode || event.which + var currentValue = this[this.tracking] + var keys = { 38: 'UP', 40: 'DOWN', 37: 'LEFT', @@ -2172,6 +2360,9 @@ var self = this $timeout(function() { var newValue = self.roundStep(self.sanitizeValue(action)) + newValue = self.options.skipRestrictedRangesWithArrowKeys + ? self.skipRestrictedRanges(keyCode, newValue) + : newValue if (!self.options.draggableRangeOnly) { self.positionTrackingHandle(newValue) } else { @@ -2293,6 +2484,12 @@ * @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, @@ -2371,6 +2568,7 @@ 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) @@ -2458,6 +2656,34 @@ return newValue }, + applyRestrictedRange: function(newValue) { + for (var i in this.options.restrictedRange) { + if ( + this.options.restrictedRange[i] != null && + newValue > this.options.restrictedRange[i].from && + newValue < this.options.restrictedRange[i].to + ) { + var halfWidth = + (this.options.restrictedRange[i].to - + this.options.restrictedRange[i].from) / + 2 + if (this.tracking === 'lowValue') { + return newValue > + this.options.restrictedRange[i].from + halfWidth + ? this.options.restrictedRange[i].to + : this.options.restrictedRange[i].from + } + if (this.tracking === 'highValue') { + return newValue < this.options.restrictedRange[i].to - halfWidth + ? this.options.restrictedRange[i].from + : this.options.restrictedRange[i].to + } + } + } + + return newValue + }, + applyPushRange: function(newValue) { var difference = this.tracking === 'lowValue' diff --git a/src/rzslider.less b/src/rzslider.less index 2004fca..171bdfa 100644 --- a/src/rzslider.less +++ b/src/rzslider.less @@ -18,6 +18,10 @@ vertical-align: middle; user-select: none; + &.noanimate * { + transition: none !important; + } + &.with-legend { margin-bottom: @withLegendMargin; } @@ -57,11 +61,12 @@ .rz-bar-wrapper { left: 0; box-sizing: border-box; - margin-top: -@handleSize / 2; - padding-top: @handleSize / 2; + margin-top: (-@handleSize / 2); + padding-top: (@handleSize / 2); width: 100%; height: @handleSize; z-index: 1; + transition: all linear @animationDuration; } .rz-draggable { @@ -74,7 +79,7 @@ height: @barDimension; z-index: 1; background: @barNormalColor; - .rounded(@barDimension/2); + .rounded((@barDimension / 2)); } .rz-bar-wrapper.rz-transparent .rz-bar { @@ -90,30 +95,34 @@ .rz-selection { z-index: 2; background: @barFillColor; - .rounded(@barDimension/2); + .rounded((@barDimension / 2)); + transition: background-color linear @animationDuration; + } + + .rz-restricted { + z-index: 3; + background: @restrictedBarColor; + .rounded((@barDimension / 2)); } .rz-pointer { cursor: pointer; width: @handleSize; height: @handleSize; - top: -@handleSize/2 + @barDimension/2; + top: (-@handleSize / 2 + @barDimension / 2); background-color: @handleBgColor; z-index: 3; - .rounded(@handleSize/2); - // -webkit-transition:all linear 0.15s; - // -moz-transition:all linear 0.15s; - // -o-transition:all linear 0.15s; - // transition:all linear 0.15s; + .rounded((@handleSize / 2)); + transition: all linear @animationDuration; &:after { content: ''; width: @handlePointerSize; height: @handlePointerSize; position: absolute; - top: @handleSize/2 - @handlePointerSize/2; - left: @handleSize/2 - @handlePointerSize/2; - .rounded(@handlePointerSize/2); + top: (@handleSize / 2 - @handlePointerSize / 2); + left: (@handleSize / 2 - @handlePointerSize / 2); + .rounded((@handlePointerSize / 2)); background: @handleInnerColor; } &:hover:after { @@ -129,11 +138,13 @@ .rz-bubble { cursor: default; - bottom: @handleSize/2; + bottom: (@handleSize / 2); padding: @bubblePadding; color: @labelTextColor; + transition: all linear @animationDuration; &.rz-limit { color: @limitLabelTextColor; + transition: none; } } @@ -143,7 +154,7 @@ height: 0; position: absolute; left: 0; - top: -(@ticksHeight - @barDimension) / 2; + top: (-(@ticksHeight - @barDimension) / 2); margin: 0; z-index: 1; list-style: none; @@ -152,7 +163,7 @@ .rz-ticks-values-under { .rz-tick-value { top: auto; - bottom: @ticksValuePosition - 2; + bottom: (@ticksValuePosition - 2); } } @@ -166,7 +177,8 @@ position: absolute; top: 0; left: 0; - margin-left: @handleSize / 2 - @ticksWidth / 2; // for centering + margin-left: (@handleSize / 2 - @ticksWidth / 2); // for centering + transition: background-color linear @animationDuration; &.rz-selected { background: @selectedTicksColor; } @@ -203,8 +215,8 @@ .rz-bar-wrapper { top: auto; left: 0; - margin: 0 0 0 -@handleSize / 2; - padding: 0 0 0 @handleSize / 2; + margin: 0 0 0 (-@handleSize / 2); + padding: 0 0 0 (@handleSize / 2); height: 100%; width: @handleSize; } @@ -217,13 +229,13 @@ } .rz-pointer { - left: -@handleSize/2 + @barDimension/2 !important; + left: (-@handleSize / 2 + @barDimension / 2) !important; top: auto; bottom: 0; } .rz-bubble { - left: @handleSize/2 !important; + left: (@handleSize / 2) !important; margin-left: 3px; bottom: 0; } @@ -231,14 +243,14 @@ .rz-ticks { height: 100%; width: 0; - left: -(@ticksHeight - @barDimension) / 2; + left: (-(@ticksHeight - @barDimension) / 2); top: 0; z-index: 1; } .rz-tick { vertical-align: middle; margin-left: auto; - margin-top: @handleSize / 2 - @ticksWidth / 2; // for centering + margin-top: (@handleSize / 2 - @ticksWidth / 2); // for centering } .rz-tick-value { left: @ticksValuePositionOnVertical; diff --git a/src/variables.less b/src/variables.less index d442591..a8422a9 100644 --- a/src/variables.less +++ b/src/variables.less @@ -16,6 +16,7 @@ @barNormalColor: #d8e0f3; @barLeftOutSelectionColor: #df002d; @barRightOutSelectionColor: #03a688; +@restrictedBarColor: red; @ticksColor: @barNormalColor; @selectedTicksColor: @barFillColor; @@ -31,3 +32,5 @@ @barDimension: 4px; @withLegendMargin: 40px; + +@animationDuration: 0.3s; diff --git a/tests/specs/accessibility-test.js b/tests/specs/accessibility-test.js index 7a3d16e..ee0c0e0 100644 --- a/tests/specs/accessibility-test.js +++ b/tests/specs/accessibility-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/custom-template-test.js b/tests/specs/custom-template-test.js index e8cc456..060e655 100644 --- a/tests/specs/custom-template-test.js +++ b/tests/specs/custom-template-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/custom-tpl.html b/tests/specs/custom-tpl.html index d24132a..c9e921c 100644 --- a/tests/specs/custom-tpl.html +++ b/tests/specs/custom-tpl.html @@ -5,6 +5,9 @@ + + + test- {{floorLabel}} diff --git a/tests/specs/helper-functions-test.js b/tests/specs/helper-functions-test.js index 61b5575..307a15f 100644 --- a/tests/specs/helper-functions-test.js +++ b/tests/specs/helper-functions-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/helper.js b/tests/specs/helper.js index 69820ab..505d058 100644 --- a/tests/specs/helper.js +++ b/tests/specs/helper.js @@ -1,6 +1,6 @@ ;(function() { 'use strict' - var helperModule = angular.module('test-helper', ['rzModule', 'appTemplates']) + var helperModule = angular.module('test-helper', ['rzSlider', 'appTemplates']) helperModule.factory('TestHelper', function( RzSlider, diff --git a/tests/specs/keyboard-controls/draggableRangeOnly-range-slider-test.js b/tests/specs/keyboard-controls/draggableRangeOnly-range-slider-test.js index 363ac61..a439f06 100644 --- a/tests/specs/keyboard-controls/draggableRangeOnly-range-slider-test.js +++ b/tests/specs/keyboard-controls/draggableRangeOnly-range-slider-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -122,14 +125,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/keyboard-controls/range-slider-test.js b/tests/specs/keyboard-controls/range-slider-test.js index 51b94a9..4ec4315 100644 --- a/tests/specs/keyboard-controls/range-slider-test.js +++ b/tests/specs/keyboard-controls/range-slider-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -154,14 +157,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/keyboard-controls/single-slider-test.js b/tests/specs/keyboard-controls/single-slider-test.js index 057b4d6..e977f9d 100644 --- a/tests/specs/keyboard-controls/single-slider-test.js +++ b/tests/specs/keyboard-controls/single-slider-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -146,14 +149,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -253,14 +259,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -394,14 +403,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/keyboard-controls/specific-test.js b/tests/specs/keyboard-controls/specific-test.js index d4c861e..89d87dd 100644 --- a/tests/specs/keyboard-controls/specific-test.js +++ b/tests/specs/keyboard-controls/specific-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -267,14 +270,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/keyboard-controls/vertical-slider-test.js b/tests/specs/keyboard-controls/vertical-slider-test.js index 4a531a4..0a4a0bf 100644 --- a/tests/specs/keyboard-controls/vertical-slider-test.js +++ b/tests/specs/keyboard-controls/vertical-slider-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -61,14 +64,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -117,14 +123,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -175,14 +184,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/labels-test.js b/tests/specs/labels-test.js index 76956a8..30c3dcc 100644 --- a/tests/specs/labels-test.js +++ b/tests/specs/labels-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/mouse-controls/draggable-range-slider-horizontal-test.js b/tests/specs/mouse-controls/draggable-range-slider-horizontal-test.js index e45c24f..ae7630d 100644 --- a/tests/specs/mouse-controls/draggable-range-slider-horizontal-test.js +++ b/tests/specs/mouse-controls/draggable-range-slider-horizontal-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -229,14 +232,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/mouse-controls/draggableOnly-range-slider-horizontal-test.js b/tests/specs/mouse-controls/draggableOnly-range-slider-horizontal-test.js index 1314dfc..70d78b3 100644 --- a/tests/specs/mouse-controls/draggableOnly-range-slider-horizontal-test.js +++ b/tests/specs/mouse-controls/draggableOnly-range-slider-horizontal-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -168,14 +171,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/mouse-controls/minMaxLimit-range-slider-horizontal-test.js b/tests/specs/mouse-controls/minMaxLimit-range-slider-horizontal-test.js index e516459..6376be2 100644 --- a/tests/specs/mouse-controls/minMaxLimit-range-slider-horizontal-test.js +++ b/tests/specs/mouse-controls/minMaxLimit-range-slider-horizontal-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -71,14 +74,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/mouse-controls/minMaxLimit-single-slider-horizontal-test.js b/tests/specs/mouse-controls/minMaxLimit-single-slider-horizontal-test.js index 34b8cfb..f5654a6 100644 --- a/tests/specs/mouse-controls/minMaxLimit-single-slider-horizontal-test.js +++ b/tests/specs/mouse-controls/minMaxLimit-single-slider-horizontal-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -70,14 +73,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/mouse-controls/minMaxRange-noSwitching-range-slider-horizontal-test.js b/tests/specs/mouse-controls/minMaxRange-noSwitching-range-slider-horizontal-test.js index 9c9fc03..5f8184b 100644 --- a/tests/specs/mouse-controls/minMaxRange-noSwitching-range-slider-horizontal-test.js +++ b/tests/specs/mouse-controls/minMaxRange-noSwitching-range-slider-horizontal-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -126,14 +129,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/mouse-controls/minMaxRange-range-slider-horizontal-test.js b/tests/specs/mouse-controls/minMaxRange-range-slider-horizontal-test.js index e9e5de2..88789ed 100644 --- a/tests/specs/mouse-controls/minMaxRange-range-slider-horizontal-test.js +++ b/tests/specs/mouse-controls/minMaxRange-range-slider-horizontal-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -86,14 +89,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -150,14 +156,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/mouse-controls/noSwitching-range-slider-horizontal-test.js b/tests/specs/mouse-controls/noSwitching-range-slider-horizontal-test.js index 7f7d0b3..528f260 100644 --- a/tests/specs/mouse-controls/noSwitching-range-slider-horizontal-test.js +++ b/tests/specs/mouse-controls/noSwitching-range-slider-horizontal-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -82,14 +85,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/mouse-controls/onlyBindHandles-single-slider-horizontal-test.js b/tests/specs/mouse-controls/onlyBindHandles-single-slider-horizontal-test.js index 1368136..1db382a 100644 --- a/tests/specs/mouse-controls/onlyBindHandles-single-slider-horizontal-test.js +++ b/tests/specs/mouse-controls/onlyBindHandles-single-slider-horizontal-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -66,14 +69,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/mouse-controls/pushRange-range-slider-horizontal-test.js b/tests/specs/mouse-controls/pushRange-range-slider-horizontal-test.js index 911012d..d182637 100644 --- a/tests/specs/mouse-controls/pushRange-range-slider-horizontal-test.js +++ b/tests/specs/mouse-controls/pushRange-range-slider-horizontal-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/mouse-controls/range-slider-horizontal-test.js b/tests/specs/mouse-controls/range-slider-horizontal-test.js index 14a723f..bf8a05e 100644 --- a/tests/specs/mouse-controls/range-slider-horizontal-test.js +++ b/tests/specs/mouse-controls/range-slider-horizontal-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -46,6 +49,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.calledWith(helper.slider.minH).should.be.true event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -64,6 +68,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.called.should.be.false event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -79,6 +84,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.calledWith(helper.slider.maxH).should.be.true event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('highValue') expect(helper.slider.maxH.hasClass('rz-active')).to.be.true }) @@ -97,6 +103,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.called.should.be.false event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('highValue') expect(helper.slider.maxH.hasClass('rz-active')).to.be.true }) @@ -267,14 +274,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -308,6 +318,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.calledWith(helper.slider.minH).should.be.true event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -326,6 +337,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.called.should.be.false event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -341,6 +353,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.calledWith(helper.slider.maxH).should.be.true event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('highValue') expect(helper.slider.maxH.hasClass('rz-active')).to.be.true }) @@ -359,6 +372,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.called.should.be.false event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('highValue') expect(helper.slider.maxH.hasClass('rz-active')).to.be.true }) diff --git a/tests/specs/mouse-controls/range-slider-vertical-test.js b/tests/specs/mouse-controls/range-slider-vertical-test.js index f1d2f59..b22f9ed 100644 --- a/tests/specs/mouse-controls/range-slider-vertical-test.js +++ b/tests/specs/mouse-controls/range-slider-vertical-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -47,6 +50,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.calledWith(helper.slider.minH).should.be.true event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -65,6 +69,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.called.should.be.false event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -80,6 +85,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.calledWith(helper.slider.maxH).should.be.true event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('highValue') expect(helper.slider.maxH.hasClass('rz-active')).to.be.true }) @@ -98,6 +104,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.called.should.be.false event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('highValue') expect(helper.slider.maxH.hasClass('rz-active')).to.be.true }) @@ -260,14 +267,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -302,6 +312,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.calledWith(helper.slider.minH).should.be.true event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -320,6 +331,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.called.should.be.false event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -335,6 +347,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.calledWith(helper.slider.maxH).should.be.true event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('highValue') expect(helper.slider.maxH.hasClass('rz-active')).to.be.true }) @@ -353,6 +366,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.called.should.be.false event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('highValue') expect(helper.slider.maxH.hasClass('rz-active')).to.be.true }) diff --git a/tests/specs/mouse-controls/restricted-range-slider-test.js b/tests/specs/mouse-controls/restricted-range-slider-test.js new file mode 100644 index 0000000..13e2b68 --- /dev/null +++ b/tests/specs/mouse-controls/restricted-range-slider-test.js @@ -0,0 +1,145 @@ +;(function() { + 'use strict' + + describe('Mouse controls - Restricted Range', function() { + var helper, RzSliderOptions, $rootScope, $timeout + + beforeEach(module('test-helper')) + + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) + + afterEach(function() { + helper.clean() + }) + + beforeEach(function() { + var sliderConf = { + min: 25, + max: 85, + options: { + floor: 0, + ceil: 100, + restrictedRange: { + from: 30, + to: 70, + }, + }, + } + helper.createRangeSlider(sliderConf) + }) + + afterEach(function() { + // to clean document listener + helper.fireMouseup() + }) + + it('should be able to modify minH below restrictedRange.from', function() { + helper.fireMousedown(helper.slider.minH, 0) + var attemptedValue = 25 + helper.moveMouseToValue(attemptedValue) + expect(helper.scope.slider.min).to.equal(25) + }) + + it('should not be able to modify minH above restrictedRange.from', function() { + helper.fireMousedown(helper.slider.minH, 0) + var attemptedValue = 40 + helper.moveMouseToValue(attemptedValue) + expect(helper.scope.slider.min).to.equal(30) + }) + + it('should be able to modify maxH above restrictedRange.to', function() { + helper.fireMousedown(helper.slider.maxH, 0) + var attemptedValue = 78 + helper.moveMouseToValue(attemptedValue) + expect(helper.scope.slider.max).to.equal(78) + }) + + it('should not be able to modify maxH below restrictedRange.to', function() { + helper.fireMousedown(helper.slider.maxH, 0) + var attemptedValue = 50 + helper.moveMouseToValue(attemptedValue) + expect(helper.scope.slider.max).to.equal(70) + }) + }) + + describe('Right to left Mouse controls - minLimit!=null && maxLimit!=null Range Horizontal', function() { + var helper, RzSliderOptions, $rootScope, $timeout + + beforeEach(module('test-helper')) + + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) + + afterEach(function() { + helper.clean() + }) + + beforeEach(function() { + var sliderConf = { + min: 45, + max: 55, + options: { + floor: 0, + ceil: 100, + restrictedRange: { + from: 30, + to: 70, + }, + rightToLeft: true, + }, + } + helper.createRangeSlider(sliderConf) + }) + afterEach(function() { + // to clean document listener + helper.fireMouseup() + }) + + it('should be able to modify minH below restrictedRange.from', function() { + helper.fireMousedown(helper.slider.minH, 0) + var attemptedValue = 25 + helper.moveMouseToValue(attemptedValue) + expect(helper.scope.slider.min).to.equal(25) + }) + + it('should not be able to modify minH above restrictedRange.from', function() { + helper.fireMousedown(helper.slider.minH, 0) + var attemptedValue = 40 + helper.moveMouseToValue(attemptedValue) + expect(helper.scope.slider.min).to.equal(30) + }) + + it('should be able to modify maxH above restrictedRange.to', function() { + helper.fireMousedown(helper.slider.maxH, 0) + var attemptedValue = 78 + helper.moveMouseToValue(attemptedValue) + expect(helper.scope.slider.max).to.equal(78) + }) + + it('should not be able to modify maxH below restrictedRange.to', function() { + helper.fireMousedown(helper.slider.maxH, 0) + var attemptedValue = 50 + helper.moveMouseToValue(attemptedValue) + expect(helper.scope.slider.max).to.equal(70) + }) + }) +})() diff --git a/tests/specs/mouse-controls/single-slider-horizontal-test.js b/tests/specs/mouse-controls/single-slider-horizontal-test.js index a3772e0..501cb28 100644 --- a/tests/specs/mouse-controls/single-slider-horizontal-test.js +++ b/tests/specs/mouse-controls/single-slider-horizontal-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -45,6 +48,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.calledWith(helper.slider.minH).should.be.true event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -63,6 +67,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.called.should.be.false event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -207,14 +212,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -247,6 +255,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.calledWith(helper.slider.minH).should.be.true event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -265,6 +274,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.called.should.be.false event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) diff --git a/tests/specs/mouse-controls/single-slider-vertical-test.js b/tests/specs/mouse-controls/single-slider-vertical-test.js index 9924dbf..897711a 100644 --- a/tests/specs/mouse-controls/single-slider-vertical-test.js +++ b/tests/specs/mouse-controls/single-slider-vertical-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -46,6 +49,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.calledWith(helper.slider.minH).should.be.true event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -64,6 +68,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.called.should.be.false event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -225,14 +230,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -266,6 +274,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.calledWith(helper.slider.minH).should.be.true event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) @@ -284,6 +293,7 @@ helper.slider.callOnStart.called.should.be.true helper.slider.focusElement.called.should.be.false event.preventDefault.called.should.be.true + event.stopPropagation.called.should.be.true expect(helper.slider.tracking).to.equal('lowValue') expect(helper.slider.minH.hasClass('rz-active')).to.be.true }) diff --git a/tests/specs/options-handling-test.js b/tests/specs/options-handling-test.js index 5567569..e64bc4d 100644 --- a/tests/specs/options-handling-test.js +++ b/tests/specs/options-handling-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -370,6 +373,7 @@ floor: 0, ceil: 10, showSelectionBar: true, + disableAnimation: true, }, } helper.createSlider(sliderConf) @@ -389,6 +393,7 @@ floor: 0, ceil: 10, showSelectionBarEnd: true, + disableAnimation: true, }, } helper.createSlider(sliderConf) @@ -415,6 +420,7 @@ floor: 0, ceil: 20, showSelectionBarFromValue: 10, + disableAnimation: true, }, } helper.createSlider(sliderConf) @@ -437,6 +443,7 @@ floor: 0, ceil: 20, showSelectionBarFromValue: 10, + disableAnimation: true, }, } helper.createSlider(sliderConf) @@ -598,6 +605,7 @@ options: { floor: 0, ceil: 10, + disableAnimation: true, }, } helper.createRangeSlider(sliderConf) @@ -1058,14 +1066,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -1237,6 +1248,7 @@ ceil: 10, showSelectionBar: true, rightToLeft: true, + disableAnimation: true, }, } helper.createSlider(sliderConf) @@ -1262,6 +1274,7 @@ ceil: 10, showSelectionBarEnd: true, rightToLeft: true, + disableAnimation: true, }, } helper.createSlider(sliderConf) @@ -1306,6 +1319,7 @@ ceil: 20, showSelectionBarFromValue: 10, rightToLeft: true, + disableAnimation: true, }, } helper.createSlider(sliderConf) @@ -1353,6 +1367,7 @@ options: { floor: 0, ceil: 10, + disableAnimation: true, }, rightToLeft: true, } @@ -1646,6 +1661,39 @@ parseInt(helper.slider.leftOutSelBar.css('left')) ) }) + + it('should use the default separator when labels overlap', function() { + helper.scope.slider.min = -1 + helper.scope.slider.max = 1 + helper.scope.slider.options.floor = -100 + helper.scope.slider.options.ceil = +100 + helper.scope.slider.options.step = 1 + helper.scope.slider.options.rightToLeft = false + helper.scope.$digest() + expect(helper.slider.cmbLab.text()).to.equal('-1 - 1') + }) + + it('should use the custom separator when labels overlap, and labelOverlapSeparator is set', function() { + helper.scope.slider.min = -1 + helper.scope.slider.max = 1 + helper.scope.slider.options.floor = -100 + helper.scope.slider.options.ceil = +100 + helper.scope.slider.options.step = 1 + helper.scope.slider.options.rightToLeft = false + helper.scope.slider.options.labelOverlapSeparator = ' .. ' + helper.scope.$digest() + expect(helper.slider.cmbLab.text()).to.equal('-1 .. 1') + }) + it('should use the custom separator when labels overlap, and labelOverlapSeparator is set, in RTL mode', function() { + helper.scope.slider.min = -1 + helper.scope.slider.max = 1 + helper.scope.slider.options.floor = -100 + helper.scope.slider.options.ceil = +100 + helper.scope.slider.options.step = 1 + helper.scope.slider.options.labelOverlapSeparator = ' .. ' + helper.scope.$digest() + expect(helper.slider.cmbLab.text()).to.equal('1 .. -1') + }) }) describe('options expression specific - ', function() { diff --git a/tests/specs/range-slider-init-test.js b/tests/specs/range-slider-init-test.js index ecba526..1d201dd 100644 --- a/tests/specs/range-slider-init-test.js +++ b/tests/specs/range-slider-init-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -33,7 +36,7 @@ }) it('should exist compiled and with correct config', function() { - expect(helper.element.find('span')).to.have.length(15) + expect(helper.element.find('span')).to.have.length(17) expect(helper.slider.range).to.be.true expect(helper.slider.valueRange).to.equal(100) expect(helper.slider.maxH.css('display')).to.equal('') diff --git a/tests/specs/rz-slider-options-test.js b/tests/specs/rz-slider-options-test.js index 76a8b18..03dafb4 100644 --- a/tests/specs/rz-slider-options-test.js +++ b/tests/specs/rz-slider-options-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/scale-test.js b/tests/specs/scale-test.js index 2f98744..e1824de 100644 --- a/tests/specs/scale-test.js +++ b/tests/specs/scale-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/single-slider-init-test.js b/tests/specs/single-slider-init-test.js index 4ff4406..35f6147 100644 --- a/tests/specs/single-slider-init-test.js +++ b/tests/specs/single-slider-init-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -32,7 +35,7 @@ }) it('should exist compiled and with correct config', function() { - expect(helper.element.find('span')).to.have.length(15) + expect(helper.element.find('span')).to.have.length(17) expect(helper.slider.range).to.be.false expect(helper.slider.valueRange).to.equal(100) expect(helper.slider.maxH.css('display')).to.equal('none') @@ -83,27 +86,25 @@ helper.slider.onLowHandleChange.called.should.be.true }) - it( - 'should call calcViewDimensions() on window resize event', - inject(function($window) { - sinon.spy(helper.slider, 'calcViewDimensions') - angular.element($window).triggerHandler('resize') - helper.slider.calcViewDimensions.called.should.be.true - }) - ) - - it( - 'should unregister all dom events on $destroy', - inject(function($window) { - sinon.spy(helper.slider, 'calcViewDimensions') - sinon.spy(helper.slider, 'unbindEvents') - - helper.scope.$broadcast('$destroy') - angular.element($window).triggerHandler('resize') - - helper.slider.calcViewDimensions.called.should.be.false - helper.slider.unbindEvents.called.should.be.true - }) - ) + it('should call calcViewDimensions() on window resize event', inject(function( + $window + ) { + sinon.spy(helper.slider, 'calcViewDimensions') + angular.element($window).triggerHandler('resize') + helper.slider.calcViewDimensions.called.should.be.true + })) + + it('should unregister all dom events on $destroy', inject(function( + $window + ) { + sinon.spy(helper.slider, 'calcViewDimensions') + sinon.spy(helper.slider, 'unbindEvents') + + helper.scope.$broadcast('$destroy') + angular.element($window).triggerHandler('resize') + + helper.slider.calcViewDimensions.called.should.be.false + helper.slider.unbindEvents.called.should.be.true + })) }) })() diff --git a/tests/specs/test-template.js b/tests/specs/test-template.js index 965c4c6..69f487b 100644 --- a/tests/specs/test-template.js +++ b/tests/specs/test-template.js @@ -11,14 +11,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() diff --git a/tests/specs/ticks-test.js b/tests/specs/ticks-test.js index 6fdcacd..4379fd1 100644 --- a/tests/specs/ticks-test.js +++ b/tests/specs/ticks-test.js @@ -6,14 +6,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean() @@ -260,6 +263,39 @@ expect(lastTick.text()).to.equal('100') }) + it('should create the correct number of ticks when ticksArray is used as array of objects', function() { + var sliderConf = { + value: 50, + options: { + floor: 0, + ceil: 100, + step: 10, + ticksArray: [ + { value: 0, legend: 'Bad' }, + { value: 50, legend: 'Average' }, + { value: 100, legend: 'Excellent' }, + ], + }, + } + helper.createSlider(sliderConf) + expect(helper.element[0].querySelectorAll('.rz-tick')).to.have.length(3) + expect( + helper.element[0].querySelectorAll('.rz-tick-value') + ).to.have.length(0) + + expect( + helper.element[0].querySelectorAll('.rz-tick-legend') + ).to.have.length(3) + var firstLegend = angular.element( + helper.element[0].querySelectorAll('.rz-tick-legend')[0] + ) + expect(firstLegend.text()).to.equal('Bad') + var lastLegend = angular.element( + helper.element[0].querySelectorAll('.rz-tick-legend')[2] + ) + expect(lastLegend.text()).to.equal('Excellent') + }) + it('should create the correct number of legend items when getLegend is defined', function() { var sliderConf = { value: 50, @@ -626,14 +662,17 @@ beforeEach(module('test-helper')) - beforeEach( - inject(function(TestHelper, _RzSliderOptions_, _$rootScope_, _$timeout_) { - helper = TestHelper - RzSliderOptions = _RzSliderOptions_ - $rootScope = _$rootScope_ - $timeout = _$timeout_ - }) - ) + beforeEach(inject(function( + TestHelper, + _RzSliderOptions_, + _$rootScope_, + _$timeout_ + ) { + helper = TestHelper + RzSliderOptions = _RzSliderOptions_ + $rootScope = _$rootScope_ + $timeout = _$timeout_ + })) afterEach(function() { helper.clean()