diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/GridItemModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/GridItemModifier.ts new file mode 100644 index 0000000000000000000000000000000000000000..d608f870ad5a88c1d3346c11c1fc36c071299427 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/GridItemModifier.ts @@ -0,0 +1,321 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AttributeModifier } from './component/common'; +import { ScrollableCommonMethodModifier } from './ScrollableCommonMethodModifier'; +import { AttributeUpdaterFlag, CommonMethodModifier } from './CommonMethodModifier'; +import { ArkGridItemPeer, GridItemAttribute } from './component/gridItem'; +import { CommonMethod, Bindable } from './component/common'; +export class GridItemModifier extends CommonMethodModifier implements GridItemAttribute, AttributeModifier { + _instanceId: number = -1; + setInstanceId(instanceId: number): void { + this._instanceId = instanceId; + } + isUpdater: () => boolean = () => false; + applyNormalAttribute(instance: GridItemAttribute): void {} + applyPressedAttribute(instance: GridItemAttribute): void {} + applyFocusedAttribute(instance: GridItemAttribute): void {} + applyDisabledAttribute(instance: GridItemAttribute): void {} + applySelectedAttribute(instance: GridItemAttribute): void {} + _rowStart_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _rowStart_0_0value?: number | undefined; + _rowEnd_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _rowEnd_0_0value?: number | undefined; + _columnStart_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _columnStart_0_0value?: number | undefined; + _columnEnd_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _columnEnd_0_0value?: number | undefined; + _selectable_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _selectable_0_0value?: boolean | undefined; + _selected_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _selected_0_0value?: boolean | Bindable | undefined; + _onSelect_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onSelect_0_0value?: ((isSelected: boolean) => void) | undefined; + applyModifierPatch(peer: ArkGridItemPeer): void { + super.applyModifierPatch(peer); + if (this._rowStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._rowStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.rowStartAttribute(this._rowStart_0_0value as number | undefined); + this._rowStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._rowStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._rowStart_0_flag = AttributeUpdaterFlag.INITIAL; + peer.rowStartAttribute(undefined as number | undefined); + } + } + } + if (this._rowEnd_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._rowEnd_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.rowEndAttribute(this._rowEnd_0_0value as number | undefined); + this._rowEnd_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._rowEnd_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._rowEnd_0_flag = AttributeUpdaterFlag.INITIAL; + peer.rowEndAttribute(undefined as number | undefined); + } + } + } + if (this._columnStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._columnStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.columnStartAttribute(this._columnStart_0_0value as number | undefined); + this._columnStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._columnStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._columnStart_0_flag = AttributeUpdaterFlag.INITIAL; + peer.columnStartAttribute(undefined as number | undefined); + } + } + } + if (this._columnEnd_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._columnEnd_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.columnEndAttribute(this._columnEnd_0_0value as number | undefined); + this._columnEnd_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._columnEnd_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._columnEnd_0_flag = AttributeUpdaterFlag.INITIAL; + peer.columnEndAttribute(undefined as number | undefined); + } + } + } + if (this._selectable_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._selectable_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.selectableAttribute(this._selectable_0_0value as boolean | undefined); + this._selectable_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._selectable_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._selectable_0_flag = AttributeUpdaterFlag.INITIAL; + peer.selectableAttribute(undefined as boolean | undefined); + } + } + } + if (this._selected_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._selected_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + if (typeof this._selectable_0_flag == 'boolean' || typeof this._selectable_0_flag == 'undefined') { + // need to add bindable + peer.selectedAttribute(this._selected_0_0value as boolean | undefined); + } + this._selected_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._selected_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._selected_0_flag = AttributeUpdaterFlag.INITIAL; + peer.selectedAttribute(undefined as boolean | undefined); + } + } + } + if (this._onSelect_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onSelect_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onSelectAttribute(this._onSelect_0_0value as ((isSelected: boolean) => void) | undefined); + this._onSelect_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onSelect_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onSelect_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onSelectAttribute(undefined as ((isSelected: boolean) => void) | undefined); + } + } + } + } + mergeModifier(modifier: GridItemModifier): void { + super.mergeModifier(modifier); + if (modifier._rowStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._rowStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.rowStart(modifier._rowStart_0_0value); + break; + } + default: { + this.rowStart(undefined as number | undefined); + } + } + } + if (modifier._rowEnd_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._rowEnd_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.rowEnd(modifier._rowEnd_0_0value); + break; + } + default: { + this.rowEnd(undefined as number | undefined); + } + } + } + if (modifier._columnStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._columnStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.columnStart(modifier._columnStart_0_0value); + break; + } + default: { + this.columnStart(undefined as number | undefined); + } + } + } + if (modifier._columnEnd_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._columnEnd_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.columnEnd(modifier._columnEnd_0_0value); + break; + } + default: { + this.columnEnd(undefined as number | undefined); + } + } + } + if (modifier._selectable_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._selectable_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.selectable(modifier._selectable_0_0value); + break; + } + default: { + this.selectable(undefined as boolean | undefined); + } + } + } + if (modifier._selected_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._selected_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.selected(modifier._selected_0_0value); + break; + } + default: { + this.selected(undefined as boolean | Bindable | undefined); + } + } + } + if (modifier._onSelect_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onSelect_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onSelect(modifier._onSelect_0_0value); + break; + } + default: { + this.onSelect(undefined as ((isSelected: boolean) => void) | undefined); + } + } + } + } + rowStart(value: number | undefined): this { + if (this._rowStart_0_flag == AttributeUpdaterFlag.INITIAL || this._rowStart_0_0value !== value) { + this._rowStart_0_flag = AttributeUpdaterFlag.UPDATE; + this._rowStart_0_0value = value; + } else { + this._rowStart_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + rowEnd(value: number | undefined): this { + if (this._rowEnd_0_flag == AttributeUpdaterFlag.INITIAL || this._rowEnd_0_0value !== value) { + this._rowEnd_0_flag = AttributeUpdaterFlag.UPDATE; + this._rowEnd_0_0value = value; + } else { + this._rowEnd_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + columnStart(value: number | undefined): this { + if (this._columnStart_0_flag == AttributeUpdaterFlag.INITIAL || this._columnStart_0_0value !== value) { + this._columnStart_0_flag = AttributeUpdaterFlag.UPDATE; + this._columnStart_0_0value = value; + } else { + this._columnStart_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + columnEnd(value: number | undefined): this { + if (this._columnEnd_0_flag == AttributeUpdaterFlag.INITIAL || this._columnEnd_0_0value !== value) { + this._columnEnd_0_flag = AttributeUpdaterFlag.UPDATE; + this._columnEnd_0_0value = value; + } else { + this._columnEnd_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + selectable(value: boolean | undefined): this { + if (this._selectable_0_flag == AttributeUpdaterFlag.INITIAL || this._selectable_0_0value !== value) { + this._selectable_0_flag = AttributeUpdaterFlag.UPDATE; + this._selectable_0_0value = value; + } else { + this._selectable_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + selected(value: boolean | Bindable | undefined): this { + if (this._selected_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._selected_0_flag = AttributeUpdaterFlag.UPDATE; + this._selected_0_0value = value; + } else { + this._selected_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onSelect(value: ((isSelected: boolean) => void) | undefined): this { + if (this._onSelect_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onSelect_0_flag = AttributeUpdaterFlag.UPDATE; + this._onSelect_0_0value = value; + } else { + this._onSelect_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/GridModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/GridModifier.ts new file mode 100644 index 0000000000000000000000000000000000000000..cc616e0687af034f42f4f13490fd90843194b533 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/GridModifier.ts @@ -0,0 +1,1013 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! + +import { ScrollableCommonMethodModifier } from './ScrollableCommonMethodModifier'; +import { AttributeUpdaterFlag, CommonMethodModifier } from './CommonMethodModifier'; +import { ArkGridPeer, ComputedBarAttribute, GridDirection, GridItemAlignment, GridAttribute } from './component/grid'; +import { CustomBuilder, ItemDragInfo, OnWillScrollCallback, OnScrollCallback, AttributeModifier } from './component/common'; +import { Length } from './component/units'; +import { OnScrollFrameBeginCallback } from './component/scroll'; +export class GridModifier extends ScrollableCommonMethodModifier implements GridAttribute, AttributeModifier { + _instanceId: number = -1; + setInstanceId(instanceId: number): void { + this._instanceId = instanceId; + } + isUpdater: () => boolean = () => false; + applyNormalAttribute(instance: GridAttribute): void {} + applyPressedAttribute(instance: GridAttribute): void {} + applyFocusedAttribute(instance: GridAttribute): void {} + applyDisabledAttribute(instance: GridAttribute): void {} + applySelectedAttribute(instance: GridAttribute): void {} + _columnsTemplate_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _columnsTemplate_0_0value?: string | undefined; + _rowsTemplate_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _rowsTemplate_0_0value?: string | undefined; + _columnsGap_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _columnsGap_0_0value?: Length | undefined; + _rowsGap_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _rowsGap_0_0value?: Length | undefined; + _onScrollBarUpdate_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollBarUpdate_0_0value?: ((index: number, offset: number) => ComputedBarAttribute) | undefined; + _onScrollIndex_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollIndex_0_0value?: ((first: number, last: number) => void) | undefined; + _cachedCount_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _cachedCount_0_0value?: number | undefined; + _editMode_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _editMode_0_0value?: boolean | undefined; + _multiSelectable_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _multiSelectable_0_0value?: boolean | undefined; + _maxCount_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _maxCount_0_0value?: number | undefined; + _minCount_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _minCount_0_0value?: number | undefined; + _cellLength_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _cellLength_0_0value?: number | undefined; + _layoutDirection_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _layoutDirection_0_0value?: GridDirection | undefined; + _supportAnimation_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _supportAnimation_0_0value?: boolean | undefined; + _onItemDragStart_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onItemDragStart_0_0value?: ((event: ItemDragInfo, itemIndex: number) => CustomBuilder) | undefined; + _onItemDragEnter_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onItemDragEnter_0_0value?: ((event: ItemDragInfo) => void) | undefined; + _onItemDragMove_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onItemDragMove_0_0value?: ((event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | undefined; + _onItemDragLeave_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onItemDragLeave_0_0value?: ((event: ItemDragInfo, itemIndex: number) => void) | undefined; + _onItemDrop_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onItemDrop_0_0value?: ((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | undefined; + _alignItems_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _alignItems_0_0value?: GridItemAlignment | undefined; + _onScrollFrameBegin_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollFrameBegin_0_0value?: OnScrollFrameBeginCallback | undefined; + _onWillScroll_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onWillScroll_0_0value?: OnWillScrollCallback | undefined; + _onDidScroll_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onDidScroll_0_0value?: OnScrollCallback | undefined; + _cachedCount_1_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _cachedCount_1_0value?: number | undefined; + _cachedCount_1_1value?: boolean | undefined; + applyModifierPatch(peer: ArkGridPeer): void { + super.applyModifierPatch(peer); + if (this._columnsTemplate_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._columnsTemplate_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.columnsTemplateAttribute(this._columnsTemplate_0_0value as string | undefined); + this._columnsTemplate_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._columnsTemplate_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._columnsTemplate_0_flag = AttributeUpdaterFlag.INITIAL; + peer.columnsTemplateAttribute(undefined as string | undefined); + } + } + } + if (this._rowsTemplate_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._rowsTemplate_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.rowsTemplateAttribute(this._rowsTemplate_0_0value as string | undefined); + this._rowsTemplate_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._rowsTemplate_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._rowsTemplate_0_flag = AttributeUpdaterFlag.INITIAL; + peer.rowsTemplateAttribute(undefined as string | undefined); + } + } + } + if (this._columnsGap_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._columnsGap_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.columnsGapAttribute(this._columnsGap_0_0value as Length | undefined); + this._columnsGap_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._columnsGap_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._columnsGap_0_flag = AttributeUpdaterFlag.INITIAL; + peer.columnsGapAttribute(undefined as Length | undefined); + } + } + } + if (this._rowsGap_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._rowsGap_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.rowsGapAttribute(this._rowsGap_0_0value as Length | undefined); + this._rowsGap_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._rowsGap_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._rowsGap_0_flag = AttributeUpdaterFlag.INITIAL; + peer.rowsGapAttribute(undefined as Length | undefined); + } + } + } + if (this._onScrollBarUpdate_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollBarUpdate_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollBarUpdateAttribute( + this._onScrollBarUpdate_0_0value as ((index: number, offset: number) => ComputedBarAttribute) | undefined + ); + this._onScrollBarUpdate_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollBarUpdate_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollBarUpdate_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollBarUpdateAttribute(undefined as ((index: number, offset: number) => ComputedBarAttribute) | undefined); + } + } + } + if (this._onScrollIndex_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollIndex_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollIndexAttribute(this._onScrollIndex_0_0value as ((first: number, last: number) => void) | undefined); + this._onScrollIndex_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollIndex_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollIndex_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollIndexAttribute(undefined as ((first: number, last: number) => void) | undefined); + } + } + } + if (this._cachedCount_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._cachedCount_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.cachedCount0Attribute(this._cachedCount_0_0value as number | undefined); + this._cachedCount_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._cachedCount_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._cachedCount_0_flag = AttributeUpdaterFlag.INITIAL; + peer.cachedCount0Attribute(undefined as number | undefined); + } + } + } + if (this._editMode_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._editMode_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.editModeAttribute(this._editMode_0_0value as boolean | undefined); + this._editMode_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._editMode_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._editMode_0_flag = AttributeUpdaterFlag.INITIAL; + peer.editModeAttribute(undefined as boolean | undefined); + } + } + } + if (this._multiSelectable_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._multiSelectable_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.multiSelectableAttribute(this._multiSelectable_0_0value as boolean | undefined); + this._multiSelectable_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._multiSelectable_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._multiSelectable_0_flag = AttributeUpdaterFlag.INITIAL; + peer.multiSelectableAttribute(undefined as boolean | undefined); + } + } + } + if (this._maxCount_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._maxCount_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.maxCountAttribute(this._maxCount_0_0value as number | undefined); + this._maxCount_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._maxCount_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._maxCount_0_flag = AttributeUpdaterFlag.INITIAL; + peer.maxCountAttribute(undefined as number | undefined); + } + } + } + if (this._minCount_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._minCount_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.minCountAttribute(this._minCount_0_0value as number | undefined); + this._minCount_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._minCount_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._minCount_0_flag = AttributeUpdaterFlag.INITIAL; + peer.minCountAttribute(undefined as number | undefined); + } + } + } + if (this._cellLength_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._cellLength_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.cellLengthAttribute(this._cellLength_0_0value as number | undefined); + this._cellLength_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._cellLength_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._cellLength_0_flag = AttributeUpdaterFlag.INITIAL; + peer.cellLengthAttribute(undefined as number | undefined); + } + } + } + if (this._layoutDirection_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._layoutDirection_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.layoutDirectionAttribute(this._layoutDirection_0_0value as GridDirection | undefined); + this._layoutDirection_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._layoutDirection_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._layoutDirection_0_flag = AttributeUpdaterFlag.INITIAL; + peer.layoutDirectionAttribute(undefined as GridDirection | undefined); + } + } + } + if (this._supportAnimation_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._supportAnimation_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.supportAnimationAttribute(this._supportAnimation_0_0value as boolean | undefined); + this._supportAnimation_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._supportAnimation_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._supportAnimation_0_flag = AttributeUpdaterFlag.INITIAL; + peer.supportAnimationAttribute(undefined as boolean | undefined); + } + } + } + if (this._onItemDragStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onItemDragStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onItemDragStartAttribute( + this._onItemDragStart_0_0value as ((event: ItemDragInfo, itemIndex: number) => CustomBuilder) | undefined + ); + this._onItemDragStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onItemDragStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onItemDragStart_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onItemDragStartAttribute(undefined as ((event: ItemDragInfo, itemIndex: number) => CustomBuilder) | undefined); + } + } + } + if (this._onItemDragEnter_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onItemDragEnter_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onItemDragEnterAttribute(this._onItemDragEnter_0_0value as ((event: ItemDragInfo) => void) | undefined); + this._onItemDragEnter_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onItemDragEnter_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onItemDragEnter_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onItemDragEnterAttribute(undefined as ((event: ItemDragInfo) => void) | undefined); + } + } + } + if (this._onItemDragMove_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onItemDragMove_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onItemDragMoveAttribute( + this._onItemDragMove_0_0value as ((event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | undefined + ); + this._onItemDragMove_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onItemDragMove_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onItemDragMove_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onItemDragMoveAttribute(undefined as ((event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | undefined); + } + } + } + if (this._onItemDragLeave_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onItemDragLeave_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onItemDragLeaveAttribute(this._onItemDragLeave_0_0value as ((event: ItemDragInfo, itemIndex: number) => void) | undefined); + this._onItemDragLeave_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onItemDragLeave_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onItemDragLeave_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onItemDragLeaveAttribute(undefined as ((event: ItemDragInfo, itemIndex: number) => void) | undefined); + } + } + } + if (this._onItemDrop_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onItemDrop_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onItemDropAttribute(this._onItemDrop_0_0value as ((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | undefined); + this._onItemDrop_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onItemDrop_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onItemDrop_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onItemDropAttribute( + undefined as ((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | undefined + ); + } + } + } + if (this._alignItems_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._alignItems_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.alignItemsAttribute(this._alignItems_0_0value as GridItemAlignment | undefined); + this._alignItems_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._alignItems_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._alignItems_0_flag = AttributeUpdaterFlag.INITIAL; + peer.alignItemsAttribute(undefined as GridItemAlignment | undefined); + } + } + } + if (this._onScrollFrameBegin_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollFrameBegin_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollFrameBeginAttribute(this._onScrollFrameBegin_0_0value as OnScrollFrameBeginCallback | undefined); + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollFrameBeginAttribute(undefined as OnScrollFrameBeginCallback | undefined); + } + } + } + if (this._onWillScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onWillScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onWillScrollAttribute(this._onWillScroll_0_0value as OnWillScrollCallback | undefined); + this._onWillScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onWillScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onWillScroll_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onWillScrollAttribute(undefined as OnWillScrollCallback | undefined); + } + } + } + if (this._onDidScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onDidScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onDidScrollAttribute(this._onDidScroll_0_0value as OnScrollCallback | undefined); + this._onDidScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onDidScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onDidScroll_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onDidScrollAttribute(undefined as OnScrollCallback | undefined); + } + } + } + if (this._cachedCount_1_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._cachedCount_1_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.cachedCount1Attribute(this._cachedCount_1_0value as number | undefined, this._cachedCount_1_1value as boolean | undefined); + this._cachedCount_1_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._cachedCount_1_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._cachedCount_1_flag = AttributeUpdaterFlag.INITIAL; + peer.cachedCount1Attribute(undefined as number | undefined, undefined as boolean | undefined); + } + } + } + } + mergeModifier(modifier: GridModifier): void { + super.mergeModifier(modifier); + if (modifier._columnsTemplate_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._columnsTemplate_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.columnsTemplate(modifier._columnsTemplate_0_0value); + break; + } + default: { + this.columnsTemplate(undefined as string | undefined); + } + } + } + if (modifier._rowsTemplate_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._rowsTemplate_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.rowsTemplate(modifier._rowsTemplate_0_0value); + break; + } + default: { + this.rowsTemplate(undefined as string | undefined); + } + } + } + if (modifier._columnsGap_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._columnsGap_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.columnsGap(modifier._columnsGap_0_0value); + break; + } + default: { + this.columnsGap(undefined as Length | undefined); + } + } + } + if (modifier._rowsGap_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._rowsGap_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.rowsGap(modifier._rowsGap_0_0value); + break; + } + default: { + this.rowsGap(undefined as Length | undefined); + } + } + } + if (modifier._onScrollBarUpdate_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollBarUpdate_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollBarUpdate(modifier._onScrollBarUpdate_0_0value); + break; + } + default: { + this.onScrollBarUpdate(undefined as ((index: number, offset: number) => ComputedBarAttribute) | undefined); + } + } + } + if (modifier._onScrollIndex_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollIndex_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollIndex(modifier._onScrollIndex_0_0value); + break; + } + default: { + this.onScrollIndex(undefined as ((first: number, last: number) => void) | undefined); + } + } + } + if (modifier._cachedCount_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._cachedCount_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.cachedCount(modifier._cachedCount_0_0value); + break; + } + default: { + this.cachedCount(undefined as number | undefined); + } + } + } + if (modifier._editMode_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._editMode_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.editMode(modifier._editMode_0_0value); + break; + } + default: { + this.editMode(undefined as boolean | undefined); + } + } + } + if (modifier._multiSelectable_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._multiSelectable_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.multiSelectable(modifier._multiSelectable_0_0value); + break; + } + default: { + this.multiSelectable(undefined as boolean | undefined); + } + } + } + if (modifier._maxCount_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._maxCount_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.maxCount(modifier._maxCount_0_0value); + break; + } + default: { + this.maxCount(undefined as number | undefined); + } + } + } + if (modifier._minCount_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._minCount_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.minCount(modifier._minCount_0_0value); + break; + } + default: { + this.minCount(undefined as number | undefined); + } + } + } + if (modifier._cellLength_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._cellLength_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.cellLength(modifier._cellLength_0_0value); + break; + } + default: { + this.cellLength(undefined as number | undefined); + } + } + } + if (modifier._layoutDirection_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._layoutDirection_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.layoutDirection(modifier._layoutDirection_0_0value); + break; + } + default: { + this.layoutDirection(undefined as GridDirection | undefined); + } + } + } + if (modifier._supportAnimation_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._supportAnimation_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.supportAnimation(modifier._supportAnimation_0_0value); + break; + } + default: { + this.supportAnimation(undefined as boolean | undefined); + } + } + } + if (modifier._onItemDragStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onItemDragStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onItemDragStart(modifier._onItemDragStart_0_0value); + break; + } + default: { + this.onItemDragStart(undefined as ((event: ItemDragInfo, itemIndex: number) => CustomBuilder) | undefined); + } + } + } + if (modifier._onItemDragEnter_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onItemDragEnter_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onItemDragEnter(modifier._onItemDragEnter_0_0value); + break; + } + default: { + this.onItemDragEnter(undefined as ((event: ItemDragInfo) => void) | undefined); + } + } + } + if (modifier._onItemDragMove_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onItemDragMove_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onItemDragMove(modifier._onItemDragMove_0_0value); + break; + } + default: { + this.onItemDragMove(undefined as ((event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | undefined); + } + } + } + if (modifier._onItemDragLeave_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onItemDragLeave_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onItemDragLeave(modifier._onItemDragLeave_0_0value); + break; + } + default: { + this.onItemDragLeave(undefined as ((event: ItemDragInfo, itemIndex: number) => void) | undefined); + } + } + } + if (modifier._onItemDrop_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onItemDrop_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onItemDrop(modifier._onItemDrop_0_0value); + break; + } + default: { + this.onItemDrop( + undefined as ((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | undefined + ); + } + } + } + if (modifier._alignItems_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._alignItems_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.alignItems(modifier._alignItems_0_0value); + break; + } + default: { + this.alignItems(undefined as GridItemAlignment | undefined); + } + } + } + if (modifier._onScrollFrameBegin_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollFrameBegin_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollFrameBegin(modifier._onScrollFrameBegin_0_0value); + break; + } + default: { + this.onScrollFrameBegin(undefined as OnScrollFrameBeginCallback | undefined); + } + } + } + if (modifier._onWillScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onWillScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onWillScroll(modifier._onWillScroll_0_0value); + break; + } + default: { + this.onWillScroll(undefined as OnWillScrollCallback | undefined); + } + } + } + if (modifier._onDidScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onDidScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onDidScroll(modifier._onDidScroll_0_0value); + break; + } + default: { + this.onDidScroll(undefined as OnScrollCallback | undefined); + } + } + } + if (modifier._cachedCount_1_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._cachedCount_1_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.cachedCount(modifier._cachedCount_1_0value, modifier._cachedCount_1_1value); + break; + } + default: { + this.cachedCount(undefined as number | undefined, undefined as boolean | undefined); + } + } + } + } + columnsTemplate(value: string | undefined): this { + if (this._columnsTemplate_0_flag == AttributeUpdaterFlag.INITIAL || this._columnsTemplate_0_0value !== value) { + this._columnsTemplate_0_flag = AttributeUpdaterFlag.UPDATE; + this._columnsTemplate_0_0value = value; + } else { + this._columnsTemplate_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + rowsTemplate(value: string | undefined): this { + if (this._rowsTemplate_0_flag == AttributeUpdaterFlag.INITIAL || this._rowsTemplate_0_0value !== value) { + this._rowsTemplate_0_flag = AttributeUpdaterFlag.UPDATE; + this._rowsTemplate_0_0value = value; + } else { + this._rowsTemplate_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + columnsGap(value: Length | undefined): this { + if (this._columnsGap_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._columnsGap_0_flag = AttributeUpdaterFlag.UPDATE; + this._columnsGap_0_0value = value; + } else { + this._columnsGap_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + rowsGap(value: Length | undefined): this { + if (this._rowsGap_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._rowsGap_0_flag = AttributeUpdaterFlag.UPDATE; + this._rowsGap_0_0value = value; + } else { + this._rowsGap_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollBarUpdate(value: ((index: number, offset: number) => ComputedBarAttribute) | undefined): this { + if (this._onScrollBarUpdate_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollBarUpdate_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollBarUpdate_0_0value = value; + } else { + this._onScrollBarUpdate_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollIndex(value: ((first: number, last: number) => void) | undefined): this { + if (this._onScrollIndex_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollIndex_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollIndex_0_0value = value; + } else { + this._onScrollIndex_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + cachedCount(value: number | undefined): this { + if (this._cachedCount_0_flag == AttributeUpdaterFlag.INITIAL || this._cachedCount_0_0value !== value) { + this._cachedCount_0_flag = AttributeUpdaterFlag.UPDATE; + this._cachedCount_0_0value = value; + } else { + this._cachedCount_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + editMode(value: boolean | undefined): this { + if (this._editMode_0_flag == AttributeUpdaterFlag.INITIAL || this._editMode_0_0value !== value) { + this._editMode_0_flag = AttributeUpdaterFlag.UPDATE; + this._editMode_0_0value = value; + } else { + this._editMode_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + multiSelectable(value: boolean | undefined): this { + if (this._multiSelectable_0_flag == AttributeUpdaterFlag.INITIAL || this._multiSelectable_0_0value !== value) { + this._multiSelectable_0_flag = AttributeUpdaterFlag.UPDATE; + this._multiSelectable_0_0value = value; + } else { + this._multiSelectable_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + maxCount(value: number | undefined): this { + if (this._maxCount_0_flag == AttributeUpdaterFlag.INITIAL || this._maxCount_0_0value !== value) { + this._maxCount_0_flag = AttributeUpdaterFlag.UPDATE; + this._maxCount_0_0value = value; + } else { + this._maxCount_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + minCount(value: number | undefined): this { + if (this._minCount_0_flag == AttributeUpdaterFlag.INITIAL || this._minCount_0_0value !== value) { + this._minCount_0_flag = AttributeUpdaterFlag.UPDATE; + this._minCount_0_0value = value; + } else { + this._minCount_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + cellLength(value: number | undefined): this { + if (this._cellLength_0_flag == AttributeUpdaterFlag.INITIAL || this._cellLength_0_0value !== value) { + this._cellLength_0_flag = AttributeUpdaterFlag.UPDATE; + this._cellLength_0_0value = value; + } else { + this._cellLength_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + layoutDirection(value: GridDirection | undefined): this { + if (this._layoutDirection_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._layoutDirection_0_flag = AttributeUpdaterFlag.UPDATE; + this._layoutDirection_0_0value = value; + } else { + this._layoutDirection_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + supportAnimation(value: boolean | undefined): this { + if (this._supportAnimation_0_flag == AttributeUpdaterFlag.INITIAL || this._supportAnimation_0_0value !== value) { + this._supportAnimation_0_flag = AttributeUpdaterFlag.UPDATE; + this._supportAnimation_0_0value = value; + } else { + this._supportAnimation_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onItemDragStart(value: ((event: ItemDragInfo, itemIndex: number) => CustomBuilder) | undefined): this { + if (this._onItemDragStart_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onItemDragStart_0_flag = AttributeUpdaterFlag.UPDATE; + this._onItemDragStart_0_0value = value; + } else { + this._onItemDragStart_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onItemDragEnter(value: ((event: ItemDragInfo) => void) | undefined): this { + if (this._onItemDragEnter_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onItemDragEnter_0_flag = AttributeUpdaterFlag.UPDATE; + this._onItemDragEnter_0_0value = value; + } else { + this._onItemDragEnter_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onItemDragMove(value: ((event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | undefined): this { + if (this._onItemDragMove_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onItemDragMove_0_flag = AttributeUpdaterFlag.UPDATE; + this._onItemDragMove_0_0value = value; + } else { + this._onItemDragMove_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onItemDragLeave(value: ((event: ItemDragInfo, itemIndex: number) => void) | undefined): this { + if (this._onItemDragLeave_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onItemDragLeave_0_flag = AttributeUpdaterFlag.UPDATE; + this._onItemDragLeave_0_0value = value; + } else { + this._onItemDragLeave_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onItemDrop(value: ((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | undefined): this { + if (this._onItemDrop_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onItemDrop_0_flag = AttributeUpdaterFlag.UPDATE; + this._onItemDrop_0_0value = value; + } else { + this._onItemDrop_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + alignItems(value: GridItemAlignment | undefined): this { + if (this._alignItems_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._alignItems_0_flag = AttributeUpdaterFlag.UPDATE; + this._alignItems_0_0value = value; + } else { + this._alignItems_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollFrameBegin(value: OnScrollFrameBeginCallback | undefined): this { + if (this._onScrollFrameBegin_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollFrameBegin_0_0value = value; + } else { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onWillScroll(value: OnWillScrollCallback | undefined): this { + if (this._onWillScroll_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onWillScroll_0_flag = AttributeUpdaterFlag.UPDATE; + this._onWillScroll_0_0value = value; + } else { + this._onWillScroll_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onDidScroll(value: OnScrollCallback | undefined): this { + if (this._onDidScroll_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onDidScroll_0_flag = AttributeUpdaterFlag.UPDATE; + this._onDidScroll_0_0value = value; + } else { + this._onDidScroll_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + cachedCount(count: number | undefined, show: boolean | undefined): this { + if (this._cachedCount_1_flag == AttributeUpdaterFlag.INITIAL || this._cachedCount_1_0value !== count || this._cachedCount_1_1value !== show) { + this._cachedCount_1_flag = AttributeUpdaterFlag.UPDATE; + this._cachedCount_1_0value = count; + this._cachedCount_1_1value = show; + } else { + this._cachedCount_1_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ListItemGroupModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ListItemGroupModifier.ts new file mode 100644 index 0000000000000000000000000000000000000000..25e09065eb744db9b7f11721a8b17746a342562f --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ListItemGroupModifier.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonMethodModifier, AttributeUpdaterFlag } from './CommonMethodModifier' +import { ArkListItemGroupPeer, ListItemGroupAttribute } from './component/listItemGroup' +import { CommonMethod, ChildrenMainSize, AttributeModifier } from './component/common' +import { ListDividerOptions } from './component/list' + +export class ListItemGroupModifier extends CommonMethodModifier implements ListItemGroupAttribute, AttributeModifier { + _instanceId: number = -1 + setInstanceId(instanceId: number): void { + this._instanceId = instanceId + } + isUpdater: () => boolean = () => false + applyNormalAttribute(instance: ListItemGroupAttribute): void {} + applyPressedAttribute(instance: ListItemGroupAttribute): void {} + applyFocusedAttribute(instance: ListItemGroupAttribute): void {} + applyDisabledAttribute(instance: ListItemGroupAttribute): void {} + applySelectedAttribute(instance: ListItemGroupAttribute): void {} + _divider_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL + _divider_0_0value?: ListDividerOptions | undefined + _childrenMainSize_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL + _childrenMainSize_0_0value?: ChildrenMainSize | undefined + applyModifierPatch(peer: ArkListItemGroupPeer): void { + super.applyModifierPatch(peer) + if (this._divider_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._divider_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.dividerAttribute(this._divider_0_0value as ListDividerOptions | undefined) + this._divider_0_flag = AttributeUpdaterFlag.RESET + break + } + case AttributeUpdaterFlag.SKIP: { + this._divider_0_flag = AttributeUpdaterFlag.RESET + break + } + default: { + this._divider_0_flag = AttributeUpdaterFlag.INITIAL + peer.dividerAttribute(undefined as ListDividerOptions | undefined) + } + } + } + if (this._childrenMainSize_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._childrenMainSize_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.childrenMainSizeAttribute(this._childrenMainSize_0_0value as ChildrenMainSize | undefined) + this._childrenMainSize_0_flag = AttributeUpdaterFlag.RESET + break + } + case AttributeUpdaterFlag.SKIP: { + this._childrenMainSize_0_flag = AttributeUpdaterFlag.RESET + break + } + default: { + this._childrenMainSize_0_flag = AttributeUpdaterFlag.INITIAL + peer.childrenMainSizeAttribute(undefined as ChildrenMainSize | undefined) + } + } + } + } + mergeModifier(modifier: ListItemGroupModifier): void { + super.mergeModifier(modifier) + if (modifier._divider_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._divider_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.divider(modifier._divider_0_0value) + break + } + default: { + this.divider(undefined as ListDividerOptions | undefined) + } + } + } + if (modifier._childrenMainSize_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._childrenMainSize_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.childrenMainSize(modifier._childrenMainSize_0_0value) + break + } + default: { + this.childrenMainSize(undefined as ChildrenMainSize | undefined) + } + } + } + } + divider(value: ListDividerOptions | undefined): this { + if (this._divider_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._divider_0_flag = AttributeUpdaterFlag.UPDATE + this._divider_0_0value = value + } else { + this._divider_0_flag = AttributeUpdaterFlag.SKIP + } + return this + } + childrenMainSize(value: ChildrenMainSize | undefined): this { + if (this._childrenMainSize_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._childrenMainSize_0_flag = AttributeUpdaterFlag.UPDATE + this._childrenMainSize_0_0value = value + } else { + this._childrenMainSize_0_flag = AttributeUpdaterFlag.SKIP + } + return this + } +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ListItemModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ListItemModifier.ts new file mode 100644 index 0000000000000000000000000000000000000000..26e24b7eaa8e46333019b1b03752362013f5400d --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ListItemModifier.ts @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonMethodModifier, AttributeUpdaterFlag } from './CommonMethodModifier'; +import { PeerNode } from './PeerNode'; +import { ArkListItemPeer, SwipeActionOptions, ListItemAttribute, Sticky } from './component/listItem'; +import { CommonMethod, Bindable, AttributeModifier } from './component/common'; + +export class ListItemModifier extends CommonMethodModifier implements ListItemAttribute, AttributeModifier { + _instanceId: number = -1; + setInstanceId(instanceId: number): void { + this._instanceId = instanceId; + } + isUpdater: () => boolean = () => false; + applyNormalAttribute(instance: ListItemAttribute): void {} + applyPressedAttribute(instance: ListItemAttribute): void {} + applyFocusedAttribute(instance: ListItemAttribute): void {} + applyDisabledAttribute(instance: ListItemAttribute): void {} + applySelectedAttribute(instance: ListItemAttribute): void {} + _selectable_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _selectable_0_0value?: boolean | undefined; + _selected_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _selected_0_0value?: boolean | Bindable | undefined; + _swipeAction_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _swipeAction_0_0value?: SwipeActionOptions | undefined; + _onSelect_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onSelect_0_0value?: ((isSelected: boolean) => void) | undefined; + _sticky_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _sticky_0_0value?: Sticky | undefined; + applyModifierPatch(peer: ArkListItemPeer): void { + super.applyModifierPatch(peer); + if (this._selectable_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._selectable_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.selectableAttribute(this._selectable_0_0value as boolean | undefined); + this._selectable_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._selectable_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._selectable_0_flag = AttributeUpdaterFlag.INITIAL; + peer.selectableAttribute(undefined as boolean | undefined); + } + } + } + if (this._selected_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._selected_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + if (typeof this._selectable_0_0value == 'boolean' || typeof this._selectable_0_0value == 'undefined') { + peer.selectedAttribute(this._selected_0_0value as boolean | undefined); + } + + this._selected_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._selected_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._selected_0_flag = AttributeUpdaterFlag.INITIAL; + peer.selectedAttribute(undefined as boolean | undefined); + } + } + } + if (this._swipeAction_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._swipeAction_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.swipeActionAttribute(this._swipeAction_0_0value as SwipeActionOptions | undefined); + this._swipeAction_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._swipeAction_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._swipeAction_0_flag = AttributeUpdaterFlag.INITIAL; + peer.swipeActionAttribute(undefined as SwipeActionOptions | undefined); + } + } + } + if (this._onSelect_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onSelect_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onSelectAttribute(this._onSelect_0_0value as ((isSelected: boolean) => void) | undefined); + this._onSelect_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onSelect_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onSelect_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onSelectAttribute(undefined as ((isSelected: boolean) => void) | undefined); + } + } + } + if (this._sticky_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._sticky_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.stickyAttribute(this._sticky_0_0value as Sticky | undefined); + this._sticky_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._sticky_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._sticky_0_flag = AttributeUpdaterFlag.INITIAL; + peer.stickyAttribute(undefined as Sticky | undefined); + } + } + } + } + mergeModifier(modifier: ListItemModifier): void { + super.mergeModifier(modifier); + if (modifier._selectable_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._selectable_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.selectable(modifier._selectable_0_0value); + break; + } + default: { + this.selectable(undefined as boolean | undefined); + } + } + } + if (modifier._selected_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._selected_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.selected(modifier._selected_0_0value); + break; + } + default: { + this.selected(undefined as boolean | Bindable | undefined); + } + } + } + if (modifier._swipeAction_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._swipeAction_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.swipeAction(modifier._swipeAction_0_0value); + break; + } + default: { + this.swipeAction(undefined as SwipeActionOptions | undefined); + } + } + } + if (modifier._onSelect_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onSelect_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onSelect(modifier._onSelect_0_0value); + break; + } + default: { + this.onSelect(undefined as ((isSelected: boolean) => void) | undefined); + } + } + } + } + selectable(value: boolean | undefined): this { + if (this._selectable_0_flag == AttributeUpdaterFlag.INITIAL || this._selectable_0_0value !== value) { + this._selectable_0_flag = AttributeUpdaterFlag.UPDATE; + this._selectable_0_0value = value; + } else { + this._selectable_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + selected(value: boolean | Bindable | undefined): this { + if (this._selected_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._selected_0_flag = AttributeUpdaterFlag.UPDATE; + this._selected_0_0value = value; + } else { + this._selected_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + swipeAction(value: SwipeActionOptions | undefined): this { + if (this._swipeAction_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._swipeAction_0_flag = AttributeUpdaterFlag.UPDATE; + this._swipeAction_0_0value = value; + } else { + this._swipeAction_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onSelect(value: ((isSelected: boolean) => void) | undefined): this { + if (this._onSelect_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onSelect_0_flag = AttributeUpdaterFlag.UPDATE; + this._onSelect_0_0value = value; + } else { + this._onSelect_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + public sticky(value: Sticky | undefined): this { + if (this._sticky_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._sticky_0_flag = AttributeUpdaterFlag.UPDATE; + this._sticky_0_0value = value; + } else { + this._sticky_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ListModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ListModifier.ts new file mode 100644 index 0000000000000000000000000000000000000000..03f96df5c1339c71a546d9b831a79a66c7ff5e59 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ListModifier.ts @@ -0,0 +1,1144 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ScrollableCommonMethodModifier } from './ScrollableCommonMethodModifier'; +import { AttributeUpdaterFlag } from './CommonMethodModifier'; +import { + ArkListPeer, + ListItemAlign, + ListDividerOptions, + ChainAnimationOptions, + StickyStyle, + ScrollSnapAlign, + OnScrollVisibleContentChangeCallback, + ListAttribute +} from './component/list'; +import { AttributeModifier, ItemDragInfo, OnWillScrollCallback, OnScrollCallback, CustomBuilder, ChildrenMainSize } from './component/common'; +import { Axis, ScrollSource } from './component/enums'; +import { OnScrollFrameBeginCallback } from './component/scroll'; +import { LengthConstrain, Dimension } from './component/units'; +export class ListModifier extends ScrollableCommonMethodModifier implements ListAttribute, AttributeModifier { + _instanceId: number = -1; + setInstanceId(instanceId: number): void { + this._instanceId = instanceId; + } + isUpdater: () => boolean = () => false; + applyNormalAttribute(instance: ListAttribute): void {} + applyPressedAttribute(instance: ListAttribute): void {} + applyFocusedAttribute(instance: ListAttribute): void {} + applyDisabledAttribute(instance: ListAttribute): void {} + applySelectedAttribute(instance: ListAttribute): void {} + _alignListItem_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _alignListItem_0_0value?: ListItemAlign | undefined; + _listDirection_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _listDirection_0_0value?: Axis | undefined; + _contentStartOffset_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _contentStartOffset_0_0value?: number | undefined; + _contentEndOffset_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _contentEndOffset_0_0value?: number | undefined; + _divider_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _divider_0_0value?: ListDividerOptions | undefined; + _multiSelectable_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _multiSelectable_0_0value?: boolean | undefined; + _cachedCount_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _cachedCount_0_0value?: number | undefined; + _chainAnimation_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _chainAnimation_0_0value?: boolean | undefined; + _chainAnimationOptions_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _chainAnimationOptions_0_0value?: ChainAnimationOptions | undefined; + _sticky_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _sticky_0_0value?: StickyStyle | undefined; + _scrollSnapAlign_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _scrollSnapAlign_0_0value?: ScrollSnapAlign | undefined; + _childrenMainSize_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _childrenMainSize_0_0value?: ChildrenMainSize | undefined; + _maintainVisibleContentPosition_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _maintainVisibleContentPosition_0_0value?: boolean | undefined; + _stackFromEnd_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _stackFromEnd_0_0value?: boolean | undefined; + _onScrollIndex_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollIndex_0_0value?: ((start: number, end: number, center: number) => void) | undefined; + _onScrollVisibleContentChange_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollVisibleContentChange_0_0value?: OnScrollVisibleContentChangeCallback | undefined; + _onItemMove_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onItemMove_0_0value?: ((from: number, to: number) => boolean) | undefined; + _onItemDragStart_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onItemDragStart_0_0value?: ((event: ItemDragInfo, itemIndex: number) => CustomBuilder) | undefined; + _onItemDragEnter_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onItemDragEnter_0_0value?: ((event: ItemDragInfo) => void) | undefined; + _onItemDragMove_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onItemDragMove_0_0value?: ((event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | undefined; + _onItemDragLeave_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onItemDragLeave_0_0value?: ((event: ItemDragInfo, itemIndex: number) => void) | undefined; + _onItemDrop_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onItemDrop_0_0value?: ((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | undefined; + _onScrollFrameBegin_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollFrameBegin_0_0value?: OnScrollFrameBeginCallback | undefined; + _onWillScroll_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onWillScroll_0_0value?: OnWillScrollCallback | undefined; + _onDidScroll_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onDidScroll_0_0value?: OnScrollCallback | undefined; + _lanes_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _lanes_0_0value?: number | LengthConstrain | undefined; + _lanes_0_1value?: Dimension | undefined; + _cachedCount_1_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _cachedCount_1_0value?: number | undefined; + _cachedCount_1_1value?: boolean | undefined; + applyModifierPatch(peer: ArkListPeer): void { + super.applyModifierPatch(peer); + if (this._alignListItem_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._alignListItem_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.alignListItemAttribute(this._alignListItem_0_0value as ListItemAlign | undefined); + this._alignListItem_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._alignListItem_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._alignListItem_0_flag = AttributeUpdaterFlag.INITIAL; + peer.alignListItemAttribute(undefined as ListItemAlign | undefined); + } + } + } + if (this._listDirection_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._listDirection_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.listDirectionAttribute(this._listDirection_0_0value as Axis | undefined); + this._listDirection_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._listDirection_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._listDirection_0_flag = AttributeUpdaterFlag.INITIAL; + peer.listDirectionAttribute(undefined as Axis | undefined); + } + } + } + if (this._contentStartOffset_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._contentStartOffset_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.contentStartOffsetAttribute(this._contentStartOffset_0_0value as number | undefined); + this._contentStartOffset_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._contentStartOffset_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._contentStartOffset_0_flag = AttributeUpdaterFlag.INITIAL; + peer.contentStartOffsetAttribute(undefined as number | undefined); + } + } + } + if (this._contentEndOffset_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._contentEndOffset_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.contentEndOffsetAttribute(this._contentEndOffset_0_0value as number | undefined); + this._contentEndOffset_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._contentEndOffset_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._contentEndOffset_0_flag = AttributeUpdaterFlag.INITIAL; + peer.contentEndOffsetAttribute(undefined as number | undefined); + } + } + } + if (this._divider_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._divider_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.dividerAttribute(this._divider_0_0value as ListDividerOptions | undefined); + this._divider_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._divider_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._divider_0_flag = AttributeUpdaterFlag.INITIAL; + peer.dividerAttribute(undefined as ListDividerOptions | undefined); + } + } + } + if (this._multiSelectable_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._multiSelectable_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.multiSelectableAttribute(this._multiSelectable_0_0value as boolean | undefined); + this._multiSelectable_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._multiSelectable_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._multiSelectable_0_flag = AttributeUpdaterFlag.INITIAL; + peer.multiSelectableAttribute(undefined as boolean | undefined); + } + } + } + if (this._cachedCount_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._cachedCount_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.cachedCount0Attribute(this._cachedCount_0_0value as number | undefined); + this._cachedCount_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._cachedCount_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._cachedCount_0_flag = AttributeUpdaterFlag.INITIAL; + peer.cachedCount0Attribute(undefined as number | undefined); + } + } + } + + if (this._chainAnimation_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._chainAnimation_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.chainAnimationAttribute(this._chainAnimation_0_0value as boolean | undefined); + this._chainAnimation_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._chainAnimation_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._chainAnimation_0_flag = AttributeUpdaterFlag.INITIAL; + peer.chainAnimationAttribute(undefined as boolean | undefined); + } + } + } + if (this._chainAnimationOptions_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._chainAnimationOptions_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.chainAnimationOptionsAttribute(this._chainAnimationOptions_0_0value as ChainAnimationOptions | undefined); + this._chainAnimationOptions_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._chainAnimationOptions_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._chainAnimationOptions_0_flag = AttributeUpdaterFlag.INITIAL; + peer.chainAnimationOptionsAttribute(undefined as ChainAnimationOptions | undefined); + } + } + } + if (this._sticky_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._sticky_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.stickyAttribute(this._sticky_0_0value as StickyStyle | undefined); + this._sticky_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._sticky_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._sticky_0_flag = AttributeUpdaterFlag.INITIAL; + peer.stickyAttribute(undefined as StickyStyle | undefined); + } + } + } + if (this._scrollSnapAlign_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._scrollSnapAlign_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.scrollSnapAlignAttribute(this._scrollSnapAlign_0_0value as ScrollSnapAlign | undefined); + this._scrollSnapAlign_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._scrollSnapAlign_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._scrollSnapAlign_0_flag = AttributeUpdaterFlag.INITIAL; + peer.scrollSnapAlignAttribute(undefined as ScrollSnapAlign | undefined); + } + } + } + if (this._childrenMainSize_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._childrenMainSize_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.childrenMainSizeAttribute(this._childrenMainSize_0_0value as ChildrenMainSize | undefined); + this._childrenMainSize_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._childrenMainSize_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._childrenMainSize_0_flag = AttributeUpdaterFlag.INITIAL; + peer.childrenMainSizeAttribute(undefined as ChildrenMainSize | undefined); + } + } + } + if (this._maintainVisibleContentPosition_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._maintainVisibleContentPosition_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.maintainVisibleContentPositionAttribute(this._maintainVisibleContentPosition_0_0value as boolean | undefined); + this._maintainVisibleContentPosition_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._maintainVisibleContentPosition_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._maintainVisibleContentPosition_0_flag = AttributeUpdaterFlag.INITIAL; + peer.maintainVisibleContentPositionAttribute(undefined as boolean | undefined); + } + } + } + if (this._stackFromEnd_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._stackFromEnd_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.stackFromEndAttribute(this._stackFromEnd_0_0value as boolean | undefined); + this._stackFromEnd_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._stackFromEnd_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._stackFromEnd_0_flag = AttributeUpdaterFlag.INITIAL; + peer.stackFromEndAttribute(undefined as boolean | undefined); + } + } + } + if (this._onScrollIndex_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollIndex_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollIndexAttribute(this._onScrollIndex_0_0value as ((start: number, end: number, center: number) => void) | undefined); + this._onScrollIndex_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollIndex_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollIndex_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollIndexAttribute(undefined as ((start: number, end: number, center: number) => void) | undefined); + } + } + } + if (this._onScrollVisibleContentChange_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollVisibleContentChange_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollVisibleContentChangeAttribute( + this._onScrollVisibleContentChange_0_0value as OnScrollVisibleContentChangeCallback | undefined + ); + this._onScrollVisibleContentChange_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollVisibleContentChange_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollVisibleContentChange_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollVisibleContentChangeAttribute(undefined as OnScrollVisibleContentChangeCallback | undefined); + } + } + } + if (this._onItemMove_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onItemMove_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onItemMoveAttribute(this._onItemMove_0_0value as ((from: number, to: number) => boolean) | undefined); + this._onItemMove_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onItemMove_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onItemMove_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onItemMoveAttribute(undefined as ((from: number, to: number) => boolean) | undefined); + } + } + } + if (this._onItemDragStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onItemDragStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onItemDragStartAttribute( + this._onItemDragStart_0_0value as ((event: ItemDragInfo, itemIndex: number) => CustomBuilder) | undefined + ); + this._onItemDragStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onItemDragStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onItemDragStart_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onItemDragStartAttribute(undefined as ((event: ItemDragInfo, itemIndex: number) => CustomBuilder) | undefined); + } + } + } + if (this._onItemDragEnter_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onItemDragEnter_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onItemDragEnterAttribute(this._onItemDragEnter_0_0value as ((event: ItemDragInfo) => void) | undefined); + this._onItemDragEnter_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onItemDragEnter_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onItemDragEnter_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onItemDragEnterAttribute(undefined as ((event: ItemDragInfo) => void) | undefined); + } + } + } + if (this._onItemDragMove_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onItemDragMove_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onItemDragMoveAttribute( + this._onItemDragMove_0_0value as ((event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | undefined + ); + this._onItemDragMove_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onItemDragMove_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onItemDragMove_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onItemDragMoveAttribute(undefined as ((event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | undefined); + } + } + } + if (this._onItemDragLeave_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onItemDragLeave_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onItemDragLeaveAttribute(this._onItemDragLeave_0_0value as ((event: ItemDragInfo, itemIndex: number) => void) | undefined); + this._onItemDragLeave_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onItemDragLeave_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onItemDragLeave_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onItemDragLeaveAttribute(undefined as ((event: ItemDragInfo, itemIndex: number) => void) | undefined); + } + } + } + if (this._onItemDrop_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onItemDrop_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onItemDropAttribute(this._onItemDrop_0_0value as ((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | undefined); + this._onItemDrop_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onItemDrop_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onItemDrop_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onItemDropAttribute( + undefined as ((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | undefined + ); + } + } + } + if (this._onScrollFrameBegin_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollFrameBegin_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollFrameBeginAttribute(this._onScrollFrameBegin_0_0value as OnScrollFrameBeginCallback | undefined); + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollFrameBeginAttribute(undefined as OnScrollFrameBeginCallback | undefined); + } + } + } + if (this._onWillScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onWillScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onWillScrollAttribute(this._onWillScroll_0_0value as OnWillScrollCallback | undefined); + this._onWillScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onWillScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onWillScroll_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onWillScrollAttribute(undefined as OnWillScrollCallback | undefined); + } + } + } + if (this._onDidScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onDidScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onDidScrollAttribute(this._onDidScroll_0_0value as OnScrollCallback | undefined); + this._onDidScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onDidScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onDidScroll_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onDidScrollAttribute(undefined as OnScrollCallback | undefined); + } + } + } + if (this._lanes_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._lanes_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.lanesAttribute(this._lanes_0_0value as number | LengthConstrain | undefined, this._lanes_0_1value as Dimension | undefined); + this._lanes_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._lanes_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._lanes_0_flag = AttributeUpdaterFlag.INITIAL; + peer.lanesAttribute(undefined as number | LengthConstrain | undefined, undefined as Dimension | undefined | undefined); + } + } + } + if (this._cachedCount_1_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._cachedCount_1_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.cachedCount1Attribute(this._cachedCount_1_0value as number | undefined, this._cachedCount_1_1value as boolean | undefined); + this._cachedCount_1_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._cachedCount_1_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._cachedCount_1_flag = AttributeUpdaterFlag.INITIAL; + peer.cachedCount1Attribute(undefined as number | undefined, undefined as boolean | undefined); + } + } + } + } + mergeModifier(modifier: ListModifier): void { + super.mergeModifier(modifier); + if (modifier._alignListItem_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._alignListItem_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.alignListItem(modifier._alignListItem_0_0value); + break; + } + default: { + this.alignListItem(undefined as ListItemAlign | undefined); + } + } + } + if (modifier._listDirection_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._listDirection_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.listDirection(modifier._listDirection_0_0value); + break; + } + default: { + this.listDirection(undefined as Axis | undefined); + } + } + } + if (modifier._contentStartOffset_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._contentStartOffset_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.contentStartOffset(modifier._contentStartOffset_0_0value); + break; + } + default: { + this.contentStartOffset(undefined as number | undefined); + } + } + } + if (modifier._contentEndOffset_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._contentEndOffset_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.contentEndOffset(modifier._contentEndOffset_0_0value); + break; + } + default: { + this.contentEndOffset(undefined as number | undefined); + } + } + } + if (modifier._divider_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._divider_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.divider(modifier._divider_0_0value); + break; + } + default: { + this.divider(undefined as ListDividerOptions | undefined); + } + } + } + if (modifier._multiSelectable_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._multiSelectable_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.multiSelectable(modifier._multiSelectable_0_0value); + break; + } + default: { + this.multiSelectable(undefined as boolean | undefined); + } + } + } + if (modifier._cachedCount_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._cachedCount_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.cachedCount(modifier._cachedCount_0_0value); + break; + } + default: { + this.cachedCount(undefined as number | undefined); + } + } + } + if (modifier._chainAnimation_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._chainAnimation_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.chainAnimation(modifier._chainAnimation_0_0value); + break; + } + default: { + this.chainAnimation(undefined as boolean | undefined); + } + } + } + if (modifier._chainAnimationOptions_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._chainAnimationOptions_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.chainAnimationOptions(modifier._chainAnimationOptions_0_0value); + break; + } + default: { + this.chainAnimationOptions(undefined as ChainAnimationOptions | undefined); + } + } + } + if (modifier._sticky_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._sticky_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.sticky(modifier._sticky_0_0value); + break; + } + default: { + this.sticky(undefined as StickyStyle | undefined); + } + } + } + if (modifier._scrollSnapAlign_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._scrollSnapAlign_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.scrollSnapAlign(modifier._scrollSnapAlign_0_0value); + break; + } + default: { + this.scrollSnapAlign(undefined as ScrollSnapAlign | undefined); + } + } + } + if (modifier._childrenMainSize_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._childrenMainSize_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.childrenMainSize(modifier._childrenMainSize_0_0value); + break; + } + default: { + this.childrenMainSize(undefined as ChildrenMainSize | undefined); + } + } + } + if (modifier._maintainVisibleContentPosition_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._maintainVisibleContentPosition_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.maintainVisibleContentPosition(modifier._maintainVisibleContentPosition_0_0value); + break; + } + default: { + this.maintainVisibleContentPosition(undefined as boolean | undefined); + } + } + } + if (modifier._stackFromEnd_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._stackFromEnd_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.stackFromEnd(modifier._stackFromEnd_0_0value); + break; + } + default: { + this.stackFromEnd(undefined as boolean | undefined); + } + } + } + if (modifier._onScrollIndex_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollIndex_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollIndex(modifier._onScrollIndex_0_0value); + break; + } + default: { + this.onScrollIndex(undefined as ((start: number, end: number, center: number) => void) | undefined); + } + } + } + if (modifier._onScrollVisibleContentChange_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollVisibleContentChange_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollVisibleContentChange(modifier._onScrollVisibleContentChange_0_0value); + break; + } + default: { + this.onScrollVisibleContentChange(undefined as OnScrollVisibleContentChangeCallback | undefined); + } + } + } + if (modifier._onItemMove_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onItemMove_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onItemMove(modifier._onItemMove_0_0value); + break; + } + default: { + this.onItemMove(undefined as ((from: number, to: number) => boolean) | undefined); + } + } + } + if (modifier._onItemDragStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onItemDragStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onItemDragStart(modifier._onItemDragStart_0_0value); + break; + } + default: { + this.onItemDragStart(undefined as ((event: ItemDragInfo, itemIndex: number) => CustomBuilder) | undefined); + } + } + } + if (modifier._onItemDragEnter_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onItemDragEnter_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onItemDragEnter(modifier._onItemDragEnter_0_0value); + break; + } + default: { + this.onItemDragEnter(undefined as ((event: ItemDragInfo) => void) | undefined); + } + } + } + if (modifier._onItemDragMove_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onItemDragMove_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onItemDragMove(modifier._onItemDragMove_0_0value); + break; + } + default: { + this.onItemDragMove(undefined as ((event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | undefined); + } + } + } + if (modifier._onItemDragLeave_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onItemDragLeave_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onItemDragLeave(modifier._onItemDragLeave_0_0value); + break; + } + default: { + this.onItemDragLeave(undefined as ((event: ItemDragInfo, itemIndex: number) => void) | undefined); + } + } + } + if (modifier._onItemDrop_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onItemDrop_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onItemDrop(modifier._onItemDrop_0_0value); + break; + } + default: { + this.onItemDrop( + undefined as ((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | undefined + ); + } + } + } + if (modifier._onScrollFrameBegin_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollFrameBegin_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollFrameBegin(modifier._onScrollFrameBegin_0_0value); + break; + } + default: { + this.onScrollFrameBegin(undefined as OnScrollFrameBeginCallback | undefined); + } + } + } + if (modifier._onWillScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onWillScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onWillScroll(modifier._onWillScroll_0_0value); + break; + } + default: { + this.onWillScroll(undefined as OnWillScrollCallback | undefined); + } + } + } + if (modifier._onDidScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onDidScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onDidScroll(modifier._onDidScroll_0_0value); + break; + } + default: { + this.onDidScroll(undefined as OnScrollCallback | undefined); + } + } + } + if (modifier._lanes_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._lanes_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.lanes(modifier._lanes_0_0value, modifier._lanes_0_1value); + break; + } + default: { + this.lanes(undefined as number | LengthConstrain | undefined, undefined as Dimension | undefined | undefined); + } + } + } + if (modifier._cachedCount_1_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._cachedCount_1_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.cachedCount(modifier._cachedCount_1_0value, modifier._cachedCount_1_1value); + break; + } + default: { + this.cachedCount(undefined as number | undefined, undefined as boolean | undefined); + } + } + } + } + alignListItem(value: ListItemAlign | undefined): this { + if (this._alignListItem_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._alignListItem_0_flag = AttributeUpdaterFlag.UPDATE; + this._alignListItem_0_0value = value; + } else { + this._alignListItem_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + listDirection(value: Axis | undefined): this { + if (this._listDirection_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._listDirection_0_flag = AttributeUpdaterFlag.UPDATE; + this._listDirection_0_0value = value; + } else { + this._listDirection_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + contentStartOffset(value: number | undefined): this { + if (this._contentStartOffset_0_flag == AttributeUpdaterFlag.INITIAL || this._contentStartOffset_0_0value !== value) { + this._contentStartOffset_0_flag = AttributeUpdaterFlag.UPDATE; + this._contentStartOffset_0_0value = value; + } else { + this._contentStartOffset_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + contentEndOffset(value: number | undefined): this { + if (this._contentEndOffset_0_flag == AttributeUpdaterFlag.INITIAL || this._contentEndOffset_0_0value !== value) { + this._contentEndOffset_0_flag = AttributeUpdaterFlag.UPDATE; + this._contentEndOffset_0_0value = value; + } else { + this._contentEndOffset_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + divider(value: ListDividerOptions | undefined): this { + if (this._divider_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._divider_0_flag = AttributeUpdaterFlag.UPDATE; + this._divider_0_0value = value; + } else { + this._divider_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + multiSelectable(value: boolean | undefined): this { + if (this._multiSelectable_0_flag == AttributeUpdaterFlag.INITIAL || this._multiSelectable_0_0value !== value) { + this._multiSelectable_0_flag = AttributeUpdaterFlag.UPDATE; + this._multiSelectable_0_0value = value; + } else { + this._multiSelectable_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + cachedCount(value: number | undefined): this { + if (this._cachedCount_0_flag == AttributeUpdaterFlag.INITIAL || this._cachedCount_0_0value !== value) { + this._cachedCount_0_flag = AttributeUpdaterFlag.UPDATE; + this._cachedCount_0_0value = value; + } else { + this._cachedCount_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + chainAnimation(value: boolean | undefined): this { + if (this._chainAnimation_0_flag == AttributeUpdaterFlag.INITIAL || this._chainAnimation_0_0value !== value) { + this._chainAnimation_0_flag = AttributeUpdaterFlag.UPDATE; + this._chainAnimation_0_0value = value; + } else { + this._chainAnimation_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + chainAnimationOptions(value: ChainAnimationOptions | undefined): this { + if (this._chainAnimationOptions_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._chainAnimationOptions_0_flag = AttributeUpdaterFlag.UPDATE; + this._chainAnimationOptions_0_0value = value; + } else { + this._chainAnimationOptions_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + sticky(value: StickyStyle | undefined): this { + if (this._sticky_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._sticky_0_flag = AttributeUpdaterFlag.UPDATE; + this._sticky_0_0value = value; + } else { + this._sticky_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + scrollSnapAlign(value: ScrollSnapAlign | undefined): this { + if (this._scrollSnapAlign_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._scrollSnapAlign_0_flag = AttributeUpdaterFlag.UPDATE; + this._scrollSnapAlign_0_0value = value; + } else { + this._scrollSnapAlign_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + childrenMainSize(value: ChildrenMainSize | undefined): this { + if (this._childrenMainSize_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._childrenMainSize_0_flag = AttributeUpdaterFlag.UPDATE; + this._childrenMainSize_0_0value = value; + } else { + this._childrenMainSize_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + maintainVisibleContentPosition(value: boolean | undefined): this { + if (this._maintainVisibleContentPosition_0_flag == AttributeUpdaterFlag.INITIAL || this._maintainVisibleContentPosition_0_0value !== value) { + this._maintainVisibleContentPosition_0_flag = AttributeUpdaterFlag.UPDATE; + this._maintainVisibleContentPosition_0_0value = value; + } else { + this._maintainVisibleContentPosition_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + stackFromEnd(value: boolean | undefined): this { + if (this._stackFromEnd_0_flag == AttributeUpdaterFlag.INITIAL || this._stackFromEnd_0_0value !== value) { + this._stackFromEnd_0_flag = AttributeUpdaterFlag.UPDATE; + this._stackFromEnd_0_0value = value; + } else { + this._stackFromEnd_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollIndex(value: ((start: number, end: number, center: number) => void) | undefined): this { + if (this._onScrollIndex_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollIndex_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollIndex_0_0value = value; + } else { + this._onScrollIndex_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollVisibleContentChange(value: OnScrollVisibleContentChangeCallback | undefined): this { + if (this._onScrollVisibleContentChange_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollVisibleContentChange_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollVisibleContentChange_0_0value = value; + } else { + this._onScrollVisibleContentChange_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onItemMove(value: ((from: number, to: number) => boolean) | undefined): this { + if (this._onItemMove_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onItemMove_0_flag = AttributeUpdaterFlag.UPDATE; + this._onItemMove_0_0value = value; + } else { + this._onItemMove_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onItemDragStart(value: ((event: ItemDragInfo, itemIndex: number) => CustomBuilder) | undefined): this { + if (this._onItemDragStart_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onItemDragStart_0_flag = AttributeUpdaterFlag.UPDATE; + this._onItemDragStart_0_0value = value; + } else { + this._onItemDragStart_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onItemDragEnter(value: ((event: ItemDragInfo) => void) | undefined): this { + if (this._onItemDragEnter_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onItemDragEnter_0_flag = AttributeUpdaterFlag.UPDATE; + this._onItemDragEnter_0_0value = value; + } else { + this._onItemDragEnter_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onItemDragMove(value: ((event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | undefined): this { + if (this._onItemDragMove_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onItemDragMove_0_flag = AttributeUpdaterFlag.UPDATE; + this._onItemDragMove_0_0value = value; + } else { + this._onItemDragMove_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onItemDragLeave(value: ((event: ItemDragInfo, itemIndex: number) => void) | undefined): this { + if (this._onItemDragLeave_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onItemDragLeave_0_flag = AttributeUpdaterFlag.UPDATE; + this._onItemDragLeave_0_0value = value; + } else { + this._onItemDragLeave_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onItemDrop(value: ((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | undefined): this { + if (this._onItemDrop_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onItemDrop_0_flag = AttributeUpdaterFlag.UPDATE; + this._onItemDrop_0_0value = value; + } else { + this._onItemDrop_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollFrameBegin(value: OnScrollFrameBeginCallback | undefined): this { + if (this._onScrollFrameBegin_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollFrameBegin_0_0value = value; + } else { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onWillScroll(value: OnWillScrollCallback | undefined): this { + if (this._onWillScroll_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onWillScroll_0_flag = AttributeUpdaterFlag.UPDATE; + this._onWillScroll_0_0value = value; + } else { + this._onWillScroll_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onDidScroll(value: OnScrollCallback | undefined): this { + if (this._onDidScroll_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onDidScroll_0_flag = AttributeUpdaterFlag.UPDATE; + this._onDidScroll_0_0value = value; + } else { + this._onDidScroll_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + lanes(value: number | LengthConstrain | undefined, gutter?: Dimension): this { + if (this._lanes_0_flag == AttributeUpdaterFlag.INITIAL || true || true) { + this._lanes_0_flag = AttributeUpdaterFlag.UPDATE; + this._lanes_0_0value = value; + this._lanes_0_1value = gutter; + } else { + this._lanes_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + cachedCount(count: number | undefined, show: boolean | undefined): this { + if (this._cachedCount_1_flag == AttributeUpdaterFlag.INITIAL || this._cachedCount_1_0value !== count || this._cachedCount_1_1value !== show) { + this._cachedCount_1_flag = AttributeUpdaterFlag.UPDATE; + this._cachedCount_1_0value = count; + this._cachedCount_1_1value = show; + } else { + this._cachedCount_1_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/RefreshModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/RefreshModifier.ts new file mode 100644 index 0000000000000000000000000000000000000000..3cef806fb983b31d7bf73586f9c6ba8af3d99367 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/RefreshModifier.ts @@ -0,0 +1,277 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AttributeModifier } from './component/common'; +import { AttributeUpdaterFlag, CommonMethodModifier } from './CommonMethodModifier'; +import { ArkRefreshPeer, RefreshAttribute, RefreshStatus } from './component/refresh'; + +export class RefreshModifier extends CommonMethodModifier implements RefreshAttribute, AttributeModifier { + _instanceId: number = -1; + setInstanceId(instanceId: number): void { + this._instanceId = instanceId; + } + isUpdater: () => boolean = () => false; + applyNormalAttribute(instance: RefreshAttribute): void {} + applyPressedAttribute(instance: RefreshAttribute): void {} + applyFocusedAttribute(instance: RefreshAttribute): void {} + applyDisabledAttribute(instance: RefreshAttribute): void {} + applySelectedAttribute(instance: RefreshAttribute): void {} + _onStateChange_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onStateChange_0_0value?: ((state: RefreshStatus) => void) | undefined; + _onRefreshing_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onRefreshing_0_0value?: (() => void) | undefined; + _refreshOffset_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _refreshOffset_0_0value?: number | undefined; + _pullToRefresh_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _pullToRefresh_0_0value?: boolean | undefined; + _onOffsetChange_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onOffsetChange_0_0value?: ((value0: number) => void) | undefined; + _pullDownRatio_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _pullDownRatio_0_0value?: number | undefined; + applyModifierPatch(peer: ArkRefreshPeer): void { + super.applyModifierPatch(peer); + if (this._onStateChange_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onStateChange_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onStateChangeAttribute(this._onStateChange_0_0value as ((state: RefreshStatus) => void) | undefined); + this._onStateChange_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onStateChange_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onStateChange_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onStateChangeAttribute(undefined as ((state: RefreshStatus) => void) | undefined); + } + } + } + if (this._onRefreshing_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onRefreshing_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onRefreshingAttribute(this._onRefreshing_0_0value as (() => void) | undefined); + this._onRefreshing_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onRefreshing_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onRefreshing_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onRefreshingAttribute(undefined as (() => void) | undefined); + } + } + } + if (this._refreshOffset_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._refreshOffset_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.refreshOffsetAttribute(this._refreshOffset_0_0value as number | undefined); + this._refreshOffset_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._refreshOffset_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._refreshOffset_0_flag = AttributeUpdaterFlag.INITIAL; + peer.refreshOffsetAttribute(undefined as number | undefined); + } + } + } + if (this._pullToRefresh_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._pullToRefresh_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.pullToRefreshAttribute(this._pullToRefresh_0_0value as boolean | undefined); + this._pullToRefresh_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._pullToRefresh_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._pullToRefresh_0_flag = AttributeUpdaterFlag.INITIAL; + peer.pullToRefreshAttribute(undefined as boolean | undefined); + } + } + } + if (this._onOffsetChange_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onOffsetChange_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onOffsetChangeAttribute(this._onOffsetChange_0_0value as ((value0: number) => void) | undefined); + this._onOffsetChange_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onOffsetChange_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onOffsetChange_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onOffsetChangeAttribute(undefined as ((value0: number) => void) | undefined); + } + } + } + if (this._pullDownRatio_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._pullDownRatio_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.pullDownRatioAttribute(this._pullDownRatio_0_0value as number | undefined); + this._pullDownRatio_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._pullDownRatio_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._pullDownRatio_0_flag = AttributeUpdaterFlag.INITIAL; + peer.pullDownRatioAttribute(undefined as number | undefined); + } + } + } + } + mergeModifier(modifier: RefreshModifier): void { + super.mergeModifier(modifier); + if (modifier._onStateChange_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onStateChange_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onStateChange(modifier._onStateChange_0_0value); + break; + } + default: { + this.onStateChange(undefined as ((state: RefreshStatus) => void) | undefined); + } + } + } + if (modifier._onRefreshing_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onRefreshing_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onRefreshing(modifier._onRefreshing_0_0value); + break; + } + default: { + this.onRefreshing(undefined as (() => void) | undefined); + } + } + } + if (modifier._refreshOffset_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._refreshOffset_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.refreshOffset(modifier._refreshOffset_0_0value); + break; + } + default: { + this.refreshOffset(undefined as number | undefined); + } + } + } + if (modifier._pullToRefresh_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._pullToRefresh_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.pullToRefresh(modifier._pullToRefresh_0_0value); + break; + } + default: { + this.pullToRefresh(undefined as boolean | undefined); + } + } + } + if (modifier._onOffsetChange_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onOffsetChange_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onOffsetChange(modifier._onOffsetChange_0_0value); + break; + } + default: { + this.onOffsetChange(undefined as ((value0: number) => void) | undefined); + } + } + } + if (modifier._pullDownRatio_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._pullDownRatio_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.pullDownRatio(modifier._pullDownRatio_0_0value); + break; + } + default: { + this.pullDownRatio(undefined as number | undefined); + } + } + } + } + onStateChange(value: ((state: RefreshStatus) => void) | undefined): this { + if (this._onStateChange_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onStateChange_0_flag = AttributeUpdaterFlag.UPDATE; + this._onStateChange_0_0value = value; + } else { + this._onStateChange_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onRefreshing(value: (() => void) | undefined): this { + if (this._onRefreshing_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onRefreshing_0_flag = AttributeUpdaterFlag.UPDATE; + this._onRefreshing_0_0value = value; + } else { + this._onRefreshing_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + refreshOffset(value: number | undefined): this { + if (this._refreshOffset_0_flag == AttributeUpdaterFlag.INITIAL || this._refreshOffset_0_0value !== value) { + this._refreshOffset_0_flag = AttributeUpdaterFlag.UPDATE; + this._refreshOffset_0_0value = value; + } else { + this._refreshOffset_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + pullToRefresh(value: boolean | undefined): this { + if (this._pullToRefresh_0_flag == AttributeUpdaterFlag.INITIAL || this._pullToRefresh_0_0value !== value) { + this._pullToRefresh_0_flag = AttributeUpdaterFlag.UPDATE; + this._pullToRefresh_0_0value = value; + } else { + this._pullToRefresh_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onOffsetChange(value: ((value0: number) => void) | undefined): this { + if (this._onOffsetChange_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onOffsetChange_0_flag = AttributeUpdaterFlag.UPDATE; + this._onOffsetChange_0_0value = value; + } else { + this._onOffsetChange_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + pullDownRatio(value: number | undefined): this { + if (this._pullDownRatio_0_flag == AttributeUpdaterFlag.INITIAL || this._pullDownRatio_0_0value !== value) { + this._pullDownRatio_0_flag = AttributeUpdaterFlag.UPDATE; + this._pullDownRatio_0_0value = value; + } else { + this._pullDownRatio_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ScrollModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ScrollModifier.ts new file mode 100644 index 0000000000000000000000000000000000000000..f4b53b4c1b45af1dc29161c47fd4e9d69938c8a4 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ScrollModifier.ts @@ -0,0 +1,736 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ScrollableCommonMethodModifier } from './ScrollableCommonMethodModifier'; +import { AttributeUpdaterFlag } from './CommonMethodModifier'; +import { + ArkScrollPeer, + ScrollDirection, + ScrollOnWillScrollCallback, + ScrollOnScrollCallback, + OnScrollEdgeCallback, + OnScrollFrameBeginCallback, + ScrollSnapOptions, + OffsetOptions, + ScrollAttribute +} from './component/scroll'; +import { ScrollableCommonMethod, NestedScrollOptions, CommonMethod, EdgeEffectOptions, AttributeModifier } from './component/common'; +import { ScrollState } from './component/list'; +import { ScrollSource, Edge, BarState, Color, EdgeEffect } from './component/enums'; +import { VoidCallback } from './component/units'; +import { Resource } from 'global.resource'; +export class ScrollModifier extends ScrollableCommonMethodModifier implements ScrollAttribute, AttributeModifier { + _instanceId: number = -1; + setInstanceId(instanceId: number): void { + this._instanceId = instanceId; + } + isUpdater: () => boolean = () => false; + applyNormalAttribute(instance: ScrollAttribute): void {} + applyPressedAttribute(instance: ScrollAttribute): void {} + applyFocusedAttribute(instance: ScrollAttribute): void {} + applyDisabledAttribute(instance: ScrollAttribute): void {} + applySelectedAttribute(instance: ScrollAttribute): void {} + _scrollable_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _scrollable_0_0value?: ScrollDirection | undefined; + _onWillScroll_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onWillScroll_0_0value?: ScrollOnWillScrollCallback | undefined; + _onDidScroll_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onDidScroll_0_0value?: ScrollOnScrollCallback | undefined; + _onScrollEdge_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollEdge_0_0value?: OnScrollEdgeCallback | undefined; + _onScrollStart_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollStart_0_0value?: VoidCallback | undefined; + _onScrollStop_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollStop_0_0value?: VoidCallback | undefined; + _scrollBar_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _scrollBar_0_0value?: BarState | undefined; + _scrollBarColor_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _scrollBarColor_0_0value?: Color | number | string | undefined; + _scrollBarWidth_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _scrollBarWidth_0_0value?: number | string | undefined; + _onScrollFrameBegin_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollFrameBegin_0_0value?: OnScrollFrameBeginCallback | undefined; + _nestedScroll_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _nestedScroll_0_0value?: NestedScrollOptions | undefined; + _enableScrollInteraction_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _enableScrollInteraction_0_0value?: boolean | undefined; + _friction_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _friction_0_0value?: number | Resource | undefined; + _scrollSnap_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _scrollSnap_0_0value?: ScrollSnapOptions | undefined; + _enablePaging_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _enablePaging_0_0value?: boolean | undefined; + _initialOffset_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _initialOffset_0_0value?: OffsetOptions | undefined; + _edgeEffect_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _edgeEffect_0_0value?: EdgeEffect | undefined; + _edgeEffect_0_1value?: EdgeEffectOptions | undefined; + applyModifierPatch(peer: ArkScrollPeer): void { + super.applyModifierPatch(peer); + if (this._scrollable_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._scrollable_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.scrollableAttribute(this._scrollable_0_0value as ScrollDirection | undefined); + this._scrollable_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._scrollable_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._scrollable_0_flag = AttributeUpdaterFlag.INITIAL; + peer.scrollableAttribute(undefined as ScrollDirection | undefined); + } + } + } + if (this._onWillScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onWillScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onWillScrollAttribute(this._onWillScroll_0_0value as ScrollOnWillScrollCallback | undefined); + this._onWillScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onWillScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onWillScroll_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onWillScrollAttribute(undefined as ScrollOnWillScrollCallback | undefined); + } + } + } + if (this._onDidScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onDidScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onDidScrollAttribute(this._onDidScroll_0_0value as ScrollOnScrollCallback | undefined); + this._onDidScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onDidScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onDidScroll_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onDidScrollAttribute(undefined as ScrollOnScrollCallback | undefined); + } + } + } + if (this._onScrollEdge_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollEdge_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollEdgeAttribute(this._onScrollEdge_0_0value as OnScrollEdgeCallback | undefined); + this._onScrollEdge_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollEdge_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollEdge_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollEdgeAttribute(undefined as OnScrollEdgeCallback | undefined); + } + } + } + if (this._onScrollStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollStartAttribute(this._onScrollStart_0_0value as VoidCallback | undefined); + this._onScrollStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollStart_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollStartAttribute(undefined as VoidCallback | undefined); + } + } + } + if (this._onScrollStop_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollStop_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollStopAttribute(this._onScrollStop_0_0value as VoidCallback | undefined); + this._onScrollStop_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollStop_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollStop_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollStopAttribute(undefined as VoidCallback | undefined); + } + } + } + if (this._scrollBar_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._scrollBar_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.scrollBarAttribute(this._scrollBar_0_0value as BarState | undefined); + this._scrollBar_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._scrollBar_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._scrollBar_0_flag = AttributeUpdaterFlag.INITIAL; + peer.scrollBarAttribute(undefined as BarState | undefined); + } + } + } + if (this._scrollBarColor_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._scrollBarColor_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.scrollBarColorAttribute(this._scrollBarColor_0_0value as Color | number | string | undefined); + this._scrollBarColor_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._scrollBarColor_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._scrollBarColor_0_flag = AttributeUpdaterFlag.INITIAL; + peer.scrollBarColorAttribute(undefined as Color | number | string | undefined); + } + } + } + if (this._scrollBarWidth_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._scrollBarWidth_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.scrollBarWidthAttribute(this._scrollBarWidth_0_0value as number | string | undefined); + this._scrollBarWidth_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._scrollBarWidth_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._scrollBarWidth_0_flag = AttributeUpdaterFlag.INITIAL; + peer.scrollBarWidthAttribute(undefined as number | string | undefined); + } + } + } + if (this._onScrollFrameBegin_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollFrameBegin_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollFrameBeginAttribute(this._onScrollFrameBegin_0_0value as OnScrollFrameBeginCallback | undefined); + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollFrameBeginAttribute(undefined as OnScrollFrameBeginCallback | undefined); + } + } + } + if (this._nestedScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._nestedScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.nestedScrollAttribute(this._nestedScroll_0_0value as NestedScrollOptions | undefined); + this._nestedScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._nestedScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._nestedScroll_0_flag = AttributeUpdaterFlag.INITIAL; + peer.nestedScrollAttribute(undefined as NestedScrollOptions | undefined); + } + } + } + if (this._enableScrollInteraction_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._enableScrollInteraction_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.enableScrollInteractionAttribute(this._enableScrollInteraction_0_0value as boolean | undefined); + this._enableScrollInteraction_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._enableScrollInteraction_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._enableScrollInteraction_0_flag = AttributeUpdaterFlag.INITIAL; + peer.enableScrollInteractionAttribute(undefined as boolean | undefined); + } + } + } + if (this._friction_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._friction_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.frictionAttribute(this._friction_0_0value as number | Resource | undefined); + this._friction_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._friction_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._friction_0_flag = AttributeUpdaterFlag.INITIAL; + peer.frictionAttribute(undefined as number | Resource | undefined); + } + } + } + if (this._scrollSnap_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._scrollSnap_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.scrollSnapAttribute(this._scrollSnap_0_0value as ScrollSnapOptions | undefined); + this._scrollSnap_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._scrollSnap_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._scrollSnap_0_flag = AttributeUpdaterFlag.INITIAL; + peer.scrollSnapAttribute(undefined as ScrollSnapOptions | undefined); + } + } + } + if (this._enablePaging_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._enablePaging_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.enablePagingAttribute(this._enablePaging_0_0value as boolean | undefined); + this._enablePaging_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._enablePaging_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._enablePaging_0_flag = AttributeUpdaterFlag.INITIAL; + peer.enablePagingAttribute(undefined as boolean | undefined); + } + } + } + if (this._initialOffset_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._initialOffset_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.initialOffsetAttribute(this._initialOffset_0_0value as OffsetOptions | undefined); + this._initialOffset_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._initialOffset_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._initialOffset_0_flag = AttributeUpdaterFlag.INITIAL; + peer.initialOffsetAttribute(undefined as OffsetOptions | undefined); + } + } + } + if (this._edgeEffect_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._edgeEffect_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.edgeEffectAttribute( + this._edgeEffect_0_0value as EdgeEffect | undefined, + this._edgeEffect_0_1value as EdgeEffectOptions | undefined + ); + this._edgeEffect_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._edgeEffect_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._edgeEffect_0_flag = AttributeUpdaterFlag.INITIAL; + peer.edgeEffectAttribute(undefined as EdgeEffect | undefined, undefined as EdgeEffectOptions | undefined | undefined); + } + } + } + } + mergeModifier(modifier: ScrollModifier): void { + super.mergeModifier(modifier); + if (modifier._scrollable_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._scrollable_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.scrollable(modifier._scrollable_0_0value); + break; + } + default: { + this.scrollable(undefined as ScrollDirection | undefined); + } + } + } + if (modifier._onWillScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onWillScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onWillScroll(modifier._onWillScroll_0_0value); + break; + } + default: { + this.onWillScroll(undefined as ScrollOnWillScrollCallback | undefined); + } + } + } + if (modifier._onDidScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onDidScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onDidScroll(modifier._onDidScroll_0_0value); + break; + } + default: { + this.onDidScroll(undefined as ScrollOnScrollCallback | undefined); + } + } + } + if (modifier._onScrollEdge_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollEdge_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollEdge(modifier._onScrollEdge_0_0value); + break; + } + default: { + this.onScrollEdge(undefined as OnScrollEdgeCallback | undefined); + } + } + } + if (modifier._onScrollStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollStart(modifier._onScrollStart_0_0value); + break; + } + default: { + this.onScrollStart(undefined as VoidCallback | undefined); + } + } + } + if (modifier._onScrollStop_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollStop_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollStop(modifier._onScrollStop_0_0value); + break; + } + default: { + this.onScrollStop(undefined as VoidCallback | undefined); + } + } + } + if (modifier._scrollBar_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._scrollBar_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.scrollBar(modifier._scrollBar_0_0value); + break; + } + default: { + this.scrollBar(undefined as BarState | undefined); + } + } + } + if (modifier._scrollBarColor_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._scrollBarColor_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.scrollBarColor(modifier._scrollBarColor_0_0value); + break; + } + default: { + this.scrollBarColor(undefined as Color | number | string | undefined); + } + } + } + if (modifier._scrollBarWidth_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._scrollBarWidth_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.scrollBarWidth(modifier._scrollBarWidth_0_0value); + break; + } + default: { + this.scrollBarWidth(undefined as number | string | undefined); + } + } + } + if (modifier._onScrollFrameBegin_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollFrameBegin_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollFrameBegin(modifier._onScrollFrameBegin_0_0value); + break; + } + default: { + this.onScrollFrameBegin(undefined as OnScrollFrameBeginCallback | undefined); + } + } + } + if (modifier._nestedScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._nestedScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.nestedScroll(modifier._nestedScroll_0_0value); + break; + } + default: { + this.nestedScroll(undefined as NestedScrollOptions | undefined); + } + } + } + if (modifier._enableScrollInteraction_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._enableScrollInteraction_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.enableScrollInteraction(modifier._enableScrollInteraction_0_0value); + break; + } + default: { + this.enableScrollInteraction(undefined as boolean | undefined); + } + } + } + if (modifier._friction_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._friction_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.friction(modifier._friction_0_0value); + break; + } + default: { + this.friction(undefined as number | Resource | undefined); + } + } + } + if (modifier._scrollSnap_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._scrollSnap_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.scrollSnap(modifier._scrollSnap_0_0value); + break; + } + default: { + this.scrollSnap(undefined as ScrollSnapOptions | undefined); + } + } + } + if (modifier._enablePaging_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._enablePaging_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.enablePaging(modifier._enablePaging_0_0value); + break; + } + default: { + this.enablePaging(undefined as boolean | undefined); + } + } + } + if (modifier._initialOffset_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._initialOffset_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.initialOffset(modifier._initialOffset_0_0value); + break; + } + default: { + this.initialOffset(undefined as OffsetOptions | undefined); + } + } + } + if (modifier._edgeEffect_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._edgeEffect_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.edgeEffect(modifier._edgeEffect_0_0value, modifier._edgeEffect_0_1value); + break; + } + default: { + this.edgeEffect(undefined as EdgeEffect | undefined, undefined as EdgeEffectOptions | undefined | undefined); + } + } + } + } + scrollable(value: ScrollDirection | undefined): this { + if (this._scrollable_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._scrollable_0_flag = AttributeUpdaterFlag.UPDATE; + this._scrollable_0_0value = value; + } else { + this._scrollable_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onWillScroll(value: ScrollOnWillScrollCallback | undefined): this { + if (this._onWillScroll_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onWillScroll_0_flag = AttributeUpdaterFlag.UPDATE; + this._onWillScroll_0_0value = value; + } else { + this._onWillScroll_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onDidScroll(value: ScrollOnScrollCallback | undefined): this { + if (this._onDidScroll_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onDidScroll_0_flag = AttributeUpdaterFlag.UPDATE; + this._onDidScroll_0_0value = value; + } else { + this._onDidScroll_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollEdge(value: OnScrollEdgeCallback | undefined): this { + if (this._onScrollEdge_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollEdge_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollEdge_0_0value = value; + } else { + this._onScrollEdge_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollStart(value: VoidCallback | undefined): this { + if (this._onScrollStart_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollStart_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollStart_0_0value = value; + } else { + this._onScrollStart_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollStop(value: VoidCallback | undefined): this { + if (this._onScrollStop_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollStop_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollStop_0_0value = value; + } else { + this._onScrollStop_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + scrollBar(value: BarState | undefined): this { + if (this._scrollBar_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._scrollBar_0_flag = AttributeUpdaterFlag.UPDATE; + this._scrollBar_0_0value = value; + } else { + this._scrollBar_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + scrollBarColor(value: Color | number | string | undefined): this { + if (this._scrollBarColor_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._scrollBarColor_0_flag = AttributeUpdaterFlag.UPDATE; + this._scrollBarColor_0_0value = value; + } else { + this._scrollBarColor_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + scrollBarWidth(value: number | string | undefined): this { + if (this._scrollBarWidth_0_flag == AttributeUpdaterFlag.INITIAL || this._scrollBarWidth_0_0value !== value) { + this._scrollBarWidth_0_flag = AttributeUpdaterFlag.UPDATE; + this._scrollBarWidth_0_0value = value; + } else { + this._scrollBarWidth_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollFrameBegin(value: OnScrollFrameBeginCallback | undefined): this { + if (this._onScrollFrameBegin_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollFrameBegin_0_0value = value; + } else { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + nestedScroll(value: NestedScrollOptions | undefined): this { + if (this._nestedScroll_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._nestedScroll_0_flag = AttributeUpdaterFlag.UPDATE; + this._nestedScroll_0_0value = value; + } else { + this._nestedScroll_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + enableScrollInteraction(value: boolean | undefined): this { + if (this._enableScrollInteraction_0_flag == AttributeUpdaterFlag.INITIAL || this._enableScrollInteraction_0_0value !== value) { + this._enableScrollInteraction_0_flag = AttributeUpdaterFlag.UPDATE; + this._enableScrollInteraction_0_0value = value; + } else { + this._enableScrollInteraction_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + friction(value: number | Resource | undefined): this { + if (this._friction_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._friction_0_flag = AttributeUpdaterFlag.UPDATE; + this._friction_0_0value = value; + } else { + this._friction_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + scrollSnap(value: ScrollSnapOptions | undefined): this { + if (this._scrollSnap_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._scrollSnap_0_flag = AttributeUpdaterFlag.UPDATE; + this._scrollSnap_0_0value = value; + } else { + this._scrollSnap_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + enablePaging(value: boolean | undefined): this { + if (this._enablePaging_0_flag == AttributeUpdaterFlag.INITIAL || this._enablePaging_0_0value !== value) { + this._enablePaging_0_flag = AttributeUpdaterFlag.UPDATE; + this._enablePaging_0_0value = value; + } else { + this._enablePaging_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + initialOffset(value: OffsetOptions | undefined): this { + if (this._initialOffset_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._initialOffset_0_flag = AttributeUpdaterFlag.UPDATE; + this._initialOffset_0_0value = value; + } else { + this._initialOffset_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + edgeEffect(edgeEffect: EdgeEffect | undefined, options?: EdgeEffectOptions): this { + if (this._edgeEffect_0_flag == AttributeUpdaterFlag.INITIAL || true || true) { + this._edgeEffect_0_flag = AttributeUpdaterFlag.UPDATE; + this._edgeEffect_0_0value = edgeEffect; + this._edgeEffect_0_1value = options; + } else { + this._edgeEffect_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ScrollableCommonMethodModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ScrollableCommonMethodModifier.ts new file mode 100644 index 0000000000000000000000000000000000000000..d84fccea716fe349a76b0e62a22ead798685f0f1 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ScrollableCommonMethodModifier.ts @@ -0,0 +1,700 @@ +/* + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! + +import { AttributeModifier } from './component/common'; + +import { AttributeUpdaterFlag, CommonMethodModifier } from './CommonMethodModifier'; +import { + ArkScrollableCommonMethodPeer, + CommonMethod, + NestedScrollOptions, + ContentClipMode, + EdgeEffectOptions, + FadingEdgeOptions, + ScrollableCommonMethod +} from './component/common'; +import { BarState, Color, CrownSensitivity, EdgeEffect } from './component/enums'; +import { Resource } from 'global.resource'; +import { RectShape } from '@ohos/arkui/shape'; +export class ScrollableCommonMethodModifier extends CommonMethodModifier implements ScrollableCommonMethod, AttributeModifier { + _instanceId: number = -1; + setInstanceId(instanceId: number): void { + this._instanceId = instanceId; + } + isUpdater: () => boolean = () => false; + applyNormalAttribute(instance: ScrollableCommonMethod): void {} + applyPressedAttribute(instance: ScrollableCommonMethod): void {} + applyFocusedAttribute(instance: ScrollableCommonMethod): void {} + applyDisabledAttribute(instance: ScrollableCommonMethod): void {} + applySelectedAttribute(instance: ScrollableCommonMethod): void {} + _scrollBar_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _scrollBar_0_0value?: BarState | undefined; + _scrollBarColor_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _scrollBarColor_0_0value?: Color | number | string | undefined; + _scrollBarWidth_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _scrollBarWidth_0_0value?: number | string | undefined; + _nestedScroll_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _nestedScroll_0_0value?: NestedScrollOptions | undefined; + _enableScrollInteraction_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _enableScrollInteraction_0_0value?: boolean | undefined; + _friction_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _friction_0_0value?: number | Resource | undefined; + _onReachStart_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onReachStart_0_0value?: (() => void) | undefined; + _onReachEnd_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onReachEnd_0_0value?: (() => void) | undefined; + _onScrollStart_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollStart_0_0value?: (() => void) | undefined; + _onScrollStop_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollStop_0_0value?: (() => void) | undefined; + _flingSpeedLimit_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _flingSpeedLimit_0_0value?: number | undefined; + _clipContent_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _clipContent_0_0value?: ContentClipMode | RectShape | undefined; + _digitalCrownSensitivity_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _digitalCrownSensitivity_0_0value?: CrownSensitivity | undefined; + _backToTop_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _backToTop_0_0value?: boolean | undefined; + _edgeEffect_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _edgeEffect_0_0value?: EdgeEffect | undefined; + _edgeEffect_0_1value?: EdgeEffectOptions | undefined; + _fadingEdge_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _fadingEdge_0_0value?: boolean | undefined; + _fadingEdge_0_1value?: FadingEdgeOptions | undefined; + applyModifierPatch(peer: ArkScrollableCommonMethodPeer): void { + super.applyModifierPatch(peer); + if (this._scrollBar_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._scrollBar_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.scrollBarAttribute(this._scrollBar_0_0value as BarState | undefined); + this._scrollBar_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._scrollBar_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._scrollBar_0_flag = AttributeUpdaterFlag.INITIAL; + peer.scrollBarAttribute(undefined as BarState | undefined); + } + } + } + if (this._scrollBarColor_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._scrollBarColor_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.scrollBarColorAttribute(this._scrollBarColor_0_0value as Color | number | string | undefined); + this._scrollBarColor_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._scrollBarColor_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._scrollBarColor_0_flag = AttributeUpdaterFlag.INITIAL; + peer.scrollBarColorAttribute(undefined as Color | number | string | undefined); + } + } + } + if (this._scrollBarWidth_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._scrollBarWidth_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.scrollBarWidthAttribute(this._scrollBarWidth_0_0value as number | string | undefined); + this._scrollBarWidth_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._scrollBarWidth_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._scrollBarWidth_0_flag = AttributeUpdaterFlag.INITIAL; + peer.scrollBarWidthAttribute(undefined as number | string | undefined); + } + } + } + if (this._nestedScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._nestedScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.nestedScrollAttribute(this._nestedScroll_0_0value as NestedScrollOptions | undefined); + this._nestedScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._nestedScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._nestedScroll_0_flag = AttributeUpdaterFlag.INITIAL; + peer.nestedScrollAttribute(undefined as NestedScrollOptions | undefined); + } + } + } + if (this._enableScrollInteraction_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._enableScrollInteraction_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.enableScrollInteractionAttribute(this._enableScrollInteraction_0_0value as boolean | undefined); + this._enableScrollInteraction_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._enableScrollInteraction_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._enableScrollInteraction_0_flag = AttributeUpdaterFlag.INITIAL; + peer.enableScrollInteractionAttribute(undefined as boolean | undefined); + } + } + } + if (this._friction_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._friction_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.frictionAttribute(this._friction_0_0value as number | Resource | undefined); + this._friction_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._friction_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._friction_0_flag = AttributeUpdaterFlag.INITIAL; + peer.frictionAttribute(undefined as number | Resource | undefined); + } + } + } + if (this._onReachStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onReachStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onReachStartAttribute(this._onReachStart_0_0value as (() => void) | undefined); + this._onReachStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onReachStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onReachStart_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onReachStartAttribute(undefined as (() => void) | undefined); + } + } + } + if (this._onReachEnd_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onReachEnd_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onReachEndAttribute(this._onReachEnd_0_0value as (() => void) | undefined); + this._onReachEnd_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onReachEnd_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onReachEnd_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onReachEndAttribute(undefined as (() => void) | undefined); + } + } + } + if (this._onScrollStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollStartAttribute(this._onScrollStart_0_0value as (() => void) | undefined); + this._onScrollStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollStart_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollStart_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollStartAttribute(undefined as (() => void) | undefined); + } + } + } + if (this._onScrollStop_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollStop_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollStopAttribute(this._onScrollStop_0_0value as (() => void) | undefined); + this._onScrollStop_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollStop_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollStop_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollStopAttribute(undefined as (() => void) | undefined); + } + } + } + if (this._flingSpeedLimit_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._flingSpeedLimit_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.flingSpeedLimitAttribute(this._flingSpeedLimit_0_0value as number | undefined); + this._flingSpeedLimit_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._flingSpeedLimit_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._flingSpeedLimit_0_flag = AttributeUpdaterFlag.INITIAL; + peer.flingSpeedLimitAttribute(undefined as number | undefined); + } + } + } + if (this._clipContent_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._clipContent_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.clipContentAttribute(this._clipContent_0_0value as ContentClipMode | RectShape | undefined); + this._clipContent_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._clipContent_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._clipContent_0_flag = AttributeUpdaterFlag.INITIAL; + peer.clipContentAttribute(undefined as ContentClipMode | RectShape | undefined); + } + } + } + if (this._digitalCrownSensitivity_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._digitalCrownSensitivity_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.digitalCrownSensitivityAttribute(this._digitalCrownSensitivity_0_0value as CrownSensitivity | undefined); + this._digitalCrownSensitivity_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._digitalCrownSensitivity_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._digitalCrownSensitivity_0_flag = AttributeUpdaterFlag.INITIAL; + peer.digitalCrownSensitivityAttribute(undefined as CrownSensitivity | undefined); + } + } + } + if (this._backToTop_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._backToTop_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.backToTopAttribute(this._backToTop_0_0value as boolean | undefined); + this._backToTop_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._backToTop_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._backToTop_0_flag = AttributeUpdaterFlag.INITIAL; + peer.backToTopAttribute(undefined as boolean | undefined); + } + } + } + if (this._edgeEffect_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._edgeEffect_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.edgeEffectAttribute( + this._edgeEffect_0_0value as EdgeEffect | undefined, + this._edgeEffect_0_1value as EdgeEffectOptions | undefined + ); + this._edgeEffect_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._edgeEffect_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._edgeEffect_0_flag = AttributeUpdaterFlag.INITIAL; + peer.edgeEffectAttribute(undefined as EdgeEffect | undefined, undefined as EdgeEffectOptions | undefined | undefined); + } + } + } + if (this._fadingEdge_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._fadingEdge_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.fadingEdgeAttribute( + this._fadingEdge_0_0value as boolean | undefined, + this._fadingEdge_0_1value as FadingEdgeOptions | undefined + ); + this._fadingEdge_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._fadingEdge_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._fadingEdge_0_flag = AttributeUpdaterFlag.INITIAL; + peer.fadingEdgeAttribute(undefined as boolean | undefined, undefined as FadingEdgeOptions | undefined | undefined); + } + } + } + } + mergeModifier(modifier: ScrollableCommonMethodModifier): void { + super.mergeModifier(modifier); + if (modifier._scrollBar_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._scrollBar_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.scrollBar(modifier._scrollBar_0_0value); + break; + } + default: { + this.scrollBar(undefined as BarState | undefined); + } + } + } + if (modifier._scrollBarColor_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._scrollBarColor_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.scrollBarColor(modifier._scrollBarColor_0_0value); + break; + } + default: { + this.scrollBarColor(undefined as Color | number | string | undefined); + } + } + } + if (modifier._scrollBarWidth_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._scrollBarWidth_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.scrollBarWidth(modifier._scrollBarWidth_0_0value); + break; + } + default: { + this.scrollBarWidth(undefined as number | string | undefined); + } + } + } + if (modifier._nestedScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._nestedScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.nestedScroll(modifier._nestedScroll_0_0value); + break; + } + default: { + this.nestedScroll(undefined as NestedScrollOptions | undefined); + } + } + } + if (modifier._enableScrollInteraction_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._enableScrollInteraction_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.enableScrollInteraction(modifier._enableScrollInteraction_0_0value); + break; + } + default: { + this.enableScrollInteraction(undefined as boolean | undefined); + } + } + } + if (modifier._friction_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._friction_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.friction(modifier._friction_0_0value); + break; + } + default: { + this.friction(undefined as number | Resource | undefined); + } + } + } + if (modifier._onReachStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onReachStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onReachStart(modifier._onReachStart_0_0value); + break; + } + default: { + this.onReachStart(undefined as (() => void) | undefined); + } + } + } + if (modifier._onReachEnd_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onReachEnd_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onReachEnd(modifier._onReachEnd_0_0value); + break; + } + default: { + this.onReachEnd(undefined as (() => void) | undefined); + } + } + } + if (modifier._onScrollStart_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollStart_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollStart(modifier._onScrollStart_0_0value); + break; + } + default: { + this.onScrollStart(undefined as (() => void) | undefined); + } + } + } + if (modifier._onScrollStop_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollStop_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollStop(modifier._onScrollStop_0_0value); + break; + } + default: { + this.onScrollStop(undefined as (() => void) | undefined); + } + } + } + if (modifier._flingSpeedLimit_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._flingSpeedLimit_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.flingSpeedLimit(modifier._flingSpeedLimit_0_0value); + break; + } + default: { + this.flingSpeedLimit(undefined as number | undefined); + } + } + } + if (modifier._clipContent_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._clipContent_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.clipContent(modifier._clipContent_0_0value); + break; + } + default: { + this.clipContent(undefined as ContentClipMode | RectShape | undefined); + } + } + } + if (modifier._digitalCrownSensitivity_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._digitalCrownSensitivity_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.digitalCrownSensitivity(modifier._digitalCrownSensitivity_0_0value); + break; + } + default: { + this.digitalCrownSensitivity(undefined as CrownSensitivity | undefined); + } + } + } + if (modifier._backToTop_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._backToTop_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.backToTop(modifier._backToTop_0_0value); + break; + } + default: { + this.backToTop(undefined as boolean | undefined); + } + } + } + if (modifier._edgeEffect_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._edgeEffect_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.edgeEffect(modifier._edgeEffect_0_0value, modifier._edgeEffect_0_1value); + break; + } + default: { + this.edgeEffect(undefined as EdgeEffect | undefined, undefined as EdgeEffectOptions | undefined | undefined); + } + } + } + if (modifier._fadingEdge_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._fadingEdge_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.fadingEdge(modifier._fadingEdge_0_0value, modifier._fadingEdge_0_1value); + break; + } + default: { + this.fadingEdge(undefined as boolean | undefined, undefined as FadingEdgeOptions | undefined | undefined); + } + } + } + } + scrollBar(value: BarState | undefined): this { + if (this._scrollBar_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._scrollBar_0_flag = AttributeUpdaterFlag.UPDATE; + this._scrollBar_0_0value = value; + } else { + this._scrollBar_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + scrollBarColor(value: Color | number | string | undefined): this { + if (this._scrollBarColor_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._scrollBarColor_0_flag = AttributeUpdaterFlag.UPDATE; + this._scrollBarColor_0_0value = value; + } else { + this._scrollBarColor_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + scrollBarWidth(value: number | string | undefined): this { + if (this._scrollBarWidth_0_flag == AttributeUpdaterFlag.INITIAL || this._scrollBarWidth_0_0value !== value) { + this._scrollBarWidth_0_flag = AttributeUpdaterFlag.UPDATE; + this._scrollBarWidth_0_0value = value; + } else { + this._scrollBarWidth_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + nestedScroll(value: NestedScrollOptions | undefined): this { + if (this._nestedScroll_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._nestedScroll_0_flag = AttributeUpdaterFlag.UPDATE; + this._nestedScroll_0_0value = value; + } else { + this._nestedScroll_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + enableScrollInteraction(value: boolean | undefined): this { + if (this._enableScrollInteraction_0_flag == AttributeUpdaterFlag.INITIAL || this._enableScrollInteraction_0_0value !== value) { + this._enableScrollInteraction_0_flag = AttributeUpdaterFlag.UPDATE; + this._enableScrollInteraction_0_0value = value; + } else { + this._enableScrollInteraction_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + friction(value: number | Resource | undefined): this { + if (this._friction_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._friction_0_flag = AttributeUpdaterFlag.UPDATE; + this._friction_0_0value = value; + } else { + this._friction_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onReachStart(value: (() => void) | undefined): this { + if (this._onReachStart_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onReachStart_0_flag = AttributeUpdaterFlag.UPDATE; + this._onReachStart_0_0value = value; + } else { + this._onReachStart_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onReachEnd(value: (() => void) | undefined): this { + if (this._onReachEnd_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onReachEnd_0_flag = AttributeUpdaterFlag.UPDATE; + this._onReachEnd_0_0value = value; + } else { + this._onReachEnd_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollStart(value: (() => void) | undefined): this { + if (this._onScrollStart_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollStart_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollStart_0_0value = value; + } else { + this._onScrollStart_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollStop(value: (() => void) | undefined): this { + if (this._onScrollStop_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollStop_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollStop_0_0value = value; + } else { + this._onScrollStop_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + flingSpeedLimit(value: number | undefined): this { + if (this._flingSpeedLimit_0_flag == AttributeUpdaterFlag.INITIAL || this._flingSpeedLimit_0_0value !== value) { + this._flingSpeedLimit_0_flag = AttributeUpdaterFlag.UPDATE; + this._flingSpeedLimit_0_0value = value; + } else { + this._flingSpeedLimit_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + clipContent(value: ContentClipMode | RectShape | undefined): this { + if (this._clipContent_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._clipContent_0_flag = AttributeUpdaterFlag.UPDATE; + this._clipContent_0_0value = value; + } else { + this._clipContent_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + digitalCrownSensitivity(value: CrownSensitivity | undefined): this { + if (this._digitalCrownSensitivity_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._digitalCrownSensitivity_0_flag = AttributeUpdaterFlag.UPDATE; + this._digitalCrownSensitivity_0_0value = value; + } else { + this._digitalCrownSensitivity_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + backToTop(value: boolean | undefined): this { + if (this._backToTop_0_flag == AttributeUpdaterFlag.INITIAL || this._backToTop_0_0value !== value) { + this._backToTop_0_flag = AttributeUpdaterFlag.UPDATE; + this._backToTop_0_0value = value; + } else { + this._backToTop_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + edgeEffect(edgeEffect: EdgeEffect | undefined, options?: EdgeEffectOptions): this { + if (this._edgeEffect_0_flag == AttributeUpdaterFlag.INITIAL || true || true) { + this._edgeEffect_0_flag = AttributeUpdaterFlag.UPDATE; + this._edgeEffect_0_0value = edgeEffect; + this._edgeEffect_0_1value = options; + } else { + this._edgeEffect_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + fadingEdge(enabled: boolean | undefined, options?: FadingEdgeOptions): this { + if (this._fadingEdge_0_flag == AttributeUpdaterFlag.INITIAL || this._fadingEdge_0_0value !== enabled || true) { + this._fadingEdge_0_flag = AttributeUpdaterFlag.UPDATE; + this._fadingEdge_0_0value = enabled; + this._fadingEdge_0_1value = options; + } else { + this._fadingEdge_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } +} \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/WaterFlowModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/WaterFlowModifier.ts new file mode 100644 index 0000000000000000000000000000000000000000..fa5387e78a1daae3690ab49fb2e1584f40f6a3c1 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/WaterFlowModifier.ts @@ -0,0 +1,524 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AttributeModifier } from './component/common'; +import { ScrollableCommonMethodModifier } from './ScrollableCommonMethodModifier'; +import { AttributeUpdaterFlag } from './CommonMethodModifier'; +import { ArkWaterFlowPeer, WaterFlowAttribute } from './component/waterFlow'; +import { OnWillScrollCallback, OnScrollCallback } from './component/common'; +import { ConstraintSizeOptions, Length } from './component/units'; +import { FlexDirection } from './component/enums'; +import { OnScrollFrameBeginCallback } from './component/scroll'; + +export class WaterFlowModifier extends ScrollableCommonMethodModifier implements WaterFlowAttribute, AttributeModifier { + _instanceId: number = -1; + setInstanceId(instanceId: number): void { + this._instanceId = instanceId; + } + isUpdater: () => boolean = () => false; + applyNormalAttribute(instance: WaterFlowAttribute): void {} + applyPressedAttribute(instance: WaterFlowAttribute): void {} + applyFocusedAttribute(instance: WaterFlowAttribute): void {} + applyDisabledAttribute(instance: WaterFlowAttribute): void {} + applySelectedAttribute(instance: WaterFlowAttribute): void {} + _columnsTemplate_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _columnsTemplate_0_0value?: string | undefined; + _itemConstraintSize_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _itemConstraintSize_0_0value?: ConstraintSizeOptions | undefined; + _rowsTemplate_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _rowsTemplate_0_0value?: string | undefined; + _columnsGap_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _columnsGap_0_0value?: Length | undefined; + _rowsGap_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _rowsGap_0_0value?: Length | undefined; + _layoutDirection_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _layoutDirection_0_0value?: FlexDirection | undefined; + _cachedCount_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _cachedCount_0_0value?: number | undefined; + _onScrollFrameBegin_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollFrameBegin_0_0value?: OnScrollFrameBeginCallback | undefined; + _onScrollIndex_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onScrollIndex_0_0value?: ((first: number, last: number) => void) | undefined; + _onWillScroll_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onWillScroll_0_0value?: OnWillScrollCallback | undefined; + _onDidScroll_0_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _onDidScroll_0_0value?: OnScrollCallback | undefined; + _cachedCount_1_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL; + _cachedCount_1_0value?: number | undefined; + _cachedCount_1_1value?: boolean | undefined; + applyModifierPatch(peer: ArkWaterFlowPeer): void { + super.applyModifierPatch(peer); + if (this._columnsTemplate_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._columnsTemplate_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.columnsTemplateAttribute(this._columnsTemplate_0_0value as string | undefined); + this._columnsTemplate_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._columnsTemplate_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._columnsTemplate_0_flag = AttributeUpdaterFlag.INITIAL; + peer.columnsTemplateAttribute(undefined as string | undefined); + } + } + } + if (this._itemConstraintSize_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._itemConstraintSize_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.itemConstraintSizeAttribute(this._itemConstraintSize_0_0value as ConstraintSizeOptions | undefined); + this._itemConstraintSize_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._itemConstraintSize_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._itemConstraintSize_0_flag = AttributeUpdaterFlag.INITIAL; + peer.itemConstraintSizeAttribute(undefined as ConstraintSizeOptions | undefined); + } + } + } + if (this._rowsTemplate_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._rowsTemplate_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.rowsTemplateAttribute(this._rowsTemplate_0_0value as string | undefined); + this._rowsTemplate_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._rowsTemplate_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._rowsTemplate_0_flag = AttributeUpdaterFlag.INITIAL; + peer.rowsTemplateAttribute(undefined as string | undefined); + } + } + } + if (this._columnsGap_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._columnsGap_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.columnsGapAttribute(this._columnsGap_0_0value as Length | undefined); + this._columnsGap_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._columnsGap_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._columnsGap_0_flag = AttributeUpdaterFlag.INITIAL; + peer.columnsGapAttribute(undefined as Length | undefined); + } + } + } + if (this._rowsGap_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._rowsGap_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.rowsGapAttribute(this._rowsGap_0_0value as Length | undefined); + this._rowsGap_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._rowsGap_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._rowsGap_0_flag = AttributeUpdaterFlag.INITIAL; + peer.rowsGapAttribute(undefined as Length | undefined); + } + } + } + if (this._layoutDirection_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._layoutDirection_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.layoutDirectionAttribute(this._layoutDirection_0_0value as FlexDirection | undefined); + this._layoutDirection_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._layoutDirection_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._layoutDirection_0_flag = AttributeUpdaterFlag.INITIAL; + peer.layoutDirectionAttribute(undefined as FlexDirection | undefined); + } + } + } + if (this._cachedCount_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._cachedCount_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.cachedCount0Attribute(this._cachedCount_0_0value as number | undefined); + this._cachedCount_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._cachedCount_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._cachedCount_0_flag = AttributeUpdaterFlag.INITIAL; + peer.cachedCount0Attribute(undefined as number | undefined); + } + } + } + if (this._onScrollFrameBegin_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollFrameBegin_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollFrameBeginAttribute(this._onScrollFrameBegin_0_0value as OnScrollFrameBeginCallback | undefined); + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollFrameBeginAttribute(undefined as OnScrollFrameBeginCallback | undefined); + } + } + } + if (this._onScrollIndex_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onScrollIndex_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onScrollIndexAttribute(this._onScrollIndex_0_0value as ((first: number, last: number) => void) | undefined); + this._onScrollIndex_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onScrollIndex_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onScrollIndex_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onScrollIndexAttribute(undefined as ((first: number, last: number) => void) | undefined); + } + } + } + if (this._onWillScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onWillScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onWillScrollAttribute(this._onWillScroll_0_0value as OnWillScrollCallback | undefined); + this._onWillScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onWillScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onWillScroll_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onWillScrollAttribute(undefined as OnWillScrollCallback | undefined); + } + } + } + if (this._onDidScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._onDidScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.onDidScrollAttribute(this._onDidScroll_0_0value as OnScrollCallback | undefined); + this._onDidScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._onDidScroll_0_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._onDidScroll_0_flag = AttributeUpdaterFlag.INITIAL; + peer.onDidScrollAttribute(undefined as OnScrollCallback | undefined); + } + } + } + if (this._cachedCount_1_flag != AttributeUpdaterFlag.INITIAL) { + switch (this._cachedCount_1_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.cachedCount1Attribute(this._cachedCount_1_0value as number | undefined, this._cachedCount_1_1value as boolean | undefined); + this._cachedCount_1_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._cachedCount_1_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._cachedCount_1_flag = AttributeUpdaterFlag.INITIAL; + peer.cachedCount1Attribute(undefined as number | undefined, undefined as boolean | undefined); + } + } + } + } + mergeModifier(modifier: WaterFlowModifier): void { + super.mergeModifier(modifier); + if (modifier._columnsTemplate_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._columnsTemplate_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.columnsTemplate(modifier._columnsTemplate_0_0value); + break; + } + default: { + this.columnsTemplate(undefined as string | undefined); + } + } + } + if (modifier._itemConstraintSize_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._itemConstraintSize_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.itemConstraintSize(modifier._itemConstraintSize_0_0value); + break; + } + default: { + this.itemConstraintSize(undefined as ConstraintSizeOptions | undefined); + } + } + } + if (modifier._rowsTemplate_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._rowsTemplate_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.rowsTemplate(modifier._rowsTemplate_0_0value); + break; + } + default: { + this.rowsTemplate(undefined as string | undefined); + } + } + } + if (modifier._columnsGap_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._columnsGap_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.columnsGap(modifier._columnsGap_0_0value); + break; + } + default: { + this.columnsGap(undefined as Length | undefined); + } + } + } + if (modifier._rowsGap_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._rowsGap_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.rowsGap(modifier._rowsGap_0_0value); + break; + } + default: { + this.rowsGap(undefined as Length | undefined); + } + } + } + if (modifier._layoutDirection_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._layoutDirection_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.layoutDirection(modifier._layoutDirection_0_0value); + break; + } + default: { + this.layoutDirection(undefined as FlexDirection | undefined); + } + } + } + if (modifier._cachedCount_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._cachedCount_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.cachedCount(modifier._cachedCount_0_0value); + break; + } + default: { + this.cachedCount(undefined as number | undefined); + } + } + } + if (modifier._onScrollFrameBegin_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollFrameBegin_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollFrameBegin(modifier._onScrollFrameBegin_0_0value); + break; + } + default: { + this.onScrollFrameBegin(undefined as OnScrollFrameBeginCallback | undefined); + } + } + } + if (modifier._onScrollIndex_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onScrollIndex_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onScrollIndex(modifier._onScrollIndex_0_0value); + break; + } + default: { + this.onScrollIndex(undefined as ((first: number, last: number) => void) | undefined); + } + } + } + if (modifier._onWillScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onWillScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onWillScroll(modifier._onWillScroll_0_0value); + break; + } + default: { + this.onWillScroll(undefined as OnWillScrollCallback | undefined); + } + } + } + if (modifier._onDidScroll_0_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._onDidScroll_0_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.onDidScroll(modifier._onDidScroll_0_0value); + break; + } + default: { + this.onDidScroll(undefined as OnScrollCallback | undefined); + } + } + } + if (modifier._cachedCount_1_flag != AttributeUpdaterFlag.INITIAL) { + switch (modifier._cachedCount_1_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.cachedCount(modifier._cachedCount_1_0value, modifier._cachedCount_1_1value); + break; + } + default: { + this.cachedCount(undefined as number | undefined, undefined as boolean | undefined); + } + } + } + } + columnsTemplate(value: string | undefined): this { + if (this._columnsTemplate_0_flag == AttributeUpdaterFlag.INITIAL || this._columnsTemplate_0_0value !== value) { + this._columnsTemplate_0_flag = AttributeUpdaterFlag.UPDATE; + this._columnsTemplate_0_0value = value; + } else { + this._columnsTemplate_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + itemConstraintSize(value: ConstraintSizeOptions | undefined): this { + if (this._itemConstraintSize_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._itemConstraintSize_0_flag = AttributeUpdaterFlag.UPDATE; + this._itemConstraintSize_0_0value = value; + } else { + this._itemConstraintSize_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + rowsTemplate(value: string | undefined): this { + if (this._rowsTemplate_0_flag == AttributeUpdaterFlag.INITIAL || this._rowsTemplate_0_0value !== value) { + this._rowsTemplate_0_flag = AttributeUpdaterFlag.UPDATE; + this._rowsTemplate_0_0value = value; + } else { + this._rowsTemplate_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + columnsGap(value: Length | undefined): this { + if (this._columnsGap_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._columnsGap_0_flag = AttributeUpdaterFlag.UPDATE; + this._columnsGap_0_0value = value; + } else { + this._columnsGap_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + rowsGap(value: Length | undefined): this { + if (this._rowsGap_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._rowsGap_0_flag = AttributeUpdaterFlag.UPDATE; + this._rowsGap_0_0value = value; + } else { + this._rowsGap_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + layoutDirection(value: FlexDirection | undefined): this { + if (this._layoutDirection_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._layoutDirection_0_flag = AttributeUpdaterFlag.UPDATE; + this._layoutDirection_0_0value = value; + } else { + this._layoutDirection_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + cachedCount(value: number | undefined): this { + if (this._cachedCount_0_flag == AttributeUpdaterFlag.INITIAL || this._cachedCount_0_0value !== value) { + this._cachedCount_0_flag = AttributeUpdaterFlag.UPDATE; + this._cachedCount_0_0value = value; + } else { + this._cachedCount_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollFrameBegin(value: OnScrollFrameBeginCallback | undefined): this { + if (this._onScrollFrameBegin_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollFrameBegin_0_0value = value; + } else { + this._onScrollFrameBegin_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onScrollIndex(value: ((first: number, last: number) => void) | undefined): this { + if (this._onScrollIndex_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onScrollIndex_0_flag = AttributeUpdaterFlag.UPDATE; + this._onScrollIndex_0_0value = value; + } else { + this._onScrollIndex_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onWillScroll(value: OnWillScrollCallback | undefined): this { + if (this._onWillScroll_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onWillScroll_0_flag = AttributeUpdaterFlag.UPDATE; + this._onWillScroll_0_0value = value; + } else { + this._onWillScroll_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + onDidScroll(value: OnScrollCallback | undefined): this { + if (this._onDidScroll_0_flag == AttributeUpdaterFlag.INITIAL || true) { + this._onDidScroll_0_flag = AttributeUpdaterFlag.UPDATE; + this._onDidScroll_0_0value = value; + } else { + this._onDidScroll_0_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } + cachedCount(count: number | undefined, show: boolean | undefined): this { + if (this._cachedCount_1_flag == AttributeUpdaterFlag.INITIAL || this._cachedCount_1_0value !== count || this._cachedCount_1_1value !== show) { + this._cachedCount_1_flag = AttributeUpdaterFlag.UPDATE; + this._cachedCount_1_0value = count; + this._cachedCount_1_1value = show; + } else { + this._cachedCount_1_flag = AttributeUpdaterFlag.SKIP; + } + return this; + } +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/common.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/common.ts index e4d010091699c54f1af3dd973da84f9f40cada53..99225452419e2a06f7b1c52df7fdf2a8ec61f354 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/common.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/common.ts @@ -70,6 +70,7 @@ import { hookCommonMethodGestureImpl, hookCommonMethodGestureModifierImpl, hookC hookCustomPropertyImpl } from "../handwritten/CommonHandWritten" import { CommonMethodModifier } from "../CommonMethodModifier" +import { ScrollableCommonMethodModifier } from '../ScrollableCommonMethodModifier' import { ICurve as ICurve_} from "#external" export type ICurve = ICurve_ export class ICurveInternal implements MaterializedBase,ICurve { @@ -6621,6 +6622,7 @@ export class ArkCommonShapeMethodPeer extends ArkCommonMethodPeer { } } export class ArkScrollableCommonMethodPeer extends ArkCommonMethodPeer { + _attributeSet?: ScrollableCommonMethodModifier; protected constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { super(peerPtr, id, name, flags) } @@ -9124,23 +9126,23 @@ export enum ContentClipMode { SAFE_AREA = 2 } export interface ScrollableCommonMethod extends CommonMethod { - scrollBar(value: BarState | undefined): this - scrollBarColor(value: Color | number | string | undefined): this - scrollBarWidth(value: number | string | undefined): this - nestedScroll(value: NestedScrollOptions | undefined): this - enableScrollInteraction(value: boolean | undefined): this - friction(value: number | Resource | undefined): this - onScroll(value: ((first: number,last: number) => void) | undefined): this - onReachStart(value: (() => void) | undefined): this - onReachEnd(value: (() => void) | undefined): this - onScrollStart(value: (() => void) | undefined): this - onScrollStop(value: (() => void) | undefined): this - flingSpeedLimit(value: number | undefined): this - clipContent(value: ContentClipMode | RectShape | undefined): this - digitalCrownSensitivity(value: CrownSensitivity | undefined): this - backToTop(value: boolean | undefined): this - edgeEffect(edgeEffect: EdgeEffect | undefined, options?: EdgeEffectOptions | undefined): this - fadingEdge(enabled: boolean | undefined, options?: FadingEdgeOptions | undefined): this + scrollBar(value: BarState | undefined): this { return this; } + scrollBarColor(value: Color | number | string | undefined): this { return this; } + scrollBarWidth(value: number | string | undefined): this { return this; } + nestedScroll(value: NestedScrollOptions | undefined): this { return this; } + enableScrollInteraction(value: boolean | undefined): this { return this; } + friction(value: number | Resource | undefined): this { return this; } + onScroll(value: ((first: number,last: number) => void) | undefined): this { return this; } + onReachStart(value: (() => void) | undefined): this { return this; } + onReachEnd(value: (() => void) | undefined): this { return this; } + onScrollStart(value: (() => void) | undefined): this { return this; } + onScrollStop(value: (() => void) | undefined): this { return this; } + flingSpeedLimit(value: number | undefined): this { return this; } + clipContent(value: ContentClipMode | RectShape | undefined): this { return this; } + digitalCrownSensitivity(value: CrownSensitivity | undefined): this { return this; } + backToTop(value: boolean | undefined): this { return this; } + edgeEffect(edgeEffect: EdgeEffect | undefined, options?: EdgeEffectOptions | undefined): this { return this; } + fadingEdge(enabled: boolean | undefined, options?: FadingEdgeOptions | undefined): this { return this; } } export class ArkScrollableCommonMethodStyle extends ArkCommonMethodStyle implements ScrollableCommonMethod { public scrollBar(value: BarState | undefined): this { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/grid.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/grid.ts index f5338786250d705e5d5f75dfa4d64e6be4b69ca6..f36b2d52b79c344dbf29446a28353e9352ca78ca 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/grid.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/grid.ts @@ -22,7 +22,8 @@ import { Serializer } from "./peers/Serializer" import { ComponentBase } from "./../ComponentBase" import { PeerNode } from "./../PeerNode" import { ArkUIGeneratedNativeModule, TypeChecker } from "#components" -import { ArkScrollableCommonMethodPeer, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, ArkScrollableCommonMethodComponent, ArkScrollableCommonMethodStyle, ArkCommonMethodComponent, ArkCommonMethodStyle, CommonMethod, OnWillScrollCallback, OnScrollCallback } from "./common" +import { ArkScrollableCommonMethodPeer, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, ArkScrollableCommonMethodComponent, + ArkScrollableCommonMethodStyle, ArkCommonMethodComponent, ArkCommonMethodStyle, CommonMethod, OnWillScrollCallback, OnScrollCallback, AttributeModifier } from "./common" import { Length } from "./units" import { Color, BarState, EdgeEffect } from "./enums" import { GridAttribute_onItemDragStart_event_type } from "./type-replacements" @@ -33,8 +34,11 @@ import { CallbackKind } from "./peers/CallbackKind" import { CallbackTransformer } from "./peers/CallbackTransformer" import { NodeAttach, remember } from "@koalaui/runtime" import { Tuple_Number_Number } from "./arkui-synthetics" +import { GridModifier } from "../GridModifier" +import { hookGridAttributeModifier } from '../handwritten' export class ArkGridPeer extends ArkScrollableCommonMethodPeer { + _attributeSet?:GridModifier; constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { super(peerPtr, id, name, flags) } @@ -596,42 +600,31 @@ export interface GridAttribute extends ScrollableCommonMethod { setGridOptions(scroller?: Scroller, layoutOptions?: GridLayoutOptions): this { return this } - columnsTemplate(value: string | undefined): this - rowsTemplate(value: string | undefined): this - columnsGap(value: Length | undefined): this - rowsGap(value: Length | undefined): this - scrollBarWidth(value: number | string | undefined): this - scrollBarColor(value: Color | number | string | undefined): this - scrollBar(value: BarState | undefined): this - onScrollBarUpdate(value: ((index: number,offset: number) => ComputedBarAttribute) | undefined): this - onScrollIndex(value: ((first: number,last: number) => void) | undefined): this - cachedCount(value: number | undefined):this - cachedCount(count: number | undefined, show: boolean | undefined): this - editMode(value: boolean | undefined): this - multiSelectable(value: boolean | undefined): this - maxCount(value: number | undefined): this - minCount(value: number | undefined): this - cellLength(value: number | undefined): this - layoutDirection(value: GridDirection | undefined): this - supportAnimation(value: boolean | undefined): this - onItemDragStart(value: ((event: ItemDragInfo,itemIndex: number) => CustomBuilder) | undefined): this - onItemDragEnter(value: ((event: ItemDragInfo) => void) | undefined): this - onItemDragMove(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number) => void) | undefined): this - onItemDragLeave(value: ((event: ItemDragInfo,itemIndex: number) => void) | undefined): this - onItemDrop(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number,isSuccess: boolean) => void) | undefined): this - nestedScroll(value: NestedScrollOptions | undefined): this - enableScrollInteraction(value: boolean | undefined): this - friction(value: number | Resource | undefined): this - alignItems(value: GridItemAlignment | undefined): this - onScroll(value: ((first: number,last: number) => void) | undefined): this - onReachStart(value: (() => void) | undefined): this - onReachEnd(value: (() => void) | undefined): this - onScrollStart(value: (() => void) | undefined): this - onScrollStop(value: (() => void) | undefined): this - onScrollFrameBegin(value: OnScrollFrameBeginCallback | undefined): this - onWillScroll(value: OnWillScrollCallback | undefined): this - onDidScroll(value: OnScrollCallback | undefined): this - edgeEffect(value: EdgeEffect | undefined, options?: EdgeEffectOptions | undefined): this + columnsTemplate(value: string | undefined): this { return this; } + rowsTemplate(value: string | undefined): this { return this; } + columnsGap(value: Length | undefined): this { return this; } + rowsGap(value: Length | undefined): this { return this; } + onScrollBarUpdate(value: ((index: number,offset: number) => ComputedBarAttribute) | undefined): this { return this;} + onScrollIndex(value: ((first: number,last: number) => void) | undefined): this { return this; } + cachedCount(value: number | undefined):this { return this; } + cachedCount(count: number | undefined, show: boolean | undefined): this { return this; } + editMode(value: boolean | undefined): this { return this; } + multiSelectable(value: boolean | undefined): this { return this; } + maxCount(value: number | undefined): this { return this; } + minCount(value: number | undefined): this { return this; } + cellLength(value: number | undefined): this { return this; } + layoutDirection(value: GridDirection | undefined): this { return this; } + supportAnimation(value: boolean | undefined): this { return this; } + onItemDragStart(value: ((event: ItemDragInfo,itemIndex: number) => CustomBuilder) | undefined): this { return this; } + onItemDragEnter(value: ((event: ItemDragInfo) => void) | undefined): this { return this; } + onItemDragMove(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number) => void) | undefined): this { return this; } + onItemDragLeave(value: ((event: ItemDragInfo,itemIndex: number) => void) | undefined): this { return this; } + onItemDrop(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number,isSuccess: boolean) => void) | undefined): this { return this; } + alignItems(value: GridItemAlignment | undefined): this { return this; } + onScrollFrameBegin(value: OnScrollFrameBeginCallback | undefined): this { return this; } + onWillScroll(value: OnWillScrollCallback | undefined): this { return this; } + onDidScroll(value: OnScrollCallback | undefined): this { return this; } + attributeModifier(value: AttributeModifier | AttributeModifier| undefined): this { return this;} } export class ArkGridStyle extends ArkScrollableCommonMethodStyle implements GridAttribute { columnsTemplate_value?: string | undefined @@ -1093,7 +1086,11 @@ export class ArkGridComponent extends ArkScrollableCommonMethodComponent impleme } return this } - + + public attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this { + hookGridAttributeModifier(this, modifier) + return this + } public applyAttributesFinish(): void { // we call this function outside of class, so need to make it public super.applyAttributesFinish() diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/gridItem.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/gridItem.ts index c94159df05d8b3586118c781512599396376c0b4..ba7e839a9551fca6e6dae5c223490c577b9ac178 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/gridItem.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/gridItem.ts @@ -22,15 +22,17 @@ import { Serializer } from "./peers/Serializer" import { ComponentBase } from "./../ComponentBase" import { PeerNode } from "./../PeerNode" import { ArkUIGeneratedNativeModule, TypeChecker } from "#components" -import { ArkCommonMethodPeer, CommonMethod, ArkCommonMethodComponent, ArkCommonMethodStyle, Bindable } from "./common" +import { ArkCommonMethodPeer, CommonMethod, ArkCommonMethodComponent, ArkCommonMethodStyle, Bindable, AttributeModifier } from "./common" import { Callback_Boolean_Void } from "./navigation" import { Callback_Opt_Boolean_Void } from "./checkbox" import { CallbackKind } from "./peers/CallbackKind" import { CallbackTransformer } from "./peers/CallbackTransformer" import { NodeAttach, remember } from "@koalaui/runtime" -import { GridItemOpsHandWritten } from "./../handwritten" +import { GridItemOpsHandWritten, hookGridItemAttributeModifier } from "./../handwritten" +import { GridItemModifier } from '../GridItemModifier' export class ArkGridItemPeer extends ArkCommonMethodPeer { + _attributeSet?:GridItemModifier; constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { super(peerPtr, id, name, flags) } @@ -167,16 +169,17 @@ export type GridItemInterface = (value?: GridItemOptions) => GridItemAttribute; export interface GridItemAttribute extends CommonMethod { setGridItemOptions(value?: GridItemOptions): this { return this - } - rowStart(value: number | undefined): this - rowEnd(value: number | undefined): this - columnStart(value: number | undefined): this - columnEnd(value: number | undefined): this - forceRebuild(value: boolean | undefined): this - selectable(value: boolean | undefined): this - selected(value: boolean | Bindable | undefined): this - onSelect(value: ((isVisible: boolean) => void) | undefined): this - _onChangeEvent_selected(callback: ((select: boolean | undefined) => void)): void + } + rowStart(value: number | undefined): this {return this;} + rowEnd(value: number | undefined): this {return this;} + columnStart(value: number | undefined): this {return this;} + columnEnd(value: number | undefined): this {return this;} + forceRebuild(value: boolean | undefined): this {return this;} + selectable(value: boolean | undefined): this {return this;} + selected(value: boolean | Bindable | undefined): this {return this;} + onSelect(value: ((isVisible: boolean) => void) | undefined): this {return this;} + _onChangeEvent_selected(callback: ((select: boolean | undefined) => void)): void {} + attributeModifier(value: AttributeModifier | AttributeModifier| undefined): this { return this;} } export class ArkGridItemStyle extends ArkCommonMethodStyle implements GridItemAttribute { rowStart_value?: number | undefined @@ -306,6 +309,10 @@ export class ArkGridItemComponent extends ArkCommonMethodComponent implements Gr } return } + public attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this { + hookGridItemAttributeModifier(this, modifier) + return this + } public applyAttributesFinish(): void { // we call this function outside of class, so need to make it public diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/list.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/list.ts index e0f5f1b0f9bd0b5999c1ea79febd6deb1c4015eb..a550942901a7c9a2771327c99fd6c41d461494f3 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/list.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/list.ts @@ -22,19 +22,19 @@ import { Serializer } from "./peers/Serializer" import { ComponentBase } from "./../ComponentBase" import { PeerNode } from "./../PeerNode" import { ArkUIGeneratedNativeModule, TypeChecker } from "#components" -import { ArkScrollableCommonMethodPeer, ScrollableCommonMethod, NestedScrollOptions, ChildrenMainSize, ItemDragInfo, CustomBuilder, EdgeEffectOptions, ArkScrollableCommonMethodComponent, ArkScrollableCommonMethodStyle, ArkCommonMethodComponent, ArkCommonMethodStyle, CommonMethod, RectResult, OnWillScrollCallback, OnScrollCallback } from "./common" +import { ArkScrollableCommonMethodPeer, ScrollableCommonMethod, NestedScrollOptions, ChildrenMainSize, ItemDragInfo, CustomBuilder, EdgeEffectOptions, + ArkScrollableCommonMethodComponent, ArkScrollableCommonMethodStyle, ArkCommonMethodComponent, ArkCommonMethodStyle, CommonMethod, RectResult, + OnWillScrollCallback, OnScrollCallback, AttributeModifier } from "./common" import { Axis, BarState, EdgeEffect } from "./enums" import { Resource } from "global.resource" -import { Callback_Number_Number_Void, Callback_ItemDragInfo_Void, Callback_ItemDragInfo_Number_Number_Void, Callback_ItemDragInfo_Number_Void, Callback_ItemDragInfo_Number_Number_Boolean_Void, Callback_Number_ScrollState_Literal_Number_offsetRemain, Literal_Number_offsetRemain } from "./grid" -import { ListAttribute_onItemDragStart_event_type } from "./type-replacements" import { LengthConstrain, Dimension, PX, VP, FP, LPX, Percentage, Length, ResourceColor } from "./units" -import { CallbackKind } from "./peers/CallbackKind" -import { CallbackTransformer } from "./peers/CallbackTransformer" import { NodeAttach, remember } from "@koalaui/runtime" import { OnScrollFrameBeginCallback, Scroller, ScrollerInternal, ScrollAlign } from "./scroll" import { Deserializer } from "./peers/Deserializer" -import { hookListChildrenMainSizeImpl } from "./../handwritten" +import { hookListChildrenMainSizeImpl, hookListAttributeModifier } from "./../handwritten" +import { ListModifier } from "../ListModifier" export class ArkListPeer extends ArkScrollableCommonMethodPeer { + _attributeSet?: ListModifier constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { super(peerPtr, id, name, flags) } @@ -646,45 +646,36 @@ export interface ListAttribute extends ScrollableCommonMethod { setListOptions(options?: ListOptions): this { return this } - alignListItem(value: ListItemAlign | undefined): this - listDirection(value: Axis | undefined): this - scrollBar(value: BarState | undefined): this - contentStartOffset(value: number | undefined): this - contentEndOffset(value: number | undefined): this - divider(value: ListDividerOptions | null | undefined): this - editMode(value: boolean | undefined): this - multiSelectable(value: boolean | undefined): this - cachedCount(count: number | undefined, show: boolean | undefined): this - cachedCount(value: number | undefined): this - chainAnimation(value: boolean | undefined): this - chainAnimationOptions(value: ChainAnimationOptions | undefined): this - sticky(value: StickyStyle | undefined): this - scrollSnapAlign(value: ScrollSnapAlign | undefined): this - nestedScroll(value: NestedScrollOptions | undefined): this - enableScrollInteraction(value: boolean | undefined): this - friction(value: number | Resource | undefined): this - childrenMainSize(value: ChildrenMainSize | undefined): this - maintainVisibleContentPosition(value: boolean | undefined): this - stackFromEnd(value: boolean | undefined): this - onScroll(value: ((first: number,last: number) => void) | undefined): this - onScrollIndex(value: ((start: number,end: number,center: number) => void) | undefined): this - onScrollVisibleContentChange(value: OnScrollVisibleContentChangeCallback | undefined): this - onReachStart(value: (() => void) | undefined): this - onReachEnd(value: (() => void) | undefined): this - onScrollStart(value: (() => void) | undefined): this - onScrollStop(value: (() => void) | undefined): this - onItemDelete(value: ((index: number) => boolean) | undefined): this - onItemMove(value: ((from: number,to: number) => boolean) | undefined): this - onItemDragStart(value: ((event: ItemDragInfo,itemIndex: number) => CustomBuilder) | undefined): this - onItemDragEnter(value: ((event: ItemDragInfo) => void) | undefined): this - onItemDragMove(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number) => void) | undefined): this - onItemDragLeave(value: ((event: ItemDragInfo,itemIndex: number) => void) | undefined): this - onItemDrop(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number,isSuccess: boolean) => void) | undefined): this - onScrollFrameBegin(value: OnScrollFrameBeginCallback | undefined): this - onWillScroll(value: OnWillScrollCallback | undefined): this - onDidScroll(value: OnScrollCallback | undefined): this - lanes(value: number | LengthConstrain | undefined, gutter?: Dimension): this - edgeEffect(value: EdgeEffect | undefined, options?: EdgeEffectOptions): this + alignListItem(value: ListItemAlign | undefined): this { return this; } + listDirection(value: Axis | undefined): this { return this; } + contentStartOffset(value: number | undefined): this { return this; } + contentEndOffset(value: number | undefined): this { return this; } + divider(value: ListDividerOptions | null | undefined): this { return this; } + editMode(value: boolean | undefined): this { return this; } + multiSelectable(value: boolean | undefined): this { return this; } + cachedCount(count: number | undefined, show: boolean | undefined): this { return this; } + cachedCount(value: number | undefined): this { return this; } + chainAnimation(value: boolean | undefined): this { return this; } + chainAnimationOptions(value: ChainAnimationOptions | undefined): this { return this; } + sticky(value: StickyStyle | undefined): this { return this; } + scrollSnapAlign(value: ScrollSnapAlign | undefined): this { return this; } + childrenMainSize(value: ChildrenMainSize | undefined): this { return this; } + maintainVisibleContentPosition(value: boolean | undefined): this { return this; } + stackFromEnd(value: boolean | undefined): this { return this; } + onScrollIndex(value: ((start: number,end: number,center: number) => void) | undefined): this { return this; } + onScrollVisibleContentChange(value: OnScrollVisibleContentChangeCallback | undefined): this { return this; } + onItemDelete(value: ((index: number) => boolean) | undefined): this { return this; } + onItemMove(value: ((from: number,to: number) => boolean) | undefined): this { return this; } + onItemDragStart(value: ((event: ItemDragInfo,itemIndex: number) => CustomBuilder) | undefined): this { return this; } + onItemDragEnter(value: ((event: ItemDragInfo) => void) | undefined): this { return this; } + onItemDragMove(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number) => void) | undefined): this { return this; } + onItemDragLeave(value: ((event: ItemDragInfo,itemIndex: number) => void) | undefined): this { return this; } + onItemDrop(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number,isSuccess: boolean) => void) | undefined): this { return this; } + onScrollFrameBegin(value: OnScrollFrameBeginCallback | undefined): this { return this; } + onWillScroll(value: OnWillScrollCallback | undefined): this { return this; } + onDidScroll(value: OnScrollCallback | undefined): this { return this; } + lanes(value: number | LengthConstrain | undefined, gutter?: Dimension): this { return this; } + attributeModifier(value: AttributeModifier | AttributeModifier| undefined): this { return this;} } export class ArkListStyle extends ArkScrollableCommonMethodStyle implements ListAttribute { alignListItem_value?: ListItemAlign | undefined @@ -1186,7 +1177,10 @@ export class ArkListComponent extends ArkScrollableCommonMethodComponent impleme } return this } - + public attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this { + hookListAttributeModifier(this, modifier) + return this + } public applyAttributesFinish(): void { // we call this function outside of class, so need to make it public super.applyAttributesFinish() diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/listItem.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/listItem.ts index b54c9c0bbf90b15753f4635df1d77f2bd3814f03..f78ab413b6256e1617bab525930c52fe55377e46 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/listItem.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/listItem.ts @@ -22,18 +22,15 @@ import { Serializer } from "./peers/Serializer" import { ComponentBase } from "./../ComponentBase" import { PeerNode } from "./../PeerNode" import { ArkUIGeneratedNativeModule, TypeChecker } from "#components" -import { ArkCommonMethodPeer, CommonMethod, CustomBuilder, ArkCommonMethodComponent, ArkCommonMethodStyle, Bindable } from "./common" -import { Callback_Boolean_Void } from "./navigation" -import { Callback_Opt_Boolean_Void } from "./checkbox" -import { CallbackKind } from "./peers/CallbackKind" -import { CallbackTransformer } from "./peers/CallbackTransformer" +import { ArkCommonMethodPeer, CommonMethod, CustomBuilder, ArkCommonMethodComponent, ArkCommonMethodStyle, Bindable, AttributeModifier } from "./common" import { NodeAttach, remember } from "@koalaui/runtime" import { ComponentContent } from "./arkui-custom" import { Length } from "./units" -import { Callback_Number_Void } from "./alphabetIndexer" -import { ListItemOpsHandWritten } from "./../handwritten" +import { ListItemOpsHandWritten, hookListItemAttributeModifier } from "./../handwritten" +import { ListItemModifier } from '../ListItemModifier' export class ArkListItemPeer extends ArkCommonMethodPeer { + _attributeSet?: ListItemModifier constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { super(peerPtr, id, name, flags) } @@ -212,13 +209,14 @@ export interface ListItemAttribute extends CommonMethod { setListItemOptions(value?: ListItemOptions | string): this { return this } - sticky(value: Sticky | undefined): this - editable(value: boolean | EditMode | undefined): this - selectable(value: boolean | undefined): this - selected(value: boolean | Bindable | undefined): this - swipeAction(value: SwipeActionOptions | undefined): this - onSelect(value: ((isVisible: boolean) => void) | undefined): this - _onChangeEvent_selected(callback: ((select: boolean | undefined) => void)): void + sticky(value: Sticky | undefined): this { return this; } + editable(value: boolean | EditMode | undefined): this { return this; } + selectable(value: boolean | undefined): this { return this; } + selected(value: boolean | Bindable | undefined): this { return this; } + swipeAction(value: SwipeActionOptions | undefined): this { return this; } + onSelect(value: ((isVisible: boolean) => void) | undefined): this { return this; } + _onChangeEvent_selected(callback: ((select: boolean | undefined) => void)): void {} + attributeModifier(value: AttributeModifier | AttributeModifier| undefined): this { return this;} } export class ArkListItemStyle extends ArkCommonMethodStyle implements ListItemAttribute { sticky_value?: Sticky | undefined @@ -333,7 +331,10 @@ export class ArkListItemComponent extends ArkCommonMethodComponent implements Li } return } - + public attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this { + hookListItemAttributeModifier(this, modifier) + return this + } public applyAttributesFinish(): void { // we call this function outside of class, so need to make it public super.applyAttributesFinish() diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/listItemGroup.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/listItemGroup.ts index 46daac1bb6a57a8cbe2894e527cfff0b02e39f16..3e950f9815cd62cb387e4f0037cd7011f32a4195 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/listItemGroup.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/listItemGroup.ts @@ -22,15 +22,17 @@ import { Serializer } from "./peers/Serializer" import { ComponentBase } from "./../ComponentBase" import { PeerNode } from "./../PeerNode" import { ArkUIGeneratedNativeModule, TypeChecker } from "#components" -import { ArkCommonMethodPeer, CommonMethod, ChildrenMainSize, CustomBuilder, ArkCommonMethodComponent, ArkCommonMethodStyle } from "./common" +import { ArkCommonMethodPeer, CommonMethod, ChildrenMainSize, CustomBuilder, ArkCommonMethodComponent, ArkCommonMethodStyle, AttributeModifier } from "./common" import { ListDividerOptions } from "./list" import { CallbackKind } from "./peers/CallbackKind" import { CallbackTransformer } from "./peers/CallbackTransformer" import { NodeAttach, remember } from "@koalaui/runtime" import { ComponentContent } from "./arkui-custom" -import { hookListItemGroupChildrenMainSizeImpl } from "./../handwritten" +import { hookListItemGroupChildrenMainSizeImpl, hookListItemGroupAttributeModifier } from "./../handwritten" +import { ListItemGroupModifier } from '../ListItemGroupModifier' export class ArkListItemGroupPeer extends ArkCommonMethodPeer { + _attributeSet?: ListItemGroupModifier constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { super(peerPtr, id, name, flags) } @@ -95,8 +97,9 @@ export interface ListItemGroupAttribute extends CommonMethod { setListItemGroupOptions(options?: ListItemGroupOptions): this { return this } - divider(value: ListDividerOptions | null | undefined): this - childrenMainSize(value: ChildrenMainSize | undefined): this + divider(value: ListDividerOptions | null | undefined): this { return this; } + childrenMainSize(value: ChildrenMainSize | undefined): this { return this; } + attributeModifier(value: AttributeModifier | AttributeModifier| undefined): this { return this;} } export class ArkListItemGroupStyle extends ArkCommonMethodStyle implements ListItemGroupAttribute { divider_value?: ListDividerOptions | null | undefined @@ -138,7 +141,10 @@ export class ArkListItemGroupComponent extends ArkCommonMethodComponent implemen } return this } - + public attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this { + hookListItemGroupAttributeModifier(this, modifier) + return this + } public applyAttributesFinish(): void { // we call this function outside of class, so need to make it public super.applyAttributesFinish() diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/refresh.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/refresh.ts index c89619ec0942367ac1a2f89140d4a3426769c7ca..3d5a9229d62e817524d93c7570adcb3cab8e9951 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/refresh.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/refresh.ts @@ -22,7 +22,7 @@ import { Serializer } from "./peers/Serializer" import { ComponentBase } from "./../ComponentBase" import { PeerNode } from "./../PeerNode" import { ArkUIGeneratedNativeModule, TypeChecker } from "#components" -import { ArkCommonMethodPeer, CommonMethod, CustomBuilder, ArkCommonMethodComponent, ArkCommonMethodStyle, Bindable } from "./common" +import { ArkCommonMethodPeer, CommonMethod, CustomBuilder, ArkCommonMethodComponent, ArkCommonMethodStyle, Bindable, AttributeModifier } from "./common" import { Callback_Number_Void } from "./alphabetIndexer" import { Callback_Boolean_Void } from "./navigation" import { CallbackKind } from "./peers/CallbackKind" @@ -31,8 +31,10 @@ import { NodeAttach, remember } from "@koalaui/runtime" import { ResourceStr } from "./units" import { ComponentContent } from "./arkui-custom" import { RefreshOpsHandWritten } from "./../handwritten" - +import { hookRefreshAttributeModifier } from '../handwritten' +import { RefreshModifier } from '../RefreshModifier' export class ArkRefreshPeer extends ArkCommonMethodPeer { + _attributeSet?: RefreshModifier protected constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { super(peerPtr, id, name, flags) } @@ -154,13 +156,14 @@ export interface RefreshAttribute extends CommonMethod { setRefreshOptions(value: RefreshOptions): this { return this } - onStateChange(value: ((state: RefreshStatus) => void) | undefined): this - onRefreshing(value: (() => void) | undefined): this - refreshOffset(value: number | undefined): this - pullToRefresh(value: boolean | undefined): this - onOffsetChange(value: ((index: number) => void) | undefined): this - pullDownRatio(value: number | undefined): this - _onChangeEvent_refreshing(callback: ((isVisible: boolean) => void)): void + onStateChange(value: ((state: RefreshStatus) => void) | undefined): this { return this; } + onRefreshing(value: (() => void) | undefined): this { return this; } + refreshOffset(value: number | undefined): this { return this; } + pullToRefresh(value: boolean | undefined): this { return this; } + onOffsetChange(value: ((index: number) => void) | undefined): this { return this; } + pullDownRatio(value: number | undefined): this { return this; } + _onChangeEvent_refreshing(callback: ((isVisible: boolean) => void)): void {} + attributeModifier(value: AttributeModifier | AttributeModifier| undefined): this { return this;} } export class ArkRefreshStyle extends ArkCommonMethodStyle implements RefreshAttribute { onStateChange_value?: ((state: RefreshStatus) => void) | undefined @@ -275,6 +278,10 @@ export class ArkRefreshComponent extends ArkCommonMethodComponent implements Ref } return } + public attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this { + hookRefreshAttributeModifier(this, modifier) + return this + } public applyAttributesFinish(): void { // we call this function outside of class, so need to make it public diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/scroll.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/scroll.ts index cfd7611d01f4875146902d6398d705659b25cd89..52e3cefd3d3d7b169ebdbfbc4d54271f24d6c315 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/scroll.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/scroll.ts @@ -18,7 +18,7 @@ import { Edge, Axis, ScrollSource, BarState, Color, EdgeEffect, Curve } from "./enums" import { Length, VoidCallback, Dimension } from "./units" -import { RectResult, ArkScrollableCommonMethodPeer, ScrollableCommonMethod, NestedScrollOptions, EdgeEffectOptions, ICurve, ArkScrollableCommonMethodComponent, ArkScrollableCommonMethodStyle, ArkCommonMethodComponent, ArkCommonMethodStyle, CommonMethod } from "./common" +import { RectResult, ArkScrollableCommonMethodPeer, ScrollableCommonMethod, NestedScrollOptions, EdgeEffectOptions, ICurve, ArkScrollableCommonMethodComponent, ArkScrollableCommonMethodStyle, AttributeModifier, ArkCommonMethodStyle, CommonMethod } from "./common" import { Resource } from "global.resource" import { TypeChecker, ArkUIGeneratedNativeModule } from "#components" import { Finalizable, runtimeType, RuntimeType, SerializerBase, registerCallback, wrapCallback, toPeerPtr, KPointer, MaterializedBase, NativeBuffer, nullptr, KInt, KBoolean, KStringPtr } from "@koalaui/interop" @@ -33,6 +33,8 @@ import { Callback_Number_Number_Void } from "./grid" import { ScrollState, ScrollSnapAlign } from "./list" import { NodeAttach, remember } from "@koalaui/runtime" import { LengthMetrics } from "../Graphics" +import { hookScrollAttributeModifier } from '../handwritten' +import { ScrollModifier } from "../ScrollModifier" export class ScrollerInternal { public static fromPtr(ptr: KPointer): Scroller { @@ -241,6 +243,7 @@ export class Scroller implements MaterializedBase { } } export class ArkScrollPeer extends ArkScrollableCommonMethodPeer { + _attributeSet?: ScrollModifier; constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { super(peerPtr, id, name, flags) } @@ -601,25 +604,25 @@ export interface ScrollAttribute extends ScrollableCommonMethod { setScrollOptions(scroller?: Scroller): this { return this } - scrollable(value: ScrollDirection | undefined): this - onScroll(value: ((first: number,last: number) => void) | undefined): this - onWillScroll(value: ScrollOnWillScrollCallback | undefined): this - onDidScroll(value: ScrollOnScrollCallback | undefined): this - onScrollEdge(value: OnScrollEdgeCallback | undefined): this - onScrollStart(value: VoidCallback | undefined): this - onScrollEnd(value: (() => void) | undefined): this - onScrollStop(value: VoidCallback | undefined): this - scrollBar(value: BarState | undefined): this - scrollBarColor(value: Color | number | string | undefined): this - scrollBarWidth(value: number | string | undefined): this - onScrollFrameBegin(value: OnScrollFrameBeginCallback | undefined): this - nestedScroll(value: NestedScrollOptions | undefined): this - enableScrollInteraction(value: boolean | undefined): this - friction(value: number | Resource | undefined): this - scrollSnap(value: ScrollSnapOptions | undefined): this - enablePaging(value: boolean | undefined): this - initialOffset(value: OffsetOptions | undefined): this - edgeEffect(edgeEffect: EdgeEffect | undefined, options?: EdgeEffectOptions | undefined): this + scrollable(value: ScrollDirection | undefined): this { return this; } + onWillScroll(value: ScrollOnWillScrollCallback | undefined): this { return this; } + onDidScroll(value: ScrollOnScrollCallback | undefined): this { return this; } + onScrollEdge(value: OnScrollEdgeCallback | undefined): this { return this; } + onScrollStart(value: VoidCallback | undefined): this { return this; } + onScrollEnd(value: (() => void) | undefined): this { return this; } + onScrollStop(value: VoidCallback | undefined): this { return this; } + scrollBar(value: BarState | undefined): this { return this; } + scrollBarColor(value: Color | number | string | undefined): this { return this; } + scrollBarWidth(value: number | string | undefined): this { return this; } + onScrollFrameBegin(value: OnScrollFrameBeginCallback | undefined): this { return this; } + nestedScroll(value: NestedScrollOptions | undefined): this { return this; } + enableScrollInteraction(value: boolean | undefined): this { return this; } + friction(value: number | Resource | undefined): this { return this; } + scrollSnap(value: ScrollSnapOptions | undefined): this { return this; } + enablePaging(value: boolean | undefined): this { return this; } + initialOffset(value: OffsetOptions | undefined): this { return this; } + edgeEffect(edgeEffect: EdgeEffect | undefined, options?: EdgeEffectOptions | undefined): this { return this; } + attributeModifier(value: AttributeModifier | AttributeModifier| undefined): this { return this;} } export class ArkScrollStyle extends ArkScrollableCommonMethodStyle implements ScrollAttribute { scrollable_value?: ScrollDirection | undefined @@ -868,6 +871,10 @@ export class ArkScrollComponent extends ArkScrollableCommonMethodComponent imple } return this } + public attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this { + hookScrollAttributeModifier(this, modifier) + return this + } public applyAttributesFinish(): void { // we call this function outside of class, so need to make it public diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/waterFlow.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/waterFlow.ts index b470bdc1be73ce27b3e358941b99f69af92fbf05..4441a4caad125f98ed52a2b177ae8e7a81b128c7 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/waterFlow.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/waterFlow.ts @@ -17,26 +17,24 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! import { TypeChecker, ArkUIGeneratedNativeModule } from "#components" -import { Finalizable, runtimeType, RuntimeType, SerializerBase, registerCallback, wrapCallback, toPeerPtr, KPointer, MaterializedBase, NativeBuffer, nullptr, KInt, KBoolean, KStringPtr } from "@koalaui/interop" +import { Finalizable, runtimeType, RuntimeType, KPointer } from "@koalaui/interop" import { unsafeCast, int32, int64, float32 } from "@koalaui/common" import { Serializer } from "./peers/Serializer" -import { CallbackKind } from "./peers/CallbackKind" -import { Deserializer } from "./peers/Deserializer" -import { CallbackTransformer } from "./peers/CallbackTransformer" import { ComponentBase } from "./../ComponentBase" import { PeerNode } from "./../PeerNode" -import { ArkScrollableCommonMethodPeer, ScrollableCommonMethod, NestedScrollOptions, CustomBuilder, ArkScrollableCommonMethodComponent, ArkScrollableCommonMethodStyle, ArkCommonMethodComponent, ArkCommonMethodStyle, CommonMethod, OnWillScrollCallback, OnScrollCallback } from "./common" +import { ArkScrollableCommonMethodPeer, ScrollableCommonMethod, NestedScrollOptions, CustomBuilder, ArkScrollableCommonMethodComponent, ArkScrollableCommonMethodStyle, AttributeModifier , CommonMethod, OnWillScrollCallback, OnScrollCallback } from "./common" import { ConstraintSizeOptions, Length, Dimension, Padding } from "./units" import { FlexDirection } from "./enums" import { Resource } from "global.resource" -import { Callback_Number_ScrollState_Literal_Number_offsetRemain, Literal_Number_offsetRemain, Callback_Number_Number_Void } from "./grid" -import { ScrollState } from "./list" import { NodeAttach, remember } from "@koalaui/runtime" import { ComponentContent } from "./arkui-custom" import { Scroller, OnScrollFrameBeginCallback } from "./scroll" import { WaterFlowHandWritten } from "../handwritten/WaterFlowImpl" +import { WaterFlowModifier } from "../WaterFlowModifier" +import { hookWaterFlowAttributeModifier } from "../handwritten" export class ArkWaterFlowPeer extends ArkScrollableCommonMethodPeer { + _attributeSet?: WaterFlowModifier constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { super(peerPtr, id, name, flags) } @@ -311,23 +309,19 @@ export interface WaterFlowAttribute extends ScrollableCommonMethod { setWaterFlowOptions(options?: WaterFlowOptions): this { return this } - columnsTemplate(value: string | undefined): this - itemConstraintSize(value: ConstraintSizeOptions | undefined): this - rowsTemplate(value: string | undefined): this - columnsGap(value: Length | undefined): this - rowsGap(value: Length | undefined): this - layoutDirection(value: FlexDirection | undefined): this - nestedScroll(value: NestedScrollOptions | undefined): this - enableScrollInteraction(value: boolean | undefined): this - friction(value: number | Resource | undefined): this - cachedCount(count: number | undefined, show?: boolean): this - cachedCount(value: number | undefined): this - onReachStart(value: (() => void) | undefined): this - onReachEnd(value: (() => void) | undefined): this - onScrollFrameBegin(value: OnScrollFrameBeginCallback | undefined): this - onScrollIndex(value: ((first: number,last: number) => void) | undefined): this - onWillScroll(value: OnWillScrollCallback | undefined): this - onDidScroll(value: OnScrollCallback | undefined): this + columnsTemplate(value: string | undefined): this { return this; } + itemConstraintSize(value: ConstraintSizeOptions | undefined): this { return this; } + rowsTemplate(value: string | undefined): this { return this; } + columnsGap(value: Length | undefined): this { return this; } + rowsGap(value: Length | undefined): this { return this; } + layoutDirection(value: FlexDirection | undefined): this { return this; } + cachedCount(count: number | undefined, show?: boolean): this { return this; } + cachedCount(value: number | undefined): this { return this; } + onScrollFrameBegin(value: OnScrollFrameBeginCallback | undefined): this { return this; } + onScrollIndex(value: ((first: number,last: number) => void) | undefined): this { return this; } + onWillScroll(value: OnWillScrollCallback | undefined): this { return this; } + onDidScroll(value: OnScrollCallback | undefined): this { return this; } + attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this { return this; } } export class ArkWaterFlowStyle extends ArkScrollableCommonMethodStyle implements WaterFlowAttribute { columnsTemplate_value?: string | undefined @@ -564,6 +558,11 @@ export class ArkWaterFlowComponent extends ArkScrollableCommonMethodComponent im } return this } + + public attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this { + hookWaterFlowAttributeModifier(this, modifier) + return this + } public applyAttributesFinish(): void { // we call this function outside of class, so need to make it public diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/AttributeModifierOpsHandWritten.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/AttributeModifierOpsHandWritten.ts index c160c0801021caf9c32e77781c7b7ee4551765de..bd99b869cf80030ad1f060e05edfa49acb8d162e 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/AttributeModifierOpsHandWritten.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/AttributeModifierOpsHandWritten.ts @@ -48,6 +48,23 @@ import { StackModifier } from '../StackModifier'; import { SymbolGlyphModifier } from '../SymbolGlyphModifier'; import { Resource } from 'global.resource'; import { runtimeType, RuntimeType } from '@koalaui/interop'; +import { ArkGridComponent, GridAttribute } from '../component/grid'; +import { GridModifier } from '../GridModifier'; +import { ArkGridItemComponent, GridItemAttribute } from '../component/gridItem'; +import { GridItemModifier } from '../GridItemModifier'; +import { ArkListComponent, ListAttribute } from '../component/list'; +import { ListModifier } from '../ListModifier'; +import { ArkListItemComponent, ListItemAttribute } from '../component/listItem'; +import { ListItemModifier } from '../ListItemModifier'; +import { ArkListItemGroupComponent, ListItemGroupAttribute } from '../component/listItemGroup'; +import { ListItemGroupModifier } from '../ListItemGroupModifier'; +import { ArkRefreshComponent, RefreshAttribute } from '../component/refresh'; +import { RefreshModifier } from '../RefreshModifier'; +import { ArkScrollComponent, ScrollAttribute } from '../component/scroll'; +import { ScrollModifier } from '../ScrollModifier'; +import { ArkWaterFlowComponent, WaterFlowAttribute } from '../component/waterFlow'; +import { WaterFlowModifier } from '../WaterFlowModifier'; + export function hookButtonAttributeModifier(component: ArkButtonComponent, modifier: AttributeModifier | AttributeModifier | undefined): void { if (modifier === undefined) { @@ -570,3 +587,273 @@ export function hookSymbolGlyphAttributeModifier(component: ArkSymbolGlyphCompon }; applyAttributeModifierBase(modifier as Object as AttributeModifier, attributeSet, constructParam, updaterReceiver, component.getPeer()); } + +export function hookGridAttributeModifier(component: ArkGridComponent, + modifier: AttributeModifier | AttributeModifier | undefined): void { + if (modifier === undefined) { + return; + } + let isCommonModifier: boolean = modifier instanceof CommonModifier; + if (isCommonModifier) { + applyCommonModifier(component.getPeer(), modifier as Object as AttributeModifier); + return; + } + let attributeSet = (): GridModifier => { + let isGridModifier: boolean = modifier instanceof GridModifier; + let initModifier = component.getPeer()._attributeSet ? component.getPeer()._attributeSet! : new GridModifier(); + if (isGridModifier) { + let gridModifier = modifier as object as GridModifier; + initModifier.mergeModifier(gridModifier); + component.getPeer()._attributeSet = initModifier; + return initModifier; + } else { + component.getPeer()._attributeSet = initModifier; + return initModifier; + } + } + let constructParam = (component: ArkCommonMethodComponent, ...params: FixedArray): void => { + }; + let updaterReceiver = (): ArkGridComponent => { + let componentNew: ArkGridComponent = new ArkGridComponent(); + componentNew.setPeer(component.getPeer()); + return componentNew; + }; + applyAttributeModifierBase(modifier as Object as AttributeModifier, attributeSet, constructParam, updaterReceiver, component.getPeer()); +} + +export function hookGridItemAttributeModifier(component: ArkGridItemComponent, + modifier: AttributeModifier | AttributeModifier | undefined): void { + if (modifier === undefined) { + return; + } + let isCommonModifier: boolean = modifier instanceof CommonModifier; + if (isCommonModifier) { + applyCommonModifier(component.getPeer(), modifier as Object as AttributeModifier); + return; + } + let attributeSet = (): GridItemModifier => { + let isGridItemModifier: boolean = modifier instanceof GridItemModifier; + let initModifier = component.getPeer()._attributeSet ? component.getPeer()._attributeSet! : new GridItemModifier(); + if (isGridItemModifier) { + let gridItemModifier = modifier as object as GridItemModifier; + initModifier.mergeModifier(gridItemModifier); + component.getPeer()._attributeSet = initModifier; + return initModifier; + } else { + component.getPeer()._attributeSet = initModifier; + return initModifier; + } + } + let constructParam = (component: ArkCommonMethodComponent, ...params: FixedArray): void => { + }; + let updaterReceiver = (): ArkGridItemComponent => { + let componentNew: ArkGridItemComponent = new ArkGridItemComponent(); + componentNew.setPeer(component.getPeer()); + return componentNew; + }; + applyAttributeModifierBase(modifier as Object as AttributeModifier, attributeSet, constructParam, updaterReceiver, component.getPeer()); + +} + +export function hookListAttributeModifier(component: ArkListComponent, + modifier: AttributeModifier | AttributeModifier | undefined): void { + if (modifier === undefined) { + return; + } + let isCommonModifier: boolean = modifier instanceof CommonModifier; + if (isCommonModifier) { + applyCommonModifier(component.getPeer(), modifier as Object as AttributeModifier); + return; + } + let attributeSet = (): ListModifier => { + let isListModifier: boolean = modifier instanceof ListModifier; + let initModifier = component.getPeer()._attributeSet ? component.getPeer()._attributeSet! : new ListModifier(); + if (isListModifier) { + let listModifier = modifier as object as ListModifier; + initModifier.mergeModifier(listModifier); + component.getPeer()._attributeSet = initModifier; + return initModifier; + } else { + component.getPeer()._attributeSet = initModifier; + return initModifier; + } + } + let constructParam = (component: ArkCommonMethodComponent, ...params: FixedArray): void => { + }; + let updaterReceiver = (): ArkListComponent => { + let componentNew: ArkListComponent = new ArkListComponent(); + componentNew.setPeer(component.getPeer()); + return componentNew; + }; + applyAttributeModifierBase(modifier as Object as AttributeModifier, attributeSet, constructParam, updaterReceiver, component.getPeer()); + +} + +export function hookListItemAttributeModifier(component: ArkListItemComponent, + modifier: AttributeModifier | AttributeModifier | undefined): void { + if (modifier === undefined) { + return; + } + let isCommonModifier: boolean = modifier instanceof CommonModifier; + if (isCommonModifier) { + applyCommonModifier(component.getPeer(), modifier as Object as AttributeModifier); + return; + } + let attributeSet = (): ListItemModifier => { + let isListItemModifier: boolean = modifier instanceof ListItemModifier; + let initModifier = component.getPeer()._attributeSet ? component.getPeer()._attributeSet! : new ListItemModifier(); + if (isListItemModifier) { + let listItemModifier = modifier as object as ListItemModifier; + initModifier.mergeModifier(listItemModifier); + component.getPeer()._attributeSet = initModifier; + return initModifier; + } else { + component.getPeer()._attributeSet = initModifier; + return initModifier; + } + } + let constructParam = (component: ArkCommonMethodComponent, ...params: FixedArray): void => { + }; + let updaterReceiver = (): ArkListItemComponent => { + let componentNew: ArkListItemComponent = new ArkListItemComponent(); + componentNew.setPeer(component.getPeer()); + return componentNew; + }; + applyAttributeModifierBase(modifier as Object as AttributeModifier, attributeSet, constructParam, updaterReceiver, component.getPeer()); + +} + +export function hookListItemGroupAttributeModifier(component: ArkListItemGroupComponent, + modifier: AttributeModifier | AttributeModifier | undefined): void { + if (modifier === undefined) { + return; + } + let isCommonModifier: boolean = modifier instanceof CommonModifier; + if (isCommonModifier) { + applyCommonModifier(component.getPeer(), modifier as Object as AttributeModifier); + return; + } + let attributeSet = (): ListItemGroupModifier => { + let isListItemGroupModifier: boolean = modifier instanceof ListItemGroupModifier; + let initModifier = component.getPeer()._attributeSet ? component.getPeer()._attributeSet! : new ListItemGroupModifier(); + if (isListItemGroupModifier) { + let listItemGroupModifier = modifier as object as ListItemGroupModifier; + initModifier.mergeModifier(listItemGroupModifier); + component.getPeer()._attributeSet = initModifier; + return initModifier; + } else { + component.getPeer()._attributeSet = initModifier; + return initModifier; + } + } + let constructParam = (component: ArkCommonMethodComponent, ...params: FixedArray): void => { + }; + let updaterReceiver = (): ArkListItemGroupComponent => { + let componentNew: ArkListItemGroupComponent = new ArkListItemGroupComponent(); + componentNew.setPeer(component.getPeer()); + return componentNew; + }; + applyAttributeModifierBase(modifier as Object as AttributeModifier, attributeSet, constructParam, updaterReceiver, component.getPeer()); + +} + +export function hookRefreshAttributeModifier(component: ArkRefreshComponent, + modifier: AttributeModifier | AttributeModifier | undefined): void { + if (modifier === undefined) { + return; + } + let isCommonModifier: boolean = modifier instanceof CommonModifier; + if (isCommonModifier) { + applyCommonModifier(component.getPeer(), modifier as Object as AttributeModifier); + return; + } + let attributeSet = (): RefreshModifier => { + let isRefreshModifier: boolean = modifier instanceof RefreshModifier; + let initModifier = component.getPeer()._attributeSet ? component.getPeer()._attributeSet! : new RefreshModifier(); + if (isRefreshModifier) { + let refreshModifier = modifier as object as RefreshModifier; + initModifier.mergeModifier(refreshModifier); + component.getPeer()._attributeSet = initModifier; + return initModifier; + } else { + component.getPeer()._attributeSet = initModifier; + return initModifier; + } + } + let constructParam = (component: ArkCommonMethodComponent, ...params: FixedArray): void => { + }; + let updaterReceiver = (): ArkRefreshComponent => { + let componentNew: ArkRefreshComponent = new ArkRefreshComponent(); + componentNew.setPeer(component.getPeer()); + return componentNew; + }; + applyAttributeModifierBase(modifier as Object as AttributeModifier, attributeSet, constructParam, updaterReceiver, component.getPeer()); + +} +export function hookScrollAttributeModifier(component: ArkScrollComponent, + modifier: AttributeModifier | AttributeModifier | undefined): void { + if (modifier === undefined) { + return; + } + let isCommonModifier: boolean = modifier instanceof CommonModifier; + if (isCommonModifier) { + applyCommonModifier(component.getPeer(), modifier as Object as AttributeModifier); + return; + } + let attributeSet = (): ScrollModifier => { + let isScrollModifier: boolean = modifier instanceof ScrollModifier; + let initModifier = component.getPeer()._attributeSet ? component.getPeer()._attributeSet! : new ScrollModifier(); + if (isScrollModifier) { + let scrollModifier = modifier as object as ScrollModifier; + initModifier.mergeModifier(scrollModifier); + component.getPeer()._attributeSet = initModifier; + return initModifier; + } else { + component.getPeer()._attributeSet = initModifier; + return initModifier; + } + } + let constructParam = (component: ArkCommonMethodComponent, ...params: FixedArray): void => { + }; + let updaterReceiver = (): ArkScrollComponent => { + let componentNew: ArkScrollComponent = new ArkScrollComponent(); + componentNew.setPeer(component.getPeer()); + return componentNew; + }; + applyAttributeModifierBase(modifier as Object as AttributeModifier, attributeSet, constructParam, updaterReceiver, component.getPeer()); + +} + +export function hookWaterFlowAttributeModifier(component: ArkWaterFlowComponent, + modifier: AttributeModifier | AttributeModifier | undefined): void { + if (modifier === undefined) { + return; + } + let isCommonModifier: boolean = modifier instanceof CommonModifier; + if (isCommonModifier) { + applyCommonModifier(component.getPeer(), modifier as Object as AttributeModifier); + return; + } + let attributeSet = (): WaterFlowModifier => { + let isWaterFlowModifier: boolean = modifier instanceof WaterFlowModifier; + let initModifier = component.getPeer()._attributeSet ? component.getPeer()._attributeSet! : new WaterFlowModifier(); + if (isWaterFlowModifier) { + let waterFlowModifier = modifier as object as WaterFlowModifier; + initModifier.mergeModifier(waterFlowModifier); + component.getPeer()._attributeSet = initModifier; + return initModifier; + } else { + component.getPeer()._attributeSet = initModifier; + return initModifier; + } + } + let constructParam = (component: ArkCommonMethodComponent, ...params: FixedArray): void => { + }; + let updaterReceiver = (): ArkWaterFlowComponent => { + let componentNew: ArkWaterFlowComponent = new ArkWaterFlowComponent(); + componentNew.setPeer(component.getPeer()); + return componentNew; + }; + applyAttributeModifierBase(modifier as Object as AttributeModifier, attributeSet, constructParam, updaterReceiver, component.getPeer()); + +} \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni index a3f4314165ee36c5f44d837e6f079f781537b88e..2e6394aa386929ce85e8476be89f358b42cc08bf 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni @@ -63,9 +63,14 @@ arkui_files = [ "arkui-preprocessed/arkui/FrameNode.ets", "arkui-preprocessed/arkui/Graphics.ets", "arkui-preprocessed/arkui/GridColModifier.ets", + "arkui-preprocessed/arkui/GridItemModifier.ets", + "arkui-preprocessed/arkui/GridModifier.ets", "arkui-preprocessed/arkui/GridRowModifier.ets", "arkui-preprocessed/arkui/RelativeContainerModifier.ets", "arkui-preprocessed/arkui/LineModifier.ets", + "arkui-preprocessed/arkui/ListItemGroupModifier.ets", + "arkui-preprocessed/arkui/ListItemModifier.ets", + "arkui-preprocessed/arkui/ListModifier.ets", "arkui-preprocessed/arkui/NativePeerNode.ets", "arkui-preprocessed/arkui/NavDestinationModifier.ets", "arkui-preprocessed/arkui/NavigationModifier.ets", @@ -76,10 +81,13 @@ arkui_files = [ "arkui-preprocessed/arkui/PolygonModifier.ets", "arkui-preprocessed/arkui/PolylineModifier.ets", "arkui-preprocessed/arkui/RectModifier.ets", + "arkui-preprocessed/arkui/RefreshModifier.ets", "arkui-preprocessed/arkui/RenderNode.ets", "arkui-preprocessed/arkui/ReusablePool.ets", "arkui-preprocessed/arkui/RowModifier.ets", "arkui-preprocessed/arkui/RowSplitModifier.ets", + "arkui-preprocessed/arkui/ScrollModifier.ets", + "arkui-preprocessed/arkui/ScrollableCommonMethodModifier.ets", "arkui-preprocessed/arkui/ShapeModifier.ets", "arkui-preprocessed/arkui/SideBarContainerModifier.ets", "arkui-preprocessed/arkui/StackModifier.ets", @@ -89,6 +97,7 @@ arkui_files = [ "arkui-preprocessed/arkui/TextModifier.ets", "arkui-preprocessed/arkui/UserView.ets", "arkui-preprocessed/arkui/VideoModifier.ets", + "arkui-preprocessed/arkui/WaterFlowModifier.ets", "arkui-preprocessed/arkui/ani/arkts/ArkUIAniCustomNodeModule.ets", "arkui-preprocessed/arkui/ani/arkts/ArkUIAniModule.ets", "arkui-preprocessed/arkui/ani/arkts/index.ets",