fixing the fix, missed the camelCase of Et2Checkbox and changed Et2Checkbox so IDE can check it

This commit is contained in:
ralf 2024-07-06 09:06:58 +02:00
parent 2fa7fa9a45
commit a893669641
3 changed files with 13 additions and 24 deletions

View File

@ -14,6 +14,7 @@ import {Et2InputWidget} from "../Et2InputWidget/Et2InputWidget";
import '../Et2Image/Et2Image';
import {SlCheckbox} from "@shoelace-style/shoelace";
import shoelace from "../Styles/shoelace";
import {property} from "lit/decorators/property.js";
export class Et2Checkbox extends Et2InputWidget(SlCheckbox)
{
@ -59,31 +60,21 @@ export class Et2Checkbox extends Et2InputWidget(SlCheckbox)
];
}
static get properties()
{
return {
...super.properties,
/* Different value when checked */
selectedValue: {type: String},
/* Different value when unchecked */
unselectedValue: {type: String}
}
}
@property({type: String})
selectedValue = 'true';
@property({type: String})
unselectedValue = '';
constructor()
{
super();
this.isSlComponent = true;
this.selectedValue = 'true';
this.unselectedValue = '';
}
connectedCallback()
{
super.connectedCallback();
}
get label()

View File

@ -22,7 +22,7 @@ import {egw, IegwAppLocal} from "../jsapi/egw_global";
import {et2_cloneObject, et2_csvSplit} from "./et2_core_common";
import {et2_compileLegacyJS} from "./et2_core_legacyJSFunctions";
import {et2_IDOMNode, et2_IInputNode} from "./et2_core_interfaces";
import {loadWebComponent} from "./Et2Widget/Et2Widget";
import {loadWebComponent,Et2Widget} from "./Et2Widget/Et2Widget";
// fixing circular dependencies by only importing type
import type {et2_container} from "./et2_core_baseWidget";
import type {et2_inputWidget} from "./et2_core_inputWidget";
@ -460,7 +460,7 @@ export class et2_widget extends ClassWithAttributes
*
* @param _id is the id you're searching for
*/
getWidgetById(_id): et2_widget | null
getWidgetById(_id): Et2Widget | et2_widget | null
{
if (this.id == _id)
{
@ -480,7 +480,7 @@ export class et2_widget extends ClassWithAttributes
if (this.id && _id.indexOf('[') > -1 && this._children.length)
{
var ids = (new et2_arrayMgr()).explodeKey(_id);
var widget: et2_widget = this;
var widget: Et2Widget | et2_widget = this;
for (var i = 0; i < ids.length && widget !== null; i++)
{
widget = widget.getWidgetById(ids[i]);

View File

@ -37,14 +37,11 @@ import {et2_selectbox} from "../../api/js/etemplate/et2_widget_selectbox";
import {et2_widget} from "../../api/js/etemplate/et2_core_widget";
import {et2_nextmatch} from "../../api/js/etemplate/et2_extension_nextmatch";
import {et2_iframe} from "../../api/js/etemplate/et2_widget_iframe";
// @ts-ignore
import {date} from "../../api/js/etemplate/lib/date.js";
import {sprintf} from "../../api/js/egw_action/egw_action_common";
import {egw_registerGlobalShortcut, egw_unregisterGlobalShortcut} from "../../api/js/egw_action/egw_keymanager";
import {egw, egw_getFramework} from "../../api/js/jsapi/egw_global";
import {et2_number} from "../../api/js/etemplate/et2_widget_number";
import {et2_template} from "../../api/js/etemplate/et2_widget_template";
import {et2_checkbox} from "../../api/js/etemplate/et2_widget_checkbox";
import {et2_grid} from "../../api/js/etemplate/et2_widget_grid";
import {Et2Textbox} from "../../api/js/etemplate/Et2Textbox/Et2Textbox";
import "./SidemenuDate";
@ -59,6 +56,7 @@ import {et2_IInput} from "../../api/js/etemplate/et2_core_interfaces";
import {Et2DateTime} from "../../api/js/etemplate/Et2Date/Et2DateTime";
import {Et2Select} from "../../api/js/etemplate/Et2Select/Et2Select";
import type {SelectOption} from "../../api/js/etemplate/Et2Select/FindSelectOptions";
import type {Et2Checkbox} from "../../api/js/etemplate/Et2Checkbox/Et2Checkbox";
/**
* UI for calendar
@ -2266,9 +2264,9 @@ export class CalendarApp extends EgwApp
const content : any = this.et2.getArrayMgr('content').data;
const start_date = this.et2.getValueById('start');
const end_date = this.et2.getValueById('end');
const whole_day = <et2_checkbox> this.et2.getWidgetById('whole_day');
const whole_day = <Et2Checkbox>this.et2.getWidgetById('whole_day');
const duration = ''+this.et2.getValueById('duration');
const is_whole_day = whole_day && whole_day.value == whole_day.selected_value;
const is_whole_day = whole_day && whole_day.value == whole_day.selectedValue;
const button = _button;
const that = this;
@ -4264,7 +4262,7 @@ export class CalendarApp extends EgwApp
{
if (content.grid[i] != null)
{
checkbox = <et2_checkbox> this.et2.getWidgetById(i+'[enable]');
checkbox = <Et2Checkbox>this.et2.getWidgetById(i+'[enable]');
if (checkbox)
{
checkbox.set_value(_widget.checked);
@ -4302,7 +4300,7 @@ export class CalendarApp extends EgwApp
*/
public videoconferenceOnChange(event)
{
let widget = <et2_checkbox> this.et2.getWidgetById('videoconference');
let widget = <Et2Checkbox>this.et2.getWidgetById('videoconference');
if (widget && widget.get_value())
{