Repository navigation
v5.3.0: BSDateRangePicker without JQuery - #17
Merged
Merged
Conversation
- Bundled date range picker: vanilla-datetimerange-picker (commit 32608b3), Dan Grossman's daterangepicker 3.1 without JQuery, with the 2 previous local patches plus: apply/cancel events on the picker element and remove() removing the container and the resize listener (as in the original). - BSDateRangePicker: doesn't load JQuery; new DateRangePicker(...); new jsPicker; a new render removes the previous JS picker. - README: bundled libraries, new See also section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- daterangepicker.js outsideClick: inside the picker by element identity, as in the original (the port matched any element with the same tag and classes, e.g. another picker field, keeping two pickers open). - remove(): also sets isShowing = false. - The JS picker is removed on render, clear and dispose, deferred (a render from the picker callback no longer breaks it while applying). - render: only the date text if DateRangePicker isn't loaded. - Tests: two pickers in the page, clear, render from onChange while applying. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BSDateRangePickerno longer needs JQuery, so this package no longer loads it (only an explicitJQuery.load()does).lib/components/daterangepicker): now vanilla-datetimerange-picker at commit32608b3(MIT): Dan Grossman'sdaterangepicker3.1 (the version bundled until now) with JQuery replaced by DOM calls. Same options (startDate,endDate,timePicker,timePicker24Hour,timePickerIncrement,ranges,locale), callback and CSS selectors. It still uses Moment.timePickerIncrement; callback with a single array.clickApply/clickCanceldispatch theapply/cancelevents on the picker element, as the original did (the port usede.target, failing when called without an event, e.g.picker.clickApply()).remove()removes the container from the document and the windowresizelistener, as the original did (the port only dropped its reference, and added the listener again).BSDateRangePicker:loaddoesn't load JQuery; createsnew DateRangePicker(element, config, callback); newjsPicker(the JS instance); a new render removes the previous JS picker (its container used to be left indocument.body).pubspec.yaml: 5.3.0.Review fixes (9ccbfdf)
daterangepicker.jsoutsideClick: "inside the picker" by element identity (contains), as in the original; the port built a CSS selector from the element tag and classes (div.form-control), so a click on another picker field kept the open one open (two pickers shown).remove(): also setsisShowing = false.BSDateRangePicker: the JS picker is also removed onclearanddispose(not only on a new render), deferred to a microtask so a render triggered by the picker callback (onChange→refresh) doesn't remove it while it's still insidehide().render: ifdaterangepicker.jsfailed to load, only the date text (noTypeError).datasetoptions parsing and the[data-toggle=dropdown]hook of the port (not used byBSDateRangePicker).Tests
bones_ui_bootstrap_daterangepicker_test.dart(JQuery never loaded, two pickers in the page): loads without JQuery, JS selection calls back into Dart, opens on click, a click on the other picker field closes the open one, a click inside keeps it open, a new render orclearremoves the JS picker, a render fromonChangewhile applying completes the apply.BSDateRangePicker.jsPickerinstead of JQuerydata(selection, cancel, ranges, minute rounding all still pass).daterangepicker.js.dart test -p vm: 32 passed.dart test -p chrome: 73 passed.dart analyze,dependency_validator: clean.🤖 Generated with Claude Code