stalefish 7.4.4 → 7.4.6

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.
@@ -7,7 +7,7 @@ import dropdown from './dropdown.mjs'
7
7
  import * as deepDiff from 'deep-object-diff'
8
8
  import clone from 'fast-clone'
9
9
 
10
- let cache = new LRU(300)
10
+ let cache = new LRU(2000)
11
11
 
12
12
  let styles = css`
13
13
  .panel h3 {
@@ -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
- <div 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; color: ${light ? '#555' : '#22487e'}">${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({
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
- </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>` : ''}
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
- ${collapsed === false ? typeof content === 'function' ? content() : content : ''}
84
- </div>` : ''
83
+ ${collapsed === false ? typeof content === 'function' ? content() : content : ''}
84
+ </div>` : ''
85
85
  }
86
86
 
87
87
  update (args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stalefish",
3
- "version": "7.4.4",
3
+ "version": "7.4.6",
4
4
  "description": "Simple function based component library for halfcab tagged template literals",
5
5
  "main": "index.mjs",
6
6
  "module": "index.mjs",