groovinads-ui 1.2.48 → 1.2.50
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/README.md +30 -25
- package/dist/index.es.js +4 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/Dropdowns/DropdownSimpleDatePicker.jsx +99 -102
- package/src/components/index.js +49 -0
- package/src/index.js +7 -21
- package/src/stories/DropdownSimpleDatePicker.stories.jsx +9 -8
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "groovinads-ui",
|
|
3
3
|
"description": "Groovinads UI is a React component library designed exclusively for Groovinads applications. It provides ready-to-use UI elements styled according to Groovinads design guidelines to facilitate rapid development.",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.50",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
7
7
|
"sass",
|
|
@@ -12,116 +12,111 @@ import DatePicker from 'react-datepicker';
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
export default function DropdownSimpleDatePicker({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
className = '',
|
|
16
|
+
show,
|
|
17
|
+
setShow,
|
|
18
|
+
onToggle,
|
|
19
|
+
inputLabel = 'period',
|
|
20
|
+
overflow = false,
|
|
21
|
+
date,
|
|
22
|
+
setDate,
|
|
23
|
+
handleClear,
|
|
23
24
|
}) {
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
const [internalShow, setInternalShow] = useState(!!show);
|
|
26
27
|
|
|
27
|
-
const [internalShow, setInternalShow] = useState(!!show);
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
const internalToggle = () => {
|
|
30
|
+
setInternalShow((prevShow) => !prevShow);
|
|
31
|
+
try {
|
|
32
|
+
onToggle();
|
|
33
|
+
} catch (error) { }
|
|
34
|
+
};
|
|
30
35
|
|
|
31
|
-
|
|
36
|
+
const closeDropdown = () => {
|
|
37
|
+
setInternalShow(false);
|
|
38
|
+
try {
|
|
39
|
+
setShow(false);
|
|
40
|
+
} catch (error) { }
|
|
41
|
+
};
|
|
32
42
|
|
|
43
|
+
const updateDateFilters = (newDate) => {
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
setDate(newDate?.toString());
|
|
46
|
+
closeDropdown();
|
|
47
|
+
}, 100);
|
|
48
|
+
};
|
|
33
49
|
|
|
34
|
-
|
|
35
|
-
setInternalShow((prevShow) => !prevShow);
|
|
36
|
-
try {
|
|
37
|
-
onToggle();
|
|
38
|
-
} catch (error) { }
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const closeDropdown = () => {
|
|
42
|
-
setInternalShow(false);
|
|
43
|
-
try {
|
|
44
|
-
setShow(false);
|
|
45
|
-
} catch (error) { }
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const updateDateFilters = (date) => {
|
|
49
|
-
setEditingDate(date);
|
|
50
|
-
setTimeout(() => {
|
|
51
|
-
setDate(editingDate?.toString());
|
|
52
|
-
closeDropdown();
|
|
53
|
-
}, 100);
|
|
54
|
-
};
|
|
55
|
-
|
|
50
|
+
|
|
56
51
|
const clearDate = () => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
52
|
+
if (handleClear) {
|
|
53
|
+
handleClear()
|
|
54
|
+
return
|
|
55
|
+
}
|
|
56
|
+
setDate(null);
|
|
57
|
+
closeDropdown();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
setInternalShow(!!show);
|
|
62
|
+
}, [show]);
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<Dropdown
|
|
66
|
+
show={internalShow}
|
|
67
|
+
className={className}
|
|
68
|
+
>
|
|
69
|
+
<Dropdown.Toggle
|
|
70
|
+
variant='toggle-filter'
|
|
71
|
+
onClick={internalToggle}
|
|
72
|
+
className={`btn-input w-100`}
|
|
73
|
+
>
|
|
74
|
+
<span className='dropdown-label'>{inputLabel}</span>
|
|
75
|
+
<span>
|
|
76
|
+
{(date || '').toString().split('00')[0]}
|
|
77
|
+
</span>
|
|
78
|
+
|
|
79
|
+
<Icon iconName='angle-down' />
|
|
80
|
+
|
|
81
|
+
</Dropdown.Toggle>
|
|
82
|
+
|
|
83
|
+
<Dropdown.Menu
|
|
84
|
+
popperConfig={
|
|
85
|
+
overflow
|
|
86
|
+
? {
|
|
87
|
+
strategy: 'fixed',
|
|
88
|
+
onFirstUpdate: () =>
|
|
89
|
+
window.dispatchEvent(new CustomEvent('scroll')),
|
|
90
|
+
}
|
|
91
|
+
: undefined
|
|
92
|
+
}
|
|
93
|
+
>
|
|
94
|
+
<Dropdown.Item as={'div'}>
|
|
95
|
+
|
|
96
|
+
<DatePicker
|
|
97
|
+
className='form-control form-search'
|
|
98
|
+
selected={date || ''}
|
|
99
|
+
onChange={updateDateFilters}
|
|
100
|
+
startDate={date || ''}
|
|
101
|
+
monthsShown={1}
|
|
102
|
+
inline
|
|
103
|
+
/>
|
|
104
|
+
|
|
105
|
+
<div className='px-2 w-100'>
|
|
106
|
+
<Button
|
|
107
|
+
onClick={clearDate}
|
|
108
|
+
icon='calendar-circle-minus'
|
|
109
|
+
size='xs'
|
|
110
|
+
variant='terciary'
|
|
111
|
+
className='w-100'
|
|
112
|
+
>
|
|
113
|
+
Clear
|
|
114
|
+
</Button>
|
|
115
|
+
</div>
|
|
116
|
+
</Dropdown.Item>
|
|
117
|
+
</Dropdown.Menu>
|
|
118
|
+
</Dropdown>
|
|
119
|
+
)
|
|
125
120
|
}
|
|
126
121
|
|
|
127
122
|
DropdownSimpleDatePicker.propTypes = {
|
|
@@ -133,4 +128,6 @@ DropdownSimpleDatePicker.propTypes = {
|
|
|
133
128
|
overflow: PropTypes.bool,
|
|
134
129
|
date: PropTypes.string,
|
|
135
130
|
setDate: PropTypes.func,
|
|
131
|
+
clearDate: PropTypes.func,
|
|
132
|
+
handleClear: PropTypes.func,
|
|
136
133
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Buttons
|
|
2
|
+
import Button from "./Button/Button";
|
|
3
|
+
|
|
4
|
+
// Dropdowns
|
|
5
|
+
import { DropdownComponent, DropdownMultiSelect, DropdownDatePicker, DropdownFilter, DropdownSimpleDatePicker } from './Dropdowns';
|
|
6
|
+
|
|
7
|
+
// Inputs
|
|
8
|
+
import { Checkbox, Input, Radio, Switch, Textarea } from './Inputs';
|
|
9
|
+
|
|
10
|
+
// Labels
|
|
11
|
+
import { Alert, Icon, LoginSource, PillComponent, Spinner, StatusIcon } from './Labels';
|
|
12
|
+
|
|
13
|
+
// Toasts
|
|
14
|
+
import {ToastComponent, ToastProgress} from './Toasts';
|
|
15
|
+
|
|
16
|
+
// Navigation
|
|
17
|
+
import {Navbar, Stepper, Tabnav, Sidebar} from './Navigation';
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
// Buttons
|
|
21
|
+
Button,
|
|
22
|
+
// Dropdowns
|
|
23
|
+
DropdownComponent,
|
|
24
|
+
DropdownFilter,
|
|
25
|
+
DropdownMultiSelect,
|
|
26
|
+
DropdownSimpleDatePicker,
|
|
27
|
+
DropdownDatePicker,
|
|
28
|
+
// Inputs
|
|
29
|
+
Checkbox,
|
|
30
|
+
Input,
|
|
31
|
+
Radio,
|
|
32
|
+
Switch,
|
|
33
|
+
Textarea,
|
|
34
|
+
// Labels
|
|
35
|
+
Alert,
|
|
36
|
+
Icon,
|
|
37
|
+
LoginSource,
|
|
38
|
+
PillComponent,
|
|
39
|
+
Spinner,
|
|
40
|
+
StatusIcon,
|
|
41
|
+
// Toasts
|
|
42
|
+
ToastComponent,
|
|
43
|
+
ToastProgress,
|
|
44
|
+
// Navigation
|
|
45
|
+
Navbar,
|
|
46
|
+
Stepper,
|
|
47
|
+
Tabnav,
|
|
48
|
+
Sidebar
|
|
49
|
+
}
|
package/src/index.js
CHANGED
|
@@ -2,34 +2,19 @@
|
|
|
2
2
|
import Button from "./components/Button/Button";
|
|
3
3
|
|
|
4
4
|
// Dropdowns
|
|
5
|
-
import DropdownComponent from './components/Dropdowns
|
|
6
|
-
|
|
7
|
-
import DropdownMultiSelect from './components/Dropdowns/DropdownMultiSelect';
|
|
8
|
-
import DropdownDatePicker from './components/Dropdowns/DropdownsDatePicker/DropdownDatePicker';
|
|
5
|
+
import {DropdownComponent, DropdownFilter, DropdownMultiSelect, DropdownDatePicker, DropdownSimpleDatePicker} from './components/Dropdowns';
|
|
6
|
+
|
|
9
7
|
// Inputs
|
|
10
|
-
import Checkbox from './components/Inputs
|
|
11
|
-
import Input from './components/Inputs/Input';
|
|
12
|
-
import Radio from './components/Inputs/Radio';
|
|
13
|
-
import Switch from './components/Inputs/Switch';
|
|
14
|
-
import Textarea from './components/Inputs/Textarea';
|
|
8
|
+
import {Checkbox, Input, Radio, Switch, Textarea} from './components/Inputs';
|
|
15
9
|
|
|
16
10
|
// Labels
|
|
17
|
-
import Alert from './components/Labels
|
|
18
|
-
import Icon from './components/Labels/Icon';
|
|
19
|
-
import LoginSource from './components/Labels/LoginSource';
|
|
20
|
-
import PillComponent from './components/Labels/PillComponent';
|
|
21
|
-
import Spinner from './components/Labels/Spinner';
|
|
22
|
-
import StatusIcon from './components/Labels/StatusIcon';
|
|
11
|
+
import {Alert, Icon, LoginSource, PillComponent, Spinner, StatusIcon} from './components/Labels';
|
|
23
12
|
|
|
24
13
|
// Toasts
|
|
25
|
-
import ToastComponent from './components/Toasts
|
|
26
|
-
import ToastProgress from './components/Toasts/ToastProgress';
|
|
14
|
+
import {ToastComponent, ToastProgress} from './components/Toasts';
|
|
27
15
|
|
|
28
16
|
// Navigation
|
|
29
|
-
import Navbar from './components/Navigation
|
|
30
|
-
import Stepper from './components/Navigation/Stepper';
|
|
31
|
-
import Tabnav from './components/Navigation/Tabnav';
|
|
32
|
-
import Sidebar from './components/Navigation/Sidebar';
|
|
17
|
+
import {Navbar, Stepper, Tabnav, Sidebar} from './components/Navigation';
|
|
33
18
|
|
|
34
19
|
export {
|
|
35
20
|
// Buttons
|
|
@@ -38,6 +23,7 @@ export {
|
|
|
38
23
|
DropdownComponent,
|
|
39
24
|
DropdownFilter,
|
|
40
25
|
DropdownMultiSelect,
|
|
26
|
+
DropdownSimpleDatePicker,
|
|
41
27
|
DropdownDatePicker,
|
|
42
28
|
// Inputs
|
|
43
29
|
Checkbox,
|
|
@@ -9,20 +9,21 @@ export default {
|
|
|
9
9
|
const Template = (args) => {
|
|
10
10
|
const [show, setShow] = useState(false);
|
|
11
11
|
|
|
12
|
-
const [
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const [date, setDate] = useState('');
|
|
13
|
+
|
|
14
|
+
const clearData = () => {
|
|
15
|
+
console.log('afuera');
|
|
16
|
+
}
|
|
15
17
|
|
|
16
18
|
return (
|
|
17
19
|
<>
|
|
18
20
|
<button onClick={() => setShow(!show)}>Toggle</button>
|
|
19
|
-
<div className='col-2'>
|
|
21
|
+
<div className='col-2 mt-3'>
|
|
20
22
|
<DropdownSimpleDatePicker
|
|
21
23
|
{...args}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
setDate={setDateTo}
|
|
24
|
+
date={date}
|
|
25
|
+
setDate={setDate}
|
|
26
|
+
handleClear={clearData}
|
|
26
27
|
/>
|
|
27
28
|
</div>
|
|
28
29
|
</>
|