Skip to content

Commit

Permalink
b7122a1fac87973003bb55ea31bf60fb110d596a New: Automatically detect `d…
Browse files Browse the repository at this point in the history
…` as a string on a JSON response and parse it as JSON for use (if it is valid JSON). This is for improved compatibility with .NET so `-init ajax.dataSrc` doesn't need to be specified for this wrapper.

df5e548be32eec8f95f76c1ddc0698e83aa6b143 Merge branch 'master' into 2.1

d802465853307ad3dd4ccda577fb1f83a5a775a6 Fix: Reordering initial data load to allow `data-*` attributes to be used to define column data points

https://datatables.net/forums/discussion/78851/datatables-2-data-attributes-processing-change

2d4d358d1caf2f99c317c8779a37682b19aff0ad New: Support for Bulma 1 and Bulma's new dark mode

0cde9b3d3e87d8bdadfe9c27127d24f2d6e7dde6 New: If no `width` style or `width` attribute is found on the `-tag table`, we now automatically assign the table 100%. If either is found, they are retained. This is done to simplify the HTML needed, and the `width` attribute is long since obsolate in HTML (although still works). Disabling `-init autoWidth` will stop 100% width being assigned automatically.

c39530fd05d9354c559399fa10e22f75db5b773f New: `-api DataTable.use()` method which can inform DataTables libraries such as Moment and Luxon in a module loader environment.

It did exist before, but wasn't documented and didn't support Moment or Luxon.

4c90fb210f33b06e60eff88d69c835d1e3f7f443 Dev: Examples look better with 100% width applied, due to FOUC

f586b3f12500322938962db8e01f2bef4c3e9b32 New: Ability to control what buttons appear in the paging control through three new options for the feature:
* `-feature paging.numbers`
* `-feature paging.previousNext`
* `-feature paging.firstLast`

This provides similar functionality to `-feature paging.type` but is more intuitive. It also allows the paging feature code to be more compartmentalised, and will allow a reduction in code size when the deprecated properties are removed.

Deprecated: `-init pagingType` and `-feature paging.type` are now redundant and will be removed in DataTables 3. If you are using these properties it is recommended that you update them when possible.

bce90b21a91aaeeef1e52bf2e640f788fd68647e Dev: Missed type def for `use()` method

cb3493124a3cbd47f97ebd6aaed75a615828ca88 Example: JS data example was out of sync

c3e3c0de6547dc7d8ca78e88bfc75210728306b8 New: `-feature search.processing` option which can be used to show the processing indicator (`-init processing`) when the end user types into the search box.

DD-2951

fa0bfd01f0c01bc29dd70fc418f616160701e78e Dev: Working on upgrading the data type detection in DataTables. WIP

1e6727dade78e56c913afd630542baf9d3d2a32c New: Type detection is now far more functional in that it it is possible to specify that at least one data point in a column match a specific test. Previously all data points had to pass a given test (`allOf`), but now in addition to that an extra function can be given to help limit data selection (`oneOf`).
Fix: The new type detection is used to prevent HTML columns without numbers being detected as numeric columns (e.g. this happened with FontAwesome icons in a column).

DD-2976

8d00e1f6b9babdf20f0e851f488a535a7d11865d Fix: Type detection was not running if both ordering and searching were disabled.

DD-2968

2d0dd6728709dfa490aa40336d0e3e421a6728b8 Dev: `init` type detection wasn't working due to the `if` condition when `oneOf` was defined

0193d6af5a13beaeae261e0a87c7dfab392f7c66 Updated: Disable auto type detection when server-side processing is enabled. Without the full data set available it is unreliable and error prone. If you need specific type actions (e.g. a class name) you can assign a type to a column using `-init columns.type`.

DD-2966

695631d2d2d88a69cc43cd02dfc69222225c8458 Dev: Remove type detection in filtering - it is performed a level up now. Missed this file!

680a5686c96444a13ef11d92ed19c45d2d6066fa Fix: It was possible for date time types to overlap due to the replacement of characters in the name. That is not required as the data type names are just a plain string.

DD-2973

44ce47232278f56d61d113ad5e7ea266b7669707 Dev: Extending the new `use()` method to be able to act as a getter

This is needed for SearchBuilder to get the moment / luxon object

DD-2973

cf409997aa8dd856d6c85e93a376a3039dd2af3a New: `-init language.aria.paginate.number` option which can be used to set an ARIA label for the number buttons in the pagination control.
Docs: Reflect that the aria values for pagination are now set in 2.0+

DD-2903

239693bcf3dd9a350ee202b8b13498c3fb118544 New: `-init orderDescReverse` option which can be used to disable the revesal of data when doing a descending order. This can make the ordering of data more like how Excel operates when data matches in the column being ordered on.

DD-2972
DataTables/DataTablesSrc#272 (comment)

4068663780e5efad5be7b0257d4f659a687c4418 Merge branch 'master' into 2.1

c8dc52e52016b78ddddee459dd6b76a27612863f Dev: Fix responsive paging which the recent buttons/numbers change broke

9199d502b2f94ee5563090e0e3c01e16103274bd Dev: Remove debug

739308b6c28dc2bc98caacdd3ec593f61a8ed8ba Dev: Remove debug!

a3ef9acd102f455672ed80ce3b246eec0a725d95 New: Automatic detection and ordering for accented characters in the data set. This is done by making use of the improved data type detection to allow non-UTF8 columns to continue to use simple ASCII string sorting (for performance), but columns with UTF-8 characters in them will now use `localeCompare` automatically for sorting, which the locale specified by the end user's browser preferences. Please note that this requires Safari 10.1 or newer if you are using Safari. If you are using an older version, it will automatically failback to treating the column as a simple string type.

DD-2956

1ed59eaeab4ad1fa02dba5def2273ea89af44fa7 Dev: Corrections for markdown

c4e8cc432676007b6f0b3a0f13866e96b6179b3a Dev fix: Need to account for the nextra string type when checking for HTML based data

f95f3493cbb5d31022504a9faeefb057d5dbf3f2 Test: Add tests to ensure `dataSrc` is assigned before state is loaded

DD-2964

c376cbea727a7fdb40e50c8dcc4c326d45e16c49 Test: Add test case to ensure column data attributes are applied

DataTables/DataTablesSrc#279
DD-2964

73e842e4278b6c214c9c996bdef3c8a9332c2e3b Fix: Tidy up the order of initialisation when a language file is loaded

It now happens after the columns have been detected, and the HTML for
the table itself setup (not the features).

DD-2964

ebcdf5e6119b0da7989c91f4b745286b4e540f8f New: Reintroduce the `-init deferLoading` option which is used to delay the first request for data when server-side processing is enabled until the second draw of the table.

DD-2971

4b01c6d346dfb53152dbec32b8986b92314adb26 Dev: Might as well go for maximum compatibility with deferLoading and
support the hungarian notation as well. Can do it with just two extra
characters.

d9b9f01eb3f1c2c7b366ec23b6163ebf08cf5050 Site: Tweak the example tabs as it was overflowing on the Editor site

5c73cecf11643368d8cbd556d384700f4a385b7f Update: If there are multiple `-init layout` items in a single cell, they will now show on the same line on larger screens and collapse to a single column for small screens.

cb81193278860460506d47acfd6a799354fa0b75 Docs: Fix link to `-event dt-error`

987ea83e61baf10c68a884c1f263261dd2efd22e WIP: Reworking the layout rendering to allow cell and row class/id
values to be specified, letting it be a complete replacement to `dom`.
Also a new `div` feature which can be used for further refined control.

Currently at the moment of rewriting the layout renders. Most can be
done with just class names now. Bootstrap X and DT done. Others still to
do.

0a7b581ffc7f17228f83db1ed8580d1e5790d026 New: `-init layout` now has the ability to set class names on the rows and cells of the layout grid. This gives you complete control over the markup that is used to control the grid, allowing it to fully replace all options that exist in `-init dom`.
New: DataTables styling updated to use flexbox for layout, allowing much more flexbility.
New: All styling frameworks updated to have control elements which are in the same position (i.e. an array of items) will now place them side by side.
New: All styling frameworks will evenly space layout full row items
Examples: New examples for grid layout and id/class demonstrations.

Todo: Unit tests and update `layout` docs

d66c133ce685d650662a6a57fd5f8326a86b76a4 Dev: Unit tests failing - saving WIP

dad5dc9f650dbe81c04829811ea1c551bee80247 Dev: Fix layout error when spcifying a full row

3ee746cc2277be29af5aad95283e72db9f7b5216 Fix: Don't add `tabIndex` to the paging buttons if its value is `0` as it is redundant

https://datatables.net/forums/discussion/79251

a201e2620faa86d762644c91de8d6d33d1ec9e7a New: `-tag nav` element is now used to wrap around the pagination control. This is done to help improve accessability. To preserve CSS backwards compatibility the host element `div.dt-paging` is retained, and the new `-tag nav` is a child of that, with the paging elements and child of that in turn. It means there is an extra tag than can be considered redundant, but that's the trade off for adding the element.

Tests updates
https://datatables.net/forums/discussion/79269

191d0d768710c6508729725953c4e84bcf6e2aee Update: Use `-tag button` elements for Bootstrap 5's pagination control, as they are more suitable for in page nagivation and Bootstrap fully supports this.

https://datatables.net/forums/discussion/79269
twbs/bootstrap#40579

bbe16d3690fb7666a5821350224c9b8d82fe8db5 Dev: Remove debug test init

b2100fd2bb86cc5b5fc9ab88cd1d256e17f194e4 Dev: The table must be in a block container, otherwise the sizing table gets placed next to it and the column widths are completely wrong.

Sync to source repo @b2100fd2bb86cc5b5fc9ab88cd1d256e17f194e4
  • Loading branch information
dtbuild committed Jul 9, 2024
1 parent f6db243 commit 084e672
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 81 deletions.
87 changes: 80 additions & 7 deletions css/dataTables.bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,21 @@ table.dataTable tr.dt-hasChild td.dt-control:before {
}

html.dark table.dataTable td.dt-control:before,
:root[data-bs-theme=dark] table.dataTable td.dt-control:before {
:root[data-bs-theme=dark] table.dataTable td.dt-control:before,
:root[data-theme=dark] table.dataTable td.dt-control:before {
border-left-color: rgba(255, 255, 255, 0.5);
}
html.dark table.dataTable tr.dt-hasChild td.dt-control:before,
:root[data-bs-theme=dark] table.dataTable tr.dt-hasChild td.dt-control:before {
:root[data-bs-theme=dark] table.dataTable tr.dt-hasChild td.dt-control:before,
:root[data-theme=dark] table.dataTable tr.dt-hasChild td.dt-control:before {
border-top-color: rgba(255, 255, 255, 0.5);
border-left-color: transparent;
}

div.dt-scroll {
width: 100%;
}

div.dt-scroll-body thead tr,
div.dt-scroll-body tfoot tr {
height: 0;
Expand Down Expand Up @@ -357,11 +363,79 @@ table.table.dataTable.table-hover > tbody > tr.selected:hover > * {
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.975);
}

div.dt-container div.row {
margin-bottom: 0.75rem;
div.dt-container div.dt-layout-row {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
margin: 0.75em 0;
}
div.dt-container div.dt-layout-row div.dt-layout-cell {
display: flex;
justify-content: space-between;
align-items: center;
}
div.dt-container div.dt-layout-row div.dt-layout-cell.dt-layout-start {
justify-content: flex-start;
margin-right: auto;
}
div.dt-container div.dt-layout-row div.dt-layout-cell.dt-layout-end {
justify-content: flex-end;
margin-left: auto;
}
div.dt-container div.dt-layout-row div.dt-layout-cell:empty {
display: none;
}
div.dt-container div.row:last-child {
margin-bottom: 0;

@media screen and (max-width: 767px) {
div.dt-container div.dt-layout-row {
display: block;
}
div.dt-container div.dt-layout-row div.dt-layout-cell {
display: block;
text-align: center;
}
div.dt-container div.dt-layout-row div.dt-layout-cell > * {
margin: 0.5em 0;
}
div.dt-container div.dt-layout-row div.dt-layout-cell.dt-layout-start {
margin-right: 0;
}
div.dt-container div.dt-layout-row div.dt-layout-cell.dt-layout-end {
margin-left: 0;
}
}
div.dt-container div.dt-layout-start > *:not(:last-child) {
margin-right: 1em;
}
div.dt-container div.dt-layout-end > *:not(:first-child) {
margin-left: 1em;
}
div.dt-container div.dt-layout-full {
width: 100%;
}
div.dt-container div.dt-layout-full > *:only-child {
margin-left: auto;
margin-right: auto;
}
div.dt-container div.dt-layout-table > div {
display: block !important;
}

@media screen and (max-width: 767px) {
div.dt-container div.dt-layout-start > *:not(:last-child) {
margin-right: 0;
}
div.dt-container div.dt-layout-end > *:not(:first-child) {
margin-left: 0;
}
}
div.dt-container div.dt-layout-row {
width: auto;
}
div.dt-container div.dt-layout-row div.dt-layout-cell {
padding-left: 15px;
padding-right: 15px;
}
div.dt-container div.dt-length label {
font-weight: normal;
Expand All @@ -386,7 +460,6 @@ div.dt-container div.dt-search input {
width: auto;
}
div.dt-container div.dt-info {
padding-top: 8px;
white-space: nowrap;
}
div.dt-container div.dt-paging {
Expand Down
2 changes: 1 addition & 1 deletion css/dataTables.bootstrap.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
],
"src-repo": "http://github.com/DataTables/DataTablesSrc",
"last-tag": "2.0.8",
"last-sync": "92840b01f4a0c71b25f004273fc9e0f57291ee4f"
"last-sync": "b2100fd2bb86cc5b5fc9ab88cd1d256e17f194e4"
}
43 changes: 8 additions & 35 deletions js/dataTables.bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ $.extend( true, DataTable.ext.classes, {
},
processing: {
container: "dt-processing panel panel-default"
},
layout: {
row: 'row dt-layout-row',
cell: 'dt-layout-cell',
tableCell: 'col-12',
start: 'dt-layout-start col-sm-6',
end: 'dt-layout-end col-sm-6',
full: 'dt-layout-full col-sm-12'
}
} );

Expand Down Expand Up @@ -107,41 +115,6 @@ DataTable.ext.renderer.pagingContainer.bootstrap = function (settings, buttonEls
return $('<ul/>').addClass('pagination').append(buttonEls);
};

DataTable.ext.renderer.layout.bootstrap = function ( settings, container, items ) {
var row = $( '<div/>', {
"class": 'row'
} )
.appendTo( container );

$.each( items, function (key, val) {
var klass = '';
if ( key === 'start' ) {
klass += 'col-sm-6 text-left';
}
else if ( key === 'end' ) {
klass += 'col-sm-6 text-right';

// If no left element, we need to offset this one
if (row.find('.col-sm-6').length === 0) {
klass += ' col-sm-offset-6';
}
}
else if ( key === 'full' ) {
klass += 'col-sm-12';
if ( ! val.table ) {
klass += ' text-center';
}
}

$( '<div/>', {
id: val.id || null,
"class": klass+' '+(val.className || '')
} )
.append( val.contents )
.appendTo( row );
} );
};


return DataTable;
}));
2 changes: 1 addition & 1 deletion js/dataTables.bootstrap.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dataTables.bootstrap.min.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! DataTables Bootstrap 3 integration
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;$.extend(!0,DataTable.defaults,{renderer:"bootstrap"}),$.extend(!0,DataTable.ext.classes,{container:"dt-container form-inline dt-bootstrap",search:{input:"form-control input-sm"},length:{select:"form-control input-sm"},processing:{container:"dt-processing panel panel-default"}}),DataTable.ext.renderer.pagingButton.bootstrap=function(t,e,a,n,r){var l=["dt-paging-button","page-item"],n=(n&&l.push("active"),r&&l.push("disabled"),$("<li>").addClass(l.join(" ")));return{display:n,clicker:$("<a>",{href:r?null:"#",class:"page-link"}).html(a).appendTo(n)}},DataTable.ext.renderer.pagingContainer.bootstrap=function(t,e){return $("<ul/>").addClass("pagination").append(e)},DataTable.ext.renderer.layout.bootstrap=function(t,e,a){var n=$("<div/>",{class:"row"}).appendTo(e);$.each(a,function(t,e){var a="";"start"===t?a+="col-sm-6 text-left":"end"===t?(a+="col-sm-6 text-right",0===n.find(".col-sm-6").length&&(a+=" col-sm-offset-6")):"full"===t&&(a+="col-sm-12",e.table||(a+=" text-center")),$("<div/>",{id:e.id||null,class:a+" "+(e.className||"")}).append(e.contents).appendTo(n)})};export default DataTable;
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;$.extend(!0,DataTable.defaults,{renderer:"bootstrap"}),$.extend(!0,DataTable.ext.classes,{container:"dt-container form-inline dt-bootstrap",search:{input:"form-control input-sm"},length:{select:"form-control input-sm"},processing:{container:"dt-processing panel panel-default"},layout:{row:"row dt-layout-row",cell:"dt-layout-cell",tableCell:"col-12",start:"dt-layout-start col-sm-6",end:"dt-layout-end col-sm-6",full:"dt-layout-full col-sm-12"}}),DataTable.ext.renderer.pagingButton.bootstrap=function(t,a,e,l,n){var o=["dt-paging-button","page-item"],l=(l&&o.push("active"),n&&o.push("disabled"),$("<li>").addClass(o.join(" ")));return{display:l,clicker:$("<a>",{href:n?null:"#",class:"page-link"}).html(e).appendTo(l)}},DataTable.ext.renderer.pagingContainer.bootstrap=function(t,a){return $("<ul/>").addClass("pagination").append(a)};export default DataTable;
43 changes: 8 additions & 35 deletions js/dataTables.bootstrap.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ $.extend( true, DataTable.ext.classes, {
},
processing: {
container: "dt-processing panel panel-default"
},
layout: {
row: 'row dt-layout-row',
cell: 'dt-layout-cell',
tableCell: 'col-12',
start: 'dt-layout-start col-sm-6',
end: 'dt-layout-end col-sm-6',
full: 'dt-layout-full col-sm-12'
}
} );

Expand Down Expand Up @@ -67,40 +75,5 @@ DataTable.ext.renderer.pagingContainer.bootstrap = function (settings, buttonEls
return $('<ul/>').addClass('pagination').append(buttonEls);
};

DataTable.ext.renderer.layout.bootstrap = function ( settings, container, items ) {
var row = $( '<div/>', {
"class": 'row'
} )
.appendTo( container );

$.each( items, function (key, val) {
var klass = '';
if ( key === 'start' ) {
klass += 'col-sm-6 text-left';
}
else if ( key === 'end' ) {
klass += 'col-sm-6 text-right';

// If no left element, we need to offset this one
if (row.find('.col-sm-6').length === 0) {
klass += ' col-sm-offset-6';
}
}
else if ( key === 'full' ) {
klass += 'col-sm-12';
if ( ! val.table ) {
klass += ' text-center';
}
}

$( '<div/>', {
id: val.id || null,
"class": klass+' '+(val.className || '')
} )
.append( val.contents )
.appendTo( row );
} );
};


export default DataTable;

0 comments on commit 084e672

Please sign in to comment.