@ninebone/datagrid 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/nine-table.css +61 -31
- package/dist/nine-table.js +16 -7
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +4 -4
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/css/nine-table.css
CHANGED
|
@@ -506,25 +506,17 @@ cell-row-indicator {
|
|
|
506
506
|
pointer-events: none;
|
|
507
507
|
}
|
|
508
508
|
|
|
509
|
-
.
|
|
509
|
+
.row-status {
|
|
510
|
+
display: inline-block;
|
|
510
511
|
position: absolute;
|
|
511
|
-
right:
|
|
512
|
+
right: 0;
|
|
512
513
|
top: 1px;
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
514
|
+
width: 4px;
|
|
515
|
+
height: 4px;
|
|
516
|
+
border-radius: 50%;
|
|
516
517
|
}
|
|
517
518
|
}
|
|
518
519
|
|
|
519
|
-
cell-row-indicator .row-status {
|
|
520
|
-
display: inline-block;
|
|
521
|
-
position: absolute;
|
|
522
|
-
right: 0;
|
|
523
|
-
top: 1px;
|
|
524
|
-
width: 4px;
|
|
525
|
-
height: 4px;
|
|
526
|
-
border-radius: 50%;
|
|
527
|
-
}
|
|
528
520
|
|
|
529
521
|
cell-row-indicator.is-insert .row-status {
|
|
530
522
|
background-color: #333;
|
|
@@ -543,20 +535,35 @@ cell-row-indicator.is-delete .row-status {
|
|
|
543
535
|
}
|
|
544
536
|
|
|
545
537
|
tbody {
|
|
546
|
-
|
|
547
|
-
|
|
538
|
+
|
|
539
|
+
tr.selected {
|
|
540
|
+
cell-row-indicator {
|
|
541
|
+
border-left: 2px solid darkgoldenrod;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
cell-row-indicator {
|
|
545
|
+
border-left: 2px solid darkgoldenrod;
|
|
546
|
+
}
|
|
548
547
|
}
|
|
549
548
|
|
|
550
|
-
.selected
|
|
551
|
-
|
|
549
|
+
th.selected, td.selected {
|
|
550
|
+
.selected {
|
|
551
|
+
background-color: var(--cell-selection-bg);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
.selected-start {
|
|
555
|
+
background-color: transparent;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.selected-top { border-top: 2px solid var(--cell-selection-border-color); }
|
|
559
|
+
.selected-bottom { border-bottom: 2px solid var(--cell-selection-border-color); }
|
|
560
|
+
.selected-left { border-left: 2px solid var(--cell-selection-border-color); }
|
|
561
|
+
.selected-right { border-right: 2px solid var(--cell-selection-border-color); }
|
|
552
562
|
}
|
|
553
563
|
|
|
554
|
-
.selected-top { border-top: 2px solid var(--cell-selection-border-color); }
|
|
555
|
-
.selected-bottom { border-bottom: 2px solid var(--cell-selection-border-color); }
|
|
556
|
-
.selected-left { border-left: 2px solid var(--cell-selection-border-color); }
|
|
557
|
-
.selected-right { border-right: 2px solid var(--cell-selection-border-color); }
|
|
558
564
|
}
|
|
559
565
|
|
|
566
|
+
|
|
560
567
|
nine-table-col-expand {
|
|
561
568
|
position: absolute;
|
|
562
569
|
right: 2px;
|
|
@@ -1519,31 +1526,54 @@ nine-table-sheets-footer {
|
|
|
1519
1526
|
}
|
|
1520
1527
|
|
|
1521
1528
|
|
|
1529
|
+
|
|
1522
1530
|
.asc::after,
|
|
1523
1531
|
.desc::after {
|
|
1524
|
-
|
|
1525
|
-
|
|
1532
|
+
z-index: 1;
|
|
1526
1533
|
content: "";
|
|
1527
1534
|
display: inline-block;
|
|
1528
|
-
width:
|
|
1529
|
-
height:
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1535
|
+
width: 10px;
|
|
1536
|
+
height: 10px;
|
|
1537
|
+
position: absolute;
|
|
1538
|
+
left: 50%;
|
|
1539
|
+
top: -2px;
|
|
1540
|
+
transform: translateX(-50%);
|
|
1533
1541
|
background-repeat: no-repeat;
|
|
1534
1542
|
background-position: center;
|
|
1535
1543
|
background-size: contain;
|
|
1536
1544
|
}
|
|
1537
1545
|
|
|
1538
1546
|
.asc::after {
|
|
1539
|
-
--sort-icon-color: #2563eb;
|
|
1540
1547
|
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 16 16"><path fill="%232563eb" d="M8 3L3 11h10L8 3z"/></svg>');
|
|
1541
1548
|
}
|
|
1542
1549
|
|
|
1543
1550
|
.desc::after {
|
|
1544
|
-
--sort-icon-color: #dc2626;
|
|
1545
1551
|
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 16 16"><path fill="%23dc2626" d="M8 13L3 5h10l-5 8z"/></svg>');
|
|
1546
1552
|
}
|
|
1553
|
+
|
|
1554
|
+
|
|
1555
|
+
tbody.body td *:first-child, tbody.body th *:first-child {
|
|
1556
|
+
transform: translate(0, 0);
|
|
1557
|
+
transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1.35), opacity 0.4s ease-out;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
tbody.body .sorting-anim-asc *:first-child {
|
|
1561
|
+
transform: translate(0px, 20px);
|
|
1562
|
+
opacity: 0.2;
|
|
1563
|
+
transition: none;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
tbody.body .sorting-anim-desc *:first-child {
|
|
1567
|
+
transform: translate(0px, -30px);
|
|
1568
|
+
opacity: 0.2;
|
|
1569
|
+
transition: none;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
tbody.body .sorting-anim-none *:first-child {
|
|
1573
|
+
transform: translate(0px, 0px);
|
|
1574
|
+
opacity: 0.2;
|
|
1575
|
+
transition: none;
|
|
1576
|
+
}
|
|
1547
1577
|
table {
|
|
1548
1578
|
--table-th-bg: #f9fafb;
|
|
1549
1579
|
--table-th-color: #111827;
|
package/dist/nine-table.js
CHANGED
|
@@ -271,8 +271,8 @@ var n = new class extends e.constructor {
|
|
|
271
271
|
e = parseInt(e, 10);
|
|
272
272
|
let i = this.getHostFields().indexOf(t);
|
|
273
273
|
if (i < 0) return;
|
|
274
|
-
let a = this.#
|
|
275
|
-
|
|
274
|
+
let a = this.#u(e), o = this.#t.rawRecords[a];
|
|
275
|
+
o && (o.v[i] !== n && o.m._[r.META.INDEX.ROW_STATE] !== r.ROW_STATE.INSERT && (o.m._[r.META.INDEX.ROW_STATE] = r.ROW_STATE.UPDATE), o.v[i] = n);
|
|
276
276
|
};
|
|
277
277
|
#d = (e) => {
|
|
278
278
|
if (!e) return e;
|
|
@@ -2229,10 +2229,19 @@ var k = class {
|
|
|
2229
2229
|
}) : c ? u >= 0 ? this.#n[u].asc = !1 : this.#n.push({
|
|
2230
2230
|
...d,
|
|
2231
2231
|
asc: !1
|
|
2232
|
-
}) : this.#n = this.#n.filter((e) => !(e.colIndex === n && e.subRowIndex === i || e.colName === o)), this.#a();
|
|
2232
|
+
}) : this.#n = this.#n.filter((e) => !(e.colIndex === n && e.subRowIndex === i || e.colName === o)), this.#a(t);
|
|
2233
2233
|
}
|
|
2234
|
-
#a() {
|
|
2235
|
-
this.#e.view
|
|
2234
|
+
#a(e) {
|
|
2235
|
+
this.#e.view.setSorting(this.#n), this.#o(), this.#e.invalidate(), requestAnimationFrame(() => {
|
|
2236
|
+
let t = this.#e.querySelectorAll("tbody.body th, tbody.body td");
|
|
2237
|
+
t.forEach((t) => {
|
|
2238
|
+
t.classList.remove("sorting-anim-asc", "sorting-anim-desc", "sorting-anim-none"), e.classList.contains("asc") ? t.classList.add("sorting-anim-asc") : e.classList.contains("desc") ? t.classList.add("sorting-anim-desc") : t.classList.add("sorting-anim-none");
|
|
2239
|
+
}), requestAnimationFrame(() => {
|
|
2240
|
+
t.forEach((e) => {
|
|
2241
|
+
e.classList.remove("sorting-anim-asc", "sorting-anim-desc", "sorting-anim-none");
|
|
2242
|
+
});
|
|
2243
|
+
});
|
|
2244
|
+
});
|
|
2236
2245
|
}
|
|
2237
2246
|
#o() {
|
|
2238
2247
|
this.#e.querySelectorAll("thead th, thead td").forEach((e) => {
|
|
@@ -2843,7 +2852,7 @@ var N = class {
|
|
|
2843
2852
|
let e = Array.from(this.#e.children).filter((e) => e.tagName.toUpperCase() === "TABLE"), t = this.#e.getAttribute("auto-height") === "true", n = e.length, r = e.map((e, t) => {
|
|
2844
2853
|
let r = t === 0 ? "active" : "", i = e.id || `sheet${t + 1}`;
|
|
2845
2854
|
return `<nine-table-sheet class="${r}" data-index="${t}" data-sheet-id="${i}" id="${i}"></nine-table-sheet>` + (t < n - 1 ? `<nine-splitter class="h" data-split-index="${t}"></nine-splitter>` : "");
|
|
2846
|
-
}).join(""), i = ["@import \"https://cdn.jsdelivr.net/npm/@ninebone/datagrid@0.0.
|
|
2855
|
+
}).join(""), i = ["@import \"https://cdn.jsdelivr.net/npm/@ninebone/datagrid@0.0.12/dist/css/nine-table.css\";"];
|
|
2847
2856
|
nine["nine-table"] && nine["nine-table"].cssFile && i.push(`@import "${nine["nine-table"].cssFile}";`), this.#e.shadowRoot.innerHTML = `
|
|
2848
2857
|
<style>
|
|
2849
2858
|
${i.join("\n")}
|
|
@@ -2912,7 +2921,7 @@ var N = class {
|
|
|
2912
2921
|
#r = 0;
|
|
2913
2922
|
#i = "";
|
|
2914
2923
|
constructor() {
|
|
2915
|
-
super(), ["NINE-TABLE"].includes(this.tagName) && n.log("Welcome nine-table", "0.0.
|
|
2924
|
+
super(), ["NINE-TABLE"].includes(this.tagName) && n.log("Welcome nine-table", "0.0.12"), this.#e = this.attachShadow({ mode: "open" }), this.#t = new o(this);
|
|
2916
2925
|
}
|
|
2917
2926
|
connectedCallback() {
|
|
2918
2927
|
setTimeout(() => {
|