2021-07-22 22:54:10 +02:00
|
|
|
/**
|
2021-08-13 23:26:18 +02:00
|
|
|
* EGroupware eTemplate2 - Textbox widget (WebComponent)
|
2021-07-22 22:54:10 +02:00
|
|
|
*
|
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
|
|
* @package etemplate
|
|
|
|
* @subpackage api
|
|
|
|
* @link https://www.egroupware.org
|
|
|
|
* @author Nathan Gray
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2021-08-27 08:13:36 +02:00
|
|
|
import {css, html} from "@lion/core";
|
|
|
|
import {LionInput} from "@lion/input";
|
2021-08-25 23:35:06 +02:00
|
|
|
import {Et2InputWidget} from "../Et2InputWidget/Et2InputWidget";
|
2021-07-22 22:54:10 +02:00
|
|
|
|
2021-08-26 20:59:13 +02:00
|
|
|
export class Et2Textbox extends Et2InputWidget(LionInput)
|
2021-07-22 22:54:10 +02:00
|
|
|
{
|
|
|
|
|
2021-08-13 23:26:18 +02:00
|
|
|
static get styles()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
...super.styles,
|
|
|
|
css`
|
|
|
|
/* Custom CSS */
|
|
|
|
`,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
static get properties()
|
|
|
|
{
|
|
|
|
return {
|
|
|
|
...super.properties,
|
2021-08-20 23:52:22 +02:00
|
|
|
onkeypress: Function,
|
2021-08-10 23:02:52 +02:00
|
|
|
}
|
2021-08-13 23:26:18 +02:00
|
|
|
}
|
2021-08-10 23:02:52 +02:00
|
|
|
|
2021-08-26 20:59:13 +02:00
|
|
|
constructor(...args : any[])
|
2021-08-13 23:26:18 +02:00
|
|
|
{
|
2021-08-26 20:59:13 +02:00
|
|
|
super(...args);
|
2021-08-13 23:26:18 +02:00
|
|
|
}
|
2021-08-10 23:02:52 +02:00
|
|
|
|
2021-08-13 23:26:18 +02:00
|
|
|
connectedCallback()
|
|
|
|
{
|
|
|
|
super.connectedCallback();
|
|
|
|
}
|
2021-12-10 21:24:06 +01:00
|
|
|
|
|
|
|
getValue()
|
|
|
|
{
|
|
|
|
if(this.readOnly)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return this.value;
|
|
|
|
}
|
2021-07-22 22:54:10 +02:00
|
|
|
}
|
2021-08-10 23:02:52 +02:00
|
|
|
|
2021-08-27 19:21:40 +02:00
|
|
|
// @ts-ignore TypeScript is not recognizing that Et2Textbox is a LitElement
|
2021-08-10 23:02:52 +02:00
|
|
|
customElements.define("et2-textbox", Et2Textbox);
|