@xaypay/tui 0.0.14 → 0.0.16
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 +247 -180
- package/dist/index.js +228 -158
- package/package.json +1 -1
- package/src/components/button/index.js +0 -3
- package/src/components/captcha/captcha.stories.js +0 -1
- package/src/components/icon/Icon.js +9 -2
- package/src/components/input/index.js +5 -2
- package/src/components/input/input.stories.js +1 -1
- package/src/components/multiselect/multiselect.stories.js +0 -1
- package/src/components/pagination/index.js +4 -2
- package/src/components/select/index.js +52 -51
- package/src/components/select/select.stories.js +0 -1
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -31,8 +31,6 @@ export const ButtonSize = {
|
|
|
31
31
|
|
|
32
32
|
export const Button = ({ primary, backgroundColor, theme, size, className, disabled, label, outline, ...props }) => {
|
|
33
33
|
|
|
34
|
-
console.log(styles);
|
|
35
|
-
console.log(backgroundColor);
|
|
36
34
|
const classProps = classnames(
|
|
37
35
|
styles.btn,
|
|
38
36
|
styles[theme],
|
|
@@ -41,7 +39,6 @@ export const Button = ({ primary, backgroundColor, theme, size, className, disab
|
|
|
41
39
|
className
|
|
42
40
|
);
|
|
43
41
|
// className='btn type-outline size-default'
|
|
44
|
-
console.log(classProps);
|
|
45
42
|
return (
|
|
46
43
|
<button
|
|
47
44
|
type="button"
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Created by aleksanyan.tigran on 10/7/2022.
|
|
3
3
|
*/
|
|
4
|
+
import React from "react";
|
|
4
5
|
import style from '../../assets_old/icons/style.css'
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
const Icon = (props) => {
|
|
8
|
+
return (
|
|
9
|
+
<i className={style[props.className]} />
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default Icon;
|
|
@@ -29,12 +29,13 @@ export const Input = ({
|
|
|
29
29
|
disabled,
|
|
30
30
|
type,
|
|
31
31
|
onChange,
|
|
32
|
+
value,
|
|
32
33
|
...props
|
|
33
34
|
}) => {
|
|
34
|
-
const [inputValue, setInputValue] = useState(
|
|
35
|
+
const [inputValue, setInputValue] = useState(value);
|
|
35
36
|
const handleChange = (event) => {
|
|
36
37
|
setInputValue(event.target.value);
|
|
37
|
-
onChange(event.target.value);
|
|
38
|
+
onChange ? onChange(event.target.value) : '';
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
let eMessage = "";
|
|
@@ -79,6 +80,7 @@ Input.propTypes = {
|
|
|
79
80
|
regexpError: PropTypes.string,
|
|
80
81
|
label: PropTypes.string.isRequired,
|
|
81
82
|
disabled: PropTypes.bool,
|
|
83
|
+
value: PropTypes.string
|
|
82
84
|
};
|
|
83
85
|
|
|
84
86
|
Input.defaultProps = {
|
|
@@ -89,4 +91,5 @@ Input.defaultProps = {
|
|
|
89
91
|
required: true,
|
|
90
92
|
errorMesage: "",
|
|
91
93
|
type: "text",
|
|
94
|
+
value: ""
|
|
92
95
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import classnames from "classnames";
|
|
4
4
|
import styles from "./pagination.module.css";
|
|
@@ -29,7 +29,9 @@ export const Pagination = ({
|
|
|
29
29
|
const onPageChange = (page) => {
|
|
30
30
|
setCurrentPage(page);
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
onChange(currentPageNumber);
|
|
34
|
+
}, []);
|
|
33
35
|
const paginationRange = PaginationRange({
|
|
34
36
|
currentPageNumber,
|
|
35
37
|
currentTotalCount,
|
|
@@ -48,66 +48,67 @@ export const Select = ({
|
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
<div>
|
|
52
|
+
{label ? <label className={styles['select-title']}>{label}</label> : ""}
|
|
53
|
+
<div className={styles['select-wrap']}>
|
|
54
|
+
<div className={styles['select-content']} id={styles.selector}>
|
|
55
|
+
<div
|
|
56
|
+
className={styles['select-content-top']}
|
|
57
|
+
onClick={() => {
|
|
58
|
+
setOpened(!opened)
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
<div className={styles['select-content-top-text']}>{newSelected && newSelected.name ? newSelected.name : defaultOption}</div>
|
|
62
|
+
<div className={styles['select-content-top-icon']}>
|
|
63
|
+
<Icon className={opened ? 'icon-arrow-up' : 'icon-arrow-down'}/>
|
|
64
|
+
</div>
|
|
64
65
|
</div>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
opened && !disabled ?
|
|
66
|
+
{
|
|
67
|
+
opened && !disabled ?
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
<div className={styles['select-content-bottom']}>
|
|
70
|
+
<div className={styles['select-content-bottom-inner']}>
|
|
71
|
+
<div
|
|
72
|
+
className={styles['select-content-bottom-row']}
|
|
73
|
+
onClick={() => {
|
|
74
|
+
if (!required && !selected) {
|
|
75
|
+
setNewSelected(defaultOption)
|
|
76
|
+
onChange(defaultOption)
|
|
77
|
+
setOpened(!opened)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
78
80
|
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
>
|
|
82
|
-
{defaultOption}
|
|
83
|
-
</div>
|
|
84
|
-
{
|
|
85
|
-
options ?.map((option, i) => {
|
|
86
|
-
return <div
|
|
87
|
-
className={styles['select-content-bottom-row']}
|
|
88
|
-
disabled={true}
|
|
89
|
-
onClick={() => {
|
|
90
|
-
setNewSelected(option);
|
|
91
|
-
onChange(option);
|
|
92
|
-
setOpened(!opened);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
defaultValue={option.id}
|
|
96
81
|
>
|
|
97
|
-
|
|
82
|
+
{defaultOption}
|
|
98
83
|
</div>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
84
|
+
{
|
|
85
|
+
options.map((option, i) => {
|
|
86
|
+
return <div
|
|
87
|
+
key={i}
|
|
88
|
+
className={styles['select-content-bottom-row']}
|
|
89
|
+
disabled={true}
|
|
90
|
+
onClick={() => {
|
|
91
|
+
setNewSelected(option);
|
|
92
|
+
onChange(option);
|
|
93
|
+
setOpened(!opened);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
defaultValue={option.id}
|
|
97
|
+
>
|
|
98
|
+
{option.name}
|
|
99
|
+
</div>
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
</div>
|
|
102
103
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
</div>
|
|
105
|
+
: null
|
|
106
|
+
}
|
|
106
107
|
|
|
108
|
+
</div>
|
|
107
109
|
</div>
|
|
110
|
+
{eMessage ? <span className={styles.eMessage}>{eMessage}</span> : null}
|
|
108
111
|
</div>
|
|
109
|
-
{eMessage ? <span className={styles.eMessage}>{eMessage}</span> : null}
|
|
110
|
-
</>
|
|
111
112
|
);
|
|
112
113
|
};
|
|
113
114
|
|
|
@@ -13,7 +13,6 @@ Default.args = {
|
|
|
13
13
|
label: 'վարչական շրջան',
|
|
14
14
|
jsonData: '[{"id":"0", "name":"Արաբկիր"}, {"id":"1", "name":"Կենտրոն"}, {"id":"2", "name":"Մալաթիա"}]',
|
|
15
15
|
onChange: (newValue)=> {
|
|
16
|
-
console.log(newValue);
|
|
17
16
|
},
|
|
18
17
|
defaultOption: 'ընտրել',
|
|
19
18
|
selected: {"id":"2", "name":"Մալաթիա"}
|
package/src/index.js
CHANGED