@things-factory/apptool-ui 10.1.279 → 10.1.281

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 +1 @@
1
- import '@material/web/progress/linear-progress.js';
1
+ export {};
@@ -1,28 +1,66 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
- import '@material/web/progress/linear-progress.js';
3
- import { css, html, LitElement } from 'lit';
2
+ import { css, html, LitElement, nothing } from 'lit';
4
3
  import { customElement, state } from 'lit/decorators.js';
5
4
  import { store } from '@operato/shell';
5
+ /**
6
+ * The one reading bar of the app, right under the header: a thin accent sweep while any request is out
7
+ * (store busy, counted by the graphql link). It takes no room - the page does not move when it shows.
8
+ * Screens do not draw their own (ox-page-state only says a refresh to a screen reader).
9
+ * It shows after half a second, so a quick answer does not flicker it.
10
+ */
6
11
  let AppBusyBar = class AppBusyBar extends LitElement {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.busy = false;
15
+ this.lastState = false;
16
+ }
7
17
  static { this.styles = [
8
18
  css `
9
19
  :host {
10
20
  display: block;
11
21
  position: relative;
12
-
13
- --md-linear-progress-track-color: var(--md-sys-color-on-primary);
22
+ height: 0;
23
+ z-index: 2;
14
24
  }
15
25
 
16
- md-linear-progress {
26
+ .bar {
17
27
  position: absolute;
18
- bottom: 0;
19
- width: 100%;
28
+ top: 0;
29
+ left: 0;
30
+ right: 0;
31
+ height: 2px;
20
32
  overflow: hidden;
33
+ pointer-events: none;
34
+ background: linear-gradient(
35
+ 90deg,
36
+ transparent,
37
+ var(--ui-accent, var(--md-sys-color-primary, #00727e)),
38
+ transparent
39
+ );
40
+ background-size: 50% 100%;
41
+ background-repeat: no-repeat;
42
+ animation: sweep 1s linear infinite;
43
+ }
44
+
45
+ @keyframes sweep {
46
+ from {
47
+ background-position: -50% 0;
48
+ }
49
+ to {
50
+ background-position: 150% 0;
51
+ }
52
+ }
53
+
54
+ @media (prefers-reduced-motion: reduce) {
55
+ .bar {
56
+ animation: none;
57
+ background-position: 50% 0;
58
+ }
21
59
  }
22
60
  `
23
61
  ]; }
24
62
  render() {
25
- return this.busy ? html `<md-linear-progress indeterminate></md-linear-progress>` : html ``;
63
+ return this.busy ? html `<div class="bar" aria-hidden="true"></div>` : nothing;
26
64
  }
27
65
  connectedCallback() {
28
66
  super.connectedCallback();
@@ -34,33 +72,23 @@ let AppBusyBar = class AppBusyBar extends LitElement {
34
72
  this._unsubscribe?.();
35
73
  }
36
74
  _applyState() {
37
- const __state__ = store.getState();
38
- if (!__state__.busy.busy) {
75
+ const busy = !!store.getState().busy.busy;
76
+ if (!busy)
39
77
  this.busy = false;
40
- }
41
- this.lastState = __state__.busy.busy;
78
+ this.lastState = busy;
42
79
  if (!this.timeout) {
43
80
  this.timeout = setTimeout(() => {
44
- if (this.lastState) {
81
+ if (this.lastState)
45
82
  this.busy = true;
46
- }
47
83
  this.timeout = null;
48
84
  }, 500);
49
85
  }
50
86
  }
51
87
  };
52
- __decorate([
53
- state(),
54
- __metadata("design:type", Boolean)
55
- ], AppBusyBar.prototype, "busy", void 0);
56
- __decorate([
57
- state(),
58
- __metadata("design:type", Boolean)
59
- ], AppBusyBar.prototype, "lastState", void 0);
60
88
  __decorate([
61
89
  state(),
62
90
  __metadata("design:type", Object)
63
- ], AppBusyBar.prototype, "timeout", void 0);
91
+ ], AppBusyBar.prototype, "busy", void 0);
64
92
  AppBusyBar = __decorate([
65
93
  customElement('app-busybar')
66
94
  ], AppBusyBar);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/apptool-ui",
3
- "version": "10.1.279",
3
+ "version": "10.1.281",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "files": [
@@ -47,8 +47,8 @@
47
47
  "@operato/shell": "^10.29.60",
48
48
  "@operato/styles": "^10.29.81",
49
49
  "@operato/utils": "^10.29.43",
50
- "@things-factory/apptool-base": "^10.1.279",
51
- "@things-factory/setting-base": "^10.1.279"
50
+ "@things-factory/apptool-base": "^10.1.281",
51
+ "@things-factory/setting-base": "^10.1.281"
52
52
  },
53
- "gitHead": "666c08055c408b408fde961ad10da080941b147c"
53
+ "gitHead": "c872f4723dcd72808f3c60a7d6c95521d4c2bbca"
54
54
  }