pixelize-design-library 2.2.188 → 2.2.189
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/coverage/clover.xml +638 -0
- package/coverage/coverage-final.json +20 -0
- package/coverage/lcov-report/Table/CompactSelect.tsx.html +379 -0
- package/coverage/lcov-report/Table/Components/ActiveFilters.tsx.html +514 -0
- package/coverage/lcov-report/Table/Components/HeaderActions.tsx.html +373 -0
- package/coverage/lcov-report/Table/Components/Pagination.tsx.html +574 -0
- package/coverage/lcov-report/Table/Components/TableActions.tsx.html +574 -0
- package/coverage/lcov-report/Table/Components/TableBody.tsx.html +1027 -0
- package/coverage/lcov-report/Table/Components/TableFilters.tsx.html +397 -0
- package/coverage/lcov-report/Table/Components/TableHeader.tsx.html +1060 -0
- package/coverage/lcov-report/Table/Components/TableLoading.tsx.html +361 -0
- package/coverage/lcov-report/Table/Components/TableSearch.tsx.html +337 -0
- package/coverage/lcov-report/Table/Components/index.html +266 -0
- package/coverage/lcov-report/Table/Components/useDebounce.ts.html +178 -0
- package/coverage/lcov-report/Table/Components/useTable.ts.html +778 -0
- package/coverage/lcov-report/Table/LeftFilterPane.tsx.html +1810 -0
- package/coverage/lcov-report/Table/SelectOperationControls.tsx.html +178 -0
- package/coverage/lcov-report/Table/Table.tsx.html +1567 -0
- package/coverage/lcov-report/Table/TableProps.tsx.html +658 -0
- package/coverage/lcov-report/Table/TableSettings/ManageColumns.tsx.html +619 -0
- package/coverage/lcov-report/Table/TableSettings/TableFilters.tsx.html +229 -0
- package/coverage/lcov-report/Table/TableSettings/TableSettings.tsx.html +532 -0
- package/coverage/lcov-report/Table/TableSettings/index.html +146 -0
- package/coverage/lcov-report/Table/TableToDo.tsx.html +973 -0
- package/coverage/lcov-report/Table/TextOperationControls.tsx.html +271 -0
- package/coverage/lcov-report/Table/filterTypes.ts.html +97 -0
- package/coverage/lcov-report/Table/index.html +176 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +146 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov.info +1836 -0
- package/debug-storybook.log +72 -0
- package/dist/Assets/defaultLogo.tsx +31 -0
- package/dist/Components/Editor/Editor.d.ts +2 -1
- package/dist/Components/Editor/Editor.js +39 -5
- package/dist/Components/KanbanBoard/AccountCard.d.ts +2 -2
- package/dist/Components/KanbanBoard/AccountCard.js +37 -4
- package/dist/Components/KanbanBoard/KanbanBoard.js +70 -34
- package/dist/Components/MultiSelect/MultiSelect.js +10 -19
- package/dist/Components/SearchSelect/SearchSelect.js +23 -16
- package/dist/Components/Table/Components/ActiveFilters.js +63 -22
- package/dist/Components/Table/Components/Pagination.d.ts +1 -1
- package/dist/Components/Table/Components/Pagination.js +41 -9
- package/dist/Components/Table/Components/TableFilters.js +11 -5
- package/dist/Components/Table/Components/useTable.js +36 -24
- package/dist/Theme/Dark/palette.d.ts +370 -0
- package/dist/Theme/Dark/palette.js +372 -0
- package/package.json +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
[14:50:38.093] [INFO] storybook v10.2.16
|
|
2
|
+
[14:50:40.124] [DEBUG] Getting package.json info for /Users/mahesh/Applications/Pixelize/CRM/Micro-Components/package.json...
|
|
3
|
+
[14:50:40.126] [WARN] You are currently using Storybook 10.2.16 but you have packages which are incompatible with it:
|
|
4
|
+
|
|
5
|
+
- @storybook/addon-essentials@8.6.14 which depends on 8.6.14
|
|
6
|
+
Repo: https://github.com/storybookjs/storybook/tree/next/code/addons/essentials
|
|
7
|
+
- @storybook/addon-interactions@8.6.14 which depends on 8.6.14
|
|
8
|
+
Repo: https://github.com/storybookjs/storybook/tree/next/code/addons/interactions
|
|
9
|
+
- @storybook/test@8.6.15 which depends on 8.6.15
|
|
10
|
+
Repo: https://github.com/storybookjs/storybook/tree/next/code/lib/test
|
|
11
|
+
|
|
12
|
+
Please consider updating your packages or contacting the maintainers for compatibility details.
|
|
13
|
+
|
|
14
|
+
For more details on compatibility guidance, see:
|
|
15
|
+
https://github.com/storybookjs/storybook/issues/32836
|
|
16
|
+
[14:50:40.147] [ERROR] [38;2;241;97;97mSB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: @storybook/react-vite/preset.
|
|
17
|
+
|
|
18
|
+
Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
|
|
19
|
+
|
|
20
|
+
If you believe this is a bug, please open an issue on Github.
|
|
21
|
+
|
|
22
|
+
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@storybook/react-vite' imported from /Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/_node-chunks/chunk-EBZ4DOUR.js
|
|
23
|
+
at packageResolve (node:internal/modules/esm/resolve:873:9)
|
|
24
|
+
at moduleResolve (node:internal/modules/esm/resolve:946:18)
|
|
25
|
+
at defaultResolve (node:internal/modules/esm/resolve:1188:11)
|
|
26
|
+
at nextResolve (node:internal/modules/esm/hooks:864:28)
|
|
27
|
+
at Hooks.resolve (node:internal/modules/esm/hooks:306:30)
|
|
28
|
+
at MessagePort.handleMessage (node:internal/modules/esm/worker:196:24)
|
|
29
|
+
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:831:20)
|
|
30
|
+
at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
|
|
31
|
+
|
|
32
|
+
More info:
|
|
33
|
+
[39m
|
|
34
|
+
at loadPreset (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/_node-chunks/chunk-UXMBIWPQ.js:10081:13)
|
|
35
|
+
at async Promise.all (index 0)
|
|
36
|
+
at async loadPresets (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/_node-chunks/chunk-UXMBIWPQ.js:10090:73)
|
|
37
|
+
at async getPresets (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/_node-chunks/chunk-UXMBIWPQ.js:10121:23)
|
|
38
|
+
at async buildDevStandalone (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/core-server/index.js:7661:17)
|
|
39
|
+
at async withTelemetry (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/_node-chunks/chunk-CSGMAQQ4.js:218:12)
|
|
40
|
+
at async dev (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/bin/core.js:2734:3)
|
|
41
|
+
at async _Command.<anonymous> (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/bin/core.js:2804:92)
|
|
42
|
+
[14:50:40.152] [WARN] Broken build, fix the error above.
|
|
43
|
+
You may need to refresh the browser.
|
|
44
|
+
[14:50:40.159] [WARN] Failed to load preset: {"name":"/Users/mahesh/Applications/Pixelize/CRM/Micro-Components/node_modules/@storybook/addon-essentials/dist/preset.js"} on level 2
|
|
45
|
+
[14:50:40.159] [ERROR] [38;2;241;97;97mError: Cannot find module 'storybook/internal/common'
|
|
46
|
+
Require stack:
|
|
47
|
+
- ./node_modules/@storybook/addon-essentials/dist/preset.js[39m
|
|
48
|
+
at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
|
|
49
|
+
at Module._load (node:internal/modules/cjs/loader:1043:27)
|
|
50
|
+
at Module.require (node:internal/modules/cjs/loader:1298:19)
|
|
51
|
+
at require (node:internal/modules/helpers:182:18)
|
|
52
|
+
at Object.<anonymous> (./node_modules/@storybook/addon-essentials/dist/preset.js:4:14)
|
|
53
|
+
at Module._compile (node:internal/modules/cjs/loader:1529:14)
|
|
54
|
+
at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
|
|
55
|
+
at Module.load (node:internal/modules/cjs/loader:1275:32)
|
|
56
|
+
at Module._load (node:internal/modules/cjs/loader:1096:12)
|
|
57
|
+
at cjsLoader (node:internal/modules/esm/translators:298:15)
|
|
58
|
+
[14:50:40.161] [WARN] Failed to load preset: {"name":"/Users/mahesh/Applications/Pixelize/CRM/Micro-Components/node_modules/@storybook/addon-interactions/dist/preset.js"} on level 2
|
|
59
|
+
[14:50:40.161] [ERROR] [38;2;241;97;97mError: Cannot find module 'storybook/internal/common'
|
|
60
|
+
Require stack:
|
|
61
|
+
- ./node_modules/@storybook/addon-interactions/dist/preset.js[39m
|
|
62
|
+
at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
|
|
63
|
+
at Module._load (node:internal/modules/cjs/loader:1043:27)
|
|
64
|
+
at Module.require (node:internal/modules/cjs/loader:1298:19)
|
|
65
|
+
at require (node:internal/modules/helpers:182:18)
|
|
66
|
+
at Object.<anonymous> (./node_modules/@storybook/addon-interactions/dist/preset.js:4:14)
|
|
67
|
+
at Module._compile (node:internal/modules/cjs/loader:1529:14)
|
|
68
|
+
at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
|
|
69
|
+
at Module.load (node:internal/modules/cjs/loader:1275:32)
|
|
70
|
+
at Module._load (node:internal/modules/cjs/loader:1096:12)
|
|
71
|
+
at cjsLoader (node:internal/modules/esm/translators:298:15)
|
|
72
|
+
[14:50:40.164] [INFO] Storybook collects completely anonymous usage telemetry. We use it to shape Storybook's roadmap and prioritize features. You can learn more, including how to opt out, at https://storybook.js.org/telemetry
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useCustomTheme } from "../Theme/useCustomTheme";
|
|
3
|
+
|
|
4
|
+
const DefaultLogo = () => {
|
|
5
|
+
const theme = useCustomTheme();
|
|
6
|
+
return (
|
|
7
|
+
<svg
|
|
8
|
+
width="12.09"
|
|
9
|
+
height="15.95"
|
|
10
|
+
viewBox="0 0 31 29"
|
|
11
|
+
fill="none"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
>
|
|
14
|
+
<path
|
|
15
|
+
d="M30.4999 6.26137V7.81058H15.9761H14.8787V22.8508V28.8862H12.5226C9.6824 28.8862 7.32632 26.4656 7.06812 23.3995C7.06812 23.2381 7.06812 23.0444 7.06812 22.8508V18.3323C7.06812 18.2677 7.06812 18.2032 7.06812 18.1063V15.5889V6.2291C7.06812 2.80793 9.84378 -5.72205e-06 13.2972 -5.72205e-06H24.8517C28.0147 0.355021 30.4676 3.00158 30.4676 6.2291L30.4999 6.26137Z"
|
|
16
|
+
fill={theme.colors.black}
|
|
17
|
+
/>
|
|
18
|
+
<path
|
|
19
|
+
d="M7.10053 23.3672H7.03598C5.16402 23.2381 3.48571 22.4635 2.25926 21.3338C0.871428 20.0428 0 18.2677 0 16.3312V15.6211H7.06825V18.1386C7.06825 18.2032 7.06825 18.2677 7.06825 18.3645V22.883C7.06825 23.0767 7.06825 23.2381 7.06825 23.4317L7.10053 23.3672Z"
|
|
20
|
+
fill={theme.colors.black}
|
|
21
|
+
/>
|
|
22
|
+
<path
|
|
23
|
+
d="M30.4678 12.0063V15.6211V17.1703C30.4678 20.6238 26.272 23.3994 21.0757 23.3994H14.8789V22.8508V15.6211H22.6572V7.81056C22.6895 7.81056 30.5001 7.81056 30.5001 7.81056V11.5868C30.5001 11.7159 30.5001 11.8772 30.5001 12.0063H30.4678Z"
|
|
24
|
+
fill={theme.colors.black}
|
|
25
|
+
/>
|
|
26
|
+
</svg>
|
|
27
|
+
|
|
28
|
+
)
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default DefaultLogo;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EditorProps } from "./EditorProps";
|
|
3
|
-
|
|
3
|
+
declare const Editor: React.NamedExoticComponent<EditorProps>;
|
|
4
|
+
export default Editor;
|
|
@@ -1,12 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
39
|
+
var react_1 = __importStar(require("react"));
|
|
8
40
|
var jodit_react_1 = __importDefault(require("jodit-react"));
|
|
9
|
-
function Editor(_a) {
|
|
41
|
+
var Editor = react_1.default.memo(function Editor(_a) {
|
|
10
42
|
var value = _a.value, key = _a.key, config = _a.config, editorRef = _a.editorRef, className = _a.className, onChange = _a.onChange, onBlur = _a.onBlur;
|
|
11
|
-
|
|
12
|
-
}
|
|
43
|
+
var stableConfig = (0, react_1.useMemo)(function () { return config; }, [JSON.stringify(config)]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
44
|
+
return (react_1.default.createElement(jodit_react_1.default, { key: key, config: stableConfig, value: value, ref: editorRef, className: className, onChange: onChange, onBlur: onBlur }));
|
|
45
|
+
});
|
|
46
|
+
exports.default = Editor;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Account, KanbanBoardProps } from "./KanbanBoardProps";
|
|
3
|
-
declare const AccountCard: ({ account, onDelete, onOpen, isExpanded, onToggleExpand, isDeletable, }: {
|
|
3
|
+
declare const AccountCard: React.MemoExoticComponent<({ account, onDelete, onOpen, isExpanded, onToggleExpand, isDeletable, }: {
|
|
4
4
|
account: Account;
|
|
5
5
|
index?: number;
|
|
6
6
|
onDelete: KanbanBoardProps["onDelete"];
|
|
@@ -8,5 +8,5 @@ declare const AccountCard: ({ account, onDelete, onOpen, isExpanded, onToggleExp
|
|
|
8
8
|
isExpanded?: boolean;
|
|
9
9
|
onToggleExpand?: () => void;
|
|
10
10
|
isDeletable?: boolean;
|
|
11
|
-
}) => React.JSX.Element
|
|
11
|
+
}) => React.JSX.Element>;
|
|
12
12
|
export default AccountCard;
|
|
@@ -1,19 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var react_1 =
|
|
39
|
+
var react_1 = __importStar(require("react"));
|
|
7
40
|
var react_2 = require("@chakra-ui/react");
|
|
8
41
|
var lucide_react_1 = require("lucide-react");
|
|
9
42
|
var useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
10
43
|
var AccountRow_1 = __importDefault(require("./AccountRow"));
|
|
11
44
|
var excludeKeys = ["id", "details"];
|
|
12
|
-
var AccountCard = function (_a) {
|
|
45
|
+
var AccountCard = react_1.default.memo(function (_a) {
|
|
13
46
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
14
47
|
var account = _a.account, onDelete = _a.onDelete, onOpen = _a.onOpen, _j = _a.isExpanded, isExpanded = _j === void 0 ? false : _j, onToggleExpand = _a.onToggleExpand, _k = _a.isDeletable, isDeletable = _k === void 0 ? true : _k;
|
|
15
48
|
var colors = (0, useCustomTheme_1.useCustomTheme)().colors;
|
|
16
|
-
var keys = Object.keys(account).filter(function (key) { return typeof account[key] === "string" && !excludeKeys.includes(key); });
|
|
49
|
+
var keys = (0, react_1.useMemo)(function () { return Object.keys(account).filter(function (key) { return typeof account[key] === "string" && !excludeKeys.includes(key); }); }, [account]);
|
|
17
50
|
var visibleKeys = isExpanded ? keys : keys.slice(0, 4);
|
|
18
51
|
var handleToggle = function () {
|
|
19
52
|
onToggleExpand === null || onToggleExpand === void 0 ? void 0 : onToggleExpand();
|
|
@@ -37,5 +70,5 @@ var AccountCard = function (_a) {
|
|
|
37
70
|
react_1.default.createElement(lucide_react_1.Trash2, { size: 16, color: (_g = colors === null || colors === void 0 ? void 0 : colors.red) === null || _g === void 0 ? void 0 : _g[600], onClick: function () { return onDelete === null || onDelete === void 0 ? void 0 : onDelete(account); }, cursor: "pointer", "aria-label": "Delete" }))),
|
|
38
71
|
react_1.default.createElement(react_2.Tooltip, { label: "Open" },
|
|
39
72
|
react_1.default.createElement(lucide_react_1.ExternalLink, { size: 16, color: (_h = colors === null || colors === void 0 ? void 0 : colors.blue) === null || _h === void 0 ? void 0 : _h[600], onClick: function () { return onOpen === null || onOpen === void 0 ? void 0 : onOpen(account); }, cursor: "pointer", "aria-label": "Open" })))))));
|
|
40
|
-
};
|
|
73
|
+
});
|
|
41
74
|
exports.default = AccountCard;
|
|
@@ -70,6 +70,31 @@ var OverflowTooltipText_1 = __importDefault(require("../SideBar/components/Overf
|
|
|
70
70
|
var Button_1 = __importDefault(require("../Button/Button"));
|
|
71
71
|
/** Narrow rail width when a column is horizontally collapsed. */
|
|
72
72
|
var COLLAPSED_KANBAN_COLUMN_WIDTH = "2.75rem";
|
|
73
|
+
var KanbanRow = react_1.default.memo(function (_a) {
|
|
74
|
+
var index = _a.index, style = _a.style, data = _a.data;
|
|
75
|
+
var items = data.items, colId = data.colId, canDrag = data.canDrag, expanded = data.expanded, onDelete = data.onDelete, onOpen = data.onOpen, canDelete = data.canDelete, setSize = data.setSize, toggleExpand = data.toggleExpand;
|
|
76
|
+
var account = items[index];
|
|
77
|
+
if (!account) {
|
|
78
|
+
return react_1.default.createElement("div", { style: style });
|
|
79
|
+
}
|
|
80
|
+
return (react_1.default.createElement("div", { style: style },
|
|
81
|
+
react_1.default.createElement(MeasuredItem_1.default, { index: index, setSize: function (i, h) { return setSize(i, h, colId); } },
|
|
82
|
+
react_1.default.createElement("div", { style: { marginBottom: 12 } },
|
|
83
|
+
react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id, isDragDisabled: !canDrag }, function (provided) {
|
|
84
|
+
var _a;
|
|
85
|
+
return (react_1.default.createElement("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: provided.draggableProps.style }), (account === null || account === void 0 ? void 0 : account.customNode) ? (_a = account === null || account === void 0 ? void 0 : account.customNode) === null || _a === void 0 ? void 0 : _a.call(account) : (react_1.default.createElement(AccountCard_1.default, { key: account.id, account: account, index: index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[account.id], onToggleExpand: function () {
|
|
86
|
+
return toggleExpand(account.id, colId, index);
|
|
87
|
+
}, isDeletable: canDelete }))));
|
|
88
|
+
})))));
|
|
89
|
+
});
|
|
90
|
+
var NoItemsTemplate = react_1.default.memo(function (_a) {
|
|
91
|
+
var _b;
|
|
92
|
+
var column = _a.column, noItems = _a.noItems, colors = _a.colors;
|
|
93
|
+
return (react_1.default.createElement(react_2.Box, null,
|
|
94
|
+
react_1.default.createElement(react_2.Flex, { flexDirection: "column", alignItems: "center", justifyContent: "center", gap: 2 },
|
|
95
|
+
react_1.default.createElement(react_2.Text, { fontSize: "sm", color: (_b = colors === null || colors === void 0 ? void 0 : colors.text) === null || _b === void 0 ? void 0 : _b[600], textAlign: "center", mt: 4 }, (noItems === null || noItems === void 0 ? void 0 : noItems.text) || "No items in this column"),
|
|
96
|
+
!(noItems === null || noItems === void 0 ? void 0 : noItems.isEmptyTextOnly) && (react_1.default.createElement(Button_1.default, { onClick: function () { var _a; return (_a = noItems === null || noItems === void 0 ? void 0 : noItems.onClick) === null || _a === void 0 ? void 0 : _a.call(noItems, column); }, size: "xs" }, (noItems === null || noItems === void 0 ? void 0 : noItems.buttonText) || "Add Item")))));
|
|
97
|
+
});
|
|
73
98
|
function reorderColumnEntries(entries, startIndex, endIndex) {
|
|
74
99
|
var result = Array.from(entries);
|
|
75
100
|
var removed = result.splice(startIndex, 1)[0];
|
|
@@ -191,6 +216,37 @@ var KanbanBoard = function (_a) {
|
|
|
191
216
|
var containerRef = (0, react_1.useRef)(null);
|
|
192
217
|
// store measured heights
|
|
193
218
|
var _4 = (0, react_1.useState)({}), sizes = _4[0], setSizes = _4[1];
|
|
219
|
+
var hasMountedSizes = (0, react_1.useRef)(false);
|
|
220
|
+
// Prune stale size entries when columns change (skip first render)
|
|
221
|
+
(0, react_1.useEffect)(function () {
|
|
222
|
+
if (!hasMountedSizes.current) {
|
|
223
|
+
hasMountedSizes.current = true;
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
setSizes(function (prev) {
|
|
227
|
+
if (Object.keys(prev).length === 0)
|
|
228
|
+
return prev;
|
|
229
|
+
var validKeys = new Set();
|
|
230
|
+
for (var _i = 0, _a = Object.entries(columns); _i < _a.length; _i++) {
|
|
231
|
+
var _b = _a[_i], colId = _b[0], col = _b[1];
|
|
232
|
+
for (var i = 0; i < col.items.length; i++) {
|
|
233
|
+
validKeys.add("".concat(colId, "-").concat(i));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
var pruned = {};
|
|
237
|
+
var changed = false;
|
|
238
|
+
for (var _c = 0, _d = Object.keys(prev); _c < _d.length; _c++) {
|
|
239
|
+
var key = _d[_c];
|
|
240
|
+
if (validKeys.has(key)) {
|
|
241
|
+
pruned[key] = prev[key];
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
changed = true;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return changed ? pruned : prev;
|
|
248
|
+
});
|
|
249
|
+
}, [columns]);
|
|
194
250
|
// update height for an item
|
|
195
251
|
var setSize = (0, react_1.useCallback)(function (index, size, colId) {
|
|
196
252
|
var key = "".concat(colId, "-").concat(index);
|
|
@@ -204,10 +260,10 @@ var KanbanBoard = function (_a) {
|
|
|
204
260
|
listRefs.current[colId].resetAfterIndex(index);
|
|
205
261
|
}
|
|
206
262
|
}, []);
|
|
207
|
-
var getItemSize = function (index, _items, colId) {
|
|
263
|
+
var getItemSize = (0, react_1.useCallback)(function (index, _items, colId) {
|
|
208
264
|
var key = "".concat(colId, "-").concat(index);
|
|
209
|
-
return (sizes[key] ||
|
|
210
|
-
};
|
|
265
|
+
return (sizes[key] || 80) + 12;
|
|
266
|
+
}, [sizes]);
|
|
211
267
|
// Calculate container height
|
|
212
268
|
(0, react_1.useEffect)(function () {
|
|
213
269
|
var calculateDimensions = function () {
|
|
@@ -291,32 +347,15 @@ var KanbanBoard = function (_a) {
|
|
|
291
347
|
var columnIds = ((_b = (_a = columns[colId]) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.map(function (item) { return item.id; })) || [];
|
|
292
348
|
onColumnDelete === null || onColumnDelete === void 0 ? void 0 : onColumnDelete(columnIds);
|
|
293
349
|
};
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
react_1.default.createElement(MeasuredItem_1.default, { index: index, setSize: function (i, h) { return setSize(i, h, colId); } },
|
|
304
|
-
react_1.default.createElement("div", { style: { marginBottom: 12 } },
|
|
305
|
-
react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id, isDragDisabled: !canDrag }, function (provided) {
|
|
306
|
-
var _a;
|
|
307
|
-
return (react_1.default.createElement("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: provided.draggableProps.style }), (account === null || account === void 0 ? void 0 : account.customNode) ? (_a = account === null || account === void 0 ? void 0 : account.customNode) === null || _a === void 0 ? void 0 : _a.call(account) : (react_1.default.createElement(AccountCard_1.default, { key: account.id, account: account, index: index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[account.id], onToggleExpand: function () {
|
|
308
|
-
return toggleExpand(account.id, colId, index);
|
|
309
|
-
}, isDeletable: canDelete }))));
|
|
310
|
-
})))));
|
|
311
|
-
};
|
|
312
|
-
var NoItemsTemplate = function (_a) {
|
|
313
|
-
var _b;
|
|
314
|
-
var column = _a.column;
|
|
315
|
-
return (react_1.default.createElement(react_2.Box, null,
|
|
316
|
-
react_1.default.createElement(react_2.Flex, { flexDirection: "column", alignItems: "center", justifyContent: "center", gap: 2 },
|
|
317
|
-
react_1.default.createElement(react_2.Text, { fontSize: "sm", color: (_b = colors === null || colors === void 0 ? void 0 : colors.text) === null || _b === void 0 ? void 0 : _b[600], textAlign: "center", mt: 4 }, (noItems === null || noItems === void 0 ? void 0 : noItems.text) || "No items in this column"),
|
|
318
|
-
!(noItems === null || noItems === void 0 ? void 0 : noItems.isEmptyTextOnly) && (react_1.default.createElement(Button_1.default, { onClick: function () { var _a; return (_a = noItems === null || noItems === void 0 ? void 0 : noItems.onClick) === null || _a === void 0 ? void 0 : _a.call(noItems, column); }, size: "xs" }, (noItems === null || noItems === void 0 ? void 0 : noItems.buttonText) || "Add Item")))));
|
|
319
|
-
};
|
|
350
|
+
var rowBaseProps = (0, react_1.useMemo)(function () { return ({
|
|
351
|
+
canDrag: canDrag,
|
|
352
|
+
expanded: expanded,
|
|
353
|
+
onDelete: onDelete,
|
|
354
|
+
onOpen: onOpen,
|
|
355
|
+
canDelete: canDelete,
|
|
356
|
+
setSize: setSize,
|
|
357
|
+
toggleExpand: toggleExpand,
|
|
358
|
+
}); }, [canDrag, expanded, onDelete, onOpen, canDelete, setSize, toggleExpand]);
|
|
320
359
|
var renderColumnDroppable = function (colId, column, columnDragHandleProps, isColCollapsed) { return (react_1.default.createElement(dnd_1.Droppable, { droppableId: colId, key: colId, mode: virtualization ? "virtual" : "standard", renderClone: function (provided, _snapshot, rubric) {
|
|
321
360
|
var _a;
|
|
322
361
|
var item = column.items[rubric.source.index];
|
|
@@ -391,17 +430,14 @@ var KanbanBoard = function (_a) {
|
|
|
391
430
|
},
|
|
392
431
|
cursor: canDrag ? "grab" : "not-allowed",
|
|
393
432
|
} },
|
|
394
|
-
(noItems === null || noItems === void 0 ? void 0 : noItems.isVisible) && column.items.length === 0 && (react_1.default.createElement(NoItemsTemplate, { column: column })),
|
|
433
|
+
(noItems === null || noItems === void 0 ? void 0 : noItems.isVisible) && column.items.length === 0 && (react_1.default.createElement(NoItemsTemplate, { column: column, noItems: noItems, colors: colors })),
|
|
395
434
|
virtualization ? (react_1.default.createElement(react_window_1.VariableSizeList, { ref: function (el) {
|
|
396
435
|
if (el)
|
|
397
436
|
listRefs.current[colId] = el;
|
|
398
437
|
}, height: containerHeight - 150, itemCount: column.items.length +
|
|
399
438
|
(snapshot.isUsingPlaceholder ? 1 : 0), itemSize: function (index) {
|
|
400
439
|
return getItemSize(index, column.items, colId);
|
|
401
|
-
}, width: "100%", itemData: {
|
|
402
|
-
items: column.items,
|
|
403
|
-
colId: colId,
|
|
404
|
-
} }, Row)) : (react_1.default.createElement(react_2.Box, null,
|
|
440
|
+
}, width: "100%", itemData: __assign(__assign({}, rowBaseProps), { items: column.items, colId: colId }) }, KanbanRow)) : (react_1.default.createElement(react_2.Box, null,
|
|
405
441
|
column.items.map(function (account, index) { return (react_1.default.createElement("div", { key: account.id, style: { marginBottom: 12 } },
|
|
406
442
|
react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id, isDragDisabled: !canDrag }, function (dragProvided) {
|
|
407
443
|
var _a;
|
|
@@ -78,17 +78,14 @@ function MultiSelect(_a) {
|
|
|
78
78
|
var value = _a.value, onValueChange = _a.onValueChange, _d = _a.width, width = _d === void 0 ? "100%" : _d, _e = _a.label, label = _e === void 0 ? "label" : _e, _f = _a.isRequired, isRequired = _f === void 0 ? true : _f, _g = _a.isInformation, isInformation = _g === void 0 ? false : _g, _h = _a.informationMessage, informationMessage = _h === void 0 ? "" : _h, name = _a.name, id = _a.id, _j = _a.placeholderText, placeholderText = _j === void 0 ? "Type valid email and press enter" : _j, isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly, _k = _a.size, size = _k === void 0 ? "md" : _k, inputStyle = _a.inputStyle, helperText = _a.helperText, error = _a.error, errorMessage = _a.errorMessage;
|
|
79
79
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
80
80
|
var s = (0, searchSelectSize_1.getSearchSelectSizeStyles)((size || "md"));
|
|
81
|
-
var
|
|
82
|
-
var
|
|
83
|
-
var
|
|
81
|
+
var options = value;
|
|
82
|
+
var _l = (0, react_1.useState)(""), inputValue = _l[0], setInputValue = _l[1];
|
|
83
|
+
var _m = (0, react_1.useState)(""), localError = _m[0], setLocalError = _m[1];
|
|
84
84
|
var inputRef = (0, react_1.useRef)(null);
|
|
85
|
-
(0, react_1.
|
|
86
|
-
setOptions(value);
|
|
87
|
-
}, [value]);
|
|
88
|
-
var handleInputChange = function (e) {
|
|
85
|
+
var handleInputChange = (0, react_1.useCallback)(function (e) {
|
|
89
86
|
setInputValue(e.target.value);
|
|
90
87
|
setLocalError("");
|
|
91
|
-
};
|
|
88
|
+
}, []);
|
|
92
89
|
var validateEmail = function (email) {
|
|
93
90
|
var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
94
91
|
return emailRegex.test(email);
|
|
@@ -102,23 +99,17 @@ function MultiSelect(_a) {
|
|
|
102
99
|
var existingOption = options.find(function (option) { return option.label === inputValue; });
|
|
103
100
|
if (!existingOption) {
|
|
104
101
|
var newOption = { id: generateUniqueId(), label: inputValue };
|
|
105
|
-
|
|
106
|
-
setOptions(updatedOptions);
|
|
107
|
-
onValueChange(updatedOptions);
|
|
102
|
+
onValueChange(__spreadArray(__spreadArray([], options, true), [newOption], false));
|
|
108
103
|
setInputValue("");
|
|
109
104
|
}
|
|
110
105
|
}
|
|
111
106
|
else if (e.key === "Backspace" && inputValue === "") {
|
|
112
|
-
|
|
113
|
-
setOptions(updatedOptions);
|
|
114
|
-
onValueChange(updatedOptions);
|
|
107
|
+
onValueChange(options.slice(0, -1));
|
|
115
108
|
}
|
|
116
109
|
};
|
|
117
|
-
var handleRemove = function (optionToRemove) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
onValueChange(updatedOptions);
|
|
121
|
-
};
|
|
110
|
+
var handleRemove = (0, react_1.useCallback)(function (optionToRemove) {
|
|
111
|
+
onValueChange(options.filter(function (option) { return option.id !== optionToRemove.id; }));
|
|
112
|
+
}, [options, onValueChange]);
|
|
122
113
|
return (react_1.default.createElement(react_2.Box, { width: width },
|
|
123
114
|
label && (react_1.default.createElement(FormLabel_1.TextLabel, { label: label, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })),
|
|
124
115
|
react_1.default.createElement(react_2.Flex, { wrap: "wrap", gap: s.gap, align: "center", px: s.px, border: "1px solid", borderColor: error || localError
|
|
@@ -67,6 +67,7 @@ var HelperText_1 = __importDefault(require("../Common/HelperText"));
|
|
|
67
67
|
var ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
|
|
68
68
|
var SelectTruncatedLabel_1 = __importDefault(require("./SelectTruncatedLabel"));
|
|
69
69
|
var searchSelectSize_1 = require("./searchSelectSize");
|
|
70
|
+
var Checkbox_1 = __importDefault(require("../Checkbox/Checkbox"));
|
|
70
71
|
var normalizeSingleValue = function (val) {
|
|
71
72
|
if (typeof val === "object" && val !== null && "id" in val && "label" in val) {
|
|
72
73
|
return val;
|
|
@@ -110,13 +111,16 @@ var SearchSelect = function (_a) {
|
|
|
110
111
|
: normalizeSingleValue(value)
|
|
111
112
|
? [normalizeSingleValue(value)]
|
|
112
113
|
: [];
|
|
113
|
-
var filteredOptions = options.filter(function (option) { var _a, _b; return (_b = (_a = option === null || option === void 0 ? void 0 : option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase()); });
|
|
114
|
+
var filteredOptions = (0, react_1.useMemo)(function () { return options.filter(function (option) { var _a, _b; return (_b = (_a = option === null || option === void 0 ? void 0 : option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase()); }); }, [options, inputValue]);
|
|
115
|
+
var onSearchRef = (0, react_1.useRef)(onSearch);
|
|
116
|
+
onSearchRef.current = onSearch;
|
|
114
117
|
(0, react_1.useEffect)(function () {
|
|
115
118
|
var delayDebounce = setTimeout(function () {
|
|
116
|
-
|
|
119
|
+
var _a;
|
|
120
|
+
(_a = onSearchRef.current) === null || _a === void 0 ? void 0 : _a.call(onSearchRef, inputValue);
|
|
117
121
|
}, 1000);
|
|
118
122
|
return function () { return clearTimeout(delayDebounce); };
|
|
119
|
-
}, [inputValue
|
|
123
|
+
}, [inputValue]);
|
|
120
124
|
(0, react_1.useEffect)(function () {
|
|
121
125
|
if (pagination === null || pagination === void 0 ? void 0 : pagination.limit) {
|
|
122
126
|
setHasMore(options.length % pagination.limit === 0);
|
|
@@ -142,8 +146,8 @@ var SearchSelect = function (_a) {
|
|
|
142
146
|
else {
|
|
143
147
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(option);
|
|
144
148
|
setIsOpen(false);
|
|
149
|
+
setInputValue("");
|
|
145
150
|
}
|
|
146
|
-
setInputValue("");
|
|
147
151
|
};
|
|
148
152
|
var handleRemove = function (id) {
|
|
149
153
|
var updated = selectedValues.filter(function (v) { return v.id !== id; });
|
|
@@ -167,16 +171,15 @@ var SearchSelect = function (_a) {
|
|
|
167
171
|
}
|
|
168
172
|
setInputValue("");
|
|
169
173
|
};
|
|
170
|
-
var
|
|
171
|
-
|
|
172
|
-
};
|
|
174
|
+
var selectedIdsSet = (0, react_1.useMemo)(function () { return new Set(selectedValues.map(function (v) { return v.id; })); }, [selectedValues]);
|
|
175
|
+
var isSelected = (0, react_1.useCallback)(function (id) { return selectedIdsSet.has(id); }, [selectedIdsSet]);
|
|
173
176
|
var isValidIcon = function (icon) {
|
|
174
177
|
return react_1.default.isValidElement(icon);
|
|
175
178
|
};
|
|
176
|
-
var allFilteredSelected =
|
|
177
|
-
filteredOptions.
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
var allFilteredSelected = (0, react_1.useMemo)(function () {
|
|
180
|
+
return filteredOptions.length > 0 &&
|
|
181
|
+
filteredOptions.every(function (opt) { return selectedIdsSet.has(opt.id); });
|
|
182
|
+
}, [filteredOptions, selectedIdsSet]);
|
|
180
183
|
var handleScroll = (0, react_1.useCallback)(function (e) {
|
|
181
184
|
if (!pagination ||
|
|
182
185
|
!pagination.onScroll ||
|
|
@@ -274,13 +277,17 @@ var SearchSelect = function (_a) {
|
|
|
274
277
|
}, "aria-label": "toggle-dropdown", display: "flex", alignItems: "center" }, isOpen ? (react_1.default.createElement(lucide_react_1.ChevronUp, { size: s.chevronSize })) : (react_1.default.createElement(lucide_react_1.ChevronDown, { size: s.chevronSize }))))))),
|
|
275
278
|
isOpen && (react_1.default.createElement(react_2.Box, { position: "absolute", zIndex: 10, width: "100%", maxH: "20rem", borderWidth: 1, borderRadius: "sm", bg: theme.colors.white, boxShadow: "md", display: "flex", flexDirection: "column" },
|
|
276
279
|
isMultiple && isSelectAll && (react_1.default.createElement(react_2.Box, { py: s.optionRowPy, px: 3, cursor: "pointer", onClick: handleSelectAll, display: "flex", alignItems: "center", gap: 2, borderBottom: "0.063rem solid ".concat(theme.colors.gray[100]) },
|
|
277
|
-
react_1.default.createElement(
|
|
280
|
+
react_1.default.createElement(Checkbox_1.default, { isChecked: allFilteredSelected, sx: { pointerEvents: "none" }, size: s.checkboxSize }),
|
|
278
281
|
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, allFilteredSelected ? "Unselect All" : "Select All"))),
|
|
279
|
-
react_1.default.createElement(react_2.Box, { flex: "1", overflowY: "auto", onScroll: handleScroll, maxH: "15rem", borderBottom: "0.063rem solid", borderColor: theme.colors.gray[200] }, isOptionLoading ? (react_1.default.createElement(react_2.Box, { py: s.optionRowPy, px: 3, display: "flex", alignItems: "center", gap: 2, minH: s.optionRowMinH },
|
|
282
|
+
react_1.default.createElement(react_2.Box, { flex: "1", overflowY: "auto", onScroll: handleScroll, maxH: "15rem", borderBottom: "0.063rem solid", borderColor: theme.colors.gray[200] }, isOptionLoading && filteredOptions.length === 0 ? (react_1.default.createElement(react_2.Box, { py: s.optionRowPy, px: 3, display: "flex", alignItems: "center", gap: 2, minH: s.optionRowMinH },
|
|
280
283
|
react_1.default.createElement(react_2.Spinner, { size: s.spinnerSize }),
|
|
281
|
-
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, loadingText))) : filteredOptions.length === 0 ? (react_1.default.createElement(react_2.Text, { p: 3, fontSize: s.dropdownTextFontSize, color: theme.colors.gray[500] }, "No results found")) : (
|
|
282
|
-
|
|
283
|
-
|
|
284
|
+
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, loadingText))) : !isOptionLoading && filteredOptions.length === 0 ? (react_1.default.createElement(react_2.Text, { p: 3, fontSize: s.dropdownTextFontSize, color: theme.colors.gray[500] }, "No results found")) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
285
|
+
filteredOptions.map(function (option) { return (react_1.default.createElement(react_2.Box, { key: option.id, py: s.optionRowPy, px: 3, minH: s.optionRowMinH, cursor: "pointer", bg: isSelected(option.id) ? theme.colors.gray[100] : "transparent", _hover: { bg: theme.colors.gray[50] }, onClick: function () { return handleSelect(option); }, display: "flex", alignItems: "center", gap: 2, borderBottom: "0.063rem solid ".concat(theme.colors.gray[100]) },
|
|
286
|
+
isMultiple && (react_1.default.createElement(Checkbox_1.default, { isChecked: isSelected(option.id), sx: { pointerEvents: "none" }, size: s.checkboxSize })),
|
|
287
|
+
option.view ? (react_1.default.createElement(react_1.default.Fragment, null, option.view)) : (react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, option.label)))); }),
|
|
288
|
+
((pagination === null || pagination === void 0 ? void 0 : pagination.scrollLoading) || (isOptionLoading && filteredOptions.length > 0)) && (react_1.default.createElement(react_2.Box, { py: s.optionRowPy, px: 3, display: "flex", alignItems: "center", justifyContent: "center", gap: 2, minH: s.optionRowMinH },
|
|
289
|
+
react_1.default.createElement(react_2.Spinner, { size: s.spinnerSize }),
|
|
290
|
+
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, loadingText)))))),
|
|
284
291
|
(addNew === null || addNew === void 0 ? void 0 : addNew.enabled) && (react_1.default.createElement(react_2.Box, { py: s.optionRowPy, px: 3, borderTop: "0.063rem solid", borderColor: theme.colors.gray[200], bg: theme.colors.white, display: "flex", alignItems: "center", gap: 2, minH: s.optionRowMinH, cursor: "pointer", onClick: addNew.onClick, _hover: { bg: theme.colors.gray[50] } },
|
|
285
292
|
addNew.icon || react_1.default.createElement(lucide_react_1.Plus, { size: s.addNewIconSize }),
|
|
286
293
|
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, addNew.text || "Add New"))))),
|