ywana-core8 0.0.263 → 0.0.264

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.263",
3
+ "version": "0.0.264",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -180,9 +180,6 @@ export const FieldEditor = ({ field, onChange, content, outlined = false }) => {
180
180
  if (isHidden) {
181
181
  return null
182
182
  } else {
183
-
184
- console.log("FieldEditor: ", label, value1)
185
-
186
183
  switch (type) {
187
184
  case TYPES.ENTITY:
188
185
  return <EntityEditor field={field} value={value1} onChange={change} />
package/src/site/site.css CHANGED
@@ -45,6 +45,21 @@
45
45
  width: var(--site-menu-width);
46
46
  }
47
47
 
48
+ .site6>menu.max {
49
+ width: 20rem;
50
+ }
51
+
52
+ .site6>menu>main>.site-menu-item {
53
+ width: 100%;
54
+ display: flex;
55
+ align-items: center;
56
+ }
57
+
58
+ .site6>menu.max>main>.site-menu-item:hover {
59
+ background-color: rgba(200,200,200,.2);
60
+ cursor: pointer;
61
+ }
62
+
48
63
  .site6>menu>main {
49
64
  flex: 1;
50
65
  overflow-x: hidden;
package/src/site/site.js CHANGED
@@ -4,7 +4,12 @@ import { Tabs, Tab } from '../html/tab'
4
4
  import { Header } from '../html/header'
5
5
  import { Page } from './page'
6
6
  import { SiteContext } from './siteContext'
7
- import { NotificationContainer, NotificationManager} from 'react-notifications'
7
+
8
+ /*
9
+ import { NotificationManager } from 'react-notifications'
10
+ import { NotificationContainer } from 'react-notifications'
11
+ */
12
+
8
13
  import './site.css'
9
14
  import 'react-notifications/lib/notifications.css';
10
15
 
@@ -69,8 +74,8 @@ export const SiteProvider = ({ children, siteLang, siteDictionary, showConsole }
69
74
 
70
75
  confirm: (message) => window.confirm(message),
71
76
 
72
- notify: ({title, body}) => {
73
- NotificationManager.info(body, title)
77
+ notify: ({ title, body }) => {
78
+ //NotificationManager.info(body, title)
74
79
  }
75
80
  }
76
81
 
@@ -106,6 +111,9 @@ export const Site = ({ icon, logo, title, toolbar, children, init, min, lang, di
106
111
  }
107
112
 
108
113
  const SiteNotifications = () => {
114
+ return (
115
+ <div></div>
116
+ )
109
117
  return (
110
118
  <NotificationContainer />
111
119
  )
@@ -151,17 +159,22 @@ const SiteAside = () => {
151
159
  const SiteMenu = ({ logo, title, children, min }) => {
152
160
 
153
161
  const context = useContext(SiteContext)
154
- const { sideNav, showNav } = context
155
- const toggleIcon = sideNav === 'max' ? 'chevron_left' : 'chevron_right'
162
+ const { sideNav, setSideNav, showNav } = context
156
163
 
157
164
  useEffect(() => {
158
165
  if (min) context.setSideNav('min')
159
166
  }, [])
160
167
 
168
+ function toggle() {
169
+ const next = sideNav === 'max' ? 'min' : 'max'
170
+ setSideNav(next)
171
+ }
172
+
161
173
  const goto = (id) => {
162
174
  context.setShowNav(false)
163
175
  context.goto(id)
164
176
  }
177
+
165
178
  const sections = children ?
166
179
  Children.toArray(children).reduce((sections, page) => {
167
180
  const section = page.props ? page.props.section : '...'
@@ -171,18 +184,29 @@ const SiteMenu = ({ logo, title, children, min }) => {
171
184
  return sections
172
185
  }, {}) : {}
173
186
 
187
+
188
+ const style = sideNav === 'max' ? 'max' : 'min'
189
+ const toggleIcon = sideNav === 'max' ? 'chevron_left' : 'chevron_right'
174
190
  return (
175
- <menu className={`min ${showNav ? 'show' : ''}`}>
191
+ <menu className={`${style} ${showNav ? 'show' : ''}`}>
176
192
  <main >
177
193
  {Object.keys(sections).map(title => (
178
194
  <Fragment key={title}>
179
195
  {sections[title].map(({ id, icon = 'info', title }) => {
180
- return (<Icon key={id} icon={icon} clickable checked={id === context.page} action={() => goto(id)} />)
196
+ return (
197
+ <div className="site-menu-item" key={id} onClick={() => goto(id)}>
198
+ <Icon key={id} icon={icon} clickable checked={id === context.page} action={() => goto(id)} />
199
+ { sideNav === 'max' ? <label>{title}</label> : null }
200
+ </div>
201
+ )
181
202
  })}
182
203
  <div className="section-divider" ></div>
183
204
  </Fragment>
184
205
  ))}
185
206
  </main>
207
+ <footer>
208
+ <Icon icon={toggleIcon} clickable action={toggle} />
209
+ </footer>
186
210
  </menu>
187
211
  )
188
212
  }
@@ -0,0 +1,19 @@
1
+ import React, { useState } from 'react'
2
+ import { Site } from './site'
3
+ import { Page } from './page'
4
+ import './site.css'
5
+ import './page.css'
6
+
7
+ const SiteTest = (prop) => {
8
+
9
+ return (
10
+ <Site icon="star" title="Site Test" init={"PAGE1"}>
11
+ <Page id="PAGE1" section="SECTION1" icon="description" title="Page 1">
12
+ 111
13
+ </Page>
14
+ <Page id="PAGE2" section="SECTION1" icon="description" title="Page 2">
15
+ 222
16
+ </Page>
17
+ </Site>
18
+ )
19
+ }
@@ -195,7 +195,7 @@ const PlannerCell = ({ lane, events, date, disabled = false, onAdd, onDelete, on
195
195
  return (
196
196
  <div className={`cell ${weekend}`} onDragOver={onDragOver} onDragLeave={onDragLeave} onDrop={drop} onClick={select}>
197
197
  {events.map(event => {
198
- const { title, color, Renderer = EventCard } = event
198
+ const { Renderer = EventCard } = event
199
199
  return <Renderer event={event} />
200
200
  })}
201
201
  </div>