@things-factory/print-ui 9.2.5 → 10.0.0-beta.10

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,15 +1,13 @@
1
1
  import '@material/web/icon/icon.js'
2
2
 
3
3
  import { html, LitElement } from 'lit'
4
- import { connect } from 'pwa-helpers/connect-mixin'
5
-
6
4
  import { UPDATE_VIEWPART } from '@operato/layout'
7
5
  import { ContextToolbarOverlayStyle } from '@operato/context/ox-context-toolbar-overlay-style.js'
8
6
  import { store } from '@operato/shell'
9
7
  import { i18next } from '@operato/i18n'
10
8
  import { print } from '@things-factory/print-base'
11
9
 
12
- class PrintContextTemplate extends connect(store)(LitElement) {
10
+ class PrintContextTemplate extends LitElement {
13
11
  static get properties() {
14
12
  return {
15
13
  _context: Object,
@@ -65,10 +63,36 @@ class PrintContextTemplate extends connect(store)(LitElement) {
65
63
  `
66
64
  }
67
65
 
68
- stateChanged(state) {
69
- this._printers = state.print.printers
70
- this._staticPrinters = state.print.staticPrinters
71
- this._context = state.route.context
66
+ private _unsubscribe?: () => void
67
+
68
+
69
+ connectedCallback() {
70
+
71
+ super.connectedCallback()
72
+
73
+ this._applyState()
74
+
75
+ this._unsubscribe = store.subscribe(() => this._applyState())
76
+
77
+ }
78
+
79
+
80
+ disconnectedCallback() {
81
+
82
+ super.disconnectedCallback()
83
+
84
+ this._unsubscribe?.()
85
+
86
+ }
87
+
88
+
89
+ private _applyState() {
90
+
91
+ const __state__ = store.getState() as any
92
+ this._printers = __state__.print.printers
93
+ this._staticPrinters = __state__.print.staticPrinters
94
+ this._context = __state__.route.context
95
+
72
96
  }
73
97
 
74
98
  async _onPrintOut(printer) {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@things-factory/print-ui",
3
- "version": "9.2.5",
3
+ "version": "10.0.0-beta.10",
4
4
  "main": "dist-server/index.js",
5
- "browser": "client/index.js",
5
+ "browser": "client/index.ts",
6
6
  "things-factory": true,
7
7
  "author": "",
8
8
  "description": "User interface for showing printer options.",
@@ -24,10 +24,10 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create ./server/migrations/migration"
25
25
  },
26
26
  "dependencies": {
27
- "@operato/layout": "^9.0.0",
28
- "@things-factory/context-ui": "^9.2.5",
29
- "@things-factory/i18n-base": "^9.2.5",
30
- "@things-factory/print-base": "^9.2.5"
27
+ "@operato/layout": "^10.0.0-beta.1",
28
+ "@things-factory/context-ui": "^10.0.0-beta.10",
29
+ "@things-factory/i18n-base": "^10.0.0-beta.10",
30
+ "@things-factory/print-base": "^10.0.0-beta.10"
31
31
  },
32
- "gitHead": "d3622f475ae3bab84322d31b064cc4cda20f7062"
32
+ "gitHead": "95acadd39e9a0ff3b2f34d9f7082142395903179"
33
33
  }
File without changes
File without changes