@things-factory/more-ui 8.0.0-beta.1 → 8.0.0-beta.4

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": "@things-factory/more-ui",
3
- "version": "8.0.0-beta.1",
3
+ "version": "8.0.0-beta.4",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -28,8 +28,8 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@operato/layout": "^8.0.0-beta",
31
- "@things-factory/apptool-base": "^8.0.0-beta.1",
32
- "@things-factory/more-base": "^8.0.0-beta.1"
31
+ "@things-factory/apptool-base": "^8.0.0-beta.4",
32
+ "@things-factory/more-base": "^8.0.0-beta.4"
33
33
  },
34
- "gitHead": "36c494e587640c1490318ef7b95adab02606e0c2"
34
+ "gitHead": "d83d12ed4ba07177dff1dac26e37be347d156b43"
35
35
  }
@@ -1,38 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import './layout/more-panel'
3
-
4
- import { html } from 'lit-html'
5
-
6
- import { appendViewpart, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION } from '@operato/layout'
7
- import { store } from '@operato/shell'
8
-
9
- import { APPEND_APP_TOOL } from '@things-factory/apptool-base/client'
10
-
11
- export default function bootstrap() {
12
- appendViewpart({
13
- name: 'more',
14
- viewpart: {
15
- show: false,
16
- hovering: 'edge',
17
- template: html` <more-panel></more-panel> `
18
- },
19
- position: VIEWPART_POSITION.ASIDEBAR
20
- })
21
-
22
- store.dispatch({
23
- type: APPEND_APP_TOOL,
24
- tool: {
25
- name: 'more',
26
- template: html`
27
- <md-icon
28
- @click=${e =>
29
- toggleOverlay('more', {
30
- backdrop: true
31
- })}
32
- >more_vert</md-icon
33
- >
34
- `,
35
- position: TOOL_POSITION.REAR_END
36
- }
37
- })
38
- }
package/client/index.ts DELETED
File without changes
@@ -1,95 +0,0 @@
1
- import { TOOL_POSITION } from '@operato/layout'
2
- import { css, html, nothing, LitElement, TemplateResult } from 'lit'
3
- import { customElement, property, query } from 'lit/decorators.js'
4
-
5
- @customElement('more-let')
6
- class MoreLet extends LitElement {
7
- static styles = [
8
- css`
9
- :host {
10
- display: flex;
11
- flex-direction: column;
12
- padding: var(--morelet-padding);
13
-
14
- min-width: var(--morelet-min-width);
15
- color: var(--morelet-title-color, var(--md-sys-color-on-secondary-fixed, rgb(211 233 254)));
16
- border-bottom: var(--morelet-border-bottom);
17
- font: var(--morelet-title-font);
18
- }
19
-
20
- #morelet {
21
- display: none;
22
- width: calc(100% - 18px);
23
- margin-top: 5px;
24
- padding: 5px 9px;
25
- border-bottom-right-radius: 7px;
26
- border-bottom-left-radius: 7px;
27
-
28
- border-top: var(--morelet-focus-border-top);
29
- background-color: var(--morelet-background-color);
30
- color: var(--morelet-color, var(--md-sys-color-on-secondary-fixed, rgb(211 233 254)));
31
- font: var(--morelet-font);
32
-
33
- [opened] {
34
- display: block;
35
- }
36
- }
37
-
38
- [header] {
39
- opacity: 0.8;
40
-
41
- &:hover {
42
- opacity: 1;
43
- cursor: pointer;
44
- }
45
-
46
- [icon] {
47
- --md-icon-size: 1.2em;
48
- vertical-align: middle;
49
- }
50
-
51
- [titler] {
52
- text-transform: capitalize;
53
- }
54
- }
55
- `
56
- ]
57
-
58
- @property({ type: Object }) morenda?: {
59
- position: TOOL_POSITION
60
- icon: string
61
- name: string
62
- template: TemplateResult
63
- action?: () => void
64
- }
65
-
66
- @query('#morelet') morelet?: HTMLDivElement
67
-
68
- render() {
69
- const morenda = this.morenda
70
-
71
- if (!morenda) {
72
- return nothing
73
- }
74
-
75
- return html`
76
- <div @click=${e => this.onTitleClick()} header>
77
- <span icon> ${morenda.icon ? morenda.icon : html``} </span>
78
-
79
- <span titler>${morenda.name}</span>
80
- </div>
81
-
82
- ${morenda.template ? html` <div id="morelet">${morenda.template}</div> ` : html``}
83
- `
84
- }
85
-
86
- private onTitleClick() {
87
- const morenda = this.morenda!
88
-
89
- if (morenda.template) {
90
- this.morelet?.toggleAttribute('opened')
91
- } else if (morenda.action) {
92
- morenda.action()
93
- }
94
- }
95
- }
@@ -1,90 +0,0 @@
1
- import './more-let'
2
-
3
- import { css, html, LitElement, TemplateResult } from 'lit'
4
- import { customElement, state } from 'lit/decorators.js'
5
- import { connect } from 'pwa-helpers/connect-mixin.js'
6
-
7
- import { store } from '@operato/shell'
8
- import { TOOL_POSITION } from '@operato/layout'
9
- import { ScrollbarStyles } from '@operato/styles'
10
-
11
- @customElement('more-panel')
12
- class MorePanel extends connect(store)(LitElement) {
13
- static styles = [
14
- ScrollbarStyles,
15
- css`
16
- :host {
17
- display: flex;
18
- flex-direction: column;
19
-
20
- height: 100%;
21
- min-width: var(--more-panel-min-width);
22
- user-select: none;
23
- }
24
-
25
- :host(:focus) {
26
- outline: none;
27
- }
28
-
29
- div[body] {
30
- flex: 1;
31
- overflow-y: auto;
32
- background-color: var(--more-panel-background-color, var(--md-sys-color-secondary-fixed-dim, rgb(47 88 128)));
33
- padding: var(--spacing-medium);
34
- }
35
-
36
- div[head] {
37
- background-color: var(--more-panel-head-color, var(--md-sys-color-secondary-fixed-dim, rgb(47 88 128)));
38
- }
39
-
40
- div[tail] {
41
- margin-top: auto;
42
- background-color: var(--more-panel-tail-color, var(--md-sys-color-secondary-fixed-dim, rgb(47 88 128)));
43
- }
44
-
45
- @media only screen and (max-width: 460px) {
46
- :host {
47
- min-width: 90vw;
48
- }
49
- }
50
- `
51
- ]
52
-
53
- @state() private more?: {
54
- morendas: {
55
- position: TOOL_POSITION
56
- icon: string
57
- name: string
58
- template: TemplateResult
59
- action?: () => void
60
- }[]
61
- heads: {
62
- template: TemplateResult
63
- }[]
64
- tails: {
65
- template: TemplateResult
66
- }[]
67
- }
68
-
69
- render() {
70
- var { morendas, heads, tails } = this.more || {}
71
-
72
- morendas = [
73
- ...(morendas || []).filter(morenda => morenda.position == TOOL_POSITION.FRONT_END),
74
- ...(morendas || []).filter(morenda => morenda.position == TOOL_POSITION.FRONT),
75
- ...(morendas || []).filter(morenda => !morenda.position || morenda.position == TOOL_POSITION.CENTER),
76
- ...(morendas || []).filter(morenda => morenda.position == TOOL_POSITION.REAR),
77
- ...(morendas || []).filter(morenda => morenda.position == TOOL_POSITION.REAR_END)
78
- ]
79
-
80
- return html`
81
- <div head>${(heads || []).map(template => template)}</div>
82
- <div body>${(morendas || []).map(morenda => html` <more-let .morenda=${morenda}></more-let> `)}</div>
83
- <div tail>${(tails || []).map(template => template)}</div>
84
- `
85
- }
86
-
87
- stateChanged(state) {
88
- this.more = state.more
89
- }
90
- }
@@ -1,24 +0,0 @@
1
- body {
2
- --more-panel-background-color: var(--md-sys-color-secondary-fixed-dim);
3
- --more-panel-head-color: var(--more-panel-background-color);
4
- --more-panel-tail-color: var(--more-panel-background-color);
5
- --more-panel-min-width: 200px;
6
-
7
- --morelet-min-width: 200px;
8
- --morelet-title-color: var(--md-sys-color-on-secondary-fixed);
9
- --morelet-title-font: normal 14px var(--theme-font);
10
- --morelet-border-bottom: 1px solid rgba(255, 255, 255, 0.15);
11
- --morelet-focus-border-top: 3px solid var(--md-sys-color-primary);
12
- --morelet-background-color: var(--md-sys-color-surface);
13
- --morelet-padding: var(--padding-default) var(--padding-narrow) var(--padding-narrow) var(--padding-default);
14
- --morelet-color: var(--md-sys-color-on-secondary-fixed);
15
- --morelet-font: normal 0.9em/1.4em var(--theme-font);
16
- --morelet-icon-color: var(--md-sys-color-on-primary);
17
- }
18
-
19
- @media screen and (max-width: 460px) {
20
- body {
21
- --morelet-padding: var(--padding-wide);
22
- --morelet-font: normal 1em/0.9em var(--theme-font);
23
- }
24
- }
package/server/index.ts DELETED
File without changes