@xaypay/tui 0.0.105 → 0.0.107
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/.eslintrc.js +30 -0
- package/.husky/pre-commit +4 -0
- package/.prettierrc +10 -0
- package/.storybook/main.js +42 -45
- package/.storybook/preview.js +7 -7
- package/cli-command.js +1 -1
- package/dist/index.es.js +105 -94
- package/dist/index.js +105 -94
- package/package.json +16 -4
- package/rollup.config.js +11 -11
- package/src/assets_old/icons/demo-files/demo.js +16 -18
- package/src/components/autocomplate/autocomplate.stories.js +30 -28
- package/src/components/autocomplate/index.js +145 -127
- package/src/components/button/button.stories.js +6 -6
- package/src/components/button/index.js +176 -126
- package/src/components/captcha/captcha.stories.js +12 -8
- package/src/components/captcha/index.js +47 -50
- package/src/components/checkbox/checkbox.stories.js +7 -7
- package/src/components/checkbox/index.js +77 -93
- package/src/components/file/file.stories.js +15 -15
- package/src/components/file/index.js +114 -116
- package/src/components/icon/Arrow.js +18 -18
- package/src/components/icon/CaptchaArrowDown.js +18 -18
- package/src/components/icon/CaptchaArrowUp.js +18 -18
- package/src/components/icon/CheckboxChecked.js +20 -20
- package/src/components/icon/CheckboxUnchecked.js +20 -20
- package/src/components/icon/Close.js +18 -18
- package/src/components/icon/CloseIcon.js +18 -18
- package/src/components/icon/CloseSlide.js +18 -18
- package/src/components/icon/DeleteComponent.js +19 -19
- package/src/components/icon/Dots.js +18 -18
- package/src/components/icon/HeartFilled.js +22 -23
- package/src/components/icon/HeartOutline.js +22 -22
- package/src/components/icon/Icon.js +3 -5
- package/src/components/icon/ListItemDelete.js +18 -18
- package/src/components/icon/ListItemJpeg.js +20 -20
- package/src/components/icon/ListItemJpg.js +20 -20
- package/src/components/icon/ListItemPdf.js +20 -20
- package/src/components/icon/ListItemPng.js +20 -20
- package/src/components/icon/Next.js +19 -19
- package/src/components/icon/Nextarrow.js +18 -18
- package/src/components/icon/PDF.js +18 -18
- package/src/components/icon/Prev.js +19 -19
- package/src/components/icon/RangeArrowDefault.js +41 -52
- package/src/components/icon/RangeArrowError.js +41 -52
- package/src/components/icon/RangeArrowSuccess.js +41 -52
- package/src/components/icon/RemoveFile.js +19 -19
- package/src/components/icon/ToasterClose.js +18 -18
- package/src/components/icon/ToasterError.js +18 -18
- package/src/components/icon/ToasterInfo.js +18 -18
- package/src/components/icon/ToasterSuccess.js +18 -18
- package/src/components/icon/ToasterWarning.js +18 -18
- package/src/components/icon/Tooltip.js +18 -18
- package/src/components/icon/Upload.js +24 -24
- package/src/components/input/index.js +267 -224
- package/src/components/input/input.stories.js +20 -21
- package/src/components/modal/index.js +172 -159
- package/src/components/modal/modal.stories.js +79 -78
- package/src/components/newAutocomplete/NewAutocomplete.stories.js +93 -51
- package/src/components/newAutocomplete/index.js +342 -216
- package/src/components/newFile/fileItem.js +214 -191
- package/src/components/newFile/index.js +235 -173
- package/src/components/newFile/newFile.stories.js +32 -35
- package/src/components/pagination/index.js +97 -122
- package/src/components/pagination/pagination.stories.js +362 -362
- package/src/components/pagination/paginationRange.js +42 -53
- package/src/components/radio/index.js +49 -62
- package/src/components/radio/radio.stories.js +7 -7
- package/src/components/select/index.js +318 -223
- package/src/components/select/select.stories.js +25 -14
- package/src/components/singleCheckbox/Checkbox.js +31 -34
- package/src/components/singleCheckbox/index.js +36 -45
- package/src/components/singleCheckbox/singleCheckbox.stories.js +16 -16
- package/src/components/stepper/index.js +35 -30
- package/src/components/stepper/stepper.stories.js +11 -11
- package/src/components/table/index.js +280 -148
- package/src/components/table/table.stories.js +105 -217
- package/src/components/table/td.js +80 -72
- package/src/components/table/th.js +19 -16
- package/src/components/textarea/index.js +86 -62
- package/src/components/textarea/textarea.stories.js +10 -13
- package/src/components/toaster/Toast.js +180 -158
- package/src/components/toaster/index.js +108 -111
- package/src/components/toaster/toaster.module.css +13 -0
- package/src/components/toaster/toaster.stories.js +582 -367
- package/src/components/tooltip/index.js +79 -46
- package/src/components/tooltip/tooltip.stories.js +9 -10
- package/src/components/typography/index.js +108 -101
- package/src/components/typography/typography.stories.js +16 -19
- package/src/index.js +20 -20
- package/src/stories/configuration.stories.mdx +1 -0
- package/src/utils/index.js +11 -11
- package/tui.config.js +343 -340
|
@@ -1,87 +1,88 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import { Modal } from
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { Modal } from './index'
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
5
|
+
component: Modal,
|
|
6
|
+
title: 'Components/Modal',
|
|
7
|
+
}
|
|
8
8
|
|
|
9
|
-
const Template = ({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
9
|
+
const Template = ({ className }) => {
|
|
10
|
+
const [show, setShow] = useState(false)
|
|
11
|
+
const [type, setType] = useState('content')
|
|
12
|
+
const data = [
|
|
13
|
+
{
|
|
14
|
+
url: 'https://images.pexels.com/photos/268533/pexels-photo-268533.jpeg?cs=srgb&dl=pexels-pixabay-268533.jpg&fm=jpg',
|
|
15
|
+
id: 1,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSS8LHEGxt49kfpf7asGDZd5rnTjQMD0HF2WtJ3wKEDww&s',
|
|
19
|
+
id: 2,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
url: 'https://s.alamy.com/kdawwlsweh27/2LtummpjO849eQ83yGGiUN/316e62a71020a924f9f663b6ca6b7eda/Fresh_Stock_Content.jpg?fm=jpg&q=100',
|
|
23
|
+
id: 3,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
url: 'https://media.istockphoto.com/id/533899788/photo/mount-ararat-from-armenia.jpg?s=612x612&w=0&k=20&c=dB48gVwJq4UGCzdLpOsxDv9DniGQIOBdmli28zUXu0A=',
|
|
27
|
+
id: 4,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
url: 'https://media.istockphoto.com/id/500221043/photo/cascade-yerevan.jpg?s=612x612&w=0&k=20&c=vaULCkIZaIbetZlkFnP20ELnD8cyhlc9cRsvt-X5YAk=',
|
|
31
|
+
id: 5,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
url: 'https://images.unsplash.com/photo-1512850183-6d7990f42385?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NXx8dmVydGljYWx8ZW58MHx8MHx8fDA%3D&w=1000&q=80',
|
|
35
|
+
id: 6,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
url: './../../assets/figma-image.png',
|
|
39
|
+
id: 7,
|
|
40
|
+
},
|
|
41
|
+
]
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
const handleClick = () => {
|
|
44
|
+
setShow(true)
|
|
45
|
+
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
const handleChangeType = () => {
|
|
48
|
+
if (type === 'content') {
|
|
49
|
+
setType('images')
|
|
50
|
+
} else {
|
|
51
|
+
setType('content')
|
|
52
|
+
}
|
|
52
53
|
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<>
|
|
57
|
-
<button
|
|
58
|
-
onClick={handleClick}
|
|
59
|
-
style={{ cursor: 'pointer', padding: '8px', fontSize: '16px', marginRight: '10px' }}
|
|
60
|
-
>Click</button>
|
|
61
|
-
<button
|
|
62
|
-
onClick={handleChangeType}
|
|
63
|
-
style={{ cursor: 'pointer', padding: '8px', fontSize: '16px' }}
|
|
64
|
-
>Change type to {type === 'content' ? 'images' : 'content'}</button>
|
|
65
|
-
{show && (
|
|
66
|
-
<Modal type={type} selected={0} data={data} setShow={setShow} className={className}>
|
|
67
|
-
<div
|
|
68
|
-
style={{
|
|
69
|
-
width: '400px',
|
|
70
|
-
height: '500px',
|
|
71
|
-
backgroundColor: 'red'
|
|
72
|
-
}}
|
|
73
|
-
>
|
|
74
|
-
just test
|
|
75
|
-
</div>
|
|
76
|
-
</Modal>
|
|
77
|
-
)}
|
|
78
|
-
</>
|
|
79
|
-
);
|
|
80
|
-
};
|
|
81
54
|
|
|
82
|
-
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
<button
|
|
58
|
+
onClick={handleClick}
|
|
59
|
+
style={{ cursor: 'pointer', padding: '8px', fontSize: '16px', marginRight: '10px' }}
|
|
60
|
+
>
|
|
61
|
+
Click
|
|
62
|
+
</button>
|
|
63
|
+
<button onClick={handleChangeType} style={{ cursor: 'pointer', padding: '8px', fontSize: '16px' }}>
|
|
64
|
+
Change type to {type === 'content' ? 'images' : 'content'}
|
|
65
|
+
</button>
|
|
66
|
+
{show && (
|
|
67
|
+
<Modal type={type} selected={0} data={data} setShow={setShow} className={className}>
|
|
68
|
+
<div
|
|
69
|
+
style={{
|
|
70
|
+
width: '400px',
|
|
71
|
+
height: '500px',
|
|
72
|
+
backgroundColor: 'red',
|
|
73
|
+
}}
|
|
74
|
+
>
|
|
75
|
+
just test
|
|
76
|
+
</div>
|
|
77
|
+
</Modal>
|
|
78
|
+
)}
|
|
79
|
+
</>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const Default = Template.bind({})
|
|
83
84
|
|
|
84
85
|
Default.args = {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
86
|
+
headerText: 'Modal header text',
|
|
87
|
+
className: 'Modal',
|
|
88
|
+
}
|
|
@@ -1,60 +1,102 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import { NewAutocomplete } from './index'
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { NewAutocomplete } from './index'
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
component: NewAutocomplete,
|
|
6
|
+
title: 'Components/NewAutocomplete',
|
|
7
|
+
argTypes: {
|
|
8
|
+
options: {
|
|
9
|
+
control: 'array',
|
|
10
|
+
},
|
|
11
|
+
getItem: {
|
|
12
|
+
control: 'function',
|
|
13
|
+
},
|
|
14
|
+
change: {
|
|
15
|
+
control: 'function',
|
|
16
|
+
},
|
|
13
17
|
},
|
|
14
|
-
|
|
15
|
-
control: 'function'
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
18
|
+
}
|
|
19
19
|
|
|
20
20
|
const Template = (args) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const [newOptions, setNewOptions] = useState([])
|
|
22
|
+
const [sel, setSel] = useState({ bbb: '0', name: 'gasdfgdsfgdsg' })
|
|
23
|
+
const handleClick = (selected) => {
|
|
24
|
+
console.log(selected, 'selected')
|
|
25
|
+
}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
27
|
+
const handleChange = (value) => {
|
|
28
|
+
fetch(`http://dev2.govazd-api.yerevan.am/api/v1/companies/autocomplete?slug=${value.name ? value.name : ''}`, {
|
|
29
|
+
method: 'GET',
|
|
30
|
+
headers: {
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
|
+
Authorization:
|
|
33
|
+
'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIwMjE0NzEyYTllNzQwZWMyMjNhYzE2MGQyNGVkY2UzNyIsImp0aSI6ImE1Mjk4NTU5ZjRiYWMxMzQyOTM3OTIzMTM2ZWQwNTM2ZWI1NjNlMzdhZGJjYjlkOWE1OWE5YjBlODBlM2JkMTJjZDE4YTAxM2NjNWEwOTM2IiwiaWF0IjoxNjg2ODA2NzEyLjgyNjEyLCJuYmYiOjE2ODY4MDY3MTIuODI2MTI4LCJleHAiOjE2ODY4MzE5MTIuODA0MTYxLCJzdWIiOiJtaW5hczg5QG1haWwucnUiLCJzY29wZXMiOlsiZW1haWwiXX0.Laezbf2xobWHCeDsFD_9nrGsPznIqUAz56Y-KyfvGt6x6F7WpxAg5HovIeiaLdhi0wdHWZhYnOMVktlHz-Gw0wdC6i-0IMq27tc968o21sTwp3jkVTl543J334u2-ju-s0nx9Yfcd84ySd499sMlhZRbsxuUPKJTiPAXeG6_tqlnMGRcQPIN24SIY4FLzES2vIQ6SqeiSQm9UQFlf4rmHVE7bEhFUPHXymNLMk8gS7Jm_xdhWtuv2Ei0ipiTApmUwpE4GYnpiHnnrEoZVrJ-sFgFZJekV0theZp5qPvjyLOVaC1rPIwwt8pdQZcfwFGxWWC9J3cEHtPfw9UhIsLi_IjS0OsFWuast6z6qSGVBpymQPA3oA1QSO4iA2UPAC0Yj7cYpYHP1q76jxbnSfYM0ifWwPUanX2OUdMWRMGuwzct7gi2jC3WIwTICahxrKFr_YpbEupxweL2IbxUeGoKCY13bq97C4u7bGELPlhoNHxm2HTD1Gp_sdQcEepJj2OMOvxE3eRCaJwyCtjZgsFpZSZYxo_6cSuCDGb0oxXESMjLPvCrleIXVJykc9ZjiK0gCZzeX83N9QlndsJ4elOcM8dLy0OOvXoojF1o_TMqSw8sD8wjpEo9Bp0MyUs4hPjmiBSrPNSAo9jbpgLYWuTUvCpPXFqmRkZhr4T_hnnuHkk',
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
.then((res) => {
|
|
37
|
+
return res.json()
|
|
38
|
+
})
|
|
39
|
+
.then((data) => {
|
|
40
|
+
if (data.data.success === false) {
|
|
41
|
+
setNewOptions([])
|
|
42
|
+
} else {
|
|
43
|
+
setNewOptions(data.data.companies)
|
|
44
|
+
}
|
|
45
|
+
console.log(data, 'data')
|
|
46
|
+
})
|
|
47
|
+
}
|
|
45
48
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<NewAutocomplete
|
|
52
|
+
{...args}
|
|
53
|
+
getItem={handleClick}
|
|
54
|
+
selected={sel}
|
|
55
|
+
options={newOptions}
|
|
56
|
+
change={handleChange}
|
|
57
|
+
/>
|
|
58
|
+
<button
|
|
59
|
+
style={{
|
|
60
|
+
padding: '15px',
|
|
61
|
+
cursor: 'pointer',
|
|
62
|
+
margin: '10px 15px 0px 0px',
|
|
63
|
+
borderRadius: '10px',
|
|
64
|
+
fontSize: '22px',
|
|
65
|
+
}}
|
|
66
|
+
onClick={() => setSel({ bbb: '0', name: 'gasdfgdsfgdsg' })}
|
|
67
|
+
>
|
|
68
|
+
reset selected
|
|
69
|
+
</button>
|
|
70
|
+
<button
|
|
71
|
+
style={{
|
|
72
|
+
padding: '15px',
|
|
73
|
+
cursor: 'pointer',
|
|
74
|
+
margin: '10px 15px 0px 0px',
|
|
75
|
+
borderRadius: '10px',
|
|
76
|
+
fontSize: '22px',
|
|
77
|
+
}}
|
|
78
|
+
onClick={() => setSel({ dd: '1', name: 'just ok' })}
|
|
79
|
+
>
|
|
80
|
+
change selected
|
|
81
|
+
</button>
|
|
82
|
+
<button
|
|
83
|
+
style={{
|
|
84
|
+
padding: '15px',
|
|
85
|
+
cursor: 'pointer',
|
|
86
|
+
margin: '10px 15px 0px 0px',
|
|
87
|
+
borderRadius: '10px',
|
|
88
|
+
fontSize: '22px',
|
|
89
|
+
}}
|
|
90
|
+
onClick={() => setSel({ dd: '', name: '' })}
|
|
91
|
+
>
|
|
92
|
+
empty selected
|
|
93
|
+
</button>
|
|
94
|
+
</>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
export const Default = Template.bind({})
|
|
56
98
|
Default.args = {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
99
|
+
searchCount: 3,
|
|
100
|
+
keyNames: { name: 'name', id: 'bbb' },
|
|
101
|
+
selected: { bbb: '0', name: 'gasdfgdsfgdsg' },
|
|
60
102
|
}
|