Giter VIP home page Giter VIP logo

dist-datatables-bootstrap5's People

Contributors

allanjard avatar sandydatatables avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

dist-datatables-bootstrap5's Issues

Dark mode on v1.11.3 is not working

Hello,

I hope to not open this issue for nothing, but after many tests, it seems that the dark mode doesn't use the recommendation of Bootstrap.

To use the dark mode, there is a pretty simple doc.

[Just] add data-bs-theme="light" or data-bs-theme="dark" to the parent

the highest element is html, same workflow as Bootstrap doc page.

Bootstrap shared this JS script to make the implementation easy.

The problem (imo) is the implementation with html.dark in the file is not correct.

It should be in:

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

The demo page DataTables example - Bootstrap 5 styling is working, because you have this snippet hack of JS code:

if (mode === 'dark') {
	var html = document.getElementsByTagName('html')[0];

	html.className += html.className + ' dark';
	html.setAttribute('data-bs-theme', 'dark');
}

Is it possible to implement dark mode properly?

Best,

Datatables 2.0 does not consider BS5 table variants

I experimented a bit with Datatables 2.0 and various Bootstrap 5 Table variants (i.e. table header different color than table body). It seems that class dataTables which is inserted by datatables.js overrides most Bootstrap 5 classes (i.e. table-dark does have white text, but not black background).

Example:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.datatables.net/2.0.1/css/dataTables.bootstrap5.min.css" rel="stylesheet">

    <script src="https://code.jquery.com/jquery-3.7.1.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.datatables.net/2.0.1/js/dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/2.0.1/js/dataTables.bootstrap5.min.js"></script>
</head>
<body>
<div class="container pt-3">
    <h1>Datatables test</h1>

    <div class="my-2">
        <table id="sample-data" class="table table-striped table-success">
            <thead class="table-dark">
                <tr>
                    <th>Name</th>
                    <th>Position</th>
                    <th>Office</th>
                    <th>Age</th>
                    <th>Start date</th>
                    <th>Salary</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>Tiger Nixon</td>
                    <td>System Architect</td>
                    <td>Edinburgh</td>
                    <td>61</td>
                    <td>2011-04-25</td>
                    <td>$320,800</td>
                </tr>
                <tr class="table-info">
                    <td>Garrett Winters</td>
                    <td>Accountant</td>
                    <td>Tokyo</td>
                    <td>63</td>
                    <td>2011-07-25</td>
                    <td>$170,750</td>
                </tr>
                <tr>
                    <td>Ashton Cox</td>
                    <td>Junior Technical Author</td>
                    <td>San Francisco</td>
                    <td>66</td>
                    <td>2009-01-12</td>
                    <td>$86,000</td>
                </tr>
                <tr>
                    <td>Cedric Kelly</td>
                    <td>Senior Javascript Developer</td>
                    <td>Edinburgh</td>
                    <td>22</td>
                    <td>2012-03-29</td>
                    <td>$433,060</td>
                </tr>
                <tr>
                    <td>Airi Satou</td>
                    <td>Accountant</td>
                    <td>Tokyo</td>
                    <td>33</td>
                    <td>2008-11-28</td>
                    <td>$162,700</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
    
<script>
    $(document).ready(function() {
        new DataTable('#sample-data', {});
    });
</script>
</body>
</html>

CSS conflict with .card

In dataTables.bootstrap5.js the Default class modification adds the .card class to sProcessing. The result is that the processing message div gets height: 100% from bootstrap 5's .card css which makes the processing message box unsightly. I'd recommend either overriding the height in div.dataTables_processing or not using the .card class in the js at all.

Error

Error with Composer:

[InvalidArgumentException]
Could not find a version of package datatables.net/datatables.net matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability.

CSS files incorrectly merged/synced causing duplicate lines

CSS tokens defined at the top of the file are used in sections such as this one :

table.dataTable > tbody > tr.selected > * {
box-shadow: inset 0 0 0 9999px #0d6efd;
box-shadow: inset 0 0 0 9999px rgb(var(--dt-row-selected));
color: white;
color: rgb(var(--dt-row-selected-text));
}
table.dataTable > tbody > tr.selected a {
color: #090a0b;
color: rgb(var(--dt-row-selected-link));
}
table.dataTable.table-striped > tbody > tr.odd > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.05);
}
table.dataTable.table-striped > tbody > tr.odd.selected > * {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.95);
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.95);
}
table.dataTable.table-hover > tbody > tr:hover > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.075);
}
table.dataTable.table-hover > tbody > tr.selected:hover > * {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.975);
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.975);
}

Each time, the use of the token follows a definition of the same CSS property with hard-coded values, precisely those the token intends to replace.

These lines seem to have been incorrectly merged or auto-generated.
This issue certainly spans all the auto-synced Github repositories ...

Upgrading from 1.13.7 to 1.13.8 breaks pagination styling

Good day,

I'm using this package to style my dataTables using Bootstrap5. This is how the pagination looks like with 1.13.7 version.
Screenshot 2023-12-07 at 11 30 44 AM

And the code uses a ul tag

Screenshot 2023-12-07 at 11 30 15 AM

However, after installing the update, the pagination looks like this:

Screenshot 2023-12-07 at 11 27 02 AM

And it uses span tags instead of the ul list element.

Screenshot 2023-12-07 at 11 29 16 AM

Was that intended? How may I keep the current look and use the latest version of the package?

Thank you

Pagination error with bootstrap 5

Hi,

I´m getting the following error with last dev version of datatables and bs5 plugin.

jquery.min.js:2 Uncaught TypeError: Cannot read properties of undefined (reading 'nodeType') at S.fn.init.attr (jquery.min.js:2:65491) at $ (jquery.min.js:2:32561) at S.fn.init.attr (jquery.min.js:2:65332) at o.ext.renderer.pageButton.bootstrap (dataTables.bootstrap5.min.js:1:1953) at S.fn.init.fn (jquery.dataTables.min.js:1:34084) at jquery.dataTables.min.js:1:47121 at Function.map (jquery.min.js:2:3536) at R (jquery.dataTables.min.js:1:47068) at v (jquery.dataTables.min.js:1:23286) at B.<anonymous> (jquery.dataTables.min.js:1:54760)

The highlight in the paginator is not updated when switch between pages. Show the gif.
Animation

Any clue?

Version 1.13.3 is broken

With version 1.13.2 I get this error message:

jquery.dataTables.mjs:59 
        
       Uncaught TypeError: Cannot set properties of undefined (setting '$')
    at DataTable (jquery.dataTables.mjs:59:7)
    at Comp.use (datatables.net-vue.esm.js:26522:3)
    at setup (DataTableNetComponent.vue:5:11)
    at callWithErrorHandling (runtime-core.esm-bundler.js:173:22)
    at setupStatefulComponent (runtime-core.esm-bundler.js:7265:29)
    at setupComponent (runtime-core.esm-bundler.js:7220:11)
    at mountComponent (runtime-core.esm-bundler.js:5542:13)
    at processComponent (runtime-core.esm-bundler.js:5517:17)
    at patch (runtime-core.esm-bundler.js:5119:21)
    at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5656:21)

Changing the version back to 1.12.1 fixes the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.