optikos 0.4.0 → 0.5.0
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/CHANGELOG.md +19 -0
- package/dist/build.js +2 -0
- package/dist/build.js.map +7 -0
- package/dist/chunk-2CVMT3IW.js +3 -0
- package/dist/chunk-2CVMT3IW.js.map +7 -0
- package/dist/{chunk-JSEI44A7.js → chunk-2I4Y7I7C.js} +2 -2
- package/dist/{chunk-U5L76VVB.js → chunk-2I7HDIOU.js} +2 -2
- package/dist/{chunk-FCJI2JF7.js → chunk-34KVSA2V.js} +2 -2
- package/dist/{chunk-NQV4THNE.js → chunk-37PYJAA2.js} +2 -2
- package/dist/{chunk-JJLOUMCJ.js → chunk-3OA3P37P.js} +2 -2
- package/dist/chunk-5G5PHOZJ.js +2 -0
- package/dist/chunk-5G5PHOZJ.js.map +7 -0
- package/dist/{chunk-S2CMWKVB.js → chunk-5GCTM37D.js} +2 -2
- package/dist/chunk-632LUU52.js +2 -0
- package/dist/chunk-632LUU52.js.map +7 -0
- package/dist/{chunk-RG6SHPHF.js → chunk-6NP4AEV4.js} +2 -2
- package/dist/{chunk-6LJK4QWF.js → chunk-6PPRYSLN.js} +2 -2
- package/dist/{chunk-NNR2FNHG.js → chunk-6TZJO2G2.js} +2 -2
- package/dist/{chunk-DWTDNKXX.js → chunk-A36JFIA3.js} +2 -2
- package/dist/{chunk-CFGCB37K.js → chunk-ADHKL2GM.js} +2 -2
- package/dist/{chunk-CMV3F6HR.js → chunk-AJN66F32.js} +2 -2
- package/dist/{chunk-DWA45BWR.js → chunk-BRGT4O6Q.js} +2 -2
- package/dist/{chunk-643FOYQB.js → chunk-BTGJ3MP4.js} +2 -2
- package/dist/{chunk-AT7VFZRB.js → chunk-CXZKCBQE.js} +2 -2
- package/dist/{chunk-PMOXLQ72.js → chunk-DLRGB5NY.js} +2 -2
- package/dist/chunk-DY3ZYMXD.js +2 -0
- package/dist/chunk-DY3ZYMXD.js.map +7 -0
- package/dist/{chunk-M7FNPRV4.js → chunk-EO777UIN.js} +2 -2
- package/dist/{chunk-HLS5FI55.js → chunk-ESRS5ZQV.js} +2 -2
- package/dist/{chunk-YDX2PCVL.js → chunk-FNZI6MFG.js} +2 -2
- package/dist/{chunk-6PZPBPAD.js → chunk-FSR6BDVO.js} +2 -2
- package/dist/{chunk-ZSPJZ3ZH.js → chunk-G26R2F3W.js} +2 -2
- package/dist/chunk-GLAY4RJF.js +2 -0
- package/dist/chunk-GLAY4RJF.js.map +7 -0
- package/dist/{chunk-SWCB2GMN.js → chunk-GNKVLJ5H.js} +2 -2
- package/dist/chunk-IODSL7KU.js +2 -0
- package/dist/chunk-IODSL7KU.js.map +7 -0
- package/dist/{chunk-EXIADWI7.js → chunk-J2TCHWYD.js} +2 -2
- package/dist/{chunk-IUOEPAWG.js → chunk-J5BZAKC6.js} +2 -2
- package/dist/{chunk-5BMG5ZBY.js → chunk-JBOKM5YA.js} +2 -2
- package/dist/{chunk-N2LS4JD6.js → chunk-L6DOWGBO.js} +2 -2
- package/dist/{chunk-2YRQULDC.js → chunk-LHWY6G6Q.js} +2 -2
- package/dist/chunk-LLHDEUIA.js +2 -0
- package/dist/chunk-LLHDEUIA.js.map +7 -0
- package/dist/chunk-LXWCTCZV.js +2 -0
- package/dist/chunk-LXWCTCZV.js.map +7 -0
- package/dist/{chunk-FPU53CCV.js → chunk-M7HLHGQV.js} +2 -2
- package/dist/{chunk-J5QPFJ7M.js → chunk-MGSCSS7X.js} +2 -2
- package/dist/{chunk-NJ5IFOPR.js → chunk-MM2OC66E.js} +2 -2
- package/dist/{chunk-MNSDGJKA.js → chunk-MQEALOU3.js} +2 -2
- package/dist/{chunk-TQPQ4UEA.js → chunk-NAUSRVB6.js} +2 -2
- package/dist/{chunk-JLKIHXZP.js → chunk-NEVDHDJ4.js} +2 -2
- package/dist/{chunk-F4HZUAKM.js → chunk-NWHH3CYH.js} +2 -2
- package/dist/{chunk-3FCIZKIN.js → chunk-OADWLPSF.js} +2 -2
- package/dist/{chunk-4AZ44KV4.js → chunk-OB3VIRQR.js} +2 -2
- package/dist/{chunk-4CWYF4O7.js → chunk-QOSTS5I3.js} +2 -2
- package/dist/{chunk-XR677UYD.js → chunk-QVBDBGS4.js} +2 -2
- package/dist/{chunk-GEBAYD6N.js → chunk-RMATRKXV.js} +2 -2
- package/dist/{chunk-Z6L55FTN.js → chunk-S3ILIWSW.js} +2 -2
- package/dist/{chunk-P4O57S6N.js → chunk-SEUIIPHS.js} +2 -2
- package/dist/{chunk-R32HPK7R.js → chunk-T5OGUCY2.js} +2 -2
- package/dist/chunk-TMBGEZSD.js +2 -0
- package/dist/chunk-TMBGEZSD.js.map +7 -0
- package/dist/{chunk-5PWPAN62.js → chunk-TVO3Z2BM.js} +2 -2
- package/dist/{chunk-UQRQH2JW.js → chunk-U25QSLAH.js} +2 -2
- package/dist/chunk-UCWICDYG.js +2 -0
- package/dist/{chunk-YXOKWCYS.js.map → chunk-UCWICDYG.js.map} +4 -4
- package/dist/{chunk-C3MWS7P2.js → chunk-UL364TLO.js} +2 -2
- package/dist/chunk-UUAGMZD2.js +2 -0
- package/dist/chunk-UUAGMZD2.js.map +7 -0
- package/dist/chunk-XFDNXSU5.js +2 -0
- package/dist/{chunk-XQHATUKN.js.map → chunk-XFDNXSU5.js.map} +3 -3
- package/dist/{chunk-XFIREDWO.js → chunk-XNRZJP4E.js} +2 -2
- package/dist/{chunk-JE56CJX2.js → chunk-Z6HZY2YG.js} +2 -2
- package/dist/{chunk-3QRA3XOA.js → chunk-ZEIE2OCQ.js} +2 -2
- package/dist/{chunk-4S3HRFQB.js → chunk-ZLYZFHEN.js} +2 -2
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/chart.js +1 -1
- package/dist/components/chat.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkboxgroup.js +1 -1
- package/dist/components/codeviewer.js +1 -1
- package/dist/components/columntotals.js +2 -0
- package/dist/components/columntotals.js.map +7 -0
- package/dist/components/combobox.js +1 -1
- package/dist/components/dataview.js +1 -1
- package/dist/components/datefield.js +1 -1
- package/dist/components/daterangefield.js +1 -1
- package/dist/components/datetimefield.js +1 -1
- package/dist/components/dial.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/exportbar.js +2 -0
- package/dist/components/exportbar.js.map +7 -0
- package/dist/components/fieldgroup.js +1 -1
- package/dist/components/fieldlist.js +1 -1
- package/dist/components/filterbuilder.js +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/formactions.js +1 -1
- package/dist/components/grid.js +1 -1
- package/dist/components/gridexport.js +1 -1
- package/dist/components/grouping.js +1 -1
- package/dist/components/imagefield.js +1 -1
- package/dist/components/inputgroup.js +1 -1
- package/dist/components/lookupfield.js +1 -1
- package/dist/components/maskfield.js +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/messagebox.js +1 -1
- package/dist/components/navmenu.js +1 -1
- package/dist/components/numberfield.js +1 -1
- package/dist/components/panel.js +1 -1
- package/dist/components/pickerfield.js +1 -1
- package/dist/components/radiogroup.js +1 -1
- package/dist/components/searchgrid.js +1 -1
- package/dist/components/secretfield.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/shortcuts.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/stat.js +1 -1
- package/dist/components/stepform.js +1 -1
- package/dist/components/suggestfield.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/textarea.js +1 -1
- package/dist/components/textfield.js +1 -1
- package/dist/components/timeentry.js +2 -0
- package/dist/components/timeentry.js.map +7 -0
- package/dist/components/timefield.js +1 -1
- package/dist/components/timeline.js +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/components/viewmanager.js +1 -1
- package/dist/components/widget.js +1 -1
- package/dist/components/window.js +1 -1
- package/dist/core.js +1 -1
- package/dist/css/columntotals.css +56 -0
- package/dist/css/exportbar.css +9 -0
- package/dist/css/grid.css +12 -0
- package/dist/css/grouping.css +7 -0
- package/dist/css/timeentry.css +116 -0
- package/dist/css/timeline.css +45 -0
- package/dist/data.js +1 -1
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +2 -2
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/optikos.css +248 -0
- package/dist/types/build/build.d.ts +49 -0
- package/dist/types/build/index.d.ts +1 -0
- package/dist/types/components/columntotals.d.ts +1 -0
- package/dist/types/components/data/columntotals/columntotals.d.ts +24 -0
- package/dist/types/components/data/exportbar/exportbar.d.ts +24 -0
- package/dist/types/components/data/grid/footer.d.ts +6 -0
- package/dist/types/components/data/grouping/controls.d.ts +27 -0
- package/dist/types/components/data/grouping/grouping.d.ts +15 -3
- package/dist/types/components/data/timeentry/timeentry.d.ts +37 -0
- package/dist/types/components/data/timeline/timeline.d.ts +3 -0
- package/dist/types/components/exportbar.d.ts +1 -0
- package/dist/types/components/timeentry.d.ts +1 -0
- package/dist/types/data/column.d.ts +4 -2
- package/dist/types/index.d.ts +4 -0
- package/dist/ui.js +1 -1
- package/package.json +5 -1
- package/dist/chunk-2HNQ2XRY.js +0 -2
- package/dist/chunk-2HNQ2XRY.js.map +0 -7
- package/dist/chunk-BJWREA76.js +0 -2
- package/dist/chunk-BJWREA76.js.map +0 -7
- package/dist/chunk-GFFZTFQH.js +0 -2
- package/dist/chunk-GFFZTFQH.js.map +0 -7
- package/dist/chunk-SB4ICXBV.js +0 -2
- package/dist/chunk-SB4ICXBV.js.map +0 -7
- package/dist/chunk-XQHATUKN.js +0 -2
- package/dist/chunk-YXOKWCYS.js +0 -2
- /package/dist/{chunk-JSEI44A7.js.map → chunk-2I4Y7I7C.js.map} +0 -0
- /package/dist/{chunk-U5L76VVB.js.map → chunk-2I7HDIOU.js.map} +0 -0
- /package/dist/{chunk-FCJI2JF7.js.map → chunk-34KVSA2V.js.map} +0 -0
- /package/dist/{chunk-NQV4THNE.js.map → chunk-37PYJAA2.js.map} +0 -0
- /package/dist/{chunk-JJLOUMCJ.js.map → chunk-3OA3P37P.js.map} +0 -0
- /package/dist/{chunk-S2CMWKVB.js.map → chunk-5GCTM37D.js.map} +0 -0
- /package/dist/{chunk-RG6SHPHF.js.map → chunk-6NP4AEV4.js.map} +0 -0
- /package/dist/{chunk-6LJK4QWF.js.map → chunk-6PPRYSLN.js.map} +0 -0
- /package/dist/{chunk-NNR2FNHG.js.map → chunk-6TZJO2G2.js.map} +0 -0
- /package/dist/{chunk-DWTDNKXX.js.map → chunk-A36JFIA3.js.map} +0 -0
- /package/dist/{chunk-CFGCB37K.js.map → chunk-ADHKL2GM.js.map} +0 -0
- /package/dist/{chunk-CMV3F6HR.js.map → chunk-AJN66F32.js.map} +0 -0
- /package/dist/{chunk-DWA45BWR.js.map → chunk-BRGT4O6Q.js.map} +0 -0
- /package/dist/{chunk-643FOYQB.js.map → chunk-BTGJ3MP4.js.map} +0 -0
- /package/dist/{chunk-AT7VFZRB.js.map → chunk-CXZKCBQE.js.map} +0 -0
- /package/dist/{chunk-PMOXLQ72.js.map → chunk-DLRGB5NY.js.map} +0 -0
- /package/dist/{chunk-M7FNPRV4.js.map → chunk-EO777UIN.js.map} +0 -0
- /package/dist/{chunk-HLS5FI55.js.map → chunk-ESRS5ZQV.js.map} +0 -0
- /package/dist/{chunk-YDX2PCVL.js.map → chunk-FNZI6MFG.js.map} +0 -0
- /package/dist/{chunk-6PZPBPAD.js.map → chunk-FSR6BDVO.js.map} +0 -0
- /package/dist/{chunk-ZSPJZ3ZH.js.map → chunk-G26R2F3W.js.map} +0 -0
- /package/dist/{chunk-SWCB2GMN.js.map → chunk-GNKVLJ5H.js.map} +0 -0
- /package/dist/{chunk-EXIADWI7.js.map → chunk-J2TCHWYD.js.map} +0 -0
- /package/dist/{chunk-IUOEPAWG.js.map → chunk-J5BZAKC6.js.map} +0 -0
- /package/dist/{chunk-5BMG5ZBY.js.map → chunk-JBOKM5YA.js.map} +0 -0
- /package/dist/{chunk-N2LS4JD6.js.map → chunk-L6DOWGBO.js.map} +0 -0
- /package/dist/{chunk-2YRQULDC.js.map → chunk-LHWY6G6Q.js.map} +0 -0
- /package/dist/{chunk-FPU53CCV.js.map → chunk-M7HLHGQV.js.map} +0 -0
- /package/dist/{chunk-J5QPFJ7M.js.map → chunk-MGSCSS7X.js.map} +0 -0
- /package/dist/{chunk-NJ5IFOPR.js.map → chunk-MM2OC66E.js.map} +0 -0
- /package/dist/{chunk-MNSDGJKA.js.map → chunk-MQEALOU3.js.map} +0 -0
- /package/dist/{chunk-TQPQ4UEA.js.map → chunk-NAUSRVB6.js.map} +0 -0
- /package/dist/{chunk-JLKIHXZP.js.map → chunk-NEVDHDJ4.js.map} +0 -0
- /package/dist/{chunk-F4HZUAKM.js.map → chunk-NWHH3CYH.js.map} +0 -0
- /package/dist/{chunk-3FCIZKIN.js.map → chunk-OADWLPSF.js.map} +0 -0
- /package/dist/{chunk-4AZ44KV4.js.map → chunk-OB3VIRQR.js.map} +0 -0
- /package/dist/{chunk-4CWYF4O7.js.map → chunk-QOSTS5I3.js.map} +0 -0
- /package/dist/{chunk-XR677UYD.js.map → chunk-QVBDBGS4.js.map} +0 -0
- /package/dist/{chunk-GEBAYD6N.js.map → chunk-RMATRKXV.js.map} +0 -0
- /package/dist/{chunk-Z6L55FTN.js.map → chunk-S3ILIWSW.js.map} +0 -0
- /package/dist/{chunk-P4O57S6N.js.map → chunk-SEUIIPHS.js.map} +0 -0
- /package/dist/{chunk-R32HPK7R.js.map → chunk-T5OGUCY2.js.map} +0 -0
- /package/dist/{chunk-5PWPAN62.js.map → chunk-TVO3Z2BM.js.map} +0 -0
- /package/dist/{chunk-UQRQH2JW.js.map → chunk-U25QSLAH.js.map} +0 -0
- /package/dist/{chunk-C3MWS7P2.js.map → chunk-UL364TLO.js.map} +0 -0
- /package/dist/{chunk-XFIREDWO.js.map → chunk-XNRZJP4E.js.map} +0 -0
- /package/dist/{chunk-JE56CJX2.js.map → chunk-Z6HZY2YG.js.map} +0 -0
- /package/dist/{chunk-3QRA3XOA.js.map → chunk-ZEIE2OCQ.js.map} +0 -0
- /package/dist/{chunk-4S3HRFQB.js.map → chunk-ZLYZFHEN.js.map} +0 -0
package/dist/optikos.css
CHANGED
|
@@ -1535,6 +1535,63 @@
|
|
|
1535
1535
|
}
|
|
1536
1536
|
}
|
|
1537
1537
|
|
|
1538
|
+
@layer optikos {
|
|
1539
|
+
.op-columntotals {
|
|
1540
|
+
display: grid;
|
|
1541
|
+
grid-template-columns: var(--op-grid-cols);
|
|
1542
|
+
box-sizing: border-box;
|
|
1543
|
+
flex: none;
|
|
1544
|
+
overflow: hidden;
|
|
1545
|
+
min-block-size: var(--op-grid-row-height, var(--op-row-height));
|
|
1546
|
+
border-block-start: var(--op-border-width) solid var(--op-grid-header-border, var(--op-color-border-strong));
|
|
1547
|
+
background: var(--op-grid-total-bg, var(--op-color-surface-2));
|
|
1548
|
+
font-weight: var(--op-font-weight-bold);
|
|
1549
|
+
}
|
|
1550
|
+
.op-columntotals[hidden] {
|
|
1551
|
+
display: none;
|
|
1552
|
+
}
|
|
1553
|
+
.op-columntotals__cell {
|
|
1554
|
+
display: flex;
|
|
1555
|
+
align-items: center;
|
|
1556
|
+
gap: var(--op-space-2);
|
|
1557
|
+
min-inline-size: 0;
|
|
1558
|
+
padding-inline: var(--op-grid-cell-padding-x, var(--op-control-padding-x));
|
|
1559
|
+
overflow: hidden;
|
|
1560
|
+
white-space: nowrap;
|
|
1561
|
+
}
|
|
1562
|
+
.op-columntotals__cell--right { justify-content: flex-end; }
|
|
1563
|
+
.op-columntotals__cell--center { justify-content: center; }
|
|
1564
|
+
.op-columntotals__op {
|
|
1565
|
+
color: var(--op-color-fg-muted);
|
|
1566
|
+
font-size: var(--op-font-size-sm);
|
|
1567
|
+
font-weight: var(--op-font-weight-normal, normal);
|
|
1568
|
+
}
|
|
1569
|
+
.op-columntotals__btn {
|
|
1570
|
+
display: inline-flex;
|
|
1571
|
+
flex: none;
|
|
1572
|
+
align-items: center;
|
|
1573
|
+
margin-inline-start: auto;
|
|
1574
|
+
padding: var(--op-space-1);
|
|
1575
|
+
border: 0;
|
|
1576
|
+
border-radius: var(--op-radius-sm);
|
|
1577
|
+
background: transparent;
|
|
1578
|
+
color: var(--op-color-fg-muted);
|
|
1579
|
+
cursor: pointer;
|
|
1580
|
+
}
|
|
1581
|
+
.op-columntotals__btn:hover {
|
|
1582
|
+
background: var(--op-color-hover);
|
|
1583
|
+
color: var(--op-color-fg);
|
|
1584
|
+
}
|
|
1585
|
+
.op-columntotals__btn:focus-visible {
|
|
1586
|
+
outline: var(--op-focus-width) solid var(--op-color-focus);
|
|
1587
|
+
outline-offset: var(--op-focus-offset);
|
|
1588
|
+
}
|
|
1589
|
+
.op-columntotals--top {
|
|
1590
|
+
border-block-start: 0;
|
|
1591
|
+
border-block-end: var(--op-border-width) solid var(--op-grid-header-border, var(--op-color-border-strong));
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1538
1595
|
@layer optikos {
|
|
1539
1596
|
:root {
|
|
1540
1597
|
--op-dataview-item-width: 10rem;
|
|
@@ -1592,6 +1649,16 @@
|
|
|
1592
1649
|
}
|
|
1593
1650
|
}
|
|
1594
1651
|
|
|
1652
|
+
@layer optikos {
|
|
1653
|
+
.op-exportbar {
|
|
1654
|
+
display: flex;
|
|
1655
|
+
flex: none;
|
|
1656
|
+
gap: var(--op-space-1);
|
|
1657
|
+
margin-inline-start: auto;
|
|
1658
|
+
padding-inline: var(--op-space-2);
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1595
1662
|
@layer optikos {
|
|
1596
1663
|
:root {
|
|
1597
1664
|
--op-filterbuilder-gap: var(--op-space-2);
|
|
@@ -1853,6 +1920,18 @@
|
|
|
1853
1920
|
padding: var(--op-space-2);
|
|
1854
1921
|
border-block-start: var(--op-border-width) solid var(--_border);
|
|
1855
1922
|
}
|
|
1923
|
+
.op-grid__footer {
|
|
1924
|
+
display: flex;
|
|
1925
|
+
flex: none;
|
|
1926
|
+
flex-wrap: wrap;
|
|
1927
|
+
align-items: center;
|
|
1928
|
+
justify-content: space-between;
|
|
1929
|
+
border-block-start: var(--op-border-width) solid var(--_border);
|
|
1930
|
+
}
|
|
1931
|
+
.op-grid__footer .op-grid__pager {
|
|
1932
|
+
flex: 1 1 auto;
|
|
1933
|
+
border-block-start: 0;
|
|
1934
|
+
}
|
|
1856
1935
|
.op-grid .op-virtual {
|
|
1857
1936
|
min-inline-size: var(--op-grid-min-width);
|
|
1858
1937
|
}
|
|
@@ -2221,6 +2300,13 @@
|
|
|
2221
2300
|
transition: none;
|
|
2222
2301
|
}
|
|
2223
2302
|
}
|
|
2303
|
+
.op-groupcontrols {
|
|
2304
|
+
display: flex;
|
|
2305
|
+
flex: none;
|
|
2306
|
+
gap: var(--op-space-1);
|
|
2307
|
+
margin-inline-start: auto;
|
|
2308
|
+
padding-inline: var(--op-space-2);
|
|
2309
|
+
}
|
|
2224
2310
|
}
|
|
2225
2311
|
|
|
2226
2312
|
@layer optikos {
|
|
@@ -2362,11 +2448,130 @@
|
|
|
2362
2448
|
}
|
|
2363
2449
|
}
|
|
2364
2450
|
|
|
2451
|
+
@layer optikos {
|
|
2452
|
+
:root {
|
|
2453
|
+
--op-timeentry-handle: 0.5rem;
|
|
2454
|
+
--op-timeentry-cursor: 0.125rem;
|
|
2455
|
+
--op-timeentry-grip: 0.125rem;
|
|
2456
|
+
}
|
|
2457
|
+
.op-timeline--entry .op-timeline__lane {
|
|
2458
|
+
cursor: crosshair;
|
|
2459
|
+
border-radius: var(--op-radius);
|
|
2460
|
+
}
|
|
2461
|
+
.op-timeline--entry .op-timeline__lane:focus-visible {
|
|
2462
|
+
outline: var(--op-focus-width) solid var(--op-color-focus);
|
|
2463
|
+
outline-offset: var(--op-focus-offset);
|
|
2464
|
+
}
|
|
2465
|
+
.op-timeline--entry .op-timeline__track {
|
|
2466
|
+
touch-action: pan-y;
|
|
2467
|
+
}
|
|
2468
|
+
.op-timeline--entry .op-timeline__bar {
|
|
2469
|
+
cursor: grab;
|
|
2470
|
+
touch-action: none;
|
|
2471
|
+
user-select: none;
|
|
2472
|
+
}
|
|
2473
|
+
.op-timeline--entry .op-timeline__bar.is-dragging {
|
|
2474
|
+
cursor: grabbing;
|
|
2475
|
+
z-index: 1;
|
|
2476
|
+
box-shadow: var(--op-shadow);
|
|
2477
|
+
}
|
|
2478
|
+
.op-timeline--entry .op-timeline__bar.is-locked {
|
|
2479
|
+
cursor: not-allowed;
|
|
2480
|
+
opacity: 0.6;
|
|
2481
|
+
}
|
|
2482
|
+
.op-timeline--entry .op-timeline__bar.is-invalid,
|
|
2483
|
+
.op-timeentry__ghost.is-invalid {
|
|
2484
|
+
--op-timeline-c: var(--op-color-danger);
|
|
2485
|
+
}
|
|
2486
|
+
.is-time-dragging {
|
|
2487
|
+
user-select: none;
|
|
2488
|
+
}
|
|
2489
|
+
.op-timeentry__handle {
|
|
2490
|
+
position: absolute;
|
|
2491
|
+
inset-block: 0;
|
|
2492
|
+
inline-size: var(--op-timeentry-handle);
|
|
2493
|
+
cursor: ew-resize;
|
|
2494
|
+
}
|
|
2495
|
+
.op-timeentry__handle--start { inset-inline-start: 0; }
|
|
2496
|
+
.op-timeentry__handle--end { inset-inline-end: 0; }
|
|
2497
|
+
.op-timeentry__handle::after {
|
|
2498
|
+
content: '';
|
|
2499
|
+
position: absolute;
|
|
2500
|
+
inset-block: 25%;
|
|
2501
|
+
inset-inline-start: 40%;
|
|
2502
|
+
inline-size: var(--op-timeentry-grip);
|
|
2503
|
+
border-radius: var(--op-timeentry-grip);
|
|
2504
|
+
background: currentColor;
|
|
2505
|
+
opacity: 0.6;
|
|
2506
|
+
}
|
|
2507
|
+
.op-timeentry__ghost {
|
|
2508
|
+
--op-timeline-c: var(--op-color-primary);
|
|
2509
|
+
position: absolute;
|
|
2510
|
+
inset-block: 0;
|
|
2511
|
+
border: var(--op-border-width) dashed var(--op-timeline-c);
|
|
2512
|
+
border-radius: var(--op-radius);
|
|
2513
|
+
background: color-mix(in srgb, var(--op-timeline-c) 25%, transparent);
|
|
2514
|
+
pointer-events: none;
|
|
2515
|
+
}
|
|
2516
|
+
.op-timeentry__cursor {
|
|
2517
|
+
position: absolute;
|
|
2518
|
+
inset-block: 0;
|
|
2519
|
+
inline-size: var(--op-timeentry-cursor);
|
|
2520
|
+
background: var(--op-color-focus);
|
|
2521
|
+
pointer-events: none;
|
|
2522
|
+
}
|
|
2523
|
+
.op-timeentry__lane.is-under .op-timeline__lane-name { color: var(--op-color-warning); }
|
|
2524
|
+
.op-timeentry__lane.is-met .op-timeline__lane-name { color: var(--op-color-success); }
|
|
2525
|
+
.op-timeentry__lane.is-over .op-timeline__lane-name { color: var(--op-color-danger); }
|
|
2526
|
+
.op-timeentry__grand {
|
|
2527
|
+
display: flex;
|
|
2528
|
+
justify-content: space-between;
|
|
2529
|
+
gap: var(--op-space-3);
|
|
2530
|
+
padding: var(--op-space-2);
|
|
2531
|
+
border-block-start: var(--op-border-width) solid var(--op-color-border-strong);
|
|
2532
|
+
font-size: var(--op-font-size-sm);
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
.op-timeline--vertical.op-timeline--entry .op-timeline__track {
|
|
2536
|
+
touch-action: auto;
|
|
2537
|
+
}
|
|
2538
|
+
.op-timeline--vertical .op-timeentry__handle {
|
|
2539
|
+
inset-block: auto;
|
|
2540
|
+
inset-inline: 0;
|
|
2541
|
+
inline-size: auto;
|
|
2542
|
+
block-size: var(--op-timeentry-handle);
|
|
2543
|
+
cursor: ns-resize;
|
|
2544
|
+
}
|
|
2545
|
+
.op-timeline--vertical .op-timeentry__handle--start { inset-block-start: 0; }
|
|
2546
|
+
.op-timeline--vertical .op-timeentry__handle--end { inset-block-end: 0; }
|
|
2547
|
+
.op-timeline--vertical .op-timeentry__handle::after {
|
|
2548
|
+
inset-block: 40% auto;
|
|
2549
|
+
inset-inline: 25%;
|
|
2550
|
+
inline-size: auto;
|
|
2551
|
+
block-size: var(--op-timeentry-grip);
|
|
2552
|
+
}
|
|
2553
|
+
.op-timeline--vertical .op-timeentry__ghost {
|
|
2554
|
+
inset-block: auto;
|
|
2555
|
+
inset-inline: 0;
|
|
2556
|
+
}
|
|
2557
|
+
.op-timeline--vertical .op-timeentry__cursor {
|
|
2558
|
+
inset-block: auto;
|
|
2559
|
+
inset-inline: 0;
|
|
2560
|
+
inline-size: auto;
|
|
2561
|
+
block-size: var(--op-timeentry-cursor);
|
|
2562
|
+
}
|
|
2563
|
+
.op-timeline--vertical .op-timeentry__grand {
|
|
2564
|
+
grid-column: 1 / -1;
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2365
2568
|
@layer optikos {
|
|
2366
2569
|
:root {
|
|
2367
2570
|
--op-timeline-marker: 0.875rem;
|
|
2368
2571
|
--op-timeline-when-width: 8rem;
|
|
2369
2572
|
--op-timeline-lane-width: 8rem;
|
|
2573
|
+
--op-timeline-axis-width: 4rem;
|
|
2574
|
+
--op-timeline-height: 32rem;
|
|
2370
2575
|
--op-timeline-bar-height: 1.75rem;
|
|
2371
2576
|
--op-timeline-line: 2px;
|
|
2372
2577
|
}
|
|
@@ -2501,6 +2706,49 @@
|
|
|
2501
2706
|
background: var(--op-color-danger);
|
|
2502
2707
|
pointer-events: none;
|
|
2503
2708
|
}
|
|
2709
|
+
|
|
2710
|
+
.op-timeline--vertical.op-timeline--range {
|
|
2711
|
+
display: grid;
|
|
2712
|
+
gap: var(--op-space-2);
|
|
2713
|
+
}
|
|
2714
|
+
.op-timeline--vertical .op-timeline__axis,
|
|
2715
|
+
.op-timeline--vertical .op-timeline__lane {
|
|
2716
|
+
display: flex;
|
|
2717
|
+
flex-direction: column;
|
|
2718
|
+
align-items: stretch;
|
|
2719
|
+
border-block-start: 0;
|
|
2720
|
+
border-inline-start: var(--op-border-width) solid var(--op-color-border);
|
|
2721
|
+
padding-block: 0;
|
|
2722
|
+
padding-inline: var(--op-space-1);
|
|
2723
|
+
min-inline-size: 0;
|
|
2724
|
+
}
|
|
2725
|
+
.op-timeline--vertical .op-timeline__axis {
|
|
2726
|
+
border-inline-start: 0;
|
|
2727
|
+
}
|
|
2728
|
+
.op-timeline--vertical .op-timeline__lane-name {
|
|
2729
|
+
text-align: center;
|
|
2730
|
+
padding-block-end: var(--op-space-1);
|
|
2731
|
+
}
|
|
2732
|
+
.op-timeline--vertical .op-timeline__track,
|
|
2733
|
+
.op-timeline--vertical .op-timeline__axis .op-timeline__track {
|
|
2734
|
+
block-size: var(--op-timeline-height);
|
|
2735
|
+
}
|
|
2736
|
+
.op-timeline--vertical .op-timeline__tick {
|
|
2737
|
+
inset-inline-start: 0;
|
|
2738
|
+
transform: translateY(-50%);
|
|
2739
|
+
}
|
|
2740
|
+
.op-timeline--vertical .op-timeline__bar {
|
|
2741
|
+
inset-block: auto;
|
|
2742
|
+
inset-inline: 0;
|
|
2743
|
+
align-items: flex-start;
|
|
2744
|
+
padding-block: var(--op-space-1);
|
|
2745
|
+
}
|
|
2746
|
+
.op-timeline--vertical .op-timeline__now {
|
|
2747
|
+
inset-block: auto;
|
|
2748
|
+
inset-inline: 0;
|
|
2749
|
+
inline-size: auto;
|
|
2750
|
+
block-size: var(--op-timeline-line);
|
|
2751
|
+
}
|
|
2504
2752
|
}
|
|
2505
2753
|
|
|
2506
2754
|
@layer optikos {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Grid, type GridConfig } from '../components/data/grid/grid.js';
|
|
2
|
+
import { Form, type FormConfig } from '../components/form/form/form.js';
|
|
3
|
+
import type { FilterField } from '../components/data/filterbuilder/filterbuilder.js';
|
|
4
|
+
import type { Column } from '../data/column.js';
|
|
5
|
+
import type { Component } from '../core/component.js';
|
|
6
|
+
export type FieldKind = 'text' | 'email' | 'area' | 'number' | 'money' | 'duration' | 'date' | 'datetime' | 'select' | 'bool';
|
|
7
|
+
type Cfg = Record<string, any>;
|
|
8
|
+
export interface FieldSpec {
|
|
9
|
+
/** The record's property. */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Default: the name as words (`unitPrice` → "Unit price"). */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** Default `text`. `duration` is a number of minutes, shown as `7h 30m`. */
|
|
14
|
+
type?: FieldKind;
|
|
15
|
+
/** For `select`. */
|
|
16
|
+
options?: Array<string | number | {
|
|
17
|
+
value: string | number;
|
|
18
|
+
label: string;
|
|
19
|
+
}>;
|
|
20
|
+
/** Picks the value in a lookup window: a LookupDef or the name given to `registerLookup`. */
|
|
21
|
+
lookup?: Cfg | string;
|
|
22
|
+
required?: boolean;
|
|
23
|
+
readonly?: boolean;
|
|
24
|
+
/** A band over the grid header and a section of the form. */
|
|
25
|
+
group?: string;
|
|
26
|
+
/** Total of the (filtered) rows in the grid: the starting total of the `columnTotals()` plugin. */
|
|
27
|
+
summary?: Column['summary'];
|
|
28
|
+
/** Grid column width in px. */
|
|
29
|
+
width?: number;
|
|
30
|
+
/** Leaves the field out of some of the builds. */
|
|
31
|
+
hide?: Array<'grid' | 'form' | 'filter'>;
|
|
32
|
+
/** Overrides for what each build makes. */
|
|
33
|
+
column?: Partial<Column>;
|
|
34
|
+
field?: Cfg;
|
|
35
|
+
filter?: Partial<FilterField>;
|
|
36
|
+
}
|
|
37
|
+
/** Grid columns: right-aligned numbers and money, formatted dates and booleans. */
|
|
38
|
+
export declare function buildColumns(specs: FieldSpec[]): Column[];
|
|
39
|
+
/** Form fields (instances), in order. */
|
|
40
|
+
export declare function buildFields(specs: FieldSpec[]): Component[];
|
|
41
|
+
/** Fields for a `FilterBuilder`; `bool` filters as a Yes/No choice. */
|
|
42
|
+
export declare function buildFilterFields(specs: FieldSpec[]): FilterField[];
|
|
43
|
+
/** A `Grid` whose columns come from the specs. `cfg` adds or overrides anything (`store`, `selection`, ...). */
|
|
44
|
+
export declare const buildGrid: (specs: FieldSpec[], cfg?: Partial<GridConfig>) => Grid<any>;
|
|
45
|
+
/** A `Form` with the fields in `columns` columns (default 2); specs with a `group` go in a `FieldSet` of that title. */
|
|
46
|
+
export declare function buildForm(specs: FieldSpec[], cfg?: FormConfig & {
|
|
47
|
+
columns?: number;
|
|
48
|
+
}): Form;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { buildColumns, buildFields, buildFilterFields, buildGrid, buildForm, type FieldSpec, type FieldKind } from './build.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../components/data/columntotals/columntotals.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Model } from '../../../data/model.js';
|
|
2
|
+
import type { GridPlugin } from '../grid/grid.js';
|
|
3
|
+
/** An operation offered in the column menu besides the built-in ones. */
|
|
4
|
+
export interface TotalOperation {
|
|
5
|
+
text: string;
|
|
6
|
+
/** The column's values and the records of every filtered row. */
|
|
7
|
+
run: (values: any[], recs: Model[]) => unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface ColumnTotalsOptions {
|
|
10
|
+
/** Your own operations (a median, a weighted mean...). Offered on every column. */
|
|
11
|
+
operations?: TotalOperation[];
|
|
12
|
+
/**
|
|
13
|
+
* Where the answer goes: `'bar'` (default) keeps it in a bar under the grid; `'modal'` answers in a dialog and `'toast'` in a
|
|
14
|
+
* notice, once, and nothing stays on the grid.
|
|
15
|
+
*/
|
|
16
|
+
show?: 'bar' | 'modal' | 'toast';
|
|
17
|
+
/** `bar` only: under the grid (default) or `'top'`, right under the header, above the rows (a row of the grid itself). */
|
|
18
|
+
position?: 'bottom' | 'top';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A button on every column header opens a menu of totals (sum, average, minimum, maximum, count, your own); the choice
|
|
22
|
+
* shows in a bar under the grid, over every filtered row. A column's `summary` is where it starts and where it is kept.
|
|
23
|
+
*/
|
|
24
|
+
export declare function columnTotals(options?: ColumnTotalsOptions): GridPlugin;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GridPlugin } from '../grid/grid.js';
|
|
2
|
+
export type ExportBarAction = 'csv' | 'xlsx' | 'page' | 'print';
|
|
3
|
+
export interface ExportBarOptions {
|
|
4
|
+
/** Each button: `false` leaves it out. `csv`, `xlsx` and `print` default to true; `page` (CSV of the page on screen) to true on a paged grid. */
|
|
5
|
+
csv?: boolean;
|
|
6
|
+
xlsx?: boolean;
|
|
7
|
+
page?: boolean;
|
|
8
|
+
print?: boolean;
|
|
9
|
+
/** File name without extension. Default `export`. */
|
|
10
|
+
filename?: string;
|
|
11
|
+
/** A heading above the printed table. */
|
|
12
|
+
title?: string;
|
|
13
|
+
/** Show the text beside the icons. Default false (icons with a tooltip). */
|
|
14
|
+
labels?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ExportBar extends GridPlugin {
|
|
17
|
+
setVisible(action: ExportBarAction, visible: boolean): void;
|
|
18
|
+
setDisabled(action: ExportBarAction, disabled: boolean): void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Export and print buttons inside the grid, in a row with the pager: `plugins: [exportBar({ print: false })]`. They run
|
|
22
|
+
* `exportGrid` and `printGrid`, which still work on their own from your own buttons.
|
|
23
|
+
*/
|
|
24
|
+
export declare function exportBar(options?: ExportBarOptions): ExportBar;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Grid } from './grid.js';
|
|
2
|
+
/**
|
|
3
|
+
* The row under a grid where the pager and the plugins' icon buttons sit side by side. Each plugin adds its own group;
|
|
4
|
+
* the last one out gives the pager back.
|
|
5
|
+
*/
|
|
6
|
+
export declare function addFooterGroup(grid: Grid, group: HTMLElement): () => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Model } from '../../../data/model.js';
|
|
2
|
+
import type { Grid } from '../grid/grid.js';
|
|
3
|
+
export type GroupingControl = 'expand' | 'collapse' | 'by';
|
|
4
|
+
/** A way to group, offered in the "Group by" menu: a record field or any function of the record. */
|
|
5
|
+
export interface GroupChoice {
|
|
6
|
+
text: string;
|
|
7
|
+
field?: string;
|
|
8
|
+
by?: (rec: Model) => unknown;
|
|
9
|
+
}
|
|
10
|
+
interface Target {
|
|
11
|
+
expandAll(): void;
|
|
12
|
+
collapseAll(): void;
|
|
13
|
+
setGroupBy(by: string | ((rec: Model) => unknown) | null): void;
|
|
14
|
+
}
|
|
15
|
+
/** Icon buttons in the grid's footer row (beside the pager): expand all, collapse all and a "Group by" menu. */
|
|
16
|
+
export declare function groupingControls(grid: Grid, target: Target, o: {
|
|
17
|
+
expand?: boolean;
|
|
18
|
+
collapse?: boolean;
|
|
19
|
+
by?: boolean;
|
|
20
|
+
choices: GroupChoice[];
|
|
21
|
+
current?: string;
|
|
22
|
+
}): {
|
|
23
|
+
set: (a: GroupingControl, visible: boolean) => void | undefined;
|
|
24
|
+
disable: (a: GroupingControl, disabled: boolean) => void | undefined;
|
|
25
|
+
destroy(): void;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Model } from '../../../data/model.js';
|
|
2
|
-
import
|
|
2
|
+
import { summarize } from '../../../data/column.js';
|
|
3
|
+
import { type GroupChoice, type GroupingControl } from './controls.js';
|
|
3
4
|
import type { GridPlugin } from '../grid/grid.js';
|
|
5
|
+
export { summarize };
|
|
6
|
+
export type { GroupChoice, GroupingControl };
|
|
4
7
|
export interface GroupingOptions {
|
|
5
8
|
/** Record field to group by. */
|
|
6
9
|
field?: string;
|
|
@@ -12,6 +15,14 @@ export interface GroupingOptions {
|
|
|
12
15
|
summary?: 'group' | 'grand' | 'both';
|
|
13
16
|
/** Start with every group closed. */
|
|
14
17
|
collapsed?: boolean;
|
|
18
|
+
/** Icon buttons inside the grid, beside the pager: expand all, collapse all and, with `choices`, a "Group by" menu. `false` leaves one out. */
|
|
19
|
+
controls?: boolean | {
|
|
20
|
+
expand?: boolean;
|
|
21
|
+
collapse?: boolean;
|
|
22
|
+
by?: boolean;
|
|
23
|
+
};
|
|
24
|
+
/** The ways to group offered by the controls' menu (a field or a function each). */
|
|
25
|
+
choices?: GroupChoice[];
|
|
15
26
|
}
|
|
16
27
|
export interface Grouping extends GridPlugin {
|
|
17
28
|
expandAll(): void;
|
|
@@ -20,9 +31,10 @@ export interface Grouping extends GridPlugin {
|
|
|
20
31
|
setGroupBy(by: string | ((rec: Model) => unknown) | null): void;
|
|
21
32
|
/** Opens or closes one group by its key. */
|
|
22
33
|
toggle(key: unknown, open?: boolean): void;
|
|
34
|
+
/** The in-grid controls: show or hide one. */
|
|
35
|
+
setControlVisible(control: GroupingControl, visible: boolean): void;
|
|
36
|
+
setControlDisabled(control: GroupingControl, disabled: boolean): void;
|
|
23
37
|
}
|
|
24
|
-
/** The value of a column's `summary` over some records. */
|
|
25
|
-
export declare function summarize(col: Column, recs: Model[]): unknown;
|
|
26
38
|
/**
|
|
27
39
|
* Groups the rows of the current page (a remote store groups what it loaded, not the whole set) under a header with
|
|
28
40
|
* its count; the header toggles by click, Enter/Space, → and ←. Sorting works inside each group. Group headers and total
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { TimelineItem, TimelinePlugin } from '../timeline/timeline.js';
|
|
2
|
+
export interface TimeEntryOptions {
|
|
3
|
+
/** Minutes everything snaps to. Default 15. */
|
|
4
|
+
step?: number;
|
|
5
|
+
/** Shortest entry, in minutes. Default `step`. */
|
|
6
|
+
minDuration?: number;
|
|
7
|
+
/** Length of an entry created with the keyboard, in minutes. Default 60. */
|
|
8
|
+
duration?: number;
|
|
9
|
+
/** `false` keeps two entries of one lane from overlapping: a drag stops at the neighbour, a move is refused. Default `true`. */
|
|
10
|
+
overlap?: boolean;
|
|
11
|
+
/** Let an entry change lane (drag up/down, ↑/↓). Default `false`. */
|
|
12
|
+
moveAcrossLanes?: boolean;
|
|
13
|
+
/** Minutes a lane should add up to: its total is `is-under`, `is-met` or `is-over` that. */
|
|
14
|
+
target?: number;
|
|
15
|
+
/** Return `false` to lock an entry (approved, invoiced): it cannot be moved, resized, edited or removed. */
|
|
16
|
+
editable?: (item: TimelineItem) => boolean;
|
|
17
|
+
/** Fields of a new entry besides `lane`, `start` and `end`. */
|
|
18
|
+
defaults?: Partial<TimelineItem>;
|
|
19
|
+
/**
|
|
20
|
+
* Opens your own dialog to fill a new entry (`'create'`, after the drag or Enter) or to edit one (`'edit'`, double click
|
|
21
|
+
* or Enter on a block). Resolve with the fields to set (`title`, `text`, ...), or with `false` to cancel.
|
|
22
|
+
*/
|
|
23
|
+
form?: (item: TimelineItem, mode: 'create' | 'edit') => Promise<Partial<TimelineItem> | false | void> | Partial<TimelineItem> | false | void;
|
|
24
|
+
}
|
|
25
|
+
/** A duration in minutes as people write it: `7h30`, `8h`, `45m`. */
|
|
26
|
+
export declare function formatDuration(minutes: number): string;
|
|
27
|
+
/**
|
|
28
|
+
* Creates, moves, resizes and removes entries on a `range` Timeline: drag an empty lane to create, drag a block to move,
|
|
29
|
+
* its ends to resize; the same with the keyboard (see the ficha). Snaps to `step`, keeps to `from`/`to`, can forbid
|
|
30
|
+
* overlap and lock entries. Shows each lane's total (and a grand total) against `target`.
|
|
31
|
+
*
|
|
32
|
+
* Events on the timeline: `before-create({ lane, start, end })` → `create(item)`, `before-change(item, next, old)` →
|
|
33
|
+
* `change(item, next, old)`, `before-remove(item)` → `remove(item)`, `edit(item)` (double click, Enter). With a `store`
|
|
34
|
+
* the records are updated here (the app saves); without, the `items` are.
|
|
35
|
+
* Touch: a block drags at once; an empty lane needs a long press (about half a second) so a swipe still scrolls.
|
|
36
|
+
*/
|
|
37
|
+
export declare function timeEntry(options?: TimeEntryOptions): TimelinePlugin;
|
|
@@ -27,6 +27,8 @@ export interface TimelineConfig extends ComponentConfig {
|
|
|
27
27
|
to?: string;
|
|
28
28
|
/** `range`: a marker at the current time. Default true. */
|
|
29
29
|
now?: boolean;
|
|
30
|
+
/** `range`: `horizontal` (time runs left to right, one row per lane, default) or `vertical` (time runs top to bottom, one column per lane). */
|
|
31
|
+
direction?: 'horizontal' | 'vertical';
|
|
30
32
|
/** Optional features (`timeEntry()`...). See `TimelinePlugin`. */
|
|
31
33
|
plugins?: TimelinePlugin[];
|
|
32
34
|
}
|
|
@@ -39,6 +41,7 @@ export interface TimelineScale {
|
|
|
39
41
|
lo: number;
|
|
40
42
|
hi: number;
|
|
41
43
|
clock: boolean;
|
|
44
|
+
vertical: boolean;
|
|
42
45
|
parse(v: string): number;
|
|
43
46
|
format(ms: number): string;
|
|
44
47
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../components/data/exportbar/exportbar.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../components/data/timeentry/timeentry.js';
|
|
@@ -20,13 +20,13 @@ export interface Column<T extends Record<string, any> = any> {
|
|
|
20
20
|
hidden?: boolean;
|
|
21
21
|
/** Pinned to the start or the end while the body scrolls sideways (give it a `width`; default 140). The columns of one edge stay together. */
|
|
22
22
|
locked?: 'start' | 'end';
|
|
23
|
-
/** With
|
|
23
|
+
/** With `grouping()` or `columnTotals()`: what the total shows. Numbers: `sum`, `avg`, `min`, `max`, `count`; dates: `min` (earliest), `max` (latest), `count`; or your own function of the values. */
|
|
24
24
|
summary?: 'sum' | 'avg' | 'min' | 'max' | 'count' | ((values: any[], recs: Model<T>[]) => unknown);
|
|
25
25
|
/** Text for the total of this column (default: the column's `format`, else the plain value). */
|
|
26
26
|
summaryRenderer?: (value: any, col: Column<T>) => string | Node;
|
|
27
27
|
/** Left out while `setPermissionResolver` denies it. */
|
|
28
28
|
permission?: string;
|
|
29
|
-
/** Name registered with `registerFormat` (`money`, `date`, `number`, `percent`, `bool`) or a function. */
|
|
29
|
+
/** Name registered with `registerFormat` (`money`, `date`, `number`, `percent`, `bool`, `duration`: minutes as `7h 30m`) or a function. */
|
|
30
30
|
format?: string | Formatter;
|
|
31
31
|
/** Full control over the cell content. Text is escaped; return a Node for markup. */
|
|
32
32
|
renderer?: (value: any, rec: Model<T>, col: Column<T>) => string | Node;
|
|
@@ -38,3 +38,5 @@ export interface Column<T extends Record<string, any> = any> {
|
|
|
38
38
|
}
|
|
39
39
|
/** Cell content for a record: `renderer` first, then `format`, then the plain value. */
|
|
40
40
|
export declare function cellContent<T extends Record<string, any>>(col: Column<T>, rec: Model<T>): string | Node;
|
|
41
|
+
/** The value of a column's `summary` over some records. */
|
|
42
|
+
export declare function summarize(col: Column, recs: Model[]): unknown;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './data/index.js';
|
|
|
3
3
|
export * from './themes/index.js';
|
|
4
4
|
export * from './motion/index.js';
|
|
5
5
|
export * from './ui/index.js';
|
|
6
|
+
export * from './build/index.js';
|
|
6
7
|
export * from './components/base/avatar/avatar.js';
|
|
7
8
|
export * from './components/base/badge/badge.js';
|
|
8
9
|
export * from './components/base/button/button.js';
|
|
@@ -16,7 +17,9 @@ export * from './components/charts/chart/chart.js';
|
|
|
16
17
|
export * from './components/charts/stat/stat.js';
|
|
17
18
|
export * from './components/chat/chat/chat.js';
|
|
18
19
|
export * from './components/data/cellediting/cellediting.js';
|
|
20
|
+
export * from './components/data/columntotals/columntotals.js';
|
|
19
21
|
export * from './components/data/dataview/dataview.js';
|
|
22
|
+
export * from './components/data/exportbar/exportbar.js';
|
|
20
23
|
export * from './components/data/filterbuilder/filterbuilder.js';
|
|
21
24
|
export * from './components/data/grid/grid.js';
|
|
22
25
|
export * from './components/data/gridexport/gridexport.js';
|
|
@@ -26,6 +29,7 @@ export * from './components/data/pagination/pagination.js';
|
|
|
26
29
|
export * from './components/data/rowediting/rowediting.js';
|
|
27
30
|
export * from './components/data/searchgrid/searchgrid.js';
|
|
28
31
|
export * from './components/data/table/table.js';
|
|
32
|
+
export * from './components/data/timeentry/timeentry.js';
|
|
29
33
|
export * from './components/data/timeline/timeline.js';
|
|
30
34
|
export * from './components/data/tree/tree.js';
|
|
31
35
|
export * from './components/data/treegrid/treegrid.js';
|
package/dist/ui.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j
|
|
1
|
+
import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k}from"./chunk-LLHDEUIA.js";import{a}from"./chunk-UCWICDYG.js";import"./chunk-OADWLPSF.js";import"./chunk-ADHKL2GM.js";import"./chunk-2I7HDIOU.js";import"./chunk-SEUIIPHS.js";import"./chunk-BRGT4O6Q.js";import"./chunk-3OA3P37P.js";import"./chunk-QOSTS5I3.js";import"./chunk-TVO3Z2BM.js";import"./chunk-G26R2F3W.js";import"./chunk-6TZJO2G2.js";import"./chunk-S3ILIWSW.js";import"./chunk-BTGJ3MP4.js";import"./chunk-AJN66F32.js";import"./chunk-L6DOWGBO.js";import"./chunk-H25XXQVH.js";import"./chunk-5GCTM37D.js";import"./chunk-NAUSRVB6.js";import"./chunk-EO777UIN.js";import"./chunk-FSR6BDVO.js";import"./chunk-J5BZAKC6.js";import"./chunk-T5OGUCY2.js";import"./chunk-OB3VIRQR.js";import"./chunk-GEJKFE4X.js";import"./chunk-LXWCTCZV.js";import"./chunk-JBOKM5YA.js";import"./chunk-Z6HZY2YG.js";import"./chunk-U25QSLAH.js";import"./chunk-HRW25TMU.js";import"./chunk-3F4MN2BU.js";import"./chunk-SEW5OCQF.js";import"./chunk-LHWY6G6Q.js";import"./chunk-MQEALOU3.js";import"./chunk-6NP4AEV4.js";import"./chunk-AQ3RTHG5.js";import"./chunk-BCVOUMJJ.js";import"./chunk-ESRS5ZQV.js";import"./chunk-DIOJGTUN.js";import"./chunk-2GKIF7A6.js";import"./chunk-OWEQT2HN.js";import"./chunk-BQEFLPDA.js";import"./chunk-QVBDBGS4.js";import"./chunk-E4VNLYO2.js";import"./chunk-676AKAGF.js";import"./chunk-VV7CFMPZ.js";import"./chunk-TIPK3SCJ.js";import"./chunk-UDXO3KM3.js";import"./chunk-PZSHOSOS.js";import"./chunk-IODSL7KU.js";import"./chunk-XFDNXSU5.js";import"./chunk-L5SQQFO7.js";import"./chunk-3VDLX7ET.js";import"./chunk-S4QD5NID.js";import"./chunk-6NCXO5ZP.js";import"./chunk-4AA4FQEM.js";import"./chunk-2UPUC4RK.js";import"./chunk-V5G5JECN.js";import"./chunk-4C666HHU.js";export{d as Direction,c as LabelPos,g as LayoutKind,j as Op,e as Region,h as Selection,f as Side,k as ThemeName,i as ToastType,b as Variant,a as ui};
|
|
2
2
|
//# sourceMappingURL=ui.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "optikos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Declarative UI components in plain TypeScript: forms, grids, windows and themes. No runtime dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -51,6 +51,10 @@
|
|
|
51
51
|
"types": "./dist/types/ui/index.d.ts",
|
|
52
52
|
"import": "./dist/ui.js"
|
|
53
53
|
},
|
|
54
|
+
"./build": {
|
|
55
|
+
"types": "./dist/types/build/index.d.ts",
|
|
56
|
+
"import": "./dist/build.js"
|
|
57
|
+
},
|
|
54
58
|
"./testing": {
|
|
55
59
|
"types": "./dist/types/testing/index.d.ts",
|
|
56
60
|
"import": "./dist/testing.js"
|
package/dist/chunk-2HNQ2XRY.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/data/column.ts"],
|
|
4
|
-
"sourcesContent": ["import { format, type Formatter } from './format';\nimport type { Model } from './model';\n\n/** A grid/table column. `T` is the record shape: `field` then autocompletes its keys (any string still works). */\nexport interface Column<T extends Record<string, any> = any> {\n field: Extract<keyof T, string> | (string & {});\n header?: string;\n /** Fixed width in px. */\n width?: number;\n /** Share of the free space (like CSS `fr`). Default 1 when there is no `width`. */\n flex?: number;\n /** A label that groups columns (\"Identification\", \"Values\"...): a band over the header and sections in the column menu. */\n group?: string;\n minWidth?: number;\n /** Upper bound when the user resizes it. */\n maxWidth?: number;\n /** `false` keeps a column's width fixed even when the grid has `resizableColumns`. */\n resizable?: boolean;\n align?: 'left' | 'center' | 'right';\n sortable?: boolean;\n hidden?: boolean;\n /** Pinned to the start or the end while the body scrolls sideways (give it a `width`; default 140). The columns of one edge stay together. */\n locked?: 'start' | 'end';\n /** With the `grouping()` plugin: what the total row shows for this column. */\n summary?: 'sum' | 'avg' | 'min' | 'max' | 'count' | ((values: any[], recs: Model<T>[]) => unknown);\n /** Text for the total of this column (default: the column's `format`, else the plain value). */\n summaryRenderer?: (value: any, col: Column<T>) => string | Node;\n /** Left out while `setPermissionResolver` denies it. */\n permission?: string;\n /** Name registered with `registerFormat` (`money`, `date`, `number`, `percent`, `bool`) or a function. */\n format?: string | Formatter;\n /** Full control over the cell content. Text is escaped; return a Node for markup. */\n renderer?: (value: any, rec: Model<T>, col: Column<T>) => string | Node;\n cls?: string;\n /** With the `cellEditing()` grid plugin: `true` (an editor for the value's type), a field type (`'select'`) or a field config. */\n editor?: boolean | string | Record<string, any>;\n /** With `cellEditing()`: whether this record's cell can be edited (default: every record, when `editor` is set). */\n editable?: (rec: Model<T>) => boolean;\n}\n\n/** Cell content for a record: `renderer` first, then `format`, then the plain value. */\nexport function cellContent<T extends Record<string, any>>(col: Column<T>, rec: Model<T>): string | Node {\n const v = rec.data[col.field];\n if (col.renderer) return col.renderer(v, rec, col);\n if (col.format) return format(col.format, v);\n return v == null ? '' : String(v);\n}\n"],
|
|
5
|
-
"mappings": "wCAyCO,SAASA,EAA2CC,EAAgBC,EAA8B,CACvG,IAAMC,EAAID,EAAI,KAAKD,EAAI,KAAK,EAC5B,OAAIA,EAAI,SAAiBA,EAAI,SAASE,EAAGD,EAAKD,CAAG,EAC7CA,EAAI,OAAeG,EAAOH,EAAI,OAAQE,CAAC,EACpCA,GAAK,KAAO,GAAK,OAAOA,CAAC,CAClC",
|
|
6
|
-
"names": ["cellContent", "col", "rec", "v", "format"]
|
|
7
|
-
}
|
package/dist/chunk-BJWREA76.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as T}from"./chunk-DIOJGTUN.js";import{b as S}from"./chunk-XQHATUKN.js";import{b as h}from"./chunk-PZSHOSOS.js";import{e as _,f as b}from"./chunk-S4QD5NID.js";_("en",{groupTotal:"Total",groupCount:"{n}",groupToggle:"Toggle group"});_("pt-BR",{groupTotal:"Total",groupCount:"{n}",groupToggle:"Alternar grupo"});var A=a=>typeof a=="number"?a:Number(a);function G(a,s){let p=s.map(r=>r.data[a.field]),l=p.filter(r=>r!=null&&r!==""&&!isNaN(A(r))).map(A),g=a.summary;return typeof g=="function"?g(p,s):g==="count"?p.filter(r=>r!=null&&r!=="").length:l.length?g==="sum"?l.reduce((r,y)=>r+y,0):g==="avg"?l.reduce((r,y)=>r+y,0)/l.length:g==="min"?Math.min(...l):Math.max(...l):null}function O(a={}){let s,p=a.by??(a.field?e=>e.data[a.field]:void 0),l=new Set,g=!!a.collapsed,r=[],y=[],M=a.summary??"group",v=e=>e.filter(o=>!o.classList.contains("op-grid__selcell")&&!o.classList.contains("op-grid__actcell"));function L(e,o,u){return{cls:`op-grid__row--total ${u}`,paint(d,f){f.setAttribute("aria-label",e);let t=s.getColumns();v(d).forEach((n,c)=>{let i=t[c];if(!i)return;let E=i.summary?(m=>i.summaryRenderer?i.summaryRenderer(m,i):m==null?"":i.format?S(i.format,m):String(m))(G(i,o)):c===0?e:"";n.replaceChildren(E),n.classList.toggle("op-grid__cell--right",i.align==="right")})}}}function w(){let o=s.getStore().getRange();if(!p)return s.setRowLayout(void 0);let u=new Map;for(let t of o){let n=p(t);u.set(n,[...u.get(n)??[],t])}if(r=[...u.keys()],g){for(let t of r)l.add(String(t));g=!1}let d=[],f=s.getColumns().some(t=>t.summary);for(let[t,n]of u){let c=!l.has(String(t));if(d.push({level:1,expanded:c,cls:"op-grid__row--group",paint(i,E){let[m]=v(i);m.classList.add("is-group-label"),m.replaceChildren(h("span","op-grid__twist",{"aria-hidden":"true"},T("chevron-down")),h("span","op-grid__group-name",{},a.label?a.label(t,n):String(t??"\u2014")),h("span","op-grid__group-count",{},b("groupCount",{n:n.length}))),E.dataset.group=String(t)}}),!!c){for(let i of n)d.push({rec:i,level:2,cls:"is-grouped"});f&&M!=="grand"&&d.push(L(b("groupTotal"),n,"is-group-total"))}}f&&M!=="group"&&d.push(L(b("groupTotal"),o,"is-grand-total")),s.setRowLayout(d)}function k(e,o){let u=String(e),d=o??l.has(u);d!==!l.has(u)&&(d?l.delete(u):l.add(u),w(),s.emit("group-toggle",e,d))}let R=e=>{let o=e?.closest(".op-grid__row--group");return o?r.find(u=>String(u)===o.dataset.group):void 0};return{init(e){s=e;let o=e.el,u=o.querySelector("[role=grid]"),d=t=>{let n=R(t.target);(n!==void 0||t.target.closest(".op-grid__row--group"))&&k(n)},f=t=>{if(t.target!==u)return;let n=s.getRowEntry(s.getActive());if(!n||n.rec||n.level!==1)return;let c=R(document.getElementById(`${s.id}-r${s.getActive()}`)),i=n.expanded;if(t.key==="Enter"||t.key===" ")k(c);else if(t.key==="ArrowRight"&&!i)k(c,!0);else if(t.key==="ArrowLeft"&&i)k(c,!1);else return;t.preventDefault(),t.stopPropagation()};return o.addEventListener("click",d),o.addEventListener("keydown",f,!0),y=[C(e),()=>o.removeEventListener("click",d),()=>o.removeEventListener("keydown",f,!0),()=>s.setRowLayout(void 0)],w(),()=>y.forEach(t=>t())},expandAll(){l.clear(),w()},collapseAll(){for(let e of r)l.add(String(e));w()},toggle:k,setGroupBy(e){p=e===null?void 0:typeof e=="string"?o=>o.data[e]:e,l.clear(),w()}};function C(e){return e.getStore().subscribe(o=>queueMicrotask(()=>!e.destroyed&&w()))}}export{G as a,O as b};
|
|
2
|
-
//# sourceMappingURL=chunk-BJWREA76.js.map
|