armtek-uikit-react 1.0.55 → 1.0.57
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/assets/ListItem.scss +19 -3
- package/assets/Table.scss +29 -0
- package/package.json +1 -1
- package/ui/Form/DateField/DateField.js +4 -2
- package/ui/Form/Password/Password.js +4 -2
- package/ui/Form/Select/Select.js +4 -2
- package/ui/List/ListItem.js +13 -3
- package/ui/Modal/BaseModal.js +1 -0
- package/ui/Table/Table.d.ts +22 -0
- package/ui/Table/Table.js +43 -0
- package/ui/Table/Table.module.scss +1 -0
- package/ui/Table/TableCell.d.ts +6 -0
- package/ui/Table/TableCell.js +24 -0
- package/ui/Table/TableRow.d.ts +4 -0
- package/ui/Table/TableRow.js +18 -0
- package/ui/Table/index.d.ts +3 -0
- package/ui/Table/index.js +3 -0
package/assets/ListItem.scss
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
outline: none;
|
|
5
5
|
padding: calc($size-step * 1.5) calc($size-step * 2);
|
|
6
6
|
color: $color-neutral;
|
|
7
|
-
background:
|
|
7
|
+
background: #fff;
|
|
8
8
|
@include transition(0.3s, background);
|
|
9
9
|
@include flex();
|
|
10
10
|
width: 100%;
|
|
@@ -19,8 +19,20 @@
|
|
|
19
19
|
background: rgba($color-primary, 0.1);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
.listitem_startAdornment{
|
|
23
22
|
|
|
23
|
+
.listitem_disabled{
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
background: #fff;
|
|
26
|
+
color: $color-gray-400;
|
|
27
|
+
user-select: none;
|
|
28
|
+
cursor: default;
|
|
29
|
+
}
|
|
30
|
+
.listitem__Content{
|
|
31
|
+
display: block;
|
|
32
|
+
margin-right: calc($size-step * 2);
|
|
33
|
+
}
|
|
34
|
+
.listitem__Content_adornment_left{
|
|
35
|
+
margin-left: calc($size-step * 2);
|
|
24
36
|
}
|
|
25
37
|
.listitem_endAdornment{
|
|
26
38
|
|
|
@@ -30,5 +42,9 @@
|
|
|
30
42
|
}
|
|
31
43
|
.listitemText{
|
|
32
44
|
display: block;
|
|
33
|
-
|
|
45
|
+
}
|
|
46
|
+
.listitem__helper{
|
|
47
|
+
margin-top: calc($size-step / 2);
|
|
48
|
+
display: block;
|
|
49
|
+
color: $color-neutral-light;
|
|
34
50
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@import "variables";
|
|
2
|
+
|
|
3
|
+
.table{
|
|
4
|
+
width: 100%;
|
|
5
|
+
margin:0;
|
|
6
|
+
padding:0;
|
|
7
|
+
background:none;
|
|
8
|
+
border:none;
|
|
9
|
+
border-collapse:collapse;
|
|
10
|
+
border-spacing:0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.tableCell{
|
|
14
|
+
color: $color-gray-800;
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
}
|
|
17
|
+
.tableCellInner{
|
|
18
|
+
padding: calc($size-step * 2 ) $size-step;
|
|
19
|
+
}
|
|
20
|
+
.tableCell_head{
|
|
21
|
+
color: $color-gray-500
|
|
22
|
+
}
|
|
23
|
+
.tableRow td{
|
|
24
|
+
border-bottom: 1px solid $color-gray-300;
|
|
25
|
+
background: #fff;
|
|
26
|
+
}
|
|
27
|
+
.tableRow:hover td{
|
|
28
|
+
background: #F8F9FA;
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"armtek-uikit-react","version":"1.0.
|
|
1
|
+
{"name":"armtek-uikit-react","version":"1.0.57","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"build":"^0.1.4","clsx":"^2.0.0","rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
|
|
@@ -22,8 +22,10 @@ const DateInput = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22
22
|
variant: 'transparent',
|
|
23
23
|
onClick: props.onClick,
|
|
24
24
|
color: 'neutral',
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
26
|
+
className: 'material_icon',
|
|
27
|
+
children: inputIcon
|
|
28
|
+
})
|
|
27
29
|
})
|
|
28
30
|
});
|
|
29
31
|
});
|
|
@@ -32,8 +32,10 @@ export const Password = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
32
32
|
variant: 'transparent',
|
|
33
33
|
color: 'neutral',
|
|
34
34
|
onClick: handleClick,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
36
|
+
className: 'material_icon',
|
|
37
|
+
children: isPassword ? 'visibility_off' : 'visibility'
|
|
38
|
+
})
|
|
37
39
|
})
|
|
38
40
|
})
|
|
39
41
|
});
|
package/ui/Form/Select/Select.js
CHANGED
|
@@ -87,8 +87,10 @@ function Select(props) {
|
|
|
87
87
|
}), /*#__PURE__*/_jsx(ButtonIcon, {
|
|
88
88
|
size: 'small',
|
|
89
89
|
variant: 'transparent',
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
91
|
+
className: 'material_icon',
|
|
92
|
+
children: "arrow_drop_down"
|
|
93
|
+
})
|
|
92
94
|
})]
|
|
93
95
|
});
|
|
94
96
|
let selectProps = {};
|
package/ui/List/ListItem.js
CHANGED
|
@@ -13,6 +13,7 @@ const ListItem = props => {
|
|
|
13
13
|
let {
|
|
14
14
|
children,
|
|
15
15
|
className,
|
|
16
|
+
title,
|
|
16
17
|
active,
|
|
17
18
|
divider,
|
|
18
19
|
checked,
|
|
@@ -27,6 +28,7 @@ const ListItem = props => {
|
|
|
27
28
|
className: clsx(css.listitem, className, {
|
|
28
29
|
[css.listitem_active]: !!active || !!checked,
|
|
29
30
|
[css.listitem_divider]: !!divider,
|
|
31
|
+
[css.listitem_disabled]: !!restProps.disabled,
|
|
30
32
|
[css.listitem_endAdornment]: !!endAdornment,
|
|
31
33
|
[css.listitem_startAdornment]: withStartAdornment
|
|
32
34
|
}),
|
|
@@ -43,9 +45,17 @@ const ListItem = props => {
|
|
|
43
45
|
position: 'start',
|
|
44
46
|
children: startAdornment
|
|
45
47
|
})]
|
|
46
|
-
}), /*#__PURE__*/
|
|
47
|
-
className: css.
|
|
48
|
-
|
|
48
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
49
|
+
className: clsx(css.listitem__Content, {
|
|
50
|
+
[css.listitem__content_adornment_left]: withStartAdornment
|
|
51
|
+
}),
|
|
52
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
53
|
+
className: clsx(css.listitemText),
|
|
54
|
+
children: children
|
|
55
|
+
}), title && /*#__PURE__*/_jsx("span", {
|
|
56
|
+
className: css.listitem__helper,
|
|
57
|
+
children: title
|
|
58
|
+
})]
|
|
49
59
|
}), !!endAdornment && /*#__PURE__*/_jsx(AdornmentContainer, {
|
|
50
60
|
position: 'end',
|
|
51
61
|
children: /*#__PURE__*/_jsx(Adornment, {
|
package/ui/Modal/BaseModal.js
CHANGED
|
@@ -47,6 +47,7 @@ export const BaseModal = props => {
|
|
|
47
47
|
}), showControls && /*#__PURE__*/_jsx("div", {
|
|
48
48
|
className: clsx('Arm-Modal__footer', classes == null ? void 0 : classes['Arm-Modal__footer'], css.Modal__footer),
|
|
49
49
|
children: /*#__PURE__*/_jsx(FormControls, {
|
|
50
|
+
className: classes == null ? void 0 : classes['Arm-FormControls'],
|
|
50
51
|
onSubmit: onSubmit,
|
|
51
52
|
onCancel: onCancel,
|
|
52
53
|
submitProps: submitProps,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode, MouseEvent } from 'react';
|
|
2
|
+
type ItemType = Record<string, any>;
|
|
3
|
+
type ClassesType<T extends ItemType> = {
|
|
4
|
+
tableRowHead?: string;
|
|
5
|
+
tableRow?: string | ((item: T) => string);
|
|
6
|
+
tableCellHead?: string;
|
|
7
|
+
tableCell?: string;
|
|
8
|
+
};
|
|
9
|
+
export type TableColType<T extends ItemType> = {
|
|
10
|
+
text: string;
|
|
11
|
+
getValue?: (item: T) => string | ReactNode | number;
|
|
12
|
+
getTitle?: () => string | ReactNode | number;
|
|
13
|
+
code: keyof T;
|
|
14
|
+
};
|
|
15
|
+
type TableProps<T extends ItemType> = Omit<ComponentPropsWithoutRef<'table'>, 'onClick'> & {
|
|
16
|
+
classes?: ClassesType<T>;
|
|
17
|
+
structure: TableColType<T>[];
|
|
18
|
+
items: T[];
|
|
19
|
+
onClick: (item: T, e: MouseEvent<HTMLTableRowElement>) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare function Table<T extends ItemType>(props: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { TableRow } from "./TableRow";
|
|
3
|
+
import { TableCell } from "./TableCell";
|
|
4
|
+
import css from "./Table.module.scss";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
|
+
// TODO TESTS
|
|
9
|
+
export function Table(props) {
|
|
10
|
+
const {
|
|
11
|
+
className,
|
|
12
|
+
structure,
|
|
13
|
+
items,
|
|
14
|
+
onClick,
|
|
15
|
+
classes,
|
|
16
|
+
...tableProps
|
|
17
|
+
} = props;
|
|
18
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
19
|
+
children: /*#__PURE__*/_jsxs("table", {
|
|
20
|
+
...tableProps,
|
|
21
|
+
className: clsx(className, css.table),
|
|
22
|
+
children: [/*#__PURE__*/_jsx(TableRow, {
|
|
23
|
+
className: classes == null ? void 0 : classes.tableRowHead,
|
|
24
|
+
children: structure.map(item => /*#__PURE__*/_jsx(TableCell, {
|
|
25
|
+
head: true,
|
|
26
|
+
className: classes == null ? void 0 : classes.tableCellHead,
|
|
27
|
+
children: item.getTitle ? item.getTitle() : item.text
|
|
28
|
+
}))
|
|
29
|
+
}), items.map(row => {
|
|
30
|
+
let rowClass = !!(classes != null && classes.tableRow) ? typeof classes.tableRow === 'string' ? classes.tableRow : classes.tableRow(row) : '';
|
|
31
|
+
return /*#__PURE__*/_jsx(TableRow, {
|
|
32
|
+
className: rowClass,
|
|
33
|
+
onClick: e => onClick(row, e),
|
|
34
|
+
children: structure.map(item => {
|
|
35
|
+
return /*#__PURE__*/_jsx(TableCell, {
|
|
36
|
+
children: item.getValue ? item.getValue(row) : row[item.code]
|
|
37
|
+
});
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
})]
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "../../assets/Table";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import css from "./Table.module.scss";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
export const TableCell = props => {
|
|
6
|
+
const {
|
|
7
|
+
className,
|
|
8
|
+
children,
|
|
9
|
+
head,
|
|
10
|
+
...cellProps
|
|
11
|
+
} = props;
|
|
12
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
13
|
+
children: /*#__PURE__*/_jsx("td", {
|
|
14
|
+
...cellProps,
|
|
15
|
+
className: clsx(className, css.tableCell, {
|
|
16
|
+
[css.tableCell_head]: !!head
|
|
17
|
+
}),
|
|
18
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
19
|
+
className: css.tableCellInner,
|
|
20
|
+
children: children
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import css from "./Table.module.scss";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
export const TableRow = props => {
|
|
6
|
+
const {
|
|
7
|
+
className,
|
|
8
|
+
children,
|
|
9
|
+
...rowProps
|
|
10
|
+
} = props;
|
|
11
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
12
|
+
children: /*#__PURE__*/_jsx("tr", {
|
|
13
|
+
...rowProps,
|
|
14
|
+
className: clsx(className, css.tableRow),
|
|
15
|
+
children: children
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
};
|