flinker-dom 1.1.3 → 1.1.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.
@@ -182,6 +182,10 @@ export class UIComponent {
182
182
  this.dom.addEventListener('input', callback);
183
183
  return this;
184
184
  }
185
+ onChange(callback) {
186
+ this.dom.addEventListener('change', callback);
187
+ return this;
188
+ }
185
189
  }
186
190
  export const vstackMapper = (s) => {
187
191
  const halign = s.halign ?? 'left';
@@ -641,7 +645,13 @@ export const image = () => {
641
645
  export class Input extends UIComponent {
642
646
  bind(rx) {
643
647
  this.unsubscribeColl.push(rx.pipe()
644
- .onReceive(v => this.dom.value = v)
648
+ .onReceive(v => {
649
+ this.dom.value = v;
650
+ if (this.props.autoResize) {
651
+ this.dom.style.height = 'auto';
652
+ this.dom.style.height = this.dom.scrollHeight + 'px';
653
+ }
654
+ })
645
655
  .subscribe());
646
656
  this.onInput((e) => rx.value = e.target.value);
647
657
  return this;
@@ -39,6 +39,7 @@ export declare class UIComponent<P extends UIComponentProps> {
39
39
  onBlur(callback: (event: FocusEvent) => void): this;
40
40
  onFocus(callback: (event: FocusEvent) => void): this;
41
41
  onInput(callback: (event: Event) => void): this;
42
+ onChange(callback: (event: Event) => void): this;
42
43
  }
43
44
  export type StackHAlign = 'left' | 'right' | 'center' | 'stretch';
44
45
  export type StackVAlign = 'top' | 'center' | 'base' | 'bottom' | 'stretch';
@@ -140,6 +141,7 @@ export interface InputProps extends UIComponentProps {
140
141
  caretColor?: string;
141
142
  autoFocus?: boolean;
142
143
  spellCheck?: boolean;
144
+ autoResize?: boolean;
143
145
  autoCorrect?: TurnType;
144
146
  autoComplete?: TurnType;
145
147
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "flinker-dom",
3
3
  "description": "Free TypeScript library for writing frontend apps",
4
- "version": "1.1.3",
4
+ "version": "1.1.5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/Dittner/FlinkerDOM.git"