pixelize-design-library 2.2.42 → 2.2.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.
|
@@ -216,7 +216,14 @@ var KanbanBoard = function (_a) {
|
|
|
216
216
|
react_1.default.createElement(react_2.Text, { fontWeight: "600", fontSize: "1rem", color: (_h = colors === null || colors === void 0 ? void 0 : colors.text) === null || _h === void 0 ? void 0 : _h[700] }, column.title),
|
|
217
217
|
hoveredColumn === colId && column.items.length > 0 && (react_1.default.createElement(react_2.Box, { as: lucide_react_1.Trash2, size: 16, cursor: "pointer", color: (_j = colors === null || colors === void 0 ? void 0 : colors.text) === null || _j === void 0 ? void 0 : _j[600], _hover: { color: (_k = colors === null || colors === void 0 ? void 0 : colors.red) === null || _k === void 0 ? void 0 : _k[600] }, onClick: function () { return handleColumnDelete(colId); }, transition: "color 0.2s ease" })),
|
|
218
218
|
!(hoveredColumn === colId && column.items.length > 0) && (react_1.default.createElement(react_2.Box, { width: "16px", height: "16px" }))),
|
|
219
|
-
react_1.default.createElement(react_2.Box
|
|
219
|
+
react_1.default.createElement(react_2.Box
|
|
220
|
+
// px={2}
|
|
221
|
+
// pb={2}
|
|
222
|
+
, {
|
|
223
|
+
// px={2}
|
|
224
|
+
// pb={2}
|
|
225
|
+
flex: "1", overflowY: "auto", width: "100%",
|
|
226
|
+
// mr={1} // Add right margin to create gap for scrollbar
|
|
220
227
|
/////LIST/////////////////////////////
|
|
221
228
|
sx: {
|
|
222
229
|
overflowY: "auto",
|
|
@@ -19,7 +19,8 @@ declare const useGetPreferences: ({ baseUrl, key, page, name, authToken, orgId,
|
|
|
19
19
|
};
|
|
20
20
|
declare const useSavePreferences: ({ baseUrl, key, page, name, authToken, orgId, }: PreferencesProps) => {
|
|
21
21
|
savePreferences: (data?: Record<string, any>) => void;
|
|
22
|
+
savePreferencesDebounced: (data?: Record<string, any>, wait?: number) => void;
|
|
22
23
|
loading: boolean;
|
|
23
|
-
error:
|
|
24
|
+
error: unknown;
|
|
24
25
|
};
|
|
25
26
|
export { useGetPreferences, useSavePreferences };
|
|
@@ -48,7 +48,7 @@ var useSavePreferences = function (_a) {
|
|
|
48
48
|
var _b = _a.baseUrl, baseUrl = _b === void 0 ? "" : _b, _c = _a.key, key = _c === void 0 ? "" : _c, _d = _a.page, page = _d === void 0 ? "" : _d, _e = _a.name, name = _e === void 0 ? "" : _e, _f = _a.authToken, authToken = _f === void 0 ? "" : _f, _g = _a.orgId, orgId = _g === void 0 ? "" : _g;
|
|
49
49
|
var _h = (0, react_1.useState)(false), loading = _h[0], setLoading = _h[1];
|
|
50
50
|
var _j = (0, react_1.useState)(null), error = _j[0], setError = _j[1];
|
|
51
|
-
var savePreferences = function (data) {
|
|
51
|
+
var savePreferences = (0, react_1.useCallback)(function (data) {
|
|
52
52
|
if (data === void 0) { data = {}; }
|
|
53
53
|
if (!baseUrl)
|
|
54
54
|
return;
|
|
@@ -59,18 +59,21 @@ var useSavePreferences = function (_a) {
|
|
|
59
59
|
Authorization: authToken,
|
|
60
60
|
"Content-Type": "application/json",
|
|
61
61
|
},
|
|
62
|
-
body: JSON.stringify({
|
|
63
|
-
key: key,
|
|
64
|
-
page: page,
|
|
65
|
-
name: name,
|
|
66
|
-
json: data,
|
|
67
|
-
}),
|
|
62
|
+
body: JSON.stringify({ key: key, page: page, name: name, json: data }),
|
|
68
63
|
})
|
|
69
|
-
.then(function (
|
|
70
|
-
.then(function (
|
|
71
|
-
.catch(function (
|
|
64
|
+
.then(function (r) { return r.json(); })
|
|
65
|
+
.then(function (d) { return console.log(d); })
|
|
66
|
+
.catch(function (e) { return setError(e); })
|
|
72
67
|
.finally(function () { return setLoading(false); });
|
|
73
|
-
};
|
|
74
|
-
|
|
68
|
+
}, [baseUrl, orgId, authToken, key, page, name]);
|
|
69
|
+
var debounceRef = (0, react_1.useRef)(null);
|
|
70
|
+
var savePreferencesDebounced = (0, react_1.useCallback)(function (data, wait) {
|
|
71
|
+
if (data === void 0) { data = {}; }
|
|
72
|
+
if (wait === void 0) { wait = 500; }
|
|
73
|
+
if (debounceRef.current)
|
|
74
|
+
window.clearTimeout(debounceRef.current);
|
|
75
|
+
debounceRef.current = window.setTimeout(function () { return savePreferences(data); }, wait);
|
|
76
|
+
}, [savePreferences]);
|
|
77
|
+
return { savePreferences: savePreferences, savePreferencesDebounced: savePreferencesDebounced, loading: loading, error: error };
|
|
75
78
|
};
|
|
76
79
|
exports.useSavePreferences = useSavePreferences;
|