imbric-theme 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. package/.dockerignore +14 -0
  2. package/.eslintignore +1 -0
  3. package/.prettierignore +1 -0
  4. package/.storybook/main.js +6 -2
  5. package/.storybook/preview.js +21 -0
  6. package/.vscode/settings.json +3 -0
  7. package/Dockerfile +17 -0
  8. package/atoms/AlertModal/AlertModal.js +69 -0
  9. package/atoms/AlertModal/AlertModal.module.css +3 -0
  10. package/atoms/AlertModal/AlertModal.stories.js +30 -0
  11. package/atoms/AlertModal/constants.js +4 -0
  12. package/atoms/AlertModal/index.js +3 -0
  13. package/atoms/Button/Button.js +17 -2
  14. package/atoms/Button/Button.module.css +25 -3
  15. package/atoms/Button/Button.stories.js +1 -1
  16. package/atoms/Button/__snapshots__/Button.stories.js.snap +8 -8
  17. package/atoms/Check/Check.js +6 -4
  18. package/atoms/Checkbox/Checkbox.js +77 -0
  19. package/atoms/Checkbox/Checkbox.module.css +60 -0
  20. package/atoms/Checkbox/Checkbox.stories.js +30 -0
  21. package/atoms/Checkbox/constants.js +1 -0
  22. package/atoms/Checkbox/index.js +3 -0
  23. package/atoms/Divider/Divider.js +5 -2
  24. package/atoms/Divider/Divider.module.css +20 -0
  25. package/atoms/Divider/Divider.stories.js +13 -2
  26. package/atoms/Divider/constants.js +3 -0
  27. package/atoms/Divider/index.js +1 -0
  28. package/atoms/Heading/Heading.js +1 -1
  29. package/atoms/Heading/Heading.module.css +4 -0
  30. package/atoms/Heading/Heading.stories.js +2 -2
  31. package/atoms/Heading/__snapshots__/Heading.stories.js.snap +16 -16
  32. package/atoms/Heading/constants.js +1 -1
  33. package/atoms/Icon/Icon.js +1 -1
  34. package/atoms/Icon/Icon.module.css +30 -0
  35. package/atoms/Icon/constants.js +750 -145
  36. package/atoms/Input/Input.js +195 -15
  37. package/atoms/Input/Input.module.css +62 -6
  38. package/atoms/Input/Input.stories.js +8 -2
  39. package/atoms/Input/__snapshots__/Input.stories.js.snap +5 -5
  40. package/atoms/Input/constants.js +1 -1
  41. package/atoms/Label/Label.js +31 -0
  42. package/atoms/Label/Label.module.css +42 -0
  43. package/atoms/Label/Label.stories.js +26 -0
  44. package/atoms/Label/constants.js +1 -0
  45. package/atoms/Label/index.js +3 -0
  46. package/atoms/LinkItem/LinkItem.js +38 -0
  47. package/atoms/{Link/Link.module.css → LinkItem/LinkItem.module.css} +6 -1
  48. package/atoms/{Link/Link.stories.js → LinkItem/LinkItem.stories.js} +5 -5
  49. package/atoms/LinkItem/index.js +3 -0
  50. package/atoms/Modal/Modal.js +27 -4
  51. package/atoms/Modal/Modal.module.css +63 -6
  52. package/atoms/Paragraph/Paragraph.module.css +4 -0
  53. package/atoms/Paragraph/Paragraph.stories.js +2 -2
  54. package/atoms/Paragraph/__snapshots__/Paragraph.stories.js.snap +16 -16
  55. package/atoms/Picture/Picture.js +9 -2
  56. package/atoms/Tab/Tab.js +41 -0
  57. package/atoms/Tab/Tab.module.css +17 -0
  58. package/atoms/Tab/Tab.stories.js +27 -0
  59. package/atoms/Tab/constants.js +1 -0
  60. package/atoms/Tab/index.js +3 -0
  61. package/atoms/Textarea/Textarea.js +106 -15
  62. package/atoms/Textarea/Textarea.module.css +31 -2
  63. package/atoms/Toggle/Toggle.js +56 -0
  64. package/atoms/Toggle/Toggle.module.css +41 -0
  65. package/atoms/Toggle/Toggle.stories.js +21 -0
  66. package/atoms/Toggle/constants.js +1 -0
  67. package/atoms/Toggle/index.js +3 -0
  68. package/helpers/storybook.js +2 -2
  69. package/hook/useAddColumn.js +40 -0
  70. package/hook/useStateDate.js +25 -0
  71. package/hook/useTable.js +54 -0
  72. package/index.js +41 -1
  73. package/jest.config.js +1 -1
  74. package/layout/DynamicTable/DynamicTable.js +372 -0
  75. package/layout/DynamicTable/DynamicTable.module.css +62 -0
  76. package/layout/DynamicTable/DynamicTable.stories.js +79 -0
  77. package/layout/DynamicTable/constants.js +323 -0
  78. package/layout/DynamicTable/index.js +3 -0
  79. package/layout/FlexColumnContent/FlexColumnContent.js +26 -0
  80. package/layout/FlexColumnContent/FlexColumnContent.module.css +5 -0
  81. package/layout/FlexColumnContent/FlexColumnContent.stories.js +28 -0
  82. package/layout/FlexColumnContent/constants.js +1 -0
  83. package/layout/FlexColumnContent/index.js +3 -0
  84. package/layout/Navbar/Navbar.js +247 -0
  85. package/layout/Navbar/Navbar.module.css +35 -0
  86. package/layout/Navbar/Navbar.stories.js +20 -0
  87. package/layout/Navbar/constants.js +35 -0
  88. package/layout/Navbar/index.js +2 -0
  89. package/layout/Sidebar/Sidebar.js +115 -0
  90. package/layout/Sidebar/Sidebar.module.css +387 -0
  91. package/layout/Sidebar/Sidebar.stories.js +28 -0
  92. package/layout/Sidebar/constants.js +228 -0
  93. package/layout/Sidebar/index.js +3 -0
  94. package/molecules/Accordion/Accordion.js +11 -11
  95. package/molecules/CardDefault/CardDefault.js +65 -0
  96. package/molecules/CardDefault/CardDefault.module.css +19 -0
  97. package/molecules/CardDefault/CardDefault.stories.js +23 -0
  98. package/molecules/CardDefault/constants.js +1 -0
  99. package/molecules/CardDefault/index.js +3 -0
  100. package/molecules/CardProductTypesBooking/CardProductTypesBooking.js +89 -0
  101. package/molecules/CardProductTypesBooking/CardProductTypesBooking.module.css +118 -0
  102. package/molecules/CardProductTypesBooking/CardProductTypesBooking.stories.js +25 -0
  103. package/molecules/CardProductTypesBooking/constants.js +1 -0
  104. package/molecules/CardProductTypesBooking/index.js +3 -0
  105. package/molecules/CardServiceDetail/CardServiceDetail.js +400 -0
  106. package/molecules/CardServiceDetail/CardServiceDetail.module.css +222 -0
  107. package/molecules/CardServiceDetail/CardServiceDetail.stories.js +23 -0
  108. package/molecules/CardServiceDetail/constants.js +1 -0
  109. package/molecules/CardServiceDetail/index.js +3 -0
  110. package/molecules/CardServices/CardServices.js +461 -0
  111. package/molecules/CardServices/CardServices.module.css +213 -0
  112. package/molecules/CardServices/CardServices.stories.js +41 -0
  113. package/molecules/CardServices/constants.js +5 -0
  114. package/molecules/CardServices/index.js +3 -0
  115. package/molecules/CardServicesFinalized/CardServicesFinalized.js +381 -0
  116. package/molecules/CardServicesFinalized/CardServicesFinalized.module.css +213 -0
  117. package/molecules/CardServicesFinalized/CardServicesFinalized.stories.js +23 -0
  118. package/molecules/CardServicesFinalized/constants.js +1 -0
  119. package/molecules/CardServicesFinalized/index.js +3 -0
  120. package/molecules/CheckList/CheckList.js +135 -0
  121. package/molecules/CheckList/CheckList.module.css +94 -0
  122. package/molecules/CheckList/CheckList.stories.js +25 -0
  123. package/molecules/CheckList/constants.js +23 -0
  124. package/molecules/CheckList/index.js +3 -0
  125. package/molecules/ColumnTable/ColumnTable.js +155 -0
  126. package/molecules/ColumnTable/ColumnTable.module.css +51 -0
  127. package/molecules/ColumnTable/ColumnTable.stories.js +26 -0
  128. package/molecules/ColumnTable/constants.js +117 -0
  129. package/molecules/ColumnTable/index.js +3 -0
  130. package/molecules/DatePicker/DatePicker.js +242 -0
  131. package/molecules/DatePicker/DatePicker.module.css +38 -0
  132. package/molecules/DatePicker/DatePicker.stories.js +23 -0
  133. package/molecules/DatePicker/constants.js +3 -0
  134. package/molecules/DatePicker/index.js +3 -0
  135. package/molecules/DatePickerTime/DatePickerTime.js +133 -0
  136. package/molecules/DatePickerTime/DatePickerTime.module.css +3 -0
  137. package/molecules/DatePickerTime/DatePickerTime.stories.js +18 -0
  138. package/molecules/DatePickerTime/constants.js +1 -0
  139. package/molecules/DatePickerTime/index.js +3 -0
  140. package/molecules/Dropdown/Dropdown.js +26 -23
  141. package/molecules/Dropdown/Dropdown.module.css +21 -3
  142. package/molecules/DynamicSelect/DynamicSelect.js +186 -0
  143. package/molecules/DynamicSelect/DynamicSelect.module.css +10 -0
  144. package/molecules/DynamicSelect/DynamicSelect.stories.js +32 -0
  145. package/molecules/DynamicSelect/constants.js +7 -0
  146. package/molecules/DynamicSelect/index.js +3 -0
  147. package/molecules/Error/Error.js +2 -2
  148. package/molecules/Error/Error.module.css +3 -2
  149. package/molecules/FooterTable/FooterTable.js +166 -0
  150. package/molecules/FooterTable/FooterTable.module.css +63 -0
  151. package/molecules/FooterTable/FooterTable.stories.js +23 -0
  152. package/molecules/FooterTable/constants.js +9 -0
  153. package/molecules/FooterTable/index.js +3 -0
  154. package/molecules/InputAutocomplete/InputAutocomplete.js +221 -0
  155. package/molecules/InputAutocomplete/InputAutocomplete.module.css +55 -0
  156. package/molecules/InputAutocomplete/InputAutocomplete.stories.js +23 -0
  157. package/molecules/InputAutocomplete/constants.js +1 -0
  158. package/molecules/InputAutocomplete/index.js +3 -0
  159. package/molecules/ItemMenu/ItemMenu.js +134 -0
  160. package/molecules/ItemMenu/ItemMenu.module.css +363 -0
  161. package/molecules/ItemMenu/ItemMenu.stories.js +42 -0
  162. package/molecules/ItemMenu/constants.js +36 -0
  163. package/molecules/ItemMenu/index.js +3 -0
  164. package/molecules/RowTable/RowTable.js +928 -0
  165. package/molecules/RowTable/RowTable.module.css +63 -0
  166. package/molecules/RowTable/RowTable.stories.js +26 -0
  167. package/molecules/RowTable/constants.js +798 -0
  168. package/molecules/RowTable/index.js +3 -0
  169. package/molecules/Tabs/Tabs.js +59 -0
  170. package/molecules/Tabs/Tabs.module.css +13 -0
  171. package/molecules/Tabs/Tabs.stories.js +34 -0
  172. package/molecules/Tabs/constants.js +34 -0
  173. package/molecules/Tabs/index.js +3 -0
  174. package/package.json +33 -16
  175. package/pages/Login/Login.js +102 -0
  176. package/pages/Login/Login.module.css +5 -0
  177. package/pages/Login/Login.stories.js +23 -0
  178. package/pages/Login/constants.js +1 -0
  179. package/pages/Login/index.js +3 -0
  180. package/pages/Login/validation/loginSchema.js +5 -0
  181. package/public/favicon.ico +0 -0
  182. package/public/static/google-maps.png +0 -0
  183. package/public/static/images/folders-folder.svg +26 -0
  184. package/public/static/images/permissions.svg +14 -0
  185. package/public/static/images/reports-results.svg +18 -0
  186. package/public/static/logo.svg +19 -0
  187. package/public/static/logologin.png +0 -0
  188. package/public/static/logologin.svg +16 -0
  189. package/public/static/logologintagos.svg +19 -0
  190. package/public/static/logotipo.svg +50 -0
  191. package/public/static/logotipoS.svg +26 -0
  192. package/public/static/taxisvalencia_logod.png +0 -0
  193. package/scripts/create-component.js +2 -1
  194. package/styles/GrupoMutua.css +391 -0
  195. package/styles/default.css +391 -0
  196. package/styles/globals.css +1514 -0
  197. package/styles/radiotaxiaragon.css +391 -0
  198. package/styles/spartan.css +391 -0
  199. package/styles/tagos.css +391 -0
  200. package/styles/taxisvalencia.css +391 -0
  201. package/styles/tokens.css +2 -1
  202. package/tokens/index.js +2 -1
  203. package/.eslintcache +0 -1
  204. package/atoms/Link/Link.js +0 -33
  205. package/atoms/Link/index.js +0 -3
  206. /package/atoms/{Link → LinkItem}/__snapshots__/Link.stories.js.snap +0 -0
  207. /package/atoms/{Link → LinkItem}/constants.js +0 -0
@@ -0,0 +1,186 @@
1
+ import React from 'react'
2
+ import Select from 'react-select'
3
+ import PropTypes from 'prop-types'
4
+ import styles from './DynamicSelect.module.css'
5
+ import withStyles from '../../hocs/withStyles'
6
+
7
+
8
+ export const DynamicSelect = ({
9
+ getStyles,
10
+ optionsSelect,
11
+ value,
12
+ defaultValue,
13
+ placeholder,
14
+ isMulti,
15
+ isClearable,
16
+ isDisabled,
17
+ isLoading,
18
+ isRtl,
19
+ isSearchable,
20
+ isInline,
21
+ onChange,
22
+ onFocus,
23
+ onBlur,
24
+ closeMenuOnSelect,
25
+ maxMenuHeight,
26
+ instanceId,
27
+ }) => {
28
+
29
+
30
+ const customStyles = {
31
+
32
+ option: (base, state) => ({
33
+ ...base,
34
+ cursor: 'pointer',
35
+ width: "max-content",
36
+ minWidth: "100%",
37
+ position: 'relative',
38
+ backgroundColor: state.isSelected ? 'var(--color-primary)' : 'transparent',
39
+ "&:hover": {
40
+ backgroundColor: "var(--color-primary-highlight)",
41
+ color: 'var(--color-primary)',
42
+ },
43
+ // "&:active": {
44
+ // backgroundColor: "var(--color-primary)"
45
+ // }
46
+ }),
47
+ control: (base, state) => ({
48
+ ...base,
49
+ cursor: 'pointer',
50
+ width: '100%',
51
+ borderRadius: 0,
52
+ border: 'var(--border-width-thin) solid var(--color-brand-white-lilac)',
53
+ // border: state.isFocused ? "var(--border-width-thin) solid var(--color-brand-white-lilac)" : "var(--border-width-thin) solid var(--color-brand-white-lilac)",
54
+ boxShadow: state.isFocused ? "0 0 0 1px var(--color-primary), 0 0 10px 0 var(--color-primary)" : "none",
55
+ "&:hover": {
56
+ borderColor: "var(--color-primary)"
57
+ },
58
+ }),
59
+ input: (base) => ({
60
+ ...base,
61
+ cursor: 'pointer',
62
+ margin: '2px',
63
+ paddingBottom: '2px',
64
+ paddingTop: '2px',
65
+ }),
66
+
67
+ placeholder: (base) => ({
68
+ ...base,
69
+ color: 'var(--color-brand-white-lilac)',
70
+ fontWeight: 'var(--font-weight-light)',
71
+ whiteSpace: 'nowrap',
72
+ overflow: 'hidden',
73
+ textOverflow: 'ellipsis',
74
+ }),
75
+
76
+ valueContainer: (base, state) => ({
77
+ ...base,
78
+ textOverflow: "ellipsis",
79
+ whiteSpace: "nowrap",
80
+ overflow: "hidden",
81
+ // display: "inline-grid"
82
+ // maxHeight: "38px",
83
+ }),
84
+
85
+ container: (base) => ({
86
+ ...base,
87
+ // width: "max-content",
88
+ minWidth: "100%",
89
+ }),
90
+
91
+ menu: (base) => ({
92
+ ...base,
93
+ width: "max-content",
94
+ minWidth: "100%",
95
+ }),
96
+
97
+ // menu: styles => ({ ...styles,
98
+ // width: '500px'
99
+ // })
100
+
101
+ // indicatorsContainer: (provided, state) => ({
102
+ // ...provided,
103
+ // height: '50px',
104
+ // }),
105
+
106
+ }
107
+
108
+ // const handleChange = (value) => {
109
+ // console.group('Value Changed');
110
+ // console.log(value);
111
+ // // console.log(`action: ${actionMeta.action}`);
112
+ // console.groupEnd();
113
+ // };
114
+
115
+ return (
116
+
117
+ <div className={getStyles('dynamic-select', {
118
+ 'is-inline': isInline,
119
+ })}>
120
+ <Select
121
+ name="basic"
122
+ // className="basic-single"
123
+ // classNamePrefix="select"
124
+ placeholder={placeholder}
125
+ styles={customStyles}
126
+ options={optionsSelect}
127
+ defaultValue={defaultValue}
128
+ value={value}
129
+ isMulti={isMulti}
130
+ isClearable={isClearable}
131
+ isDisabled={isDisabled}
132
+ isLoading={isLoading}
133
+ isRtl={isRtl}
134
+ isSearchable={isSearchable}
135
+ onChange={onChange}
136
+ onFocus={onFocus}
137
+ onBlur={onBlur}
138
+ closeMenuOnSelect={closeMenuOnSelect}
139
+ maxMenuHeight={maxMenuHeight}
140
+ autosize={true}
141
+ instanceId={instanceId}
142
+ />
143
+ </div>
144
+
145
+ )
146
+ }
147
+
148
+ DynamicSelect.propTypes = {
149
+ getStyles: PropTypes.func.isRequired,
150
+ defaultValue: PropTypes.any,
151
+ value: PropTypes.any,
152
+ placeholder: PropTypes.string,
153
+ isMulti: PropTypes.bool,
154
+ isClearable: PropTypes.bool,
155
+ isDisabled: PropTypes.bool,
156
+ isLoading: PropTypes.bool,
157
+ isRtl: PropTypes.bool,
158
+ isSearchable: PropTypes.bool,
159
+ isInline: PropTypes.bool,
160
+ onChange: PropTypes.func,
161
+ onFocus: PropTypes.func,
162
+ onBlur: PropTypes.func,
163
+ closeMenuOnSelect: PropTypes.bool,
164
+ maxMenuHeight: PropTypes.number,
165
+ instanceId: PropTypes.string,
166
+ }
167
+
168
+ DynamicSelect.defaultProps = {
169
+ getStyles: () => { },
170
+ placeholder: 'seleccionar',
171
+ isMulti: false,
172
+ isClearable: true,
173
+ isDisabled: false,
174
+ isLoading: false,
175
+ isRtl: false,
176
+ isSearchable: false,
177
+ isInline: false,
178
+ onChange: () => { },
179
+ onFocus: () => { },
180
+ onBlur: () => { },
181
+ closeMenuOnSelect: true,
182
+ maxMenuHeight: 300,
183
+ instanceId: ''
184
+ }
185
+
186
+ export default withStyles(styles)(DynamicSelect)
@@ -0,0 +1,10 @@
1
+ .dynamic-select {
2
+ position: relative;
3
+ display: inline-block;
4
+ width: 100%;
5
+ cursor: pointer;
6
+ }
7
+
8
+ .is-inline {
9
+ max-width: max-content;
10
+ }
@@ -0,0 +1,32 @@
1
+ import { DynamicSelect, styles, options } from '.'
2
+
3
+ import {
4
+ getTemplate,
5
+ getListTemplate,
6
+ getOptionsArgTypes,
7
+ } from '../../helpers/storybook'
8
+
9
+ const Template = getTemplate(DynamicSelect, styles)
10
+ const ListTemplate = getListTemplate(DynamicSelect, styles)
11
+
12
+ export default {
13
+ title: 'Molecules/DynamicSelect',
14
+ component: DynamicSelect,
15
+ args: {
16
+ optionsSelect: options.optionsSelect,
17
+ defaultValue: options.optionsSelect[0],
18
+ placeholder: 'seleccionar',
19
+ isMulti: false,
20
+ isClearable: true,
21
+ isDisabled: false,
22
+ isLoading: false,
23
+ isRtl: false,
24
+ isSearchable: false,
25
+ isInline: false,
26
+ },
27
+ argTypes: {
28
+ // types: getOptionsArgTypes(options.types),
29
+ },
30
+ }
31
+
32
+ export const Default = Template.bind({})
@@ -0,0 +1,7 @@
1
+ export const options = {
2
+ optionsSelect: [
3
+ { value: 'chocolate', label: 'Chocolate' },
4
+ { value: 'strawberry', label: 'Strawberry' },
5
+ { value: 'vanilla', label: 'Vanilla' }
6
+ ]
7
+ }
@@ -0,0 +1,3 @@
1
+ export { default, DynamicSelect } from './DynamicSelect'
2
+ export { options } from './constants'
3
+ export { default as styles } from './DynamicSelect.module.css'
@@ -12,11 +12,11 @@ import Icon from '../../atoms/Icon'
12
12
  export const Error = ({ title, children, getStyles }) => {
13
13
  return (
14
14
  <div className={getStyles('error')}>
15
- <Icon className="icon-warning" name="warning" size="md" />
15
+ <Icon className="icon-warning" name="warning" size="lg" />
16
16
  <Spacer.Horizontal size="sm" />
17
17
  <div>
18
18
  {title && <Heading>{title}</Heading>}
19
- <Paragraph>{children}</Paragraph>
19
+ <Paragraph size="sm">{children}</Paragraph>
20
20
  </div>
21
21
  </div>
22
22
  )
@@ -1,9 +1,10 @@
1
1
  .error {
2
2
  display: flex;
3
3
  padding: 10px 20px;
4
- border-top: 4px solid var(--color-red-500);
5
- background: var(--color-red-200);
4
+ border-top: 2px solid var(--color-red-500);
5
+ background: var(--color-red-100);
6
6
  color: var(--color-red-800);
7
+ border-radius: var(--border-radius-sm);
7
8
  }
8
9
 
9
10
  .error :global(.icon-warning) {
@@ -0,0 +1,166 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import PropTypes from 'prop-types'
3
+
4
+ import styles from './FooterTable.module.css'
5
+ import { options } from './constants'
6
+ import withStyles from '../../hocs/withStyles'
7
+ import DynamicSelect from '../../molecules/DynamicSelect'
8
+ import Icon from "../../atoms/Icon/Icon";
9
+
10
+
11
+ export const FooterTable = ({ getStyles, range, setPage, setDataPage, setScrollPage, page, slice, placeholderDinamicSelect, handleResultsForPage, defaultValueSelect, positionPag, useAvancesCeil, setPositionPag }) => {
12
+
13
+
14
+ // const [positionPag, setPositionPag] = useState(0)
15
+
16
+ useEffect(() => {
17
+ if (slice.length < 1 && page !== 1) {
18
+ setPage(page - 1);
19
+ }
20
+
21
+ console.log(page)
22
+
23
+ }, [slice, page, setPage, positionPag, useAvancesCeil]);
24
+
25
+ // const nextPagScroll = (page) => {
26
+
27
+ // console.log(page)
28
+ // if (page >= 4) {
29
+ // setPositionPag('-40')
30
+ // console.log(positionPag)
31
+ // const elem = document.getElementById('table-pag-scroll');
32
+ // elem.style.marginLeft = '-40px';
33
+ // console.log(elem)
34
+ // }
35
+ // }
36
+
37
+
38
+ return (
39
+ <div className={getStyles('footer-table')}>
40
+
41
+ <div className={styles.tableFooter}>
42
+
43
+ {page >= 2 ?
44
+ <Icon
45
+ name="angleLeft"
46
+ onClick={() => { setPage(page - 1); setDataPage(page - 1); setScrollPage('angleLeft') }}
47
+ />
48
+ : null}
49
+
50
+
51
+ {page >= 4 ?
52
+
53
+ <button
54
+ className={`${styles.button} ${styles.inactiveButton}`}
55
+ onClick={() => { setPage(1); setDataPage(1); setPositionPag(0); }}
56
+ >
57
+ 1
58
+ </button>
59
+
60
+ : null}
61
+
62
+
63
+ {page >= 5 ?
64
+
65
+ <button
66
+ disabled
67
+ className={`${styles.button} ${styles.disabled}`}
68
+ >
69
+ ...
70
+ </button>
71
+ : null}
72
+
73
+ <div className={getStyles('footer-table-pag-box')}>
74
+
75
+ <div id="table-pag-scroll" className={getStyles('footer-table-pag')} style={{ marginLeft: positionPag + 'px' }}>
76
+
77
+ {range.map((el, index) => (
78
+
79
+ <button
80
+ key={'footer' + index}
81
+ className={`${styles.button} ${page === el ? styles.activeButton : styles.inactiveButton
82
+ }`}
83
+ onClick={() => { setPage(el); setDataPage(el) }}
84
+ onChange={item => { handleSelectRange(item); onChangeRange(item); }}
85
+ >
86
+ {el}
87
+ </button>
88
+
89
+ ))}
90
+
91
+ </div>
92
+ </div>
93
+
94
+
95
+ {page <= (range.length - 4) && range.length > 5 ?
96
+
97
+ <button
98
+ disabled
99
+ className={`${styles.button} ${styles.disabled}`}
100
+ >
101
+ ...
102
+ </button>
103
+
104
+ : null}
105
+
106
+
107
+ {page <= (range.length - 3) && range.length > 5 ?
108
+
109
+ <button
110
+ onClick={() => { setPage(range.length); setDataPage(range.length); setPositionPag('-' + (38 * (useAvancesCeil - 1))) }}
111
+ className={`${styles.button} ${styles.inactiveButton}`}
112
+ >
113
+ {range.length}
114
+ </button>
115
+
116
+ : null}
117
+
118
+ {page <= (range.length - 1) ?
119
+ < Icon
120
+ name="angleRight"
121
+ onClick={() => { setPage(page + 1); setDataPage(page + 1); setScrollPage('angleRight') }}
122
+ // onChange={item => { handleSelectRange(item); onChangeRange(item); }}
123
+ />
124
+ : null}
125
+
126
+
127
+ </div>
128
+
129
+ <DynamicSelect
130
+ isInline
131
+ onChange={handleResultsForPage}
132
+ optionsSelect={options.opResultsForPage}
133
+ placeholder={placeholderDinamicSelect}
134
+ isClearable={false}
135
+ defaultValue={defaultValueSelect}
136
+ closeMenuOnSelect={false}
137
+ instanceId={'idResultsForPage'}
138
+ />
139
+
140
+ </div>
141
+
142
+
143
+ )
144
+ }
145
+
146
+ FooterTable.propTypes = {
147
+ // children: PropTypes.node.isRequired,
148
+ getStyles: PropTypes.func.isRequired,
149
+ setDataPage: PropTypes.func,
150
+ setScrollPage: PropTypes.func,
151
+ placeholderDinamicSelect: PropTypes.string,
152
+ handleResultsForPage: PropTypes.func,
153
+ defaultValueSelect: PropTypes.any,
154
+ // type: PropTypes.oneOf(options.types),
155
+ }
156
+
157
+ FooterTable.defaultProps = {
158
+ getStyles: () => { },
159
+ setDataPage: () => { },
160
+ setScrollPage: () => { },
161
+ handleResultsForPage: () => { },
162
+ placeholderDinamicSelect: 'resultados por pagina',
163
+ defaultValueSelect: { value: 10, label: '10' },
164
+ }
165
+
166
+ export default withStyles(styles)(FooterTable)
@@ -0,0 +1,63 @@
1
+ .footer-table {
2
+ display: flex;
3
+ width: 100%;
4
+ justify-content: space-between;
5
+ }
6
+
7
+ .tableFooter {
8
+ /* background-color: #f1f1f1; */
9
+ padding: 4px 0px;
10
+ font-weight: 500;
11
+ text-align: left;
12
+ font-size: 16px;
13
+ color: #2c3e50;
14
+ border-bottom-left-radius: 5px;
15
+ border-bottom-right-radius: 0px;
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: flex-start;
19
+ }
20
+
21
+ .button {
22
+ border: none;
23
+ padding: 6px 0px;
24
+ border-radius: 10px;
25
+ cursor: pointer;
26
+ margin-right: 4px;
27
+ margin-left: 4px;
28
+ min-width: 30px;
29
+ max-width: 30px;
30
+ }
31
+
32
+ .activeButton {
33
+ color: white;
34
+ background: rgb(73, 125, 189, .4);
35
+ }
36
+
37
+ .inactiveButton {
38
+ color: #2c3e50;
39
+ background: #f9f9f9;
40
+ }
41
+
42
+ .inactiveButton:hover {
43
+ color: white;
44
+ background: rgb(73, 125, 189, .4);
45
+ }
46
+
47
+ .disabled {
48
+ color: #2c3e50;
49
+ background: #f9f9f9;
50
+ cursor: no-drop;
51
+ }
52
+
53
+ .footer-table-pag-box {
54
+ display: flex;
55
+ overflow-x: clip;
56
+ width: 100%;
57
+ max-width: 190px;
58
+ }
59
+
60
+ .footer-table-pag {
61
+ display: flex;
62
+ width: 100%;
63
+ }
@@ -0,0 +1,23 @@
1
+ import { FooterTable, styles, options } from '.'
2
+
3
+ import {
4
+ getTemplate,
5
+ getListTemplate,
6
+ getOptionsArgTypes,
7
+ } from '../../helpers/storybook'
8
+
9
+ const Template = getTemplate(FooterTable, styles)
10
+ const ListTemplate = getListTemplate(FooterTable, styles)
11
+
12
+ export default {
13
+ title: 'Molecules/FooterTable',
14
+ component: FooterTable,
15
+ args: {},
16
+ argTypes: {
17
+ // types: getOptionsArgTypes(options.types),
18
+ },
19
+ }
20
+
21
+ export const Default = Template.bind({})
22
+ // export const List = ListTemplate.bind({})
23
+ // List.args = { items: options.types.map((type) => ({ type })) }
@@ -0,0 +1,9 @@
1
+ export const options =
2
+ {
3
+ opResultsForPage: [
4
+ { id: 'pagOps1', value: 5, label: '5' },
5
+ { id: 'pagOps2', value: 10, label: '10' },
6
+ { id: 'pagOps3', value: 20, label: '20' },
7
+ { id: 'pagOps4', value: 50, label: '50' },
8
+ ]
9
+ }
@@ -0,0 +1,3 @@
1
+ export { default, FooterTable } from './FooterTable'
2
+ export { options } from './constants'
3
+ export { default as styles } from './FooterTable.module.css'