wenay-react2 1.0.42 → 1.0.43
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/doc/changes/v1.0.43.md +10 -0
- package/doc/wenay-react2.md +3 -1
- package/lib/common/src/grid/columnState/ColumnDots.js +34 -17
- package/lib/common/src/styles/tokens.d.ts +3 -0
- package/lib/common/src/styles/tokens.js +3 -0
- package/lib/style/style.css +693 -679
- package/lib/style/tokens.css +11 -8
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# v1.0.43
|
|
2
|
+
|
|
3
|
+
Date: 2026-07-10
|
|
4
|
+
|
|
5
|
+
Status: released.
|
|
6
|
+
|
|
7
|
+
- Changed: `ColumnDots` drag is LIVE (user request from the stand, card 32: "отображать и выключать надо по мере движения — я так буду искать нужный мне столбик"): every EMPTY mark the dot crosses swaps the shown column immediately - the grid/cards follow the finger during the drag; the drop no longer commits a swap (it only settles selection and the tear-off). Occupied marks are passed over; a fixed dot still never swaps; the vertical tear-off flick hides the CURRENTLY shown column of the gesture.
|
|
8
|
+
- Added: a small label above the dragged dot (`.wenayColDotsDragLabel`, tokens `--cols-dots-drag-label-bg/color/font-size` + TS mirror) naming the currently shown column - sized for a finger on a phone.
|
|
9
|
+
- Changed: QA cards 29 and 32 do/expect texts updated to the live semantics.
|
|
10
|
+
- Verification: `npx tsc -p tsconfig.qa-check.json --noEmit`; `npm run testjest -- --runInBand` (62/62, incl. the two-way tokens sync test); stand 3010 card 32 - dragging the NOTE dot left across QTY to PRICE leaves the table showing NAME+PRICE with the dot settled on the PRICE mark (the drop path commits nothing, so the end state proves the live path), zero console errors.
|
package/doc/wenay-react2.md
CHANGED
|
@@ -341,7 +341,9 @@ keep `ColumnsMenu` for compact button strips or custom presentation-only menus.
|
|
|
341
341
|
Mobile (no ag-grid): dots selector + card rows over the same config:
|
|
342
342
|
```
|
|
343
343
|
<ColumnDots state={cs} max?=8 /> // track of marks; dots = shown columns; tap empty=add,
|
|
344
|
-
// drag=replace
|
|
344
|
+
// drag=LIVE replace (every empty mark crossed swaps the shown
|
|
345
|
+
// column immediately + small label names it - column search
|
|
346
|
+
// by finger), swipe up=remove, tap dot=select, sort cycles
|
|
345
347
|
<CardList<Row> state={cs} data={rows} getId? renderValue? /> // visible cols -> card fields; cardRole:'title'/'accent'
|
|
346
348
|
```
|
|
347
349
|
|
|
@@ -3,8 +3,11 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
// with dots on the columns that are currently shown. Placing a dot IS showing
|
|
4
4
|
// the column; the card view (CardList) rebuilds from the same config live.
|
|
5
5
|
// Gestures (pointer events, mouse + touch):
|
|
6
|
-
// drag a dot along the track ->
|
|
7
|
-
// column
|
|
6
|
+
// drag a dot along the track -> LIVE: every empty mark the dot crosses swaps
|
|
7
|
+
// the shown column immediately (the grid/cards
|
|
8
|
+
// follow the finger - that is how you SEARCH for
|
|
9
|
+
// a column on a phone); a small label above the
|
|
10
|
+
// finger names the currently shown column
|
|
8
11
|
// swipe a dot UP (flick off) -> the dot tears off the track: column hidden
|
|
9
12
|
// tap an empty mark -> a dot appears there: column shown
|
|
10
13
|
// tap a dot (no move) -> select the field (highlight); the sort
|
|
@@ -38,7 +41,7 @@ export function ColumnDots(p) {
|
|
|
38
41
|
function downDot(key, e) {
|
|
39
42
|
e.preventDefault();
|
|
40
43
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
41
|
-
gestureRef.current = { key, startX: e.clientX, startY: e.clientY, moved: false };
|
|
44
|
+
gestureRef.current = { key, startX: e.clientX, startY: e.clientY, moved: false, shown: key, fixed: !!byKey.get(key)?.fixed };
|
|
42
45
|
}
|
|
43
46
|
function moveDot(e) {
|
|
44
47
|
const g = gestureRef.current;
|
|
@@ -56,7 +59,17 @@ export function ColumnDots(p) {
|
|
|
56
59
|
const from = order.indexOf(g.key);
|
|
57
60
|
const off = -dy > REMOVE_DY && -dy > Math.abs(dx);
|
|
58
61
|
const to = Math.max(0, Math.min(n - 1, Math.round(from + dx / step)));
|
|
59
|
-
|
|
62
|
+
// LIVE swap: crossing an EMPTY mark shows that column immediately (the grid
|
|
63
|
+
// follows the finger - column search by dragging). Occupied marks are passed
|
|
64
|
+
// over; a fixed dot never swaps (same rule the old on-drop commit had).
|
|
65
|
+
if (!off && !g.fixed) {
|
|
66
|
+
const target = order[to];
|
|
67
|
+
if (target && target != g.shown && cfg.visible[target] == false) {
|
|
68
|
+
p.state.api.setConfig({ ...cfg, visible: { ...cfg.visible, [g.shown]: false, [target]: true } });
|
|
69
|
+
g.shown = target;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
setDrag({ key: g.key, dx, dy, to, off, shown: g.shown });
|
|
60
73
|
}
|
|
61
74
|
function upDot() {
|
|
62
75
|
const g = gestureRef.current;
|
|
@@ -71,21 +84,19 @@ export function ColumnDots(p) {
|
|
|
71
84
|
}
|
|
72
85
|
if (!st)
|
|
73
86
|
return;
|
|
74
|
-
|
|
87
|
+
// swaps already happened live during the move; the drop only settles
|
|
88
|
+
// selection and handles the tear-off of the CURRENTLY shown column
|
|
75
89
|
if (st.off) {
|
|
90
|
+
const meta = byKey.get(g.shown);
|
|
76
91
|
if (!meta?.fixed && visibleKeys.length > 1) {
|
|
77
|
-
p.state.api.show(g.
|
|
78
|
-
if (selected == g.key)
|
|
92
|
+
p.state.api.show(g.shown, false);
|
|
93
|
+
if (selected == g.key || selected == g.shown)
|
|
79
94
|
setSelected(null);
|
|
80
95
|
}
|
|
81
96
|
return;
|
|
82
97
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
p.state.api.setConfig({ ...cfg, visible: { ...cfg.visible, [g.key]: false, [target]: true } });
|
|
86
|
-
if (selected == g.key)
|
|
87
|
-
setSelected(target);
|
|
88
|
-
}
|
|
98
|
+
if (g.shown != g.key && selected == g.key)
|
|
99
|
+
setSelected(g.shown);
|
|
89
100
|
}
|
|
90
101
|
function tapMark(key) {
|
|
91
102
|
if (cfg.visible[key] != false)
|
|
@@ -101,11 +112,17 @@ export function ColumnDots(p) {
|
|
|
101
112
|
const isSorted = cfg.sort?.key == k;
|
|
102
113
|
return _jsxs("div", { onPointerUp: () => tapMark(k), className: cx(['wenayColDotsMark', vis ? 'wenayColDotsMark_on' : 'wenayColDotsMark_off']), style: { left: `${pct(i)}%`, cursor: !vis && visibleKeys.length < max ? 'pointer' : 'default' }, children: [isSorted && _jsx("div", { className: 'wenayColDotsSortMark', children: cfg.sort.dir == 'asc' ? '↑' : '↓' }), _jsx("div", { className: 'wenayColDotsMarkPin' }), _jsx("div", { className: 'wenayColDotsMarkLabel', children: short(k) })] }, 'm' + k);
|
|
103
114
|
}), order.map((k, i) => {
|
|
104
|
-
|
|
115
|
+
const d = drag?.key == k ? drag : null;
|
|
116
|
+
// the dragged dot stays mounted through live swaps (its column may be
|
|
117
|
+
// hidden mid-gesture; unmounting would kill the pointer capture)...
|
|
118
|
+
if (cfg.visible[k] == false && !d)
|
|
119
|
+
return null;
|
|
120
|
+
// ...and the live-shown column's resting dot is suppressed: its
|
|
121
|
+
// representation IS the dot under the finger
|
|
122
|
+
if (drag && !d && k == drag.shown && drag.shown != drag.key)
|
|
105
123
|
return null;
|
|
106
124
|
const meta = byKey.get(k);
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
return _jsx("div", { onPointerDown: e => downDot(k, e), onPointerMove: moveDot, onPointerUp: upDot, onPointerCancel: upDot, className: cx(['wenayColDotsDotWrap', d && 'wenayColDotsDotWrap_dragging', removing && 'wenayColDotsDotWrap_removing']), style: { left: `${pct(i)}%`, transform: d ? `translate(${d.dx}px, ${removing ? d.dy : 0}px)` : undefined }, children: _jsx("div", { className: cx(['wenayColDotsDot', selected == k && 'wenayColDotsDot_selected', meta?.fixed && 'wenayColDotsDot_fixed']) }) }, 'd' + k);
|
|
125
|
+
const removing = !!d?.off && !byKey.get(d.shown)?.fixed && visibleKeys.length > 1;
|
|
126
|
+
return _jsxs("div", { onPointerDown: e => downDot(k, e), onPointerMove: moveDot, onPointerUp: upDot, onPointerCancel: upDot, className: cx(['wenayColDotsDotWrap', d && 'wenayColDotsDotWrap_dragging', removing && 'wenayColDotsDotWrap_removing']), style: { left: `${pct(i)}%`, transform: d ? `translate(${d.dx}px, ${removing ? d.dy : 0}px)` : undefined }, children: [d && !d.off && _jsx("div", { className: 'wenayColDotsDragLabel', children: short(d.shown) }), _jsx("div", { className: cx(['wenayColDotsDot', selected == k && 'wenayColDotsDot_selected', meta?.fixed && 'wenayColDotsDot_fixed']) })] }, 'd' + k);
|
|
110
127
|
})] })] });
|
|
111
128
|
}
|
|
@@ -133,6 +133,9 @@ export declare const tokens: {
|
|
|
133
133
|
readonly selectedBg: "#0969da";
|
|
134
134
|
readonly selectedBorder: "#b6d4fe";
|
|
135
135
|
readonly fixedBorder: "#afb8c1";
|
|
136
|
+
readonly dragLabelBg: "#24292f";
|
|
137
|
+
readonly dragLabelColor: "#fff";
|
|
138
|
+
readonly dragLabelFontSize: "10px";
|
|
136
139
|
};
|
|
137
140
|
/** CardList chrome (--cols-card-*). Defaults preserve restored card-29 look. */
|
|
138
141
|
readonly colsCard: {
|
|
@@ -137,6 +137,9 @@ export const tokens = {
|
|
|
137
137
|
selectedBg: '#0969da',
|
|
138
138
|
selectedBorder: '#b6d4fe',
|
|
139
139
|
fixedBorder: '#afb8c1',
|
|
140
|
+
dragLabelBg: '#24292f',
|
|
141
|
+
dragLabelColor: '#fff',
|
|
142
|
+
dragLabelFontSize: '10px',
|
|
140
143
|
},
|
|
141
144
|
/** CardList chrome (--cols-card-*). Defaults preserve restored card-29 look. */
|
|
142
145
|
colsCard: {
|