1/* 2 * Copyright (c) 2023-2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the 'License'); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an 'AS IS' BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16if (!('finalizeConstruction' in ViewPU.prototype)) { 17 Reflect.set(ViewPU.prototype, 'finalizeConstruction', () => { }); 18} 19const hilog = requireNapi('hilog'); 20const KeyCode = requireNapi('multimodalInput.keyCode').KeyCode; 21const resourceManager = requireNapi('resourceManager'); 22const LengthMetrics = requireNapi('arkui.node').LengthMetrics; 23export var EditableLeftIconType; 24(function (q67) { 25 q67[q67['Back'] = 0] = 'Back'; 26 q67[q67['Cancel'] = 1] = 'Cancel'; 27})(EditableLeftIconType || (EditableLeftIconType = {})); 28var ItemType; 29(function (p67) { 30 p67[p67['Image'] = 0] = 'Image'; 31 p67[p67['Icon'] = 1] = 'Icon'; 32 p67[p67['LeftIcon'] = 2] = 'LeftIcon'; 33})(ItemType || (ItemType = {})); 34const PUBLIC_CANCEL = { 'id': -1, 'type': 40000, params: ['sys.symbol.xmark'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 35const PUBLIC_OK = { 'id': -1, 'type': 40000, params: ['sys.symbol.checkmark'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 36const PUBLIC_BACK = { 'id': -1, 'type': 40000, params: ['sys.symbol.chevron_backward'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 37const PUBLIC_IMAGE_BACK = { 'id': -1, 'type': 20000, params: ['sys.media.ohos_ic_compnent_titlebar_back'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 38const DEFAULT_TITLE_BAR_HEIGHT = 56; 39const DEFAULT_TITLE_PADDING = 2; 40const MAX_LINE_ONE = 1; 41const MAX_LINES_TWO = 2; 42const MAX_MAIN_TITLE_PERCENT = 0.65; 43const MAX_SUB_TITLE_PERCENT = 0.35; 44const MIN_SUBTITLE_SIZE = '10.0vp'; 45const TEXT_EDITABLE_DIALOG = '18.3fp'; 46const IMAGE_SIZE = '64vp'; 47const MAX_DIALOG = '256vp'; 48const MIN_DIALOG = '216vp'; 49const SYMBOL_SIZE = '24vp'; 50const SYMBOL_TITLE_SIZE = '64vp'; 51const TITLE_VP = 20; 52const SUBTITLE_VP = 14; 53const TITLE_F = getNumberByResource(125831095, TITLE_VP); 54const SUBTITLE_F = getNumberByResource(125831097, SUBTITLE_VP); 55const TITLE_F_VP = (TITLE_F > 0 ? TITLE_F : TITLE_VP) + 'vp'; 56const SUBTITLE_F_VP = (SUBTITLE_F > 0 ? SUBTITLE_F : SUBTITLE_VP) + 'vp'; 57class EditableTitleBarTheme { 58 constructor() { 59 this.iconColor = { 'id': -1, 'type': 10001, params: ['sys.color.titlebar_icon_color'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 60 this.iconBackgroundColor = { 'id': -1, 'type': 10001, params: ['sys.color.titlebar_icon_background_color'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 61 this.iconBackgroundPressedColor = { 'id': -1, 'type': 10001, params: ['sys.color.titlebar_icon_background_pressed_color'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 62 this.iconBackgroundHoverColor = { 'id': -1, 'type': 10001, params: ['sys.color.titlebar_icon_background_hover_color'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 63 this.iconBackgroundFocusOutlineColor = { 'id': -1, 'type': 10001, params: ['sys.color.titlebar_icon_background_focus_outline_color'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 64 this.titleColor = { 'id': -1, 'type': 10001, params: ['sys.color.titlebar_title_tertiary_color'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 65 this.subTitleColor = { 'id': -1, 'type': 10001, params: ['sys.color.titlebar_subheader_color'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 66 } 67} 68class ButtonGestureModifier { 69 constructor(o67) { 70 this.fontSize = 1; 71 this.controller = null; 72 this.controller = o67; 73 } 74 applyGesture(n67) { 75 if (this.fontSize >= ButtonGestureModifier.minFontSize) { 76 n67.addGesture(new LongPressGestureHandler({ repeat: false, duration: ButtonGestureModifier.longPressTime }) 77 .onAction(() => { 78 if (n67) { 79 this.controller?.open(); 80 } 81 }) 82 .onActionEnd(() => { 83 this.controller?.close(); 84 })); 85 } 86 else { 87 n67.clearGestures(); 88 } 89 } 90} 91ButtonGestureModifier.longPressTime = 500; 92ButtonGestureModifier.minFontSize = 1.75; 93export class EditableTitleBar extends ViewPU { 94 constructor(h67, i67, j67, k67 = -1, l67 = undefined, m67) { 95 super(h67, j67, k67, m67); 96 if (typeof l67 === 'function') { 97 this.paramsGenerator_ = l67; 98 } 99 this.leftIconStyle = EditableLeftIconType.Back; 100 this.title = ''; 101 this.subtitle = ''; 102 this.isSaveIconRequired = true; 103 this.imageItem = undefined; 104 this.menuItems = undefined; 105 this.options = {}; 106 this.onSave = undefined; 107 this.onCancel = undefined; 108 this.constraintWidth = 0; 109 this.leftIconDefaultFocus = false; 110 this.saveIconDefaultFocus = false; 111 this.isFollowingSystemFontScale = false; 112 this.maxFontScale = 1; 113 this.systemFontScale = 1; 114 this.__editableTitleBarTheme = new ObservedPropertyObjectPU(new EditableTitleBarTheme(), this, 'editableTitleBarTheme'); 115 this.addProvidedVar('editableTitleBarTheme', this.__editableTitleBarTheme, false); 116 this.__contentMargin = new SynchedPropertyObjectOneWayPU(i67.contentMargin, this, 'contentMargin'); 117 this.__titleBarMargin = new ObservedPropertyObjectPU({ 118 start: LengthMetrics.resource({ 'id': -1, 'type': 10002, params: ['sys.float.margin_left'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }), 119 end: LengthMetrics.resource({ 'id': -1, 'type': 10002, params: ['sys.float.margin_right'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }), 120 }, this, 'titleBarMargin'); 121 this.__fontSize = new ObservedPropertySimplePU(1, this, 'fontSize'); 122 this.setInitiallyProvidedValue(i67); 123 this.finalizeConstruction(); 124 } 125 setInitiallyProvidedValue(g67) { 126 if (g67.leftIconStyle !== undefined) { 127 this.leftIconStyle = g67.leftIconStyle; 128 } 129 if (g67.title !== undefined) { 130 this.title = g67.title; 131 } 132 if (g67.subtitle !== undefined) { 133 this.subtitle = g67.subtitle; 134 } 135 if (g67.isSaveIconRequired !== undefined) { 136 this.isSaveIconRequired = g67.isSaveIconRequired; 137 } 138 if (g67.imageItem !== undefined) { 139 this.imageItem = g67.imageItem; 140 } 141 if (g67.menuItems !== undefined) { 142 this.menuItems = g67.menuItems; 143 } 144 if (g67.options !== undefined) { 145 this.options = g67.options; 146 } 147 if (g67.onSave !== undefined) { 148 this.onSave = g67.onSave; 149 } 150 if (g67.onCancel !== undefined) { 151 this.onCancel = g67.onCancel; 152 } 153 if (g67.constraintWidth !== undefined) { 154 this.constraintWidth = g67.constraintWidth; 155 } 156 if (g67.leftIconDefaultFocus !== undefined) { 157 this.leftIconDefaultFocus = g67.leftIconDefaultFocus; 158 } 159 if (g67.saveIconDefaultFocus !== undefined) { 160 this.saveIconDefaultFocus = g67.saveIconDefaultFocus; 161 } 162 if (g67.isFollowingSystemFontScale !== undefined) { 163 this.isFollowingSystemFontScale = g67.isFollowingSystemFontScale; 164 } 165 if (g67.maxFontScale !== undefined) { 166 this.maxFontScale = g67.maxFontScale; 167 } 168 if (g67.systemFontScale !== undefined) { 169 this.systemFontScale = g67.systemFontScale; 170 } 171 if (g67.editableTitleBarTheme !== undefined) { 172 this.editableTitleBarTheme = g67.editableTitleBarTheme; 173 } 174 if (g67.titleBarMargin !== undefined) { 175 this.titleBarMargin = g67.titleBarMargin; 176 } 177 if (g67.fontSize !== undefined) { 178 this.fontSize = g67.fontSize; 179 } 180 } 181 updateStateVars(f67) { 182 this.__contentMargin.reset(f67.contentMargin); 183 } 184 purgeVariableDependenciesOnElmtId(e67) { 185 this.__editableTitleBarTheme.purgeDependencyOnElmtId(e67); 186 this.__contentMargin.purgeDependencyOnElmtId(e67); 187 this.__titleBarMargin.purgeDependencyOnElmtId(e67); 188 this.__fontSize.purgeDependencyOnElmtId(e67); 189 } 190 aboutToBeDeleted() { 191 this.__editableTitleBarTheme.aboutToBeDeleted(); 192 this.__contentMargin.aboutToBeDeleted(); 193 this.__titleBarMargin.aboutToBeDeleted(); 194 this.__fontSize.aboutToBeDeleted(); 195 SubscriberManager.Get().delete(this.id__()); 196 this.aboutToBeDeletedInternal(); 197 } 198 get editableTitleBarTheme() { 199 return this.__editableTitleBarTheme.get(); 200 } 201 set editableTitleBarTheme(d67) { 202 this.__editableTitleBarTheme.set(d67); 203 } 204 get contentMargin() { 205 return this.__contentMargin.get(); 206 } 207 set contentMargin(c67) { 208 this.__contentMargin.set(c67); 209 } 210 get titleBarMargin() { 211 return this.__titleBarMargin.get(); 212 } 213 set titleBarMargin(b67) { 214 this.__titleBarMargin.set(b67); 215 } 216 get fontSize() { 217 return this.__fontSize.get(); 218 } 219 set fontSize(a67) { 220 this.__fontSize.set(a67); 221 } 222 onWillApplyTheme(z66) { 223 this.editableTitleBarTheme.iconColor = z66.colors.iconPrimary; 224 this.editableTitleBarTheme.titleColor = z66.colors.fontPrimary; 225 this.editableTitleBarTheme.subTitleColor = z66.colors.fontSecondary; 226 this.editableTitleBarTheme.iconBackgroundPressedColor = z66.colors.interactivePressed; 227 this.editableTitleBarTheme.iconBackgroundHoverColor = z66.colors.interactiveHover; 228 this.editableTitleBarTheme.iconBackgroundFocusOutlineColor = z66.colors.interactiveFocus; 229 } 230 aboutToAppear() { 231 try { 232 let y66 = this.getUIContext(); 233 this.isFollowingSystemFontScale = y66.isFollowingSystemFontScale(); 234 this.maxFontScale = y66.getMaxFontScale(); 235 } 236 catch (v66) { 237 let w66 = v66.code; 238 let x66 = v66.message; 239 hilog.error(0x3900, 'Ace', `Faild to init fontsizescale info,cause, code: ${w66}, message: ${x66}`); 240 } 241 } 242 decideFontScale() { 243 let u66 = this.getUIContext(); 244 this.systemFontScale = u66.getHostContext()?.config?.fontSizeScale ?? 1; 245 if (!this.isFollowingSystemFontScale) { 246 return 1; 247 } 248 return Math.min(this.systemFontScale, this.maxFontScale); 249 } 250 initialRender() { 251 this.observeComponentCreation2((s66, t66) => { 252 Flex.create({ 253 justifyContent: FlexAlign.SpaceBetween, 254 alignItems: ItemAlign.Stretch, 255 }); 256 Flex.backgroundColor(this.options.backgroundColor ?? EditableTitleBar.noneColor); 257 Flex.backgroundBlurStyle(this.options.backgroundBlurStyle ?? BlurStyle.NONE); 258 Flex.expandSafeArea(this.options.safeAreaTypes ? this.options.safeAreaTypes : [SafeAreaType.SYSTEM], this.options.safeAreaEdges ? this.options.safeAreaEdges : [SafeAreaEdge.TOP]); 259 }, Flex); 260 this.observeComponentCreation2((q66, r66) => { 261 Row.create(); 262 Row.width('100%'); 263 Row.margin(this.contentMargin ?? this.titleBarMargin); 264 Row.height(EditableTitleBar.totalHeight); 265 }, Row); 266 this.observeComponentCreation2((o66, p66) => { 267 Row.create(); 268 Row.flexShrink(0); 269 }, Row); 270 this.leftIconLayout.bind(this)(); 271 Row.pop(); 272 this.observeComponentCreation2((m66, n66) => { 273 Row.create(); 274 Row.width('100%'); 275 Row.flexShrink(1); 276 Row.accessibilityGroup(true); 277 Row.accessibilityDescription({ 278 'id': -1, 279 'type': 10003, 280 params: ['sys.string.subheader_accessibility_title'], 281 'bundleName': '__harDefaultBundleName__', 282 'moduleName': '__harDefaultModuleName__' 283 }); 284 }, Row); 285 this.observeComponentCreation2((i66, j66) => { 286 If.create(); 287 if (this.imageItem) { 288 this.ifElseBranchUpdateFunction(0, () => { 289 this.observeComponentCreation2((k66, l66) => { 290 Row.create(); 291 Row.flexShrink(0); 292 }, Row); 293 this.imageItemLayout.bind(this)(); 294 Row.pop(); 295 }); 296 } 297 else { 298 this.ifElseBranchUpdateFunction(1, () => { 299 }); 300 } 301 }, If); 302 If.pop(); 303 this.observeComponentCreation2((g66, h66) => { 304 Row.create(); 305 Row.width('100%'); 306 Row.flexShrink(1); 307 }, Row); 308 this.titleLayout.bind(this)(); 309 Row.pop(); 310 Row.pop(); 311 this.observeComponentCreation2((e66, f66) => { 312 Row.create(); 313 Row.flexShrink(0); 314 }, Row); 315 this.rightMenuItemsLayout.bind(this)(); 316 Row.pop(); 317 Row.pop(); 318 Flex.pop(); 319 } 320 imageItemLayout(z65 = null) { 321 { 322 this.observeComponentCreation2((a66, b66) => { 323 if (b66) { 324 let c66 = new ImageMenuItem(this, { 325 item: this.imageItem, 326 attribute: ItemType.Image, 327 }, undefined, a66, () => { }, { page: 'library/src/main/ets/components/EditableTitleBar.ets', line: 253, col: 5 }); 328 ViewPU.create(c66); 329 let i1 = () => { 330 return { 331 item: this.imageItem, 332 attribute: ItemType.Image 333 }; 334 }; 335 c66.paramsGenerator_ = i1; 336 } 337 else { 338 this.updateStateVarsOfChildByElmtId(a66, {}); 339 } 340 }, { name: 'ImageMenuItem' }); 341 } 342 } 343 leftIconLayout(o65 = null) { 344 this.observeComponentCreation2((p65, q65) => { 345 If.create(); 346 if (this.leftIconStyle === EditableLeftIconType.Back) { 347 this.ifElseBranchUpdateFunction(0, () => { 348 { 349 this.observeComponentCreation2((v65, w65) => { 350 if (w65) { 351 let x65 = new ImageMenuItem(this, { 352 item: { 353 value: PUBLIC_BACK, 354 isEnabled: true, 355 action: () => this.onCancel ? this.onCancel() : this.getUIContext()?.getRouter()?.back(), 356 defaultFocus: this.leftIconDefaultFocus 357 }, 358 fontSize: this.fontSize, 359 attribute: ItemType.LeftIcon, 360 imageMenuItemId: `BackMenuItem_${this.getUniqueId()}` 361 }, undefined, v65, () => { }, { page: 'library/src/main/ets/components/EditableTitleBar.ets', line: 262, col: 7 }); 362 ViewPU.create(x65); 363 let h1 = () => { 364 return { 365 item: { 366 value: PUBLIC_BACK, 367 isEnabled: true, 368 action: () => this.onCancel ? this.onCancel() : this.getUIContext()?.getRouter()?.back(), 369 defaultFocus: this.leftIconDefaultFocus 370 }, 371 fontSize: this.fontSize, 372 attribute: ItemType.LeftIcon, 373 imageMenuItemId: `BackMenuItem_${this.getUniqueId()}` 374 }; 375 }; 376 x65.paramsGenerator_ = h1; 377 } 378 else { 379 this.updateStateVarsOfChildByElmtId(v65, {}); 380 } 381 }, { name: 'ImageMenuItem' }); 382 } 383 }); 384 } 385 else { 386 this.ifElseBranchUpdateFunction(1, () => { 387 { 388 this.observeComponentCreation2((r65, s65) => { 389 if (s65) { 390 let t65 = new ImageMenuItem(this, { 391 item: { 392 value: PUBLIC_CANCEL, 393 isEnabled: true, 394 action: () => this.onCancel && this.onCancel(), 395 defaultFocus: this.leftIconDefaultFocus 396 }, 397 fontSize: this.fontSize, 398 attribute: ItemType.LeftIcon, 399 imageMenuItemId: `CancelMenuItem_${this.getUniqueId()}` 400 }, undefined, r65, () => { }, { page: 'library/src/main/ets/components/EditableTitleBar.ets', line: 274, col: 7 }); 401 ViewPU.create(t65); 402 let g1 = () => { 403 return { 404 item: { 405 value: PUBLIC_CANCEL, 406 isEnabled: true, 407 action: () => this.onCancel && this.onCancel(), 408 defaultFocus: this.leftIconDefaultFocus 409 }, 410 fontSize: this.fontSize, 411 attribute: ItemType.LeftIcon, 412 imageMenuItemId: `CancelMenuItem_${this.getUniqueId()}` 413 }; 414 }; 415 t65.paramsGenerator_ = g1; 416 } 417 else { 418 this.updateStateVarsOfChildByElmtId(r65, {}); 419 } 420 }, { name: 'ImageMenuItem' }); 421 } 422 }); 423 } 424 }, If); 425 If.pop(); 426 } 427 titleLayout(b65 = null) { 428 this.observeComponentCreation2((m65, n65) => { 429 Column.create(); 430 Column.height(EditableTitleBar.totalHeight); 431 Column.justifyContent(FlexAlign.Center); 432 Column.margin({ 433 start: LengthMetrics.resource({ 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_space_horizontal'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }), 434 }); 435 Column.alignItems(HorizontalAlign.Start); 436 }, Column); 437 this.observeComponentCreation2((k65, l65) => { 438 Row.create(); 439 Row.justifyContent(FlexAlign.Start); 440 }, Row); 441 this.observeComponentCreation2((i65, j65) => { 442 Text.create(this.title); 443 Text.maxFontSize(TITLE_F_VP); 444 Text.minFontSize(SUBTITLE_F_VP); 445 Text.fontColor(this.editableTitleBarTheme.titleColor); 446 Text.maxLines(this.subtitle ? MAX_LINE_ONE : MAX_LINES_TWO); 447 Text.fontWeight(FontWeight.Bold); 448 Text.textAlign(TextAlign.Start); 449 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 450 Text.heightAdaptivePolicy(this.subtitle ? 451 TextHeightAdaptivePolicy.MAX_LINES_FIRST : TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST); 452 Text.constraintSize({ 453 maxHeight: this.subtitle ? EditableTitleBar.maxMainTitleHeight : EditableTitleBar.totalHeight, 454 }); 455 }, Text); 456 Text.pop(); 457 Row.pop(); 458 this.observeComponentCreation2((c65, d65) => { 459 If.create(); 460 if (this.subtitle) { 461 this.ifElseBranchUpdateFunction(0, () => { 462 this.observeComponentCreation2((g65, h65) => { 463 Row.create(); 464 Row.margin({ 465 top: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level1'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 466 }); 467 Row.justifyContent(FlexAlign.Start); 468 }, Row); 469 this.observeComponentCreation2((e65, f65) => { 470 Text.create(this.subtitle); 471 Text.maxFontSize(SUBTITLE_F_VP); 472 Text.minFontSize(MIN_SUBTITLE_SIZE); 473 Text.fontColor(this.editableTitleBarTheme.subTitleColor); 474 Text.maxLines(MAX_LINE_ONE); 475 Text.fontWeight(FontWeight.Regular); 476 Text.textAlign(TextAlign.Start); 477 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 478 Text.heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST); 479 Text.constraintSize({ 480 maxHeight: this.title ? EditableTitleBar.maxSubTitleHeight : EditableTitleBar.totalHeight, 481 }); 482 }, Text); 483 Text.pop(); 484 Row.pop(); 485 }); 486 } 487 else { 488 this.ifElseBranchUpdateFunction(1, () => { 489 }); 490 } 491 }, If); 492 If.pop(); 493 Column.pop(); 494 } 495 rightMenuItemsLayout(w64 = null) { 496 { 497 this.observeComponentCreation2((x64, y64) => { 498 if (y64) { 499 let z64 = new EditableTitleBarMenuSection(this, { 500 menuItems: this.menuItems, 501 onSave: this.onSave, 502 isSaveEnabled: this.isSaveIconRequired, 503 fontSize: this.fontSize, 504 parentUniqueId: this.getUniqueId(), 505 saveIconDefaultFocus: this.saveIconDefaultFocus 506 }, undefined, x64, () => { }, { page: 'library/src/main/ets/components/EditableTitleBar.ets', line: 340, col: 5 }); 507 ViewPU.create(z64); 508 let f1 = () => { 509 return { 510 menuItems: this.menuItems, 511 onSave: this.onSave, 512 isSaveEnabled: this.isSaveIconRequired, 513 fontSize: this.fontSize, 514 parentUniqueId: this.getUniqueId(), 515 saveIconDefaultFocus: this.saveIconDefaultFocus 516 }; 517 }; 518 z64.paramsGenerator_ = f1; 519 } 520 else { 521 this.updateStateVarsOfChildByElmtId(x64, { 522 fontSize: this.fontSize, 523 parentUniqueId: this.getUniqueId() 524 }); 525 } 526 }, { name: 'EditableTitleBarMenuSection' }); 527 } 528 } 529 onPlaceChildren(s64, t64, u64) { 530 t64.forEach((v64) => { 531 v64.layout({ x: 0, y: 0 }); 532 }); 533 } 534 onMeasureSize(n64, o64, p64) { 535 let q64 = { width: n64.width, height: n64.height }; 536 this.fontSize = this.decideFontScale(); 537 o64.forEach((r64) => { 538 q64.height = r64.measure(p64).height; 539 q64.width = Number(p64.maxWidth); 540 }); 541 return q64; 542 } 543 rerender() { 544 this.updateDirtyElements(); 545 } 546} 547EditableTitleBar.maxCountOfExtraItems = 3; 548EditableTitleBar.maxOtherCountOfExtraItems = 2; 549EditableTitleBar.commonZero = 0; 550EditableTitleBar.noneColor = '#00000000'; 551EditableTitleBar.defaultHeight = getNumberByResource(125831115, DEFAULT_TITLE_BAR_HEIGHT); 552EditableTitleBar.defaultTitlePadding = getNumberByResource(125830920, DEFAULT_TITLE_PADDING); 553EditableTitleBar.totalHeight = EditableTitleBar.defaultHeight === EditableTitleBar.commonZero ? DEFAULT_TITLE_BAR_HEIGHT : 554EditableTitleBar.defaultHeight; 555EditableTitleBar.titlePadding = EditableTitleBar.defaultTitlePadding === EditableTitleBar.commonZero ? 556 DEFAULT_TITLE_PADDING : EditableTitleBar.defaultTitlePadding; 557EditableTitleBar.maxMainTitleHeight = (EditableTitleBar.totalHeight - EditableTitleBar.titlePadding) * MAX_MAIN_TITLE_PERCENT; 558EditableTitleBar.maxSubTitleHeight = (EditableTitleBar.totalHeight - EditableTitleBar.titlePadding) * MAX_SUB_TITLE_PERCENT; 559class EditableTitleBarMenuSection extends ViewPU { 560 constructor(h64, i64, j64, k64 = -1, l64 = undefined, m64) { 561 super(h64, j64, k64, m64); 562 if (typeof l64 === 'function') { 563 this.paramsGenerator_ = l64; 564 } 565 this.menuItems = undefined; 566 this.onSave = undefined; 567 this.isSaveEnabled = true; 568 this.saveIconDefaultFocus = false; 569 this.__fontSize = new SynchedPropertySimpleOneWayPU(i64.fontSize, this, 'fontSize'); 570 this.__parentUniqueId = new SynchedPropertySimpleOneWayPU(i64.parentUniqueId, this, 'parentUniqueId'); 571 this.setInitiallyProvidedValue(i64); 572 this.finalizeConstruction(); 573 } 574 setInitiallyProvidedValue(g64) { 575 if (g64.menuItems !== undefined) { 576 this.menuItems = g64.menuItems; 577 } 578 if (g64.onSave !== undefined) { 579 this.onSave = g64.onSave; 580 } 581 if (g64.isSaveEnabled !== undefined) { 582 this.isSaveEnabled = g64.isSaveEnabled; 583 } 584 if (g64.saveIconDefaultFocus !== undefined) { 585 this.saveIconDefaultFocus = g64.saveIconDefaultFocus; 586 } 587 if (g64.fontSize === undefined) { 588 this.__fontSize.set(1); 589 } 590 } 591 updateStateVars(f64) { 592 this.__fontSize.reset(f64.fontSize); 593 this.__parentUniqueId.reset(f64.parentUniqueId); 594 } 595 purgeVariableDependenciesOnElmtId(e64) { 596 this.__fontSize.purgeDependencyOnElmtId(e64); 597 this.__parentUniqueId.purgeDependencyOnElmtId(e64); 598 } 599 aboutToBeDeleted() { 600 this.__fontSize.aboutToBeDeleted(); 601 this.__parentUniqueId.aboutToBeDeleted(); 602 SubscriberManager.Get().delete(this.id__()); 603 this.aboutToBeDeletedInternal(); 604 } 605 get fontSize() { 606 return this.__fontSize.get(); 607 } 608 set fontSize(d64) { 609 this.__fontSize.set(d64); 610 } 611 get parentUniqueId() { 612 return this.__parentUniqueId.get(); 613 } 614 set parentUniqueId(c64) { 615 this.__parentUniqueId.set(c64); 616 } 617 initialRender() { 618 this.observeComponentCreation2((a64, b64) => { 619 Column.create(); 620 Column.justifyContent(FlexAlign.Center); 621 }, Column); 622 this.observeComponentCreation2((y63, z63) => { 623 Row.create(); 624 }, Row); 625 this.observeComponentCreation2((m63, n63) => { 626 If.create(); 627 if (this.menuItems !== undefined && this.menuItems.length > EditableTitleBar.commonZero) { 628 this.ifElseBranchUpdateFunction(0, () => { 629 this.observeComponentCreation2((o63, p63) => { 630 ForEach.create(); 631 const d1 = (r63, s63) => { 632 const t63 = r63; 633 { 634 this.observeComponentCreation2((u63, v63) => { 635 if (v63) { 636 let w63 = new ImageMenuItem(this, { 637 item: t63, 638 attribute: ItemType.Icon, 639 imageMenuItemId: `ImageMenuItem_${this.parentUniqueId}_${s63}` 640 }, undefined, u63, () => { }, { page: 'library/src/main/ets/components/EditableTitleBar.ets', line: 384, col: 15 }); 641 ViewPU.create(w63); 642 let e1 = () => { 643 return { 644 item: t63, 645 attribute: ItemType.Icon, 646 imageMenuItemId: `ImageMenuItem_${this.parentUniqueId}_${s63}` 647 }; 648 }; 649 w63.paramsGenerator_ = e1; 650 } 651 else { 652 this.updateStateVarsOfChildByElmtId(u63, {}); 653 } 654 }, { name: 'ImageMenuItem' }); 655 } 656 }; 657 this.forEachUpdateFunction(o63, this.menuItems.slice(EditableTitleBar.commonZero, this.isSaveEnabled ? 658 EditableTitleBar.maxOtherCountOfExtraItems : EditableTitleBar.maxCountOfExtraItems), d1, undefined, true, false); 659 }, ForEach); 660 ForEach.pop(); 661 }); 662 } 663 else { 664 this.ifElseBranchUpdateFunction(1, () => { 665 }); 666 } 667 }, If); 668 If.pop(); 669 this.observeComponentCreation2((g63, h63) => { 670 If.create(); 671 if (this.isSaveEnabled) { 672 this.ifElseBranchUpdateFunction(0, () => { 673 { 674 this.observeComponentCreation2((i63, j63) => { 675 if (j63) { 676 let k63 = new ImageMenuItem(this, { 677 item: { 678 value: PUBLIC_OK, 679 isEnabled: true, 680 action: () => this.onSave && this.onSave(), 681 defaultFocus: this.saveIconDefaultFocus 682 }, 683 fontSize: this.fontSize, 684 attribute: ItemType.Icon, 685 imageMenuItemId: `SaveMenuItem_${this.parentUniqueId}` 686 }, undefined, i63, () => { }, { page: 'library/src/main/ets/components/EditableTitleBar.ets', line: 392, col: 11 }); 687 ViewPU.create(k63); 688 let c1 = () => { 689 return { 690 item: { 691 value: PUBLIC_OK, 692 isEnabled: true, 693 action: () => this.onSave && this.onSave(), 694 defaultFocus: this.saveIconDefaultFocus 695 }, 696 fontSize: this.fontSize, 697 attribute: ItemType.Icon, 698 imageMenuItemId: `SaveMenuItem_${this.parentUniqueId}` 699 }; 700 }; 701 k63.paramsGenerator_ = c1; 702 } 703 else { 704 this.updateStateVarsOfChildByElmtId(i63, {}); 705 } 706 }, { name: 'ImageMenuItem' }); 707 } 708 }); 709 } 710 else { 711 this.ifElseBranchUpdateFunction(1, () => { 712 }); 713 } 714 }, If); 715 If.pop(); 716 Row.pop(); 717 Column.pop(); 718 } 719 rerender() { 720 this.updateDirtyElements(); 721 } 722} 723class ImageMenuItem extends ViewPU { 724 constructor(y62, z62, a63, b63 = -1, c63 = undefined, d63) { 725 super(y62, a63, b63, d63); 726 if (typeof c63 === 'function') { 727 this.paramsGenerator_ = c63; 728 } 729 this.item = { 730 value: '', 731 isEnabled: true, 732 label: '', 733 accessibilityLevel: 'auto', 734 accessibilityText: '', 735 accessibilityDescription: '', 736 }; 737 this.attribute = ItemType.Image; 738 this.callbackId = undefined; 739 this.minFontSize = 1.75; 740 this.maxFontSize = 3.2; 741 this.longPressTime = 500; 742 this.systemFontScale = 1; 743 this.isFollowingSystemFontScale = this.getUIContext().isFollowingSystemFontScale(); 744 this.maxFontScale = this.getUIContext().getMaxFontScale(); 745 this.__fontSize = new ObservedPropertySimplePU(1, this, 'fontSize'); 746 this.__isOnFocus = new ObservedPropertySimplePU(false, this, 'isOnFocus'); 747 this.__isOnHover = new ObservedPropertySimplePU(false, this, 'isOnHover'); 748 this.__isOnClick = new ObservedPropertySimplePU(false, this, 'isOnClick'); 749 this.imageMenuItemId = undefined; 750 this.__editableTitleBarTheme = this.initializeConsume('editableTitleBarTheme', 'editableTitleBarTheme'); 751 this.dialogController = new CustomDialogController({ 752 builder: () => { 753 let e63 = new EditableTitleBarDialog(this, { 754 cancel: () => { 755 }, 756 confirm: () => { 757 }, 758 itemEditableDialog: this.item, 759 textEditableTitleBarDialog: this.item.label ? this.item.label : this.textDialog(), 760 fontSize: this.fontSize, 761 }, undefined, -1, () => { }, { page: 'library/src/main/ets/components/EditableTitleBar.ets', line: 435, col: 14 }); 762 e63.setController(this.dialogController); 763 ViewPU.create(e63); 764 let b1 = () => { 765 return { 766 cancel: () => { 767 }, 768 confirm: () => { 769 }, 770 itemEditableDialog: this.item, 771 textEditableTitleBarDialog: this.item.label ? this.item.label : this.textDialog(), 772 fontSize: this.fontSize 773 }; 774 }; 775 e63.paramsGenerator_ = b1; 776 }, 777 maskColor: Color.Transparent, 778 isModal: true, 779 customStyle: true 780 }, this); 781 this.__buttonGestureModifier = new ObservedPropertyObjectPU(new ButtonGestureModifier(this.dialogController), this, 'buttonGestureModifier'); 782 this.envCallback = { 783 onConfigurationUpdated: (x) => { 784 if (x === undefined || !this.isFollowingSystemFontScale) { 785 this.fontSize = 1; 786 return; 787 } 788 try { 789 this.fontSize = Math.min(this.maxFontScale, x.fontSizeScale ?? 1); 790 this.buttonGestureModifier.fontSize = this.fontSize; 791 } 792 catch (y) { 793 let z = y.code; 794 let a1 = y.message; 795 hilog.error(0x3900, 'Ace', `EditableTitleBar environmentCallback error: ${z}, ${a1}`); 796 } 797 }, 798 onMemoryLevel: (w) => { 799 } 800 }; 801 this.setInitiallyProvidedValue(z62); 802 this.finalizeConstruction(); 803 } 804 setInitiallyProvidedValue(x62) { 805 if (x62.item !== undefined) { 806 this.item = x62.item; 807 } 808 if (x62.attribute !== undefined) { 809 this.attribute = x62.attribute; 810 } 811 if (x62.callbackId !== undefined) { 812 this.callbackId = x62.callbackId; 813 } 814 if (x62.minFontSize !== undefined) { 815 this.minFontSize = x62.minFontSize; 816 } 817 if (x62.maxFontSize !== undefined) { 818 this.maxFontSize = x62.maxFontSize; 819 } 820 if (x62.longPressTime !== undefined) { 821 this.longPressTime = x62.longPressTime; 822 } 823 if (x62.systemFontScale !== undefined) { 824 this.systemFontScale = x62.systemFontScale; 825 } 826 if (x62.isFollowingSystemFontScale !== undefined) { 827 this.isFollowingSystemFontScale = x62.isFollowingSystemFontScale; 828 } 829 if (x62.maxFontScale !== undefined) { 830 this.maxFontScale = x62.maxFontScale; 831 } 832 if (x62.fontSize !== undefined) { 833 this.fontSize = x62.fontSize; 834 } 835 if (x62.isOnFocus !== undefined) { 836 this.isOnFocus = x62.isOnFocus; 837 } 838 if (x62.isOnHover !== undefined) { 839 this.isOnHover = x62.isOnHover; 840 } 841 if (x62.isOnClick !== undefined) { 842 this.isOnClick = x62.isOnClick; 843 } 844 if (x62.imageMenuItemId !== undefined) { 845 this.imageMenuItemId = x62.imageMenuItemId; 846 } 847 if (x62.dialogController !== undefined) { 848 this.dialogController = x62.dialogController; 849 } 850 if (x62.buttonGestureModifier !== undefined) { 851 this.buttonGestureModifier = x62.buttonGestureModifier; 852 } 853 if (x62.envCallback !== undefined) { 854 this.envCallback = x62.envCallback; 855 } 856 } 857 updateStateVars(w62) { 858 } 859 purgeVariableDependenciesOnElmtId(v62) { 860 this.__fontSize.purgeDependencyOnElmtId(v62); 861 this.__isOnFocus.purgeDependencyOnElmtId(v62); 862 this.__isOnHover.purgeDependencyOnElmtId(v62); 863 this.__isOnClick.purgeDependencyOnElmtId(v62); 864 this.__editableTitleBarTheme.purgeDependencyOnElmtId(v62); 865 this.__buttonGestureModifier.purgeDependencyOnElmtId(v62); 866 } 867 aboutToBeDeleted() { 868 this.__fontSize.aboutToBeDeleted(); 869 this.__isOnFocus.aboutToBeDeleted(); 870 this.__isOnHover.aboutToBeDeleted(); 871 this.__isOnClick.aboutToBeDeleted(); 872 this.__editableTitleBarTheme.aboutToBeDeleted(); 873 this.__buttonGestureModifier.aboutToBeDeleted(); 874 SubscriberManager.Get().delete(this.id__()); 875 this.aboutToBeDeletedInternal(); 876 } 877 get fontSize() { 878 return this.__fontSize.get(); 879 } 880 set fontSize(u62) { 881 this.__fontSize.set(u62); 882 } 883 get isOnFocus() { 884 return this.__isOnFocus.get(); 885 } 886 set isOnFocus(t62) { 887 this.__isOnFocus.set(t62); 888 } 889 get isOnHover() { 890 return this.__isOnHover.get(); 891 } 892 set isOnHover(s62) { 893 this.__isOnHover.set(s62); 894 } 895 get isOnClick() { 896 return this.__isOnClick.get(); 897 } 898 set isOnClick(r62) { 899 this.__isOnClick.set(r62); 900 } 901 get editableTitleBarTheme() { 902 return this.__editableTitleBarTheme.get(); 903 } 904 set editableTitleBarTheme(q62) { 905 this.__editableTitleBarTheme.set(q62); 906 } 907 get buttonGestureModifier() { 908 return this.__buttonGestureModifier.get(); 909 } 910 set buttonGestureModifier(p62) { 911 this.__buttonGestureModifier.set(p62); 912 } 913 textDialog() { 914 if (this.item.value === PUBLIC_OK) { 915 return { 'id': -1, 'type': 10003, params: ['sys.string.icon_save'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 916 } 917 else if (this.item.value === PUBLIC_CANCEL) { 918 return { 'id': -1, 'type': 10003, params: ['sys.string.icon_cancel'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 919 } 920 else if (this.item.value === PUBLIC_BACK) { 921 return { 'id': -1, 'type': 10003, params: ['sys.string.icon_back'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 922 } 923 else { 924 return this.item.label ? this.item.label : ''; 925 } 926 } 927 aboutToAppear() { 928 try { 929 this.callbackId = getContext()?.getApplicationContext()?.on('environment', this.envCallback); 930 } 931 catch (t) { 932 let u = t.code; 933 let v = t.message; 934 hilog.error(0x3900, 'Ace', `EditableTitleBar Faild to get environment param error: ${u}, ${v}`); 935 } 936 this.fontSize = this.decideFontScale(); 937 this.buttonGestureModifier.fontSize = this.fontSize; 938 } 939 decideFontScale() { 940 try { 941 let s = this.getUIContext(); 942 this.systemFontScale = s.getHostContext()?.config?.fontSizeScale ?? 1; 943 if (!this.isFollowingSystemFontScale) { 944 return 1; 945 } 946 return Math.min(this.systemFontScale, this.maxFontScale); 947 } 948 catch (p) { 949 let q = p.code; 950 let r = p.message; 951 hilog.error(0x3900, 'EditableTitleBar', `Faild to decideFontScale,cause, code: ${q}, message: ${r}`); 952 return 1; 953 } 954 } 955 touchEventAction(o62) { 956 if (!this.item.isEnabled) { 957 return; 958 } 959 if (o62.type === TouchType.Down) { 960 this.isOnClick = true; 961 } 962 if (o62.type === TouchType.Up || o62.type === TouchType.Cancel) { 963 if (this.fontSize >= this.minFontSize) { 964 this.dialogController?.close(); 965 } 966 this.isOnClick = false; 967 } 968 } 969 keyEventAction(n62) { 970 if (!this.item.isEnabled) { 971 return; 972 } 973 if (n62.keyCode !== KeyCode.KEYCODE_ENTER && n62.keyCode !== KeyCode.KEYCODE_SPACE) { 974 return; 975 } 976 if (n62.type === KeyType.Down) { 977 this.isOnClick = true; 978 } 979 if (n62.type === KeyType.Up) { 980 this.isOnClick = false; 981 } 982 } 983 getBgColor() { 984 if (this.isOnClick) { 985 return this.editableTitleBarTheme.iconBackgroundPressedColor; 986 } 987 else if (this.isOnHover) { 988 return this.editableTitleBarTheme.iconBackgroundHoverColor; 989 } 990 else { 991 return this.editableTitleBarTheme.iconBackgroundColor; 992 } 993 } 994 getFgColor() { 995 if (this.isOnClick) { 996 return { 'id': -1, 'type': 10001, params: ['sys.color.titlebar_icon_background_pressed_color'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 997 } 998 else if (this.isOnHover) { 999 return { 'id': -1, 'type': 10001, params: ['sys.color.titlebar_icon_background_hover_color'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }; 1000 } 1001 else { 1002 return EditableTitleBar.noneColor; 1003 } 1004 } 1005 toStringFormat(i62) { 1006 if (typeof i62 === 'string' || typeof i62 === 'undefined') { 1007 return i62; 1008 } 1009 else { 1010 let j62 = ''; 1011 try { 1012 if (i62.id === -1) { 1013 j62 = getContext()?.resourceManager?.getStringByNameSync(i62.params?.[0]?.split('.').pop() ?? ''); 1014 } 1015 else { 1016 j62 = getContext()?.resourceManager?.getStringSync(i62); 1017 } 1018 } 1019 catch (k62) { 1020 let l62 = k62?.code; 1021 let m62 = k62?.message; 1022 hilog.error(0x3900, 'Ace', `Faild to EditableTitleBar toStringFormat, code: ${l62}, message: ${m62}`); 1023 } 1024 return j62; 1025 } 1026 } 1027 getAccessibilityReadText() { 1028 if (this.item.value === PUBLIC_OK) { 1029 return getContext()?.resourceManager?.getStringByNameSync('icon_save'); 1030 } 1031 else if (this.item.value === PUBLIC_CANCEL) { 1032 return getContext()?.resourceManager?.getStringByNameSync('icon_cancel'); 1033 } 1034 else if (this.item.value === PUBLIC_BACK) { 1035 return getContext()?.resourceManager?.getStringByNameSync('icon_back'); 1036 } 1037 else if (this.item.accessibilityText) { 1038 return this.toStringFormat(this.item.accessibilityText); 1039 } 1040 else if (this.item.label) { 1041 return this.toStringFormat(this.item.label); 1042 } 1043 return ' '; 1044 } 1045 getRightIconAccessibilityLevel() { 1046 if (this.item.accessibilityLevel && this.item.accessibilityLevel !== '') { 1047 return this.item.accessibilityLevel; 1048 } 1049 return 'auto'; 1050 } 1051 getAccessibilityDescription() { 1052 if (this.item.accessibilityDescription && this.item.accessibilityDescription !== '') { 1053 return this.toStringFormat(this.item.accessibilityDescription); 1054 } 1055 return ''; 1056 } 1057 IconBuilder(w61 = null) { 1058 this.observeComponentCreation2((d62, e62) => { 1059 Button.createWithChild({ type: ButtonType.Normal, stateEffect: this.item.isEnabled }); 1060 Button.id(this.imageMenuItemId); 1061 Button.width({ 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_width'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); 1062 Button.height({ 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_height'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); 1063 Button.focusable(this.item.isEnabled); 1064 Button.enabled(this.item.isEnabled); 1065 Button.borderRadius({ 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_shape'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); 1066 Button.margin({ 1067 start: this.attribute === ItemType.LeftIcon ? LengthMetrics.vp(EditableTitleBar.commonZero) : 1068 LengthMetrics.resource({ 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_space_horizontal'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }), 1069 }); 1070 Button.focusOnTouch(true); 1071 Button.foregroundColor(this.getFgColor()); 1072 Button.backgroundColor(this.getBgColor()); 1073 ViewStackProcessor.visualState('focused'); 1074 Button.border({ 1075 radius: { 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_shape'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1076 width: { 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_focus_outline_weight'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1077 color: this.editableTitleBarTheme.iconBackgroundFocusOutlineColor, 1078 style: BorderStyle.Solid, 1079 }); 1080 ViewStackProcessor.visualState('normal'); 1081 Button.border({ 1082 radius: { 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_shape'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1083 width: EditableTitleBar.commonZero, 1084 }); 1085 ViewStackProcessor.visualState('pressed'); 1086 Button.border({ 1087 radius: { 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_shape'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1088 width: EditableTitleBar.commonZero, 1089 }); 1090 ViewStackProcessor.visualState(); 1091 Button.onFocus(() => { 1092 if (!this.item.isEnabled) { 1093 return; 1094 } 1095 this.isOnFocus = true; 1096 }); 1097 Button.onBlur(() => this.isOnFocus = false); 1098 Button.onHover((h62) => { 1099 if (!this.item.isEnabled) { 1100 return; 1101 } 1102 this.isOnHover = h62; 1103 }); 1104 Button.onKeyEvent((g62) => { 1105 this.keyEventAction(g62); 1106 }); 1107 Button.onTouch((f62) => { 1108 this.touchEventAction(f62); 1109 }); 1110 Button.onClick(() => { 1111 if (this.item.isEnabled === undefined) { 1112 this.item.isEnabled = true; 1113 } 1114 this.item.isEnabled && this.item.action && this.item.action(); 1115 }); 1116 Button.gestureModifier(ObservedObject.GetRawObject(this.buttonGestureModifier)); 1117 Button.accessibilityLevel(this.getRightIconAccessibilityLevel()); 1118 Button.accessibilityDescription(this.getAccessibilityDescription()); 1119 }, Button); 1120 this.observeComponentCreation2((x61, y61) => { 1121 If.create(); 1122 if (this.item.symbolStyle !== undefined) { 1123 this.ifElseBranchUpdateFunction(0, () => { 1124 this.observeComponentCreation2((b62, c62) => { 1125 SymbolGlyph.create(); 1126 SymbolGlyph.fontColor([this.editableTitleBarTheme.iconColor]); 1127 SymbolGlyph.attributeModifier.bind(this)(this.item.symbolStyle); 1128 SymbolGlyph.focusable(this.item.isEnabled); 1129 SymbolGlyph.enabled(this.item.isEnabled); 1130 SymbolGlyph.draggable(false); 1131 SymbolGlyph.accessibilityText(this.getAccessibilityReadText()); 1132 SymbolGlyph.effectStrategy(SymbolEffectStrategy.NONE); 1133 SymbolGlyph.symbolEffect(new SymbolEffect(), false); 1134 SymbolGlyph.fontSize(SYMBOL_SIZE); 1135 SymbolGlyph.defaultFocus(this.item.isEnabled ? this.item.defaultFocus : false); 1136 }, SymbolGlyph); 1137 }); 1138 } 1139 else { 1140 this.ifElseBranchUpdateFunction(1, () => { 1141 this.observeComponentCreation2((z61, a62) => { 1142 If.create(); 1143 if (Util.isSymbolResource(this.item.value)) { 1144 this.ifElseBranchUpdateFunction(0, () => { 1145 this.observeComponentCreation2((n, o) => { 1146 SymbolGlyph.create(this.item.value); 1147 SymbolGlyph.fontSize(SYMBOL_SIZE); 1148 SymbolGlyph.fontColor([this.editableTitleBarTheme.iconColor]); 1149 SymbolGlyph.focusable(this.item.isEnabled); 1150 SymbolGlyph.enabled(this.item.isEnabled); 1151 SymbolGlyph.draggable(false); 1152 SymbolGlyph.accessibilityText(this.getAccessibilityReadText()); 1153 SymbolGlyph.defaultFocus(this.item.isEnabled ? this.item.defaultFocus : false); 1154 }, SymbolGlyph); 1155 }); 1156 } 1157 else { 1158 this.ifElseBranchUpdateFunction(1, () => { 1159 this.observeComponentCreation2((l, m) => { 1160 Image.create(this.item.value); 1161 Image.fillColor(this.editableTitleBarTheme.iconColor); 1162 Image.matchTextDirection(this.item.value === PUBLIC_IMAGE_BACK ? true : false); 1163 Image.width({ 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_width'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); 1164 Image.height({ 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_height'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); 1165 Image.focusable(this.item.isEnabled); 1166 Image.enabled(this.item.isEnabled); 1167 Image.draggable(false); 1168 Image.accessibilityText(this.getAccessibilityReadText()); 1169 Image.defaultFocus(this.item.isEnabled ? this.item.defaultFocus : false); 1170 }, Image); 1171 }); 1172 } 1173 }, If); 1174 If.pop(); 1175 }); 1176 } 1177 }, If); 1178 If.pop(); 1179 Button.pop(); 1180 } 1181 ImageBuilder(i61 = null) { 1182 this.observeComponentCreation2((u61, v61) => { 1183 Stack.create({ alignContent: Alignment.Center }); 1184 Stack.margin({ 1185 start: LengthMetrics.resource({ 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_space_horizontal'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }), 1186 }); 1187 }, Stack); 1188 this.observeComponentCreation2((o61, p61) => { 1189 Image.create(this.item.value); 1190 Image.width({ 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_width'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); 1191 Image.height({ 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_height'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); 1192 Image.borderRadius({ 'id': -1, 'type': 10002, params: ['sys.float.corner_radius_level10'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); 1193 Image.focusable(false); 1194 Image.enabled(this.item.isEnabled); 1195 Image.objectFit(ImageFit.Cover); 1196 }, Image); 1197 this.observeComponentCreation2((j61, k61) => { 1198 Button.createWithLabel({ type: ButtonType.Circle }); 1199 Button.width({ 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_width'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); 1200 Button.height({ 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_height'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); 1201 Button.focusable(this.item.isEnabled); 1202 Button.enabled(this.item.isEnabled); 1203 Button.foregroundColor(this.getFgColor()); 1204 Button.backgroundColor(EditableTitleBar.noneColor); 1205 ViewStackProcessor.visualState('pressed'); 1206 Button.border({ 1207 radius: { 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_shape'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1208 width: EditableTitleBar.commonZero, 1209 }); 1210 ViewStackProcessor.visualState('normal'); 1211 Button.border({ 1212 radius: { 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_shape'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1213 width: EditableTitleBar.commonZero, 1214 }); 1215 ViewStackProcessor.visualState('focused'); 1216 Button.border({ 1217 radius: { 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_shape'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1218 width: { 'id': -1, 'type': 10002, params: ['sys.float.titlebar_icon_background_focus_outline_weight'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1219 color: this.editableTitleBarTheme.iconBackgroundFocusOutlineColor, 1220 style: BorderStyle.Solid, 1221 }); 1222 ViewStackProcessor.visualState(); 1223 Button.onFocus(() => { 1224 if (!this.item.isEnabled) { 1225 return; 1226 } 1227 this.isOnFocus = true; 1228 }); 1229 Button.onBlur(() => this.isOnFocus = false); 1230 Button.onHover((n61) => { 1231 if (!this.item.isEnabled) { 1232 return; 1233 } 1234 this.isOnHover = n61; 1235 }); 1236 Button.onKeyEvent((m61) => { 1237 this.keyEventAction(m61); 1238 }); 1239 Button.onTouch((l61) => { 1240 this.touchEventAction(l61); 1241 }); 1242 Button.onClick(() => { 1243 if (this.item.isEnabled === undefined) { 1244 this.item.isEnabled = true; 1245 } 1246 this.item.isEnabled && this.item.action && this.item.action(); 1247 }); 1248 Button.gestureModifier(ObservedObject.GetRawObject(this.buttonGestureModifier)); 1249 Button.defaultFocus(this.item.isEnabled ? this.item.defaultFocus : false); 1250 }, Button); 1251 Button.pop(); 1252 Stack.pop(); 1253 } 1254 initialRender() { 1255 this.observeComponentCreation2((g61, h61) => { 1256 If.create(); 1257 if (this.attribute === ItemType.Icon || this.attribute === ItemType.LeftIcon) { 1258 this.ifElseBranchUpdateFunction(0, () => { 1259 this.IconBuilder.bind(this)(); 1260 }); 1261 } 1262 else { 1263 this.ifElseBranchUpdateFunction(1, () => { 1264 this.ImageBuilder.bind(this)(); 1265 }); 1266 } 1267 }, If); 1268 If.pop(); 1269 } 1270 rerender() { 1271 this.updateDirtyElements(); 1272 } 1273} 1274class EditableTitleBarDialog extends ViewPU { 1275 constructor(a61, b61, c61, d61 = -1, e61 = undefined, f61) { 1276 super(a61, c61, d61, f61); 1277 if (typeof e61 === 'function') { 1278 this.paramsGenerator_ = e61; 1279 } 1280 this.itemEditableDialog = { 1281 value: '', 1282 isEnabled: true, 1283 }; 1284 this.callbackId = undefined; 1285 this.textEditableTitleBarDialog = ''; 1286 this.mainWindowStage = undefined; 1287 this.controller = undefined; 1288 this.minFontSize = 1.75; 1289 this.maxFontSize = 3.2; 1290 this.screenWidth = 640; 1291 this.verticalScreenLines = 6; 1292 this.horizontalsScreenLines = 1; 1293 this.cancel = () => { 1294 }; 1295 this.confirm = () => { 1296 }; 1297 this.__mainWindow = this.createStorageLink('mainWindow', undefined, 'mainWindow'); 1298 this.__fontSize = new SynchedPropertySimpleOneWayPU(b61.fontSize, this, 'fontSize'); 1299 this.__maxLines = new ObservedPropertySimplePU(1, this, 'maxLines'); 1300 this.__windowStandardHeight = this.createStorageProp('windowStandardHeight', 0, 'windowStandardHeight'); 1301 this.setInitiallyProvidedValue(b61); 1302 this.finalizeConstruction(); 1303 } 1304 setInitiallyProvidedValue(z60) { 1305 if (z60.itemEditableDialog !== undefined) { 1306 this.itemEditableDialog = z60.itemEditableDialog; 1307 } 1308 if (z60.callbackId !== undefined) { 1309 this.callbackId = z60.callbackId; 1310 } 1311 if (z60.textEditableTitleBarDialog !== undefined) { 1312 this.textEditableTitleBarDialog = z60.textEditableTitleBarDialog; 1313 } 1314 if (z60.mainWindowStage !== undefined) { 1315 this.mainWindowStage = z60.mainWindowStage; 1316 } 1317 if (z60.controller !== undefined) { 1318 this.controller = z60.controller; 1319 } 1320 if (z60.minFontSize !== undefined) { 1321 this.minFontSize = z60.minFontSize; 1322 } 1323 if (z60.maxFontSize !== undefined) { 1324 this.maxFontSize = z60.maxFontSize; 1325 } 1326 if (z60.screenWidth !== undefined) { 1327 this.screenWidth = z60.screenWidth; 1328 } 1329 if (z60.verticalScreenLines !== undefined) { 1330 this.verticalScreenLines = z60.verticalScreenLines; 1331 } 1332 if (z60.horizontalsScreenLines !== undefined) { 1333 this.horizontalsScreenLines = z60.horizontalsScreenLines; 1334 } 1335 if (z60.cancel !== undefined) { 1336 this.cancel = z60.cancel; 1337 } 1338 if (z60.confirm !== undefined) { 1339 this.confirm = z60.confirm; 1340 } 1341 if (z60.fontSize === undefined) { 1342 this.__fontSize.set(1); 1343 } 1344 if (z60.maxLines !== undefined) { 1345 this.maxLines = z60.maxLines; 1346 } 1347 } 1348 updateStateVars(y60) { 1349 this.__fontSize.reset(y60.fontSize); 1350 } 1351 purgeVariableDependenciesOnElmtId(x60) { 1352 this.__mainWindow.purgeDependencyOnElmtId(x60); 1353 this.__fontSize.purgeDependencyOnElmtId(x60); 1354 this.__maxLines.purgeDependencyOnElmtId(x60); 1355 this.__windowStandardHeight.purgeDependencyOnElmtId(x60); 1356 } 1357 aboutToBeDeleted() { 1358 this.__mainWindow.aboutToBeDeleted(); 1359 this.__fontSize.aboutToBeDeleted(); 1360 this.__maxLines.aboutToBeDeleted(); 1361 this.__windowStandardHeight.aboutToBeDeleted(); 1362 SubscriberManager.Get().delete(this.id__()); 1363 this.aboutToBeDeletedInternal(); 1364 } 1365 setController(w60) { 1366 this.controller = w60; 1367 } 1368 get mainWindow() { 1369 return this.__mainWindow.get(); 1370 } 1371 set mainWindow(v60) { 1372 this.__mainWindow.set(v60); 1373 } 1374 get fontSize() { 1375 return this.__fontSize.get(); 1376 } 1377 set fontSize(u60) { 1378 this.__fontSize.set(u60); 1379 } 1380 get maxLines() { 1381 return this.__maxLines.get(); 1382 } 1383 set maxLines(t60) { 1384 this.__maxLines.set(t60); 1385 } 1386 get windowStandardHeight() { 1387 return this.__windowStandardHeight.get(); 1388 } 1389 set windowStandardHeight(s60) { 1390 this.__windowStandardHeight.set(s60); 1391 } 1392 initialRender() { 1393 this.observeComponentCreation2((w59, x59) => { 1394 If.create(); 1395 if (this.textEditableTitleBarDialog) { 1396 this.ifElseBranchUpdateFunction(0, () => { 1397 this.observeComponentCreation2((q60, r60) => { 1398 Column.create(); 1399 Column.width(this.fontSize === this.maxFontSize ? MAX_DIALOG : MIN_DIALOG); 1400 Column.constraintSize({ minHeight: this.fontSize === this.maxFontSize ? MAX_DIALOG : MIN_DIALOG }); 1401 Column.backgroundBlurStyle(BlurStyle.COMPONENT_ULTRA_THICK); 1402 Column.shadow(ShadowStyle.OUTER_DEFAULT_LG); 1403 Column.borderRadius(({ 'id': -1, 'type': 10002, params: ['sys.float.corner_radius_level10'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' })); 1404 }, Column); 1405 this.observeComponentCreation2((k60, l60) => { 1406 If.create(); 1407 if (this.itemEditableDialog.symbolStyle !== undefined) { 1408 this.ifElseBranchUpdateFunction(0, () => { 1409 this.observeComponentCreation2((o60, p60) => { 1410 SymbolGlyph.create(); 1411 SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.icon_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]); 1412 SymbolGlyph.attributeModifier.bind(this)(this.itemEditableDialog.symbolStyle); 1413 SymbolGlyph.margin({ 1414 top: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level24'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1415 bottom: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level8'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1416 }); 1417 SymbolGlyph.effectStrategy(SymbolEffectStrategy.NONE); 1418 SymbolGlyph.symbolEffect(new SymbolEffect(), false); 1419 SymbolGlyph.fontSize(SYMBOL_TITLE_SIZE); 1420 SymbolGlyph.direction(Direction.Ltr); 1421 }, SymbolGlyph); 1422 }); 1423 } 1424 else { 1425 this.ifElseBranchUpdateFunction(1, () => { 1426 this.observeComponentCreation2((m60, n60) => { 1427 If.create(); 1428 if (Util.isSymbolResource(this.itemEditableDialog.value)) { 1429 this.ifElseBranchUpdateFunction(0, () => { 1430 this.observeComponentCreation2((j, k) => { 1431 SymbolGlyph.create(this.itemEditableDialog.value); 1432 SymbolGlyph.margin({ 1433 top: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level24'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1434 bottom: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level8'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1435 }); 1436 SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.icon_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]); 1437 SymbolGlyph.fontSize(SYMBOL_TITLE_SIZE); 1438 SymbolGlyph.direction(Direction.Ltr); 1439 }, SymbolGlyph); 1440 }); 1441 } 1442 else { 1443 this.ifElseBranchUpdateFunction(1, () => { 1444 this.observeComponentCreation2((h, i) => { 1445 Image.create(this.itemEditableDialog.value); 1446 Image.width(IMAGE_SIZE); 1447 Image.height(IMAGE_SIZE); 1448 Image.margin({ 1449 top: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level24'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1450 bottom: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level8'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1451 }); 1452 Image.fillColor({ 'id': -1, 'type': 10001, params: ['sys.color.icon_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); 1453 Image.direction(Direction.Ltr); 1454 }, Image); 1455 }); 1456 } 1457 }, If); 1458 If.pop(); 1459 }); 1460 } 1461 }, If); 1462 If.pop(); 1463 this.observeComponentCreation2((i60, j60) => { 1464 Column.create(); 1465 Column.width('100%'); 1466 Column.padding({ 1467 left: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level4'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1468 right: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level4'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1469 bottom: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level12'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, 1470 }); 1471 }, Column); 1472 this.observeComponentCreation2((g60, h60) => { 1473 Text.create(this.textEditableTitleBarDialog); 1474 Text.fontSize(TEXT_EDITABLE_DIALOG); 1475 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 1476 Text.maxLines(this.maxLines); 1477 Text.width('100%'); 1478 Text.textAlign(TextAlign.Center); 1479 Text.fontColor({ 'id': -1, 'type': 10001, params: ['sys.color.font_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); 1480 }, Text); 1481 Text.pop(); 1482 Column.pop(); 1483 Column.pop(); 1484 }); 1485 } 1486 else { 1487 this.ifElseBranchUpdateFunction(1, () => { 1488 this.observeComponentCreation2((e60, f60) => { 1489 Column.create(); 1490 Column.width(this.fontSize === this.maxFontSize ? MAX_DIALOG : MIN_DIALOG); 1491 Column.constraintSize({ minHeight: this.fontSize === this.maxFontSize ? MAX_DIALOG : MIN_DIALOG }); 1492 Column.backgroundBlurStyle(BlurStyle.COMPONENT_ULTRA_THICK); 1493 Column.shadow(ShadowStyle.OUTER_DEFAULT_LG); 1494 Column.borderRadius(({ 'id': -1, 'type': 10002, params: ['sys.float.corner_radius_level10'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' })); 1495 Column.justifyContent(FlexAlign.Center); 1496 Column.direction(Direction.Ltr); 1497 }, Column); 1498 this.observeComponentCreation2((y59, z59) => { 1499 If.create(); 1500 if (this.itemEditableDialog.symbolStyle !== undefined) { 1501 this.ifElseBranchUpdateFunction(0, () => { 1502 this.observeComponentCreation2((c60, d60) => { 1503 SymbolGlyph.create(); 1504 SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.icon_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]); 1505 SymbolGlyph.attributeModifier.bind(this)(this.itemEditableDialog.symbolStyle); 1506 SymbolGlyph.effectStrategy(SymbolEffectStrategy.NONE); 1507 SymbolGlyph.symbolEffect(new SymbolEffect(), false); 1508 SymbolGlyph.fontSize(SYMBOL_TITLE_SIZE); 1509 }, SymbolGlyph); 1510 }); 1511 } 1512 else { 1513 this.ifElseBranchUpdateFunction(1, () => { 1514 this.observeComponentCreation2((a60, b60) => { 1515 If.create(); 1516 if (Util.isSymbolResource(this.itemEditableDialog.value)) { 1517 this.ifElseBranchUpdateFunction(0, () => { 1518 this.observeComponentCreation2((f, g) => { 1519 SymbolGlyph.create(this.itemEditableDialog.value); 1520 SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.icon_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]); 1521 SymbolGlyph.fontSize(SYMBOL_TITLE_SIZE); 1522 }, SymbolGlyph); 1523 }); 1524 } 1525 else { 1526 this.ifElseBranchUpdateFunction(1, () => { 1527 this.observeComponentCreation2((d, e) => { 1528 Image.create(this.itemEditableDialog.value); 1529 Image.width(IMAGE_SIZE); 1530 Image.height(IMAGE_SIZE); 1531 Image.fillColor({ 'id': -1, 'type': 10001, params: ['sys.color.icon_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); 1532 }, Image); 1533 }); 1534 } 1535 }, If); 1536 If.pop(); 1537 }); 1538 } 1539 }, If); 1540 If.pop(); 1541 Column.pop(); 1542 }); 1543 } 1544 }, If); 1545 If.pop(); 1546 } 1547 async aboutToAppear() { 1548 let t59 = this.getUIContext().getHostContext(); 1549 this.mainWindowStage = t59.windowStage.getMainWindowSync(); 1550 let u59 = this.mainWindowStage.getWindowProperties(); 1551 let v59 = u59.windowRect; 1552 if (px2vp(v59.height) > this.screenWidth) { 1553 this.maxLines = this.verticalScreenLines; 1554 } 1555 else { 1556 this.maxLines = this.horizontalsScreenLines; 1557 } 1558 } 1559 rerender() { 1560 this.updateDirtyElements(); 1561 } 1562} 1563function getNumberByResource(n59, o59) { 1564 try { 1565 let s59 = resourceManager.getSystemResourceManager().getNumber(n59); 1566 if (s59 === 0) { 1567 return o59; 1568 } 1569 else { 1570 return s59; 1571 } 1572 } 1573 catch (p59) { 1574 let q59 = p59.code; 1575 let r59 = p59.message; 1576 hilog.error(0x3900, 'Ace', `EditableTitleBar getNumberByResource error, code: ${q59},message:${r59}`); 1577 return 0; 1578 } 1579} 1580class Util { 1581 static isSymbolResource(b) { 1582 if (!Util.isResourceType(b)) { 1583 return false; 1584 } 1585 let c = b; 1586 return c.type === Util.RESOURCE_TYPE_SYMBOL; 1587 } 1588 static isResourceType(a) { 1589 if (!a) { 1590 return false; 1591 } 1592 if (typeof a === 'string' || typeof a === 'undefined') { 1593 return false; 1594 } 1595 return true; 1596 } 1597} 1598Util.RESOURCE_TYPE_SYMBOL = 40000; 1599 1600export default { 1601 EditableLeftIconType: EditableLeftIconType, 1602 EditableTitleBar: EditableTitleBar, 1603}; 1604