@vixoniccom/menu-daily 0.1.0 → 0.1.1-dev.0
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 +10 -1
- package/build.zip +0 -0
- package/package.json +14 -9
- package/src/dataLoader.ts +5 -4
- package/src/scenes/App.tsx +1 -1
- package/src/scenes/components/Grid/Grid.tsx +2 -2
- package/src/scenes/components/Grid/GridItem.tsx +3 -3
- package/src/scenes/components/Grid/animation.ts +2 -3
- package/src/scenes/components/MealContainer/components/Title/index.tsx +2 -2
- package/src/scenes/components/MealContainer/index.tsx +2 -2
- package/src/static/menu-daily-example.xlsx +0 -0
- package/src/test/parameters.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
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.1.1-dev.0 (2025-02-13)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* animejs was upgrated to v3.2.2 ([b53b53b](https://bitbucket.org/vixonic_dev/menu-daily/commit/b53b53ba4d4d93f8efff2958f88fc214f16e557e))
|
|
11
|
+
* several packages were upgrated ([c3ade1b](https://bitbucket.org/vixonic_dev/menu-daily/commit/c3ade1b5b0bde05ee7c043ea6a8f3a5f7a60c18b))
|
|
12
|
+
* standard-version was added to the app ([7043098](https://bitbucket.org/vixonic_dev/menu-daily/commit/7043098a5858981571920fcb2ac28cfad7180019))
|
|
13
|
+
|
|
5
14
|
<a name="0.1.0"></a>
|
|
6
15
|
# 0.1.0 (2018-08-22)
|
|
7
16
|
|
package/build.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -10,22 +10,27 @@
|
|
|
10
10
|
"author": {
|
|
11
11
|
"name": ""
|
|
12
12
|
},
|
|
13
|
-
"version": "0.1.0",
|
|
13
|
+
"version": "0.1.1-dev.0",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"prepublish": "vixonic-module-packager --mode build",
|
|
16
16
|
"watch": "vixonic-module-packager --mode watch",
|
|
17
|
-
"run": "vixonic-module-packager --mode run"
|
|
17
|
+
"run": "vixonic-module-packager --mode run",
|
|
18
|
+
"release": "standard-version",
|
|
19
|
+
"prerelease-beta": "standard-version --prerelease beta",
|
|
20
|
+
"prerelease-dev": "standard-version --prerelease dev"
|
|
18
21
|
},
|
|
19
22
|
"devDependencies": {
|
|
20
|
-
"@types/node": "^
|
|
21
|
-
"@types/react": "^
|
|
22
|
-
"@types/react-dom": "^
|
|
23
|
+
"@types/node": "^14.18.63",
|
|
24
|
+
"@types/react": "^17.0.35",
|
|
25
|
+
"@types/react-dom": "^17.0.11",
|
|
26
|
+
"@vixoniccom/module-packager": "^2.10.0",
|
|
27
|
+
"standard-version": "^9.5.0"
|
|
23
28
|
},
|
|
24
29
|
"dependencies": {
|
|
25
|
-
"animejs": "^2.
|
|
30
|
+
"animejs": "^3.2.2",
|
|
26
31
|
"localforage": "^1.5.0",
|
|
27
|
-
"react": "^
|
|
28
|
-
"react-dom": "^
|
|
29
|
-
"xlsx": "^0.
|
|
32
|
+
"react": "^17.0.2",
|
|
33
|
+
"react-dom": "^17.0.2",
|
|
34
|
+
"xlsx": "^0.17.5"
|
|
30
35
|
}
|
|
31
36
|
}
|
package/src/dataLoader.ts
CHANGED
|
@@ -109,7 +109,7 @@ export class DataLoader {
|
|
|
109
109
|
let bstr = arr.join('')
|
|
110
110
|
|
|
111
111
|
/* Call XLSX */
|
|
112
|
-
let workbook = xlsx
|
|
112
|
+
let workbook = xlsx?.read(bstr, { type: 'binary' })
|
|
113
113
|
this._pollingTimer = window.setTimeout(() => { this.load() }, this._pollingInterval)
|
|
114
114
|
|
|
115
115
|
let menuData = this.parseData(workbook)
|
|
@@ -132,6 +132,7 @@ export class DataLoader {
|
|
|
132
132
|
|
|
133
133
|
private parseData (workbook: xlsx.WorkBook): MenuData | undefined {
|
|
134
134
|
try {
|
|
135
|
+
if (!workbook) return undefined
|
|
135
136
|
if (this._mealType) workbook.SheetNames.find((name) => name.toUpperCase() === this._mealType!.toUpperCase())
|
|
136
137
|
let menuData: MenuData = workbook.SheetNames.reduce((menu: MenuData, name) => {
|
|
137
138
|
let newMenu = {...menu}
|
|
@@ -141,7 +142,7 @@ export class DataLoader {
|
|
|
141
142
|
}, {})
|
|
142
143
|
logger.log(menuData)
|
|
143
144
|
return menuData
|
|
144
|
-
} catch (e) {
|
|
145
|
+
} catch (e: any) {
|
|
145
146
|
this.onError && this.onError(e)
|
|
146
147
|
return undefined
|
|
147
148
|
}
|
|
@@ -149,10 +150,10 @@ export class DataLoader {
|
|
|
149
150
|
|
|
150
151
|
private parseSheet (sheet: xlsx.WorkSheet): MenuByDate | undefined {
|
|
151
152
|
if (!sheet) return undefined
|
|
152
|
-
let meals: MenuByDate | {} = xlsx
|
|
153
|
+
let meals: MenuByDate | {} = xlsx?.utils.sheet_to_json(sheet, {raw: true}).reduce((menu: MenuByDate, row: any) => {
|
|
153
154
|
let newMenu = {...menu}
|
|
154
155
|
let keys = Object.keys(row)
|
|
155
|
-
let date: {d: number, m: number, y: number} = xlsx
|
|
156
|
+
let date: {d: number, m: number, y: number} = xlsx?.SSF.parse_date_code(row[keys[0]] as any)
|
|
156
157
|
if (date.d && date.m && date.y) {
|
|
157
158
|
newMenu[new Date(date.y,date.m - 1,date.d).getTime()] = keys.slice(1).map((key) => {
|
|
158
159
|
return {
|
package/src/scenes/App.tsx
CHANGED
|
@@ -35,7 +35,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
|
35
35
|
const today = new Date()
|
|
36
36
|
today.setHours(0,0,0,0)
|
|
37
37
|
const menu = mealType && data[mealType.toUpperCase()] || data[Object.keys(data)[0]]
|
|
38
|
-
this.setState({loading: false, data: menu[
|
|
38
|
+
this.setState({loading: false, data: menu[1651809600000]})
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
this.dataLoader.onError = (e) => {
|
|
@@ -31,8 +31,8 @@ export type ContainerDataProps = {
|
|
|
31
31
|
class GridItem extends React.Component<GridItemProps, any> {
|
|
32
32
|
el: any
|
|
33
33
|
|
|
34
|
-
constructor () {
|
|
35
|
-
super()
|
|
34
|
+
constructor (props: GridItemProps) {
|
|
35
|
+
super(props)
|
|
36
36
|
this.state = {}
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -70,7 +70,7 @@ class GridItem extends React.Component<GridItemProps, any> {
|
|
|
70
70
|
return <div style={style}
|
|
71
71
|
ref={(el) => this.el = el}>
|
|
72
72
|
{
|
|
73
|
-
React.cloneElement<any, any>(props.children as
|
|
73
|
+
React.cloneElement<any, any>(props.children as any, props.containerData)
|
|
74
74
|
}
|
|
75
75
|
</div>
|
|
76
76
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const anime: any = require('animejs').default
|
|
2
2
|
|
|
3
3
|
// Predefined animation modes.
|
|
4
4
|
const animationModes: {[mode: string]: any} = {
|
|
@@ -93,11 +93,10 @@ class Animation {
|
|
|
93
93
|
delay: function (_el: any, _i: any, _l: any) {
|
|
94
94
|
return _i * self.stagger
|
|
95
95
|
},
|
|
96
|
-
offset: `+=${offset}`,
|
|
97
96
|
complete: () => {
|
|
98
97
|
finished()
|
|
99
98
|
}
|
|
100
|
-
}, this.mode.out))
|
|
99
|
+
}, this.mode.out), `+=${offset}`)
|
|
101
100
|
animation.play()
|
|
102
101
|
}
|
|
103
102
|
}
|
|
Binary file
|
package/src/test/parameters.json
CHANGED
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"pollingInterval": 300000,
|
|
34
|
-
"url":"
|
|
35
|
-
"url2":"https://docs.google.com/spreadsheets/d/e/2PACX-1vRTuTsKdqpLH2zqKXURYTu_xpc5arXljE0W8KfnPJVy5U_J1HGD30C5YfVrWjUFAz5W9JiTC4VGVBYN/pub?output=xlsx"
|
|
34
|
+
"url":"https://docs.google.com/spreadsheets/d/e/2PACX-1vRNutB0GG-4deRCMFk5R3mGWWHS3ctoVZOjS7ZzK4Z3wFfozYYLet4TYXiArJ-8eeWwqQtgP3StDkkF/pub?output=xlsx"
|
|
36
35
|
}
|
|
37
36
|
}
|