componenteshospitais 4.5.5 → 4.5.7
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/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/types/components/Carregando.d.ts +6 -0
- package/dist/types/stories/Carregando.stories.d.ts +5 -0
- package/package.json +1 -1
- package/src/components/Carregando.tsx +28 -0
- package/src/components/TableStandardButtons.tsx +1 -1
- package/src/stories/Carregando.stories.tsx +31 -0
- package/src/stories/TableStandardButtons.stories.tsx +3 -2
- package/src/styles/carregando.module.css +59 -0
package/dist/cjs/index.js
CHANGED
|
@@ -17006,7 +17006,7 @@ var TableStandardButtons = function (_a) {
|
|
|
17006
17006
|
React.createElement("thead", null,
|
|
17007
17007
|
React.createElement("tr", { className: "".concat(styles$2.row, " ").concat(borderColor ? styles$2.cellBorder : '') }, Object.keys(dados[0] || {})
|
|
17008
17008
|
.filter(function (key) { var _a; return ((_a = dados[0][key]) === null || _a === void 0 ? void 0 : _a.typeColumn) !== 'hidden'; }) // Filtra as colunas com 'hidden'
|
|
17009
|
-
.map(function (key) { return (React.createElement("th", { key: key, className: styles$2.header, style: { padding: cellsPadding ? "".concat(cellsPadding, "px") : '', borderColor: borderColor ? borderColor : '' } }, key !== 'menu' && key !== '' && key.charAt(0).toUpperCase() + key.slice(1))); }))),
|
|
17009
|
+
.map(function (key) { return (React.createElement("th", { key: key, className: styles$2.header, style: { padding: cellsPadding ? "".concat(cellsPadding, "px") : '', borderColor: borderColor ? borderColor : '', borderRadius: borderRadius ? "".concat(borderRadius, "px") : '' } }, key !== 'menu' && key !== '' && key.charAt(0).toUpperCase() + key.slice(1))); }))),
|
|
17010
17010
|
React.createElement("tbody", { className: "".concat(linhasZebradas || empresa === '6' ? styles$2.linhasZebradas : '') }, currentItems.map(function (row, index) { return (React.createElement("tr", { key: index, id: "id_".concat(index), className: "".concat(styles$2.row, " ").concat(selectedRow === row[idColumn] ? styles$2.activeRow : '', " ").concat(borderColor ? styles$2.cellBorder : ''), onClick: function () { return handleRowClick(row); }, style: { background: cor ? 'white' : '', cursor: onRowClick ? 'pointer' : '' } }, Object.keys(row).filter(function (key) { var _a; return ((_a = row[key]) === null || _a === void 0 ? void 0 : _a.typeColumn) !== 'hidden'; }).map(function (key, i) {
|
|
17011
17011
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
17012
17012
|
return (React.createElement("td", { key: i, className: "".concat(styles$2.cell, " ").concat(row[key].typeColumn && row[key].typeColumn === 'img' ? styles$2.center : ''), style: { padding: cellsPadding ? "".concat(cellsPadding, "px") : '', borderRadius: borderRadius ? "".concat(borderRadius, "px") : '', borderColor: borderColor ? borderColor : '', backgroundColor: row[key].backgroundCell ? row[key].backgroundCell : '' } },
|
package/dist/esm/index.js
CHANGED
|
@@ -17004,7 +17004,7 @@ var TableStandardButtons = function (_a) {
|
|
|
17004
17004
|
React.createElement("thead", null,
|
|
17005
17005
|
React.createElement("tr", { className: "".concat(styles$2.row, " ").concat(borderColor ? styles$2.cellBorder : '') }, Object.keys(dados[0] || {})
|
|
17006
17006
|
.filter(function (key) { var _a; return ((_a = dados[0][key]) === null || _a === void 0 ? void 0 : _a.typeColumn) !== 'hidden'; }) // Filtra as colunas com 'hidden'
|
|
17007
|
-
.map(function (key) { return (React.createElement("th", { key: key, className: styles$2.header, style: { padding: cellsPadding ? "".concat(cellsPadding, "px") : '', borderColor: borderColor ? borderColor : '' } }, key !== 'menu' && key !== '' && key.charAt(0).toUpperCase() + key.slice(1))); }))),
|
|
17007
|
+
.map(function (key) { return (React.createElement("th", { key: key, className: styles$2.header, style: { padding: cellsPadding ? "".concat(cellsPadding, "px") : '', borderColor: borderColor ? borderColor : '', borderRadius: borderRadius ? "".concat(borderRadius, "px") : '' } }, key !== 'menu' && key !== '' && key.charAt(0).toUpperCase() + key.slice(1))); }))),
|
|
17008
17008
|
React.createElement("tbody", { className: "".concat(linhasZebradas || empresa === '6' ? styles$2.linhasZebradas : '') }, currentItems.map(function (row, index) { return (React.createElement("tr", { key: index, id: "id_".concat(index), className: "".concat(styles$2.row, " ").concat(selectedRow === row[idColumn] ? styles$2.activeRow : '', " ").concat(borderColor ? styles$2.cellBorder : ''), onClick: function () { return handleRowClick(row); }, style: { background: cor ? 'white' : '', cursor: onRowClick ? 'pointer' : '' } }, Object.keys(row).filter(function (key) { var _a; return ((_a = row[key]) === null || _a === void 0 ? void 0 : _a.typeColumn) !== 'hidden'; }).map(function (key, i) {
|
|
17009
17009
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
17010
17010
|
return (React.createElement("td", { key: i, className: "".concat(styles$2.cell, " ").concat(row[key].typeColumn && row[key].typeColumn === 'img' ? styles$2.center : ''), style: { padding: cellsPadding ? "".concat(cellsPadding, "px") : '', borderRadius: borderRadius ? "".concat(borderRadius, "px") : '', borderColor: borderColor ? borderColor : '', backgroundColor: row[key].backgroundCell ? row[key].backgroundCell : '' } },
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { CarregandoProps } from '../components/Carregando';
|
|
3
|
+
declare const meta: Meta<CarregandoProps>;
|
|
4
|
+
export default meta;
|
|
5
|
+
export declare const Primary: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, CarregandoProps>;
|
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styles from '../styles/carregando.module.css';
|
|
3
|
+
import { GoDotFill } from 'react-icons/go';
|
|
4
|
+
|
|
5
|
+
export interface CarregandoProps {
|
|
6
|
+
empresa: '1' | '2' | '3' | '4' | '5' | '6';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Carregando: React.FC<CarregandoProps> = ({
|
|
10
|
+
empresa,
|
|
11
|
+
}) => {
|
|
12
|
+
|
|
13
|
+
const empresaClass = empresa ? styles[`empresa${empresa}`] : '';
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<div className={`${empresaClass} ${styles.gifCarregando}`}>
|
|
18
|
+
<GoDotFill fontSize={30} className={`${styles.dot} ${styles.dot1}`}/>
|
|
19
|
+
<GoDotFill fontSize={30} className={`${styles.dot} ${styles.dot2}`}/>
|
|
20
|
+
<GoDotFill fontSize={30} className={`${styles.dot} ${styles.dot3}`}/>
|
|
21
|
+
<GoDotFill fontSize={30} className={`${styles.dot} ${styles.dot4}`}/>
|
|
22
|
+
<GoDotFill fontSize={30} className={`${styles.dot} ${styles.dot5}`}/>
|
|
23
|
+
</div>
|
|
24
|
+
</>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default Carregando;
|
|
@@ -309,7 +309,7 @@ const TableStandardButtons: React.FC<TableStandardButtonsProps> = ({
|
|
|
309
309
|
<th
|
|
310
310
|
key={key}
|
|
311
311
|
className={styles.header}
|
|
312
|
-
style={{padding: cellsPadding ? `${cellsPadding}px` : '', borderColor: borderColor ? borderColor : ''}}
|
|
312
|
+
style={{padding: cellsPadding ? `${cellsPadding}px` : '', borderColor: borderColor ? borderColor : '', borderRadius: borderRadius ? `${borderRadius}px` : ''}}
|
|
313
313
|
>
|
|
314
314
|
{key !== 'menu' && key !== '' && key.charAt(0).toUpperCase() + key.slice(1)}
|
|
315
315
|
</th>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
import Carregando, {CarregandoProps} from '../components/Carregando';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<CarregandoProps> = {
|
|
6
|
+
title: 'Components/CarregandoField',
|
|
7
|
+
component: Carregando,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
empresa: {
|
|
13
|
+
control: { type: 'radio', options: ['1', '3', '4', '5', '6'] },
|
|
14
|
+
description: 'Define o estilo da empresa aplicado ao botão',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
|
|
21
|
+
const Template: StoryFn<CarregandoProps> = (args: any) => {
|
|
22
|
+
const [value, setValue] = useState(args.value || '');
|
|
23
|
+
|
|
24
|
+
return <Carregando {...args} value={value} />;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// História principal (Primary)
|
|
28
|
+
export const Primary = Template.bind({});
|
|
29
|
+
Primary.args = {
|
|
30
|
+
empresa: '1'
|
|
31
|
+
};
|
|
@@ -120,7 +120,7 @@ const teste = (rowId:any, checked:any) => {
|
|
|
120
120
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
const Template: StoryFn<TableStandardButtonsProps> = (args: any) => <TableStandardButtons {...args} onCheckboxChange={teste} linhasZebradas empresa='
|
|
123
|
+
const Template: StoryFn<TableStandardButtonsProps> = (args: any) => <TableStandardButtons {...args} onCheckboxChange={teste} linhasZebradas empresa='1' onPageChange={2}/>;
|
|
124
124
|
|
|
125
125
|
// Definição dos dados de exemplo para a tabela
|
|
126
126
|
const sampleData: Data[] = [
|
|
@@ -138,7 +138,7 @@ const sampleData: Data[] = [
|
|
|
138
138
|
iconButton: '',
|
|
139
139
|
colorButton: '',
|
|
140
140
|
initialValue: '',
|
|
141
|
-
borderRadius: '
|
|
141
|
+
borderRadius: '20',
|
|
142
142
|
menus: [
|
|
143
143
|
{nome: 'Preencher/Emitir AF', onClick: (rowId)=>alert(rowId), disabled: true},
|
|
144
144
|
{nome: 'hr'},
|
|
@@ -321,6 +321,7 @@ Primary.args = {
|
|
|
321
321
|
dados: sampleData,
|
|
322
322
|
numeroPaginas: 5,
|
|
323
323
|
empresa: '1',
|
|
324
|
+
borderRadius: '0'
|
|
324
325
|
};
|
|
325
326
|
|
|
326
327
|
// História com botão de download do Excel
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
|
|
2
|
+
.gifCarregando{
|
|
3
|
+
margin: 10px 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.dot {
|
|
7
|
+
opacity: 0;
|
|
8
|
+
animation: fadeInOut 2s infinite;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dot1 {
|
|
12
|
+
animation-delay: 0s;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.dot2 {
|
|
16
|
+
animation-delay: 0.3s;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.dot3 {
|
|
20
|
+
animation-delay: 0.6s;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.dot4 {
|
|
24
|
+
animation-delay: 0.9s;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.dot5 {
|
|
28
|
+
animation-delay: 1.2s;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Cores */
|
|
32
|
+
.empresa1 .dot{
|
|
33
|
+
color: var(--blue);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.empresa2 .dot{
|
|
37
|
+
color: var(--regionalPrincipal);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.empresa3 .dot{
|
|
41
|
+
color: var(--green);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.empresa4 .dot{
|
|
45
|
+
color: var(--red);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.empresa5 .dot{
|
|
49
|
+
color: var(--cartaoGreen);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.empresa6 .dot{
|
|
53
|
+
color: var(--sistemaSaudeBlue);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@keyframes fadeInOut {
|
|
57
|
+
0%, 100% { opacity: 0; }
|
|
58
|
+
50% { opacity: 1; }
|
|
59
|
+
}
|