File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed
exampleVault/Input Fields
src/inputFields/_new/fields/Text Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 11---
2- text : test
2+ text : alnsdksdnfknfnjksdbfhjdf
33textArea : textArea
44---
55
@@ -8,6 +8,10 @@ textArea: textArea
88INPUT[text(showcase):text]
99```
1010
11+ ``` meta-bind
12+ INPUT[text(showcase, limit(10)):text]
13+ ```
14+
1115### Text Area
1216``` meta-bind
1317INPUT[text_area(showcase, class(meta-bind-full-width), class(meta-bind-high)):textArea]
Original file line number Diff line number Diff line change 77 export function setValue(v : string ): void {
88 value = v ;
99 }
10+
11+ function getLimitString(length : number , limit : number ) {
12+ const limitStr = limit .toString ();
13+ const lengthStr = length .toString ().padStart (limitStr .length , ' 0' );
14+ return ` ${lengthStr }/${limitStr } ` ;
15+ }
1016 </script >
1117
1218<input type ='text' tabindex ='0' placeholder ={placeholder } bind:value ={value } maxlength ={limit }
1319 on:input ={() => onValueChange (value )}>
20+ {#if limit !== undefined }
21+ <span class ={` mb-content-limit-indicator ${value .length > limit ? ' mb-content-limit-indicator-overflow' : ' ' } ` } >{getLimitString (value .length , limit )}</span >
22+ {/if }
Original file line number Diff line number Diff line change @@ -58,6 +58,16 @@ div.mb-view-wrapper {
5858 color : var (--text-muted );
5959}
6060
61+ /* Text Input */
62+ .mb-content-limit-indicator {
63+ color : var (--text-muted );
64+ font-size : var (--font-ui-small );
65+ }
66+
67+ .mb-content-limit-indicator-overflow {
68+ color : var (--color-red );
69+ }
70+
6171/* Select Input */
6272.mb-select-input-element {
6373 cursor : pointer;
You can’t perform that action at this time.
0 commit comments