@xiee/utils 1.14.110 → 1.14.112

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.
@@ -0,0 +1,11 @@
1
+ /* lt-input.css — an editable table looks like a spreadsheet (see lt-input.js).
2
+ lt.css draws the frame and header gaps from --bd/--bg, so redefining them
3
+ (the row separator color, #ddd) leaves one uniform grid. The `tr` in the
4
+ selector outranks lt.css's cell rules regardless of stylesheet order. */
5
+ .lt-table.lt-edit {
6
+ --bd: 1px solid #ddd;
7
+ --bg: var(--bd);
8
+ border-collapse: collapse;
9
+ :is(thead, tbody) tr :is(td, th) { border: var(--bd); }
10
+ [contenteditable] { cursor: pointer; &:focus { outline: 2px solid #217346; outline-offset: -1px; } }
11
+ }
@@ -0,0 +1,2 @@
1
+ .lt-table.lt-edit{--bd:1px solid #ddd;--bg:var(--bd);border-collapse:collapse;& :is(thead,tbody) tr :is(td,th){border:var(--bd)}& [contenteditable]{cursor:pointer;&:focus{outline-offset:-1px;outline:2px solid #217346}}}
2
+ /*# sourceMappingURL=lt-input.min.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":"AAIA,8EAIE,kDACA,mCAAqC","sources":["lt-input.css"],"sourcesContent":["/* lt-input.css — an editable table looks like a spreadsheet (see lt-input.js).\n lt.css draws the frame and header gaps from --bd/--bg, so redefining them\n (the row separator color, #ddd) leaves one uniform grid. The `tr` in the\n selector outranks lt.css's cell rules regardless of stylesheet order. */\n.lt-table.lt-edit {\n --bd: 1px solid #ddd;\n --bg: var(--bd);\n border-collapse: collapse;\n :is(thead, tbody) tr :is(td, th) { border: var(--bd); }\n [contenteditable] { cursor: pointer; &:focus { outline: 2px solid #217346; outline-offset: -1px; } }\n}\n"],"names":[]}
@@ -1,38 +1,32 @@
1
- /* lt-interactive.css — controls for lt-interactive.js (search box, sortable
2
- * headers, column filters, pager). Classes are namespaced `lti-*` to avoid
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
- /* the search box and the pager are full-width rows of the table, so they line
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
- /* Each box fills its cell: the whole table for the search, one column for a
15
- * filter. A faded magnifier stands in for a placeholder — it says "type here
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 the magnifier goes away, leaving a small left pad so the caret
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
- /* the click target is the label span, not the whole cell (so the resize grip
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
- /* the ▲/▼ indicator, set off from the column label */
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
- /* the expand caret leads the first cell of each row; it carries its own
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
- /* a row's detail spans every column; the inset marks it as belonging to the
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
- /* the drag grip sits on a column's right edge, inside its header cell */
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
- /* while dragging, the pointer keeps the resize cursor anywhere on the table,
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
- /* column widths are authoritative once frozen, so a drag moves one edge only */
75
+ /* frozen widths are authoritative: a drag moves one edge only */
85
76
  &.lti-fixed {
86
77
  table-layout: fixed;
87
- /* a shrunk column hides its overflow rather than spilling into the next
88
- * column or out under the resize grip, so the grip can shrink it freely;
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
- /* the control bar lays its parts out left to right: an icon group, the filter
97
- * chips, then the search box. Only the search box grows, so all the free space
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
- /* a wide gap between the three parts (icons, chips, search) ... */
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
- /* ... but a tight gap between the buttons / chips within a part */
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 a caller's chip (el._lt.chips); when
115
- it holds none, collapse it so it adds no gap between icons and search */
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: a chip's popover holds its own `.lti-search` box */
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 footprint for the eye button and the download button */
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
- /* the column-visibility menu: an eye button and the checklist it pops up */
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
- /* a spanner's label, above its (indented) columns */
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
- /* the CSV download button: an icon button, same footprint as the eye button */
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 chips sit after the search box in the head bar; each is a label,
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
- /* the whole chip is the popover's click target and the box its panel is
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
- /* a pill (border + faint fill) so each chip reads as a separate unit */
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
- /* let the panel resolve against the chip, not the inner funnel wrap */
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
- /* a funnel standing in for a header-level filter reads as active when its
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
- /* a checklist widget's rows: a checkbox beside its label */
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
- /* the custom range slider: a track with a fill band between two button thumbs */
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
- /* push the row count away from the arrows, and the page size to the far end */
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 view recompute that freezes the page (see
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
- /* !important beats the controls' own pointer/resize cursors */
275
+ /* beat controls' own cursors */
293
276
  &, & * {
294
277
  cursor: wait !important;
295
278
  }
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAKA,UAGE,kEAQA,oSAME,iDAQF,2DAKA,4CAKA,kCAMA,oFASA,oCAKA,yCAGA,0HASE,4CAOF,kDAKA,+BAME,2DASF,qDAKE,6EAOA,sBAIE,sBAGF,sCAOF,kFAQA,8BAEE,wSAGA,6GAQE,wDAMA,gDAIA,8BAKJ,6QAMA,2KAaE,2BAEE,kCAEF,6DAKA,4BAEF,6BAEE,oQAUA,+BAGA,uLAaE,+BACA,kCAEA,0FAWJ,8DAIE,kIASA,0GAOA,6NAeF,sEAKA,sDAKA,8CAKA,iCAOF,UAEE,4BAGA","sources":["lt-interactive.css"],"sourcesContent":["/* lt-interactive.css — controls for lt-interactive.js (search box, sortable\n * headers, column filters, pager). Classes are namespaced `lti-*` to avoid\n * clashing with core `lt-*`. Only properties that change a default are\n * declared. */\n\n.lt-table {\n /* the search box and the pager are full-width rows of the table, so they line\n * up with its edges rather than the cell text */\n :is(.lti-head, .lti-pager-row) td {\n padding-left: 0;\n padding-right: 0;\n }\n\n /* Each box fills its cell: the whole table for the search, one column for a\n * filter. A faded magnifier stands in for a placeholder — it says \"type here\n * to search\" in no language — and steps aside once the box has the 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 /* on focus the magnifier goes away, leaving a small left pad so the caret\n * sits just inside the edge rather than behind the icon's wider gutter */\n &:focus {\n padding-left: .5em;\n background-image: none;\n }\n }\n\n /* the click target is the label span, not the whole cell (so the resize grip\n * stays separate), so the pointer cursor belongs on the label too */\n .lti-sortable .lti-label {\n cursor: pointer;\n user-select: none;\n }\n /* the ▲/▼ indicator, set off from the column label */\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 /* the expand caret leads the first cell of each row; it carries its own\n * glyph (▸ / ▾), so it needs no borders or background of its own */\n .lti-expand {\n border: none;\n background: none;\n padding: 0;\n margin-right: 0.4em;\n cursor: pointer;\n }\n /* a row's detail spans every column; the inset marks it as belonging to the\n * row above it */\n .lti-detail > td {\n padding-left: 1.5em;\n }\n\n /* the drag grip sits on a column's right edge, inside its header cell */\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 /* while dragging, the pointer keeps the resize cursor anywhere on the table,\n * and the drag selects no text */\n &.lti-resizing {\n cursor: col-resize;\n user-select: none;\n }\n /* column widths are authoritative once frozen, so a drag moves one edge only */\n &.lti-fixed {\n table-layout: fixed;\n /* a shrunk column hides its overflow rather than spilling into the next\n * column or out under the resize grip, so the grip can shrink it freely;\n * the detail row (full width, possibly tall) and the popover-bearing\n * filter/bar cells (<td>) are left to overflow */\n thead th, tbody tr:not(.lti-detail) td {\n overflow: hidden;\n }\n }\n\n /* the control bar lays its parts out left to right: an icon group, the filter\n * chips, then the search box. Only the search box grows, so all the free space\n * lands in it (pushing it to the right edge); the icons and chips keep their\n * natural width. The search still fills the bar when it is the only control. */\n .lti-bar {\n display: flex;\n align-items: center;\n /* a wide gap between the three parts (icons, chips, search) ... */\n gap: 1.2em;\n .lti-icons, .lti-chips {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n /* ... but a tight gap between the buttons / chips within a part */\n gap: 0.3em;\n }\n .lti-chips {\n gap: 0.5em;\n /* always present as a drop target for a caller's chip (el._lt.chips); when\n it holds none, collapse it so it adds no gap between icons and search */\n &:empty { display: none; }\n }\n /* direct child only: a chip's popover holds its own `.lti-search` box */\n & > .lti-search {\n flex: 1 1 8em;\n min-width: 6em;\n }\n }\n\n /* shared footprint for the eye button and the download button */\n .lti-cols button, .lti-download {\n border: none;\n padding: 0;\n width: 1.2em;\n height: 1.2em;\n }\n\n /* the column-visibility menu: an eye button and the checklist it pops up */\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 /* a spanner's 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 /* the CSV download button: an icon button, same footprint as the eye 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 chips sit after the search box in the head bar; each is a label,\n * a summary of the current filter, and a funnel popping up the widget + box */\n .lti-chip {\n /* the whole chip is the popover's click target and the box its panel is\n * positioned against, so the panel opens flush with the chip's left edge */\n position: relative;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 0.3em;\n /* a pill (border + faint fill) so each chip reads as a separate unit */\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 /* let the panel resolve against the chip, not the inner 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 /* a funnel standing in for a header-level filter reads as active when its\n * 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 /* a checklist widget's rows: a checkbox beside its 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 /* the custom range slider: a track with a fill band between 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 /* push the row count away from the arrows, and the page size to the far end */\n .lti-pos {\n margin: 0 auto 0 0.3em;\n }\n}\n\n/* Busy state during a view recompute that freezes the page (see\n * lt-interactive.js): wait cursor over the whole table and a dimmed body. */\n.lti-busy {\n /* !important beats the controls' own pointer/resize cursors */\n &, & * {\n cursor: wait !important;\n }\n & tbody {\n opacity: 0.5;\n }\n}\n"],"names":[]}
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 — styles for inline graphics cells (see lt-plot.js). */
1
+ /* lt-plot.css — inline graphics cell styles (see lt-plot.js). */
2
2
  .lt-table {
3
- /* auto-fit plot: SVG takes --fw of its column (min --w); the resizer redraws
4
- it at the measured px (see lt-plot.js) */
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; /* so the gridline background fills the whole cell */
9
- text-align: left; /* keep the plot flush left, aligned with the gridlines */
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 without a per-series stroke=/fill= attribute, so that
21
- attribute still shows; override either via that attr or a `.lt-eb` rule */
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; /* small gap below the body, since the cell has no padding */
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 this via currentColor; override inline */
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 the absolutely-positioned gridlines */
40
+ position: relative; /* paint above absolute gridlines */
41
41
  vertical-align: middle;
42
42
  color: #333;
43
- /* default only the dots without a per-column fill= attribute, so that
44
- attribute still shows; override either via `color` or `.lt-dot circle` */
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; /* small gap below the axis, since the cell has no padding */
48
+ margin-top: 3px; /* gap below axis; cell has no padding */
49
49
  font-size: 11px;
50
50
  color: #666;
51
51
  i {
@@ -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 — styles for inline graphics cells (see lt-plot.js). */\n.lt-table {\n /* auto-fit plot: SVG takes --fw of its column (min --w); the resizer redraws\n it at the 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; /* so the gridline background fills the whole cell */\n text-align: left; /* keep the plot flush left, aligned with the 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 without a per-series stroke=/fill= attribute, so that\n attribute still shows; override either via that attr or a `.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; /* small gap below the body, since the 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 this 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 the absolutely-positioned gridlines */\n vertical-align: middle;\n color: #333;\n /* default only the dots without a per-column fill= attribute, so that\n attribute still shows; override either via `color` or `.lt-dot circle` */\n circle:not([fill]) { fill: currentColor; }\n }\n .lt-plot-legend {\n margin-top: 3px; /* small gap below the axis, since the 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":[]}
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/css/lt.css CHANGED
@@ -1,9 +1,9 @@
1
- th, td{ padding: 5px; }
2
1
  .lt-wrap { overflow-x: auto; }
3
2
  .lt-table {
4
3
  --bg: 4px solid transparent;
5
4
  --bd: 1.5px solid #888;
6
5
 
6
+ th, td{ padding: 5px; }
7
7
  border-collapse: separate;
8
8
  caption-side: top;
9
9
  margin: 1em auto;
package/css/lt.min.css CHANGED
@@ -1,2 +1,2 @@
1
- th,td{padding:5px}.lt-wrap{overflow-x:auto}.lt-table{--bg:4px solid transparent;--bd:1.5px solid #888;border-collapse:separate;caption-side:top;border-spacing:0;border-top:var(--bd);border-bottom:var(--bd);margin:1em auto;& caption{text-align:center;border-top:var(--bd);padding:.5em;& .lt-title{font-size:1.2em}& .lt-subtitle{font-size:.9em}}& th{font-weight:400}& tbody{& :not(:last-child) :is(td,th){border-bottom:1px solid #ddd}& .lt-row-group :is(td,th){border-bottom:1.5px solid #ddd}& .lt-row-group{text-align:left;&.lt-row-open{border-bottom-color:#0000}}}& thead th{border-bottom:1px solid #888;&:not(:first-child){border-left:var(--bg)}&:not(:last-child){border-right:var(--bg)}}& .lt-indent{padding-left:1em}& .lt-spanner-row{& .lt-spanner{text-align:center;border-bottom:1px solid #bbb}& .lt-spanner-empty{border-bottom:none}}& .lt-footer{font-size:.85em;& .lt-footnote:first-child td{border-top:1px solid #aaa}& .lt-source-note:first-child td{border-top:1px dashed #aaa}& .lt-source-note td{font-style:italic}}& .al-r{text-align:right}& .al-c{text-align:center}& .lt-fnref{color:#06c;&:before{content:" ["}&:after{content:"]"}}}.lt-raw [title]:after{content:" (" attr(title) ")";background:#ffffe0;font-size:.85em}
1
+ .lt-wrap{overflow-x:auto}.lt-table{--bg:4px solid transparent;--bd:1.5px solid #888;& th,& td{padding:5px}border-collapse:separate;caption-side:top;border-spacing:0;border-top:var(--bd);border-bottom:var(--bd);margin:1em auto;& caption{text-align:center;border-top:var(--bd);padding:.5em;& .lt-title{font-size:1.2em}& .lt-subtitle{font-size:.9em}}& th{font-weight:400}& tbody{& :not(:last-child) :is(td,th){border-bottom:1px solid #ddd}& .lt-row-group :is(td,th){border-bottom:1.5px solid #ddd}& .lt-row-group{text-align:left;&.lt-row-open{border-bottom-color:#0000}}}& thead th{border-bottom:1px solid #888;&:not(:first-child){border-left:var(--bg)}&:not(:last-child){border-right:var(--bg)}}& .lt-indent{padding-left:1em}& .lt-spanner-row{& .lt-spanner{text-align:center;border-bottom:1px solid #bbb}& .lt-spanner-empty{border-bottom:none}}& .lt-footer{font-size:.85em;& .lt-footnote:first-child td{border-top:1px solid #aaa}& .lt-source-note:first-child td{border-top:1px dashed #aaa}& .lt-source-note td{font-style:italic}}& .al-r{text-align:right}& .al-c{text-align:center}& .lt-fnref{color:#06c;&:before{content:" ["}&:after{content:"]"}}}.lt-raw [title]:after{content:" (" attr(title) ")";background:#ffffe0;font-size:.85em}
2
2
  /*# sourceMappingURL=lt.min.css.map */
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,kBACA,yBACA,mLAWE,8DAEE,4BACA,+BAGF,qBACA,QACE,4DACA,0DACA,gCAEE,0CAGJ,wCAEE,0CACA,2CAEF,8BACA,kBACE,6DACA,wCAGF,6BAEE,wDACA,4DACA,wCAGF,yBACA,0BAEA,uBAEE,uBACA,sBAGJ","sources":["lt.css"],"sourcesContent":["th, td{ padding: 5px; }\n.lt-wrap { overflow-x: auto; }\n.lt-table {\n --bg: 4px solid transparent;\n --bd: 1.5px solid #888;\n\n border-collapse: separate;\n caption-side: top;\n margin: 1em auto;\n border-spacing: 0;\n border-top: var(--bd);\n border-bottom: var(--bd);\n\n caption {\n padding: .5em; text-align: center; border-top: var(--bd);\n .lt-title { font-size: 1.2em; }\n .lt-subtitle { font-size: 0.9em; }\n }\n\n th { font-weight: normal; }\n tbody {\n :not(:last-child) :is(td, th) { border-bottom: 1px solid #ddd; }\n .lt-row-group :is(td, th) { border-bottom: 1.5px solid #ddd; }\n .lt-row-group {\n text-align: left;\n &.lt-row-open { border-bottom-color: transparent; }\n }\n }\n thead th {\n border-bottom: 1px solid #888;\n &:not(:first-child) { border-left: var(--bg); }\n &:not(:last-child) { border-right: var(--bg); }\n }\n .lt-indent { padding-left: 1em; }\n .lt-spanner-row {\n .lt-spanner { border-bottom: 1px solid #bbb; text-align: center; }\n .lt-spanner-empty { border-bottom: none; }\n }\n\n .lt-footer {\n font-size: 0.85em;\n .lt-footnote:first-child td { border-top: 1px solid #aaa; }\n .lt-source-note:first-child td { border-top: 1px dashed #aaa; }\n .lt-source-note td { font-style: italic; }\n }\n\n .al-r { text-align: right; }\n .al-c { text-align: center; }\n\n .lt-fnref {\n color: #06c;\n &::before { content: \"\\00a0[\"; }\n &::after { content: \"]\"; }\n }\n}\n.lt-raw [title]::after {\n content: \" (\" attr(title) \")\";\n background: lightyellow;\n font-size: 0.85em;\n}\n"],"names":[]}
1
+ {"version":3,"mappings":"AAAA,yBACA,2DAIE,sBACgB,wHAOhB,8DAEE,4BACA,+BAGF,qBACA,QACE,4DACA,0DACA,gCAEE,0CAGJ,wCAEE,0CACA,2CAEF,8BACA,kBACE,6DACA,wCAGF,6BAEE,wDACA,4DACA,wCAGF,yBACA,0BAEA,uBAEE,uBACA,sBAGJ","sources":["lt.css"],"sourcesContent":[".lt-wrap { overflow-x: auto; }\n.lt-table {\n --bg: 4px solid transparent;\n --bd: 1.5px solid #888;\n\n th, td{ padding: 5px; }\n border-collapse: separate;\n caption-side: top;\n margin: 1em auto;\n border-spacing: 0;\n border-top: var(--bd);\n border-bottom: var(--bd);\n\n caption {\n padding: .5em; text-align: center; border-top: var(--bd);\n .lt-title { font-size: 1.2em; }\n .lt-subtitle { font-size: 0.9em; }\n }\n\n th { font-weight: normal; }\n tbody {\n :not(:last-child) :is(td, th) { border-bottom: 1px solid #ddd; }\n .lt-row-group :is(td, th) { border-bottom: 1.5px solid #ddd; }\n .lt-row-group {\n text-align: left;\n &.lt-row-open { border-bottom-color: transparent; }\n }\n }\n thead th {\n border-bottom: 1px solid #888;\n &:not(:first-child) { border-left: var(--bg); }\n &:not(:last-child) { border-right: var(--bg); }\n }\n .lt-indent { padding-left: 1em; }\n .lt-spanner-row {\n .lt-spanner { border-bottom: 1px solid #bbb; text-align: center; }\n .lt-spanner-empty { border-bottom: none; }\n }\n\n .lt-footer {\n font-size: 0.85em;\n .lt-footnote:first-child td { border-top: 1px solid #aaa; }\n .lt-source-note:first-child td { border-top: 1px dashed #aaa; }\n .lt-source-note td { font-style: italic; }\n }\n\n .al-r { text-align: right; }\n .al-c { text-align: center; }\n\n .lt-fnref {\n color: #06c;\n &::before { content: \"\\00a0[\"; }\n &::after { content: \"]\"; }\n }\n}\n.lt-raw [title]::after {\n content: \" (\" attr(title) \")\";\n background: lightyellow;\n font-size: 0.85em;\n}\n"],"names":[]}
package/js/lt-input.js ADDED
@@ -0,0 +1,66 @@
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
+ tbl.classList.add("lt-edit");
24
+ rows.forEach(tr => cols.forEach((c, i) => {
25
+ if (spec.input.includes(c)) tr.cells[i].contentEditable = "plaintext-only";
26
+ }));
27
+ on(tbl, "focusin", e => { // edit the raw value, not its display
28
+ const [td, c, r] = hit(e) || [];
29
+ if (td) td.textContent = spec.data[c][r] ?? "";
30
+ });
31
+ on(tbl, "focusout", e => {
32
+ const [td, c, r] = hit(e) || [];
33
+ if (!td) return;
34
+ const col = spec.data[c], v = td.textContent.trim();
35
+ if (!numCol(col)) col[r] = td.textContent;
36
+ else if (isNaN(v)) td.textContent = col[r] ?? ""; // reject non-numeric
37
+ else col[r] = v === "" ? null : +v;
38
+ tbl.dispatchEvent(new CustomEvent("lt-edit", { bubbles: true }));
39
+ });
40
+ on(tbl, "keydown", e => { // Enter commits and moves down a row
41
+ const [td, , r] = hit(e) || [];
42
+ if (!td || e.key !== "Enter") return;
43
+ e.preventDefault();
44
+ (rows[r + 1]?.cells[td.cellIndex] || td).focus();
45
+ td.blur();
46
+ });
47
+ };
48
+
49
+ LT.plugins.input = 1;
50
+ LT.onMount.push(onMount);
51
+ if (typeof document !== "undefined")
52
+ $$(document, ".lt-table").forEach(t => onMount(t, t._ltSpec));
53
+
54
+ // Shiny input binding: <div class="lt-input" data-spec='{...}'>
55
+ if (!root.Shiny) return;
56
+ const draw = (el, spec) => el._tbl = LT.render(el, spec);
57
+ Shiny.inputBindings.register(Object.assign(new Shiny.InputBinding(), {
58
+ find: scope => $(scope).find(".lt-input"),
59
+ initialize: el => draw(el, JSON.parse(el.dataset.spec)),
60
+ getType: () => "lt.table",
61
+ getValue: el => el._tbl._ltSpec.data,
62
+ subscribe: (el, cb) => $(el).on("lt-edit.lt", () => cb(true)),
63
+ unsubscribe: el => $(el).off(".lt"),
64
+ receiveMessage: (el, msg) => { draw(el, { input: el._tbl._ltSpec.input, ...msg.spec }); $(el).trigger("lt-edit"); }
65
+ }), "lt.input");
66
+ })(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,l=(t,e)=>{if(!e?.input||e._rowspan||e.interactive)return;const l=[...n(t.tBodies[0],"tr:not(.lt-row-group)")],s=e._cols,u=t=>{const e=t.target.closest?.("td[contenteditable]");return e&&[e,s[e.cellIndex],l.indexOf(e.parentNode)]};t.classList.add("lt-edit"),l.forEach(t=>s.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,l,s]=u(n)||[];if(!i)return;const c=e.data[l],r=i.textContent.trim();o(c)?isNaN(r)?i.textContent=c[s]??"":c[s]=""===r?null:+r:c[s]=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(),(l[n+1]?.cells[e.cellIndex]||e).focus(),e.blur())})};if(e.plugins.input=1,e.onMount.push(l),"undefined"!=typeof document&&n(document,".lt-table").forEach(t=>l(t,t._ltSpec)),!t.Shiny)return;const s=(t,n)=>t._tbl=e.render(t,n);Shiny.inputBindings.register(Object.assign(new Shiny.InputBinding,{find:t=>$(t).find(".lt-input"),initialize:t=>s(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)=>{s(t,{input:t._tbl._ltSpec.input,...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","classList","add","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,cAE9Df,EAAIgB,UAAUC,IAAI,WAClBb,EAAKc,QAAQC,GAAMb,EAAKY,QAAQ,CAACE,EAAGC,KAC9BpB,EAAKL,MAAM0B,SAASF,KAAID,EAAGI,MAAMF,GAAGG,gBAAkB,qBAE5D1B,EAAGE,EAAK,UAAWS,IACjB,MAAOC,EAAIU,EAAGK,GAAKjB,EAAIC,IAAM,GACzBC,IAAIA,EAAGgB,YAAczB,EAAK0B,KAAKP,GAAGK,IAAM,MAE9C3B,EAAGE,EAAK,WAAYS,IAClB,MAAOC,EAAIU,EAAGK,GAAKjB,EAAIC,IAAM,GAC7B,IAAKC,EAAI,OACT,MAAMkB,EAAM3B,EAAK0B,KAAKP,GAAIS,EAAInB,EAAGgB,YAAYI,OACxC/B,EAAO6B,GACHG,MAAMF,GAAInB,EAAGgB,YAAcE,EAAIH,IAAM,GACzCG,EAAIH,GAAW,KAANI,EAAW,MAAQA,EAFfD,EAAIH,GAAKf,EAAGgB,YAG9B1B,EAAIgC,cAAc,IAAIC,YAAY,UAAW,CAAEC,SAAS,OAE1DpC,EAAGE,EAAK,UAAWS,IACjB,MAAOC,EAAI,CAAEe,GAAKjB,EAAIC,IAAM,GACvBC,GAAgB,UAAVD,EAAE0B,MACb1B,EAAE2B,kBACDhC,EAAKqB,EAAI,IAAIF,MAAMb,EAAGG,YAAcH,GAAI2B,QACzC3B,EAAG4B,WAUP,GANA7C,EAAGE,QAAQC,MAAQ,EACnBH,EAAGC,QAAQ6C,KAAK7C,GACQ,oBAAb8C,UACT3C,EAAG2C,SAAU,aAAatB,QAAQuB,GAAK/C,EAAQ+C,EAAGA,EAAEC,WAGjDlD,EAAKmD,MAAO,OACjB,MAAMC,EAAO,CAACC,EAAI5C,IAAS4C,EAAGC,KAAOrD,EAAGsD,OAAOF,EAAI5C,GACnD0C,MAAMK,cAAcC,SAASC,OAAOC,OAAO,IAAIR,MAAMS,aAAgB,CACnEC,KAAMC,GAASC,EAAED,GAAOD,KAAK,aAC7BG,WAAYX,GAAMD,EAAKC,EAAIY,KAAKC,MAAMb,EAAGc,QAAQ1D,OACjD2D,QAAS,IAAM,WACfC,SAAUhB,GAAMA,EAAGC,KAAKJ,QAAQf,KAChCmC,UAAW,CAACjB,EAAIkB,IAAOR,EAAEV,GAAI/C,GAAG,aAAc,IAAMiE,GAAG,IACvDC,YAAanB,GAAMU,EAAEV,GAAIoB,IAAI,OAC7BC,eAAgB,CAACrB,EAAIsB,KAAUvB,EAAKC,EAAI,CAAEjD,MAAOiD,EAAGC,KAAKJ,QAAQ9C,SAAUuE,EAAIlE,OAASsD,EAAEV,GAAIuB,QAAQ,cACpG,WACL,EA1DD,CA0DqB,oBAAXC,OAAyBA,OAASC","ignoreList":[]}