1/* 2 * Copyright (c) 2023-2023 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 16const SPACE_MARGIN = 8; 17const MARGIN_NUM = 4; 18const IMAGE_WIDTH_NUM = 16; 19const IMAGE_HEIGHT_NUM = 24; 20const BUTTON_SIZE = 32; 21const SINGLE_LINE_HEIGHT = 48; 22const DOUBLE_LINE_HEIGHT = 64; 23const BUTTON_HEIGHT = 28; 24const IMAGE_WIDTH = 12; 25const BORDER_WIDTH = 2; 26const SINGLE_LINE_NUM = 1; 27const DOUBLE_LINE_NUM = 2; 28const MIN_FONT_SIZE = 14; 29const MAIN_TEXT_SIZE = 10; 30const MIN_CONSTRAINT_WIDTH = 3; 31 32export var OperationType; 33!function(e){ 34 e[e.TEXT_ARROW=0] = "TEXT_ARROW"; 35 e[e.BUTTON=1] = "BUTTON"; 36 e[e.ICON_GROUP=2] = "ICON_GROUP"; 37 e[e.LOADING=3] = "LOADING" 38}(OperationType || (OperationType = {})); 39 40class ButtonStyle extends ViewPU { 41 constructor(e, o, t, s = -1) { 42 super(e, t, s); 43 this.__buttonBgColor = new ObservedPropertyObjectPU({ 44 id: -1, 45 type: 10001, 46 params: ["sys.color.ohos_id_color_background"], 47 bundleName: "", 48 moduleName: "" 49 }, this, "buttonBgColor"); 50 this.__isButtonFocus = new ObservedPropertySimplePU(!1, this, "isButtonFocus"); 51 this.button = void 0; 52 this.focusBorderWidth = 2; 53 this.setInitiallyProvidedValue(o) 54 } 55 56 setInitiallyProvidedValue(e) { 57 void 0 !== e.buttonBgColor && (this.buttonBgColor = e.buttonBgColor); 58 void 0 !== e.isButtonFocus && (this.isButtonFocus = e.isButtonFocus); 59 void 0 !== e.button && (this.button = e.button); 60 void 0 !== e.focusBorderWidth && (this.focusBorderWidth = e.focusBorderWidth) 61 } 62 63 updateStateVars(e) { 64 } 65 66 purgeVariableDependenciesOnElmtId(e) { 67 this.__buttonBgColor.purgeDependencyOnElmtId(e); 68 this.__isButtonFocus.purgeDependencyOnElmtId(e) 69 } 70 71 aboutToBeDeleted() { 72 this.__buttonBgColor.aboutToBeDeleted(); 73 this.__isButtonFocus.aboutToBeDeleted(); 74 SubscriberManager.Get().delete(this.id__()); 75 this.aboutToBeDeletedInternal() 76 } 77 78 get buttonBgColor() { 79 return this.__buttonBgColor.get() 80 } 81 82 set buttonBgColor(e) { 83 this.__buttonBgColor.set(e) 84 } 85 86 get isButtonFocus() { 87 return this.__isButtonFocus.get() 88 } 89 90 set isButtonFocus(e) { 91 this.__isButtonFocus.set(e) 92 } 93 94 initialRender() { 95 this.observeComponentCreation(((e, o) => { 96 ViewStackProcessor.StartGetAccessRecordingFor(e); 97 Row.create(); 98 Row.align(Alignment.End); 99 Row.justifyContent(FlexAlign.Center); 100 Row.focusable(!0); 101 Row.height(28); 102 Row.margin({ left: 8, right: 8 }); 103 Row.borderRadius(16); 104 Row.backgroundColor(ObservedObject.GetRawObject(this.buttonBgColor)); 105 Row.onTouch((e => { 106 if (e.type === TouchType.Down) { 107 this.button.action && this.button.action(); 108 this.buttonBgColor = { 109 id: -1, 110 type: 10001, 111 params: ["sys.color.ohos_id_color_click_effect"], 112 bundleName: "", 113 moduleName: "" 114 } 115 } 116 e.type === TouchType.Up && (this.buttonBgColor = { 117 id: -1, 118 type: 10001, 119 params: ["sys.color.ohos_id_color_background"], 120 bundleName: "", 121 moduleName: "" 122 }) 123 })); 124 Row.onHover((e => { 125 this.buttonBgColor = e ? { 126 id: -1, 127 type: 10001, 128 params: ["sys.color.ohos_id_color_hover"], 129 bundleName: "", 130 moduleName: "" 131 } : { 132 id: -1, 133 type: 10001, 134 params: ["sys.color.ohos_id_color_background"], 135 bundleName: "", 136 moduleName: "" 137 } 138 })); 139 Row.border(this.isButtonFocus ? { 140 width: this.focusBorderWidth, 141 color: { 142 id: -1, 143 type: 10001, 144 params: ["sys.color.ohos_id_color_focused_outline"], 145 bundleName: "", 146 moduleName: "" 147 }, 148 style: BorderStyle.Solid 149 } : { width: 0 }); 150 Row.onFocus((() => { 151 this.isButtonFocus = !0 152 })); 153 Row.onBlur((() => { 154 this.isButtonFocus = !1 155 })); 156 Row.onKeyEvent((e => { 157 2054 !== e.keyCode && 2050 !== e.keyCode || this.button.action && this.button.action() 158 })); 159 o || Row.pop(); 160 ViewStackProcessor.StopGetAccessRecording() 161 })); 162 this.observeComponentCreation(((e, o) => { 163 ViewStackProcessor.StartGetAccessRecordingFor(e); 164 Text.create(this.button.value); 165 Text.fontColor({ 166 id: -1, 167 type: 10001, 168 params: ["sys.color.ohos_id_color_text_primary_activated"], 169 bundleName: "", 170 moduleName: "" 171 }); 172 Text.fontSize({ 173 id: -1, 174 type: 10002, 175 params: ["sys.float.ohos_id_text_size_button2"], 176 bundleName: "", 177 moduleName: "" 178 }); 179 Text.fontWeight(FontWeight.Medium); 180 Text.margin({ left: 8, right: 8 }); 181 Text.focusable(!0); 182 Text.maxLines(2); 183 o || Text.pop(); 184 ViewStackProcessor.StopGetAccessRecording() 185 })); 186 Text.pop(); 187 Row.pop() 188 } 189 190 rerender() { 191 this.updateDirtyElements() 192 } 193} 194 195class IconGroup extends ViewPU { 196 constructor(e, o, t, s = -1) { 197 super(e, t, s); 198 this.__bgColor = new ObservedPropertyObjectPU({ 199 id: -1, 200 type: 10001, 201 params: ["sys.color.ohos_id_color_background"], 202 bundleName: "", 203 moduleName: "" 204 }, this, "bgColor"); 205 this.__isFocus = new ObservedPropertySimplePU(!1, this, "isFocus"); 206 this.item = void 0; 207 this.focusBorderWidth = 2; 208 this.setInitiallyProvidedValue(o) 209 } 210 211 setInitiallyProvidedValue(e) { 212 void 0 !== e.bgColor && (this.bgColor = e.bgColor); 213 void 0 !== e.isFocus && (this.isFocus = e.isFocus); 214 void 0 !== e.item && (this.item = e.item); 215 void 0 !== e.focusBorderWidth && (this.focusBorderWidth = e.focusBorderWidth) 216 } 217 218 updateStateVars(e) { 219 } 220 221 purgeVariableDependenciesOnElmtId(e) { 222 this.__bgColor.purgeDependencyOnElmtId(e); 223 this.__isFocus.purgeDependencyOnElmtId(e) 224 } 225 226 aboutToBeDeleted() { 227 this.__bgColor.aboutToBeDeleted(); 228 this.__isFocus.aboutToBeDeleted(); 229 SubscriberManager.Get().delete(this.id__()); 230 this.aboutToBeDeletedInternal() 231 } 232 233 get bgColor() { 234 return this.__bgColor.get() 235 } 236 237 set bgColor(e) { 238 this.__bgColor.set(e) 239 } 240 241 get isFocus() { 242 return this.__isFocus.get() 243 } 244 245 set isFocus(e) { 246 this.__isFocus.set(e) 247 } 248 249 initialRender() { 250 this.observeComponentCreation(((e, o) => { 251 ViewStackProcessor.StartGetAccessRecordingFor(e); 252 Row.create(); 253 Row.focusable(!0); 254 Row.width(32); 255 Row.height(32); 256 Row.margin({ right: 8 }); 257 Row.justifyContent(FlexAlign.Center); 258 Row.borderRadius({ 259 id: -1, 260 type: 10002, 261 params: ["sys.float.ohos_id_corner_radius_clicked"], 262 bundleName: "", 263 moduleName: "" 264 }); 265 Row.backgroundColor(ObservedObject.GetRawObject(this.bgColor)); 266 Row.onTouch((e => { 267 if (e.type === TouchType.Down) { 268 this.item.action && this.item.action(); 269 this.bgColor = { 270 id: -1, 271 type: 10001, 272 params: ["sys.color.ohos_id_color_click_effect"], 273 bundleName: "", 274 moduleName: "" 275 } 276 } 277 e.type === TouchType.Up && (this.bgColor = { 278 id: -1, 279 type: 10001, 280 params: ["sys.color.ohos_id_color_background"], 281 bundleName: "", 282 moduleName: "" 283 }) 284 })); 285 Row.onHover((e => { 286 this.bgColor = e ? { 287 id: -1, 288 type: 10001, 289 params: ["sys.color.ohos_id_color_hover"], 290 bundleName: "", 291 moduleName: "" 292 } : { 293 id: -1, 294 type: 10001, 295 params: ["sys.color.ohos_id_color_background"], 296 bundleName: "", 297 moduleName: "" 298 } 299 })); 300 Row.border(this.isFocus ? { 301 width: this.focusBorderWidth, 302 color: { 303 id: -1, 304 type: 10001, 305 params: ["sys.color.ohos_id_color_emphasize"], 306 bundleName: "", 307 moduleName: "" 308 }, 309 style: BorderStyle.Solid 310 } : { width: 0 }); 311 Row.onFocus((() => { 312 this.isFocus = !0 313 })); 314 Row.onBlur((() => { 315 this.isFocus = !1 316 })); 317 Row.onKeyEvent((e => { 318 2054 !== e.keyCode && 2050 !== e.keyCode || this.item.action && this.item.action() 319 })); 320 o || Row.pop(); 321 ViewStackProcessor.StopGetAccessRecording() 322 })); 323 this.observeComponentCreation(((e, o) => { 324 ViewStackProcessor.StartGetAccessRecordingFor(e); 325 Image.create(this.item.value); 326 Image.fillColor({ 327 id: -1, 328 type: 10001, 329 params: ["sys.color.ohos_id_color_primary"], 330 bundleName: "", 331 moduleName: "" 332 }); 333 Image.width(24); 334 Image.height(24); 335 Image.focusable(!0); 336 o || Image.pop(); 337 ViewStackProcessor.StopGetAccessRecording() 338 })); 339 Row.pop() 340 } 341 342 rerender() { 343 this.updateDirtyElements() 344 } 345} 346 347export class SubHeader extends ViewPU { 348 constructor(e, o, t, s = -1) { 349 super(e, t, s); 350 this.__icon = new SynchedPropertyObjectOneWayPU(o.icon, this, "icon"); 351 this.__primaryTitle = new SynchedPropertySimpleOneWayPU(o.primaryTitle, this, "primaryTitle"); 352 this.__secondaryTitle = new SynchedPropertySimpleOneWayPU(o.secondaryTitle, this, "secondaryTitle"); 353 this.__select = new SynchedPropertyObjectOneWayPU(o.select, this, "select"); 354 this.__operationType = new SynchedPropertySimpleOneWayPU(o.operationType, this, "operationType"); 355 this.operationItem = void 0; 356 this.__isDuplicateLine = new ObservedPropertySimplePU(!1, this, "isDuplicateLine"); 357 this.__textArrowBgColor = new ObservedPropertyObjectPU({ 358 id: -1, 359 type: 10001, 360 params: ["sys.color.ohos_id_color_background"], 361 bundleName: "", 362 moduleName: "" 363 }, this, "textArrowBgColor"); 364 this.__buttonBgColor = new ObservedPropertyObjectPU({ 365 id: -1, 366 type: 10001, 367 params: ["sys.color.ohos_id_color_background"], 368 bundleName: "", 369 moduleName: "" 370 }, this, "buttonBgColor"); 371 this.__iconBgColor = new ObservedPropertyObjectPU({ 372 id: -1, 373 type: 10001, 374 params: ["sys.color.ohos_id_color_background"], 375 bundleName: "", 376 moduleName: "" 377 }, this, "iconBgColor"); 378 this.__firstIconBgColor = new ObservedPropertyObjectPU({ 379 id: -1, 380 type: 10001, 381 params: ["sys.color.ohos_id_color_background"], 382 bundleName: "", 383 moduleName: "" 384 }, this, "firstIconBgColor"); 385 this.__SecondaryIconBgColor = new ObservedPropertyObjectPU({ 386 id: -1, 387 type: 10001, 388 params: ["sys.color.ohos_id_color_background"], 389 bundleName: "", 390 moduleName: "" 391 }, this, "SecondaryIconBgColor"); 392 this.__thirdIconBgColor = new ObservedPropertyObjectPU({ 393 id: -1, 394 type: 10001, 395 params: ["sys.color.ohos_id_color_background"], 396 bundleName: "", 397 moduleName: "" 398 }, this, "thirdIconBgColor"); 399 this.__flag = new ObservedPropertySimplePU(!1, this, "flag"); 400 this.__isTextArrowFocus = new ObservedPropertySimplePU(!1, this, "isTextArrowFocus"); 401 this.focusBorderWidth = 2; 402 this.setInitiallyProvidedValue(o) 403 } 404 405 setInitiallyProvidedValue(e) { 406 void 0 !== e.operationType ? this.__operationType.set(e.operationType) : this.__operationType.set(OperationType.BUTTON); 407 void 0 !== e.operationItem && (this.operationItem = e.operationItem); 408 void 0 !== e.isDuplicateLine && (this.isDuplicateLine = e.isDuplicateLine); 409 void 0 !== e.textArrowBgColor && (this.textArrowBgColor = e.textArrowBgColor); 410 void 0 !== e.buttonBgColor && (this.buttonBgColor = e.buttonBgColor); 411 void 0 !== e.iconBgColor && (this.iconBgColor = e.iconBgColor); 412 void 0 !== e.firstIconBgColor && (this.firstIconBgColor = e.firstIconBgColor); 413 void 0 !== e.SecondaryIconBgColor && (this.SecondaryIconBgColor = e.SecondaryIconBgColor); 414 void 0 !== e.thirdIconBgColor && (this.thirdIconBgColor = e.thirdIconBgColor); 415 void 0 !== e.flag && (this.flag = e.flag); 416 void 0 !== e.isTextArrowFocus && (this.isTextArrowFocus = e.isTextArrowFocus); 417 void 0 !== e.focusBorderWidth && (this.focusBorderWidth = e.focusBorderWidth) 418 } 419 420 updateStateVars(e) { 421 this.__icon.reset(e.icon); 422 this.__primaryTitle.reset(e.primaryTitle); 423 this.__secondaryTitle.reset(e.secondaryTitle); 424 this.__select.reset(e.select); 425 this.__operationType.reset(e.operationType) 426 } 427 428 purgeVariableDependenciesOnElmtId(e) { 429 this.__icon.purgeDependencyOnElmtId(e); 430 this.__primaryTitle.purgeDependencyOnElmtId(e); 431 this.__secondaryTitle.purgeDependencyOnElmtId(e); 432 this.__select.purgeDependencyOnElmtId(e); 433 this.__operationType.purgeDependencyOnElmtId(e); 434 this.__isDuplicateLine.purgeDependencyOnElmtId(e); 435 this.__textArrowBgColor.purgeDependencyOnElmtId(e); 436 this.__buttonBgColor.purgeDependencyOnElmtId(e); 437 this.__iconBgColor.purgeDependencyOnElmtId(e); 438 this.__firstIconBgColor.purgeDependencyOnElmtId(e); 439 this.__SecondaryIconBgColor.purgeDependencyOnElmtId(e); 440 this.__thirdIconBgColor.purgeDependencyOnElmtId(e); 441 this.__flag.purgeDependencyOnElmtId(e); 442 this.__isTextArrowFocus.purgeDependencyOnElmtId(e) 443 } 444 445 aboutToBeDeleted() { 446 this.__icon.aboutToBeDeleted(); 447 this.__primaryTitle.aboutToBeDeleted(); 448 this.__secondaryTitle.aboutToBeDeleted(); 449 this.__select.aboutToBeDeleted(); 450 this.__operationType.aboutToBeDeleted(); 451 this.__isDuplicateLine.aboutToBeDeleted(); 452 this.__textArrowBgColor.aboutToBeDeleted(); 453 this.__buttonBgColor.aboutToBeDeleted(); 454 this.__iconBgColor.aboutToBeDeleted(); 455 this.__firstIconBgColor.aboutToBeDeleted(); 456 this.__SecondaryIconBgColor.aboutToBeDeleted(); 457 this.__thirdIconBgColor.aboutToBeDeleted(); 458 this.__flag.aboutToBeDeleted(); 459 this.__isTextArrowFocus.aboutToBeDeleted(); 460 SubscriberManager.Get().delete(this.id__()); 461 this.aboutToBeDeletedInternal() 462 } 463 464 get icon() { 465 return this.__icon.get() 466 } 467 468 set icon(e) { 469 this.__icon.set(e) 470 } 471 472 get primaryTitle() { 473 return this.__primaryTitle.get() 474 } 475 476 set primaryTitle(e) { 477 this.__primaryTitle.set(e) 478 } 479 480 get secondaryTitle() { 481 return this.__secondaryTitle.get() 482 } 483 484 set secondaryTitle(e) { 485 this.__secondaryTitle.set(e) 486 } 487 488 get select() { 489 return this.__select.get() 490 } 491 492 set select(e) { 493 this.__select.set(e) 494 } 495 496 get operationType() { 497 return this.__operationType.get() 498 } 499 500 set operationType(e) { 501 this.__operationType.set(e) 502 } 503 504 get isDuplicateLine() { 505 return this.__isDuplicateLine.get() 506 } 507 508 set isDuplicateLine(e) { 509 this.__isDuplicateLine.set(e) 510 } 511 512 get textArrowBgColor() { 513 return this.__textArrowBgColor.get() 514 } 515 516 set textArrowBgColor(e) { 517 this.__textArrowBgColor.set(e) 518 } 519 520 get buttonBgColor() { 521 return this.__buttonBgColor.get() 522 } 523 524 set buttonBgColor(e) { 525 this.__buttonBgColor.set(e) 526 } 527 528 get iconBgColor() { 529 return this.__iconBgColor.get() 530 } 531 532 set iconBgColor(e) { 533 this.__iconBgColor.set(e) 534 } 535 536 get firstIconBgColor() { 537 return this.__firstIconBgColor.get() 538 } 539 540 set firstIconBgColor(e) { 541 this.__firstIconBgColor.set(e) 542 } 543 544 get SecondaryIconBgColor() { 545 return this.__SecondaryIconBgColor.get() 546 } 547 548 set SecondaryIconBgColor(e) { 549 this.__SecondaryIconBgColor.set(e) 550 } 551 552 get thirdIconBgColor() { 553 return this.__thirdIconBgColor.get() 554 } 555 556 set thirdIconBgColor(e) { 557 this.__thirdIconBgColor.set(e) 558 } 559 560 get flag() { 561 return this.__flag.get() 562 } 563 564 set flag(e) { 565 this.__flag.set(e) 566 } 567 568 get isTextArrowFocus() { 569 return this.__isTextArrowFocus.get() 570 } 571 572 set isTextArrowFocus(e) { 573 this.__isTextArrowFocus.set(e) 574 } 575 576 ListTextStyle(e, o = null) { 577 this.observeComponentCreation(((o, t) => { 578 ViewStackProcessor.StartGetAccessRecordingFor(o); 579 Text.create(e.content); 580 Text.fontColor({ 581 id: -1, 582 type: 10001, 583 params: ["sys.color.ohos_id_color_text_secondary"], 584 bundleName: "", 585 moduleName: "" 586 }); 587 Text.fontSize({ 588 id: -1, 589 type: 10002, 590 params: ["sys.float.ohos_id_text_size_sub_title3"], 591 bundleName: "", 592 moduleName: "" 593 }); 594 Text.maxLines(2); 595 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 596 Text.margin({ 597 left: { 598 id: -1, 599 type: 10002, 600 params: ["sys.float.ohos_id_max_padding_end"], 601 bundleName: "", 602 moduleName: "" 603 }, 604 bottom: 8, 605 right: 4 606 }); 607 t || Text.pop(); 608 ViewStackProcessor.StopGetAccessRecording() 609 })); 610 Text.pop() 611 } 612 613 ListIconStyle(e, o, t = null) { 614 this.observeComponentCreation(((e, o) => { 615 ViewStackProcessor.StartGetAccessRecordingFor(e); 616 Row.create(); 617 Row.margin({ 618 left: { 619 id: -1, 620 type: 10002, 621 params: ["sys.float.ohos_id_max_padding_end"], 622 bundleName: "", 623 moduleName: "" 624 }, 625 bottom: 8, 626 right: 4 627 }); 628 o || Row.pop(); 629 ViewStackProcessor.StopGetAccessRecording() 630 })); 631 this.observeComponentCreation(((e, t) => { 632 ViewStackProcessor.StartGetAccessRecordingFor(e); 633 Image.create(o); 634 Image.width(16); 635 Image.height(16); 636 Image.margin({ right: 8 }); 637 t || Image.pop(); 638 ViewStackProcessor.StopGetAccessRecording() 639 })); 640 this.observeComponentCreation(((o, t) => { 641 ViewStackProcessor.StartGetAccessRecordingFor(o); 642 Text.create(e.content); 643 Text.fontColor({ 644 id: -1, 645 type: 10001, 646 params: ["sys.color.ohos_id_color_text_secondary"], 647 bundleName: "", 648 moduleName: "" 649 }); 650 Text.fontSize({ 651 id: -1, 652 type: 10002, 653 params: ["sys.float.ohos_id_text_size_sub_title3"], 654 bundleName: "", 655 moduleName: "" 656 }); 657 Text.maxLines(2); 658 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 659 t || Text.pop(); 660 ViewStackProcessor.StopGetAccessRecording() 661 })); 662 Text.pop(); 663 Row.pop() 664 } 665 666 ContentTextStyle(e, o = null) { 667 this.observeComponentCreation(((o, t) => { 668 ViewStackProcessor.StartGetAccessRecordingFor(o); 669 Text.create(e.content); 670 Text.fontColor({ 671 id: -1, 672 type: 10001, 673 params: ["sys.color.ohos_id_color_text_primary"], 674 bundleName: "", 675 moduleName: "" 676 }); 677 Text.fontSize({ 678 id: -1, 679 type: 10002, 680 params: ["sys.float.ohos_id_text_size_sub_title2"], 681 bundleName: "", 682 moduleName: "" 683 }); 684 Text.maxLines(2); 685 Text.maxFontSize({ 686 id: -1, 687 type: 10002, 688 params: ["sys.float.ohos_id_text_size_sub_title2"], 689 bundleName: "", 690 moduleName: "" 691 }); 692 Text.minFontSize(14); 693 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 694 Text.margin({ 695 left: { 696 id: -1, 697 type: 10002, 698 params: ["sys.float.ohos_id_max_padding_start"], 699 bundleName: "", 700 moduleName: "" 701 }, 702 right: 4, 703 bottom: 8 704 }); 705 t || Text.pop(); 706 ViewStackProcessor.StopGetAccessRecording() 707 })); 708 Text.pop() 709 } 710 711 SubTextStyle(e, o = null) { 712 this.observeComponentCreation(((e, o) => { 713 ViewStackProcessor.StartGetAccessRecordingFor(e); 714 Column.create(); 715 Column.alignItems(HorizontalAlign.Start); 716 Column.onAppear((() => { 717 this.isDuplicateLine = !0 718 })); 719 Column.margin({ 720 left: { 721 id: -1, 722 type: 10002, 723 params: ["sys.float.ohos_id_max_padding_start"], 724 bundleName: "", 725 moduleName: "" 726 }, 727 right: 4, 728 bottom: 8 729 }); 730 o || Column.pop(); 731 ViewStackProcessor.StopGetAccessRecording() 732 })); 733 this.observeComponentCreation(((o, t) => { 734 ViewStackProcessor.StartGetAccessRecordingFor(o); 735 Text.create(e.content); 736 Text.fontColor({ 737 id: -1, 738 type: 10001, 739 params: ["sys.color.ohos_id_color_text_primary"], 740 bundleName: "", 741 moduleName: "" 742 }); 743 Text.fontSize({ 744 id: -1, 745 type: 10002, 746 params: ["sys.float.ohos_id_text_size_sub_title2"], 747 bundleName: "", 748 moduleName: "" 749 }); 750 Text.maxLines(1); 751 Text.maxFontSize({ 752 id: -1, 753 type: 10002, 754 params: ["sys.float.ohos_id_text_size_sub_title2"], 755 bundleName: "", 756 moduleName: "" 757 }); 758 Text.minFontSize(14); 759 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 760 t || Text.pop(); 761 ViewStackProcessor.StopGetAccessRecording() 762 })); 763 Text.pop(); 764 this.observeComponentCreation(((o, t) => { 765 ViewStackProcessor.StartGetAccessRecordingFor(o); 766 Text.create(e.subContent); 767 Text.fontColor({ 768 id: -1, 769 type: 10001, 770 params: ["sys.color.ohos_id_color_text_secondary"], 771 bundleName: "", 772 moduleName: "" 773 }); 774 Text.fontSize({ 775 id: -1, 776 type: 10002, 777 params: ["sys.float.ohos_id_text_size_sub_title3"], 778 bundleName: "", 779 moduleName: "" 780 }); 781 Text.maxLines(1); 782 Text.maxFontSize({ 783 id: -1, 784 type: 10002, 785 params: ["sys.float.ohos_id_text_size_sub_title3"], 786 bundleName: "", 787 moduleName: "" 788 }); 789 Text.minFontSize(10); 790 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 791 t || Text.pop(); 792 ViewStackProcessor.StopGetAccessRecording() 793 })); 794 Text.pop(); 795 Column.pop() 796 } 797 798 SelectStyle(e, o = null) { 799 this.observeComponentCreation(((o, t) => { 800 ViewStackProcessor.StartGetAccessRecordingFor(o); 801 Select.create(e.options); 802 Select.selected(e.selected); 803 Select.value(e.value); 804 Select.onSelect(((o, t) => { 805 e.onSelect && e.onSelect(o, t) 806 })); 807 Select.margin({ 808 left: { 809 id: -1, 810 type: 10002, 811 params: ["sys.float.ohos_id_default_padding_start"], 812 bundleName: "", 813 moduleName: "" 814 }, 815 right: 4 816 }); 817 t || Select.pop(); 818 ViewStackProcessor.StopGetAccessRecording() 819 })); 820 Select.pop() 821 } 822 823 LoadingProcessStyle(e = null) { 824 this.observeComponentCreation(((e, o) => { 825 ViewStackProcessor.StartGetAccessRecordingFor(e); 826 LoadingProgress.create(); 827 LoadingProgress.width(24); 828 LoadingProgress.height(24); 829 LoadingProgress.focusable(!0); 830 LoadingProgress.margin({ 831 right: { 832 id: -1, 833 type: 10002, 834 params: ["sys.float.ohos_id_default_padding_end"], 835 bundleName: "", 836 moduleName: "" 837 } 838 }); 839 o || LoadingProgress.pop(); 840 ViewStackProcessor.StopGetAccessRecording() 841 })) 842 } 843 844 TextArrowStyle(e, o = null) { 845 this.observeComponentCreation(((o, t) => { 846 ViewStackProcessor.StartGetAccessRecordingFor(o); 847 Row.create(); 848 Row.focusable(!0); 849 Row.margin({ left: 4, right: 4, bottom: 4 }); 850 Row.borderRadius({ 851 id: -1, 852 type: 10002, 853 params: ["sys.float.ohos_id_corner_radius_subtab"], 854 bundleName: "", 855 moduleName: "" 856 }); 857 Row.backgroundColor(ObservedObject.GetRawObject(this.textArrowBgColor)); 858 Row.onTouch((o => { 859 if (o.type === TouchType.Down) { 860 e.action && e.action(); 861 this.textArrowBgColor = { 862 id: -1, 863 type: 10001, 864 params: ["sys.color.ohos_id_color_click_effect"], 865 bundleName: "", 866 moduleName: "" 867 } 868 } 869 o.type === TouchType.Up && (this.textArrowBgColor = { 870 id: -1, 871 type: 10001, 872 params: ["sys.color.ohos_id_color_background"], 873 bundleName: "", 874 moduleName: "" 875 }) 876 })); 877 Row.onHover((e => { 878 this.textArrowBgColor = e ? { 879 id: -1, 880 type: 10001, 881 params: ["sys.color.ohos_id_color_hover"], 882 bundleName: "", 883 moduleName: "" 884 } : { 885 id: -1, 886 type: 10001, 887 params: ["sys.color.ohos_id_color_background"], 888 bundleName: "", 889 moduleName: "" 890 } 891 })); 892 Row.border(this.isTextArrowFocus ? { 893 width: this.focusBorderWidth, 894 color: { 895 id: -1, 896 type: 10001, 897 params: ["sys.color.ohos_id_color_focused_outline"], 898 bundleName: "", 899 moduleName: "" 900 }, 901 style: BorderStyle.Solid 902 } : { width: 0 }); 903 Row.onFocus((() => { 904 this.isTextArrowFocus = !0 905 })); 906 Row.onBlur((() => { 907 this.isTextArrowFocus = !1 908 })); 909 Row.onKeyEvent((o => { 910 2054 !== o.keyCode && 2050 !== o.keyCode || e.action && e.action() 911 })); 912 t || Row.pop(); 913 ViewStackProcessor.StopGetAccessRecording() 914 })); 915 this.observeComponentCreation(((e, o) => { 916 ViewStackProcessor.StartGetAccessRecordingFor(e); 917 Row.create(); 918 Row.margin({ left: 8, right: 8 }); 919 o || Row.pop(); 920 ViewStackProcessor.StopGetAccessRecording() 921 })); 922 this.observeComponentCreation(((o, t) => { 923 ViewStackProcessor.StartGetAccessRecordingFor(o); 924 Text.create(e.value); 925 Text.fontColor({ 926 id: -1, 927 type: 10001, 928 params: ["sys.color.ohos_id_color_text_secondary"], 929 bundleName: "", 930 moduleName: "" 931 }); 932 Text.fontSize({ 933 id: -1, 934 type: 10002, 935 params: ["sys.float.ohos_id_text_size_body2"], 936 bundleName: "", 937 moduleName: "" 938 }); 939 Text.margin({ right: 4 }); 940 Text.focusable(!0); 941 Text.maxLines(2); 942 t || Text.pop(); 943 ViewStackProcessor.StopGetAccessRecording() 944 })); 945 Text.pop(); 946 this.observeComponentCreation(((e, o) => { 947 ViewStackProcessor.StartGetAccessRecordingFor(e); 948 Image.create({ 949 id: -1, 950 type: 2e4, 951 params: ["sys.media.ohos_ic_public_arrow_right"], 952 bundleName: "", 953 moduleName: "" 954 }); 955 Image.fillColor({ 956 id: -1, 957 type: 10001, 958 params: ["sys.color.ohos_id_color_tertiary"], 959 bundleName: "", 960 moduleName: "" 961 }); 962 Image.width(12); 963 Image.height(24); 964 Image.focusable(!0); 965 o || Image.pop(); 966 ViewStackProcessor.StopGetAccessRecording() 967 })); 968 Row.pop(); 969 Row.pop() 970 } 971 972 initialRender() { 973 this.observeComponentCreation(((e, o) => { 974 ViewStackProcessor.StartGetAccessRecordingFor(e); 975 Flex.create({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.End }); 976 Flex.padding({ 977 right: { 978 id: -1, 979 type: 10002, 980 params: ["sys.float.ohos_id_default_padding_end"], 981 bundleName: "", 982 moduleName: "" 983 } 984 }); 985 Flex.height(this.isDuplicateLine ? 64 : 48); 986 o || Flex.pop(); 987 ViewStackProcessor.StopGetAccessRecording() 988 })); 989 this.observeComponentCreation(((e, o) => { 990 ViewStackProcessor.StartGetAccessRecordingFor(e); 991 If.create(); 992 null != this.secondaryTitle && null != this.icon ? this.ifElseBranchUpdateFunction(0, (() => { 993 this.ListIconStyle.bind(this)({ content: this.secondaryTitle }, ObservedObject.GetRawObject(this.icon)) 994 })) : null != this.secondaryTitle && null != this.primaryTitle ? this.ifElseBranchUpdateFunction(1, (() => { 995 this.SubTextStyle.bind(this)(makeBuilderParameterProxy("SubTextStyle", { 996 content: () => this.__primaryTitle ? this.__primaryTitle : this.primaryTitle, 997 subContent: () => this.__secondaryTitle ? this.__secondaryTitle : this.secondaryTitle 998 })) 999 })) : null != this.secondaryTitle ? this.ifElseBranchUpdateFunction(2, (() => { 1000 this.ListTextStyle.bind(this)(makeBuilderParameterProxy("ListTextStyle", { 1001 content: () => this.__secondaryTitle ? this.__secondaryTitle : this.secondaryTitle 1002 })) 1003 })) : null != this.select ? this.ifElseBranchUpdateFunction(3, (() => { 1004 this.SelectStyle.bind(this)(ObservedObject.GetRawObject(this.select)) 1005 })) : null != this.primaryTitle && this.ifElseBranchUpdateFunction(4, (() => { 1006 this.ContentTextStyle.bind(this)(makeBuilderParameterProxy("ContentTextStyle", { 1007 content: () => this.__primaryTitle ? this.__primaryTitle : this.primaryTitle 1008 })) 1009 })); 1010 o || If.pop(); 1011 ViewStackProcessor.StopGetAccessRecording() 1012 })); 1013 If.pop(); 1014 this.observeComponentCreation(((e, o) => { 1015 ViewStackProcessor.StartGetAccessRecordingFor(e); 1016 If.create(); 1017 this.operationType === OperationType.BUTTON && null != this.operationItem ? this.ifElseBranchUpdateFunction(0, (() => { 1018 this.observeComponentCreation(((e, o) => { 1019 ViewStackProcessor.StartGetAccessRecordingFor(e); 1020 __Common__.create(); 1021 __Common__.margin({ bottom: 4 }); 1022 o || __Common__.pop(); 1023 ViewStackProcessor.StopGetAccessRecording() 1024 })); 1025 this.observeComponentCreation(((e, o) => { 1026 ViewStackProcessor.StartGetAccessRecordingFor(e); 1027 o ? ViewPU.create(new ButtonStyle(this, { 1028 button: this.operationItem[0] 1029 }, void 0, e)) : this.updateStateVarsOfChildByElmtId(e, {}); 1030 ViewStackProcessor.StopGetAccessRecording() 1031 })); 1032 __Common__.pop() 1033 })) : If.branchId(1); 1034 o || If.pop(); 1035 ViewStackProcessor.StopGetAccessRecording() 1036 })); 1037 If.pop(); 1038 this.observeComponentCreation(((e, o) => { 1039 ViewStackProcessor.StartGetAccessRecordingFor(e); 1040 If.create(); 1041 this.operationType === OperationType.ICON_GROUP && null != this.operationItem ? this.ifElseBranchUpdateFunction(0, (() => { 1042 this.observeComponentCreation(((e, o) => { 1043 ViewStackProcessor.StartGetAccessRecordingFor(e); 1044 Row.create(); 1045 Row.margin({ bottom: 4 }); 1046 o || Row.pop(); 1047 ViewStackProcessor.StopGetAccessRecording() 1048 })); 1049 this.observeComponentCreation(((e, o) => { 1050 ViewStackProcessor.StartGetAccessRecordingFor(e); 1051 ForEach.create(); 1052 this.forEachUpdateFunction(e, this.operationItem, ((e, o) => { 1053 const t = e; 1054 this.observeComponentCreation(((e, s) => { 1055 ViewStackProcessor.StartGetAccessRecordingFor(e); 1056 If.create(); 1057 0 == o ? this.ifElseBranchUpdateFunction(0, (() => { 1058 this.observeComponentCreation(((e, o) => { 1059 ViewStackProcessor.StartGetAccessRecordingFor(e); 1060 o ? ViewPU.create(new IconGroup(this, { 1061 item: t 1062 }, void 0, e)) : this.updateStateVarsOfChildByElmtId(e, {}); 1063 ViewStackProcessor.StopGetAccessRecording() 1064 })) 1065 })) : If.branchId(1); 1066 s || If.pop(); 1067 ViewStackProcessor.StopGetAccessRecording() 1068 })); 1069 If.pop(); 1070 this.observeComponentCreation(((e, s) => { 1071 ViewStackProcessor.StartGetAccessRecordingFor(e); 1072 If.create(); 1073 1 == o ? this.ifElseBranchUpdateFunction(0, (() => { 1074 this.observeComponentCreation(((e, o) => { 1075 ViewStackProcessor.StartGetAccessRecordingFor(e); 1076 o ? ViewPU.create(new IconGroup(this, { 1077 item: t 1078 }, void 0, e)) : this.updateStateVarsOfChildByElmtId(e, {}); 1079 ViewStackProcessor.StopGetAccessRecording() 1080 })) 1081 })) : If.branchId(1); 1082 s || If.pop(); 1083 ViewStackProcessor.StopGetAccessRecording() 1084 })); 1085 If.pop(); 1086 this.observeComponentCreation(((e, s) => { 1087 ViewStackProcessor.StartGetAccessRecordingFor(e); 1088 If.create(); 1089 2 == o ? this.ifElseBranchUpdateFunction(0, (() => { 1090 this.observeComponentCreation(((e, o) => { 1091 ViewStackProcessor.StartGetAccessRecordingFor(e); 1092 o ? ViewPU.create(new IconGroup(this, { 1093 item: t 1094 }, void 0, e)) : this.updateStateVarsOfChildByElmtId(e, {}); 1095 ViewStackProcessor.StopGetAccessRecording() 1096 })) 1097 })) : If.branchId(1); 1098 s || If.pop(); 1099 ViewStackProcessor.StopGetAccessRecording() 1100 })); 1101 If.pop() 1102 }), void 0,!0,!1); 1103 o || ForEach.pop(); 1104 ViewStackProcessor.StopGetAccessRecording() 1105 })); 1106 ForEach.pop(); 1107 Row.pop() 1108 })) : If.branchId(1); 1109 o || If.pop(); 1110 ViewStackProcessor.StopGetAccessRecording() 1111 })); 1112 If.pop(); 1113 this.observeComponentCreation(((e, o) => { 1114 ViewStackProcessor.StartGetAccessRecordingFor(e); 1115 If.create(); 1116 this.operationType === OperationType.TEXT_ARROW && null != this.operationItem ? this.ifElseBranchUpdateFunction(0, (() => { 1117 this.TextArrowStyle.bind(this)(this.operationItem[0]) 1118 })) : If.branchId(1); 1119 o || If.pop(); 1120 ViewStackProcessor.StopGetAccessRecording() 1121 })); 1122 If.pop(); 1123 this.observeComponentCreation(((e, o) => { 1124 ViewStackProcessor.StartGetAccessRecordingFor(e); 1125 If.create(); 1126 this.operationType === OperationType.LOADING ? this.ifElseBranchUpdateFunction(0, (() => { 1127 this.LoadingProcessStyle.bind(this)() 1128 })) : If.branchId(1); 1129 o || If.pop(); 1130 ViewStackProcessor.StopGetAccessRecording() 1131 })); 1132 If.pop(); 1133 Flex.pop() 1134 } 1135 1136 rerender() { 1137 this.updateDirtyElements() 1138 } 1139} 1140 1141export default { OperationStyle, SubHeader }