ikoncomponents 1.1.5 → 1.1.7
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/dist/hooks/use-mobile.js +2 -38
- package/dist/ikoncomponents/action-menu/index.js +15 -18
- package/dist/ikoncomponents/action-menu/type.js +1 -2
- package/dist/ikoncomponents/alert-dialog/index.js +6 -10
- package/dist/ikoncomponents/buttons/index.js +32 -23
- package/dist/ikoncomponents/combobox-input/index.js +14 -16
- package/dist/ikoncomponents/combobox-input/type.js +1 -2
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +13 -16
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +22 -58
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +18 -21
- package/dist/ikoncomponents/data-table/datatable-pagination/index.js +10 -13
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +17 -19
- package/dist/ikoncomponents/data-table/function.js +4 -7
- package/dist/ikoncomponents/data-table/index.js +81 -116
- package/dist/ikoncomponents/data-table/type.js +1 -2
- package/dist/ikoncomponents/e-chart/index.js +32 -37
- package/dist/ikoncomponents/file-input/index.js +20 -11
- package/dist/ikoncomponents/glowing-effect/index.js +16 -18
- package/dist/ikoncomponents/icon/index.js +16 -40
- package/dist/ikoncomponents/loading-spinner/index.js +16 -8
- package/dist/ikoncomponents/multi-combobox/index.js +31 -30
- package/dist/ikoncomponents/no-data/index.js +4 -7
- package/dist/ikoncomponents/page-wrapper/index.js +5 -8
- package/dist/ikoncomponents/password-strength-meter/index.js +6 -13
- package/dist/ikoncomponents/phone-input/index.js +30 -54
- package/dist/ikoncomponents/resource-spreadsheet/index.js +11 -48
- package/dist/ikoncomponents/search-input/index.js +18 -9
- package/dist/ikoncomponents/sheet/index.js +5 -8
- package/dist/ikoncomponents/simple-widget/index.js +8 -11
- package/dist/ikoncomponents/tabs/index.js +20 -22
- package/dist/ikoncomponents/tabs/type.js +1 -2
- package/dist/ikoncomponents/theme-toggle-btn/index.js +8 -11
- package/dist/ikoncomponents/title-progress/index.js +4 -7
- package/dist/ikoncomponents/tooltip/index.js +4 -7
- package/dist/ikoncomponents/twolevel-dropdown/index.js +20 -53
- package/dist/ikoncomponents/widgets/index.js +10 -13
- package/dist/ikoncomponents/widgets/type.js +1 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +70 -123
- package/dist/shadcn/accordion.js +28 -51
- package/dist/shadcn/alert-dialog.js +60 -70
- package/dist/shadcn/alert.d.ts +1 -1
- package/dist/shadcn/alert.js +25 -15
- package/dist/shadcn/avatar.js +24 -47
- package/dist/shadcn/badge.d.ts +1 -1
- package/dist/shadcn/badge.js +21 -13
- package/dist/shadcn/button.d.ts +1 -1
- package/dist/shadcn/button.js +21 -13
- package/dist/shadcn/calendar.js +42 -97
- package/dist/shadcn/card.js +35 -25
- package/dist/shadcn/checkbox.js +19 -42
- package/dist/shadcn/command.js +53 -43
- package/dist/shadcn/date-input.js +25 -60
- package/dist/shadcn/date-range-picker.js +14 -18
- package/dist/shadcn/dialog.js +56 -79
- package/dist/shadcn/dropdown-menu.js +61 -84
- package/dist/shadcn/hover-card.js +24 -47
- package/dist/shadcn/input.js +17 -7
- package/dist/shadcn/label.js +18 -41
- package/dist/shadcn/navigation-menu.d.ts +1 -1
- package/dist/shadcn/navigation-menu.js +43 -68
- package/dist/shadcn/popover.js +27 -50
- package/dist/shadcn/progress.js +19 -42
- package/dist/shadcn/radio-group.js +23 -45
- package/dist/shadcn/scroll-area.js +22 -45
- package/dist/shadcn/select.js +58 -81
- package/dist/shadcn/separator.js +18 -41
- package/dist/shadcn/sheet.js +52 -73
- package/dist/shadcn/sidebar.d.ts +1 -1
- package/dist/shadcn/sidebar.js +113 -141
- package/dist/shadcn/skeleton.js +17 -7
- package/dist/shadcn/slider.js +19 -42
- package/dist/shadcn/sonner.js +20 -11
- package/dist/shadcn/switch.js +18 -41
- package/dist/shadcn/table.js +46 -36
- package/dist/shadcn/tabs.js +27 -50
- package/dist/shadcn/textarea.js +17 -7
- package/dist/shadcn/tooltip.js +27 -50
- package/dist/shadcn/workflow.js +8 -8
- package/dist/styles.css +3 -0
- package/dist/utils/cn.js +4 -7
- package/dist/utils/theme-provider/index.js +16 -7
- package/package.json +2 -1
|
@@ -1,47 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.Icon = Icon;
|
|
38
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
-
const LucideIcons = __importStar(require("lucide-react"));
|
|
40
|
-
function Icon({ name, ...props }) {
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import * as LucideIcons from 'lucide-react';
|
|
15
|
+
export function Icon(_a) {
|
|
16
|
+
var { name } = _a, props = __rest(_a, ["name"]);
|
|
41
17
|
const IconComponent = LucideIcons[name];
|
|
42
18
|
if (!IconComponent) {
|
|
43
19
|
console.warn(`Icon "${name}" not found in lucide-react`);
|
|
44
20
|
return null;
|
|
45
21
|
}
|
|
46
|
-
return (
|
|
22
|
+
return _jsx(IconComponent, Object.assign({}, props));
|
|
47
23
|
}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { cn } from "../../utils/cn";
|
|
14
|
+
export const LoadingSpinner = (_a) => {
|
|
15
|
+
var { size = 48, className, visible = true } = _a, props = __rest(_a, ["size", "className", "visible"]);
|
|
7
16
|
if (!visible)
|
|
8
17
|
return null;
|
|
9
|
-
return ((
|
|
18
|
+
return (_jsx("div", { className: "h-full w-full", children: _jsx("div", { className: "absolute inset-0 flex justify-center items-center z-50", children: _jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: size, height: size }, props, { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: cn("animate-spin", className), children: _jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) })) }) }));
|
|
10
19
|
};
|
|
11
|
-
exports.LoadingSpinner = LoadingSpinner;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MultiCombobox = MultiCombobox;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
2
|
// import React, { useEffect, useState } from 'react'
|
|
6
3
|
// import { Popover, PopoverContent, PopoverTrigger } from '@/shadcn/ui/popover'
|
|
7
4
|
// import { Button } from '@/shadcn/ui/button'
|
|
@@ -98,25 +95,25 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
98
95
|
// </>
|
|
99
96
|
// )
|
|
100
97
|
// }
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaultOptions = 2 }) {
|
|
110
|
-
const [selectedItems, setSelectedItems] =
|
|
111
|
-
const [search, setSearch] =
|
|
112
|
-
const containerRef =
|
|
113
|
-
const [open, setOpen] =
|
|
114
|
-
|
|
98
|
+
import { useEffect, useState, useRef, useCallback } from 'react';
|
|
99
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../../shadcn/popover';
|
|
100
|
+
import { Button } from '../../shadcn/button';
|
|
101
|
+
import { cn } from '../../utils/cn';
|
|
102
|
+
import { ChevronsUpDown, X } from 'lucide-react';
|
|
103
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '../../shadcn/command';
|
|
104
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../shadcn/tooltip';
|
|
105
|
+
import { Checkbox } from '../../shadcn/checkbox';
|
|
106
|
+
export function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaultOptions = 2 }) {
|
|
107
|
+
const [selectedItems, setSelectedItems] = useState(defaultValue || []);
|
|
108
|
+
const [search, setSearch] = useState("");
|
|
109
|
+
const containerRef = useRef(null);
|
|
110
|
+
const [open, setOpen] = useState(false);
|
|
111
|
+
useEffect(() => {
|
|
115
112
|
onValueChange(selectedItems);
|
|
116
113
|
}, [selectedItems, onValueChange]);
|
|
117
114
|
const filteredItems = items
|
|
118
115
|
.filter((item) => (item.label || item.value).toLowerCase().includes(search.toLowerCase()))
|
|
119
|
-
.sort((a, b) => (a
|
|
116
|
+
.sort((a, b) => { var _a, _b; return ((_a = a === null || a === void 0 ? void 0 : a.label) !== null && _a !== void 0 ? _a : "").localeCompare((_b = b === null || b === void 0 ? void 0 : b.label) !== null && _b !== void 0 ? _b : ""); });
|
|
120
117
|
const onWheel = (e) => {
|
|
121
118
|
const el = e.currentTarget;
|
|
122
119
|
el.scrollTop += e.deltaY;
|
|
@@ -128,8 +125,8 @@ function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaul
|
|
|
128
125
|
: [...selectedItems, value];
|
|
129
126
|
setSelectedItems(updatedItems);
|
|
130
127
|
};
|
|
131
|
-
const [visibleCount, setVisibleCount] =
|
|
132
|
-
const calculateVisibleItems =
|
|
128
|
+
const [visibleCount, setVisibleCount] = useState(selectedItems.length);
|
|
129
|
+
const calculateVisibleItems = useCallback(() => {
|
|
133
130
|
const container = containerRef.current;
|
|
134
131
|
if (!container)
|
|
135
132
|
return visibleCount;
|
|
@@ -149,7 +146,7 @@ function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaul
|
|
|
149
146
|
}
|
|
150
147
|
return fitCount;
|
|
151
148
|
}, [visibleCount]);
|
|
152
|
-
|
|
149
|
+
useEffect(() => {
|
|
153
150
|
const container = containerRef.current;
|
|
154
151
|
if (!container)
|
|
155
152
|
return;
|
|
@@ -170,9 +167,10 @@ function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaul
|
|
|
170
167
|
resizeObserver.disconnect();
|
|
171
168
|
};
|
|
172
169
|
}, [calculateVisibleItems]);
|
|
173
|
-
return ((
|
|
174
|
-
|
|
175
|
-
|
|
170
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, className: "w-full", children: _jsxs(Button, { variant: "outline", role: "combobox", className: cn("justify-between px-3 py-2 h-10", selectedItems.length === 0 && "text-foreground/50", "bg-secondary"), onClick: () => setOpen((prev) => !prev), children: [selectedItems.length > 0 ? (_jsx(TooltipProvider, { children: _jsxs("div", { ref: containerRef, className: "flex flex-wrap gap-2 items-center overflow-hidden flex-1", children: [selectedItems.slice(0, defaultOptions).map((value) => {
|
|
171
|
+
var _a;
|
|
172
|
+
const label = ((_a = items.find((item) => item.value === value)) === null || _a === void 0 ? void 0 : _a.label) || value;
|
|
173
|
+
return (_jsxs("span", { className: "flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full", title: label, children: [_jsx("span", { className: "truncate max-w-[120px]", children: label }), _jsx("span", { role: "button", tabIndex: 0, onClick: (e) => {
|
|
176
174
|
e.stopPropagation();
|
|
177
175
|
toggleItem(value);
|
|
178
176
|
}, onKeyDown: (e) => {
|
|
@@ -181,21 +179,24 @@ function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaul
|
|
|
181
179
|
e.stopPropagation();
|
|
182
180
|
toggleItem(value);
|
|
183
181
|
}
|
|
184
|
-
}, className: "ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none", children: (
|
|
185
|
-
}), selectedItems.length > defaultOptions && ((
|
|
182
|
+
}, className: "ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none", children: _jsx(X, { className: "w-3 h-3 ml-1" }) })] }, value));
|
|
183
|
+
}), selectedItems.length > defaultOptions && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("span", { className: "px-2 py-1 bg-secondary text-secondary-foreground dark:bg-secondary dark:text-secondary-foreground keross:bg-secondary keross:text-secondary-foreground rounded-md cursor-pointer", children: ["+", selectedItems.length - defaultOptions, " more"] }) }), _jsx(TooltipContent, { className: "max-w-xs break-words", children: _jsx("div", { onWheel: onWheel, className: "flex flex-col gap-1 max-h-[200px] overflow-auto", children: selectedItems.slice(defaultOptions).map((value) => {
|
|
184
|
+
var _a;
|
|
185
|
+
return (_jsx("span", { className: "text-sm", children: ((_a = items.find((item) => item.value === value)) === null || _a === void 0 ? void 0 : _a.label) || value }, value));
|
|
186
|
+
}) }) })] }))] }) })) : (_jsx("span", { className: "flex-1 text-left truncate", children: placeholder })), _jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })] }) }), _jsx(PopoverContent, { className: "p-0 min-w-[var(--radix-popover-trigger-width)]", style: { width: 'max-content', maxWidth: 'min(500px, 90vw)' }, align: "start", children: _jsxs(Command, { onMouseDown: (e) => e.preventDefault(), children: [_jsx(CommandInput, { placeholder: "Search...", value: search, onValueChange: setSearch }), _jsxs(CommandList, { onWheel: onWheel, className: "max-h-60 overflow-auto", children: [_jsx(CommandEmpty, { children: "No items found." }), _jsx(CommandGroup, { children: filteredItems.map((item) => {
|
|
186
187
|
const isSelected = selectedItems.includes(item.value);
|
|
187
188
|
const isDisabled = item.disabled === true || (typeof item.disabled === "function" && item.disabled(item));
|
|
188
|
-
return ((
|
|
189
|
+
return (_jsxs(CommandItem, { value: item.label || item.value, disabled: isDisabled, onPointerDown: (e) => {
|
|
189
190
|
e.preventDefault();
|
|
190
191
|
e.stopPropagation();
|
|
191
192
|
}, onSelect: () => {
|
|
192
193
|
if (!isDisabled) {
|
|
193
194
|
toggleItem(item.value);
|
|
194
195
|
}
|
|
195
|
-
}, className:
|
|
196
|
+
}, className: cn("flex items-center justify-between space-x-2", isDisabled && "opacity-50 cursor-not-allowed"), children: [_jsx(Checkbox, { checked: isSelected, onCheckedChange: () => {
|
|
196
197
|
if (!isDisabled) {
|
|
197
198
|
toggleItem(item.value);
|
|
198
199
|
}
|
|
199
|
-
}, onClick: (e) => e.stopPropagation(), disabled: isDisabled }), (
|
|
200
|
+
}, onClick: (e) => e.stopPropagation(), disabled: isDisabled }), _jsx("span", { className: "flex-grow text-left", children: (item === null || item === void 0 ? void 0 : item.label) || item.value })] }, item.value));
|
|
200
201
|
}) })] })] }) })] }));
|
|
201
202
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const lucide_react_1 = require("lucide-react");
|
|
6
|
-
function NoDataComponent({ text }) {
|
|
7
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col h-full justify-center text-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CircleAlert, { className: "text-muted-foreground mx-auto", size: 36 }), (0, jsx_runtime_1.jsx)("p", { className: "text-muted-foreground", children: text ? text : "No Data Available" })] }));
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CircleAlert } from "lucide-react";
|
|
3
|
+
export function NoDataComponent({ text }) {
|
|
4
|
+
return (_jsxs("div", { className: "flex flex-col h-full justify-center text-center gap-2", children: [_jsx(CircleAlert, { className: "text-muted-foreground mx-auto", size: 36 }), _jsx("p", { className: "text-muted-foreground", children: text ? text : "No Data Available" })] }));
|
|
8
5
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
'use client';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
title
|
|
8
|
-
subtitle = subtitle ?? '';
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-4 h-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: 'grid grid-cols-1 gap-1', children: [title && (0, jsx_runtime_1.jsx)("h1", { className: 'text-2xl font-semibold', children: title }), subtitle && (0, jsx_runtime_1.jsx)("p", { className: 'text-muted-foreground/60', children: subtitle })] }), (0, jsx_runtime_1.jsx)("div", { children: tools })] }), children] }));
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
export function PageWrapper({ title, subtitle, tools, children }) {
|
|
4
|
+
title = title !== null && title !== void 0 ? title : '';
|
|
5
|
+
subtitle = subtitle !== null && subtitle !== void 0 ? subtitle : '';
|
|
6
|
+
return (_jsxs("div", { className: "flex flex-col gap-4 h-full", children: [_jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsxs("div", { className: 'grid grid-cols-1 gap-1', children: [title && _jsx("h1", { className: 'text-2xl font-semibold', children: title }), subtitle && _jsx("p", { className: 'text-muted-foreground/60', children: subtitle })] }), _jsx("div", { children: tools })] }), children] }));
|
|
10
7
|
}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
exports.PasswordStrengthMeter = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const progress_1 = require("../../shadcn/progress");
|
|
9
|
-
const zxcvbn_1 = __importDefault(require("zxcvbn"));
|
|
10
|
-
const PasswordStrengthMeter = ({ value }) => {
|
|
11
|
-
const testResult = (0, zxcvbn_1.default)(value);
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Progress } from "../../shadcn/progress";
|
|
3
|
+
import zxcvbn from "zxcvbn";
|
|
4
|
+
export const PasswordStrengthMeter = ({ value }) => {
|
|
5
|
+
const testResult = zxcvbn(value);
|
|
12
6
|
const num = (testResult.score * 100) / 4;
|
|
13
7
|
const createPassLabel = () => {
|
|
14
8
|
switch (testResult.score) {
|
|
@@ -42,6 +36,5 @@ const PasswordStrengthMeter = ({ value }) => {
|
|
|
42
36
|
return "";
|
|
43
37
|
}
|
|
44
38
|
};
|
|
45
|
-
return ((
|
|
39
|
+
return (_jsx(_Fragment, { children: _jsx(Progress, { value: num, indicatorColor: funcProgressColor() }) }));
|
|
46
40
|
};
|
|
47
|
-
exports.PasswordStrengthMeter = PasswordStrengthMeter;
|
|
@@ -1,65 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
if (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.PhoneInput = PhoneInput;
|
|
37
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const button_1 = require("../../shadcn/button");
|
|
39
|
-
const command_1 = require("../../shadcn/command");
|
|
40
|
-
const popover_1 = require("../../shadcn/popover");
|
|
41
|
-
const lucide_react_1 = require("lucide-react");
|
|
42
|
-
const react_1 = require("react");
|
|
43
|
-
const countries_list_1 = require("countries-list");
|
|
44
|
-
const Flags = __importStar(require("country-flag-icons/react/3x2"));
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Button } from '../../shadcn/button';
|
|
14
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '../../shadcn/command';
|
|
15
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../../shadcn/popover';
|
|
16
|
+
import { ChevronsUpDown } from 'lucide-react';
|
|
17
|
+
import { useState } from 'react';
|
|
18
|
+
import { countries } from 'countries-list';
|
|
19
|
+
import * as Flags from "country-flag-icons/react/3x2";
|
|
45
20
|
const Flag = ({ code }) => {
|
|
46
21
|
const FlagComponent = Flags[code];
|
|
47
|
-
return (
|
|
22
|
+
return _jsx(FlagComponent, {});
|
|
48
23
|
};
|
|
49
|
-
function PhoneInput(
|
|
50
|
-
|
|
51
|
-
const [
|
|
52
|
-
const [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
24
|
+
export function PhoneInput(_a) {
|
|
25
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
26
|
+
const [open, setOpen] = useState(false);
|
|
27
|
+
const [value, setValue] = useState("");
|
|
28
|
+
const [countryCode, setCountryCode] = useState("");
|
|
29
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", role: "combobox", "aria-expanded": open, className: "justify-between bg-secondary", children: [countryCode
|
|
30
|
+
? _jsx(Flag, { code: countryCode })
|
|
31
|
+
: "...", _jsx(ChevronsUpDown, { className: "opacity-50" })] }) }), _jsx(PopoverContent, { className: "p-0", align: 'start', children: _jsxs(Command, { filter: (value, search, keywords = []) => {
|
|
56
32
|
const extendValue = value.toLowerCase() + ' ' + keywords.join(' ').toLowerCase();
|
|
57
33
|
if (extendValue.includes(search.toLowerCase()))
|
|
58
34
|
return 1;
|
|
59
35
|
return 0;
|
|
60
|
-
}, children: [(
|
|
36
|
+
}, children: [_jsx(CommandInput, { placeholder: "Search ...", className: "h-9" }), _jsxs(CommandList, { children: [_jsx(CommandEmpty, { children: "No country found." }), _jsx(CommandGroup, { children: Object.entries(countries).map(([code, country]) => (country.phone.map((phone) => _jsxs(CommandItem, { value: `${phone}`, keywords: [country.name, "+" + phone.toString(), code], onSelect: (currentValue) => {
|
|
61
37
|
setValue(currentValue === value ? "" : currentValue);
|
|
62
38
|
setCountryCode(code);
|
|
63
39
|
setOpen(false);
|
|
64
|
-
}, children: [(
|
|
40
|
+
}, children: [_jsx(Flag, { code: code }), " ", country.name, " +", phone] }, phone)))) })] })] }) })] }));
|
|
65
41
|
}
|
|
@@ -1,47 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ResourceTable = void 0;
|
|
37
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const card_1 = require("../../shadcn/card");
|
|
39
|
-
const input_1 = require("../../shadcn/input");
|
|
40
|
-
const select_1 = require("../../shadcn/select");
|
|
41
|
-
const table_1 = require("../../shadcn/table");
|
|
42
|
-
const lucide_react_1 = require("lucide-react");
|
|
43
|
-
const React = __importStar(require("react"));
|
|
44
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Card, CardContent } from "../../shadcn/card";
|
|
3
|
+
import { Input } from "../../shadcn/input";
|
|
4
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../shadcn/select";
|
|
5
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../shadcn/table";
|
|
6
|
+
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { useFormContext } from "react-hook-form";
|
|
45
9
|
const groupResourcesByTask = (resources) => {
|
|
46
10
|
const groupedMap = resources.reduce((acc, resource) => {
|
|
47
11
|
const taskId = resource.taskId;
|
|
@@ -57,8 +21,8 @@ const groupResourcesByTask = (resources) => {
|
|
|
57
21
|
}, new Map());
|
|
58
22
|
return Array.from(groupedMap.values());
|
|
59
23
|
};
|
|
60
|
-
const ResourceTable = ({ resourceDataWithAllocation, userMaps, monthsRange }) => {
|
|
61
|
-
const { setValue } =
|
|
24
|
+
export const ResourceTable = ({ resourceDataWithAllocation, userMaps, monthsRange }) => {
|
|
25
|
+
const { setValue } = useFormContext();
|
|
62
26
|
const [expandedTasks, setExpandedTasks] = React.useState(new Set());
|
|
63
27
|
const groupedResources = groupResourcesByTask(resourceDataWithAllocation);
|
|
64
28
|
const toggleTask = (taskId) => {
|
|
@@ -68,6 +32,5 @@ const ResourceTable = ({ resourceDataWithAllocation, userMaps, monthsRange }) =>
|
|
|
68
32
|
return newSet;
|
|
69
33
|
});
|
|
70
34
|
};
|
|
71
|
-
return ((
|
|
35
|
+
return (_jsx(Card, { className: "p-0 bg-background", children: _jsx(CardContent, { className: "p-0", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: "w-[300px] py-5", children: "Task Name" }), _jsx(TableHead, { className: "w-[200px] py-5", children: "Employee Name" }), _jsx(TableHead, { className: "w-[200px] py-5", children: "Role" }), monthsRange.map((month) => (_jsx(TableHead, { className: "w-[100px] py-5", children: month.replace("_", " ") }, month)))] }) }), _jsx(TableBody, { children: groupedResources.map((group) => (_jsxs(React.Fragment, { children: [_jsx(TableRow, { className: "cursor-pointer hover:bg-accent", onClick: () => toggleTask(group.taskId), children: _jsx(TableCell, { colSpan: 3 + monthsRange.length, children: _jsxs("div", { className: "flex items-center gap-2", children: [expandedTasks.has(group.taskId) ? _jsx(ChevronDown, { className: "h-4 w-4 text-primary" }) : _jsx(ChevronRight, { className: "h-4 w-4 text-primary" }), _jsx("span", { className: "font-medium", children: group.taskName })] }) }) }), expandedTasks.has(group.taskId) && group.resources.map((resource) => (_jsxs(TableRow, { className: "hover:bg-muted/30", children: [_jsx(TableCell, { className: "pl-8", children: _jsx(Input, { value: resource.taskName, disabled: true, className: "w-full bg-transparent border-0 px-0 disabled:opacity-100" }) }), _jsx(TableCell, { children: _jsxs(Select, { defaultValue: resource.resourceId, children: [_jsx(SelectTrigger, { className: "w-full bg-secondary dark:bg-secondary", children: _jsx(SelectValue, { placeholder: "Select employee" }) }), _jsx(SelectContent, { children: Object.entries(userMaps.userDetailsMap).map(([id, user]) => (_jsx(SelectItem, { value: id, children: user.name }, id))) })] }) }), _jsx(TableCell, { children: _jsxs(Select, { defaultValue: resource.gradeId.toString(), children: [_jsx(SelectTrigger, { className: "w-full bg-secondary dark:bg-secondary", children: _jsx(SelectValue, { placeholder: "Select role" }) }), _jsx(SelectContent, { children: Object.entries(userMaps.rolesMap).map(([id, role]) => (_jsx(SelectItem, { value: id, children: role.roleName }, id))) })] }) }), monthsRange.map((month) => (_jsx(TableCell, { children: _jsx(Input, { type: "number", min: "0", max: "1", step: "0.01", defaultValue: resource.allocation[month] || 0, className: "w-20" }) }, month)))] }, `${resource.taskId}-${resource.resourceId}`)))] }, group.taskId))) })] }) }) }));
|
|
72
36
|
};
|
|
73
|
-
exports.ResourceTable = ResourceTable;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Input } from '../../shadcn/input';
|
|
14
|
+
import { cx } from 'class-variance-authority';
|
|
15
|
+
import { Search } from 'lucide-react';
|
|
16
|
+
export function SearchInput(_a) {
|
|
17
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
18
|
+
return (_jsxs("div", { className: "relative w-auto flex items-center", children: [_jsx(Search, { className: "absolute left-2 mr-2 h-4 w-4 shrink-0 opacity-50" }), _jsx(Input, Object.assign({ className: cx('pl-8 h-8', className) }, props))] }));
|
|
10
19
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const sheet_1 = require("../../shadcn/sheet");
|
|
7
|
-
function SheetComponent({ buttonText, buttonIcon, buttonStyle, sheetContent, sheetDescription, sheetTitle, closeButton }) {
|
|
8
|
-
return ((0, jsx_runtime_1.jsxs)(sheet_1.Sheet, { children: [(0, jsx_runtime_1.jsx)(sheet_1.SheetTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: 'outline', className: buttonStyle, size: "smIcon", children: [buttonText, buttonIcon] }) }), (0, jsx_runtime_1.jsxs)(sheet_1.SheetContent, { className: "p-4", children: [(0, jsx_runtime_1.jsx)(sheet_1.SheetTitle, { children: sheetTitle }), sheetContent] })] }));
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "../../shadcn/button";
|
|
3
|
+
import { Sheet, SheetContent, SheetTitle, SheetTrigger } from "../../shadcn/sheet";
|
|
4
|
+
export function SheetComponent({ buttonText, buttonIcon, buttonStyle, sheetContent, sheetDescription, sheetTitle, closeButton }) {
|
|
5
|
+
return (_jsxs(Sheet, { children: [_jsx(SheetTrigger, { asChild: true, children: _jsxs(Button, { variant: 'outline', className: buttonStyle, size: "smIcon", children: [buttonText, buttonIcon] }) }), _jsxs(SheetContent, { className: "p-4", children: [_jsx(SheetTitle, { children: sheetTitle }), sheetContent] })] }));
|
|
9
6
|
}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const lucide_react_1 = require("lucide-react");
|
|
7
|
-
const LUCID_ICONS = lucide_react_1.icons;
|
|
8
|
-
function SimpleWidget({ title, iconName, iconSize, iconClass, primaryText, secondaryText, mainClassName = '', loading, loadingMessage }) {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Card, CardContent } from "../../shadcn/card";
|
|
3
|
+
import { icons, LoaderCircle } from "lucide-react";
|
|
4
|
+
const LUCID_ICONS = icons;
|
|
5
|
+
export function SimpleWidget({ title, iconName, iconSize, iconClass, primaryText, secondaryText, mainClassName = '', loading, loadingMessage }) {
|
|
9
6
|
let IconComponent = null;
|
|
10
7
|
if (iconName) {
|
|
11
8
|
IconComponent = LUCID_ICONS[iconName];
|
|
12
9
|
}
|
|
13
10
|
iconSize = iconSize === undefined ? 20 : iconSize;
|
|
14
|
-
iconClass = iconClass
|
|
15
|
-
loadingMessage = loadingMessage
|
|
16
|
-
return ((
|
|
11
|
+
iconClass = iconClass !== null && iconClass !== void 0 ? iconClass : '';
|
|
12
|
+
loadingMessage = loadingMessage !== null && loadingMessage !== void 0 ? loadingMessage : 'Loading...';
|
|
13
|
+
return (_jsx(Card, { className: mainClassName, children: _jsxs(CardContent, { className: 'p-5', children: [_jsxs("div", { className: 'flex items-center justify-between gap-4', children: [_jsx("span", { children: title }), loading ? (_jsx(LoaderCircle, { size: iconSize, className: 'animate-spin ' + iconClass })) : (IconComponent && _jsx(IconComponent, { size: iconSize, className: iconClass }))] }), _jsx("div", { className: 'mt-6 text-2xl font-semibold', children: loading ? '...' : primaryText }), secondaryText && (_jsx("small", { className: 'mt-2 text-gray-400', children: loading ? loadingMessage : secondaryText }))] }) }));
|
|
17
14
|
}
|