stalefish 6.1.1 → 7.0.0

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/README.md CHANGED
@@ -1,4 +1,3 @@
1
1
  # stalefish
2
2
  Simple function based component library for hyperx/bel/halfcab/nanohtml tagged template literals
3
3
 
4
- - Requires the `esm` package (or node version with esm modules) for server side rendering as its only distributed as an ES module.
@@ -4,6 +4,7 @@ import clone from 'fast-clone'
4
4
 
5
5
  let cache = new LRU(300)
6
6
 
7
+ // language=CSS
7
8
  let styles = css`
8
9
  .textfield {
9
10
  padding: 10px;
@@ -104,9 +105,9 @@ class Textfield extends Component {
104
105
  this.oninput = args.oninput
105
106
  this.onchange = args.onchange
106
107
 
107
- let { highlightBorder = false, wrapperStyle = null, holdingPen, label, placeholder, property, required, pattern, type, autofocus, valueContext, permanentTopPlaceholder = false, permanentTopLabel = false, disabled } = args
108
+ let { highlightBorder = false, wrapperStyle = null, holdingPen, label, placeholder, property, required, pattern, type, autofocus, valueContext, permanentTopPlaceholder = false, permanentTopLabel = false, disabled, maxCharacters } = args
108
109
 
109
- let input = html`<input data-gramm="false" ${disabled ? { disabled } : ''} style="${disabled ? 'cursor: not-allowed; opacity: 0.3;' : ''}" class="${styles.textfield} ${fieldIsTouched(holdingPen, property) === true ? styles.touched : ''} ${highlightBorder ? styles.highlight : ''}" value="${holdingPen[property] || ''}" onkeyup=${e => this.onkeyup && this.onkeyup(e)} ${required ? { required: 'required' } : ''} onchange=${e => { change({ e, holdingPen, property, label: styles.label }); this.onchange && this.onchange(e) }} oninput=${e => { change({ e, holdingPen, property, label: styles.label }); this.oninput && this.oninput(e) }} onblur=${formField(holdingPen, property)} placeholder="${placeholder || ''}${required ? ' *' : ''}" type="${determineType(type)}" ${pattern ? { pattern } : ''} ${type.toLowerCase() === 'number' ? { step: determineStep(type) } : ''} />`
110
+ let input = html`<input data-gramm="false" ${disabled ? { disabled } : ''} ${maxCharacters ? { maxlength: maxCharacters } : ''} style="${disabled ? 'cursor: not-allowed; opacity: 0.3;' : ''}" class="${styles.textfield} ${fieldIsTouched(holdingPen, property) === true ? styles.touched : ''} ${highlightBorder ? styles.highlight : ''}" value="${holdingPen[property] !== undefined && holdingPen[property] !== null ? holdingPen[property] : ''}" onkeyup=${e => this.onkeyup && this.onkeyup(e)} ${required ? { required: 'required' } : ''} onchange=${e => { change({ e, holdingPen, property, label: styles.label }); this.onchange && this.onchange(e) }} oninput=${e => { change({ e, holdingPen, property, label: styles.label }); this.oninput && this.oninput(e) }} onblur=${formField(holdingPen, property)} placeholder="${placeholder || ''}${required ? ' *' : ''}" type="${determineType(type)}" ${pattern ? { pattern } : ''} ${type.toLowerCase() === 'number' ? { step: determineStep(type) } : ''} />`
110
111
 
111
112
  if (autofocus) {
112
113
  input.autofocus = true
package/package.json CHANGED
@@ -1,15 +1,13 @@
1
1
  {
2
2
  "name": "stalefish",
3
- "version": "6.1.1",
3
+ "version": "7.0.0",
4
4
  "description": "Simple function based component library for halfcab tagged template literals",
5
5
  "main": "index.mjs",
6
6
  "module": "index.mjs",
7
7
  "jsnext:main": "index.mjs",
8
- "@std/esm": true,
9
- "esm": true,
10
8
  "scripts": {
11
9
  "test": "npm run test:lint",
12
- "test:lint": "standard \"**/*.mjs\" --fix",
10
+ "test:lint": "standard \"**/*.mjs\"",
13
11
  "npm-publish": "npm publish",
14
12
  "versionbump:fix": "npm version patch --no-git-tag-version",
15
13
  "versionbump:feature": "npm version minor --no-git-tag-version",
@@ -32,11 +30,8 @@
32
30
  "url": "https://github.com/lorengreenfield/stalefish/issues"
33
31
  },
34
32
  "homepage": "https://github.com/lorengreenfield/stalefish#readme",
35
- "peerDependencies": {
36
- "halfcab": "^12.0.1"
37
- },
38
33
  "devDependencies": {
39
- "halfcab": "^12.0.1",
34
+ "halfcab": "^13.0.5",
40
35
  "standard": "^12.0.1"
41
36
  },
42
37
  "dependencies": {