Commit f999ed8
authored
Remove modules deprecated in 4.0.0 (select2#5815)
* Remove legacy support for `<input />` tags
This never actually really worked, and since we thought this commit
was coming sooner, we never actually fixed it. Now we can just
remove it and accept the fact that Select2 currently only works
for `<select>` boxes, the things it advertises itself as being a
replacement for.
Closes select2#3294.
* Removed tests for legacy features
These features will be removed in upcoming commits.
* Remove legacy support for `initSelection`
* Remove legacy support for `query`
* Remove old `select2/compat/matcher` module
* Promote containerCss and dropdownCss to core plugins
These were originally slate to be deprecated and removed during the
4.1.0 release, but it has been determined that they should still
remain in the core. These will be stripped down to only the essentials
before the 4.1.0 release, sincce we don't want to have to continue
supporting another 6 options on top of the ones we already have.
* Remove dropdownCss and adaptDropdownCssClass
This removes the two options that were specific to the CSS for a
dropdown. These two options were not well documented and as a result
are not widely used.
* dropdownCss - Allowed for custom CSS styles to be injected on the
dropdown container. Had an undocumented feature where the CSS
could be customized per element by passing in a function as the
option.
There is no immediate replacement for this option since Select2
will only allow custom CSS classes going forward. The best option
is to create a new CSS class which covers the properties that
were previously being injected.
* adaptDropdownCssClass - Allowed for the CSS classes which were
present on the original element to be cloned into the set of
CSS classes which were on the dropdown container. This was only
documented as a possible option but the rest of the documentation
was left blank, probably because nobody knew what this did.
Internally this was used to make the `:all:` helper function within
the `dropdownCssClass` option.
The suggested replacement for this is to change the CSS classes
on the original element prior to initializing Select2, and to use
the `:all:` helper to copy those classes over. The `:all:` helper
will remain as a supported option going forward.
* Remove containerCss and adaptContainerCssClass
This removes the two options that were specific to the CSS for a
selection container. These two options were not well documented and
as a result are not widely used.
* containerCss - Allowed for custom CSS styles to be injected on the
selection container. Had an undocumented feature where the CSS
could be customized per element by passing in a function as the
option.
There is no immediate replacement for this option since Select2
will only allow custom CSS classes going forward. The best option
is to create a new CSS class which covers the properties that
were previously being injected.
* adaptContainerCssClass - Allowed for the CSS classes which were
present on the original element to be cloned into the set of
CSS classes which were on the selection container. This was only
documented as a possible option but the rest of the documentation
was left blank, probably because nobody knew what this did.
Internally this was used to make the `:all:` helper function within
the `containerCssClass` option.
The suggested replacement for this is to change the CSS classes
on the original element prior to initializing Select2, and to use
the `:all:` helper to copy those classes over. The `:all:` helper
will remain as a supported option going forward.
* Updated list of options in docs
Removed `adaptContainerCssClass`, `adaptDropdownCssClass`,
`containerCss`, and `dropdownCss` which are now no longer supported
with the promotion of `dropdownCssClass` and `selectionCssClass` to
the core builds.
Renamed `containerCssClass` to `selectionCssClass` to reflect the
new name.
Documented the `dir` option and pointed to the MDN documentation on
the `dir` attribute.
Removed `initSelection` and `query` which were used with the
now-removed support of `<input />` tags.
* Removed `amdBase` option
Now that we are not dynamically loading in any modules for the full
builds, we do not need the ability to override the AMD base path to
search for these additional modules at. The `amdLanguageBase` option
is still needed to handle dynamically loading in the additional
lanugage files, though we acknowledge that nobody appears to be
using this option.
* Remove support for *CssClass being a function
This was an undocumented feature that we are dropping to ease the
the maintenance burden now that the `dropdownCssClass` and
`selectionCssClass` options are being included in all builds.
* Rename containerCssClass to selectionCssClass
This should help alleviate much of the confusion that comes from
people who used Select2 3.x and were used to these classes being
injected at the container which wrapped the selection container
instead of on the selection container itself. Now this makes it more
clear what container these classes are being applied to.
* Internally rename ContainerCSS to SelectionCSS
* Clean up unused adapter logic for *CssClass
* Simplify internal logic for copying CSS classes
* Fixed issue copying classes with *CssClass
We were lacking a test that verified that original classes were not
copied unless `:all:` was actually specified.1 parent 284f6bb commit f999ed8
22 files changed
Lines changed: 152 additions & 1039 deletions
File tree
- docs/pages/03.configuration/01.options-api
- src/js/select2
- compat
- dropdown
- selection
- tests
- data
- dropdown
- options
- selection
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 15 | | |
24 | 16 | | |
25 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | 11 | | |
14 | 12 | | |
15 | | - | |
16 | 13 | | |
17 | 14 | | |
18 | | - | |
19 | | - | |
20 | 15 | | |
21 | 16 | | |
22 | 17 | | |
23 | | - | |
| 18 | + | |
24 | 19 | | |
25 | 20 | | |
26 | 21 | | |
27 | | - | |
28 | | - | |
| 22 | + | |
29 | 23 | | |
30 | 24 | | |
31 | | - | |
32 | 25 | | |
33 | 26 | | |
34 | 27 | | |
| |||
37 | 30 | | |
38 | 31 | | |
39 | 32 | | |
40 | | - | |
41 | 33 | | |
42 | 34 | | |
| 35 | + | |
43 | 36 | | |
44 | 37 | | |
45 | 38 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments