imbric-theme 0.3.9 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ import LoadingError from '../../molecules/LoadingError'
16
16
  // import useStateDate from '../../hook/useStateDate';
17
17
 
18
18
 
19
- export const DynamicTable = ({ getStyles, optionsData, opColumns, opAddColumns, isLayoutDate, isViewRange, isViewAddColumn, isViewDownloadDoc, handleAddColumn, handleSelectRange, handleDownloadExcel }) => {
19
+ export const DynamicTable = ({ getStyles, optionsData, opColumns, opAddColumns, isLayoutDate, isViewRange, isViewAddColumn, isViewDownloadDoc, handleAddColumn, handleSelectRange, handleDownloadExcel, labelDinamicSelect, placeholderDinamicSelect, labelSinceDateRange, labelTillDateRange }) => {
20
20
 
21
21
  const [tableData, setTableData] = useState(optionsData);
22
22
  const [columnsData, setColumnsData] = useState(opColumns);
@@ -94,6 +94,8 @@ export const DynamicTable = ({ getStyles, optionsData, opColumns, opAddColumns,
94
94
  <DatePicker
95
95
  isLayoutDate={isLayoutDate}
96
96
  onChangeRange={handleSelectRange}
97
+ sinceDateRange={labelSinceDateRange}
98
+ tillDateRange={labelTillDateRange}
97
99
  />
98
100
  </div>
99
101
  ) : null}
@@ -102,13 +104,13 @@ export const DynamicTable = ({ getStyles, optionsData, opColumns, opAddColumns,
102
104
 
103
105
  {isViewAddColumn ? (
104
106
  <div className={getStyles('opFunctionBox3')}>
105
- <Label>Mostrar u ocultar columnas</Label>
107
+ <Label>{labelDinamicSelect}</Label>
106
108
  <DynamicSelect
107
109
  isMulti
108
110
  isInline
109
111
  onChange={handleAddColumn}
110
112
  optionsSelect={addColumsData}
111
- placeholder='Seleccionar columnas'
113
+ placeholder={placeholderDinamicSelect}
112
114
  />
113
115
  </div>
114
116
  ) : null}
@@ -156,6 +158,10 @@ DynamicTable.propTypes = {
156
158
  isLayoutDate: PropTypes.string,
157
159
  handleSelectRange: PropTypes.func,
158
160
  handleDownloadExcel: PropTypes.func,
161
+ labelDinamicSelect: PropTypes.string,
162
+ placeholderDinamicSelect: PropTypes.string,
163
+ labelSinceDateRange: PropTypes.string,
164
+ labelTillDateRange: PropTypes.string,
159
165
  }
160
166
 
161
167
  DynamicTable.defaultProps = {
@@ -167,6 +173,10 @@ DynamicTable.defaultProps = {
167
173
  isLayoutDate: 'Calendar',
168
174
  handleSelectRange: () => { },
169
175
  handleDownloadExcel: () => { },
176
+ labelDinamicSelect: 'Mostrar u ocultar columnas',
177
+ placeholderDinamicSelect: 'Seleccionar columnas',
178
+ labelSinceDateRange: 'Desde',
179
+ labelTillDateRange: 'Hasta',
170
180
  }
171
181
 
172
182
  export default withStyles(styles)(DynamicTable)
@@ -27,6 +27,8 @@ export default {
27
27
  isViewRange: true,
28
28
  isViewAddColumn: true,
29
29
  isViewDownloadDoc: true,
30
+ labelDinamicSelect: 'Mostrar u ocultar columnas',
31
+ placeholderDinamicSelect: 'Seleccionar columnas',
30
32
  },
31
33
  argTypes: {
32
34
  // types: getOptionsArgTypes(options.types),
@@ -2,11 +2,32 @@ import React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './Navbar.module.css'
4
4
  import withStyles from '../../hocs/withStyles'
5
+ import { useRouter } from "next/router";
6
+ import Link from 'next/link'
7
+ import DynamicSelect from '../../molecules/DynamicSelect'
5
8
 
6
9
  import Heading from '../../atoms/Heading/Heading'
7
10
  import Tabs from '../../molecules/Tabs/Tabs'
11
+ import Icon from '../../atoms/Icon'
12
+ import { options } from './constants'
13
+
14
+ export const Navbar = ({ getStyles, viewTabsNav, viewOptionsNav, children, linkLogout, defaultValueLanguage, optionsSelectLanguage, handleChangeLanguage }) => {
15
+
16
+
17
+ const router = useRouter();
18
+
19
+ const handleClick = (e, path) => {
20
+
21
+ console.log("I clicked on the About Page" + path);
22
+
23
+ router.push({
24
+ pathname: path,
25
+ })
26
+
27
+
28
+ };
29
+
8
30
 
9
- export const Navbar = ({ getStyles, viewTabsNav, viewOptionsNav, children, linkLogout }) => {
10
31
  return (
11
32
  <>
12
33
  <header className={getStyles('navbar')}>
@@ -52,16 +73,61 @@ export const Navbar = ({ getStyles, viewTabsNav, viewOptionsNav, children, linkL
52
73
  />
53
74
 
54
75
 
55
- {/* <div className={getStyles('navbar__title', 'navbar__item')}>Taksee</div> */}
56
- {/* <div className={getStyles('navbar__item')}>Legal</div>
57
- <div className={getStyles('navbar__item')}>User Guide</div> */}
58
-
59
76
  {viewOptionsNav ? (
60
- <div onClick={linkLogout} className={getStyles('navbar__item', { 'is-playground': viewTabsNav })}>
61
- Logout
77
+ <div className={getStyles('navbar__actions')}>
78
+ {/* <div className={getStyles('navbar__item')}>Legal</div>
79
+ <div className={getStyles('navbar__item')}>User Guide</div> */}
80
+
81
+ {options.map((item, index) => (
82
+ <Icon
83
+ key={index}
84
+ size='lg'
85
+ name={item.icon}
86
+ color='highlight'
87
+ background='transparent'
88
+ onClick={(e) => handleClick(e, item.href)}
89
+ />
90
+ ))}
91
+
92
+ <DynamicSelect
93
+ isClearable={false}
94
+ // defaultValue={{
95
+ // label: 'ES',
96
+ // value: 'es'
97
+ // }}
98
+ defaultValue={defaultValueLanguage}
99
+ onChange={handleChangeLanguage}
100
+ optionsSelect={optionsSelectLanguage}
101
+ // optionsSelect={[
102
+ // {
103
+ // label: 'ES',
104
+ // value: 'es'
105
+ // },
106
+ // {
107
+ // label: 'EN',
108
+ // value: 'en'
109
+ // }
110
+ // ]}
111
+ />
112
+
113
+ <Icon
114
+ size='lg'
115
+ name='logout'
116
+ color='highlight'
117
+ background='transparent'
118
+ onClick={linkLogout}
119
+ />
120
+
62
121
  </div>
122
+
63
123
  ) : null}
64
124
 
125
+ {/* {viewOptionsNav ? (
126
+ <div onClick={linkLogout} className={getStyles('navbar__item')}>
127
+ Logout
128
+ </div>
129
+ ) : null} */}
130
+
65
131
 
66
132
  </header>
67
133
 
@@ -76,6 +142,7 @@ Navbar.propTypes = {
76
142
  viewTabsNav: PropTypes.bool,
77
143
  viewOptionsNav: PropTypes.bool,
78
144
  linkLogout: PropTypes.func,
145
+ handleChange: PropTypes.func,
79
146
  }
80
147
 
81
148
  Navbar.defaultProps = {
@@ -27,4 +27,9 @@
27
27
  padding: 0.67em 1.5em;
28
28
  cursor: pointer;
29
29
  vertical-align: middle;
30
+ }
31
+
32
+ .navbar__actions {
33
+ display: flex;
34
+ align-items: center;
30
35
  }
@@ -0,0 +1,35 @@
1
+ export const options = [
2
+ {
3
+ active: false,
4
+ href: '#',
5
+ icon: 'legal',
6
+ text: 'Legal',
7
+ view: true,
8
+ viewSubMenu: true,
9
+ },
10
+ {
11
+ active: false,
12
+ href: '/home',
13
+ icon: 'info',
14
+ text: 'User Guide',
15
+ view: true,
16
+ viewSubMenu: false,
17
+ },
18
+ {
19
+ active: false,
20
+ href: '/home',
21
+ icon: 'profile',
22
+ text: 'My profile',
23
+ view: true,
24
+ viewSubMenu: false,
25
+ },
26
+ // {
27
+ // active: false,
28
+ // href: '/home',
29
+ // icon: 'logout',
30
+ // text: 'Salir',
31
+ // view: true,
32
+ // viewSubMenu: false,
33
+ // },
34
+
35
+ ]
@@ -33,7 +33,7 @@ import {
33
33
 
34
34
 
35
35
 
36
- export const DatePicker = ({ getStyles, isLayoutDate, onChangeRange }) => {
36
+ export const DatePicker = ({ getStyles, isLayoutDate, onChangeRange, sinceDateRange, tillDateRange }) => {
37
37
 
38
38
  const [isShowCalendar, setShowCalendar] = useState(false);
39
39
 
@@ -96,7 +96,7 @@ export const DatePicker = ({ getStyles, isLayoutDate, onChangeRange }) => {
96
96
  !isShowCalendar ?
97
97
  <div className={getStyles('date-picker-input')}>
98
98
  <div>
99
- <Label>Desde</Label>
99
+ <Label>{sinceDateRange}</Label>
100
100
  <Input
101
101
  isInline
102
102
  id="startDate"
@@ -108,7 +108,7 @@ export const DatePicker = ({ getStyles, isLayoutDate, onChangeRange }) => {
108
108
  </div>
109
109
 
110
110
  <div>
111
- <Label>Hasta</Label>
111
+ <Label>{tillDateRange}</Label>
112
112
  <Input
113
113
  isInline
114
114
  id="endDate"
@@ -224,13 +224,17 @@ export const DatePicker = ({ getStyles, isLayoutDate, onChangeRange }) => {
224
224
  DatePicker.propTypes = {
225
225
  getStyles: PropTypes.func.isRequired,
226
226
  isLayoutDate: PropTypes.oneOf(options.typeLayoutDate),
227
- onChangeRange: PropTypes.func
227
+ onChangeRange: PropTypes.func,
228
+ sinceDateRange: PropTypes.string,
229
+ tillDateRange: PropTypes.string,
228
230
  }
229
231
 
230
232
  DatePicker.defaultProps = {
231
233
  getStyles: () => { },
232
234
  isLayoutDate: 'Calendar',
233
235
  onChangeRange: () => { },
236
+ sinceDateRange: 'Desde',
237
+ tillDateRange: 'Hasta',
234
238
  }
235
239
 
236
240
  export default withStyles(styles)(DatePicker)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imbric-theme",
3
- "version": "0.3.9",
3
+ "version": "0.4.0",
4
4
  "description": "Components library IMBRIC",
5
5
  "private": false,
6
6
  "main": "index.js",