aboutsummaryrefslogtreecommitdiff
path: root/js/src/util
AgeCommit message (Collapse)AuthorFilesLines
2022-01-29Rename variablesXhmikosR2-15/+15
2022-01-29backdrop.js: cache `_getElement` callsXhmikosR1-4/+6
2022-01-29Remove a few unneeded variablesXhmikosR1-6/+3
2022-01-13Fix: `isVisible` function behavior in case of a `<details>` element, on ↵Ryan Berliner1-1/+20
chrome 97 (#35682)
2021-12-10Extract Component config functionality to a separate class (#33872)GeoSot6-62/+130
Co-authored-by: XhmikosR <[email protected]>
2021-12-10util/index.js: minor refactoring (#35510)XhmikosR1-27/+25
* rename variables * remove an unused variable * be more explicit * reuse variable
2021-12-09Scrollbar - remove margin/padding properties properly (#35388)GeoSot1-7/+8
Co-authored-by: XhmikosR <[email protected]>
2021-12-09ScrollBar.js. Minor refactoring and add test (#35492)GeoSot1-13/+17
2021-11-25Add a template factory helper to handle all template cases (#34519)GeoSot1-0/+161
Co-authored-by: XhmikosR <[email protected]>
2021-10-13JS: minor refactoring (#35183)XhmikosR5-56/+98
* add missing comments * shorten block comments * reorder constants * reorder public/private methods * sort exports alphabetically in util/index.js * fix a couple of typos
2021-10-12Swipe: add test to ensure that it ignores `pinch` events (#35161)GeoSot1-1/+1
2021-10-11Extract Carousel's swipe functionality to a separate Class (#32999)GeoSot1-0/+122
2021-10-09Merge remote-tracking branch 'remotes/origin/v513'XhmikosR6-6/+6
2021-10-09Bump version to 5.1.3.XhmikosR6-6/+6
2021-10-07Sanitizer: fix logic and add a test. (#35133)XhmikosR1-1/+1
This was broken in 2596c97 inadvertently. Added a test so that we don't hit this in the future.
2021-10-06util/sanitizer.js: use `Array.every()` (#35120)XhmikosR1-9/+2
2021-10-05Enable `unicorn/numeric-separators-style` rule.XhmikosR1-1/+1
This is taken care of by babel via @babel/plugin-proposal-numeric-separator
2021-10-05Enable `unicorn/no-array-for-each` ruleXhmikosR3-6/+10
2021-10-05Enable `unicorn/no-for-loop` ruleXhmikosR1-4/+3
2021-10-05Enable `unicorn/prefer-prototype-methods` ruleXhmikosR1-1/+1
2021-10-05Release v5.1.2 (#35114)XhmikosR6-6/+6
2021-09-29sanitizer: add `sms` in the `SAFE_URL_PATTERN` (#35074)XhmikosR1-3/+3
2021-09-15Minor refactoring (#34980)XhmikosR2-23/+18
Rename variables and remove a temporary one
2021-09-08Remove remaining "master" branch references (#34932)Julien Déramond2-2/+2
2021-09-07Release v5.1.1 (#34869)v5.1.1XhmikosR6-6/+6
* Prepare v5.1.1. * Dist
2021-08-04Prepare v5.1.0. (#34674)v5.1.0XhmikosR6-6/+6
2021-07-30Enable a few eslint-config-xo rules (#34620)XhmikosR1-1/+1
* unicorn/prefer-dom-node-append * unicorn/prefer-dom-node-remove
2021-07-28Use a streamlined way to trigger component dismiss (#34170)GeoSot1-0/+34
* use a streamlined way to trigger component dismiss * add documentation Co-authored-by: XhmikosR <[email protected]>
2021-07-27Add shift-tab keyboard support for dialogs (modal & Offcanvas components) ↵Ryan Berliner1-0/+109
(#33865) * consolidate dialog focus trap logic * add shift-tab support to focustrap * remove redundant null check of trap element Co-authored-by: GeoSot <[email protected]> * remove area support forom focusableChildren * fix no expectations warning in focustrap tests Co-authored-by: GeoSot <[email protected]> Co-authored-by: XhmikosR <[email protected]>
2021-07-21Remove whitespace at beginning of util/index.js (#34545)Ryan Berliner1-1/+0
2021-07-20Fix `Util.reflow` function and add documentation (#34543)GeoSot1-1/+12
* add documentation to reflow function * refactor to void as it should be Co-authored-by: XhmikosR <[email protected]>
2021-07-14util.js: remove `Selector.findOne()` dependency (#34441)GeoSot1-2/+1
Co-authored-by: XhmikosR <[email protected]>
2021-06-25Variablize backdrop for modal and offcanvasMark Otto1-2/+3
2021-06-22Release v5.0.2 (#34276)v5.0.2XhmikosR4-4/+4
* Bump version to v5.0.2. * Dist
2021-06-22Register only one `DOMContentLoaded` event listener in `onDOMContentLoaded` ↵alpadev1-1/+10
(#34158) * refactor: reuse one DOMContentLoaded event listener in onDOMContentLoaded function Instead of adding an event listener everytime the utility function is called, cache the callbacks and execute them all at once. * refactor: drop iife for onDOMContentLoaded Co-authored-by: XhmikosR <[email protected]>
2021-06-06Refactor scrollbar.js to be used as a Class (#33947)GeoSot1-54/+67
2021-06-03Fix handling of transitionend events dispatched by nested elements(#33845)alpadev2-29/+33
Fix handling of transitionend events dispatched by nested elements Properly handle events from nested elements Change `emulateTransitionEnd` to `executeAfterTransition` &&
2021-05-31Changing Backdrop rootElement to default to a string (#34092)Ryan Weaver1-4/+5
The current config can cause the "body" to become stale. Specifically, if the entire body element is swapped out for a new body element, then the backdrop will continue to append itself to the original body element, since it's stored in memory as a reference on this object. This also no longer allows an explicit null to be passed to Backdrop's rootElement This still accomplishes the laziness of "not finding the rootElement until the Backdrop is created" to avoid problems of the JavaScript being included inside <head> (so, before body is available).
2021-05-25Change `element.parentNode.removeChild(element)` to `element.remove()` (#34071)GeoSot2-6/+2
2021-05-22Automatically select an item in the dropdown when using arrow keys (#34052)alpadev1-2/+2
2021-05-22Fix bug where backdrop calls method on null if it is already removed from ↵Ryan Weaver1-1/+5
the body (#34014) Co-authored-by: Rohit Sharma <[email protected]>
2021-05-20Refactor `isVisible` helper, fixing false positives from deep nesting or ↵Ryan Berliner1-11/+2
alternate means (#33960)
2021-05-20Add Tests on scrollbar.js & better handling if a style property doesn't ↵GeoSot1-1/+4
exists (#33948) * scrollbar.js: add some tests transfer test from modal.spec. to scrollbar.spec proper handling if style property doesn't exist
2021-05-19Add `getNextActiveElement` helper function to utils, replacing custom ↵GeoSot1-0/+29
implementation through components (#33608)
2021-05-13Release v5.0.1 (#33972)v5.0.1XhmikosR4-4/+4
* Bump version to 5.0.1. * Dist
2021-05-13Move get element functionality to a helper (#33327)GeoSot1-1/+26
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)GeoSot1-1/+2
* 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 Bodduna1-0/+2
* Initialize default value of rootElement before using * Remove redundant test | put rootElement tests together Co-authored-by: GeoSot <[email protected]>
2021-05-05Release v5.0.0 (#33647)v5.0.0XhmikosR4-4/+4
* Bump version to 5.0.0 * Fix npm tag * Dist
2021-04-25Scrollbar: respect the initial body overflow value (#33706)GeoSot1-4/+14
* add method to handle overflow on body element & tests * replace duplicated code on modal/offcanvas tests