@xaypay/tui 0.0.76 → 0.0.77
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/index.es.js +212 -286
- package/dist/index.js +211 -286
- package/package.json +3 -3
- package/src/assets/table-settings-icon.svg +3 -0
- package/src/components/button/button.stories.js +4 -2
- package/src/components/button/index.js +9 -4
- package/src/components/input/index.js +13 -0
- package/src/components/newFile/index.js +10 -10
- package/src/components/select/index.js +7 -6
- package/src/components/select/select.module.css +1 -1
- package/src/components/table/index.js +185 -119
- package/src/components/table/table.stories.js +32 -29
- package/src/stories/static/button-usage-icon.png +0 -0
- package/src/stories/usage.stories.mdx +4 -0
- package/src/utils/index.js +3 -16
- package/tui.config.js +25 -2
- package/src/components/table/table.module.css +0 -80
|
@@ -1,36 +1,39 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Table from './index';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
component: Table,
|
|
6
|
+
title: 'Components/Table'
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
const Template = (args) =>
|
|
9
|
+
const Template = (args) => {
|
|
10
|
+
const tableHeadItems = [
|
|
11
|
+
'Հ/Հ',
|
|
12
|
+
'ՀՎՀՀ',
|
|
13
|
+
'Վարչ․ շրջան',
|
|
14
|
+
'Վճար',
|
|
15
|
+
'Ամսաթիվ',
|
|
16
|
+
'Մուտքի ամիս',
|
|
17
|
+
'Հավելյալ ինֆորմացիա',
|
|
18
|
+
'Ստեղծված',
|
|
19
|
+
'Գործողություն',
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
const tableBodyItems = [
|
|
23
|
+
{ id: 1, hh: 19854, hvhh: 10195524, shrjan: 'Շենգավիթ', pay: 7000, date: '27.05.2022', enterDate: '27.05.2022', info: 'Այլ արտաքին գովազդի տեղադրելու վճար / ԱՁ', create: '27.05.2022', actions: ['item', 'just'] },
|
|
24
|
+
{ id: 3, hh: 22641, hvhh: 12095524, shrjan: 'Շենգավիթ', pay: 7000, date: '27.05.2022', enterDate: '27.05.2022', info: 'Այլ արտաքին գովազդի տեղադրելու վճար / ԱՁ', create: '27.05.2022', actions: 'text' },
|
|
25
|
+
{ id: 4, hh: 25005, hvhh: 15495524, shrjan: 'Շենգավիթ', pay: 7000, date: '27.05.2022', enterDate: '27.05.2022', info: 'Այլ արտաքին գովազդի տեղադրելու վճար / ԱՁ', create: '27.05.2022', actions: [] },
|
|
26
|
+
{ id: 7, hh: 31576, hvhh: 16895524, shrjan: 'Շենգավիթ', pay: 7000, date: '27.05.2022', enterDate: '27.05.2022', info: 'Այլ արտաքին գովազդի տեղադրելու վճար / ԱՁ', create: '27.05.2022', actions: [] },
|
|
27
|
+
{ id: 45, hh: 32586, hvhh: 17495524, shrjan: 'Շենգավիթ', pay: 7000, date: '27.05.2022', enterDate: '27.05.2022', info: 'Այլ արտաքին գովազդի տեղադրելու վճար / ԱՁ', create: '27.05.2022', actions: [] },
|
|
28
|
+
{ id: 78, hh: 32754, hvhh: 20095524, shrjan: 'Շենգավիթ', pay: 7000, date: '27.05.2022', enterDate: '27.05.2022', info: 'Այլ արտաքին գովազդի տեղադրելու վճար / ԱՁ', create: '27.05.2022', actions: [] },
|
|
29
|
+
{ id: 99, hh: 41411, hvhh: 20595524, shrjan: 'Շենգավիթ', pay: 7000, date: '27.05.2022', enterDate: '27.05.2022', info: 'Այլ արտաքին գովազդի տեղադրելու վճար / ԱՁ', create: '27.05.2022', actions: [] },
|
|
30
|
+
{ id: 541, hh: 44547, hvhh: 26595524, shrjan: 'Շենգավիթ', pay: 7000, date: '27.05.2022', enterDate: '27.05.2022', info: 'Այլ արտաքին գովազդի տեղադրելու վճար / ԱՁ', create: '27.05.2022', actions: [] },
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
return <Table tableHeadItems={tableHeadItems} tableBodyItems={tableBodyItems} {...args} />;
|
|
34
|
+
};
|
|
10
35
|
|
|
11
36
|
export const Default = Template.bind({});
|
|
12
|
-
|
|
13
|
-
const showCheckbox = (item) => {
|
|
14
|
-
return true;
|
|
15
|
-
// return item.id === 2;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const onChange = (checked) => {
|
|
19
|
-
console.log("project",checked);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const show = () => {
|
|
23
|
-
return true
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const action = (id) => {
|
|
27
|
-
console.log('action from project',id);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
37
|
Default.args = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
actions: [{icon: 'icon-1',show: show, click: action},{icon: 'icon-2'},{icon: 'icon-3'},{icon: 'icon-4'}],
|
|
34
|
-
keyNames: ['name',{name: 'name2', icon: 'icon-temp'}],
|
|
35
|
-
hearderData: ['first Name', 'Last Name','asdas',]
|
|
36
|
-
};
|
|
38
|
+
|
|
39
|
+
};
|
|
Binary file
|
|
@@ -17,6 +17,7 @@ import selectImage from './static/select-usage.png';
|
|
|
17
17
|
import toastImage from './static/toaster-usage.png';
|
|
18
18
|
import tooltipImage from './static/tooltip-usage.png';
|
|
19
19
|
import textareaImage from './static/textarea-usage.png';
|
|
20
|
+
import buttonImageIcon from './static/button-usage-icon.png';
|
|
20
21
|
import fileSingleImage from './static/file-single-usage.png';
|
|
21
22
|
import toasterImage from './static/toaster-container-usage.png';
|
|
22
23
|
import autocompleteImage from './static/autocomplete-usage.png';
|
|
@@ -136,6 +137,9 @@ import autocompleteImage from './static/autocomplete-usage.png';
|
|
|
136
137
|
### Button
|
|
137
138
|
<img src={buttonImage} alt="button image" />
|
|
138
139
|
|
|
140
|
+
#### Button with icon prop
|
|
141
|
+
<img src={buttonImageIcon} alt="button image" />
|
|
142
|
+
|
|
139
143
|
### Input
|
|
140
144
|
<img src={inputImage} alt="input image" />
|
|
141
145
|
|
package/src/utils/index.js
CHANGED
|
@@ -2,24 +2,11 @@ const _ = require('lodash');
|
|
|
2
2
|
|
|
3
3
|
export const compereConfigs = () => {
|
|
4
4
|
let projectConfig = {};
|
|
5
|
-
let packageConfig =
|
|
5
|
+
let packageConfig = require(process.env.STORYBOOK_PATH);
|
|
6
6
|
|
|
7
7
|
try {
|
|
8
|
-
|
|
9
|
-
} catch
|
|
10
|
-
try {
|
|
11
|
-
packageConfig = require('../../tui.config.js');
|
|
12
|
-
} catch (err) {
|
|
13
|
-
packageConfig = {};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
projectConfig = require('../../../../tui.config.js');
|
|
19
|
-
} catch (error) {
|
|
20
|
-
projectConfig = {};
|
|
21
|
-
// console.log(error, 'Project: if you want to use custom styles, create tui.config.js file in your project root');
|
|
22
|
-
}
|
|
8
|
+
projectConfig = require(`${process.env.STORYBOOK_CONFIG_PATH}`);
|
|
9
|
+
} catch(e) {}
|
|
23
10
|
|
|
24
11
|
return _.merge(packageConfig, projectConfig);
|
|
25
12
|
};
|
package/tui.config.js
CHANGED
|
@@ -50,12 +50,15 @@ module.exports = {
|
|
|
50
50
|
labelLineHeight: '22px', // for label line height
|
|
51
51
|
errorLineHeight: '19px', // for error message line height
|
|
52
52
|
boxSizing: 'border-box', // for box sizing
|
|
53
|
+
borderRight: '2px solid', // for type tel right border
|
|
53
54
|
backgroundColor: 'white', // for input and also (if there exist left or right icons) icons block background color
|
|
54
55
|
color: 'rgb(60, 57, 62)', // for input color
|
|
55
56
|
labelMarginBottom: '6px', // for label margin bottom
|
|
56
57
|
phoneAlignItems: 'center', // for phone extention inside item, work when input type is tel
|
|
57
58
|
errorPosition: 'absolute', // for error message position (maybe you want to show error message in custom place)
|
|
58
59
|
transform: 'scale3d(0,0,0)', // for transform (when have error message and errorAnimation prop is true)
|
|
60
|
+
borderRightColor: '#d1d1d1', // for type tel right border
|
|
61
|
+
borderRightColorHover: '#3c393e', // for type tel right border color when hover is active
|
|
59
62
|
phoneJustifyContent: 'center', // for phone extention inside item, work when input type is tel
|
|
60
63
|
boxShadow: '0 0 0 2px #d1d1d1', // for border size and color
|
|
61
64
|
errorAnimationDuration: '240ms', // for animation duration (when have error message and errorAnimation prop is true)
|
|
@@ -194,9 +197,7 @@ module.exports = {
|
|
|
194
197
|
selectedFontWeight: '500', // for selected font weight
|
|
195
198
|
selectedLineHeight: '22px', // for selected line height
|
|
196
199
|
selectedPadding: '0px 15px', // for selected padding
|
|
197
|
-
selectedBorder: '2px solid', // for selected border
|
|
198
200
|
selectedHoverColor: '#373538', // for selected color ( when hover )
|
|
199
|
-
selectedBorderColor: '#D1D1D1', // for selected border color
|
|
200
201
|
selectedBoxSizing: 'border-box', // for selected box sizing
|
|
201
202
|
selectedTransition: 'border-color 240ms', // for selected transition
|
|
202
203
|
|
|
@@ -216,6 +217,9 @@ module.exports = {
|
|
|
216
217
|
optionItemBoxSizing: 'border-box', // for option box sizing
|
|
217
218
|
optionItemBackgroudColor: '#ffffff', // for option background color
|
|
218
219
|
optionItemBackgroudColorHover: 'unset', // for option background color ( when hover )
|
|
220
|
+
|
|
221
|
+
boxShadow: '0 0 0 2px #d1d1d1',
|
|
222
|
+
boxShadowHover: '0 0 0 2px #3c393e'
|
|
219
223
|
},
|
|
220
224
|
// default properties for <Textarea /> component
|
|
221
225
|
TEXTAREA: {
|
|
@@ -374,5 +378,24 @@ module.exports = {
|
|
|
374
378
|
backgroundColor: 'white', // for modal background color
|
|
375
379
|
padding: '10px 20px 20px', // for modal padding
|
|
376
380
|
layerBackgroundColor: 'rgba(0,0,0,0.4)', // for modal parent layer background color
|
|
381
|
+
},
|
|
382
|
+
// default properties for <Table /> component
|
|
383
|
+
TABLE: {
|
|
384
|
+
tHeadFontWeight: 600,
|
|
385
|
+
tHeadColor: '#FBFBFB',
|
|
386
|
+
tHeadPadding: '11px 20px',
|
|
387
|
+
tHeadBorderRadius: '14px',
|
|
388
|
+
tHeadBackgroundColor: '#00236A',
|
|
389
|
+
tHeadFamily: 'Noto Sans Armenia',
|
|
390
|
+
|
|
391
|
+
tBodyColor: '#3C393E',
|
|
392
|
+
tBodyFontSize: '16px',
|
|
393
|
+
tBodyFontWeight: 500,
|
|
394
|
+
tBodyTextAlign: 'center',
|
|
395
|
+
tBodyPadding: '11px 20px',
|
|
396
|
+
tBodyFontFamily: 'Noto Sans Armenia',
|
|
397
|
+
|
|
398
|
+
tBodyRowBorder: '1px solid #eeeeee',
|
|
399
|
+
tBodyMarginTop: '20px',
|
|
377
400
|
}
|
|
378
401
|
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
.table-wrap {
|
|
2
|
-
width: 100%;
|
|
3
|
-
background: #fff;
|
|
4
|
-
box-shadow: 0 10px 30px rgba(0,35,106,.06);
|
|
5
|
-
border-radius: 14px 14px 0 0;
|
|
6
|
-
overflow: hidden
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.table-wrap:not(:first-child) {
|
|
10
|
-
margin-top: 30px
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.table-bottom-inner .table-items:first-child,.table-top .table-items:first-child {
|
|
14
|
-
flex: 0 0 auto;
|
|
15
|
-
width: 60px
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.table-bottom-inner .table-items:nth-child(2),.table-top .table-items:nth-child(2) {
|
|
19
|
-
flex: 0 0 auto;
|
|
20
|
-
width: 120px
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.table-bottom-inner .table-items:nth-child(3),.table-top .table-items:nth-child(3) {
|
|
24
|
-
flex: 0 0 auto;
|
|
25
|
-
width: 170px
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.table-bottom-inner .table-items:nth-child(4),.table-top .table-items:nth-child(4) {
|
|
29
|
-
flex: 0 0 auto;
|
|
30
|
-
width: 126px
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.table-bottom-inner .table-items:nth-child(5),.table-bottom-inner .table-items:nth-child(6),.table-bottom-inner .table-items:nth-child(8),.table-top .table-items:nth-child(5),.table-top .table-items:nth-child(6),.table-top .table-items:nth-child(8) {
|
|
34
|
-
flex: 0 0 auto;
|
|
35
|
-
width: 100px
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.table-bottom-inner .table-items:last-child,.table-top .table-items:last-child {
|
|
39
|
-
flex: 0 0 auto;
|
|
40
|
-
width: 104px
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.table-top {
|
|
44
|
-
width: 100%;
|
|
45
|
-
height: 44px;
|
|
46
|
-
background: #00236a
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.table-top .table-items {
|
|
50
|
-
flex: 1 1;
|
|
51
|
-
display: flex;
|
|
52
|
-
align-items: center;
|
|
53
|
-
justify-content: center;
|
|
54
|
-
text-align: center;
|
|
55
|
-
color: #fff;
|
|
56
|
-
font-size: 15px;
|
|
57
|
-
line-height: 17px
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.table-bottom-inner {
|
|
61
|
-
width: 100%;
|
|
62
|
-
min-height: 40px;
|
|
63
|
-
background: #fff
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.table-bottom-inner .table-items {
|
|
67
|
-
flex: 1 1;
|
|
68
|
-
display: flex;
|
|
69
|
-
align-items: center;
|
|
70
|
-
justify-content: center;
|
|
71
|
-
text-align: center;
|
|
72
|
-
font-size: 14px;
|
|
73
|
-
line-height: 16px;
|
|
74
|
-
border-bottom: 1px solid #eee;
|
|
75
|
-
padding: 4px
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.table-bottom-inner .table-items:not(:last-child) {
|
|
79
|
-
border-right: 1px solid #eee
|
|
80
|
-
}
|