minitel-standalone
Advanced tools
Comparing version 1.9.6 to 1.10.0
@@ -14,2 +14,4 @@ import { MinitelObjectAttributes } from '../types.js'; | ||
disabled: boolean; | ||
onFocus: () => void; | ||
onBlur: () => void; | ||
} |
@@ -8,7 +8,7 @@ import { MinitelObject } from '../abstract/minitelobject.js'; | ||
constructor(children: never[] | undefined, attributes: Partial<T>, minitel: Minitel); | ||
getDimensions(attributes: ContainerAttributes, inheritMe: Partial<ContainerAttributes>): { | ||
getDimensions(attributes: T, inheritMe: Partial<T>): { | ||
width: number; | ||
height: number; | ||
}; | ||
render(attributes: ContainerAttributes, inheritMe: Partial<ContainerAttributes>): import("../richchargrid.js").RichCharGrid; | ||
render(attributes: T, inheritMe: Partial<T>): import("../richchargrid.js").RichCharGrid; | ||
} | ||
@@ -15,0 +15,0 @@ export interface ContainerAttributes extends MinitelObjectAttributes { |
@@ -49,2 +49,3 @@ import { MinitelObject } from '../abstract/minitelobject.js'; | ||
set focused(val) { | ||
var _a, _b, _c, _d; | ||
if (this._focused !== val) | ||
@@ -56,5 +57,7 @@ this.minitel.invalidateRender(); | ||
this._focused = true; | ||
(_b = (_a = this.attributes).onFocus) === null || _b === void 0 ? void 0 : _b.call(_a); | ||
} | ||
else { | ||
this._focused = false; | ||
(_d = (_c = this.attributes).onBlur) === null || _d === void 0 ? void 0 : _d.call(_c); | ||
} | ||
@@ -209,2 +212,2 @@ } | ||
} | ||
Input.defaultAttributes = Object.assign(Object.assign({}, MinitelObject.defaultAttributes), { fillChar: '.', width: 8, height: 1, type: 'text', autofocus: false, disabled: false, multiline: false, onChange: () => { }, onScroll: () => { } }); | ||
Input.defaultAttributes = Object.assign(Object.assign({}, MinitelObject.defaultAttributes), { fillChar: '.', width: 8, height: 1, type: 'text', autofocus: false, disabled: false, multiline: false, onFocus: () => { }, onBlur: () => { }, onChange: () => { }, onScroll: () => { } }); |
@@ -42,2 +42,4 @@ import { Focusable } from '../abstract/focusable.js'; | ||
blinkPeriod: number; | ||
onFocus: () => void; | ||
onBlur: () => void; | ||
} |
@@ -14,2 +14,3 @@ import { RichChar } from '../richchar.js'; | ||
set focused(val) { | ||
var _a, _b, _c, _d; | ||
if (this._focused !== val) | ||
@@ -21,5 +22,7 @@ this.minitel.invalidateRender(); | ||
this._focused = true; | ||
(_b = (_a = this.attributes).onFocus) === null || _b === void 0 ? void 0 : _b.call(_a); | ||
} | ||
else { | ||
this._focused = false; | ||
(_d = (_c = this.attributes).onBlur) === null || _d === void 0 ? void 0 : _d.call(_c); | ||
} | ||
@@ -235,2 +238,2 @@ } | ||
} | ||
Scrollable.defaultAttributes = Object.assign(Object.assign({}, Container.defaultAttributes), { overflowX: 'hidden', overflowY: 'auto', autofocus: false, disabled: false, scrollbarBackColor: 5, scrollbarColor: 7, blinkPeriod: 500, onScroll: () => { } }); | ||
Scrollable.defaultAttributes = Object.assign(Object.assign({}, Container.defaultAttributes), { overflowX: 'hidden', overflowY: 'auto', autofocus: false, disabled: false, scrollbarBackColor: 5, scrollbarColor: 7, blinkPeriod: 500, onScroll: () => { }, onFocus: () => { }, onBlur: () => { } }); |
@@ -7,2 +7,3 @@ export * from './abstract/textnode.js'; | ||
export * from './components/scrollable.js'; | ||
export * from './components/focusable.js'; | ||
export * from './components/xjoin.js'; | ||
@@ -9,0 +10,0 @@ export * from './components/yjoin.js'; |
@@ -7,2 +7,3 @@ export * from './abstract/textnode.js'; | ||
export * from './components/scrollable.js'; | ||
export * from './components/focusable.js'; | ||
export * from './components/xjoin.js'; | ||
@@ -9,0 +10,0 @@ export * from './components/yjoin.js'; |
{ | ||
"name": "minitel-standalone", | ||
"version": "1.9.6", | ||
"version": "1.10.0", | ||
"description": "A standalone package for minitel components", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -14,2 +14,4 @@ import { MinitelObjectAttributes } from '../types.js'; | ||
disabled: boolean; | ||
onFocus: () => void; | ||
onBlur: () => void; | ||
} |
@@ -21,3 +21,3 @@ import { MinitelObject } from '../abstract/minitelobject.js'; | ||
} | ||
getDimensions(attributes: ContainerAttributes, inheritMe: Partial<ContainerAttributes>): { width: number; height: number; } { | ||
getDimensions(attributes: T, inheritMe: Partial<T>): { width: number; height: number; } { | ||
return this.children[0].getDimensionsWrapper(inheritMe, { | ||
@@ -28,3 +28,3 @@ ...(attributes.width != null ? { width: attributes.width } : {}), | ||
} | ||
render(attributes: ContainerAttributes, inheritMe: Partial<ContainerAttributes>) { | ||
render(attributes: T, inheritMe: Partial<T>) { | ||
const fillChar = new RichChar(attributes.fillChar, attributes).noSize(); | ||
@@ -31,0 +31,0 @@ |
@@ -7,3 +7,2 @@ import { Focusable, FocusableAttributes } from '../abstract/focusable.js'; | ||
import type { Minitel } from './minitel.js'; | ||
import { Scrollable, ScrollableAttributes } from './scrollable.js'; | ||
@@ -23,2 +22,4 @@ export class Input | ||
multiline: false, | ||
onFocus: () => {}, | ||
onBlur: () => {}, | ||
onChange: () => {}, | ||
@@ -76,4 +77,6 @@ onScroll: () => {}, | ||
this._focused = true; | ||
this.attributes.onFocus?.(); | ||
} else { | ||
this._focused = false; | ||
this.attributes.onBlur?.(); | ||
} | ||
@@ -80,0 +83,0 @@ } |
@@ -18,2 +18,4 @@ import { Focusable } from '../abstract/focusable.js'; | ||
onScroll: () => {}, | ||
onFocus: () => {}, | ||
onBlur: () => {}, | ||
}; | ||
@@ -43,4 +45,6 @@ defaultAttributes = Scrollable.defaultAttributes; | ||
this._focused = true; | ||
this.attributes.onFocus?.(); | ||
} else { | ||
this._focused = false; | ||
this.attributes.onBlur?.(); | ||
} | ||
@@ -307,2 +311,4 @@ } | ||
blinkPeriod: number; | ||
onFocus: () => void; | ||
onBlur: () => void; | ||
} |
@@ -7,2 +7,3 @@ export * from './abstract/textnode.js'; | ||
export * from './components/scrollable.js'; | ||
export * from './components/focusable.js'; | ||
export * from './components/xjoin.js'; | ||
@@ -9,0 +10,0 @@ export * from './components/yjoin.js'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
218125
72
4720