flexdesk 0.4.2 → 0.4.4
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/README.md +24 -0
- package/dist/charts.js +2 -2
- package/dist/{chunk-XKDTIT4Q.js → chunk-4RGQSRMC.js} +2 -2
- package/dist/{chunk-QIU5S2RU.js → chunk-P4AALM3A.js} +2 -2
- package/dist/{chunk-QIU5S2RU.js.map → chunk-P4AALM3A.js.map} +2 -2
- package/dist/tiles.js +2 -2
- package/dist/widgets.js +100 -1
- package/dist/widgets.js.map +4 -4
- package/dist/wm.js +206 -165
- package/dist/wm.js.map +3 -3
- package/package.json +1 -1
- package/src/tiling/tile_breadcrumb.js +9 -8
- package/src/tiling/wm.js +222 -175
- package/src/ui/components/column_fit.js +170 -0
- package/src/ui/components/data_table.js +5 -1
- /package/dist/{chunk-XKDTIT4Q.js.map → chunk-4RGQSRMC.js.map} +0 -0
package/dist/tiles.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "./chunk-O5OHMWBB.js";
|
|
4
4
|
import {
|
|
5
5
|
openRawTracesWindow
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-4RGQSRMC.js";
|
|
7
|
+
import "./chunk-P4AALM3A.js";
|
|
8
8
|
import "./chunk-LH5TSOZW.js";
|
|
9
9
|
import "./chunk-FL5KFNQH.js";
|
|
10
10
|
import {
|
package/dist/widgets.js
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
DataTable,
|
|
23
23
|
createRafResizeObserver
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-P4AALM3A.js";
|
|
25
25
|
import {
|
|
26
26
|
ManagedWindow
|
|
27
27
|
} from "./chunk-LH5TSOZW.js";
|
|
@@ -1661,6 +1661,103 @@ var AutocompleteField = class {
|
|
|
1661
1661
|
}
|
|
1662
1662
|
};
|
|
1663
1663
|
|
|
1664
|
+
// src/ui/components/column_fit.js
|
|
1665
|
+
var COLUMN_FIT = Object.freeze({
|
|
1666
|
+
/** Absolute floor, and the drag-resize minimum. */
|
|
1667
|
+
FLOOR: 40,
|
|
1668
|
+
/** Sub-pixel safety against an ellipsis on content that exactly fits. */
|
|
1669
|
+
PAD: 2,
|
|
1670
|
+
/** A column whose full width reaches this is free text. */
|
|
1671
|
+
TEXT_AT: 240,
|
|
1672
|
+
/** A text column's starting share when room allows it. */
|
|
1673
|
+
TEXT_MIN: 200,
|
|
1674
|
+
/** How far a text column shrinks before short columns go below `typical`. */
|
|
1675
|
+
TEXT_FLOOR: 120,
|
|
1676
|
+
/** How far a short column shrinks before the table scrolls. */
|
|
1677
|
+
SHORT_FLOOR: 56
|
|
1678
|
+
});
|
|
1679
|
+
function fitColumns(columns, avail) {
|
|
1680
|
+
const { FLOOR, PAD, TEXT_AT, TEXT_MIN, TEXT_FLOOR, SHORT_FLOOR } = COLUMN_FIT;
|
|
1681
|
+
const n = columns.length;
|
|
1682
|
+
const cols = columns.map((c) => {
|
|
1683
|
+
const header = Math.max(0, Number(c.header) || 0);
|
|
1684
|
+
const natural = Math.max(0, Number(c.natural) || 0);
|
|
1685
|
+
const full = Math.max(FLOOR, Math.ceil(Math.max(natural, header) + PAD));
|
|
1686
|
+
const typical = Math.min(full, Math.max(FLOOR, Math.ceil(Math.max(
|
|
1687
|
+
Number.isFinite(c.typical) ? c.typical : natural,
|
|
1688
|
+
header
|
|
1689
|
+
) + PAD)));
|
|
1690
|
+
const pinned = Number.isFinite(c.pinned) ? Math.max(FLOOR, Math.round(c.pinned)) : null;
|
|
1691
|
+
const text2 = pinned == null && (typeof c.text === "boolean" ? c.text : full >= TEXT_AT);
|
|
1692
|
+
return { full, typical, pinned, text: text2 };
|
|
1693
|
+
});
|
|
1694
|
+
const text = [];
|
|
1695
|
+
const short = [];
|
|
1696
|
+
cols.forEach((c, i) => {
|
|
1697
|
+
if (c.pinned == null) (c.text ? text : short).push(i);
|
|
1698
|
+
});
|
|
1699
|
+
if (!(avail > 1)) return cols.map((c) => c.pinned != null ? c.pinned : c.full);
|
|
1700
|
+
const widths = cols.map((c) => {
|
|
1701
|
+
if (c.pinned != null) return c.pinned;
|
|
1702
|
+
return c.text ? Math.min(c.full, TEXT_MIN) : c.full;
|
|
1703
|
+
});
|
|
1704
|
+
const total = () => widths.reduce((a, b) => a + b, 0);
|
|
1705
|
+
let slack = avail - total();
|
|
1706
|
+
if (slack >= 0) {
|
|
1707
|
+
slack = raise(widths, text, (i) => cols[i].full, slack);
|
|
1708
|
+
if (slack > 0) {
|
|
1709
|
+
if (text.length) text.forEach((i) => {
|
|
1710
|
+
widths[i] += slack / text.length;
|
|
1711
|
+
});
|
|
1712
|
+
else widths[short.length ? short[short.length - 1] : n - 1] += slack;
|
|
1713
|
+
}
|
|
1714
|
+
return widths;
|
|
1715
|
+
}
|
|
1716
|
+
const steps = [
|
|
1717
|
+
[short, (i) => cols[i].typical],
|
|
1718
|
+
[text, () => TEXT_FLOOR],
|
|
1719
|
+
[short, (i) => Math.min(cols[i].typical, SHORT_FLOOR)],
|
|
1720
|
+
[text, () => FLOOR * 2]
|
|
1721
|
+
];
|
|
1722
|
+
for (const [idxs, low] of steps) {
|
|
1723
|
+
const over = total() - avail;
|
|
1724
|
+
if (over <= 1e-6) break;
|
|
1725
|
+
lowerTo(widths, idxs, low, over);
|
|
1726
|
+
}
|
|
1727
|
+
return widths;
|
|
1728
|
+
}
|
|
1729
|
+
function raise(widths, idxs, target, slack) {
|
|
1730
|
+
if (!(slack > 0)) return slack;
|
|
1731
|
+
const wants = idxs.map((i) => Math.max(0, target(i) - widths[i]));
|
|
1732
|
+
const need = wants.reduce((a, b) => a + b, 0);
|
|
1733
|
+
if (!(need > 0)) return slack;
|
|
1734
|
+
const give = Math.min(slack, need);
|
|
1735
|
+
idxs.forEach((i, k) => {
|
|
1736
|
+
widths[i] += give * wants[k] / need;
|
|
1737
|
+
});
|
|
1738
|
+
return slack - give;
|
|
1739
|
+
}
|
|
1740
|
+
function lowerTo(widths, idxs, low, over) {
|
|
1741
|
+
const floorOf = (i) => Math.min(widths[i], Math.max(0, low(i)));
|
|
1742
|
+
const cand = idxs.filter((i) => widths[i] > floorOf(i));
|
|
1743
|
+
if (!cand.length || over <= 0) return;
|
|
1744
|
+
const floors = new Map(cand.map((i) => [i, floorOf(i)]));
|
|
1745
|
+
const capacity = cand.reduce((a, i) => a + widths[i] - floors.get(i), 0);
|
|
1746
|
+
if (capacity <= over) {
|
|
1747
|
+
for (const i of cand) widths[i] = floors.get(i);
|
|
1748
|
+
return;
|
|
1749
|
+
}
|
|
1750
|
+
const cutAt = (level) => cand.reduce((a, i) => a + Math.max(0, widths[i] - Math.max(floors.get(i), level)), 0);
|
|
1751
|
+
let lo = 0;
|
|
1752
|
+
let hi = Math.max(...cand.map((i) => widths[i]));
|
|
1753
|
+
for (let k = 0; k < 64; k++) {
|
|
1754
|
+
const mid = (lo + hi) / 2;
|
|
1755
|
+
if (cutAt(mid) > over) lo = mid;
|
|
1756
|
+
else hi = mid;
|
|
1757
|
+
}
|
|
1758
|
+
for (const i of cand) widths[i] = Math.min(widths[i], Math.max(floors.get(i), hi));
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1664
1761
|
// src/ui/components/computing_status_window.js
|
|
1665
1762
|
var _activeWindow = null;
|
|
1666
1763
|
function showComputingWindow({ title = "Computing...", message = "", icon = "hourglass_top", onCancel } = {}) {
|
|
@@ -5400,6 +5497,7 @@ if (typeof window !== "undefined") {
|
|
|
5400
5497
|
export {
|
|
5401
5498
|
ActionDropdown,
|
|
5402
5499
|
AutocompleteField,
|
|
5500
|
+
COLUMN_FIT,
|
|
5403
5501
|
ComponentBase,
|
|
5404
5502
|
ControllerBase,
|
|
5405
5503
|
DEFAULT_TYPES,
|
|
@@ -5429,6 +5527,7 @@ export {
|
|
|
5429
5527
|
createTreeItem,
|
|
5430
5528
|
createTreeNode,
|
|
5431
5529
|
filterTree,
|
|
5530
|
+
fitColumns,
|
|
5432
5531
|
helpCategories,
|
|
5433
5532
|
helpCopy,
|
|
5434
5533
|
helpProvider,
|