Skip to content

Commit

Permalink
fix: added minlength. maxlength validation
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthramesh committed Jun 6, 2021
1 parent 56e5187 commit cf7d5bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
"build": "tsc && npm run manifest",
"prepublish": "npm run build",
"release": "standard-version -a",
"release": "npm run test && standard-version -a",
"postrelease": "git push --follow-tags origin master",
"manifest": "wca analyze src --format json --outFile ./dist/custom-elements.json && node web-component-manifest.mjs && wca analyze src --format json --outFile ./vscode-custom-data.json",
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
Expand Down Expand Up @@ -86,4 +86,4 @@
"singleQuote": true,
"arrowParens": "avoid"
}
}
}
8 changes: 8 additions & 0 deletions src/medblocks/text/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export default class MbInput extends EhrElement {

@property({ type: Number, reflect: true }) max: number;

@property({ type: Number, reflect: true }) minlength: number;

@property({ type: Number, reflect: true }) maxlength: number;

@event('mb-input')
_mbInput: EventEmitter<string>;

Expand All @@ -50,6 +54,8 @@ export default class MbInput extends EhrElement {
return this.textarea
? html`
<sl-textarea
maxlength=${this.maxlength}
minlength=${this.minlength}
?required=${this.required}
label=${this.label}
@sl-input=${this.handleInput}
Expand All @@ -60,6 +66,8 @@ export default class MbInput extends EhrElement {
<sl-input
min=${this.min}
max=${this.max}
maxlength=${this.maxlength}
minlength=${this.minlength}
type=${this.datatype as any}
?required=${this.required}
label=${this.label}
Expand Down

0 comments on commit cf7d5bd

Please sign in to comment.