@vixoniccom/menu-daily 0.1.1-dev.0 → 0.1.1
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 +2 -4
- package/build.zip +0 -0
- package/configuration.json +1 -1
- package/package.json +9 -9
- package/src/dataLoader.ts +3 -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 +3 -2
- package/src/scenes/components/MealContainer/components/Title/index.tsx +2 -2
- package/src/scenes/components/MealContainer/index.tsx +2 -2
- package/src/test/parameters.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,14 +2,12 @@
|
|
|
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
|
|
5
|
+
### 0.1.1 (2024-05-22)
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
### Bug Fixes
|
|
9
9
|
|
|
10
|
-
*
|
|
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))
|
|
10
|
+
* configuration label was corrected ([ebc6b85](https://bitbucket.org/vixonic_dev/menu-daily/commit/ebc6b85ab818004ac98011f6a2daf1c8f76335bb))
|
|
13
11
|
|
|
14
12
|
<a name="0.1.0"></a>
|
|
15
13
|
# 0.1.0 (2018-08-22)
|
package/build.zip
CHANGED
|
Binary file
|
package/configuration.json
CHANGED
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"author": {
|
|
11
11
|
"name": ""
|
|
12
12
|
},
|
|
13
|
-
"version": "0.1.1
|
|
13
|
+
"version": "0.1.1",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"prepublish": "vixonic-module-packager --mode build",
|
|
16
16
|
"watch": "vixonic-module-packager --mode watch",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"prerelease-dev": "standard-version --prerelease dev"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@types/node": "^
|
|
24
|
-
"@types/react": "^
|
|
25
|
-
"@types/react-dom": "^
|
|
26
|
-
"@vixoniccom/module-packager": "^2.
|
|
23
|
+
"@types/node": "^8.0.14",
|
|
24
|
+
"@types/react": "^15.0.38",
|
|
25
|
+
"@types/react-dom": "^15.5.1",
|
|
26
|
+
"@vixoniccom/module-packager": "^2.9.1",
|
|
27
27
|
"standard-version": "^9.5.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"animejs": "^
|
|
30
|
+
"animejs": "^2.0.2",
|
|
31
31
|
"localforage": "^1.5.0",
|
|
32
|
-
"react": "^
|
|
33
|
-
"react-dom": "^
|
|
34
|
-
"xlsx": "^0.
|
|
32
|
+
"react": "^15.6.1",
|
|
33
|
+
"react-dom": "^15.6.1",
|
|
34
|
+
"xlsx": "^0.10.8"
|
|
35
35
|
}
|
|
36
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,7 +132,6 @@ export class DataLoader {
|
|
|
132
132
|
|
|
133
133
|
private parseData (workbook: xlsx.WorkBook): MenuData | undefined {
|
|
134
134
|
try {
|
|
135
|
-
if (!workbook) return undefined
|
|
136
135
|
if (this._mealType) workbook.SheetNames.find((name) => name.toUpperCase() === this._mealType!.toUpperCase())
|
|
137
136
|
let menuData: MenuData = workbook.SheetNames.reduce((menu: MenuData, name) => {
|
|
138
137
|
let newMenu = {...menu}
|
|
@@ -150,10 +149,10 @@ export class DataLoader {
|
|
|
150
149
|
|
|
151
150
|
private parseSheet (sheet: xlsx.WorkSheet): MenuByDate | undefined {
|
|
152
151
|
if (!sheet) return undefined
|
|
153
|
-
let meals: MenuByDate | {} = xlsx
|
|
152
|
+
let meals: MenuByDate | {} = xlsx.utils.sheet_to_json(sheet, {raw: true}).reduce((menu: MenuByDate, row: any) => {
|
|
154
153
|
let newMenu = {...menu}
|
|
155
154
|
let keys = Object.keys(row)
|
|
156
|
-
let date: {d: number, m: number, y: number} = xlsx
|
|
155
|
+
let date: {d: number, m: number, y: number} = xlsx.SSF.parse_date_code(row[keys[0]] as any)
|
|
157
156
|
if (date.d && date.m && date.y) {
|
|
158
157
|
newMenu[new Date(date.y,date.m - 1,date.d).getTime()] = keys.slice(1).map((key) => {
|
|
159
158
|
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[today.getTime()]})
|
|
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 () {
|
|
35
|
+
super()
|
|
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 any
|
|
73
|
+
React.cloneElement<any, any>(props.children as React.ReactElement<any>, props.containerData)
|
|
74
74
|
}
|
|
75
75
|
</div>
|
|
76
76
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
let anime = require('animejs')
|
|
2
2
|
|
|
3
3
|
// Predefined animation modes.
|
|
4
4
|
const animationModes: {[mode: string]: any} = {
|
|
@@ -93,10 +93,11 @@ class Animation {
|
|
|
93
93
|
delay: function (_el: any, _i: any, _l: any) {
|
|
94
94
|
return _i * self.stagger
|
|
95
95
|
},
|
|
96
|
+
offset: `+=${offset}`,
|
|
96
97
|
complete: () => {
|
|
97
98
|
finished()
|
|
98
99
|
}
|
|
99
|
-
}, this.mode.out)
|
|
100
|
+
}, this.mode.out))
|
|
100
101
|
animation.play()
|
|
101
102
|
}
|
|
102
103
|
}
|
package/src/test/parameters.json
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"pollingInterval": 300000,
|
|
34
|
-
"url":"
|
|
34
|
+
"url":"./static/menu-daily-example.xlsx",
|
|
35
|
+
"url2":"https://docs.google.com/spreadsheets/d/e/2PACX-1vRTuTsKdqpLH2zqKXURYTu_xpc5arXljE0W8KfnPJVy5U_J1HGD30C5YfVrWjUFAz5W9JiTC4VGVBYN/pub?output=xlsx"
|
|
35
36
|
}
|
|
36
37
|
}
|