@things-factory/shell 4.2.12 → 4.3.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.
@@ -1,4 +1,4 @@
1
- import { css } from 'lit-element'
1
+ import { css } from 'lit'
2
2
 
3
3
  export const AppStyle = css`
4
4
  :host {
@@ -9,6 +9,7 @@ export const AppStyle = css`
9
9
  grid-template-areas: var(--app-grid-template-area, 'header header header' 'nav main aside' 'nav footer aside');
10
10
  grid-gap: var(--app-grid-gap, 0em);
11
11
 
12
+ max-width: 100vw;
12
13
  width: 100vw;
13
14
  height: 100vh;
14
15
  }
package/client/app/app.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import '@operato/layout'
2
2
 
3
- import { html, LitElement } from 'lit'
4
- import { connect } from 'pwa-helpers/connect-mixin.js'
5
- import { installRouter } from 'pwa-helpers/router.js'
3
+ import { LitElement, html } from 'lit'
4
+ import { UPDATE_ACTIVE_PAGE, UPDATE_CONTEXT_PATH, UPDATE_MODULES, navigateWithSilence, store } from '@operato/shell'
6
5
 
7
- import { navigateWithSilence, store, UPDATE_ACTIVE_PAGE, UPDATE_CONTEXT_PATH, UPDATE_MODULES } from '@operato/shell'
6
+ import { AppStyle } from './app-style'
8
7
  import { ScrollbarStyles } from '@operato/styles'
8
+ import { connect } from 'pwa-helpers/connect-mixin.js'
9
9
  import { getPathInfo } from '@operato/utils'
10
-
11
- import { AppStyle } from './app-style'
10
+ import { installRouter } from 'pwa-helpers/router.js'
11
+ import throttle from 'lodash-es/throttle'
12
12
 
13
13
  class ThingsApp extends connect(store)(LitElement) {
14
14
  static get properties() {
@@ -56,6 +56,8 @@ class ThingsApp extends connect(store)(LitElement) {
56
56
  connectedCallback() {
57
57
  super.connectedCallback()
58
58
 
59
+ window.addEventListener('resize', () => this.resized())
60
+
59
61
  /* 모듈 임포트를 동적으로 처리한다. */
60
62
  import(
61
63
  /* webpackPrefetch: true */
@@ -111,6 +113,22 @@ class ThingsApp extends connect(store)(LitElement) {
111
113
  this.setBase()
112
114
  }
113
115
 
116
+ resized() {
117
+ if (!this._throttledResize) {
118
+ this._throttledResize = throttle(() => {
119
+ const aside = this.renderRoot.querySelector('ox-aside-bar').clientWidth
120
+ const nav = this.renderRoot.querySelector('ox-nav-bar').clientWidth
121
+
122
+ this.style.setProperty(
123
+ '--app-grid-template-columns',
124
+ `auto minmax(calc(100vw - ${aside}px - ${nav}px), 1fr) auto`
125
+ )
126
+ }, 100)
127
+ }
128
+
129
+ this._throttledResize()
130
+ }
131
+
114
132
  routeToPage() {
115
133
  let activePages = this.shadowRoot.querySelectorAll('main > .page[active]')
116
134
  activePages.forEach(page => {
@@ -165,6 +183,8 @@ class ThingsApp extends connect(store)(LitElement) {
165
183
  if (changedProps.has('_contextPath')) {
166
184
  this.setBase()
167
185
  }
186
+
187
+ this.resized()
168
188
  }
169
189
 
170
190
  shouldUpdate() {
@@ -1,4 +1,4 @@
1
- import { css, html } from 'lit-element'
1
+ import { css, html } from 'lit'
2
2
 
3
3
  import { PageView } from '@operato/shell'
4
4
 
@@ -1,4 +1,4 @@
1
- import { LitElement, html, css } from 'lit-element'
1
+ import { LitElement, html, css } from 'lit'
2
2
 
3
3
  import '@material/mwc-icon'
4
4
 
@@ -1,4 +1,4 @@
1
- import { html, LitElement } from 'lit-element'
1
+ import { html, LitElement } from 'lit'
2
2
 
3
3
  import { subscribe } from '@operato/graphql'
4
4
 
@@ -1,4 +1,4 @@
1
- import { LitElement, html, css } from 'lit-element'
1
+ import { LitElement, html, css } from 'lit'
2
2
 
3
3
  export class OopsSpinner extends LitElement {
4
4
  static get styles() {
@@ -1,7 +1,7 @@
1
1
  import '@material/mwc-icon-button'
2
2
  import '@material/mwc-button'
3
3
 
4
- import { css, html, LitElement } from 'lit-element'
4
+ import { css, html, LitElement } from 'lit'
5
5
 
6
6
  export class HomePage extends LitElement {
7
7
  static get styles() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/shell",
3
- "version": "4.2.12",
3
+ "version": "4.3.0",
4
4
  "description": "Core module for framework",
5
5
  "bin": {
6
6
  "things-factory": "bin/things-factory",
@@ -44,16 +44,16 @@
44
44
  "@material/mwc-icon-button": "^0.25.3",
45
45
  "@material/mwc-slider": "^0.25.3",
46
46
  "@material/mwc-textfield": "^0.25.3",
47
- "@operato/board": "^0.3.28",
48
- "@operato/graphql": "^0.3.28",
49
- "@operato/help": "^0.3.28",
50
- "@operato/layout": "^0.3.28",
51
- "@operato/shell": "^0.3.28",
52
- "@operato/utils": "^0.3.28",
47
+ "@operato/board": "^0.4.3",
48
+ "@operato/graphql": "^0.4.3",
49
+ "@operato/help": "^0.4.3",
50
+ "@operato/layout": "^0.4.3",
51
+ "@operato/shell": "^0.4.3",
52
+ "@operato/utils": "^0.4.3",
53
53
  "@things-factory/ejs-remote": "^4.1.40",
54
54
  "@things-factory/env": "^4.1.40",
55
- "@things-factory/styles": "^4.1.40",
56
- "@things-factory/utils": "^4.1.40",
55
+ "@things-factory/styles": "^4.3.0",
56
+ "@things-factory/utils": "^4.3.0",
57
57
  "@webcomponents/webcomponentsjs": "^2.6.0",
58
58
  "@webpack-contrib/schema-utils": "^1.0.0-beta.0",
59
59
  "apollo-server-core": "^3.5.0",
@@ -92,9 +92,10 @@
92
92
  "koa-static": "^5.0.0",
93
93
  "koa-unless": "^1.0.7",
94
94
  "koa2-connect-history-api-fallback": "^0.1.2",
95
- "lit": "^2.0.2",
95
+ "lit": "^2.2.0",
96
96
  "loader-utils": "^2.0.0",
97
97
  "lodash": "^4.17.15",
98
+ "lodash-es": "^4.17.15",
98
99
  "mkdirp": "^1.0.3",
99
100
  "mqtt": "^4.3.4",
100
101
  "node-fetch": "^2.6.0",
@@ -128,5 +129,5 @@
128
129
  "resolutions": {
129
130
  "core-js": "^3.16.0"
130
131
  },
131
- "gitHead": "fea26f2ea238a3a279c7ab6427cd8aedcd68926b"
132
+ "gitHead": "772c8e6f56a3dda655ad49f7018a49a37e081ee8"
132
133
  }