blixify-ui-web 1.2.199 → 1.2.200
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/lib/components/data/columnTypes/context.d.ts +1 -0
- package/lib/components/data/columnTypes/context.d.ts.map +1 -1
- package/lib/components/data/columnTypes/context.js.map +1 -1
- package/lib/components/data/columnTypes/dateRangeCell.d.ts.map +1 -1
- package/lib/components/data/columnTypes/dateRangeCell.js +2 -1
- package/lib/components/data/columnTypes/dateRangeCell.js.map +1 -1
- package/lib/components/data/columnTypes/personAvatar.d.ts +24 -0
- package/lib/components/data/columnTypes/personAvatar.d.ts.map +1 -0
- package/lib/components/data/columnTypes/personAvatar.js +89 -0
- package/lib/components/data/columnTypes/personAvatar.js.map +1 -0
- package/lib/components/data/columnTypes/timeTracking.d.ts +2 -0
- package/lib/components/data/columnTypes/timeTracking.d.ts.map +1 -1
- package/lib/components/data/columnTypes/timeTracking.js +14 -1
- package/lib/components/data/columnTypes/timeTracking.js.map +1 -1
- package/lib/components/data/columnTypes/timeTrackingCell.d.ts +7 -0
- package/lib/components/data/columnTypes/timeTrackingCell.d.ts.map +1 -1
- package/lib/components/data/columnTypes/timeTrackingCell.js +72 -17
- package/lib/components/data/columnTypes/timeTrackingCell.js.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.d.ts +20 -1
- package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +369 -206
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +6 -0
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.js +35 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.js.map +1 -1
- package/lib/components/data/flexFilter/index.d.ts.map +1 -1
- package/lib/components/data/flexFilter/index.js +1 -1
- package/lib/components/data/flexFilter/index.js.map +1 -1
- package/lib/components/data/listModule.d.ts +1 -0
- package/lib/components/data/listModule.d.ts.map +1 -1
- package/lib/components/data/listModule.js +17 -17
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/data/readModule.d.ts.map +1 -1
- package/lib/components/data/readModule.js +7 -14
- package/lib/components/data/readModule.js.map +1 -1
- package/lib/components/data/updateModule.d.ts.map +1 -1
- package/lib/components/data/updateModule.js +25 -21
- package/lib/components/data/updateModule.js.map +1 -1
- package/lib/components/display/newTable/columnWidth.d.ts +8 -0
- package/lib/components/display/newTable/columnWidth.d.ts.map +1 -0
- package/lib/components/display/newTable/columnWidth.js +32 -0
- package/lib/components/display/newTable/columnWidth.js.map +1 -0
- package/lib/components/display/newTable/index.d.ts +1 -0
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +57 -28
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/input/select/index.d.ts +2 -0
- package/lib/components/input/select/index.d.ts.map +1 -1
- package/lib/components/input/select/index.js +62 -16
- package/lib/components/input/select/index.js.map +1 -1
- package/lib/components/input/textInput/index.d.ts.map +1 -1
- package/lib/components/input/textInput/index.js +16 -11
- package/lib/components/input/textInput/index.js.map +1 -1
- package/lib/tail.css +12 -2
- package/package.json +1 -1
|
@@ -69,6 +69,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
73
|
+
var t = {};
|
|
74
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
75
|
+
t[p] = s[p];
|
|
76
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
77
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
78
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
79
|
+
t[p[i]] = s[p[i]];
|
|
80
|
+
}
|
|
81
|
+
return t;
|
|
82
|
+
};
|
|
72
83
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
73
84
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
74
85
|
if (ar || !(i in from)) {
|
|
@@ -112,6 +123,7 @@ var loading_1 = require("../loading");
|
|
|
112
123
|
var modal_1 = require("../modal");
|
|
113
124
|
var newPagination_1 = require("../newPagination");
|
|
114
125
|
var scrollShadow_1 = require("../scrollShadow");
|
|
126
|
+
var columnWidth_1 = require("./columnWidth");
|
|
115
127
|
var tag_1 = require("../tag");
|
|
116
128
|
// INFO: rows a section draws before its "Show more" — a 2,000-row section
|
|
117
129
|
// would otherwise mount every row (and every cell's controls) at once
|
|
@@ -1163,26 +1175,30 @@ var NewTable = function (props) {
|
|
|
1163
1175
|
}
|
|
1164
1176
|
});
|
|
1165
1177
|
}); };
|
|
1166
|
-
// INFO:
|
|
1167
|
-
//
|
|
1168
|
-
//
|
|
1169
|
-
// wins over the col.width
|
|
1178
|
+
// INFO: the width of a column being dragged, keyed by column key, until the
|
|
1179
|
+
// drag is released — then a caller with onResizeColumn keeps it, otherwise
|
|
1180
|
+
// it stays here until the table unmounts. Tailwind cannot emit a runtime
|
|
1181
|
+
// w-[Npx], so a width drives an inline style and wins over the col.width
|
|
1182
|
+
// class.
|
|
1170
1183
|
var _38 = (0, react_2.useState)({}), columnWidths = _38[0], setColumnWidths = _38[1];
|
|
1171
1184
|
var resizeRef = (0, react_2.useRef)(null);
|
|
1185
|
+
// INFO: a dragged width first, else the column's own fixed width in pixels
|
|
1186
|
+
// whatever form it is stored in ("180px", "w-[180px]", "w-48")
|
|
1187
|
+
var getColumnWidth = function (key) {
|
|
1188
|
+
if (columnWidths[key])
|
|
1189
|
+
return columnWidths[key];
|
|
1190
|
+
var col = flatColumns.find(function (eachCol) { return eachCol.key === key; });
|
|
1191
|
+
return (0, columnWidth_1.handleParseColumnWidth)(col === null || col === void 0 ? void 0 : col.width);
|
|
1192
|
+
};
|
|
1172
1193
|
// INFO: a consumer may deliberately set a column narrower than the default
|
|
1173
1194
|
// floor (a 40px icon column, say) — never force it wider than it was asked to
|
|
1174
1195
|
// be, so the floor drops to the configured width when that is smaller
|
|
1175
1196
|
var getColumnMinWidth = function (key) {
|
|
1176
1197
|
var col = flatColumns.find(function (eachCol) { return eachCol.key === key; });
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
return Math.min(MIN_COLUMN_WIDTH, parseInt(arbMatch[1], 10));
|
|
1182
|
-
var stdMatch = col.width.match(/w-(\d+)/);
|
|
1183
|
-
if (stdMatch)
|
|
1184
|
-
return Math.min(MIN_COLUMN_WIDTH, parseInt(stdMatch[1], 10) * 4);
|
|
1185
|
-
return MIN_COLUMN_WIDTH;
|
|
1198
|
+
var configured = (0, columnWidth_1.handleParseColumnWidth)(col === null || col === void 0 ? void 0 : col.width);
|
|
1199
|
+
return configured === undefined
|
|
1200
|
+
? MIN_COLUMN_WIDTH
|
|
1201
|
+
: Math.min(MIN_COLUMN_WIDTH, configured);
|
|
1186
1202
|
};
|
|
1187
1203
|
var handleResizeStart = function (event, key) {
|
|
1188
1204
|
var _a, _b, _c, _d, _e;
|
|
@@ -1203,8 +1219,23 @@ var NewTable = function (props) {
|
|
|
1203
1219
|
return (__assign(__assign({}, previous), (_a = {}, _a[resizing.key] = next, _a)));
|
|
1204
1220
|
});
|
|
1205
1221
|
};
|
|
1222
|
+
// INFO: reported once per drag, on release, and only when it moved
|
|
1206
1223
|
var handleResizeEnd = function () {
|
|
1224
|
+
var _a;
|
|
1225
|
+
var resizing = resizeRef.current;
|
|
1207
1226
|
resizeRef.current = null;
|
|
1227
|
+
if (!resizing || !((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.onResizeColumn))
|
|
1228
|
+
return;
|
|
1229
|
+
var width = columnWidths[resizing.key];
|
|
1230
|
+
if (!width || Math.round(width) === Math.round(resizing.startWidth))
|
|
1231
|
+
return;
|
|
1232
|
+
props.advSettings.onResizeColumn(resizing.key, Math.round(width));
|
|
1233
|
+
// INFO: the caller's width takes over in the same render, so a view
|
|
1234
|
+
// switched to later shows its own width rather than this drag's
|
|
1235
|
+
setColumnWidths(function (previous) {
|
|
1236
|
+
var _a = previous, _b = resizing.key, _released = _a[_b], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
1237
|
+
return rest;
|
|
1238
|
+
});
|
|
1208
1239
|
};
|
|
1209
1240
|
var handleDragStart = function (e, id) {
|
|
1210
1241
|
e.dataTransfer.setData("itemId", id);
|
|
@@ -1830,18 +1861,13 @@ var NewTable = function (props) {
|
|
|
1830
1861
|
// Falls back to measured DOM width for columns without explicit width.
|
|
1831
1862
|
var parsePinWidth = function (key) {
|
|
1832
1863
|
var _a;
|
|
1833
|
-
// INFO: a dragged width wins over the
|
|
1834
|
-
|
|
1835
|
-
|
|
1864
|
+
// INFO: a dragged or fixed width wins over the measured fallback
|
|
1865
|
+
var fixedWidth = getColumnWidth(key);
|
|
1866
|
+
if (fixedWidth)
|
|
1867
|
+
return fixedWidth;
|
|
1836
1868
|
var col = flatColumns.find(function (c) { return c.key === key; });
|
|
1837
1869
|
if (!(col === null || col === void 0 ? void 0 : col.width))
|
|
1838
1870
|
return (_a = measuredPinWidths[key]) !== null && _a !== void 0 ? _a : DEFAULT_PIN_WIDTH;
|
|
1839
|
-
var arbMatch = col.width.match(/\[(\d+)px\]/);
|
|
1840
|
-
if (arbMatch)
|
|
1841
|
-
return parseInt(arbMatch[1], 10);
|
|
1842
|
-
var stdMatch = col.width.match(/w-(\d+)/);
|
|
1843
|
-
if (stdMatch)
|
|
1844
|
-
return parseInt(stdMatch[1], 10) * 4;
|
|
1845
1871
|
return DEFAULT_PIN_WIDTH;
|
|
1846
1872
|
};
|
|
1847
1873
|
var style;
|
|
@@ -2255,7 +2281,10 @@ var NewTable = function (props) {
|
|
|
2255
2281
|
columnTypeActions.canUpdate &&
|
|
2256
2282
|
columnTypeActions.onUpdateCell &&
|
|
2257
2283
|
!col.disabled)
|
|
2258
|
-
return (react_2.default.createElement("td", { key: col.key, "data-cell-key": col.key,
|
|
2284
|
+
return (react_2.default.createElement("td", { key: col.key, "data-cell-key": col.key,
|
|
2285
|
+
// INFO: no padding — the cell's own button carries it, so the
|
|
2286
|
+
// whole cell is the click target
|
|
2287
|
+
className: "!p-0 text-sm ".concat(cellFontColor, " whitespace-nowrap ").concat((_d = (_c = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _c === void 0 ? void 0 : _c.className) !== null && _d !== void 0 ? _d : ""), style: (_e = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _e === void 0 ? void 0 : _e.style },
|
|
2259
2288
|
react_2.default.createElement(dateRangeCell_1.DateRangeCell, { column: __assign(__assign({}, col), { id: col.key, name: col.title, type: "dateRange" }), rowId: (_f = row.recordId) !== null && _f !== void 0 ? _f : row.id, value: resolveValue(row, col.key) })));
|
|
2260
2289
|
// INFO: a cell whose value is already a React element (row action
|
|
2261
2290
|
// buttons, a custom control) is rendered as-is even in an editable
|
|
@@ -2657,14 +2686,14 @@ var NewTable = function (props) {
|
|
|
2657
2686
|
: undefined }, renderSelectAll())),
|
|
2658
2687
|
flatColumns.map(function (col) {
|
|
2659
2688
|
var _a, _b, _c, _d;
|
|
2660
|
-
return (react_2.default.createElement("th", { key: col.key, className: "group/th relative ".concat(cellPadding, " text-left text-xs font-semibold uppercase tracking-wide ").concat(cursorClassname, " ").concat((_b = (_a = getPinProps(col.key, true)) === null || _a === void 0 ? void 0 : _a.className) !== null && _b !== void 0 ? _b : ""), style: __assign(__assign({}, (_c = getPinProps(col.key, true)) === null || _c === void 0 ? void 0 : _c.style), (
|
|
2689
|
+
return (react_2.default.createElement("th", { key: col.key, className: "group/th relative ".concat(cellPadding, " text-left text-xs font-semibold uppercase tracking-wide ").concat(cursorClassname, " ").concat((_b = (_a = getPinProps(col.key, true)) === null || _a === void 0 ? void 0 : _a.className) !== null && _b !== void 0 ? _b : ""), style: __assign(__assign({}, (_c = getPinProps(col.key, true)) === null || _c === void 0 ? void 0 : _c.style), (getColumnWidth(col.key)
|
|
2661
2690
|
? {
|
|
2662
|
-
width:
|
|
2663
|
-
minWidth:
|
|
2664
|
-
maxWidth:
|
|
2691
|
+
width: getColumnWidth(col.key),
|
|
2692
|
+
minWidth: getColumnWidth(col.key),
|
|
2693
|
+
maxWidth: getColumnWidth(col.key),
|
|
2665
2694
|
}
|
|
2666
2695
|
: {})), draggable: draggable, onDragStart: function (e) { return handleDragStart(e, col.key); }, onDrop: droppable ? function (e) { return handleDrop(e, col.key); } : undefined, onDragOver: handleDragOver },
|
|
2667
|
-
react_2.default.createElement("div", { className: "group/header flex flex-row items-center ".concat(
|
|
2696
|
+
react_2.default.createElement("div", { className: "group/header flex flex-row items-center ".concat(getColumnWidth(col.key) ? "" : ((_d = col.width) !== null && _d !== void 0 ? _d : "")) },
|
|
2668
2697
|
col.title,
|
|
2669
2698
|
renderHeaderIcons(col)),
|
|
2670
2699
|
react_2.default.createElement("span", { "data-testid": "table-column-resize-".concat(col.key), className: "group/grip absolute inset-y-0 -right-1 z-10 flex w-2 cursor-col-resize touch-none select-none items-stretch justify-center", draggable: false, onPointerDown: function (event) { return handleResizeStart(event, col.key); }, onPointerMove: handleResizeMove, onPointerUp: handleResizeEnd, onPointerCancel: handleResizeEnd, onClick: function (event) { return event.stopPropagation(); } },
|