123b3eb3cSopenharmony_ci/* 223b3eb3cSopenharmony_ci * Copyright (c) 2023-2024 Huawei Device Co., Ltd. 323b3eb3cSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the 'License'); 423b3eb3cSopenharmony_ci * you may not use this file except in compliance with the License. 523b3eb3cSopenharmony_ci * You may obtain a copy of the License at 623b3eb3cSopenharmony_ci * 723b3eb3cSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 823b3eb3cSopenharmony_ci * 923b3eb3cSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1023b3eb3cSopenharmony_ci * distributed under the License is distributed on an 'AS IS' BASIS, 1123b3eb3cSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1223b3eb3cSopenharmony_ci * See the License for the specific language governing permissions and 1323b3eb3cSopenharmony_ci * limitations under the License. 1423b3eb3cSopenharmony_ci */ 1523b3eb3cSopenharmony_ci 1623b3eb3cSopenharmony_ciconst display = requireNapi('display'); 1723b3eb3cSopenharmony_ciconst hilog = requireNapi('hilog'); 1823b3eb3cSopenharmony_ciconst measure = requireNapi('measure'); 1923b3eb3cSopenharmony_ciconst resourceManager = requireNapi('resourceManager'); 2023b3eb3cSopenharmony_ciconst LengthMetrics = requireNapi('arkui.node').LengthMetrics; 2123b3eb3cSopenharmony_ciconst LengthUnit = requireNapi('arkui.node').LengthUnit; 2223b3eb3cSopenharmony_ci 2323b3eb3cSopenharmony_ciif (!('finalizeConstruction' in ViewPU.prototype)) { 2423b3eb3cSopenharmony_ci Reflect.set(ViewPU.prototype, 'finalizeConstruction', () => { 2523b3eb3cSopenharmony_ci }); 2623b3eb3cSopenharmony_ci} 2723b3eb3cSopenharmony_ci 2823b3eb3cSopenharmony_ciclass CustomThemeImpl { 2923b3eb3cSopenharmony_ci constructor(p34) { 3023b3eb3cSopenharmony_ci this.colors = p34; 3123b3eb3cSopenharmony_ci } 3223b3eb3cSopenharmony_ci} 3323b3eb3cSopenharmony_ci 3423b3eb3cSopenharmony_ciconst TITLE_MAX_LINES = 2; 3523b3eb3cSopenharmony_ciconst HORIZON_BUTTON_MAX_COUNT = 2; 3623b3eb3cSopenharmony_ciconst VERTICAL_BUTTON_MAX_COUNT = 4; 3723b3eb3cSopenharmony_ciconst BUTTON_LAYOUT_WEIGHT = 1; 3823b3eb3cSopenharmony_ciconst CHECKBOX_CONTAINER_HEIGHT = 48; 3923b3eb3cSopenharmony_ciconst CONTENT_MAX_LINES = 2; 4023b3eb3cSopenharmony_ciconst LOADING_PROGRESS_WIDTH = 40; 4123b3eb3cSopenharmony_ciconst LOADING_PROGRESS_HEIGHT = 40; 4223b3eb3cSopenharmony_ciconst LOADING_MAX_LINES = 10; 4323b3eb3cSopenharmony_ciconst LOADING_MAX_LINES_BIG_FONT = 4; 4423b3eb3cSopenharmony_ciconst LOADING_TEXT_LAYOUT_WEIGHT = 1; 4523b3eb3cSopenharmony_ciconst LOADING_TEXT_MARGIN_LEFT = 12; 4623b3eb3cSopenharmony_ciconst LOADING_MIN_HEIGHT = 48; 4723b3eb3cSopenharmony_ciconst LIST_MIN_HEIGHT = 48; 4823b3eb3cSopenharmony_ciconst CHECKBOX_CONTAINER_LENGTH = 20; 4923b3eb3cSopenharmony_ciconst TEXT_MIN_HEIGHT = 48; 5023b3eb3cSopenharmony_ciconst DEFAULT_IMAGE_SIZE = 64; 5123b3eb3cSopenharmony_ciconst MIN_CONTENT_HEIGHT = 100; 5223b3eb3cSopenharmony_ciconst MAX_CONTENT_HEIGHT = 30000; 5323b3eb3cSopenharmony_ciconst KEYCODE_UP = 2012; 5423b3eb3cSopenharmony_ciconst KEYCODE_DOWN = 2013; 5523b3eb3cSopenharmony_ciconst IGNORE_KEY_EVENT_TYPE = 1; 5623b3eb3cSopenharmony_ciconst FIRST_ITEM_INDEX = 0; 5723b3eb3cSopenharmony_ciconst VERSION_TWELVE = 50000012; 5823b3eb3cSopenharmony_ciconst BUTTON_MIN_FONT_SIZE = 9; 5923b3eb3cSopenharmony_ciconst MAX_FONT_SCALE = 2; 6023b3eb3cSopenharmony_ciconst MAX_DIALOG_WIDTH = getNumberByResourceId(125831042, 400); 6123b3eb3cSopenharmony_ciconst BUTTON_HORIZONTAL_MARGIN = getNumberByResourceId(125831054, 16); 6223b3eb3cSopenharmony_ciconst BUTTON_HORIZONTAL_PADDING = getNumberByResourceId(125830927, 16); 6323b3eb3cSopenharmony_ciconst CHECK_BOX_MARGIN_END = getNumberByResourceId(125830923, 8); 6423b3eb3cSopenharmony_ciconst BUTTON_HORIZONTAL_SPACE = getNumberByResourceId(125831051, 8); 6523b3eb3cSopenharmony_ciconst BODY_L = getNumberByResourceId(125830970, 16); 6623b3eb3cSopenharmony_ciconst BODY_M = getNumberByResourceId(125830971, 14); 6723b3eb3cSopenharmony_ciconst BODY_S = getNumberByResourceId(125830972, 12); 6823b3eb3cSopenharmony_ciconst TITLE_S = getNumberByResourceId(125830966, 20); 6923b3eb3cSopenharmony_ciconst SUBTITLE_S = getNumberByResourceId(125830969, 14); 7023b3eb3cSopenharmony_ciconst PADDING_LEVEL_8 = getNumberByResourceId(125830927, 16); 7123b3eb3cSopenharmony_ciconst DIALOG_DIVIDER_SHOW = getNumberByResourceId(125831202, 1, true); 7223b3eb3cSopenharmony_ciconst ALERT_BUTTON_STYLE = getNumberByResourceId(125831085, 2, true); 7323b3eb3cSopenharmony_ciconst ALERT_TITLE_ALIGNMENT = getEnumNumberByResourceId(125831126, 1); 7423b3eb3cSopenharmony_ciexport class TipsDialog extends ViewPU { 7523b3eb3cSopenharmony_ci constructor(i34, j34, k34, l34 = -1, m34 = undefined, n34) { 7623b3eb3cSopenharmony_ci super(i34, k34, l34, n34); 7723b3eb3cSopenharmony_ci if (typeof m34 === 'function') { 7823b3eb3cSopenharmony_ci this.paramsGenerator_ = m34; 7923b3eb3cSopenharmony_ci } 8023b3eb3cSopenharmony_ci this.controller = undefined; 8123b3eb3cSopenharmony_ci this.imageRes = null; 8223b3eb3cSopenharmony_ci this.__imageSize = 8323b3eb3cSopenharmony_ci new ObservedPropertyObjectPU({ width: DEFAULT_IMAGE_SIZE, height: DEFAULT_IMAGE_SIZE }, this, 'imageSize'); 8423b3eb3cSopenharmony_ci this.title = null; 8523b3eb3cSopenharmony_ci this.content = null; 8623b3eb3cSopenharmony_ci this.checkAction = undefined; 8723b3eb3cSopenharmony_ci this.onCheckedChange = undefined; 8823b3eb3cSopenharmony_ci this.checkTips = null; 8923b3eb3cSopenharmony_ci this.__isChecked = new ObservedPropertySimplePU(false, this, 'isChecked'); 9023b3eb3cSopenharmony_ci this.primaryButton = null; 9123b3eb3cSopenharmony_ci this.secondaryButton = null; 9223b3eb3cSopenharmony_ci this.buttons = undefined; 9323b3eb3cSopenharmony_ci this.__textAlignment = new ObservedPropertySimplePU(TextAlign.Start, this, 'textAlignment'); 9423b3eb3cSopenharmony_ci this.marginOffset = 0; 9523b3eb3cSopenharmony_ci this.contentScroller = new Scroller(); 9623b3eb3cSopenharmony_ci this.__fontColorWithTheme = new ObservedPropertyObjectPU({ 9723b3eb3cSopenharmony_ci 'id': -1, 9823b3eb3cSopenharmony_ci 'type': 10001, 9923b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 10023b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 10123b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 10223b3eb3cSopenharmony_ci }, this, 'fontColorWithTheme'); 10323b3eb3cSopenharmony_ci this.theme = new CustomThemeImpl({}); 10423b3eb3cSopenharmony_ci this.themeColorMode = ThemeColorMode.SYSTEM; 10523b3eb3cSopenharmony_ci this.__fontSizeScale = new ObservedPropertySimplePU(1, this, 'fontSizeScale'); 10623b3eb3cSopenharmony_ci this.__minContentHeight = new ObservedPropertySimplePU(160, this, 'minContentHeight'); 10723b3eb3cSopenharmony_ci this.updateTextAlign = (o34) => { 10823b3eb3cSopenharmony_ci if (this.content) { 10923b3eb3cSopenharmony_ci this.textAlignment = getTextAlign(o34, this.content, `${BODY_L * this.fontSizeScale}vp`); 11023b3eb3cSopenharmony_ci } 11123b3eb3cSopenharmony_ci }; 11223b3eb3cSopenharmony_ci this.imageIndex = 0; 11323b3eb3cSopenharmony_ci this.textIndex = 1; 11423b3eb3cSopenharmony_ci this.checkBoxIndex = 2; 11523b3eb3cSopenharmony_ci this.setInitiallyProvidedValue(j34); 11623b3eb3cSopenharmony_ci this.finalizeConstruction(); 11723b3eb3cSopenharmony_ci } 11823b3eb3cSopenharmony_ci 11923b3eb3cSopenharmony_ci setInitiallyProvidedValue(h34) { 12023b3eb3cSopenharmony_ci if (h34.controller !== undefined) { 12123b3eb3cSopenharmony_ci this.controller = h34.controller; 12223b3eb3cSopenharmony_ci } 12323b3eb3cSopenharmony_ci if (h34.imageRes !== undefined) { 12423b3eb3cSopenharmony_ci this.imageRes = h34.imageRes; 12523b3eb3cSopenharmony_ci } 12623b3eb3cSopenharmony_ci if (h34.imageSize !== undefined) { 12723b3eb3cSopenharmony_ci this.imageSize = h34.imageSize; 12823b3eb3cSopenharmony_ci } 12923b3eb3cSopenharmony_ci if (h34.title !== undefined) { 13023b3eb3cSopenharmony_ci this.title = h34.title; 13123b3eb3cSopenharmony_ci } 13223b3eb3cSopenharmony_ci if (h34.content !== undefined) { 13323b3eb3cSopenharmony_ci this.content = h34.content; 13423b3eb3cSopenharmony_ci } 13523b3eb3cSopenharmony_ci if (h34.checkAction !== undefined) { 13623b3eb3cSopenharmony_ci this.checkAction = h34.checkAction; 13723b3eb3cSopenharmony_ci } 13823b3eb3cSopenharmony_ci if (h34.onCheckedChange !== undefined) { 13923b3eb3cSopenharmony_ci this.onCheckedChange = h34.onCheckedChange; 14023b3eb3cSopenharmony_ci } 14123b3eb3cSopenharmony_ci if (h34.checkTips !== undefined) { 14223b3eb3cSopenharmony_ci this.checkTips = h34.checkTips; 14323b3eb3cSopenharmony_ci } 14423b3eb3cSopenharmony_ci if (h34.isChecked !== undefined) { 14523b3eb3cSopenharmony_ci this.isChecked = h34.isChecked; 14623b3eb3cSopenharmony_ci } 14723b3eb3cSopenharmony_ci if (h34.primaryButton !== undefined) { 14823b3eb3cSopenharmony_ci this.primaryButton = h34.primaryButton; 14923b3eb3cSopenharmony_ci } 15023b3eb3cSopenharmony_ci if (h34.secondaryButton !== undefined) { 15123b3eb3cSopenharmony_ci this.secondaryButton = h34.secondaryButton; 15223b3eb3cSopenharmony_ci } 15323b3eb3cSopenharmony_ci if (h34.buttons !== undefined) { 15423b3eb3cSopenharmony_ci this.buttons = h34.buttons; 15523b3eb3cSopenharmony_ci } 15623b3eb3cSopenharmony_ci if (h34.textAlignment !== undefined) { 15723b3eb3cSopenharmony_ci this.textAlignment = h34.textAlignment; 15823b3eb3cSopenharmony_ci } 15923b3eb3cSopenharmony_ci if (h34.marginOffset !== undefined) { 16023b3eb3cSopenharmony_ci this.marginOffset = h34.marginOffset; 16123b3eb3cSopenharmony_ci } 16223b3eb3cSopenharmony_ci if (h34.contentScroller !== undefined) { 16323b3eb3cSopenharmony_ci this.contentScroller = h34.contentScroller; 16423b3eb3cSopenharmony_ci } 16523b3eb3cSopenharmony_ci if (h34.fontColorWithTheme !== undefined) { 16623b3eb3cSopenharmony_ci this.fontColorWithTheme = h34.fontColorWithTheme; 16723b3eb3cSopenharmony_ci } 16823b3eb3cSopenharmony_ci if (h34.theme !== undefined) { 16923b3eb3cSopenharmony_ci this.theme = h34.theme; 17023b3eb3cSopenharmony_ci } 17123b3eb3cSopenharmony_ci if (h34.themeColorMode !== undefined) { 17223b3eb3cSopenharmony_ci this.themeColorMode = h34.themeColorMode; 17323b3eb3cSopenharmony_ci } 17423b3eb3cSopenharmony_ci if (h34.fontSizeScale !== undefined) { 17523b3eb3cSopenharmony_ci this.fontSizeScale = h34.fontSizeScale; 17623b3eb3cSopenharmony_ci } 17723b3eb3cSopenharmony_ci if (h34.minContentHeight !== undefined) { 17823b3eb3cSopenharmony_ci this.minContentHeight = h34.minContentHeight; 17923b3eb3cSopenharmony_ci } 18023b3eb3cSopenharmony_ci if (h34.updateTextAlign !== undefined) { 18123b3eb3cSopenharmony_ci this.updateTextAlign = h34.updateTextAlign; 18223b3eb3cSopenharmony_ci } 18323b3eb3cSopenharmony_ci if (h34.imageIndex !== undefined) { 18423b3eb3cSopenharmony_ci this.imageIndex = h34.imageIndex; 18523b3eb3cSopenharmony_ci } 18623b3eb3cSopenharmony_ci if (h34.textIndex !== undefined) { 18723b3eb3cSopenharmony_ci this.textIndex = h34.textIndex; 18823b3eb3cSopenharmony_ci } 18923b3eb3cSopenharmony_ci if (h34.checkBoxIndex !== undefined) { 19023b3eb3cSopenharmony_ci this.checkBoxIndex = h34.checkBoxIndex; 19123b3eb3cSopenharmony_ci } 19223b3eb3cSopenharmony_ci } 19323b3eb3cSopenharmony_ci 19423b3eb3cSopenharmony_ci updateStateVars(g34) { 19523b3eb3cSopenharmony_ci } 19623b3eb3cSopenharmony_ci 19723b3eb3cSopenharmony_ci purgeVariableDependenciesOnElmtId(f34) { 19823b3eb3cSopenharmony_ci this.__imageSize.purgeDependencyOnElmtId(f34); 19923b3eb3cSopenharmony_ci this.__isChecked.purgeDependencyOnElmtId(f34); 20023b3eb3cSopenharmony_ci this.__textAlignment.purgeDependencyOnElmtId(f34); 20123b3eb3cSopenharmony_ci this.__fontColorWithTheme.purgeDependencyOnElmtId(f34); 20223b3eb3cSopenharmony_ci this.__fontSizeScale.purgeDependencyOnElmtId(f34); 20323b3eb3cSopenharmony_ci this.__minContentHeight.purgeDependencyOnElmtId(f34); 20423b3eb3cSopenharmony_ci } 20523b3eb3cSopenharmony_ci 20623b3eb3cSopenharmony_ci aboutToBeDeleted() { 20723b3eb3cSopenharmony_ci this.__imageSize.aboutToBeDeleted(); 20823b3eb3cSopenharmony_ci this.__isChecked.aboutToBeDeleted(); 20923b3eb3cSopenharmony_ci this.__textAlignment.aboutToBeDeleted(); 21023b3eb3cSopenharmony_ci this.__fontColorWithTheme.aboutToBeDeleted(); 21123b3eb3cSopenharmony_ci this.__fontSizeScale.aboutToBeDeleted(); 21223b3eb3cSopenharmony_ci this.__minContentHeight.aboutToBeDeleted(); 21323b3eb3cSopenharmony_ci SubscriberManager.Get().delete(this.id__()); 21423b3eb3cSopenharmony_ci this.aboutToBeDeletedInternal(); 21523b3eb3cSopenharmony_ci } 21623b3eb3cSopenharmony_ci 21723b3eb3cSopenharmony_ci setController(e34) { 21823b3eb3cSopenharmony_ci this.controller = e34; 21923b3eb3cSopenharmony_ci } 22023b3eb3cSopenharmony_ci 22123b3eb3cSopenharmony_ci get imageSize() { 22223b3eb3cSopenharmony_ci return this.__imageSize.get(); 22323b3eb3cSopenharmony_ci } 22423b3eb3cSopenharmony_ci 22523b3eb3cSopenharmony_ci set imageSize(d34) { 22623b3eb3cSopenharmony_ci this.__imageSize.set(d34); 22723b3eb3cSopenharmony_ci } 22823b3eb3cSopenharmony_ci 22923b3eb3cSopenharmony_ci get isChecked() { 23023b3eb3cSopenharmony_ci return this.__isChecked.get(); 23123b3eb3cSopenharmony_ci } 23223b3eb3cSopenharmony_ci 23323b3eb3cSopenharmony_ci set isChecked(c34) { 23423b3eb3cSopenharmony_ci this.__isChecked.set(c34); 23523b3eb3cSopenharmony_ci } 23623b3eb3cSopenharmony_ci 23723b3eb3cSopenharmony_ci get textAlignment() { 23823b3eb3cSopenharmony_ci return this.__textAlignment.get(); 23923b3eb3cSopenharmony_ci } 24023b3eb3cSopenharmony_ci 24123b3eb3cSopenharmony_ci set textAlignment(b34) { 24223b3eb3cSopenharmony_ci this.__textAlignment.set(b34); 24323b3eb3cSopenharmony_ci } 24423b3eb3cSopenharmony_ci 24523b3eb3cSopenharmony_ci get fontColorWithTheme() { 24623b3eb3cSopenharmony_ci return this.__fontColorWithTheme.get(); 24723b3eb3cSopenharmony_ci } 24823b3eb3cSopenharmony_ci 24923b3eb3cSopenharmony_ci set fontColorWithTheme(a34) { 25023b3eb3cSopenharmony_ci this.__fontColorWithTheme.set(a34); 25123b3eb3cSopenharmony_ci } 25223b3eb3cSopenharmony_ci 25323b3eb3cSopenharmony_ci get fontSizeScale() { 25423b3eb3cSopenharmony_ci return this.__fontSizeScale.get(); 25523b3eb3cSopenharmony_ci } 25623b3eb3cSopenharmony_ci 25723b3eb3cSopenharmony_ci set fontSizeScale(z33) { 25823b3eb3cSopenharmony_ci this.__fontSizeScale.set(z33); 25923b3eb3cSopenharmony_ci } 26023b3eb3cSopenharmony_ci 26123b3eb3cSopenharmony_ci get minContentHeight() { 26223b3eb3cSopenharmony_ci return this.__minContentHeight.get(); 26323b3eb3cSopenharmony_ci } 26423b3eb3cSopenharmony_ci 26523b3eb3cSopenharmony_ci set minContentHeight(y33) { 26623b3eb3cSopenharmony_ci this.__minContentHeight.set(y33); 26723b3eb3cSopenharmony_ci } 26823b3eb3cSopenharmony_ci 26923b3eb3cSopenharmony_ci initialRender() { 27023b3eb3cSopenharmony_ci this.observeComponentCreation2((w33, x33) => { 27123b3eb3cSopenharmony_ci __Common__.create(); 27223b3eb3cSopenharmony_ci __Common__.constraintSize({ maxHeight: '100%' }); 27323b3eb3cSopenharmony_ci }, __Common__); 27423b3eb3cSopenharmony_ci { 27523b3eb3cSopenharmony_ci this.observeComponentCreation2((s33, t33) => { 27623b3eb3cSopenharmony_ci if (t33) { 27723b3eb3cSopenharmony_ci let u33 = new CustomDialogContentComponent(this, { 27823b3eb3cSopenharmony_ci controller: this.controller, 27923b3eb3cSopenharmony_ci contentBuilder: () => { 28023b3eb3cSopenharmony_ci this.contentBuilder(); 28123b3eb3cSopenharmony_ci }, 28223b3eb3cSopenharmony_ci buttons: this.buttons, 28323b3eb3cSopenharmony_ci theme: this.theme, 28423b3eb3cSopenharmony_ci themeColorMode: this.themeColorMode, 28523b3eb3cSopenharmony_ci fontSizeScale: this.__fontSizeScale, 28623b3eb3cSopenharmony_ci minContentHeight: this.__minContentHeight, 28723b3eb3cSopenharmony_ci }, undefined, s33, () => { 28823b3eb3cSopenharmony_ci }, { page: 'library/src/main/ets/components/MainPage.ets', line: 131, col: 5 }); 28923b3eb3cSopenharmony_ci ViewPU.create(u33); 29023b3eb3cSopenharmony_ci let t = () => { 29123b3eb3cSopenharmony_ci return { 29223b3eb3cSopenharmony_ci controller: this.controller, 29323b3eb3cSopenharmony_ci contentBuilder: () => { 29423b3eb3cSopenharmony_ci this.contentBuilder(); 29523b3eb3cSopenharmony_ci }, 29623b3eb3cSopenharmony_ci buttons: this.buttons, 29723b3eb3cSopenharmony_ci theme: this.theme, 29823b3eb3cSopenharmony_ci themeColorMode: this.themeColorMode, 29923b3eb3cSopenharmony_ci fontSizeScale: this.fontSizeScale, 30023b3eb3cSopenharmony_ci minContentHeight: this.minContentHeight 30123b3eb3cSopenharmony_ci }; 30223b3eb3cSopenharmony_ci }; 30323b3eb3cSopenharmony_ci u33.paramsGenerator_ = t; 30423b3eb3cSopenharmony_ci } else { 30523b3eb3cSopenharmony_ci this.updateStateVarsOfChildByElmtId(s33, {}); 30623b3eb3cSopenharmony_ci } 30723b3eb3cSopenharmony_ci }, { name: 'CustomDialogContentComponent' }); 30823b3eb3cSopenharmony_ci } 30923b3eb3cSopenharmony_ci __Common__.pop(); 31023b3eb3cSopenharmony_ci } 31123b3eb3cSopenharmony_ci 31223b3eb3cSopenharmony_ci contentBuilder(n32 = null) { 31323b3eb3cSopenharmony_ci { 31423b3eb3cSopenharmony_ci this.observeComponentCreation2((o32, p32) => { 31523b3eb3cSopenharmony_ci if (p32) { 31623b3eb3cSopenharmony_ci let q32 = new TipsDialogContentLayout(this, { 31723b3eb3cSopenharmony_ci title: this.title, 31823b3eb3cSopenharmony_ci content: this.content, 31923b3eb3cSopenharmony_ci checkTips: this.checkTips, 32023b3eb3cSopenharmony_ci minContentHeight: this.__minContentHeight, 32123b3eb3cSopenharmony_ci updateTextAlign: this.updateTextAlign, 32223b3eb3cSopenharmony_ci dialogBuilder: () => { 32323b3eb3cSopenharmony_ci this.observeComponentCreation2((f33, g33) => { 32423b3eb3cSopenharmony_ci ForEach.create(); 32523b3eb3cSopenharmony_ci const s = i33 => { 32623b3eb3cSopenharmony_ci const j33 = i33; 32723b3eb3cSopenharmony_ci this.observeComponentCreation2((k33, l33) => { 32823b3eb3cSopenharmony_ci If.create(); 32923b3eb3cSopenharmony_ci if (j33 === this.imageIndex) { 33023b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 33123b3eb3cSopenharmony_ci this.imagePart.bind(this)(); 33223b3eb3cSopenharmony_ci }); 33323b3eb3cSopenharmony_ci } else if (j33 === this.textIndex) { 33423b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 33523b3eb3cSopenharmony_ci this.observeComponentCreation2((q33, r33) => { 33623b3eb3cSopenharmony_ci Column.create(); 33723b3eb3cSopenharmony_ci Column.padding({ 33823b3eb3cSopenharmony_ci top: { 33923b3eb3cSopenharmony_ci 'id': -1, 34023b3eb3cSopenharmony_ci 'type': 10002, 34123b3eb3cSopenharmony_ci params: ['sys.float.padding_level8'], 34223b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 34323b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 34423b3eb3cSopenharmony_ci } 34523b3eb3cSopenharmony_ci }); 34623b3eb3cSopenharmony_ci }, Column); 34723b3eb3cSopenharmony_ci this.observeComponentCreation2((o33, p33) => { 34823b3eb3cSopenharmony_ci WithTheme.create({ 34923b3eb3cSopenharmony_ci theme: this.theme, 35023b3eb3cSopenharmony_ci colorMode: this.themeColorMode 35123b3eb3cSopenharmony_ci }); 35223b3eb3cSopenharmony_ci }, WithTheme); 35323b3eb3cSopenharmony_ci this.textPart.bind(this)(); 35423b3eb3cSopenharmony_ci WithTheme.pop(); 35523b3eb3cSopenharmony_ci Column.pop(); 35623b3eb3cSopenharmony_ci }); 35723b3eb3cSopenharmony_ci } else { 35823b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(2, () => { 35923b3eb3cSopenharmony_ci this.observeComponentCreation2((m33, n33) => { 36023b3eb3cSopenharmony_ci WithTheme.create({ 36123b3eb3cSopenharmony_ci theme: this.theme, 36223b3eb3cSopenharmony_ci colorMode: this.themeColorMode 36323b3eb3cSopenharmony_ci }); 36423b3eb3cSopenharmony_ci }, WithTheme); 36523b3eb3cSopenharmony_ci this.checkBoxPart.bind(this)(); 36623b3eb3cSopenharmony_ci WithTheme.pop(); 36723b3eb3cSopenharmony_ci }); 36823b3eb3cSopenharmony_ci } 36923b3eb3cSopenharmony_ci }, If); 37023b3eb3cSopenharmony_ci If.pop(); 37123b3eb3cSopenharmony_ci }; 37223b3eb3cSopenharmony_ci this.forEachUpdateFunction(f33, [this.imageIndex, this.textIndex, 37323b3eb3cSopenharmony_ci this.checkBoxIndex], s); 37423b3eb3cSopenharmony_ci }, ForEach); 37523b3eb3cSopenharmony_ci ForEach.pop(); 37623b3eb3cSopenharmony_ci } 37723b3eb3cSopenharmony_ci }, undefined, o32, () => { 37823b3eb3cSopenharmony_ci }, { page: 'library/src/main/ets/components/MainPage.ets', line: 146, col: 5 }); 37923b3eb3cSopenharmony_ci ViewPU.create(q32); 38023b3eb3cSopenharmony_ci let q = () => { 38123b3eb3cSopenharmony_ci return { 38223b3eb3cSopenharmony_ci title: this.title, 38323b3eb3cSopenharmony_ci content: this.content, 38423b3eb3cSopenharmony_ci checkTips: this.checkTips, 38523b3eb3cSopenharmony_ci minContentHeight: this.minContentHeight, 38623b3eb3cSopenharmony_ci updateTextAlign: this.updateTextAlign, 38723b3eb3cSopenharmony_ci dialogBuilder: () => { 38823b3eb3cSopenharmony_ci this.observeComponentCreation2((s32, t32) => { 38923b3eb3cSopenharmony_ci ForEach.create(); 39023b3eb3cSopenharmony_ci const r = v32 => { 39123b3eb3cSopenharmony_ci const w32 = v32; 39223b3eb3cSopenharmony_ci this.observeComponentCreation2((x32, y32) => { 39323b3eb3cSopenharmony_ci If.create(); 39423b3eb3cSopenharmony_ci if (w32 === this.imageIndex) { 39523b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 39623b3eb3cSopenharmony_ci this.imagePart.bind(this)(); 39723b3eb3cSopenharmony_ci }); 39823b3eb3cSopenharmony_ci } else if (w32 === this.textIndex) { 39923b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 40023b3eb3cSopenharmony_ci this.observeComponentCreation2((d33, e33) => { 40123b3eb3cSopenharmony_ci Column.create(); 40223b3eb3cSopenharmony_ci Column.padding({ 40323b3eb3cSopenharmony_ci top: { 40423b3eb3cSopenharmony_ci 'id': -1, 40523b3eb3cSopenharmony_ci 'type': 10002, 40623b3eb3cSopenharmony_ci params: ['sys.float.padding_level8'], 40723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 40823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 40923b3eb3cSopenharmony_ci } 41023b3eb3cSopenharmony_ci }); 41123b3eb3cSopenharmony_ci }, Column); 41223b3eb3cSopenharmony_ci this.observeComponentCreation2((b33, c33) => { 41323b3eb3cSopenharmony_ci WithTheme.create({ 41423b3eb3cSopenharmony_ci theme: this.theme, 41523b3eb3cSopenharmony_ci colorMode: this.themeColorMode 41623b3eb3cSopenharmony_ci }); 41723b3eb3cSopenharmony_ci }, WithTheme); 41823b3eb3cSopenharmony_ci this.textPart.bind(this)(); 41923b3eb3cSopenharmony_ci WithTheme.pop(); 42023b3eb3cSopenharmony_ci Column.pop(); 42123b3eb3cSopenharmony_ci }); 42223b3eb3cSopenharmony_ci } else { 42323b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(2, () => { 42423b3eb3cSopenharmony_ci this.observeComponentCreation2((z32, a33) => { 42523b3eb3cSopenharmony_ci WithTheme.create({ 42623b3eb3cSopenharmony_ci theme: this.theme, 42723b3eb3cSopenharmony_ci colorMode: this.themeColorMode 42823b3eb3cSopenharmony_ci }); 42923b3eb3cSopenharmony_ci }, WithTheme); 43023b3eb3cSopenharmony_ci this.checkBoxPart.bind(this)(); 43123b3eb3cSopenharmony_ci WithTheme.pop(); 43223b3eb3cSopenharmony_ci }); 43323b3eb3cSopenharmony_ci } 43423b3eb3cSopenharmony_ci }, If); 43523b3eb3cSopenharmony_ci If.pop(); 43623b3eb3cSopenharmony_ci }; 43723b3eb3cSopenharmony_ci this.forEachUpdateFunction(s32, 43823b3eb3cSopenharmony_ci [this.imageIndex, this.textIndex, this.checkBoxIndex], r); 43923b3eb3cSopenharmony_ci }, ForEach); 44023b3eb3cSopenharmony_ci ForEach.pop(); 44123b3eb3cSopenharmony_ci } 44223b3eb3cSopenharmony_ci }; 44323b3eb3cSopenharmony_ci }; 44423b3eb3cSopenharmony_ci q32.paramsGenerator_ = q; 44523b3eb3cSopenharmony_ci } else { 44623b3eb3cSopenharmony_ci this.updateStateVarsOfChildByElmtId(o32, {}); 44723b3eb3cSopenharmony_ci } 44823b3eb3cSopenharmony_ci }, { name: 'TipsDialogContentLayout' }); 44923b3eb3cSopenharmony_ci } 45023b3eb3cSopenharmony_ci } 45123b3eb3cSopenharmony_ci 45223b3eb3cSopenharmony_ci checkBoxPart(d32 = null) { 45323b3eb3cSopenharmony_ci this.observeComponentCreation2((l32, m32) => { 45423b3eb3cSopenharmony_ci Row.create(); 45523b3eb3cSopenharmony_ci Row.accessibilityGroup(true); 45623b3eb3cSopenharmony_ci Row.onClick(() => { 45723b3eb3cSopenharmony_ci this.isChecked = !this.isChecked; 45823b3eb3cSopenharmony_ci if (this.checkAction) { 45923b3eb3cSopenharmony_ci this.checkAction(this.isChecked); 46023b3eb3cSopenharmony_ci } 46123b3eb3cSopenharmony_ci }); 46223b3eb3cSopenharmony_ci Row.padding({ top: 8, bottom: 8 }); 46323b3eb3cSopenharmony_ci Row.constraintSize({ minHeight: CHECKBOX_CONTAINER_HEIGHT }); 46423b3eb3cSopenharmony_ci Row.width('100%'); 46523b3eb3cSopenharmony_ci }, Row); 46623b3eb3cSopenharmony_ci this.observeComponentCreation2((e32, f32) => { 46723b3eb3cSopenharmony_ci If.create(); 46823b3eb3cSopenharmony_ci if (this.checkTips !== null) { 46923b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 47023b3eb3cSopenharmony_ci this.observeComponentCreation2((i32, j32) => { 47123b3eb3cSopenharmony_ci Checkbox.create({ name: '', group: 'checkboxGroup' }); 47223b3eb3cSopenharmony_ci Checkbox.select(this.isChecked); 47323b3eb3cSopenharmony_ci Checkbox.onChange((k32) => { 47423b3eb3cSopenharmony_ci this.isChecked = k32; 47523b3eb3cSopenharmony_ci if (this.checkAction) { 47623b3eb3cSopenharmony_ci this.checkAction(k32); 47723b3eb3cSopenharmony_ci } 47823b3eb3cSopenharmony_ci if (this.onCheckedChange) { 47923b3eb3cSopenharmony_ci this.onCheckedChange(k32); 48023b3eb3cSopenharmony_ci } 48123b3eb3cSopenharmony_ci }); 48223b3eb3cSopenharmony_ci Checkbox.accessibilityLevel('yes'); 48323b3eb3cSopenharmony_ci Checkbox.margin({ 48423b3eb3cSopenharmony_ci start: LengthMetrics.vp(0), 48523b3eb3cSopenharmony_ci end: LengthMetrics.vp(CHECK_BOX_MARGIN_END) 48623b3eb3cSopenharmony_ci }); 48723b3eb3cSopenharmony_ci }, Checkbox); 48823b3eb3cSopenharmony_ci Checkbox.pop(); 48923b3eb3cSopenharmony_ci this.observeComponentCreation2((g32, h32) => { 49023b3eb3cSopenharmony_ci Text.create(this.checkTips); 49123b3eb3cSopenharmony_ci Text.fontSize(`${BODY_L}fp`); 49223b3eb3cSopenharmony_ci Text.fontWeight(FontWeight.Regular); 49323b3eb3cSopenharmony_ci Text.fontColor(ObservedObject.GetRawObject(this.fontColorWithTheme)); 49423b3eb3cSopenharmony_ci Text.maxLines(CONTENT_MAX_LINES); 49523b3eb3cSopenharmony_ci Text.layoutWeight(1); 49623b3eb3cSopenharmony_ci Text.focusable(false); 49723b3eb3cSopenharmony_ci Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 49823b3eb3cSopenharmony_ci }, Text); 49923b3eb3cSopenharmony_ci Text.pop(); 50023b3eb3cSopenharmony_ci }); 50123b3eb3cSopenharmony_ci } else { 50223b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 50323b3eb3cSopenharmony_ci }); 50423b3eb3cSopenharmony_ci } 50523b3eb3cSopenharmony_ci }, If); 50623b3eb3cSopenharmony_ci If.pop(); 50723b3eb3cSopenharmony_ci Row.pop(); 50823b3eb3cSopenharmony_ci } 50923b3eb3cSopenharmony_ci 51023b3eb3cSopenharmony_ci imagePart(y31 = null) { 51123b3eb3cSopenharmony_ci this.observeComponentCreation2((b32, c32) => { 51223b3eb3cSopenharmony_ci Column.create(); 51323b3eb3cSopenharmony_ci Column.width('100%'); 51423b3eb3cSopenharmony_ci }, Column); 51523b3eb3cSopenharmony_ci this.observeComponentCreation2((z31, a32) => { 51623b3eb3cSopenharmony_ci Image.create(this.imageRes); 51723b3eb3cSopenharmony_ci Image.objectFit(ImageFit.Contain); 51823b3eb3cSopenharmony_ci Image.borderRadius({ 51923b3eb3cSopenharmony_ci 'id': -1, 52023b3eb3cSopenharmony_ci 'type': 10002, 52123b3eb3cSopenharmony_ci params: ['sys.float.corner_radius_level6'], 52223b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 52323b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 52423b3eb3cSopenharmony_ci }); 52523b3eb3cSopenharmony_ci Image.constraintSize({ 52623b3eb3cSopenharmony_ci maxWidth: this.imageSize?.width ?? DEFAULT_IMAGE_SIZE, 52723b3eb3cSopenharmony_ci maxHeight: this.imageSize?.height ?? DEFAULT_IMAGE_SIZE 52823b3eb3cSopenharmony_ci }); 52923b3eb3cSopenharmony_ci }, Image); 53023b3eb3cSopenharmony_ci Column.pop(); 53123b3eb3cSopenharmony_ci } 53223b3eb3cSopenharmony_ci 53323b3eb3cSopenharmony_ci textPart(g31 = null) { 53423b3eb3cSopenharmony_ci this.observeComponentCreation2((w31, x31) => { 53523b3eb3cSopenharmony_ci Scroll.create(this.contentScroller); 53623b3eb3cSopenharmony_ci Scroll.nestedScroll({ 53723b3eb3cSopenharmony_ci scrollForward: NestedScrollMode.PARALLEL, 53823b3eb3cSopenharmony_ci scrollBackward: NestedScrollMode.PARALLEL 53923b3eb3cSopenharmony_ci }); 54023b3eb3cSopenharmony_ci Scroll.margin({ end: LengthMetrics.vp(this.marginOffset) }); 54123b3eb3cSopenharmony_ci }, Scroll); 54223b3eb3cSopenharmony_ci this.observeComponentCreation2((u31, v31) => { 54323b3eb3cSopenharmony_ci Column.create(); 54423b3eb3cSopenharmony_ci Column.margin({ 54523b3eb3cSopenharmony_ci end: LengthMetrics.resource({ 54623b3eb3cSopenharmony_ci 'id': -1, 54723b3eb3cSopenharmony_ci 'type': 10002, 54823b3eb3cSopenharmony_ci params: ['sys.float.padding_level8'], 54923b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 55023b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 55123b3eb3cSopenharmony_ci }) 55223b3eb3cSopenharmony_ci }); 55323b3eb3cSopenharmony_ci }, Column); 55423b3eb3cSopenharmony_ci this.observeComponentCreation2((o31, p31) => { 55523b3eb3cSopenharmony_ci If.create(); 55623b3eb3cSopenharmony_ci if (this.title !== null) { 55723b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 55823b3eb3cSopenharmony_ci this.observeComponentCreation2((s31, t31) => { 55923b3eb3cSopenharmony_ci Row.create(); 56023b3eb3cSopenharmony_ci Row.padding({ 56123b3eb3cSopenharmony_ci bottom: { 56223b3eb3cSopenharmony_ci 'id': -1, 56323b3eb3cSopenharmony_ci 'type': 10002, 56423b3eb3cSopenharmony_ci params: ['sys.float.padding_level8'], 56523b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 56623b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 56723b3eb3cSopenharmony_ci } 56823b3eb3cSopenharmony_ci }); 56923b3eb3cSopenharmony_ci }, Row); 57023b3eb3cSopenharmony_ci this.observeComponentCreation2((q31, r31) => { 57123b3eb3cSopenharmony_ci Text.create(this.title); 57223b3eb3cSopenharmony_ci Text.fontSize(`${TITLE_S}fp`); 57323b3eb3cSopenharmony_ci Text.fontWeight(FontWeight.Bold); 57423b3eb3cSopenharmony_ci Text.fontColor(ObservedObject.GetRawObject(this.fontColorWithTheme)); 57523b3eb3cSopenharmony_ci Text.textAlign(TextAlign.Center); 57623b3eb3cSopenharmony_ci Text.maxLines(CONTENT_MAX_LINES); 57723b3eb3cSopenharmony_ci Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 57823b3eb3cSopenharmony_ci Text.width('100%'); 57923b3eb3cSopenharmony_ci }, Text); 58023b3eb3cSopenharmony_ci Text.pop(); 58123b3eb3cSopenharmony_ci Row.pop(); 58223b3eb3cSopenharmony_ci }); 58323b3eb3cSopenharmony_ci } else { 58423b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 58523b3eb3cSopenharmony_ci }); 58623b3eb3cSopenharmony_ci } 58723b3eb3cSopenharmony_ci }, If); 58823b3eb3cSopenharmony_ci If.pop(); 58923b3eb3cSopenharmony_ci this.observeComponentCreation2((h31, i31) => { 59023b3eb3cSopenharmony_ci If.create(); 59123b3eb3cSopenharmony_ci if (this.content !== null) { 59223b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 59323b3eb3cSopenharmony_ci this.observeComponentCreation2((m31, n31) => { 59423b3eb3cSopenharmony_ci Row.create(); 59523b3eb3cSopenharmony_ci }, Row); 59623b3eb3cSopenharmony_ci this.observeComponentCreation2((j31, k31) => { 59723b3eb3cSopenharmony_ci Text.create(this.content); 59823b3eb3cSopenharmony_ci Text.focusable(true); 59923b3eb3cSopenharmony_ci Text.defaultFocus(!(this.primaryButton || this.secondaryButton)); 60023b3eb3cSopenharmony_ci Text.focusBox({ 60123b3eb3cSopenharmony_ci strokeWidth: LengthMetrics.px(0) 60223b3eb3cSopenharmony_ci }); 60323b3eb3cSopenharmony_ci Text.fontSize(this.getContentFontSize()); 60423b3eb3cSopenharmony_ci Text.fontWeight(FontWeight.Medium); 60523b3eb3cSopenharmony_ci Text.fontColor(ObservedObject.GetRawObject(this.fontColorWithTheme)); 60623b3eb3cSopenharmony_ci Text.textAlign(this.textAlignment); 60723b3eb3cSopenharmony_ci Text.width('100%'); 60823b3eb3cSopenharmony_ci Text.onKeyEvent((l31) => { 60923b3eb3cSopenharmony_ci if (l31) { 61023b3eb3cSopenharmony_ci resolveKeyEvent(l31, this.contentScroller); 61123b3eb3cSopenharmony_ci } 61223b3eb3cSopenharmony_ci }); 61323b3eb3cSopenharmony_ci }, Text); 61423b3eb3cSopenharmony_ci Text.pop(); 61523b3eb3cSopenharmony_ci Row.pop(); 61623b3eb3cSopenharmony_ci }); 61723b3eb3cSopenharmony_ci } else { 61823b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 61923b3eb3cSopenharmony_ci }); 62023b3eb3cSopenharmony_ci } 62123b3eb3cSopenharmony_ci }, If); 62223b3eb3cSopenharmony_ci If.pop(); 62323b3eb3cSopenharmony_ci Column.pop(); 62423b3eb3cSopenharmony_ci Scroll.pop(); 62523b3eb3cSopenharmony_ci } 62623b3eb3cSopenharmony_ci 62723b3eb3cSopenharmony_ci aboutToAppear() { 62823b3eb3cSopenharmony_ci this.fontColorWithTheme = this.theme?.colors?.fontPrimary ? 62923b3eb3cSopenharmony_ci this.theme.colors.fontPrimary : { 63023b3eb3cSopenharmony_ci 'id': -1, 63123b3eb3cSopenharmony_ci 'type': 10001, 63223b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 63323b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 63423b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 63523b3eb3cSopenharmony_ci }; 63623b3eb3cSopenharmony_ci this.initButtons(); 63723b3eb3cSopenharmony_ci this.initMargin(); 63823b3eb3cSopenharmony_ci } 63923b3eb3cSopenharmony_ci 64023b3eb3cSopenharmony_ci getContentFontSize() { 64123b3eb3cSopenharmony_ci return BODY_L + 'fp'; 64223b3eb3cSopenharmony_ci } 64323b3eb3cSopenharmony_ci 64423b3eb3cSopenharmony_ci initButtons() { 64523b3eb3cSopenharmony_ci if (!this.primaryButton && !this.secondaryButton) { 64623b3eb3cSopenharmony_ci return; 64723b3eb3cSopenharmony_ci } 64823b3eb3cSopenharmony_ci this.buttons = []; 64923b3eb3cSopenharmony_ci if (this.primaryButton) { 65023b3eb3cSopenharmony_ci this.buttons.push(this.primaryButton); 65123b3eb3cSopenharmony_ci } 65223b3eb3cSopenharmony_ci if (this.secondaryButton) { 65323b3eb3cSopenharmony_ci this.buttons.push(this.secondaryButton); 65423b3eb3cSopenharmony_ci } 65523b3eb3cSopenharmony_ci } 65623b3eb3cSopenharmony_ci 65723b3eb3cSopenharmony_ci initMargin() { 65823b3eb3cSopenharmony_ci this.marginOffset = 0 - PADDING_LEVEL_8; 65923b3eb3cSopenharmony_ci } 66023b3eb3cSopenharmony_ci 66123b3eb3cSopenharmony_ci rerender() { 66223b3eb3cSopenharmony_ci this.updateDirtyElements(); 66323b3eb3cSopenharmony_ci } 66423b3eb3cSopenharmony_ci} 66523b3eb3cSopenharmony_ci 66623b3eb3cSopenharmony_ciclass TipsDialogContentLayout extends ViewPU { 66723b3eb3cSopenharmony_ci constructor(z30, a31, b31, c31 = -1, d31 = undefined, e31) { 66823b3eb3cSopenharmony_ci super(z30, b31, c31, e31); 66923b3eb3cSopenharmony_ci if (typeof d31 === "function") { 67023b3eb3cSopenharmony_ci this.paramsGenerator_ = d31; 67123b3eb3cSopenharmony_ci } 67223b3eb3cSopenharmony_ci this.title = null; 67323b3eb3cSopenharmony_ci this.content = null; 67423b3eb3cSopenharmony_ci this.checkTips = null; 67523b3eb3cSopenharmony_ci this.updateTextAlign = (f31) => { 67623b3eb3cSopenharmony_ci }; 67723b3eb3cSopenharmony_ci this.__minContentHeight = new SynchedPropertySimpleTwoWayPU(a31.minContentHeight, this, 'minContentHeight'); 67823b3eb3cSopenharmony_ci this.dialogBuilder = this.doNothingBuilder; 67923b3eb3cSopenharmony_ci this.imageIndex = 0; 68023b3eb3cSopenharmony_ci this.textIndex = 1; 68123b3eb3cSopenharmony_ci this.checkBoxIndex = 2; 68223b3eb3cSopenharmony_ci this.childrenSize = 3; 68323b3eb3cSopenharmony_ci this.setInitiallyProvidedValue(a31); 68423b3eb3cSopenharmony_ci this.finalizeConstruction(); 68523b3eb3cSopenharmony_ci } 68623b3eb3cSopenharmony_ci 68723b3eb3cSopenharmony_ci setInitiallyProvidedValue(y30) { 68823b3eb3cSopenharmony_ci if (y30.title !== undefined) { 68923b3eb3cSopenharmony_ci this.title = y30.title; 69023b3eb3cSopenharmony_ci } 69123b3eb3cSopenharmony_ci if (y30.content !== undefined) { 69223b3eb3cSopenharmony_ci this.content = y30.content; 69323b3eb3cSopenharmony_ci } 69423b3eb3cSopenharmony_ci if (y30.checkTips !== undefined) { 69523b3eb3cSopenharmony_ci this.checkTips = y30.checkTips; 69623b3eb3cSopenharmony_ci } 69723b3eb3cSopenharmony_ci if (y30.updateTextAlign !== undefined) { 69823b3eb3cSopenharmony_ci this.updateTextAlign = y30.updateTextAlign; 69923b3eb3cSopenharmony_ci } 70023b3eb3cSopenharmony_ci if (y30.dialogBuilder !== undefined) { 70123b3eb3cSopenharmony_ci this.dialogBuilder = y30.dialogBuilder; 70223b3eb3cSopenharmony_ci } 70323b3eb3cSopenharmony_ci if (y30.imageIndex !== undefined) { 70423b3eb3cSopenharmony_ci this.imageIndex = y30.imageIndex; 70523b3eb3cSopenharmony_ci } 70623b3eb3cSopenharmony_ci if (y30.textIndex !== undefined) { 70723b3eb3cSopenharmony_ci this.textIndex = y30.textIndex; 70823b3eb3cSopenharmony_ci } 70923b3eb3cSopenharmony_ci if (y30.checkBoxIndex !== undefined) { 71023b3eb3cSopenharmony_ci this.checkBoxIndex = y30.checkBoxIndex; 71123b3eb3cSopenharmony_ci } 71223b3eb3cSopenharmony_ci if (y30.childrenSize !== undefined) { 71323b3eb3cSopenharmony_ci this.childrenSize = y30.childrenSize; 71423b3eb3cSopenharmony_ci } 71523b3eb3cSopenharmony_ci } 71623b3eb3cSopenharmony_ci 71723b3eb3cSopenharmony_ci updateStateVars(x30) { 71823b3eb3cSopenharmony_ci } 71923b3eb3cSopenharmony_ci 72023b3eb3cSopenharmony_ci purgeVariableDependenciesOnElmtId(w30) { 72123b3eb3cSopenharmony_ci this.__minContentHeight.purgeDependencyOnElmtId(w30); 72223b3eb3cSopenharmony_ci } 72323b3eb3cSopenharmony_ci 72423b3eb3cSopenharmony_ci aboutToBeDeleted() { 72523b3eb3cSopenharmony_ci this.__minContentHeight.aboutToBeDeleted(); 72623b3eb3cSopenharmony_ci SubscriberManager.Get().delete(this.id__()); 72723b3eb3cSopenharmony_ci this.aboutToBeDeletedInternal(); 72823b3eb3cSopenharmony_ci } 72923b3eb3cSopenharmony_ci 73023b3eb3cSopenharmony_ci doNothingBuilder(v30 = null) { 73123b3eb3cSopenharmony_ci } 73223b3eb3cSopenharmony_ci 73323b3eb3cSopenharmony_ci get minContentHeight() { 73423b3eb3cSopenharmony_ci return this.__minContentHeight.get(); 73523b3eb3cSopenharmony_ci } 73623b3eb3cSopenharmony_ci 73723b3eb3cSopenharmony_ci set minContentHeight(u30) { 73823b3eb3cSopenharmony_ci this.__minContentHeight.set(u30); 73923b3eb3cSopenharmony_ci } 74023b3eb3cSopenharmony_ci 74123b3eb3cSopenharmony_ci onPlaceChildren(n30, o30, p30) { 74223b3eb3cSopenharmony_ci let q30 = 0; 74323b3eb3cSopenharmony_ci let r30 = 0; 74423b3eb3cSopenharmony_ci for (let s30 = 0; s30 < o30.length; s30++) { 74523b3eb3cSopenharmony_ci let t30 = o30[s30]; 74623b3eb3cSopenharmony_ci t30.layout({ x: q30, y: r30 }); 74723b3eb3cSopenharmony_ci r30 += t30.measureResult.height; 74823b3eb3cSopenharmony_ci } 74923b3eb3cSopenharmony_ci } 75023b3eb3cSopenharmony_ci 75123b3eb3cSopenharmony_ci onMeasureSize(v29, w29, x29) { 75223b3eb3cSopenharmony_ci let y29 = { width: Number(x29.maxWidth), height: 0 }; 75323b3eb3cSopenharmony_ci if (w29.length < this.childrenSize) { 75423b3eb3cSopenharmony_ci return y29; 75523b3eb3cSopenharmony_ci } 75623b3eb3cSopenharmony_ci let z29 = 0; 75723b3eb3cSopenharmony_ci let a30 = 0; 75823b3eb3cSopenharmony_ci if (this.checkTips !== null) { 75923b3eb3cSopenharmony_ci let k30 = w29[this.checkBoxIndex]; 76023b3eb3cSopenharmony_ci let l30 = { 76123b3eb3cSopenharmony_ci maxWidth: x29.maxWidth, 76223b3eb3cSopenharmony_ci minHeight: CHECKBOX_CONTAINER_HEIGHT, 76323b3eb3cSopenharmony_ci maxHeight: x29.maxHeight 76423b3eb3cSopenharmony_ci }; 76523b3eb3cSopenharmony_ci let m30 = k30.measure(l30); 76623b3eb3cSopenharmony_ci a30 = m30.height; 76723b3eb3cSopenharmony_ci z29 += a30; 76823b3eb3cSopenharmony_ci } 76923b3eb3cSopenharmony_ci let b30 = w29[this.imageIndex]; 77023b3eb3cSopenharmony_ci let c30 = 0; 77123b3eb3cSopenharmony_ci if (this.title !== null || this.content !== null) { 77223b3eb3cSopenharmony_ci c30 = TEXT_MIN_HEIGHT + PADDING_LEVEL_8; 77323b3eb3cSopenharmony_ci } 77423b3eb3cSopenharmony_ci let d30 = Number(x29.maxHeight) - a30 - c30; 77523b3eb3cSopenharmony_ci let e30 = { 77623b3eb3cSopenharmony_ci maxWidth: x29.maxWidth, 77723b3eb3cSopenharmony_ci maxHeight: d30 77823b3eb3cSopenharmony_ci }; 77923b3eb3cSopenharmony_ci let f30 = b30.measure(e30); 78023b3eb3cSopenharmony_ci z29 += f30.height; 78123b3eb3cSopenharmony_ci if (this.title !== null || this.content !== null) { 78223b3eb3cSopenharmony_ci let g30 = w29[this.textIndex]; 78323b3eb3cSopenharmony_ci this.updateTextAlign(y29.width); 78423b3eb3cSopenharmony_ci let h30 = Number(x29.maxHeight) - f30.height - a30; 78523b3eb3cSopenharmony_ci let i30 = { 78623b3eb3cSopenharmony_ci maxWidth: x29.maxWidth, 78723b3eb3cSopenharmony_ci maxHeight: Math.max(h30, TEXT_MIN_HEIGHT) 78823b3eb3cSopenharmony_ci }; 78923b3eb3cSopenharmony_ci let j30 = g30.measure(i30); 79023b3eb3cSopenharmony_ci z29 += j30.height; 79123b3eb3cSopenharmony_ci } 79223b3eb3cSopenharmony_ci y29.height = z29; 79323b3eb3cSopenharmony_ci this.minContentHeight = Math.max(a30 + f30.height + c30, MIN_CONTENT_HEIGHT); 79423b3eb3cSopenharmony_ci return y29; 79523b3eb3cSopenharmony_ci } 79623b3eb3cSopenharmony_ci 79723b3eb3cSopenharmony_ci initialRender() { 79823b3eb3cSopenharmony_ci this.dialogBuilder.bind(this)(); 79923b3eb3cSopenharmony_ci } 80023b3eb3cSopenharmony_ci 80123b3eb3cSopenharmony_ci rerender() { 80223b3eb3cSopenharmony_ci this.updateDirtyElements(); 80323b3eb3cSopenharmony_ci } 80423b3eb3cSopenharmony_ci} 80523b3eb3cSopenharmony_ci 80623b3eb3cSopenharmony_ciexport class SelectDialog extends ViewPU { 80723b3eb3cSopenharmony_ci constructor(p29, q29, r29, s29 = -1, t29 = undefined, u29) { 80823b3eb3cSopenharmony_ci super(p29, r29, s29, u29); 80923b3eb3cSopenharmony_ci if (typeof t29 === 'function') { 81023b3eb3cSopenharmony_ci this.paramsGenerator_ = t29; 81123b3eb3cSopenharmony_ci } 81223b3eb3cSopenharmony_ci this.controller = undefined; 81323b3eb3cSopenharmony_ci this.title = ''; 81423b3eb3cSopenharmony_ci this.content = ''; 81523b3eb3cSopenharmony_ci this.confirm = null; 81623b3eb3cSopenharmony_ci this.radioContent = []; 81723b3eb3cSopenharmony_ci this.buttons = []; 81823b3eb3cSopenharmony_ci this.contentPadding = undefined; 81923b3eb3cSopenharmony_ci this.isFocus = false; 82023b3eb3cSopenharmony_ci this.currentFocusIndex = -1; 82123b3eb3cSopenharmony_ci this.radioHeight = 0; 82223b3eb3cSopenharmony_ci this.itemHeight = 0; 82323b3eb3cSopenharmony_ci this.__selectedIndex = new ObservedPropertySimplePU(-1, this, 'selectedIndex'); 82423b3eb3cSopenharmony_ci this.contentBuilder = this.buildContent; 82523b3eb3cSopenharmony_ci this.__fontColorWithTheme = new ObservedPropertyObjectPU({ 82623b3eb3cSopenharmony_ci 'id': -1, 82723b3eb3cSopenharmony_ci 'type': 10001, 82823b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 82923b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 83023b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 83123b3eb3cSopenharmony_ci }, this, 'fontColorWithTheme'); 83223b3eb3cSopenharmony_ci this.__dividerColorWithTheme = new ObservedPropertyObjectPU({ 83323b3eb3cSopenharmony_ci 'id': -1, 83423b3eb3cSopenharmony_ci 'type': 10001, 83523b3eb3cSopenharmony_ci params: ['sys.color.comp_divider'], 83623b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 83723b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 83823b3eb3cSopenharmony_ci }, this, 'dividerColorWithTheme'); 83923b3eb3cSopenharmony_ci this.theme = new CustomThemeImpl({}); 84023b3eb3cSopenharmony_ci this.themeColorMode = ThemeColorMode.SYSTEM; 84123b3eb3cSopenharmony_ci this.contentScroller = new Scroller(); 84223b3eb3cSopenharmony_ci this.__fontSizeScale = new ObservedPropertySimplePU(1, this, 'fontSizeScale'); 84323b3eb3cSopenharmony_ci this.__minContentHeight = new ObservedPropertySimplePU(MIN_CONTENT_HEIGHT, this, 'minContentHeight'); 84423b3eb3cSopenharmony_ci this.setInitiallyProvidedValue(q29); 84523b3eb3cSopenharmony_ci this.finalizeConstruction(); 84623b3eb3cSopenharmony_ci } 84723b3eb3cSopenharmony_ci 84823b3eb3cSopenharmony_ci setInitiallyProvidedValue(o29) { 84923b3eb3cSopenharmony_ci if (o29.controller !== undefined) { 85023b3eb3cSopenharmony_ci this.controller = o29.controller; 85123b3eb3cSopenharmony_ci } 85223b3eb3cSopenharmony_ci if (o29.title !== undefined) { 85323b3eb3cSopenharmony_ci this.title = o29.title; 85423b3eb3cSopenharmony_ci } 85523b3eb3cSopenharmony_ci if (o29.content !== undefined) { 85623b3eb3cSopenharmony_ci this.content = o29.content; 85723b3eb3cSopenharmony_ci } 85823b3eb3cSopenharmony_ci if (o29.confirm !== undefined) { 85923b3eb3cSopenharmony_ci this.confirm = o29.confirm; 86023b3eb3cSopenharmony_ci } 86123b3eb3cSopenharmony_ci if (o29.radioContent !== undefined) { 86223b3eb3cSopenharmony_ci this.radioContent = o29.radioContent; 86323b3eb3cSopenharmony_ci } 86423b3eb3cSopenharmony_ci if (o29.buttons !== undefined) { 86523b3eb3cSopenharmony_ci this.buttons = o29.buttons; 86623b3eb3cSopenharmony_ci } 86723b3eb3cSopenharmony_ci if (o29.contentPadding !== undefined) { 86823b3eb3cSopenharmony_ci this.contentPadding = o29.contentPadding; 86923b3eb3cSopenharmony_ci } 87023b3eb3cSopenharmony_ci if (o29.isFocus !== undefined) { 87123b3eb3cSopenharmony_ci this.isFocus = o29.isFocus; 87223b3eb3cSopenharmony_ci } 87323b3eb3cSopenharmony_ci if (o29.currentFocusIndex !== undefined) { 87423b3eb3cSopenharmony_ci this.currentFocusIndex = o29.currentFocusIndex; 87523b3eb3cSopenharmony_ci } 87623b3eb3cSopenharmony_ci if (o29.radioHeight !== undefined) { 87723b3eb3cSopenharmony_ci this.radioHeight = o29.radioHeight; 87823b3eb3cSopenharmony_ci } 87923b3eb3cSopenharmony_ci if (o29.itemHeight !== undefined) { 88023b3eb3cSopenharmony_ci this.itemHeight = o29.itemHeight; 88123b3eb3cSopenharmony_ci } 88223b3eb3cSopenharmony_ci if (o29.selectedIndex !== undefined) { 88323b3eb3cSopenharmony_ci this.selectedIndex = o29.selectedIndex; 88423b3eb3cSopenharmony_ci } 88523b3eb3cSopenharmony_ci if (o29.contentBuilder !== undefined) { 88623b3eb3cSopenharmony_ci this.contentBuilder = o29.contentBuilder; 88723b3eb3cSopenharmony_ci } 88823b3eb3cSopenharmony_ci if (o29.fontColorWithTheme !== undefined) { 88923b3eb3cSopenharmony_ci this.fontColorWithTheme = o29.fontColorWithTheme; 89023b3eb3cSopenharmony_ci } 89123b3eb3cSopenharmony_ci if (o29.dividerColorWithTheme !== undefined) { 89223b3eb3cSopenharmony_ci this.dividerColorWithTheme = o29.dividerColorWithTheme; 89323b3eb3cSopenharmony_ci } 89423b3eb3cSopenharmony_ci if (o29.theme !== undefined) { 89523b3eb3cSopenharmony_ci this.theme = o29.theme; 89623b3eb3cSopenharmony_ci } 89723b3eb3cSopenharmony_ci if (o29.themeColorMode !== undefined) { 89823b3eb3cSopenharmony_ci this.themeColorMode = o29.themeColorMode; 89923b3eb3cSopenharmony_ci } 90023b3eb3cSopenharmony_ci if (o29.contentScroller !== undefined) { 90123b3eb3cSopenharmony_ci this.contentScroller = o29.contentScroller; 90223b3eb3cSopenharmony_ci } 90323b3eb3cSopenharmony_ci if (o29.fontSizeScale !== undefined) { 90423b3eb3cSopenharmony_ci this.fontSizeScale = o29.fontSizeScale; 90523b3eb3cSopenharmony_ci } 90623b3eb3cSopenharmony_ci if (o29.minContentHeight !== undefined) { 90723b3eb3cSopenharmony_ci this.minContentHeight = o29.minContentHeight; 90823b3eb3cSopenharmony_ci } 90923b3eb3cSopenharmony_ci } 91023b3eb3cSopenharmony_ci 91123b3eb3cSopenharmony_ci updateStateVars(n29) { 91223b3eb3cSopenharmony_ci } 91323b3eb3cSopenharmony_ci 91423b3eb3cSopenharmony_ci purgeVariableDependenciesOnElmtId(m29) { 91523b3eb3cSopenharmony_ci this.__selectedIndex.purgeDependencyOnElmtId(m29); 91623b3eb3cSopenharmony_ci this.__fontColorWithTheme.purgeDependencyOnElmtId(m29); 91723b3eb3cSopenharmony_ci this.__dividerColorWithTheme.purgeDependencyOnElmtId(m29); 91823b3eb3cSopenharmony_ci this.__fontSizeScale.purgeDependencyOnElmtId(m29); 91923b3eb3cSopenharmony_ci this.__minContentHeight.purgeDependencyOnElmtId(m29); 92023b3eb3cSopenharmony_ci } 92123b3eb3cSopenharmony_ci aboutToBeDeleted() { 92223b3eb3cSopenharmony_ci this.__selectedIndex.aboutToBeDeleted(); 92323b3eb3cSopenharmony_ci this.__fontColorWithTheme.aboutToBeDeleted(); 92423b3eb3cSopenharmony_ci this.__dividerColorWithTheme.aboutToBeDeleted(); 92523b3eb3cSopenharmony_ci this.__fontSizeScale.aboutToBeDeleted(); 92623b3eb3cSopenharmony_ci this.__minContentHeight.aboutToBeDeleted(); 92723b3eb3cSopenharmony_ci SubscriberManager.Get().delete(this.id__()); 92823b3eb3cSopenharmony_ci this.aboutToBeDeletedInternal(); 92923b3eb3cSopenharmony_ci } 93023b3eb3cSopenharmony_ci 93123b3eb3cSopenharmony_ci setController(l29) { 93223b3eb3cSopenharmony_ci this.controller = l29; 93323b3eb3cSopenharmony_ci } 93423b3eb3cSopenharmony_ci 93523b3eb3cSopenharmony_ci get selectedIndex() { 93623b3eb3cSopenharmony_ci return this.__selectedIndex.get(); 93723b3eb3cSopenharmony_ci } 93823b3eb3cSopenharmony_ci 93923b3eb3cSopenharmony_ci set selectedIndex(k29) { 94023b3eb3cSopenharmony_ci this.__selectedIndex.set(k29); 94123b3eb3cSopenharmony_ci } 94223b3eb3cSopenharmony_ci 94323b3eb3cSopenharmony_ci get fontColorWithTheme() { 94423b3eb3cSopenharmony_ci return this.__fontColorWithTheme.get(); 94523b3eb3cSopenharmony_ci } 94623b3eb3cSopenharmony_ci 94723b3eb3cSopenharmony_ci set fontColorWithTheme(j29) { 94823b3eb3cSopenharmony_ci this.__fontColorWithTheme.set(j29); 94923b3eb3cSopenharmony_ci } 95023b3eb3cSopenharmony_ci 95123b3eb3cSopenharmony_ci get dividerColorWithTheme() { 95223b3eb3cSopenharmony_ci return this.__dividerColorWithTheme.get(); 95323b3eb3cSopenharmony_ci } 95423b3eb3cSopenharmony_ci 95523b3eb3cSopenharmony_ci set dividerColorWithTheme(i29) { 95623b3eb3cSopenharmony_ci this.__dividerColorWithTheme.set(i29); 95723b3eb3cSopenharmony_ci } 95823b3eb3cSopenharmony_ci 95923b3eb3cSopenharmony_ci get fontSizeScale() { 96023b3eb3cSopenharmony_ci return this.__fontSizeScale.get(); 96123b3eb3cSopenharmony_ci } 96223b3eb3cSopenharmony_ci 96323b3eb3cSopenharmony_ci set fontSizeScale(h29) { 96423b3eb3cSopenharmony_ci this.__fontSizeScale.set(h29); 96523b3eb3cSopenharmony_ci } 96623b3eb3cSopenharmony_ci 96723b3eb3cSopenharmony_ci get minContentHeight() { 96823b3eb3cSopenharmony_ci return this.__minContentHeight.get(); 96923b3eb3cSopenharmony_ci } 97023b3eb3cSopenharmony_ci 97123b3eb3cSopenharmony_ci set minContentHeight(g29) { 97223b3eb3cSopenharmony_ci this.__minContentHeight.set(g29); 97323b3eb3cSopenharmony_ci } 97423b3eb3cSopenharmony_ci buildContent(j27 = null) { 97523b3eb3cSopenharmony_ci this.observeComponentCreation2((b29, c29) => { 97623b3eb3cSopenharmony_ci Scroll.create(this.contentScroller); 97723b3eb3cSopenharmony_ci Scroll.scrollBar(BarState.Auto); 97823b3eb3cSopenharmony_ci Scroll.nestedScroll({ 97923b3eb3cSopenharmony_ci scrollForward: NestedScrollMode.PARALLEL, 98023b3eb3cSopenharmony_ci scrollBackward: NestedScrollMode.PARALLEL 98123b3eb3cSopenharmony_ci }); 98223b3eb3cSopenharmony_ci Scroll.onDidScroll((d29, e29) => { 98323b3eb3cSopenharmony_ci let f29 = (this.itemHeight - this.radioHeight) / 2; 98423b3eb3cSopenharmony_ci if (this.isFocus) { 98523b3eb3cSopenharmony_ci if (this.currentFocusIndex === this.radioContent.length - 1) { 98623b3eb3cSopenharmony_ci this.contentScroller.scrollEdge(Edge.Bottom); 98723b3eb3cSopenharmony_ci this.currentFocusIndex = -1; 98823b3eb3cSopenharmony_ci } else if (this.currentFocusIndex === FIRST_ITEM_INDEX) { 98923b3eb3cSopenharmony_ci this.contentScroller.scrollEdge(Edge.Top); 99023b3eb3cSopenharmony_ci this.currentFocusIndex = -1; 99123b3eb3cSopenharmony_ci } else { 99223b3eb3cSopenharmony_ci if (e29 > 0) { 99323b3eb3cSopenharmony_ci this.contentScroller.scrollBy(0, f29); 99423b3eb3cSopenharmony_ci } else if (e29 < 0) { 99523b3eb3cSopenharmony_ci this.contentScroller.scrollBy(0, 0 - f29); 99623b3eb3cSopenharmony_ci } 99723b3eb3cSopenharmony_ci } 99823b3eb3cSopenharmony_ci this.isFocus = false; 99923b3eb3cSopenharmony_ci } 100023b3eb3cSopenharmony_ci }); 100123b3eb3cSopenharmony_ci }, Scroll); 100223b3eb3cSopenharmony_ci this.observeComponentCreation2((z28, a29) => { 100323b3eb3cSopenharmony_ci Column.create(); 100423b3eb3cSopenharmony_ci }, Column); 100523b3eb3cSopenharmony_ci this.observeComponentCreation2((t28, u28) => { 100623b3eb3cSopenharmony_ci If.create(); 100723b3eb3cSopenharmony_ci if (this.content) { 100823b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 100923b3eb3cSopenharmony_ci this.observeComponentCreation2((x28, y28) => { 101023b3eb3cSopenharmony_ci Row.create(); 101123b3eb3cSopenharmony_ci Row.padding({ 101223b3eb3cSopenharmony_ci left: { 101323b3eb3cSopenharmony_ci 'id': -1, 101423b3eb3cSopenharmony_ci 'type': 10002, 101523b3eb3cSopenharmony_ci params: ['sys.float.padding_level12'], 101623b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 101723b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 101823b3eb3cSopenharmony_ci }, 101923b3eb3cSopenharmony_ci right: { 102023b3eb3cSopenharmony_ci 'id': -1, 102123b3eb3cSopenharmony_ci 'type': 10002, 102223b3eb3cSopenharmony_ci params: ['sys.float.padding_level12'], 102323b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 102423b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 102523b3eb3cSopenharmony_ci }, 102623b3eb3cSopenharmony_ci bottom: { 102723b3eb3cSopenharmony_ci 'id': -1, 102823b3eb3cSopenharmony_ci 'type': 10002, 102923b3eb3cSopenharmony_ci params: ['sys.float.padding_level4'], 103023b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 103123b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 103223b3eb3cSopenharmony_ci } 103323b3eb3cSopenharmony_ci }); 103423b3eb3cSopenharmony_ci Row.width('100%'); 103523b3eb3cSopenharmony_ci }, Row); 103623b3eb3cSopenharmony_ci this.observeComponentCreation2((v28, w28) => { 103723b3eb3cSopenharmony_ci Text.create(this.content); 103823b3eb3cSopenharmony_ci Text.fontSize(`${BODY_M}fp`); 103923b3eb3cSopenharmony_ci Text.fontWeight(FontWeight.Regular); 104023b3eb3cSopenharmony_ci Text.fontColor(ObservedObject.GetRawObject(this.fontColorWithTheme)); 104123b3eb3cSopenharmony_ci Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 104223b3eb3cSopenharmony_ci }, Text); 104323b3eb3cSopenharmony_ci Text.pop(); 104423b3eb3cSopenharmony_ci Row.pop(); 104523b3eb3cSopenharmony_ci }); 104623b3eb3cSopenharmony_ci } else { 104723b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 104823b3eb3cSopenharmony_ci }); 104923b3eb3cSopenharmony_ci } 105023b3eb3cSopenharmony_ci }, If); 105123b3eb3cSopenharmony_ci If.pop(); 105223b3eb3cSopenharmony_ci this.observeComponentCreation2((r28, s28) => { 105323b3eb3cSopenharmony_ci List.create(); 105423b3eb3cSopenharmony_ci List.width('100%'); 105523b3eb3cSopenharmony_ci List.clip(false); 105623b3eb3cSopenharmony_ci List.onFocus(() => { 105723b3eb3cSopenharmony_ci if (!this.contentScroller.isAtEnd()) { 105823b3eb3cSopenharmony_ci this.contentScroller.scrollEdge(Edge.Top); 105923b3eb3cSopenharmony_ci focusControl.requestFocus(String(FIRST_ITEM_INDEX)); 106023b3eb3cSopenharmony_ci } 106123b3eb3cSopenharmony_ci }); 106223b3eb3cSopenharmony_ci List.defaultFocus(this.buttons?.length === 0 ? true : false); 106323b3eb3cSopenharmony_ci }, List); 106423b3eb3cSopenharmony_ci this.observeComponentCreation2((k27, l27) => { 106523b3eb3cSopenharmony_ci ForEach.create(); 106623b3eb3cSopenharmony_ci const m = (n27, o27) => { 106723b3eb3cSopenharmony_ci const p27 = n27; 106823b3eb3cSopenharmony_ci { 106923b3eb3cSopenharmony_ci const n = (p28, q28) => { 107023b3eb3cSopenharmony_ci ViewStackProcessor.StartGetAccessRecordingFor(p28); 107123b3eb3cSopenharmony_ci o(p28, q28); 107223b3eb3cSopenharmony_ci if (!q28) { 107323b3eb3cSopenharmony_ci ListItem.pop(); 107423b3eb3cSopenharmony_ci } 107523b3eb3cSopenharmony_ci ViewStackProcessor.StopGetAccessRecording(); 107623b3eb3cSopenharmony_ci }; 107723b3eb3cSopenharmony_ci const o = (l28, m28) => { 107823b3eb3cSopenharmony_ci ListItem.create(p, true); 107923b3eb3cSopenharmony_ci ListItem.padding({ 108023b3eb3cSopenharmony_ci left: { 108123b3eb3cSopenharmony_ci 'id': -1, 108223b3eb3cSopenharmony_ci 'type': 10002, 108323b3eb3cSopenharmony_ci params: ['sys.float.padding_level6'], 108423b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 108523b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 108623b3eb3cSopenharmony_ci }, 108723b3eb3cSopenharmony_ci right: { 108823b3eb3cSopenharmony_ci 'id': -1, 108923b3eb3cSopenharmony_ci 'type': 10002, 109023b3eb3cSopenharmony_ci params: ['sys.float.padding_level6'], 109123b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 109223b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 109323b3eb3cSopenharmony_ci } 109423b3eb3cSopenharmony_ci }); 109523b3eb3cSopenharmony_ci ListItem.onSizeChange((n28, o28) => { 109623b3eb3cSopenharmony_ci this.itemHeight = Number(o28.height); 109723b3eb3cSopenharmony_ci }); 109823b3eb3cSopenharmony_ci }; 109923b3eb3cSopenharmony_ci const p = (t27, u27) => { 110023b3eb3cSopenharmony_ci n(t27, u27); 110123b3eb3cSopenharmony_ci this.observeComponentCreation2((j28, k28) => { 110223b3eb3cSopenharmony_ci Column.create(); 110323b3eb3cSopenharmony_ci Column.borderRadius({ 110423b3eb3cSopenharmony_ci 'id': -1, 110523b3eb3cSopenharmony_ci 'type': 10002, 110623b3eb3cSopenharmony_ci params: ['sys.float.corner_radius_level8'], 110723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 110823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 110923b3eb3cSopenharmony_ci }); 111023b3eb3cSopenharmony_ci Column.focusBox({ 111123b3eb3cSopenharmony_ci margin: { value: -2, unit: LengthUnit.VP } 111223b3eb3cSopenharmony_ci }); 111323b3eb3cSopenharmony_ci Column.accessibilityText(getAccessibilityText(p27.title, this.selectedIndex === o27)); 111423b3eb3cSopenharmony_ci Column.onClick(() => { 111523b3eb3cSopenharmony_ci this.selectedIndex = o27; 111623b3eb3cSopenharmony_ci p27.action && p27.action(); 111723b3eb3cSopenharmony_ci this.controller?.close(); 111823b3eb3cSopenharmony_ci }); 111923b3eb3cSopenharmony_ci }, Column); 112023b3eb3cSopenharmony_ci this.observeComponentCreation2((h28, i28) => { 112123b3eb3cSopenharmony_ci Button.createWithChild(); 112223b3eb3cSopenharmony_ci Button.type(ButtonType.Normal); 112323b3eb3cSopenharmony_ci Button.borderRadius({ 112423b3eb3cSopenharmony_ci 'id': -1, 112523b3eb3cSopenharmony_ci 'type': 10002, 112623b3eb3cSopenharmony_ci params: ['sys.float.corner_radius_level8'], 112723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 112823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 112923b3eb3cSopenharmony_ci }); 113023b3eb3cSopenharmony_ci Button.buttonStyle(ButtonStyleMode.TEXTUAL); 113123b3eb3cSopenharmony_ci Button.padding({ 113223b3eb3cSopenharmony_ci left: { 113323b3eb3cSopenharmony_ci 'id': -1, 113423b3eb3cSopenharmony_ci 'type': 10002, 113523b3eb3cSopenharmony_ci params: ['sys.float.padding_level6'], 113623b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 113723b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 113823b3eb3cSopenharmony_ci }, 113923b3eb3cSopenharmony_ci right: { 114023b3eb3cSopenharmony_ci 'id': -1, 114123b3eb3cSopenharmony_ci 'type': 10002, 114223b3eb3cSopenharmony_ci params: ['sys.float.padding_level6'], 114323b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 114423b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 114523b3eb3cSopenharmony_ci } 114623b3eb3cSopenharmony_ci }); 114723b3eb3cSopenharmony_ci }, Button); 114823b3eb3cSopenharmony_ci this.observeComponentCreation2((f28, g28) => { 114923b3eb3cSopenharmony_ci Row.create(); 115023b3eb3cSopenharmony_ci Row.constraintSize({ minHeight: LIST_MIN_HEIGHT }); 115123b3eb3cSopenharmony_ci Row.clip(false); 115223b3eb3cSopenharmony_ci Row.padding({ 115323b3eb3cSopenharmony_ci top: { 115423b3eb3cSopenharmony_ci 'id': -1, 115523b3eb3cSopenharmony_ci 'type': 10002, 115623b3eb3cSopenharmony_ci params: ['sys.float.padding_level4'], 115723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 115823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 115923b3eb3cSopenharmony_ci }, 116023b3eb3cSopenharmony_ci bottom: { 116123b3eb3cSopenharmony_ci 'id': -1, 116223b3eb3cSopenharmony_ci 'type': 10002, 116323b3eb3cSopenharmony_ci params: ['sys.float.padding_level4'], 116423b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 116523b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 116623b3eb3cSopenharmony_ci } 116723b3eb3cSopenharmony_ci }); 116823b3eb3cSopenharmony_ci }, Row); 116923b3eb3cSopenharmony_ci this.observeComponentCreation2((d28, e28) => { 117023b3eb3cSopenharmony_ci Text.create(p27.title); 117123b3eb3cSopenharmony_ci Text.fontSize(`${BODY_L}fp`); 117223b3eb3cSopenharmony_ci Text.fontWeight(FontWeight.Medium); 117323b3eb3cSopenharmony_ci Text.fontColor(ObservedObject.GetRawObject(this.fontColorWithTheme)); 117423b3eb3cSopenharmony_ci Text.layoutWeight(1); 117523b3eb3cSopenharmony_ci }, Text); 117623b3eb3cSopenharmony_ci Text.pop(); 117723b3eb3cSopenharmony_ci this.observeComponentCreation2((z27, a28) => { 117823b3eb3cSopenharmony_ci Radio.create({ value: 'item.title', group: 'radioGroup' }); 117923b3eb3cSopenharmony_ci Radio.size({ width: CHECKBOX_CONTAINER_LENGTH, height: CHECKBOX_CONTAINER_LENGTH }); 118023b3eb3cSopenharmony_ci Radio.checked(this.selectedIndex === o27); 118123b3eb3cSopenharmony_ci Radio.hitTestBehavior(HitTestMode.None); 118223b3eb3cSopenharmony_ci Radio.id(String(o27)); 118323b3eb3cSopenharmony_ci Radio.focusable(false); 118423b3eb3cSopenharmony_ci Radio.accessibilityLevel('no'); 118523b3eb3cSopenharmony_ci Radio.onFocus(() => { 118623b3eb3cSopenharmony_ci this.isFocus = true; 118723b3eb3cSopenharmony_ci this.currentFocusIndex = o27; 118823b3eb3cSopenharmony_ci if (o27 === FIRST_ITEM_INDEX) { 118923b3eb3cSopenharmony_ci this.contentScroller.scrollEdge(Edge.Top); 119023b3eb3cSopenharmony_ci } else if (o27 === this.radioContent.length - 1) { 119123b3eb3cSopenharmony_ci this.contentScroller.scrollEdge(Edge.Bottom); 119223b3eb3cSopenharmony_ci } 119323b3eb3cSopenharmony_ci }); 119423b3eb3cSopenharmony_ci Radio.onSizeChange((b28, c28) => { 119523b3eb3cSopenharmony_ci this.radioHeight = Number(c28.height); 119623b3eb3cSopenharmony_ci }); 119723b3eb3cSopenharmony_ci }, Radio); 119823b3eb3cSopenharmony_ci Row.pop(); 119923b3eb3cSopenharmony_ci Button.pop(); 120023b3eb3cSopenharmony_ci this.observeComponentCreation2((v27, w27) => { 120123b3eb3cSopenharmony_ci If.create(); 120223b3eb3cSopenharmony_ci if (o27 < this.radioContent.length - 1) { 120323b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 120423b3eb3cSopenharmony_ci this.observeComponentCreation2((x27, y27) => { 120523b3eb3cSopenharmony_ci Divider.create(); 120623b3eb3cSopenharmony_ci Divider.color(ObservedObject.GetRawObject(this.dividerColorWithTheme)); 120723b3eb3cSopenharmony_ci Divider.padding({ 120823b3eb3cSopenharmony_ci left: { 120923b3eb3cSopenharmony_ci 'id': -1, 121023b3eb3cSopenharmony_ci 'type': 10002, 121123b3eb3cSopenharmony_ci params: ['sys.float.padding_level6'], 121223b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 121323b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 121423b3eb3cSopenharmony_ci }, 121523b3eb3cSopenharmony_ci right: { 121623b3eb3cSopenharmony_ci 'id': -1, 121723b3eb3cSopenharmony_ci 'type': 10002, 121823b3eb3cSopenharmony_ci params: ['sys.float.padding_level6'], 121923b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 122023b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 122123b3eb3cSopenharmony_ci } 122223b3eb3cSopenharmony_ci }); 122323b3eb3cSopenharmony_ci }, Divider); 122423b3eb3cSopenharmony_ci }); 122523b3eb3cSopenharmony_ci } else { 122623b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 122723b3eb3cSopenharmony_ci }); 122823b3eb3cSopenharmony_ci } 122923b3eb3cSopenharmony_ci }, If); 123023b3eb3cSopenharmony_ci If.pop(); 123123b3eb3cSopenharmony_ci Column.pop(); 123223b3eb3cSopenharmony_ci ListItem.pop(); 123323b3eb3cSopenharmony_ci }; 123423b3eb3cSopenharmony_ci this.observeComponentCreation2(o, ListItem); 123523b3eb3cSopenharmony_ci ListItem.pop(); 123623b3eb3cSopenharmony_ci } 123723b3eb3cSopenharmony_ci }; 123823b3eb3cSopenharmony_ci this.forEachUpdateFunction(k27, this.radioContent, m, undefined, true, false); 123923b3eb3cSopenharmony_ci }, ForEach); 124023b3eb3cSopenharmony_ci ForEach.pop(); 124123b3eb3cSopenharmony_ci List.pop(); 124223b3eb3cSopenharmony_ci Column.pop(); 124323b3eb3cSopenharmony_ci Scroll.pop(); 124423b3eb3cSopenharmony_ci } 124523b3eb3cSopenharmony_ci 124623b3eb3cSopenharmony_ci initialRender() { 124723b3eb3cSopenharmony_ci this.observeComponentCreation2((h27, i27) => { 124823b3eb3cSopenharmony_ci __Common__.create(); 124923b3eb3cSopenharmony_ci __Common__.constraintSize({ maxHeight: '100%' }); 125023b3eb3cSopenharmony_ci }, __Common__); 125123b3eb3cSopenharmony_ci { 125223b3eb3cSopenharmony_ci this.observeComponentCreation2((d27, e27) => { 125323b3eb3cSopenharmony_ci if (e27) { 125423b3eb3cSopenharmony_ci let f27 = new CustomDialogContentComponent(this, { 125523b3eb3cSopenharmony_ci controller: this.controller, 125623b3eb3cSopenharmony_ci primaryTitle: this.title, 125723b3eb3cSopenharmony_ci contentBuilder: () => { 125823b3eb3cSopenharmony_ci this.contentBuilder(); 125923b3eb3cSopenharmony_ci }, 126023b3eb3cSopenharmony_ci buttons: this.buttons, 126123b3eb3cSopenharmony_ci contentAreaPadding: this.contentPadding, 126223b3eb3cSopenharmony_ci theme: this.theme, 126323b3eb3cSopenharmony_ci themeColorMode: this.themeColorMode, 126423b3eb3cSopenharmony_ci fontSizeScale: this.__fontSizeScale, 126523b3eb3cSopenharmony_ci minContentHeight: this.__minContentHeight, 126623b3eb3cSopenharmony_ci }, undefined, d27, () => { 126723b3eb3cSopenharmony_ci }, { page: 'library/src/main/ets/components/MainPage.ets', line: 526, col: 5 }); 126823b3eb3cSopenharmony_ci ViewPU.create(f27); 126923b3eb3cSopenharmony_ci let l = () => { 127023b3eb3cSopenharmony_ci return { 127123b3eb3cSopenharmony_ci controller: this.controller, 127223b3eb3cSopenharmony_ci primaryTitle: this.title, 127323b3eb3cSopenharmony_ci contentBuilder: () => { 127423b3eb3cSopenharmony_ci this.contentBuilder(); 127523b3eb3cSopenharmony_ci }, 127623b3eb3cSopenharmony_ci buttons: this.buttons, 127723b3eb3cSopenharmony_ci contentAreaPadding: this.contentPadding, 127823b3eb3cSopenharmony_ci theme: this.theme, 127923b3eb3cSopenharmony_ci themeColorMode: this.themeColorMode, 128023b3eb3cSopenharmony_ci fontSizeScale: this.fontSizeScale, 128123b3eb3cSopenharmony_ci minContentHeight: this.minContentHeight 128223b3eb3cSopenharmony_ci }; 128323b3eb3cSopenharmony_ci }; 128423b3eb3cSopenharmony_ci f27.paramsGenerator_ = l; 128523b3eb3cSopenharmony_ci } else { 128623b3eb3cSopenharmony_ci this.updateStateVarsOfChildByElmtId(d27, {}); 128723b3eb3cSopenharmony_ci } 128823b3eb3cSopenharmony_ci }, { name: 'CustomDialogContentComponent' }); 128923b3eb3cSopenharmony_ci } 129023b3eb3cSopenharmony_ci __Common__.pop(); 129123b3eb3cSopenharmony_ci } 129223b3eb3cSopenharmony_ci 129323b3eb3cSopenharmony_ci aboutToAppear() { 129423b3eb3cSopenharmony_ci this.fontColorWithTheme = this.theme?.colors?.fontPrimary ? 129523b3eb3cSopenharmony_ci this.theme.colors.fontPrimary : { 129623b3eb3cSopenharmony_ci 'id': -1, 129723b3eb3cSopenharmony_ci 'type': 10001, 129823b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 129923b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 130023b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 130123b3eb3cSopenharmony_ci }; 130223b3eb3cSopenharmony_ci this.dividerColorWithTheme = this.theme?.colors?.compDivider ? 130323b3eb3cSopenharmony_ci this.theme.colors.compDivider : { 130423b3eb3cSopenharmony_ci 'id': -1, 130523b3eb3cSopenharmony_ci 'type': 10001, 130623b3eb3cSopenharmony_ci params: ['sys.color.comp_divider'], 130723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 130823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 130923b3eb3cSopenharmony_ci }; 131023b3eb3cSopenharmony_ci this.initContentPadding(); 131123b3eb3cSopenharmony_ci this.initButtons(); 131223b3eb3cSopenharmony_ci } 131323b3eb3cSopenharmony_ci 131423b3eb3cSopenharmony_ci initContentPadding() { 131523b3eb3cSopenharmony_ci this.contentPadding = { 131623b3eb3cSopenharmony_ci left: { 131723b3eb3cSopenharmony_ci 'id': -1, 131823b3eb3cSopenharmony_ci 'type': 10002, 131923b3eb3cSopenharmony_ci params: ['sys.float.padding_level0'], 132023b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 132123b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 132223b3eb3cSopenharmony_ci }, 132323b3eb3cSopenharmony_ci right: { 132423b3eb3cSopenharmony_ci 'id': -1, 132523b3eb3cSopenharmony_ci 'type': 10002, 132623b3eb3cSopenharmony_ci params: ['sys.float.padding_level0'], 132723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 132823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 132923b3eb3cSopenharmony_ci } 133023b3eb3cSopenharmony_ci }; 133123b3eb3cSopenharmony_ci if (!this.title && !this.confirm) { 133223b3eb3cSopenharmony_ci this.contentPadding = { 133323b3eb3cSopenharmony_ci top: { 133423b3eb3cSopenharmony_ci 'id': -1, 133523b3eb3cSopenharmony_ci 'type': 10002, 133623b3eb3cSopenharmony_ci params: ['sys.float.padding_level12'], 133723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 133823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 133923b3eb3cSopenharmony_ci }, 134023b3eb3cSopenharmony_ci bottom: { 134123b3eb3cSopenharmony_ci 'id': -1, 134223b3eb3cSopenharmony_ci 'type': 10002, 134323b3eb3cSopenharmony_ci params: ['sys.float.padding_level12'], 134423b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 134523b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 134623b3eb3cSopenharmony_ci } 134723b3eb3cSopenharmony_ci }; 134823b3eb3cSopenharmony_ci return; 134923b3eb3cSopenharmony_ci } 135023b3eb3cSopenharmony_ci if (!this.title) { 135123b3eb3cSopenharmony_ci this.contentPadding = { 135223b3eb3cSopenharmony_ci top: { 135323b3eb3cSopenharmony_ci 'id': -1, 135423b3eb3cSopenharmony_ci 'type': 10002, 135523b3eb3cSopenharmony_ci params: ['sys.float.padding_level12'], 135623b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 135723b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 135823b3eb3cSopenharmony_ci } 135923b3eb3cSopenharmony_ci }; 136023b3eb3cSopenharmony_ci } else if (!this.confirm) { 136123b3eb3cSopenharmony_ci this.contentPadding = { 136223b3eb3cSopenharmony_ci bottom: { 136323b3eb3cSopenharmony_ci 'id': -1, 136423b3eb3cSopenharmony_ci 'type': 10002, 136523b3eb3cSopenharmony_ci params: ['sys.float.padding_level12'], 136623b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 136723b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 136823b3eb3cSopenharmony_ci } 136923b3eb3cSopenharmony_ci }; 137023b3eb3cSopenharmony_ci } 137123b3eb3cSopenharmony_ci } 137223b3eb3cSopenharmony_ci 137323b3eb3cSopenharmony_ci initButtons() { 137423b3eb3cSopenharmony_ci this.buttons = []; 137523b3eb3cSopenharmony_ci if (this.confirm) { 137623b3eb3cSopenharmony_ci this.buttons.push(this.confirm); 137723b3eb3cSopenharmony_ci } 137823b3eb3cSopenharmony_ci } 137923b3eb3cSopenharmony_ci 138023b3eb3cSopenharmony_ci rerender() { 138123b3eb3cSopenharmony_ci this.updateDirtyElements(); 138223b3eb3cSopenharmony_ci } 138323b3eb3cSopenharmony_ci} 138423b3eb3cSopenharmony_ci 138523b3eb3cSopenharmony_ciclass ConfirmDialogContentLayout extends ViewPU { 138623b3eb3cSopenharmony_ci constructor(w26, x26, y26, z26 = -1, a27 = undefined, b27) { 138723b3eb3cSopenharmony_ci super(w26, y26, z26, b27); 138823b3eb3cSopenharmony_ci if (typeof a27 === 'function') { 138923b3eb3cSopenharmony_ci this.paramsGenerator_ = a27; 139023b3eb3cSopenharmony_ci } 139123b3eb3cSopenharmony_ci this.textIndex = 0; 139223b3eb3cSopenharmony_ci this.checkboxIndex = 1; 139323b3eb3cSopenharmony_ci this.__minContentHeight = new SynchedPropertySimpleTwoWayPU(x26.minContentHeight, this, 'minContentHeight'); 139423b3eb3cSopenharmony_ci this.updateTextAlign = (c27) => { 139523b3eb3cSopenharmony_ci }; 139623b3eb3cSopenharmony_ci this.dialogBuilder = this.doNothingBuilder; 139723b3eb3cSopenharmony_ci this.setInitiallyProvidedValue(x26); 139823b3eb3cSopenharmony_ci this.finalizeConstruction(); 139923b3eb3cSopenharmony_ci } 140023b3eb3cSopenharmony_ci 140123b3eb3cSopenharmony_ci setInitiallyProvidedValue(v26) { 140223b3eb3cSopenharmony_ci if (v26.textIndex !== undefined) { 140323b3eb3cSopenharmony_ci this.textIndex = v26.textIndex; 140423b3eb3cSopenharmony_ci } 140523b3eb3cSopenharmony_ci if (v26.checkboxIndex !== undefined) { 140623b3eb3cSopenharmony_ci this.checkboxIndex = v26.checkboxIndex; 140723b3eb3cSopenharmony_ci } 140823b3eb3cSopenharmony_ci if (v26.updateTextAlign !== undefined) { 140923b3eb3cSopenharmony_ci this.updateTextAlign = v26.updateTextAlign; 141023b3eb3cSopenharmony_ci } 141123b3eb3cSopenharmony_ci if (v26.dialogBuilder !== undefined) { 141223b3eb3cSopenharmony_ci this.dialogBuilder = v26.dialogBuilder; 141323b3eb3cSopenharmony_ci } 141423b3eb3cSopenharmony_ci } 141523b3eb3cSopenharmony_ci 141623b3eb3cSopenharmony_ci updateStateVars(u26) { 141723b3eb3cSopenharmony_ci } 141823b3eb3cSopenharmony_ci 141923b3eb3cSopenharmony_ci purgeVariableDependenciesOnElmtId(t26) { 142023b3eb3cSopenharmony_ci this.__minContentHeight.purgeDependencyOnElmtId(t26); 142123b3eb3cSopenharmony_ci } 142223b3eb3cSopenharmony_ci 142323b3eb3cSopenharmony_ci aboutToBeDeleted() { 142423b3eb3cSopenharmony_ci this.__minContentHeight.aboutToBeDeleted(); 142523b3eb3cSopenharmony_ci SubscriberManager.Get().delete(this.id__()); 142623b3eb3cSopenharmony_ci this.aboutToBeDeletedInternal(); 142723b3eb3cSopenharmony_ci } 142823b3eb3cSopenharmony_ci 142923b3eb3cSopenharmony_ci get minContentHeight() { 143023b3eb3cSopenharmony_ci return this.__minContentHeight.get(); 143123b3eb3cSopenharmony_ci } 143223b3eb3cSopenharmony_ci 143323b3eb3cSopenharmony_ci set minContentHeight(s26) { 143423b3eb3cSopenharmony_ci this.__minContentHeight.set(s26); 143523b3eb3cSopenharmony_ci } 143623b3eb3cSopenharmony_ci 143723b3eb3cSopenharmony_ci doNothingBuilder(r26 = null) { 143823b3eb3cSopenharmony_ci } 143923b3eb3cSopenharmony_ci 144023b3eb3cSopenharmony_ci onPlaceChildren(k26, l26, m26) { 144123b3eb3cSopenharmony_ci let n26 = 0; 144223b3eb3cSopenharmony_ci let o26 = 0; 144323b3eb3cSopenharmony_ci for (let p26 = 0; p26 < l26.length; p26++) { 144423b3eb3cSopenharmony_ci let q26 = l26[p26]; 144523b3eb3cSopenharmony_ci q26.layout({ x: n26, y: o26 }); 144623b3eb3cSopenharmony_ci o26 += q26.measureResult.height; 144723b3eb3cSopenharmony_ci } 144823b3eb3cSopenharmony_ci } 144923b3eb3cSopenharmony_ci 145023b3eb3cSopenharmony_ci onMeasureSize(y25, z25, a26) { 145123b3eb3cSopenharmony_ci let b26 = { width: Number(a26.maxWidth), height: 0 }; 145223b3eb3cSopenharmony_ci let c26 = 2; 145323b3eb3cSopenharmony_ci if (z25.length < c26) { 145423b3eb3cSopenharmony_ci return b26; 145523b3eb3cSopenharmony_ci } 145623b3eb3cSopenharmony_ci this.updateTextAlign(b26.width); 145723b3eb3cSopenharmony_ci let d26 = 0; 145823b3eb3cSopenharmony_ci let e26 = z25[this.checkboxIndex]; 145923b3eb3cSopenharmony_ci let f26 = { 146023b3eb3cSopenharmony_ci maxWidth: a26.maxWidth, 146123b3eb3cSopenharmony_ci minHeight: CHECKBOX_CONTAINER_HEIGHT, 146223b3eb3cSopenharmony_ci maxHeight: a26.maxHeight 146323b3eb3cSopenharmony_ci }; 146423b3eb3cSopenharmony_ci let g26 = e26.measure(f26); 146523b3eb3cSopenharmony_ci d26 += g26.height; 146623b3eb3cSopenharmony_ci let h26 = z25[this.textIndex]; 146723b3eb3cSopenharmony_ci let i26 = { 146823b3eb3cSopenharmony_ci maxWidth: a26.maxWidth, 146923b3eb3cSopenharmony_ci maxHeight: Number(a26.maxHeight) - d26 147023b3eb3cSopenharmony_ci }; 147123b3eb3cSopenharmony_ci let j26 = h26.measure(i26); 147223b3eb3cSopenharmony_ci d26 += j26.height; 147323b3eb3cSopenharmony_ci b26.height = d26; 147423b3eb3cSopenharmony_ci this.minContentHeight = Math.max(g26.height + TEXT_MIN_HEIGHT, MIN_CONTENT_HEIGHT); 147523b3eb3cSopenharmony_ci return b26; 147623b3eb3cSopenharmony_ci } 147723b3eb3cSopenharmony_ci 147823b3eb3cSopenharmony_ci initialRender() { 147923b3eb3cSopenharmony_ci this.dialogBuilder.bind(this)(); 148023b3eb3cSopenharmony_ci } 148123b3eb3cSopenharmony_ci 148223b3eb3cSopenharmony_ci rerender() { 148323b3eb3cSopenharmony_ci this.updateDirtyElements(); 148423b3eb3cSopenharmony_ci } 148523b3eb3cSopenharmony_ci} 148623b3eb3cSopenharmony_ci 148723b3eb3cSopenharmony_ciexport class ConfirmDialog extends ViewPU { 148823b3eb3cSopenharmony_ci constructor(r25, s25, t25, u25 = -1, v25 = undefined, w25) { 148923b3eb3cSopenharmony_ci super(r25, t25, u25, w25); 149023b3eb3cSopenharmony_ci if (typeof v25 === 'function') { 149123b3eb3cSopenharmony_ci this.paramsGenerator_ = v25; 149223b3eb3cSopenharmony_ci } 149323b3eb3cSopenharmony_ci this.controller = undefined; 149423b3eb3cSopenharmony_ci this.title = ''; 149523b3eb3cSopenharmony_ci this.content = ''; 149623b3eb3cSopenharmony_ci this.checkTips = ''; 149723b3eb3cSopenharmony_ci this.__isChecked = new ObservedPropertySimplePU(false, this, 'isChecked'); 149823b3eb3cSopenharmony_ci this.primaryButton = { value: "" }; 149923b3eb3cSopenharmony_ci this.secondaryButton = { value: "" }; 150023b3eb3cSopenharmony_ci this.__fontColorWithTheme = new ObservedPropertyObjectPU({ 150123b3eb3cSopenharmony_ci 'id': -1, 150223b3eb3cSopenharmony_ci 'type': 10001, 150323b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 150423b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 150523b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 150623b3eb3cSopenharmony_ci }, this, 'fontColorWithTheme'); 150723b3eb3cSopenharmony_ci this.theme = new CustomThemeImpl({}); 150823b3eb3cSopenharmony_ci this.themeColorMode = ThemeColorMode.SYSTEM; 150923b3eb3cSopenharmony_ci this.onCheckedChange = undefined; 151023b3eb3cSopenharmony_ci this.contentScroller = new Scroller(); 151123b3eb3cSopenharmony_ci this.buttons = undefined; 151223b3eb3cSopenharmony_ci this.__textAlign = new ObservedPropertySimplePU(TextAlign.Start, this, 'textAlign'); 151323b3eb3cSopenharmony_ci this.marginOffset = 0; 151423b3eb3cSopenharmony_ci this.__fontSizeScale = new ObservedPropertySimplePU(1, this, 'fontSizeScale'); 151523b3eb3cSopenharmony_ci this.__minContentHeight = new ObservedPropertySimplePU(MIN_CONTENT_HEIGHT, this, 'minContentHeight'); 151623b3eb3cSopenharmony_ci this.textIndex = 0; 151723b3eb3cSopenharmony_ci this.checkboxIndex = 1; 151823b3eb3cSopenharmony_ci this.updateTextAlign = (x25) => { 151923b3eb3cSopenharmony_ci if (this.content) { 152023b3eb3cSopenharmony_ci this.textAlign = getTextAlign(x25, this.content, `${BODY_L * this.fontSizeScale}vp`); 152123b3eb3cSopenharmony_ci } 152223b3eb3cSopenharmony_ci }; 152323b3eb3cSopenharmony_ci this.setInitiallyProvidedValue(s25); 152423b3eb3cSopenharmony_ci this.finalizeConstruction(); 152523b3eb3cSopenharmony_ci } 152623b3eb3cSopenharmony_ci 152723b3eb3cSopenharmony_ci setInitiallyProvidedValue(q25) { 152823b3eb3cSopenharmony_ci if (q25.controller !== undefined) { 152923b3eb3cSopenharmony_ci this.controller = q25.controller; 153023b3eb3cSopenharmony_ci } 153123b3eb3cSopenharmony_ci if (q25.title !== undefined) { 153223b3eb3cSopenharmony_ci this.title = q25.title; 153323b3eb3cSopenharmony_ci } 153423b3eb3cSopenharmony_ci if (q25.content !== undefined) { 153523b3eb3cSopenharmony_ci this.content = q25.content; 153623b3eb3cSopenharmony_ci } 153723b3eb3cSopenharmony_ci if (q25.checkTips !== undefined) { 153823b3eb3cSopenharmony_ci this.checkTips = q25.checkTips; 153923b3eb3cSopenharmony_ci } 154023b3eb3cSopenharmony_ci if (q25.isChecked !== undefined) { 154123b3eb3cSopenharmony_ci this.isChecked = q25.isChecked; 154223b3eb3cSopenharmony_ci } 154323b3eb3cSopenharmony_ci if (q25.primaryButton !== undefined) { 154423b3eb3cSopenharmony_ci this.primaryButton = q25.primaryButton; 154523b3eb3cSopenharmony_ci } 154623b3eb3cSopenharmony_ci if (q25.secondaryButton !== undefined) { 154723b3eb3cSopenharmony_ci this.secondaryButton = q25.secondaryButton; 154823b3eb3cSopenharmony_ci } 154923b3eb3cSopenharmony_ci if (q25.fontColorWithTheme !== undefined) { 155023b3eb3cSopenharmony_ci this.fontColorWithTheme = q25.fontColorWithTheme; 155123b3eb3cSopenharmony_ci } 155223b3eb3cSopenharmony_ci if (q25.theme !== undefined) { 155323b3eb3cSopenharmony_ci this.theme = q25.theme; 155423b3eb3cSopenharmony_ci } 155523b3eb3cSopenharmony_ci if (q25.themeColorMode !== undefined) { 155623b3eb3cSopenharmony_ci this.themeColorMode = q25.themeColorMode; 155723b3eb3cSopenharmony_ci } 155823b3eb3cSopenharmony_ci if (q25.onCheckedChange !== undefined) { 155923b3eb3cSopenharmony_ci this.onCheckedChange = q25.onCheckedChange; 156023b3eb3cSopenharmony_ci } 156123b3eb3cSopenharmony_ci if (q25.contentScroller !== undefined) { 156223b3eb3cSopenharmony_ci this.contentScroller = q25.contentScroller; 156323b3eb3cSopenharmony_ci } 156423b3eb3cSopenharmony_ci if (q25.buttons !== undefined) { 156523b3eb3cSopenharmony_ci this.buttons = q25.buttons; 156623b3eb3cSopenharmony_ci } 156723b3eb3cSopenharmony_ci if (q25.textAlign !== undefined) { 156823b3eb3cSopenharmony_ci this.textAlign = q25.textAlign; 156923b3eb3cSopenharmony_ci } 157023b3eb3cSopenharmony_ci if (q25.marginOffset !== undefined) { 157123b3eb3cSopenharmony_ci this.marginOffset = q25.marginOffset; 157223b3eb3cSopenharmony_ci } 157323b3eb3cSopenharmony_ci if (q25.fontSizeScale !== undefined) { 157423b3eb3cSopenharmony_ci this.fontSizeScale = q25.fontSizeScale; 157523b3eb3cSopenharmony_ci } 157623b3eb3cSopenharmony_ci if (q25.minContentHeight !== undefined) { 157723b3eb3cSopenharmony_ci this.minContentHeight = q25.minContentHeight; 157823b3eb3cSopenharmony_ci } 157923b3eb3cSopenharmony_ci if (q25.textIndex !== undefined) { 158023b3eb3cSopenharmony_ci this.textIndex = q25.textIndex; 158123b3eb3cSopenharmony_ci } 158223b3eb3cSopenharmony_ci if (q25.checkboxIndex !== undefined) { 158323b3eb3cSopenharmony_ci this.checkboxIndex = q25.checkboxIndex; 158423b3eb3cSopenharmony_ci } 158523b3eb3cSopenharmony_ci if (q25.updateTextAlign !== undefined) { 158623b3eb3cSopenharmony_ci this.updateTextAlign = q25.updateTextAlign; 158723b3eb3cSopenharmony_ci } 158823b3eb3cSopenharmony_ci } 158923b3eb3cSopenharmony_ci 159023b3eb3cSopenharmony_ci updateStateVars(p25) { 159123b3eb3cSopenharmony_ci } 159223b3eb3cSopenharmony_ci 159323b3eb3cSopenharmony_ci purgeVariableDependenciesOnElmtId(o25) { 159423b3eb3cSopenharmony_ci this.__isChecked.purgeDependencyOnElmtId(o25); 159523b3eb3cSopenharmony_ci this.__fontColorWithTheme.purgeDependencyOnElmtId(o25); 159623b3eb3cSopenharmony_ci this.__textAlign.purgeDependencyOnElmtId(o25); 159723b3eb3cSopenharmony_ci this.__fontSizeScale.purgeDependencyOnElmtId(o25); 159823b3eb3cSopenharmony_ci this.__minContentHeight.purgeDependencyOnElmtId(o25); 159923b3eb3cSopenharmony_ci } 160023b3eb3cSopenharmony_ci 160123b3eb3cSopenharmony_ci aboutToBeDeleted() { 160223b3eb3cSopenharmony_ci this.__isChecked.aboutToBeDeleted(); 160323b3eb3cSopenharmony_ci this.__fontColorWithTheme.aboutToBeDeleted(); 160423b3eb3cSopenharmony_ci this.__textAlign.aboutToBeDeleted(); 160523b3eb3cSopenharmony_ci this.__fontSizeScale.aboutToBeDeleted(); 160623b3eb3cSopenharmony_ci this.__minContentHeight.aboutToBeDeleted(); 160723b3eb3cSopenharmony_ci SubscriberManager.Get().delete(this.id__()); 160823b3eb3cSopenharmony_ci this.aboutToBeDeletedInternal(); 160923b3eb3cSopenharmony_ci } 161023b3eb3cSopenharmony_ci 161123b3eb3cSopenharmony_ci setController(n25) { 161223b3eb3cSopenharmony_ci this.controller = n25; 161323b3eb3cSopenharmony_ci } 161423b3eb3cSopenharmony_ci 161523b3eb3cSopenharmony_ci get isChecked() { 161623b3eb3cSopenharmony_ci return this.__isChecked.get(); 161723b3eb3cSopenharmony_ci } 161823b3eb3cSopenharmony_ci 161923b3eb3cSopenharmony_ci set isChecked(m25) { 162023b3eb3cSopenharmony_ci this.__isChecked.set(m25); 162123b3eb3cSopenharmony_ci } 162223b3eb3cSopenharmony_ci 162323b3eb3cSopenharmony_ci get fontColorWithTheme() { 162423b3eb3cSopenharmony_ci return this.__fontColorWithTheme.get(); 162523b3eb3cSopenharmony_ci } 162623b3eb3cSopenharmony_ci 162723b3eb3cSopenharmony_ci set fontColorWithTheme(l25) { 162823b3eb3cSopenharmony_ci this.__fontColorWithTheme.set(l25); 162923b3eb3cSopenharmony_ci } 163023b3eb3cSopenharmony_ci 163123b3eb3cSopenharmony_ci get textAlign() { 163223b3eb3cSopenharmony_ci return this.__textAlign.get(); 163323b3eb3cSopenharmony_ci } 163423b3eb3cSopenharmony_ci 163523b3eb3cSopenharmony_ci set textAlign(k25) { 163623b3eb3cSopenharmony_ci this.__textAlign.set(k25); 163723b3eb3cSopenharmony_ci } 163823b3eb3cSopenharmony_ci 163923b3eb3cSopenharmony_ci get fontSizeScale() { 164023b3eb3cSopenharmony_ci return this.__fontSizeScale.get(); 164123b3eb3cSopenharmony_ci } 164223b3eb3cSopenharmony_ci 164323b3eb3cSopenharmony_ci set fontSizeScale(j25) { 164423b3eb3cSopenharmony_ci this.__fontSizeScale.set(j25); 164523b3eb3cSopenharmony_ci } 164623b3eb3cSopenharmony_ci 164723b3eb3cSopenharmony_ci get minContentHeight() { 164823b3eb3cSopenharmony_ci return this.__minContentHeight.get(); 164923b3eb3cSopenharmony_ci } 165023b3eb3cSopenharmony_ci 165123b3eb3cSopenharmony_ci set minContentHeight(i25) { 165223b3eb3cSopenharmony_ci this.__minContentHeight.set(i25); 165323b3eb3cSopenharmony_ci } 165423b3eb3cSopenharmony_ci 165523b3eb3cSopenharmony_ci textBuilder(y24 = null) { 165623b3eb3cSopenharmony_ci this.observeComponentCreation2((g25, h25) => { 165723b3eb3cSopenharmony_ci Column.create(); 165823b3eb3cSopenharmony_ci }, Column); 165923b3eb3cSopenharmony_ci this.observeComponentCreation2((e25, f25) => { 166023b3eb3cSopenharmony_ci Scroll.create(this.contentScroller); 166123b3eb3cSopenharmony_ci Scroll.nestedScroll({ 166223b3eb3cSopenharmony_ci scrollForward: NestedScrollMode.PARALLEL, 166323b3eb3cSopenharmony_ci scrollBackward: NestedScrollMode.PARALLEL 166423b3eb3cSopenharmony_ci }); 166523b3eb3cSopenharmony_ci Scroll.margin({ end: LengthMetrics.vp(this.marginOffset) }); 166623b3eb3cSopenharmony_ci }, Scroll); 166723b3eb3cSopenharmony_ci this.observeComponentCreation2((c25, d25) => { 166823b3eb3cSopenharmony_ci Column.create(); 166923b3eb3cSopenharmony_ci Column.margin({ end: LengthMetrics.resource({ 167023b3eb3cSopenharmony_ci 'id': -1, 167123b3eb3cSopenharmony_ci 'type': 10002, 167223b3eb3cSopenharmony_ci params: ['sys.float.padding_level8'], 167323b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 167423b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 167523b3eb3cSopenharmony_ci }) 167623b3eb3cSopenharmony_ci }); 167723b3eb3cSopenharmony_ci }, Column); 167823b3eb3cSopenharmony_ci this.observeComponentCreation2((z24, a25) => { 167923b3eb3cSopenharmony_ci Text.create(this.content); 168023b3eb3cSopenharmony_ci Text.focusable(true); 168123b3eb3cSopenharmony_ci Text.defaultFocus(!(this.primaryButton?.value || this.secondaryButton?.value)); 168223b3eb3cSopenharmony_ci Text.focusBox({ 168323b3eb3cSopenharmony_ci strokeWidth: LengthMetrics.px(0) 168423b3eb3cSopenharmony_ci }); 168523b3eb3cSopenharmony_ci Text.fontSize(`${BODY_L}fp`); 168623b3eb3cSopenharmony_ci Text.fontWeight(FontWeight.Medium); 168723b3eb3cSopenharmony_ci Text.fontColor(ObservedObject.GetRawObject(this.fontColorWithTheme)); 168823b3eb3cSopenharmony_ci Text.textAlign(this.textAlign); 168923b3eb3cSopenharmony_ci Text.onKeyEvent((b25) => { 169023b3eb3cSopenharmony_ci if (b25) { 169123b3eb3cSopenharmony_ci resolveKeyEvent(b25, this.contentScroller); 169223b3eb3cSopenharmony_ci } 169323b3eb3cSopenharmony_ci }); 169423b3eb3cSopenharmony_ci Text.width('100%'); 169523b3eb3cSopenharmony_ci }, Text); 169623b3eb3cSopenharmony_ci Text.pop(); 169723b3eb3cSopenharmony_ci Column.pop(); 169823b3eb3cSopenharmony_ci Scroll.pop(); 169923b3eb3cSopenharmony_ci Column.pop(); 170023b3eb3cSopenharmony_ci } 170123b3eb3cSopenharmony_ci 170223b3eb3cSopenharmony_ci checkBoxBuilder(q24 = null) { 170323b3eb3cSopenharmony_ci this.observeComponentCreation2((w24, x24) => { 170423b3eb3cSopenharmony_ci Row.create(); 170523b3eb3cSopenharmony_ci Row.accessibilityGroup(true); 170623b3eb3cSopenharmony_ci Row.onClick(() => { 170723b3eb3cSopenharmony_ci this.isChecked = !this.isChecked; 170823b3eb3cSopenharmony_ci }); 170923b3eb3cSopenharmony_ci Row.width('100%'); 171023b3eb3cSopenharmony_ci Row.padding({ top: 8, bottom: 8 }); 171123b3eb3cSopenharmony_ci }, Row); 171223b3eb3cSopenharmony_ci this.observeComponentCreation2((t24, u24) => { 171323b3eb3cSopenharmony_ci Checkbox.create({ name: '', group: 'checkboxGroup' }); 171423b3eb3cSopenharmony_ci Checkbox.select(this.isChecked); 171523b3eb3cSopenharmony_ci Checkbox.onChange((v24) => { 171623b3eb3cSopenharmony_ci this.isChecked = v24; 171723b3eb3cSopenharmony_ci if (this.onCheckedChange) { 171823b3eb3cSopenharmony_ci this.onCheckedChange(this.isChecked); 171923b3eb3cSopenharmony_ci } 172023b3eb3cSopenharmony_ci }); 172123b3eb3cSopenharmony_ci Checkbox.hitTestBehavior(HitTestMode.Block); 172223b3eb3cSopenharmony_ci Checkbox.accessibilityLevel('yes'); 172323b3eb3cSopenharmony_ci Checkbox.margin({ start: LengthMetrics.vp(0), end: LengthMetrics.vp(CHECK_BOX_MARGIN_END) }); 172423b3eb3cSopenharmony_ci }, Checkbox); 172523b3eb3cSopenharmony_ci Checkbox.pop(); 172623b3eb3cSopenharmony_ci this.observeComponentCreation2((r24, s24) => { 172723b3eb3cSopenharmony_ci Text.create(this.checkTips); 172823b3eb3cSopenharmony_ci Text.fontSize(`${BODY_M}fp`); 172923b3eb3cSopenharmony_ci Text.fontWeight(FontWeight.Medium); 173023b3eb3cSopenharmony_ci Text.fontColor(ObservedObject.GetRawObject(this.fontColorWithTheme)); 173123b3eb3cSopenharmony_ci Text.maxLines(CONTENT_MAX_LINES); 173223b3eb3cSopenharmony_ci Text.focusable(false); 173323b3eb3cSopenharmony_ci Text.layoutWeight(1); 173423b3eb3cSopenharmony_ci Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 173523b3eb3cSopenharmony_ci }, Text); 173623b3eb3cSopenharmony_ci Text.pop(); 173723b3eb3cSopenharmony_ci Row.pop(); 173823b3eb3cSopenharmony_ci } 173923b3eb3cSopenharmony_ci 174023b3eb3cSopenharmony_ci buildContent(p23 = null) { 174123b3eb3cSopenharmony_ci { 174223b3eb3cSopenharmony_ci this.observeComponentCreation2((q23, r23) => { 174323b3eb3cSopenharmony_ci if (r23) { 174423b3eb3cSopenharmony_ci let s23 = new ConfirmDialogContentLayout(this, { 174523b3eb3cSopenharmony_ci minContentHeight: this.__minContentHeight, updateTextAlign: this.updateTextAlign, 174623b3eb3cSopenharmony_ci dialogBuilder: () => { 174723b3eb3cSopenharmony_ci this.observeComponentCreation2((f24, g24) => { 174823b3eb3cSopenharmony_ci ForEach.create(); 174923b3eb3cSopenharmony_ci const k = i24 => { 175023b3eb3cSopenharmony_ci const j24 = i24; 175123b3eb3cSopenharmony_ci this.observeComponentCreation2((k24, l24) => { 175223b3eb3cSopenharmony_ci If.create(); 175323b3eb3cSopenharmony_ci if (j24 === this.textIndex) { 175423b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 175523b3eb3cSopenharmony_ci this.observeComponentCreation2((o24, p24) => { 175623b3eb3cSopenharmony_ci WithTheme.create({ 175723b3eb3cSopenharmony_ci theme: this.theme, 175823b3eb3cSopenharmony_ci colorMode: this.themeColorMode 175923b3eb3cSopenharmony_ci }); 176023b3eb3cSopenharmony_ci }, WithTheme); 176123b3eb3cSopenharmony_ci this.textBuilder.bind(this)(); 176223b3eb3cSopenharmony_ci WithTheme.pop(); 176323b3eb3cSopenharmony_ci }); 176423b3eb3cSopenharmony_ci } else if (j24 === this.checkboxIndex) { 176523b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 176623b3eb3cSopenharmony_ci this.observeComponentCreation2((m24, n24) => { 176723b3eb3cSopenharmony_ci WithTheme.create({ 176823b3eb3cSopenharmony_ci theme: this.theme, 176923b3eb3cSopenharmony_ci colorMode: this.themeColorMode 177023b3eb3cSopenharmony_ci }); 177123b3eb3cSopenharmony_ci }, WithTheme); 177223b3eb3cSopenharmony_ci this.checkBoxBuilder.bind(this)(); 177323b3eb3cSopenharmony_ci WithTheme.pop(); 177423b3eb3cSopenharmony_ci }); 177523b3eb3cSopenharmony_ci } else { 177623b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(2, () => { 177723b3eb3cSopenharmony_ci }); 177823b3eb3cSopenharmony_ci } 177923b3eb3cSopenharmony_ci }, If); 178023b3eb3cSopenharmony_ci If.pop(); 178123b3eb3cSopenharmony_ci }; 178223b3eb3cSopenharmony_ci this.forEachUpdateFunction(f24, [this.textIndex, this.checkboxIndex], k); 178323b3eb3cSopenharmony_ci }, ForEach); 178423b3eb3cSopenharmony_ci ForEach.pop(); 178523b3eb3cSopenharmony_ci } 178623b3eb3cSopenharmony_ci }, undefined, q23, () => { 178723b3eb3cSopenharmony_ci }, { page: 'library/src/main/ets/components/MainPage.ets', line: 733, col: 5 }); 178823b3eb3cSopenharmony_ci ViewPU.create(s23); 178923b3eb3cSopenharmony_ci let i = () => { 179023b3eb3cSopenharmony_ci return { 179123b3eb3cSopenharmony_ci minContentHeight: this.minContentHeight, 179223b3eb3cSopenharmony_ci updateTextAlign: this.updateTextAlign, 179323b3eb3cSopenharmony_ci dialogBuilder: () => { 179423b3eb3cSopenharmony_ci this.observeComponentCreation2((u23, v23) => { 179523b3eb3cSopenharmony_ci ForEach.create(); 179623b3eb3cSopenharmony_ci const j = x23 => { 179723b3eb3cSopenharmony_ci const y23 = x23; 179823b3eb3cSopenharmony_ci this.observeComponentCreation2((z23, a24) => { 179923b3eb3cSopenharmony_ci If.create(); 180023b3eb3cSopenharmony_ci if (y23 === this.textIndex) { 180123b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 180223b3eb3cSopenharmony_ci this.observeComponentCreation2((d24, e24) => { 180323b3eb3cSopenharmony_ci WithTheme.create({ 180423b3eb3cSopenharmony_ci theme: this.theme, 180523b3eb3cSopenharmony_ci colorMode: this.themeColorMode 180623b3eb3cSopenharmony_ci }); 180723b3eb3cSopenharmony_ci }, WithTheme); 180823b3eb3cSopenharmony_ci this.textBuilder.bind(this)(); 180923b3eb3cSopenharmony_ci WithTheme.pop(); 181023b3eb3cSopenharmony_ci }); 181123b3eb3cSopenharmony_ci } else if (y23 === this.checkboxIndex) { 181223b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 181323b3eb3cSopenharmony_ci this.observeComponentCreation2((b24, c24) => { 181423b3eb3cSopenharmony_ci WithTheme.create({ 181523b3eb3cSopenharmony_ci theme: this.theme, 181623b3eb3cSopenharmony_ci colorMode: this.themeColorMode 181723b3eb3cSopenharmony_ci }); 181823b3eb3cSopenharmony_ci }, WithTheme); 181923b3eb3cSopenharmony_ci this.checkBoxBuilder.bind(this)(); 182023b3eb3cSopenharmony_ci WithTheme.pop(); 182123b3eb3cSopenharmony_ci }); 182223b3eb3cSopenharmony_ci } else { 182323b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(2, () => { 182423b3eb3cSopenharmony_ci }); 182523b3eb3cSopenharmony_ci } 182623b3eb3cSopenharmony_ci }, If); 182723b3eb3cSopenharmony_ci If.pop(); 182823b3eb3cSopenharmony_ci }; 182923b3eb3cSopenharmony_ci this.forEachUpdateFunction(u23, [this.textIndex, this.checkboxIndex], j); 183023b3eb3cSopenharmony_ci }, ForEach); 183123b3eb3cSopenharmony_ci ForEach.pop(); 183223b3eb3cSopenharmony_ci } 183323b3eb3cSopenharmony_ci }; 183423b3eb3cSopenharmony_ci }; 183523b3eb3cSopenharmony_ci s23.paramsGenerator_ = i; 183623b3eb3cSopenharmony_ci } else { 183723b3eb3cSopenharmony_ci this.updateStateVarsOfChildByElmtId(q23, {}); 183823b3eb3cSopenharmony_ci } 183923b3eb3cSopenharmony_ci }, { name: 'ConfirmDialogContentLayout' }); 184023b3eb3cSopenharmony_ci } 184123b3eb3cSopenharmony_ci } 184223b3eb3cSopenharmony_ci 184323b3eb3cSopenharmony_ci initialRender() { 184423b3eb3cSopenharmony_ci this.observeComponentCreation2((n23, o23) => { 184523b3eb3cSopenharmony_ci __Common__.create(); 184623b3eb3cSopenharmony_ci __Common__.constraintSize({ maxHeight: '100%' }); 184723b3eb3cSopenharmony_ci }, __Common__); 184823b3eb3cSopenharmony_ci { 184923b3eb3cSopenharmony_ci this.observeComponentCreation2((j23, k23) => { 185023b3eb3cSopenharmony_ci if (k23) { 185123b3eb3cSopenharmony_ci let l23 = new CustomDialogContentComponent(this, { 185223b3eb3cSopenharmony_ci primaryTitle: this.title, 185323b3eb3cSopenharmony_ci controller: this.controller, 185423b3eb3cSopenharmony_ci contentBuilder: () => { 185523b3eb3cSopenharmony_ci this.buildContent(); 185623b3eb3cSopenharmony_ci }, 185723b3eb3cSopenharmony_ci minContentHeight: this.__minContentHeight, 185823b3eb3cSopenharmony_ci buttons: this.buttons, 185923b3eb3cSopenharmony_ci theme: this.theme, 186023b3eb3cSopenharmony_ci themeColorMode: this.themeColorMode, 186123b3eb3cSopenharmony_ci fontSizeScale: this.__fontSizeScale, 186223b3eb3cSopenharmony_ci }, undefined, j23, () => { 186323b3eb3cSopenharmony_ci }, { page: 'library/src/main/ets/components/MainPage.ets', line: 749, col: 5 }); 186423b3eb3cSopenharmony_ci ViewPU.create(l23); 186523b3eb3cSopenharmony_ci let h = () => { 186623b3eb3cSopenharmony_ci return { 186723b3eb3cSopenharmony_ci primaryTitle: this.title, 186823b3eb3cSopenharmony_ci controller: this.controller, 186923b3eb3cSopenharmony_ci contentBuilder: () => { 187023b3eb3cSopenharmony_ci this.buildContent(); 187123b3eb3cSopenharmony_ci }, 187223b3eb3cSopenharmony_ci minContentHeight: this.minContentHeight, 187323b3eb3cSopenharmony_ci buttons: this.buttons, 187423b3eb3cSopenharmony_ci theme: this.theme, 187523b3eb3cSopenharmony_ci themeColorMode: this.themeColorMode, 187623b3eb3cSopenharmony_ci fontSizeScale: this.fontSizeScale 187723b3eb3cSopenharmony_ci }; 187823b3eb3cSopenharmony_ci }; 187923b3eb3cSopenharmony_ci l23.paramsGenerator_ = h; 188023b3eb3cSopenharmony_ci } else { 188123b3eb3cSopenharmony_ci this.updateStateVarsOfChildByElmtId(j23, {}); 188223b3eb3cSopenharmony_ci } 188323b3eb3cSopenharmony_ci }, { name: 'CustomDialogContentComponent' }); 188423b3eb3cSopenharmony_ci } 188523b3eb3cSopenharmony_ci __Common__.pop(); 188623b3eb3cSopenharmony_ci } 188723b3eb3cSopenharmony_ci 188823b3eb3cSopenharmony_ci aboutToAppear() { 188923b3eb3cSopenharmony_ci this.fontColorWithTheme = this.theme?.colors?.fontPrimary ? 189023b3eb3cSopenharmony_ci this.theme.colors.fontPrimary : { 189123b3eb3cSopenharmony_ci 'id': -1, 189223b3eb3cSopenharmony_ci 'type': 10001, 189323b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 189423b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 189523b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 189623b3eb3cSopenharmony_ci }; 189723b3eb3cSopenharmony_ci this.initButtons(); 189823b3eb3cSopenharmony_ci this.initMargin(); 189923b3eb3cSopenharmony_ci } 190023b3eb3cSopenharmony_ci 190123b3eb3cSopenharmony_ci initMargin() { 190223b3eb3cSopenharmony_ci this.marginOffset = 0 - PADDING_LEVEL_8; 190323b3eb3cSopenharmony_ci } 190423b3eb3cSopenharmony_ci 190523b3eb3cSopenharmony_ci initButtons() { 190623b3eb3cSopenharmony_ci if (!this.primaryButton && !this.secondaryButton) { 190723b3eb3cSopenharmony_ci return; 190823b3eb3cSopenharmony_ci } 190923b3eb3cSopenharmony_ci this.buttons = []; 191023b3eb3cSopenharmony_ci if (this.primaryButton) { 191123b3eb3cSopenharmony_ci this.buttons.push(this.primaryButton); 191223b3eb3cSopenharmony_ci } 191323b3eb3cSopenharmony_ci if (this.secondaryButton) { 191423b3eb3cSopenharmony_ci this.buttons.push(this.secondaryButton); 191523b3eb3cSopenharmony_ci } 191623b3eb3cSopenharmony_ci } 191723b3eb3cSopenharmony_ci 191823b3eb3cSopenharmony_ci rerender() { 191923b3eb3cSopenharmony_ci this.updateDirtyElements(); 192023b3eb3cSopenharmony_ci } 192123b3eb3cSopenharmony_ci} 192223b3eb3cSopenharmony_ci 192323b3eb3cSopenharmony_ciexport class AlertDialog extends ViewPU { 192423b3eb3cSopenharmony_ci constructor(d23, e23, f23, g23 = -1, h23 = undefined, i23) { 192523b3eb3cSopenharmony_ci super(d23, f23, g23, i23); 192623b3eb3cSopenharmony_ci if (typeof h23 === 'function') { 192723b3eb3cSopenharmony_ci this.paramsGenerator_ = h23; 192823b3eb3cSopenharmony_ci } 192923b3eb3cSopenharmony_ci this.controller = undefined; 193023b3eb3cSopenharmony_ci this.primaryTitle = undefined; 193123b3eb3cSopenharmony_ci this.secondaryTitle = undefined; 193223b3eb3cSopenharmony_ci this.content = ''; 193323b3eb3cSopenharmony_ci this.primaryButton = null; 193423b3eb3cSopenharmony_ci this.secondaryButton = null; 193523b3eb3cSopenharmony_ci this.buttons = undefined; 193623b3eb3cSopenharmony_ci this.__textAlign = new ObservedPropertySimplePU(TextAlign.Start, this, 'textAlign'); 193723b3eb3cSopenharmony_ci this.contentScroller = new Scroller(); 193823b3eb3cSopenharmony_ci this.__fontColorWithTheme = new ObservedPropertyObjectPU({ 193923b3eb3cSopenharmony_ci 'id': -1, 194023b3eb3cSopenharmony_ci 'type': 10001, 194123b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 194223b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 194323b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 194423b3eb3cSopenharmony_ci }, this, 'fontColorWithTheme'); 194523b3eb3cSopenharmony_ci this.theme = new CustomThemeImpl({}); 194623b3eb3cSopenharmony_ci this.themeColorMode = ThemeColorMode.SYSTEM; 194723b3eb3cSopenharmony_ci this.__fontSizeScale = new ObservedPropertySimplePU(1, this, 'fontSizeScale'); 194823b3eb3cSopenharmony_ci this.__minContentHeight = new ObservedPropertySimplePU(MIN_CONTENT_HEIGHT, this, 'minContentHeight'); 194923b3eb3cSopenharmony_ci this.setInitiallyProvidedValue(e23); 195023b3eb3cSopenharmony_ci this.finalizeConstruction(); 195123b3eb3cSopenharmony_ci } 195223b3eb3cSopenharmony_ci 195323b3eb3cSopenharmony_ci setInitiallyProvidedValue(c23) { 195423b3eb3cSopenharmony_ci if (c23.controller !== undefined) { 195523b3eb3cSopenharmony_ci this.controller = c23.controller; 195623b3eb3cSopenharmony_ci } 195723b3eb3cSopenharmony_ci if (c23.primaryTitle !== undefined) { 195823b3eb3cSopenharmony_ci this.primaryTitle = c23.primaryTitle; 195923b3eb3cSopenharmony_ci } 196023b3eb3cSopenharmony_ci if (c23.secondaryTitle !== undefined) { 196123b3eb3cSopenharmony_ci this.secondaryTitle = c23.secondaryTitle; 196223b3eb3cSopenharmony_ci } 196323b3eb3cSopenharmony_ci if (c23.content !== undefined) { 196423b3eb3cSopenharmony_ci this.content = c23.content; 196523b3eb3cSopenharmony_ci } 196623b3eb3cSopenharmony_ci if (c23.primaryButton !== undefined) { 196723b3eb3cSopenharmony_ci this.primaryButton = c23.primaryButton; 196823b3eb3cSopenharmony_ci } 196923b3eb3cSopenharmony_ci if (c23.secondaryButton !== undefined) { 197023b3eb3cSopenharmony_ci this.secondaryButton = c23.secondaryButton; 197123b3eb3cSopenharmony_ci } 197223b3eb3cSopenharmony_ci if (c23.buttons !== undefined) { 197323b3eb3cSopenharmony_ci this.buttons = c23.buttons; 197423b3eb3cSopenharmony_ci } 197523b3eb3cSopenharmony_ci if (c23.textAlign !== undefined) { 197623b3eb3cSopenharmony_ci this.textAlign = c23.textAlign; 197723b3eb3cSopenharmony_ci } 197823b3eb3cSopenharmony_ci if (c23.contentScroller !== undefined) { 197923b3eb3cSopenharmony_ci this.contentScroller = c23.contentScroller; 198023b3eb3cSopenharmony_ci } 198123b3eb3cSopenharmony_ci if (c23.fontColorWithTheme !== undefined) { 198223b3eb3cSopenharmony_ci this.fontColorWithTheme = c23.fontColorWithTheme; 198323b3eb3cSopenharmony_ci } 198423b3eb3cSopenharmony_ci if (c23.theme !== undefined) { 198523b3eb3cSopenharmony_ci this.theme = c23.theme; 198623b3eb3cSopenharmony_ci } 198723b3eb3cSopenharmony_ci if (c23.themeColorMode !== undefined) { 198823b3eb3cSopenharmony_ci this.themeColorMode = c23.themeColorMode; 198923b3eb3cSopenharmony_ci } 199023b3eb3cSopenharmony_ci if (c23.fontSizeScale !== undefined) { 199123b3eb3cSopenharmony_ci this.fontSizeScale = c23.fontSizeScale; 199223b3eb3cSopenharmony_ci } 199323b3eb3cSopenharmony_ci if (c23.minContentHeight !== undefined) { 199423b3eb3cSopenharmony_ci this.minContentHeight = c23.minContentHeight; 199523b3eb3cSopenharmony_ci } 199623b3eb3cSopenharmony_ci } 199723b3eb3cSopenharmony_ci 199823b3eb3cSopenharmony_ci updateStateVars(b23) { 199923b3eb3cSopenharmony_ci } 200023b3eb3cSopenharmony_ci 200123b3eb3cSopenharmony_ci purgeVariableDependenciesOnElmtId(a23) { 200223b3eb3cSopenharmony_ci this.__textAlign.purgeDependencyOnElmtId(a23); 200323b3eb3cSopenharmony_ci this.__fontColorWithTheme.purgeDependencyOnElmtId(a23); 200423b3eb3cSopenharmony_ci this.__fontSizeScale.purgeDependencyOnElmtId(a23); 200523b3eb3cSopenharmony_ci this.__minContentHeight.purgeDependencyOnElmtId(a23); 200623b3eb3cSopenharmony_ci } 200723b3eb3cSopenharmony_ci 200823b3eb3cSopenharmony_ci aboutToBeDeleted() { 200923b3eb3cSopenharmony_ci this.__textAlign.aboutToBeDeleted(); 201023b3eb3cSopenharmony_ci this.__fontColorWithTheme.aboutToBeDeleted(); 201123b3eb3cSopenharmony_ci this.__fontSizeScale.aboutToBeDeleted(); 201223b3eb3cSopenharmony_ci this.__minContentHeight.aboutToBeDeleted(); 201323b3eb3cSopenharmony_ci SubscriberManager.Get().delete(this.id__()); 201423b3eb3cSopenharmony_ci this.aboutToBeDeletedInternal(); 201523b3eb3cSopenharmony_ci } 201623b3eb3cSopenharmony_ci 201723b3eb3cSopenharmony_ci setController(z22) { 201823b3eb3cSopenharmony_ci this.controller = z22; 201923b3eb3cSopenharmony_ci } 202023b3eb3cSopenharmony_ci 202123b3eb3cSopenharmony_ci get textAlign() { 202223b3eb3cSopenharmony_ci return this.__textAlign.get(); 202323b3eb3cSopenharmony_ci } 202423b3eb3cSopenharmony_ci 202523b3eb3cSopenharmony_ci set textAlign(y22) { 202623b3eb3cSopenharmony_ci this.__textAlign.set(y22); 202723b3eb3cSopenharmony_ci } 202823b3eb3cSopenharmony_ci 202923b3eb3cSopenharmony_ci get fontColorWithTheme() { 203023b3eb3cSopenharmony_ci return this.__fontColorWithTheme.get(); 203123b3eb3cSopenharmony_ci } 203223b3eb3cSopenharmony_ci 203323b3eb3cSopenharmony_ci set fontColorWithTheme(x22) { 203423b3eb3cSopenharmony_ci this.__fontColorWithTheme.set(x22); 203523b3eb3cSopenharmony_ci } 203623b3eb3cSopenharmony_ci 203723b3eb3cSopenharmony_ci get fontSizeScale() { 203823b3eb3cSopenharmony_ci return this.__fontSizeScale.get(); 203923b3eb3cSopenharmony_ci } 204023b3eb3cSopenharmony_ci 204123b3eb3cSopenharmony_ci set fontSizeScale(w22) { 204223b3eb3cSopenharmony_ci this.__fontSizeScale.set(w22); 204323b3eb3cSopenharmony_ci } 204423b3eb3cSopenharmony_ci 204523b3eb3cSopenharmony_ci get minContentHeight() { 204623b3eb3cSopenharmony_ci return this.__minContentHeight.get(); 204723b3eb3cSopenharmony_ci } 204823b3eb3cSopenharmony_ci 204923b3eb3cSopenharmony_ci set minContentHeight(v22) { 205023b3eb3cSopenharmony_ci this.__minContentHeight.set(v22); 205123b3eb3cSopenharmony_ci } 205223b3eb3cSopenharmony_ci 205323b3eb3cSopenharmony_ci initialRender() { 205423b3eb3cSopenharmony_ci this.observeComponentCreation2((t22, u22) => { 205523b3eb3cSopenharmony_ci __Common__.create(); 205623b3eb3cSopenharmony_ci __Common__.constraintSize({ maxHeight: '100%' }); 205723b3eb3cSopenharmony_ci }, __Common__); 205823b3eb3cSopenharmony_ci { 205923b3eb3cSopenharmony_ci this.observeComponentCreation2((p22, q22) => { 206023b3eb3cSopenharmony_ci if (q22) { 206123b3eb3cSopenharmony_ci let r22 = new CustomDialogContentComponent(this, { 206223b3eb3cSopenharmony_ci primaryTitle: this.primaryTitle, 206323b3eb3cSopenharmony_ci secondaryTitle: this.secondaryTitle, 206423b3eb3cSopenharmony_ci controller: this.controller, 206523b3eb3cSopenharmony_ci contentBuilder: () => { 206623b3eb3cSopenharmony_ci this.AlertDialogContentBuilder(); 206723b3eb3cSopenharmony_ci }, 206823b3eb3cSopenharmony_ci buttons: this.buttons, 206923b3eb3cSopenharmony_ci theme: this.theme, 207023b3eb3cSopenharmony_ci themeColorMode: this.themeColorMode, 207123b3eb3cSopenharmony_ci fontSizeScale: this.__fontSizeScale, 207223b3eb3cSopenharmony_ci minContentHeight: this.__minContentHeight, 207323b3eb3cSopenharmony_ci }, undefined, p22, () => { 207423b3eb3cSopenharmony_ci }, { page: 'library/src/main/ets/components/MainPage.ets', line: 807, col: 5 }); 207523b3eb3cSopenharmony_ci ViewPU.create(r22); 207623b3eb3cSopenharmony_ci let g = () => { 207723b3eb3cSopenharmony_ci return { 207823b3eb3cSopenharmony_ci primaryTitle: this.primaryTitle, 207923b3eb3cSopenharmony_ci secondaryTitle: this.secondaryTitle, 208023b3eb3cSopenharmony_ci controller: this.controller, 208123b3eb3cSopenharmony_ci contentBuilder: () => { 208223b3eb3cSopenharmony_ci this.AlertDialogContentBuilder(); 208323b3eb3cSopenharmony_ci }, 208423b3eb3cSopenharmony_ci buttons: this.buttons, 208523b3eb3cSopenharmony_ci theme: this.theme, 208623b3eb3cSopenharmony_ci themeColorMode: this.themeColorMode, 208723b3eb3cSopenharmony_ci fontSizeScale: this.fontSizeScale, 208823b3eb3cSopenharmony_ci minContentHeight: this.minContentHeight 208923b3eb3cSopenharmony_ci }; 209023b3eb3cSopenharmony_ci }; 209123b3eb3cSopenharmony_ci r22.paramsGenerator_ = g; 209223b3eb3cSopenharmony_ci } else { 209323b3eb3cSopenharmony_ci this.updateStateVarsOfChildByElmtId(p22, {}); 209423b3eb3cSopenharmony_ci } 209523b3eb3cSopenharmony_ci }, { name: 'CustomDialogContentComponent' }); 209623b3eb3cSopenharmony_ci } 209723b3eb3cSopenharmony_ci __Common__.pop(); 209823b3eb3cSopenharmony_ci } 209923b3eb3cSopenharmony_ci 210023b3eb3cSopenharmony_ci AlertDialogContentBuilder(f22 = null) { 210123b3eb3cSopenharmony_ci this.observeComponentCreation2((n22, o22) => { 210223b3eb3cSopenharmony_ci Column.create(); 210323b3eb3cSopenharmony_ci Column.margin({ end: LengthMetrics.vp(this.getMargin()) }); 210423b3eb3cSopenharmony_ci }, Column); 210523b3eb3cSopenharmony_ci this.observeComponentCreation2((l22, m22) => { 210623b3eb3cSopenharmony_ci Scroll.create(this.contentScroller); 210723b3eb3cSopenharmony_ci Scroll.nestedScroll({ 210823b3eb3cSopenharmony_ci scrollForward: NestedScrollMode.PARALLEL, 210923b3eb3cSopenharmony_ci scrollBackward: NestedScrollMode.PARALLEL 211023b3eb3cSopenharmony_ci }); 211123b3eb3cSopenharmony_ci Scroll.width('100%'); 211223b3eb3cSopenharmony_ci }, Scroll); 211323b3eb3cSopenharmony_ci this.observeComponentCreation2((g22, h22) => { 211423b3eb3cSopenharmony_ci Text.create(this.content); 211523b3eb3cSopenharmony_ci Text.focusable(true); 211623b3eb3cSopenharmony_ci Text.defaultFocus(!(this.primaryButton || this.secondaryButton)); 211723b3eb3cSopenharmony_ci Text.focusBox({ 211823b3eb3cSopenharmony_ci strokeWidth: LengthMetrics.px(0) 211923b3eb3cSopenharmony_ci }); 212023b3eb3cSopenharmony_ci Text.fontSize(`${BODY_L}fp`); 212123b3eb3cSopenharmony_ci Text.fontWeight(this.getFontWeight()); 212223b3eb3cSopenharmony_ci Text.fontColor(ObservedObject.GetRawObject(this.fontColorWithTheme)); 212323b3eb3cSopenharmony_ci Text.margin({ 212423b3eb3cSopenharmony_ci end: LengthMetrics.resource({ 212523b3eb3cSopenharmony_ci 'id': -1, 212623b3eb3cSopenharmony_ci 'type': 10002, 212723b3eb3cSopenharmony_ci params: ['sys.float.padding_level8'], 212823b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 212923b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 213023b3eb3cSopenharmony_ci }) 213123b3eb3cSopenharmony_ci }); 213223b3eb3cSopenharmony_ci Text.width(`calc(100% - ${PADDING_LEVEL_8}vp)`); 213323b3eb3cSopenharmony_ci Text.textAlign(this.textAlign); 213423b3eb3cSopenharmony_ci Text.onAreaChange((j22, k22) => { 213523b3eb3cSopenharmony_ci this.updateTextAlign(Number(k22.width)); 213623b3eb3cSopenharmony_ci }); 213723b3eb3cSopenharmony_ci Text.onKeyEvent((i22) => { 213823b3eb3cSopenharmony_ci if (i22) { 213923b3eb3cSopenharmony_ci resolveKeyEvent(i22, this.contentScroller); 214023b3eb3cSopenharmony_ci } 214123b3eb3cSopenharmony_ci }); 214223b3eb3cSopenharmony_ci }, Text); 214323b3eb3cSopenharmony_ci Text.pop(); 214423b3eb3cSopenharmony_ci Scroll.pop(); 214523b3eb3cSopenharmony_ci Column.pop(); 214623b3eb3cSopenharmony_ci } 214723b3eb3cSopenharmony_ci 214823b3eb3cSopenharmony_ci aboutToAppear() { 214923b3eb3cSopenharmony_ci this.fontColorWithTheme = this.theme?.colors?.fontPrimary ? 215023b3eb3cSopenharmony_ci this.theme.colors.fontPrimary : { 215123b3eb3cSopenharmony_ci 'id': -1, 215223b3eb3cSopenharmony_ci 'type': 10001, 215323b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 215423b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 215523b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 215623b3eb3cSopenharmony_ci }; 215723b3eb3cSopenharmony_ci this.initButtons(); 215823b3eb3cSopenharmony_ci } 215923b3eb3cSopenharmony_ci 216023b3eb3cSopenharmony_ci updateTextAlign(e22) { 216123b3eb3cSopenharmony_ci this.textAlign = getTextAlign(e22, this.content, `${BODY_L * this.fontSizeScale}vp`); 216223b3eb3cSopenharmony_ci } 216323b3eb3cSopenharmony_ci 216423b3eb3cSopenharmony_ci initButtons() { 216523b3eb3cSopenharmony_ci if (!this.primaryButton && !this.secondaryButton) { 216623b3eb3cSopenharmony_ci return; 216723b3eb3cSopenharmony_ci } 216823b3eb3cSopenharmony_ci this.buttons = []; 216923b3eb3cSopenharmony_ci if (this.primaryButton) { 217023b3eb3cSopenharmony_ci this.buttons.push(this.primaryButton); 217123b3eb3cSopenharmony_ci } 217223b3eb3cSopenharmony_ci if (this.secondaryButton) { 217323b3eb3cSopenharmony_ci this.buttons.push(this.secondaryButton); 217423b3eb3cSopenharmony_ci } 217523b3eb3cSopenharmony_ci } 217623b3eb3cSopenharmony_ci 217723b3eb3cSopenharmony_ci getMargin() { 217823b3eb3cSopenharmony_ci return 0 - PADDING_LEVEL_8; 217923b3eb3cSopenharmony_ci } 218023b3eb3cSopenharmony_ci 218123b3eb3cSopenharmony_ci getFontWeight() { 218223b3eb3cSopenharmony_ci if (this.primaryTitle || this.secondaryTitle) { 218323b3eb3cSopenharmony_ci return FontWeight.Regular; 218423b3eb3cSopenharmony_ci } 218523b3eb3cSopenharmony_ci return FontWeight.Medium; 218623b3eb3cSopenharmony_ci } 218723b3eb3cSopenharmony_ci 218823b3eb3cSopenharmony_ci rerender() { 218923b3eb3cSopenharmony_ci this.updateDirtyElements(); 219023b3eb3cSopenharmony_ci } 219123b3eb3cSopenharmony_ci} 219223b3eb3cSopenharmony_ci 219323b3eb3cSopenharmony_ciexport class CustomContentDialog extends ViewPU { 219423b3eb3cSopenharmony_ci constructor(y21, z21, a22, b22 = -1, c22 = undefined, d22) { 219523b3eb3cSopenharmony_ci super(y21, a22, b22, d22); 219623b3eb3cSopenharmony_ci if (typeof c22 === 'function') { 219723b3eb3cSopenharmony_ci this.paramsGenerator_ = c22; 219823b3eb3cSopenharmony_ci } 219923b3eb3cSopenharmony_ci this.controller = undefined; 220023b3eb3cSopenharmony_ci this.primaryTitle = undefined; 220123b3eb3cSopenharmony_ci this.secondaryTitle = undefined; 220223b3eb3cSopenharmony_ci this.contentBuilder = undefined; 220323b3eb3cSopenharmony_ci this.contentAreaPadding = undefined; 220423b3eb3cSopenharmony_ci this.localizedContentAreaPadding = undefined; 220523b3eb3cSopenharmony_ci this.buttons = undefined; 220623b3eb3cSopenharmony_ci this.theme = new CustomThemeImpl({}); 220723b3eb3cSopenharmony_ci this.themeColorMode = ThemeColorMode.SYSTEM; 220823b3eb3cSopenharmony_ci this.__fontSizeScale = new ObservedPropertySimplePU(1, this, 'fontSizeScale'); 220923b3eb3cSopenharmony_ci this.__minContentHeight = new ObservedPropertySimplePU(MIN_CONTENT_HEIGHT, this, 'minContentHeight'); 221023b3eb3cSopenharmony_ci this.setInitiallyProvidedValue(z21); 221123b3eb3cSopenharmony_ci this.finalizeConstruction(); 221223b3eb3cSopenharmony_ci } 221323b3eb3cSopenharmony_ci 221423b3eb3cSopenharmony_ci setInitiallyProvidedValue(x21) { 221523b3eb3cSopenharmony_ci if (x21.controller !== undefined) { 221623b3eb3cSopenharmony_ci this.controller = x21.controller; 221723b3eb3cSopenharmony_ci } 221823b3eb3cSopenharmony_ci if (x21.primaryTitle !== undefined) { 221923b3eb3cSopenharmony_ci this.primaryTitle = x21.primaryTitle; 222023b3eb3cSopenharmony_ci } 222123b3eb3cSopenharmony_ci if (x21.secondaryTitle !== undefined) { 222223b3eb3cSopenharmony_ci this.secondaryTitle = x21.secondaryTitle; 222323b3eb3cSopenharmony_ci } 222423b3eb3cSopenharmony_ci if (x21.contentBuilder !== undefined) { 222523b3eb3cSopenharmony_ci this.contentBuilder = x21.contentBuilder; 222623b3eb3cSopenharmony_ci } 222723b3eb3cSopenharmony_ci if (x21.contentAreaPadding !== undefined) { 222823b3eb3cSopenharmony_ci this.contentAreaPadding = x21.contentAreaPadding; 222923b3eb3cSopenharmony_ci } 223023b3eb3cSopenharmony_ci if (x21.localizedContentAreaPadding !== undefined) { 223123b3eb3cSopenharmony_ci this.localizedContentAreaPadding = x21.localizedContentAreaPadding; 223223b3eb3cSopenharmony_ci } 223323b3eb3cSopenharmony_ci if (x21.buttons !== undefined) { 223423b3eb3cSopenharmony_ci this.buttons = x21.buttons; 223523b3eb3cSopenharmony_ci } 223623b3eb3cSopenharmony_ci if (x21.theme !== undefined) { 223723b3eb3cSopenharmony_ci this.theme = x21.theme; 223823b3eb3cSopenharmony_ci } 223923b3eb3cSopenharmony_ci if (x21.themeColorMode !== undefined) { 224023b3eb3cSopenharmony_ci this.themeColorMode = x21.themeColorMode; 224123b3eb3cSopenharmony_ci } 224223b3eb3cSopenharmony_ci if (x21.fontSizeScale !== undefined) { 224323b3eb3cSopenharmony_ci this.fontSizeScale = x21.fontSizeScale; 224423b3eb3cSopenharmony_ci } 224523b3eb3cSopenharmony_ci if (x21.minContentHeight !== undefined) { 224623b3eb3cSopenharmony_ci this.minContentHeight = x21.minContentHeight; 224723b3eb3cSopenharmony_ci } 224823b3eb3cSopenharmony_ci } 224923b3eb3cSopenharmony_ci 225023b3eb3cSopenharmony_ci updateStateVars(w21) { 225123b3eb3cSopenharmony_ci } 225223b3eb3cSopenharmony_ci 225323b3eb3cSopenharmony_ci purgeVariableDependenciesOnElmtId(v21) { 225423b3eb3cSopenharmony_ci this.__fontSizeScale.purgeDependencyOnElmtId(v21); 225523b3eb3cSopenharmony_ci this.__minContentHeight.purgeDependencyOnElmtId(v21); 225623b3eb3cSopenharmony_ci } 225723b3eb3cSopenharmony_ci 225823b3eb3cSopenharmony_ci aboutToBeDeleted() { 225923b3eb3cSopenharmony_ci this.__fontSizeScale.aboutToBeDeleted(); 226023b3eb3cSopenharmony_ci this.__minContentHeight.aboutToBeDeleted(); 226123b3eb3cSopenharmony_ci SubscriberManager.Get().delete(this.id__()); 226223b3eb3cSopenharmony_ci this.aboutToBeDeletedInternal(); 226323b3eb3cSopenharmony_ci } 226423b3eb3cSopenharmony_ci 226523b3eb3cSopenharmony_ci setController(u21) { 226623b3eb3cSopenharmony_ci this.controller = u21; 226723b3eb3cSopenharmony_ci } 226823b3eb3cSopenharmony_ci 226923b3eb3cSopenharmony_ci get fontSizeScale() { 227023b3eb3cSopenharmony_ci return this.__fontSizeScale.get(); 227123b3eb3cSopenharmony_ci } 227223b3eb3cSopenharmony_ci 227323b3eb3cSopenharmony_ci set fontSizeScale(t21) { 227423b3eb3cSopenharmony_ci this.__fontSizeScale.set(t21); 227523b3eb3cSopenharmony_ci } 227623b3eb3cSopenharmony_ci 227723b3eb3cSopenharmony_ci get minContentHeight() { 227823b3eb3cSopenharmony_ci return this.__minContentHeight.get(); 227923b3eb3cSopenharmony_ci } 228023b3eb3cSopenharmony_ci 228123b3eb3cSopenharmony_ci set minContentHeight(s21) { 228223b3eb3cSopenharmony_ci this.__minContentHeight.set(s21); 228323b3eb3cSopenharmony_ci } 228423b3eb3cSopenharmony_ci 228523b3eb3cSopenharmony_ci initialRender() { 228623b3eb3cSopenharmony_ci this.observeComponentCreation2((q21, r21) => { 228723b3eb3cSopenharmony_ci __Common__.create(); 228823b3eb3cSopenharmony_ci __Common__.constraintSize({ maxHeight: '100%' }); 228923b3eb3cSopenharmony_ci }, __Common__); 229023b3eb3cSopenharmony_ci { 229123b3eb3cSopenharmony_ci this.observeComponentCreation2((m21, n21) => { 229223b3eb3cSopenharmony_ci if (n21) { 229323b3eb3cSopenharmony_ci let o21 = new CustomDialogContentComponent(this, { 229423b3eb3cSopenharmony_ci controller: this.controller, 229523b3eb3cSopenharmony_ci primaryTitle: this.primaryTitle, 229623b3eb3cSopenharmony_ci secondaryTitle: this.secondaryTitle, 229723b3eb3cSopenharmony_ci contentBuilder: () => { 229823b3eb3cSopenharmony_ci this.contentBuilder(); 229923b3eb3cSopenharmony_ci }, 230023b3eb3cSopenharmony_ci contentAreaPadding: this.contentAreaPadding, 230123b3eb3cSopenharmony_ci localizedContentAreaPadding: this.localizedContentAreaPadding, 230223b3eb3cSopenharmony_ci buttons: this.buttons, 230323b3eb3cSopenharmony_ci theme: this.theme, 230423b3eb3cSopenharmony_ci themeColorMode: this.themeColorMode, 230523b3eb3cSopenharmony_ci fontSizeScale: this.__fontSizeScale, 230623b3eb3cSopenharmony_ci minContentHeight: this.__minContentHeight, 230723b3eb3cSopenharmony_ci customStyle: false 230823b3eb3cSopenharmony_ci }, undefined, m21, () => { 230923b3eb3cSopenharmony_ci }, { page: 'library/src/main/ets/components/MainPage.ets', line: 903, col: 5 }); 231023b3eb3cSopenharmony_ci ViewPU.create(o21); 231123b3eb3cSopenharmony_ci let f = () => { 231223b3eb3cSopenharmony_ci return { 231323b3eb3cSopenharmony_ci controller: this.controller, 231423b3eb3cSopenharmony_ci primaryTitle: this.primaryTitle, 231523b3eb3cSopenharmony_ci secondaryTitle: this.secondaryTitle, 231623b3eb3cSopenharmony_ci contentBuilder: () => { 231723b3eb3cSopenharmony_ci this.contentBuilder(); 231823b3eb3cSopenharmony_ci }, 231923b3eb3cSopenharmony_ci contentAreaPadding: this.contentAreaPadding, 232023b3eb3cSopenharmony_ci localizedContentAreaPadding: this.localizedContentAreaPadding, 232123b3eb3cSopenharmony_ci buttons: this.buttons, 232223b3eb3cSopenharmony_ci theme: this.theme, 232323b3eb3cSopenharmony_ci themeColorMode: this.themeColorMode, 232423b3eb3cSopenharmony_ci fontSizeScale: this.fontSizeScale, 232523b3eb3cSopenharmony_ci minContentHeight: this.minContentHeight, 232623b3eb3cSopenharmony_ci customStyle: false 232723b3eb3cSopenharmony_ci }; 232823b3eb3cSopenharmony_ci }; 232923b3eb3cSopenharmony_ci o21.paramsGenerator_ = f; 233023b3eb3cSopenharmony_ci } else { 233123b3eb3cSopenharmony_ci this.updateStateVarsOfChildByElmtId(m21, {}); 233223b3eb3cSopenharmony_ci } 233323b3eb3cSopenharmony_ci }, { name: 'CustomDialogContentComponent' }); 233423b3eb3cSopenharmony_ci } 233523b3eb3cSopenharmony_ci __Common__.pop(); 233623b3eb3cSopenharmony_ci } 233723b3eb3cSopenharmony_ci 233823b3eb3cSopenharmony_ci rerender() { 233923b3eb3cSopenharmony_ci this.updateDirtyElements(); 234023b3eb3cSopenharmony_ci } 234123b3eb3cSopenharmony_ci} 234223b3eb3cSopenharmony_ci 234323b3eb3cSopenharmony_ciclass CustomDialogControllerExtend extends CustomDialogController { 234423b3eb3cSopenharmony_ci constructor(l21) { 234523b3eb3cSopenharmony_ci super(l21); 234623b3eb3cSopenharmony_ci this.arg_ = l21; 234723b3eb3cSopenharmony_ci } 234823b3eb3cSopenharmony_ci} 234923b3eb3cSopenharmony_ci 235023b3eb3cSopenharmony_ciclass CustomDialogLayout extends ViewPU { 235123b3eb3cSopenharmony_ci constructor(f21, g21, h21, i21 = -1, j21 = undefined, k21) { 235223b3eb3cSopenharmony_ci super(f21, h21, i21, k21); 235323b3eb3cSopenharmony_ci if (typeof j21 === 'function') { 235423b3eb3cSopenharmony_ci this.paramsGenerator_ = j21; 235523b3eb3cSopenharmony_ci } 235623b3eb3cSopenharmony_ci this.__titleHeight = new SynchedPropertySimpleTwoWayPU(g21.titleHeight, this, 'titleHeight'); 235723b3eb3cSopenharmony_ci this.__buttonHeight = new SynchedPropertySimpleTwoWayPU(g21.buttonHeight, this, 'buttonHeight'); 235823b3eb3cSopenharmony_ci this.__titleMinHeight = new SynchedPropertyObjectTwoWayPU(g21.titleMinHeight, this, 'titleMinHeight'); 235923b3eb3cSopenharmony_ci this.dialogBuilder = this.doNothingBuilder; 236023b3eb3cSopenharmony_ci this.titleIndex = 0; 236123b3eb3cSopenharmony_ci this.contentIndex = 1; 236223b3eb3cSopenharmony_ci this.buttonIndex = 2; 236323b3eb3cSopenharmony_ci this.setInitiallyProvidedValue(g21); 236423b3eb3cSopenharmony_ci this.finalizeConstruction(); 236523b3eb3cSopenharmony_ci } 236623b3eb3cSopenharmony_ci 236723b3eb3cSopenharmony_ci setInitiallyProvidedValue(e21) { 236823b3eb3cSopenharmony_ci if (e21.dialogBuilder !== undefined) { 236923b3eb3cSopenharmony_ci this.dialogBuilder = e21.dialogBuilder; 237023b3eb3cSopenharmony_ci } 237123b3eb3cSopenharmony_ci if (e21.titleIndex !== undefined) { 237223b3eb3cSopenharmony_ci this.titleIndex = e21.titleIndex; 237323b3eb3cSopenharmony_ci } 237423b3eb3cSopenharmony_ci if (e21.contentIndex !== undefined) { 237523b3eb3cSopenharmony_ci this.contentIndex = e21.contentIndex; 237623b3eb3cSopenharmony_ci } 237723b3eb3cSopenharmony_ci if (e21.buttonIndex !== undefined) { 237823b3eb3cSopenharmony_ci this.buttonIndex = e21.buttonIndex; 237923b3eb3cSopenharmony_ci } 238023b3eb3cSopenharmony_ci } 238123b3eb3cSopenharmony_ci 238223b3eb3cSopenharmony_ci updateStateVars(d21) { 238323b3eb3cSopenharmony_ci } 238423b3eb3cSopenharmony_ci 238523b3eb3cSopenharmony_ci purgeVariableDependenciesOnElmtId(c21) { 238623b3eb3cSopenharmony_ci this.__titleHeight.purgeDependencyOnElmtId(c21); 238723b3eb3cSopenharmony_ci this.__buttonHeight.purgeDependencyOnElmtId(c21); 238823b3eb3cSopenharmony_ci this.__titleMinHeight.purgeDependencyOnElmtId(c21); 238923b3eb3cSopenharmony_ci } 239023b3eb3cSopenharmony_ci 239123b3eb3cSopenharmony_ci aboutToBeDeleted() { 239223b3eb3cSopenharmony_ci this.__titleHeight.aboutToBeDeleted(); 239323b3eb3cSopenharmony_ci this.__buttonHeight.aboutToBeDeleted(); 239423b3eb3cSopenharmony_ci this.__titleMinHeight.aboutToBeDeleted(); 239523b3eb3cSopenharmony_ci SubscriberManager.Get().delete(this.id__()); 239623b3eb3cSopenharmony_ci this.aboutToBeDeletedInternal(); 239723b3eb3cSopenharmony_ci } 239823b3eb3cSopenharmony_ci 239923b3eb3cSopenharmony_ci doNothingBuilder(b21 = null) { 240023b3eb3cSopenharmony_ci } 240123b3eb3cSopenharmony_ci 240223b3eb3cSopenharmony_ci get titleHeight() { 240323b3eb3cSopenharmony_ci return this.__titleHeight.get(); 240423b3eb3cSopenharmony_ci } 240523b3eb3cSopenharmony_ci 240623b3eb3cSopenharmony_ci set titleHeight(a21) { 240723b3eb3cSopenharmony_ci this.__titleHeight.set(a21); 240823b3eb3cSopenharmony_ci } 240923b3eb3cSopenharmony_ci 241023b3eb3cSopenharmony_ci get buttonHeight() { 241123b3eb3cSopenharmony_ci return this.__buttonHeight.get(); 241223b3eb3cSopenharmony_ci } 241323b3eb3cSopenharmony_ci 241423b3eb3cSopenharmony_ci set buttonHeight(z20) { 241523b3eb3cSopenharmony_ci this.__buttonHeight.set(z20); 241623b3eb3cSopenharmony_ci } 241723b3eb3cSopenharmony_ci 241823b3eb3cSopenharmony_ci get titleMinHeight() { 241923b3eb3cSopenharmony_ci return this.__titleMinHeight.get(); 242023b3eb3cSopenharmony_ci } 242123b3eb3cSopenharmony_ci 242223b3eb3cSopenharmony_ci set titleMinHeight(y20) { 242323b3eb3cSopenharmony_ci this.__titleMinHeight.set(y20); 242423b3eb3cSopenharmony_ci } 242523b3eb3cSopenharmony_ci 242623b3eb3cSopenharmony_ci onPlaceChildren(r20, s20, t20) { 242723b3eb3cSopenharmony_ci let u20 = 0; 242823b3eb3cSopenharmony_ci let v20 = 0; 242923b3eb3cSopenharmony_ci for (let w20 = 0; w20 < s20.length; w20++) { 243023b3eb3cSopenharmony_ci let x20 = s20[w20]; 243123b3eb3cSopenharmony_ci x20.layout({ x: u20, y: v20 }); 243223b3eb3cSopenharmony_ci v20 += x20.measureResult.height; 243323b3eb3cSopenharmony_ci } 243423b3eb3cSopenharmony_ci } 243523b3eb3cSopenharmony_ci 243623b3eb3cSopenharmony_ci onMeasureSize(d20, e20, f20) { 243723b3eb3cSopenharmony_ci let g20 = { width: Number(f20.maxWidth), height: 0 }; 243823b3eb3cSopenharmony_ci let h20 = 3; 243923b3eb3cSopenharmony_ci if (e20.length < h20) { 244023b3eb3cSopenharmony_ci return g20; 244123b3eb3cSopenharmony_ci } 244223b3eb3cSopenharmony_ci let i20 = 0; 244323b3eb3cSopenharmony_ci let j20 = e20[this.titleIndex]; 244423b3eb3cSopenharmony_ci let k20 = { 244523b3eb3cSopenharmony_ci maxWidth: f20.maxWidth, 244623b3eb3cSopenharmony_ci minHeight: this.titleMinHeight, 244723b3eb3cSopenharmony_ci maxHeight: f20.maxHeight 244823b3eb3cSopenharmony_ci }; 244923b3eb3cSopenharmony_ci let l20 = j20.measure(k20); 245023b3eb3cSopenharmony_ci this.titleHeight = l20.height; 245123b3eb3cSopenharmony_ci i20 += this.titleHeight; 245223b3eb3cSopenharmony_ci let m20 = e20[this.buttonIndex]; 245323b3eb3cSopenharmony_ci let n20 = m20.measure(f20); 245423b3eb3cSopenharmony_ci this.buttonHeight = n20.height; 245523b3eb3cSopenharmony_ci i20 += this.buttonHeight; 245623b3eb3cSopenharmony_ci let o20 = e20[this.contentIndex]; 245723b3eb3cSopenharmony_ci let p20 = { 245823b3eb3cSopenharmony_ci maxWidth: f20.maxWidth, 245923b3eb3cSopenharmony_ci maxHeight: Number(f20.maxHeight) - i20 246023b3eb3cSopenharmony_ci }; 246123b3eb3cSopenharmony_ci let q20 = o20.measure(p20); 246223b3eb3cSopenharmony_ci i20 += q20.height; 246323b3eb3cSopenharmony_ci g20.height = i20; 246423b3eb3cSopenharmony_ci return g20; 246523b3eb3cSopenharmony_ci } 246623b3eb3cSopenharmony_ci 246723b3eb3cSopenharmony_ci initialRender() { 246823b3eb3cSopenharmony_ci this.dialogBuilder.bind(this)(); 246923b3eb3cSopenharmony_ci } 247023b3eb3cSopenharmony_ci 247123b3eb3cSopenharmony_ci rerender() { 247223b3eb3cSopenharmony_ci this.updateDirtyElements(); 247323b3eb3cSopenharmony_ci } 247423b3eb3cSopenharmony_ci} 247523b3eb3cSopenharmony_ci 247623b3eb3cSopenharmony_ciclass CustomDialogContentComponent extends ViewPU { 247723b3eb3cSopenharmony_ci constructor(x19, y19, z19, a20 = -1, b20 = undefined, c20) { 247823b3eb3cSopenharmony_ci super(x19, z19, a20, c20); 247923b3eb3cSopenharmony_ci if (typeof b20 === 'function') { 248023b3eb3cSopenharmony_ci this.paramsGenerator_ = b20; 248123b3eb3cSopenharmony_ci } 248223b3eb3cSopenharmony_ci this.controller = undefined; 248323b3eb3cSopenharmony_ci this.primaryTitle = undefined; 248423b3eb3cSopenharmony_ci this.secondaryTitle = undefined; 248523b3eb3cSopenharmony_ci this.localizedContentAreaPadding = undefined; 248623b3eb3cSopenharmony_ci this.contentBuilder = this.defaultContentBuilder; 248723b3eb3cSopenharmony_ci this.buttons = undefined; 248823b3eb3cSopenharmony_ci this.contentAreaPadding = undefined; 248923b3eb3cSopenharmony_ci this.keyIndex = 0; 249023b3eb3cSopenharmony_ci this.theme = new CustomThemeImpl({}); 249123b3eb3cSopenharmony_ci this.themeColorMode = ThemeColorMode.SYSTEM; 249223b3eb3cSopenharmony_ci this.__minContentHeight = new SynchedPropertySimpleTwoWayPU(y19.minContentHeight, this, 'minContentHeight'); 249323b3eb3cSopenharmony_ci this.__titleHeight = new ObservedPropertySimplePU(0, this, 'titleHeight'); 249423b3eb3cSopenharmony_ci this.__buttonHeight = new ObservedPropertySimplePU(0, this, 'buttonHeight'); 249523b3eb3cSopenharmony_ci this.__contentMaxHeight = new ObservedPropertyObjectPU('100%', this, 'contentMaxHeight'); 249623b3eb3cSopenharmony_ci this.__fontSizeScale = new SynchedPropertySimpleTwoWayPU(y19.fontSizeScale, this, 'fontSizeScale'); 249723b3eb3cSopenharmony_ci this.__customStyle = new ObservedPropertySimplePU(undefined, this, 'customStyle'); 249823b3eb3cSopenharmony_ci this.__buttonMaxFontSize = new ObservedPropertyObjectPU(`${BODY_L}fp`, this, 'buttonMaxFontSize'); 249923b3eb3cSopenharmony_ci this.__buttonMinFontSize = new ObservedPropertyObjectPU(9, this, 'buttonMinFontSize'); 250023b3eb3cSopenharmony_ci this.__primaryTitleMaxFontSize = new ObservedPropertyObjectPU(`${TITLE_S}fp`, this, 'primaryTitleMaxFontSize'); 250123b3eb3cSopenharmony_ci this.__primaryTitleMinFontSize = new ObservedPropertyObjectPU(`${BODY_L}fp`, this, 'primaryTitleMinFontSize'); 250223b3eb3cSopenharmony_ci this.__secondaryTitleMaxFontSize = new ObservedPropertyObjectPU(`${SUBTITLE_S}fp`, this, 'secondaryTitleMaxFontSize'); 250323b3eb3cSopenharmony_ci this.__secondaryTitleMinFontSize = new ObservedPropertyObjectPU(`${BODY_S}fp`, this, 'secondaryTitleMinFontSize'); 250423b3eb3cSopenharmony_ci this.__primaryTitleFontColorWithTheme = new ObservedPropertyObjectPU({ 250523b3eb3cSopenharmony_ci 'id': -1, 250623b3eb3cSopenharmony_ci 'type': 10001, 250723b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 250823b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 250923b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 251023b3eb3cSopenharmony_ci }, this, 'primaryTitleFontColorWithTheme'); 251123b3eb3cSopenharmony_ci this.__secondaryTitleFontColorWithTheme = new ObservedPropertyObjectPU({ 251223b3eb3cSopenharmony_ci 'id': -1, 251323b3eb3cSopenharmony_ci 'type': 10001, 251423b3eb3cSopenharmony_ci params: ['sys.color.font_secondary'], 251523b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 251623b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 251723b3eb3cSopenharmony_ci }, this, 'secondaryTitleFontColorWithTheme'); 251823b3eb3cSopenharmony_ci this.__titleTextAlign = new ObservedPropertySimplePU(TextAlign.Center, this, 'titleTextAlign'); 251923b3eb3cSopenharmony_ci this.__isButtonVertical = new ObservedPropertySimplePU(false, this, 'isButtonVertical'); 252023b3eb3cSopenharmony_ci this.__titleMinHeight = new ObservedPropertyObjectPU(0, this, 'titleMinHeight'); 252123b3eb3cSopenharmony_ci this.isFollowingSystemFontScale = false; 252223b3eb3cSopenharmony_ci this.appMaxFontScale = 3.2; 252323b3eb3cSopenharmony_ci this.titleIndex = 0; 252423b3eb3cSopenharmony_ci this.contentIndex = 1; 252523b3eb3cSopenharmony_ci this.buttonIndex = 2; 252623b3eb3cSopenharmony_ci this.setInitiallyProvidedValue(y19); 252723b3eb3cSopenharmony_ci this.finalizeConstruction(); 252823b3eb3cSopenharmony_ci } 252923b3eb3cSopenharmony_ci 253023b3eb3cSopenharmony_ci setInitiallyProvidedValue(w19) { 253123b3eb3cSopenharmony_ci if (w19.controller !== undefined) { 253223b3eb3cSopenharmony_ci this.controller = w19.controller; 253323b3eb3cSopenharmony_ci } 253423b3eb3cSopenharmony_ci if (w19.primaryTitle !== undefined) { 253523b3eb3cSopenharmony_ci this.primaryTitle = w19.primaryTitle; 253623b3eb3cSopenharmony_ci } 253723b3eb3cSopenharmony_ci if (w19.secondaryTitle !== undefined) { 253823b3eb3cSopenharmony_ci this.secondaryTitle = w19.secondaryTitle; 253923b3eb3cSopenharmony_ci } 254023b3eb3cSopenharmony_ci if (w19.localizedContentAreaPadding !== undefined) { 254123b3eb3cSopenharmony_ci this.localizedContentAreaPadding = w19.localizedContentAreaPadding; 254223b3eb3cSopenharmony_ci } 254323b3eb3cSopenharmony_ci if (w19.contentBuilder !== undefined) { 254423b3eb3cSopenharmony_ci this.contentBuilder = w19.contentBuilder; 254523b3eb3cSopenharmony_ci } 254623b3eb3cSopenharmony_ci if (w19.buttons !== undefined) { 254723b3eb3cSopenharmony_ci this.buttons = w19.buttons; 254823b3eb3cSopenharmony_ci } 254923b3eb3cSopenharmony_ci if (w19.contentAreaPadding !== undefined) { 255023b3eb3cSopenharmony_ci this.contentAreaPadding = w19.contentAreaPadding; 255123b3eb3cSopenharmony_ci } 255223b3eb3cSopenharmony_ci if (w19.keyIndex !== undefined) { 255323b3eb3cSopenharmony_ci this.keyIndex = w19.keyIndex; 255423b3eb3cSopenharmony_ci } 255523b3eb3cSopenharmony_ci if (w19.theme !== undefined) { 255623b3eb3cSopenharmony_ci this.theme = w19.theme; 255723b3eb3cSopenharmony_ci } 255823b3eb3cSopenharmony_ci if (w19.themeColorMode !== undefined) { 255923b3eb3cSopenharmony_ci this.themeColorMode = w19.themeColorMode; 256023b3eb3cSopenharmony_ci } 256123b3eb3cSopenharmony_ci if (w19.titleHeight !== undefined) { 256223b3eb3cSopenharmony_ci this.titleHeight = w19.titleHeight; 256323b3eb3cSopenharmony_ci } 256423b3eb3cSopenharmony_ci if (w19.buttonHeight !== undefined) { 256523b3eb3cSopenharmony_ci this.buttonHeight = w19.buttonHeight; 256623b3eb3cSopenharmony_ci } 256723b3eb3cSopenharmony_ci if (w19.contentMaxHeight !== undefined) { 256823b3eb3cSopenharmony_ci this.contentMaxHeight = w19.contentMaxHeight; 256923b3eb3cSopenharmony_ci } 257023b3eb3cSopenharmony_ci if (w19.customStyle !== undefined) { 257123b3eb3cSopenharmony_ci this.customStyle = w19.customStyle; 257223b3eb3cSopenharmony_ci } 257323b3eb3cSopenharmony_ci if (w19.buttonMaxFontSize !== undefined) { 257423b3eb3cSopenharmony_ci this.buttonMaxFontSize = w19.buttonMaxFontSize; 257523b3eb3cSopenharmony_ci } 257623b3eb3cSopenharmony_ci if (w19.buttonMinFontSize !== undefined) { 257723b3eb3cSopenharmony_ci this.buttonMinFontSize = w19.buttonMinFontSize; 257823b3eb3cSopenharmony_ci } 257923b3eb3cSopenharmony_ci if (w19.primaryTitleMaxFontSize !== undefined) { 258023b3eb3cSopenharmony_ci this.primaryTitleMaxFontSize = w19.primaryTitleMaxFontSize; 258123b3eb3cSopenharmony_ci } 258223b3eb3cSopenharmony_ci if (w19.primaryTitleMinFontSize !== undefined) { 258323b3eb3cSopenharmony_ci this.primaryTitleMinFontSize = w19.primaryTitleMinFontSize; 258423b3eb3cSopenharmony_ci } 258523b3eb3cSopenharmony_ci if (w19.secondaryTitleMaxFontSize !== undefined) { 258623b3eb3cSopenharmony_ci this.secondaryTitleMaxFontSize = w19.secondaryTitleMaxFontSize; 258723b3eb3cSopenharmony_ci } 258823b3eb3cSopenharmony_ci if (w19.secondaryTitleMinFontSize !== undefined) { 258923b3eb3cSopenharmony_ci this.secondaryTitleMinFontSize = w19.secondaryTitleMinFontSize; 259023b3eb3cSopenharmony_ci } 259123b3eb3cSopenharmony_ci if (w19.primaryTitleFontColorWithTheme !== undefined) { 259223b3eb3cSopenharmony_ci this.primaryTitleFontColorWithTheme = w19.primaryTitleFontColorWithTheme; 259323b3eb3cSopenharmony_ci } 259423b3eb3cSopenharmony_ci if (w19.secondaryTitleFontColorWithTheme !== undefined) { 259523b3eb3cSopenharmony_ci this.secondaryTitleFontColorWithTheme = w19.secondaryTitleFontColorWithTheme; 259623b3eb3cSopenharmony_ci } 259723b3eb3cSopenharmony_ci if (w19.titleTextAlign !== undefined) { 259823b3eb3cSopenharmony_ci this.titleTextAlign = w19.titleTextAlign; 259923b3eb3cSopenharmony_ci } 260023b3eb3cSopenharmony_ci if (w19.isButtonVertical !== undefined) { 260123b3eb3cSopenharmony_ci this.isButtonVertical = w19.isButtonVertical; 260223b3eb3cSopenharmony_ci } 260323b3eb3cSopenharmony_ci if (w19.titleMinHeight !== undefined) { 260423b3eb3cSopenharmony_ci this.titleMinHeight = w19.titleMinHeight; 260523b3eb3cSopenharmony_ci } 260623b3eb3cSopenharmony_ci if (w19.isFollowingSystemFontScale !== undefined) { 260723b3eb3cSopenharmony_ci this.isFollowingSystemFontScale = w19.isFollowingSystemFontScale; 260823b3eb3cSopenharmony_ci } 260923b3eb3cSopenharmony_ci if (w19.appMaxFontScale !== undefined) { 261023b3eb3cSopenharmony_ci this.appMaxFontScale = w19.appMaxFontScale; 261123b3eb3cSopenharmony_ci } 261223b3eb3cSopenharmony_ci if (w19.titleIndex !== undefined) { 261323b3eb3cSopenharmony_ci this.titleIndex = w19.titleIndex; 261423b3eb3cSopenharmony_ci } 261523b3eb3cSopenharmony_ci if (w19.contentIndex !== undefined) { 261623b3eb3cSopenharmony_ci this.contentIndex = w19.contentIndex; 261723b3eb3cSopenharmony_ci } 261823b3eb3cSopenharmony_ci if (w19.buttonIndex !== undefined) { 261923b3eb3cSopenharmony_ci this.buttonIndex = w19.buttonIndex; 262023b3eb3cSopenharmony_ci } 262123b3eb3cSopenharmony_ci } 262223b3eb3cSopenharmony_ci 262323b3eb3cSopenharmony_ci updateStateVars(v19) { 262423b3eb3cSopenharmony_ci } 262523b3eb3cSopenharmony_ci 262623b3eb3cSopenharmony_ci purgeVariableDependenciesOnElmtId(u19) { 262723b3eb3cSopenharmony_ci this.__minContentHeight.purgeDependencyOnElmtId(u19); 262823b3eb3cSopenharmony_ci this.__titleHeight.purgeDependencyOnElmtId(u19); 262923b3eb3cSopenharmony_ci this.__buttonHeight.purgeDependencyOnElmtId(u19); 263023b3eb3cSopenharmony_ci this.__contentMaxHeight.purgeDependencyOnElmtId(u19); 263123b3eb3cSopenharmony_ci this.__fontSizeScale.purgeDependencyOnElmtId(u19); 263223b3eb3cSopenharmony_ci this.__customStyle.purgeDependencyOnElmtId(u19); 263323b3eb3cSopenharmony_ci this.__buttonMaxFontSize.purgeDependencyOnElmtId(u19); 263423b3eb3cSopenharmony_ci this.__buttonMinFontSize.purgeDependencyOnElmtId(u19); 263523b3eb3cSopenharmony_ci this.__primaryTitleMaxFontSize.purgeDependencyOnElmtId(u19); 263623b3eb3cSopenharmony_ci this.__primaryTitleMinFontSize.purgeDependencyOnElmtId(u19); 263723b3eb3cSopenharmony_ci this.__secondaryTitleMaxFontSize.purgeDependencyOnElmtId(u19); 263823b3eb3cSopenharmony_ci this.__secondaryTitleMinFontSize.purgeDependencyOnElmtId(u19); 263923b3eb3cSopenharmony_ci this.__primaryTitleFontColorWithTheme.purgeDependencyOnElmtId(u19); 264023b3eb3cSopenharmony_ci this.__secondaryTitleFontColorWithTheme.purgeDependencyOnElmtId(u19); 264123b3eb3cSopenharmony_ci this.__titleTextAlign.purgeDependencyOnElmtId(u19); 264223b3eb3cSopenharmony_ci this.__isButtonVertical.purgeDependencyOnElmtId(u19); 264323b3eb3cSopenharmony_ci this.__titleMinHeight.purgeDependencyOnElmtId(u19); 264423b3eb3cSopenharmony_ci } 264523b3eb3cSopenharmony_ci 264623b3eb3cSopenharmony_ci aboutToBeDeleted() { 264723b3eb3cSopenharmony_ci this.__minContentHeight.aboutToBeDeleted(); 264823b3eb3cSopenharmony_ci this.__titleHeight.aboutToBeDeleted(); 264923b3eb3cSopenharmony_ci this.__buttonHeight.aboutToBeDeleted(); 265023b3eb3cSopenharmony_ci this.__contentMaxHeight.aboutToBeDeleted(); 265123b3eb3cSopenharmony_ci this.__fontSizeScale.aboutToBeDeleted(); 265223b3eb3cSopenharmony_ci this.__customStyle.aboutToBeDeleted(); 265323b3eb3cSopenharmony_ci this.__buttonMaxFontSize.aboutToBeDeleted(); 265423b3eb3cSopenharmony_ci this.__buttonMinFontSize.aboutToBeDeleted(); 265523b3eb3cSopenharmony_ci this.__primaryTitleMaxFontSize.aboutToBeDeleted(); 265623b3eb3cSopenharmony_ci this.__primaryTitleMinFontSize.aboutToBeDeleted(); 265723b3eb3cSopenharmony_ci this.__secondaryTitleMaxFontSize.aboutToBeDeleted(); 265823b3eb3cSopenharmony_ci this.__secondaryTitleMinFontSize.aboutToBeDeleted(); 265923b3eb3cSopenharmony_ci this.__primaryTitleFontColorWithTheme.aboutToBeDeleted(); 266023b3eb3cSopenharmony_ci this.__secondaryTitleFontColorWithTheme.aboutToBeDeleted(); 266123b3eb3cSopenharmony_ci this.__titleTextAlign.aboutToBeDeleted(); 266223b3eb3cSopenharmony_ci this.__isButtonVertical.aboutToBeDeleted(); 266323b3eb3cSopenharmony_ci this.__titleMinHeight.aboutToBeDeleted(); 266423b3eb3cSopenharmony_ci SubscriberManager.Get().delete(this.id__()); 266523b3eb3cSopenharmony_ci this.aboutToBeDeletedInternal(); 266623b3eb3cSopenharmony_ci } 266723b3eb3cSopenharmony_ci 266823b3eb3cSopenharmony_ci get minContentHeight() { 266923b3eb3cSopenharmony_ci return this.__minContentHeight.get(); 267023b3eb3cSopenharmony_ci } 267123b3eb3cSopenharmony_ci 267223b3eb3cSopenharmony_ci set minContentHeight(t19) { 267323b3eb3cSopenharmony_ci this.__minContentHeight.set(t19); 267423b3eb3cSopenharmony_ci } 267523b3eb3cSopenharmony_ci 267623b3eb3cSopenharmony_ci defaultContentBuilder(s19 = null) { 267723b3eb3cSopenharmony_ci } 267823b3eb3cSopenharmony_ci 267923b3eb3cSopenharmony_ci get titleHeight() { 268023b3eb3cSopenharmony_ci return this.__titleHeight.get(); 268123b3eb3cSopenharmony_ci } 268223b3eb3cSopenharmony_ci 268323b3eb3cSopenharmony_ci set titleHeight(r19) { 268423b3eb3cSopenharmony_ci this.__titleHeight.set(r19); 268523b3eb3cSopenharmony_ci } 268623b3eb3cSopenharmony_ci 268723b3eb3cSopenharmony_ci get buttonHeight() { 268823b3eb3cSopenharmony_ci return this.__buttonHeight.get(); 268923b3eb3cSopenharmony_ci } 269023b3eb3cSopenharmony_ci 269123b3eb3cSopenharmony_ci set buttonHeight(q19) { 269223b3eb3cSopenharmony_ci this.__buttonHeight.set(q19); 269323b3eb3cSopenharmony_ci } 269423b3eb3cSopenharmony_ci 269523b3eb3cSopenharmony_ci get contentMaxHeight() { 269623b3eb3cSopenharmony_ci return this.__contentMaxHeight.get(); 269723b3eb3cSopenharmony_ci } 269823b3eb3cSopenharmony_ci 269923b3eb3cSopenharmony_ci set contentMaxHeight(p19) { 270023b3eb3cSopenharmony_ci this.__contentMaxHeight.set(p19); 270123b3eb3cSopenharmony_ci } 270223b3eb3cSopenharmony_ci 270323b3eb3cSopenharmony_ci get fontSizeScale() { 270423b3eb3cSopenharmony_ci return this.__fontSizeScale.get(); 270523b3eb3cSopenharmony_ci } 270623b3eb3cSopenharmony_ci 270723b3eb3cSopenharmony_ci set fontSizeScale(o19) { 270823b3eb3cSopenharmony_ci this.__fontSizeScale.set(o19); 270923b3eb3cSopenharmony_ci } 271023b3eb3cSopenharmony_ci 271123b3eb3cSopenharmony_ci get customStyle() { 271223b3eb3cSopenharmony_ci return this.__customStyle.get(); 271323b3eb3cSopenharmony_ci } 271423b3eb3cSopenharmony_ci 271523b3eb3cSopenharmony_ci set customStyle(n19) { 271623b3eb3cSopenharmony_ci this.__customStyle.set(n19); 271723b3eb3cSopenharmony_ci } 271823b3eb3cSopenharmony_ci 271923b3eb3cSopenharmony_ci get buttonMaxFontSize() { 272023b3eb3cSopenharmony_ci return this.__buttonMaxFontSize.get(); 272123b3eb3cSopenharmony_ci } 272223b3eb3cSopenharmony_ci 272323b3eb3cSopenharmony_ci set buttonMaxFontSize(m19) { 272423b3eb3cSopenharmony_ci this.__buttonMaxFontSize.set(m19); 272523b3eb3cSopenharmony_ci } 272623b3eb3cSopenharmony_ci 272723b3eb3cSopenharmony_ci get buttonMinFontSize() { 272823b3eb3cSopenharmony_ci return this.__buttonMinFontSize.get(); 272923b3eb3cSopenharmony_ci } 273023b3eb3cSopenharmony_ci 273123b3eb3cSopenharmony_ci set buttonMinFontSize(l19) { 273223b3eb3cSopenharmony_ci this.__buttonMinFontSize.set(l19); 273323b3eb3cSopenharmony_ci } 273423b3eb3cSopenharmony_ci 273523b3eb3cSopenharmony_ci get primaryTitleMaxFontSize() { 273623b3eb3cSopenharmony_ci return this.__primaryTitleMaxFontSize.get(); 273723b3eb3cSopenharmony_ci } 273823b3eb3cSopenharmony_ci 273923b3eb3cSopenharmony_ci set primaryTitleMaxFontSize(k19) { 274023b3eb3cSopenharmony_ci this.__primaryTitleMaxFontSize.set(k19); 274123b3eb3cSopenharmony_ci } 274223b3eb3cSopenharmony_ci 274323b3eb3cSopenharmony_ci get primaryTitleMinFontSize() { 274423b3eb3cSopenharmony_ci return this.__primaryTitleMinFontSize.get(); 274523b3eb3cSopenharmony_ci } 274623b3eb3cSopenharmony_ci 274723b3eb3cSopenharmony_ci set primaryTitleMinFontSize(j19) { 274823b3eb3cSopenharmony_ci this.__primaryTitleMinFontSize.set(j19); 274923b3eb3cSopenharmony_ci } 275023b3eb3cSopenharmony_ci 275123b3eb3cSopenharmony_ci get secondaryTitleMaxFontSize() { 275223b3eb3cSopenharmony_ci return this.__secondaryTitleMaxFontSize.get(); 275323b3eb3cSopenharmony_ci } 275423b3eb3cSopenharmony_ci 275523b3eb3cSopenharmony_ci set secondaryTitleMaxFontSize(i19) { 275623b3eb3cSopenharmony_ci this.__secondaryTitleMaxFontSize.set(i19); 275723b3eb3cSopenharmony_ci } 275823b3eb3cSopenharmony_ci 275923b3eb3cSopenharmony_ci get secondaryTitleMinFontSize() { 276023b3eb3cSopenharmony_ci return this.__secondaryTitleMinFontSize.get(); 276123b3eb3cSopenharmony_ci } 276223b3eb3cSopenharmony_ci 276323b3eb3cSopenharmony_ci set secondaryTitleMinFontSize(h19) { 276423b3eb3cSopenharmony_ci this.__secondaryTitleMinFontSize.set(h19); 276523b3eb3cSopenharmony_ci } 276623b3eb3cSopenharmony_ci 276723b3eb3cSopenharmony_ci get primaryTitleFontColorWithTheme() { 276823b3eb3cSopenharmony_ci return this.__primaryTitleFontColorWithTheme.get(); 276923b3eb3cSopenharmony_ci } 277023b3eb3cSopenharmony_ci 277123b3eb3cSopenharmony_ci set primaryTitleFontColorWithTheme(g19) { 277223b3eb3cSopenharmony_ci this.__primaryTitleFontColorWithTheme.set(g19); 277323b3eb3cSopenharmony_ci } 277423b3eb3cSopenharmony_ci 277523b3eb3cSopenharmony_ci get secondaryTitleFontColorWithTheme() { 277623b3eb3cSopenharmony_ci return this.__secondaryTitleFontColorWithTheme.get(); 277723b3eb3cSopenharmony_ci } 277823b3eb3cSopenharmony_ci 277923b3eb3cSopenharmony_ci set secondaryTitleFontColorWithTheme(f19) { 278023b3eb3cSopenharmony_ci this.__secondaryTitleFontColorWithTheme.set(f19); 278123b3eb3cSopenharmony_ci } 278223b3eb3cSopenharmony_ci 278323b3eb3cSopenharmony_ci get titleTextAlign() { 278423b3eb3cSopenharmony_ci return this.__titleTextAlign.get(); 278523b3eb3cSopenharmony_ci } 278623b3eb3cSopenharmony_ci 278723b3eb3cSopenharmony_ci set titleTextAlign(e19) { 278823b3eb3cSopenharmony_ci this.__titleTextAlign.set(e19); 278923b3eb3cSopenharmony_ci } 279023b3eb3cSopenharmony_ci 279123b3eb3cSopenharmony_ci get isButtonVertical() { 279223b3eb3cSopenharmony_ci return this.__isButtonVertical.get(); 279323b3eb3cSopenharmony_ci } 279423b3eb3cSopenharmony_ci 279523b3eb3cSopenharmony_ci set isButtonVertical(d19) { 279623b3eb3cSopenharmony_ci this.__isButtonVertical.set(d19); 279723b3eb3cSopenharmony_ci } 279823b3eb3cSopenharmony_ci 279923b3eb3cSopenharmony_ci get titleMinHeight() { 280023b3eb3cSopenharmony_ci return this.__titleMinHeight.get(); 280123b3eb3cSopenharmony_ci } 280223b3eb3cSopenharmony_ci 280323b3eb3cSopenharmony_ci set titleMinHeight(c19) { 280423b3eb3cSopenharmony_ci this.__titleMinHeight.set(c19); 280523b3eb3cSopenharmony_ci } 280623b3eb3cSopenharmony_ci initialRender() { 280723b3eb3cSopenharmony_ci this.observeComponentCreation2((a19, b19) => { 280823b3eb3cSopenharmony_ci WithTheme.create({ theme: this.theme, colorMode: this.themeColorMode }); 280923b3eb3cSopenharmony_ci }, WithTheme); 281023b3eb3cSopenharmony_ci this.observeComponentCreation2((y18, z18) => { 281123b3eb3cSopenharmony_ci Scroll.create(); 281223b3eb3cSopenharmony_ci Scroll.backgroundColor(this.themeColorMode === ThemeColorMode.SYSTEM || undefined ? 281323b3eb3cSopenharmony_ci Color.Transparent : { 281423b3eb3cSopenharmony_ci 'id': -1, 281523b3eb3cSopenharmony_ci 'type': 10001, 281623b3eb3cSopenharmony_ci params: ['sys.color.comp_background_primary'], 281723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 281823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 281923b3eb3cSopenharmony_ci }); 282023b3eb3cSopenharmony_ci }, Scroll); 282123b3eb3cSopenharmony_ci this.observeComponentCreation2((w18, x18) => { 282223b3eb3cSopenharmony_ci Column.create(); 282323b3eb3cSopenharmony_ci Column.constraintSize({ maxHeight: this.contentMaxHeight }); 282423b3eb3cSopenharmony_ci Column.backgroundBlurStyle(this.customStyle ? BlurStyle.Thick : BlurStyle.NONE); 282523b3eb3cSopenharmony_ci Column.borderRadius(this.customStyle ? { 282623b3eb3cSopenharmony_ci 'id': -1, 282723b3eb3cSopenharmony_ci 'type': 10002, 282823b3eb3cSopenharmony_ci params: ['sys.float.ohos_id_corner_radius_dialog'], 282923b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 283023b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 283123b3eb3cSopenharmony_ci } : 0); 283223b3eb3cSopenharmony_ci Column.margin(this.customStyle ? { 283323b3eb3cSopenharmony_ci start: LengthMetrics.resource({ 283423b3eb3cSopenharmony_ci 'id': -1, 283523b3eb3cSopenharmony_ci 'type': 10002, 283623b3eb3cSopenharmony_ci params: ['sys.float.ohos_id_dialog_margin_start'], 283723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 283823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 283923b3eb3cSopenharmony_ci }), 284023b3eb3cSopenharmony_ci end: LengthMetrics.resource({ 284123b3eb3cSopenharmony_ci 'id': -1, 284223b3eb3cSopenharmony_ci 'type': 10002, 284323b3eb3cSopenharmony_ci params: ['sys.float.ohos_id_dialog_margin_end'], 284423b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 284523b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 284623b3eb3cSopenharmony_ci }), 284723b3eb3cSopenharmony_ci bottom: LengthMetrics.resource({ 284823b3eb3cSopenharmony_ci 'id': -1, 284923b3eb3cSopenharmony_ci 'type': 10002, 285023b3eb3cSopenharmony_ci params: ['sys.float.ohos_id_dialog_margin_bottom'], 285123b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 285223b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 285323b3eb3cSopenharmony_ci }), 285423b3eb3cSopenharmony_ci } : { left: 0, right: 0, bottom: 0 }); 285523b3eb3cSopenharmony_ci Column.backgroundColor(this.customStyle ? { 285623b3eb3cSopenharmony_ci 'id': -1, 285723b3eb3cSopenharmony_ci 'type': 10001, 285823b3eb3cSopenharmony_ci params: ['sys.color.ohos_id_color_dialog_bg'], 285923b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 286023b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 286123b3eb3cSopenharmony_ci } : Color.Transparent); 286223b3eb3cSopenharmony_ci }, Column); 286323b3eb3cSopenharmony_ci { 286423b3eb3cSopenharmony_ci this.observeComponentCreation2((o17, p17) => { 286523b3eb3cSopenharmony_ci if (p17) { 286623b3eb3cSopenharmony_ci let q17 = new CustomDialogLayout(this, { 286723b3eb3cSopenharmony_ci buttonHeight: this.__buttonHeight, 286823b3eb3cSopenharmony_ci titleHeight: this.__titleHeight, 286923b3eb3cSopenharmony_ci titleMinHeight: this.__titleMinHeight, 287023b3eb3cSopenharmony_ci dialogBuilder: () => { 287123b3eb3cSopenharmony_ci this.observeComponentCreation2((h18, i18) => { 287223b3eb3cSopenharmony_ci ForEach.create(); 287323b3eb3cSopenharmony_ci const e = k18 => { 287423b3eb3cSopenharmony_ci const l18 = k18; 287523b3eb3cSopenharmony_ci this.observeComponentCreation2((m18, n18) => { 287623b3eb3cSopenharmony_ci If.create(); 287723b3eb3cSopenharmony_ci if (l18 === this.titleIndex) { 287823b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 287923b3eb3cSopenharmony_ci this.observeComponentCreation2((u18, v18) => { 288023b3eb3cSopenharmony_ci WithTheme.create({ 288123b3eb3cSopenharmony_ci theme: this.theme, 288223b3eb3cSopenharmony_ci colorMode: this.themeColorMode 288323b3eb3cSopenharmony_ci }); 288423b3eb3cSopenharmony_ci }, WithTheme); 288523b3eb3cSopenharmony_ci this.titleBuilder.bind(this)(); 288623b3eb3cSopenharmony_ci WithTheme.pop(); 288723b3eb3cSopenharmony_ci }); 288823b3eb3cSopenharmony_ci } else if (l18 === this.contentIndex) { 288923b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 289023b3eb3cSopenharmony_ci this.observeComponentCreation2((s18, t18) => { 289123b3eb3cSopenharmony_ci Column.create(); 289223b3eb3cSopenharmony_ci Column.padding(this.getContentPadding()); 289323b3eb3cSopenharmony_ci }, Column); 289423b3eb3cSopenharmony_ci this.observeComponentCreation2((q18, r18) => { 289523b3eb3cSopenharmony_ci WithTheme.create({ 289623b3eb3cSopenharmony_ci theme: this.theme, 289723b3eb3cSopenharmony_ci colorMode: this.themeColorMode 289823b3eb3cSopenharmony_ci }); 289923b3eb3cSopenharmony_ci }, WithTheme); 290023b3eb3cSopenharmony_ci this.contentBuilder.bind(this)(); 290123b3eb3cSopenharmony_ci WithTheme.pop(); 290223b3eb3cSopenharmony_ci Column.pop(); 290323b3eb3cSopenharmony_ci }); 290423b3eb3cSopenharmony_ci } else { 290523b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(2, () => { 290623b3eb3cSopenharmony_ci this.observeComponentCreation2((o18, p18) => { 290723b3eb3cSopenharmony_ci WithTheme.create({ 290823b3eb3cSopenharmony_ci theme: this.theme, 290923b3eb3cSopenharmony_ci colorMode: this.themeColorMode 291023b3eb3cSopenharmony_ci }); 291123b3eb3cSopenharmony_ci }, WithTheme); 291223b3eb3cSopenharmony_ci this.ButtonBuilder.bind(this)(); 291323b3eb3cSopenharmony_ci WithTheme.pop(); 291423b3eb3cSopenharmony_ci }); 291523b3eb3cSopenharmony_ci } 291623b3eb3cSopenharmony_ci }, If); 291723b3eb3cSopenharmony_ci If.pop(); 291823b3eb3cSopenharmony_ci }; 291923b3eb3cSopenharmony_ci this.forEachUpdateFunction(h18, [this.titleIndex, this.contentIndex, 292023b3eb3cSopenharmony_ci this.buttonIndex], e); 292123b3eb3cSopenharmony_ci }, ForEach); 292223b3eb3cSopenharmony_ci ForEach.pop(); 292323b3eb3cSopenharmony_ci } 292423b3eb3cSopenharmony_ci }, undefined, o17, () => { 292523b3eb3cSopenharmony_ci }, { page: 'library/src/main/ets/components/MainPage.ets', line: 1041, col: 11 }); 292623b3eb3cSopenharmony_ci ViewPU.create(q17); 292723b3eb3cSopenharmony_ci let c = () => { 292823b3eb3cSopenharmony_ci return { 292923b3eb3cSopenharmony_ci buttonHeight: this.buttonHeight, 293023b3eb3cSopenharmony_ci titleHeight: this.titleHeight, 293123b3eb3cSopenharmony_ci titleMinHeight: this.titleMinHeight, 293223b3eb3cSopenharmony_ci dialogBuilder: () => { 293323b3eb3cSopenharmony_ci this.observeComponentCreation2((s17, t17) => { 293423b3eb3cSopenharmony_ci ForEach.create(); 293523b3eb3cSopenharmony_ci const d = v17 => { 293623b3eb3cSopenharmony_ci const w17 = v17; 293723b3eb3cSopenharmony_ci this.observeComponentCreation2((x17, y17) => { 293823b3eb3cSopenharmony_ci If.create(); 293923b3eb3cSopenharmony_ci if (w17 === this.titleIndex) { 294023b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 294123b3eb3cSopenharmony_ci this.observeComponentCreation2((f18, g18) => { 294223b3eb3cSopenharmony_ci WithTheme.create({ 294323b3eb3cSopenharmony_ci theme: this.theme, 294423b3eb3cSopenharmony_ci colorMode: this.themeColorMode 294523b3eb3cSopenharmony_ci }); 294623b3eb3cSopenharmony_ci }, WithTheme); 294723b3eb3cSopenharmony_ci this.titleBuilder.bind(this)(); 294823b3eb3cSopenharmony_ci WithTheme.pop(); 294923b3eb3cSopenharmony_ci }); 295023b3eb3cSopenharmony_ci } else if (w17 === this.contentIndex) { 295123b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 295223b3eb3cSopenharmony_ci this.observeComponentCreation2((d18, e18) => { 295323b3eb3cSopenharmony_ci Column.create(); 295423b3eb3cSopenharmony_ci Column.padding(this.getContentPadding()); 295523b3eb3cSopenharmony_ci }, Column); 295623b3eb3cSopenharmony_ci this.observeComponentCreation2((b18, c18) => { 295723b3eb3cSopenharmony_ci WithTheme.create({ 295823b3eb3cSopenharmony_ci theme: this.theme, 295923b3eb3cSopenharmony_ci colorMode: this.themeColorMode 296023b3eb3cSopenharmony_ci }); 296123b3eb3cSopenharmony_ci }, WithTheme); 296223b3eb3cSopenharmony_ci this.contentBuilder.bind(this)(); 296323b3eb3cSopenharmony_ci WithTheme.pop(); 296423b3eb3cSopenharmony_ci Column.pop(); 296523b3eb3cSopenharmony_ci }); 296623b3eb3cSopenharmony_ci } else { 296723b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(2, () => { 296823b3eb3cSopenharmony_ci this.observeComponentCreation2((z17, a18) => { 296923b3eb3cSopenharmony_ci WithTheme.create({ 297023b3eb3cSopenharmony_ci theme: this.theme, 297123b3eb3cSopenharmony_ci colorMode: this.themeColorMode 297223b3eb3cSopenharmony_ci }); 297323b3eb3cSopenharmony_ci }, WithTheme); 297423b3eb3cSopenharmony_ci this.ButtonBuilder.bind(this)(); 297523b3eb3cSopenharmony_ci WithTheme.pop(); 297623b3eb3cSopenharmony_ci }); 297723b3eb3cSopenharmony_ci } 297823b3eb3cSopenharmony_ci }, If); 297923b3eb3cSopenharmony_ci If.pop(); 298023b3eb3cSopenharmony_ci }; 298123b3eb3cSopenharmony_ci this.forEachUpdateFunction(s17, [this.titleIndex, this.contentIndex, 298223b3eb3cSopenharmony_ci this.buttonIndex], d); 298323b3eb3cSopenharmony_ci }, ForEach); 298423b3eb3cSopenharmony_ci ForEach.pop(); 298523b3eb3cSopenharmony_ci } 298623b3eb3cSopenharmony_ci }; 298723b3eb3cSopenharmony_ci }; 298823b3eb3cSopenharmony_ci q17.paramsGenerator_ = c; 298923b3eb3cSopenharmony_ci } else { 299023b3eb3cSopenharmony_ci this.updateStateVarsOfChildByElmtId(o17, {}); 299123b3eb3cSopenharmony_ci } 299223b3eb3cSopenharmony_ci }, { name: 'CustomDialogLayout' }); 299323b3eb3cSopenharmony_ci } 299423b3eb3cSopenharmony_ci Column.pop(); 299523b3eb3cSopenharmony_ci Scroll.pop(); 299623b3eb3cSopenharmony_ci WithTheme.pop(); 299723b3eb3cSopenharmony_ci } 299823b3eb3cSopenharmony_ci 299923b3eb3cSopenharmony_ci onMeasureSize(f17, g17, h17) { 300023b3eb3cSopenharmony_ci let i17 = { width: f17.width, height: f17.height }; 300123b3eb3cSopenharmony_ci let j17 = Number(h17.maxWidth); 300223b3eb3cSopenharmony_ci let k17 = Number(h17.maxHeight); 300323b3eb3cSopenharmony_ci this.fontSizeScale = this.updateFontScale(); 300423b3eb3cSopenharmony_ci this.updateFontSize(); 300523b3eb3cSopenharmony_ci this.isButtonVertical = this.isVerticalAlignButton(j17 - BUTTON_HORIZONTAL_MARGIN * 2); 300623b3eb3cSopenharmony_ci this.titleMinHeight = this.getTitleAreaMinHeight(); 300723b3eb3cSopenharmony_ci let l17 = 0; 300823b3eb3cSopenharmony_ci g17.forEach((m17) => { 300923b3eb3cSopenharmony_ci this.contentMaxHeight = '100%'; 301023b3eb3cSopenharmony_ci let n17 = m17.measure(h17); 301123b3eb3cSopenharmony_ci if (k17 - this.buttonHeight - this.titleHeight < this.minContentHeight) { 301223b3eb3cSopenharmony_ci this.contentMaxHeight = MAX_CONTENT_HEIGHT; 301323b3eb3cSopenharmony_ci n17 = m17.measure(h17); 301423b3eb3cSopenharmony_ci } 301523b3eb3cSopenharmony_ci l17 += n17.height; 301623b3eb3cSopenharmony_ci }); 301723b3eb3cSopenharmony_ci i17.height = l17; 301823b3eb3cSopenharmony_ci i17.width = j17; 301923b3eb3cSopenharmony_ci return i17; 302023b3eb3cSopenharmony_ci } 302123b3eb3cSopenharmony_ci 302223b3eb3cSopenharmony_ci aboutToAppear() { 302323b3eb3cSopenharmony_ci let d17 = this.getUIContext(); 302423b3eb3cSopenharmony_ci this.isFollowingSystemFontScale = d17.isFollowingSystemFontScale(); 302523b3eb3cSopenharmony_ci this.appMaxFontScale = d17.getMaxFontScale(); 302623b3eb3cSopenharmony_ci this.fontSizeScale = this.updateFontScale(); 302723b3eb3cSopenharmony_ci if (this.controller && this.customStyle === undefined) { 302823b3eb3cSopenharmony_ci let e17 = this.controller; 302923b3eb3cSopenharmony_ci if (e17.arg_ && e17.arg_.customStyle && e17.arg_.customStyle === true) { 303023b3eb3cSopenharmony_ci this.customStyle = true; 303123b3eb3cSopenharmony_ci } 303223b3eb3cSopenharmony_ci } 303323b3eb3cSopenharmony_ci if (this.customStyle === undefined) { 303423b3eb3cSopenharmony_ci this.customStyle = false; 303523b3eb3cSopenharmony_ci } 303623b3eb3cSopenharmony_ci this.primaryTitleFontColorWithTheme = this.theme?.colors?.fontPrimary ? 303723b3eb3cSopenharmony_ci this.theme.colors.fontPrimary : { 303823b3eb3cSopenharmony_ci 'id': -1, 303923b3eb3cSopenharmony_ci 'type': 10001, 304023b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 304123b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 304223b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 304323b3eb3cSopenharmony_ci }; 304423b3eb3cSopenharmony_ci this.secondaryTitleFontColorWithTheme = this.theme?.colors?.fontSecondary ? 304523b3eb3cSopenharmony_ci this.theme.colors.fontSecondary : { 304623b3eb3cSopenharmony_ci 'id': -1, 304723b3eb3cSopenharmony_ci 'type': 10001, 304823b3eb3cSopenharmony_ci params: ['sys.color.font_secondary'], 304923b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 305023b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 305123b3eb3cSopenharmony_ci }; 305223b3eb3cSopenharmony_ci this.initTitleTextAlign(); 305323b3eb3cSopenharmony_ci } 305423b3eb3cSopenharmony_ci 305523b3eb3cSopenharmony_ci updateFontSize() { 305623b3eb3cSopenharmony_ci if (this.fontSizeScale > MAX_FONT_SCALE) { 305723b3eb3cSopenharmony_ci this.buttonMaxFontSize = BODY_L * MAX_FONT_SCALE + 'vp'; 305823b3eb3cSopenharmony_ci this.buttonMinFontSize = BUTTON_MIN_FONT_SIZE * MAX_FONT_SCALE + 'vp'; 305923b3eb3cSopenharmony_ci } else { 306023b3eb3cSopenharmony_ci this.buttonMaxFontSize = BODY_L + 'fp'; 306123b3eb3cSopenharmony_ci this.buttonMinFontSize = BUTTON_MIN_FONT_SIZE + 'fp'; 306223b3eb3cSopenharmony_ci } 306323b3eb3cSopenharmony_ci } 306423b3eb3cSopenharmony_ci 306523b3eb3cSopenharmony_ci updateFontScale() { 306623b3eb3cSopenharmony_ci try { 306723b3eb3cSopenharmony_ci let b17 = this.getUIContext(); 306823b3eb3cSopenharmony_ci let c17 = b17.getHostContext()?.config.fontSizeScale ?? 1; 306923b3eb3cSopenharmony_ci if (!this.isFollowingSystemFontScale) { 307023b3eb3cSopenharmony_ci return 1; 307123b3eb3cSopenharmony_ci } 307223b3eb3cSopenharmony_ci return Math.min(c17, this.appMaxFontScale); 307323b3eb3cSopenharmony_ci } catch (y16) { 307423b3eb3cSopenharmony_ci let z16 = y16.code; 307523b3eb3cSopenharmony_ci let a17 = y16.message; 307623b3eb3cSopenharmony_ci hilog.error(0x3900, 'Ace', `Faild to init fontsizescale info,cause, code: ${z16}, message: ${a17}`); 307723b3eb3cSopenharmony_ci return 1; 307823b3eb3cSopenharmony_ci } 307923b3eb3cSopenharmony_ci } 308023b3eb3cSopenharmony_ci getContentPadding() { 308123b3eb3cSopenharmony_ci if (this.localizedContentAreaPadding) { 308223b3eb3cSopenharmony_ci return this.localizedContentAreaPadding; 308323b3eb3cSopenharmony_ci } 308423b3eb3cSopenharmony_ci if (this.contentAreaPadding) { 308523b3eb3cSopenharmony_ci return this.contentAreaPadding; 308623b3eb3cSopenharmony_ci } 308723b3eb3cSopenharmony_ci if ((this.primaryTitle || this.secondaryTitle) && this.buttons && this.buttons.length > 0) { 308823b3eb3cSopenharmony_ci return { 308923b3eb3cSopenharmony_ci top: 0, 309023b3eb3cSopenharmony_ci right: { 309123b3eb3cSopenharmony_ci 'id': -1, 309223b3eb3cSopenharmony_ci 'type': 10002, 309323b3eb3cSopenharmony_ci params: ['sys.float.alert_content_default_padding'], 309423b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 309523b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 309623b3eb3cSopenharmony_ci }, 309723b3eb3cSopenharmony_ci bottom: 0, 309823b3eb3cSopenharmony_ci left: { 309923b3eb3cSopenharmony_ci 'id': -1, 310023b3eb3cSopenharmony_ci 'type': 10002, 310123b3eb3cSopenharmony_ci params: ['sys.float.alert_content_default_padding'], 310223b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 310323b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 310423b3eb3cSopenharmony_ci }, 310523b3eb3cSopenharmony_ci }; 310623b3eb3cSopenharmony_ci } else if (this.primaryTitle || this.secondaryTitle) { 310723b3eb3cSopenharmony_ci return { 310823b3eb3cSopenharmony_ci top: 0, 310923b3eb3cSopenharmony_ci right: { 311023b3eb3cSopenharmony_ci 'id': -1, 311123b3eb3cSopenharmony_ci 'type': 10002, 311223b3eb3cSopenharmony_ci params: ['sys.float.alert_content_default_padding'], 311323b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 311423b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 311523b3eb3cSopenharmony_ci }, 311623b3eb3cSopenharmony_ci bottom: { 311723b3eb3cSopenharmony_ci 'id': -1, 311823b3eb3cSopenharmony_ci 'type': 10002, 311923b3eb3cSopenharmony_ci params: ['sys.float.alert_content_default_padding'], 312023b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 312123b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 312223b3eb3cSopenharmony_ci }, 312323b3eb3cSopenharmony_ci left: { 312423b3eb3cSopenharmony_ci 'id': -1, 312523b3eb3cSopenharmony_ci 'type': 10002, 312623b3eb3cSopenharmony_ci params: ['sys.float.alert_content_default_padding'], 312723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 312823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 312923b3eb3cSopenharmony_ci }, 313023b3eb3cSopenharmony_ci }; 313123b3eb3cSopenharmony_ci } else if (this.buttons && this.buttons.length > 0) { 313223b3eb3cSopenharmony_ci return { 313323b3eb3cSopenharmony_ci top: { 313423b3eb3cSopenharmony_ci 'id': -1, 313523b3eb3cSopenharmony_ci 'type': 10002, 313623b3eb3cSopenharmony_ci params: ['sys.float.alert_content_default_padding'], 313723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 313823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 313923b3eb3cSopenharmony_ci }, 314023b3eb3cSopenharmony_ci right: { 314123b3eb3cSopenharmony_ci 'id': -1, 314223b3eb3cSopenharmony_ci 'type': 10002, 314323b3eb3cSopenharmony_ci params: ['sys.float.alert_content_default_padding'], 314423b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 314523b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 314623b3eb3cSopenharmony_ci }, 314723b3eb3cSopenharmony_ci bottom: 0, 314823b3eb3cSopenharmony_ci left: { 314923b3eb3cSopenharmony_ci 'id': -1, 315023b3eb3cSopenharmony_ci 'type': 10002, 315123b3eb3cSopenharmony_ci params: ['sys.float.alert_content_default_padding'], 315223b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 315323b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 315423b3eb3cSopenharmony_ci }, 315523b3eb3cSopenharmony_ci }; 315623b3eb3cSopenharmony_ci } else { 315723b3eb3cSopenharmony_ci return { 315823b3eb3cSopenharmony_ci top: { 315923b3eb3cSopenharmony_ci 'id': -1, 316023b3eb3cSopenharmony_ci 'type': 10002, 316123b3eb3cSopenharmony_ci params: ['sys.float.alert_content_default_padding'], 316223b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 316323b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 316423b3eb3cSopenharmony_ci }, 316523b3eb3cSopenharmony_ci right: { 316623b3eb3cSopenharmony_ci 'id': -1, 316723b3eb3cSopenharmony_ci 'type': 10002, 316823b3eb3cSopenharmony_ci params: ['sys.float.alert_content_default_padding'], 316923b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 317023b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 317123b3eb3cSopenharmony_ci }, 317223b3eb3cSopenharmony_ci bottom: { 317323b3eb3cSopenharmony_ci 'id': -1, 317423b3eb3cSopenharmony_ci 'type': 10002, 317523b3eb3cSopenharmony_ci params: ['sys.float.alert_content_default_padding'], 317623b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 317723b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 317823b3eb3cSopenharmony_ci }, 317923b3eb3cSopenharmony_ci left: { 318023b3eb3cSopenharmony_ci 'id': -1, 318123b3eb3cSopenharmony_ci 'type': 10002, 318223b3eb3cSopenharmony_ci params: ['sys.float.alert_content_default_padding'], 318323b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 318423b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 318523b3eb3cSopenharmony_ci }, 318623b3eb3cSopenharmony_ci }; 318723b3eb3cSopenharmony_ci } 318823b3eb3cSopenharmony_ci } 318923b3eb3cSopenharmony_ci 319023b3eb3cSopenharmony_ci titleBuilder(j16 = null) { 319123b3eb3cSopenharmony_ci this.observeComponentCreation2((w16, x16) => { 319223b3eb3cSopenharmony_ci Column.create(); 319323b3eb3cSopenharmony_ci Column.justifyContent(FlexAlign.Center); 319423b3eb3cSopenharmony_ci Column.width('100%'); 319523b3eb3cSopenharmony_ci Column.padding(this.getTitleAreaPadding()); 319623b3eb3cSopenharmony_ci }, Column); 319723b3eb3cSopenharmony_ci this.observeComponentCreation2((u16, v16) => { 319823b3eb3cSopenharmony_ci Row.create(); 319923b3eb3cSopenharmony_ci Row.width('100%'); 320023b3eb3cSopenharmony_ci }, Row); 320123b3eb3cSopenharmony_ci this.observeComponentCreation2((s16, t16) => { 320223b3eb3cSopenharmony_ci Text.create(this.primaryTitle); 320323b3eb3cSopenharmony_ci Text.fontWeight(FontWeight.Bold); 320423b3eb3cSopenharmony_ci Text.fontColor(ObservedObject.GetRawObject(this.primaryTitleFontColorWithTheme)); 320523b3eb3cSopenharmony_ci Text.textAlign(this.titleTextAlign); 320623b3eb3cSopenharmony_ci Text.maxFontSize(ObservedObject.GetRawObject(this.primaryTitleMaxFontSize)); 320723b3eb3cSopenharmony_ci Text.minFontSize(ObservedObject.GetRawObject(this.primaryTitleMinFontSize)); 320823b3eb3cSopenharmony_ci Text.maxFontScale(Math.min(this.appMaxFontScale, MAX_FONT_SCALE)); 320923b3eb3cSopenharmony_ci Text.maxLines(TITLE_MAX_LINES); 321023b3eb3cSopenharmony_ci Text.heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST); 321123b3eb3cSopenharmony_ci Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 321223b3eb3cSopenharmony_ci Text.width('100%'); 321323b3eb3cSopenharmony_ci }, Text); 321423b3eb3cSopenharmony_ci Text.pop(); 321523b3eb3cSopenharmony_ci Row.pop(); 321623b3eb3cSopenharmony_ci this.observeComponentCreation2((o16, p16) => { 321723b3eb3cSopenharmony_ci If.create(); 321823b3eb3cSopenharmony_ci if (this.primaryTitle && this.secondaryTitle) { 321923b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 322023b3eb3cSopenharmony_ci this.observeComponentCreation2((q16, r16) => { 322123b3eb3cSopenharmony_ci Row.create(); 322223b3eb3cSopenharmony_ci Row.height({ 322323b3eb3cSopenharmony_ci 'id': -1, 322423b3eb3cSopenharmony_ci 'type': 10002, 322523b3eb3cSopenharmony_ci params: ['sys.float.padding_level1'], 322623b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 322723b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 322823b3eb3cSopenharmony_ci }); 322923b3eb3cSopenharmony_ci }, Row); 323023b3eb3cSopenharmony_ci Row.pop(); 323123b3eb3cSopenharmony_ci }); 323223b3eb3cSopenharmony_ci } else { 323323b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 323423b3eb3cSopenharmony_ci }); 323523b3eb3cSopenharmony_ci } 323623b3eb3cSopenharmony_ci }, If); 323723b3eb3cSopenharmony_ci If.pop(); 323823b3eb3cSopenharmony_ci this.observeComponentCreation2((m16, n16) => { 323923b3eb3cSopenharmony_ci Row.create(); 324023b3eb3cSopenharmony_ci Row.width('100%'); 324123b3eb3cSopenharmony_ci }, Row); 324223b3eb3cSopenharmony_ci this.observeComponentCreation2((k16, l16) => { 324323b3eb3cSopenharmony_ci Text.create(this.secondaryTitle); 324423b3eb3cSopenharmony_ci Text.fontWeight(FontWeight.Regular); 324523b3eb3cSopenharmony_ci Text.fontColor(ObservedObject.GetRawObject(this.secondaryTitleFontColorWithTheme)); 324623b3eb3cSopenharmony_ci Text.textAlign(this.titleTextAlign); 324723b3eb3cSopenharmony_ci Text.maxFontSize(ObservedObject.GetRawObject(this.secondaryTitleMaxFontSize)); 324823b3eb3cSopenharmony_ci Text.minFontSize(ObservedObject.GetRawObject(this.secondaryTitleMinFontSize)); 324923b3eb3cSopenharmony_ci Text.maxFontScale(Math.min(this.appMaxFontScale, MAX_FONT_SCALE)); 325023b3eb3cSopenharmony_ci Text.maxLines(TITLE_MAX_LINES); 325123b3eb3cSopenharmony_ci Text.heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST); 325223b3eb3cSopenharmony_ci Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 325323b3eb3cSopenharmony_ci Text.width('100%'); 325423b3eb3cSopenharmony_ci }, Text); 325523b3eb3cSopenharmony_ci Text.pop(); 325623b3eb3cSopenharmony_ci Row.pop(); 325723b3eb3cSopenharmony_ci Column.pop(); 325823b3eb3cSopenharmony_ci } 325923b3eb3cSopenharmony_ci 326023b3eb3cSopenharmony_ci getTitleAreaPadding() { 326123b3eb3cSopenharmony_ci if (this.primaryTitle || this.secondaryTitle) { 326223b3eb3cSopenharmony_ci return { 326323b3eb3cSopenharmony_ci top: { 326423b3eb3cSopenharmony_ci 'id': -1, 326523b3eb3cSopenharmony_ci 'type': 10002, 326623b3eb3cSopenharmony_ci params: ['sys.float.alert_title_padding_top'], 326723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 326823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 326923b3eb3cSopenharmony_ci }, 327023b3eb3cSopenharmony_ci right: { 327123b3eb3cSopenharmony_ci 'id': -1, 327223b3eb3cSopenharmony_ci 'type': 10002, 327323b3eb3cSopenharmony_ci params: ['sys.float.alert_title_padding_right'], 327423b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 327523b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 327623b3eb3cSopenharmony_ci }, 327723b3eb3cSopenharmony_ci left: { 327823b3eb3cSopenharmony_ci 'id': -1, 327923b3eb3cSopenharmony_ci 'type': 10002, 328023b3eb3cSopenharmony_ci params: ['sys.float.alert_title_padding_left'], 328123b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 328223b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 328323b3eb3cSopenharmony_ci }, 328423b3eb3cSopenharmony_ci bottom: { 328523b3eb3cSopenharmony_ci 'id': -1, 328623b3eb3cSopenharmony_ci 'type': 10002, 328723b3eb3cSopenharmony_ci params: ['sys.float.alert_title_padding_bottom'], 328823b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 328923b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 329023b3eb3cSopenharmony_ci }, 329123b3eb3cSopenharmony_ci }; 329223b3eb3cSopenharmony_ci } 329323b3eb3cSopenharmony_ci return { 329423b3eb3cSopenharmony_ci top: 0, 329523b3eb3cSopenharmony_ci right: { 329623b3eb3cSopenharmony_ci 'id': -1, 329723b3eb3cSopenharmony_ci 'type': 10002, 329823b3eb3cSopenharmony_ci params: ['sys.float.alert_title_padding_right'], 329923b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 330023b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 330123b3eb3cSopenharmony_ci }, 330223b3eb3cSopenharmony_ci left: { 330323b3eb3cSopenharmony_ci 'id': -1, 330423b3eb3cSopenharmony_ci 'type': 10002, 330523b3eb3cSopenharmony_ci params: ['sys.float.alert_title_padding_left'], 330623b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 330723b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 330823b3eb3cSopenharmony_ci }, 330923b3eb3cSopenharmony_ci bottom: 0, 331023b3eb3cSopenharmony_ci }; 331123b3eb3cSopenharmony_ci } 331223b3eb3cSopenharmony_ci 331323b3eb3cSopenharmony_ci initTitleTextAlign() { 331423b3eb3cSopenharmony_ci let i16 = ALERT_TITLE_ALIGNMENT; 331523b3eb3cSopenharmony_ci if (i16 === TextAlign.Start) { 331623b3eb3cSopenharmony_ci this.titleTextAlign = TextAlign.Start; 331723b3eb3cSopenharmony_ci } else if (i16 === TextAlign.Center) { 331823b3eb3cSopenharmony_ci this.titleTextAlign = TextAlign.Center; 331923b3eb3cSopenharmony_ci } else if (i16 === TextAlign.End) { 332023b3eb3cSopenharmony_ci this.titleTextAlign = TextAlign.End; 332123b3eb3cSopenharmony_ci } else if (i16 === TextAlign.JUSTIFY) { 332223b3eb3cSopenharmony_ci this.titleTextAlign = TextAlign.JUSTIFY; 332323b3eb3cSopenharmony_ci } else { 332423b3eb3cSopenharmony_ci this.titleTextAlign = TextAlign.Center; 332523b3eb3cSopenharmony_ci } 332623b3eb3cSopenharmony_ci } 332723b3eb3cSopenharmony_ci 332823b3eb3cSopenharmony_ci getTitleAreaMinHeight() { 332923b3eb3cSopenharmony_ci if (this.secondaryTitle) { 333023b3eb3cSopenharmony_ci return { 333123b3eb3cSopenharmony_ci 'id': -1, 333223b3eb3cSopenharmony_ci 'type': 10002, 333323b3eb3cSopenharmony_ci params: ['sys.float.alert_title_secondary_height'], 333423b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 333523b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 333623b3eb3cSopenharmony_ci }; 333723b3eb3cSopenharmony_ci } else if (this.primaryTitle) { 333823b3eb3cSopenharmony_ci return { 333923b3eb3cSopenharmony_ci 'id': -1, 334023b3eb3cSopenharmony_ci 'type': 10002, 334123b3eb3cSopenharmony_ci params: ['sys.float.alert_title_primary_height'], 334223b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 334323b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 334423b3eb3cSopenharmony_ci }; 334523b3eb3cSopenharmony_ci } else { 334623b3eb3cSopenharmony_ci return 0; 334723b3eb3cSopenharmony_ci } 334823b3eb3cSopenharmony_ci } 334923b3eb3cSopenharmony_ci 335023b3eb3cSopenharmony_ci ButtonBuilder(b16 = null) { 335123b3eb3cSopenharmony_ci this.observeComponentCreation2((g16, h16) => { 335223b3eb3cSopenharmony_ci Column.create(); 335323b3eb3cSopenharmony_ci Column.width('100%'); 335423b3eb3cSopenharmony_ci Column.padding(this.getOperationAreaPadding()); 335523b3eb3cSopenharmony_ci }, Column); 335623b3eb3cSopenharmony_ci this.observeComponentCreation2((c16, d16) => { 335723b3eb3cSopenharmony_ci If.create(); 335823b3eb3cSopenharmony_ci if (this.buttons && this.buttons.length > 0) { 335923b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 336023b3eb3cSopenharmony_ci this.observeComponentCreation2((e16, f16) => { 336123b3eb3cSopenharmony_ci If.create(); 336223b3eb3cSopenharmony_ci if (this.isButtonVertical) { 336323b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 336423b3eb3cSopenharmony_ci this.buildVerticalAlignButtons.bind(this)(); 336523b3eb3cSopenharmony_ci }); 336623b3eb3cSopenharmony_ci } else { 336723b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 336823b3eb3cSopenharmony_ci this.buildHorizontalAlignButtons.bind(this)(); 336923b3eb3cSopenharmony_ci }); 337023b3eb3cSopenharmony_ci } 337123b3eb3cSopenharmony_ci }, If); 337223b3eb3cSopenharmony_ci If.pop(); 337323b3eb3cSopenharmony_ci }); 337423b3eb3cSopenharmony_ci } else { 337523b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 337623b3eb3cSopenharmony_ci }); 337723b3eb3cSopenharmony_ci } 337823b3eb3cSopenharmony_ci }, If); 337923b3eb3cSopenharmony_ci If.pop(); 338023b3eb3cSopenharmony_ci Column.pop(); 338123b3eb3cSopenharmony_ci } 338223b3eb3cSopenharmony_ci 338323b3eb3cSopenharmony_ci getOperationAreaPadding() { 338423b3eb3cSopenharmony_ci if (this.isButtonVertical) { 338523b3eb3cSopenharmony_ci return { 338623b3eb3cSopenharmony_ci top: { 338723b3eb3cSopenharmony_ci 'id': -1, 338823b3eb3cSopenharmony_ci 'type': 10002, 338923b3eb3cSopenharmony_ci params: ['sys.float.alert_button_top_padding'], 339023b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 339123b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 339223b3eb3cSopenharmony_ci }, 339323b3eb3cSopenharmony_ci right: { 339423b3eb3cSopenharmony_ci 'id': -1, 339523b3eb3cSopenharmony_ci 'type': 10002, 339623b3eb3cSopenharmony_ci params: ['sys.float.alert_right_padding_vertical'], 339723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 339823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 339923b3eb3cSopenharmony_ci }, 340023b3eb3cSopenharmony_ci left: { 340123b3eb3cSopenharmony_ci 'id': -1, 340223b3eb3cSopenharmony_ci 'type': 10002, 340323b3eb3cSopenharmony_ci params: ['sys.float.alert_left_padding_vertical'], 340423b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 340523b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 340623b3eb3cSopenharmony_ci }, 340723b3eb3cSopenharmony_ci bottom: { 340823b3eb3cSopenharmony_ci 'id': -1, 340923b3eb3cSopenharmony_ci 'type': 10002, 341023b3eb3cSopenharmony_ci params: ['sys.float.alert_button_bottom_padding_vertical'], 341123b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 341223b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 341323b3eb3cSopenharmony_ci }, 341423b3eb3cSopenharmony_ci }; 341523b3eb3cSopenharmony_ci } 341623b3eb3cSopenharmony_ci return { 341723b3eb3cSopenharmony_ci top: { 341823b3eb3cSopenharmony_ci 'id': -1, 341923b3eb3cSopenharmony_ci 'type': 10002, 342023b3eb3cSopenharmony_ci params: ['sys.float.alert_button_top_padding'], 342123b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 342223b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 342323b3eb3cSopenharmony_ci }, 342423b3eb3cSopenharmony_ci right: { 342523b3eb3cSopenharmony_ci 'id': -1, 342623b3eb3cSopenharmony_ci 'type': 10002, 342723b3eb3cSopenharmony_ci params: ['sys.float.alert_right_padding_horizontal'], 342823b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 342923b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 343023b3eb3cSopenharmony_ci }, 343123b3eb3cSopenharmony_ci left: { 343223b3eb3cSopenharmony_ci 'id': -1, 343323b3eb3cSopenharmony_ci 'type': 10002, 343423b3eb3cSopenharmony_ci params: ['sys.float.alert_left_padding_horizontal'], 343523b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 343623b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 343723b3eb3cSopenharmony_ci }, 343823b3eb3cSopenharmony_ci bottom: { 343923b3eb3cSopenharmony_ci 'id': -1, 344023b3eb3cSopenharmony_ci 'type': 10002, 344123b3eb3cSopenharmony_ci params: ['sys.float.alert_button_bottom_padding_horizontal'], 344223b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 344323b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 344423b3eb3cSopenharmony_ci }, 344523b3eb3cSopenharmony_ci }; 344623b3eb3cSopenharmony_ci } 344723b3eb3cSopenharmony_ci buildSingleButton(p15, q15 = null) { 344823b3eb3cSopenharmony_ci this.observeComponentCreation2((r15, s15) => { 344923b3eb3cSopenharmony_ci If.create(); 345023b3eb3cSopenharmony_ci if (this.isNewPropertiesHighPriority(p15)) { 345123b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 345223b3eb3cSopenharmony_ci this.observeComponentCreation2((z15, a16) => { 345323b3eb3cSopenharmony_ci Button.createWithLabel(p15.value); 345423b3eb3cSopenharmony_ci __Button__setButtonProperties(p15, this.buttons, this.controller); 345523b3eb3cSopenharmony_ci Button.role(p15.role ?? ButtonRole.NORMAL); 345623b3eb3cSopenharmony_ci Button.key(`advanced_dialog_button_${this.keyIndex++}`); 345723b3eb3cSopenharmony_ci Button.labelStyle({ 345823b3eb3cSopenharmony_ci maxLines: 1, 345923b3eb3cSopenharmony_ci maxFontSize: this.buttonMaxFontSize, 346023b3eb3cSopenharmony_ci minFontSize: this.buttonMinFontSize 346123b3eb3cSopenharmony_ci }); 346223b3eb3cSopenharmony_ci }, Button); 346323b3eb3cSopenharmony_ci Button.pop(); 346423b3eb3cSopenharmony_ci }); 346523b3eb3cSopenharmony_ci } else if (p15.background !== undefined && p15.fontColor !== undefined) { 346623b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 346723b3eb3cSopenharmony_ci this.observeComponentCreation2((x15, y15) => { 346823b3eb3cSopenharmony_ci Button.createWithLabel(p15.value); 346923b3eb3cSopenharmony_ci __Button__setButtonProperties(p15, this.buttons, this.controller); 347023b3eb3cSopenharmony_ci Button.backgroundColor(p15.background); 347123b3eb3cSopenharmony_ci Button.fontColor(p15.fontColor); 347223b3eb3cSopenharmony_ci Button.key(`advanced_dialog_button_${this.keyIndex++}`); 347323b3eb3cSopenharmony_ci Button.labelStyle({ 347423b3eb3cSopenharmony_ci maxLines: 1, 347523b3eb3cSopenharmony_ci maxFontSize: this.buttonMaxFontSize, 347623b3eb3cSopenharmony_ci minFontSize: this.buttonMinFontSize 347723b3eb3cSopenharmony_ci }); 347823b3eb3cSopenharmony_ci }, Button); 347923b3eb3cSopenharmony_ci Button.pop(); 348023b3eb3cSopenharmony_ci }); 348123b3eb3cSopenharmony_ci } else if (p15.background !== undefined) { 348223b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(2, () => { 348323b3eb3cSopenharmony_ci this.observeComponentCreation2((v15, w15) => { 348423b3eb3cSopenharmony_ci Button.createWithLabel(p15.value); 348523b3eb3cSopenharmony_ci __Button__setButtonProperties(p15, this.buttons, this.controller); 348623b3eb3cSopenharmony_ci Button.backgroundColor(p15.background); 348723b3eb3cSopenharmony_ci Button.key(`advanced_dialog_button_${this.keyIndex++}`); 348823b3eb3cSopenharmony_ci Button.labelStyle({ 348923b3eb3cSopenharmony_ci maxLines: 1, 349023b3eb3cSopenharmony_ci maxFontSize: this.buttonMaxFontSize, 349123b3eb3cSopenharmony_ci minFontSize: this.buttonMinFontSize 349223b3eb3cSopenharmony_ci }); 349323b3eb3cSopenharmony_ci }, Button); 349423b3eb3cSopenharmony_ci Button.pop(); 349523b3eb3cSopenharmony_ci }); 349623b3eb3cSopenharmony_ci } else { 349723b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(3, () => { 349823b3eb3cSopenharmony_ci this.observeComponentCreation2((t15, u15) => { 349923b3eb3cSopenharmony_ci Button.createWithLabel(p15.value); 350023b3eb3cSopenharmony_ci __Button__setButtonProperties(p15, this.buttons, this.controller); 350123b3eb3cSopenharmony_ci Button.fontColor(p15.fontColor); 350223b3eb3cSopenharmony_ci Button.key(`advanced_dialog_button_${this.keyIndex++}`); 350323b3eb3cSopenharmony_ci Button.labelStyle({ 350423b3eb3cSopenharmony_ci maxLines: 1, 350523b3eb3cSopenharmony_ci maxFontSize: this.buttonMaxFontSize, 350623b3eb3cSopenharmony_ci minFontSize: this.buttonMinFontSize 350723b3eb3cSopenharmony_ci }); 350823b3eb3cSopenharmony_ci }, Button); 350923b3eb3cSopenharmony_ci Button.pop(); 351023b3eb3cSopenharmony_ci }); 351123b3eb3cSopenharmony_ci } 351223b3eb3cSopenharmony_ci }, If); 351323b3eb3cSopenharmony_ci If.pop(); 351423b3eb3cSopenharmony_ci } 351523b3eb3cSopenharmony_ci 351623b3eb3cSopenharmony_ci buildHorizontalAlignButtons(e15 = null) { 351723b3eb3cSopenharmony_ci this.observeComponentCreation2((f15, g15) => { 351823b3eb3cSopenharmony_ci If.create(); 351923b3eb3cSopenharmony_ci if (this.buttons && this.buttons.length > 0) { 352023b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 352123b3eb3cSopenharmony_ci this.observeComponentCreation2((n15, o15) => { 352223b3eb3cSopenharmony_ci Row.create(); 352323b3eb3cSopenharmony_ci }, Row); 352423b3eb3cSopenharmony_ci this.buildSingleButton.bind(this)(this.buttons[0]); 352523b3eb3cSopenharmony_ci this.observeComponentCreation2((h15, i15) => { 352623b3eb3cSopenharmony_ci If.create(); 352723b3eb3cSopenharmony_ci if (this.buttons.length === HORIZON_BUTTON_MAX_COUNT) { 352823b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 352923b3eb3cSopenharmony_ci this.observeComponentCreation2((l15, m15) => { 353023b3eb3cSopenharmony_ci Row.create(); 353123b3eb3cSopenharmony_ci Row.width(BUTTON_HORIZONTAL_SPACE * 2); 353223b3eb3cSopenharmony_ci Row.justifyContent(FlexAlign.Center); 353323b3eb3cSopenharmony_ci }, Row); 353423b3eb3cSopenharmony_ci this.observeComponentCreation2((j15, k15) => { 353523b3eb3cSopenharmony_ci Divider.create(); 353623b3eb3cSopenharmony_ci Divider.width({ 353723b3eb3cSopenharmony_ci 'id': -1, 353823b3eb3cSopenharmony_ci 'type': 10002, 353923b3eb3cSopenharmony_ci params: ['sys.float.alert_divider_width'], 354023b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 354123b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 354223b3eb3cSopenharmony_ci }); 354323b3eb3cSopenharmony_ci Divider.height({ 354423b3eb3cSopenharmony_ci 'id': -1, 354523b3eb3cSopenharmony_ci 'type': 10002, 354623b3eb3cSopenharmony_ci params: ['sys.float.alert_divider_height'], 354723b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 354823b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 354923b3eb3cSopenharmony_ci }); 355023b3eb3cSopenharmony_ci Divider.color(this.getDividerColor()); 355123b3eb3cSopenharmony_ci Divider.vertical(true); 355223b3eb3cSopenharmony_ci }, Divider); 355323b3eb3cSopenharmony_ci Row.pop(); 355423b3eb3cSopenharmony_ci this.buildSingleButton.bind(this)(this.buttons[HORIZON_BUTTON_MAX_COUNT - 1]); 355523b3eb3cSopenharmony_ci }); 355623b3eb3cSopenharmony_ci } else { 355723b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 355823b3eb3cSopenharmony_ci }); 355923b3eb3cSopenharmony_ci } 356023b3eb3cSopenharmony_ci }, If); 356123b3eb3cSopenharmony_ci If.pop(); 356223b3eb3cSopenharmony_ci Row.pop(); 356323b3eb3cSopenharmony_ci }); 356423b3eb3cSopenharmony_ci } else { 356523b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 356623b3eb3cSopenharmony_ci }); 356723b3eb3cSopenharmony_ci } 356823b3eb3cSopenharmony_ci }, If); 356923b3eb3cSopenharmony_ci If.pop(); 357023b3eb3cSopenharmony_ci } 357123b3eb3cSopenharmony_ci 357223b3eb3cSopenharmony_ci buildVerticalAlignButtons(s14 = null) { 357323b3eb3cSopenharmony_ci this.observeComponentCreation2((t14, u14) => { 357423b3eb3cSopenharmony_ci If.create(); 357523b3eb3cSopenharmony_ci if (this.buttons) { 357623b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 357723b3eb3cSopenharmony_ci this.observeComponentCreation2((c15, d15) => { 357823b3eb3cSopenharmony_ci Column.create(); 357923b3eb3cSopenharmony_ci }, Column); 358023b3eb3cSopenharmony_ci this.observeComponentCreation2((v14, w14) => { 358123b3eb3cSopenharmony_ci ForEach.create(); 358223b3eb3cSopenharmony_ci const b = (z14, a15) => { 358323b3eb3cSopenharmony_ci const b15 = z14; 358423b3eb3cSopenharmony_ci this.buildButtonWithDivider.bind(this)(this.buttons?.length === HORIZON_BUTTON_MAX_COUNT ? 358523b3eb3cSopenharmony_ci HORIZON_BUTTON_MAX_COUNT - a15 - 1 : a15); 358623b3eb3cSopenharmony_ci }; 358723b3eb3cSopenharmony_ci this.forEachUpdateFunction(v14, this.buttons.slice(0, VERTICAL_BUTTON_MAX_COUNT), 358823b3eb3cSopenharmony_ci b, (y14) => y14.value.toString(), true, false); 358923b3eb3cSopenharmony_ci }, ForEach); 359023b3eb3cSopenharmony_ci ForEach.pop(); 359123b3eb3cSopenharmony_ci Column.pop(); 359223b3eb3cSopenharmony_ci }); 359323b3eb3cSopenharmony_ci } else { 359423b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 359523b3eb3cSopenharmony_ci }); 359623b3eb3cSopenharmony_ci } 359723b3eb3cSopenharmony_ci }, If); 359823b3eb3cSopenharmony_ci If.pop(); 359923b3eb3cSopenharmony_ci } 360023b3eb3cSopenharmony_ci 360123b3eb3cSopenharmony_ci getDividerColor() { 360223b3eb3cSopenharmony_ci if (!this.buttons || this.buttons.length === 0 || !DIALOG_DIVIDER_SHOW) { 360323b3eb3cSopenharmony_ci return Color.Transparent; 360423b3eb3cSopenharmony_ci } 360523b3eb3cSopenharmony_ci if (this.buttons[0].buttonStyle === ButtonStyleMode.TEXTUAL || this.buttons[0].buttonStyle === undefined) { 360623b3eb3cSopenharmony_ci if (this.buttons[HORIZON_BUTTON_MAX_COUNT - 1].buttonStyle === ButtonStyleMode.TEXTUAL || 360723b3eb3cSopenharmony_ci this.buttons[HORIZON_BUTTON_MAX_COUNT - 1].buttonStyle === undefined) { 360823b3eb3cSopenharmony_ci return { 360923b3eb3cSopenharmony_ci 'id': -1, 361023b3eb3cSopenharmony_ci 'type': 10001, 361123b3eb3cSopenharmony_ci params: ['sys.color.alert_divider_color'], 361223b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 361323b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 361423b3eb3cSopenharmony_ci }; 361523b3eb3cSopenharmony_ci } 361623b3eb3cSopenharmony_ci } 361723b3eb3cSopenharmony_ci return Color.Transparent; 361823b3eb3cSopenharmony_ci } 361923b3eb3cSopenharmony_ci 362023b3eb3cSopenharmony_ci isNewPropertiesHighPriority(r14) { 362123b3eb3cSopenharmony_ci if (r14.role === ButtonRole.ERROR) { 362223b3eb3cSopenharmony_ci return true; 362323b3eb3cSopenharmony_ci } 362423b3eb3cSopenharmony_ci if (r14.buttonStyle !== undefined && 362523b3eb3cSopenharmony_ci r14.buttonStyle !== ALERT_BUTTON_STYLE) { 362623b3eb3cSopenharmony_ci return true; 362723b3eb3cSopenharmony_ci } 362823b3eb3cSopenharmony_ci if (r14.background === undefined && r14.fontColor === undefined) { 362923b3eb3cSopenharmony_ci return true; 363023b3eb3cSopenharmony_ci } 363123b3eb3cSopenharmony_ci return false; 363223b3eb3cSopenharmony_ci } 363323b3eb3cSopenharmony_ci 363423b3eb3cSopenharmony_ci buildButtonWithDivider(h14, i14 = null) { 363523b3eb3cSopenharmony_ci this.observeComponentCreation2((j14, k14) => { 363623b3eb3cSopenharmony_ci If.create(); 363723b3eb3cSopenharmony_ci if (this.buttons && this.buttons[h14]) { 363823b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 363923b3eb3cSopenharmony_ci this.observeComponentCreation2((p14, q14) => { 364023b3eb3cSopenharmony_ci Row.create(); 364123b3eb3cSopenharmony_ci }, Row); 364223b3eb3cSopenharmony_ci this.buildSingleButton.bind(this)(this.buttons[h14]); 364323b3eb3cSopenharmony_ci Row.pop(); 364423b3eb3cSopenharmony_ci this.observeComponentCreation2((l14, m14) => { 364523b3eb3cSopenharmony_ci If.create(); 364623b3eb3cSopenharmony_ci if ((this.buttons.length === HORIZON_BUTTON_MAX_COUNT ? 364723b3eb3cSopenharmony_ci HORIZON_BUTTON_MAX_COUNT - h14 - 1 : h14) < 364823b3eb3cSopenharmony_ci Math.min(this.buttons.length, VERTICAL_BUTTON_MAX_COUNT) - 1) { 364923b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(0, () => { 365023b3eb3cSopenharmony_ci this.observeComponentCreation2((n14, o14) => { 365123b3eb3cSopenharmony_ci Row.create(); 365223b3eb3cSopenharmony_ci Row.height({ 365323b3eb3cSopenharmony_ci 'id': -1, 365423b3eb3cSopenharmony_ci 'type': 10002, 365523b3eb3cSopenharmony_ci params: ['sys.float.alert_button_vertical_space'], 365623b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 365723b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 365823b3eb3cSopenharmony_ci }); 365923b3eb3cSopenharmony_ci }, Row); 366023b3eb3cSopenharmony_ci Row.pop(); 366123b3eb3cSopenharmony_ci }); 366223b3eb3cSopenharmony_ci } else { 366323b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 366423b3eb3cSopenharmony_ci }); 366523b3eb3cSopenharmony_ci } 366623b3eb3cSopenharmony_ci }, If); 366723b3eb3cSopenharmony_ci If.pop(); 366823b3eb3cSopenharmony_ci }); 366923b3eb3cSopenharmony_ci } else { 367023b3eb3cSopenharmony_ci this.ifElseBranchUpdateFunction(1, () => { 367123b3eb3cSopenharmony_ci }); 367223b3eb3cSopenharmony_ci } 367323b3eb3cSopenharmony_ci }, If); 367423b3eb3cSopenharmony_ci If.pop(); 367523b3eb3cSopenharmony_ci } 367623b3eb3cSopenharmony_ci 367723b3eb3cSopenharmony_ci isVerticalAlignButton(c14) { 367823b3eb3cSopenharmony_ci if (this.buttons) { 367923b3eb3cSopenharmony_ci if (this.buttons.length === 1) { 368023b3eb3cSopenharmony_ci return false; 368123b3eb3cSopenharmony_ci } 368223b3eb3cSopenharmony_ci if (this.buttons.length !== HORIZON_BUTTON_MAX_COUNT) { 368323b3eb3cSopenharmony_ci return true; 368423b3eb3cSopenharmony_ci } 368523b3eb3cSopenharmony_ci let d14 = false; 368623b3eb3cSopenharmony_ci let e14 = vp2px(c14 / HORIZON_BUTTON_MAX_COUNT - BUTTON_HORIZONTAL_MARGIN - 368723b3eb3cSopenharmony_ci BUTTON_HORIZONTAL_SPACE - 2 * BUTTON_HORIZONTAL_PADDING); 368823b3eb3cSopenharmony_ci this.buttons.forEach((f14) => { 368923b3eb3cSopenharmony_ci let g14 = measure.measureTextSize({ 369023b3eb3cSopenharmony_ci textContent: f14.value, 369123b3eb3cSopenharmony_ci fontSize: this.buttonMaxFontSize 369223b3eb3cSopenharmony_ci }); 369323b3eb3cSopenharmony_ci if (Number(g14.width) > e14) { 369423b3eb3cSopenharmony_ci d14 = true; 369523b3eb3cSopenharmony_ci } 369623b3eb3cSopenharmony_ci }); 369723b3eb3cSopenharmony_ci return d14; 369823b3eb3cSopenharmony_ci } 369923b3eb3cSopenharmony_ci return false; 370023b3eb3cSopenharmony_ci } 370123b3eb3cSopenharmony_ci 370223b3eb3cSopenharmony_ci rerender() { 370323b3eb3cSopenharmony_ci this.updateDirtyElements(); 370423b3eb3cSopenharmony_ci } 370523b3eb3cSopenharmony_ci} 370623b3eb3cSopenharmony_ci 370723b3eb3cSopenharmony_cifunction __Button__setButtonProperties(z13, a14, b14) { 370823b3eb3cSopenharmony_ci Button.onClick(() => { 370923b3eb3cSopenharmony_ci if (z13.action) { 371023b3eb3cSopenharmony_ci z13.action(); 371123b3eb3cSopenharmony_ci } 371223b3eb3cSopenharmony_ci b14?.close(); 371323b3eb3cSopenharmony_ci }); 371423b3eb3cSopenharmony_ci Button.defaultFocus(z13.defaultFocus ? true : isHasDefaultFocus(a14) ? false : true); 371523b3eb3cSopenharmony_ci Button.buttonStyle(z13.buttonStyle ?? ALERT_BUTTON_STYLE); 371623b3eb3cSopenharmony_ci Button.layoutWeight(BUTTON_LAYOUT_WEIGHT); 371723b3eb3cSopenharmony_ci Button.type(ButtonType.ROUNDED_RECTANGLE); 371823b3eb3cSopenharmony_ci} 371923b3eb3cSopenharmony_ci 372023b3eb3cSopenharmony_cifunction isHasDefaultFocus(t13) { 372123b3eb3cSopenharmony_ci try { 372223b3eb3cSopenharmony_ci let x13 = false; 372323b3eb3cSopenharmony_ci t13?.forEach((y13) => { 372423b3eb3cSopenharmony_ci if (y13.defaultFocus) { 372523b3eb3cSopenharmony_ci x13 = true; 372623b3eb3cSopenharmony_ci } 372723b3eb3cSopenharmony_ci }); 372823b3eb3cSopenharmony_ci return x13; 372923b3eb3cSopenharmony_ci } catch (u13) { 373023b3eb3cSopenharmony_ci let v13 = u13.code; 373123b3eb3cSopenharmony_ci let w13 = u13.message; 373223b3eb3cSopenharmony_ci hilog.error(0x3900, 'Ace', `get defaultFocus exist error, code: ${v13}, message: ${w13}`); 373323b3eb3cSopenharmony_ci return false; 373423b3eb3cSopenharmony_ci } 373523b3eb3cSopenharmony_ci} 373623b3eb3cSopenharmony_ci 373723b3eb3cSopenharmony_cifunction getNumberByResourceId(m13, n13, o13) { 373823b3eb3cSopenharmony_ci try { 373923b3eb3cSopenharmony_ci let s13 = resourceManager.getSystemResourceManager().getNumber(m13); 374023b3eb3cSopenharmony_ci if (s13 > 0 || o13) { 374123b3eb3cSopenharmony_ci return s13; 374223b3eb3cSopenharmony_ci } else { 374323b3eb3cSopenharmony_ci return n13; 374423b3eb3cSopenharmony_ci } 374523b3eb3cSopenharmony_ci } catch (p13) { 374623b3eb3cSopenharmony_ci let q13 = p13.code; 374723b3eb3cSopenharmony_ci let r13 = p13.message; 374823b3eb3cSopenharmony_ci hilog.error(0x3900, 'Ace', `CustomContentDialog getNumberByResourceId error, code: ${q13}, message: ${r13}`); 374923b3eb3cSopenharmony_ci return n13; 375023b3eb3cSopenharmony_ci } 375123b3eb3cSopenharmony_ci} 375223b3eb3cSopenharmony_ci 375323b3eb3cSopenharmony_cifunction getEnumNumberByResourceId(g13, h13) { 375423b3eb3cSopenharmony_ci try { 375523b3eb3cSopenharmony_ci let l13 = getContext().resourceManager.getNumber(g13); 375623b3eb3cSopenharmony_ci if (l13 > 0) { 375723b3eb3cSopenharmony_ci return l13; 375823b3eb3cSopenharmony_ci } else { 375923b3eb3cSopenharmony_ci return h13; 376023b3eb3cSopenharmony_ci } 376123b3eb3cSopenharmony_ci } catch (i13) { 376223b3eb3cSopenharmony_ci let j13 = i13.code; 376323b3eb3cSopenharmony_ci let k13 = i13.message; 376423b3eb3cSopenharmony_ci hilog.error(0x3900, 'Ace', `getEnumNumberByResourceId error, code: ${j13}, message: ${k13}`); 376523b3eb3cSopenharmony_ci return h13; 376623b3eb3cSopenharmony_ci } 376723b3eb3cSopenharmony_ci} 376823b3eb3cSopenharmony_ci 376923b3eb3cSopenharmony_cifunction getAccessibilityText(z12, a13) { 377023b3eb3cSopenharmony_ci try { 377123b3eb3cSopenharmony_ci let e13 = getContext().resourceManager.getStringSync(125833934); 377223b3eb3cSopenharmony_ci let f13 = ''; 377323b3eb3cSopenharmony_ci if (typeof z12 === 'string') { 377423b3eb3cSopenharmony_ci f13 = z12; 377523b3eb3cSopenharmony_ci } else { 377623b3eb3cSopenharmony_ci f13 = getContext().resourceManager.getStringSync(z12); 377723b3eb3cSopenharmony_ci } 377823b3eb3cSopenharmony_ci return a13 ? `${e13},${f13}` : f13; 377923b3eb3cSopenharmony_ci } catch (b13) { 378023b3eb3cSopenharmony_ci let c13 = b13.code; 378123b3eb3cSopenharmony_ci let d13 = b13.message; 378223b3eb3cSopenharmony_ci hilog.error(0x3900, 'Ace', `getAccessibilityText error, code: ${c13}, message: ${d13}`); 378323b3eb3cSopenharmony_ci return ''; 378423b3eb3cSopenharmony_ci } 378523b3eb3cSopenharmony_ci} 378623b3eb3cSopenharmony_ci 378723b3eb3cSopenharmony_cifunction getTextAlign(u12, v12, w12) { 378823b3eb3cSopenharmony_ci let x12 = measure.measureTextSize({ 378923b3eb3cSopenharmony_ci textContent: v12, 379023b3eb3cSopenharmony_ci fontSize: w12, 379123b3eb3cSopenharmony_ci constraintWidth: u12, 379223b3eb3cSopenharmony_ci }); 379323b3eb3cSopenharmony_ci let y12 = measure.measureTextSize({ 379423b3eb3cSopenharmony_ci textContent: v12, 379523b3eb3cSopenharmony_ci fontSize: w12, 379623b3eb3cSopenharmony_ci }); 379723b3eb3cSopenharmony_ci if (getTextHeight(x12) <= getTextHeight(y12)) { 379823b3eb3cSopenharmony_ci return TextAlign.Center; 379923b3eb3cSopenharmony_ci } 380023b3eb3cSopenharmony_ci return TextAlign.Start; 380123b3eb3cSopenharmony_ci} 380223b3eb3cSopenharmony_ci 380323b3eb3cSopenharmony_cifunction getTextHeight(t12) { 380423b3eb3cSopenharmony_ci if (t12 && t12.height !== null && t12.height !== undefined) { 380523b3eb3cSopenharmony_ci return Number(t12.height); 380623b3eb3cSopenharmony_ci } 380723b3eb3cSopenharmony_ci return 0; 380823b3eb3cSopenharmony_ci} 380923b3eb3cSopenharmony_ci 381023b3eb3cSopenharmony_cifunction resolveKeyEvent(r12, s12) { 381123b3eb3cSopenharmony_ci if (r12.type === IGNORE_KEY_EVENT_TYPE) { 381223b3eb3cSopenharmony_ci return; 381323b3eb3cSopenharmony_ci } 381423b3eb3cSopenharmony_ci if (r12.keyCode === KEYCODE_UP) { 381523b3eb3cSopenharmony_ci s12.scrollPage({ next: false }); 381623b3eb3cSopenharmony_ci r12.stopPropagation(); 381723b3eb3cSopenharmony_ci } else if (r12.keyCode === KEYCODE_DOWN) { 381823b3eb3cSopenharmony_ci if (s12.isAtEnd()) { 381923b3eb3cSopenharmony_ci return; 382023b3eb3cSopenharmony_ci } else { 382123b3eb3cSopenharmony_ci s12.scrollPage({ next: true }); 382223b3eb3cSopenharmony_ci r12.stopPropagation(); 382323b3eb3cSopenharmony_ci } 382423b3eb3cSopenharmony_ci } 382523b3eb3cSopenharmony_ci} 382623b3eb3cSopenharmony_ci 382723b3eb3cSopenharmony_ciexport class LoadingDialog extends ViewPU { 382823b3eb3cSopenharmony_ci constructor(l12, m12, n12, o12 = -1, p12 = undefined, q12) { 382923b3eb3cSopenharmony_ci super(l12, n12, o12, q12); 383023b3eb3cSopenharmony_ci if (typeof p12 === 'function') { 383123b3eb3cSopenharmony_ci this.paramsGenerator_ = p12; 383223b3eb3cSopenharmony_ci } 383323b3eb3cSopenharmony_ci this.controller = undefined; 383423b3eb3cSopenharmony_ci this.content = ''; 383523b3eb3cSopenharmony_ci this.__fontColorWithTheme = new ObservedPropertyObjectPU({ 383623b3eb3cSopenharmony_ci 'id': -1, 383723b3eb3cSopenharmony_ci 'type': 10001, 383823b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 383923b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 384023b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 384123b3eb3cSopenharmony_ci }, this, 'fontColorWithTheme'); 384223b3eb3cSopenharmony_ci this.__loadingProgressIconColorWithTheme = new ObservedPropertyObjectPU({ 384323b3eb3cSopenharmony_ci 'id': -1, 384423b3eb3cSopenharmony_ci 'type': 10001, 384523b3eb3cSopenharmony_ci params: ['sys.color.icon_secondary'], 384623b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 384723b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 384823b3eb3cSopenharmony_ci }, this, 'loadingProgressIconColorWithTheme'); 384923b3eb3cSopenharmony_ci this.theme = new CustomThemeImpl({}); 385023b3eb3cSopenharmony_ci this.themeColorMode = ThemeColorMode.SYSTEM; 385123b3eb3cSopenharmony_ci this.__fontSizeScale = new ObservedPropertySimplePU(1, this, 'fontSizeScale'); 385223b3eb3cSopenharmony_ci this.__minContentHeight = new ObservedPropertySimplePU(MIN_CONTENT_HEIGHT, this, 'minContentHeight'); 385323b3eb3cSopenharmony_ci this.setInitiallyProvidedValue(m12); 385423b3eb3cSopenharmony_ci this.finalizeConstruction(); 385523b3eb3cSopenharmony_ci } 385623b3eb3cSopenharmony_ci 385723b3eb3cSopenharmony_ci setInitiallyProvidedValue(k12) { 385823b3eb3cSopenharmony_ci if (k12.controller !== undefined) { 385923b3eb3cSopenharmony_ci this.controller = k12.controller; 386023b3eb3cSopenharmony_ci } 386123b3eb3cSopenharmony_ci if (k12.content !== undefined) { 386223b3eb3cSopenharmony_ci this.content = k12.content; 386323b3eb3cSopenharmony_ci } 386423b3eb3cSopenharmony_ci if (k12.fontColorWithTheme !== undefined) { 386523b3eb3cSopenharmony_ci this.fontColorWithTheme = k12.fontColorWithTheme; 386623b3eb3cSopenharmony_ci } 386723b3eb3cSopenharmony_ci if (k12.loadingProgressIconColorWithTheme !== undefined) { 386823b3eb3cSopenharmony_ci this.loadingProgressIconColorWithTheme = k12.loadingProgressIconColorWithTheme; 386923b3eb3cSopenharmony_ci } 387023b3eb3cSopenharmony_ci if (k12.theme !== undefined) { 387123b3eb3cSopenharmony_ci this.theme = k12.theme; 387223b3eb3cSopenharmony_ci } 387323b3eb3cSopenharmony_ci if (k12.themeColorMode !== undefined) { 387423b3eb3cSopenharmony_ci this.themeColorMode = k12.themeColorMode; 387523b3eb3cSopenharmony_ci } 387623b3eb3cSopenharmony_ci if (k12.fontSizeScale !== undefined) { 387723b3eb3cSopenharmony_ci this.fontSizeScale = k12.fontSizeScale; 387823b3eb3cSopenharmony_ci } 387923b3eb3cSopenharmony_ci if (k12.minContentHeight !== undefined) { 388023b3eb3cSopenharmony_ci this.minContentHeight = k12.minContentHeight; 388123b3eb3cSopenharmony_ci } 388223b3eb3cSopenharmony_ci } 388323b3eb3cSopenharmony_ci 388423b3eb3cSopenharmony_ci updateStateVars(j12) { 388523b3eb3cSopenharmony_ci } 388623b3eb3cSopenharmony_ci 388723b3eb3cSopenharmony_ci purgeVariableDependenciesOnElmtId(i12) { 388823b3eb3cSopenharmony_ci this.__fontColorWithTheme.purgeDependencyOnElmtId(i12); 388923b3eb3cSopenharmony_ci this.__loadingProgressIconColorWithTheme.purgeDependencyOnElmtId(i12); 389023b3eb3cSopenharmony_ci this.__fontSizeScale.purgeDependencyOnElmtId(i12); 389123b3eb3cSopenharmony_ci this.__minContentHeight.purgeDependencyOnElmtId(i12); 389223b3eb3cSopenharmony_ci } 389323b3eb3cSopenharmony_ci 389423b3eb3cSopenharmony_ci aboutToBeDeleted() { 389523b3eb3cSopenharmony_ci this.__fontColorWithTheme.aboutToBeDeleted(); 389623b3eb3cSopenharmony_ci this.__loadingProgressIconColorWithTheme.aboutToBeDeleted(); 389723b3eb3cSopenharmony_ci this.__fontSizeScale.aboutToBeDeleted(); 389823b3eb3cSopenharmony_ci this.__minContentHeight.aboutToBeDeleted(); 389923b3eb3cSopenharmony_ci SubscriberManager.Get().delete(this.id__()); 390023b3eb3cSopenharmony_ci this.aboutToBeDeletedInternal(); 390123b3eb3cSopenharmony_ci } 390223b3eb3cSopenharmony_ci 390323b3eb3cSopenharmony_ci setController(h12) { 390423b3eb3cSopenharmony_ci this.controller = h12; 390523b3eb3cSopenharmony_ci } 390623b3eb3cSopenharmony_ci 390723b3eb3cSopenharmony_ci get fontColorWithTheme() { 390823b3eb3cSopenharmony_ci return this.__fontColorWithTheme.get(); 390923b3eb3cSopenharmony_ci } 391023b3eb3cSopenharmony_ci 391123b3eb3cSopenharmony_ci set fontColorWithTheme(g12) { 391223b3eb3cSopenharmony_ci this.__fontColorWithTheme.set(g12); 391323b3eb3cSopenharmony_ci } 391423b3eb3cSopenharmony_ci 391523b3eb3cSopenharmony_ci get loadingProgressIconColorWithTheme() { 391623b3eb3cSopenharmony_ci return this.__loadingProgressIconColorWithTheme.get(); 391723b3eb3cSopenharmony_ci } 391823b3eb3cSopenharmony_ci 391923b3eb3cSopenharmony_ci set loadingProgressIconColorWithTheme(f12) { 392023b3eb3cSopenharmony_ci this.__loadingProgressIconColorWithTheme.set(f12); 392123b3eb3cSopenharmony_ci } 392223b3eb3cSopenharmony_ci 392323b3eb3cSopenharmony_ci get fontSizeScale() { 392423b3eb3cSopenharmony_ci return this.__fontSizeScale.get(); 392523b3eb3cSopenharmony_ci } 392623b3eb3cSopenharmony_ci 392723b3eb3cSopenharmony_ci set fontSizeScale(e12) { 392823b3eb3cSopenharmony_ci this.__fontSizeScale.set(e12); 392923b3eb3cSopenharmony_ci } 393023b3eb3cSopenharmony_ci 393123b3eb3cSopenharmony_ci get minContentHeight() { 393223b3eb3cSopenharmony_ci return this.__minContentHeight.get(); 393323b3eb3cSopenharmony_ci } 393423b3eb3cSopenharmony_ci 393523b3eb3cSopenharmony_ci set minContentHeight(d12) { 393623b3eb3cSopenharmony_ci this.__minContentHeight.set(d12); 393723b3eb3cSopenharmony_ci } 393823b3eb3cSopenharmony_ci 393923b3eb3cSopenharmony_ci initialRender() { 394023b3eb3cSopenharmony_ci this.observeComponentCreation2((b12, c12) => { 394123b3eb3cSopenharmony_ci Column.create(); 394223b3eb3cSopenharmony_ci }, Column); 394323b3eb3cSopenharmony_ci this.observeComponentCreation2((z11, a12) => { 394423b3eb3cSopenharmony_ci __Common__.create(); 394523b3eb3cSopenharmony_ci __Common__.constraintSize({ maxHeight: '100%' }); 394623b3eb3cSopenharmony_ci }, __Common__); 394723b3eb3cSopenharmony_ci { 394823b3eb3cSopenharmony_ci this.observeComponentCreation2((v11, w11) => { 394923b3eb3cSopenharmony_ci if (w11) { 395023b3eb3cSopenharmony_ci let x11 = new CustomDialogContentComponent(this, { 395123b3eb3cSopenharmony_ci controller: this.controller, 395223b3eb3cSopenharmony_ci contentBuilder: () => { 395323b3eb3cSopenharmony_ci this.contentBuilder(); 395423b3eb3cSopenharmony_ci }, 395523b3eb3cSopenharmony_ci theme: this.theme, 395623b3eb3cSopenharmony_ci themeColorMode: this.themeColorMode, 395723b3eb3cSopenharmony_ci fontSizeScale: this.__fontSizeScale, 395823b3eb3cSopenharmony_ci minContentHeight: this.__minContentHeight, 395923b3eb3cSopenharmony_ci }, undefined, v11, () => { 396023b3eb3cSopenharmony_ci }, { page: 'library/src/main/ets/components/MainPage.ets', line: 1661, col: 7 }); 396123b3eb3cSopenharmony_ci ViewPU.create(x11); 396223b3eb3cSopenharmony_ci let a = () => { 396323b3eb3cSopenharmony_ci return { 396423b3eb3cSopenharmony_ci controller: this.controller, 396523b3eb3cSopenharmony_ci contentBuilder: () => { 396623b3eb3cSopenharmony_ci this.contentBuilder(); 396723b3eb3cSopenharmony_ci }, 396823b3eb3cSopenharmony_ci theme: this.theme, 396923b3eb3cSopenharmony_ci themeColorMode: this.themeColorMode, 397023b3eb3cSopenharmony_ci fontSizeScale: this.fontSizeScale, 397123b3eb3cSopenharmony_ci minContentHeight: this.minContentHeight 397223b3eb3cSopenharmony_ci }; 397323b3eb3cSopenharmony_ci }; 397423b3eb3cSopenharmony_ci x11.paramsGenerator_ = a; 397523b3eb3cSopenharmony_ci } else { 397623b3eb3cSopenharmony_ci this.updateStateVarsOfChildByElmtId(v11, {}); 397723b3eb3cSopenharmony_ci } 397823b3eb3cSopenharmony_ci }, { name: 'CustomDialogContentComponent' }); 397923b3eb3cSopenharmony_ci } 398023b3eb3cSopenharmony_ci __Common__.pop(); 398123b3eb3cSopenharmony_ci Column.pop(); 398223b3eb3cSopenharmony_ci } 398323b3eb3cSopenharmony_ci 398423b3eb3cSopenharmony_ci contentBuilder(m11 = null) { 398523b3eb3cSopenharmony_ci this.observeComponentCreation2((t11, u11) => { 398623b3eb3cSopenharmony_ci Column.create(); 398723b3eb3cSopenharmony_ci }, Column); 398823b3eb3cSopenharmony_ci this.observeComponentCreation2((r11, s11) => { 398923b3eb3cSopenharmony_ci Row.create(); 399023b3eb3cSopenharmony_ci Row.constraintSize({ minHeight: LOADING_MIN_HEIGHT }); 399123b3eb3cSopenharmony_ci }, Row); 399223b3eb3cSopenharmony_ci this.observeComponentCreation2((p11, q11) => { 399323b3eb3cSopenharmony_ci Text.create(this.content); 399423b3eb3cSopenharmony_ci Text.fontSize(`${BODY_L}fp`); 399523b3eb3cSopenharmony_ci Text.fontWeight(FontWeight.Regular); 399623b3eb3cSopenharmony_ci Text.fontColor(ObservedObject.GetRawObject(this.fontColorWithTheme)); 399723b3eb3cSopenharmony_ci Text.layoutWeight(LOADING_TEXT_LAYOUT_WEIGHT); 399823b3eb3cSopenharmony_ci Text.maxLines(this.fontSizeScale > MAX_FONT_SCALE ? LOADING_MAX_LINES_BIG_FONT : LOADING_MAX_LINES); 399923b3eb3cSopenharmony_ci Text.focusable(true); 400023b3eb3cSopenharmony_ci Text.defaultFocus(true); 400123b3eb3cSopenharmony_ci Text.focusBox({ 400223b3eb3cSopenharmony_ci strokeWidth: LengthMetrics.px(0) 400323b3eb3cSopenharmony_ci }); 400423b3eb3cSopenharmony_ci Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 400523b3eb3cSopenharmony_ci }, Text); 400623b3eb3cSopenharmony_ci Text.pop(); 400723b3eb3cSopenharmony_ci this.observeComponentCreation2((n11, o11) => { 400823b3eb3cSopenharmony_ci LoadingProgress.create(); 400923b3eb3cSopenharmony_ci LoadingProgress.color(ObservedObject.GetRawObject(this.loadingProgressIconColorWithTheme)); 401023b3eb3cSopenharmony_ci LoadingProgress.width(LOADING_PROGRESS_WIDTH); 401123b3eb3cSopenharmony_ci LoadingProgress.height(LOADING_PROGRESS_HEIGHT); 401223b3eb3cSopenharmony_ci LoadingProgress.margin({ start: LengthMetrics.vp(LOADING_TEXT_MARGIN_LEFT) }); 401323b3eb3cSopenharmony_ci }, LoadingProgress); 401423b3eb3cSopenharmony_ci Row.pop(); 401523b3eb3cSopenharmony_ci Column.pop(); 401623b3eb3cSopenharmony_ci } 401723b3eb3cSopenharmony_ci aboutToAppear() { 401823b3eb3cSopenharmony_ci this.fontColorWithTheme = this.theme?.colors?.fontPrimary ? 401923b3eb3cSopenharmony_ci this.theme.colors.fontPrimary : { 402023b3eb3cSopenharmony_ci 'id': -1, 402123b3eb3cSopenharmony_ci 'type': 10001, 402223b3eb3cSopenharmony_ci params: ['sys.color.font_primary'], 402323b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 402423b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 402523b3eb3cSopenharmony_ci }; 402623b3eb3cSopenharmony_ci this.loadingProgressIconColorWithTheme = this.theme?.colors?.iconSecondary ? 402723b3eb3cSopenharmony_ci this.theme.colors.iconSecondary : { 402823b3eb3cSopenharmony_ci 'id': -1, 402923b3eb3cSopenharmony_ci 'type': 10001, 403023b3eb3cSopenharmony_ci params: ['sys.color.icon_secondary'], 403123b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 403223b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 403323b3eb3cSopenharmony_ci }; 403423b3eb3cSopenharmony_ci } 403523b3eb3cSopenharmony_ci 403623b3eb3cSopenharmony_ci rerender() { 403723b3eb3cSopenharmony_ci this.updateDirtyElements(); 403823b3eb3cSopenharmony_ci } 403923b3eb3cSopenharmony_ci} 404023b3eb3cSopenharmony_ci 404123b3eb3cSopenharmony_ciexport class PopoverDialog extends ViewPU { 404223b3eb3cSopenharmony_ci constructor(g11, h11, i11, j11 = -1, k11 = undefined, l11) { 404323b3eb3cSopenharmony_ci super(g11, i11, j11, l11); 404423b3eb3cSopenharmony_ci if (typeof k11 === 'function') { 404523b3eb3cSopenharmony_ci this.paramsGenerator_ = k11; 404623b3eb3cSopenharmony_ci } 404723b3eb3cSopenharmony_ci this.__visible = new SynchedPropertySimpleTwoWayPU(h11.visible, this, 'visible'); 404823b3eb3cSopenharmony_ci this.__popover = new SynchedPropertyObjectOneWayPU(h11.popover, this, 'popover'); 404923b3eb3cSopenharmony_ci this.targetBuilder = undefined; 405023b3eb3cSopenharmony_ci this.__dialogWidth = new ObservedPropertyObjectPU(this.popover?.width, this, 'dialogWidth'); 405123b3eb3cSopenharmony_ci this.setInitiallyProvidedValue(h11); 405223b3eb3cSopenharmony_ci this.finalizeConstruction(); 405323b3eb3cSopenharmony_ci } 405423b3eb3cSopenharmony_ci 405523b3eb3cSopenharmony_ci setInitiallyProvidedValue(f11) { 405623b3eb3cSopenharmony_ci if (f11.targetBuilder !== undefined) { 405723b3eb3cSopenharmony_ci this.targetBuilder = f11.targetBuilder; 405823b3eb3cSopenharmony_ci } 405923b3eb3cSopenharmony_ci if (f11.dialogWidth !== undefined) { 406023b3eb3cSopenharmony_ci this.dialogWidth = f11.dialogWidth; 406123b3eb3cSopenharmony_ci } 406223b3eb3cSopenharmony_ci } 406323b3eb3cSopenharmony_ci 406423b3eb3cSopenharmony_ci updateStateVars(e11) { 406523b3eb3cSopenharmony_ci this.__popover.reset(e11.popover); 406623b3eb3cSopenharmony_ci } 406723b3eb3cSopenharmony_ci 406823b3eb3cSopenharmony_ci purgeVariableDependenciesOnElmtId(d11) { 406923b3eb3cSopenharmony_ci this.__visible.purgeDependencyOnElmtId(d11); 407023b3eb3cSopenharmony_ci this.__popover.purgeDependencyOnElmtId(d11); 407123b3eb3cSopenharmony_ci this.__dialogWidth.purgeDependencyOnElmtId(d11); 407223b3eb3cSopenharmony_ci } 407323b3eb3cSopenharmony_ci 407423b3eb3cSopenharmony_ci aboutToBeDeleted() { 407523b3eb3cSopenharmony_ci this.__visible.aboutToBeDeleted(); 407623b3eb3cSopenharmony_ci this.__popover.aboutToBeDeleted(); 407723b3eb3cSopenharmony_ci this.__dialogWidth.aboutToBeDeleted(); 407823b3eb3cSopenharmony_ci SubscriberManager.Get().delete(this.id__()); 407923b3eb3cSopenharmony_ci this.aboutToBeDeletedInternal(); 408023b3eb3cSopenharmony_ci } 408123b3eb3cSopenharmony_ci 408223b3eb3cSopenharmony_ci get visible() { 408323b3eb3cSopenharmony_ci return this.__visible.get(); 408423b3eb3cSopenharmony_ci } 408523b3eb3cSopenharmony_ci 408623b3eb3cSopenharmony_ci set visible(c11) { 408723b3eb3cSopenharmony_ci this.__visible.set(c11); 408823b3eb3cSopenharmony_ci } 408923b3eb3cSopenharmony_ci 409023b3eb3cSopenharmony_ci get popover() { 409123b3eb3cSopenharmony_ci return this.__popover.get(); 409223b3eb3cSopenharmony_ci } 409323b3eb3cSopenharmony_ci 409423b3eb3cSopenharmony_ci set popover(b11) { 409523b3eb3cSopenharmony_ci this.__popover.set(b11); 409623b3eb3cSopenharmony_ci } 409723b3eb3cSopenharmony_ci 409823b3eb3cSopenharmony_ci get dialogWidth() { 409923b3eb3cSopenharmony_ci return this.__dialogWidth.get(); 410023b3eb3cSopenharmony_ci } 410123b3eb3cSopenharmony_ci 410223b3eb3cSopenharmony_ci set dialogWidth(a11) { 410323b3eb3cSopenharmony_ci this.__dialogWidth.set(a11); 410423b3eb3cSopenharmony_ci } 410523b3eb3cSopenharmony_ci 410623b3eb3cSopenharmony_ci emptyBuilder(z10 = null) { 410723b3eb3cSopenharmony_ci } 410823b3eb3cSopenharmony_ci 410923b3eb3cSopenharmony_ci aboutToAppear() { 411023b3eb3cSopenharmony_ci if (this.targetBuilder === undefined || this.targetBuilder === null) { 411123b3eb3cSopenharmony_ci this.targetBuilder = this.emptyBuilder; 411223b3eb3cSopenharmony_ci } 411323b3eb3cSopenharmony_ci } 411423b3eb3cSopenharmony_ci 411523b3eb3cSopenharmony_ci initialRender() { 411623b3eb3cSopenharmony_ci this.observeComponentCreation2((k3, v3) => { 411723b3eb3cSopenharmony_ci Column.create(); 411823b3eb3cSopenharmony_ci Column.onClick(() => { 411923b3eb3cSopenharmony_ci let r4 = display.getDefaultDisplaySync(); 412023b3eb3cSopenharmony_ci let y4 = px2vp(r4.width); 412123b3eb3cSopenharmony_ci if (y4 - BUTTON_HORIZONTAL_MARGIN - BUTTON_HORIZONTAL_MARGIN > MAX_DIALOG_WIDTH) { 412223b3eb3cSopenharmony_ci this.popover.width = this.popover?.width ?? MAX_DIALOG_WIDTH; 412323b3eb3cSopenharmony_ci } else { 412423b3eb3cSopenharmony_ci this.popover.width = this.dialogWidth; 412523b3eb3cSopenharmony_ci } 412623b3eb3cSopenharmony_ci this.visible = !this.visible; 412723b3eb3cSopenharmony_ci }); 412823b3eb3cSopenharmony_ci Column.bindPopup(this.visible, { 412923b3eb3cSopenharmony_ci builder: this.popover?.builder, 413023b3eb3cSopenharmony_ci placement: this.popover?.placement ?? Placement.Bottom, 413123b3eb3cSopenharmony_ci popupColor: this.popover?.popupColor, 413223b3eb3cSopenharmony_ci enableArrow: this.popover?.enableArrow ?? true, 413323b3eb3cSopenharmony_ci autoCancel: this.popover?.autoCancel, 413423b3eb3cSopenharmony_ci onStateChange: this.popover?.onStateChange ?? ((o4) => { 413523b3eb3cSopenharmony_ci if (!o4.isVisible) { 413623b3eb3cSopenharmony_ci this.visible = false; 413723b3eb3cSopenharmony_ci } 413823b3eb3cSopenharmony_ci }), 413923b3eb3cSopenharmony_ci arrowOffset: this.popover?.arrowOffset, 414023b3eb3cSopenharmony_ci showInSubWindow: this.popover?.showInSubWindow, 414123b3eb3cSopenharmony_ci mask: this.popover?.mask, 414223b3eb3cSopenharmony_ci targetSpace: this.popover?.targetSpace, 414323b3eb3cSopenharmony_ci offset: this.popover?.offset, 414423b3eb3cSopenharmony_ci width: this.popover?.width, 414523b3eb3cSopenharmony_ci arrowPointPosition: this.popover?.arrowPointPosition, 414623b3eb3cSopenharmony_ci arrowWidth: this.popover?.arrowWidth, 414723b3eb3cSopenharmony_ci arrowHeight: this.popover?.arrowHeight, 414823b3eb3cSopenharmony_ci radius: this.popover?.radius ?? { 414923b3eb3cSopenharmony_ci 'id': -1, 415023b3eb3cSopenharmony_ci 'type': 10002, 415123b3eb3cSopenharmony_ci params: ['sys.float.corner_radius_level16'], 415223b3eb3cSopenharmony_ci 'bundleName': '__harDefaultBundleName__', 415323b3eb3cSopenharmony_ci 'moduleName': '__harDefaultModuleName__' 415423b3eb3cSopenharmony_ci }, 415523b3eb3cSopenharmony_ci shadow: this.popover?.shadow ?? ShadowStyle.OUTER_DEFAULT_MD, 415623b3eb3cSopenharmony_ci backgroundBlurStyle: this.popover?.backgroundBlurStyle ?? BlurStyle.COMPONENT_ULTRA_THICK, 415723b3eb3cSopenharmony_ci focusable: this.popover?.focusable, 415823b3eb3cSopenharmony_ci transition: this.popover?.transition, 415923b3eb3cSopenharmony_ci onWillDismiss: this.popover?.onWillDismiss 416023b3eb3cSopenharmony_ci }); 416123b3eb3cSopenharmony_ci }, Column); 416223b3eb3cSopenharmony_ci this.targetBuilder.bind(this)(); 416323b3eb3cSopenharmony_ci Column.pop(); 416423b3eb3cSopenharmony_ci } 416523b3eb3cSopenharmony_ci 416623b3eb3cSopenharmony_ci rerender() { 416723b3eb3cSopenharmony_ci this.updateDirtyElements(); 416823b3eb3cSopenharmony_ci } 416923b3eb3cSopenharmony_ci} 417023b3eb3cSopenharmony_ci 417123b3eb3cSopenharmony_ciexport default { TipsDialog, ConfirmDialog, SelectDialog, AlertDialog, LoadingDialog, CustomContentDialog, PopoverDialog };