aboutsummaryrefslogtreecommitdiff
path: root/js/src/util
AgeCommit message (Collapse)AuthorFilesLines
2021-03-02Offcanvas as component (#29017)GeoSot1-0/+70
* Add a new offcanvas component * offcanvas.js: switch to string constants and `event.key` * Remove unneeded code * Sass optimizations * Fixes Make sure the element is hidden and not offscreen when inactive fix close icon negative margins Add content in right & bottom examples Re-fix bottom offcanvas height not to cover all viewport * Wording tweaks * update tests and offcanvas class * separate scrollbar functionality and use it in offcanvas * Update .bundlewatch.config.json * fix focus * update btn-close / fix focus on close * add aria-modal and role return focus on trigger when offcanvas is closed change body scrolling timings * move common code to reusable functions * add aria-labelledby * Replace lorem ipsum text * fix focus when offcanvas is closed * updates * revert modal, add tests for scrollbar * show backdrop by default * Update offcanvas.md * Update offcanvas CSS to better match modals - Add background-clip for borders - Move from outline to border (less clever, more consistent) - Add scss-docs in vars * Revamp offcanvas docs - Add static example to show and explain the components - Split live examples and rename them - Simplify example content - Expand docs notes elsewhere - Add sass docs * Add .offcanvas-title instead of .modal-title * Rename offcanvas example to offcanvas-navbar to reflect it's purpose * labelledby references title and not header * Add default shadow to offcanvas * enable offcanvas-body to fill all the remaining wrapper area * Be more descriptive, on Accessibility area * remove redundant classes * ensure in case of an already open offcanvas, not to open another one * bring back backdrop|scroll combinations * bring back toggling class * refactor scrollbar method, plus tests * add check if element is not full-width, according to #30621 * revert all in modal * use documentElement innerWidth * Rename classes to -start and -end Also copyedit some docs wording * omit some things on scrollbar * PASS BrowserStack tests -- IOS devices, Android devices and Browsers on Mac, hide scrollbar by default and appear it, only while scrolling. * Rename '_handleClosing' to '_addEventListeners' * change pipe usage to comma * change Data.getData to Data.get Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Martijn Cuppens <[email protected]> Co-authored-by: Mark Otto <[email protected]>
2021-02-19Adjust regex `SAFE_URL_PATTERN` for use with test method of regexes. (#33136)Nikon the Third1-1/+1
The test method on regexes behaves different than the match method on strings in the presence of the global modifier. Add a unit test for sanitizing the same template twice. Co-authored-by: XhmikosR <[email protected]>
2021-02-16util: change `isRTL` to a function (#32446)XhmikosR1-1/+1
This allows the bundler to tree-shake the function.
2021-02-10Release v5.0.0-beta2 (#32467)v5.0.0-beta2XhmikosR2-2/+2
* Bump version to 5.0.0-beta2 * Dist
2021-02-03Prevent `getSelector` from returning URLs as selector (#32586)Florian Vick1-1/+14
* added checks to getSelector in util to prevent returning hrefs that are invalid selectors * restored compatibility for the class selector and added test cases for keeping urls from being returned as a selector Co-authored-by: XhmikosR <[email protected]>
2021-01-14Bump eslint-plugin-unicorn from 25.0.1 to 26.0.1 (#32784)dependabot[bot]1-2/+2
* Bump eslint-plugin-unicorn from 25.0.1 to 26.0.1 Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 25.0.1 to 26.0.1. - [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases) - [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v25.0.1...v26.0.1) Signed-off-by: dependabot[bot] <[email protected]> * Updates for `[email protected]` Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: XhmikosR <[email protected]>
2021-01-13Throw a `TypeError` instead of the generic `Error` (#32585)Rohit Sharma1-5/+4
* Change from Error to TypeError * Convert the `NAME` to upper case to make the consistency in the error message * Update the remaining tests to be stricter Co-authored-by: XhmikosR <[email protected]>
2020-12-10Remove `TRANSITION_END` from utils (#32394)XhmikosR1-1/+0
2020-12-08Refactor components to use a utility function to define jQuery plugins (#32285)alpadev1-1/+18
* refactor: use an utility function to define jQuery plugins * test: add spec for defineJQueryPlugin utility function * Update .bundlewatch.config.json Co-authored-by: XhmikosR <[email protected]>
2020-12-07Prepare v5.0.0-beta1.XhmikosR2-2/+2
2020-12-04feat(RTL): implement RTLGaël Poupard1-1/+4
Using RTLCSS directives, renaming things to use logical names and following best practices.
2020-12-02Unbreak lines. (#32304)XhmikosR1-4/+2
2020-11-14Switch to `Set#has()`XhmikosR1-3/+3
2020-11-14Switch to Number propertiesXhmikosR1-3/+3
2020-11-14Switch to `String.includes()`XhmikosR1-3/+3
2020-11-14Add `bs` in data attributesRohit Sharma1-2/+2
- Add `bs` in data APIs everywhere - Update unit tests
2020-11-11Prepare v5.0.0-alpha3 (#32122)v5.0.0-alpha3XhmikosR2-2/+2
2020-11-01Fix TypeError when Bootstrap is included in `head` (#32024)Sascha1-2/+11
* extend jquery after domContentLoaded event is fired * add unittest for util onDOMContentLoaded * wait for trigger jquery event after domContentLoaded * remove domcontentready from eventHandler * move istanbul ignore statements to correct line Co-authored-by: XhmikosR <[email protected]>
2020-09-29Prepare v5.0.0-alpha2. (#31748)v5.0.0-alpha2XhmikosR2-2/+2
2020-06-19Change whitelist to allowlist (#31066)Patrick H. Lauke1-6/+6
Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Mark Otto <[email protected]>
2020-06-17Unbreak short linesXhmikosR1-15/+14
2020-06-16Rename "master" to "main". (#31050)XhmikosR2-2/+2
2020-05-14Replace double tilde with `Math.floor` (#30691)XhmikosR1-1/+1
Nowadays, browser engines have improved a lot and `Math.floor` is the same, if not faster. Also, clarity is better than micro-optimizations in this case.
2020-05-13Partially Revert "Use regex.test() when we want to check for a Boolean. ↵XhmikosR1-2/+2
(#29969)" (#30770) This partially reverts commit 9c2b9ac74d4abb5ec8b7864054315de3409d5f3a.
2020-05-13Bump version to 5.0.0-alpha1 (#29925)XhmikosR2-2/+2
Also add v4.5.0 in versions and keep README.md pointing to v4.5.0 so that there are no broken stuff.
2020-03-25fix: remove make array util function (#30430)Johann-S2-13/+2
2020-03-18Remove IE compatibility JS codeJohann-S1-4/+1
2020-03-18fix: ensure `totype` always returns stringified null/undefined when ↵Johann-S1-1/+7
null/undefined is passed (#30383)
2020-01-07sanitizer.js: Add srcset in the allowed attributes (#29968)XhmikosR1-1/+1
2020-01-07Fix the new lint errors.XhmikosR1-2/+2
2020-01-07Use regex.test() when we want to check for a Boolean. (#29969)XhmikosR1-3/+3
2019-10-17Skip hidden dropdowns while focusing (#29523)Jeremy Jackson1-3/+6
2019-10-03return to the original file structure to avoid breaking modularityJohann-S2-452/+0
2019-09-02ESLint: specify `--report-unused-disable-directives` (#29350)XhmikosR1-2/+0
2019-08-02add a way to disable jQuery detectionJohann-S2-2/+44
2019-07-24use get selector from element only when neededJohann-S2-5/+66
2019-07-23use qunit css for our fixtureJohann-S1-2/+6
2019-07-23Switch from QUnit to Jasmine.Johann-S2-0/+367
2019-03-18Add back support for IE 11Johann-S1-1/+4
2019-03-13Use one-line imports when possible. (#28467)XhmikosR1-3/+1
2019-03-11Comply to the new rules.XhmikosR2-18/+20
2019-02-26move util in a util folder with the sanitizerJohann-S2-0/+308