pixelize-design-library 2.3.1-beta.3 → 2.3.1-beta.5
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/.claude/settings.local.json +19 -1
- package/dist/Components/KanbanBoard/AccountCard.js +17 -14
- package/dist/Components/KanbanBoard/KanbanBoard.js +93 -78
- package/dist/Components/SearchSelect/SearchSelect.js +53 -21
- package/dist/Components/Table/Table.d.ts +1 -1
- package/dist/Components/Table/Table.js +67 -26
- package/dist/Components/Table/TableProps.d.ts +7 -1
- package/dist/Components/Table/components/TableActions.d.ts +2 -2
- package/dist/Components/Table/components/TableActions.js +5 -4
- package/dist/Components/Table/components/TableBody.js +84 -18
- package/dist/Components/Table/settings/TableSettings.d.ts +3 -1
- package/dist/Components/Table/settings/TableSettings.js +30 -5
- package/dist/Utils/table.d.ts +6 -1
- package/dist/Utils/table.js +47 -27
- package/package.json +1 -1
package/dist/Utils/table.js
CHANGED
|
@@ -137,14 +137,19 @@ function pickTableColor(value, palette, override) {
|
|
|
137
137
|
return { solid: "#8B3FC8", soft: "#8B3FC822", text: "#8B3FC8" };
|
|
138
138
|
return palette[hashKey(value) % palette.length];
|
|
139
139
|
}
|
|
140
|
-
/**
|
|
140
|
+
/**
|
|
141
|
+
* Partition rows by a column, preserving first-seen group order. The group key is
|
|
142
|
+
* a normalized string so object/array values (e.g. a `user` field that is an object
|
|
143
|
+
* or an array of users) group together by their readable text instead of by object
|
|
144
|
+
* identity.
|
|
145
|
+
*/
|
|
141
146
|
function groupRows(data, groupBy) {
|
|
142
147
|
var order = [];
|
|
143
148
|
var map = new Map();
|
|
144
149
|
for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {
|
|
145
150
|
var row = data_1[_i];
|
|
146
|
-
var
|
|
147
|
-
var key =
|
|
151
|
+
var text = getStringValue(row[groupBy]);
|
|
152
|
+
var key = text === "" ? "—" : text;
|
|
148
153
|
if (!map.has(key)) {
|
|
149
154
|
map.set(key, []);
|
|
150
155
|
order.push(key);
|
|
@@ -170,21 +175,49 @@ var extractTextFromReactNode = function (node) {
|
|
|
170
175
|
}
|
|
171
176
|
return "";
|
|
172
177
|
};
|
|
178
|
+
/** Best-effort readable text for an entity object (user/relation/option/etc.). */
|
|
179
|
+
var objectToText = function (o) {
|
|
180
|
+
var _a, _b;
|
|
181
|
+
if (typeof o.label === "string" || typeof o.label === "number")
|
|
182
|
+
return String(o.label);
|
|
183
|
+
if (typeof o.name === "string" || typeof o.name === "number")
|
|
184
|
+
return String(o.name);
|
|
185
|
+
var first = (_a = o.first_name) !== null && _a !== void 0 ? _a : o.firstName;
|
|
186
|
+
var last = (_b = o.last_name) !== null && _b !== void 0 ? _b : o.lastName;
|
|
187
|
+
if (typeof first === "string" || typeof last === "string") {
|
|
188
|
+
return "".concat(first !== null && first !== void 0 ? first : "", " ").concat(last !== null && last !== void 0 ? last : "").trim();
|
|
189
|
+
}
|
|
190
|
+
if (typeof o.full_name === "string")
|
|
191
|
+
return o.full_name;
|
|
192
|
+
if (typeof o.title === "string")
|
|
193
|
+
return o.title;
|
|
194
|
+
if (typeof o.company_name === "string")
|
|
195
|
+
return o.company_name;
|
|
196
|
+
if (typeof o.email === "string")
|
|
197
|
+
return o.email;
|
|
198
|
+
if (typeof o.value === "string" || typeof o.value === "number")
|
|
199
|
+
return String(o.value);
|
|
200
|
+
return "";
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Readable string for any cell value. Handles primitives, React elements, entity
|
|
204
|
+
* objects (e.g. `user`: `{ name }` / `{ first_name, last_name }`), and arrays of
|
|
205
|
+
* any of those (e.g. a multi-user field) by joining their texts.
|
|
206
|
+
*/
|
|
173
207
|
var getStringValue = function (value) {
|
|
174
|
-
if (
|
|
208
|
+
if (value === null || value === undefined)
|
|
209
|
+
return "";
|
|
210
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
175
211
|
return String(value);
|
|
176
212
|
}
|
|
177
213
|
if (react_1.default.isValidElement(value)) {
|
|
178
214
|
return extractTextFromReactNode(value);
|
|
179
215
|
}
|
|
180
|
-
if (value
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
if (typeof o.name === "string" || typeof o.name === "number") {
|
|
186
|
-
return String(o.name);
|
|
187
|
-
}
|
|
216
|
+
if (Array.isArray(value)) {
|
|
217
|
+
return value.map(getStringValue).filter(function (s) { return s !== ""; }).join(", ");
|
|
218
|
+
}
|
|
219
|
+
if (typeof value === "object") {
|
|
220
|
+
return objectToText(value);
|
|
188
221
|
}
|
|
189
222
|
return "";
|
|
190
223
|
};
|
|
@@ -203,21 +236,8 @@ function normalizeTableCellValue(value) {
|
|
|
203
236
|
if (react_1.default.isValidElement(value)) {
|
|
204
237
|
return value;
|
|
205
238
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
if (typeof o.label === "string" || typeof o.label === "number") {
|
|
209
|
-
return String(o.label);
|
|
210
|
-
}
|
|
211
|
-
if (typeof o.name === "string" || typeof o.name === "number") {
|
|
212
|
-
return String(o.name);
|
|
213
|
-
}
|
|
214
|
-
if (typeof o.title === "string")
|
|
215
|
-
return o.title;
|
|
216
|
-
if (typeof o.company_name === "string")
|
|
217
|
-
return o.company_name;
|
|
218
|
-
return "";
|
|
219
|
-
}
|
|
220
|
-
return String(value);
|
|
239
|
+
// Objects (relation/user) and arrays (multi-user / multi-select) → readable text.
|
|
240
|
+
return getStringValue(value);
|
|
221
241
|
}
|
|
222
242
|
var searchAndSortData = function (data, searchValues) {
|
|
223
243
|
var filteredData = data.filter(function (item) {
|