1/* 2 * Copyright (c) 2021-2025 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 16/** 17 * @file 18 * @kit ArkUI 19 */ 20 21/*** if arkts 1.2 */ 22import { CommonConfiguration, CommonMethod, ContentModifier, Optional, BlurStyle, Bindable } from './common'; 23import { ControlSize } from './button'; 24import { DividerOptions } from './textPicker'; 25import { ResourceStr, Dimension, EdgeOutlineWidths, ResourceColor, EdgeColors, Resource, Font, Length, Offset, DividerStyleOptions } from './units'; 26import { SymbolGlyphModifier } from '../SymbolGlyphModifier'; 27import { TextModifier } from '../TextModifier'; 28import { OptionWidthMode } from './enums'; 29/*** endif */ 30 31/** 32 * The declare of selectOption. 33 * 34 * @interface SelectOption 35 * @syscap SystemCapability.ArkUI.ArkUI.Full 36 * @since 8 37 */ 38/** 39 * The declare of selectOption. 40 * 41 * @interface SelectOption 42 * @syscap SystemCapability.ArkUI.ArkUI.Full 43 * @crossplatform 44 * @since 10 45 */ 46/** 47 * The declare of selectOption. 48 * 49 * @interface SelectOption 50 * @syscap SystemCapability.ArkUI.ArkUI.Full 51 * @crossplatform 52 * @atomicservice 53 * @since arkts {'1.1':'11','1.2':'20'} 54 * @arkts 1.1&1.2 55 */ 56declare interface SelectOption { 57 /** 58 * Option string. 59 * 60 * @type { ResourceStr } 61 * @syscap SystemCapability.ArkUI.ArkUI.Full 62 * @since 8 63 */ 64 /** 65 * Option string. 66 * 67 * @type { ResourceStr } 68 * @syscap SystemCapability.ArkUI.ArkUI.Full 69 * @crossplatform 70 * @since 10 71 */ 72 /** 73 * Option string. 74 * 75 * @type { ResourceStr } 76 * @syscap SystemCapability.ArkUI.ArkUI.Full 77 * @crossplatform 78 * @atomicservice 79 * @since arkts {'1.1':'11','1.2':'20'} 80 * @arkts 1.1&1.2 81 */ 82 value: ResourceStr; 83 84 /** 85 * Option icon. 86 * 87 * @type { ?ResourceStr } 88 * @syscap SystemCapability.ArkUI.ArkUI.Full 89 * @since 8 90 */ 91 /** 92 * Option icon. 93 * 94 * @type { ?ResourceStr } 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @crossplatform 97 * @since 10 98 */ 99 /** 100 * Option icon. 101 * 102 * @type { ?ResourceStr } 103 * @syscap SystemCapability.ArkUI.ArkUI.Full 104 * @crossplatform 105 * @atomicservice 106 * @since arkts {'1.1':'11','1.2':'20'} 107 * @arkts 1.1&1.2 108 */ 109 icon?: ResourceStr; 110 111 /** 112 * Indicates the symbol icon of this menu item. 113 * 114 * @type { ?SymbolGlyphModifier } 115 * @syscap SystemCapability.ArkUI.ArkUI.Full 116 * @atomicservice 117 * @since 12 118 */ 119 /** 120 * Indicates the symbol icon of this menu item. 121 * 122 * @type { ?SymbolGlyphModifier } 123 * @syscap SystemCapability.ArkUI.ArkUI.Full 124 * @crossplatform 125 * @atomicservice 126 * @since 20 127 * @arkts 1.1&1.2 128 */ 129 symbolIcon?: SymbolGlyphModifier; 130} 131 132/** 133 * Provides the select interface. 134 * 135 * @interface SelectInterface 136 * @syscap SystemCapability.ArkUI.ArkUI.Full 137 * @since 8 138 */ 139/** 140 * Provides the select interface. 141 * 142 * @interface SelectInterface 143 * @syscap SystemCapability.ArkUI.ArkUI.Full 144 * @crossplatform 145 * @since 10 146 */ 147/** 148 * Provides the select interface. 149 * 150 * @interface SelectInterface 151 * @syscap SystemCapability.ArkUI.ArkUI.Full 152 * @crossplatform 153 * @atomicservice 154 * @since arkts {'1.1':'11','1.2':'20'} 155 * @arkts 1.1&1.2 156 */ 157interface SelectInterface { 158 /** 159 * Called when the select is set. 160 * 161 * @param { Array<SelectOption> } options 162 * @returns { SelectAttribute } 163 * @syscap SystemCapability.ArkUI.ArkUI.Full 164 * @since 8 165 */ 166 /** 167 * Called when the select is set. 168 * 169 * @param { Array<SelectOption> } options 170 * @returns { SelectAttribute } 171 * @syscap SystemCapability.ArkUI.ArkUI.Full 172 * @crossplatform 173 * @since 10 174 */ 175 /** 176 * Called when the select is set. 177 * 178 * @param { Array<SelectOption> } options 179 * @returns { SelectAttribute } 180 * @syscap SystemCapability.ArkUI.ArkUI.Full 181 * @crossplatform 182 * @atomicservice 183 * @since arkts {'1.1':'11','1.2':'20'} 184 * @arkts 1.1&1.2 185 */ 186 (options: Array<SelectOption>): SelectAttribute; 187} 188 189/** 190 * The enum for arrow position in the select 191 * 192 * @enum { number } 193 * @syscap SystemCapability.ArkUI.ArkUI.Full 194 * @crossplatform 195 * @since 10 196 */ 197/** 198 * The enum for arrow position in the select 199 * 200 * @enum { number } 201 * @syscap SystemCapability.ArkUI.ArkUI.Full 202 * @crossplatform 203 * @atomicservice 204 * @since arkts {'1.1':'11','1.2':'20'} 205 * @arkts 1.1&1.2 206 */ 207declare enum ArrowPosition { 208 /** 209 * The value of arrow position end 210 * 211 * @syscap SystemCapability.ArkUI.ArkUI.Full 212 * @crossplatform 213 * @since 10 214 */ 215 /** 216 * The value of arrow position end 217 * 218 * @syscap SystemCapability.ArkUI.ArkUI.Full 219 * @crossplatform 220 * @atomicservice 221 * @since arkts {'1.1':'11','1.2':'20'} 222 * @arkts 1.1&1.2 223 */ 224 END = 0, 225 226 /** 227 * The value of arrow position start 228 * 229 * @syscap SystemCapability.ArkUI.ArkUI.Full 230 * @crossplatform 231 * @since 10 232 */ 233 /** 234 * The value of arrow position start 235 * 236 * @syscap SystemCapability.ArkUI.ArkUI.Full 237 * @crossplatform 238 * @atomicservice 239 * @since arkts {'1.1':'11','1.2':'20'} 240 * @arkts 1.1&1.2 241 */ 242 START = 1 243} 244 245/** 246 * The type of alignment between select and menu. 247 * 248 * @enum { number } 249 * @syscap SystemCapability.ArkUI.ArkUI.Full 250 * @since 10 251 */ 252/** 253 * The type of alignment between select and menu. 254 * 255 * @enum { number } 256 * @syscap SystemCapability.ArkUI.ArkUI.Full 257 * @crossplatform 258 * @atomicservice 259 * @since arkts {'1.1':'11','1.2':'20'} 260 * @arkts 1.1&1.2 261 */ 262declare enum MenuAlignType { 263 /** 264 * The value of menu align type start. 265 * 266 * @syscap SystemCapability.ArkUI.ArkUI.Full 267 * @since 10 268 */ 269 /** 270 * The value of menu align type start. 271 * 272 * @syscap SystemCapability.ArkUI.ArkUI.Full 273 * @crossplatform 274 * @atomicservice 275 * @since arkts {'1.1':'11','1.2':'20'} 276 * @arkts 1.1&1.2 277 */ 278 START, 279 /** 280 * The value of menu align type center. 281 * 282 * @syscap SystemCapability.ArkUI.ArkUI.Full 283 * @since 10 284 */ 285 /** 286 * The value of menu align type center. 287 * 288 * @syscap SystemCapability.ArkUI.ArkUI.Full 289 * @crossplatform 290 * @atomicservice 291 * @since arkts {'1.1':'11','1.2':'20'} 292 * @arkts 1.1&1.2 293 */ 294 CENTER, 295 /** 296 * The value of menu align type end. 297 * 298 * @syscap SystemCapability.ArkUI.ArkUI.Full 299 * @since 10 300 */ 301 /** 302 * The value of menu align type end. 303 * 304 * @syscap SystemCapability.ArkUI.ArkUI.Full 305 * @crossplatform 306 * @atomicservice 307 * @since arkts {'1.1':'11','1.2':'20'} 308 * @arkts 1.1&1.2 309 */ 310 END 311} 312 313/** 314 * Enumeration of avoidance modes for the Select dropdown menu 315 * @enum { number } 316 * @syscap SystemCapability.ArkUI.ArkUI.Full 317 * @crossplatform 318 * @atomicservice 319 * @since arkts {'1.1':'19','1.2':'20'} 320 * @arkts 1.1&1.2 321 */ 322declare enum AvoidanceMode { 323 /** 324 * The value covers the target component. 325 * 326 * @syscap SystemCapability.ArkUI.ArkUI.Full 327 * @crossplatform 328 * @atomicservice 329 * @since arkts {'1.1':'19','1.2':'20'} 330 * @arkts 1.1&1.2 331 */ 332 COVER_TARGET, 333 /** 334 * This value is displayed in the maximum space.(Compress the scrollbar) 335 * 336 * @syscap SystemCapability.ArkUI.ArkUI.Full 337 * @crossplatform 338 * @atomicservice 339 * @since arkts {'1.1':'19','1.2':'20'} 340 * @arkts 1.1&1.2 341 */ 342 AVOID_AROUND_TARGET 343} 344 345/** 346 * Callback of selecting an item from the select event. 347 * 348 * @typedef {function} OnSelectCallback 349 * @param {number} index - The index of the selected item. 350 * @param {string} selectStr - The value of the selected item. 351 * @syscap SystemCapability.ArkUI.ArkUI.Full 352 * @crossplatform 353 * @atomicservice 354 * @since arkts {'1.1':'18','1.2':'20'} 355 * @arkts 1.1&1.2 356 */ 357declare type OnSelectCallback = (index: number, selectStr: string) => void; 358 359/** 360 * The declare of menuOutlineOptions. 361 * 362 * @interface MenuOutlineOptions 363 * @syscap SystemCapability.ArkUI.ArkUI.Full 364 * @crossplatform 365 * @atomicservice 366 * @since 20 367 * @arkts 1.1&1.2 368 */ 369declare interface MenuOutlineOptions { 370 /** 371 * the width of the menu outline. 372 * 373 * @type { ?(Dimension | EdgeOutlineWidths) } 374 * @syscap SystemCapability.ArkUI.ArkUI.Full 375 * @crossplatform 376 * @atomicservice 377 * @since 20 378 * @arkts 1.1&1.2 379 */ 380 width?: Dimension | EdgeOutlineWidths; 381 382 /** 383 * the color of the menu outline. 384 * 385 * @type { ?(ResourceColor | EdgeColors) } 386 * @syscap SystemCapability.ArkUI.ArkUI.Full 387 * @crossplatform 388 * @atomicservice 389 * @since 20 390 * @arkts 1.1&1.2 391 */ 392 color?: ResourceColor | EdgeColors; 393 } 394 395/** 396 * The commonMethod of select. 397 * 398 * @extends CommonMethod<SelectAttribute> 399 * @syscap SystemCapability.ArkUI.ArkUI.Full 400 * @since 8 401 */ 402/** 403 * The commonMethod of select. 404 * 405 * @extends CommonMethod<SelectAttribute> 406 * @syscap SystemCapability.ArkUI.ArkUI.Full 407 * @crossplatform 408 * @since 10 409 */ 410/** 411 * The commonMethod of select. 412 * 413 * @extends CommonMethod<SelectAttribute> 414 * @syscap SystemCapability.ArkUI.ArkUI.Full 415 * @crossplatform 416 * @atomicservice 417 * @since arkts {'1.1':'11','1.2':'20'} 418 * @arkts 1.1&1.2 419 */ 420declare class SelectAttribute extends CommonMethod<SelectAttribute> { 421 /** 422 * Sets the serial number of the select item, starting from 0. 423 * 424 * @param { number } value 425 * @returns { SelectAttribute } 426 * @syscap SystemCapability.ArkUI.ArkUI.Full 427 * @since 8 428 */ 429 /** 430 * Sets the serial number of the select item, starting from 0. 431 * 432 * @param { number } value 433 * @returns { SelectAttribute } 434 * @syscap SystemCapability.ArkUI.ArkUI.Full 435 * @crossplatform 436 * @since 10 437 */ 438 /** 439 * Sets the serial number of the select item, starting from 0. 440 * 441 * @param { number | Resource } value - the serial number of the select item. 442 * @returns { SelectAttribute } the attribute of the select. 443 * @syscap SystemCapability.ArkUI.ArkUI.Full 444 * @crossplatform 445 * @atomicservice 446 * @since arkts {'1.1':'11','1.2':'20'} 447 * @arkts 1.1&1.2 448 */ 449 selected(value: number | Resource): SelectAttribute; 450 451 /** 452 * Sets the serial number of the select item, starting from 0. 453 * 454 * @param { Optional<number | Resource> } numCount - the serial number of the select item. 455 * @returns { SelectAttribute } the attribute of the select. 456 * @syscap SystemCapability.ArkUI.ArkUI.Full 457 * @crossplatform 458 * @atomicservice 459 * @since arkts {'1.1':'18','1.2':'20'} 460 * @arkts 1.1&1.2 461 */ 462 selected(numCount: Optional<number | Resource>): SelectAttribute; 463 464 /** 465 * Sets the text display of the select button itself. 466 * 467 * @param { string } value 468 * @returns { SelectAttribute } 469 * @syscap SystemCapability.ArkUI.ArkUI.Full 470 * @since 8 471 */ 472 /** 473 * Sets the text display of the select button itself. 474 * 475 * @param { string } value 476 * @returns { SelectAttribute } 477 * @syscap SystemCapability.ArkUI.ArkUI.Full 478 * @crossplatform 479 * @since 10 480 */ 481 /** 482 * Sets the text display of the select button itself. 483 * 484 * @param { ResourceStr } value - the text display of the select button itself. 485 * @returns { SelectAttribute } the attribute of the select. 486 * @syscap SystemCapability.ArkUI.ArkUI.Full 487 * @crossplatform 488 * @atomicservice 489 * @since 11 490 */ 491 value(value: ResourceStr): SelectAttribute; 492 493 /** 494 * Sets the text display of the select button itself. 495 * 496 * @param { Optional<ResourceStr> } resStr - the text display of the select button itself. 497 * @returns { SelectAttribute } the attribute of the select. 498 * @syscap SystemCapability.ArkUI.ArkUI.Full 499 * @crossplatform 500 * @atomicservice 501 * @since arkts {'1.1':'18','1.2':'20'} 502 * @arkts 1.1&1.2 503 */ 504 value(resStr: Optional<ResourceStr>): SelectAttribute; 505 506 /** 507 * Sets the text properties of the select button itself. 508 * 509 * @param { Font } value 510 * @returns { SelectAttribute } 511 * @syscap SystemCapability.ArkUI.ArkUI.Full 512 * @since 8 513 */ 514 /** 515 * Sets the text properties of the select button itself. 516 * 517 * @param { Font } value 518 * @returns { SelectAttribute } 519 * @syscap SystemCapability.ArkUI.ArkUI.Full 520 * @crossplatform 521 * @since 10 522 */ 523 /** 524 * Sets the text properties of the select button itself. 525 * 526 * @param { Font } value 527 * @returns { SelectAttribute } 528 * @syscap SystemCapability.ArkUI.ArkUI.Full 529 * @crossplatform 530 * @atomicservice 531 * @since arkts {'1.1':'11','1.2':'20'} 532 * @arkts 1.1&1.2 533 */ 534 font(value: Font): SelectAttribute; 535 536 /** 537 * Sets the text properties of the select button itself. 538 * 539 * @param { Optional<Font> } selectFont 540 * @returns { SelectAttribute } 541 * @syscap SystemCapability.ArkUI.ArkUI.Full 542 * @crossplatform 543 * @atomicservice 544 * @since arkts {'1.1':'18','1.2':'20'} 545 * @arkts 1.1&1.2 546 */ 547 font(selectFont: Optional<Font>): SelectAttribute; 548 549 /** 550 * Sets the text color of the select button itself. 551 * 552 * @param { ResourceColor } value 553 * @returns { SelectAttribute } 554 * @syscap SystemCapability.ArkUI.ArkUI.Full 555 * @since 8 556 */ 557 /** 558 * Sets the text color of the select button itself. 559 * 560 * @param { ResourceColor } value 561 * @returns { SelectAttribute } 562 * @syscap SystemCapability.ArkUI.ArkUI.Full 563 * @crossplatform 564 * @since 10 565 */ 566 /** 567 * Sets the text color of the select button itself. 568 * 569 * @param { ResourceColor } value 570 * @returns { SelectAttribute } 571 * @syscap SystemCapability.ArkUI.ArkUI.Full 572 * @crossplatform 573 * @atomicservice 574 * @since arkts {'1.1':'11','1.2':'20'} 575 * @arkts 1.1&1.2 576 */ 577 fontColor(value: ResourceColor): SelectAttribute; 578 579 /** 580 * Sets the text color of the select button itself. 581 * 582 * @param { Optional<ResourceColor> } resColor 583 * @returns { SelectAttribute } 584 * @syscap SystemCapability.ArkUI.ArkUI.Full 585 * @crossplatform 586 * @atomicservice 587 * @since arkts {'1.1':'18','1.2':'20'} 588 * @arkts 1.1&1.2 589 */ 590 fontColor(resColor: Optional<ResourceColor>): SelectAttribute; 591 592 /** 593 * Sets the background color of the selected items in the select. 594 * 595 * @param { ResourceColor } value 596 * @returns { SelectAttribute } 597 * @syscap SystemCapability.ArkUI.ArkUI.Full 598 * @since 8 599 */ 600 /** 601 * Sets the background color of the selected items in the select. 602 * 603 * @param { ResourceColor } value 604 * @returns { SelectAttribute } 605 * @syscap SystemCapability.ArkUI.ArkUI.Full 606 * @crossplatform 607 * @since 10 608 */ 609 /** 610 * Sets the background color of the selected items in the select. 611 * 612 * @param { ResourceColor } value 613 * @returns { SelectAttribute } 614 * @syscap SystemCapability.ArkUI.ArkUI.Full 615 * @crossplatform 616 * @atomicservice 617 * @since arkts {'1.1':'11','1.2':'20'} 618 * @arkts 1.1&1.2 619 */ 620 selectedOptionBgColor(value: ResourceColor): SelectAttribute; 621 622 /** 623 * Sets the background color of the selected items in the select. 624 * 625 * @param { Optional<ResourceColor> } resColor 626 * @returns { SelectAttribute } 627 * @syscap SystemCapability.ArkUI.ArkUI.Full 628 * @crossplatform 629 * @atomicservice 630 * @since arkts {'1.1':'18','1.2':'20'} 631 * @arkts 1.1&1.2 632 */ 633 selectedOptionBgColor(resColor: Optional<ResourceColor>): SelectAttribute; 634 635 /** 636 * Sets the text style of the selected items in the select. 637 * 638 * @param { Font } value 639 * @returns { SelectAttribute } 640 * @syscap SystemCapability.ArkUI.ArkUI.Full 641 * @since 8 642 */ 643 /** 644 * Sets the text style of the selected items in the select. 645 * 646 * @param { Font } value 647 * @returns { SelectAttribute } 648 * @syscap SystemCapability.ArkUI.ArkUI.Full 649 * @crossplatform 650 * @since 10 651 */ 652 /** 653 * Sets the text style of the selected items in the select. 654 * 655 * @param { Font } value 656 * @returns { SelectAttribute } 657 * @syscap SystemCapability.ArkUI.ArkUI.Full 658 * @crossplatform 659 * @atomicservice 660 * @since arkts {'1.1':'11','1.2':'20'} 661 * @arkts 1.1&1.2 662 */ 663 selectedOptionFont(value: Font): SelectAttribute; 664 665 /** 666 * Sets the text style of the selected items in the select. 667 * 668 * @param { Optional<Font> } selectFont 669 * @returns { SelectAttribute } 670 * @syscap SystemCapability.ArkUI.ArkUI.Full 671 * @crossplatform 672 * @atomicservice 673 * @since arkts {'1.1':'18','1.2':'20'} 674 * @arkts 1.1&1.2 675 */ 676 selectedOptionFont(selectFont: Optional<Font>): SelectAttribute; 677 678 /** 679 * Sets the text color of the selected item in the select. 680 * 681 * @param { ResourceColor } value 682 * @returns { SelectAttribute } 683 * @syscap SystemCapability.ArkUI.ArkUI.Full 684 * @since 8 685 */ 686 /** 687 * Sets the text color of the selected item in the select. 688 * 689 * @param { ResourceColor } value 690 * @returns { SelectAttribute } 691 * @syscap SystemCapability.ArkUI.ArkUI.Full 692 * @crossplatform 693 * @since 10 694 */ 695 /** 696 * Sets the text color of the selected item in the select. 697 * 698 * @param { ResourceColor } value 699 * @returns { SelectAttribute } 700 * @syscap SystemCapability.ArkUI.ArkUI.Full 701 * @crossplatform 702 * @atomicservice 703 * @since arkts {'1.1':'11','1.2':'20'} 704 * @arkts 1.1&1.2 705 */ 706 selectedOptionFontColor(value: ResourceColor): SelectAttribute; 707 708 /** 709 * Sets the text color of the selected item in the select. 710 * 711 * @param { Optional<ResourceColor> } resColor 712 * @returns { SelectAttribute } 713 * @syscap SystemCapability.ArkUI.ArkUI.Full 714 * @crossplatform 715 * @atomicservice 716 * @since arkts {'1.1':'18','1.2':'20'} 717 * @arkts 1.1&1.2 718 */ 719 selectedOptionFontColor(resColor: Optional<ResourceColor>): SelectAttribute; 720 721 /** 722 * Sets the background color of the select item. 723 * 724 * @param { ResourceColor } value 725 * @returns { SelectAttribute } 726 * @syscap SystemCapability.ArkUI.ArkUI.Full 727 * @since 8 728 */ 729 /** 730 * Sets the background color of the select item. 731 * 732 * @param { ResourceColor } value 733 * @returns { SelectAttribute } 734 * @syscap SystemCapability.ArkUI.ArkUI.Full 735 * @crossplatform 736 * @since 10 737 */ 738 /** 739 * Sets the background color of the select item. 740 * 741 * @param { ResourceColor } value 742 * @returns { SelectAttribute } 743 * @syscap SystemCapability.ArkUI.ArkUI.Full 744 * @crossplatform 745 * @atomicservice 746 * @since arkts {'1.1':'11','1.2':'20'} 747 * @arkts 1.1&1.2 748 */ 749 optionBgColor(value: ResourceColor): SelectAttribute; 750 751 /** 752 * Sets the background color of the select item. 753 * 754 * @param { Optional<ResourceColor> } resColor 755 * @returns { SelectAttribute } 756 * @syscap SystemCapability.ArkUI.ArkUI.Full 757 * @crossplatform 758 * @atomicservice 759 * @since arkts {'1.1':'18','1.2':'20'} 760 * @arkts 1.1&1.2 761 */ 762 optionBgColor(resColor: Optional<ResourceColor>): SelectAttribute; 763 764 /** 765 * Sets the text style for select items. 766 * 767 * @param { Font } value 768 * @returns { SelectAttribute } 769 * @syscap SystemCapability.ArkUI.ArkUI.Full 770 * @since 8 771 */ 772 /** 773 * Sets the text style for select items. 774 * 775 * @param { Font } value 776 * @returns { SelectAttribute } 777 * @syscap SystemCapability.ArkUI.ArkUI.Full 778 * @crossplatform 779 * @since 10 780 */ 781 /** 782 * Sets the text style for select items. 783 * 784 * @param { Font } value 785 * @returns { SelectAttribute } 786 * @syscap SystemCapability.ArkUI.ArkUI.Full 787 * @crossplatform 788 * @atomicservice 789 * @since arkts {'1.1':'11','1.2':'20'} 790 * @arkts 1.1&1.2 791 */ 792 optionFont(value: Font): SelectAttribute; 793 794 /** 795 * Sets the text style for select items. 796 * 797 * @param { Optional<Font> } selectFont 798 * @returns { SelectAttribute } 799 * @syscap SystemCapability.ArkUI.ArkUI.Full 800 * @crossplatform 801 * @atomicservice 802 * @since arkts {'1.1':'18','1.2':'20'} 803 * @arkts 1.1&1.2 804 */ 805 optionFont(selectFont: Optional<Font>): SelectAttribute; 806 807 /** 808 * Sets the text color for select items. 809 * 810 * @param { ResourceColor } value 811 * @returns { SelectAttribute } 812 * @syscap SystemCapability.ArkUI.ArkUI.Full 813 * @since 8 814 */ 815 /** 816 * Sets the text color for select items. 817 * 818 * @param { ResourceColor } value 819 * @returns { SelectAttribute } 820 * @syscap SystemCapability.ArkUI.ArkUI.Full 821 * @crossplatform 822 * @since 10 823 */ 824 /** 825 * Sets the text color for select items. 826 * 827 * @param { ResourceColor } value 828 * @returns { SelectAttribute } 829 * @syscap SystemCapability.ArkUI.ArkUI.Full 830 * @crossplatform 831 * @atomicservice 832 * @since arkts {'1.1':'11','1.2':'20'} 833 * @arkts 1.1&1.2 834 */ 835 optionFontColor(value: ResourceColor): SelectAttribute; 836 837 /** 838 * Sets the text color for select items. 839 * 840 * @param { Optional<ResourceColor> } resColor 841 * @returns { SelectAttribute } 842 * @syscap SystemCapability.ArkUI.ArkUI.Full 843 * @crossplatform 844 * @atomicservice 845 * @since arkts {'1.1':'18','1.2':'20'} 846 * @arkts 1.1&1.2 847 */ 848 optionFontColor(resColor: Optional<ResourceColor>): SelectAttribute; 849 850 /** 851 * Callback for selecting an item from the select. 852 * 853 * @param { function } callback 854 * @returns { SelectAttribute } 855 * @syscap SystemCapability.ArkUI.ArkUI.Full 856 * @since 8 857 */ 858 /** 859 * Callback for selecting an item from the select. 860 * 861 * @param { function } callback 862 * @returns { SelectAttribute } 863 * @syscap SystemCapability.ArkUI.ArkUI.Full 864 * @crossplatform 865 * @since 10 866 */ 867 /** 868 * Callback for selecting an item from the select. 869 * 870 * @param { function } callback 871 * @returns { SelectAttribute } 872 * @syscap SystemCapability.ArkUI.ArkUI.Full 873 * @crossplatform 874 * @atomicservice 875 * @since 11 876 */ 877 onSelect(callback: (index: number, value: string) => void): SelectAttribute; 878 879 /** 880 * Callback for selecting an item from the select. 881 * 882 * @param { Optional<OnSelectCallback> } callback 883 * @returns { SelectAttribute } 884 * @syscap SystemCapability.ArkUI.ArkUI.Full 885 * @crossplatform 886 * @atomicservice 887 * @since arkts {'1.1':'18','1.2':'20'} 888 * @arkts 1.1&1.2 889 */ 890 onSelect(callback: Optional<OnSelectCallback>): SelectAttribute; 891 892 /** 893 * Set the space for text and icon in select 894 * 895 * @param { Length } value - indicates the length of the space 896 * @returns { SelectAttribute } 897 * @syscap SystemCapability.ArkUI.ArkUI.Full 898 * @crossplatform 899 * @since 10 900 */ 901 /** 902 * Set the space for text and icon in select 903 * 904 * @param { Length } value - indicates the length of the space 905 * @returns { SelectAttribute } 906 * @syscap SystemCapability.ArkUI.ArkUI.Full 907 * @crossplatform 908 * @atomicservice 909 * @since arkts {'1.1':'11','1.2':'20'} 910 * @arkts 1.1&1.2 911 */ 912 space(value: Length): SelectAttribute; 913 914 /** 915 * Set the space for text and icon in select 916 * 917 * @param { Optional<Length> } spaceLength - indicates the length of the space 918 * @returns { SelectAttribute } 919 * @syscap SystemCapability.ArkUI.ArkUI.Full 920 * @crossplatform 921 * @atomicservice 922 * @since arkts {'1.1':'18','1.2':'20'} 923 * @arkts 1.1&1.2 924 */ 925 space(spaceLength: Optional<Length>): SelectAttribute; 926 927 /** 928 * Set the layout direction for text and arrow in select 929 * 930 * @param { ArrowPosition } value - indicates the arrow position in the select 931 * @returns { SelectAttribute } 932 * @syscap SystemCapability.ArkUI.ArkUI.Full 933 * @crossplatform 934 * @since 10 935 */ 936 /** 937 * Set the layout direction for text and arrow in select 938 * 939 * @param { ArrowPosition } value - indicates the arrow position in the select 940 * @returns { SelectAttribute } 941 * @syscap SystemCapability.ArkUI.ArkUI.Full 942 * @crossplatform 943 * @atomicservice 944 * @since arkts {'1.1':'11','1.2':'20'} 945 * @arkts 1.1&1.2 946 */ 947 arrowPosition(value: ArrowPosition): SelectAttribute; 948 949 /** 950 * Set the layout direction for text and arrow in select 951 * 952 * @param { Optional<ArrowPosition> } position - indicates the arrow position in the select 953 * @returns { SelectAttribute } 954 * @syscap SystemCapability.ArkUI.ArkUI.Full 955 * @crossplatform 956 * @atomicservice 957 * @since arkts {'1.1':'18','1.2':'20'} 958 * @arkts 1.1&1.2 959 */ 960 arrowPosition(position: Optional<ArrowPosition>): SelectAttribute; 961 962 /** 963 * Set the alignment between select and menu. 964 * 965 * @param { MenuAlignType } alignType - The type of alignment between select and menu. 966 * @param { Offset } offset - The offset between select and menu. 967 * @returns { SelectAttribute } the attribute of the select. 968 * @syscap SystemCapability.ArkUI.ArkUI.Full 969 * @since 10 970 */ 971 /** 972 * Set the alignment between select and menu. 973 * 974 * @param { MenuAlignType } alignType - The type of alignment between select and menu. 975 * @param { Offset } offset - The offset between select and menu. 976 * @returns { SelectAttribute } the attribute of the select. 977 * @syscap SystemCapability.ArkUI.ArkUI.Full 978 * @crossplatform 979 * @atomicservice 980 * @since arkts {'1.1':'11','1.2':'20'} 981 * @arkts 1.1&1.2 982 */ 983 menuAlign(alignType: MenuAlignType, offset?: Offset): SelectAttribute; 984 985 /** 986 * Set the alignment between select and menu. 987 * 988 * @param { Optional<MenuAlignType> } alignType - The type of alignment between select and menu. 989 * @param { Offset } offset - The offset between select and menu. 990 * @returns { SelectAttribute } the attribute of the select. 991 * @syscap SystemCapability.ArkUI.ArkUI.Full 992 * @crossplatform 993 * @atomicservice 994 * @since arkts {'1.1':'18','1.2':'20'} 995 * @arkts 1.1&1.2 996 */ 997 menuAlign(alignType: Optional<MenuAlignType>, offset?: Offset): SelectAttribute; 998 999 /** 1000 * Set the width of each option and set whether the option width fit the trigger. 1001 * 1002 * @param { Dimension | OptionWidthMode } value - The length of option width and decide option width to fit trigger or content. 1003 * @returns { SelectAttribute } the attribute of the select. 1004 * @syscap SystemCapability.ArkUI.ArkUI.Full 1005 * @crossplatform 1006 * @since 11 1007 */ 1008 /** 1009 * Set the width of each option and set whether the option width fit the trigger. 1010 * 1011 * @param { Dimension | OptionWidthMode } value - The length of option width and decide option width to fit trigger or content. 1012 * @returns { SelectAttribute } the attribute of the select. 1013 * @syscap SystemCapability.ArkUI.ArkUI.Full 1014 * @crossplatform 1015 * @atomicservice 1016 * @since arkts {'1.1':'12','1.2':'20'} 1017 * @arkts 1.1&1.2 1018 */ 1019 optionWidth(value: Dimension | OptionWidthMode ): SelectAttribute; 1020 1021 /** 1022 * Set the width of each option and set whether the option width fit the trigger. 1023 * 1024 * @param { Optional<Dimension | OptionWidthMode> } width - The length of option width and decide option width to fit trigger or content. 1025 * @returns { SelectAttribute } the attribute of the select. 1026 * @syscap SystemCapability.ArkUI.ArkUI.Full 1027 * @crossplatform 1028 * @atomicservice 1029 * @since arkts {'1.1':'18','1.2':'20'} 1030 * @arkts 1.1&1.2 1031 */ 1032 optionWidth(width: Optional<Dimension | OptionWidthMode> ): SelectAttribute; 1033 1034 /** 1035 * Set the height of each option. 1036 * 1037 * @param { Dimension } value - The length of option height. 1038 * @returns { SelectAttribute } the attribute of the select. 1039 * @syscap SystemCapability.ArkUI.ArkUI.Full 1040 * @crossplatform 1041 * @since 11 1042 */ 1043 /** 1044 * Set the height of each option. 1045 * 1046 * @param { Dimension } value - The length of option height. 1047 * @returns { SelectAttribute } the attribute of the select. 1048 * @syscap SystemCapability.ArkUI.ArkUI.Full 1049 * @crossplatform 1050 * @atomicservice 1051 * @since arkts {'1.1':'12','1.2':'20'} 1052 * @arkts 1.1&1.2 1053 */ 1054 optionHeight(value: Dimension): SelectAttribute; 1055 1056 /** 1057 * Set the height of each option. 1058 * 1059 * @param { Optional<Dimension> } height - The length of option height. 1060 * @returns { SelectAttribute } the attribute of the select. 1061 * @syscap SystemCapability.ArkUI.ArkUI.Full 1062 * @crossplatform 1063 * @atomicservice 1064 * @since arkts {'1.1':'18','1.2':'20'} 1065 * @arkts 1.1&1.2 1066 */ 1067 optionHeight(height: Optional<Dimension>): SelectAttribute; 1068 1069 /** 1070 * set the menu's background color 1071 * 1072 * @param { ResourceColor } value - The backgroundColor of menu. 1073 * @returns { SelectAttribute } the attribute of the select. 1074 * @syscap SystemCapability.ArkUI.ArkUI.Full 1075 * @crossplatform 1076 * @since 11 1077 */ 1078 /** 1079 * set the menu's background color 1080 * 1081 * @param { ResourceColor } value - The backgroundColor of menu. 1082 * @returns { SelectAttribute } the attribute of the select. 1083 * @syscap SystemCapability.ArkUI.ArkUI.Full 1084 * @crossplatform 1085 * @atomicservice 1086 * @since arkts {'1.1':'12','1.2':'20'} 1087 * @arkts 1.1&1.2 1088 */ 1089 menuBackgroundColor(value: ResourceColor): SelectAttribute; 1090 1091 /** 1092 * set the menu's background color 1093 * 1094 * @param { Optional<ResourceColor> } resColor - The backgroundColor of menu. 1095 * @returns { SelectAttribute } the attribute of the select. 1096 * @syscap SystemCapability.ArkUI.ArkUI.Full 1097 * @crossplatform 1098 * @atomicservice 1099 * @since arkts {'1.1':'18','1.2':'20'} 1100 * @arkts 1.1&1.2 1101 */ 1102 menuBackgroundColor(resColor: Optional<ResourceColor>): SelectAttribute; 1103 1104 /** 1105 * set menu background blur Style 1106 * 1107 * @param { BlurStyle } value - The BackgroundBlurStyle of menu. 1108 * @returns { SelectAttribute } the attribute of the select. 1109 * @syscap SystemCapability.ArkUI.ArkUI.Full 1110 * @crossplatform 1111 * @since 11 1112 */ 1113 /** 1114 * set menu background blur Style 1115 * 1116 * @param { BlurStyle } value - The BackgroundBlurStyle of menu. 1117 * @returns { SelectAttribute } the attribute of the select. 1118 * @syscap SystemCapability.ArkUI.ArkUI.Full 1119 * @crossplatform 1120 * @atomicservice 1121 * @since arkts {'1.1':'12','1.2':'20'} 1122 * @arkts 1.1&1.2 1123 */ 1124 menuBackgroundBlurStyle(value: BlurStyle): SelectAttribute; 1125 1126 /** 1127 * set menu background blur Style 1128 * 1129 * @param { Optional<BlurStyle> } style - The BackgroundBlurStyle of menu. 1130 * @returns { SelectAttribute } the attribute of the select. 1131 * @syscap SystemCapability.ArkUI.ArkUI.Full 1132 * @crossplatform 1133 * @atomicservice 1134 * @since arkts {'1.1':'18','1.2':'20'} 1135 * @arkts 1.1&1.2 1136 */ 1137 menuBackgroundBlurStyle(style: Optional<BlurStyle>): SelectAttribute; 1138 1139 /** 1140 * Sets the size for controls within Select Component. 1141 * 1142 * @param { ControlSize } value - control size 1143 * @returns { SelectAttribute } the attribute of the select. 1144 * @syscap SystemCapability.ArkUI.ArkUI.Full 1145 * @crossplatform 1146 * @atomicservice 1147 * @since arkts {'1.1':'12','1.2':'20'} 1148 * @arkts 1.1&1.2 1149 */ 1150 controlSize(value: ControlSize): SelectAttribute; 1151 1152 /** 1153 * Sets the size for controls within Select Component. 1154 * 1155 * @param { Optional<ControlSize> } size - control size 1156 * @returns { SelectAttribute } the attribute of the select. 1157 * @syscap SystemCapability.ArkUI.ArkUI.Full 1158 * @crossplatform 1159 * @atomicservice 1160 * @since arkts {'1.1':'18','1.2':'20'} 1161 * @arkts 1.1&1.2 1162 */ 1163 controlSize(size: Optional<ControlSize>): SelectAttribute; 1164 1165 /** 1166 * Register a ContentModifier for each menu item. 1167 * 1168 * @param { ContentModifier<MenuItemConfiguration> } modifier - The content modifier of select menu item. 1169 * @returns { SelectAttribute } the attribute of the select. 1170 * @syscap SystemCapability.ArkUI.ArkUI.Full 1171 * @crossplatform 1172 * @atomicservice 1173 * @since arkts {'1.1':'12','1.2':'20'} 1174 * @arkts 1.1&1.2 1175 */ 1176 menuItemContentModifier(modifier: ContentModifier<MenuItemConfiguration>): SelectAttribute; 1177 1178 /** 1179 * Register a ContentModifier for each menu item. 1180 * 1181 * @param { Optional<ContentModifier<MenuItemConfiguration>> } modifier - The content modifier of select menu item. 1182 * @returns { SelectAttribute } the attribute of the select. 1183 * @syscap SystemCapability.ArkUI.ArkUI.Full 1184 * @crossplatform 1185 * @atomicservice 1186 * @since arkts {'1.1':'18','1.2':'20'} 1187 * @arkts 1.1&1.2 1188 */ 1189 menuItemContentModifier(modifier: Optional<ContentModifier<MenuItemConfiguration>>): SelectAttribute; 1190 1191 /** 1192 * Set the divider of select. 1193 * 1194 * @param { Optional<DividerOptions> | null } options Set custom and hidden divider. 1195 * @returns { SelectAttribute } the attribute of the select. 1196 * @syscap SystemCapability.ArkUI.ArkUI.Full 1197 * @crossplatform 1198 * @atomicservice 1199 * @since arkts {'1.1':'12','1.2':'20'} 1200 * @arkts 1.1&1.2 1201 */ 1202 divider(options: Optional<DividerOptions> | null): SelectAttribute; 1203 1204 /** 1205 * Sets the attribute modifier for the text of select. 1206 * 1207 * @param { Optional<TextModifier> } modifier Set modifier for the text of select. 1208 * @returns { SelectAttribute } the attribute of the select. 1209 * @syscap SystemCapability.ArkUI.ArkUI.Full 1210 * @crossplatform 1211 * @atomicservice 1212 * @since 20 1213 * @arkts 1.1&1.2 1214 */ 1215 textModifier(modifier: Optional<TextModifier>): SelectAttribute; 1216 1217 /** 1218 * Sets the attribute modifier for the arrow symbol of select. 1219 * 1220 * @param { Optional<SymbolGlyphModifier> } modifier Set modifier for the arrow symbol of select. 1221 * @returns { SelectAttribute } the attribute of the select. 1222 * @syscap SystemCapability.ArkUI.ArkUI.Full 1223 * @crossplatform 1224 * @atomicservice 1225 * @since 20 1226 * @arkts 1.1&1.2 1227 */ 1228 arrowModifier(modifier: Optional<SymbolGlyphModifier>): SelectAttribute; 1229 1230 /** 1231 * Sets the attribute modifier for the text of each option. 1232 * 1233 * @param { Optional<TextModifier> } modifier Set modifier for the text of each option. 1234 * @returns { SelectAttribute } the attribute of the select. 1235 * @syscap SystemCapability.ArkUI.ArkUI.Full 1236 * @crossplatform 1237 * @atomicservice 1238 * @since 20 1239 * @arkts 1.1&1.2 1240 */ 1241 optionTextModifier(modifier: Optional<TextModifier>): SelectAttribute; 1242 1243 /** 1244 * Sets the attribute modifier for the text of selected option. 1245 * 1246 * @param { Optional<TextModifier> } modifier Set modifier for the text of selected option. 1247 * @returns { SelectAttribute } the attribute of the select. 1248 * @syscap SystemCapability.ArkUI.ArkUI.Full 1249 * @crossplatform 1250 * @atomicservice 1251 * @since 20 1252 * @arkts 1.1&1.2 1253 */ 1254 selectedOptionTextModifier(modifier: Optional<TextModifier>): SelectAttribute; 1255 1256 /** 1257 * Set the divider style of option 1258 * 1259 * @param { Optional<DividerStyleOptions> } style 1260 * @returns { SelectAttribute } 1261 * @syscap SystemCapability.ArkUI.ArkUI.Full 1262 * @crossplatform 1263 * @atomicservice 1264 * @since arkts {'1.1':'19','1.2':'20'} 1265 * @arkts 1.1&1.2 1266 */ 1267 dividerStyle(style: Optional<DividerStyleOptions>): SelectAttribute; 1268 1269 /** 1270 * Set the select menu avoidance mode 1271 * 1272 * @param { AvoidanceMode } mode - Enumeration value of the avoidance mode 1273 * @returns { SelectAttribute } Returns the chained object of Select component attributes 1274 * @syscap SystemCapability.ArkUI.ArkUI.Full 1275 * @crossplatform 1276 * @atomicservice 1277 * @since arkts {'1.1':'19','1.2':'20'} 1278 * @arkts 1.1&1.2 1279 */ 1280 avoidance(mode: AvoidanceMode): SelectAttribute; 1281 1282 /** 1283 * Sets the outline of menu. 1284 * 1285 * @param { MenuOutlineOptions } outline Set the outline of menu. 1286 * @returns { SelectAttribute } the attribute of the select. 1287 * @syscap SystemCapability.ArkUI.ArkUI.Full 1288 * @crossplatform 1289 * @atomicservice 1290 * @since 20 1291 * @arkts 1.1&1.2 1292 */ 1293 menuOutline(outline: MenuOutlineOptions): SelectAttribute; 1294 1295 /** 1296 * Sets whether to display in the sub window. 1297 * 1298 * @param { Optional<boolean> } showInSubWindow Whether to display in the sub window. 1299 * @returns { SelectAttribute } The attribute of the select. 1300 * @syscap SystemCapability.ArkUI.ArkUI.Full 1301 * @crossplatform 1302 * @atomicservice 1303 * @since 20 1304 */ 1305 showInSubWindow(showInSubWindow: Optional<boolean>): SelectAttribute; 1306 1307 /** 1308 * Set whether to display the default selected icon 1309 * 1310 * @param { boolean } show - whether to display the default selected icon. 1311 * @returns { SelectAttribute } the attribute of the select. 1312 * @syscap SystemCapability.ArkUI.ArkUI.Full 1313 * @crossplatform 1314 * @atomicservice 1315 * @since 20 1316 */ 1317 showDefaultSelectedIcon(show: boolean): SelectAttribute; 1318} 1319 1320/** 1321 * MenuItemConfiguration used by menu item content modifier. 1322 * 1323 * @extends CommonConfiguration<MenuItemConfiguration> 1324 * @interface MenuItemConfiguration 1325 * @syscap SystemCapability.ArkUI.ArkUI.Full 1326 * @crossplatform 1327 * @atomicservice 1328 * @since arkts {'1.1':'12','1.2':'20'} 1329 * @arkts 1.1&1.2 1330 */ 1331declare interface MenuItemConfiguration extends CommonConfiguration<MenuItemConfiguration>{ 1332 /** 1333 * Indicates the text of this menu item. 1334 * 1335 * @type { ResourceStr } 1336 * @syscap SystemCapability.ArkUI.ArkUI.Full 1337 * @crossplatform 1338 * @atomicservice 1339 * @since arkts {'1.1':'12','1.2':'20'} 1340 * @arkts 1.1&1.2 1341 */ 1342 value: ResourceStr; 1343 1344 /** 1345 * Indicates the icon of this menu item. 1346 * 1347 * @type { ?ResourceStr } 1348 * @syscap SystemCapability.ArkUI.ArkUI.Full 1349 * @crossplatform 1350 * @atomicservice 1351 * @since arkts {'1.1':'12','1.2':'20'} 1352 * @arkts 1.1&1.2 1353 */ 1354 icon?: ResourceStr; 1355 1356 /** 1357 * Indicates the symbol icon of this menu item. 1358 * 1359 * @type { ?SymbolGlyphModifier } 1360 * @syscap SystemCapability.ArkUI.ArkUI.Full 1361 * @atomicservice 1362 * @since 12 1363 */ 1364 /** 1365 * Indicates the symbol icon of this menu item. 1366 * 1367 * @type { ?SymbolGlyphModifier } 1368 * @syscap SystemCapability.ArkUI.ArkUI.Full 1369 * @crossplatform 1370 * @atomicservice 1371 * @since 20 1372 * @arkts 1.1&1.2 1373 */ 1374 symbolIcon?: SymbolGlyphModifier; 1375 1376 /** 1377 * Indicates whether this menu item is selected or not. 1378 * 1379 * @type { boolean } 1380 * @syscap SystemCapability.ArkUI.ArkUI.Full 1381 * @crossplatform 1382 * @atomicservice 1383 * @since arkts {'1.1':'12','1.2':'20'} 1384 * @arkts 1.1&1.2 1385 */ 1386 selected: boolean; 1387 1388 /** 1389 * Indicates the index of the menu item. 1390 * 1391 * @type { number } 1392 * @syscap SystemCapability.ArkUI.ArkUI.Full 1393 * @crossplatform 1394 * @atomicservice 1395 * @since arkts {'1.1':'12','1.2':'20'} 1396 * @arkts 1.1&1.2 1397 */ 1398 index: number; 1399 1400 /** 1401 * Select this menu item. 1402 * 1403 * @param { number } index - The value of menu item index. 1404 * @param { string } value - The value of menu item text. 1405 * @syscap SystemCapability.ArkUI.ArkUI.Full 1406 * @crossplatform 1407 * @atomicservice 1408 * @since arkts {'1.1':'12','1.2':'20'} 1409 * @arkts 1.1&1.2 1410 */ 1411 triggerSelect(index: number, value: string): void; 1412} 1413/** 1414 * Defines Select Component. 1415 * 1416 * @syscap SystemCapability.ArkUI.ArkUI.Full 1417 * @since 8 1418 */ 1419/** 1420 * Defines Select Component. 1421 * 1422 * @syscap SystemCapability.ArkUI.ArkUI.Full 1423 * @crossplatform 1424 * @since 10 1425 */ 1426/** 1427 * Defines Select Component. 1428 * 1429 * @syscap SystemCapability.ArkUI.ArkUI.Full 1430 * @crossplatform 1431 * @atomicservice 1432 * @since 11 1433 */ 1434declare const Select: SelectInterface; 1435 1436/** 1437 * Defines Select Component instance. 1438 * 1439 * @syscap SystemCapability.ArkUI.ArkUI.Full 1440 * @since 8 1441 */ 1442/** 1443 * Defines Select Component instance. 1444 * 1445 * @syscap SystemCapability.ArkUI.ArkUI.Full 1446 * @crossplatform 1447 * @since 10 1448 */ 1449/** 1450 * Defines Select Component instance. 1451 * 1452 * @syscap SystemCapability.ArkUI.ArkUI.Full 1453 * @crossplatform 1454 * @atomicservice 1455 * @since 11 1456 */ 1457declare const SelectInstance: SelectAttribute; 1458