stalefish 7.4.3 → 7.4.5
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/components/panel.mjs +18 -18
- package/package.json +1 -1
package/components/panel.mjs
CHANGED
|
@@ -49,7 +49,7 @@ class Panel extends Component {
|
|
|
49
49
|
this.collapseToggleAction = args.collapseToggleAction
|
|
50
50
|
this.closeAction = args.closeAction
|
|
51
51
|
|
|
52
|
-
let { chevronStyle = null, on = true, content, heading = '', collapsed = false, thinBorder = false, light = false, optionsMenu } = args
|
|
52
|
+
let { chevronStyle = null, on = true, content, heading = '', collapsed = false, thinBorder = false, light = false, optionsMenu, tooltipHeading = false } = args
|
|
53
53
|
|
|
54
54
|
return on ? html`<div ondragover=${e => {
|
|
55
55
|
if (this.dragOverAction) {
|
|
@@ -57,15 +57,15 @@ class Panel extends Component {
|
|
|
57
57
|
e.dataTransfer.dropEffect = 'move'
|
|
58
58
|
}
|
|
59
59
|
}} class="${styles.panel}" style='box-sizing: border-box; position: relative; top: 0; left: 0; text-align: left; box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12); border: solid ${thinBorder ? '3px' : '5px'} ${light ? '#DDD' : '#4371AD'}; background-color: #FBFBFB;'>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
<div title="${tooltipHeading && collapsed ? heading : ''}" style="position: relative;" ondragleave="${e => this.dragLeaveAction && this.dragLeaveAction(e)}" ondragend="${e => this.dragEndAction && this.dragEndAction(e)}" ondragover="${e => this.dragOverAction && this.dragOverAction(e)}" ondragstart="${e => this.dragStartAction && this.dragStartAction(e)}" draggable="${this.draggable ? 'true' : ''}" >
|
|
61
|
+
${heading ? html`<div class="${styles.header}" onclick=${e => this.headerAction && this.headerAction(e)}>
|
|
62
|
+
<h3 style="margin: 12px; max-width: calc(100% - ${optionsMenu ? '70' : '50'}px); color: ${light ? '#555;' : '#22487e'} ${collapsed ? 'text-overflow: ellipsis; white-space: nowrap; overflow: hidden;' : ''}">${heading}</h3>
|
|
63
|
+
|
|
64
|
+
${optionsMenu ? html`<div style="position: absolute; right: 45px; top: 13px;">
|
|
65
|
+
<div style="user-select: none; -ms-user-select: none; -webkit-user-select: none; -moz-user-select: none; cursor: pointer; width: 24px; height: 24px;" onclick=${optionsMenu.action} aria-label="Options menu">
|
|
66
|
+
${moreVertical({ colour: '#ccc' })}
|
|
67
|
+
</div>
|
|
68
|
+
${dropdown({
|
|
69
69
|
side: 'right',
|
|
70
70
|
width: '200px',
|
|
71
71
|
margin: '5px',
|
|
@@ -73,15 +73,15 @@ class Panel extends Component {
|
|
|
73
73
|
menuItems: optionsMenu.menuItems,
|
|
74
74
|
backgroundColour: 'white'
|
|
75
75
|
})}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
</div>` : ''}
|
|
77
|
+
</div>` : ''}
|
|
78
|
+
</div>
|
|
79
|
+
${this.closeAction && !this.collapseToggleAction ? html`<div style="position: absolute; width: 20px; height: 20px; right: 5px; top: 5px; cursor: pointer;" onclick=${this.closeAction}><div style="display: flex; justify-content: center; align-items: center;">${close({ colour: '#22487e' })}</div></div>` : ''}
|
|
80
|
+
|
|
81
|
+
${this.collapseToggleAction ? html`<div ${chevronStyle ? { 'class': chevronStyle } : ''} style="position: absolute; width: 50px; height: 50px; right: 0; margin-top: -3px; top: 5px; cursor: pointer;" onclick=${this.collapseToggleAction}><div style="display: flex; justify-content: center; align-items: center;">${collapsed ? down({ colour: light ? '#999' : '#22487e', width: '40px', height: '50px' }) : up({ colour: light ? '#999' : '#22487e', width: '40px', height: '40px' })}</div></div>` : ''}
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
</div>` : ''
|
|
83
|
+
${collapsed === false ? typeof content === 'function' ? content() : content : ''}
|
|
84
|
+
</div>` : ''
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
update (args) {
|