diff --git a/api/js/etemplate/Et2Checkbox/Et2Checkbox.ts b/api/js/etemplate/Et2Checkbox/Et2Checkbox.ts index 8e6460c42b..0b4c6693c7 100644 --- a/api/js/etemplate/Et2Checkbox/Et2Checkbox.ts +++ b/api/js/etemplate/Et2Checkbox/Et2Checkbox.ts @@ -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() diff --git a/api/js/etemplate/et2_core_widget.ts b/api/js/etemplate/et2_core_widget.ts index 8f0d1c6f7d..b87d0e7b13 100644 --- a/api/js/etemplate/et2_core_widget.ts +++ b/api/js/etemplate/et2_core_widget.ts @@ -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]); diff --git a/calendar/js/app.ts b/calendar/js/app.ts index 4ec218d0e8..b714da75b1 100644 --- a/calendar/js/app.ts +++ b/calendar/js/app.ts @@ -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 @@ -2245,14 +2243,14 @@ export class CalendarApp extends EgwApp */ move_edit_series(_DOM,_button) { - var content : any = this.et2.getArrayMgr('content').data; - var start_date = this.et2.getValueById('start'); - var end_date = this.et2.getValueById('end'); - var whole_day = this.et2.getWidgetById('whole_day'); - var duration = ''+this.et2.getValueById('duration'); - var is_whole_day = whole_day && whole_day.value == whole_day.selected_value; - var button = _button; - var that = this; + 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 = this.et2.getWidgetById('whole_day'); + const duration = ''+this.et2.getValueById('duration'); + const is_whole_day = whole_day && whole_day.value == whole_day.selectedValue; + const button = _button; + const that = this; let instance_date_regex = window.location.search.match(/date=(\d{4}-\d{2}-\d{2}(?:.+Z)?)/); let instance_date; @@ -4246,7 +4244,7 @@ export class CalendarApp extends EgwApp { if (content.grid[i] != null) { - checkbox = this.et2.getWidgetById(i+'[enable]'); + checkbox = this.et2.getWidgetById(i+'[enable]'); if (checkbox) { checkbox.set_value(_widget.checked); @@ -4284,7 +4282,7 @@ export class CalendarApp extends EgwApp */ public videoconferenceOnChange(event) { - let widget = this.et2.getWidgetById('videoconference'); + let widget = this.et2.getWidgetById('videoconference'); if (widget && widget.get_value()) {