Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/src/util
AgeCommit message (Collapse)Author
2021-05-13Move get element functionality to a helper (#33327)GeoSot
Looking around on js components I found out many checks, different expressed but with same purpose. Some of them are trying to parse string to element, others, jQuery element to js simple nodeElement etc With this Pr, I am trying to give a standard way to parse an element So this pr: * Creates `getElement` helper that tries to parse an argument to element or null * Changes `isElement` to make explicit checks and return Boolean * fixes tests deficiencies
2021-05-11Extract static `DATA_KEY` & `EVENT_KEY` to base-component (#33635)GeoSot
* Force each plugin that extends base-components to implement a static method `NAME()` * Remove redundant `NAME` argument from 'Utils.defineJQueryPlugin' & fix test
2021-05-10Fix backdrop `rootElement` not initialized in Modal (#33853)Nagarjun Bodduna
* Initialize default value of rootElement before using * Remove redundant test | put rootElement tests together Co-authored-by: GeoSot <geo.sotis@gmail.com>
2021-05-05Release v5.0.0 (#33647)v5.0.0XhmikosR
* Bump version to 5.0.0 * Fix npm tag * Dist
2021-04-25Scrollbar: respect the initial body overflow value (#33706)GeoSot
* add method to handle overflow on body element & tests * replace duplicated code on modal/offcanvas tests
2021-04-19Use the backdrop util in offcanvas, enforcing consistency (#33545)GeoSot
* respect /share modal's backdrop functionality, keeping consistency * listen click events over backdrop (only) and trigger `hide()` without add/remove event tricks * achieve to hide foreign open offcanvas instances without glitches `if (allReadyOpen && allReadyOpen !== target)`, in case another is going to be open, when user clicks on trigger button
2021-04-14Decouple BackDrop from modal (#32439)GeoSot
* Create backdrop.js util * revert breaking changes remove PromiseTimout usage revert class name * one more test | change bundlewatch.config * add config obj to backdrop helper | tests for rootElement | use transitionend helper * Minor tweaks — Renaming Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
2021-04-11Use cached `noop` function everywhereRohit Sharma
2021-04-11Decouple Modal's scrollbar functionality (#33245)GeoSot
2021-03-30Use template literals instead of concatenation (#33497)Rohit Sharma
2021-03-23Release v5.0.0-beta3 (#33439)v5.0.0-beta3XhmikosR
2021-03-17Use more safe check for 'isDisabled' helper (#33385)GeoSot
2021-03-16Accept data-bs-body option in the configuration object as well (#33248)GeoSot
* Accept data-bs-body option in the configuration object as well Tweak jqueryInterface, add some more tests * Fix Markdown table formatting and tweak the wording on backdrop Co-authored-by: Mark Otto <markdotto@gmail.com> Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-03-02Offcanvas as component (#29017)GeoSot
* 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 <xhmikosr@gmail.com> Co-authored-by: Martijn Cuppens <martijn.cuppens@gmail.com> Co-authored-by: Mark Otto <markdotto@gmail.com>
2021-02-19Adjust regex `SAFE_URL_PATTERN` for use with test method of regexes. (#33136)Nikon the Third
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 <xhmikosr@gmail.com>
2021-02-16util: change `isRTL` to a function (#32446)XhmikosR
This allows the bundler to tree-shake the function.
2021-02-10Release v5.0.0-beta2 (#32467)v5.0.0-beta2XhmikosR
* Bump version to 5.0.0-beta2 * Dist
2021-02-03Prevent `getSelector` from returning URLs as selector (#32586)Florian Vick
* 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 <xhmikosr@gmail.com>
2021-01-14Bump eslint-plugin-unicorn from 25.0.1 to 26.0.1 (#32784)dependabot[bot]
* 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] <support@github.com> * Updates for `eslint-plugin-unicorn@26.0.1` Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-01-13Throw a `TypeError` instead of the generic `Error` (#32585)Rohit Sharma
* 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 <xhmikosr@gmail.com>
2020-12-10Remove `TRANSITION_END` from utils (#32394)XhmikosR
2020-12-08Refactor components to use a utility function to define jQuery plugins (#32285)alpadev
* refactor: use an utility function to define jQuery plugins * test: add spec for defineJQueryPlugin utility function * Update .bundlewatch.config.json Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-12-07Prepare v5.0.0-beta1.XhmikosR
2020-12-04feat(RTL): implement RTLGaël Poupard
Using RTLCSS directives, renaming things to use logical names and following best practices.
2020-12-02Unbreak lines. (#32304)XhmikosR
2020-11-14Switch to `Set#has()`XhmikosR
2020-11-14Switch to Number propertiesXhmikosR
2020-11-14Switch to `String.includes()`XhmikosR
2020-11-14Add `bs` in data attributesRohit Sharma
- Add `bs` in data APIs everywhere - Update unit tests
2020-11-11Prepare v5.0.0-alpha3 (#32122)v5.0.0-alpha3XhmikosR
2020-11-01Fix TypeError when Bootstrap is included in `head` (#32024)Sascha
* 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 <xhmikosr@gmail.com>
2020-09-29Prepare v5.0.0-alpha2. (#31748)v5.0.0-alpha2XhmikosR
2020-06-19Change whitelist to allowlist (#31066)Patrick H. Lauke
Co-authored-by: XhmikosR <xhmikosr@gmail.com> Co-authored-by: Mark Otto <markd.otto@gmail.com>
2020-06-17Unbreak short linesXhmikosR
2020-06-16Rename "master" to "main". (#31050)XhmikosR
2020-05-14Replace double tilde with `Math.floor` (#30691)XhmikosR
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. ↵XhmikosR
(#29969)" (#30770) This partially reverts commit 9c2b9ac74d4abb5ec8b7864054315de3409d5f3a.
2020-05-13Bump version to 5.0.0-alpha1 (#29925)XhmikosR
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-S
2020-03-18Remove IE compatibility JS codeJohann-S
2020-03-18fix: ensure `totype` always returns stringified null/undefined when ↵Johann-S
null/undefined is passed (#30383)
2020-01-07sanitizer.js: Add srcset in the allowed attributes (#29968)XhmikosR
2020-01-07Fix the new lint errors.XhmikosR
2020-01-07Use regex.test() when we want to check for a Boolean. (#29969)XhmikosR
2019-10-17Skip hidden dropdowns while focusing (#29523)Jeremy Jackson
2019-10-03return to the original file structure to avoid breaking modularityJohann-S
2019-09-02ESLint: specify `--report-unused-disable-directives` (#29350)XhmikosR
2019-08-02add a way to disable jQuery detectionJohann-S
2019-07-24use get selector from element only when neededJohann-S
2019-07-23use qunit css for our fixtureJohann-S