@vixoniccom/aniversarios 0.0.1-beta.1 → 0.0.1-beta.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.0.1-beta.3](https://gitlab.com/mandomedio/vixonic/aniversarios/compare/v0.0.1-beta.2...v0.0.1-beta.3) (2022-06-08)
6
+
7
+ ### [0.0.1-beta.2](https://gitlab.com/mandomedio/vixonic/aniversarios/compare/v0.0.1-beta.1...v0.0.1-beta.2) (2022-06-06)
8
+
5
9
  ### [0.0.1-beta.1](https://gitlab.com/mandomedio/vixonic/aniversarios/compare/v0.0.1-beta.0...v0.0.1-beta.1) (2022-06-03)
6
10
 
7
11
  ### [0.0.1-beta.0](https://gitlab.com/mandomedio/vixonic/aniversarios/compare/v1.0.1-beta.4...v0.0.1-beta.0) (2022-06-03)
package/build.zip CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixoniccom/aniversarios",
3
3
  "alias": "Aniversarios",
4
- "version": "0.0.1-beta.1",
4
+ "version": "0.0.1-beta.3",
5
5
  "description": "Muestra el día que el trabajador está de aniversario en la empresa.",
6
6
  "main": "main.js",
7
7
  "author": "",
package/src/App.tsx CHANGED
@@ -25,6 +25,7 @@ export const App = ({ data, start }: Props) => {
25
25
  const [dataState, setDataState] = useState(data)
26
26
  const [msj, setMsj] = useState<Msj>("");
27
27
  const { apiDomain, dataMode, excludePast } = configureState.parameters;
28
+ let updateTimer : any
28
29
 
29
30
  useEffect(() => {
30
31
  addConfiguration(data);
@@ -32,6 +33,11 @@ export const App = ({ data, start }: Props) => {
32
33
  }, [data]);
33
34
 
34
35
 
36
+ const setUpdateTime =() => {
37
+ clearTimeout(updateTimer)
38
+ updateTimer = setTimeout(getData, configureState.parameters.updateTime)
39
+ }
40
+
35
41
  useEffect(() => {
36
42
  if (apiDomain) getData();
37
43
  if (!apiDomain) setMsj("Missing google sheets");
@@ -62,6 +68,7 @@ export const App = ({ data, start }: Props) => {
62
68
  if (contractEmployees) {
63
69
  addEmployee(employee);
64
70
  setMsj("");
71
+ setUpdateTime()
65
72
  } else {
66
73
  setMsj("Ningún ingreso que mostrar");
67
74
  }
@@ -32,14 +32,14 @@ interface Animation {
32
32
  export const ItemsContainer = ({ animation, items, animate }: Props) => {
33
33
 
34
34
  const { configureState } = useContext(ConfigureContext)
35
- const { containerColumns, containerRows, containerRowsGap } = configureState.parameters
35
+ const { containerColumns, containerRows, containerRowsGap, containerColumnsGap } = configureState.parameters
36
36
  const container = useRef<HTMLDivElement>(null)
37
37
  const [animations] = useState(new (require('./animation'))())
38
38
  let itemsCount = Number(containerColumns) * Number(containerRows)
39
- let columns = Number(containerColumns) | 1
40
- let rows = Number(containerRows) | 1
41
- let rowsGap = Number(containerRowsGap) | 0
42
- let columnsGap = 1
39
+ let columns = Number(containerColumns) || 1
40
+ let rows = Number(containerRows) || 1
41
+ let rowsGap = Number(containerRowsGap) || 0
42
+ let columnsGap = Number(containerColumnsGap) || 1
43
43
 
44
44
  const [show, setShow] = useState(false)
45
45
  const [item, setItem] = useState([])
@@ -49,12 +49,18 @@ export const ItemsContainer = ({ animation, items, animate }: Props) => {
49
49
  const configure = () => {
50
50
  animations.configure(animation)
51
51
  itemsCount = Number(containerColumns) * Number(containerRows)
52
- columns = Number(containerColumns) | 1
53
- rows = Number(containerRows) | 1
54
- rowsGap = Number(containerRowsGap) | 0
52
+ columns = Number(containerColumns) || 1
53
+ rows = Number(containerRows) || 1
54
+ rowsGap = Number(containerRowsGap) || 0
55
+ columnsGap = Number(containerColumnsGap) || 1
56
+
55
57
  if (animate && stage === stages.idle) createItems(lastIndex, items)
56
58
  }
57
59
 
60
+ console.log(columns)
61
+ console.log(columnsGap)
62
+ console.log(rows)
63
+ console.log(rowsGap)
58
64
 
59
65
  useEffect(() => {
60
66
  configure()
@@ -95,9 +101,9 @@ export const ItemsContainer = ({ animation, items, animate }: Props) => {
95
101
  // Item alignment. By default is center - center.
96
102
  // alignment={alignment}
97
103
  // Setup item width based on columns count.
98
- width={`${(100 - (columnsGap * (columns - 1))) / columns}%`}
104
+ width={`${(100 - ((columnsGap * (columns - 1)))) / columns}%`}
99
105
  // Setup item height based on rows count. If 0 set up on auto.
100
- height={`${(100 - (rowsGap * (rows - 1))) / rows}%`}
106
+ height={`${(100 - ((rowsGap * (rows - 1)))) / rows}%`}
101
107
  // Setup horizontal gap
102
108
  horizontalGap={columnsGap}
103
109
  // Setup vertical gap
@@ -17,6 +17,7 @@ const INITIAL_STATE: VixonicData = {
17
17
  containerColumns: "",
18
18
  containerRows: "",
19
19
  containerRowsGap: "",
20
+ containerColumnsGap:"",
20
21
  dataMode: "",
21
22
  dateAlignment: "center",
22
23
  dateDayFormat: { font: { filename: '', id: '' ,_isAsset: true }, fontSize: 55, alignment: { horizontal: "center" }, fontColor: "" , },
@@ -19,6 +19,7 @@ export const anniversaryReducer = (state: VixonicData, action: ConfigureAction)
19
19
  apiDomain: parameters.apiDomain,
20
20
  backgroundImage: parameters.backgroundImage,
21
21
  containerColumns: parameters.containerColumns,
22
+ containerColumnsGap:parameters.containerColumnsGap,
22
23
  containerRows: parameters.containerRows,
23
24
  containerRowsGap: parameters.containerRowsGap,
24
25
  dataMode: parameters.dataMode,
@@ -19,6 +19,7 @@ declare type VixonicParameters = Partial<{
19
19
  containerColumns: string
20
20
  containerRows: string
21
21
  containerRowsGap: string
22
+ containerColumnsGap:string
22
23
  dataMode: string
23
24
  dateAlignment: keyof typeof alignment
24
25
  dateDayFormat: DateFormat