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 CHECKBOX_CONTAINER_HEIGHT = 48; 17const CONTENT_MAX_LINES = 2; 18const DIVIDER_CONTAINER_WIDTH = 16; 19const DIVIDER_HEIGHT = 24; 20const DIVIDER_WIDTH = 2; 21const LOADING_PROGRESS_WIDTH = 40; 22const LOADING_PROGRESS_HEIGHT = 48; 23const ITEM_TEXT_SIZE = 14; 24 25export class TipsDialog extends ViewPU { 26 constructor(e, o, t, r = -1) { 27 super(e, t, r); 28 this.controller = void 0; 29 this.imageRes = void 0; 30 this.imageSize = { width: '100%', height: 180 }; 31 this.title = ''; 32 this.content = ''; 33 this.checkTips = ''; 34 this.__isChecked = new ObservedPropertySimplePU(!1, this, 'isChecked'); 35 this.primaryButton = { value: '' }; 36 this.secondaryButton = { value: '' }; 37 this.setInitiallyProvidedValue(o); 38 } 39 40 setInitiallyProvidedValue(e) { 41 void 0 !== e.controller && (this.controller = e.controller); 42 void 0 !== e.imageRes && (this.imageRes = e.imageRes); 43 void 0 !== e.imageSize && (this.imageSize = e.imageSize); 44 void 0 !== e.title && (this.title = e.title); 45 void 0 !== e.content && (this.content = e.content); 46 void 0 !== e.checkTips && (this.checkTips = e.checkTips); 47 void 0 !== e.isChecked && (this.isChecked = e.isChecked); 48 void 0 !== e.primaryButton && (this.primaryButton = e.primaryButton); 49 void 0 !== e.secondaryButton && (this.secondaryButton = e.secondaryButton); 50 } 51 52 updateStateVars(e) { 53 } 54 55 purgeVariableDependenciesOnElmtId(e) { 56 this.__isChecked.purgeDependencyOnElmtId(e); 57 } 58 59 aboutToBeDeleted() { 60 this.__isChecked.aboutToBeDeleted(); 61 SubscriberManager.Get().delete(this.id__()); 62 this.aboutToBeDeletedInternal(); 63 } 64 65 setController(e) { 66 this.controller = e; 67 } 68 69 get isChecked() { 70 return this.__isChecked.get(); 71 } 72 73 set isChecked(e) { 74 this.__isChecked.set(e); 75 } 76 77 initialRender() { 78 this.observeComponentCreation(((e, o) => { 79 ViewStackProcessor.StartGetAccessRecordingFor(e); 80 Column.create(); 81 Column.backgroundBlurStyle(BlurStyle.Thick); 82 Column.borderRadius({ 83 id: -1, 84 type: 10002, 85 params: ['sys.float.ohos_id_corner_radius_dialog'], 86 bundleName: '', 87 moduleName: '' 88 }); 89 Column.margin({ 90 left: { 91 id: -1, 92 type: 10002, 93 params: ['sys.float.ohos_id_dialog_margin_start'], 94 bundleName: '', 95 moduleName: '' 96 }, 97 right: { 98 id: -1, 99 type: 10002, 100 params: ['sys.float.ohos_id_dialog_margin_end'], 101 bundleName: '', 102 moduleName: '' 103 }, 104 bottom: { 105 id: -1, 106 type: 10002, 107 params: ['sys.float.ohos_id_dialog_margin_bottom'], 108 bundleName: '', 109 moduleName: '' 110 } 111 }); 112 Column.backgroundColor({ 113 id: -1, 114 type: 10001, 115 params: ['sys.color.ohos_id_color_dialog_bg'], 116 bundleName: '', 117 moduleName: '' 118 }); 119 o || Column.pop(); 120 ViewStackProcessor.StopGetAccessRecording(); 121 })); 122 this.observeComponentCreation(((e, o) => { 123 ViewStackProcessor.StartGetAccessRecordingFor(e); 124 Row.create(); 125 Row.width('100%'); 126 Row.padding({ left: 24, right: 24 }); 127 Row.margin({ top: 24 }); 128 o || Row.pop(); 129 ViewStackProcessor.StopGetAccessRecording(); 130 })); 131 this.observeComponentCreation(((e, o) => { 132 ViewStackProcessor.StartGetAccessRecordingFor(e); 133 Column.create(); 134 Column.layoutWeight(1); 135 Column.clip(!0); 136 o || Column.pop(); 137 ViewStackProcessor.StopGetAccessRecording(); 138 })); 139 this.observeComponentCreation(((e, o) => { 140 ViewStackProcessor.StartGetAccessRecordingFor(e); 141 Image.create(this.imageRes); 142 Image.size(this.imageSize); 143 Image.objectFit(ImageFit.Fill); 144 o || Image.pop(); 145 ViewStackProcessor.StopGetAccessRecording(); 146 })); 147 Column.pop(); 148 Row.pop(); 149 this.observeComponentCreation(((e, o) => { 150 ViewStackProcessor.StartGetAccessRecordingFor(e); 151 Row.create(); 152 Row.padding({ left: 24, right: 24 }); 153 Row.margin({ top: 16 }); 154 o || Row.pop(); 155 ViewStackProcessor.StopGetAccessRecording(); 156 })); 157 this.observeComponentCreation(((e, o) => { 158 ViewStackProcessor.StartGetAccessRecordingFor(e); 159 Text.create(this.title); 160 Text.fontSize({ 161 id: -1, 162 type: 10002, 163 params: ['sys.float.ohos_id_text_size_headline8'], 164 bundleName: '', 165 moduleName: '' 166 }); 167 Text.fontWeight(FontWeight.Medium); 168 Text.fontColor({ 169 id: -1, 170 type: 10001, 171 params: ['sys.color.ohos_id_color_text_primary'], 172 bundleName: '', 173 moduleName: '' 174 }); 175 Text.textAlign(TextAlign.Center); 176 Text.maxLines(2); 177 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 178 Text.minFontSize(15); 179 Text.maxFontSize({ 180 id: -1, 181 type: 10002, 182 params: ["sys.float.ohos_id_text_size_headline8"], 183 bundleName: "", 184 moduleName: "" 185 }); 186 o || Text.pop(); 187 ViewStackProcessor.StopGetAccessRecording(); 188 })); 189 Text.pop(); 190 Row.pop(); 191 this.observeComponentCreation(((e, o) => { 192 ViewStackProcessor.StartGetAccessRecordingFor(e); 193 If.create(); 194 this.content ? this.ifElseBranchUpdateFunction(0, (() => { 195 this.observeComponentCreation(((e, o) => { 196 ViewStackProcessor.StartGetAccessRecordingFor(e); 197 Row.create(); 198 Row.padding({ left: 24, right: 24, top: 8, bottom: 8 }); 199 Row.width('100%'); 200 o || Row.pop(); 201 ViewStackProcessor.StopGetAccessRecording(); 202 })); 203 this.observeComponentCreation(((e, o) => { 204 ViewStackProcessor.StartGetAccessRecordingFor(e); 205 Text.create(this.content); 206 Text.fontSize({ 207 id: -1, 208 type: 10002, 209 params: ['sys.float.ohos_id_text_size_body1'], 210 bundleName: '', 211 moduleName: '' 212 }); 213 Text.fontWeight(FontWeight.Regular); 214 Text.fontColor({ 215 id: -1, 216 type: 10001, 217 params: ['sys.color.ohos_id_color_text_primary'], 218 bundleName: '', 219 moduleName: '' 220 }); 221 Text.textAlign(TextAlign.Center); 222 Text.minFontSize({ 223 id: -1, 224 type: 10002, 225 params: ['sys.float.ohos_id_text_size_body3'], 226 bundleName: '', 227 moduleName: '' 228 }); 229 Text.maxLines(2); 230 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 231 o || Text.pop(); 232 ViewStackProcessor.StopGetAccessRecording(); 233 })); 234 Text.pop(); 235 Row.pop(); 236 })) : If.branchId(1); 237 o || If.pop(); 238 ViewStackProcessor.StopGetAccessRecording(); 239 })); 240 If.pop(); 241 this.observeComponentCreation(((e, o) => { 242 ViewStackProcessor.StartGetAccessRecordingFor(e); 243 Row.create(); 244 Row.height(CHECKBOX_CONTAINER_HEIGHT); 245 Row.width('100%'); 246 Row.padding({ left: 24, right: 24, top: 8, bottom: 8 }); 247 o || Row.pop(); 248 ViewStackProcessor.StopGetAccessRecording(); 249 })); 250 this.observeComponentCreation(((e, o) => { 251 ViewStackProcessor.StartGetAccessRecordingFor(e); 252 Checkbox.create({ name: 'checkbox', group: 'checkboxGroup' }); 253 Checkbox.select(this.isChecked); 254 Checkbox.onChange((e => { 255 this.isChecked = e; 256 })); 257 Checkbox.margin({ left: 0, right: 8 }); 258 o || Checkbox.pop(); 259 ViewStackProcessor.StopGetAccessRecording(); 260 })); 261 Checkbox.pop(); 262 this.observeComponentCreation(((e, o) => { 263 ViewStackProcessor.StartGetAccessRecordingFor(e); 264 Text.create(this.checkTips); 265 Text.fontSize({ 266 id: -1, 267 type: 10002, 268 params: ['sys.float.ohos_id_text_size_body2'], 269 bundleName: '', 270 moduleName: '' 271 }); 272 Text.fontWeight(FontWeight.Medium); 273 Text.fontColor({ 274 id: -1, 275 type: 10001, 276 params: ['sys.color.ohos_id_color_text_primary'], 277 bundleName: '', 278 moduleName: '' 279 }); 280 Text.maxLines(CONTENT_MAX_LINES); 281 Text.layoutWeight(1); 282 Text.focusOnTouch(!0); 283 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 284 Text.onClick((() => { 285 this.isChecked = !this.isChecked; 286 })); 287 o || Text.pop(); 288 ViewStackProcessor.StopGetAccessRecording(); 289 })); 290 Text.pop(); 291 Row.pop(); 292 this.observeComponentCreation(((e, o) => { 293 ViewStackProcessor.StartGetAccessRecordingFor(e); 294 Row.create(); 295 Row.width('100%'); 296 Row.padding({ left: 16, right: 16, top: 16, bottom: 16 }); 297 o || Row.pop(); 298 ViewStackProcessor.StopGetAccessRecording(); 299 })); 300 this.observeComponentCreation(((e, o) => { 301 ViewStackProcessor.StartGetAccessRecordingFor(e); 302 If.create(); 303 this.primaryButton.value ? this.ifElseBranchUpdateFunction(0, (() => { 304 this.observeComponentCreation(((e, o) => { 305 ViewStackProcessor.StartGetAccessRecordingFor(e); 306 Button.createWithLabel(this.primaryButton.value); 307 Button.fontSize({ 308 id: -1, 309 type: 10002, 310 params: ['sys.float.ohos_id_text_size_button1'], 311 bundleName: '', 312 moduleName: '' 313 }); 314 Button.fontWeight(FontWeight.Medium); 315 Button.layoutWeight(1); 316 Button.backgroundColor(this.primaryButton.background ? this.primaryButton.background : { 317 id: -1, 318 type: 10001, 319 params: ['sys.color.ohos_id_color_background_transparent'], 320 bundleName: '', 321 moduleName: '' 322 }); 323 Button.fontColor(this.primaryButton.fontColor ? this.primaryButton.fontColor : { 324 id: -1, 325 type: 10001, 326 params: ['sys.color.ohos_id_color_text_primary_activated'], 327 bundleName: '', 328 moduleName: '' 329 }); 330 Button.onClick((() => { 331 this.primaryButton.action && this.primaryButton.action(); 332 this.controller.close(); 333 })); 334 o || Button.pop(); 335 ViewStackProcessor.StopGetAccessRecording(); 336 })); 337 Button.pop(); 338 })) : If.branchId(1); 339 o || If.pop(); 340 ViewStackProcessor.StopGetAccessRecording(); 341 })); 342 If.pop(); 343 this.observeComponentCreation(((e, o) => { 344 ViewStackProcessor.StartGetAccessRecordingFor(e); 345 If.create(); 346 this.secondaryButton.value && this.primaryButton.value ? this.ifElseBranchUpdateFunction(0, (() => { 347 this.observeComponentCreation(((e, o) => { 348 ViewStackProcessor.StartGetAccessRecordingFor(e); 349 Column.create(); 350 Column.width(DIVIDER_CONTAINER_WIDTH); 351 Column.alignItems(HorizontalAlign.Center); 352 o || Column.pop(); 353 ViewStackProcessor.StopGetAccessRecording(); 354 })); 355 this.observeComponentCreation(((e, o) => { 356 ViewStackProcessor.StartGetAccessRecordingFor(e); 357 If.create(); 358 this.secondaryButton.background ? If.branchId(1) : this.ifElseBranchUpdateFunction(0, (() => { 359 this.observeComponentCreation(((e, o) => { 360 ViewStackProcessor.StartGetAccessRecordingFor(e); 361 Divider.create(); 362 Divider.width(DIVIDER_WIDTH); 363 Divider.height(DIVIDER_HEIGHT); 364 Divider.color({ 365 id: -1, 366 type: 10001, 367 params: ['sys.color.ohos_id_color_list_separator'], 368 bundleName: '', 369 moduleName: '' 370 }); 371 Divider.vertical(!0); 372 o || Divider.pop(); 373 ViewStackProcessor.StopGetAccessRecording(); 374 })); 375 })); 376 o || If.pop(); 377 ViewStackProcessor.StopGetAccessRecording(); 378 })); 379 If.pop(); 380 Column.pop(); 381 })) : If.branchId(1); 382 o || If.pop(); 383 ViewStackProcessor.StopGetAccessRecording(); 384 })); 385 If.pop(); 386 this.observeComponentCreation(((e, o) => { 387 ViewStackProcessor.StartGetAccessRecordingFor(e); 388 If.create(); 389 this.secondaryButton.value ? this.ifElseBranchUpdateFunction(0, (() => { 390 this.observeComponentCreation(((e, o) => { 391 ViewStackProcessor.StartGetAccessRecordingFor(e); 392 Button.createWithLabel(this.secondaryButton.value); 393 Button.fontSize({ 394 id: -1, 395 type: 10002, 396 params: ['sys.float.ohos_id_text_size_button1'], 397 bundleName: '', 398 moduleName: '' 399 }); 400 Button.fontWeight(FontWeight.Medium); 401 Button.layoutWeight(1); 402 Button.backgroundColor(this.secondaryButton.background ? this.secondaryButton.background : { 403 id: -1, 404 type: 10001, 405 params: ['sys.color.ohos_id_color_background_transparent'], 406 bundleName: '', 407 moduleName: '' 408 }); 409 Button.fontColor(this.secondaryButton.fontColor ? this.secondaryButton.fontColor : { 410 id: -1, 411 type: 10001, 412 params: ['sys.color.ohos_id_color_text_primary_activated'], 413 bundleName: '', 414 moduleName: '' 415 }); 416 Button.onClick((() => { 417 this.secondaryButton.action && this.secondaryButton.action(); 418 this.controller.close(); 419 })); 420 o || Button.pop(); 421 ViewStackProcessor.StopGetAccessRecording(); 422 })); 423 Button.pop(); 424 })) : If.branchId(1); 425 o || If.pop(); 426 ViewStackProcessor.StopGetAccessRecording(); 427 })); 428 If.pop(); 429 Row.pop(); 430 Column.pop(); 431 } 432 433 rerender() { 434 this.updateDirtyElements(); 435 } 436} 437 438export class SelectDialog extends ViewPU { 439 constructor(e, o, t, r = -1) { 440 super(e, t, r); 441 this.controller = void 0; 442 this.title = ''; 443 this.content = ''; 444 this.selectedIndex = -1; 445 this.confirm = { value: '' }; 446 this.radioContent = []; 447 this.setInitiallyProvidedValue(o); 448 } 449 450 setInitiallyProvidedValue(e) { 451 void 0 !== e.controller && (this.controller = e.controller); 452 void 0 !== e.title && (this.title = e.title); 453 void 0 !== e.content && (this.content = e.content); 454 void 0 !== e.selectedIndex && (this.selectedIndex = e.selectedIndex); 455 void 0 !== e.confirm && (this.confirm = e.confirm); 456 void 0 !== e.radioContent && (this.radioContent = e.radioContent); 457 } 458 459 updateStateVars(e) { 460 } 461 462 purgeVariableDependenciesOnElmtId(e) { 463 } 464 465 aboutToBeDeleted() { 466 SubscriberManager.Get().delete(this.id__()); 467 this.aboutToBeDeletedInternal(); 468 } 469 470 setController(e) { 471 this.controller = e; 472 } 473 474 initialRender() { 475 this.observeComponentCreation(((e, o) => { 476 ViewStackProcessor.StartGetAccessRecordingFor(e); 477 Column.create(); 478 Column.backgroundBlurStyle(BlurStyle.Thick); 479 Column.borderRadius({ 480 id: -1, 481 type: 10002, 482 params: ['sys.float.ohos_id_corner_radius_dialog'], 483 bundleName: '', 484 moduleName: '' 485 }); 486 Column.margin({ 487 left: { 488 id: -1, 489 type: 10002, 490 params: ['sys.float.ohos_id_dialog_margin_start'], 491 bundleName: '', 492 moduleName: '' 493 }, 494 right: { 495 id: -1, 496 type: 10002, 497 params: ['sys.float.ohos_id_dialog_margin_end'], 498 bundleName: '', 499 moduleName: '' 500 }, 501 bottom: { 502 id: -1, 503 type: 10002, 504 params: ['sys.float.ohos_id_dialog_margin_bottom'], 505 bundleName: '', 506 moduleName: '' 507 } 508 }); 509 Column.backgroundColor({ 510 id: -1, 511 type: 10001, 512 params: ['sys.color.ohos_id_color_dialog_bg'], 513 bundleName: '', 514 moduleName: '' 515 }); 516 o || Column.pop(); 517 ViewStackProcessor.StopGetAccessRecording(); 518 })); 519 this.observeComponentCreation(((e, o) => { 520 ViewStackProcessor.StartGetAccessRecordingFor(e); 521 Row.create(); 522 Row.padding({ left: 24, right: 24, top: 24 }); 523 Row.constraintSize({ minHeight: 56 }); 524 o || Row.pop(); 525 ViewStackProcessor.StopGetAccessRecording(); 526 })); 527 this.observeComponentCreation(((e, o) => { 528 ViewStackProcessor.StartGetAccessRecordingFor(e); 529 Text.create(this.title); 530 Text.fontSize({ 531 id: -1, 532 type: 10002, 533 params: ['sys.float.ohos_id_text_size_dialog_tittle'], 534 bundleName: '', 535 moduleName: '' 536 }); 537 Text.fontWeight(FontWeight.Medium); 538 Text.maxLines(CONTENT_MAX_LINES); 539 Text.minFontSize(15); 540 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 541 Text.fontColor({ 542 id: -1, 543 type: 10001, 544 params: ['sys.color.ohos_id_color_text_primary'], 545 bundleName: '', 546 moduleName: '' 547 }); 548 Text.textAlign(TextAlign.Start); 549 Text.width('100%'); 550 o || Text.pop(); 551 ViewStackProcessor.StopGetAccessRecording(); 552 })); 553 Text.pop(); 554 Row.pop(); 555 this.observeComponentCreation(((e, o) => { 556 ViewStackProcessor.StartGetAccessRecordingFor(e); 557 If.create(); 558 this.content ? this.ifElseBranchUpdateFunction(0, (() => { 559 this.observeComponentCreation(((e, o) => { 560 ViewStackProcessor.StartGetAccessRecordingFor(e); 561 Row.create(); 562 Row.padding({ left: 24, right: 24, top: 8, bottom: 8 }); 563 Row.width('100%'); 564 o || Row.pop(); 565 ViewStackProcessor.StopGetAccessRecording(); 566 })); 567 this.observeComponentCreation(((e, o) => { 568 ViewStackProcessor.StartGetAccessRecordingFor(e); 569 Text.create(this.content); 570 Text.fontSize({ 571 id: -1, 572 type: 10002, 573 params: ['sys.float.ohos_id_text_size_body2'], 574 bundleName: '', 575 moduleName: '' 576 }); 577 Text.fontWeight(FontWeight.Medium); 578 Text.fontColor({ 579 id: -1, 580 type: 10001, 581 params: ['sys.color.ohos_id_color_text_primary'], 582 bundleName: '', 583 moduleName: '' 584 }); 585 Text.maxLines(CONTENT_MAX_LINES); 586 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 587 Text.minFontSize({ 588 id: -1, 589 type: 10002, 590 params: ['sys.float.ohos_id_text_size_body3'], 591 bundleName: '', 592 moduleName: '' 593 }); 594 o || Text.pop(); 595 ViewStackProcessor.StopGetAccessRecording(); 596 })); 597 Text.pop(); 598 Row.pop(); 599 })) : If.branchId(1); 600 o || If.pop(); 601 ViewStackProcessor.StopGetAccessRecording(); 602 })); 603 If.pop(); 604 this.observeComponentCreation(((e, o) => { 605 ViewStackProcessor.StartGetAccessRecordingFor(e); 606 List.create({ space: 1 }); 607 List.width('100%'); 608 List.padding({ left: 24, right: 24, top: 8, bottom: 8 }); 609 List.clip(!1); 610 o || List.pop(); 611 ViewStackProcessor.StopGetAccessRecording(); 612 })); 613 this.observeComponentCreation(((e, o) => { 614 ViewStackProcessor.StartGetAccessRecordingFor(e); 615 ForEach.create(); 616 this.forEachUpdateFunction(e, this.radioContent, ((e, o) => { 617 const t = e; 618 { 619 const e = !0; 620 const r = (o, t) => { 621 ViewStackProcessor.StartGetAccessRecordingFor(o); 622 ListItem.create(i, e); 623 t || ListItem.pop(); 624 ViewStackProcessor.StopGetAccessRecording(); 625 }; 626 const s = () => { 627 this.observeComponentCreation(r); 628 this.observeComponentCreation(((e, o) => { 629 ViewStackProcessor.StartGetAccessRecordingFor(e); 630 Column.create(); 631 o || Column.pop(); 632 ViewStackProcessor.StopGetAccessRecording(); 633 })); 634 this.observeComponentCreation(((e, o) => { 635 ViewStackProcessor.StartGetAccessRecordingFor(e); 636 Row.create(); 637 Row.constraintSize({ minHeight: 48 }); 638 Row.clip(!1); 639 Row.onClick((() => { 640 t.action && t.action(); 641 this.controller.close(); 642 })); 643 o || Row.pop(); 644 ViewStackProcessor.StopGetAccessRecording(); 645 })); 646 this.observeComponentCreation(((e, o) => { 647 ViewStackProcessor.StartGetAccessRecordingFor(e); 648 Text.create(t.title); 649 Text.fontSize(ITEM_TEXT_SIZE); 650 Text.fontWeight(FontWeight.Medium); 651 Text.maxLines(CONTENT_MAX_LINES); 652 Text.fontColor({ 653 id: -1, 654 type: 10001, 655 params: ['sys.color.ohos_id_color_text_primary'], 656 bundleName: '', 657 moduleName: '' 658 }); 659 Text.layoutWeight(1); 660 o || Text.pop(); 661 ViewStackProcessor.StopGetAccessRecording(); 662 })); 663 Text.pop(); 664 this.observeComponentCreation(((e, r) => { 665 ViewStackProcessor.StartGetAccessRecordingFor(e); 666 Radio.create({ value: 'item.title', group: 'radioGroup' }); 667 Radio.size({ width: 20, height:20}); 668 Radio.checked(this.selectedIndex === o); 669 Radio.onClick((() => { 670 t.action && t.action(); 671 this.controller.close(); 672 })); 673 r || Radio.pop(); 674 ViewStackProcessor.StopGetAccessRecording(); 675 })); 676 Row.pop(); 677 this.observeComponentCreation(((e, t) => { 678 ViewStackProcessor.StartGetAccessRecordingFor(e); 679 If.create(); 680 o < this.radioContent.length - 1 ? this.ifElseBranchUpdateFunction(0, (() => { 681 this.observeComponentCreation(((e, o) => { 682 ViewStackProcessor.StartGetAccessRecordingFor(e); 683 Divider.create(); 684 Divider.color({ 685 id: -1, 686 type: 10001, 687 params: ['sys.color.ohos_id_color_list_separator'], 688 bundleName: '', 689 moduleName: '' 690 }); 691 o || Divider.pop(); 692 ViewStackProcessor.StopGetAccessRecording(); 693 })); 694 })) : If.branchId(1); 695 t || If.pop(); 696 ViewStackProcessor.StopGetAccessRecording(); 697 })); 698 If.pop(); 699 Column.pop(); 700 ListItem.pop(); 701 }; 702 const i = (e, s) => { 703 r(e, s); 704 this.updateFuncByElmtId.set(e, r); 705 this.observeComponentCreation(((e, o) => { 706 ViewStackProcessor.StartGetAccessRecordingFor(e); 707 Column.create(); 708 o || Column.pop(); 709 ViewStackProcessor.StopGetAccessRecording(); 710 })); 711 this.observeComponentCreation(((e, o) => { 712 ViewStackProcessor.StartGetAccessRecordingFor(e); 713 Row.create(); 714 Row.constraintSize({ minHeight: 48 }); 715 Row.clip(!1); 716 Row.onClick((() => { 717 t.action && t.action(); 718 this.controller.close(); 719 })); 720 o || Row.pop(); 721 ViewStackProcessor.StopGetAccessRecording(); 722 })); 723 this.observeComponentCreation(((e, o) => { 724 ViewStackProcessor.StartGetAccessRecordingFor(e); 725 Text.create(t.title); 726 Text.fontSize(ITEM_TEXT_SIZE); 727 Text.fontWeight(FontWeight.Regular); 728 Text.maxLines(CONTENT_MAX_LINES); 729 Text.fontColor({ 730 id: -1, 731 type: 10001, 732 params: ['sys.color.ohos_id_color_text_primary'], 733 bundleName: '', 734 moduleName: '' 735 }); 736 Text.layoutWeight(1); 737 o || Text.pop(); 738 ViewStackProcessor.StopGetAccessRecording(); 739 })); 740 Text.pop(); 741 this.observeComponentCreation(((e, r) => { 742 ViewStackProcessor.StartGetAccessRecordingFor(e); 743 Radio.create({ value: 'item.title', group: 'radioGroup' }); 744 Radio.size({ width: 20, height: 20 }); 745 Radio.checked(this.selectedIndex === o); 746 Radio.onClick((() => { 747 t.action && t.action(); 748 this.controller.close(); 749 })); 750 r || Radio.pop(); 751 ViewStackProcessor.StopGetAccessRecording(); 752 })); 753 Row.pop(); 754 this.observeComponentCreation(((e, t) => { 755 ViewStackProcessor.StartGetAccessRecordingFor(e); 756 If.create(); 757 o < this.radioContent.length - 1 ? this.ifElseBranchUpdateFunction(0, (() => { 758 this.observeComponentCreation(((e, o) => { 759 ViewStackProcessor.StartGetAccessRecordingFor(e); 760 Divider.create(); 761 Divider.color({ 762 id: -1, 763 type: 10001, 764 params: ['sys.color.ohos_id_color_list_separator'], 765 bundleName: '', 766 moduleName: '' 767 }); 768 o || Divider.pop(); 769 ViewStackProcessor.StopGetAccessRecording(); 770 })); 771 })) : If.branchId(1); 772 t || If.pop(); 773 ViewStackProcessor.StopGetAccessRecording(); 774 })); 775 If.pop(); 776 Column.pop(); 777 ListItem.pop(); 778 }; 779 e ? (() => { 780 this.observeComponentCreation(r); 781 ListItem.pop(); 782 })() : s(); 783 } 784 }), void 0, !0, !1); 785 o || ForEach.pop(); 786 ViewStackProcessor.StopGetAccessRecording(); 787 })); 788 ForEach.pop(); 789 List.pop(); 790 this.observeComponentCreation(((e, o) => { 791 ViewStackProcessor.StartGetAccessRecordingFor(e); 792 Row.create(); 793 Row.width('100%'); 794 Row.padding({ left: 16, right: 16, top: 16, bottom: 16 }); 795 o || Row.pop(); 796 ViewStackProcessor.StopGetAccessRecording(); 797 })); 798 this.observeComponentCreation(((e, o) => { 799 ViewStackProcessor.StartGetAccessRecordingFor(e); 800 If.create(); 801 this.confirm.value ? this.ifElseBranchUpdateFunction(0, (() => { 802 this.observeComponentCreation(((e, o) => { 803 ViewStackProcessor.StartGetAccessRecordingFor(e); 804 Button.createWithLabel(this.confirm.value); 805 Button.fontSize({ 806 id: -1, 807 type: 10002, 808 params: ['sys.float.ohos_id_text_size_button1'], 809 bundleName: '', 810 moduleName: '' 811 }); 812 Button.fontWeight(FontWeight.Medium); 813 Button.layoutWeight(1); 814 Button.backgroundColor(this.confirm.background ? this.confirm.background : { 815 id: -1, 816 type: 10001, 817 params: ['sys.color.ohos_id_color_background_transparent'], 818 bundleName: '', 819 moduleName: '' 820 }); 821 Button.fontColor(this.confirm.fontColor ? this.confirm.fontColor : { 822 id: -1, 823 type: 10001, 824 params: ['sys.color.ohos_id_color_text_primary_activated'], 825 bundleName: '', 826 moduleName: '' 827 }); 828 Button.onClick((() => { 829 this.confirm.action && this.confirm.action(); 830 this.controller.close(); 831 })); 832 o || Button.pop(); 833 ViewStackProcessor.StopGetAccessRecording(); 834 })); 835 Button.pop(); 836 })) : If.branchId(1); 837 o || If.pop(); 838 ViewStackProcessor.StopGetAccessRecording(); 839 })); 840 If.pop(); 841 Row.pop(); 842 Column.pop(); 843 } 844 845 rerender() { 846 this.updateDirtyElements(); 847 } 848} 849 850export class ConfirmDialog extends ViewPU { 851 constructor(e, o, t, r = -1) { 852 super(e, t, r); 853 this.controller = void 0; 854 this.title = ''; 855 this.content = ''; 856 this.checkTips = ''; 857 this.__isChecked = new ObservedPropertySimplePU(!1, this, 'isChecked'); 858 this.primaryButton = { value: '' }; 859 this.secondaryButton = { value: '' }; 860 this.setInitiallyProvidedValue(o); 861 } 862 863 setInitiallyProvidedValue(e) { 864 void 0 !== e.controller && (this.controller = e.controller); 865 void 0 !== e.title && (this.title = e.title); 866 void 0 !== e.content && (this.content = e.content); 867 void 0 !== e.checkTips && (this.checkTips = e.checkTips); 868 void 0 !== e.isChecked && (this.isChecked = e.isChecked); 869 void 0 !== e.primaryButton && (this.primaryButton = e.primaryButton); 870 void 0 !== e.secondaryButton && (this.secondaryButton = e.secondaryButton); 871 } 872 873 updateStateVars(e) { 874 } 875 876 purgeVariableDependenciesOnElmtId(e) { 877 this.__isChecked.purgeDependencyOnElmtId(e); 878 } 879 880 aboutToBeDeleted() { 881 this.__isChecked.aboutToBeDeleted(); 882 SubscriberManager.Get().delete(this.id__()); 883 this.aboutToBeDeletedInternal(); 884 } 885 886 setController(e) { 887 this.controller = e; 888 } 889 890 get isChecked() { 891 return this.__isChecked.get(); 892 } 893 894 set isChecked(e) { 895 this.__isChecked.set(e); 896 } 897 898 initialRender() { 899 this.observeComponentCreation(((e, o) => { 900 ViewStackProcessor.StartGetAccessRecordingFor(e); 901 Column.create(); 902 Column.backgroundBlurStyle(BlurStyle.Thick); 903 Column.borderRadius({ 904 id: -1, 905 type: 10002, 906 params: ['sys.float.ohos_id_corner_radius_dialog'], 907 bundleName: '', 908 moduleName: '' 909 }); 910 Column.margin({ 911 left: { 912 id: -1, 913 type: 10002, 914 params: ['sys.float.ohos_id_dialog_margin_start'], 915 bundleName: '', 916 moduleName: '' 917 }, 918 right: { 919 id: -1, 920 type: 10002, 921 params: ['sys.float.ohos_id_dialog_margin_end'], 922 bundleName: '', 923 moduleName: '' 924 }, 925 bottom: { 926 id: -1, 927 type: 10002, 928 params: ['sys.float.ohos_id_dialog_margin_bottom'], 929 bundleName: '', 930 moduleName: '' 931 } 932 }); 933 Column.backgroundColor({ 934 id: -1, 935 type: 10001, 936 params: ['sys.color.ohos_id_color_dialog_bg'], 937 bundleName: '', 938 moduleName: '' 939 }); 940 o || Column.pop(); 941 ViewStackProcessor.StopGetAccessRecording(); 942 })); 943 this.observeComponentCreation(((e, o) => { 944 ViewStackProcessor.StartGetAccessRecordingFor(e); 945 Row.create(); 946 Row.padding({ left: 24, right: 24, top: 24 }); 947 Row.constraintSize({ minHeight: 56 }); 948 o || Row.pop(); 949 ViewStackProcessor.StopGetAccessRecording(); 950 })); 951 this.observeComponentCreation(((e, o) => { 952 ViewStackProcessor.StartGetAccessRecordingFor(e); 953 Text.create(this.title); 954 Text.fontSize({ 955 id: -1, 956 type: 10002, 957 params: ['sys.float.ohos_id_text_size_dialog_tittle'], 958 bundleName: '', 959 moduleName: '' 960 }); 961 Text.fontWeight(FontWeight.Medium); 962 Text.maxLines(CONTENT_MAX_LINES); 963 Text.minFontSize(15); 964 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 965 Text.fontColor({ 966 id: -1, 967 type: 10001, 968 params: ['sys.color.ohos_id_color_text_primary'], 969 bundleName: '', 970 moduleName: '' 971 }); 972 Text.textAlign(TextAlign.Start); 973 Text.width('100%'); 974 o || Text.pop(); 975 ViewStackProcessor.StopGetAccessRecording(); 976 })); 977 Text.pop(); 978 Row.pop(); 979 this.observeComponentCreation(((e, o) => { 980 ViewStackProcessor.StartGetAccessRecordingFor(e); 981 If.create(); 982 this.content ? this.ifElseBranchUpdateFunction(0, (() => { 983 this.observeComponentCreation(((e, o) => { 984 ViewStackProcessor.StartGetAccessRecordingFor(e); 985 Row.create(); 986 Row.padding({ left: 24, right: 24, top: 8, bottom: 8 }); 987 Row.width('100%'); 988 Row.constraintSize({ minHeight: 36 }); 989 o || Row.pop(); 990 ViewStackProcessor.StopGetAccessRecording(); 991 })); 992 this.observeComponentCreation(((e, o) => { 993 ViewStackProcessor.StartGetAccessRecordingFor(e); 994 Text.create(this.content); 995 Text.fontSize({ 996 id: -1, 997 type: 10002, 998 params: ['sys.float.ohos_id_text_size_body1'], 999 bundleName: '', 1000 moduleName: '' 1001 }); 1002 Text.fontWeight(FontWeight.Medium); 1003 Text.fontColor({ 1004 id: -1, 1005 type: 10001, 1006 params: ['sys.color.ohos_id_color_text_primary'], 1007 bundleName: '', 1008 moduleName: '' 1009 }); 1010 Text.maxLines(CONTENT_MAX_LINES); 1011 Text.textOverflow({ overflow: TextOverflow.Ellipsis }); 1012 Text.minFontSize({ 1013 id: -1, 1014 type: 10002, 1015 params: ['sys.float.ohos_id_text_size_body3'], 1016 bundleName: '', 1017 moduleName: '' 1018 }); 1019 o || Text.pop(); 1020 ViewStackProcessor.StopGetAccessRecording(); 1021 })); 1022 Text.pop(); 1023 Row.pop(); 1024 })) : If.branchId(1); 1025 o || If.pop(); 1026 ViewStackProcessor.StopGetAccessRecording(); 1027 })); 1028 If.pop(); 1029 this.observeComponentCreation(((e, o) => { 1030 ViewStackProcessor.StartGetAccessRecordingFor(e); 1031 Row.create(); 1032 Row.height(CHECKBOX_CONTAINER_HEIGHT); 1033 Row.width('100%'); 1034 Row.padding({ left: 24, right: 24, top: 8, bottom: 8 }); 1035 o || Row.pop(); 1036 ViewStackProcessor.StopGetAccessRecording(); 1037 })); 1038 this.observeComponentCreation(((e, o) => { 1039 ViewStackProcessor.StartGetAccessRecordingFor(e); 1040 Checkbox.create({ name: 'checkbox', group: 'checkboxGroup' }); 1041 Checkbox.select(this.isChecked); 1042 Checkbox.onChange((e => { 1043 this.isChecked = e; 1044 })); 1045 Checkbox.margin({ left: 0, right: 8 }); 1046 o || Checkbox.pop(); 1047 ViewStackProcessor.StopGetAccessRecording(); 1048 })); 1049 Checkbox.pop(); 1050 this.observeComponentCreation(((e, o) => { 1051 ViewStackProcessor.StartGetAccessRecordingFor(e); 1052 Text.create(this.checkTips); 1053 Text.fontSize({ 1054 id: -1, 1055 type: 10002, 1056 params: ['sys.float.ohos_id_text_size_body2'], 1057 bundleName: '', 1058 moduleName: '' 1059 }); 1060 Text.fontWeight(FontWeight.Medium); 1061 Text.fontColor({ 1062 id: -1, 1063 type: 10001, 1064 params: ['sys.color.ohos_id_color_text_primary'], 1065 bundleName: '', 1066 moduleName: '' 1067 }); 1068 Text.maxLines(CONTENT_MAX_LINES); 1069 Text.layoutWeight(1); 1070 Text.focusOnTouch(!0); 1071 Text.onClick((() => { 1072 this.isChecked = !this.isChecked; 1073 })); 1074 o || Text.pop(); 1075 ViewStackProcessor.StopGetAccessRecording(); 1076 })); 1077 Text.pop(); 1078 Row.pop(); 1079 this.observeComponentCreation(((e, o) => { 1080 ViewStackProcessor.StartGetAccessRecordingFor(e); 1081 Row.create(); 1082 Row.width('100%'); 1083 Row.padding({ left: 16, right: 16, top: 16, bottom: 16 }); 1084 o || Row.pop(); 1085 ViewStackProcessor.StopGetAccessRecording(); 1086 })); 1087 this.observeComponentCreation(((e, o) => { 1088 ViewStackProcessor.StartGetAccessRecordingFor(e); 1089 If.create(); 1090 this.primaryButton.value ? this.ifElseBranchUpdateFunction(0, (() => { 1091 this.observeComponentCreation(((e, o) => { 1092 ViewStackProcessor.StartGetAccessRecordingFor(e); 1093 Button.createWithLabel(this.primaryButton.value); 1094 Button.fontSize({ 1095 id: -1, 1096 type: 10002, 1097 params: ['sys.float.ohos_id_text_size_button1'], 1098 bundleName: '', 1099 moduleName: '' 1100 }); 1101 Button.fontWeight(FontWeight.Medium); 1102 Button.layoutWeight(1); 1103 Button.backgroundColor(this.primaryButton.background ? this.primaryButton.background : { 1104 id: -1, 1105 type: 10001, 1106 params: ['sys.color.ohos_id_color_background_transparent'], 1107 bundleName: '', 1108 moduleName: '' 1109 }); 1110 Button.fontColor(this.primaryButton.fontColor ? this.primaryButton.fontColor : { 1111 id: -1, 1112 type: 10001, 1113 params: ['sys.color.ohos_id_color_text_primary_activated'], 1114 bundleName: '', 1115 moduleName: '' 1116 }); 1117 Button.onClick((() => { 1118 this.primaryButton.action && this.primaryButton.action(); 1119 this.controller.close(); 1120 })); 1121 o || Button.pop(); 1122 ViewStackProcessor.StopGetAccessRecording(); 1123 })); 1124 Button.pop(); 1125 })) : If.branchId(1); 1126 o || If.pop(); 1127 ViewStackProcessor.StopGetAccessRecording(); 1128 })); 1129 If.pop(); 1130 this.observeComponentCreation(((e, o) => { 1131 ViewStackProcessor.StartGetAccessRecordingFor(e); 1132 If.create(); 1133 this.secondaryButton.value && this.primaryButton.value ? this.ifElseBranchUpdateFunction(0, (() => { 1134 this.observeComponentCreation(((e, o) => { 1135 ViewStackProcessor.StartGetAccessRecordingFor(e); 1136 Column.create(); 1137 Column.width(DIVIDER_CONTAINER_WIDTH); 1138 Column.alignItems(HorizontalAlign.Center); 1139 o || Column.pop(); 1140 ViewStackProcessor.StopGetAccessRecording(); 1141 })); 1142 this.observeComponentCreation(((e, o) => { 1143 ViewStackProcessor.StartGetAccessRecordingFor(e); 1144 If.create(); 1145 this.secondaryButton.background ? If.branchId(1) : this.ifElseBranchUpdateFunction(0, (() => { 1146 this.observeComponentCreation(((e, o) => { 1147 ViewStackProcessor.StartGetAccessRecordingFor(e); 1148 Divider.create(); 1149 Divider.width(DIVIDER_WIDTH); 1150 Divider.height(DIVIDER_HEIGHT); 1151 Divider.color({ 1152 id: -1, 1153 type: 10001, 1154 params: ['sys.color.ohos_id_color_list_separator'], 1155 bundleName: '', 1156 moduleName: '' 1157 }); 1158 Divider.vertical(!0); 1159 o || Divider.pop(); 1160 ViewStackProcessor.StopGetAccessRecording(); 1161 })); 1162 })); 1163 o || If.pop(); 1164 ViewStackProcessor.StopGetAccessRecording(); 1165 })); 1166 If.pop(); 1167 Column.pop(); 1168 })) : If.branchId(1); 1169 o || If.pop(); 1170 ViewStackProcessor.StopGetAccessRecording(); 1171 })); 1172 If.pop(); 1173 this.observeComponentCreation(((e, o) => { 1174 ViewStackProcessor.StartGetAccessRecordingFor(e); 1175 If.create(); 1176 this.secondaryButton.value ? this.ifElseBranchUpdateFunction(0, (() => { 1177 this.observeComponentCreation(((e, o) => { 1178 ViewStackProcessor.StartGetAccessRecordingFor(e); 1179 Button.createWithLabel(this.secondaryButton.value); 1180 Button.fontSize({ 1181 id: -1, 1182 type: 10002, 1183 params: ['sys.float.ohos_id_text_size_button1'], 1184 bundleName: '', 1185 moduleName: '' 1186 }); 1187 Button.fontWeight(FontWeight.Medium); 1188 Button.layoutWeight(1); 1189 Button.backgroundColor(this.secondaryButton.background ? this.secondaryButton.background : { 1190 id: -1, 1191 type: 10001, 1192 params: ['sys.color.ohos_id_color_background_transparent'], 1193 bundleName: '', 1194 moduleName: '' 1195 }); 1196 Button.fontColor(this.secondaryButton.fontColor ? this.secondaryButton.fontColor : { 1197 id: -1, 1198 type: 10001, 1199 params: ['sys.color.ohos_id_color_text_primary_activated'], 1200 bundleName: '', 1201 moduleName: '' 1202 }); 1203 Button.onClick((() => { 1204 this.secondaryButton.action && this.secondaryButton.action(); 1205 this.controller.close(); 1206 })); 1207 o || Button.pop(); 1208 ViewStackProcessor.StopGetAccessRecording(); 1209 })); 1210 Button.pop(); 1211 })) : If.branchId(1); 1212 o || If.pop(); 1213 ViewStackProcessor.StopGetAccessRecording(); 1214 })); 1215 If.pop(); 1216 Row.pop(); 1217 Column.pop(); 1218 } 1219 1220 rerender() { 1221 this.updateDirtyElements(); 1222 } 1223} 1224 1225export class AlertDialog extends ViewPU { 1226 constructor(e, o, t, r = -1) { 1227 super(e, t, r); 1228 this.controller = void 0; 1229 this.content = ''; 1230 this.primaryButton = { value: '' }; 1231 this.secondaryButton = { value: '' }; 1232 this.setInitiallyProvidedValue(o); 1233 } 1234 1235 setInitiallyProvidedValue(e) { 1236 void 0 !== e.controller && (this.controller = e.controller); 1237 void 0 !== e.content && (this.content = e.content); 1238 void 0 !== e.primaryButton && (this.primaryButton = e.primaryButton); 1239 void 0 !== e.secondaryButton && (this.secondaryButton = e.secondaryButton); 1240 } 1241 1242 updateStateVars(e) { 1243 } 1244 1245 purgeVariableDependenciesOnElmtId(e) { 1246 } 1247 1248 aboutToBeDeleted() { 1249 SubscriberManager.Get().delete(this.id__()); 1250 this.aboutToBeDeletedInternal(); 1251 } 1252 1253 setController(e) { 1254 this.controller = e; 1255 } 1256 1257 initialRender() { 1258 this.observeComponentCreation(((e, o) => { 1259 ViewStackProcessor.StartGetAccessRecordingFor(e); 1260 Column.create(); 1261 Column.backgroundBlurStyle(BlurStyle.Thick); 1262 Column.borderRadius({ 1263 id: -1, 1264 type: 10002, 1265 params: ['sys.float.ohos_id_corner_radius_dialog'], 1266 bundleName: '', 1267 moduleName: '' 1268 }); 1269 Column.margin({ 1270 left: { 1271 id: -1, 1272 type: 10002, 1273 params: ['sys.float.ohos_id_dialog_margin_start'], 1274 bundleName: '', 1275 moduleName: '' 1276 }, 1277 right: { 1278 id: -1, 1279 type: 10002, 1280 params: ['sys.float.ohos_id_dialog_margin_end'], 1281 bundleName: '', 1282 moduleName: '' 1283 }, 1284 bottom: { 1285 id: -1, 1286 type: 10002, 1287 params: ['sys.float.ohos_id_dialog_margin_bottom'], 1288 bundleName: '', 1289 moduleName: '' 1290 } 1291 }); 1292 Column.backgroundColor({ 1293 id: -1, 1294 type: 10001, 1295 params: ['sys.color.ohos_id_color_dialog_bg'], 1296 bundleName: '', 1297 moduleName: '' 1298 }); 1299 o || Column.pop(); 1300 ViewStackProcessor.StopGetAccessRecording(); 1301 })); 1302 this.observeComponentCreation(((e, o) => { 1303 ViewStackProcessor.StartGetAccessRecordingFor(e); 1304 Row.create(); 1305 Row.padding({ left: 24, right: 24, top: 24 }); 1306 o || Row.pop(); 1307 ViewStackProcessor.StopGetAccessRecording(); 1308 })); 1309 this.observeComponentCreation(((e, o) => { 1310 ViewStackProcessor.StartGetAccessRecordingFor(e); 1311 Text.create(this.content); 1312 Text.fontSize({ 1313 id: -1, 1314 type: 10002, 1315 params: ['sys.float.ohos_id_text_size_body1'], 1316 bundleName: '', 1317 moduleName: '' 1318 }); 1319 Text.fontWeight(FontWeight.Medium); 1320 Text.fontColor({ 1321 id: -1, 1322 type: 10001, 1323 params: ['sys.color.ohos_id_color_text_primary'], 1324 bundleName: '', 1325 moduleName: '' 1326 }); 1327 o || Text.pop(); 1328 ViewStackProcessor.StopGetAccessRecording(); 1329 })); 1330 Text.pop(); 1331 Row.pop(); 1332 this.observeComponentCreation(((e, o) => { 1333 ViewStackProcessor.StartGetAccessRecordingFor(e); 1334 Row.create(); 1335 Row.width('100%'); 1336 Row.padding({ left: 16, right: 16, top: 16, bottom: 16 }); 1337 o || Row.pop(); 1338 ViewStackProcessor.StopGetAccessRecording(); 1339 })); 1340 this.observeComponentCreation(((e, o) => { 1341 ViewStackProcessor.StartGetAccessRecordingFor(e); 1342 If.create(); 1343 this.primaryButton.value ? this.ifElseBranchUpdateFunction(0, (() => { 1344 this.observeComponentCreation(((e, o) => { 1345 ViewStackProcessor.StartGetAccessRecordingFor(e); 1346 Button.createWithLabel(this.primaryButton.value); 1347 Button.fontSize({ 1348 id: -1, 1349 type: 10002, 1350 params: ['sys.float.ohos_id_text_size_button1'], 1351 bundleName: '', 1352 moduleName: '' 1353 }); 1354 Button.fontWeight(FontWeight.Medium); 1355 Button.layoutWeight(1); 1356 Button.backgroundColor(this.primaryButton.background ? this.primaryButton.background : { 1357 id: -1, 1358 type: 10001, 1359 params: ['sys.color.ohos_id_color_background_transparent'], 1360 bundleName: '', 1361 moduleName: '' 1362 }); 1363 Button.fontColor(this.primaryButton.fontColor ? this.primaryButton.fontColor : { 1364 id: -1, 1365 type: 10001, 1366 params: ['sys.color.ohos_id_color_text_primary_activated'], 1367 bundleName: '', 1368 moduleName: '' 1369 }); 1370 Button.onClick((() => { 1371 this.primaryButton.action && this.primaryButton.action(); 1372 this.controller.close(); 1373 })); 1374 o || Button.pop(); 1375 ViewStackProcessor.StopGetAccessRecording(); 1376 })); 1377 Button.pop(); 1378 })) : If.branchId(1); 1379 o || If.pop(); 1380 ViewStackProcessor.StopGetAccessRecording(); 1381 })); 1382 If.pop(); 1383 this.observeComponentCreation(((e, o) => { 1384 ViewStackProcessor.StartGetAccessRecordingFor(e); 1385 If.create(); 1386 this.secondaryButton.value && this.primaryButton.value ? this.ifElseBranchUpdateFunction(0, (() => { 1387 this.observeComponentCreation(((e, o) => { 1388 ViewStackProcessor.StartGetAccessRecordingFor(e); 1389 Column.create(); 1390 Column.width(DIVIDER_CONTAINER_WIDTH); 1391 Column.alignItems(HorizontalAlign.Center); 1392 o || Column.pop(); 1393 ViewStackProcessor.StopGetAccessRecording(); 1394 })); 1395 this.observeComponentCreation(((e, o) => { 1396 ViewStackProcessor.StartGetAccessRecordingFor(e); 1397 If.create(); 1398 this.secondaryButton.background ? If.branchId(1) : this.ifElseBranchUpdateFunction(0, (() => { 1399 this.observeComponentCreation(((e, o) => { 1400 ViewStackProcessor.StartGetAccessRecordingFor(e); 1401 Divider.create(); 1402 Divider.width(DIVIDER_WIDTH); 1403 Divider.height(DIVIDER_HEIGHT); 1404 Divider.color({ 1405 id: -1, 1406 type: 10001, 1407 params: ['sys.color.ohos_id_color_list_separator'], 1408 bundleName: '', 1409 moduleName: '' 1410 }); 1411 Divider.vertical(!0); 1412 o || Divider.pop(); 1413 ViewStackProcessor.StopGetAccessRecording(); 1414 })); 1415 })); 1416 o || If.pop(); 1417 ViewStackProcessor.StopGetAccessRecording(); 1418 })); 1419 If.pop(); 1420 Column.pop(); 1421 })) : If.branchId(1); 1422 o || If.pop(); 1423 ViewStackProcessor.StopGetAccessRecording(); 1424 })); 1425 If.pop(); 1426 this.observeComponentCreation(((e, o) => { 1427 ViewStackProcessor.StartGetAccessRecordingFor(e); 1428 If.create(); 1429 this.secondaryButton.value ? this.ifElseBranchUpdateFunction(0, (() => { 1430 this.observeComponentCreation(((e, o) => { 1431 ViewStackProcessor.StartGetAccessRecordingFor(e); 1432 Button.createWithLabel(this.secondaryButton.value); 1433 Button.fontSize({ 1434 id: -1, 1435 type: 10002, 1436 params: ['sys.float.ohos_id_text_size_button1'], 1437 bundleName: '', 1438 moduleName: '' 1439 }); 1440 Button.fontWeight(FontWeight.Medium); 1441 Button.layoutWeight(1); 1442 Button.backgroundColor(this.secondaryButton.background ? this.secondaryButton.background : { 1443 id: -1, 1444 type: 10001, 1445 params: ['sys.color.ohos_id_color_background_transparent'], 1446 bundleName: '', 1447 moduleName: '' 1448 }); 1449 Button.fontColor(this.secondaryButton.fontColor ? this.secondaryButton.fontColor : { 1450 id: -1, 1451 type: 10001, 1452 params: ['sys.color.ohos_id_color_text_primary_activated'], 1453 bundleName: '', 1454 moduleName: '' 1455 }); 1456 Button.onClick((() => { 1457 this.secondaryButton.action && this.secondaryButton.action(); 1458 this.controller.close(); 1459 })); 1460 o || Button.pop(); 1461 ViewStackProcessor.StopGetAccessRecording(); 1462 })); 1463 Button.pop(); 1464 })) : If.branchId(1); 1465 o || If.pop(); 1466 ViewStackProcessor.StopGetAccessRecording(); 1467 })); 1468 If.pop(); 1469 Row.pop(); 1470 Column.pop(); 1471 } 1472 1473 rerender() { 1474 this.updateDirtyElements(); 1475 } 1476} 1477 1478export class LoadingDialog extends ViewPU { 1479 constructor(e, o, t, r = -1) { 1480 super(e, t, r); 1481 this.controller = void 0; 1482 this.content = ''; 1483 this.setInitiallyProvidedValue(o); 1484 } 1485 1486 setInitiallyProvidedValue(e) { 1487 void 0 !== e.controller && (this.controller = e.controller); 1488 void 0 !== e.content && (this.content = e.content); 1489 } 1490 1491 updateStateVars(e) { 1492 } 1493 1494 purgeVariableDependenciesOnElmtId(e) { 1495 } 1496 1497 aboutToBeDeleted() { 1498 SubscriberManager.Get().delete(this.id__()); 1499 this.aboutToBeDeletedInternal(); 1500 } 1501 1502 setController(e) { 1503 this.controller = e; 1504 } 1505 1506 initialRender() { 1507 this.observeComponentCreation(((e, o) => { 1508 ViewStackProcessor.StartGetAccessRecordingFor(e); 1509 Column.create(); 1510 Column.backgroundBlurStyle(BlurStyle.Thick); 1511 Column.borderRadius({ 1512 id: -1, 1513 type: 10002, 1514 params: ['sys.float.ohos_id_corner_radius_dialog'], 1515 bundleName: '', 1516 moduleName: '' 1517 }); 1518 Column.margin({ 1519 left: { 1520 id: -1, 1521 type: 10002, 1522 params: ['sys.float.ohos_id_dialog_margin_start'], 1523 bundleName: '', 1524 moduleName: '' 1525 }, 1526 right: { 1527 id: -1, 1528 type: 10002, 1529 params: ['sys.float.ohos_id_dialog_margin_end'], 1530 bundleName: '', 1531 moduleName: '' 1532 }, 1533 bottom: { 1534 id: -1, 1535 type: 10002, 1536 params: ['sys.float.ohos_id_dialog_margin_bottom'], 1537 bundleName: '', 1538 moduleName: '' 1539 } 1540 }); 1541 Column.backgroundColor({ 1542 id: -1, 1543 type: 10001, 1544 params: ['sys.color.ohos_id_color_dialog_bg'], 1545 bundleName: '', 1546 moduleName: '' 1547 }); 1548 o || Column.pop(); 1549 ViewStackProcessor.StopGetAccessRecording(); 1550 })); 1551 this.observeComponentCreation(((e, o) => { 1552 ViewStackProcessor.StartGetAccessRecordingFor(e); 1553 Row.create(); 1554 Row.margin({ left: 24, right: 24, top: 24, bottom: 24 }); 1555 Row.constraintSize({ minHeight: 48 }); 1556 o || Row.pop(); 1557 ViewStackProcessor.StopGetAccessRecording(); 1558 })); 1559 this.observeComponentCreation(((e, o) => { 1560 ViewStackProcessor.StartGetAccessRecordingFor(e); 1561 Text.create(this.content); 1562 Text.fontSize({ 1563 id: -1, 1564 type: 10002, 1565 params: ['sys.float.ohos_id_text_size_body1'], 1566 bundleName: '', 1567 moduleName: '' 1568 }); 1569 Text.fontWeight(FontWeight.Medium); 1570 Text.fontColor({ 1571 id: -1, 1572 type: 10001, 1573 params: ['sys.color.ohos_id_color_text_primary'], 1574 bundleName: '', 1575 moduleName: '' 1576 }); 1577 Text.layoutWeight(1); 1578 o || Text.pop(); 1579 ViewStackProcessor.StopGetAccessRecording(); 1580 })); 1581 Text.pop(); 1582 this.observeComponentCreation(((e, o) => { 1583 ViewStackProcessor.StartGetAccessRecordingFor(e); 1584 LoadingProgress.create(); 1585 LoadingProgress.width(LOADING_PROGRESS_WIDTH); 1586 LoadingProgress.height(LOADING_PROGRESS_HEIGHT); 1587 LoadingProgress.margin({ left: 16 }); 1588 o || LoadingProgress.pop(); 1589 ViewStackProcessor.StopGetAccessRecording(); 1590 })); 1591 Row.pop(); 1592 Column.pop(); 1593 } 1594 1595 rerender() { 1596 this.updateDirtyElements(); 1597 } 1598} 1599export default { TipsDialog, ConfirmDialog, SelectDialog, AlertDialog, LoadingDialog };