Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

671
goTorrentWebUI/node_modules/react-select/HISTORY.md generated vendored Normal file
View File

@@ -0,0 +1,671 @@
# React-Select
## v1.1.0 / 2017-11-28
* added; more props are passed to the Option component: `focusOption`, `inputValue`, `selectValue`, `removeValue`
* added; the `inputValue` is passed as the third argument to the `optionRenderer`
* fixed; issues opening the menu correctly for multiselect when `autosize={false}`
* fixed; removed `event.stopPropagation()` from Select's `clearValue` and `onClick` handlers, thanks [Thomas Burke](https://github.com/etburke)
* fixed; `handleMouseDownOnArrow` when `openOnClick={false}`, thanks [elias ghali](https://github.com/elghali)
* fixed; conditional scrolling into view of focused option, thanks [Michael Lewis](https://github.com/mtlewis)
## v1.0.1 / 2017-11-24
* reintroduced source files for scss and less stylesheets into the npm package
## v1.0.0 / 2017-11-23
* reverted spacebar-selects-option behaviour for searchable selects, thanks [Charles Lee](https://github.com/gwyneplaine) - [see PR](https://github.com/JedWatson/react-select/pull/2163)
* fixed behaviour where async doesn't handle onInputChange returning a value, thanks [Anton](https://github.com/tehbi4) - [see PR](https://github.com/JedWatson/react-select/pull/2133)
* fixed Creatable bug where the first enter keypress is ignored when `promptTextCreator` returns only the label, thanks [George Karagkiaouris](https://github.com/karaggeorge) - [see PR](https://github.com/JedWatson/react-select/pull/2140)
* Utility functions are now exported from the es6 build, thanks [Deiru](https://github.com/Deiru2k) - [see PR](https://github.com/JedWatson/react-select/pull/2154)
* Update aria-only class to have absolute positioning, thanks [Jacob Hilker](https://github.com/JHilker) - [see PR](https://github.com/JedWatson/react-select/pull/1243)
* gives possibility to use ref property for Creatable, thanks [blacktemplar](https://github.com/blacktemplar) - [see PR](https://github.com/JedWatson/react-select/pull/1646)
* Adds lint and test pre-commit hooks, thanks [carymcpoland](https://github.com/mcpolandc) - [see PR](https://github.com/JedWatson/react-select/pull/2077)
* Disable some browser-specific behaviours that break the input, thanks [Jed Watson](https://github.com/JedWatson) - [see PR](https://github.com/JedWatson/react-select/pull/2101)
* onOpen: run after dom has rendered, thanks [Karl-Aksel Puulmann](https://github.com/macobo) - [see PR](https://github.com/JedWatson/react-select/pull/#1756)
* fix not clearing when given invalid values, from #1756, thanks [Mário][https://github.com/ticklemynausea] - [see PR](https://github.com/JedWatson/react-select/pull/2100)
* Exports Option Component, thanks [Erkelens, Jan Paul](https://github.com/jperkelens) - [see PR](https://github.com/JedWatson/react-select/pull/2097)
* Fix/numeric multi select, thanks [Charles Lee](https://github.com/gwyneplaine) - [see PR](https://github.com/JedWatson/react-select/pull/2086)
* removeSelected prop (round 2), for optionally keeping selected values in dropdown, thanks [Jed Watson](https://github.com/banderson) - [see PR](https://github.com/JedWatson/react-select/pull/1891)
* pass removeValue() and always pass valueArray, thanks [kcliu](https://github.com/kcliu) - [see PR](https://github.com/JedWatson/react-select/pull/1850)
* Accessibility Enhancements - Aria tags, Space/Enter keys, thanks [sushmabadam](https://github.com/sushmabadam) - [see PR](https://github.com/JedWatson/react-select/pull/1428)
* added rtl support, thanks [Dekel](https://github.com/dekelb) - [see PR](https://github.com/JedWatson/react-select/pull/1613)
* Add inputValue to menuRenderer, thanks [headcanon](https://github.com/chronick) - [see PR](https://github.com/JedWatson/react-select/pull/1732)
* fix typo in handleKeyDown method, thanks [jasonchangxo](https://github.com/jasonchangxo) - [see PR](https://github.com/JedWatson/react-select/pull/2088)
* Fix/numeric multi select, thanks [Charles Lee](https://github.com/gwyneplaine) - [see PR](https://github.com/JedWatson/react-select/pull/2086)
* expose children in AsyncCreatable.js, thanks [Charles Lee](https://github.com/gwyneplaine) - [see PR](https://github.com/JedWatson/react-select/pull/2084)
* replace trim fn loop with regex, thanks [Charles Lee](https://github.com/gwyneplaine) - [see PR](https://github.com/JedWatson/react-select/pull/2085)
* Trim search text from beginning and the end. (fixes #1861), thanks [Serkan Ozer](https://github.com/serkanozer) - [see PR](https://github.com/JedWatson/react-select/pull/1862)
* Add variable for focused input background, thanks [Aron Strandberg](https://github.com/aronstrandberg) - [see PR](https://github.com/JedWatson/react-select/pull/1998)
* Added id in the input select, thanks [thecreazy](https://github.com/thecreazy) - [see PR](https://github.com/JedWatson/react-select/pull/2027)
* adding a nvmrc file and adding coverage to eslintignore, thanks [Dave Birch](https://github.com/uxtx) - [see PR](https://github.com/JedWatson/react-select/pull/1137)
* Updated the comment for the deleteRemoves option., thanks [Abul Dider](https://github.com/dider7) - [see PR](https://github.com/JedWatson/react-select/pull/2078)
* implemented optional rendering of arrow, thanks [rolandjohann](https://github.com/rolandjohann) - [see PR](https://github.com/JedWatson/react-select/pull/1761)
* Skip rendering arrow wrapper when custom arrow renderer returns falsy value, thanks [Mike Lewis](https://github.com/mtlewis) - [see PR](https://github.com/JedWatson/react-select/pull/2055)
* do not show clear button if value is an empty string, thanks [Marie Godon](https://github.com/mariegodon) - [see PR](https://github.com/JedWatson/react-select/pull/2074)
* Set isLoading to false if cache hit, thanks [timhwang21](https://github.com/timhwang21) - [see PR](https://github.com/JedWatson/react-select/pull/2042)
* Add aria-labels to Options, thanks [jasonchangxo](https://github.com/jasonchangxo) - [see PR](https://github.com/JedWatson/react-select/pull/2036)
* Adds source links to each example, thanks [Damon Bauer](https://github.com/damonbauer) - [see PR](https://github.com/JedWatson/react-select/pull/2051)
* Issue #2056: onInputChange should return modified value, thanks [Caleb Scholze](https://github.com/cscholze) - [see PR](https://github.com/JedWatson/react-select/pull/2057)
* Remove option `addLabelText` from README and propTypes, thanks [Jannes Jeising](https://github.com/jjeising) - [see PR](https://github.com/JedWatson/react-select/pull/2040)
* GitHub has a capital H, thanks [David Baumgold](https://github.com/singingwolfboy) - [see PR](https://github.com/JedWatson/react-select/pull/2053)
* refactor componentWillUnmount(), thanks [riophae](https://github.com/riophae) - [see PR](https://github.com/JedWatson/react-select/pull/2064)
* Slim down NPM package, thanks [Valentin Agachi](https://github.com/avaly) - [see PR](https://github.com/JedWatson/react-select/pull/2062)
* Update contributing doc, thanks [Gregg Brewster](https://github.com/greggb) - [see PR](https://github.com/JedWatson/react-select/pull/2059)
* strip proptypes in production build (fixes #1882), thanks [Jochen Berger](https://github.com/jochenberger) - [see PR](https://github.com/JedWatson/react-select/pull/2003)
* Support Webpack 2, Webpack 3, rollup., thanks [Matthew Schnee](https://github.com/mschnee) - [see PR](https://github.com/JedWatson/react-select/pull/2020)
* Add missing semicolon, thanks [jochenberger](https://github.com/jochenberger) - [see PR](https://github.com/JedWatson/react-select/pull/2018)
* autofocus --> autoFocus, thanks [Charles Lee](https://github.com/gwyneplaine) - [see PR](https://github.com/JedWatson/react-select/pull/2002)
* Async> cache async response regardless of req order, thanks [Timothy Hwang](https://github.com/timhwang21) - [see PR](https://github.com/JedWatson/react-select/pull/2012)
* Make this work in preact., thanks [liaoxuezhi](https://github.com/2betop) - [see PR](https://github.com/JedWatson/react-select/pull/2013)
* Correct release candidate version on README, thanks [Damon Aw](https://github.com/daemonsy) - [see PR](https://github.com/JedWatson/react-select/pull/2017)
* Fix test name, thanks [jochenberger](https://github.com/jochenberger) - [see PR](https://github.com/JedWatson/react-select/pull/2005)
* Fixing css states to be scoped with Select selector, closes #1951., thanks [Adam Girton](https://github.com/agirton) - [see PR](https://github.com/JedWatson/react-select/pull/2000)
* fix typo, thanks [jochenberger](https://github.com/jochenberger) - [see PR](https://github.com/JedWatson/react-select/pull/1999)
## v1.0.0-rc.10 / 2017-09-13
* changed; `openAfterFocus` prop has been renamed to `openOnClick`, and now defaults to `true`
* fixed; React.PropTypes deprecation warning, thanks [Jeremy Liberman](https://github.com/MrLeebo)
* improved; scrolling behaviour when navigating the menu with the keyboard, thanks [boatkorachal](https://github.com/boatkorachal)
* fixed; error with the `Async` cache when you type `"hasOwnProperty"`, thanks [SuhushinAS](https://github.com/SuhushinAS)
## v1.0.0-rc.9 / 2017-09-13
* fixed; clearable padding style, thanks [Minori Miyauchi](https://github.com/mmiyauchi)
* fixed; removed use of `Object.assign`, fixes IE compatibility
* added; new `closeOnSelect` prop (defaults to `true`) that controls whether the menu is closed when an option is selected, thanks to [Michael Elgar](https://github.com/melgar) for the original idea
* changed; by default, the menu for multi-selects now closes when an option is selected
* changed; `Async` component no longer always clears options when one is selected (although the menu is now closed by default). Use `closeOnSelect={false} onSelectResetsInput={false}` to leave the menu open.
* fixed; `Async` component always called `onChange` even when it wasn't provided
* fixed; input lag for the `Async` component when results are returned from cache
* fixed; required was not being updated without an onChange handler
* fixed; peer dependencies for `prop-types`, thanks [Michaël De Boey](https://github.com/MichaelDeBoey)
* fixed; internal optimisations, thanks [Kieran Boyle](https://github.com/dysfunc)
* added; `Value` component is now exported, thanks [Prof Gra](https://github.com/Grahack)
* fixed; callback fired after `Async` component unmounts, thanks [Andrew Russell](https://github.com/DeadHeadRussell)
* fixed; wrapping on Firefox in SCSS files, thanks [Michael Williamson](https://github.com/mwilliamson)
## v1.0.0-rc.8 / 2017-09-12
* fixed; `onMenuScrollToBottom` does not work in chrome 58.0, thanks [Simon Hartcher](https://github.com/deevus)
* fixed; missing es6 module build for `js:next` entrypoint
* updated; `react-input-autosize@2.0.0` including several fixes for react-select (see [changes](https://github.com/JedWatson/react-input-autosize/blob/master/HISTORY.md))
## v1.0.0-rc.7 / 2017-09-11
* fixed; issue with `lib` build preventing use in ES2015 environments
## v1.0.0-rc.6 / 2017-09-10
* fixed; changing `required` prop from `true` to `false` now works as expected, thanks [George Karagkiaouris](https://github.com/karaggeorge)
* added; new prop `onSelectResetsInput` controls whether the input value is cleared when options are selected, thanks [David Roeca](https://github.com/davidroeca) and [Alexander Nosov](https://github.com/nosovsh)
* fixed; tabindex parent bug fix for Edge, thanks [George Payne](https://github.com/George-A-Payne)
* fixed; update selectize link in README.md, thanks [kerumen](https://github.com/kerumen)
* added; standard issue template, thanks [agirton](https://github.com/agirton)
* added; new build process using rollup and webpack. Removed grunt. thanks [gwyneplaine](https://github.com/gwyneplaine)
* fixed; updated contributor docs with the correct node version reference [gwyneplaine](https://github.com/gwyneplaine)
* fixed; missing method binds in Option, thanks [agirton](https://github.com/agirton)
* fixed; converted components to use es6 classes, thanks [jochenberger](https://github.com/jochenberger)
* fixed; console.log example in usage docs, thanks [rohmanhm](https://github.com/rohmanhm)
* fixed; hide create option after closing menu, thanks [andreme](https://github.com/andreme)
* fixed; remove circular reference, thanks [agirton](https://github.com/agirton)
* fixed; readme typo, thanks [ieldanr](https:/github.com/ieldanr)
* fixed; add missing function binds in Option component, thanks [agirton](https://github.com/agirton) and [blacktemplar](https://github.com/blacktemplar)
* fixed; re-added fix to [#1580](https://github.com/JedWatson/react-select/issues/1580), thanks [agirton](https://github.com/agirton)
* fixed; avoid mutating user inputs when ignoring case/accents, thanks [not-an-aardvark](https://github.com/not-an-aardvark)
* fixed; issues synchronising options props in `Async`, thanks [cbergmiller](https://github.com/cbergmiller)
* fixed; backspace handling for non-multi select controls, thanks [Jeremy Liberman](https://github.com/MrLeebo)
## v1.0.0-rc.5 / 2017-05-25
* fixed; Allow `falsey` values to be clearable, thanks [Simon Gaestel](https://github.com/sgaestel)
* fixed; issue where Firefox would crash due to incorrect use of `aria-owns` attribute, thanks [Max Hubenthal](https://github.com/mhubenthal)
* fixed; regression where options not using the value key couldn't be focused, thanks [Benjamin Piouffle](https://github.com/Betree)
## v1.0.0-rc.4 / 2017-05-14
* fixed; no more warning when using React 15.5, thanks [Adam Girton](https://github.com/agirton)
* fixed; issue comparing objects in `getFocusableOptionIndex`, thanks [rndm2](https://github.com/rndm2)
* fixed; missing .focus() method in `Creatable`, thanks [Anton Alexandrenok](https://github.com/the-spyke)
* added; support for `aria-describedby` attribute, thanks [Eric Lee](https://github.com/ericj17)
* added; `.is-clearable` className when clearable is true, thanks [Dan Diaz](https://github.com/dan-diaz)
## v1.0.0-rc.3 / 2017-02-01
* added; `arrowRenderer` prop, thanks [Brian Vaughn](https://github.com/bvaughn)
* added; child-function support to `Async` and `Creatable` components so that they can compose each other (or future HOCs), thanks [Brian Vaughn](https://github.com/bvaughn)
* added; `asyncCreatable` HOC that combines `Async` and `Creatable` so they can be used together, thanks [Brian Vaughn](https://github.com/bvaughn)
* added; undocumented arguments for `menuRenderer`, thanks [Julian Krispel-Samsel](https://github.com/juliankrispel)
* fixed; Do not focus and open menu when disabled, thanks [nhducit](https://github.com/nhducit)
* fixed; Scrolling with arrow-keys is not working correctly, thanks [Damian Pieczynski](https://github.com/piecyk)
* added; "select all text" functionality `Shift+Home|Del`, thanks [Damian Pieczynski](https://github.com/piecyk)
* added; support for `boolean` values, thanks [Aaron Hardy](https://github.com/Aaronius)
* fixed; Remove duplicated `promptTextCreator` field from readme, thanks [Jih-Chi Lee](https://github.com/jihchi)
* fixed; Adding back ref that was removed in rc2, thanks [Martin Jujou](https://github.com/jooj123)
* fixed; `Creatable` component doesn't allow input key down handling, thanks [Ivan Leonenko](https://github.com/IvanLeonenko)
* added; Allow react nodes to be passed as loadingPlaceholder, thanks [Daniel Heath](https://github.com/DanielHeath)
* fixed; IE8 compatibility issues, thanks [Kirill Mesnyankin](https://github.com/strayiker)
* improved; Allow users to specify noResultsText, thanks [Daniel Heath](https://github.com/DanielHeath)
* added; Only remove options if a loading placeholder is available, thanks [Daniel Heath](https://github.com/DanielHeath)
* fixed; firefox display items in two rows due to reflow, thanks [Daniel Heath](https://github.com/DanielHeath)
* fixed; `Creatable` readme typo, thanks [Ben](https://github.com/rockingskier)
* fixed; explain way to implement `allowCreate` functionality with `Creatable` to readme, thanks [mayerwin](https://github.com/mayerwin)
* added; delete key removes an item when there is no input, thanks [forum-is](https://github.com/forum-is)
* added; `onNewOptionClick` handler for `Creatable`, thanks [Lee Siong Chan](https://github.com/leesiongchan)
* fixed; `onInputChange` consistent for `Creatable`, thanks [Lee Siong Chan](https://github.com/leesiongchan)
* fixed; `menuRenderer` is treated consistently between `Creatable` and `Select`, thanks [Brian Vaughn](https://github.com/bvaughn)
* fixed; `asyncCreatable` options parsing will not parse undefined values into props, thanks [Romain Dardour](https://github.com/unity)
* added; pass `inputProps` to `inputRenderer`, thanks [Alec Winograd](https://github.com/awinograd)
* fixed; no exception when clearing an Async field that is not set to multi, thanks [Patrik Stutz](https://github.com/VanCoding)
* added; allow rendering a custom clear component, thanks [Conor Hastings](https://github.com/conorhastings)
* fixed; document `ignoreAccents`, thanks [Domenico Matteo](https://github.com/dmatteo)
* fixed; arrowing up or down in `Select` with 0 options does not throw type error, thanks [Alex Howard](https://github.com/thezanke)
* fixed; `Creatable` handles null children prop, thanks [Jack Coulter](https://github.com/jscinoz)
* added; provide `isOpen` to arrowRenderer, thanks [Kuan](https://github.com/khankuan)
* fixed; re-added the `focus()` method on `Select.Async`, thanks, [Maarten Claes](https://github.com/mcls)
* fixed; focus the next available option after a selection, not the top option, thanks [Nicolas Raynaud](https://github.com/nraynaud)
Note there has also been a breaking change to the props for the `Async` component: both `minimumInput` and `searchingText` have been removed. See #1226 for more details. Apologies for doing this in an RC release, but we had to trade off between resolving some important bugs and breaking the API, and figured it was better to do this before declaring 1.0.0 stable.
## v1.0.0-rc.1 / 2016-09-04
* fixed; reset value to `[]` when `multi=true`, thanks [Michael Williamson](https://github.com/mwilliamson)
* added; pass index to `renderLabel` method, thanks [nhducit](https://github.com/nhducit)
* fixed; uncontrolled to controlled component warning in React 15.3
* fixed; props cleanup, thanks [Forbes Lindesay](https://github.com/ForbesLindesay)
* fixed; issue where a value of the number `0` would be assumed to be no value, thanks [Hanwen Cheng](https://github.com/hanwencheng)
* fixed; internal refs converted to callbacks instead of strings, thanks [Johnny Nguyen](https://github.com/gojohnnygo)
* added; optional `instanceId` prop for server-side rendering, thanks [Jevin Anderson](https://github.com/JevinAnderson)
* added; `onCloseResetsInput` prop, thanks [Frankie](https://github.com/frankievx)
* added; `Creatable` component, replaces pre-1.0 `allowCreate` prop, thanks [Brian Vaughn](https://github.com/bvaughn)
## v1.0.0-beta14 / 2016-07-17
* fixed; `react-input-autosize` has been udpated to `1.1.0`, which includes fixes for the new warnings that React 15.2 logs
* fixed; "Unknown prop `inputClassName` on <div> tag" warning, thanks [Max Stoiber](https://github.com/mxstbr)
* fixed; Removed unnecessary `onUnfocus`, thanks [Johnny Nguyen](https://github.com/gojohnnygo)
* added; Support for react components in `searchPromptText`, thanks [Matt](https://github.com/hellaeon)
* fixed; focus bug on iOS, thanks [Tony deCatanzaro](https://github.com/tonydecat)
* fixed; Async bugs with Promises, thanks [Vladimir](https://github.com/VladimirPal) and [Ian Firkin](https://github.com/lobsteropteryx)
* fixed; `searchingText` bug, thanks [Tony deCatanzaro](https://github.com/tonydecat)
* improved; More antive-like input behaviour, thanks [Johnny Nguyen](https://github.com/gojohnnygo)
* fixed; Added missing unit (px) to `minWidth` attribute, thanks [Ian Witherow](https://github.com/ianwitherow)
* added; Support for assistive technologies, thanks [Dave Brotherstone](https://github.com/bruderstein)
* fixed; React error if `onChange` callback causes a root component to unmount, thanks [Nathan Norton](https://github.com/Xesued)
* fixed; Open menu is now closed if `disabled` becomes true, thanks [Jason Moon](https://github.com/jsnmoon)
* fixed; Prevent `getFocusableOptionIndex` from returning a disabled option, thanks [Brian Powers](https://github.com/brianspowers)
* added; Home, End, Page Up/Down support, thanks [Jason Kadrmas](https://github.com/blackjk3)
* fixed; Don't render `backspaceToRemoveMessage` if `backspaceRemoves` is set to false, thanks [Ryan Zec](https://github.com/ryanzec)
* fixed; Issue with an outline appearing on the auto sized input, thanks [Ryan Zec](https://github.com/ryanzec)
* fixed; Events don't propagate when `esc` is pressed, thanks [Yoshihide Jimbo](https://github.com/jmblog)
* fixed; Update `required` prop based on nextProps on update, thanks [Matt Shwery](https://github.com/mshwery)
* fixed; On focus check whether input ref is a real input or an input component, thanks [Peter Brant](https://github.com/pbrant) and [Greg Poole](https://github.com/gpoole)
Also a big thanks to [Brian Vaughn](https://github.com/bvaughn) for his help triaging issues for this release!
## v1.0.0-beta13 / 2016-05-30
* added; `inputRenderer` prop, allows you to override the input component, thanks [Sean Burke](https://github.com/leftmostcat)
* added; `openOnFocus` prop, causes the menu to always open when the select control is focused, thanks [HuysentruytRuben](https://github.com/HuysentruytRuben)
* added; `react-virtualised-select` HOC example, thanks [Brian Vaughn](https://github.com/bvaughn)
* added; `tabSelectsValue` prop can be set to false to prevent selection of focused option when tab is pressed, thanks [Byron Anderson](https://github.com/byronanderson)
* added; ability to override `resetValue` when clearing the control, thanks [Alexander Luberg](https://github.com/LubergAlexander)
* added; input can be updated with `onInputChange`, thanks [Brett DeWoody](https://github.com/brettdewoody)
* added; Styles for .is-selected class, thanks [Danny Herran](https://github.com/dherran)
* fixed; `noResultsText` prop type is now `stringOrNode` for Async component, thanks [Michael Groeneman](https://github.com/mgroeneman)
* fixed; `onInputChange` is wrapped by Async component, thanks [Eric O'Connell](https://github.com/drd)
* fixed; `scrollMenuIntoView` behaviour in IE10, thanks [Ivan Jager](https://github.com/aij)
* fixed; isEqualNode replaced with strict equality check, thanks [Alexandre Balhier](https://github.com/abalhier)
* fixed; issue with value object not being passed to `handleRequired`, thanks [Andrew Hite](https://github.com/andyhite)
* fixed; the menu-outer container is no longer rendered when it does not contain anything, thanks [Kuan](https://github.com/khankuan)
* improved; better support for IE8 in styles, thanks [Rockallite Wulf](https://github.com/rockallite)
## v1.0.0-beta12 / 2016-04-02
* added; `menuRenderer` method and example for effeciently rendering thousands of options, thanks [Brian Vaughn](https://github.com/bvaughn)
* added; `optionClassName` prop, thanks [Max Tyler](https://github.com/iam4x)
## v1.0.0-beta11 / 2016-03-09
* updated dependencies to allow use with React 15.x
* changed; multiple selected values are now submitted using multiple inputs, thanks [Trinh Hoang Nhu](https://github.com/james4388)
* added; `joinValues` prop to revert the above change and submit multiple values in a single field with the delimiter
## v1.0.0-beta10 / 2016-02-23
* fixed build issues with v1.0.0-beta9
## v1.0.0-beta9 / 2016-02-12
* added; onBlurResetsInput prop, thanks [Sly Bridges](https://github.com/slybridges)
* changed; Enter selects and retains focus, Tab selects and shifts focus, thanks [RDX](https://github.com/rdsubhas)
* fixed; Hide noResultsText when value is falsy, thanks [Fernando Alex Helwanger](https://github.com/fhelwanger)
* added; `required` prop, adds HTML5 required attribute, thanks [Domenico Matteo](https://github.com/dmatteo)
* fixed; Touch drag behaviour, thanks [Pavel Tarnopolsky](https://github.com/Paveltarno)
* added; `onOpen` and `onClose` event props, thanks [Jacob Page](https://github.com/DullReferenceException)
* fixed; Pressing Enter on open Select should stop propagation, thanks [Jeremy Liberman](https://github.com/MrLeebo)
* fixed; Missing handleMouseDownOnMenu, thanks [Jeremy Liberman](https://github.com/MrLeebo)
* added; Ensures the selected option is immediately visible when the menu is open, thanks [Martin Jujou](https://github.com/jooj123)
* added; `autoBlur` prop, blurs the input when a value is selected, thanks [Pavel Tarnopolsky](https://github.com/Paveltarno)
* fixed; Several isFocused checks weren't working properly
## v1.0.0-beta8 / 2015-12-20
* fixed; input focus bug when toggling `disabled` prop, thanks [Davide Curletti](https://github.com/dcurletti)
* fixed; `focus()` is now exposed on the `Async` component, thanks [AugustinLF](https://github.com/AugustinLF)
## v1.0.0-beta7 / 2015-12-15
* You can now use React elements for placeholders and the text props, thanks [kromit](https://github.com/kromit) and [Alyssa Biasi](https://github.com/alyssaBiasi)
* Fixed a problem where the border doesn't show when the element is inside a table, thanks [Rodrigo Boratto](https://github.com/rwrz)
* New prop `scrollMenuIntoView` scrolls the viewport to display the menu, thanks [Alexander Zaharakis](https://github.com/azaharakis)
* New LESS / SCSS variable `select-option-bg` lets you control the menu option background color, thanks [Evan Goldenberg](https://github.com/Naveg)
* Fixed an error in the blur handler on IE when the menu is not visible, thanks [Gaston Sanchez](https://github.com/gaastonsr)
* Added support for a `clearableValue` option property in `multi` mode, thanks [Sly Bridges](https://github.com/slybridges)
## v1.0.0-beta6 / 2015-11-29
* Test suite complete and passing, with a couple of minor fixes thanks to @bruderstein
## v1.0.0-beta5 / 2015-11-08
* Fixes issues relating to serializing simple values into the hidden field
## v1.0.0-beta4 / 2015-11-08
* New default styles that match [Elemental UI](http://elemental-ui.com) and look right at home in the new [KeystoneJS Admin UI](http://keystonejs.com)
We're potentially going to ship some theme stylesheets in the future, shout out on GitHub if this interests you.
## v1.0.0-beta3 / 2015-11-08
* The selected value populated in the hidden field has been fixed (was `"[object Object]"` before)
* Added new `autofocus` prop
* Fixed duplicate key error for options and values with duplicate `value` properties
* SCSS variables now have `!default` so you can override them
## v1.0.0-beta2 / 2015-11-06
Changed since beta 1:
* Async options cache works again
* New style props for custom styling the component without modifying css classes: `style` `wrapperStyle` `menuStyle` `menuContainerStyle`
* The menu opens and closes correctly when `searchable={false}`, there is still some work to do on this use-case
## v1.0.0-beta1 / 2015-11-06
This is a complete rewrite. Major changes include:
* Everything is simpler (I'm nearly done and the source code is only 60% of the size of the last version)
* No more timeouts or weird handlers, the restructuring has let me make everything more straight-forward
* The options array is no longer preprocessed into state, just retrieved from props
* The values array is now initialised in the Options array during render, and not stored in state, which along with the change to options makes the component more reliable and fixes issues with props not updating correctly
* The component no longer stores its own value in state (ever) - it needs to be passed as a prop and handled with `onChange`.
* Complex values are now enabled by default (so you're passed the option object, not its value); you can enable the legacy mode with a prop
* The Value and Option components have been cleaned up as well for consistency
* The hidden `<input>` field is now optional and the component is better suited to use in a rich React.js app than it was
* You can disable options filtering to do the filtering externally with `onInputChange`
* Accents on characters can now be ignored
* The `asyncOptions` prop has been replaced by a new wrapper component: `Select.Async`
Note that "Tag mode" (creating options on the fly) isn't reimplemented yet.
A full guide to the breaking changes and new features will be written up soon. In the meantime please see the new examples.
## v0.9.1 / 2015-11-01
* added; new Contributors example w/ async options loading and custom value / label keys
* fixed; several issues with custom `valueKey` and `labelKey` props
* fixed; autoload now loads options with no search input
## v0.9.0 / 2015-10-29
* added; SCSS stylesheets!
* improved; Options rendering should be more performant
* breaking change; Custom `Option` components now need to pass their `option` prop to event handlers; see [this commit](https://github.com/JedWatson/react-select/commit/89af12a80a972794222b193a767f44234bbe9817) for an example of the required change.
## v0.8.4 / 2015-10-27
* fixed; LESS math operations now work with --strict-math=on, thanks [Vincent Fretin](https://github.com/vincentfretin)
## v0.8.3 / 2015-10-27
* fixed; IE issue where clicking the scrollbar would close the menu, thanks [Pete Nykänen](https://github.com/petetnt)
## v0.8.2 / 2015-10-22
* added; Promise support for `loadAsyncOptions`, thanks [Domenico Matteo](https://github.com/dmatteo)
## v0.8.1 / 2015-10-20
* fixed; `loadAsyncOptions` raises TypeError in setup, see #439 for details, thanks [Pancham Mehrunkar](https://github.com/pancham348)
## v0.8.0 / 2015-10-19
This release contains significant DOM structure and CSS improvements by @jossmac, including:
* no more `position: absolute` for inner controls
* `display: table` is used for layout, which works in IE8 and above, and [all other modern browsers](http://caniuse.com/#feat=css-table)
* less "magic numbers" used for layout, should fix various browser-specific alignment issues
* clear "x" control now animates in
* clearer `.Select--multi` className replaces `.Select.is-multi`
* new height & theme variables
* "dropdown" indicator chevron is no longer displayed for multi-select controls
There are no functional changes, but if you've forked the LESS / CSS to create your own theme you'll want to pay close attention to PR #527 when upgrading to this version.
## v0.7.0 / 2015-10-10
React Select is updated for React 0.14. If you're still using React 0.13, please continue to use `react-select@0.6.x`. There are no functional differences between v0.7.0 and v0.6.12.
Additionally, our tests now require Node.js 4.x. If you are developing `react-select`, please make sure you are running the latest version of node.
Thanks to @bruderstein, @dmatteo and @hull for their help getting these updates shipped!
## v0.6.12 / 2015-10-02
* added; `labelKey` and `valueKey` props, so you can now use different keys in `option` objects for the label and value
* fixed; additional `isMounted()` checks in timeouts
* fixed; componentDidUpdate timeout is reset correctly, see #208 and #434, thanks [Petr Gladkikh](https://github.com/PetrGlad)
* fixed; mousedown event on scrollbar in menu no longer hides it, thanks [Yishai Burt](https://github.com/burtyish)
## v0.6.11 / 2015-09-28
* added; `isLoading` prop, allows indication of async options loading in situations where more control is required, thanks [Jon Gautsch](https://github.com/jgautsch)
## v0.6.10 / 2015-09-24
* fixed; a build issue with the previous release that prevented the stylesheet being generated / included
* fixed; a LESS syntax issue, thanks [Bob Cardenas](https://github.com/bcardi)
## v0.6.9 / 2015-09-19
* added; `style` key for package.json, thanks [Stephen Wan](https://github.com/stephen)
* added; `onInputChange` handler that returns the current input value, thanks [Tom Leslie](https://github.com/lomteslie)
* fixed; simplifying handleKey function & preventDefault behaviour, thanks [davidpene](https://github.com/davidpene)
* fixed; Display spinner while auto-loading initial data, thanks [Ben Jenkinson](https://github.com/BenJenkinson)
* fixed; better support for touch events, thanks [Montlouis-Calixte Stéphane](https://github.com/bulby97)
* fixed; prevent value splitting on non-multi-value select, thanks [Alan R. Soares](https://github.com/alanrsoares)
## v0.6.8 / 2015-09-16
* fixed; broader range of allowed prereleases for React 0.14, including rc1
* fixed; preventing backspace from navigating back in the browser history, thanks [davidpene](https://github.com/davidpene)
## v0.6.7 / 2015-08-28
* fixed; missing styles for `.Select-search-prompt` and `.Select-searching` issues, thanks [Jaak Erisalu](https://github.com/jaakerisalu) and [davidpene](https://github.com/davidpene)
## v0.6.6 / 2015-08-26
* fixed; issue in Chrome where clicking the scrollbar would close the menu, thanks [Vladimir Matsola](https://github.com/vomchik)
## v0.6.5 / 2015-08-24
* fixed; completely ignores clicks on disabled items, unless the target of the click is a link, thanks [Ben Stahl](https://github.com/bhstahl)
## v0.6.4 / 2015-08-24
This release includes a huge improvement to the examples / website thanks to @jossmac. Also:
* added; support for React 0.14 beta3
* fixed; disabled options after searching, thanks @bruderstein
* added; support for "Searching..." text (w/ prop) while loading async results, thanks @bruderstein and @johnomalley
* added; `className`, `style` and `title` keys are now supported in option properties, thanks @bruderstein
## v0.6.3 / 2015-08-18
Otherwise known as "the real 0.6.2" this includes the updated build for the last version; sorry about that!
## v0.6.2 / 2015-08-13
* changed; if the `searchable` prop is `false`, the menu is opened _or closed_ on click, more like a standard Select input. thanks [MaaikeB](https://github.com/MaaikeB)
## v0.6.1 / 2015-08-09
* added; Support for options with numeric values, thanks [Dave Brotherstone](https://github.com/bruderstein)
* changed; Disabled options now appear in the search results, thanks [Dave Brotherstone](https://github.com/bruderstein)
* fixed; asyncOptions are reloaded on componentWillReceiveProps when the value has changed, thanks [Francis Cote](https://github.com/drfeelgoud)
* added; `cacheAsyncResults` prop (default `true`) now controls whether the internal cache is used for `asyncOptions`
## v0.6.0 / 2015-08-05
* improved; option, value and single value have been split out into their own components, and can be customised with props. see [#328](https://github.com/JedWatson/react-select/pull/328) for more details.
* improved; Near-complete test coverage thanks to the awesome work of [Dave Brotherstone](https://github.com/bruderstein)
* improved; Support all alpha/beta/rc's of React 0.14.0, thanks [Sébastien Lorber](https://github.com/slorber)
* fixed; Close multi-select menu when tabbing away, thanks [Ben Alpert](https://github.com/spicyj)
* fixed; Bug where Select shows the value instead of the label (reapplying fix)
* fixed; `valueRenderer` now works when `multi={false}`, thanks [Chris Portela](https://github.com/0xCMP)
* added; New property `backspaceRemoves` (default `true`), allows the default behaviour of removing values with backspace when `multi={true}`, thanks [Leo Lehikoinen](https://github.com/lehikol2)
## v0.5.6 / 2015-07-27
* fixed; Allow entering of commas when allowCreate is on but multi is off, thanks [Angelo DiNardi](https://github.com/adinardi)
* fixed; Times (clear) character is now rendered from string unicode character for consistent output, thanks [Nibbles](https://github.com/Siliconrob)
* fixed; allowCreate bug, thanks [goodzsq](https://github.com/goodzsq)
* fixed; changes to props.placeholder weren't being reflected correctly, thanks [alesn](https://github.com/alesn)
* fixed; error when escape is pressedn where `clearValue` was not passed the event, thanks [Mikhail Kotelnikov](https://github.com/mkotelnikov)
* added; More tests, thanks [Dave Brotherstone](https://github.com/bruderstein)
## v0.5.5 / 2015-07-12
* fixed; replaced usage of `component.getDOMNode()` with `React.findDOMNode(component)` for compatibility with React 0.14
## v0.5.4 / 2015-07-06
* fixed; regression in 0.5.3 that broke componentWillMount, sorry everyone!
* added; `addLabelText` prop for customising the "add {label}?" text when in tags mode, thanks [Fenn](https://github.com/Fenntasy)
## v0.5.3 / 2015-07-05
* fixed; autoload issues, thanks [Maxime Tyler](https://github.com/iam4x)
* fixed; style incompatibilities with Foundation framework, thanks [Timothy Kempf](https://github.com/Fauntleroy)
## v0.5.2 / 2015-06-28
* fixed; bug where Select shows the value instead of the label, thanks [Stephen Demjanenko](https://github.com/sdemjanenko)
* added; 'is-selected' classname is added to the selected option, thanks [Alexey Volodkin](https://github.com/miraks)
* fixed; async options are now loaded with the initial value, thanks [Pokai Chang](https://github.com/Neson)
* fixed; `react-input-autosize` now correctly escapes ampersands (&), not actually a fix in react-select but worth noting here because it would have been causing a problem in `react-select` as well.
## v0.5.1 / 2015-06-21
* added; custom option and value rendering capability, thanks [Brian Reavis](https://github.com/brianreavis)
* fixed; collapsing issue when single-select or empty multi-select fields are disabled
* fixed; issue where an empty value would be left after clearing all values in a multi-select field
## v0.5.0 / 2015-06-20
* fixed; `esc` key incorrectly created empty options, thanks [rgrzelak](https://github.com/rgrzelak)
* adeed; New feature to allow option creation ("tags mode"), enable with `allowCreate` prop, thanks [Florent Vilmart](https://github.com/flovilmart) and [Brian Reavis](https://github.com/brianreavis)
* fixed; IE8 compatibility fallback for `addEventListener/removeEventListener`, which don't exist in IE8, thanks [Stefan Billiet](https://github.com/StefanBilliet)
* fixed; Undefined values when using asyncOptions, thanks [bannaN](https://github.com/bannaN)
* fixed; Prevent add the last focused value when the drop down menu is closed / Pushing enter without dropdown open adds a value, thanks [Giuseppe](https://github.com/giuse88)
* fixed; Callback context is undefined, thanks [Giuseppe](https://github.com/giuse88)
* fixed; Issue with event being swallowed on Enter `keydown`, thanks [Kevin Burke](https://github.com/kembuco)
* added; Support for case-insensitive filtering when `matchPos="start"`, thanks [wesrage](https://github.com/wesrage)
* added; Support for customizable background color, thanks [John Morales](https://github.com/JohnMorales)
* fixed; Updated ESLint and cleared up warnings, thanks [Alexander Shemetovsky](https://github.com/AlexKVal)
* fixed; Close dropdown when clicking on select, thanks [Nik Butenko](https://github.com/nkbt)
* added; Tests, and mocha test framework, thanks [Craig Dallimore](https://github.com/craigdallimore)
* fixed; You can now start the example server and watch for changes with `npm start`
## v0.4.9 / 2015-05-11
* fixed; focus was being grabbed by the select when `autoload` and `asyncOptions` were set
* added; `focus` method on the component
* added; support for disabled options, thanks [Pasha Palangpour](https://github.com/pashap)
* improved; more closures, less binds, for better performance, thanks [Daniel Cousens](https://github.com/dcousens)
## v0.4.8 / 2015-05-02
* fixed; restored `dist/default.css`
* fixed; standalone example works again
* fixed; clarified dependency documentation and added dependencies for Bower
* fixed; Scoping issues in `_bindCloseMenuIfClickedOutside`, thanks [bannaN](https://github.com/bannaN)
* fixed; Doesnt try to set focus afterupdate if component is disabled, thanks [bannaN](https://github.com/bannaN)
## v0.4.7 / 2015-04-21
* improved; lodash is no longer a dependency, thanks [Daniel Lo Nigro](https://github.com/Daniel15)
## v0.4.6 / 2015-04-06
* updated; dependencies, build process and input-autosize component
## v0.4.5 / 2015-03-28
* fixed; issue with long options overlapping arrow and clear icons, thanks [Rohit Kalkur](https://github.com/rovolution)
## v0.4.4 / 2015-03-26
* fixed; error handling click events when the menu is closed, thanks [Ilya Petrov](https://github.com/muromec)
* fixed; issue where options will not be filtered in certain conditions, thanks [G. Kay Lee](https://github.com/gsklee)
## v0.4.3 / 2015-03-25
* added tests and updated dependencies
## v0.4.2 / 2015-03-23
* added; ESLint and contributing guide
* fixed; incorrect `classnames` variable assignment in window scope
* fixed; all ESLint errors and warnings (except invalid JSX undefined/unused vars due to ESLint bug)
* fixed; first option is now focused correctly, thanks [Eivind Siqveland Larsen](https://github.com/esiqveland)
## v0.4.1 / 2015-03-20
* fixed; IE11 issue: clicking on scrollbar within menu no longer closes menu, thanks [Rohit Kalkur](https://github.com/rovolution)
## v0.4.0 / 2015-03-12
* updated; compatible with React 0.13
## v0.3.5 / 2015-03-09
* improved; less/no repaint on scroll for performance wins, thanks [jsmunich](https://github.com/jsmunich)
* added; `onBlur` and `onFocus` event handlers, thanks [Jonas Budelmann](https://github.com/cloudkite)
* added; support for `inputProps` prop, passed to the `<input>` component, thanks [Yann Plantevin](https://github.com/YannPl)
* changed; now using [react-component-gulp-tasks](https://github.com/JedWatson/react-component-gulp-tasks) for build
* fixed; issue w/ remote callbacks overriding cached options, thanks [Corey McMahon](https://github.com/coreymcmahon)
* fixed; if not `this.props.multi`, menu doesn't need handleMouseDown, thanks [wenbing](https://github.com/wenbing)
## v0.3.4 / 2015-02-23
* fixed; issues with the underscore/lodash dependency change, thanks [Aaron Powell](https://github.com/aaronpowell)
## v0.3.3 / 2015-02-22
* added; `disabled` prop, thanks [Danny Shaw](https://github.com/dannyshaw)
* added; `searchable` prop - set to `false` to disable the search box, thanks [Julen Ruiz Aizpuru](https://github.com/julen)
* added; `onOptionLabelClick` prop - see [#66](https://github.com/JedWatson/react-select/pull/66) for docs, thanks [Dmitry Smirnov](https://github.com/dmitry-smirnov)
* fixed; `text-overflow: ellipsis;` typo, thanks [Andru Vallance](https://github.com/andru)
## v0.3.2 / 2015-01-30
* fixed; issue adding undefined values to multiselect, thanks [Tejas Dinkar](https://github.com/gja)
## v0.3.1 / 2015-01-20
* fixed; missing `var` statement
## v0.3.0 / 2015-01-20
* added; node compatible build now available in `/lib`
## v0.2.14 / 2015-01-07
* added; `searchPromptText` property that is displayed when `asyncOptions` is set and there are (a) no options loaded, and (b) no input entered to search on, thanks [Anton Fedchenko](https://github.com/kompot)
* added; `clearable` property (defaults to `true`) to control whether the "clear" control is available, thanks [Anton Fedchenko](https://github.com/kompot)
## v0.2.13 / 2015-01-05
* fixed; height issues in Safari, thanks [Joss Mackison](https://github.com/jossmac)
* added; Option to specify "Clear value" label as prop for i18n
## v0.2.12 / 2015-01-04
* fixed; UI now responds to touch events, and works on mobile devices! thanks [Fraser Xu](https://github.com/fraserxu)
## v0.2.11 / 2015-01-04
* fixed; Options in the dropdown now scroll into view when they are focused, thanks [Adam](https://github.com/fmovlex)
* improved; Example dist is now excluded from the npm package
## v0.2.10 / 2015-01-01
* fixed; More specific mixin name to avoid conflicts (css)
* fixed; Example CSS now correctly rebuilds on changes in development
* fixed; Values are now expanded correctly when options change (see #28)
* added; Option to specify "No results found" label as prop for i18n, thanks [Julen Ruiz Aizpuru](https://github.com/julen)
## v0.2.9 / 2014-12-09
* added; `filterOption` and `filterOptions` props for more control over filtering
## v0.2.8 / 2014-12-08
* added; `matchPos` option to control whether to match the `start` or `any` position in the string when filtering options (default: `any`)
* added; `matchProp` option to control whether to match the `value`, `label` or `any` property of each option when filtering (default: `any`)
## v0.2.7 / 2014-12-01
* fixed; screen-readers will now read "clear value" instead of "times" for the clear button
* fixed; non-left-click mousedown events aren't blocked by the control
## v0.2.6 / 2014-11-30
* improved; better comparison of changes to [options] in `willReceiveProps`
* fixed; now focuses the first option correctly when in multiselect mode
* fixed; fixed focused option behaviour on value change
* fixed; when filtering, there is always a focused option (#19)
* changed; using ^ in package.json to compare dependencies
## v0.2.5 / 2014-11-20
* fixed; compatibility with case-sensitive file systems
## v0.2.4 / 2014-11-20
* fixed; package.json pointed at the right file
## v0.2.3 / 2014-11-17
* fixed; Updating state correctly when props change
* improved; Build tasks and docs
* added; Working standalone build
* added; Minified dist version
* added; Publised to Bower
## v0.2.2 / 2014-11-15
* fixed; backspace event being incorrectly cancelled
## v0.2.1 / 2014-11-15
* fixed; issue where backspace incorrectly clears the value (#14)
## v0.2.0 / 2014-11-15
* changed; Major rewrite to improve focus handling and internal state management
* added; Support for `multi` prop, enable multiselect mode
## v0.1.1 / 2014-11-03
* added; Support for `onChange` event
* added; `propTypes` are defined by the `Select` component now
* added; `className` property, sets the `className` on the outer `div` element
* fixed; Removed deprecated `React.DOM.x` calls
## v0.1.0 / 2014-11-01
* updated; React to 0.12.0
## v0.0.6 / 2014-10-14
* fixed; Error keeping value when using Async Options

21
goTorrentWebUI/node_modules/react-select/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2017 Jed Watson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

451
goTorrentWebUI/node_modules/react-select/README.md generated vendored Normal file
View File

@@ -0,0 +1,451 @@
[![NPM](https://img.shields.io/npm/v/react-select.svg)](https://www.npmjs.com/package/react-select)
[![CDNJS](https://img.shields.io/cdnjs/v/react-select.svg)](https://cdnjs.com/libraries/react-select)
[![Build Status](https://travis-ci.org/JedWatson/react-select.svg?branch=master)](https://travis-ci.org/JedWatson/react-select)
[![Coverage Status](https://coveralls.io/repos/JedWatson/react-select/badge.svg?branch=master&service=github)](https://coveralls.io/github/JedWatson/react-select?branch=master)
[![Supported by Thinkmill](https://thinkmill.github.io/badge/heart.svg)](http://thinkmill.com.au/?utm_source=github&utm_medium=badge&utm_campaign=react-select)
React-Select
============
A Select control built with and for [React](http://facebook.github.io/react/index.html). Initially built for use in [KeystoneJS](http://www.keystonejs.com).
## Demo & Examples
Live demo: [jedwatson.github.io/react-select](http://jedwatson.github.io/react-select/)
## Installation
The easiest way to use react-select is to install it from npm and build it into your app with Webpack.
```js
yarn add react-select
```
You can then import react-select and its styles in your application as follows:
```js
import Select from 'react-select';
import 'react-select/dist/react-select.css';
```
You can also use the standalone UMD build by including `dist/react-select.js` and `dist/react-select.css` in your page. If you do this you'll also need to include the dependencies. For example:
```html
<script src="https://unpkg.com/react@15.6.1/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15.6.1/dist/react-dom.js"></script>
<script src="https://unpkg.com/prop-types@15.5.10/prop-types.js"></script>
<script src="https://unpkg.com/classnames@2.2.5/index.js"></script>
<script src="https://unpkg.com/react-input-autosize@2.0.0/dist/react-input-autosize.js"></script>
<script src="https://unpkg.com/react-select/dist/react-select.js"></script>
<link rel="stylesheet" href="https://unpkg.com/react-select/dist/react-select.css">
```
## Usage
React-Select generates a hidden text field containing the selected value, so you can submit it as part of a standard form. You can also listen for changes with the `onChange` event property.
Options should be provided as an `Array` of `Object`s, each with a `value` and `label` property for rendering and searching. You can use a `disabled` property to indicate whether the option is disabled or not.
The `value` property of each option should be either a string or a number.
When the value is changed, `onChange(selectedValueOrValues)` will fire. Note that (as of 1.0) you **must** handle the change and pass the updated `value` to the Select.
```js
import React from 'react';
import Select from 'react-select';
class App extends React.Component {
state = {
selectedOption: '',
}
handleChange = (selectedOption) => {
this.setState({ selectedOption });
console.log(`Selected: ${selectedOption.label}`);
}
render() {
return (
<Select
name="form-field-name"
value={this.state.value}
onChange={this.handleChange}
options={[
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' },
]}
/>
);
}
}
```
You can customise the `valueKey` and `labelKey` props to use a different option shape.
### Custom classNames
You can provide a custom `className` prop to the `<Select>` component, which will be added to the base `.Select` className for the outer container.
The built-in Options renderer also support custom classNames, just add a `className` property to objects in the `options` array.
### Multiselect options
You can enable multi-value selection by setting `multi={true}`. In this mode:
* Selected options will be removed from the dropdown menu by default. If you want them to remain in the list, set `removeSelected={false}`
* The selected values are submitted in multiple `<input type="hidden">` fields, use the `joinValues` prop to submit joined values in a single field instead
* The values of the selected items are joined using the `delimiter` prop to create the input value when `joinValues` is true
* A simple value, if provided, will be split using the `delimiter` prop
* The `onChange` event provides an array of selected options _or_ a comma-separated string of values (eg `"1,2,3"`) if `simpleValue` is true
* By default, only options in the `options` array can be selected. Use the `Creatable` Component (which wraps `Select`) to allow new options to be created if they do not already exist. Hitting comma (','), ENTER or TAB will add a new option. Versions `0.9.x` and below provided a boolean attribute on the `Select` Component (`allowCreate`) to achieve the same functionality. It is no longer available starting with version `1.0.0`.
* By default, selected options can be cleared. To disable the possibility of clearing a particular option, add `clearableValue: false` to that option:
```js
var options = [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two', clearableValue: false }
];
```
Note: the `clearable` prop of the Select component should also be set to `false` to prevent allowing clearing all fields at once
#### Accessibility Note
Selected values aren't focus targets, which means keyboard users can't tab to them, and are restricted to removing them using backspace in order. This isn't ideal and I'm looking at other options for the future; in the meantime if you want to use a custom `valueComponent` that implements tabIndex and keyboard event handling, see #2098 for an example.
### Async options
If you want to load options asynchronously, use the `Async` export and provide a `loadOptions` Function.
The function takes two arguments `String input, Function callback`and will be called when the input text is changed.
When your async process finishes getting the options, pass them to `callback(err, data)` in a Object `{ options: [] }`.
The select control will intelligently cache options for input strings that have already been fetched. The cached result set will be filtered as more specific searches are input, so if your async process would only return a smaller set of results for a more specific query, also pass `complete: true` in the callback object. Caching can be disabled by setting `cache` to `false` (Note that `complete: true` will then have no effect).
Unless you specify the property `autoload={false}` the control will automatically load the default set of options (i.e. for `input: ''`) when it is mounted.
```js
import { Async } from 'react-select';
const getOptions = (input, callback) => {
setTimeout(() => {
callback(null, {
options: [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' }
],
// CAREFUL! Only set this to true when there are no more options,
// or more specific queries will not be sent to the server.
complete: true
});
}, 500);
};
<Async
name="form-field-name"
loadOptions={getOptions}
/>
```
#### Note about filtering async options
The `Async` component doesn't change the default behaviour for filtering the options based on user input, but if you're already filtering the options server-side you may want to customise or disable this feature (see [filtering options](#filtering-options) below)
### Async options with Promises
`loadOptions` supports Promises, which can be used in very much the same way as callbacks.
Everything that applies to `loadOptions` with callbacks still applies to the Promises approach (e.g. caching, autoload, ...)
An example using the `fetch` API and ES6 syntax, with an API that returns an object like:
```js
import { Async } from 'react-select';
/*
* assuming the API returns something like this:
* const json = [
* { value: 'one', label: 'One' },
* { value: 'two', label: 'Two' }
* ]
*/
const getOptions = (input) => {
return fetch(`/users/${input}.json`)
.then((response) => {
return response.json();
}).then((json) => {
return { options: json };
});
}
<Async
name="form-field-name"
value="one"
loadOptions={getOptions}
/>
```
### Async options loaded externally
If you want to load options asynchronously externally from the `Select` component, you can have the `Select` component show a loading spinner by passing in the `isLoading` prop set to `true`.
```js
import Select from 'react-select';
let isLoadingExternally = true;
<Select
name="form-field-name"
isLoading={isLoadingExternally}
...
/>
```
### User-created tags
The `Creatable` component enables users to create new tags within react-select.
It decorates a `Select` and so it supports all of the default properties (eg single/multi mode, filtering, etc) in addition to a couple of custom ones (shown below).
The easiest way to use it is like so:
```js
import { Creatable } from 'react-select';
function render (selectProps) {
return <Creatable {...selectProps} />;
};
```
### Combining Async and Creatable
Use the `AsyncCreatable` HOC if you want both _async_ and _creatable_ functionality.
It ties `Async` and `Creatable` components together and supports a union of their properties (listed above).
Use it as follows:
```js
import { AsyncCreatable } from 'react-select';
function render (props) {
// props can be a mix of Async, Creatable, and Select properties
return (
<AsyncCreatable {...props} />
);
}
```
### Filtering options
You can control how options are filtered with the following props:
* `matchPos`: `"start"` or `"any"`: whether to match the text entered at the start or any position in the option value
* `matchProp`: `"label"`, `"value"` or `"any"`: whether to match the value, label or both values of each option when filtering
* `ignoreCase`: `Boolean`: whether to ignore case or match the text exactly when filtering
* `ignoreAccents`: `Boolean`: whether to ignore accents on characters like ø or å
`matchProp` and `matchPos` both default to `"any"`.
`ignoreCase` defaults to `true`.
`ignoreAccents` defaults to `true`.
#### Advanced filters
You can also completely replace the method used to filter either a single option, or the entire options array (allowing custom sort mechanisms, etc.)
* `filterOption`: `function(Object option, String filter)` returns `Boolean`. Will override `matchPos`, `matchProp`, `ignoreCase` and `ignoreAccents` options.
* `filterOptions`: `function(Array options, String filter, Array currentValues)` returns `Array filteredOptions`. Will override `filterOption`, `matchPos`, `matchProp`, `ignoreCase` and `ignoreAccents` options.
For multi-select inputs, when providing a custom `filterOptions` method, remember to exclude current values from the returned array of options.
#### Filtering large lists
The default `filterOptions` method scans the options array for matches each time the filter text changes.
This works well but can get slow as the options array grows to several hundred objects.
For larger options lists a custom filter function like [`react-select-fast-filter-options`](https://github.com/bvaughn/react-select-fast-filter-options) will produce better results.
### Efficiently rendering large lists with windowing
The `menuRenderer` property can be used to override the default drop-down list of options.
This should be done when the list is large (hundreds or thousands of items) for faster rendering.
Windowing libraries like [`react-virtualized`](https://github.com/bvaughn/react-virtualized) can then be used to more efficiently render the drop-down menu like so.
The easiest way to do this is with the [`react-virtualized-select`](https://github.com/bvaughn/react-virtualized-select/) HOC.
This component decorates a `Select` and uses the react-virtualized `VirtualScroll` component to render options.
Demo and documentation for this component are available [here](https://bvaughn.github.io/react-virtualized-select/).
You can also specify your own custom renderer.
The custom `menuRenderer` property accepts the following named parameters:
| Parameter | Type | Description |
|:---|:---|:---|
| focusedOption | `Object` | The currently focused option; should be visible in the menu by default. |
| focusOption | `Function` | Callback to focus a new option; receives the option as a parameter. |
| labelKey | `String` | Option labels are accessible with this string key. |
| optionClassName | `String` | The className that gets used for options |
| optionComponent | `ReactClass` | The react component that gets used for rendering an option |
| optionRenderer | `Function` | The function that gets used to render the content of an option |
| options | `Array<Object>` | Ordered array of options to render. |
| selectValue | `Function` | Callback to select a new option; receives the option as a parameter. |
| valueArray | `Array<Object>` | Array of currently selected options. |
### Updating input values with onInputChange
You can manipulate the input by providing a `onInputChange` callback that returns a new value.
**Please note:** When you want to use `onInputChange` only to listen to the input updates, you still have to return the unchanged value!
```js
function cleanInput(inputValue) {
// Strip all non-number characters from the input
return inputValue.replace(/[^0-9]/g, "");
}
<Select
name="form-field-name"
onInputChange={cleanInput}
/>
```
### Overriding default key-down behaviour with onInputKeyDown
`Select` listens to `keyDown` events to select items, navigate drop-down list via arrow keys, etc.
You can extend or override this behaviour by providing a `onInputKeyDown` callback.
```js
function onInputKeyDown(event) {
switch (event.keyCode) {
case 9: // TAB
// Extend default TAB behaviour by doing something here
break;
case 13: // ENTER
// Override default ENTER behaviour by doing stuff here and then preventing default
event.preventDefault();
break;
}
}
<Select
{...otherProps}
onInputKeyDown={onInputKeyDown}
/>
```
### Select Props
| Property | Type | Default | Description |
|:---|:---|:---|:---|
| `aria`-describedby | string | undefined | HTML ID(s) of element(s) that should be used to describe this input (for assistive tech) |
| `aria`-label | string | undefined | Aria label (for assistive tech) |
| `aria`-labelledby | string | undefined | HTML ID of an element that should be used as the label (for assistive tech) |
| `arrowRenderer` | function | undefined | Renders a custom drop-down arrow to be shown in the right-hand side of the select: `arrowRenderer({ onMouseDown, isOpen })`. Won't render when set to `null`
| `autoBlur` | boolean | false | Blurs the input element after a selection has been made. Handy for lowering the keyboard on mobile devices |
| `autofocus` | boolean | undefined | deprecated; use the autoFocus prop instead |
| `autoFocus` | boolean | undefined | autofocus the component on mount |
| `autoload` | boolean | true | whether to auto-load the default async options set |
| `autosize` | boolean | true | If enabled, the input will expand as the length of its value increases |
| `backspaceRemoves` | boolean | true | whether pressing backspace removes the last item when there is no input value |
| `backspaceToRemoveMessage` | string | 'Press backspace to remove {last label}' | prompt shown in input when at least one option in a multiselect is shown, set to '' to clear |
| `className` | string | undefined | className for the outer element |
| `clearable` | boolean | true | should it be possible to reset value |
| `clearAllText` | string | 'Clear all' | title for the "clear" control when `multi` is true |
| `clearRenderer` | function | undefined | Renders a custom clear to be shown in the right-hand side of the select when clearable true: `clearRenderer()` |
| `clearValueText` | string | 'Clear value' | title for the "clear" control |
| `closeOnSelect` | boolean | true | whether to close the menu when a value is selected
| `deleteRemoves` | boolean | true | whether pressing delete key removes the last item when there is no input value |
| `delimiter` | string | ',' | delimiter to use to join multiple values |
| `disabled` | boolean | false | whether the Select is disabled or not |
| `escapeClearsValue` | boolean | true | whether escape clears the value when the menu is closed |
| `filterOption` | function | undefined | method to filter a single option `(option, filterString) => boolean` |
| `filterOptions` | boolean or function | undefined | boolean to enable default filtering or function to filter the options array `([options], filterString, [values]) => [options]` |
| `id` | string | undefined | html id to set on the input element for accessibility or tests
| `ignoreAccents` | boolean | true | whether to strip accents when filtering |
| `ignoreCase` | boolean | true | whether to perform case-insensitive filtering |
| `inputProps` | object | undefined | custom attributes for the Input (in the Select-control) e.g: `{'data-foo': 'bar'}` |
| `inputRenderer` | function | undefined | renders a custom input component |
| `instanceId` | string | increment | instance ID used internally to set html ids on elements for accessibility, specify for universal rendering |
| `isLoading` | boolean | false | whether the Select is loading externally or not (such as options being loaded) |
| `joinValues` | boolean | false | join multiple values into a single hidden input using the `delimiter` |
| `labelKey` | string | 'label' | the option property to use for the label |
| `matchPos` | string | 'any' | (any, start) match the start or entire string when filtering |
| `matchProp` | string | 'any' | (any, label, value) which option property to filter on |
| `menuBuffer` | number | 0 | buffer of px between the base of the dropdown and the viewport to shift if menu doesnt fit in viewport |
| `menuContainerStyle` | object | undefined | optional style to apply to the menu container |
| `menuRenderer` | function | undefined | Renders a custom menu with options; accepts the following named parameters: `menuRenderer({ focusedOption, focusOption, options, selectValue, valueArray })` |
| `menuStyle` | object | undefined | optional style to apply to the menu |
| `multi` | boolean | undefined | multi-value input |
| `name` | string | undefined | field name, for hidden `<input />` tag |
| `noResultsText` | string | 'No results found' | placeholder displayed when there are no matching search results or a falsy value to hide it (can also be a react component) |
| `onBlur` | function | undefined | onBlur handler: `function(event) {}` |
| `onBlurResetsInput` | boolean | true | whether to clear input on blur or not |
| `onChange` | function | undefined | onChange handler: `function(newOption) {}` |
| `onClose` | function | undefined | handler for when the menu closes: `function () {}` |
| `onCloseResetsInput` | boolean | true | whether to clear input when closing the menu through the arrow |
| `onFocus` | function | undefined | onFocus handler: `function(event) {}` |
| `onInputChange` | function | undefined | onInputChange handler/interceptor: `function(inputValue: string): string` |
| `onInputKeyDown` | function | undefined | input keyDown handler; call `event.preventDefault()` to override default `Select` behaviour: `function(event) {}` |
| `onMenuScrollToBottom` | function | undefined | called when the menu is scrolled to the bottom |
| `onOpen` | function | undefined | handler for when the menu opens: `function () {}` |
| `onSelectResetsInput` | boolean | true | whether the input value should be reset when options are selected, for `multi`
| `onValueClick` | function | undefined | onClick handler for value labels: `function (value, event) {}` |
| `openOnClick` | boolean | true | open the options menu when the control is clicked (requires searchable = true) |
| `openOnFocus` | boolean | false | open the options menu when the control gets focus |
| `optionClassName`: string | undefined | additional class(es) to apply to the <Option /> elements
| `optionComponent` | function | undefined | option component to render in dropdown |
| `optionRenderer` | function | undefined | custom function to render the options in the menu |
| `options` | array | undefined | array of options |
| `removeSelected` | boolean | true | whether the selected option is removed from the dropdown on multi selects |
| `pageSize` | number | 5 | number of options to jump when using page up/down keys |
| `placeholder` | string or node | 'Select ...' | field placeholder, displayed when there's no value |
| `required` | boolean | false | applies HTML5 required attribute when needed |
| `resetValue` | any | null | value to set when the control is cleared |
| `rtl` | boolean | false | use react-select in right-to-left direction |
| `scrollMenuIntoView` | boolean | true | whether the viewport will shift to display the entire menu when engaged |
| `searchable` | boolean | true | whether to enable searching feature or not |
| `searchPromptText` | string or node | 'Type to search' | label to prompt for search input |
| `simpleValue` | boolean | false | pass the value to onChange as a string |
| `style` | object | undefined | optional styles to apply to the control |
| `tabIndex` | string or number | undefined | tabIndex of the control |
| `tabSelectsValue` | boolean | true | whether to select the currently focused value when the `[tab]` key is pressed |
| `trimFilter` | boolean | false | whether to trim whitespace from the filter value |
| `value` | any | undefined | initial field value |
| `valueComponent` | function | <Value /> | function which returns a custom way to render/manage the value selected `<CustomValue />` |
| `valueKey` | string | 'value' | the option property to use for the value |
| `valueRenderer` | function | undefined | function which returns a custom way to render the value selected `function (option) {}` |
| `wrapperStyle` | object | undefined | optional styles to apply to the component wrapper |
#### Async Props
| Property | Type | Default | Description |
|:---|:---|:---|:---|
| `autoload` | boolean | true | automatically call the `loadOptions` prop on-mount |
| `cache` | object | undefined | Sets the cache object used for options. Set to `false` if you would like to disable caching.
| `loadingPlaceholder` | string or node | 'Loading...' | label to prompt for loading search result |
| `loadOptions` | function | undefined | function that returns a promise or calls a callback with the options: `function(input, [callback])` |
#### Creatable properties
| Property | Type | Description |
:---|:---|:---|
| `children` | function | Child function responsible for creating the inner Select component. This component can be used to compose HOCs (eg Creatable and Async). Expected signature: `(props: Object): PropTypes.element` |
| `isOptionUnique` | function | Searches for any matching option within the set of options. This function prevents duplicate options from being created. By default this is a basic, case-sensitive comparison of label and value. Expected signature: `({ option: Object, options: Array, labelKey: string, valueKey: string }): boolean` |
| `isValidNewOption` | function | Determines if the current input text represents a valid option. By default any non-empty string will be considered valid. Expected signature: `({ label: string }): boolean` |
| `newOptionCreator` | function | Factory to create new option. Expected signature: `({ label: string, labelKey: string, valueKey: string }): Object` |
| `onNewOptionClick` | function | new option click handler, it calls when new option has been selected. `function(option) {}` |
| `shouldKeyDownEventCreateNewOption` | function | Decides if a keyDown event (eg its `keyCode`) should result in the creation of a new option. ENTER, TAB and comma keys create new options by default. Expected signature: `({ keyCode: number }): boolean` |
| `promptTextCreator` | function | Factory for overriding default option creator prompt label. By default it will read 'Create option "{label}"'. Expected signature: `(label: String): String` |
### Methods
Use the `focus()` method to give the control focus. All other methods on `<Select>` elements should be considered private.
```js
// focuses the input element
<instance>.focus();
```
# Contributing
See our [CONTRIBUTING.md](https://github.com/JedWatson/react-select/blob/master/CONTRIBUTING.md) for information on how to contribute.
Thanks to the projects this was inspired by: [Selectize](http://selectize.github.io/selectize.js/) (in terms of behaviour and user experience), [React-Autocomplete](https://github.com/rackt/react-autocomplete) (as a quality React Combobox implementation), as well as other select controls including [Chosen](http://harvesthq.github.io/chosen/) and [Select2](http://ivaynberg.github.io/select2/).
# License
MIT Licensed. Copyright (c) Jed Watson 2017.

View File

@@ -0,0 +1,426 @@
/**
* React Select
* ============
* Created by Jed Watson and Joss Mackison for KeystoneJS, http://www.keystonejs.com/
* https://twitter.com/jedwatson https://twitter.com/jossmackison https://twitter.com/keystonejs
* MIT License: https://github.com/JedWatson/react-select
*/
.Select {
position: relative;
}
.Select input::-webkit-contacts-auto-fill-button,
.Select input::-webkit-credentials-auto-fill-button {
display: none !important;
}
.Select input::-ms-clear {
display: none !important;
}
.Select input::-ms-reveal {
display: none !important;
}
.Select,
.Select div,
.Select input,
.Select span {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.Select.is-disabled .Select-arrow-zone {
cursor: default;
pointer-events: none;
opacity: 0.35;
}
.Select.is-disabled > .Select-control {
background-color: #f9f9f9;
}
.Select.is-disabled > .Select-control:hover {
box-shadow: none;
}
.Select.is-open > .Select-control {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
background: #fff;
border-color: #b3b3b3 #ccc #d9d9d9;
}
.Select.is-open > .Select-control .Select-arrow {
top: -2px;
border-color: transparent transparent #999;
border-width: 0 5px 5px;
}
.Select.is-searchable.is-open > .Select-control {
cursor: text;
}
.Select.is-searchable.is-focused:not(.is-open) > .Select-control {
cursor: text;
}
.Select.is-focused > .Select-control {
background: #fff;
}
.Select.is-focused:not(.is-open) > .Select-control {
border-color: #007eff;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 0 3px rgba(0, 126, 255, 0.1);
background: #fff;
}
.Select.has-value.is-clearable.Select--single > .Select-control .Select-value {
padding-right: 42px;
}
.Select.has-value.Select--single > .Select-control .Select-value .Select-value-label,
.Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label {
color: #333;
}
.Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label,
.Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label {
cursor: pointer;
text-decoration: none;
}
.Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:hover,
.Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:hover,
.Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:focus,
.Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:focus {
color: #007eff;
outline: none;
text-decoration: underline;
}
.Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:focus,
.Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:focus {
background: #fff;
}
.Select.has-value.is-pseudo-focused .Select-input {
opacity: 0;
}
.Select.is-open .Select-arrow,
.Select .Select-arrow-zone:hover > .Select-arrow {
border-top-color: #666;
}
.Select.Select--rtl {
direction: rtl;
text-align: right;
}
.Select-control {
background-color: #fff;
border-color: #d9d9d9 #ccc #b3b3b3;
border-radius: 4px;
border: 1px solid #ccc;
color: #333;
cursor: default;
display: table;
border-spacing: 0;
border-collapse: separate;
height: 36px;
outline: none;
overflow: hidden;
position: relative;
width: 100%;
}
.Select-control:hover {
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.Select-control .Select-input:focus {
outline: none;
background: #fff;
}
.Select-placeholder,
.Select--single > .Select-control .Select-value {
bottom: 0;
color: #aaa;
left: 0;
line-height: 34px;
padding-left: 10px;
padding-right: 10px;
position: absolute;
right: 0;
top: 0;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.Select-input {
height: 34px;
padding-left: 10px;
padding-right: 10px;
vertical-align: middle;
}
.Select-input > input {
width: 100%;
background: none transparent;
border: 0 none;
box-shadow: none;
cursor: default;
display: inline-block;
font-family: inherit;
font-size: inherit;
margin: 0;
outline: none;
line-height: 17px;
/* For IE 8 compatibility */
padding: 8px 0 12px;
/* For IE 8 compatibility */
-webkit-appearance: none;
}
.is-focused .Select-input > input {
cursor: text;
}
.has-value.is-pseudo-focused .Select-input {
opacity: 0;
}
.Select-control:not(.is-searchable) > .Select-input {
outline: none;
}
.Select-loading-zone {
cursor: pointer;
display: table-cell;
position: relative;
text-align: center;
vertical-align: middle;
width: 16px;
}
.Select-loading {
-webkit-animation: Select-animation-spin 400ms infinite linear;
-o-animation: Select-animation-spin 400ms infinite linear;
animation: Select-animation-spin 400ms infinite linear;
width: 16px;
height: 16px;
box-sizing: border-box;
border-radius: 50%;
border: 2px solid #ccc;
border-right-color: #333;
display: inline-block;
position: relative;
vertical-align: middle;
}
.Select-clear-zone {
-webkit-animation: Select-animation-fadeIn 200ms;
-o-animation: Select-animation-fadeIn 200ms;
animation: Select-animation-fadeIn 200ms;
color: #999;
cursor: pointer;
display: table-cell;
position: relative;
text-align: center;
vertical-align: middle;
width: 17px;
}
.Select-clear-zone:hover {
color: #D0021B;
}
.Select-clear {
display: inline-block;
font-size: 18px;
line-height: 1;
}
.Select--multi .Select-clear-zone {
width: 17px;
}
.Select-arrow-zone {
cursor: pointer;
display: table-cell;
position: relative;
text-align: center;
vertical-align: middle;
width: 25px;
padding-right: 5px;
}
.Select--rtl .Select-arrow-zone {
padding-right: 0;
padding-left: 5px;
}
.Select-arrow {
border-color: #999 transparent transparent;
border-style: solid;
border-width: 5px 5px 2.5px;
display: inline-block;
height: 0;
width: 0;
position: relative;
}
.Select-control > *:last-child {
padding-right: 5px;
}
.Select--multi .Select-multi-value-wrapper {
display: inline-block;
}
.Select .Select-aria-only {
position: absolute;
display: inline-block;
height: 1px;
width: 1px;
margin: -1px;
clip: rect(0, 0, 0, 0);
overflow: hidden;
float: left;
}
@-webkit-keyframes Select-animation-fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes Select-animation-fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.Select-menu-outer {
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
background-color: #fff;
border: 1px solid #ccc;
border-top-color: #e6e6e6;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
box-sizing: border-box;
margin-top: -1px;
max-height: 200px;
position: absolute;
top: 100%;
width: 100%;
z-index: 1;
-webkit-overflow-scrolling: touch;
}
.Select-menu {
max-height: 198px;
overflow-y: auto;
}
.Select-option {
box-sizing: border-box;
background-color: #fff;
color: #666666;
cursor: pointer;
display: block;
padding: 8px 10px;
}
.Select-option:last-child {
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.Select-option.is-selected {
background-color: #f5faff;
/* Fallback color for IE 8 */
background-color: rgba(0, 126, 255, 0.04);
color: #333;
}
.Select-option.is-focused {
background-color: #ebf5ff;
/* Fallback color for IE 8 */
background-color: rgba(0, 126, 255, 0.08);
color: #333;
}
.Select-option.is-disabled {
color: #cccccc;
cursor: default;
}
.Select-noresults {
box-sizing: border-box;
color: #999999;
cursor: default;
display: block;
padding: 8px 10px;
}
.Select--multi .Select-input {
vertical-align: middle;
margin-left: 10px;
padding: 0;
}
.Select--multi.Select--rtl .Select-input {
margin-left: 0;
margin-right: 10px;
}
.Select--multi.has-value .Select-input {
margin-left: 5px;
}
.Select--multi .Select-value {
background-color: #ebf5ff;
/* Fallback color for IE 8 */
background-color: rgba(0, 126, 255, 0.08);
border-radius: 2px;
border: 1px solid #c2e0ff;
/* Fallback color for IE 8 */
border: 1px solid rgba(0, 126, 255, 0.24);
color: #007eff;
display: inline-block;
font-size: 0.9em;
line-height: 1.4;
margin-left: 5px;
margin-top: 5px;
vertical-align: top;
}
.Select--multi .Select-value-icon,
.Select--multi .Select-value-label {
display: inline-block;
vertical-align: middle;
}
.Select--multi .Select-value-label {
border-bottom-right-radius: 2px;
border-top-right-radius: 2px;
cursor: default;
padding: 2px 5px;
}
.Select--multi a.Select-value-label {
color: #007eff;
cursor: pointer;
text-decoration: none;
}
.Select--multi a.Select-value-label:hover {
text-decoration: underline;
}
.Select--multi .Select-value-icon {
cursor: pointer;
border-bottom-left-radius: 2px;
border-top-left-radius: 2px;
border-right: 1px solid #c2e0ff;
/* Fallback color for IE 8 */
border-right: 1px solid rgba(0, 126, 255, 0.24);
padding: 1px 5px 3px;
}
.Select--multi .Select-value-icon:hover,
.Select--multi .Select-value-icon:focus {
background-color: #d8eafd;
/* Fallback color for IE 8 */
background-color: rgba(0, 113, 230, 0.08);
color: #0071e6;
}
.Select--multi .Select-value-icon:active {
background-color: #c2e0ff;
/* Fallback color for IE 8 */
background-color: rgba(0, 126, 255, 0.24);
}
.Select--multi.Select--rtl .Select-value {
margin-left: 0;
margin-right: 5px;
}
.Select--multi.Select--rtl .Select-value-icon {
border-right: none;
border-left: 1px solid #c2e0ff;
/* Fallback color for IE 8 */
border-left: 1px solid rgba(0, 126, 255, 0.24);
}
.Select--multi.is-disabled .Select-value {
background-color: #fcfcfc;
border: 1px solid #e3e3e3;
color: #333;
}
.Select--multi.is-disabled .Select-value-icon {
cursor: not-allowed;
border-right: 1px solid #e3e3e3;
}
.Select--multi.is-disabled .Select-value-icon:hover,
.Select--multi.is-disabled .Select-value-icon:focus,
.Select--multi.is-disabled .Select-value-icon:active {
background-color: #fcfcfc;
}
@keyframes Select-animation-spin {
to {
transform: rotate(1turn);
}
}
@-webkit-keyframes Select-animation-spin {
to {
-webkit-transform: rotate(1turn);
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,322 @@
//
// Control
// ------------------------------
// Mixins
// focused styles
.Select-focus-state(@color) {
border-color: @color;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 0 3px fade(@color, 10%);
background: @select-input-bg-focus;
}
// "classic" focused styles: maintain for legacy
.Select-focus-state-classic() {
border-color: @select-input-border-focus lighten(@select-input-border-focus, 5%) lighten(@select-input-border-focus, 5%);
box-shadow: @select-input-box-shadow-focus;
background: @select-input-bg-focus;
}
// base
.Select {
position: relative;
// disable some browser-specific behaviours that break the input
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
display: none !important;
}
input::-ms-clear {
display: none !important;
}
input::-ms-reveal {
display: none !important;
}
// preferred box model
&,
& div,
& input,
& span {
.box-sizing(border-box);
}
// handle disabled state
&.is-disabled {
.Select-arrow-zone {
cursor: default;
pointer-events: none;
opacity: 0.35;
}
> .Select-control {
background-color: @select-input-bg-disabled;
&:hover {
box-shadow: none;
}
}
}
&.is-open > .Select-control {
.border-bottom-radius( 0 );
background: @select-input-bg;
border-color: darken(@select-input-border-color, 10%) @select-input-border-color lighten(@select-input-border-color, 5%);
// flip the arrow so its pointing up when the menu is open
.Select-arrow {
top: -2px;
border-color: transparent transparent @select-arrow-color;
border-width: 0 @select-arrow-width @select-arrow-width;
}
}
&.is-searchable {
&.is-open > .Select-control {
cursor: text;
}
&.is-focused:not(.is-open) > .Select-control {
cursor: text;
}
}
&.is-focused > .Select-control {
background: @select-input-bg-focus;
}
&.is-focused:not(.is-open) > .Select-control {
.Select-focus-state(@select-input-border-focus);
}
&.has-value.is-clearable.Select--single > .Select-control .Select-value {
padding-right: (@select-clear-width + @select-arrow-width * 5);
}
&.has-value.Select--single > .Select-control .Select-value,
&.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value {
.Select-value-label {
color: @select-text-color;
}
a.Select-value-label {
cursor: pointer;
text-decoration: none;
&:hover,
&:focus {
color: @select-link-hover-color;
outline: none;
text-decoration: underline;
}
&:focus {
background: @select-input-bg-focus;
}
}
}
// fake-hide the input when the control is pseudo-focused
&.has-value.is-pseudo-focused .Select-input {
opacity: 0;
}
&.is-open .Select-arrow,
.Select-arrow-zone:hover > .Select-arrow {
border-top-color: @select-arrow-color-hover;
}
&.Select--rtl {
direction: rtl;
text-align: right;
}
}
// base
.Select-control {
background-color: @select-input-bg;
border-color: lighten(@select-input-border-color, 5%) @select-input-border-color darken(@select-input-border-color, 10%);
border-radius: @select-input-border-radius;
border: @select-input-border-width solid @select-input-border-color;
color: @select-text-color;
cursor: default;
display: table;
border-spacing: 0;
border-collapse: separate;
height: @select-input-height;
outline: none;
overflow: hidden;
position: relative;
width: 100%;
&:hover {
box-shadow: @select-input-hover-box-shadow;
}
.Select-input:focus {
outline: none;
background: @select-input-bg-focus;
}
}
// placeholder
.Select-placeholder,
.Select--single > .Select-control .Select-value {
bottom: 0;
color: @select-input-placeholder;
left: 0;
line-height: @select-input-internal-height;
padding-left: @select-padding-horizontal;
padding-right: @select-padding-horizontal;
position: absolute;
right: 0;
top: 0;
// crop text
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
// the <input> element users type in
.Select-input {
// inherits `display: inline-block` from "react-input-autosize"
height: @select-input-internal-height;
padding-left: @select-padding-horizontal;
padding-right: @select-padding-horizontal;
vertical-align: middle;
> input {
width: 100%;
background: none transparent;
border: 0 none;
box-shadow: none;
cursor: default;
display: inline-block;
font-family: inherit;
font-size: inherit;
// height: @select-input-internal-height;
margin: 0;
outline: none;
// padding: 0;
line-height: 17px; /* For IE 8 compatibility */
padding: ((@select-input-internal-height - 14) / 2 - 2) 0 ((@select-input-internal-height - 14) / 2 + 2); /* For IE 8 compatibility */
-webkit-appearance: none;
.is-focused & {
cursor: text;
}
}
}
// fake-hide the input when the control is pseudo-focused
.has-value.is-pseudo-focused .Select-input {
opacity: 0;
}
// fake input
.Select-control:not(.is-searchable) > .Select-input {
outline: none;
}
// loading indicator
.Select-loading-zone {
cursor: pointer;
display: table-cell;
position: relative;
text-align: center;
vertical-align: middle;
width: @select-loading-size;
}
.Select-loading {
.Select-spinner(@select-loading-size, @select-loading-color-bg, @select-loading-color);
vertical-align: middle;
}
// the little cross that clears the field
.Select-clear-zone {
.animation( Select-animation-fadeIn 200ms );
color: @select-clear-color;
cursor: pointer;
display: table-cell;
position: relative;
text-align: center;
vertical-align: middle;
width: @select-clear-width;
&:hover {
color: @select-clear-hover-color;
}
}
.Select-clear {
display: inline-block;
font-size: @select-clear-size;
line-height: 1;
}
.Select--multi .Select-clear-zone {
width: @select-clear-width;
}
// arrow indicator
.Select-arrow-zone {
cursor: pointer;
display: table-cell;
position: relative;
text-align: center;
vertical-align: middle;
width: (@select-arrow-width * 5);
padding-right: @select-arrow-width;
.Select--rtl & {
padding-right: 0;
padding-left: @select-arrow-width;
}
}
.Select-arrow {
border-color: @select-arrow-color transparent transparent;
border-style: solid;
border-width: @select-arrow-width @select-arrow-width (@select-arrow-width / 2);
display: inline-block;
height: 0;
width: 0;
position: relative;
}
.Select-control > *:last-child {
padding-right: @select-right-padding;
}
.Select--multi .Select-multi-value-wrapper {
display: inline-block;
}
.Select .Select-aria-only {
position: absolute;
display: inline-block;
height: 1px;
width: 1px;
margin: -1px;
clip: rect(0,0,0,0);
overflow: hidden;
float: left;
}
// Animation
// ------------------------------
// fade in
@-webkit-keyframes Select-animation-fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes Select-animation-fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}

View File

@@ -0,0 +1 @@
@import "select.less";

View File

@@ -0,0 +1,79 @@
//
// Select Menu
// ------------------------------
// wrapper around the menu
.Select-menu-outer {
// Unfortunately, having both border-radius and allows scrolling using overflow defined on the same
// element forces the browser to repaint on scroll. However, if these definitions are split into an
// outer and an inner element, the browser is able to optimize the scrolling behavior and does not
// have to repaint on scroll.
.border-bottom-radius( @select-input-border-radius );
background-color: @select-input-bg;
border: 1px solid @select-input-border-color;
border-top-color: mix(@select-input-bg, @select-input-border-color, 50%);
box-shadow: @select-menu-box-shadow;
box-sizing: border-box;
margin-top: -1px;
max-height: @select-menu-max-height;
position: absolute;
top: 100%;
width: 100%;
z-index: @select-menu-zindex;
-webkit-overflow-scrolling: touch;
}
// wrapper
.Select-menu {
max-height: (@select-menu-max-height - 2px);
overflow-y: auto;
}
// options
.Select-option {
box-sizing: border-box;
background-color: @select-option-bg;
color: @select-option-color;
cursor: pointer;
display: block;
padding: @select-padding-vertical @select-padding-horizontal;
&:last-child {
.border-bottom-radius( @select-input-border-radius );
}
&.is-selected {
background-color: @select-option-selected-bg-fb; /* Fallback color for IE 8 */
background-color: @select-option-selected-bg;
color: @select-option-selected-color;
}
&.is-focused {
background-color: @select-option-focused-bg-fb; /* Fallback color for IE 8 */
background-color: @select-option-focused-bg;
color: @select-option-focused-color;
}
&.is-disabled {
color: @select-option-disabled-color;
cursor: default;
}
}
// no results
.Select-noresults {
box-sizing: border-box;
color: @select-noresults-color;
cursor: default;
display: block;
padding: @select-padding-vertical @select-padding-horizontal;
}

View File

@@ -0,0 +1,56 @@
//
// Mixins
// ------------------------------
// Utilities
.size(@width; @height) {
width: @width;
height: @height;
}
.square(@size) {
.size(@size; @size);
}
.border-top-radius(@radius) {
border-top-right-radius: @radius;
border-top-left-radius: @radius;
}
.border-right-radius(@radius) {
border-bottom-right-radius: @radius;
border-top-right-radius: @radius;
}
.border-bottom-radius(@radius) {
border-bottom-right-radius: @radius;
border-bottom-left-radius: @radius;
}
.border-left-radius(@radius) {
border-bottom-left-radius: @radius;
border-top-left-radius: @radius;
}
// Vendor Prefixes
.animation(@animation) {
-webkit-animation: @animation;
-o-animation: @animation;
animation: @animation;
}
.box-sizing(@boxmodel) {
-webkit-box-sizing: @boxmodel;
-moz-box-sizing: @boxmodel;
box-sizing: @boxmodel;
}
.rotate(@degrees) {
-webkit-transform: rotate(@degrees);
-ms-transform: rotate(@degrees); // IE9 only
-o-transform: rotate(@degrees);
transform: rotate(@degrees);
}
.transform(@transform) {
-webkit-transform: @transform;
-moz-transform: @transform;
-ms-transform: @transform;
transform: @transform;
}

View File

@@ -0,0 +1,117 @@
//
// Multi-Select
// ------------------------------
// Base
.Select--multi {
// add margin to the input element
.Select-input {
vertical-align: middle;
// border: 1px solid transparent;
margin-left: @select-padding-horizontal;
padding: 0;
}
&.Select--rtl .Select-input {
margin-left: 0;
margin-right: @select-padding-horizontal;
}
// reduce margin once there is value
&.has-value .Select-input {
margin-left: @select-item-gutter;
}
// Items
.Select-value {
background-color: @select-item-bg-fb; /* Fallback color for IE 8 */
background-color: @select-item-bg;
border-radius: @select-item-border-radius;
border: 1px solid @select-item-border-color-fb; /* Fallback color for IE 8 */
border: 1px solid @select-item-border-color;
color: @select-item-color;
display: inline-block;
font-size: @select-item-font-size;
line-height: 1.4;
margin-left: @select-item-gutter;
margin-top: @select-item-gutter;
vertical-align: top;
}
// common
.Select-value-icon,
.Select-value-label {
display: inline-block;
vertical-align: middle;
}
// label
.Select-value-label {
.border-right-radius( @select-item-border-radius );
cursor: default;
padding: @select-item-padding-vertical @select-item-padding-horizontal;
}
a.Select-value-label {
color: @select-item-color;
cursor: pointer;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
// icon
.Select-value-icon {
cursor: pointer;
.border-left-radius( @select-item-border-radius );
border-right: 1px solid @select-item-border-color-fb; /* Fallback color for IE 8 */
border-right: 1px solid @select-item-border-color;
// move the baseline up by 1px
padding: (@select-item-padding-vertical - 1) @select-item-padding-horizontal (@select-item-padding-vertical + 1);
&:hover,
&:focus {
background-color: @select-item-hover-bg-fb; /* Fallback color for IE 8 */
background-color: @select-item-hover-bg;
color: @select-item-hover-color;
}
&:active {
background-color: @select-item-border-color-fb; /* Fallback color for IE 8 */
background-color: @select-item-border-color;
}
}
&.Select--rtl {
.Select-value {
margin-left: 0;
margin-right: @select-item-gutter;
}
.Select-value-icon {
border-right: none;
border-left: 1px solid @select-item-border-color-fb; /* Fallback color for IE 8 */
border-left: 1px solid @select-item-border-color;
}
}
}
.Select--multi.is-disabled {
.Select-value {
background-color: @select-item-disabled-bg;
border: 1px solid @select-item-disabled-border-color;
color: @select-item-disabled-color;
}
// icon
.Select-value-icon {
cursor: not-allowed;
border-right: 1px solid @select-item-disabled-border-color;
&:hover,
&:focus,
&:active {
background-color: @select-item-disabled-bg;
}
}
}

View File

@@ -0,0 +1,95 @@
/**
* React Select
* ============
* Created by Jed Watson and Joss Mackison for KeystoneJS, http://www.keystonejs.com/
* https://twitter.com/jedwatson https://twitter.com/jossmackison https://twitter.com/keystonejs
* MIT License: https://github.com/JedWatson/react-select
*/
// Variables
// ------------------------------
// common
@select-primary-color: #007eff;
// control options
@select-input-bg: #fff;
@select-input-bg-disabled: #f9f9f9;
@select-input-bg-focus: @select-input-bg;
@select-input-border-color: #ccc;
@select-input-border-radius: 4px;
@select-input-border-focus: @select-primary-color;
@select-input-box-shadow-focus: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 5px -1px fade(@select-input-border-focus, 50%);
@select-input-border-width: 1px;
@select-input-height: 36px;
@select-input-internal-height: (@select-input-height - (@select-input-border-width * 2));
@select-input-placeholder: #aaa;
@select-text-color: #333;
@select-link-hover-color: @select-input-border-focus;
@select-input-hover-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
@select-padding-vertical: 8px;
@select-padding-horizontal: 10px;
// menu options
@select-menu-zindex: 1;
@select-menu-max-height: 200px;
@select-menu-box-shadow: @select-input-hover-box-shadow;
@select-option-color: lighten(@select-text-color, 20%);
@select-option-bg: @select-input-bg;
@select-option-focused-color: @select-text-color;
@select-option-focused-bg: fade(@select-primary-color, 8%);
@select-option-focused-bg-fb: mix(@select-primary-color, @select-option-bg, 8%); // Fallback color for IE 8
@select-option-selected-color: @select-text-color;
@select-option-selected-bg: fade(@select-primary-color, 4%);
@select-option-selected-bg-fb: mix(@select-primary-color, @select-option-bg, 4%); // Fallback color for IE 8
@select-option-disabled-color: lighten(@select-text-color, 60%);
@select-noresults-color: lighten(@select-text-color, 40%);
// clear "x" button
@select-clear-size: floor((@select-input-height / 2));
@select-clear-color: #999;
@select-clear-hover-color: #D0021B; // red
@select-clear-width: (@select-input-internal-height / 2);
// arrow indicator
@select-arrow-color: #999;
@select-arrow-color-hover: #666;
@select-arrow-width: 5px;
// loading indicator
@select-loading-size: 16px;
@select-loading-color: @select-text-color;
@select-loading-color-bg: @select-input-border-color;
@select-right-padding: 5px;
// multi-select item
@select-item-font-size: .9em;
@select-item-bg: fade(@select-primary-color, 8%);
@select-item-bg-fb: mix(@select-primary-color, @select-input-bg, 8%); // Fallback color for IE 8
@select-item-color: @select-primary-color;
@select-item-border-color: fade(@select-primary-color, 24%);
@select-item-border-color-fb: mix(@select-primary-color, @select-input-bg, 24%); // Fallback color for IE 8
@select-item-hover-color: darken(@select-item-color, 5%);
@select-item-hover-bg: darken(@select-item-bg, 5%);
@select-item-hover-bg-fb: mix(darken(@select-primary-color, 5%), @select-item-bg-fb, 8%); // Fallback color for IE 8
@select-item-disabled-color: #333;
@select-item-disabled-bg: #fcfcfc;
@select-item-disabled-border-color: darken(@select-item-disabled-bg, 10%);
@select-item-border-radius: 2px;
@select-item-gutter: 5px;
@select-item-padding-horizontal: 5px;
@select-item-padding-vertical: 2px;
// imports
@import "control.less";
@import "menu.less";
@import "mixins.less";
@import "multi.less";
@import "spinner.less";

View File

@@ -0,0 +1,22 @@
//
// Spinner
// ------------------------------
.Select-spinner(@size, @orbit, @satellite) {
.animation( Select-animation-spin 400ms infinite linear );
.square(@size);
box-sizing: border-box;
border-radius: 50%;
border: floor((@size / 8)) solid @orbit;
border-right-color: @satellite;
display: inline-block;
position: relative;
}
@keyframes Select-animation-spin {
to { transform: rotate(1turn); }
}
@-webkit-keyframes Select-animation-spin {
to { -webkit-transform: rotate(1turn); }
}

274
goTorrentWebUI/node_modules/react-select/lib/Async.js generated vendored Normal file
View File

@@ -0,0 +1,274 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Select = require('./Select');
var _Select2 = _interopRequireDefault(_Select);
var _stripDiacritics = require('./utils/stripDiacritics');
var _stripDiacritics2 = _interopRequireDefault(_stripDiacritics);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var propTypes = {
autoload: _propTypes2.default.bool.isRequired, // automatically call the `loadOptions` prop on-mount; defaults to true
cache: _propTypes2.default.any, // object to use to cache results; set to null/false to disable caching
children: _propTypes2.default.func.isRequired, // Child function responsible for creating the inner Select component; (props: Object): PropTypes.element
ignoreAccents: _propTypes2.default.bool, // strip diacritics when filtering; defaults to true
ignoreCase: _propTypes2.default.bool, // perform case-insensitive filtering; defaults to true
loadOptions: _propTypes2.default.func.isRequired, // callback to load options asynchronously; (inputValue: string, callback: Function): ?Promise
loadingPlaceholder: _propTypes2.default.oneOfType([// replaces the placeholder while options are loading
_propTypes2.default.string, _propTypes2.default.node]),
multi: _propTypes2.default.bool, // multi-value input
noResultsText: _propTypes2.default.oneOfType([// field noResultsText, displayed when no options come back from the server
_propTypes2.default.string, _propTypes2.default.node]),
onChange: _propTypes2.default.func, // onChange handler: function (newValue) {}
onInputChange: _propTypes2.default.func, // optional for keeping track of what is being typed
options: _propTypes2.default.array.isRequired, // array of options
placeholder: _propTypes2.default.oneOfType([// field placeholder, displayed when there's no value (shared with Select)
_propTypes2.default.string, _propTypes2.default.node]),
searchPromptText: _propTypes2.default.oneOfType([// label to prompt for search input
_propTypes2.default.string, _propTypes2.default.node]),
value: _propTypes2.default.any // initial field value
};
var defaultCache = {};
var defaultProps = {
autoload: true,
cache: defaultCache,
children: defaultChildren,
ignoreAccents: true,
ignoreCase: true,
loadingPlaceholder: 'Loading...',
options: [],
searchPromptText: 'Type to search'
};
var Async = function (_Component) {
_inherits(Async, _Component);
function Async(props, context) {
_classCallCheck(this, Async);
var _this = _possibleConstructorReturn(this, (Async.__proto__ || Object.getPrototypeOf(Async)).call(this, props, context));
_this._cache = props.cache === defaultCache ? {} : props.cache;
_this.state = {
inputValue: '',
isLoading: false,
options: props.options
};
_this.onInputChange = _this.onInputChange.bind(_this);
return _this;
}
_createClass(Async, [{
key: 'componentDidMount',
value: function componentDidMount() {
var autoload = this.props.autoload;
if (autoload) {
this.loadOptions('');
}
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if (nextProps.options !== this.props.options) {
this.setState({
options: nextProps.options
});
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this._callback = null;
}
}, {
key: 'loadOptions',
value: function loadOptions(inputValue) {
var _this2 = this;
var loadOptions = this.props.loadOptions;
var cache = this._cache;
if (cache && Object.prototype.hasOwnProperty.call(cache, inputValue)) {
this._callback = null;
this.setState({
isLoading: false,
options: cache[inputValue]
});
return;
}
var callback = function callback(error, data) {
var options = data && data.options || [];
if (cache) {
cache[inputValue] = options;
}
if (callback === _this2._callback) {
_this2._callback = null;
_this2.setState({
isLoading: false,
options: options
});
}
};
// Ignore all but the most recent request
this._callback = callback;
var promise = loadOptions(inputValue, callback);
if (promise) {
promise.then(function (data) {
return callback(null, data);
}, function (error) {
return callback(error);
});
}
if (this._callback && !this.state.isLoading) {
this.setState({
isLoading: true
});
}
}
}, {
key: 'onInputChange',
value: function onInputChange(inputValue) {
var _props = this.props,
ignoreAccents = _props.ignoreAccents,
ignoreCase = _props.ignoreCase,
onInputChange = _props.onInputChange;
var newInputValue = inputValue;
if (onInputChange) {
var value = onInputChange(newInputValue);
// Note: != used deliberately here to catch undefined and null
if (value != null && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object') {
newInputValue = '' + value;
}
}
var transformedInputValue = newInputValue;
if (ignoreAccents) {
transformedInputValue = (0, _stripDiacritics2.default)(transformedInputValue);
}
if (ignoreCase) {
transformedInputValue = transformedInputValue.toLowerCase();
}
this.setState({ inputValue: newInputValue });
this.loadOptions(transformedInputValue);
// Return new input value, but without applying toLowerCase() to avoid modifying the user's view case of the input while typing.
return newInputValue;
}
}, {
key: 'noResultsText',
value: function noResultsText() {
var _props2 = this.props,
loadingPlaceholder = _props2.loadingPlaceholder,
noResultsText = _props2.noResultsText,
searchPromptText = _props2.searchPromptText;
var _state = this.state,
inputValue = _state.inputValue,
isLoading = _state.isLoading;
if (isLoading) {
return loadingPlaceholder;
}
if (inputValue && noResultsText) {
return noResultsText;
}
return searchPromptText;
}
}, {
key: 'focus',
value: function focus() {
this.select.focus();
}
}, {
key: 'render',
value: function render() {
var _this3 = this;
var _props3 = this.props,
children = _props3.children,
loadingPlaceholder = _props3.loadingPlaceholder,
multi = _props3.multi,
onChange = _props3.onChange,
placeholder = _props3.placeholder,
value = _props3.value;
var _state2 = this.state,
isLoading = _state2.isLoading,
options = _state2.options;
var props = {
noResultsText: this.noResultsText(),
placeholder: isLoading ? loadingPlaceholder : placeholder,
options: isLoading && loadingPlaceholder ? [] : options,
ref: function ref(_ref) {
return _this3.select = _ref;
}
};
return children(_extends({}, this.props, props, {
isLoading: isLoading,
onInputChange: this.onInputChange
}));
}
}]);
return Async;
}(_react.Component);
exports.default = Async;
Async.propTypes = propTypes;
Async.defaultProps = defaultProps;
function defaultChildren(props) {
return _react2.default.createElement(_Select2.default, props);
}

View File

@@ -0,0 +1,107 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Select = require('./Select');
var _Select2 = _interopRequireDefault(_Select);
var _Async = require('./Async');
var _Async2 = _interopRequireDefault(_Async);
var _Creatable = require('./Creatable');
var _Creatable2 = _interopRequireDefault(_Creatable);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var AsyncCreatableSelect = function (_React$Component) {
_inherits(AsyncCreatableSelect, _React$Component);
function AsyncCreatableSelect() {
_classCallCheck(this, AsyncCreatableSelect);
return _possibleConstructorReturn(this, (AsyncCreatableSelect.__proto__ || Object.getPrototypeOf(AsyncCreatableSelect)).apply(this, arguments));
}
_createClass(AsyncCreatableSelect, [{
key: 'focus',
value: function focus() {
this.select.focus();
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
return _react2.default.createElement(
_Async2.default,
this.props,
function (_ref) {
var ref = _ref.ref,
asyncProps = _objectWithoutProperties(_ref, ['ref']);
var asyncRef = ref;
return _react2.default.createElement(
_Creatable2.default,
asyncProps,
function (_ref2) {
var ref = _ref2.ref,
creatableProps = _objectWithoutProperties(_ref2, ['ref']);
var creatableRef = ref;
return _this2.props.children(_extends({}, creatableProps, {
ref: function ref(select) {
creatableRef(select);
asyncRef(select);
_this2.select = select;
}
}));
}
);
}
);
}
}]);
return AsyncCreatableSelect;
}(_react2.default.Component);
;
function defaultChildren(props) {
return _react2.default.createElement(_Select2.default, props);
};
AsyncCreatableSelect.propTypes = {
children: _propTypes2.default.func.isRequired // Child function responsible for creating the inner Select component; (props: Object): PropTypes.element
};
AsyncCreatableSelect.defaultProps = {
children: defaultChildren
};
exports.default = AsyncCreatableSelect;

View File

@@ -0,0 +1,373 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Select = require('./Select');
var _Select2 = _interopRequireDefault(_Select);
var _defaultFilterOptions = require('./utils/defaultFilterOptions');
var _defaultFilterOptions2 = _interopRequireDefault(_defaultFilterOptions);
var _defaultMenuRenderer = require('./utils/defaultMenuRenderer');
var _defaultMenuRenderer2 = _interopRequireDefault(_defaultMenuRenderer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var CreatableSelect = function (_React$Component) {
_inherits(CreatableSelect, _React$Component);
function CreatableSelect(props, context) {
_classCallCheck(this, CreatableSelect);
var _this = _possibleConstructorReturn(this, (CreatableSelect.__proto__ || Object.getPrototypeOf(CreatableSelect)).call(this, props, context));
_this.filterOptions = _this.filterOptions.bind(_this);
_this.menuRenderer = _this.menuRenderer.bind(_this);
_this.onInputKeyDown = _this.onInputKeyDown.bind(_this);
_this.onInputChange = _this.onInputChange.bind(_this);
_this.onOptionSelect = _this.onOptionSelect.bind(_this);
return _this;
}
_createClass(CreatableSelect, [{
key: 'createNewOption',
value: function createNewOption() {
var _props = this.props,
isValidNewOption = _props.isValidNewOption,
newOptionCreator = _props.newOptionCreator,
onNewOptionClick = _props.onNewOptionClick,
_props$options = _props.options,
options = _props$options === undefined ? [] : _props$options,
shouldKeyDownEventCreateNewOption = _props.shouldKeyDownEventCreateNewOption;
if (isValidNewOption({ label: this.inputValue })) {
var option = newOptionCreator({ label: this.inputValue, labelKey: this.labelKey, valueKey: this.valueKey });
var _isOptionUnique = this.isOptionUnique({ option: option });
// Don't add the same option twice.
if (_isOptionUnique) {
if (onNewOptionClick) {
onNewOptionClick(option);
} else {
options.unshift(option);
this.select.selectValue(option);
}
}
}
}
}, {
key: 'filterOptions',
value: function filterOptions() {
var _props2 = this.props,
filterOptions = _props2.filterOptions,
isValidNewOption = _props2.isValidNewOption,
promptTextCreator = _props2.promptTextCreator;
// TRICKY Check currently selected options as well.
// Don't display a create-prompt for a value that's selected.
// This covers async edge-cases where a newly-created Option isn't yet in the async-loaded array.
var excludeOptions = (arguments.length <= 2 ? undefined : arguments[2]) || [];
var filteredOptions = filterOptions.apply(undefined, arguments) || [];
if (isValidNewOption({ label: this.inputValue })) {
var _newOptionCreator = this.props.newOptionCreator;
var option = _newOptionCreator({
label: this.inputValue,
labelKey: this.labelKey,
valueKey: this.valueKey
});
// TRICKY Compare to all options (not just filtered options) in case option has already been selected).
// For multi-selects, this would remove it from the filtered list.
var _isOptionUnique2 = this.isOptionUnique({
option: option,
options: excludeOptions.concat(filteredOptions)
});
if (_isOptionUnique2) {
var prompt = promptTextCreator(this.inputValue);
this._createPlaceholderOption = _newOptionCreator({
label: prompt,
labelKey: this.labelKey,
valueKey: this.valueKey
});
filteredOptions.unshift(this._createPlaceholderOption);
}
}
return filteredOptions;
}
}, {
key: 'isOptionUnique',
value: function isOptionUnique(_ref) {
var option = _ref.option,
options = _ref.options;
var isOptionUnique = this.props.isOptionUnique;
options = options || this.props.options;
return isOptionUnique({
labelKey: this.labelKey,
option: option,
options: options,
valueKey: this.valueKey
});
}
}, {
key: 'menuRenderer',
value: function menuRenderer(params) {
var menuRenderer = this.props.menuRenderer;
return menuRenderer(_extends({}, params, {
onSelect: this.onOptionSelect,
selectValue: this.onOptionSelect
}));
}
}, {
key: 'onInputChange',
value: function onInputChange(input) {
var onInputChange = this.props.onInputChange;
// This value may be needed in between Select mounts (when this.select is null)
this.inputValue = input;
if (onInputChange) {
this.inputValue = onInputChange(input);
}
return this.inputValue;
}
}, {
key: 'onInputKeyDown',
value: function onInputKeyDown(event) {
var _props3 = this.props,
shouldKeyDownEventCreateNewOption = _props3.shouldKeyDownEventCreateNewOption,
onInputKeyDown = _props3.onInputKeyDown;
var focusedOption = this.select.getFocusedOption();
if (focusedOption && focusedOption === this._createPlaceholderOption && shouldKeyDownEventCreateNewOption({ keyCode: event.keyCode })) {
this.createNewOption();
// Prevent decorated Select from doing anything additional with this keyDown event
event.preventDefault();
} else if (onInputKeyDown) {
onInputKeyDown(event);
}
}
}, {
key: 'onOptionSelect',
value: function onOptionSelect(option, event) {
if (option === this._createPlaceholderOption) {
this.createNewOption();
} else {
this.select.selectValue(option);
}
}
}, {
key: 'focus',
value: function focus() {
this.select.focus();
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var _props4 = this.props,
newOptionCreator = _props4.newOptionCreator,
shouldKeyDownEventCreateNewOption = _props4.shouldKeyDownEventCreateNewOption,
refProp = _props4.ref,
restProps = _objectWithoutProperties(_props4, ['newOptionCreator', 'shouldKeyDownEventCreateNewOption', 'ref']);
var children = this.props.children;
// We can't use destructuring default values to set the children,
// because it won't apply work if `children` is null. A falsy check is
// more reliable in real world use-cases.
if (!children) {
children = defaultChildren;
}
var props = _extends({}, restProps, {
allowCreate: true,
filterOptions: this.filterOptions,
menuRenderer: this.menuRenderer,
onInputChange: this.onInputChange,
onInputKeyDown: this.onInputKeyDown,
ref: function ref(_ref2) {
_this2.select = _ref2;
// These values may be needed in between Select mounts (when this.select is null)
if (_ref2) {
_this2.labelKey = _ref2.props.labelKey;
_this2.valueKey = _ref2.props.valueKey;
}
if (refProp) {
refProp(_ref2);
}
}
});
return children(props);
}
}]);
return CreatableSelect;
}(_react2.default.Component);
;
function defaultChildren(props) {
return _react2.default.createElement(_Select2.default, props);
};
function isOptionUnique(_ref3) {
var option = _ref3.option,
options = _ref3.options,
labelKey = _ref3.labelKey,
valueKey = _ref3.valueKey;
return options.filter(function (existingOption) {
return existingOption[labelKey] === option[labelKey] || existingOption[valueKey] === option[valueKey];
}).length === 0;
};
function isValidNewOption(_ref4) {
var label = _ref4.label;
return !!label;
};
function newOptionCreator(_ref5) {
var label = _ref5.label,
labelKey = _ref5.labelKey,
valueKey = _ref5.valueKey;
var option = {};
option[valueKey] = label;
option[labelKey] = label;
option.className = 'Select-create-option-placeholder';
return option;
};
function promptTextCreator(label) {
return 'Create option "' + label + '"';
}
function shouldKeyDownEventCreateNewOption(_ref6) {
var keyCode = _ref6.keyCode;
switch (keyCode) {
case 9: // TAB
case 13: // ENTER
case 188:
// COMMA
return true;
default:
return false;
}
};
// Default prop methods
CreatableSelect.isOptionUnique = isOptionUnique;
CreatableSelect.isValidNewOption = isValidNewOption;
CreatableSelect.newOptionCreator = newOptionCreator;
CreatableSelect.promptTextCreator = promptTextCreator;
CreatableSelect.shouldKeyDownEventCreateNewOption = shouldKeyDownEventCreateNewOption;
CreatableSelect.defaultProps = {
filterOptions: _defaultFilterOptions2.default,
isOptionUnique: isOptionUnique,
isValidNewOption: isValidNewOption,
menuRenderer: _defaultMenuRenderer2.default,
newOptionCreator: newOptionCreator,
promptTextCreator: promptTextCreator,
shouldKeyDownEventCreateNewOption: shouldKeyDownEventCreateNewOption
};
CreatableSelect.propTypes = {
// Child function responsible for creating the inner Select component
// This component can be used to compose HOCs (eg Creatable and Async)
// (props: Object): PropTypes.element
children: _propTypes2.default.func,
// See Select.propTypes.filterOptions
filterOptions: _propTypes2.default.any,
// Searches for any matching option within the set of options.
// This function prevents duplicate options from being created.
// ({ option: Object, options: Array, labelKey: string, valueKey: string }): boolean
isOptionUnique: _propTypes2.default.func,
// Determines if the current input text represents a valid option.
// ({ label: string }): boolean
isValidNewOption: _propTypes2.default.func,
// See Select.propTypes.menuRenderer
menuRenderer: _propTypes2.default.any,
// Factory to create new option.
// ({ label: string, labelKey: string, valueKey: string }): Object
newOptionCreator: _propTypes2.default.func,
// input change handler: function (inputValue) {}
onInputChange: _propTypes2.default.func,
// input keyDown handler: function (event) {}
onInputKeyDown: _propTypes2.default.func,
// new option click handler: function (option) {}
onNewOptionClick: _propTypes2.default.func,
// See Select.propTypes.options
options: _propTypes2.default.array,
// Creates prompt/placeholder option text.
// (filterText: string): string
promptTextCreator: _propTypes2.default.func,
ref: _propTypes2.default.func,
// Decides if a keyDown event (eg its `keyCode`) should result in the creation of a new option.
shouldKeyDownEventCreateNewOption: _propTypes2.default.func
};
exports.default = CreatableSelect;

160
goTorrentWebUI/node_modules/react-select/lib/Option.js generated vendored Normal file
View File

@@ -0,0 +1,160 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = require('classnames');
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Option = function (_React$Component) {
_inherits(Option, _React$Component);
function Option(props) {
_classCallCheck(this, Option);
var _this = _possibleConstructorReturn(this, (Option.__proto__ || Object.getPrototypeOf(Option)).call(this, props));
_this.handleMouseDown = _this.handleMouseDown.bind(_this);
_this.handleMouseEnter = _this.handleMouseEnter.bind(_this);
_this.handleMouseMove = _this.handleMouseMove.bind(_this);
_this.handleTouchStart = _this.handleTouchStart.bind(_this);
_this.handleTouchEnd = _this.handleTouchEnd.bind(_this);
_this.handleTouchMove = _this.handleTouchMove.bind(_this);
_this.onFocus = _this.onFocus.bind(_this);
return _this;
}
_createClass(Option, [{
key: 'blockEvent',
value: function blockEvent(event) {
event.preventDefault();
event.stopPropagation();
if (event.target.tagName !== 'A' || !('href' in event.target)) {
return;
}
if (event.target.target) {
window.open(event.target.href, event.target.target);
} else {
window.location.href = event.target.href;
}
}
}, {
key: 'handleMouseDown',
value: function handleMouseDown(event) {
event.preventDefault();
event.stopPropagation();
this.props.onSelect(this.props.option, event);
}
}, {
key: 'handleMouseEnter',
value: function handleMouseEnter(event) {
this.onFocus(event);
}
}, {
key: 'handleMouseMove',
value: function handleMouseMove(event) {
this.onFocus(event);
}
}, {
key: 'handleTouchEnd',
value: function handleTouchEnd(event) {
// Check if the view is being dragged, In this case
// we don't want to fire the click event (because the user only wants to scroll)
if (this.dragging) return;
this.handleMouseDown(event);
}
}, {
key: 'handleTouchMove',
value: function handleTouchMove(event) {
// Set a flag that the view is being dragged
this.dragging = true;
}
}, {
key: 'handleTouchStart',
value: function handleTouchStart(event) {
// Set a flag that the view is not being dragged
this.dragging = false;
}
}, {
key: 'onFocus',
value: function onFocus(event) {
if (!this.props.isFocused) {
this.props.onFocus(this.props.option, event);
}
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
option = _props.option,
instancePrefix = _props.instancePrefix,
optionIndex = _props.optionIndex;
var className = (0, _classnames2.default)(this.props.className, option.className);
return option.disabled ? _react2.default.createElement(
'div',
{ className: className,
onMouseDown: this.blockEvent,
onClick: this.blockEvent },
this.props.children
) : _react2.default.createElement(
'div',
{ className: className,
style: option.style,
role: 'option',
'aria-label': option.label,
onMouseDown: this.handleMouseDown,
onMouseEnter: this.handleMouseEnter,
onMouseMove: this.handleMouseMove,
onTouchStart: this.handleTouchStart,
onTouchMove: this.handleTouchMove,
onTouchEnd: this.handleTouchEnd,
id: instancePrefix + '-option-' + optionIndex,
title: option.title },
this.props.children
);
}
}]);
return Option;
}(_react2.default.Component);
;
Option.propTypes = {
children: _propTypes2.default.node,
className: _propTypes2.default.string, // className (based on mouse position)
instancePrefix: _propTypes2.default.string.isRequired, // unique prefix for the ids (used for aria)
isDisabled: _propTypes2.default.bool, // the option is disabled
isFocused: _propTypes2.default.bool, // the option is focused
isSelected: _propTypes2.default.bool, // the option is selected
onFocus: _propTypes2.default.func, // method to handle mouseEnter on option element
onSelect: _propTypes2.default.func, // method to handle click on option element
onUnfocus: _propTypes2.default.func, // method to handle mouseLeave on option element
option: _propTypes2.default.object.isRequired, // object that is base for that option
optionIndex: _propTypes2.default.number // index of the option, used to generate unique ids for aria
};
exports.default = Option;

1376
goTorrentWebUI/node_modules/react-select/lib/Select.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

147
goTorrentWebUI/node_modules/react-select/lib/Value.js generated vendored Normal file
View File

@@ -0,0 +1,147 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = require('classnames');
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Value = function (_React$Component) {
_inherits(Value, _React$Component);
function Value(props) {
_classCallCheck(this, Value);
var _this = _possibleConstructorReturn(this, (Value.__proto__ || Object.getPrototypeOf(Value)).call(this, props));
_this.handleMouseDown = _this.handleMouseDown.bind(_this);
_this.onRemove = _this.onRemove.bind(_this);
_this.handleTouchEndRemove = _this.handleTouchEndRemove.bind(_this);
_this.handleTouchMove = _this.handleTouchMove.bind(_this);
_this.handleTouchStart = _this.handleTouchStart.bind(_this);
return _this;
}
_createClass(Value, [{
key: 'handleMouseDown',
value: function handleMouseDown(event) {
if (event.type === 'mousedown' && event.button !== 0) {
return;
}
if (this.props.onClick) {
event.stopPropagation();
this.props.onClick(this.props.value, event);
return;
}
if (this.props.value.href) {
event.stopPropagation();
}
}
}, {
key: 'onRemove',
value: function onRemove(event) {
event.preventDefault();
event.stopPropagation();
this.props.onRemove(this.props.value);
}
}, {
key: 'handleTouchEndRemove',
value: function handleTouchEndRemove(event) {
// Check if the view is being dragged, In this case
// we don't want to fire the click event (because the user only wants to scroll)
if (this.dragging) return;
// Fire the mouse events
this.onRemove(event);
}
}, {
key: 'handleTouchMove',
value: function handleTouchMove(event) {
// Set a flag that the view is being dragged
this.dragging = true;
}
}, {
key: 'handleTouchStart',
value: function handleTouchStart(event) {
// Set a flag that the view is not being dragged
this.dragging = false;
}
}, {
key: 'renderRemoveIcon',
value: function renderRemoveIcon() {
if (this.props.disabled || !this.props.onRemove) return;
return _react2.default.createElement(
'span',
{ className: 'Select-value-icon',
'aria-hidden': 'true',
onMouseDown: this.onRemove,
onTouchEnd: this.handleTouchEndRemove,
onTouchStart: this.handleTouchStart,
onTouchMove: this.handleTouchMove },
'\xD7'
);
}
}, {
key: 'renderLabel',
value: function renderLabel() {
var className = 'Select-value-label';
return this.props.onClick || this.props.value.href ? _react2.default.createElement(
'a',
{ className: className, href: this.props.value.href, target: this.props.value.target, onMouseDown: this.handleMouseDown, onTouchEnd: this.handleMouseDown },
this.props.children
) : _react2.default.createElement(
'span',
{ className: className, role: 'option', 'aria-selected': 'true', id: this.props.id },
this.props.children
);
}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
{ className: (0, _classnames2.default)('Select-value', this.props.value.className),
style: this.props.value.style,
title: this.props.value.title
},
this.renderRemoveIcon(),
this.renderLabel()
);
}
}]);
return Value;
}(_react2.default.Component);
;
Value.propTypes = {
children: _propTypes2.default.node,
disabled: _propTypes2.default.bool, // disabled prop passed to ReactSelect
id: _propTypes2.default.string, // Unique id for the value - used for aria
onClick: _propTypes2.default.func, // method to handle click on value label
onRemove: _propTypes2.default.func, // method to handle removal of the value
value: _propTypes2.default.object.isRequired // the option object for this value
};
exports.default = Value;

65
goTorrentWebUI/node_modules/react-select/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,65 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.defaultFilterOptions = exports.defaultClearRenderer = exports.defaultArrowRenderer = exports.defaultMenuRenderer = exports.Option = exports.Value = exports.Creatable = exports.AsyncCreatable = exports.Async = undefined;
var _Select = require('./Select');
var _Select2 = _interopRequireDefault(_Select);
var _Async = require('./Async');
var _Async2 = _interopRequireDefault(_Async);
var _AsyncCreatable = require('./AsyncCreatable');
var _AsyncCreatable2 = _interopRequireDefault(_AsyncCreatable);
var _Creatable = require('./Creatable');
var _Creatable2 = _interopRequireDefault(_Creatable);
var _Value = require('./Value');
var _Value2 = _interopRequireDefault(_Value);
var _Option = require('./Option');
var _Option2 = _interopRequireDefault(_Option);
var _defaultMenuRenderer = require('./utils/defaultMenuRenderer');
var _defaultMenuRenderer2 = _interopRequireDefault(_defaultMenuRenderer);
var _defaultArrowRenderer = require('./utils/defaultArrowRenderer');
var _defaultArrowRenderer2 = _interopRequireDefault(_defaultArrowRenderer);
var _defaultClearRenderer = require('./utils/defaultClearRenderer');
var _defaultClearRenderer2 = _interopRequireDefault(_defaultClearRenderer);
var _defaultFilterOptions = require('./utils/defaultFilterOptions');
var _defaultFilterOptions2 = _interopRequireDefault(_defaultFilterOptions);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_Select2.default.Async = _Async2.default;
_Select2.default.AsyncCreatable = _AsyncCreatable2.default;
_Select2.default.Creatable = _Creatable2.default;
_Select2.default.Value = _Value2.default;
_Select2.default.Option = _Option2.default;
exports.default = _Select2.default;
exports.Async = _Async2.default;
exports.AsyncCreatable = _AsyncCreatable2.default;
exports.Creatable = _Creatable2.default;
exports.Value = _Value2.default;
exports.Option = _Option2.default;
exports.defaultMenuRenderer = _defaultMenuRenderer2.default;
exports.defaultArrowRenderer = _defaultArrowRenderer2.default;
exports.defaultClearRenderer = _defaultClearRenderer2.default;
exports.defaultFilterOptions = _defaultFilterOptions2.default;

View File

@@ -0,0 +1,29 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = arrowRenderer;
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function arrowRenderer(_ref) {
var onMouseDown = _ref.onMouseDown;
return _react2.default.createElement('span', {
className: 'Select-arrow',
onMouseDown: onMouseDown
});
};
arrowRenderer.propTypes = {
onMouseDown: _propTypes2.default.func
};

View File

@@ -0,0 +1,19 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = clearRenderer;
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function clearRenderer() {
return _react2.default.createElement('span', {
className: 'Select-clear',
dangerouslySetInnerHTML: { __html: '&times;' }
});
};

View File

@@ -0,0 +1,56 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _stripDiacritics = require('./stripDiacritics');
var _stripDiacritics2 = _interopRequireDefault(_stripDiacritics);
var _trim = require('./trim');
var _trim2 = _interopRequireDefault(_trim);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function filterOptions(options, filterValue, excludeOptions, props) {
var _this = this;
if (props.ignoreAccents) {
filterValue = (0, _stripDiacritics2.default)(filterValue);
}
if (props.ignoreCase) {
filterValue = filterValue.toLowerCase();
}
if (props.trimFilter) {
filterValue = (0, _trim2.default)(filterValue);
}
if (excludeOptions) excludeOptions = excludeOptions.map(function (i) {
return i[props.valueKey];
});
return options.filter(function (option) {
if (excludeOptions && excludeOptions.indexOf(option[props.valueKey]) > -1) return false;
if (props.filterOption) return props.filterOption.call(_this, option, filterValue);
if (!filterValue) return true;
var valueTest = String(option[props.valueKey]);
var labelTest = String(option[props.labelKey]);
if (props.ignoreAccents) {
if (props.matchProp !== 'label') valueTest = (0, _stripDiacritics2.default)(valueTest);
if (props.matchProp !== 'value') labelTest = (0, _stripDiacritics2.default)(labelTest);
}
if (props.ignoreCase) {
if (props.matchProp !== 'label') valueTest = valueTest.toLowerCase();
if (props.matchProp !== 'value') labelTest = labelTest.toLowerCase();
}
return props.matchPos === 'start' ? props.matchProp !== 'label' && valueTest.substr(0, filterValue.length) === filterValue || props.matchProp !== 'value' && labelTest.substr(0, filterValue.length) === filterValue : props.matchProp !== 'label' && valueTest.indexOf(filterValue) >= 0 || props.matchProp !== 'value' && labelTest.indexOf(filterValue) >= 0;
});
}
exports.default = filterOptions;

View File

@@ -0,0 +1,75 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _classnames = require('classnames');
var _classnames2 = _interopRequireDefault(_classnames);
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function menuRenderer(_ref) {
var focusedOption = _ref.focusedOption,
focusOption = _ref.focusOption,
inputValue = _ref.inputValue,
instancePrefix = _ref.instancePrefix,
labelKey = _ref.labelKey,
onFocus = _ref.onFocus,
onOptionRef = _ref.onOptionRef,
onSelect = _ref.onSelect,
optionClassName = _ref.optionClassName,
optionComponent = _ref.optionComponent,
optionRenderer = _ref.optionRenderer,
options = _ref.options,
removeValue = _ref.removeValue,
selectValue = _ref.selectValue,
valueArray = _ref.valueArray,
valueKey = _ref.valueKey;
var Option = optionComponent;
return options.map(function (option, i) {
var isSelected = valueArray && valueArray.some(function (x) {
return x[valueKey] == option[valueKey];
});
var isFocused = option === focusedOption;
var optionClass = (0, _classnames2.default)(optionClassName, {
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled
});
return _react2.default.createElement(
Option,
{
className: optionClass,
focusOption: focusOption,
inputValue: inputValue,
instancePrefix: instancePrefix,
isDisabled: option.disabled,
isFocused: isFocused,
isSelected: isSelected,
key: 'option-' + i + '-' + option[valueKey],
onFocus: onFocus,
onSelect: onSelect,
option: option,
optionIndex: i,
ref: function ref(_ref2) {
onOptionRef(_ref2, isFocused);
},
removeValue: removeValue,
selectValue: selectValue
},
optionRenderer(option, i, inputValue)
);
});
}
exports.default = menuRenderer;

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = trim;
function trim(str) {
return str.replace(/^\s+|\s+$/g, '');
}

View File

@@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../loose-envify/cli.js" "$@"
ret=$?
else
node "$basedir/../loose-envify/cli.js" "$@"
ret=$?
fi
exit $ret

View File

@@ -0,0 +1,7 @@
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\loose-envify\cli.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\loose-envify\cli.js" %*
)

View File

@@ -0,0 +1,70 @@
## 2.0.6
Version 2.0.4 adds support for React Native by clarifying in package.json that
the browser environment does not support Node.js domains.
Why this is necessary, we leave as an exercise for the user.
## 2.0.3
Version 2.0.3 fixes a bug when adjusting the capacity of the task queue.
## 2.0.1-2.02
Version 2.0.1 fixes a bug in the way redirects were expressed that affected the
function of Browserify, but which Mr would tolerate.
## 2.0.0
Version 2 of ASAP is a full rewrite with a few salient changes.
First, the ASAP source is CommonJS only and designed with [Browserify][] and
[Browserify-compatible][Mr] module loaders in mind.
[Browserify]: https://github.com/substack/node-browserify
[Mr]: https://github.com/montagejs/mr
The new version has been refactored in two dimensions.
Support for Node.js and browsers have been separated, using Browserify
redirects and ASAP has been divided into two modules.
The "raw" layer depends on the tasks to catch thrown exceptions and unravel
Node.js domains.
The full implementation of ASAP is loadable as `require("asap")` in both Node.js
and browsers.
The raw layer that lacks exception handling overhead is loadable as
`require("asap/raw")`.
The interface is the same for both layers.
Tasks are no longer required to be functions, but can rather be any object that
implements `task.call()`.
With this feature you can recycle task objects to avoid garbage collector churn
and avoid closures in general.
The implementation has been rigorously documented so that our successors can
understand the scope of the problem that this module solves and all of its
nuances, ensuring that the next generation of implementations know what details
are essential.
- [asap.js](https://github.com/kriskowal/asap/blob/master/asap.js)
- [raw.js](https://github.com/kriskowal/asap/blob/master/raw.js)
- [browser-asap.js](https://github.com/kriskowal/asap/blob/master/browser-asap.js)
- [browser-raw.js](https://github.com/kriskowal/asap/blob/master/browser-raw.js)
The new version has also been rigorously tested across a broad spectrum of
browsers, in both the window and worker context.
The following charts capture the browser test results for the most recent
release.
The first chart shows test results for ASAP running in the main window context.
The second chart shows test results for ASAP running in a web worker context.
Test results are inconclusive (grey) on browsers that do not support web
workers.
These data are captured automatically by [Continuous
Integration][].
![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg)
![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg)
[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md

View File

@@ -0,0 +1,21 @@
Copyright 20092014 Contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

View File

@@ -0,0 +1,237 @@
# ASAP
[![Build Status](https://travis-ci.org/kriskowal/asap.png?branch=master)](https://travis-ci.org/kriskowal/asap)
Promise and asynchronous observer libraries, as well as hand-rolled callback
programs and libraries, often need a mechanism to postpone the execution of a
callback until the next available event.
(See [Designing APIs for Asynchrony][Zalgo].)
The `asap` function executes a task **as soon as possible** but not before it
returns, waiting only for the completion of the current event and previously
scheduled tasks.
```javascript
asap(function () {
// ...
});
```
[Zalgo]: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony
This CommonJS package provides an `asap` module that exports a function that
executes a task function *as soon as possible*.
ASAP strives to schedule events to occur before yielding for IO, reflow,
or redrawing.
Each event receives an independent stack, with only platform code in parent
frames and the events run in the order they are scheduled.
ASAP provides a fast event queue that will execute tasks until it is
empty before yielding to the JavaScript engine's underlying event-loop.
When a task gets added to a previously empty event queue, ASAP schedules a flush
event, preferring for that event to occur before the JavaScript engine has an
opportunity to perform IO tasks or rendering, thus making the first task and
subsequent tasks semantically indistinguishable.
ASAP uses a variety of techniques to preserve this invariant on different
versions of browsers and Node.js.
By design, ASAP prevents input events from being handled until the task
queue is empty.
If the process is busy enough, this may cause incoming connection requests to be
dropped, and may cause existing connections to inform the sender to reduce the
transmission rate or stall.
ASAP allows this on the theory that, if there is enough work to do, there is no
sense in looking for trouble.
As a consequence, ASAP can interfere with smooth animation.
If your task should be tied to the rendering loop, consider using
`requestAnimationFrame` instead.
A long sequence of tasks can also effect the long running script dialog.
If this is a problem, you may be able to use ASAPs cousin `setImmediate` to
break long processes into shorter intervals and periodically allow the browser
to breathe.
`setImmediate` will yield for IO, reflow, and repaint events.
It also returns a handler and can be canceled.
For a `setImmediate` shim, consider [YuzuJS setImmediate][setImmediate].
[setImmediate]: https://github.com/YuzuJS/setImmediate
Take care.
ASAP can sustain infinite recursive calls without warning.
It will not halt from a stack overflow, and it will not consume unbounded
memory.
This is behaviorally equivalent to an infinite loop.
Just as with infinite loops, you can monitor a Node.js process for this behavior
with a heart-beat signal.
As with infinite loops, a very small amount of caution goes a long way to
avoiding problems.
```javascript
function loop() {
asap(loop);
}
loop();
```
In browsers, if a task throws an exception, it will not interrupt the flushing
of high-priority tasks.
The exception will be postponed to a later, low-priority event to avoid
slow-downs.
In Node.js, if a task throws an exception, ASAP will resume flushing only if—and
only after—the error is handled by `domain.on("error")` or
`process.on("uncaughtException")`.
## Raw ASAP
Checking for exceptions comes at a cost.
The package also provides an `asap/raw` module that exports the underlying
implementation which is faster but stalls if a task throws an exception.
This internal version of the ASAP function does not check for errors.
If a task does throw an error, it will stall the event queue unless you manually
call `rawAsap.requestFlush()` before throwing the error, or any time after.
In Node.js, `asap/raw` also runs all tasks outside any domain.
If you need a task to be bound to your domain, you will have to do it manually.
```js
if (process.domain) {
task = process.domain.bind(task);
}
rawAsap(task);
```
## Tasks
A task may be any object that implements `call()`.
A function will suffice, but closures tend not to be reusable and can cause
garbage collector churn.
Both `asap` and `rawAsap` accept task objects to give you the option of
recycling task objects or using higher callable object abstractions.
See the `asap` source for an illustration.
## Compatibility
ASAP is tested on Node.js v0.10 and in a broad spectrum of web browsers.
The following charts capture the browser test results for the most recent
release.
The first chart shows test results for ASAP running in the main window context.
The second chart shows test results for ASAP running in a web worker context.
Test results are inconclusive (grey) on browsers that do not support web
workers.
These data are captured automatically by [Continuous
Integration][].
[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md
![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg)
![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg)
## Caveats
When a task is added to an empty event queue, it is not always possible to
guarantee that the task queue will begin flushing immediately after the current
event.
However, once the task queue begins flushing, it will not yield until the queue
is empty, even if the queue grows while executing tasks.
The following browsers allow the use of [DOM mutation observers][] to access
the HTML [microtask queue][], and thus begin flushing ASAP's task queue
immediately at the end of the current event loop turn, before any rendering or
IO:
[microtask queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#microtask-queue
[DOM mutation observers]: http://dom.spec.whatwg.org/#mutation-observers
- Android 44.3
- Chrome 2634
- Firefox 1429
- Internet Explorer 11
- iPad Safari 67.1
- iPhone Safari 77.1
- Safari 67
In the absense of mutation observers, there are a few browsers, and situations
like web workers in some of the above browsers, where [message channels][]
would be a useful way to avoid falling back to timers.
Message channels give direct access to the HTML [task queue][], so the ASAP
task queue would flush after any already queued rendering and IO tasks, but
without having the minimum delay imposed by timers.
However, among these browsers, Internet Explorer 10 and Safari do not reliably
dispatch messages, so they are not worth the trouble to implement.
[message channels]: http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#message-channels
[task queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task
- Internet Explorer 10
- Safair 5.0-1
- Opera 11-12
In the absense of mutation observers, these browsers and the following browsers
all fall back to using `setTimeout` and `setInterval` to ensure that a `flush`
occurs.
The implementation uses both and cancels whatever handler loses the race, since
`setTimeout` tends to occasionally skip tasks in unisolated circumstances.
Timers generally delay the flushing of ASAP's task queue for four milliseconds.
- Firefox 313
- Internet Explorer 610
- iPad Safari 4.3
- Lynx 2.8.7
## Heritage
ASAP has been factored out of the [Q][] asynchronous promise library.
It originally had a naïve implementation in terms of `setTimeout`, but
[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be
useful for creating a high-priority, no-delay event dispatch hack.
Since then, Internet Explorer proposed and implemented `setImmediate`.
Robert Katić began contributing to Q by measuring the performance of
the internal implementation of `asap`, paying particular attention to
error recovery.
Domenic, Robert, and Kris Kowal collectively settled on the current strategy of
unrolling the high-priority event queue internally regardless of what strategy
we used to dispatch the potentially lower-priority flush event.
Domenic went on to make ASAP cooperate with Node.js domains.
[Q]: https://github.com/kriskowal/q
[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html
For further reading, Nicholas Zakas provided a thorough article on [The
Case for setImmediate][NCZ].
[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/
Embers RSVP promise implementation later [adopted][RSVP ASAP] the name ASAP but
further developed the implentation.
Particularly, The `MessagePort` implementation was abandoned due to interaction
[problems with Mobile Internet Explorer][IE Problems] in favor of an
implementation backed on the newer and more reliable DOM `MutationObserver`
interface.
These changes were back-ported into this library.
[IE Problems]: https://github.com/cujojs/when/issues/197
[RSVP ASAP]: https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
In addition, ASAP factored into `asap` and `asap/raw`, such that `asap` remained
exception-safe, but `asap/raw` provided a tight kernel that could be used for
tasks that guaranteed that they would not throw exceptions.
This core is useful for promise implementations that capture thrown errors in
rejected promises and do not need a second safety net.
At the same time, the exception handling in `asap` was factored into separate
implementations for Node.js and browsers, using the the [Browserify][Browser
Config] `browser` property in `package.json` to instruct browser module loaders
and bundlers, including [Browserify][], [Mr][], and [Mop][], to use the
browser-only implementation.
[Browser Config]: https://gist.github.com/defunctzombie/4339901
[Browserify]: https://github.com/substack/node-browserify
[Mr]: https://github.com/montagejs/mr
[Mop]: https://github.com/montagejs/mop
## License
Copyright 2009-2014 by Contributors
MIT License (enclosed)

View File

@@ -0,0 +1,65 @@
"use strict";
var rawAsap = require("./raw");
var freeTasks = [];
/**
* Calls a task as soon as possible after returning, in its own event, with
* priority over IO events. An exception thrown in a task can be handled by
* `process.on("uncaughtException") or `domain.on("error")`, but will otherwise
* crash the process. If the error is handled, all subsequent tasks will
* resume.
*
* @param {{call}} task A callable object, typically a function that takes no
* arguments.
*/
module.exports = asap;
function asap(task) {
var rawTask;
if (freeTasks.length) {
rawTask = freeTasks.pop();
} else {
rawTask = new RawTask();
}
rawTask.task = task;
rawTask.domain = process.domain;
rawAsap(rawTask);
}
function RawTask() {
this.task = null;
this.domain = null;
}
RawTask.prototype.call = function () {
if (this.domain) {
this.domain.enter();
}
var threw = true;
try {
this.task.call();
threw = false;
// If the task throws an exception (presumably) Node.js restores the
// domain stack for the next event.
if (this.domain) {
this.domain.exit();
}
} finally {
// We use try/finally and a threw flag to avoid messing up stack traces
// when we catch and release errors.
if (threw) {
// In Node.js, uncaught exceptions are considered fatal errors.
// Re-throw them to interrupt flushing!
// Ensure that flushing continues if an uncaught exception is
// suppressed listening process.on("uncaughtException") or
// domain.on("error").
rawAsap.requestFlush();
}
// If the task threw an error, we do not want to exit the domain here.
// Exiting the domain would prevent the domain from catching the error.
this.task = null;
this.domain = null;
freeTasks.push(this);
}
};

View File

@@ -0,0 +1,66 @@
"use strict";
// rawAsap provides everything we need except exception management.
var rawAsap = require("./raw");
// RawTasks are recycled to reduce GC churn.
var freeTasks = [];
// We queue errors to ensure they are thrown in right order (FIFO).
// Array-as-queue is good enough here, since we are just dealing with exceptions.
var pendingErrors = [];
var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);
function throwFirstError() {
if (pendingErrors.length) {
throw pendingErrors.shift();
}
}
/**
* Calls a task as soon as possible after returning, in its own event, with priority
* over other events like animation, reflow, and repaint. An error thrown from an
* event will not interrupt, nor even substantially slow down the processing of
* other events, but will be rather postponed to a lower priority event.
* @param {{call}} task A callable object, typically a function that takes no
* arguments.
*/
module.exports = asap;
function asap(task) {
var rawTask;
if (freeTasks.length) {
rawTask = freeTasks.pop();
} else {
rawTask = new RawTask();
}
rawTask.task = task;
rawAsap(rawTask);
}
// We wrap tasks with recyclable task objects. A task object implements
// `call`, just like a function.
function RawTask() {
this.task = null;
}
// The sole purpose of wrapping the task is to catch the exception and recycle
// the task object after its single use.
RawTask.prototype.call = function () {
try {
this.task.call();
} catch (error) {
if (asap.onerror) {
// This hook exists purely for testing purposes.
// Its name will be periodically randomized to break any code that
// depends on its existence.
asap.onerror(error);
} else {
// In a web browser, exceptions are not fatal. However, to avoid
// slowing down the queue of pending tasks, we rethrow the error in a
// lower priority turn.
pendingErrors.push(error);
requestErrorThrow();
}
} finally {
this.task = null;
freeTasks[freeTasks.length] = this;
}
};

View File

@@ -0,0 +1,223 @@
"use strict";
// Use the fastest means possible to execute a task in its own turn, with
// priority over other events including IO, animation, reflow, and redraw
// events in browsers.
//
// An exception thrown by a task will permanently interrupt the processing of
// subsequent tasks. The higher level `asap` function ensures that if an
// exception is thrown by a task, that the task queue will continue flushing as
// soon as possible, but if you use `rawAsap` directly, you are responsible to
// either ensure that no exceptions are thrown from your task, or to manually
// call `rawAsap.requestFlush` if an exception is thrown.
module.exports = rawAsap;
function rawAsap(task) {
if (!queue.length) {
requestFlush();
flushing = true;
}
// Equivalent to push, but avoids a function call.
queue[queue.length] = task;
}
var queue = [];
// Once a flush has been requested, no further calls to `requestFlush` are
// necessary until the next `flush` completes.
var flushing = false;
// `requestFlush` is an implementation-specific method that attempts to kick
// off a `flush` event as quickly as possible. `flush` will attempt to exhaust
// the event queue before yielding to the browser's own event loop.
var requestFlush;
// The position of the next task to execute in the task queue. This is
// preserved between calls to `flush` so that it can be resumed if
// a task throws an exception.
var index = 0;
// If a task schedules additional tasks recursively, the task queue can grow
// unbounded. To prevent memory exhaustion, the task queue will periodically
// truncate already-completed tasks.
var capacity = 1024;
// The flush function processes all tasks that have been scheduled with
// `rawAsap` unless and until one of those tasks throws an exception.
// If a task throws an exception, `flush` ensures that its state will remain
// consistent and will resume where it left off when called again.
// However, `flush` does not make any arrangements to be called again if an
// exception is thrown.
function flush() {
while (index < queue.length) {
var currentIndex = index;
// Advance the index before calling the task. This ensures that we will
// begin flushing on the next task the task throws an error.
index = index + 1;
queue[currentIndex].call();
// Prevent leaking memory for long chains of recursive calls to `asap`.
// If we call `asap` within tasks scheduled by `asap`, the queue will
// grow, but to avoid an O(n) walk for every task we execute, we don't
// shift tasks off the queue after they have been executed.
// Instead, we periodically shift 1024 tasks off the queue.
if (index > capacity) {
// Manually shift all values starting at the index back to the
// beginning of the queue.
for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
queue[scan] = queue[scan + index];
}
queue.length -= index;
index = 0;
}
}
queue.length = 0;
index = 0;
flushing = false;
}
// `requestFlush` is implemented using a strategy based on data collected from
// every available SauceLabs Selenium web driver worker at time of writing.
// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593
// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that
// have WebKitMutationObserver but not un-prefixed MutationObserver.
// Must use `global` or `self` instead of `window` to work in both frames and web
// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.
/* globals self */
var scope = typeof global !== "undefined" ? global : self;
var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;
// MutationObservers are desirable because they have high priority and work
// reliably everywhere they are implemented.
// They are implemented in all modern browsers.
//
// - Android 4-4.3
// - Chrome 26-34
// - Firefox 14-29
// - Internet Explorer 11
// - iPad Safari 6-7.1
// - iPhone Safari 7-7.1
// - Safari 6-7
if (typeof BrowserMutationObserver === "function") {
requestFlush = makeRequestCallFromMutationObserver(flush);
// MessageChannels are desirable because they give direct access to the HTML
// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera
// 11-12, and in web workers in many engines.
// Although message channels yield to any queued rendering and IO tasks, they
// would be better than imposing the 4ms delay of timers.
// However, they do not work reliably in Internet Explorer or Safari.
// Internet Explorer 10 is the only browser that has setImmediate but does
// not have MutationObservers.
// Although setImmediate yields to the browser's renderer, it would be
// preferrable to falling back to setTimeout since it does not have
// the minimum 4ms penalty.
// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and
// Desktop to a lesser extent) that renders both setImmediate and
// MessageChannel useless for the purposes of ASAP.
// https://github.com/kriskowal/q/issues/396
// Timers are implemented universally.
// We fall back to timers in workers in most engines, and in foreground
// contexts in the following browsers.
// However, note that even this simple case requires nuances to operate in a
// broad spectrum of browsers.
//
// - Firefox 3-13
// - Internet Explorer 6-9
// - iPad Safari 4.3
// - Lynx 2.8.7
} else {
requestFlush = makeRequestCallFromTimer(flush);
}
// `requestFlush` requests that the high priority event queue be flushed as
// soon as possible.
// This is useful to prevent an error thrown in a task from stalling the event
// queue if the exception handled by Node.jss
// `process.on("uncaughtException")` or by a domain.
rawAsap.requestFlush = requestFlush;
// To request a high priority event, we induce a mutation observer by toggling
// the text of a text node between "1" and "-1".
function makeRequestCallFromMutationObserver(callback) {
var toggle = 1;
var observer = new BrowserMutationObserver(callback);
var node = document.createTextNode("");
observer.observe(node, {characterData: true});
return function requestCall() {
toggle = -toggle;
node.data = toggle;
};
}
// The message channel technique was discovered by Malte Ubl and was the
// original foundation for this library.
// http://www.nonblocking.io/2011/06/windownexttick.html
// Safari 6.0.5 (at least) intermittently fails to create message ports on a
// page's first load. Thankfully, this version of Safari supports
// MutationObservers, so we don't need to fall back in that case.
// function makeRequestCallFromMessageChannel(callback) {
// var channel = new MessageChannel();
// channel.port1.onmessage = callback;
// return function requestCall() {
// channel.port2.postMessage(0);
// };
// }
// For reasons explained above, we are also unable to use `setImmediate`
// under any circumstances.
// Even if we were, there is another bug in Internet Explorer 10.
// It is not sufficient to assign `setImmediate` to `requestFlush` because
// `setImmediate` must be called *by name* and therefore must be wrapped in a
// closure.
// Never forget.
// function makeRequestCallFromSetImmediate(callback) {
// return function requestCall() {
// setImmediate(callback);
// };
// }
// Safari 6.0 has a problem where timers will get lost while the user is
// scrolling. This problem does not impact ASAP because Safari 6.0 supports
// mutation observers, so that implementation is used instead.
// However, if we ever elect to use timers in Safari, the prevalent work-around
// is to add a scroll event listener that calls for a flush.
// `setTimeout` does not call the passed callback if the delay is less than
// approximately 7 in web workers in Firefox 8 through 18, and sometimes not
// even then.
function makeRequestCallFromTimer(callback) {
return function requestCall() {
// We dispatch a timeout with a specified delay of 0 for engines that
// can reliably accommodate that request. This will usually be snapped
// to a 4 milisecond delay, but once we're flushing, there's no delay
// between events.
var timeoutHandle = setTimeout(handleTimer, 0);
// However, since this timer gets frequently dropped in Firefox
// workers, we enlist an interval handle that will try to fire
// an event 20 times per second until it succeeds.
var intervalHandle = setInterval(handleTimer, 50);
function handleTimer() {
// Whichever timer succeeds will cancel both timers and
// execute the callback.
clearTimeout(timeoutHandle);
clearInterval(intervalHandle);
callback();
}
};
}
// This is for `asap.js` only.
// Its name will be periodically randomized to break any code that depends on
// its existence.
rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;
// ASAP was originally a nextTick shim included in Q. This was factored out
// into this ASAP package. It was later adapted to RSVP which made further
// amendments. These decisions, particularly to marginalize MessageChannel and
// to capture the MutationObserver implementation in a closure, were integrated
// back into ASAP proper.
// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js

View File

@@ -0,0 +1,87 @@
{
"_from": "asap@~2.0.3",
"_id": "asap@2.0.6",
"_inBundle": false,
"_integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=",
"_location": "/react-select/asap",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "asap@~2.0.3",
"name": "asap",
"escapedName": "asap",
"rawSpec": "~2.0.3",
"saveSpec": null,
"fetchSpec": "~2.0.3"
},
"_requiredBy": [
"/react-select/promise"
],
"_resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
"_shasum": "e50347611d7e690943208bbdafebcbc2fb866d46",
"_spec": "asap@~2.0.3",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project\\node_modules\\react-select\\node_modules\\promise",
"browser": {
"./asap": "./browser-asap.js",
"./asap.js": "./browser-asap.js",
"./raw": "./browser-raw.js",
"./raw.js": "./browser-raw.js",
"./test/domain.js": "./test/browser-domain.js"
},
"bugs": {
"url": "https://github.com/kriskowal/asap/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "High-priority task queue for Node.js and browsers",
"devDependencies": {
"benchmark": "^1.0.0",
"events": "^1.0.1",
"jshint": "^2.5.1",
"knox": "^0.8.10",
"mr": "^2.0.5",
"opener": "^1.3.0",
"q": "^2.0.3",
"q-io": "^2.0.3",
"saucelabs": "^0.1.1",
"wd": "^0.2.21",
"weak-map": "^1.0.5"
},
"files": [
"raw.js",
"asap.js",
"browser-raw.js",
"browser-asap.js"
],
"homepage": "https://github.com/kriskowal/asap#readme",
"keywords": [
"event",
"task",
"queue"
],
"license": "MIT",
"main": "./asap.js",
"name": "asap",
"react-native": {
"domain": false
},
"repository": {
"type": "git",
"url": "git+https://github.com/kriskowal/asap.git"
},
"scripts": {
"benchmarks": "node benchmarks",
"lint": "jshint raw.js asap.js browser-raw.js browser-asap.js $(find scripts -name '*.js' | grep -v gauntlet)",
"test": "npm run lint && npm run test-node",
"test-browser": "node scripts/publish-bundle.js test/asap-test.js | xargs opener",
"test-node": "node test/asap-test.js",
"test-publish": "node scripts/publish-bundle.js test/asap-test.js | pbcopy",
"test-saucelabs": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-spot-configurations.json",
"test-saucelabs-all": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-all-configurations.json",
"test-saucelabs-worker": "node scripts/saucelabs-worker-test.js scripts/saucelabs-spot-configurations.json",
"test-saucelabs-worker-all": "node scripts/saucelabs-worker-test.js scripts/saucelabs-all-configurations.json",
"test-travis": "npm run lint && npm run test-node && npm run test-saucelabs && npm run test-saucelabs-worker"
},
"version": "2.0.6"
}

View File

@@ -0,0 +1,101 @@
"use strict";
var domain; // The domain module is executed on demand
var hasSetImmediate = typeof setImmediate === "function";
// Use the fastest means possible to execute a task in its own turn, with
// priority over other events including network IO events in Node.js.
//
// An exception thrown by a task will permanently interrupt the processing of
// subsequent tasks. The higher level `asap` function ensures that if an
// exception is thrown by a task, that the task queue will continue flushing as
// soon as possible, but if you use `rawAsap` directly, you are responsible to
// either ensure that no exceptions are thrown from your task, or to manually
// call `rawAsap.requestFlush` if an exception is thrown.
module.exports = rawAsap;
function rawAsap(task) {
if (!queue.length) {
requestFlush();
flushing = true;
}
// Avoids a function call
queue[queue.length] = task;
}
var queue = [];
// Once a flush has been requested, no further calls to `requestFlush` are
// necessary until the next `flush` completes.
var flushing = false;
// The position of the next task to execute in the task queue. This is
// preserved between calls to `flush` so that it can be resumed if
// a task throws an exception.
var index = 0;
// If a task schedules additional tasks recursively, the task queue can grow
// unbounded. To prevent memory excaustion, the task queue will periodically
// truncate already-completed tasks.
var capacity = 1024;
// The flush function processes all tasks that have been scheduled with
// `rawAsap` unless and until one of those tasks throws an exception.
// If a task throws an exception, `flush` ensures that its state will remain
// consistent and will resume where it left off when called again.
// However, `flush` does not make any arrangements to be called again if an
// exception is thrown.
function flush() {
while (index < queue.length) {
var currentIndex = index;
// Advance the index before calling the task. This ensures that we will
// begin flushing on the next task the task throws an error.
index = index + 1;
queue[currentIndex].call();
// Prevent leaking memory for long chains of recursive calls to `asap`.
// If we call `asap` within tasks scheduled by `asap`, the queue will
// grow, but to avoid an O(n) walk for every task we execute, we don't
// shift tasks off the queue after they have been executed.
// Instead, we periodically shift 1024 tasks off the queue.
if (index > capacity) {
// Manually shift all values starting at the index back to the
// beginning of the queue.
for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
queue[scan] = queue[scan + index];
}
queue.length -= index;
index = 0;
}
}
queue.length = 0;
index = 0;
flushing = false;
}
rawAsap.requestFlush = requestFlush;
function requestFlush() {
// Ensure flushing is not bound to any domain.
// It is not sufficient to exit the domain, because domains exist on a stack.
// To execute code outside of any domain, the following dance is necessary.
var parentDomain = process.domain;
if (parentDomain) {
if (!domain) {
// Lazy execute the domain module.
// Only employed if the user elects to use domains.
domain = require("domain");
}
domain.active = process.domain = null;
}
// `setImmediate` is slower that `process.nextTick`, but `process.nextTick`
// cannot handle recursion.
// `requestFlush` will only be called recursively from `asap.js`, to resume
// flushing after an error is thrown into a domain.
// Conveniently, `setImmediate` was introduced in the same version
// `process.nextTick` started throwing recursion errors.
if (flushing && hasSetImmediate) {
setImmediate(flush);
} else {
process.nextTick(flush);
}
if (parentDomain) {
domain.active = process.domain = parentDomain;
}
}

View File

@@ -0,0 +1,21 @@
# Contributing
Thanks for your interest in classNames. Issues, PRs and suggestions welcome :)
Before working on a PR, please consider the following:
* Speed is a serious concern for this package as it is likely to be called a
significant number of times in any project that uses it. As such, new features
will only be accepted if they improve (or at least do not negatively impact)
performance.
* To demonstrate performance differences please set up a
[JSPerf](http://jsperf.com) test and link to it from your issue / PR.
* Tests must be added for any change or new feature before it will be accepted.
A benchmark utilitiy is included so that changes may be tested against the
current published version. To run the benchmarks, `npm install` in the
`./benchmarks` directory then run `npm run benchmarks` in the package root.
Please be aware though that local benchmarks are just a smoke-signal; they will
run in the v8 version that your node/iojs uses, while classNames is _most_
often run across a wide variety of browsers and browser versions.

View File

@@ -0,0 +1,81 @@
# Changelog
## v2.2.5 / 2016-05-02
* Improved performance of `dedupe` variant even further, thanks [Andres Suarez](https://github.com/zertosh)
## v2.2.4 / 2016-04-25
* Improved performance of `dedupe` variant by about 2x, thanks [Bartosz Gościński](https://github.com/bgoscinski)
## v2.2.3 / 2016-01-05
* Updated `bind` variant to use `[].join(' ')` as per the main script in 2.2.2
## v2.2.2 / 2016-01-04
* Switched from string concatenation to `[].join(' ')` for a slight performance gain in the main function.
## v2.2.1 / 2015-11-26
* Add deps parameter to the AMD module, fixes an issue using the Dojo loader, thanks [Chris Jordan](https://github.com/flipperkid)
## v2.2.0 / 2015-10-18
* added a new `bind` variant for use with [css-modules](https://github.com/css-modules/css-modules) and similar abstractions, thanks to [Kirill Yakovenko](https://github.com/blia)
## v2.1.5 / 2015-09-30
* reverted a new usage of `Object.keys` in `dedupe.js` that slipped through in the last release
## v2.1.4 / 2015-09-30
* new case added to benchmarks
* safer `hasOwnProperty` check
* AMD module is now named, so you can do the following:
```
define(["classnames"], function (classNames) {
var style = classNames("foo", "bar");
// ...
});
```
## v2.1.3 / 2015-07-02
* updated UMD wrapper to support AMD and CommonJS on the same pacge
## v2.1.2 / 2015-05-28
* added a proper UMD wrapper
## v2.1.1 / 2015-05-06
* minor performance improvement thanks to type caching
* improved benchmarking and results output
## v2.1.0 / 2015-05-05
* added alternate `dedupe` version of classNames, which is slower (10x) but ensures that if a class is added then overridden by a falsy value in a subsequent argument, it is excluded from the result.
## v2.0.0 / 2015-05-03
* performance improvement; switched to `Array.isArray` for type detection, which is much faster in modern browsers. A polyfill is now required for IE8 support, see the Readme for details.
## v1.2.2 / 2015-04-28
* license comment updates to simiplify certain build scenarios
## v1.2.1 / 2015-04-22
* added safe exporting for requireJS usage
* clarified Bower usage and instructions
## v1.2.0 / 2015-03-17
* added comprehensive support for array arguments, including nested arrays
* simplified code slightly
## Previous
Please see the git history for the details of previous versions.

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Jed Watson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,188 @@
Classnames
===========
[![Version](http://img.shields.io/npm/v/classnames.svg)](https://www.npmjs.org/package/classnames)
[![Build Status](https://travis-ci.org/JedWatson/classnames.svg?branch=master)](https://travis-ci.org/JedWatson/classnames)
A simple javascript utility for conditionally joining classNames together.
Install with npm or Bower.
```sh
npm install classnames
```
Use with node.js, browserify or webpack:
```js
var classNames = require('classnames');
classNames('foo', 'bar'); // => 'foo bar'
```
Alternatively, you can simply include `index.js` on your page with a standalone `<script>` tag and it will export a global `classNames` method, or define the module if you are using RequireJS.
### Project philosophy
We take the stability and performance of this package seriously, because it is run millions of times a day in browsers all around the world. Updates are thoroughly reviewed for performance impacts before being released, and we have a comprehensive test suite.
Classnames follows the [SemVer](http://semver.org/) standard for versioning.
There is also a [Changelog](https://github.com/JedWatson/classnames/blob/master/HISTORY.md).
## Usage
The `classNames` function takes any number of arguments which can be a string or object.
The argument `'foo'` is short for `{ foo: true }`. If the value of the key is falsy, it won't be included in the output.
```js
classNames('foo', 'bar'); // => 'foo bar'
classNames('foo', { bar: true }); // => 'foo bar'
classNames({ 'foo-bar': true }); // => 'foo-bar'
classNames({ 'foo-bar': false }); // => ''
classNames({ foo: true }, { bar: true }); // => 'foo bar'
classNames({ foo: true, bar: true }); // => 'foo bar'
// lots of arguments of various types
classNames('foo', { bar: true, duck: false }, 'baz', { quux: true }); // => 'foo bar baz quux'
// other falsy values are just ignored
classNames(null, false, 'bar', undefined, 0, 1, { baz: null }, ''); // => 'bar 1'
```
Arrays will be recursively flattened as per the rules above:
```js
var arr = ['b', { c: true, d: false }];
classNames('a', arr); // => 'a b c'
```
### Dynamic class names with ES2015
If you're in an environment that supports [computed keys](http://www.ecma-international.org/ecma-262/6.0/#sec-object-initializer) (available in ES2015 and Babel) you can use dynamic class names:
```js
let buttonType = 'primary';
classNames({ [`btn-${buttonType}`]: true });
```
### Usage with React.js
This package is the official replacement for `classSet`, which was originally shipped in the React.js Addons bundle.
One of its primary use cases is to make dynamic and conditional className props simpler to work with (especially more so than conditional string manipulation). So where you may have the following code to generate a `className` prop for a `<button>` in React:
```js
var Button = React.createClass({
// ...
render () {
var btnClass = 'btn';
if (this.state.isPressed) btnClass += ' btn-pressed';
else if (this.state.isHovered) btnClass += ' btn-over';
return <button className={btnClass}>{this.props.label}</button>;
}
});
```
You can express the conditional classes more simply as an object:
```js
var classNames = require('classnames');
var Button = React.createClass({
// ...
render () {
var btnClass = classNames({
'btn': true,
'btn-pressed': this.state.isPressed,
'btn-over': !this.state.isPressed && this.state.isHovered
});
return <button className={btnClass}>{this.props.label}</button>;
}
});
```
Because you can mix together object, array and string arguments, supporting optional className props is also simpler as only truthy arguments get included in the result:
```js
var btnClass = classNames('btn', this.props.className, {
'btn-pressed': this.state.isPressed,
'btn-over': !this.state.isPressed && this.state.isHovered
});
```
### Alternate `dedupe` version
There is an alternate version of `classNames` available which correctly dedupes classes and ensures that falsy classes specified in later arguments are excluded from the result set.
This version is slower (about 5x) so it is offered as an opt-in.
To use the dedupe version with node, browserify or webpack:
```js
var classNames = require('classnames/dedupe');
classNames('foo', 'foo', 'bar'); // => 'foo bar'
classNames('foo', { foo: false, bar: true }); // => 'bar'
```
For standalone (global / AMD) use, include `dedupe.js` in a `<script>` tag on your page.
### Alternate `bind` version (for [css-modules](https://github.com/css-modules/css-modules))
If you are using [css-modules](https://github.com/css-modules/css-modules), or a similar approach to abstract class "names" and the real `className` values that are actually output to the DOM, you may want to use the `bind` variant.
_Note that in ES2015 environments, it may be better to use the "dynamic class names" approach documented above._
```js
var classNames = require('classnames/bind');
var styles = {
foo: 'abc',
bar: 'def',
baz: 'xyz'
};
var cx = classNames.bind(styles);
var className = cx('foo', ['bar'], { baz: true }); // => "abc def xyz"
```
Real-world example:
```js
/* components/submit-button.js */
import { Component } from 'react';
import classNames from 'classnames/bind';
import styles from './submit-button.css';
let cx = classNames.bind(styles);
export default class SubmitButton extends Component {
render () {
let text = this.props.store.submissionInProgress ? 'Processing...' : 'Submit';
let className = cx({
base: true,
inProgress: this.props.store.submissionInProgress,
error: this.props.store.errorOccurred,
disabled: this.props.form.valid,
});
return <button className={className}>{text}</button>;
}
};
```
## Polyfills needed to support older browsers
#### `classNames >=2.0.0`
`Array.isArray`: see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) for details about unsupported older browsers (e.g. <= IE8) and a simple polyfill.
`Object.keys`: see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys) for details about unsupported older browsers (e.g. <= IE8) and a simple polyfill. This is only used in `dedupe.js`.
## License
[MIT](LICENSE). Copyright (c) 2016 Jed Watson.

View File

@@ -0,0 +1,48 @@
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var hasOwn = {}.hasOwnProperty;
function classNames () {
var classes = [];
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
var argType = typeof arg;
if (argType === 'string' || argType === 'number') {
classes.push(this && this[arg] || arg);
} else if (Array.isArray(arg)) {
classes.push(classNames.apply(this, arg));
} else if (argType === 'object') {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(this && this[key] || key);
}
}
}
}
return classes.join(' ');
}
if (typeof module !== 'undefined' && module.exports) {
module.exports = classNames;
} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
// register as 'classnames', consistent with npm package name
define('classnames', [], function () {
return classNames;
});
} else {
window.classNames = classNames;
}
}());

View File

@@ -0,0 +1,37 @@
{
"name": "classnames",
"version": "2.2.5",
"description": "A simple utility for conditionally joining classNames together",
"main": [
"index.js",
"bind.js",
"dedupe.js"
],
"homepage": "https://github.com/JedWatson/classnames",
"authors": [
"Jed Watson"
],
"moduleType": [
"amd",
"globals",
"node"
],
"keywords": [
"react",
"css",
"classes",
"classname",
"classnames",
"util",
"utility"
],
"license": "MIT",
"ignore": [
".editorconfig",
".gitignore",
"gulpfile.js",
"package.json",
"node_modules",
"tests.js"
]
}

View File

@@ -0,0 +1,109 @@
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var classNames = (function () {
// don't inherit from Object so we can skip hasOwnProperty check later
// http://stackoverflow.com/questions/15518328/creating-js-object-with-object-createnull#answer-21079232
function StorageObject() {}
StorageObject.prototype = Object.create(null);
function _parseArray (resultSet, array) {
var length = array.length;
for (var i = 0; i < length; ++i) {
_parse(resultSet, array[i]);
}
}
var hasOwn = {}.hasOwnProperty;
function _parseNumber (resultSet, num) {
resultSet[num] = true;
}
function _parseObject (resultSet, object) {
for (var k in object) {
if (hasOwn.call(object, k)) {
// set value to false instead of deleting it to avoid changing object structure
// https://www.smashingmagazine.com/2012/11/writing-fast-memory-efficient-javascript/#de-referencing-misconceptions
resultSet[k] = !!object[k];
}
}
}
var SPACE = /\s+/;
function _parseString (resultSet, str) {
var array = str.split(SPACE);
var length = array.length;
for (var i = 0; i < length; ++i) {
resultSet[array[i]] = true;
}
}
function _parse (resultSet, arg) {
if (!arg) return;
var argType = typeof arg;
// 'foo bar'
if (argType === 'string') {
_parseString(resultSet, arg);
// ['foo', 'bar', ...]
} else if (Array.isArray(arg)) {
_parseArray(resultSet, arg);
// { 'foo': true, ... }
} else if (argType === 'object') {
_parseObject(resultSet, arg);
// '130'
} else if (argType === 'number') {
_parseNumber(resultSet, arg);
}
}
function _classNames () {
// don't leak arguments
// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
var len = arguments.length;
var args = Array(len);
for (var i = 0; i < len; i++) {
args[i] = arguments[i];
}
var classSet = new StorageObject();
_parseArray(classSet, args);
var list = [];
for (var k in classSet) {
if (classSet[k]) {
list.push(k)
}
}
return list.join(' ');
}
return _classNames;
})();
if (typeof module !== 'undefined' && module.exports) {
module.exports = classNames;
} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
// register as 'classnames', consistent with npm package name
define('classnames', [], function () {
return classNames;
});
} else {
window.classNames = classNames;
}
}());

View File

@@ -0,0 +1,48 @@
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var hasOwn = {}.hasOwnProperty;
function classNames () {
var classes = [];
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
var argType = typeof arg;
if (argType === 'string' || argType === 'number') {
classes.push(arg);
} else if (Array.isArray(arg)) {
classes.push(classNames.apply(null, arg));
} else if (argType === 'object') {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
}
}
return classes.join(' ');
}
if (typeof module !== 'undefined' && module.exports) {
module.exports = classNames;
} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
// register as 'classnames', consistent with npm package name
define('classnames', [], function () {
return classNames;
});
} else {
window.classNames = classNames;
}
}());

View File

@@ -0,0 +1,61 @@
{
"_from": "classnames@^2.2.4",
"_id": "classnames@2.2.5",
"_inBundle": false,
"_integrity": "sha1-+zgB1FNGdknvNgPH1hoCvRKb3m0=",
"_location": "/react-select/classnames",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "classnames@^2.2.4",
"name": "classnames",
"escapedName": "classnames",
"rawSpec": "^2.2.4",
"saveSpec": null,
"fetchSpec": "^2.2.4"
},
"_requiredBy": [
"/react-select"
],
"_resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.5.tgz",
"_shasum": "fb3801d453467649ef3603c7d61a02bd129bde6d",
"_spec": "classnames@^2.2.4",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project\\node_modules\\react-select",
"author": {
"name": "Jed Watson"
},
"bugs": {
"url": "https://github.com/JedWatson/classnames/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "A simple utility for conditionally joining classNames together",
"devDependencies": {
"benchmark": "^1.0.0",
"mocha": "^2.1.0"
},
"homepage": "https://github.com/JedWatson/classnames#readme",
"keywords": [
"react",
"css",
"classes",
"classname",
"classnames",
"util",
"utility"
],
"license": "MIT",
"main": "index.js",
"name": "classnames",
"repository": {
"type": "git",
"url": "git+https://github.com/JedWatson/classnames.git"
},
"scripts": {
"benchmarks": "node ./benchmarks/run",
"test": "npm run unit",
"unit": "mocha tests/*.js"
},
"version": "2.2.5"
}

View File

@@ -0,0 +1,409 @@
## Changelog
##### 1.2.7 [LEGACY] - 2016.07.18
* some fixes for issues like #159, #186, #194, #207
##### 1.2.6 - 2015.11.09
* reject with `TypeError` on attempt resolve promise itself
* correct behavior with broken `Promise` subclass constructors / methods
* added `Promise`-based fallback for microtask
* fixed V8 and FF `Array#{values, @@iterator}.name`
* fixed IE7- `[1, 2].join(undefined) -> '1,2'`
* some other fixes / improvements / optimizations
##### 1.2.5 - 2015.11.02
* some more `Number` constructor fixes:
* fixed V8 ~ Node 0.8 bug: `Number('+0x1')` should be `NaN`
* fixed `Number(' 0b1\n')` case, should be `1`
* fixed `Number()` case, should be `0`
##### 1.2.4 - 2015.11.01
* fixed `Number('0b12') -> NaN` case in the shim
* fixed V8 ~ Chromium 40- bug - `Weak(Map|Set)#{delete, get, has}` should not throw errors [#124](https://github.com/zloirock/core-js/issues/124)
* some other fixes and optimizations
##### 1.2.3 - 2015.10.23
* fixed some problems related old V8 bug `Object('a').propertyIsEnumerable(0) // => false`, for example, `Object.assign({}, 'qwe')` from the last release
* fixed `.name` property and `Function#toString` conversion some polyfilled methods
* fixed `Math.imul` arity in Safari 8-
##### 1.2.2 - 2015.10.18
* improved optimisations for V8
* fixed build process from external packages, [#120](https://github.com/zloirock/core-js/pull/120)
* one more `Object.{assign, values, entries}` fix for [**very** specific case](https://github.com/ljharb/proposal-object-values-entries/issues/5)
##### 1.2.1 - 2015.10.02
* replaced fix `JSON.stringify` + `Symbol` behavior from `.toJSON` method to wrapping `JSON.stringify` - little more correct, [compat-table/642](https://github.com/kangax/compat-table/pull/642)
* fixed typo which broke tasks scheduler in WebWorkers in old FF, [#114](https://github.com/zloirock/core-js/pull/114)
##### 1.2.0 - 2015.09.27
* added browser [`Promise` rejection hook](#unhandled-rejection-tracking), [#106](https://github.com/zloirock/core-js/issues/106)
* added correct [`IsRegExp`](http://www.ecma-international.org/ecma-262/6.0/#sec-isregexp) logic to [`String#{includes, startsWith, endsWith}`](https://github.com/zloirock/core-js/#ecmascript-6-string) and [`RegExp` constructor](https://github.com/zloirock/core-js/#ecmascript-6-regexp), `@@match` case, [example](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match#Disabling_the_isRegExp_check)
* updated [`String#leftPad`](https://github.com/zloirock/core-js/#ecmascript-7) [with proposal](https://github.com/ljharb/proposal-string-pad-left-right/issues/6): string filler truncated from the right side
* replaced V8 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object) - its properties order not only [incorrect](https://github.com/sindresorhus/object-assign/issues/22), it is non-deterministic and it causes some problems
* fixed behavior with deleted in getters properties for `Object.{`[`assign`](https://github.com/zloirock/core-js/#ecmascript-6-object)`, `[`entries, values`](https://github.com/zloirock/core-js/#ecmascript-7)`}`, [example](http://goo.gl/iQE01c)
* fixed [`Math.sinh`](https://github.com/zloirock/core-js/#ecmascript-6-math) with very small numbers in V8 near Chromium 38
* some other fixes and optimizations
##### 1.1.4 - 2015.09.05
* fixed support symbols in FF34-35 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object)
* fixed [collections iterators](https://github.com/zloirock/core-js/#ecmascript-6-iterators) in FF25-26
* fixed non-generic WebKit [`Array.of`](https://github.com/zloirock/core-js/#ecmascript-6-array)
* some other fixes and optimizations
##### 1.1.3 - 2015.08.29
* fixed support Node.js domains in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise), [#103](https://github.com/zloirock/core-js/issues/103)
##### 1.1.2 - 2015.08.28
* added `toJSON` method to [`Symbol`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill and to MS Edge implementation for expected `JSON.stringify` result w/o patching this method
* replaced [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) implementations w/o correct support third argument
* fixed `global` detection with changed `document.domain` in ~IE8, [#100](https://github.com/zloirock/core-js/issues/100)
##### 1.1.1 - 2015.08.20
* added more correct microtask implementation for [`Promise`](#ecmascript-6-promise)
##### 1.1.0 - 2015.08.17
* updated [string padding](https://github.com/zloirock/core-js/#ecmascript-7) to [actual proposal](https://github.com/ljharb/proposal-string-pad-left-right) - renamed, minor internal changes:
* `String#lpad` -> `String#padLeft`
* `String#rpad` -> `String#padRight`
* added [string trim functions](#ecmascript-7) - [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim), defacto standard - required only for IE11- and fixed for some old engines:
* `String#trimLeft`
* `String#trimRight`
* [`String#trim`](https://github.com/zloirock/core-js/#ecmascript-6-string) fixed for some engines by es6 spec and moved from `es5` to single `es6` module
* splitted [`es6.object.statics-accept-primitives`](https://github.com/zloirock/core-js/#ecmascript-6-object)
* caps for `freeze`-family `Object` methods moved from `es5` to `es6` namespace and joined with [es6 wrappers](https://github.com/zloirock/core-js/#ecmascript-6-object)
* `es5` [namespace](https://github.com/zloirock/core-js/#commonjs) also includes modules, moved to `es6` namespace - you can use it as before
* increased `MessageChannel` priority in `$.task`, [#95](https://github.com/zloirock/core-js/issues/95)
* does not get `global.Symbol` on each getting iterator, if you wanna use alternative `Symbol` shim - add it before `core-js`
* [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) optimized and fixed for some cases
* simplified [`Reflect.enumerate`](https://github.com/zloirock/core-js/#ecmascript-6-reflect), see [this question](https://esdiscuss.org/topic/question-about-enumerate-and-property-decision-timing)
* some corrections in [`Math.acosh`](https://github.com/zloirock/core-js/#ecmascript-6-math)
* fixed [`Math.imul`](https://github.com/zloirock/core-js/#ecmascript-6-math) for old WebKit
* some fixes in string / RegExp [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp) logic
* some other fixes and optimizations
##### 1.0.1 - 2015.07.31
* some fixes for final MS Edge, replaced broken native `Reflect.defineProperty`
* some minor fixes and optimizations
* changed compression `client/*.min.js` options for safe `Function#name` and `Function#length`, should be fixed [#92](https://github.com/zloirock/core-js/issues/92)
##### 1.0.0 - 2015.07.22
* added logic for [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp):
* `Symbol.match`
* `Symbol.replace`
* `Symbol.split`
* `Symbol.search`
* actualized and optimized work with iterables:
* optimized [`Map`, `Set`, `WeakMap`, `WeakSet` constructors](https://github.com/zloirock/core-js/#ecmascript-6-collections), [`Promise.all`, `Promise.race`](https://github.com/zloirock/core-js/#ecmascript-6-promise) for default `Array Iterator`
* optimized [`Array.from`](https://github.com/zloirock/core-js/#ecmascript-6-array) for default `Array Iterator`
* added [`core.getIteratorMethod`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) helper
* uses enumerable properties in shimmed instances - collections, iterators, etc for optimize performance
* added support native constructors to [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) with 2 arguments
* added support native constructors to [`Function#bind`](https://github.com/zloirock/core-js/#ecmascript-5) shim with `new`
* removed obsolete `.clear` methods native [`Weak`-collections](https://github.com/zloirock/core-js/#ecmascript-6-collections)
* maximum modularity, reduced minimal custom build size, separated into submodules:
* [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect)
* [`es6.regexp`](https://github.com/zloirock/core-js/#ecmascript-6-regexp)
* [`es6.math`](https://github.com/zloirock/core-js/#ecmascript-6-math)
* [`es6.number`](https://github.com/zloirock/core-js/#ecmascript-6-number)
* [`es7.object.to-array`](https://github.com/zloirock/core-js/#ecmascript-7)
* [`core.object`](https://github.com/zloirock/core-js/#object)
* [`core.string`](https://github.com/zloirock/core-js/#escaping-html)
* [`core.iter-helpers`](https://github.com/zloirock/core-js/#ecmascript-6-iterators)
* internal modules (`$`, `$.iter`, etc)
* many other optimizations
* final cleaning non-standard features
* moved `$for` to [separate library](https://github.com/zloirock/forof). This work for syntax - `for-of` loop and comprehensions
* moved `Date#{format, formatUTC}` to [separate library](https://github.com/zloirock/dtf). Standard way for this - `ECMA-402`
* removed `Math` methods from `Number.prototype`. Slight sugar for simple `Math` methods calling
* removed `{Array#, Array, Dict}.turn`
* removed `core.global`
* uses `ToNumber` instead of `ToLength` in [`Number Iterator`](https://github.com/zloirock/core-js/#number-iterator), `Array.from(2.5)` will be `[0, 1, 2]` instead of `[0, 1]`
* fixed [#85](https://github.com/zloirock/core-js/issues/85) - invalid `Promise` unhandled rejection message in nested `setTimeout`
* fixed [#86](https://github.com/zloirock/core-js/issues/86) - support FF extensions
* fixed [#89](https://github.com/zloirock/core-js/issues/89) - behavior `Number` constructor in strange case
##### 0.9.18 - 2015.06.17
* removed `/` from [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7) escaped characters
##### 0.9.17 - 2015.06.14
* updated [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7) to the [latest proposal](https://github.com/benjamingr/RexExp.escape)
* fixed conflict with webpack dev server + IE buggy behavior
##### 0.9.16 - 2015.06.11
* more correct order resolving thenable in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) polyfill
* uses polyfill instead of [buggy V8 `Promise`](https://github.com/zloirock/core-js/issues/78)
##### 0.9.15 - 2015.06.09
* [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) from `library` version return wrapped native instances
* fixed collections prototype methods in `library` version
* optimized [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math)
##### 0.9.14 - 2015.06.04
* updated [`Promise.resolve` behavior](https://esdiscuss.org/topic/fixing-promise-resolve)
* added fallback for IE11 buggy `Object.getOwnPropertyNames` + iframe
* some other fixes
##### 0.9.13 - 2015.05.25
* added fallback for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol) for old Android
* some other fixes
##### 0.9.12 - 2015.05.24
* different instances `core-js` should use / recognize the same symbols
* some fixes
##### 0.9.11 - 2015.05.18
* simplified [custom build](https://github.com/zloirock/core-js/#custom-build)
* add custom build js api
* added `grunt-cli` to `devDependencies` for `npm run grunt`
* some fixes
##### 0.9.10 - 2015.05.16
* wrapped `Function#toString` for correct work wrapped methods / constructors with methods similar to the [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197)
* added proto versions of methods to export object in `default` version for consistency with `library` version
##### 0.9.9 - 2015.05.14
* wrapped `Object#propertyIsEnumerable` for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol)
* [added proto versions of methods to `library` for ES7 bind syntax](https://github.com/zloirock/core-js/issues/65)
* some other fixes
##### 0.9.8 - 2015.05.12
* fixed [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math) with negative arguments
* added `Object#toString.toString` as fallback for [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197)
##### 0.9.7 - 2015.05.07
* added [support DOM collections](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice#Streamlining_cross-browser_behavior) to IE8- `Array#slice`
##### 0.9.6 - 2015.05.01
* added [`String#lpad`, `String#rpad`](https://github.com/zloirock/core-js/#ecmascript-7)
##### 0.9.5 - 2015.04.30
* added cap for `Function#@@hasInstance`
* some fixes and optimizations
##### 0.9.4 - 2015.04.27
* fixed `RegExp` constructor
##### 0.9.3 - 2015.04.26
* some fixes and optimizations
##### 0.9.2 - 2015.04.25
* more correct [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking and resolving / rejection priority
##### 0.9.1 - 2015.04.25
* fixed `__proto__`-based [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) subclassing in some environments
##### 0.9.0 - 2015.04.24
* added correct [symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol) descriptors
* fixed behavior `Object.{assign, create, defineProperty, defineProperties, getOwnPropertyDescriptor, getOwnPropertyDescriptors}` with symbols
* added [single entry points](https://github.com/zloirock/core-js/#commonjs) for `Object.{create, defineProperty, defineProperties}`
* added [`Map#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7)
* removed non-standard methods `Object#[_]` and `Function#only` - they solves syntax problems, but now in compilers available arrows and ~~in near future will be available~~ [available](http://babeljs.io/blog/2015/05/14/function-bind/) [bind syntax](https://github.com/zenparsing/es-function-bind)
* removed non-standard undocumented methods `Symbol.{pure, set}`
* some fixes and internal changes
##### 0.8.4 - 2015.04.18
* uses `webpack` instead of `browserify` for browser builds - more compression-friendly result
##### 0.8.3 - 2015.04.14
* fixed `Array` statics with single entry points
##### 0.8.2 - 2015.04.13
* [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) now also works in IE9-
* added [`Set#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7)
* some optimizations and fixes
##### 0.8.1 - 2015.04.03
* fixed `Symbol.keyFor`
##### 0.8.0 - 2015.04.02
* changed [CommonJS API](https://github.com/zloirock/core-js/#commonjs)
* splitted and renamed some modules
* added support ES3 environment (ES5 polyfill) to **all** default versions - size increases slightly (+ ~4kb w/o gzip), many issues disappear, if you don't need it - [simply include only required namespaces / features / modules](https://github.com/zloirock/core-js/#commonjs)
* removed [abstract references](https://github.com/zenparsing/es-abstract-refs) support - proposal has been superseded =\
* [`$for.isIterable` -> `core.isIterable`, `$for.getIterator` -> `core.getIterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), temporary available in old namespace
* fixed iterators support in v8 `Promise.all` and `Promise.race`
* many other fixes
##### 0.7.2 - 2015.03.09
* some fixes
##### 0.7.1 - 2015.03.07
* some fixes
##### 0.7.0 - 2015.03.06
* rewritten and splitted into [CommonJS modules](https://github.com/zloirock/core-js/#commonjs)
##### 0.6.1 - 2015.02.24
* fixed support [`Object.defineProperty`](https://github.com/zloirock/core-js/#ecmascript-5) with accessors on DOM elements on IE8
##### 0.6.0 - 2015.02.23
* added support safe closing iteration - calling `iterator.return` on abort iteration, if it exists
* added basic support [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking in shim
* added [`Object.getOwnPropertyDescriptors`](https://github.com/zloirock/core-js/#ecmascript-7)
* removed `console` cap - creates too many problems - you can use [`core.log`](https://github.com/zloirock/core-js/#console) module as that
* restructuring [namespaces](https://github.com/zloirock/core-js/#custom-build)
* some fixes
##### 0.5.4 - 2015.02.15
* some fixes
##### 0.5.3 - 2015.02.14
* added [support binary and octal literals](https://github.com/zloirock/core-js/#ecmascript-6-number) to `Number` constructor
* added [`Date#toISOString`](https://github.com/zloirock/core-js/#ecmascript-5)
##### 0.5.2 - 2015.02.10
* some fixes
##### 0.5.1 - 2015.02.09
* some fixes
##### 0.5.0 - 2015.02.08
* systematization of modules
* splitted [`es6` module](https://github.com/zloirock/core-js/#ecmascript-6)
* splitted [`console` module](https://github.com/zloirock/core-js/#console): `web.console` - only cap for missing methods, `core.log` - bound methods & additional features
* added [`delay` method](https://github.com/zloirock/core-js/#delay)
* some fixes
##### 0.4.10 - 2015.01.28
* [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill returns array of wrapped keys
##### 0.4.9 - 2015.01.27
* FF20-24 fix
##### 0.4.8 - 2015.01.25
* some [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) fixes
##### 0.4.7 - 2015.01.25
* added support frozen objects as [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) keys
##### 0.4.6 - 2015.01.21
* added [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol)
* added [`NodeList.prototype[@@iterator]`](https://github.com/zloirock/core-js/#ecmascript-6-iterators)
* added basic `@@species` logic - getter in native constructors
* removed `Function#by`
* some fixes
##### 0.4.5 - 2015.01.16
* some fixes
##### 0.4.4 - 2015.01.11
* enabled CSP support
##### 0.4.3 - 2015.01.10
* added `Function` instances `name` property for IE9+
##### 0.4.2 - 2015.01.10
* `Object` static methods accept primitives
* `RegExp` constructor can alter flags (IE9+)
* added `Array.prototype[Symbol.unscopables]`
##### 0.4.1 - 2015.01.05
* some fixes
##### 0.4.0 - 2015.01.03
* added [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) module:
* added `Reflect.apply`
* added `Reflect.construct`
* added `Reflect.defineProperty`
* added `Reflect.deleteProperty`
* added `Reflect.enumerate`
* added `Reflect.get`
* added `Reflect.getOwnPropertyDescriptor`
* added `Reflect.getPrototypeOf`
* added `Reflect.has`
* added `Reflect.isExtensible`
* added `Reflect.preventExtensions`
* added `Reflect.set`
* added `Reflect.setPrototypeOf`
* `core-js` methods now can use external `Symbol.iterator` polyfill
* some fixes
##### 0.3.3 - 2014.12.28
* [console cap](https://github.com/zloirock/core-js/#console) excluded from node.js default builds
##### 0.3.2 - 2014.12.25
* added cap for [ES5](https://github.com/zloirock/core-js/#ecmascript-5) freeze-family methods
* fixed `console` bug
##### 0.3.1 - 2014.12.23
* some fixes
##### 0.3.0 - 2014.12.23
* Optimize [`Map` & `Set`](https://github.com/zloirock/core-js/#ecmascript-6-collections):
* use entries chain on hash table
* fast & correct iteration
* iterators moved to [`es6`](https://github.com/zloirock/core-js/#ecmascript-6) and [`es6.collections`](https://github.com/zloirock/core-js/#ecmascript-6-collections) modules
##### 0.2.5 - 2014.12.20
* `console` no longer shortcut for `console.log` (compatibility problems)
* some fixes
##### 0.2.4 - 2014.12.17
* better compliance of ES6
* added [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) (IE10+)
* some fixes
##### 0.2.3 - 2014.12.15
* [Symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol):
* added option to disable addition setter to `Object.prototype` for Symbol polyfill:
* added `Symbol.useSimple`
* added `Symbol.useSetter`
* added cap for well-known Symbols:
* added `Symbol.hasInstance`
* added `Symbol.isConcatSpreadable`
* added `Symbol.match`
* added `Symbol.replace`
* added `Symbol.search`
* added `Symbol.species`
* added `Symbol.split`
* added `Symbol.toPrimitive`
* added `Symbol.unscopables`
##### 0.2.2 - 2014.12.13
* added [`RegExp#flags`](https://github.com/zloirock/core-js/#ecmascript-6-regexp) ([December 2014 Draft Rev 29](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#december_6_2014_draft_rev_29))
* added [`String.raw`](https://github.com/zloirock/core-js/#ecmascript-6-string)
##### 0.2.1 - 2014.12.12
* repair converting -0 to +0 in [native collections](https://github.com/zloirock/core-js/#ecmascript-6-collections)
##### 0.2.0 - 2014.12.06
* added [`es7.proposals`](https://github.com/zloirock/core-js/#ecmascript-7) and [`es7.abstract-refs`](https://github.com/zenparsing/es-abstract-refs) modules
* added [`String#at`](https://github.com/zloirock/core-js/#ecmascript-7)
* added real [`String Iterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), older versions used Array Iterator
* added abstract references support:
* added `Symbol.referenceGet`
* added `Symbol.referenceSet`
* added `Symbol.referenceDelete`
* added `Function#@@referenceGet`
* added `Map#@@referenceGet`
* added `Map#@@referenceSet`
* added `Map#@@referenceDelete`
* added `WeakMap#@@referenceGet`
* added `WeakMap#@@referenceSet`
* added `WeakMap#@@referenceDelete`
* added `Dict.{...methods}[@@referenceGet]`
* removed deprecated `.contains` methods
* some fixes
##### 0.1.5 - 2014.12.01
* added [`Array#copyWithin`](https://github.com/zloirock/core-js/#ecmascript-6-array)
* added [`String#codePointAt`](https://github.com/zloirock/core-js/#ecmascript-6-string)
* added [`String.fromCodePoint`](https://github.com/zloirock/core-js/#ecmascript-6-string)
##### 0.1.4 - 2014.11.27
* added [`Dict.mapPairs`](https://github.com/zloirock/core-js/#dict)
##### 0.1.3 - 2014.11.20
* [TC39 November meeting](https://github.com/rwaldron/tc39-notes/tree/master/es6/2014-11):
* [`.contains` -> `.includes`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-18.md#51--44-arrayprototypecontains-and-stringprototypecontains)
* `String#contains` -> [`String#includes`](https://github.com/zloirock/core-js/#ecmascript-6-string)
* `Array#contains` -> [`Array#includes`](https://github.com/zloirock/core-js/#ecmascript-7)
* `Dict.contains` -> [`Dict.includes`](https://github.com/zloirock/core-js/#dict)
* [removed `WeakMap#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm)
* [removed `WeakSet#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm)
##### 0.1.2 - 2014.11.19
* `Map` & `Set` bug fix
##### 0.1.1 - 2014.11.18
* public release

View File

@@ -0,0 +1,2 @@
require('LiveScript');
module.exports = require('./build/Gruntfile');

View File

@@ -0,0 +1,19 @@
Copyright (c) 2015 Denis Pushkarev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,34 @@
{
"name": "core.js",
"main": "client/core.js",
"version": "1.2.7",
"description": "Standard Library",
"keywords": [
"ES6",
"ECMAScript 6",
"ES7",
"ECMAScript 7",
"Map",
"Set",
"WeakMap",
"WeakSet",
"Dict",
"Promise",
"Symbol",
"console"
],
"authors": [
"Denis Pushkarev <zloirock@zloirock.ru> (http://zloirock.ru/)"
],
"license": "MIT",
"homepage": "https://github.com/zloirock/core-js",
"repository": {
"type": "git",
"url": "https://github.com/zloirock/core-js.git"
},
"ignore": [
"build",
"node_modules",
"tests"
]
}

View File

@@ -0,0 +1,84 @@
require! <[./build fs ./config]>
library-tests = <[client/library.js tests/helpers.js tests/library.js]>map -> src: it
module.exports = (grunt)->
grunt.loadNpmTasks \grunt-contrib-clean
grunt.loadNpmTasks \grunt-contrib-copy
grunt.loadNpmTasks \grunt-contrib-uglify
grunt.loadNpmTasks \grunt-contrib-watch
grunt.loadNpmTasks \grunt-livescript
grunt.loadNpmTasks \grunt-karma
grunt.initConfig do
pkg: grunt.file.readJSON './package.json'
uglify: build:
files: '<%=grunt.option("path")%>.min.js': '<%=grunt.option("path")%>.js'
options:
mangle: {+sort, +keep_fnames}
compress: {+pure_getters, +keep_fargs, +keep_fnames}
sourceMap: on
banner: config.banner
livescript: src: files:
'./tests/helpers.js': './tests/helpers/*'
'./tests/tests.js': './tests/tests/*'
'./tests/library.js': './tests/library/*'
'./tests/es.js': './tests/tests/es*'
'./tests/experimental.js': './tests/experimental/*'
'./build/index.js': './build/build.ls*'
clean: <[./library]>
copy: lib: files:
* expand: on
cwd: './'
src: <[es5/** es6/** es7/** js/** web/** core/** fn/** index.js shim.js]>
dest: './library/'
* expand: on
cwd: './'
src: <[modules/*]>
dest: './library/'
filter: \isFile
* expand: on
cwd: './modules/library/'
src: '*'
dest: './library/modules/'
watch:
core:
files: './modules/*'
tasks: \default
tests:
files: './tests/tests/*'
tasks: \livescript
karma:
'options':
configFile: './tests/karma.conf.js'
browsers: <[PhantomJS]>
singleRun: on
'continuous': {}
'continuous-library':
files: library-tests
grunt.registerTask \build (options)->
done = @async!
err, it <- build {
modules: (options || 'es5,es6,es7,js,web,core')split \,
blacklist: (grunt.option(\blacklist) || '')split \,
library: !!grunt.option \library
}
if err
console.error err
process.exit 1
grunt.option(\path) || grunt.option(\path, './custom')
fs.writeFile grunt.option(\path) + '.js', it, done
grunt.registerTask \client ->
grunt.option \library ''
grunt.option \path './client/core'
grunt.task.run <[build:es5,es6,es7,js,web,core uglify]>
grunt.registerTask \library ->
grunt.option \library 'true'
grunt.option \path './client/library'
grunt.task.run <[build:es5,es6,es7,js,web,core uglify]>
grunt.registerTask \shim ->
grunt.option \library ''
grunt.option \path './client/shim'
grunt.task.run <[build:es5,es6,es7,js,web uglify]>
grunt.registerTask \e ->
grunt.option \library ''>
grunt.option \path './client/core'
grunt.task.run <[build:es5,es6,es7,js,web,core,exp uglify]>
grunt.registerTask \default <[clean copy client library shim]>

View File

@@ -0,0 +1,218 @@
require! {'./config': {banner}, fs: {readFile, writeFile, unlink}, path, webpack}
list = <[
es5
es6.symbol
es6.object.assign
es6.object.is
es6.object.set-prototype-of
es6.object.to-string
es6.object.freeze
es6.object.seal
es6.object.prevent-extensions
es6.object.is-frozen
es6.object.is-sealed
es6.object.is-extensible
es6.object.get-own-property-descriptor
es6.object.get-prototype-of
es6.object.keys
es6.object.get-own-property-names
es6.function.name
es6.function.has-instance
es6.number.constructor
es6.number.epsilon
es6.number.is-finite
es6.number.is-integer
es6.number.is-nan
es6.number.is-safe-integer
es6.number.max-safe-integer
es6.number.min-safe-integer
es6.number.parse-float
es6.number.parse-int
es6.math.acosh
es6.math.asinh
es6.math.atanh
es6.math.cbrt
es6.math.clz32
es6.math.cosh
es6.math.expm1
es6.math.fround
es6.math.hypot
es6.math.imul
es6.math.log10
es6.math.log1p
es6.math.log2
es6.math.sign
es6.math.sinh
es6.math.tanh
es6.math.trunc
es6.string.from-code-point
es6.string.raw
es6.string.trim
es6.string.code-point-at
es6.string.ends-with
es6.string.includes
es6.string.repeat
es6.string.starts-with
es6.string.iterator
es6.array.from
es6.array.of
es6.array.iterator
es6.array.species
es6.array.copy-within
es6.array.fill
es6.array.find
es6.array.find-index
es6.regexp.constructor
es6.regexp.flags
es6.regexp.match
es6.regexp.replace
es6.regexp.search
es6.regexp.split
es6.promise
es6.map
es6.set
es6.weak-map
es6.weak-set
es6.reflect.apply
es6.reflect.construct
es6.reflect.define-property
es6.reflect.delete-property
es6.reflect.enumerate
es6.reflect.get
es6.reflect.get-own-property-descriptor
es6.reflect.get-prototype-of
es6.reflect.has
es6.reflect.is-extensible
es6.reflect.own-keys
es6.reflect.prevent-extensions
es6.reflect.set
es6.reflect.set-prototype-of
es6.date.to-string
es6.typed.array-buffer
es6.typed.data-view
es6.typed.int8-array
es6.typed.uint8-array
es6.typed.uint8-clamped-array
es6.typed.int16-array
es6.typed.uint16-array
es6.typed.int32-array
es6.typed.uint32-array
es6.typed.float32-array
es6.typed.float64-array
es7.array.includes
es7.string.at
es7.string.pad-left
es7.string.pad-right
es7.string.trim-left
es7.string.trim-right
es7.regexp.escape
es7.object.get-own-property-descriptors
es7.object.values
es7.object.entries
es7.map.to-json
es7.set.to-json
web.immediate
web.dom.iterable
web.timers
core.dict
core.get-iterator-method
core.get-iterator
core.is-iterable
core.delay
core.function.part
core.object.is-object
core.object.classof
core.object.define
core.object.make
core.number.iterator
core.string.escape-html
core.string.unescape-html
core.log
js.array.statics
]>
experimental = <[
es6.date.to-string
es6.typed.array-buffer
es6.typed.data-view
es6.typed.int8-array
es6.typed.uint8-array
es6.typed.uint8-clamped-array
es6.typed.int16-array
es6.typed.uint16-array
es6.typed.int32-array
es6.typed.uint32-array
es6.typed.float32-array
es6.typed.float64-array
]>
libraryBlacklist = <[
es6.object.to-string
es6.function.name
es6.regexp.constructor
es6.regexp.flags
es6.regexp.match
es6.regexp.replace
es6.regexp.search
es6.regexp.split
es6.number.constructor
]>
es5SpecialCase = <[
es6.object.freeze
es6.object.seal
es6.object.prevent-extensions
es6.object.is-frozen
es6.object.is-sealed
es6.object.is-extensible
es6.string.trim
]>
module.exports = ({modules = [], blacklist = [], library = no}, next)!->
let @ = modules.reduce ((memo, it)-> memo[it] = on; memo), {}
check = (err)->
if err
next err, ''
on
if @exp => for experimental => @[..] = on
if @es5 => for es5SpecialCase => @[..] = on
for ns of @
if @[ns]
for name in list
if name.indexOf("#ns.") is 0 and name not in experimental
@[name] = on
if library => blacklist ++= libraryBlacklist
for ns in blacklist
for name in list
if name is ns or name.indexOf("#ns.") is 0
@[name] = no
TARGET = "./__tmp#{ Math.random! }__.js"
err, info <~! webpack do
entry: list.filter(~> @[it]).map ~>
path.join(__dirname, '../', "#{ if library => '/library' else '' }/modules/#it")
output:
path: ''
filename: TARGET
if check err => return
err, script <~! readFile TARGET
if check err => return
err <~! unlink TARGET
if check err => return
next null """
#banner
!function(__e, __g, undefined){
'use strict';
#script
// CommonJS export
if(typeof module != 'undefined' && module.exports)module.exports = __e;
// RequireJS export
else if(typeof define == 'function' && define.amd)define(function(){return __e});
// Export to global object
else __g.core = __e;
}(1, 1);
"""

View File

@@ -0,0 +1,8 @@
module.exports = {
banner: '/**\n' +
' * core-js ' + require('../package').version + '\n' +
' * https://github.com/zloirock/core-js\n' +
' * License: http://rock.mit-license.org\n' +
' * © ' + new Date().getFullYear() + ' Denis Pushkarev\n' +
' */'
};

View File

@@ -0,0 +1,98 @@
// Generated by LiveScript 1.3.1
(function(){
var banner, ref$, readFile, writeFile, unlink, path, webpack, list, experimental, libraryBlacklist, es5SpecialCase;
banner = require('./config').banner;
ref$ = require('fs'), readFile = ref$.readFile, writeFile = ref$.writeFile, unlink = ref$.unlink;
path = require('path');
webpack = require('webpack');
list = ['es5', 'es6.symbol', 'es6.object.assign', 'es6.object.is', 'es6.object.set-prototype-of', 'es6.object.to-string', 'es6.object.freeze', 'es6.object.seal', 'es6.object.prevent-extensions', 'es6.object.is-frozen', 'es6.object.is-sealed', 'es6.object.is-extensible', 'es6.object.get-own-property-descriptor', 'es6.object.get-prototype-of', 'es6.object.keys', 'es6.object.get-own-property-names', 'es6.function.name', 'es6.function.has-instance', 'es6.number.constructor', 'es6.number.epsilon', 'es6.number.is-finite', 'es6.number.is-integer', 'es6.number.is-nan', 'es6.number.is-safe-integer', 'es6.number.max-safe-integer', 'es6.number.min-safe-integer', 'es6.number.parse-float', 'es6.number.parse-int', 'es6.math.acosh', 'es6.math.asinh', 'es6.math.atanh', 'es6.math.cbrt', 'es6.math.clz32', 'es6.math.cosh', 'es6.math.expm1', 'es6.math.fround', 'es6.math.hypot', 'es6.math.imul', 'es6.math.log10', 'es6.math.log1p', 'es6.math.log2', 'es6.math.sign', 'es6.math.sinh', 'es6.math.tanh', 'es6.math.trunc', 'es6.string.from-code-point', 'es6.string.raw', 'es6.string.trim', 'es6.string.code-point-at', 'es6.string.ends-with', 'es6.string.includes', 'es6.string.repeat', 'es6.string.starts-with', 'es6.string.iterator', 'es6.array.from', 'es6.array.of', 'es6.array.iterator', 'es6.array.species', 'es6.array.copy-within', 'es6.array.fill', 'es6.array.find', 'es6.array.find-index', 'es6.regexp.constructor', 'es6.regexp.flags', 'es6.regexp.match', 'es6.regexp.replace', 'es6.regexp.search', 'es6.regexp.split', 'es6.promise', 'es6.map', 'es6.set', 'es6.weak-map', 'es6.weak-set', 'es6.reflect.apply', 'es6.reflect.construct', 'es6.reflect.define-property', 'es6.reflect.delete-property', 'es6.reflect.enumerate', 'es6.reflect.get', 'es6.reflect.get-own-property-descriptor', 'es6.reflect.get-prototype-of', 'es6.reflect.has', 'es6.reflect.is-extensible', 'es6.reflect.own-keys', 'es6.reflect.prevent-extensions', 'es6.reflect.set', 'es6.reflect.set-prototype-of', 'es6.date.to-string', 'es6.typed.array-buffer', 'es6.typed.data-view', 'es6.typed.int8-array', 'es6.typed.uint8-array', 'es6.typed.uint8-clamped-array', 'es6.typed.int16-array', 'es6.typed.uint16-array', 'es6.typed.int32-array', 'es6.typed.uint32-array', 'es6.typed.float32-array', 'es6.typed.float64-array', 'es7.array.includes', 'es7.string.at', 'es7.string.pad-left', 'es7.string.pad-right', 'es7.string.trim-left', 'es7.string.trim-right', 'es7.regexp.escape', 'es7.object.get-own-property-descriptors', 'es7.object.values', 'es7.object.entries', 'es7.map.to-json', 'es7.set.to-json', 'web.immediate', 'web.dom.iterable', 'web.timers', 'core.dict', 'core.get-iterator-method', 'core.get-iterator', 'core.is-iterable', 'core.delay', 'core.function.part', 'core.object.is-object', 'core.object.classof', 'core.object.define', 'core.object.make', 'core.number.iterator', 'core.string.escape-html', 'core.string.unescape-html', 'core.log', 'js.array.statics'];
experimental = ['es6.date.to-string', 'es6.typed.array-buffer', 'es6.typed.data-view', 'es6.typed.int8-array', 'es6.typed.uint8-array', 'es6.typed.uint8-clamped-array', 'es6.typed.int16-array', 'es6.typed.uint16-array', 'es6.typed.int32-array', 'es6.typed.uint32-array', 'es6.typed.float32-array', 'es6.typed.float64-array'];
libraryBlacklist = ['es6.object.to-string', 'es6.function.name', 'es6.regexp.constructor', 'es6.regexp.flags', 'es6.regexp.match', 'es6.regexp.replace', 'es6.regexp.search', 'es6.regexp.split', 'es6.number.constructor'];
es5SpecialCase = ['es6.object.freeze', 'es6.object.seal', 'es6.object.prevent-extensions', 'es6.object.is-frozen', 'es6.object.is-sealed', 'es6.object.is-extensible', 'es6.string.trim'];
module.exports = function(arg$, next){
var modules, ref$, blacklist, library;
modules = (ref$ = arg$.modules) != null
? ref$
: [], blacklist = (ref$ = arg$.blacklist) != null
? ref$
: [], library = (ref$ = arg$.library) != null ? ref$ : false;
(function(){
var check, i$, x$, ref$, len$, y$, ns, name, j$, len1$, TARGET, this$ = this;
check = function(err){
if (err) {
next(err, '');
return true;
}
};
if (this.exp) {
for (i$ = 0, len$ = (ref$ = experimental).length; i$ < len$; ++i$) {
x$ = ref$[i$];
this[x$] = true;
}
}
if (this.es5) {
for (i$ = 0, len$ = (ref$ = es5SpecialCase).length; i$ < len$; ++i$) {
y$ = ref$[i$];
this[y$] = true;
}
}
for (ns in this) {
if (this[ns]) {
for (i$ = 0, len$ = (ref$ = list).length; i$ < len$; ++i$) {
name = ref$[i$];
if (name.indexOf(ns + ".") === 0 && !in$(name, experimental)) {
this[name] = true;
}
}
}
}
if (library) {
blacklist = blacklist.concat(libraryBlacklist);
}
for (i$ = 0, len$ = blacklist.length; i$ < len$; ++i$) {
ns = blacklist[i$];
for (j$ = 0, len1$ = (ref$ = list).length; j$ < len1$; ++j$) {
name = ref$[j$];
if (name === ns || name.indexOf(ns + ".") === 0) {
this[name] = false;
}
}
}
TARGET = "./__tmp" + Math.random() + "__.js";
webpack({
entry: list.filter(function(it){
return this$[it];
}).map(function(it){
return path.join(__dirname, '../', (library ? '/library' : '') + "/modules/" + it);
}),
output: {
path: '',
filename: TARGET
}
}, function(err, info){
if (check(err)) {
return;
}
readFile(TARGET, function(err, script){
if (check(err)) {
return;
}
unlink(TARGET, function(err){
if (check(err)) {
return;
}
next(null, "" + banner + "\n!function(__e, __g, undefined){\n'use strict';\n" + script + "\n// CommonJS export\nif(typeof module != 'undefined' && module.exports)module.exports = __e;\n// RequireJS export\nelse if(typeof define == 'function' && define.amd)define(function(){return __e});\n// Export to global object\nelse __g.core = __e;\n}(1, 1);");
});
});
});
}.call(modules.reduce(function(memo, it){
memo[it] = true;
return memo;
}, {})));
};
function in$(x, xs){
var i = -1, l = xs.length >>> 0;
while (++i < l) if (x === xs[i]) return true;
return false;
}
}).call(this);

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
require('../modules/core.function.part');
module.exports = require('../modules/$.core')._;

View File

@@ -0,0 +1,2 @@
require('../modules/core.delay');
module.exports = require('../modules/$.core').delay;

View File

@@ -0,0 +1,2 @@
require('../modules/core.dict');
module.exports = require('../modules/$.core').Dict;

View File

@@ -0,0 +1,2 @@
require('../modules/core.function.part');
module.exports = require('../modules/$.core').Function;

View File

@@ -0,0 +1,15 @@
require('../modules/core.dict');
require('../modules/core.get-iterator-method');
require('../modules/core.get-iterator');
require('../modules/core.is-iterable');
require('../modules/core.delay');
require('../modules/core.function.part');
require('../modules/core.object.is-object');
require('../modules/core.object.classof');
require('../modules/core.object.define');
require('../modules/core.object.make');
require('../modules/core.number.iterator');
require('../modules/core.string.escape-html');
require('../modules/core.string.unescape-html');
require('../modules/core.log');
module.exports = require('../modules/$.core');

View File

@@ -0,0 +1,2 @@
require('../modules/core.log');
module.exports = require('../modules/$.core').log;

View File

@@ -0,0 +1,2 @@
require('../modules/core.number.iterator');
module.exports = require('../modules/$.core').Number;

View File

@@ -0,0 +1,5 @@
require('../modules/core.object.is-object');
require('../modules/core.object.classof');
require('../modules/core.object.define');
require('../modules/core.object.make');
module.exports = require('../modules/$.core').Object;

View File

@@ -0,0 +1,3 @@
require('../modules/core.string.escape-html');
require('../modules/core.string.unescape-html');
module.exports = require('../modules/$.core').String;

View File

@@ -0,0 +1,9 @@
require('../modules/es5');
require('../modules/es6.object.freeze');
require('../modules/es6.object.seal');
require('../modules/es6.object.prevent-extensions');
require('../modules/es6.object.is-frozen');
require('../modules/es6.object.is-sealed');
require('../modules/es6.object.is-extensible');
require('../modules/es6.string.trim');
module.exports = require('../modules/$.core');

View File

@@ -0,0 +1,10 @@
require('../modules/es6.string.iterator');
require('../modules/es6.array.from');
require('../modules/es6.array.of');
require('../modules/es6.array.species');
require('../modules/es6.array.iterator');
require('../modules/es6.array.copy-within');
require('../modules/es6.array.fill');
require('../modules/es6.array.find');
require('../modules/es6.array.find-index');
module.exports = require('../modules/$.core').Array;

View File

@@ -0,0 +1,3 @@
require('../modules/es6.function.name');
require('../modules/es6.function.has-instance');
module.exports = require('../modules/$.core').Function;

View File

@@ -0,0 +1,87 @@
require('../modules/es6.symbol');
require('../modules/es6.object.assign');
require('../modules/es6.object.is');
require('../modules/es6.object.set-prototype-of');
require('../modules/es6.object.to-string');
require('../modules/es6.object.freeze');
require('../modules/es6.object.seal');
require('../modules/es6.object.prevent-extensions');
require('../modules/es6.object.is-frozen');
require('../modules/es6.object.is-sealed');
require('../modules/es6.object.is-extensible');
require('../modules/es6.object.get-own-property-descriptor');
require('../modules/es6.object.get-prototype-of');
require('../modules/es6.object.keys');
require('../modules/es6.object.get-own-property-names');
require('../modules/es6.function.name');
require('../modules/es6.function.has-instance');
require('../modules/es6.number.constructor');
require('../modules/es6.number.epsilon');
require('../modules/es6.number.is-finite');
require('../modules/es6.number.is-integer');
require('../modules/es6.number.is-nan');
require('../modules/es6.number.is-safe-integer');
require('../modules/es6.number.max-safe-integer');
require('../modules/es6.number.min-safe-integer');
require('../modules/es6.number.parse-float');
require('../modules/es6.number.parse-int');
require('../modules/es6.math.acosh');
require('../modules/es6.math.asinh');
require('../modules/es6.math.atanh');
require('../modules/es6.math.cbrt');
require('../modules/es6.math.clz32');
require('../modules/es6.math.cosh');
require('../modules/es6.math.expm1');
require('../modules/es6.math.fround');
require('../modules/es6.math.hypot');
require('../modules/es6.math.imul');
require('../modules/es6.math.log10');
require('../modules/es6.math.log1p');
require('../modules/es6.math.log2');
require('../modules/es6.math.sign');
require('../modules/es6.math.sinh');
require('../modules/es6.math.tanh');
require('../modules/es6.math.trunc');
require('../modules/es6.string.from-code-point');
require('../modules/es6.string.raw');
require('../modules/es6.string.trim');
require('../modules/es6.string.iterator');
require('../modules/es6.string.code-point-at');
require('../modules/es6.string.ends-with');
require('../modules/es6.string.includes');
require('../modules/es6.string.repeat');
require('../modules/es6.string.starts-with');
require('../modules/es6.array.from');
require('../modules/es6.array.of');
require('../modules/es6.array.species');
require('../modules/es6.array.iterator');
require('../modules/es6.array.copy-within');
require('../modules/es6.array.fill');
require('../modules/es6.array.find');
require('../modules/es6.array.find-index');
require('../modules/es6.regexp.constructor');
require('../modules/es6.regexp.flags');
require('../modules/es6.regexp.match');
require('../modules/es6.regexp.replace');
require('../modules/es6.regexp.search');
require('../modules/es6.regexp.split');
require('../modules/es6.promise');
require('../modules/es6.map');
require('../modules/es6.set');
require('../modules/es6.weak-map');
require('../modules/es6.weak-set');
require('../modules/es6.reflect.apply');
require('../modules/es6.reflect.construct');
require('../modules/es6.reflect.define-property');
require('../modules/es6.reflect.delete-property');
require('../modules/es6.reflect.enumerate');
require('../modules/es6.reflect.get');
require('../modules/es6.reflect.get-own-property-descriptor');
require('../modules/es6.reflect.get-prototype-of');
require('../modules/es6.reflect.has');
require('../modules/es6.reflect.is-extensible');
require('../modules/es6.reflect.own-keys');
require('../modules/es6.reflect.prevent-extensions');
require('../modules/es6.reflect.set');
require('../modules/es6.reflect.set-prototype-of');
module.exports = require('../modules/$.core');

View File

@@ -0,0 +1,5 @@
require('../modules/es6.object.to-string');
require('../modules/es6.string.iterator');
require('../modules/web.dom.iterable');
require('../modules/es6.map');
module.exports = require('../modules/$.core').Map;

View File

@@ -0,0 +1,18 @@
require('../modules/es6.math.acosh');
require('../modules/es6.math.asinh');
require('../modules/es6.math.atanh');
require('../modules/es6.math.cbrt');
require('../modules/es6.math.clz32');
require('../modules/es6.math.cosh');
require('../modules/es6.math.expm1');
require('../modules/es6.math.fround');
require('../modules/es6.math.hypot');
require('../modules/es6.math.imul');
require('../modules/es6.math.log10');
require('../modules/es6.math.log1p');
require('../modules/es6.math.log2');
require('../modules/es6.math.sign');
require('../modules/es6.math.sinh');
require('../modules/es6.math.tanh');
require('../modules/es6.math.trunc');
module.exports = require('../modules/$.core').Math;

View File

@@ -0,0 +1,11 @@
require('../modules/es6.number.constructor');
require('../modules/es6.number.epsilon');
require('../modules/es6.number.is-finite');
require('../modules/es6.number.is-integer');
require('../modules/es6.number.is-nan');
require('../modules/es6.number.is-safe-integer');
require('../modules/es6.number.max-safe-integer');
require('../modules/es6.number.min-safe-integer');
require('../modules/es6.number.parse-float');
require('../modules/es6.number.parse-int');
module.exports = require('../modules/$.core').Number;

View File

@@ -0,0 +1,17 @@
require('../modules/es6.symbol');
require('../modules/es6.object.assign');
require('../modules/es6.object.is');
require('../modules/es6.object.set-prototype-of');
require('../modules/es6.object.to-string');
require('../modules/es6.object.freeze');
require('../modules/es6.object.seal');
require('../modules/es6.object.prevent-extensions');
require('../modules/es6.object.is-frozen');
require('../modules/es6.object.is-sealed');
require('../modules/es6.object.is-extensible');
require('../modules/es6.object.get-own-property-descriptor');
require('../modules/es6.object.get-prototype-of');
require('../modules/es6.object.keys');
require('../modules/es6.object.get-own-property-names');
module.exports = require('../modules/$.core').Object;

View File

@@ -0,0 +1,5 @@
require('../modules/es6.object.to-string');
require('../modules/es6.string.iterator');
require('../modules/web.dom.iterable');
require('../modules/es6.promise');
module.exports = require('../modules/$.core').Promise;

View File

@@ -0,0 +1,15 @@
require('../modules/es6.reflect.apply');
require('../modules/es6.reflect.construct');
require('../modules/es6.reflect.define-property');
require('../modules/es6.reflect.delete-property');
require('../modules/es6.reflect.enumerate');
require('../modules/es6.reflect.get');
require('../modules/es6.reflect.get-own-property-descriptor');
require('../modules/es6.reflect.get-prototype-of');
require('../modules/es6.reflect.has');
require('../modules/es6.reflect.is-extensible');
require('../modules/es6.reflect.own-keys');
require('../modules/es6.reflect.prevent-extensions');
require('../modules/es6.reflect.set');
require('../modules/es6.reflect.set-prototype-of');
module.exports = require('../modules/$.core').Reflect;

View File

@@ -0,0 +1,7 @@
require('../modules/es6.regexp.constructor');
require('../modules/es6.regexp.flags');
require('../modules/es6.regexp.match');
require('../modules/es6.regexp.replace');
require('../modules/es6.regexp.search');
require('../modules/es6.regexp.split');
module.exports = require('../modules/$.core').RegExp;

View File

@@ -0,0 +1,5 @@
require('../modules/es6.object.to-string');
require('../modules/es6.string.iterator');
require('../modules/web.dom.iterable');
require('../modules/es6.set');
module.exports = require('../modules/$.core').Set;

View File

@@ -0,0 +1,14 @@
require('../modules/es6.string.from-code-point');
require('../modules/es6.string.raw');
require('../modules/es6.string.trim');
require('../modules/es6.string.iterator');
require('../modules/es6.string.code-point-at');
require('../modules/es6.string.ends-with');
require('../modules/es6.string.includes');
require('../modules/es6.string.repeat');
require('../modules/es6.string.starts-with');
require('../modules/es6.regexp.match');
require('../modules/es6.regexp.replace');
require('../modules/es6.regexp.search');
require('../modules/es6.regexp.split');
module.exports = require('../modules/$.core').String;

View File

@@ -0,0 +1,3 @@
require('../modules/es6.symbol');
require('../modules/es6.object.to-string');
module.exports = require('../modules/$.core').Symbol;

View File

@@ -0,0 +1,4 @@
require('../modules/es6.object.to-string');
require('../modules/es6.array.iterator');
require('../modules/es6.weak-map');
module.exports = require('../modules/$.core').WeakMap;

View File

@@ -0,0 +1,4 @@
require('../modules/es6.object.to-string');
require('../modules/web.dom.iterable');
require('../modules/es6.weak-set');
module.exports = require('../modules/$.core').WeakSet;

View File

@@ -0,0 +1,2 @@
require('../modules/es7.array.includes');
module.exports = require('../modules/$.core').Array;

View File

@@ -0,0 +1,13 @@
require('../modules/es7.array.includes');
require('../modules/es7.string.at');
require('../modules/es7.string.pad-left');
require('../modules/es7.string.pad-right');
require('../modules/es7.string.trim-left');
require('../modules/es7.string.trim-right');
require('../modules/es7.regexp.escape');
require('../modules/es7.object.get-own-property-descriptors');
require('../modules/es7.object.values');
require('../modules/es7.object.entries');
require('../modules/es7.map.to-json');
require('../modules/es7.set.to-json');
module.exports = require('../modules/$.core');

View File

@@ -0,0 +1,2 @@
require('../modules/es7.map.to-json');
module.exports = require('../modules/$.core').Map;

View File

@@ -0,0 +1,4 @@
require('../modules/es7.object.get-own-property-descriptors');
require('../modules/es7.object.values');
require('../modules/es7.object.entries');
module.exports = require('../modules/$.core').Object;

View File

@@ -0,0 +1,2 @@
require('../modules/es7.regexp.escape');
module.exports = require('../modules/$.core').RegExp;

View File

@@ -0,0 +1,2 @@
require('../modules/es7.set.to-json');
module.exports = require('../modules/$.core').Set;

View File

@@ -0,0 +1,6 @@
require('../modules/es7.string.at');
require('../modules/es7.string.pad-left');
require('../modules/es7.string.pad-right');
require('../modules/es7.string.trim-left');
require('../modules/es7.string.trim-right');
module.exports = require('../modules/$.core').String;

View File

@@ -0,0 +1,2 @@
require('../modules/core.function.part');
module.exports = require('../modules/$.core')._;

View File

@@ -0,0 +1,2 @@
require('../../modules/js.array.statics');
module.exports = require('../../modules/$.core').Array.concat;

View File

@@ -0,0 +1,2 @@
require('../../modules/es6.array.copy-within');
module.exports = require('../../modules/$.core').Array.copyWithin;

View File

@@ -0,0 +1,2 @@
require('../../modules/es6.array.iterator');
module.exports = require('../../modules/$.core').Array.entries;

Some files were not shown because too many files have changed in this diff Show More