@xiee/utils 1.14.109 → 1.14.111
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/css/lt-interactive.css +36 -53
- package/css/lt-interactive.min.css.map +1 -1
- package/css/lt-plot.css +13 -13
- package/css/lt-plot.min.css.map +1 -1
- package/js/lt-input.js +65 -0
- package/js/lt-input.min.js +2 -0
- package/js/lt-input.min.js.map +1 -0
- package/js/lt-interactive.js +320 -463
- package/js/lt-interactive.min.js +1 -1
- package/js/lt-interactive.min.js.map +1 -1
- package/js/lt-plot.js +103 -110
- package/js/lt-plot.min.js.map +1 -1
- package/js/lt.js +150 -165
- package/js/lt.min.js +1 -1
- package/js/lt.min.js.map +1 -1
- package/package.json +1 -1
package/css/lt-interactive.css
CHANGED
|
@@ -1,38 +1,32 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* clashing with core `lt-*`. Only properties that change a default are
|
|
4
|
-
* declared. */
|
|
1
|
+
/* Controls for lt-interactive.js. `lti-*` classes avoid clashing with core
|
|
2
|
+
* `lt-*`. Declare only properties that change a default. */
|
|
5
3
|
|
|
6
4
|
.lt-table {
|
|
7
|
-
/*
|
|
8
|
-
* up with its edges rather than the cell text */
|
|
5
|
+
/* full-width rows: align with table edges, not cell text */
|
|
9
6
|
:is(.lti-head, .lti-pager-row) td {
|
|
10
7
|
padding-left: 0;
|
|
11
8
|
padding-right: 0;
|
|
12
9
|
}
|
|
13
10
|
|
|
14
|
-
/*
|
|
15
|
-
*
|
|
16
|
-
* to search" in no language — and steps aside once the box has the focus. */
|
|
11
|
+
/* Box fills its cell. Faded magnifier replaces a (translatable) placeholder;
|
|
12
|
+
* hidden on focus. */
|
|
17
13
|
.lti-search {
|
|
18
14
|
width: 100%;
|
|
19
15
|
padding: .5em 0 .5em 1.6em;
|
|
20
16
|
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="gray" stroke-width="2"><circle cx="6.5" cy="6.5" r="4.5"/><path d="M10 10l5 5"/></svg>') 0.4em center / 1em no-repeat;
|
|
21
|
-
/* on focus
|
|
22
|
-
* sits just inside the edge rather than behind the icon's wider gutter */
|
|
17
|
+
/* no icon on focus: smaller left pad so caret sits near the edge */
|
|
23
18
|
&:focus {
|
|
24
19
|
padding-left: .5em;
|
|
25
20
|
background-image: none;
|
|
26
21
|
}
|
|
27
22
|
}
|
|
28
23
|
|
|
29
|
-
/*
|
|
30
|
-
* stays separate), so the pointer cursor belongs on the label too */
|
|
24
|
+
/* click target is the label, not the cell (keeps resize grip separate) */
|
|
31
25
|
.lti-sortable .lti-label {
|
|
32
26
|
cursor: pointer;
|
|
33
27
|
user-select: none;
|
|
34
28
|
}
|
|
35
|
-
/*
|
|
29
|
+
/* ▲/▼ indicator */
|
|
36
30
|
.lti-sort {
|
|
37
31
|
margin-left: 0.3em;
|
|
38
32
|
font-size: 0.8em;
|
|
@@ -42,8 +36,7 @@
|
|
|
42
36
|
text-align: center;
|
|
43
37
|
}
|
|
44
38
|
|
|
45
|
-
/*
|
|
46
|
-
* glyph (▸ / ▾), so it needs no borders or background of its own */
|
|
39
|
+
/* expand caret: glyph is its own (▸ / ▾), so strip button chrome */
|
|
47
40
|
.lti-expand {
|
|
48
41
|
border: none;
|
|
49
42
|
background: none;
|
|
@@ -51,13 +44,12 @@
|
|
|
51
44
|
margin-right: 0.4em;
|
|
52
45
|
cursor: pointer;
|
|
53
46
|
}
|
|
54
|
-
/*
|
|
55
|
-
* row above it */
|
|
47
|
+
/* inset ties the detail to the row above */
|
|
56
48
|
.lti-detail > td {
|
|
57
49
|
padding-left: 1.5em;
|
|
58
50
|
}
|
|
59
51
|
|
|
60
|
-
/*
|
|
52
|
+
/* drag grip on a column's right edge */
|
|
61
53
|
th:has(.lti-resizer) {
|
|
62
54
|
position: relative;
|
|
63
55
|
}
|
|
@@ -75,54 +67,49 @@
|
|
|
75
67
|
opacity: 0.3;
|
|
76
68
|
}
|
|
77
69
|
}
|
|
78
|
-
/*
|
|
79
|
-
* and the drag selects no text */
|
|
70
|
+
/* keep resize cursor and block text selection during drag */
|
|
80
71
|
&.lti-resizing {
|
|
81
72
|
cursor: col-resize;
|
|
82
73
|
user-select: none;
|
|
83
74
|
}
|
|
84
|
-
/*
|
|
75
|
+
/* frozen widths are authoritative: a drag moves one edge only */
|
|
85
76
|
&.lti-fixed {
|
|
86
77
|
table-layout: fixed;
|
|
87
|
-
/* a shrunk column
|
|
88
|
-
*
|
|
89
|
-
* the detail row (full width, possibly tall) and the popover-bearing
|
|
90
|
-
* filter/bar cells (<td>) are left to overflow */
|
|
78
|
+
/* clip a shrunk column so the grip can shrink it freely; detail row and
|
|
79
|
+
* popover-bearing filter/bar cells (<td>) must overflow */
|
|
91
80
|
thead th, tbody tr:not(.lti-detail) td {
|
|
92
81
|
overflow: hidden;
|
|
93
82
|
}
|
|
94
83
|
}
|
|
95
84
|
|
|
96
|
-
/*
|
|
97
|
-
*
|
|
98
|
-
* lands in it (pushing it to the right edge); the icons and chips keep their
|
|
99
|
-
* natural width. The search still fills the bar when it is the only control. */
|
|
85
|
+
/* control bar: icons, chips, search. Only search grows, taking free space
|
|
86
|
+
* (right-aligned); it fills the bar when alone. */
|
|
100
87
|
.lti-bar {
|
|
101
88
|
display: flex;
|
|
102
89
|
align-items: center;
|
|
103
|
-
/*
|
|
90
|
+
/* wide gap between parts ... */
|
|
104
91
|
gap: 1.2em;
|
|
105
92
|
.lti-icons, .lti-chips {
|
|
106
93
|
flex: 0 0 auto;
|
|
107
94
|
display: flex;
|
|
108
95
|
align-items: center;
|
|
109
|
-
/* ...
|
|
96
|
+
/* ... tight within a part */
|
|
110
97
|
gap: 0.3em;
|
|
111
98
|
}
|
|
112
99
|
.lti-chips {
|
|
113
100
|
gap: 0.5em;
|
|
114
|
-
/* always present as a drop target for
|
|
115
|
-
|
|
101
|
+
/* always present as a drop target for caller chips (el._lt.chips);
|
|
102
|
+
collapse when empty to avoid a stray gap */
|
|
116
103
|
&:empty { display: none; }
|
|
117
104
|
}
|
|
118
|
-
/* direct child only:
|
|
105
|
+
/* direct child only: chip popovers hold their own `.lti-search` */
|
|
119
106
|
& > .lti-search {
|
|
120
107
|
flex: 1 1 8em;
|
|
121
108
|
min-width: 6em;
|
|
122
109
|
}
|
|
123
110
|
}
|
|
124
111
|
|
|
125
|
-
/* shared
|
|
112
|
+
/* shared size of eye and download buttons */
|
|
126
113
|
.lti-cols button, .lti-download {
|
|
127
114
|
border: none;
|
|
128
115
|
padding: 0;
|
|
@@ -130,7 +117,7 @@
|
|
|
130
117
|
height: 1.2em;
|
|
131
118
|
}
|
|
132
119
|
|
|
133
|
-
/*
|
|
120
|
+
/* column-visibility menu: eye button + checklist popup */
|
|
134
121
|
.lti-cols {
|
|
135
122
|
position: relative;
|
|
136
123
|
button {
|
|
@@ -149,7 +136,7 @@
|
|
|
149
136
|
white-space: nowrap;
|
|
150
137
|
cursor: pointer;
|
|
151
138
|
}
|
|
152
|
-
/*
|
|
139
|
+
/* spanner label above its indented columns */
|
|
153
140
|
.lti-group {
|
|
154
141
|
font-weight: 600;
|
|
155
142
|
white-space: nowrap;
|
|
@@ -158,22 +145,20 @@
|
|
|
158
145
|
}
|
|
159
146
|
}
|
|
160
147
|
|
|
161
|
-
/*
|
|
148
|
+
/* CSV download icon button */
|
|
162
149
|
.lti-download {
|
|
163
150
|
background: center / contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="gray" stroke-width="1.5"><path d="M8 1v9m0 0L4.5 6.5M8 10l3.5-3.5"/><path d="M2 11v3h12v-3"/></svg>');
|
|
164
151
|
}
|
|
165
152
|
|
|
166
|
-
/* typed filter
|
|
167
|
-
* a summary of the current filter, and a funnel popping up the widget + box */
|
|
153
|
+
/* typed filter chip: label, filter summary, funnel opening widget + box */
|
|
168
154
|
.lti-chip {
|
|
169
|
-
/*
|
|
170
|
-
* positioned against, so the panel opens flush with the chip's left edge */
|
|
155
|
+
/* whole chip is the click target and panel anchor (panel flush with chip) */
|
|
171
156
|
position: relative;
|
|
172
157
|
cursor: pointer;
|
|
173
158
|
display: inline-flex;
|
|
174
159
|
align-items: center;
|
|
175
160
|
gap: 0.3em;
|
|
176
|
-
/*
|
|
161
|
+
/* pill look separates chips */
|
|
177
162
|
padding: 0.05em 0.5em;
|
|
178
163
|
border: 1px solid #ccc;
|
|
179
164
|
border-radius: 4px;
|
|
@@ -186,7 +171,7 @@
|
|
|
186
171
|
color: #555;
|
|
187
172
|
font-variant-numeric: tabular-nums;
|
|
188
173
|
}
|
|
189
|
-
/*
|
|
174
|
+
/* panel positions against the chip, not the funnel wrap */
|
|
190
175
|
.lti-pop { position: static; }
|
|
191
176
|
}
|
|
192
177
|
.lti-pop {
|
|
@@ -199,8 +184,7 @@
|
|
|
199
184
|
opacity: 0.55;
|
|
200
185
|
background: center / contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="gray"><path d="M1 2h14l-5.5 6.5V14l-3 1V8.5z"/></svg>');
|
|
201
186
|
}
|
|
202
|
-
/*
|
|
203
|
-
* column has a live term */
|
|
187
|
+
/* active when the column has a live term */
|
|
204
188
|
&.lti-on .lti-funnel {
|
|
205
189
|
opacity: 1;
|
|
206
190
|
}
|
|
@@ -219,7 +203,7 @@
|
|
|
219
203
|
border: 1px solid;
|
|
220
204
|
.lti-widget { display: contents; }
|
|
221
205
|
&[hidden], [hidden] { display: none; }
|
|
222
|
-
/*
|
|
206
|
+
/* checklist row: checkbox + label */
|
|
223
207
|
.lti-check {
|
|
224
208
|
display: flex;
|
|
225
209
|
align-items: center;
|
|
@@ -230,7 +214,7 @@
|
|
|
230
214
|
}
|
|
231
215
|
}
|
|
232
216
|
|
|
233
|
-
/*
|
|
217
|
+
/* range slider: track, fill band, two button thumbs */
|
|
234
218
|
.lti-slider {
|
|
235
219
|
position: relative;
|
|
236
220
|
height: 1.2em;
|
|
@@ -280,16 +264,15 @@
|
|
|
280
264
|
font: inherit;
|
|
281
265
|
cursor: pointer;
|
|
282
266
|
}
|
|
283
|
-
/*
|
|
267
|
+
/* row count away from arrows; page size pushed to far end */
|
|
284
268
|
.lti-pos {
|
|
285
269
|
margin: 0 auto 0 0.3em;
|
|
286
270
|
}
|
|
287
271
|
}
|
|
288
272
|
|
|
289
|
-
/* Busy state during a
|
|
290
|
-
* lt-interactive.js): wait cursor over the whole table and a dimmed body. */
|
|
273
|
+
/* Busy state during a page-freezing recompute (see lt-interactive.js). */
|
|
291
274
|
.lti-busy {
|
|
292
|
-
/*
|
|
275
|
+
/* beat controls' own cursors */
|
|
293
276
|
&, & * {
|
|
294
277
|
cursor: wait !important;
|
|
295
278
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"
|
|
1
|
+
{"version":3,"mappings":"AAGA,UAEE,kEAOA,oSAKE,iDAOF,2DAKA,4CAKA,kCAKA,oFAQA,oCAKA,yCAGA,0HASE,4CAMF,kDAKA,+BAIE,2DAOF,qDAKE,6EAOA,sBAIE,sBAGF,sCAOF,kFAQA,8BAEE,wSAGA,6GAQE,wDAMA,gDAIA,8BAKJ,6QAKA,2KAYE,2BAEE,kCAEF,6DAKA,4BAEF,6BAEE,oQASA,+BAGA,uLAaE,+BACA,kCAEA,0FAWJ,8DAIE,kIASA,0GAOA,6NAeF,sEAKA,sDAKA,8CAKA,iCAMF,UAEE,4BAGA","sources":["lt-interactive.css"],"sourcesContent":["/* Controls for lt-interactive.js. `lti-*` classes avoid clashing with core\n * `lt-*`. Declare only properties that change a default. */\n\n.lt-table {\n /* full-width rows: align with table edges, not cell text */\n :is(.lti-head, .lti-pager-row) td {\n padding-left: 0;\n padding-right: 0;\n }\n\n /* Box fills its cell. Faded magnifier replaces a (translatable) placeholder;\n * hidden on focus. */\n .lti-search {\n width: 100%;\n padding: .5em 0 .5em 1.6em;\n background: url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"2\"><circle cx=\"6.5\" cy=\"6.5\" r=\"4.5\"/><path d=\"M10 10l5 5\"/></svg>') 0.4em center / 1em no-repeat;\n /* no icon on focus: smaller left pad so caret sits near the edge */\n &:focus {\n padding-left: .5em;\n background-image: none;\n }\n }\n\n /* click target is the label, not the cell (keeps resize grip separate) */\n .lti-sortable .lti-label {\n cursor: pointer;\n user-select: none;\n }\n /* ▲/▼ indicator */\n .lti-sort {\n margin-left: 0.3em;\n font-size: 0.8em;\n }\n\n .lti-empty td {\n text-align: center;\n }\n\n /* expand caret: glyph is its own (▸ / ▾), so strip button chrome */\n .lti-expand {\n border: none;\n background: none;\n padding: 0;\n margin-right: 0.4em;\n cursor: pointer;\n }\n /* inset ties the detail to the row above */\n .lti-detail > td {\n padding-left: 1.5em;\n }\n\n /* drag grip on a column's right edge */\n th:has(.lti-resizer) {\n position: relative;\n }\n .lti-resizer {\n position: absolute;\n top: 0;\n right: 0;\n width: 5px;\n height: 100%;\n cursor: col-resize;\n user-select: none;\n touch-action: none;\n &:hover {\n background: currentColor;\n opacity: 0.3;\n }\n }\n /* keep resize cursor and block text selection during drag */\n &.lti-resizing {\n cursor: col-resize;\n user-select: none;\n }\n /* frozen widths are authoritative: a drag moves one edge only */\n &.lti-fixed {\n table-layout: fixed;\n /* clip a shrunk column so the grip can shrink it freely; detail row and\n * popover-bearing filter/bar cells (<td>) must overflow */\n thead th, tbody tr:not(.lti-detail) td {\n overflow: hidden;\n }\n }\n\n /* control bar: icons, chips, search. Only search grows, taking free space\n * (right-aligned); it fills the bar when alone. */\n .lti-bar {\n display: flex;\n align-items: center;\n /* wide gap between parts ... */\n gap: 1.2em;\n .lti-icons, .lti-chips {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n /* ... tight within a part */\n gap: 0.3em;\n }\n .lti-chips {\n gap: 0.5em;\n /* always present as a drop target for caller chips (el._lt.chips);\n collapse when empty to avoid a stray gap */\n &:empty { display: none; }\n }\n /* direct child only: chip popovers hold their own `.lti-search` */\n & > .lti-search {\n flex: 1 1 8em;\n min-width: 6em;\n }\n }\n\n /* shared size of eye and download buttons */\n .lti-cols button, .lti-download {\n border: none;\n padding: 0;\n width: 1.2em;\n height: 1.2em;\n }\n\n /* column-visibility menu: eye button + checklist popup */\n .lti-cols {\n position: relative;\n button {\n background: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M1 8s2.5-4.5 7-4.5 7 4.5 7 4.5-2.5 4.5-7 4.5-7-4.5-7-4.5z\"/><circle cx=\"8\" cy=\"8\" r=\"2\"/></svg>');\n }\n .lti-menu {\n position: absolute;\n z-index: 1;\n top: 100%;\n left: 0;\n background: Canvas;\n border: 1px solid;\n padding: 0.3em 0.6em;\n label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n }\n /* spanner label above its indented columns */\n .lti-group {\n font-weight: 600;\n white-space: nowrap;\n }\n .lti-sub { padding-left: 1em; }\n }\n }\n\n /* CSV download icon button */\n .lti-download {\n background: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"gray\" stroke-width=\"1.5\"><path d=\"M8 1v9m0 0L4.5 6.5M8 10l3.5-3.5\"/><path d=\"M2 11v3h12v-3\"/></svg>');\n }\n\n /* typed filter chip: label, filter summary, funnel opening widget + box */\n .lti-chip {\n /* whole chip is the click target and panel anchor (panel flush with chip) */\n position: relative;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 0.3em;\n /* pill look separates chips */\n padding: 0.05em 0.5em;\n border: 1px solid #ccc;\n border-radius: 4px;\n background: #f7f7f7;\n &.lti-on {\n border-color: #999;\n .lti-chip-name { font-weight: 600; }\n }\n .lti-chip-cur {\n color: #555;\n font-variant-numeric: tabular-nums;\n }\n /* panel positions against the chip, not the funnel wrap */\n .lti-pop { position: static; }\n }\n .lti-pop {\n position: relative;\n .lti-funnel {\n border: none;\n padding: 0;\n width: 1.1em;\n height: 1.1em;\n opacity: 0.55;\n background: center / contain no-repeat url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"gray\"><path d=\"M1 2h14l-5.5 6.5V14l-3 1V8.5z\"/></svg>');\n }\n /* active when the column has a live term */\n &.lti-on .lti-funnel {\n opacity: 1;\n }\n .lti-pop-panel {\n position: absolute;\n z-index: 1;\n top: 100%;\n left: 0;\n display: flex;\n flex-direction: column;\n gap: 0.5em;\n min-width: 14em;\n max-width: 90vw;\n padding: 0.6em;\n background: Canvas;\n border: 1px solid;\n .lti-widget { display: contents; }\n &[hidden], [hidden] { display: none; }\n /* checklist row: checkbox + label */\n .lti-check {\n display: flex;\n align-items: center;\n gap: 0.4em;\n white-space: nowrap;\n cursor: pointer;\n }\n }\n }\n\n /* range slider: track, fill band, two button thumbs */\n .lti-slider {\n position: relative;\n height: 1.2em;\n margin: 0.4em 0.6em;\n &::before {\n content: \"\";\n position: absolute;\n inset: 50% 0 auto;\n height: 3px;\n transform: translateY(-50%);\n background: #c8c8c8;\n border-radius: 3px;\n }\n .lti-slider-fill {\n position: absolute;\n inset: 50% 0;\n height: 3px;\n transform: translateY(-50%);\n background: #4a90d9;\n }\n .lti-thumb {\n position: absolute;\n top: 50%;\n width: 14px;\n height: 14px;\n padding: 0;\n transform: translate(-50%, -50%);\n border: 2px solid #fff;\n border-radius: 50%;\n background: #4a90d9;\n box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);\n cursor: pointer;\n touch-action: none;\n }\n }\n .lti-slider-out {\n text-align: center;\n font-variant-numeric: tabular-nums;\n }\n\n .lti-pager {\n display: flex;\n align-items: center;\n gap: 0.3em;\n }\n button, select {\n font: inherit;\n cursor: pointer;\n }\n /* row count away from arrows; page size pushed to far end */\n .lti-pos {\n margin: 0 auto 0 0.3em;\n }\n}\n\n/* Busy state during a page-freezing recompute (see lt-interactive.js). */\n.lti-busy {\n /* beat controls' own cursors */\n &, & * {\n cursor: wait !important;\n }\n & tbody {\n opacity: 0.5;\n }\n}\n"],"names":[]}
|
package/css/lt-plot.css
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/* lt-plot.css —
|
|
1
|
+
/* lt-plot.css — inline graphics cell styles (see lt-plot.js). */
|
|
2
2
|
.lt-table {
|
|
3
|
-
/* auto-fit plot: SVG takes --fw of
|
|
4
|
-
|
|
3
|
+
/* auto-fit plot: SVG takes --fw of column (min --w); resizer redraws at
|
|
4
|
+
measured px (see lt-plot.js) */
|
|
5
5
|
.lt-fit { width: var(--fw, 100%); min-width: var(--w, 0); }
|
|
6
6
|
.lt-eb-cell {
|
|
7
7
|
position: relative;
|
|
8
|
-
padding: 0; /*
|
|
9
|
-
text-align: left; /*
|
|
8
|
+
padding: 0; /* gridline background fills cell */
|
|
9
|
+
text-align: left; /* plot flush left with gridlines */
|
|
10
10
|
}
|
|
11
11
|
.lt-eb-grid-bg {
|
|
12
12
|
position: absolute;
|
|
@@ -17,35 +17,35 @@
|
|
|
17
17
|
.lt-eb {
|
|
18
18
|
position: relative;
|
|
19
19
|
vertical-align: middle;
|
|
20
|
-
/* default only series
|
|
21
|
-
|
|
20
|
+
/* default only series lacking stroke=/fill= attribute, so attribute shows;
|
|
21
|
+
override via attr or `.lt-eb` rule */
|
|
22
22
|
line:not([stroke]):not(.lt-eb-ref) { stroke: #888; }
|
|
23
23
|
circle:not([fill]) { fill: #333; }
|
|
24
24
|
.lt-eb-ref { stroke: #ccc; }
|
|
25
25
|
}
|
|
26
26
|
.lt-eb-axis {
|
|
27
27
|
display: block;
|
|
28
|
-
margin-top: 3px; /*
|
|
28
|
+
margin-top: 3px; /* gap below body; cell has no padding */
|
|
29
29
|
line { stroke: #888; }
|
|
30
30
|
text { fill: #666; font-size: 11px; }
|
|
31
31
|
.lt-eb-axis-label { fill: #333; font-size: 12px; }
|
|
32
32
|
}
|
|
33
33
|
.lt-spark {
|
|
34
34
|
vertical-align: middle;
|
|
35
|
-
color: #4682b4; /* line/bars inherit
|
|
35
|
+
color: #4682b4; /* line/bars inherit via currentColor; override inline */
|
|
36
36
|
.lt-spark-line { fill: none; stroke: currentColor; stroke-width: 1; }
|
|
37
37
|
.lt-spark-bar { fill: currentColor; }
|
|
38
38
|
}
|
|
39
39
|
.lt-dot {
|
|
40
|
-
position: relative; /* paint above
|
|
40
|
+
position: relative; /* paint above absolute gridlines */
|
|
41
41
|
vertical-align: middle;
|
|
42
42
|
color: #333;
|
|
43
|
-
/* default only
|
|
44
|
-
|
|
43
|
+
/* default only dots lacking fill= attribute, so attribute shows; override
|
|
44
|
+
via `color` or `.lt-dot circle` */
|
|
45
45
|
circle:not([fill]) { fill: currentColor; }
|
|
46
46
|
}
|
|
47
47
|
.lt-plot-legend {
|
|
48
|
-
margin-top: 3px; /*
|
|
48
|
+
margin-top: 3px; /* gap below axis; cell has no padding */
|
|
49
49
|
font-size: 11px;
|
|
50
50
|
color: #666;
|
|
51
51
|
i {
|
package/css/lt-plot.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AACA,UAGE,oDACA,0DAKA,gDAIE,oBAEF,iDAKE,iDACA,+BACA,0BAEF,2CAGE,mBACA,gCACA,8CAEF,gDAGE,gEACA,mCAEF,6DAME,wCAEF,2DAIE,uGAQA","sources":["lt-plot.css"],"sourcesContent":["/* lt-plot.css —
|
|
1
|
+
{"version":3,"mappings":"AACA,UAGE,oDACA,0DAKA,gDAIE,oBAEF,iDAKE,iDACA,+BACA,0BAEF,2CAGE,mBACA,gCACA,8CAEF,gDAGE,gEACA,mCAEF,6DAME,wCAEF,2DAIE,uGAQA","sources":["lt-plot.css"],"sourcesContent":["/* lt-plot.css — inline graphics cell styles (see lt-plot.js). */\n.lt-table {\n /* auto-fit plot: SVG takes --fw of column (min --w); resizer redraws at\n measured px (see lt-plot.js) */\n .lt-fit { width: var(--fw, 100%); min-width: var(--w, 0); }\n .lt-eb-cell {\n position: relative;\n padding: 0; /* gridline background fills cell */\n text-align: left; /* plot flush left with gridlines */\n }\n .lt-eb-grid-bg {\n position: absolute;\n left: 0;\n top: 0;\n line { stroke: #eee; }\n }\n .lt-eb {\n position: relative;\n vertical-align: middle;\n /* default only series lacking stroke=/fill= attribute, so attribute shows;\n override via attr or `.lt-eb` rule */\n line:not([stroke]):not(.lt-eb-ref) { stroke: #888; }\n circle:not([fill]) { fill: #333; }\n .lt-eb-ref { stroke: #ccc; }\n }\n .lt-eb-axis {\n display: block;\n margin-top: 3px; /* gap below body; cell has no padding */\n line { stroke: #888; }\n text { fill: #666; font-size: 11px; }\n .lt-eb-axis-label { fill: #333; font-size: 12px; }\n }\n .lt-spark {\n vertical-align: middle;\n color: #4682b4; /* line/bars inherit via currentColor; override inline */\n .lt-spark-line { fill: none; stroke: currentColor; stroke-width: 1; }\n .lt-spark-bar { fill: currentColor; }\n }\n .lt-dot {\n position: relative; /* paint above absolute gridlines */\n vertical-align: middle;\n color: #333;\n /* default only dots lacking fill= attribute, so attribute shows; override\n via `color` or `.lt-dot circle` */\n circle:not([fill]) { fill: currentColor; }\n }\n .lt-plot-legend {\n margin-top: 3px; /* gap below axis; cell has no padding */\n font-size: 11px;\n color: #666;\n i {\n display: inline-block;\n width: 8px;\n height: 8px;\n margin-right: 2px;\n border-radius: 50%;\n vertical-align: middle;\n }\n span { margin-right: 6px; white-space: nowrap; }\n }\n}\n"],"names":[]}
|
package/js/lt-input.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* lt-input.js — editable cells and a Shiny input binding for lt tables.
|
|
2
|
+
*
|
|
3
|
+
* Plugin on the LT global (see lt.js). For a spec with `input` (names of
|
|
4
|
+
* editable columns), makes those body cells contenteditable and writes edits
|
|
5
|
+
* back into spec.data. Not for rowspan row groups or lt_interactive(), which
|
|
6
|
+
* reorder rows. The Shiny binding reports spec.data as the input value.
|
|
7
|
+
*/
|
|
8
|
+
(root => {
|
|
9
|
+
"use strict";
|
|
10
|
+
const LT = root.LT;
|
|
11
|
+
if (!LT?.onMount || LT.plugins.input) return;
|
|
12
|
+
const { $$, on, numCol } = LT;
|
|
13
|
+
|
|
14
|
+
const onMount = (tbl, spec) => {
|
|
15
|
+
if (!spec?.input || spec._rowspan || spec.interactive) return;
|
|
16
|
+
const rows = [...$$(tbl.tBodies[0], "tr:not(.lt-row-group)")],
|
|
17
|
+
cols = spec._cols,
|
|
18
|
+
// [column, row index] of an editable cell hit by event `e`
|
|
19
|
+
hit = e => {
|
|
20
|
+
const td = e.target.closest?.("td[contenteditable]");
|
|
21
|
+
return td && [td, cols[td.cellIndex], rows.indexOf(td.parentNode)];
|
|
22
|
+
};
|
|
23
|
+
rows.forEach(tr => cols.forEach((c, i) => {
|
|
24
|
+
if (spec.input.includes(c)) tr.cells[i].contentEditable = "plaintext-only";
|
|
25
|
+
}));
|
|
26
|
+
on(tbl, "focusin", e => { // edit the raw value, not its display
|
|
27
|
+
const [td, c, r] = hit(e) || [];
|
|
28
|
+
if (td) td.textContent = spec.data[c][r] ?? "";
|
|
29
|
+
});
|
|
30
|
+
on(tbl, "focusout", e => {
|
|
31
|
+
const [td, c, r] = hit(e) || [];
|
|
32
|
+
if (!td) return;
|
|
33
|
+
const col = spec.data[c], v = td.textContent.trim();
|
|
34
|
+
if (!numCol(col)) col[r] = td.textContent;
|
|
35
|
+
else if (isNaN(v)) td.textContent = col[r] ?? ""; // reject non-numeric
|
|
36
|
+
else col[r] = v === "" ? null : +v;
|
|
37
|
+
tbl.dispatchEvent(new CustomEvent("lt-edit", { bubbles: true }));
|
|
38
|
+
});
|
|
39
|
+
on(tbl, "keydown", e => { // Enter commits and moves down a row
|
|
40
|
+
const [td, , r] = hit(e) || [];
|
|
41
|
+
if (!td || e.key !== "Enter") return;
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
(rows[r + 1]?.cells[td.cellIndex] || td).focus();
|
|
44
|
+
td.blur();
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
LT.plugins.input = 1;
|
|
49
|
+
LT.onMount.push(onMount);
|
|
50
|
+
if (typeof document !== "undefined")
|
|
51
|
+
$$(document, ".lt-table").forEach(t => onMount(t, t._ltSpec));
|
|
52
|
+
|
|
53
|
+
// Shiny input binding: <div class="lt-input" data-spec='{...}'>
|
|
54
|
+
if (!root.Shiny) return;
|
|
55
|
+
const draw = (el, spec) => el._tbl = LT.render(el, spec);
|
|
56
|
+
Shiny.inputBindings.register(Object.assign(new Shiny.InputBinding(), {
|
|
57
|
+
find: scope => $(scope).find(".lt-input"),
|
|
58
|
+
initialize: el => draw(el, JSON.parse(el.dataset.spec)),
|
|
59
|
+
getType: () => "lt.table",
|
|
60
|
+
getValue: el => el._tbl._ltSpec.data,
|
|
61
|
+
subscribe: (el, cb) => $(el).on("lt-edit.lt", () => cb(true)),
|
|
62
|
+
unsubscribe: el => $(el).off(".lt"),
|
|
63
|
+
receiveMessage: (el, msg) => { draw(el, msg.spec); $(el).trigger("lt-edit"); }
|
|
64
|
+
}), "lt.input");
|
|
65
|
+
})(typeof window !== "undefined" ? window : globalThis);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(t=>{"use strict";const e=t.LT;if(!e?.onMount||e.plugins.input)return;const{$$:n,on:i,numCol:o}=e,s=(t,e)=>{if(!e?.input||e._rowspan||e.interactive)return;const s=[...n(t.tBodies[0],"tr:not(.lt-row-group)")],l=e._cols,u=t=>{const e=t.target.closest?.("td[contenteditable]");return e&&[e,l[e.cellIndex],s.indexOf(e.parentNode)]};s.forEach(t=>l.forEach((n,i)=>{e.input.includes(n)&&(t.cells[i].contentEditable="plaintext-only")})),i(t,"focusin",t=>{const[n,i,o]=u(t)||[];n&&(n.textContent=e.data[i][o]??"")}),i(t,"focusout",n=>{const[i,s,l]=u(n)||[];if(!i)return;const c=e.data[s],r=i.textContent.trim();o(c)?isNaN(r)?i.textContent=c[l]??"":c[l]=""===r?null:+r:c[l]=i.textContent,t.dispatchEvent(new CustomEvent("lt-edit",{bubbles:!0}))}),i(t,"keydown",t=>{const[e,,n]=u(t)||[];e&&"Enter"===t.key&&(t.preventDefault(),(s[n+1]?.cells[e.cellIndex]||e).focus(),e.blur())})};if(e.plugins.input=1,e.onMount.push(s),"undefined"!=typeof document&&n(document,".lt-table").forEach(t=>s(t,t._ltSpec)),!t.Shiny)return;const l=(t,n)=>t._tbl=e.render(t,n);Shiny.inputBindings.register(Object.assign(new Shiny.InputBinding,{find:t=>$(t).find(".lt-input"),initialize:t=>l(t,JSON.parse(t.dataset.spec)),getType:()=>"lt.table",getValue:t=>t._tbl._ltSpec.data,subscribe:(t,e)=>$(t).on("lt-edit.lt",()=>e(!0)),unsubscribe:t=>$(t).off(".lt"),receiveMessage:(t,e)=>{l(t,e.spec),$(t).trigger("lt-edit")}}),"lt.input")})("undefined"!=typeof window?window:globalThis);
|
|
2
|
+
//# sourceMappingURL=lt-input.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["root","LT","onMount","plugins","input","$$","on","numCol","tbl","spec","_rowspan","interactive","rows","tBodies","cols","_cols","hit","e","td","target","closest","cellIndex","indexOf","parentNode","forEach","tr","c","i","includes","cells","contentEditable","r","textContent","data","col","v","trim","isNaN","dispatchEvent","CustomEvent","bubbles","key","preventDefault","focus","blur","push","document","t","_ltSpec","Shiny","draw","el","_tbl","render","inputBindings","register","Object","assign","InputBinding","find","scope","$","initialize","JSON","parse","dataset","getType","getValue","subscribe","cb","unsubscribe","off","receiveMessage","msg","trigger","window","globalThis"],"sources":["lt-input.js"],"mappings":"AAOA,CAACA,IACC,aACA,MAAMC,EAAKD,EAAKC,GAChB,IAAKA,GAAIC,SAAWD,EAAGE,QAAQC,MAAO,OACtC,MAAMC,GAAEA,EAAEC,GAAEA,EAAEC,OAAEA,GAAWN,EAErBC,EAAU,CAACM,EAAKC,KACpB,IAAKA,GAAML,OAASK,EAAKC,UAAYD,EAAKE,YAAa,OACvD,MAAMC,EAAO,IAAIP,EAAGG,EAAIK,QAAQ,GAAI,0BAC9BC,EAAOL,EAAKM,MAEZC,EAAMC,IACJ,MAAMC,EAAKD,EAAEE,OAAOC,UAAU,uBAC9B,OAAOF,GAAM,CAACA,EAAIJ,EAAKI,EAAGG,WAAYT,EAAKU,QAAQJ,EAAGK,cAE9DX,EAAKY,QAAQC,GAAMX,EAAKU,QAAQ,CAACE,EAAGC,KAC9BlB,EAAKL,MAAMwB,SAASF,KAAID,EAAGI,MAAMF,GAAGG,gBAAkB,qBAE5DxB,EAAGE,EAAK,UAAWS,IACjB,MAAOC,EAAIQ,EAAGK,GAAKf,EAAIC,IAAM,GACzBC,IAAIA,EAAGc,YAAcvB,EAAKwB,KAAKP,GAAGK,IAAM,MAE9CzB,EAAGE,EAAK,WAAYS,IAClB,MAAOC,EAAIQ,EAAGK,GAAKf,EAAIC,IAAM,GAC7B,IAAKC,EAAI,OACT,MAAMgB,EAAMzB,EAAKwB,KAAKP,GAAIS,EAAIjB,EAAGc,YAAYI,OACxC7B,EAAO2B,GACHG,MAAMF,GAAIjB,EAAGc,YAAcE,EAAIH,IAAM,GACzCG,EAAIH,GAAW,KAANI,EAAW,MAAQA,EAFfD,EAAIH,GAAKb,EAAGc,YAG9BxB,EAAI8B,cAAc,IAAIC,YAAY,UAAW,CAAEC,SAAS,OAE1DlC,EAAGE,EAAK,UAAWS,IACjB,MAAOC,EAAI,CAAEa,GAAKf,EAAIC,IAAM,GACvBC,GAAgB,UAAVD,EAAEwB,MACbxB,EAAEyB,kBACD9B,EAAKmB,EAAI,IAAIF,MAAMX,EAAGG,YAAcH,GAAIyB,QACzCzB,EAAG0B,WAUP,GANA3C,EAAGE,QAAQC,MAAQ,EACnBH,EAAGC,QAAQ2C,KAAK3C,GACQ,oBAAb4C,UACTzC,EAAGyC,SAAU,aAAatB,QAAQuB,GAAK7C,EAAQ6C,EAAGA,EAAEC,WAGjDhD,EAAKiD,MAAO,OACjB,MAAMC,EAAO,CAACC,EAAI1C,IAAS0C,EAAGC,KAAOnD,EAAGoD,OAAOF,EAAI1C,GACnDwC,MAAMK,cAAcC,SAASC,OAAOC,OAAO,IAAIR,MAAMS,aAAgB,CACnEC,KAAMC,GAASC,EAAED,GAAOD,KAAK,aAC7BG,WAAYX,GAAMD,EAAKC,EAAIY,KAAKC,MAAMb,EAAGc,QAAQxD,OACjDyD,QAAS,IAAM,WACfC,SAAUhB,GAAMA,EAAGC,KAAKJ,QAAQf,KAChCmC,UAAW,CAACjB,EAAIkB,IAAOR,EAAEV,GAAI7C,GAAG,aAAc,IAAM+D,GAAG,IACvDC,YAAanB,GAAMU,EAAEV,GAAIoB,IAAI,OAC7BC,eAAgB,CAACrB,EAAIsB,KAAUvB,EAAKC,EAAIsB,EAAIhE,MAAOoD,EAAEV,GAAIuB,QAAQ,cAC/D,WACL,EAzDD,CAyDqB,oBAAXC,OAAyBA,OAASC","ignoreList":[]}
|