@vixoniccom/aniversarios 1.4.0-dev.1 → 1.4.0-dev.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/build.zip CHANGED
Binary file
@@ -9,7 +9,8 @@ export const dataInputs = [
9
9
  items: [
10
10
  { label: 'Documento', value: 'AnniversaryAppService' },
11
11
  { label: 'Rexmas', value: 'RexmasAnniversarieService'},
12
- { label: 'Buk', value: 'BukAnniversarieService' }
12
+ { label: 'Buk', value: 'BukAnniversarieService' },
13
+ { label: 'Talana', value: 'TalanaAnniversariesService' }
13
14
  ],
14
15
  defaultValue: 'AnniversaryAppService',
15
16
  description: 'Selecciona la fuente de los cumpleaños. Por defecto, Documento.'
@@ -18,7 +19,7 @@ export const dataInputs = [
18
19
  id: 'documentService',
19
20
  label: 'Documento',
20
21
  serviceType: 'AnniversaryAppService',
21
- show: serviceEnabled.annivesaryAppServiceEnabled
22
+ show: serviceEnabled.anniversaryAppServiceEnabled
22
23
  }),
23
24
  new ServiceInput({
24
25
  id: 'rexmasService',
@@ -32,6 +33,12 @@ export const dataInputs = [
32
33
  serviceType: 'BukAnniversariesService',
33
34
  show: serviceEnabled.bukServiceEnabled
34
35
  }),
36
+ new ServiceInput({
37
+ id: 'talanaService',
38
+ label: 'Talana',
39
+ serviceType: 'TalanaAnniversariesService',
40
+ show: serviceEnabled.talanaServiceEnabled
41
+ }),
35
42
  new SelectInput({
36
43
  id: 'photoMode',
37
44
  label: 'Modo de fotos',
@@ -46,7 +53,7 @@ export const dataInputs = [
46
53
  id: 'photosZip',
47
54
  label: 'Archivo Zip para fotos',
48
55
  extensions: ['zip'],
49
- show: serviceEnabled.annivesaryAppServiceEnabled
56
+ show: serviceEnabled.anniversaryAppServiceEnabled
50
57
  }),
51
58
  new Label({ label: 'Funcionamiento' }),
52
59
  new SelectInput({
@@ -12,7 +12,8 @@ export const ShowValidations = {
12
12
 
13
13
 
14
14
  export const serviceEnabled = {
15
+ anniversaryAppServiceEnabled: '{{displayService}} === "AnniversaryAppService"',
15
16
  rexmasServiceEnabled: '{{displayService}} === "RexmasAnniversarieService"',
16
- annivesaryAppServiceEnabled: '{{displayService}} === "AnniversaryAppService"',
17
- bukServiceEnabled: '{{displayService}} === "BukAnniversarieService"'
18
- }
17
+ bukServiceEnabled: '{{displayService}} === "BukAnniversarieService"',
18
+ talanaServiceEnabled: '{{displayService}} === "TalanaAnniversariesService"',
19
+ }
@@ -26,6 +26,10 @@
26
26
  {
27
27
  "label": "Buk",
28
28
  "value": "BukAnniversarieService"
29
+ },
30
+ {
31
+ "label": "Talana",
32
+ "value": "TalanaAnniversariesService"
29
33
  }
30
34
  ],
31
35
  "defaultValue": "AnniversaryAppService"
@@ -51,6 +55,13 @@
51
55
  "type": "service-input",
52
56
  "serviceType": "BukAnniversariesService"
53
57
  },
58
+ {
59
+ "id": "talanaService",
60
+ "label": "Talana",
61
+ "show": "{{displayService}} === \"TalanaAnniversariesService\"",
62
+ "type": "service-input",
63
+ "serviceType": "TalanaAnniversariesService"
64
+ },
54
65
  {
55
66
  "id": "photoMode",
56
67
  "label": "Modo de fotos",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixoniccom/aniversarios",
3
3
  "alias": "Aniversarios",
4
- "version": "1.4.0-dev.1",
4
+ "version": "1.4.0-dev.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": "",
@@ -18,21 +18,15 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "animejs": "^3.2.2",
21
- "axios": "^1.6.0",
22
- "localforage": "^1.10.0",
23
- "moment": "^2.29.4",
24
- "prop-types": "^15.8.1",
25
21
  "react": "^18.3.1",
26
- "react-dom": "^18.3.1",
27
- "use-state-with-callback": "^3.0.2"
22
+ "react-dom": "^18.3.1"
28
23
  },
29
24
  "devDependencies": {
30
25
  "@types/animejs": "^3.1.13",
31
- "@types/lodash": "^4.17.0",
32
26
  "@types/react": "^18.3.23",
33
27
  "@types/react-dom": "^18.3.7",
34
28
  "@vixoniccom/module-packager": "2.12.0-dev.10",
35
- "@vixoniccom/modules": "^2.22.0-dev.7",
29
+ "@vixoniccom/modules": "^2.24.0-dev.1",
36
30
  "standard-version": "^9.5.0"
37
31
  }
38
32
  }
package/src/App.tsx CHANGED
@@ -3,7 +3,7 @@ import { Render } from './components'
3
3
 
4
4
  interface Props {
5
5
  start: boolean
6
- appData: VixonicData
6
+ appData?: VixonicData
7
7
  anniversaries: Anniversary[]
8
8
  }
9
9
 
@@ -1,23 +1,27 @@
1
- import { AnniversaryServiceParsers } from "./service-parsers"
1
+ import { AnniversaryServiceParsers } from './service-parsers'
2
2
 
3
-
4
3
  export class AnniversaryLoader {
5
-
6
- public onData: ((birthdays: Anniversary[]) => void) | undefined = undefined
4
+ public onData?: (birthdays: Anniversary[]) => void = undefined
7
5
  private updateTime: number = 86400000
8
- private updateTimer: number | undefined = undefined
6
+ private updateTimer?: number = undefined
9
7
  private anniversariesData: Anniversary[] = []
10
8
  private serviceType: VixonicData['parameters']['displayService'] = 'AnniversaryAppService'
11
9
 
12
- update(appData: VixonicData) {
13
- let selectedServiceId: string | undefined
14
- if (appData.parameters.displayService === 'AnniversaryAppService') {
15
- selectedServiceId = appData.parameters.documentService?.id
16
- } else if(appData.parameters.displayService === 'BukAnniversarieService') {
17
- selectedServiceId = appData.parameters.bukService?.id
18
- } else {
19
- selectedServiceId = appData.parameters.rexmasService?.id
10
+ private getServiceType(appData: VixonicData) {
11
+ switch (appData.parameters.displayService) {
12
+ case 'RexmasAnniversarieService':
13
+ return appData.parameters.rexmasService?.id
14
+ case 'BukAnniversarieService':
15
+ return appData.parameters.bukService?.id
16
+ case 'TalanaAnniversariesService':
17
+ return appData.parameters.talanaService?.id
18
+ default:
19
+ return appData.parameters.documentService?.id
20
20
  }
21
+ }
22
+
23
+ update(appData: VixonicData) {
24
+ const selectedServiceId = this.getServiceType(appData)
21
25
  if (!selectedServiceId || !appData.services[selectedServiceId]) return
22
26
  const serviceData = appData.services[selectedServiceId].data as Anniversary[] | undefined
23
27
 
@@ -40,30 +44,28 @@ export class AnniversaryLoader {
40
44
  this.setUpdateTime(undefined)
41
45
  }
42
46
 
43
- private setUpdateTime(milliseconds: number | undefined) {
47
+ private setUpdateTime(milliseconds?: number) {
44
48
  window.clearTimeout(this.updateTimer)
45
- if (milliseconds === undefined) return
49
+ if (!milliseconds) return
46
50
  this.updateTimer = window.setTimeout(this.requestBirthdays, milliseconds)
47
51
  }
48
52
 
49
53
  private dispatchData(anniversaries: Anniversary[]) {
50
- this.onData && this.onData(anniversaries)
54
+ this.onData?.(anniversaries)
51
55
  }
52
56
 
53
57
  private readonly requestBirthdays = () => {
54
-
55
58
  window.clearTimeout(this.updateTimer)
56
59
  const birthdays: Anniversary[] = []
57
60
 
58
61
  if (Array.isArray(this.anniversariesData)) {
59
- this.anniversariesData.forEach(item => {
62
+ this.anniversariesData.forEach((item) => {
60
63
  birthdays.push(item)
61
64
  })
62
65
  }
63
66
 
64
- if (birthdays.length > 0) { this.dispatchData(birthdays) }
67
+ if (birthdays.length > 0) this.dispatchData(birthdays)
65
68
 
66
69
  this.setUpdateTime(this.updateTime > 10000 ? this.updateTime : 10000)
67
-
68
70
  }
69
71
  }
@@ -1,9 +1,13 @@
1
- import { useState, useRef, useEffect } from 'react'
1
+ import React, { useState, useEffect, useRef } from 'react'
2
2
  import { Item } from './components/Item'
3
- import { useStateWithCallbackLazy } from 'use-state-with-callback'
4
- import { ReactElementLike } from 'prop-types'
5
3
  import { AnimationController } from './components/animation'
6
4
 
5
+ interface AnimationType {
6
+ mode?: 'fade' | 'slideLeft' | 'slideRight'
7
+ duration?: number
8
+ speed?: number
9
+ }
10
+
7
11
  const stages = {
8
12
  idle: 'idle',
9
13
  prepared: 'prepared',
@@ -11,121 +15,105 @@ const stages = {
11
15
  }
12
16
 
13
17
  interface Props {
14
- items: ReactElementLike[],
15
- animation: Animation,
18
+ items: React.ReactElement[],
19
+ animation: AnimationType,
16
20
  animate: boolean
17
- data: VixonicData
18
- }
19
-
20
- interface Animation {
21
- mode?: "fade" | "slideRight" | "slideLeft"
22
- duration?: number,
23
- speed?: number,
24
- reverse?: boolean
21
+ containerRows: number
22
+ containerColumns: number
23
+ containerRowsGap: number
24
+ containerColumnsGap: number
25
25
  }
26
26
 
27
- export const ItemsContainer = ({ animation, items, animate, data }: Props) => {
28
- const { containerColumns, containerRows, containerRowsGap, containerColumnsGap } = data.parameters
27
+ export const ItemsContainer: React.FunctionComponent<Props> = ({ items, animation, animate, containerRows, containerColumns, containerRowsGap, containerColumnsGap }) => {
29
28
  const container = useRef<HTMLDivElement>(null)
30
- const [animations] = useState(new AnimationController())
31
- let itemsCount = Number(containerColumns) * Number(containerRows)
32
- let columns = Number(containerColumns) || 1
33
- let rows = Number(containerRows) || 1
34
- let rowsGap = Number(containerRowsGap) || 0
35
- let columnsGap = Number(containerColumnsGap) || 1
36
-
37
- const [show, setShow] = useState(false)
38
- const [item, setItem] = useState([])
39
- const [stage, setStage] = useStateWithCallbackLazy('idle')
29
+ const [animations] = useState(() => new AnimationController)
30
+ const [birthdayItems, setBirthdayItems] = useState<React.ReactElement[]>([])
40
31
  const [lastIndex, setLastIndex] = useState(0)
32
+ const [show, setShow] = useState(false)
33
+ const [stage, setStage] = useState(stages.idle)
41
34
 
42
35
  useEffect(() => {
43
36
  configure()
44
37
  }, [animation])
45
38
 
46
39
  useEffect(() => {
47
- if (animate && stage === stages.prepared) {
48
- setStage(stages.animating, () => {
49
- if (null !== container.current) {
50
- animations.animate(container.current.childNodes, () => {
51
- createItems(lastIndex, items)
52
- })
53
- }
54
- })
40
+ if (null !== container.current && stage === stages.animating) {
41
+ animations.animate(container.current.childNodes, () => createItems())
55
42
  }
56
- }, [item, animate])
43
+ }, [stage])
57
44
 
58
- const configure = () => {
59
- animations.configure(animation)
60
- itemsCount = Number(containerColumns) * Number(containerRows)
61
- columns = Number(containerColumns) || 1
62
- rows = Number(containerRows) || 1
63
- rowsGap = Number(containerRowsGap) || 0
64
- columnsGap = Number(containerColumnsGap) || 1
45
+ useEffect(() => {
46
+ if (animate && stage === stages.prepared) setStage(stages.animating)
47
+ }, [birthdayItems, animate])
65
48
 
66
- if (animate && stage === stages.idle) createItems(lastIndex, items)
49
+ const configure = () => {
50
+ animations.configure({
51
+ mode: animation.mode,
52
+ duration: animation.duration,
53
+ speed: animation.speed
54
+ })
55
+ if (animate && stage === stages.idle) createItems()
67
56
  }
68
57
 
69
- const createItems = (lastIndex: number, items: any) => {
70
- if (items.length === 0) {
71
- setShow(false)
72
- setStage(stages.idle, () => { })
73
- return
58
+ const updateIndex = (newIndex: number) => {
59
+ if (newIndex >= items.length) {
60
+ setLastIndex(0)
61
+ } else {
62
+ setLastIndex(newIndex)
74
63
  }
64
+ }
75
65
 
76
- let currentIndex = lastIndex % items.length
77
- const newItems: any = []
78
- const remainingItems = items.length - currentIndex
79
- const itemsToShow = Math.min(itemsCount, remainingItems)
66
+ const createItems = () => {
80
67
 
81
- for (let i = 0; i < itemsToShow; i++) {
82
- const itemIndex = currentIndex + i
83
- const item = items[itemIndex]
68
+ const remainingItems = items.length - lastIndex
69
+ const itemsToShow = Math.min(containerRows * containerColumns, remainingItems)
84
70
 
85
- newItems.push(
71
+ const newItems = items.slice(lastIndex, lastIndex + itemsToShow).map(
72
+ (item: React.ReactElement, index: number, arr: React.ReactElement[]) => (
86
73
  <Item
87
- key={`item-${itemIndex}`}
74
+ key={lastIndex + index + 1}
88
75
  containerData={{
89
- ic_index: i,
90
- ic_rowIndex: Math.floor(i / columns),
91
- ic_columnIndex: i % columns,
92
- ic_firstChild: i === 0,
93
- ic_lastChild: i === (itemsToShow - 1)
76
+ ic_index: index,
77
+ ic_rowIndex: index / containerColumns,
78
+ ic_columnIndex: index % containerColumns,
79
+ ic_firstChild: index === 0,
80
+ ic_lastChild: index === (arr.length - 1)
94
81
  }}
95
82
  style={animations.getInitialStyle()}
96
- width={`${(100 - ((columnsGap * (columns - 1)))) / columns}%`}
97
- height={`${(100 - ((rowsGap * (rows - 1)))) / rows}%`}
98
- horizontalGap={columnsGap}
99
- verticalGap={rowsGap}
100
- >
83
+ width={`${(100 - ((containerColumnsGap * (containerColumns - 1)))) / containerColumns}%`}
84
+ height={`${(100 - ((containerRowsGap * (containerRows - 1)))) / containerRows}%`}
85
+ horizontalGap={containerColumnsGap}
86
+ verticalGap={containerRowsGap}>
101
87
  {item}
102
88
  </Item>
103
- )
104
- }
105
-
106
- setLastIndex((currentIndex + itemsToShow) % items.length)
89
+ ))
107
90
 
108
91
  if (newItems.length > 0) {
109
92
  setShow(true)
110
- setStage(stages.prepared, () => { })
111
- setItem(newItems)
93
+ setStage(stages.prepared)
94
+ setBirthdayItems(newItems)
112
95
  } else {
113
96
  setShow(false)
114
- setStage(stages.idle, () => { })
97
+ setStage(stages.idle)
115
98
  }
99
+
100
+ updateIndex(lastIndex + newItems.length)
116
101
  }
117
102
 
118
103
  return (
119
- <div ref={container} style={{
120
- opacity: show ? 1 : 0,
121
- position: 'relative',
122
- height: '100%',
123
- width: '100%',
124
- display: 'flex',
125
- flexWrap: 'wrap',
126
- alignContent: 'flex-start'
127
- }}>
128
- {item}
104
+ <div
105
+ ref={container}
106
+ style={{
107
+ opacity: show ? 1 : 0,
108
+ position: 'relative',
109
+ height: '100%',
110
+ width: '100%',
111
+ display: 'flex',
112
+ flexWrap: 'wrap',
113
+ alignContent: 'flex-start'
114
+ }}
115
+ >
116
+ {birthdayItems}
129
117
  </div>
130
118
  )
131
119
  }
@@ -14,11 +14,14 @@ export const Render = ({ start, appData, anniversaries }: Props) => {
14
14
  const { parameters, downloadsPath } = appData
15
15
  const { backgroundImage,
16
16
  padding,
17
- defaultMessage = '',
18
- animationMode,
19
- animationOrder,
17
+ defaultMessage = 'Sin ingresos',
18
+ animationMode = 'fade',
20
19
  animationSpeed,
21
20
  animationTime,
21
+ containerRows = 3,
22
+ containerColumns = 1,
23
+ containerRowsGap = 5,
24
+ containerColumnsGap = 1,
22
25
  } = parameters
23
26
 
24
27
  const backgroundImageState = backgroundImage?.filename
@@ -40,17 +43,19 @@ export const Render = ({ start, appData, anniversaries }: Props) => {
40
43
  padding: padding
41
44
  }}>
42
45
  <FontLoader paths={['nameFormat.font', 'descriptionFormat.font', 'dateDayFormat.font', 'dateMonthFormat.font', 'optionalFormat.font']} data={appData} />
43
- {( anniversaries.length > 0) ?
46
+ {(anniversaries.length > 0) ?
44
47
  <ItemsContainer
45
48
  items={anniversaryItems}
46
49
  animation={{
47
50
  mode: animationMode,
48
51
  duration: Number(animationTime) * 1000,
49
52
  speed: animationSpeed,
50
- reverse: animationOrder
51
53
  }}
52
54
  animate={start}
53
- data={appData}
55
+ containerRows={containerRows}
56
+ containerColumns={containerColumns}
57
+ containerRowsGap={containerRowsGap}
58
+ containerColumnsGap={containerColumnsGap}
54
59
  /> :
55
60
  <div style={{
56
61
  width: '100%',
@@ -59,9 +64,9 @@ export const Render = ({ start, appData, anniversaries }: Props) => {
59
64
  justifyContent: 'center',
60
65
  alignItems: 'center'
61
66
  }}>
62
- <FormattedText text={defaultMessage.trim() || 'Sin ingresos'} format={parameters.defaultMessageFormat} />
67
+ <FormattedText text={defaultMessage.trim()} format={parameters.defaultMessageFormat} />
63
68
  </div>
64
69
  }
65
70
  </div >
66
71
  )
67
- }
72
+ }
@@ -1,9 +1,88 @@
1
1
  declare type VixonicData = {
2
2
  downloadsPath: string
3
- services: { [key: string]: { data?: any, updatedAt?: number } }
3
+ services: {[key: string]: {data?: any; updatedAt?: number}}
4
4
  parameters: VixonicParameters
5
5
  }
6
6
 
7
7
  declare type VixonicParameters = Partial<{
8
- displayService: 'AnniversaryAppService' | 'RexmasAnniversarieService' | 'BukAnniversarieService', documentService: { id: string }, rexmasService: { id: string }, bukService: { id: string }, photoMode: 'zip' | 'online', photosZip: {id?: string, filename?: string, extension?: string}, updateTime: 600000 | 1800000 | 3600000 | 21600000 | 43200000 | 86400000 | 604800000, defaultMessage: string, defaultMessageFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, orientation: 'h' | 'v', animationMode: 'fade' | 'slideRight' | 'slideLeft', animationSpeed: 2 | 1.5 | 1, animationOrder: boolean, animationTime: number, containerColumns: number, containerColumnsGap: number, containerRows: number, containerRowsGap: number, backgroundImage: {id?: string, filename?: string, extension?: string}, padding: string, textPosition: 1 | 2 | 3, textAlignment: 'start' | 'center' | 'end', nameFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, nameMaxChar: number, textMargin: string, descriptionEnabled: boolean, descriptionFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, descriptionMaxChar: number, optionalEnabled: boolean, optionalFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, imageEnabled: boolean, imagePosition: 1 | 2 | 3, imageAlignment: 'start' | 'center' | 'end', imageStyle: 'normal' | 'rounded' | 'circle', imageMargin: string, imageSize: number, dateEnabled: boolean, datePosition: 1 | 2 | 3, dateAlignment: 'start' | 'center' | 'end', dateStyle: 'calendarFlat' | 'calendarText' | 'circle' | 'text' | 'outlines', dateDayFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, dateMonthFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, abbreviatedMonths: boolean, datePrimaryColor: string, dateMargin: string, separator: boolean, separatorWidth: number, separatorColor: string, itemMargins: string
9
- }>
8
+ displayService: 'AnniversaryAppService' | 'RexmasAnniversarieService' | 'BukAnniversarieService' | 'TalanaAnniversariesService'
9
+ documentService: {id: string}
10
+ rexmasService: {id: string}
11
+ bukService: {id: string}
12
+ talanaService: {id: string}
13
+ photoMode: 'zip' | 'online'
14
+ photosZip: {id?: string; filename?: string; extension?: string}
15
+ updateTime: 600000 | 1800000 | 3600000 | 21600000 | 43200000 | 86400000 | 604800000
16
+ defaultMessage: string
17
+ defaultMessageFormat: {
18
+ fontSize?: number
19
+ fontColor?: string
20
+ alignment?: {horizontal?: 'left' | 'right' | 'center'}
21
+ font?: {filename: string; id: string; __isAsset: true}
22
+ }
23
+ orientation: 'h' | 'v'
24
+ animationMode: 'fade' | 'slideRight' | 'slideLeft'
25
+ animationSpeed: 2 | 1.5 | 1
26
+ animationOrder: boolean
27
+ animationTime: number
28
+ containerColumns: number
29
+ containerColumnsGap: number
30
+ containerRows: number
31
+ containerRowsGap: number
32
+ backgroundImage: {id?: string; filename?: string; extension?: string}
33
+ padding: string
34
+ textPosition: 1 | 2 | 3
35
+ textAlignment: 'start' | 'center' | 'end'
36
+ nameFormat: {
37
+ fontSize?: number
38
+ fontColor?: string
39
+ alignment?: {horizontal?: 'left' | 'right' | 'center'}
40
+ font?: {filename: string; id: string; __isAsset: true}
41
+ }
42
+ nameMaxChar: number
43
+ textMargin: string
44
+ descriptionEnabled: boolean
45
+ descriptionFormat: {
46
+ fontSize?: number
47
+ fontColor?: string
48
+ alignment?: {horizontal?: 'left' | 'right' | 'center'}
49
+ font?: {filename: string; id: string; __isAsset: true}
50
+ }
51
+ descriptionMaxChar: number
52
+ optionalEnabled: boolean
53
+ optionalFormat: {
54
+ fontSize?: number
55
+ fontColor?: string
56
+ alignment?: {horizontal?: 'left' | 'right' | 'center'}
57
+ font?: {filename: string; id: string; __isAsset: true}
58
+ }
59
+ imageEnabled: boolean
60
+ imagePosition: 1 | 2 | 3
61
+ imageAlignment: 'start' | 'center' | 'end'
62
+ imageStyle: 'normal' | 'rounded' | 'circle'
63
+ imageMargin: string
64
+ imageSize: number
65
+ dateEnabled: boolean
66
+ datePosition: 1 | 2 | 3
67
+ dateAlignment: 'start' | 'center' | 'end'
68
+ dateStyle: 'calendarFlat' | 'calendarText' | 'circle' | 'text' | 'outlines'
69
+ dateDayFormat: {
70
+ fontSize?: number
71
+ fontColor?: string
72
+ alignment?: {horizontal?: 'left' | 'right' | 'center'}
73
+ font?: {filename: string; id: string; __isAsset: true}
74
+ }
75
+ dateMonthFormat: {
76
+ fontSize?: number
77
+ fontColor?: string
78
+ alignment?: {horizontal?: 'left' | 'right' | 'center'}
79
+ font?: {filename: string; id: string; __isAsset: true}
80
+ }
81
+ abbreviatedMonths: boolean
82
+ datePrimaryColor: string
83
+ dateMargin: string
84
+ separator: boolean
85
+ separatorWidth: number
86
+ separatorColor: string
87
+ itemMargins: string
88
+ }>
@@ -1,3 +1,7 @@
1
+ export interface ServiceParser {
2
+ parse: (data: any[]) => Anniversary[]
3
+ }
4
+
1
5
  export class AnniversaryServiceParsers {
2
6
  static readonly AnniversaryAppService = {
3
7
  parse: (data: any[]): Anniversary[] => {
@@ -5,6 +9,7 @@ export class AnniversaryServiceParsers {
5
9
  month: item.month,
6
10
  day: item.day,
7
11
  name: item.name,
12
+ position: item.description,
8
13
  image: item.image,
9
14
  }))
10
15
  }
@@ -16,7 +21,33 @@ export class AnniversaryServiceParsers {
16
21
  month: item.month,
17
22
  day: item.day,
18
23
  name: item.name,
19
- description: undefined,
24
+ position: undefined,
25
+ image: item.image,
26
+ optional: undefined
27
+ }))
28
+ }
29
+ }
30
+
31
+ static readonly BukAnniversaryService = {
32
+ parse: (data: any[]): Anniversary[] => {
33
+ return data.map(item => ({
34
+ month: item.month,
35
+ day: item.day,
36
+ name: item.name,
37
+ position: item.position,
38
+ image: item.image,
39
+ optional: undefined
40
+ }))
41
+ }
42
+ }
43
+
44
+ static readonly TalanaAnniversariesService = {
45
+ parse: (data: any[]): Anniversary[] => {
46
+ return data.map(item => ({
47
+ month: item.month,
48
+ day: item.day,
49
+ name: item.name,
50
+ position: item.position,
20
51
  image: item.image,
21
52
  optional: undefined
22
53
  }))
@@ -25,16 +56,14 @@ export class AnniversaryServiceParsers {
25
56
 
26
57
  static getParser(serviceType: VixonicData['parameters']['displayService']): ServiceParser {
27
58
  switch (serviceType) {
28
- case 'AnniversaryAppService':
29
- return this.AnniversaryAppService
30
59
  case 'RexmasAnniversarieService':
31
60
  return this.RexmasAnniversaryService
61
+ case 'BukAnniversarieService':
62
+ return this.BukAnniversaryService
63
+ case 'TalanaAnniversariesService':
64
+ return this.TalanaAnniversariesService
32
65
  default:
33
66
  return this.AnniversaryAppService
34
67
  }
35
68
  }
36
69
  }
37
-
38
- export interface ServiceParser {
39
- parse: (data: any[]) => Anniversary[]
40
- }
@@ -1,8 +1,19 @@
1
1
  {
2
2
  "parameters": {
3
- "documentService": {"id":"080a7a66-bf46-5884-0c8a-bda3a834dc56"},
4
- "rexmasService": {"id":"e945ee89-c2ed-3eb5-d7a6-d53a3b701df8"},
5
- "defaultMessage": "No ingresos",
3
+ "documentService": {
4
+ "id": "080a7a66-bf46-5884-0c8a-bda3a834dc56"
5
+ },
6
+ "rexmasService": {
7
+ "id": "e945ee89-c2ed-3eb5-d7a6-d53a3b701df8"
8
+ },
9
+ "bukService": {
10
+ "id": "0159f12d-4a7d-24d1-f260-f33908c049e2"
11
+ },
12
+ "talanaService": {
13
+ "id": "5fedefa9-5818-4be0-bfe1-1df8605c32d2"
14
+ },
15
+ "displayService": "TalanaAnniversariesService",
16
+ "defaultMessage": "No hay ingresos",
6
17
  "padding": "365px 25px 80px 40px",
7
18
  "dataMode": "monthly",
8
19
  "template": "standard",