Commit graph

277 commits

Author SHA1 Message Date
Josh Johnson 8540d5aabd
Api changes (#515)
* Combine regexFilter and addItemFilter + minor tweaks

* Update tests to accomodate fixed dropdown notice

* Remove broken `toggleDropdown` method

* Unskip dropdown interaction tests

* Remove reference to removed method
2019-02-12 18:35:46 +00:00
Josh Johnson 55b356ec69
Add travis pipeline (#516)
* Update travis.yml

* Simplify ci pipeline

* Include css in bundle size check

* Set npm username via env var

* Specify branches

* Add build scripts

* Consistent ifs

* Add linting stage to pipeline

* Cache npm

* Cache cypress & npm folders + install using ci method

* Unignore package-lock
2019-02-12 18:04:50 +00:00
Glade ba09fb00e6 callback to filter items before adding (#485)
* Add item custom callback

* Minor unit test updates

* Test updates, Changed callback name to more clearly distinguish it's function

* Fix description wording in cypress

* Update README

* Updated filter item callback name to be addItemFilter
2019-02-11 22:56:21 +00:00
Josh Johnson 23e5e7674f Tweak doc page 2019-02-11 21:47:47 +00:00
Guilherme de Oliveira Costa 71a3131d3c Added custom properties to options
Added custom properties to options to be searchable on select.
2019-02-11 16:05:59 -02:00
Josh Johnson 5c9dfdf2db
Upgrade old packages (#508)
* Upgrade Webpack to v4

* Upgrade Mocha

* Export unminfied and minified version

* Add browserslistrc

* Remove core.js polyfills

* Run bundle size on pre push

* Run bundlesize last

* Update readme gzip side
2019-02-09 18:13:25 +00:00
Josh Johnson 437651411f
Fix render blocking (#456)
* Reapply changes from PR #310

* Version 4.1.1

* Update action name

* Update test

* Resolved broken test
2019-01-26 12:36:47 +00:00
Jeremy Hou 48b74a91bc fixes the 'invalid input type' check (#498) 2019-01-21 08:46:14 +00:00
Jeremy Hou 9c001487ba Fixes an issue where deepmerge concatenates array configs (#496) 2019-01-19 14:47:22 +00:00
Josh Johnson 826384b9d5
Fix set choice by value bug (#471)
* Resolve bug with setChoiceByValue not removing choice from dropdown

* 4.1.3

* Version 4.1.3
2018-11-25 12:48:49 +00:00
Josh Johnson c3e46e55aa
Fix form submission bug in firefox (#470)
* Fix form submission bug in firefox

* 4.1.1
2018-11-24 17:48:03 +00:00
Josh Johnson 496db95153 Disable input when loading remote data 2018-11-03 13:24:52 +00:00
Josh Johnson f3c0abef95 Add e2e tests to interact with dropdown 2018-11-03 12:26:02 +00:00
Josh Johnson feb2a15edc Disable at a later stage of intialising 2018-10-30 22:04:08 +00:00
Josh Johnson b0f3b28ef4 Do not open dropdown if element is disabled 2018-10-30 20:28:40 +00:00
Josh Johnson 798b49d565 Disable element if disabled attr passed 2018-10-30 20:21:52 +00:00
Josh Johnson 7e4347b183 Resolve issue with Firefox not selecting choices via enter key 2018-10-30 19:20:16 +00:00
Josh Johnson 608358a9f8 Fix bug where selected options were not being selected 2018-10-28 09:32:35 +00:00
Josh Johnson de71fb7ef4 Resolve issue with disable/enable methods 2018-10-27 20:16:46 +01:00
Leonard 8149db8436 Make it work in Internet Explorer (#434)
+ IE does not support multiple-parameter classList.add() /
  classList.remove(); Replace it with single-parameter calls
  https://caniuse.com/#feat=classlist
+ IE needs polyfills for Array.prototype.find / Array.prototype.includes
2018-10-27 16:26:52 +01:00
Josh Johnson 4193422cf6 Resolve an issue with disabling/enabling instances 2018-10-21 19:26:08 +01:00
Josh Johnson e07e14bd8f Add select multiple e2e tests 2018-10-13 16:38:51 +01:00
Josh Johnson 1f06a32b30 Resolve bug with text value 2018-10-13 15:49:44 +01:00
Josh Johnson 2f96c239ff Better organisation of e2e tests 2018-10-13 12:18:02 +01:00
Josh Johnson 81b2e23d0d Use test.html for testing + add additional tests 2018-10-11 19:33:19 +01:00
Josh Johnson 3319529b98 Seperate key methods into class methods 2018-10-09 13:17:11 +01:00
Josh Johnson 60d52a2d3b Check no unknown config keys are passed 2018-10-09 13:16:58 +01:00
Josh Johnson 4431a0ec23 Use deepmerge lib + store all defaults in DEFAULT_CONFIG 2018-10-09 12:43:25 +01:00
Josh Johnson 4824958e4d Make render method private 2018-10-09 12:26:47 +01:00
Ryan Mahoney 5e215907f4 expose new event that triggers when choice is highlighted 2018-07-03 09:51:18 +01:00
Josh Johnson 129d01c396 Amend copy 2018-05-29 20:39:40 +01:00
Josh Johnson 3886cbbd5c Minor tweaks 2018-05-29 20:30:58 +01:00
Josh Johnson 9ac62aec31 Codebeat fixes 2018-05-29 20:08:05 +01:00
Josh Johnson 38cc568341 Use objects for args where necessary 2018-05-29 19:55:33 +01:00
Josh Johnson bc2e0b8be0 Build 2018-05-29 15:47:45 +01:00
Josh Johnson 32f32703cb Use internal flag for enabling/disabling search 2018-05-29 15:46:30 +01:00
Josh Johnson 5a6c8142b9 Inverse focus calls when opening/closing dropdown 2018-05-29 15:08:43 +01:00
Josh Johnson 8a21c12482 Rename duplicateItems to duplicateItemsAllowed for clarity 2018-05-29 09:30:05 +01:00
Josh Johnson f286dbc653 Add util tests 2018-05-28 17:56:36 +01:00
Josh Johnson bfb6571ce9 Merge into latest 2018-05-28 16:22:22 +01:00
Josh Johnson 056ece0238 Run linter 2018-05-28 15:50:16 +01:00
Josh Johnson 179542897c
Merge branch 'develop' into develop 2018-05-28 15:47:27 +01:00
Josh Johnson 67e1940232 Avoid name conflict with stripHTML 2018-05-28 15:46:27 +01:00
Josh Johnson 9dbb2e9733 Rename stripHTML + cast values to string 2018-05-28 15:39:12 +01:00
Josh Johnson 8214eea7a9 Resolve conflict + add test 2018-05-28 15:33:13 +01:00
Tőrös Egon Richárd 6e45d3f9b0
Merge branch 'develop' into develop 2018-05-28 16:19:31 +02:00
Josh Johnson a023d92b35 Resolve conflict 2018-05-28 15:17:43 +01:00
Egon Richárd Tőrös 0cbf951845 Merge branch 'develop' of https://github.com/jshjohnson/Choices into develop 2018-05-28 16:13:55 +02:00
Josh Johnson 39beb20245 Remove pointless comments + minor tidying 2018-05-28 14:18:44 +01:00
Josh Johnson 804a4a442b Move scrolling logic into list component 2018-05-28 14:09:11 +01:00
Josh Johnson f9455b1a25 Install prettier + resolve linting issues 2018-05-28 13:55:44 +01:00
Josh Johnson a6bfdc0993 Refactor _scrollToChoice 2018-05-27 17:34:16 +01:00
Josh Johnson 1df8d81ae4 Refactor _canAddItem 2018-05-27 17:22:58 +01:00
Josh Johnson 9a9e7f7b25 Restructure style folders 2018-05-27 12:04:42 +01:00
Josh Johnson 257a038262 Use express for development + folder restructuring 2018-05-27 11:57:21 +01:00
Josh Johnson 831a79ea44 Move public assets into public foldeR 2018-05-25 14:00:27 +01:00
Josh Johnson 8f67de4844 Make event handlers private 2018-05-25 09:22:14 +01:00
Josh Johnson b3956db628 Export components from index file 2018-05-25 09:01:55 +01:00
Josh Johnson 579138f756 Remove unused utils 2018-05-25 08:58:07 +01:00
Josh Johnson 478df0fac1 Minor tweaks 2018-05-25 08:53:58 +01:00
Josh Johnson 25309c91fc Use dep for event polyfill 2018-05-25 08:53:50 +01:00
Josh Johnson 1608d815e9 Use core js for polyfills 2018-05-25 08:44:54 +01:00
Josh Johnson 62389ff744 More private variables 2018-05-24 09:22:07 +01:00
Josh Johnson 109a232171 Minor variable name change 2018-05-23 14:43:52 +01:00
Josh Johnson a591c32a24 Break out public functions into more private methods + housekeeping 2018-05-23 13:09:45 +01:00
Philipp Eichhorn 8ab0387857 perf: removed forced reflow ("layout thrashing") by reading testEl.offsetWidth in a separate animation frame 2018-05-22 15:19:00 +02:00
Philipp Eichhorn 92e968462c perf: removed forced reflow ("layout thrashing") by executing choiceList.scrollTo(0) in a separate animation frame 2018-05-22 13:46:24 +02:00
Josh Johnson d3a18e255b Destructure class args 2018-05-21 17:01:03 +01:00
Egon Richárd Tőrös ec061adc7c Merge branch 'develop' of https://github.com/jshjohnson/Choices into develop 2018-05-10 14:42:53 +02:00
Josh Johnson b3108835bb Use babel env config 2018-04-25 09:20:59 +01:00
Josh Johnson 18456153ff Remove redundant super calls 2018-04-25 09:16:02 +01:00
Josh Johnson 85c0a488cd
Add template tests (#387)
* Begun template tests

* Further tests

* Add further tests
2018-04-24 15:13:13 +01:00
Josh Johnson bf1eb3b8ac Seperate out element creation logic 2018-04-24 13:57:31 +01:00
Josh Johnson 54b8935aee Clearer store naming conventions 2018-04-24 13:52:13 +01:00
Josh Johnson f02abdaacf Final few store getters 2018-04-24 13:49:57 +01:00
Josh Johnson 80f4d929ac Further getters 2018-04-24 13:23:26 +01:00
Josh Johnson 152b740670 Use getters and setters appropriately 2018-04-24 12:54:45 +01:00
c5254061 c2fccdc398 Fix xss vulnerability(escape html in item label) 2018-04-18 11:05:21 +03:00
Andy Nutt 275295adc5 Remove inline styling (#306)
* Remove inline styling (#279)

- Remove the JS styling to prevent CSP violations.
- Add "display: none;" CSS rule for the default class "is-hidden".

* Increase the specificity of the hidden class (#279)

* Include "is-hidden" class in utils section of base style sheet (#279)

* Add top level selector for hiding Choices inputs (#279)
2018-03-27 15:02:19 +01:00
Josh Johnson 82c389bc56
Install husky (#373)
* Add prepush hook and install husky
2018-03-27 10:48:01 +01:00
c5254061 38cf04b0d8 Fix xss vulnerability(escape html in input) 2018-03-25 20:26:47 +01:00
Egon Richárd Tőrös 3019d96ad9 💄 Code formatting 2018-03-12 21:44:55 +01:00
Egon Richárd Tőrös 4f5711c7e3 💄 Build Javascript 2018-03-12 21:43:43 +01:00
Egon Richárd Tőrös 8a586fc32a Ajax - fetch properties from object 2018-03-12 21:42:13 +01:00
Waltton Morais b49980d169 Replace hardcoded color for input with $choices-bg-color variable 2018-03-09 09:07:15 +00:00
Bart Langedijk e5a3b0e308 Update of build files 2018-03-08 12:33:54 +00:00
Bart Langedijk 3cb2a897fa ESLint fix 2018-03-08 12:33:54 +00:00
Bart Langedijk 56c4888aea Add custom properties to 'addItem' event 2018-03-08 12:33:54 +00:00
= 6276d17a2a Resolving the issue 342: we can't select an empty empty string or 0 as value. EDIT 2. 2018-03-08 09:23:25 +00:00
= a2a9953b1b Resolving the issue 342: we can't select an empty empty string or 0 as value. EDIT. 2018-03-08 09:23:25 +00:00
= 1d9fd326f0 Resolving the issue 342: we can't select an empty empty string or 0 as value 2018-03-08 09:23:25 +00:00
Travis Tidwell 1e6ae4e3f9 Add ability to configure the item comparer function. 2018-02-02 10:28:44 +00:00
Josh Johnson 5048379e68 Rename rendering methods + createGroupsFragment test 2017-12-20 15:10:01 +00:00
Josh Johnson a5277a49e7 Wrapped select tests + minor refactors 2017-12-20 12:38:16 +00:00
Josh Johnson 9c9a4c115a Add further component tests 2017-12-19 13:08:57 +00:00
Josh Johnson 905f31abf1 Merge remote-tracking branch 'origin/develop' into develop 2017-12-19 12:19:57 +00:00
Josh Johnson afd5935866 Setup rendering test 2017-12-19 12:19:54 +00:00
Josh Johnson e3aa6e723e Rename sortFilter to sortFn 2017-12-19 12:19:43 +00:00
Josh Johnson f54a81f7f4 Resolve janky scrolling 2017-12-18 12:17:35 +00:00
Josh Johnson 9777287b92 Ensure destroying instance reinstates options + tests 2017-12-18 12:06:38 +00:00
Josh Johnson beeeeb87ad Move wrapping into container class 2017-12-11 14:40:38 +00:00
Josh Johnson 6130ee00d5 Enable/disable tests 2017-12-10 18:13:13 +00:00
Josh Johnson e79699facd More coverage 2017-12-10 18:00:57 +00:00
Josh Johnson 43417510cd Various unit test improvements + focus flipping 2017-12-10 16:41:39 +00:00
Josh Johnson 053ec770d3 Remove border-radius from button 2017-12-06 16:16:00 +00:00
Josh Johnson d97857e013 Merge remote-tracking branch 'origin/develop' into develop 2017-12-06 16:13:15 +00:00
Josh Johnson a5befca2fe Resolve item rendering bug 2017-12-06 16:12:53 +00:00
George Brook 622d658f6b Update choices.css 2017-12-05 13:55:36 +00:00
George Brook 40ed67453c Update choices.scss 2017-12-05 13:55:36 +00:00
Josh Johnson e18971fd6d Further test coverage 2017-11-29 13:48:49 +00:00
Josh Johnson 760ecde4c1 Add tests for removeHighlightedItems + setChoices 2017-11-29 13:25:20 +00:00
Josh Johnson b3486ccfbb Further public method unit tests 2017-11-21 16:17:00 +00:00
Josh Johnson 92037ba5b9 Keep icons for future usage 2017-11-21 15:53:28 +00:00
Josh Johnson 78bfa5dac4 Merge branch 'master' of https://github.com/indacloud/Choices into indacloud-master 2017-11-21 15:53:06 +00:00
Josh Johnson a46915718f Minor refactoring 2017-11-21 15:19:46 +00:00
Josh Johnson 3adccb3ce5 Prepare test descriptions 2017-11-21 14:10:29 +00:00
Josh Johnson dd0b4bc086 Build with latest deps 2017-11-20 12:59:12 +00:00
Josh Johnson e8d8f8662e Export properly 2017-11-15 06:51:53 +00:00
Josh Johnson 7c1a18895e Use export for classes 2017-11-13 19:13:37 +00:00
Josh Johnson dd0a06a946 Further unit tests 2017-11-11 13:40:18 +00:00
Tom Brehm f7e63ce35c Move icons to css with encoded data
### This is the problem:

the `$choices-button-icon-path` needed to be changed for use with Weppack and I still had some complications when building my project.

### This is my solution:

The icons can be encoded and used directly in the stylesheet. This makes it easier to customize and removes 2 dependencies.
You can then customize `$choices-icon-cross` and `$choices-icon-cross-inverse` with one of your one data or asset.
2017-11-09 11:17:13 -05:00
Josh Johnson b44c918022 Better splitting up of functions 2017-11-07 14:08:55 +00:00
Josh Johnson 97e8c04536 Further unit tests 2017-11-07 14:04:37 +00:00
Josh Johnson f20b9fc59f Clear store unit test 2017-11-07 12:56:54 +00:00
Josh Johnson fdbc2a890f Further public method unit tests 2017-11-07 12:51:43 +00:00
Josh Johnson 1dc040d7f8 Ignore test files from coverage 2017-11-07 12:19:56 +00:00
Josh Johnson 09cffecc69 Add further public method unit tests 2017-11-07 12:00:10 +00:00
Josh Johnson 487e878b88 Ensure webpack config is valid 2017-11-07 11:59:49 +00:00
Josh Johnson 8c7fc17811 init() and destroy() unit tests 2017-11-06 13:52:27 +00:00
Josh Johnson affd67e542 Merge with latest + housekeeping 2017-10-29 18:59:17 +00:00
Josh Johnson 71dcb6c140 Minor test tweaks 2017-10-29 18:56:24 +00:00
Josh Johnson a325a75a23 Early returns + refactoring 2017-10-19 12:35:26 +01:00
Josh Johnson 30c31a406c Abstract various methods 2017-10-18 13:05:07 +01:00
Josh Johnson 920d41d0f5 Remove 'shoulds' from tests 2017-10-18 13:04:52 +01:00
Josh Johnson 5304de02a7 Move event triggering to wrapped element class 2017-10-18 09:08:27 +01:00
Josh Johnson 88ccdc6917 Template functions as pure functions 2017-10-18 08:54:23 +01:00
Josh Johnson 859653ff72 Expose methods from wrapped elements 2017-10-18 08:43:56 +01:00
Josh Johnson 8b71f277ff Resolve passedElement issues 2017-10-14 11:29:08 +01:00
Josh Johnson bd77f458b3 Begin to move passedElement logic into wrapped component 2017-10-13 13:43:58 +01:00
Josh Johnson 82cb17ec2b Minor refactoring 2017-10-13 09:17:20 +01:00
Josh Johnson d48fdf4e02 Minor fixes 2017-10-13 08:51:28 +01:00
Josh Johnson e79aeaa93e Move key codes into constant 2017-10-12 16:27:23 +01:00
Josh Johnson d5167b0106 Add further container tests 2017-10-12 12:43:53 +01:00
Josh Johnson 843d1f66bb Use parentInstance + begin adding container tests 2017-10-12 12:34:47 +01:00
Josh Johnson 48e35a88da Finish input unit tests 2017-10-12 09:35:58 +01:00
Josh Johnson f9303d86b0 Add list unit tests 2017-10-11 09:39:31 +01:00
Josh Johnson d211cf9507 Add dropdown unit tests 2017-10-11 09:19:13 +01:00
Josh Johnson 806edca24f Move templates into own file 2017-10-10 16:59:49 +01:00
Josh Johnson f98e79e218 Move action types into constant file 2017-10-10 15:30:06 +01:00
Josh Johnson fb4f80b5f1 Break out actions into action files 2017-10-10 15:26:38 +01:00