pixelize-design-library 2.2.52 → 2.2.54
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/Assets/defaultLogo.tsx +31 -0
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChart.stories.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChart.stories.js +6 -0
- package/dist/Components/Apexcharts/ApexDonutChart/ApexDonutChart.d.ts +4 -0
- package/dist/Components/Apexcharts/ApexDonutChart/ApexDonutChart.js +58 -0
- package/dist/Components/Apexcharts/ApexDonutChart/ApexDonutChartProps.d.ts +21 -0
- package/dist/Components/Apexcharts/ApexDonutChart/ApexDonutChartProps.js +2 -0
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.stories.d.ts +1 -0
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.stories.js +6 -0
- package/dist/Components/DatePicker/CalendarPanel.js +22 -9
- package/dist/Components/DatePicker/DatePicker.js +11 -2
- package/dist/Components/DatePicker/DatePickerProps.d.ts +1 -0
- package/dist/Components/DatePicker/RangeDatePicker.js +41 -12
- package/dist/Components/DatePicker/SingleDatePicker.js +15 -15
- package/dist/Components/DatePicker/TimeOnlyPicker.js +3 -0
- package/dist/Components/DatePicker/TimePicker.js +8 -8
- package/dist/Components/DatePicker/TimePickerInput.js +78 -8
- package/dist/Components/InputTextArea/InputTextArea.stories.d.ts +1 -0
- package/dist/Components/InputTextArea/InputTextArea.stories.js +7 -0
- package/dist/Components/KaTable/CustomHeader.d.ts +14 -0
- package/dist/Components/KaTable/CustomHeader.js +69 -0
- package/dist/Components/KaTable/KaTable.d.ts +13 -0
- package/dist/Components/KaTable/KaTable.js +111 -0
- package/dist/Components/KaTable/KaTableProps.d.ts +23 -0
- package/dist/Components/KaTable/KaTableProps.js +2 -0
- package/dist/Components/KaTable/SelectionCell.d.ts +8 -0
- package/dist/Components/KaTable/SelectionCell.js +38 -0
- package/dist/Components/KaTable/SelectionHeader.d.ts +3 -0
- package/dist/Components/KaTable/SelectionHeader.js +56 -0
- package/dist/Components/KaTable/ka-table.css +27 -0
- package/dist/Components/KaTable/useMergedChildComponents.d.ts +14 -0
- package/dist/Components/KaTable/useMergedChildComponents.js +224 -0
- package/dist/Components/NumberInput/NumberInput.stories.d.ts +1 -0
- package/dist/Components/NumberInput/NumberInput.stories.js +5 -0
- package/dist/Components/Table/Table.css +16 -0
- package/dist/Theme/Default/fonts.d.ts +35 -0
- package/dist/Theme/Default/fonts.js +37 -0
- package/package.json +1 -1
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
37
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
38
|
+
if (ar || !(i in from)) {
|
|
39
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
40
|
+
ar[i] = from[i];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
44
|
+
};
|
|
45
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
|
+
};
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
var react_1 = __importStar(require("react"));
|
|
50
|
+
var CustomHeader_1 = __importDefault(require("./CustomHeader"));
|
|
51
|
+
var SelectionHeader_1 = __importDefault(require("./SelectionHeader"));
|
|
52
|
+
var SelectionCell_1 = __importDefault(require("./SelectionCell"));
|
|
53
|
+
var useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
54
|
+
var table_1 = require("../../Utils/table");
|
|
55
|
+
var useMergedChildComponents = function (_a) {
|
|
56
|
+
var childComponents = _a.childComponents, onSortChange = _a.onSortChange, handleSelection = _a.handleSelection, rowKey = _a.rowKey, onRowClick = _a.onRowClick, selected = _a.selected, dataLength = _a.dataLength, columns = _a.columns, headerBgColor = _a.headerBgColor, freezedBgColor = _a.freezedBgColor, headerTextColor = _a.headerTextColor, freezedTextColor = _a.freezedTextColor, sortState = _a.sortState;
|
|
57
|
+
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
58
|
+
var handleSortChange = (0, react_1.useCallback)(function (newState, columnKey) {
|
|
59
|
+
var newSortState = __spreadArray([], sortState, true);
|
|
60
|
+
var existingIndex = newSortState.findIndex(function (sort) { return sort.column === columnKey; });
|
|
61
|
+
if (existingIndex === -1) {
|
|
62
|
+
newSortState.push({
|
|
63
|
+
column: columnKey,
|
|
64
|
+
direction: newState, // Default to ascending when adding a column
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
var existingSort = newSortState[existingIndex];
|
|
69
|
+
existingSort.direction = newState;
|
|
70
|
+
}
|
|
71
|
+
var column = columns.find(function (col) { return col.key === columnKey; });
|
|
72
|
+
column.sortDirection = newState;
|
|
73
|
+
onSortChange(newSortState);
|
|
74
|
+
}, [sortState, onSortChange, columns]);
|
|
75
|
+
var _b = react_1.default.useState(selected), selections = _b[0], setSelections = _b[1];
|
|
76
|
+
(0, react_1.useEffect)(function () {
|
|
77
|
+
setSelections(selected);
|
|
78
|
+
}, [selected]);
|
|
79
|
+
var isAllSelected = (0, react_1.useMemo)(function () {
|
|
80
|
+
return {
|
|
81
|
+
checked: (selections === null || selections === void 0 ? void 0 : selections.length) === (dataLength || -1),
|
|
82
|
+
intederminate: (selections === null || selections === void 0 ? void 0 : selections.length) > 0 && (selections === null || selections === void 0 ? void 0 : selections.length) < dataLength,
|
|
83
|
+
};
|
|
84
|
+
}, [selections, dataLength]);
|
|
85
|
+
var cellSelectionHandle = (0, react_1.useCallback)(function (values, type) {
|
|
86
|
+
if (type === "add") {
|
|
87
|
+
setSelections(__spreadArray(__spreadArray([], selections, true), [values], false));
|
|
88
|
+
handleSelection(__spreadArray(__spreadArray([], selections, true), [values], false));
|
|
89
|
+
}
|
|
90
|
+
else if (type === "remove") {
|
|
91
|
+
setSelections(selections.filter(function (value) { return value !== values; }));
|
|
92
|
+
handleSelection(selections.filter(function (value) { return value !== values; }));
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
handleSelection(selections.filter(function (value) { return value !== values; }));
|
|
96
|
+
}
|
|
97
|
+
}, [selections, handleSelection]);
|
|
98
|
+
var headerSelectionHandle = (0, react_1.useCallback)(function (values) {
|
|
99
|
+
setSelections(values);
|
|
100
|
+
handleSelection(values);
|
|
101
|
+
}, [handleSelection]);
|
|
102
|
+
return (0, react_1.useMemo)(function () {
|
|
103
|
+
return __assign(__assign({}, childComponents), { dataRow: {
|
|
104
|
+
elementAttributes: function (props) {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
var existingElementAttributes = (_a = childComponents.dataRow) === null || _a === void 0 ? void 0 : _a.elementAttributes;
|
|
107
|
+
var attributes = existingElementAttributes
|
|
108
|
+
? existingElementAttributes(props)
|
|
109
|
+
: {};
|
|
110
|
+
var isSelected = selections === null || selections === void 0 ? void 0 : selections.includes(props.rowData[rowKey]);
|
|
111
|
+
var className = "".concat(attributes.className || "", " ").concat(isSelected ? "ka-row-selected" : "", " ka-row-hover").trim();
|
|
112
|
+
// const className =
|
|
113
|
+
// `${attributes.className || ""} ${isSelected ? "ka-row-selected" : ""}`.trim();
|
|
114
|
+
return __assign(__assign({}, attributes), { className: className, style: __assign(__assign({}, (attributes.style || {})), { backgroundColor: isSelected
|
|
115
|
+
? theme.colors.backgroundColor.subtle
|
|
116
|
+
: undefined, border: "1px solid ".concat((_b = theme.colors) === null || _b === void 0 ? void 0 : _b.gray[200]) }) });
|
|
117
|
+
},
|
|
118
|
+
}, headCell: {
|
|
119
|
+
content: function (props) {
|
|
120
|
+
var _a, _b, _c;
|
|
121
|
+
var existingContent = (_a = childComponents.headCell) === null || _a === void 0 ? void 0 : _a.content;
|
|
122
|
+
if (existingContent) {
|
|
123
|
+
var result = existingContent(props);
|
|
124
|
+
if (result) {
|
|
125
|
+
return result;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
var column = props.column;
|
|
129
|
+
if (column.sortable || column.filter) {
|
|
130
|
+
return (react_1.default.createElement(CustomHeader_1.default, __assign({}, props, { onSortChange: handleSortChange, menuItems: (_b = column === null || column === void 0 ? void 0 : column.menu) !== null && _b !== void 0 ? _b : [], isSort: props.column.sortable, sortDirection: (_c = props.column.sortDirection) !== null && _c !== void 0 ? _c : "none" })));
|
|
131
|
+
}
|
|
132
|
+
if (props.column.key === "select-cell") {
|
|
133
|
+
return (react_1.default.createElement(SelectionHeader_1.default, { onSelectionChange: headerSelectionHandle, rowKey: rowKey, selected: isAllSelected }));
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
},
|
|
137
|
+
elementAttributes: function (props) {
|
|
138
|
+
var _a, _b, _c, _d, _e, _f;
|
|
139
|
+
var existingElementAttributes = (_a = childComponents.headCell) === null || _a === void 0 ? void 0 : _a.elementAttributes;
|
|
140
|
+
if (existingElementAttributes) {
|
|
141
|
+
var result = existingElementAttributes(props);
|
|
142
|
+
if (result) {
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (props.column.columnFreeze) {
|
|
147
|
+
var stickyLeft = (0, table_1.getPreviousColumnWidth)(columns, props.column.key);
|
|
148
|
+
return {
|
|
149
|
+
style: __assign(__assign({}, props.column.style), { position: "sticky", left: stickyLeft, zIndex: 3, backgroundColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.backgroundColor.subtle, color: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.gray[600] }),
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
style: {
|
|
154
|
+
backgroundColor: headerBgColor !== null && headerBgColor !== void 0 ? headerBgColor : (_d = theme.colors.backgroundColor) === null || _d === void 0 ? void 0 : _d.subtle,
|
|
155
|
+
color: headerTextColor !== null && headerTextColor !== void 0 ? headerTextColor : (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.gray[600],
|
|
156
|
+
border: "1px solid ".concat((_f = theme.colors) === null || _f === void 0 ? void 0 : _f.gray[200]),
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
}, cell: {
|
|
161
|
+
elementAttributes: function (props) {
|
|
162
|
+
var _a, _b, _c, _d, _e;
|
|
163
|
+
var existingElementAttributes = (_a = childComponents.cell) === null || _a === void 0 ? void 0 : _a.elementAttributes;
|
|
164
|
+
if (existingElementAttributes) {
|
|
165
|
+
var result = existingElementAttributes(props);
|
|
166
|
+
if (result) {
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (props.column.columnFreeze) {
|
|
171
|
+
var stickyLeft = (0, table_1.getPreviousColumnWidth)(columns, props.column.key);
|
|
172
|
+
return {
|
|
173
|
+
style: __assign(__assign({}, props.column.style), { position: "sticky", left: stickyLeft, zIndex: 2, backgroundColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.backgroundColor.subtle, color: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.gray[600], fontWeight: 600 }),
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
style: {
|
|
178
|
+
color: (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.gray[600],
|
|
179
|
+
fontWeight: 500,
|
|
180
|
+
border: "1px solid ".concat((_e = theme.colors) === null || _e === void 0 ? void 0 : _e.gray[200]),
|
|
181
|
+
},
|
|
182
|
+
onClick: function () {
|
|
183
|
+
if (onRowClick) {
|
|
184
|
+
onRowClick(props.rowData, props.column.key);
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
},
|
|
189
|
+
}, tableWrapper: {
|
|
190
|
+
elementAttributes: function () { return ({ style: { maxHeight: 600 } }); },
|
|
191
|
+
}, cellText: {
|
|
192
|
+
content: function (props) {
|
|
193
|
+
var _a;
|
|
194
|
+
var existingContent = (_a = childComponents.cellText) === null || _a === void 0 ? void 0 : _a.content;
|
|
195
|
+
if (existingContent) {
|
|
196
|
+
var result = existingContent(props);
|
|
197
|
+
if (result) {
|
|
198
|
+
return result;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (props.column.key === "select-cell") {
|
|
202
|
+
var isSelected = selections === null || selections === void 0 ? void 0 : selections.includes(props.rowData[rowKey]);
|
|
203
|
+
return (react_1.default.createElement(SelectionCell_1.default, __assign({}, props, { selected: isSelected, onSelectionChange: cellSelectionHandle })));
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
} });
|
|
207
|
+
}, [
|
|
208
|
+
childComponents,
|
|
209
|
+
rowKey,
|
|
210
|
+
onRowClick,
|
|
211
|
+
selections,
|
|
212
|
+
columns,
|
|
213
|
+
cellSelectionHandle,
|
|
214
|
+
headerSelectionHandle,
|
|
215
|
+
isAllSelected,
|
|
216
|
+
theme.colors,
|
|
217
|
+
headerBgColor,
|
|
218
|
+
headerTextColor,
|
|
219
|
+
freezedBgColor,
|
|
220
|
+
freezedTextColor,
|
|
221
|
+
handleSortChange,
|
|
222
|
+
]);
|
|
223
|
+
};
|
|
224
|
+
exports.default = useMergedChildComponents;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.table_wrapper {
|
|
2
|
+
width: 100%;
|
|
3
|
+
border-collapse: collapse;
|
|
4
|
+
/* table-layout: fixed; */
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.table_wrapper th .resize-handle {
|
|
8
|
+
position: absolute;
|
|
9
|
+
top: 0;
|
|
10
|
+
right: 0;
|
|
11
|
+
width: 8px;
|
|
12
|
+
height: 100%;
|
|
13
|
+
cursor: col-resize;
|
|
14
|
+
background-color: transparent;
|
|
15
|
+
z-index: 999;
|
|
16
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import "@fontsource/ubuntu-sans";
|
|
2
|
+
declare const fontOptions: {
|
|
3
|
+
fonts: {
|
|
4
|
+
body: string;
|
|
5
|
+
heading: string;
|
|
6
|
+
mono: string;
|
|
7
|
+
};
|
|
8
|
+
fontSizes: {
|
|
9
|
+
xs: string;
|
|
10
|
+
sm: string;
|
|
11
|
+
md: string;
|
|
12
|
+
lg: string;
|
|
13
|
+
xl: string;
|
|
14
|
+
"2xl": string;
|
|
15
|
+
"3xl": string;
|
|
16
|
+
"4xl": string;
|
|
17
|
+
"5xl": string;
|
|
18
|
+
"6xl": string;
|
|
19
|
+
"7xl": string;
|
|
20
|
+
"8xl": string;
|
|
21
|
+
"9xl": string;
|
|
22
|
+
};
|
|
23
|
+
fontWeights: {
|
|
24
|
+
hairline: number;
|
|
25
|
+
thin: number;
|
|
26
|
+
light: number;
|
|
27
|
+
normal: number;
|
|
28
|
+
medium: number;
|
|
29
|
+
semibold: number;
|
|
30
|
+
bold: number;
|
|
31
|
+
extrabold: number;
|
|
32
|
+
black: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export default fontOptions;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("@fontsource/ubuntu-sans");
|
|
4
|
+
var fontOptions = {
|
|
5
|
+
fonts: {
|
|
6
|
+
body: "Ubuntu Sans, serif",
|
|
7
|
+
heading: "Ubuntu Sans, serif",
|
|
8
|
+
mono: "Ubuntu Sans, monospace",
|
|
9
|
+
},
|
|
10
|
+
fontSizes: {
|
|
11
|
+
xs: "0.75rem",
|
|
12
|
+
sm: "0.875rem",
|
|
13
|
+
md: "1rem",
|
|
14
|
+
lg: "1.125rem",
|
|
15
|
+
xl: "1.25rem",
|
|
16
|
+
"2xl": "1.5rem",
|
|
17
|
+
"3xl": "1.875rem",
|
|
18
|
+
"4xl": "2.25rem",
|
|
19
|
+
"5xl": "3rem",
|
|
20
|
+
"6xl": "3.75rem",
|
|
21
|
+
"7xl": "4.5rem",
|
|
22
|
+
"8xl": "6rem",
|
|
23
|
+
"9xl": "8rem",
|
|
24
|
+
},
|
|
25
|
+
fontWeights: {
|
|
26
|
+
hairline: 100,
|
|
27
|
+
thin: 200,
|
|
28
|
+
light: 300,
|
|
29
|
+
normal: 400,
|
|
30
|
+
medium: 500,
|
|
31
|
+
semibold: 600,
|
|
32
|
+
bold: 700,
|
|
33
|
+
extrabold: 800,
|
|
34
|
+
black: 900,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
exports.default = fontOptions;
|