@ui5/webcomponents 2.19.2 → 2.20.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -4
- package/dist/.tsbuildinfo +1 -1
- package/dist/Avatar.d.ts +23 -2
- package/dist/Avatar.js +41 -4
- package/dist/Avatar.js.map +1 -1
- package/dist/AvatarGroup.d.ts +5 -0
- package/dist/AvatarGroup.js +17 -10
- package/dist/AvatarGroup.js.map +1 -1
- package/dist/AvatarTemplate.js +1 -1
- package/dist/AvatarTemplate.js.map +1 -1
- package/dist/Breadcrumbs.d.ts +4 -1
- package/dist/Breadcrumbs.js +4 -0
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/ColorPalette.d.ts +14 -0
- package/dist/ColorPalette.js +11 -1
- package/dist/ColorPalette.js.map +1 -1
- package/dist/ColorPalettePopover.d.ts +14 -0
- package/dist/ColorPalettePopover.js +6 -0
- package/dist/ColorPalettePopover.js.map +1 -1
- package/dist/ColorPalettePopoverTemplate.js +1 -1
- package/dist/ColorPalettePopoverTemplate.js.map +1 -1
- package/dist/ColorPaletteTemplate.js +1 -1
- package/dist/ColorPaletteTemplate.js.map +1 -1
- package/dist/ColorPicker.d.ts +14 -0
- package/dist/ColorPicker.js +11 -1
- package/dist/ColorPicker.js.map +1 -1
- package/dist/ColorPickerTemplate.js +1 -1
- package/dist/ColorPickerTemplate.js.map +1 -1
- package/dist/DateComponentBase.d.ts +2 -2
- package/dist/DateComponentBase.js +1 -1
- package/dist/DateComponentBase.js.map +1 -1
- package/dist/DatePicker.d.ts +3 -2
- package/dist/DatePicker.js +6 -3
- package/dist/DatePicker.js.map +1 -1
- package/dist/DatePickerPopoverTemplate.js +8 -4
- package/dist/DatePickerPopoverTemplate.js.map +1 -1
- package/dist/List.js +6 -0
- package/dist/List.js.map +1 -1
- package/dist/ListItemCustom.d.ts +21 -1
- package/dist/ListItemCustom.js +86 -2
- package/dist/ListItemCustom.js.map +1 -1
- package/dist/ListItemGroup.d.ts +1 -0
- package/dist/ListItemGroup.js +1 -0
- package/dist/ListItemGroup.js.map +1 -1
- package/dist/ListItemGroupTemplate.js +1 -1
- package/dist/ListItemGroupTemplate.js.map +1 -1
- package/dist/Menu.d.ts +2 -1
- package/dist/Menu.js +14 -7
- package/dist/Menu.js.map +1 -1
- package/dist/MenuItem.d.ts +1 -0
- package/dist/MenuItem.js +6 -2
- package/dist/MenuItem.js.map +1 -1
- package/dist/MultiComboBoxPopoverTemplate.js +2 -1
- package/dist/MultiComboBoxPopoverTemplate.js.map +1 -1
- package/dist/MultiInputTemplate.js +2 -1
- package/dist/MultiInputTemplate.js.map +1 -1
- package/dist/Panel.d.ts +3 -0
- package/dist/Panel.js +13 -0
- package/dist/Panel.js.map +1 -1
- package/dist/PanelTemplate.js +1 -1
- package/dist/PanelTemplate.js.map +1 -1
- package/dist/RatingIndicator.d.ts +17 -0
- package/dist/RatingIndicator.js +12 -0
- package/dist/RatingIndicator.js.map +1 -1
- package/dist/RatingIndicatorTemplate.js +6 -8
- package/dist/RatingIndicatorTemplate.js.map +1 -1
- package/dist/SplitButton.d.ts +2 -0
- package/dist/SplitButton.js +5 -0
- package/dist/SplitButton.js.map +1 -1
- package/dist/StepInput.js +2 -2
- package/dist/StepInput.js.map +1 -1
- package/dist/Switch.js +2 -2
- package/dist/Switch.js.map +1 -1
- package/dist/TimePickerPopoverTemplate.js +2 -3
- package/dist/TimePickerPopoverTemplate.js.map +1 -1
- package/dist/Tokenizer.js +2 -2
- package/dist/Tokenizer.js.map +1 -1
- package/dist/Toolbar.d.ts +5 -2
- package/dist/Toolbar.js +29 -4
- package/dist/Toolbar.js.map +1 -1
- package/dist/ToolbarItem.d.ts +40 -1
- package/dist/ToolbarItem.js +97 -2
- package/dist/ToolbarItem.js.map +1 -1
- package/dist/ToolbarItemTemplate.d.ts +2 -0
- package/dist/ToolbarItemTemplate.js +5 -0
- package/dist/ToolbarItemTemplate.js.map +1 -0
- package/dist/ToolbarTemplate.js +9 -8
- package/dist/ToolbarTemplate.js.map +1 -1
- package/dist/bundle.esm.js +1 -0
- package/dist/bundle.esm.js.map +1 -1
- package/dist/css/themes/Avatar.css +1 -1
- package/dist/css/themes/Bar.css +1 -1
- package/dist/css/themes/DatePickerPopover.css +1 -1
- package/dist/css/themes/Panel.css +1 -1
- package/dist/css/themes/RatingIndicator.css +1 -1
- package/dist/css/themes/ResponsivePopoverCommon.css +1 -1
- package/dist/css/themes/TimePickerPopover.css +1 -1
- package/dist/css/themes/Toolbar.css +1 -1
- package/dist/css/themes/ToolbarItem.css +1 -0
- package/dist/css/themes/ToolbarPopover.css +1 -1
- package/dist/custom-elements-internal.json +476 -11
- package/dist/custom-elements.json +340 -7
- package/dist/features/InputSuggestionsTemplate.js +2 -1
- package/dist/features/InputSuggestionsTemplate.js.map +1 -1
- package/dist/generated/assets/i18n/messagebundle_ar.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_bg.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ca.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cnr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cs.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cy.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_da.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_de.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_el.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_GB.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_es.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_es_MX.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_et.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fr_CA.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hu.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_id.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_it.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_iw.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ja.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_kk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ko.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_lt.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_lv.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_mk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ms.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_nl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_no.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pt.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pt_PT.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ro.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ru.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sh.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sv.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_th.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_tr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_uk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_vi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_zh_CN.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_zh_TW.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +2 -2
- package/dist/generated/i18n/i18n-defaults.js +2 -2
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/themes/Avatar.css.d.ts +1 -1
- package/dist/generated/themes/Avatar.css.js +1 -1
- package/dist/generated/themes/Avatar.css.js.map +1 -1
- package/dist/generated/themes/Bar.css.d.ts +1 -1
- package/dist/generated/themes/Bar.css.js +1 -1
- package/dist/generated/themes/Bar.css.js.map +1 -1
- package/dist/generated/themes/DatePickerPopover.css.d.ts +1 -1
- package/dist/generated/themes/DatePickerPopover.css.js +1 -1
- package/dist/generated/themes/DatePickerPopover.css.js.map +1 -1
- package/dist/generated/themes/Panel.css.d.ts +1 -1
- package/dist/generated/themes/Panel.css.js +1 -1
- package/dist/generated/themes/Panel.css.js.map +1 -1
- package/dist/generated/themes/RatingIndicator.css.d.ts +1 -1
- package/dist/generated/themes/RatingIndicator.css.js +1 -1
- package/dist/generated/themes/RatingIndicator.css.js.map +1 -1
- package/dist/generated/themes/ResponsivePopoverCommon.css.d.ts +1 -1
- package/dist/generated/themes/ResponsivePopoverCommon.css.js +1 -1
- package/dist/generated/themes/ResponsivePopoverCommon.css.js.map +1 -1
- package/dist/generated/themes/TimePickerPopover.css.d.ts +1 -1
- package/dist/generated/themes/TimePickerPopover.css.js +1 -1
- package/dist/generated/themes/TimePickerPopover.css.js.map +1 -1
- package/dist/generated/themes/Toolbar.css.d.ts +1 -1
- package/dist/generated/themes/Toolbar.css.js +1 -1
- package/dist/generated/themes/Toolbar.css.js.map +1 -1
- package/dist/generated/themes/ToolbarItem.css.d.ts +2 -0
- package/dist/generated/themes/ToolbarItem.css.js +8 -0
- package/dist/generated/themes/ToolbarItem.css.js.map +1 -0
- package/dist/generated/themes/ToolbarPopover.css.d.ts +1 -1
- package/dist/generated/themes/ToolbarPopover.css.js +1 -1
- package/dist/generated/themes/ToolbarPopover.css.js.map +1 -1
- package/dist/types/AvatarMode.d.ts +30 -0
- package/dist/types/AvatarMode.js +32 -0
- package/dist/types/AvatarMode.js.map +1 -0
- package/dist/vscode.html-custom-data.json +64 -14
- package/dist/web-types.json +234 -19
- package/package.json +10 -10
- package/src/AvatarTemplate.tsx +1 -0
- package/src/ColorPalettePopoverTemplate.tsx +3 -0
- package/src/ColorPaletteTemplate.tsx +1 -1
- package/src/ColorPickerTemplate.tsx +2 -2
- package/src/DatePickerPopoverTemplate.tsx +21 -10
- package/src/ListItemGroupTemplate.tsx +9 -3
- package/src/MultiComboBoxPopoverTemplate.tsx +8 -1
- package/src/MultiInputTemplate.tsx +2 -1
- package/src/PanelTemplate.tsx +2 -0
- package/src/RatingIndicatorTemplate.tsx +10 -10
- package/src/TimePickerPopoverTemplate.tsx +1 -9
- package/src/ToolbarItemTemplate.tsx +7 -0
- package/src/ToolbarTemplate.tsx +9 -16
- package/src/features/InputSuggestionsTemplate.tsx +9 -2
- package/src/i18n/messagebundle.properties +5 -5
- package/src/i18n/messagebundle_ar.properties +14 -8
- package/src/i18n/messagebundle_bg.properties +14 -8
- package/src/i18n/messagebundle_ca.properties +14 -8
- package/src/i18n/messagebundle_cnr.properties +14 -8
- package/src/i18n/messagebundle_cs.properties +14 -8
- package/src/i18n/messagebundle_cy.properties +14 -8
- package/src/i18n/messagebundle_da.properties +14 -8
- package/src/i18n/messagebundle_de.properties +14 -8
- package/src/i18n/messagebundle_el.properties +14 -8
- package/src/i18n/messagebundle_en.properties +14 -8
- package/src/i18n/messagebundle_en_GB.properties +14 -8
- package/src/i18n/messagebundle_en_US_sappsd.properties +17 -11
- package/src/i18n/messagebundle_en_US_saprigi.properties +17 -11
- package/src/i18n/messagebundle_en_US_saptrc.properties +17 -11
- package/src/i18n/messagebundle_es.properties +16 -10
- package/src/i18n/messagebundle_es_MX.properties +15 -9
- package/src/i18n/messagebundle_et.properties +14 -8
- package/src/i18n/messagebundle_fi.properties +14 -8
- package/src/i18n/messagebundle_fr.properties +14 -8
- package/src/i18n/messagebundle_fr_CA.properties +15 -9
- package/src/i18n/messagebundle_hi.properties +14 -8
- package/src/i18n/messagebundle_hr.properties +14 -8
- package/src/i18n/messagebundle_hu.properties +14 -8
- package/src/i18n/messagebundle_id.properties +14 -8
- package/src/i18n/messagebundle_it.properties +14 -8
- package/src/i18n/messagebundle_iw.properties +14 -8
- package/src/i18n/messagebundle_ja.properties +14 -8
- package/src/i18n/messagebundle_kk.properties +14 -8
- package/src/i18n/messagebundle_ko.properties +14 -8
- package/src/i18n/messagebundle_lt.properties +14 -8
- package/src/i18n/messagebundle_lv.properties +14 -8
- package/src/i18n/messagebundle_mk.properties +14 -8
- package/src/i18n/messagebundle_ms.properties +14 -8
- package/src/i18n/messagebundle_nl.properties +14 -8
- package/src/i18n/messagebundle_no.properties +14 -8
- package/src/i18n/messagebundle_pl.properties +14 -8
- package/src/i18n/messagebundle_pt.properties +14 -8
- package/src/i18n/messagebundle_pt_PT.properties +14 -8
- package/src/i18n/messagebundle_ro.properties +14 -8
- package/src/i18n/messagebundle_ru.properties +14 -8
- package/src/i18n/messagebundle_sh.properties +14 -8
- package/src/i18n/messagebundle_sk.properties +14 -8
- package/src/i18n/messagebundle_sl.properties +14 -8
- package/src/i18n/messagebundle_sr.properties +14 -8
- package/src/i18n/messagebundle_sv.properties +14 -8
- package/src/i18n/messagebundle_th.properties +14 -8
- package/src/i18n/messagebundle_tr.properties +14 -8
- package/src/i18n/messagebundle_uk.properties +14 -8
- package/src/i18n/messagebundle_vi.properties +14 -8
- package/src/i18n/messagebundle_zh_CN.properties +14 -8
- package/src/i18n/messagebundle_zh_TW.properties +15 -9
- package/src/themes/Avatar.css +39 -14
- package/src/themes/Bar.css +1 -1
- package/src/themes/DatePickerPopover.css +24 -1
- package/src/themes/Panel.css +5 -1
- package/src/themes/RatingIndicator.css +26 -12
- package/src/themes/ResponsivePopoverCommon.css +1 -1
- package/src/themes/TimePickerPopover.css +7 -0
- package/src/themes/Toolbar.css +11 -3
- package/src/themes/ToolbarItem.css +8 -0
- package/src/themes/ToolbarPopover.css +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiInputTemplate.js","sourceRoot":"","sources":["../src/MultiInputTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAG/C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAC/D,OAAO,SAAS,MAAM,6CAA6C,CAAC;AAEpE,MAAM,CAAC,OAAO,UAAU,kBAAkB;IACzC,OAAO;QACN,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE;YACxB,UAAU;YACV,WAAW;YACX,eAAe,EAAE,yBAAyB;YAC1C,YAAY,EAAE,sBAAsB;SACpC,CAAC;KACF,CAAC;AACH,CAAC;AAED,SAAS,UAAU;IAClB,OAAO,CACN,8BACC,eAAM,EAAE,EAAC,kBAAkB,EAAC,KAAK,EAAC,iBAAiB,YAAE,IAAI,CAAC,gBAAgB,GAAQ,EAEjF,IAAI,CAAC,iBAAiB;gBACtB,eAAM,EAAE,EAAC,uBAAuB,EAAC,KAAK,EAAC,iBAAiB,YAAE,IAAI,CAAC,cAAc,GAAQ,EAEtF,KAAC,SAAS,IACT,KAAK,EAAC,2BAA2B,EACjC,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAC9B,eAAe,EAAE,IAAI,CAAC,WAAW,EACjC,gBAAgB,EAAE,IAAI,EACtB,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAChC,SAAS,EAAE,IAAI,CAAC,mBAAmB,EACnC,aAAa,EAAE,IAAI,CAAC,WAAW,EAC/B,UAAU,EAAE,IAAI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B,WAAW,EAAE,IAAI,CAAC,eAAe,EACjC,WAAW,EAAE,IAAI,CAAC,0BAA0B,EAC5C,iBAAiB,EAAE,IAAI,CAAC,sBAAsB,YAE9C,gBAAa,GACP,CACP,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB;IAC9B,OAAO,CACN,KAAC,YAAY,IACZ,KAAK,EAAC,sCAAsC,EAC5C,MAAM,EAAC,aAAa,EACpB,IAAI,EAAE,cAAc,EACpB,cAAc,EAAE,IAAI,CAAC,2BAA2B,EAChD,QAAQ,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAC9B,OAAO,EAAE,IAAI,CAAC,iCAAiC,EAC/C,OAAO,EAAE,GAAG,EAAE;YACb,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC;YACnC,IAAI,CAAC,wBAAwB,GAAG,CAAC,IAAI,CAAC,iCAAiC,CAAC;QACzE,CAAC,GACA,CACF,CAAC;AACH,CAAC","sourcesContent":["import Icon from \"./Icon.js\";\nimport multiSelectAll from \"@ui5/webcomponents-icons/dist/multiselect-all.js\";\nimport InputTemplate from \"./InputTemplate.js\";\nimport type MultiInput from \"./MultiInput.js\";\nimport type { MultiInputTokenDeleteEventDetail } from \"./MultiInput.js\";\nimport Tokenizer from \"./Tokenizer.js\";\nimport ToggleButton from \"./ToggleButton.js\";\nimport List from \"./List.js\";\nimport ListItemStandard from \"./ListItemStandard.js\";\nimport ListAccessibleRole from \"./types/ListAccessibleRole.js\";\nimport valueHelp from \"@ui5/webcomponents-icons/dist/value-help.js\";\n\nexport default function MultiInputTemplate(this: MultiInput) {\n\treturn [\n\t\tInputTemplate.call(this, {\n\t\t\tpreContent,\n\t\t\tpostContent,\n\t\t\tsuggestionsList: multiInputSuggestionsList,\n\t\t\tmobileHeader: multiInputMobileHeader,\n\t\t}),\n\t];\n}\n\nfunction preContent(this: MultiInput) {\n\treturn (\n\t\t<>\n\t\t\t<span id=\"hiddenText-nMore\" class=\"ui5-hidden-text\">{this._tokensCountText}</span>\n\n\t\t\t{this.showValueHelpIcon &&\n\t\t\t\t<span id=\"hiddenText-value-help\" class=\"ui5-hidden-text\">{this._valueHelpText}</span>\n\t\t\t}\n\t\t\t<Tokenizer\n\t\t\t\tclass=\"ui5-multi-input-tokenizer\"\n\t\t\t\topener={this.morePopoverOpener}\n\t\t\t\tpopoverMinWidth={this._inputWidth}\n\t\t\t\thidePopoverArrow={true}\n\t\t\t\texpanded={this.tokenizerExpanded}\n\t\t\t\tonKeyDown={this._onTokenizerKeydown}\n\t\t\t\tonTokenDelete={this.tokenDelete}\n\t\t\t\tonFocusOut={this._tokenizerFocusOut}\n\t\t\t\tonShowMoreItemsPress={this._showMoreItemsPress}\n\t\t\t>\n\t\t\t\t{ this.tokens.map(token => <slot name={token._individualSlot}></slot>)}\n\t\t\t</Tokenizer>\n\t\t</>\n\t);\n}\n\nfunction postContent(this: MultiInput) {\n\treturn (\n\t\t<>\n\t\t\t{this.showValueHelpIcon &&\n\t\t\t\t<Icon\n\t\t\t\t\tclass=\"inputIcon\"\n\t\t\t\t\tname={valueHelp}\n\t\t\t\t\taccessibleName={this.valueHelpLabel}\n\t\t\t\t\tonMouseUp={this.valueHelpMouseUp}\n\t\t\t\t\tonMouseDown={this.valueHelpMouseDown}\n\t\t\t\t\tonClick={this.valueHelpPress}\n\t\t\t\t/>\n\t\t\t}\n\t\t</>\n\t);\n}\n\nfunction multiInputSuggestionsList(this: MultiInput) {\n\tif (this._effectiveShowTokensInSuggestions) {\n\t\treturn (\n\t\t\t<List\n\t\t\t\tclass=\"ui5-tokenizer-list\"\n\t\t\t\taccessibleRole={ListAccessibleRole.ListBox}\n\t\t\t\tseparators={this.suggestionSeparators}\n\t\t\t\tselectionMode=\"Delete\"\n\t\t\t\tonMouseDown={this.onItemMouseDown}\n\t\t\t\tonItemClick={this._handleSuggestionItemPress}\n\t\t\t\tonSelectionChange={this._handleSelectionChange}\n\t\t\t\tonItemDelete={(e: any) => {\n\t\t\t\t\tconst listItem = e.detail.item;\n\t\t\t\t\tconst tokenId = listItem.getAttribute(\"data-ui5-token-ref-id\");\n\t\t\t\t\tconst token = this.tokens.find((t: any) => t._id === tokenId);\n\n\t\t\t\t\tif (token) {\n\t\t\t\t\t\tthis.tokenDelete({ detail: { tokens: [token] } } as CustomEvent<MultiInputTokenDeleteEventDetail>);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{this.tokens?.map((token: any, index: number) => (\n\t\t\t\t\t<ListItemStandard\n\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\tclass=\"ui5-suggestion-token-item\"\n\t\t\t\t\t\tdata-ui5-token-ref-id={token._id}\n\t\t\t\t\t\twrappingType=\"Normal\"\n\t\t\t\t\t\ttext={token.text}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</List>\n\t\t);\n\t}\n\n\treturn (\n\t\t<List\n\t\t\taccessibleRole={ListAccessibleRole.ListBox}\n\t\t\tseparators={this.suggestionSeparators}\n\t\t\tselectionMode=\"Single\"\n\t\t\tonMouseDown={this.onItemMouseDown}\n\t\t\tonItemClick={this._handleSuggestionItemPress}\n\t\t\tonSelectionChange={this._handleSelectionChange}\n\t\t>\n\t\t\t<slot></slot>\n\t\t</List>\n\t);\n}\n\nfunction multiInputMobileHeader(this: MultiInput) {\n\treturn (\n\t\t<ToggleButton\n\t\t\tclass=\"ui5-multi-input-mobile-dialog-button\"\n\t\t\tdesign=\"Transparent\"\n\t\t\ticon={multiSelectAll}\n\t\t\taccessibleName={this._filterButtonAccessibleName}\n\t\t\tdisabled={!this.tokens?.length}\n\t\t\tpressed={this._effectiveShowTokensInSuggestions}\n\t\t\tonClick={() => {\n\t\t\t\tthis._userToggledShowTokens = true;\n\t\t\t\tthis._showTokensInSuggestions = !this._effectiveShowTokensInSuggestions;\n\t\t\t}}\n\t\t/>\n\t);\n}\n"]}
|
package/dist/Panel.d.ts
CHANGED
|
@@ -141,6 +141,7 @@ declare class Panel extends UI5Element {
|
|
|
141
141
|
_contentExpanded: boolean;
|
|
142
142
|
_animationRunning: boolean;
|
|
143
143
|
_pendingToggle: boolean;
|
|
144
|
+
_touched: boolean;
|
|
144
145
|
/**
|
|
145
146
|
* Defines the component header area.
|
|
146
147
|
*
|
|
@@ -152,6 +153,8 @@ declare class Panel extends UI5Element {
|
|
|
152
153
|
onBeforeRendering(): void;
|
|
153
154
|
shouldToggle(element: HTMLElement): boolean;
|
|
154
155
|
get shouldNotAnimate(): boolean;
|
|
156
|
+
_isMobile(): void;
|
|
157
|
+
_headerFocusOut(): void;
|
|
155
158
|
_headerClick(e: MouseEvent): void;
|
|
156
159
|
_toggleButtonClick(e: UI5CustomEvent<Button, "click">): void;
|
|
157
160
|
_headerKeyDown(e: KeyboardEvent): void;
|
package/dist/Panel.js
CHANGED
|
@@ -16,6 +16,7 @@ import slideUp from "@ui5/webcomponents-base/dist/animations/slideUp.js";
|
|
|
16
16
|
import { isSpace, isEnter, isEscape } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
17
17
|
import AnimationMode from "@ui5/webcomponents-base/dist/types/AnimationMode.js";
|
|
18
18
|
import { getAnimationMode } from "@ui5/webcomponents-base/dist/config/AnimationMode.js";
|
|
19
|
+
import { supportsTouch } from "@ui5/webcomponents-base/dist/Device.js";
|
|
19
20
|
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
20
21
|
import PanelTemplate from "./PanelTemplate.js";
|
|
21
22
|
import { PANEL_ICON } from "./generated/i18n/i18n-defaults.js";
|
|
@@ -140,6 +141,7 @@ let Panel = Panel_1 = class Panel extends UI5Element {
|
|
|
140
141
|
this._contentExpanded = false;
|
|
141
142
|
this._animationRunning = false;
|
|
142
143
|
this._pendingToggle = false;
|
|
144
|
+
this._touched = false;
|
|
143
145
|
}
|
|
144
146
|
onBeforeRendering() {
|
|
145
147
|
// If the animation is running, it will set the content expanded state at the end
|
|
@@ -158,6 +160,14 @@ let Panel = Panel_1 = class Panel extends UI5Element {
|
|
|
158
160
|
get shouldNotAnimate() {
|
|
159
161
|
return this.noAnimation || getAnimationMode() === AnimationMode.None;
|
|
160
162
|
}
|
|
163
|
+
_isMobile() {
|
|
164
|
+
if (supportsTouch()) {
|
|
165
|
+
this._touched = true;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
_headerFocusOut() {
|
|
169
|
+
this._touched = false;
|
|
170
|
+
}
|
|
161
171
|
_headerClick(e) {
|
|
162
172
|
if (!this.shouldToggle(e.target)) {
|
|
163
173
|
return;
|
|
@@ -324,6 +334,9 @@ __decorate([
|
|
|
324
334
|
__decorate([
|
|
325
335
|
property({ type: Boolean, noAttribute: true })
|
|
326
336
|
], Panel.prototype, "_pendingToggle", void 0);
|
|
337
|
+
__decorate([
|
|
338
|
+
property({ type: Boolean })
|
|
339
|
+
], Panel.prototype, "_touched", void 0);
|
|
327
340
|
__decorate([
|
|
328
341
|
slot()
|
|
329
342
|
], Panel.prototype, "header", void 0);
|
package/dist/Panel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Panel.js","sourceRoot":"","sources":["../src/Panel.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,OAAO,MAAM,oDAAoD,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,aAAa,MAAM,qDAAqD,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AACxF,OAAO,IAAI,MAAM,iDAAiD,CAAC;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IACF,KAAK,CAAC,QAAQ,EAAE;QAChB,OAAO,EAAE,IAAI;KACb,CAAC;GACI,KAAK,CAuSV;AAED,KAAK,CAAC,MAAM,EAAE,CAAC;AAEf,eAAe,KAAK,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { Slot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport slideDown from \"@ui5/webcomponents-base/dist/animations/slideDown.js\";\nimport slideUp from \"@ui5/webcomponents-base/dist/animations/slideUp.js\";\nimport { isSpace, isEnter, isEscape } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport AnimationMode from \"@ui5/webcomponents-base/dist/types/AnimationMode.js\";\nimport { getAnimationMode } from \"@ui5/webcomponents-base/dist/config/AnimationMode.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { UI5CustomEvent } from \"@ui5/webcomponents-base\";\nimport type TitleLevel from \"./types/TitleLevel.js\";\nimport type Button from \"./Button.js\";\nimport type PanelAccessibleRole from \"./types/PanelAccessibleRole.js\";\nimport PanelTemplate from \"./PanelTemplate.js\";\nimport { PANEL_ICON } from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport panelCss from \"./generated/themes/Panel.css.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-panel` component is a container which has a header and a\n * content area and is used\n * for grouping and displaying information. It can be collapsed to save space on the screen.\n *\n * ### Guidelines:\n *\n * - Nesting two or more panels is not recommended.\n * - Do not stack too many panels on one page.\n *\n * ### Structure\n * The panel's header area consists of a title bar with a header text or custom header.\n *\n * The header is clickable and can be used to toggle between the expanded and collapsed state. It includes an icon which rotates depending on the state.\n *\n * The custom header can be set through the `header` slot and it may contain arbitraray content, such as: title, buttons or any other HTML elements.\n *\n * The content area can contain an arbitrary set of controls.\n *\n * **Note:** The custom header is not clickable out of the box, but in this case the icon is interactive and allows to show/hide the content area.\n *\n * ### Responsive Behavior\n *\n * - If the width of the panel is set to 100% (default), the panel and its children are\n * resized responsively,\n * depending on its parent container.\n * - If the panel has a fixed height, it will take up the space even if the panel is\n * collapsed.\n * - When the panel is expandable (the `fixed` property is set to `false`),\n * an arrow icon (pointing to the right) appears in front of the header.\n * - When the animation is activated, expand/collapse uses a smooth animation to open or\n * close the content area.\n * - When the panel expands/collapses, the arrow icon rotates 90 degrees\n * clockwise/counter-clockwise.\n *\n * ### Keyboard Handling\n *\n * #### Fast Navigation\n * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up].\n * In order to use this functionality, you need to import the following module:\n * `import \"@ui5/webcomponents-base/dist/features/F6Navigation.js\"`\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/Panel.js\";`\n * @constructor\n * @extends UI5Element\n * @public\n * @slot {Array<Node>} default - Defines the content of the component. The content is visible only when the component is expanded.\n * @csspart header - Used to style the wrapper of the header.\n * @csspart content - Used to style the wrapper of the content.\n */\n@customElement({\n\ttag: \"ui5-panel\",\n\tfastNavigation: true,\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: PanelTemplate,\n\tstyles: panelCss,\n})\n/**\n * Fired when the component is expanded/collapsed by user interaction.\n * @public\n */\n@event(\"toggle\", {\n\tbubbles: true,\n})\nclass Panel extends UI5Element {\n\teventDetails!: {\n\t\ttoggle: void,\n\t}\n\t/**\n\t * This property is used to set the header text of the component.\n\t * The text is visible in both expanded and collapsed states.\n\t *\n\t * **Note:** This property is overridden by the `header` slot.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\theaderText?: string;\n\n\t/**\n\t * Determines whether the component is in a fixed state that is not\n\t * expandable/collapsible by user interaction.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tfixed = false;\n\n\t/**\n\t * Indicates whether the component is collapsed and only the header is displayed.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tcollapsed = false;\n\n\t/**\n\t * Indicates whether the transition between the expanded and the collapsed state of the component is animated. By default the animation is enabled.\n\t * @default false\n\t * @public\n\t * @since 1.0.0-rc.16\n\t */\n\t@property({ type: Boolean })\n\tnoAnimation = false;\n\n\t/**\n\t * Sets the accessible ARIA role of the component.\n\t * Depending on the usage, you can change the role from the default `Form`\n\t * to `Region` or `Complementary`.\n\t * @default \"Form\"\n\t * @public\n\t */\n\t@property()\n\taccessibleRole: `${PanelAccessibleRole}` = \"Form\";\n\n\t/**\n\t * Defines the \"aria-level\" of component heading,\n\t * set by the `headerText`.\n\t * @default \"H2\"\n\t * @public\n\t*/\n\t@property()\n\theaderLevel: `${TitleLevel}` = \"H2\";\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Indicates whether the Panel header is sticky or not.\n\t * If stickyHeader is set to true, then whenever you scroll the content or\n\t * the application, the header of the panel will be always visible and\n\t * a solid color will be used for its design.\n\t * @default false\n\t * @public\n\t * @since 1.16.0-rc.1\n\t */\n\t@property({ type: Boolean })\n\tstickyHeader = false;\n\n\t/**\n\t * When set to `true`, the `accessibleName` property will be\n\t * applied not only on the panel root itself, but on its toggle button too.\n\t * **Note:** This property only has effect if `accessibleName` is set and a header slot is provided.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tuseAccessibleNameForToggleButton = false;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_hasHeader = false;\n\n\t@property({ type: Boolean, noAttribute: true })\n\t_contentExpanded = false;\n\n\t@property({ type: Boolean, noAttribute: true })\n\t_animationRunning = false;\n\n\t@property({ type: Boolean, noAttribute: true })\n\t_pendingToggle = false;\n\n\t/**\n\t * Defines the component header area.\n\t *\n\t * **Note:** When a header is provided, the `headerText` property is ignored.\n\t * @public\n\t */\n\t@slot()\n\theader!: Slot<HTMLElement>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tonBeforeRendering() {\n\t\t// If the animation is running, it will set the content expanded state at the end\n\t\tif (!this._animationRunning) {\n\t\t\tthis._contentExpanded = !this.collapsed;\n\t\t}\n\n\t\tthis._hasHeader = !!this.header.length;\n\t}\n\n\tshouldToggle(element: HTMLElement): boolean {\n\t\tconst customContent = this.header.length;\n\t\tif (customContent) {\n\t\t\treturn element.classList.contains(\"ui5-panel-header-button\");\n\t\t}\n\t\treturn true;\n\t}\n\n\tget shouldNotAnimate() {\n\t\treturn this.noAnimation || getAnimationMode() === AnimationMode.None;\n\t}\n\n\t_headerClick(e: MouseEvent) {\n\t\tif (!this.shouldToggle(e.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._toggleOpen();\n\t}\n\n\t_toggleButtonClick(e: UI5CustomEvent<Button, \"click\">) {\n\t\tif (e.detail.originalEvent.x === 0 && e.detail.originalEvent.y === 0) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\t}\n\n\t_headerKeyDown(e: KeyboardEvent) {\n\t\tif (!this.shouldToggle(e.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\tthis._toggleOpen();\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault();\n\t\t\tthis._pendingToggle = true;\n\t\t}\n\n\t\t// Cancel toggle if Escape is pressed\n\t\tif (isEscape(e) && this._pendingToggle) {\n\t\t\te.preventDefault();\n\t\t\tthis._pendingToggle = false;\n\t\t}\n\t}\n\n\t_headerKeyUp(e: KeyboardEvent) {\n\t\tif (!this.shouldToggle(e.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\t// Only toggle if space was pressed and escape wasn't pressed to cancel\n\t\t\tif (this._pendingToggle) {\n\t\t\t\tthis._toggleOpen();\n\t\t\t}\n\t\t\tthis._pendingToggle = false;\n\t\t}\n\t}\n\n\t_toggleOpen() {\n\t\tif (this.fixed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.collapsed = !this.collapsed;\n\n\t\tif (this.shouldNotAnimate) {\n\t\t\tthis.fireDecoratorEvent(\"toggle\");\n\t\t\treturn;\n\t\t}\n\n\t\tthis._animationRunning = true;\n\n\t\tconst elements = this.getDomRef()!.querySelectorAll(\".ui5-panel-content\");\n\t\tconst animations: Array<Promise<void | Error>> = [];\n\n\t\t[].forEach.call(elements, oElement => {\n\t\t\tif (this.collapsed) {\n\t\t\t\tanimations.push(slideUp(oElement).promise());\n\t\t\t} else {\n\t\t\t\tanimations.push(slideDown(oElement).promise());\n\t\t\t}\n\t\t});\n\n\t\tPromise.all(animations).then(() => {\n\t\t\tthis._animationRunning = false;\n\t\t\tthis._contentExpanded = !this.collapsed;\n\t\t\tthis.fireDecoratorEvent(\"toggle\");\n\t\t});\n\t}\n\n\t_headerOnTarget(target: HTMLElement) {\n\t\treturn target.classList.contains(\"sapMPanelWrappingDiv\");\n\t}\n\n\tget toggleButtonTitle() {\n\t\treturn Panel.i18nBundle.getText(PANEL_ICON);\n\t}\n\n\tget expanded() {\n\t\treturn !this.collapsed;\n\t}\n\n\tget accRole() {\n\t\treturn this.accessibleRole.toLowerCase() as Lowercase<PanelAccessibleRole>;\n\t}\n\n\tget effectiveAccessibleName() {\n\t\treturn typeof this.accessibleName === \"string\" && this.accessibleName.length ? this.accessibleName : undefined;\n\t}\n\n\tget accInfo() {\n\t\treturn {\n\t\t\t\"button\": {\n\t\t\t\t\"accessibilityAttributes\": {\n\t\t\t\t\t\"expanded\": this.expanded,\n\t\t\t\t},\n\t\t\t\t\"title\": this.toggleButtonTitle,\n\t\t\t\t\"ariaLabelButton\": !this.nonFocusableButton && this.useAccessibleNameForToggleButton ? this.effectiveAccessibleName : undefined,\n\t\t\t},\n\t\t\t\"ariaExpanded\": this.nonFixedInternalHeader ? this.expanded : undefined,\n\t\t\t\"ariaControls\": this.nonFixedInternalHeader ? `${this._id}-content` : undefined,\n\t\t\t\"ariaLabelledby\": this.nonFocusableButton ? this.ariaLabelledbyReference : undefined,\n\t\t\t\"role\": this.nonFixedInternalHeader ? \"button\" : undefined as \"button\" | undefined,\n\t\t};\n\t}\n\n\tget ariaLabelledbyReference() {\n\t\treturn (this.nonFocusableButton && this.headerText && !this.fixed) ? `${this._id}-header-title` : undefined;\n\t}\n\n\tget fixedPanelAriaLabelledbyReference() {\n\t\treturn this.fixed && !this.effectiveAccessibleName ? `${this._id}-header-title` : undefined;\n\t}\n\n\tget headerAriaLevel() {\n\t\treturn Number.parseInt(this.headerLevel.slice(1));\n\t}\n\n\tget headerTabIndex() {\n\t\treturn (this.header.length || this.fixed) ? -1 : 0;\n\t}\n\n\tget headingWrapperAriaLevel() {\n\t\treturn !this._hasHeader ? this.headerAriaLevel : undefined;\n\t}\n\n\tget headingWrapperRole() {\n\t\treturn !this._hasHeader ? \"heading\" : undefined;\n\t}\n\n\tget nonFixedInternalHeader() {\n\t\treturn !this._hasHeader && !this.fixed;\n\t}\n\n\tget hasHeaderOrHeaderText() {\n\t\treturn this._hasHeader || this.headerText;\n\t}\n\n\tget nonFocusableButton() {\n\t\treturn !this.header.length;\n\t}\n}\n\nPanel.define();\n\nexport default Panel;\n"]}
|
|
1
|
+
{"version":3,"file":"Panel.js","sourceRoot":"","sources":["../src/Panel.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,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C,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CACP;AAUrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+DACa;AAMzC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCACT;AAGnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;+CACtB;AAGzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;gDACrB;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;6CACxB;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uCACX;AASjB;IADC,IAAI,EAAE;qCACoB;AAGpB;IADN,IAAI,CAAC,oBAAoB,CAAC;+BACG;AAvHzB,KAAK;IAfV,aAAa,CAAC;QACd,GAAG,EAAE,WAAW;QAChB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,aAAa;QACvB,MAAM,EAAE,QAAQ;KAChB,CAAC;IACF;;;OAGG;;IACF,KAAK,CAAC,QAAQ,EAAE;QAChB,OAAO,EAAE,IAAI;KACb,CAAC;GACI,KAAK,CAoTV;AAED,KAAK,CAAC,MAAM,EAAE,CAAC;AAEf,eAAe,KAAK,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { Slot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport slideDown from \"@ui5/webcomponents-base/dist/animations/slideDown.js\";\nimport slideUp from \"@ui5/webcomponents-base/dist/animations/slideUp.js\";\nimport { isSpace, isEnter, isEscape } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport AnimationMode from \"@ui5/webcomponents-base/dist/types/AnimationMode.js\";\nimport { getAnimationMode } from \"@ui5/webcomponents-base/dist/config/AnimationMode.js\";\nimport { supportsTouch } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { UI5CustomEvent } from \"@ui5/webcomponents-base\";\nimport type TitleLevel from \"./types/TitleLevel.js\";\nimport type Button from \"./Button.js\";\nimport type PanelAccessibleRole from \"./types/PanelAccessibleRole.js\";\nimport PanelTemplate from \"./PanelTemplate.js\";\nimport { PANEL_ICON } from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport panelCss from \"./generated/themes/Panel.css.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-panel` component is a container which has a header and a\n * content area and is used\n * for grouping and displaying information. It can be collapsed to save space on the screen.\n *\n * ### Guidelines:\n *\n * - Nesting two or more panels is not recommended.\n * - Do not stack too many panels on one page.\n *\n * ### Structure\n * The panel's header area consists of a title bar with a header text or custom header.\n *\n * The header is clickable and can be used to toggle between the expanded and collapsed state. It includes an icon which rotates depending on the state.\n *\n * The custom header can be set through the `header` slot and it may contain arbitraray content, such as: title, buttons or any other HTML elements.\n *\n * The content area can contain an arbitrary set of controls.\n *\n * **Note:** The custom header is not clickable out of the box, but in this case the icon is interactive and allows to show/hide the content area.\n *\n * ### Responsive Behavior\n *\n * - If the width of the panel is set to 100% (default), the panel and its children are\n * resized responsively,\n * depending on its parent container.\n * - If the panel has a fixed height, it will take up the space even if the panel is\n * collapsed.\n * - When the panel is expandable (the `fixed` property is set to `false`),\n * an arrow icon (pointing to the right) appears in front of the header.\n * - When the animation is activated, expand/collapse uses a smooth animation to open or\n * close the content area.\n * - When the panel expands/collapses, the arrow icon rotates 90 degrees\n * clockwise/counter-clockwise.\n *\n * ### Keyboard Handling\n *\n * #### Fast Navigation\n * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up].\n * In order to use this functionality, you need to import the following module:\n * `import \"@ui5/webcomponents-base/dist/features/F6Navigation.js\"`\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/Panel.js\";`\n * @constructor\n * @extends UI5Element\n * @public\n * @slot {Array<Node>} default - Defines the content of the component. The content is visible only when the component is expanded.\n * @csspart header - Used to style the wrapper of the header.\n * @csspart content - Used to style the wrapper of the content.\n */\n@customElement({\n\ttag: \"ui5-panel\",\n\tfastNavigation: true,\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: PanelTemplate,\n\tstyles: panelCss,\n})\n/**\n * Fired when the component is expanded/collapsed by user interaction.\n * @public\n */\n@event(\"toggle\", {\n\tbubbles: true,\n})\nclass Panel extends UI5Element {\n\teventDetails!: {\n\t\ttoggle: void,\n\t}\n\t/**\n\t * This property is used to set the header text of the component.\n\t * The text is visible in both expanded and collapsed states.\n\t *\n\t * **Note:** This property is overridden by the `header` slot.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\theaderText?: string;\n\n\t/**\n\t * Determines whether the component is in a fixed state that is not\n\t * expandable/collapsible by user interaction.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tfixed = false;\n\n\t/**\n\t * Indicates whether the component is collapsed and only the header is displayed.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tcollapsed = false;\n\n\t/**\n\t * Indicates whether the transition between the expanded and the collapsed state of the component is animated. By default the animation is enabled.\n\t * @default false\n\t * @public\n\t * @since 1.0.0-rc.16\n\t */\n\t@property({ type: Boolean })\n\tnoAnimation = false;\n\n\t/**\n\t * Sets the accessible ARIA role of the component.\n\t * Depending on the usage, you can change the role from the default `Form`\n\t * to `Region` or `Complementary`.\n\t * @default \"Form\"\n\t * @public\n\t */\n\t@property()\n\taccessibleRole: `${PanelAccessibleRole}` = \"Form\";\n\n\t/**\n\t * Defines the \"aria-level\" of component heading,\n\t * set by the `headerText`.\n\t * @default \"H2\"\n\t * @public\n\t*/\n\t@property()\n\theaderLevel: `${TitleLevel}` = \"H2\";\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Indicates whether the Panel header is sticky or not.\n\t * If stickyHeader is set to true, then whenever you scroll the content or\n\t * the application, the header of the panel will be always visible and\n\t * a solid color will be used for its design.\n\t * @default false\n\t * @public\n\t * @since 1.16.0-rc.1\n\t */\n\t@property({ type: Boolean })\n\tstickyHeader = false;\n\n\t/**\n\t * When set to `true`, the `accessibleName` property will be\n\t * applied not only on the panel root itself, but on its toggle button too.\n\t * **Note:** This property only has effect if `accessibleName` is set and a header slot is provided.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tuseAccessibleNameForToggleButton = false;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_hasHeader = false;\n\n\t@property({ type: Boolean, noAttribute: true })\n\t_contentExpanded = false;\n\n\t@property({ type: Boolean, noAttribute: true })\n\t_animationRunning = false;\n\n\t@property({ type: Boolean, noAttribute: true })\n\t_pendingToggle = false;\n\n\t@property({ type: Boolean })\n\t_touched = false;\n\n\t/**\n\t * Defines the component header area.\n\t *\n\t * **Note:** When a header is provided, the `headerText` property is ignored.\n\t * @public\n\t */\n\t@slot()\n\theader!: Slot<HTMLElement>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tonBeforeRendering() {\n\t\t// If the animation is running, it will set the content expanded state at the end\n\t\tif (!this._animationRunning) {\n\t\t\tthis._contentExpanded = !this.collapsed;\n\t\t}\n\n\t\tthis._hasHeader = !!this.header.length;\n\t}\n\n\tshouldToggle(element: HTMLElement): boolean {\n\t\tconst customContent = this.header.length;\n\t\tif (customContent) {\n\t\t\treturn element.classList.contains(\"ui5-panel-header-button\");\n\t\t}\n\t\treturn true;\n\t}\n\n\tget shouldNotAnimate() {\n\t\treturn this.noAnimation || getAnimationMode() === AnimationMode.None;\n\t}\n\n\t_isMobile() {\n\t\tif (supportsTouch()) {\n\t\t\tthis._touched = true;\n\t\t}\n\t}\n\n\t_headerFocusOut() {\n\t\tthis._touched = false;\n\t}\n\n\t_headerClick(e: MouseEvent) {\n\t\tif (!this.shouldToggle(e.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._toggleOpen();\n\t}\n\n\t_toggleButtonClick(e: UI5CustomEvent<Button, \"click\">) {\n\t\tif (e.detail.originalEvent.x === 0 && e.detail.originalEvent.y === 0) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\t}\n\n\t_headerKeyDown(e: KeyboardEvent) {\n\t\tif (!this.shouldToggle(e.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\tthis._toggleOpen();\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault();\n\t\t\tthis._pendingToggle = true;\n\t\t}\n\n\t\t// Cancel toggle if Escape is pressed\n\t\tif (isEscape(e) && this._pendingToggle) {\n\t\t\te.preventDefault();\n\t\t\tthis._pendingToggle = false;\n\t\t}\n\t}\n\n\t_headerKeyUp(e: KeyboardEvent) {\n\t\tif (!this.shouldToggle(e.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\t// Only toggle if space was pressed and escape wasn't pressed to cancel\n\t\t\tif (this._pendingToggle) {\n\t\t\t\tthis._toggleOpen();\n\t\t\t}\n\t\t\tthis._pendingToggle = false;\n\t\t}\n\t}\n\n\t_toggleOpen() {\n\t\tif (this.fixed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.collapsed = !this.collapsed;\n\n\t\tif (this.shouldNotAnimate) {\n\t\t\tthis.fireDecoratorEvent(\"toggle\");\n\t\t\treturn;\n\t\t}\n\n\t\tthis._animationRunning = true;\n\n\t\tconst elements = this.getDomRef()!.querySelectorAll(\".ui5-panel-content\");\n\t\tconst animations: Array<Promise<void | Error>> = [];\n\n\t\t[].forEach.call(elements, oElement => {\n\t\t\tif (this.collapsed) {\n\t\t\t\tanimations.push(slideUp(oElement).promise());\n\t\t\t} else {\n\t\t\t\tanimations.push(slideDown(oElement).promise());\n\t\t\t}\n\t\t});\n\n\t\tPromise.all(animations).then(() => {\n\t\t\tthis._animationRunning = false;\n\t\t\tthis._contentExpanded = !this.collapsed;\n\t\t\tthis.fireDecoratorEvent(\"toggle\");\n\t\t});\n\t}\n\n\t_headerOnTarget(target: HTMLElement) {\n\t\treturn target.classList.contains(\"sapMPanelWrappingDiv\");\n\t}\n\n\tget toggleButtonTitle() {\n\t\treturn Panel.i18nBundle.getText(PANEL_ICON);\n\t}\n\n\tget expanded() {\n\t\treturn !this.collapsed;\n\t}\n\n\tget accRole() {\n\t\treturn this.accessibleRole.toLowerCase() as Lowercase<PanelAccessibleRole>;\n\t}\n\n\tget effectiveAccessibleName() {\n\t\treturn typeof this.accessibleName === \"string\" && this.accessibleName.length ? this.accessibleName : undefined;\n\t}\n\n\tget accInfo() {\n\t\treturn {\n\t\t\t\"button\": {\n\t\t\t\t\"accessibilityAttributes\": {\n\t\t\t\t\t\"expanded\": this.expanded,\n\t\t\t\t},\n\t\t\t\t\"title\": this.toggleButtonTitle,\n\t\t\t\t\"ariaLabelButton\": !this.nonFocusableButton && this.useAccessibleNameForToggleButton ? this.effectiveAccessibleName : undefined,\n\t\t\t},\n\t\t\t\"ariaExpanded\": this.nonFixedInternalHeader ? this.expanded : undefined,\n\t\t\t\"ariaControls\": this.nonFixedInternalHeader ? `${this._id}-content` : undefined,\n\t\t\t\"ariaLabelledby\": this.nonFocusableButton ? this.ariaLabelledbyReference : undefined,\n\t\t\t\"role\": this.nonFixedInternalHeader ? \"button\" : undefined as \"button\" | undefined,\n\t\t};\n\t}\n\n\tget ariaLabelledbyReference() {\n\t\treturn (this.nonFocusableButton && this.headerText && !this.fixed) ? `${this._id}-header-title` : undefined;\n\t}\n\n\tget fixedPanelAriaLabelledbyReference() {\n\t\treturn this.fixed && !this.effectiveAccessibleName ? `${this._id}-header-title` : undefined;\n\t}\n\n\tget headerAriaLevel() {\n\t\treturn Number.parseInt(this.headerLevel.slice(1));\n\t}\n\n\tget headerTabIndex() {\n\t\treturn (this.header.length || this.fixed) ? -1 : 0;\n\t}\n\n\tget headingWrapperAriaLevel() {\n\t\treturn !this._hasHeader ? this.headerAriaLevel : undefined;\n\t}\n\n\tget headingWrapperRole() {\n\t\treturn !this._hasHeader ? \"heading\" : undefined;\n\t}\n\n\tget nonFixedInternalHeader() {\n\t\treturn !this._hasHeader && !this.fixed;\n\t}\n\n\tget hasHeaderOrHeaderText() {\n\t\treturn this._hasHeader || this.headerText;\n\t}\n\n\tget nonFocusableButton() {\n\t\treturn !this.header.length;\n\t}\n}\n\nPanel.define();\n\nexport default Panel;\n"]}
|
package/dist/PanelTemplate.js
CHANGED
|
@@ -8,7 +8,7 @@ export default function PanelTemplate() {
|
|
|
8
8
|
_jsx("div", { class: {
|
|
9
9
|
"ui5-panel-heading-wrapper": true,
|
|
10
10
|
"ui5-panel-heading-wrapper-sticky": this.stickyHeader,
|
|
11
|
-
}, role: this.headingWrapperRole, "aria-level": this.headingWrapperAriaLevel, children: _jsxs("div", { onClick: this._headerClick, onKeyDown: this._headerKeyDown, onKeyUp: this._headerKeyUp, class: "ui5-panel-header", tabindex: this.headerTabIndex, role: this.accInfo.role, "aria-expanded": this.accInfo.ariaExpanded, "aria-controls": this.accInfo.ariaControls, "aria-labelledby": this.accInfo.ariaLabelledby, part: "header", children: [!this.fixed &&
|
|
11
|
+
}, role: this.headingWrapperRole, "aria-level": this.headingWrapperAriaLevel, children: _jsxs("div", { onClick: this._headerClick, onKeyDown: this._headerKeyDown, onKeyUp: this._headerKeyUp, onTouchStart: this._isMobile, onFocusOut: this._headerFocusOut, class: "ui5-panel-header", tabindex: this.headerTabIndex, role: this.accInfo.role, "aria-expanded": this.accInfo.ariaExpanded, "aria-controls": this.accInfo.ariaControls, "aria-labelledby": this.accInfo.ariaLabelledby, part: "header", children: [!this.fixed &&
|
|
12
12
|
_jsx("div", { class: "ui5-panel-header-button-root", children: this._hasHeader ?
|
|
13
13
|
_jsx(Button, { design: "Transparent", class: "ui5-panel-header-button ui5-panel-header-button-with-icon", onClick: this._toggleButtonClick, accessibilityAttributes: this.accInfo.button.accessibilityAttributes, tooltip: this.accInfo.button.title, accessibleName: this.accInfo.button.ariaLabelButton, children: _jsx("div", { class: "ui5-panel-header-icon-wrapper", children: _jsx(Icon, { class: {
|
|
14
14
|
"ui5-panel-header-icon": true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelTemplate.js","sourceRoot":"","sources":["../src/PanelTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAE/E,MAAM,CAAC,OAAO,UAAU,aAAa;IACpC,OAAO,CAAC,4BACP,eACC,KAAK,EAAC,gBAAgB,EACtB,IAAI,EAAE,IAAI,CAAC,OAAO,gBACN,IAAI,CAAC,uBAAuB,qBACvB,IAAI,CAAC,iCAAiC,aAErD,IAAI,CAAC,qBAAqB;oBAC3B,+CAA+C;oBAC/C,cACC,KAAK,EAAE;4BACN,2BAA2B,EAAE,IAAI;4BACjC,kCAAkC,EAAE,IAAI,CAAC,YAAY;yB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AE,IAAI,EACjB,cAAc,EAAE,IAAI,CAAC,iBAAiB,GACrC,GAEE,EAGL,IAAI,CAAC,UAAU,CAAC,CAAC;oCAClB,eAAM,IAAI,EAAC,QAAQ,GAAQ;oCAC3B,CAAC,CAAC,OAAO;wCACT,cACC,EAAE,EAAG,GAAG,IAAI,CAAC,GAAG,eAAe,EAC/B,KAAK,EAAC,wBAAwB,YAE5B,IAAI,CAAC,UAAU,GACZ,IAEF,GACD,EAIP,cACC,KAAK,EAAC,mBAAmB,EACzB,EAAE,EAAG,GAAG,IAAI,CAAC,GAAG,UAAU,EAC1B,QAAQ,EAAG,CAAC,CAAC,EACb,KAAK,EAAE;wBACN,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;qBACjD,EACD,IAAI,EAAC,SAAS,YAEd,gBAAa,GACR,IACD,GACJ,CAAC,CAAC;AACN,CAAC","sourcesContent":["import type Panel from \"./Panel.js\";\nimport Button from \"./Button.js\";\nimport Icon from \"./Icon.js\";\n\nimport slimArrowRight from \"@ui5/webcomponents-icons/dist/slim-arrow-right.js\";\n\nexport default function PanelTemplate(this: Panel) {\n\treturn (<>\n\t\t<div\n\t\t\tclass=\"ui5-panel-root\"\n\t\t\trole={this.accRole}\n\t\t\taria-label={this.effectiveAccessibleName}\n\t\t\taria-labelledby={this.fixedPanelAriaLabelledbyReference}\n\t\t>\n\t\t\t{ this.hasHeaderOrHeaderText &&\n\t\t\t\t// header: either header or h1 with header text\n\t\t\t\t<div\n\t\t\t\t\tclass={{\n\t\t\t\t\t\t\"ui5-panel-heading-wrapper\": true,\n\t\t\t\t\t\t\"ui5-panel-heading-wrapper-sticky\": this.stickyHeader,\n\t\t\t\t\t}}\n\t\t\t\t\trole={this.headingWrapperRole}\n\t\t\t\t\taria-level={this.headingWrapperAriaLevel}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tonClick={this._headerClick}\n\t\t\t\t\t\tonKeyDown={this._headerKeyDown}\n\t\t\t\t\t\tonKeyUp={this._headerKeyUp}\n\t\t\t\t\t\tclass=\"ui5-panel-header\"\n\t\t\t\t\t\ttabindex={this.headerTabIndex}\n\t\t\t\t\t\trole={this.accInfo.role}\n\t\t\t\t\t\taria-expanded={this.accInfo.ariaExpanded}\n\t\t\t\t\t\taria-controls={this.accInfo.ariaControls}\n\t\t\t\t\t\taria-labelledby={this.accInfo.ariaLabelledby}\n\t\t\t\t\t\tpart=\"header\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ !this.fixed &&\n\t\t\t\t\t\t\t<div class=\"ui5-panel-header-button-root\">\n\t\t\t\t\t\t\t\t{ this._hasHeader ?\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tdesign=\"Transparent\"\n\t\t\t\t\t\t\t\t\t\tclass=\"ui5-panel-header-button ui5-panel-header-button-with-icon\"\n\t\t\t\t\t\t\t\t\t\tonClick={this._toggleButtonClick}\n\t\t\t\t\t\t\t\t\t\taccessibilityAttributes={this.accInfo.button.accessibilityAttributes}\n\t\t\t\t\t\t\t\t\t\ttooltip={this.accInfo.button.title}\n\t\t\t\t\t\t\t\t\t\taccessibleName={this.accInfo.button.ariaLabelButton}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<div class=\"ui5-panel-header-icon-wrapper\">\n\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\tclass={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"ui5-panel-header-icon\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"ui5-panel-header-button-animated\": !this.shouldNotAnimate,\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\tname={slimArrowRight}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t</Icon>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t: // else\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\tclass={{\n\t\t\t\t\t\t\t\t\t\t\t\"ui5-panel-header-button\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"ui5-panel-header-icon\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"ui5-panel-header-button-animated\": !this.shouldNotAnimate,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tname={slimArrowRight}\n\t\t\t\t\t\t\t\t\t\tshowTooltip={true}\n\t\t\t\t\t\t\t\t\t\taccessibleName={this.toggleButtonTitle}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t{ this._hasHeader ?\n\t\t\t\t\t\t\t<slot name=\"header\"></slot>\n\t\t\t\t\t\t\t: // else\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tid={ `${this._id}-header-title` }\n\t\t\t\t\t\t\t\tclass=\"ui5-panel-header-title\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ this.headerText }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t}\n\n\t\t\t{/* content area */}\n\t\t\t<div\n\t\t\t\tclass=\"ui5-panel-content\"\n\t\t\t\tid={ `${this._id}-content` }\n\t\t\t\ttabindex={ -1 }\n\t\t\t\tstyle={{\n\t\t\t\t\tdisplay: this._contentExpanded ? \"block\" : \"none\",\n\t\t\t\t}}\n\t\t\t\tpart=\"content\"\n\t\t\t>\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t</div>\n\t</>);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PanelTemplate.js","sourceRoot":"","sources":["../src/PanelTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MA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AM,CAAC,KAAK,EAClC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,YAEnD,cAAK,KAAK,EAAC,+BAA+B,YACzC,KAAC,IAAI,IACJ,KAAK,EAAE;4DACN,uBAAuB,EAAE,IAAI;4DAC7B,kCAAkC,EAAE,CAAC,IAAI,CAAC,gBAAgB;yDAC1D,EACD,IAAI,EAAE,cAAc,GAEd,GACF,GACE;4CACT,CAAC,CAAC,OAAO;gDACT,KAAC,IAAI,IACJ,KAAK,EAAE;wDACN,yBAAyB,EAAE,IAAI;wDAC/B,uBAAuB,EAAE,IAAI;wDAC7B,kCAAkC,EAAE,CAAC,IAAI,CAAC,gBAAgB;qDAC1D,EACD,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,IAAI,EACjB,cAAc,EAAE,IAAI,CAAC,iBAAiB,GACrC,GAEE,EAGL,IAAI,CAAC,UAAU,CAAC,CAAC;oCAClB,eAAM,IAAI,EAAC,QAAQ,GAAQ;oCAC3B,CAAC,CAAC,OAAO;wCACT,cACC,EAAE,EAAG,GAAG,IAAI,CAAC,GAAG,eAAe,EAC/B,KAAK,EAAC,wBAAwB,YAE5B,IAAI,CAAC,UAAU,GACZ,IAEF,GACD,EAIP,cACC,KAAK,EAAC,mBAAmB,EACzB,EAAE,EAAG,GAAG,IAAI,CAAC,GAAG,UAAU,EAC1B,QAAQ,EAAG,CAAC,CAAC,EACb,KAAK,EAAE;wBACN,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;qBACjD,EACD,IAAI,EAAC,SAAS,YAEd,gBAAa,GACR,IACD,GACJ,CAAC,CAAC;AACN,CAAC","sourcesContent":["import type Panel from \"./Panel.js\";\nimport Button from \"./Button.js\";\nimport Icon from \"./Icon.js\";\n\nimport slimArrowRight from \"@ui5/webcomponents-icons/dist/slim-arrow-right.js\";\n\nexport default function PanelTemplate(this: Panel) {\n\treturn (<>\n\t\t<div\n\t\t\tclass=\"ui5-panel-root\"\n\t\t\trole={this.accRole}\n\t\t\taria-label={this.effectiveAccessibleName}\n\t\t\taria-labelledby={this.fixedPanelAriaLabelledbyReference}\n\t\t>\n\t\t\t{ this.hasHeaderOrHeaderText &&\n\t\t\t\t// header: either header or h1 with header text\n\t\t\t\t<div\n\t\t\t\t\tclass={{\n\t\t\t\t\t\t\"ui5-panel-heading-wrapper\": true,\n\t\t\t\t\t\t\"ui5-panel-heading-wrapper-sticky\": this.stickyHeader,\n\t\t\t\t\t}}\n\t\t\t\t\trole={this.headingWrapperRole}\n\t\t\t\t\taria-level={this.headingWrapperAriaLevel}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tonClick={this._headerClick}\n\t\t\t\t\t\tonKeyDown={this._headerKeyDown}\n\t\t\t\t\t\tonKeyUp={this._headerKeyUp}\n\t\t\t\t\t\tonTouchStart={this._isMobile}\n\t\t\t\t\t\tonFocusOut={this._headerFocusOut}\n\t\t\t\t\t\tclass=\"ui5-panel-header\"\n\t\t\t\t\t\ttabindex={this.headerTabIndex}\n\t\t\t\t\t\trole={this.accInfo.role}\n\t\t\t\t\t\taria-expanded={this.accInfo.ariaExpanded}\n\t\t\t\t\t\taria-controls={this.accInfo.ariaControls}\n\t\t\t\t\t\taria-labelledby={this.accInfo.ariaLabelledby}\n\t\t\t\t\t\tpart=\"header\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ !this.fixed &&\n\t\t\t\t\t\t\t<div class=\"ui5-panel-header-button-root\">\n\t\t\t\t\t\t\t\t{ this._hasHeader ?\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tdesign=\"Transparent\"\n\t\t\t\t\t\t\t\t\t\tclass=\"ui5-panel-header-button ui5-panel-header-button-with-icon\"\n\t\t\t\t\t\t\t\t\t\tonClick={this._toggleButtonClick}\n\t\t\t\t\t\t\t\t\t\taccessibilityAttributes={this.accInfo.button.accessibilityAttributes}\n\t\t\t\t\t\t\t\t\t\ttooltip={this.accInfo.button.title}\n\t\t\t\t\t\t\t\t\t\taccessibleName={this.accInfo.button.ariaLabelButton}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<div class=\"ui5-panel-header-icon-wrapper\">\n\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\tclass={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"ui5-panel-header-icon\": true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"ui5-panel-header-button-animated\": !this.shouldNotAnimate,\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\tname={slimArrowRight}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t</Icon>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t: // else\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\tclass={{\n\t\t\t\t\t\t\t\t\t\t\t\"ui5-panel-header-button\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"ui5-panel-header-icon\": true,\n\t\t\t\t\t\t\t\t\t\t\t\"ui5-panel-header-button-animated\": !this.shouldNotAnimate,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tname={slimArrowRight}\n\t\t\t\t\t\t\t\t\t\tshowTooltip={true}\n\t\t\t\t\t\t\t\t\t\taccessibleName={this.toggleButtonTitle}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t{ this._hasHeader ?\n\t\t\t\t\t\t\t<slot name=\"header\"></slot>\n\t\t\t\t\t\t\t: // else\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tid={ `${this._id}-header-title` }\n\t\t\t\t\t\t\t\tclass=\"ui5-panel-header-title\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ this.headerText }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t}\n\n\t\t\t{/* content area */}\n\t\t\t<div\n\t\t\t\tclass=\"ui5-panel-content\"\n\t\t\t\tid={ `${this._id}-content` }\n\t\t\t\ttabindex={ -1 }\n\t\t\t\tstyle={{\n\t\t\t\t\tdisplay: this._contentExpanded ? \"block\" : \"none\",\n\t\t\t\t}}\n\t\t\t\tpart=\"content\"\n\t\t\t>\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t</div>\n\t</>);\n}\n"]}
|
|
@@ -115,6 +115,21 @@ declare class RatingIndicator extends UI5Element {
|
|
|
115
115
|
* @since 1.19.0
|
|
116
116
|
*/
|
|
117
117
|
tooltip?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Defines the icon to be displayed for the selected (filled) rating symbol.
|
|
120
|
+
*
|
|
121
|
+
* @default "favorite"
|
|
122
|
+
* @public
|
|
123
|
+
* @since 2.20
|
|
124
|
+
*/
|
|
125
|
+
iconSelected?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Defines the icon to be displayed for the unselected (empty) rating symbol.
|
|
128
|
+
* @default "unfavorite"
|
|
129
|
+
* @public
|
|
130
|
+
* @since 2.20
|
|
131
|
+
*/
|
|
132
|
+
iconUnselected?: string;
|
|
118
133
|
/**
|
|
119
134
|
* @private
|
|
120
135
|
*/
|
|
@@ -140,6 +155,8 @@ declare class RatingIndicator extends UI5Element {
|
|
|
140
155
|
get _ariaLabel(): string | undefined;
|
|
141
156
|
get _ariaDescription(): string | undefined;
|
|
142
157
|
get ariaReadonly(): "true" | undefined;
|
|
158
|
+
get effectiveIconSelected(): string;
|
|
159
|
+
get effectiveIconUnselected(): string;
|
|
143
160
|
}
|
|
144
161
|
export default RatingIndicator;
|
|
145
162
|
export type { Star };
|
package/dist/RatingIndicator.js
CHANGED
|
@@ -235,6 +235,12 @@ let RatingIndicator = RatingIndicator_1 = class RatingIndicator extends UI5Eleme
|
|
|
235
235
|
get ariaReadonly() {
|
|
236
236
|
return this.readonly ? "true" : undefined;
|
|
237
237
|
}
|
|
238
|
+
get effectiveIconSelected() {
|
|
239
|
+
return this.iconSelected || "favorite";
|
|
240
|
+
}
|
|
241
|
+
get effectiveIconUnselected() {
|
|
242
|
+
return this.iconUnselected || "unfavorite";
|
|
243
|
+
}
|
|
238
244
|
};
|
|
239
245
|
__decorate([
|
|
240
246
|
property({ type: Number })
|
|
@@ -263,6 +269,12 @@ __decorate([
|
|
|
263
269
|
__decorate([
|
|
264
270
|
property()
|
|
265
271
|
], RatingIndicator.prototype, "tooltip", void 0);
|
|
272
|
+
__decorate([
|
|
273
|
+
property()
|
|
274
|
+
], RatingIndicator.prototype, "iconSelected", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
property()
|
|
277
|
+
], RatingIndicator.prototype, "iconUnselected", void 0);
|
|
266
278
|
__decorate([
|
|
267
279
|
property({ type: Array })
|
|
268
280
|
], RatingIndicator.prototype, "_stars", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RatingIndicator.js","sourceRoot":"","sources":["../src/RatingIndicator.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,EACN,MAAM,EACN,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,GACL,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,M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EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDACX;AAWjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDACX;AASjB;IADC,QAAQ,EAAE;uDACa;AASvB;IADC,QAAQ,EAAE;0DACgB;AAS5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDACX;AASjB;IADC,QAAQ,EAAE;gDACM;AAMjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CACD;AAMzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDACX;AAKV;IADN,IAAI,CAAC,oBAAoB,CAAC;yCACG;AA5GzB,eAAe;IAfpB,aAAa,CAAC;QACd,GAAG,EAAE,sBAAsB;QAC3B,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,kBAAkB;QAC1B,QAAQ,EAAE,uBAAuB;KACjC,CAAC;IACF;;;OAGG;;IACF,KAAK,CAAC,QAAQ,EAAE;QAChB,OAAO,EAAE,IAAI;KACb,CAAC;GAEI,eAAe,CAiQpB;AAED,eAAe,CAAC,MAAM,EAAE,CAAC;AAEzB,eAAe,eAAe,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport { getEnableDefaultTooltips } from \"@ui5/webcomponents-base/dist/config/Tooltips.js\";\nimport UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport {\n\tisDown,\n\tisUp,\n\tisLeft,\n\tisRight,\n\tisSpace,\n\tisEnter,\n\tisHome,\n\tisEnd,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { getEffectiveAriaLabelText } from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport {\n\tRATING_INDICATOR_TEXT,\n\tRATING_INDICATOR_TOOLTIP_TEXT,\n\tRATING_INDICATOR_ARIA_DESCRIPTION,\n} from \"./generated/i18n/i18n-defaults.js\";\nimport RatingIndicatorTemplate from \"./RatingIndicatorTemplate.js\";\n\n// Styles\nimport RatingIndicatorCss from \"./generated/themes/RatingIndicator.css.js\";\nimport type RatingIndicatorSize from \"./types/RatingIndicatorSize.js\";\n\ntype Star = {\n\tselected: boolean,\n\tindex: number,\n\thalfStar: boolean\n}\n\n/**\n * @class\n *\n * ### Overview\n * The Rating Indicator is used to display a specific number of icons that are used to rate an item.\n * Additionally, it is also used to display the average and overall ratings.\n *\n * ### Usage\n * The recommended number of icons is between 5 and 7.\n *\n * ### Responsive Behavior\n * You can change the size of the Rating Indicator by changing its `font-size` CSS property.\n *\n * Example: `<ui5-rating-indicator style=\"font-size: 3rem;\"></ui5-rating-indicator>`\n *\n * ### Keyboard Handling\n * When the `ui5-rating-indicator` is focused, the user can change the rating\n * with the following keyboard shortcuts:\n *\n * - [RIGHT/UP] - Increases the value of the rating by one step. If the highest value is reached, does nothing\n * - [LEFT/DOWN] - Decreases the value of the rating by one step. If the lowest value is reached, does nothing.\n * - [Home] - Sets the lowest value.\n * - [End] - Sets the highest value.\n * - [SPACE/ENTER/RETURN] - Increases the value of the rating by one step. If the highest value is reached, sets the rating to the lowest value.\n * - Any number - Changes value to the corresponding number. If typed number is larger than the number of values, sets the highest value.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/RatingIndicator.js\";`\n * @constructor\n * @extends UI5Element\n * @public\n * @since 1.0.0-rc.8\n */\n\n@customElement({\n\ttag: \"ui5-rating-indicator\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\tstyles: RatingIndicatorCss,\n\ttemplate: RatingIndicatorTemplate,\n})\n/**\n * The event is fired when the value changes.\n * @public\n */\n@event(\"change\", {\n\tbubbles: true,\n})\n\nclass RatingIndicator extends UI5Element {\n\teventDetails!: {\n\t\tchange: void,\n\t}\n\t/**\n\t * The indicated value of the rating.\n\t *\n\t * **Note:** If you set a number which is not round, it would be shown as follows:\n\t *\n\t * - 1.0 - 1.2 -> 1\n\t * - 1.3 - 1.7 -> 1.5\n\t * - 1.8 - 1.9 -> 2\n\t * @default 0\n\t * @public\n\t */\n\t@property({ type: Number })\n\tvalue: number = 0;\n\n\t/**\n\t * The number of displayed rating symbols.\n\t * @default 5\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property({ type: Number })\n\tmax: number = 5;\n\n\t/**\n\t * Defines the size of the component.\n\t * @default \"M\"\n\t * @public\n\t * @since 2.6.0\n\t */\n\t@property()\n\tsize: `${RatingIndicatorSize}` = \"M\";\n\n\t/**\n\t * Defines whether the component is disabled.\n\t *\n\t * **Note:** A disabled component is completely noninteractive.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines whether the component is read-only.\n\t *\n\t * **Note:** A read-only component is not editable,\n\t * but still provides visual feedback upon user interaction.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\treadonly = false;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Receives id(or many ids) of the elements that label the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.15.0\n\t */\n\t @property()\n\t accessibleNameRef?: string;\n\n\t /**\n\t * Defines whether the component is required.\n\t * @default false\n\t * @public\n\t * @since 1.15.0\n\t */\n\t@property({ type: Boolean })\n\trequired = false;\n\n\t/**\n\t * Defines the tooltip of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.19.0\n\t */\n\t@property()\n\ttooltip?: string;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Array })\n\t_stars: Array<Star> = [];\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_focused = false;\n\n\t_liveValue?: number;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tonBeforeRendering() {\n\t\tthis.calcState();\n\t}\n\n\tcalcState() {\n\t\tthis._stars = [];\n\n\t\tfor (let i = 1; i < this.max + 1; i++) {\n\t\t\tconst remainder = Math.round((this.value - Math.floor(this.value)) * 10);\n\t\t\tlet halfStar = false,\n\t\t\t\ttempValue = this.value;\n\n\t\t\tif (Math.floor(this.value) + 1 === i && remainder > 2 && remainder < 8) {\n\t\t\t\thalfStar = true;\n\t\t\t} else if (remainder <= 2) {\n\t\t\t\ttempValue = Math.floor(this.value);\n\t\t\t} else if (remainder >= 8) {\n\t\t\t\ttempValue = Math.ceil(this.value);\n\t\t\t}\n\n\t\t\tthis._stars.push({\n\t\t\t\tselected: i <= tempValue,\n\t\t\t\tindex: i,\n\t\t\t\thalfStar,\n\t\t\t});\n\t\t}\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\tconst target = e.target as UI5Element;\n\n\t\tif (!(target instanceof HTMLElement) || this.disabled || this.readonly) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst targetValue = target.getAttribute(\"data-ui5-value\");\n\n\t\tif (targetValue !== null) {\n\t\t\tthis.value = parseInt(targetValue);\n\t\t\tif (this.value === this._liveValue) {\n\t\t\t\tthis.value = 0;\n\t\t\t}\n\n\t\t\tif (this._liveValue !== this.value) {\n\t\t\t\tthis.fireDecoratorEvent(\"change\");\n\t\t\t\tthis._liveValue = this.value;\n\t\t\t}\n\t\t}\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (this.disabled || this.readonly) {\n\t\t\t// prevent page scrolling\n\t\t\tif (isSpace(e)) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst isDecrease = isDown(e) || isLeft(e);\n\t\tconst isIncrease = isRight(e) || isUp(e);\n\t\tconst isIncreaseWithReset = isSpace(e) || isEnter(e);\n\t\tconst isMin = isHome(e);\n\t\tconst isMax = isEnd(e);\n\t\tconst isNumber = (e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 96 && e.keyCode <= 105);\n\n\t\tif (isDecrease || isIncrease || isIncreaseWithReset || isMin || isMax || isNumber) {\n\t\t\te.preventDefault();\n\n\t\t\tif (isDecrease && this.value > 0) {\n\t\t\t\tthis.value = Math.round(this.value - 1);\n\t\t\t} else if (isIncrease && this.value < this.max) {\n\t\t\t\tthis.value = Math.round(this.value + 1);\n\t\t\t} else if (isIncreaseWithReset) {\n\t\t\t\tconst proposedValue = Math.round(this.value + 1);\n\t\t\t\tthis.value = proposedValue > this.max ? 0 : proposedValue;\n\t\t\t} else if (isMin) {\n\t\t\t\tthis.value = 0;\n\t\t\t} else if (isMax) {\n\t\t\t\tthis.value = this.max;\n\t\t\t} else if (isNumber) {\n\t\t\t\tconst pressedNumber = parseInt(e.key);\n\t\t\t\tthis.value = pressedNumber > this.max ? this.max : pressedNumber;\n\t\t\t}\n\n\t\t\tthis.fireDecoratorEvent(\"change\");\n\t\t}\n\t}\n\n\t_onfocusin() {\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focused = true;\n\t\tthis._liveValue = this.value;\n\t}\n\n\t_onfocusout() {\n\t\tthis._focused = false;\n\t}\n\n\tget effectiveTabIndex() {\n\t\tconst tabindex = this.getAttribute(\"tabindex\");\n\n\t\tif (this.disabled) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn tabindex ? parseInt(tabindex) : 0;\n\t}\n\n\tget ratingTooltip(): string | undefined {\n\t\tif (this.tooltip) {\n\t\t\treturn this.tooltip;\n\t\t}\n\t\treturn getEnableDefaultTooltips() ? this.defaultTooltip : undefined;\n\t}\n\n\tget defaultTooltip() {\n\t\treturn RatingIndicator.i18nBundle.getText(RATING_INDICATOR_TOOLTIP_TEXT);\n\t}\n\n\tget _ariaRoleDescription() {\n\t\treturn RatingIndicator.i18nBundle.getText(RATING_INDICATOR_TEXT);\n\t}\n\n\tget _ariaDisabled() {\n\t\treturn this.disabled || undefined;\n\t}\n\n\tget _ariaLabel() {\n\t\treturn getEffectiveAriaLabelText(this);\n\t}\n\n\tget _ariaDescription() {\n\t\treturn this.required ? RatingIndicator.i18nBundle.getText(RATING_INDICATOR_ARIA_DESCRIPTION) : undefined;\n\t}\n\n\tget ariaReadonly() {\n\t\treturn this.readonly ? \"true\" : undefined;\n\t}\n}\n\nRatingIndicator.define();\n\nexport default RatingIndicator;\nexport type { Star };\n"]}
|
|
1
|
+
{"version":3,"file":"RatingIndicator.js","sourceRoot":"","sources":["../src/RatingIndicator.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,EACN,MAAM,EACN,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,GACL,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+DAA+D,CAAC;AAC1G,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,OAAO,EACN,qBAAqB,EACrB,6BAA6B,EAC7B,iCAAiC,GACjC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE,SAAS;AACT,OAAO,kBAAkB,MAAM,2CAA2C,CAAC;AAS3E;;;;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OAAO,EAAE,CAAC;iDACX;AASjB;IADC,QAAQ,EAAE;uDACa;AASvB;IADC,QAAQ,EAAE;0DACgB;AAS5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDACX;AASjB;IADC,QAAQ,EAAE;gDACM;AAUjB;IADC,QAAQ,EAAE;qDACW;AAStB;IADC,QAAQ,EAAE;uDACa;AAMxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CACD;AAMzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDACX;AAKV;IADN,IAAI,CAAC,oBAAoB,CAAC;yCACG;AA/HzB,eAAe;IAfpB,aAAa,CAAC;QACd,GAAG,EAAE,sBAAsB;QAC3B,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,kBAAkB;QAC1B,QAAQ,EAAE,uBAAuB;KACjC,CAAC;IACF;;;OAGG;;IACF,KAAK,CAAC,QAAQ,EAAE;QAChB,OAAO,EAAE,IAAI;KACb,CAAC;GAEI,eAAe,CA4RpB;AAED,eAAe,CAAC,MAAM,EAAE,CAAC;AAEzB,eAAe,eAAe,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport { getEnableDefaultTooltips } from \"@ui5/webcomponents-base/dist/config/Tooltips.js\";\nimport UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport {\n\tisDown,\n\tisUp,\n\tisLeft,\n\tisRight,\n\tisSpace,\n\tisEnter,\n\tisHome,\n\tisEnd,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { getEffectiveAriaLabelText } from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport {\n\tRATING_INDICATOR_TEXT,\n\tRATING_INDICATOR_TOOLTIP_TEXT,\n\tRATING_INDICATOR_ARIA_DESCRIPTION,\n} from \"./generated/i18n/i18n-defaults.js\";\nimport RatingIndicatorTemplate from \"./RatingIndicatorTemplate.js\";\n\n// Styles\nimport RatingIndicatorCss from \"./generated/themes/RatingIndicator.css.js\";\nimport type RatingIndicatorSize from \"./types/RatingIndicatorSize.js\";\n\ntype Star = {\n\tselected: boolean,\n\tindex: number,\n\thalfStar: boolean\n}\n\n/**\n * @class\n *\n * ### Overview\n * The Rating Indicator is used to display a specific number of icons that are used to rate an item.\n * Additionally, it is also used to display the average and overall ratings.\n *\n * ### Usage\n * The recommended number of icons is between 5 and 7.\n *\n * ### Responsive Behavior\n * You can change the size of the Rating Indicator by changing its `font-size` CSS property.\n *\n * Example: `<ui5-rating-indicator style=\"font-size: 3rem;\"></ui5-rating-indicator>`\n *\n * ### Keyboard Handling\n * When the `ui5-rating-indicator` is focused, the user can change the rating\n * with the following keyboard shortcuts:\n *\n * - [RIGHT/UP] - Increases the value of the rating by one step. If the highest value is reached, does nothing\n * - [LEFT/DOWN] - Decreases the value of the rating by one step. If the lowest value is reached, does nothing.\n * - [Home] - Sets the lowest value.\n * - [End] - Sets the highest value.\n * - [SPACE/ENTER/RETURN] - Increases the value of the rating by one step. If the highest value is reached, sets the rating to the lowest value.\n * - Any number - Changes value to the corresponding number. If typed number is larger than the number of values, sets the highest value.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/RatingIndicator.js\";`\n * @constructor\n * @extends UI5Element\n * @public\n * @since 1.0.0-rc.8\n */\n\n@customElement({\n\ttag: \"ui5-rating-indicator\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\tstyles: RatingIndicatorCss,\n\ttemplate: RatingIndicatorTemplate,\n})\n/**\n * The event is fired when the value changes.\n * @public\n */\n@event(\"change\", {\n\tbubbles: true,\n})\n\nclass RatingIndicator extends UI5Element {\n\teventDetails!: {\n\t\tchange: void,\n\t}\n\t/**\n\t * The indicated value of the rating.\n\t *\n\t * **Note:** If you set a number which is not round, it would be shown as follows:\n\t *\n\t * - 1.0 - 1.2 -> 1\n\t * - 1.3 - 1.7 -> 1.5\n\t * - 1.8 - 1.9 -> 2\n\t * @default 0\n\t * @public\n\t */\n\t@property({ type: Number })\n\tvalue: number = 0;\n\n\t/**\n\t * The number of displayed rating symbols.\n\t * @default 5\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property({ type: Number })\n\tmax: number = 5;\n\n\t/**\n\t * Defines the size of the component.\n\t * @default \"M\"\n\t * @public\n\t * @since 2.6.0\n\t */\n\t@property()\n\tsize: `${RatingIndicatorSize}` = \"M\";\n\n\t/**\n\t * Defines whether the component is disabled.\n\t *\n\t * **Note:** A disabled component is completely noninteractive.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines whether the component is read-only.\n\t *\n\t * **Note:** A read-only component is not editable,\n\t * but still provides visual feedback upon user interaction.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\treadonly = false;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Receives id(or many ids) of the elements that label the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.15.0\n\t */\n\t @property()\n\t accessibleNameRef?: string;\n\n\t /**\n\t * Defines whether the component is required.\n\t * @default false\n\t * @public\n\t * @since 1.15.0\n\t */\n\t@property({ type: Boolean })\n\trequired = false;\n\n\t/**\n\t * Defines the tooltip of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.19.0\n\t */\n\t@property()\n\ttooltip?: string;\n\n\t/**\n\t * Defines the icon to be displayed for the selected (filled) rating symbol.\n\t *\n\t * @default \"favorite\"\n\t * @public\n\t * @since 2.20\n\t */\n\t@property()\n\ticonSelected?: string;\n\n\t/**\n\t * Defines the icon to be displayed for the unselected (empty) rating symbol.\n\t * @default \"unfavorite\"\n\t * @public\n\t * @since 2.20\n\t */\n\t@property()\n\ticonUnselected?: string;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Array })\n\t_stars: Array<Star> = [];\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_focused = false;\n\n\t_liveValue?: number;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tonBeforeRendering() {\n\t\tthis.calcState();\n\t}\n\n\tcalcState() {\n\t\tthis._stars = [];\n\n\t\tfor (let i = 1; i < this.max + 1; i++) {\n\t\t\tconst remainder = Math.round((this.value - Math.floor(this.value)) * 10);\n\t\t\tlet halfStar = false,\n\t\t\t\ttempValue = this.value;\n\n\t\t\tif (Math.floor(this.value) + 1 === i && remainder > 2 && remainder < 8) {\n\t\t\t\thalfStar = true;\n\t\t\t} else if (remainder <= 2) {\n\t\t\t\ttempValue = Math.floor(this.value);\n\t\t\t} else if (remainder >= 8) {\n\t\t\t\ttempValue = Math.ceil(this.value);\n\t\t\t}\n\n\t\t\tthis._stars.push({\n\t\t\t\tselected: i <= tempValue,\n\t\t\t\tindex: i,\n\t\t\t\thalfStar,\n\t\t\t});\n\t\t}\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\tconst target = e.target as UI5Element;\n\n\t\tif (!(target instanceof HTMLElement) || this.disabled || this.readonly) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst targetValue = target.getAttribute(\"data-ui5-value\");\n\n\t\tif (targetValue !== null) {\n\t\t\tthis.value = parseInt(targetValue);\n\t\t\tif (this.value === this._liveValue) {\n\t\t\t\tthis.value = 0;\n\t\t\t}\n\n\t\t\tif (this._liveValue !== this.value) {\n\t\t\t\tthis.fireDecoratorEvent(\"change\");\n\t\t\t\tthis._liveValue = this.value;\n\t\t\t}\n\t\t}\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (this.disabled || this.readonly) {\n\t\t\t// prevent page scrolling\n\t\t\tif (isSpace(e)) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst isDecrease = isDown(e) || isLeft(e);\n\t\tconst isIncrease = isRight(e) || isUp(e);\n\t\tconst isIncreaseWithReset = isSpace(e) || isEnter(e);\n\t\tconst isMin = isHome(e);\n\t\tconst isMax = isEnd(e);\n\t\tconst isNumber = (e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 96 && e.keyCode <= 105);\n\n\t\tif (isDecrease || isIncrease || isIncreaseWithReset || isMin || isMax || isNumber) {\n\t\t\te.preventDefault();\n\n\t\t\tif (isDecrease && this.value > 0) {\n\t\t\t\tthis.value = Math.round(this.value - 1);\n\t\t\t} else if (isIncrease && this.value < this.max) {\n\t\t\t\tthis.value = Math.round(this.value + 1);\n\t\t\t} else if (isIncreaseWithReset) {\n\t\t\t\tconst proposedValue = Math.round(this.value + 1);\n\t\t\t\tthis.value = proposedValue > this.max ? 0 : proposedValue;\n\t\t\t} else if (isMin) {\n\t\t\t\tthis.value = 0;\n\t\t\t} else if (isMax) {\n\t\t\t\tthis.value = this.max;\n\t\t\t} else if (isNumber) {\n\t\t\t\tconst pressedNumber = parseInt(e.key);\n\t\t\t\tthis.value = pressedNumber > this.max ? this.max : pressedNumber;\n\t\t\t}\n\n\t\t\tthis.fireDecoratorEvent(\"change\");\n\t\t}\n\t}\n\n\t_onfocusin() {\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focused = true;\n\t\tthis._liveValue = this.value;\n\t}\n\n\t_onfocusout() {\n\t\tthis._focused = false;\n\t}\n\n\tget effectiveTabIndex() {\n\t\tconst tabindex = this.getAttribute(\"tabindex\");\n\n\t\tif (this.disabled) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn tabindex ? parseInt(tabindex) : 0;\n\t}\n\n\tget ratingTooltip(): string | undefined {\n\t\tif (this.tooltip) {\n\t\t\treturn this.tooltip;\n\t\t}\n\t\treturn getEnableDefaultTooltips() ? this.defaultTooltip : undefined;\n\t}\n\n\tget defaultTooltip() {\n\t\treturn RatingIndicator.i18nBundle.getText(RATING_INDICATOR_TOOLTIP_TEXT);\n\t}\n\n\tget _ariaRoleDescription() {\n\t\treturn RatingIndicator.i18nBundle.getText(RATING_INDICATOR_TEXT);\n\t}\n\n\tget _ariaDisabled() {\n\t\treturn this.disabled || undefined;\n\t}\n\n\tget _ariaLabel() {\n\t\treturn getEffectiveAriaLabelText(this);\n\t}\n\n\tget _ariaDescription() {\n\t\treturn this.required ? RatingIndicator.i18nBundle.getText(RATING_INDICATOR_ARIA_DESCRIPTION) : undefined;\n\t}\n\n\tget ariaReadonly() {\n\t\treturn this.readonly ? \"true\" : undefined;\n\t}\n\n\tget effectiveIconSelected() {\n\t\treturn this.iconSelected || \"favorite\";\n\t}\n\n\tget effectiveIconUnselected() {\n\t\treturn this.iconUnselected || \"unfavorite\";\n\t}\n}\n\nRatingIndicator.define();\n\nexport default RatingIndicator;\nexport type { Star };\n"]}
|
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@ui5/webcomponents-base/jsx-runtime";
|
|
2
2
|
import Icon from "./Icon.js";
|
|
3
|
-
import favorite from "@ui5/webcomponents-icons/dist/favorite.js";
|
|
4
|
-
import unfavorite from "@ui5/webcomponents-icons/dist/unfavorite.js";
|
|
5
3
|
export default function RatingIndicatorTemplate() {
|
|
6
4
|
return (_jsx("div", { class: "ui5-rating-indicator-root", role: "slider", "aria-roledescription": this._ariaRoleDescription, "aria-valuemin": 0, "aria-valuenow": this.value, "aria-valuemax": this.max, "aria-valuetext": `${this.value} of ${this.max}`, "aria-orientation": "horizontal", "aria-disabled": this._ariaDisabled, "aria-readonly": this.ariaReadonly, "aria-description": this._ariaDescription, tabindex: this.effectiveTabIndex, onFocusIn: this._onfocusin, onFocusOut: this._onfocusout, onClick: this._onclick, onKeyDown: this._onkeydown, title: this.ratingTooltip, "aria-label": this._ariaLabel, children: _jsx("ul", { class: "ui5-rating-indicator-list", "aria-hidden": "true", children: this._stars.map(star => starLi.call(this, star)) }) }));
|
|
7
5
|
}
|
|
8
6
|
function starLi(star) {
|
|
9
7
|
if (star.selected) {
|
|
10
|
-
return (_jsx("li", { "data-ui5-value": star.index, class: "ui5-rating-indicator-item ui5-rating-indicator-item-sel", children: _jsx(Icon, { "data-ui5-value": star.index, name:
|
|
8
|
+
return (_jsx("li", { "data-ui5-value": star.index, class: "ui5-rating-indicator-item ui5-rating-indicator-item-sel", children: _jsx(Icon, { "data-ui5-value": star.index, name: this.effectiveIconSelected }) }));
|
|
11
9
|
}
|
|
12
10
|
if (star.halfStar) {
|
|
13
|
-
return (_jsxs("li", { class: "ui5-rating-indicator-item ui5-rating-indicator-item-half", children: [_jsx(Icon, { "data-ui5-value": star.index, name:
|
|
11
|
+
return (_jsxs("li", { class: "ui5-rating-indicator-item ui5-rating-indicator-item-half", children: [_jsx("div", { class: "ui5-rating-indicator-half-icon-wrapper ui5-rating-indicator-half-icon-left", children: _jsx(Icon, { "data-ui5-value": star.index, name: this.effectiveIconSelected }) }), _jsx("div", { class: "ui5-rating-indicator-half-icon-wrapper ui5-rating-indicator-half-icon-right", children: _jsx(Icon, { "data-ui5-value": star.index, name: halfStarIconName.call(this) }) })] }));
|
|
14
12
|
}
|
|
15
13
|
if (this.readonly) {
|
|
16
|
-
return (_jsx("li", { class: "ui5-rating-indicator-item ui5-rating-indicator-item-unsel", children: _jsx(Icon, { "data-ui5-value": star.index, name:
|
|
14
|
+
return (_jsx("li", { class: "ui5-rating-indicator-item ui5-rating-indicator-item-unsel", children: _jsx(Icon, { "data-ui5-value": star.index, name: this.effectiveIconSelected }) }));
|
|
17
15
|
}
|
|
18
16
|
if (this.disabled) {
|
|
19
|
-
return (_jsx("li", { class: "ui5-rating-indicator-item ui5-rating-indicator-item-unsel", children: _jsx(Icon, { "data-ui5-value": star.index, name:
|
|
17
|
+
return (_jsx("li", { class: "ui5-rating-indicator-item ui5-rating-indicator-item-unsel", children: _jsx(Icon, { "data-ui5-value": star.index, name: this.effectiveIconSelected }) }));
|
|
20
18
|
}
|
|
21
|
-
return (_jsx("li", { "data-ui5-value": star.index, class: "ui5-rating-indicator-item ui5-rating-indicator-item-unsel", children: _jsx(Icon, { "data-ui5-value": star.index, name:
|
|
19
|
+
return (_jsx("li", { "data-ui5-value": star.index, class: "ui5-rating-indicator-item ui5-rating-indicator-item-unsel", children: _jsx(Icon, { "data-ui5-value": star.index, name: this.effectiveIconUnselected }) }));
|
|
22
20
|
}
|
|
23
21
|
function halfStarIconName() {
|
|
24
|
-
return this.disabled || this.readonly ?
|
|
22
|
+
return this.disabled || this.readonly ? this.effectiveIconSelected : this.effectiveIconUnselected;
|
|
25
23
|
}
|
|
26
24
|
//# sourceMappingURL=RatingIndicatorTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RatingIndicatorTemplate.js","sourceRoot":"","sources":["../src/RatingIndicatorTemplate.tsx"],"names":[],"mappings":";AAEA,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"RatingIndicatorTemplate.js","sourceRoot":"","sources":["../src/RatingIndicatorTemplate.tsx"],"names":[],"mappings":";AAEA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,uBAAuB;IAC9C,OAAO,CACN,cACC,KAAK,EAAC,2BAA2B,EACjC,IAAI,EAAC,QAAQ,0BACS,IAAI,CAAC,oBAAoB,mBAChC,CAAC,mBACD,IAAI,CAAC,KAAK,mBACV,IAAI,CAAC,GAAG,oBACP,GAAG,IAAI,CAAC,KAAK,OAAO,IAAI,CAA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EAAE,CAAC;QACrB,OAAO,CACN,aAAI,KAAK,EAAC,2DAA2D,YACpE,KAAC,IAAI,sBAAiB,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,qBAAqB,GAAI,GAClE,CACL,CAAC;IACH,CAAC;IAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QACrB,OAAO,CACN,aAAI,KAAK,EAAC,2DAA2D,YACpE,KAAC,IAAI,sBAAiB,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,qBAAqB,GAAI,GAClE,CACL,CAAC;IACH,CAAC;IACD,OAAO,CACN,+BAAoB,IAAI,CAAC,KAAK,EAAE,KAAK,EAAC,2DAA2D,YAChG,KAAC,IAAI,sBAAiB,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,uBAAuB,GAAG,GACnE,CACL,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB;IACxB,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC;AACnG,CAAC","sourcesContent":["import type RatingIndicator from \"./RatingIndicator.js\";\nimport type { Star } from \"./RatingIndicator.js\";\nimport Icon from \"./Icon.js\";\n\nexport default function RatingIndicatorTemplate(this: RatingIndicator) {\n\treturn (\n\t\t<div\n\t\t\tclass=\"ui5-rating-indicator-root\"\n\t\t\trole=\"slider\"\n\t\t\taria-roledescription={this._ariaRoleDescription}\n\t\t\taria-valuemin={0}\n\t\t\taria-valuenow={this.value}\n\t\t\taria-valuemax={this.max}\n\t\t\taria-valuetext={`${this.value} of ${this.max}`}\n\t\t\taria-orientation=\"horizontal\"\n\t\t\taria-disabled={this._ariaDisabled}\n\t\t\taria-readonly={this.ariaReadonly}\n\t\t\taria-description={this._ariaDescription}\n\t\t\ttabindex={this.effectiveTabIndex}\n\t\t\tonFocusIn={this._onfocusin}\n\t\t\tonFocusOut={this._onfocusout}\n\t\t\tonClick={this._onclick}\n\t\t\tonKeyDown={this._onkeydown}\n\t\t\ttitle={this.ratingTooltip}\n\t\t\taria-label={this._ariaLabel}\n\t\t>\n\t\t\t<ul class=\"ui5-rating-indicator-list\" aria-hidden=\"true\">\n\t\t\t\t{ this._stars.map(star => starLi.call(this, star))}\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n\nfunction starLi(this: RatingIndicator, star: Star) {\n\tif (star.selected) {\n\t\treturn (\n\t\t\t<li data-ui5-value={star.index} class=\"ui5-rating-indicator-item ui5-rating-indicator-item-sel\">\n\t\t\t\t<Icon data-ui5-value={star.index} name={this.effectiveIconSelected} />\n\t\t\t</li>\n\t\t);\n\t} if (star.halfStar) {\n\t\treturn (\n\t\t\t<li class=\"ui5-rating-indicator-item ui5-rating-indicator-item-half\">\n\t\t\t\t<div class=\"ui5-rating-indicator-half-icon-wrapper ui5-rating-indicator-half-icon-left\">\n\t\t\t\t\t<Icon data-ui5-value={star.index} name={this.effectiveIconSelected} />\n\t\t\t\t</div>\n\t\t\t\t<div class=\"ui5-rating-indicator-half-icon-wrapper ui5-rating-indicator-half-icon-right\">\n\t\t\t\t\t<Icon data-ui5-value={star.index} name={halfStarIconName.call(this)} />\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t);\n\t} if (this.readonly) {\n\t\treturn (\n\t\t\t<li class=\"ui5-rating-indicator-item ui5-rating-indicator-item-unsel\">\n\t\t\t\t<Icon data-ui5-value={star.index} name={this.effectiveIconSelected} />\n\t\t\t</li>\n\t\t);\n\t} if (this.disabled) {\n\t\treturn (\n\t\t\t<li class=\"ui5-rating-indicator-item ui5-rating-indicator-item-unsel\">\n\t\t\t\t<Icon data-ui5-value={star.index} name={this.effectiveIconSelected} />\n\t\t\t</li>\n\t\t);\n\t}\n\treturn (\n\t\t<li data-ui5-value={star.index} class=\"ui5-rating-indicator-item ui5-rating-indicator-item-unsel\">\n\t\t\t<Icon data-ui5-value={star.index} name={this.effectiveIconUnselected}/>\n\t\t</li>\n\t);\n}\n\nfunction halfStarIconName(this: RatingIndicator) {\n\treturn this.disabled || this.readonly ? this.effectiveIconSelected : this.effectiveIconUnselected;\n}\n"]}
|
package/dist/SplitButton.d.ts
CHANGED
|
@@ -225,7 +225,9 @@ declare class SplitButton extends UI5Element {
|
|
|
225
225
|
description: string;
|
|
226
226
|
};
|
|
227
227
|
get arrowButtonTooltip(): string;
|
|
228
|
+
get isSplitButton(): boolean;
|
|
228
229
|
get ariaLabelText(): string;
|
|
229
230
|
}
|
|
230
231
|
export default SplitButton;
|
|
231
232
|
export type { SplitButtonAccessibilityAttributes, };
|
|
233
|
+
export declare const isInstanceOfSplitButton: (object: any) => object is SplitButton;
|
package/dist/SplitButton.js
CHANGED
|
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
var SplitButton_1;
|
|
8
8
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
9
|
+
import createInstanceChecker from "@ui5/webcomponents-base/dist/util/createInstanceChecker.js";
|
|
9
10
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
10
11
|
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
11
12
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
@@ -339,6 +340,9 @@ let SplitButton = SplitButton_1 = class SplitButton extends UI5Element {
|
|
|
339
340
|
get arrowButtonTooltip() {
|
|
340
341
|
return SplitButton_1.i18nBundle.getText(SPLIT_BUTTON_ARROW_BUTTON_TOOLTIP);
|
|
341
342
|
}
|
|
343
|
+
get isSplitButton() {
|
|
344
|
+
return true;
|
|
345
|
+
}
|
|
342
346
|
get ariaLabelText() {
|
|
343
347
|
return [SplitButton_1.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION), SplitButton_1.i18nBundle.getText(SPLIT_BUTTON_KEYBOARD_HINT)].join(" ");
|
|
344
348
|
}
|
|
@@ -411,4 +415,5 @@ SplitButton = SplitButton_1 = __decorate([
|
|
|
411
415
|
], SplitButton);
|
|
412
416
|
SplitButton.define();
|
|
413
417
|
export default SplitButton;
|
|
418
|
+
export const isInstanceOfSplitButton = createInstanceChecker("isSplitButton");
|
|
414
419
|
//# sourceMappingURL=SplitButton.js.map
|
package/dist/SplitButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitButton.js","sourceRoot":"","sources":["../src/SplitButton.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,IAAI,EACJ,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAO,EACP,SAAS,EACT,aAAa,GACb,MAAM,sCAAsC,CAAC;AAG9C,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAK/E,OAAO,EACN,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,GACjC,MAAM,mCAAmC,CAAC;AAE3C,WAAW;AACX,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAE3D,SAAS;AACT,OAAO,cAAc,MAAM,uCAAuC,CAAC;AAMnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAsBH,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAkBC;;;;;WAKG;QAEH,sBAAiB,GAAG,KAAK,CAAC;QAE1B;;;;WAIG;QAEH,WAAM,GAAsB,SAAS,CAAC;QAEtC;;;;;;WAMG;QAEH,aAAQ,GAA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EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;uDACpB;AAa3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACT;AASlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qDACH;AA0BzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DACsC;AASjE;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;yCACb;AAGlB;IADN,IAAI,CAAC,oBAAoB,CAAC;qCACG;AA/IzB,WAAW;IArBhB,aAAa,CAAC;QACd,GAAG,EAAE,kBAAkB;QACvB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,cAAc;QACtB,QAAQ,EAAE,mBAAmB;KAC7B,CAAC;IACF;;;OAGG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;OAGG;;IACF,KAAK,CAAC,aAAa,EAAE;QACrB,OAAO,EAAE,IAAI;KACb,CAAC;GACI,WAAW,CAiYhB;AAED,WAAW,CAAC,MAAM,EAAE,CAAC;AAErB,eAAe,WAAW,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport {\n\tisEscape,\n\tisSpace,\n\tisEnter,\n\tisDown,\n\tisUp,\n\tisDownAlt,\n\tisUpAlt,\n\tisF4,\n\tisShift,\n\tisTabNext,\n\tisTabPrevious,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport type { AccessibilityAttributes } from \"@ui5/webcomponents-base/dist/types.js\";\nimport type { AriaHasPopup, UI5CustomEvent } from \"@ui5/webcomponents-base\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type ButtonDesign from \"./types/ButtonDesign.js\";\nimport type Button from \"./Button.js\";\n\nimport {\n\tSPLIT_BUTTON_DESCRIPTION,\n\tSPLIT_BUTTON_KEYBOARD_HINT,\n\tSPLIT_BUTTON_ARROW_BUTTON_TOOLTIP,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Template\nimport SplitButtonTemplate from \"./SplitButtonTemplate.js\";\n\n// Styles\nimport SplitButtonCss from \"./generated/themes/SplitButton.css.js\";\n\ntype SplitButtonRootAccAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"roleDescription\" | \"title\" | \"ariaKeyShortcuts\">;\ntype SplitButtonArrowButtonAccAtributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"expanded\" | \"title\">;\ntype SplitButtonAccessibilityAttributes = {root?: SplitButtonRootAccAttributes, arrowButton?: SplitButtonArrowButtonAccAtributes}\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-split-button` enables users to trigger actions. It is constructed of two separate actions -\n * default action and arrow action that can be activated by clicking or tapping, or by\n * pressing certain keyboard keys - `Space` or `Enter` for default action,\n * and `Arrow Down` or `Arrow Up` for arrow action.\n *\n * ### Usage\n *\n * `ui5-split-button` consists two separate buttons:\n *\n * - for the first one (default action) you can define some `text` or an `icon`, or both.\n * - the second one (arrow action) contains only `slim-arrow-down` icon.\n *\n * You can choose a `design` from a set of predefined types (the same as for ui5-button) that offer\n * different styling to correspond to the triggered action. Both text and arrow actions have the same design.\n *\n * You can set the `ui5-split-button` as enabled or disabled. Both parts of an enabled\n * `ui5-split-button` can be pressed by clicking or tapping it, or by certain keys, which changes\n * the style to provide visual feedback to the user that it is pressed or hovered over with\n * the mouse cursor. A disabled `ui5-split-button` appears inactive and any of the two buttons\n * cannot be pressed.\n *\n * ### Keyboard Handling\n *\n * - `Space` or `Enter` - triggers the default action\n * - `Shift` or `Escape` - if `Space` is pressed, releases the default action button without triggering the click event.\n * - `Arrow Down`, `Arrow Up`, `Alt`+`Arrow Down`, `Alt`+`Arrow Up`, or `F4` - triggers the arrow action\n * There are separate events that are fired on activating of `ui5-split-button` parts:\n *\n * - `click` for the first button (default action)\n * - `arrow-click` for the second button (arrow action)\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/SplitButton.js\";`\n * @csspart button - Used to style the native button element\n * @csspart icon - Used to style the icon in the native button element\n * @csspart endIcon - Used to style the end icon in the native button element\n * @constructor\n * @extends UI5Element\n * @public\n * @since 1.1.0\n */\n@customElement({\n\ttag: \"ui5-split-button\",\n\trenderer: jsxRenderer,\n\tstyles: SplitButtonCss,\n\ttemplate: SplitButtonTemplate,\n})\n/**\n * Fired when the user clicks on the default action.\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the user clicks on the arrow action.\n * @public\n */\n@event(\"arrow-click\", {\n\tbubbles: true,\n})\nclass SplitButton extends UI5Element {\n\teventDetails!: {\n\t\tclick: void;\n\t\t\"arrow-click\": void;\n\t}\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * Example:\n\t *\n\t * See all available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines whether the arrow button should have the active state styles or not.\n\t * @default false\n\t * @public\n\t * @since 1.21.0\n\t */\n\t@property({ type: Boolean })\n\tactiveArrowButton = false;\n\n\t/**\n\t * Defines the component design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign: `${ButtonDesign}` = \"Default\";\n\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the tabIndex of the component.\n\t * @default \"0\"\n\t * @private\n\t */\n\t@property({ type: Number, noAttribute: true })\n\t_tabIndex = 0\n\n\t/**\n\t * Indicates if there is Shift or Escape key pressed while Space key is down.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_shiftOrEscapePressedDuringSpace = false;\n\n\t/**\n\t * Defines the active state of the text button\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_textButtonActive = false;\n\n\t/**\n\t * Defines the state of the internal Button used for the Arrow button of the SplitButton.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_activeArrowButton = false;\n\n\t/**\n\t * Defines the display of the end icon as a graphical element within the default action of the component after the button text.\n\t * The SAP-icons font provides different options.\n\t *\n\t * Example:\n\t *\n\t * See all available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @private\n\t */\n\t@property({ type: String })\n\t_endIcon?: string;\n\n\t/**\n\t * Defines the visibility of the arrow button of the component.\n\t *\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_hideArrowButton = false;\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The `accessibilityAttributes` property accepts an object with the following optional fields:\n\t *\n\t * - **root**: Attributes that will be applied to the main (text) button.\n\t * - **hasPopup**: Indicates the presence and type of popup triggered by the button.\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **roleDescription**: Provides a human-readable description for the role of the button.\n\t * Accepts any string value.\n\t * - **title**: Specifies a tooltip or description for screen readers.\n\t * Accepts any string value.\n\t * \t- **ariaKeyShortcuts**: Defines keyboard shortcuts that activate or give focus to the button.\n\t *\n\t * - **arrowButton**: Attributes applied specifically to the arrow (split) button.\n\t * - **hasPopup**: Indicates the presence and type of popup triggered by the arrow button.\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **expanded**: Indicates whether the popup triggered by the arrow button is currently expanded.\n\t * Accepts boolean values: `true` or `false`.\n\t *\n\t * @default {}\n\t * @public\n\t * @since 2.13.0\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: SplitButtonAccessibilityAttributes = {};\n\n\t/**\n\t * Defines the text of the component.\n\t *\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: Node, \"default\": true })\n\ttext!: DefaultSlot<Node>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tonBeforeRendering() {\n\t\tif (this.disabled) {\n\t\t\tthis._tabIndex = -1;\n\t\t}\n\t}\n\n\t_handleMouseClick(e: UI5CustomEvent<Button, \"click\">) {\n\t\tthis._fireClick(e);\n\t}\n\n\t_onFocusOut() {\n\t\tif (this.disabled || this.getFocusDomRef()!.matches(\":has(:focus-within)\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._resetActionButtonStates();\n\t\tthis._setTabIndexValue();\n\t}\n\n\thandleTouchStart(e: TouchEvent | MouseEvent) {\n\t\te.stopPropagation();\n\t\tthis._textButtonActive = true;\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_onInnerButtonFocusIn(e: FocusEvent) {\n\t\te.stopPropagation();\n\t\tthis._setTabIndexValue(true);\n\t\tconst target = e.target as Button;\n\t\ttarget.focus();\n\t}\n\n\t_onKeyDown(e: KeyboardEvent) {\n\t\tif (this._isArrowKeyAction(e)) {\n\t\t\tthis._handleArrowButtonAction(e);\n\t\t\tthis._activeArrowButton = true;\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isDefaultAction(e)) {\n\t\t\tthis._handleDefaultAction(e);\n\t\t\treturn;\n\t\t}\n\n\t\tif ((isShift(e) || isEscape(e)) && this._textButtonActive) {\n\t\t\te.preventDefault();\n\t\t\tthis._shiftOrEscapePressedDuringSpace = true;\n\t\t}\n\n\t\tif (isEscape(e) && !this._textButtonActive) {\n\t\t\tthis._resetActionButtonStates();\n\t\t}\n\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_onKeyUp(e: KeyboardEvent) {\n\t\tconst target = e.target as Button;\n\t\tif (this._isArrowKeyAction(e)) {\n\t\t\te.preventDefault();\n\t\t\tthis._activeArrowButton = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis._textButtonActive = false;\n\t\t\tif (!this._shiftOrEscapePressedDuringSpace) { // Do not fire click if Arrow button is focused by mouse and Space is pressed afterwards\n\t\t\t\tif (target !== this.arrowButton) {\n\t\t\t\t\tthis._fireClick();\n\t\t\t\t} else {\n\t\t\t\t\tthis._fireArrowClick();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._shiftOrEscapePressedDuringSpace = false;\n\t\t\treturn;\n\t\t}\n\n\t\tconst shouldToggleTextButtonActiveStateOff = isEnter(e) || (isShift(e) && this._textButtonActive);\n\n\t\tif (shouldToggleTextButtonActiveStateOff) {\n\t\t\tthis._textButtonActive = false;\n\t\t}\n\t}\n\n\t_resetActionButtonStates() {\n\t\tthis._activeArrowButton = false;\n\t\tthis._textButtonActive = false;\n\t\tthis._shiftOrEscapePressedDuringSpace = false;\n\t}\n\n\t_fireClick(e?: Event) {\n\t\te?.stopPropagation();\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t_fireArrowClick(e?: Event) {\n\t\te?.stopPropagation();\n\n\t\tthis.fireDecoratorEvent(\"arrow-click\");\n\t}\n\n\t_textButtonRelease() {\n\t\tthis._textButtonActive = false;\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_arrowButtonPress(e: MouseEvent) {\n\t\te.stopPropagation();\n\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_arrowButtonRelease(e: MouseEvent) {\n\t\te.preventDefault();\n\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_setTabIndexValue(innerButtonPressed?: boolean) {\n\t\tthis._tabIndex = this.disabled ? -1 : 0;\n\n\t\tif (this._tabIndex === -1 && innerButtonPressed) {\n\t\t\tthis._tabIndex = 0;\n\t\t}\n\t}\n\n\t_onArrowButtonActiveStateChange(e: CustomEvent) {\n\t\tif (this.activeArrowButton) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the pressed key is an arrow key.\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_isArrowKeyAction(e: KeyboardEvent): boolean {\n\t\treturn isDown(e) || isUp(e) || isDownAlt(e) || isUpAlt(e) || isF4(e);\n\t}\n\n\t/**\n\t * Checks if the pressed key is a default action key (Space or Enter).\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_isDefaultAction(e: KeyboardEvent): boolean {\n\t\treturn isSpace(e) || isEnter(e);\n\t}\n\n\t/**\n\t * Handles the click event and the focus on the arrow button.\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_handleArrowButtonAction(e: UI5CustomEvent<Button, \"click\"> | KeyboardEvent) {\n\t\te.preventDefault();\n\n\t\tthis._fireArrowClick(e);\n\t}\n\n\t/**\n\t * Handles the default action and the active state of the respective button.\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_handleDefaultAction(e: KeyboardEvent) {\n\t\te.preventDefault();\n\t\tconst target = e.target as Button;\n\n\t\tif (isEnter(e)) {\n\t\t\tif (this.arrowButton && target === this.arrowButton) {\n\t\t\t\tthis._activeArrowButton = true;\n\t\t\t\tthis._fireArrowClick();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._textButtonActive = true;\n\t\t\tthis._fireClick(e);\n\t\t\treturn;\n\t\t}\n\n\t\tif (isTabPrevious(e) || isTabNext(e)) {\n\t\t\tthis._resetActionButtonStates();\n\t\t}\n\t}\n\n\tget effectiveActiveArrowButton() {\n\t\treturn this.activeArrowButton || this._activeArrowButton;\n\t}\n\n\tget buttonTextContent() {\n\t\treturn this.textContent;\n\t}\n\n\tget isTextButton() {\n\t\treturn !!this.textContent;\n\t}\n\n\tget textButton() {\n\t\treturn this.getDomRef()?.querySelector<Button>(\".ui5-split-text-button\");\n\t}\n\n\tget arrowButton() {\n\t\treturn this.getDomRef()?.querySelector<Button>(\".ui5-split-arrow-button\");\n\t}\n\n\tget _computedAccessibilityAttributes(): SplitButtonAccessibilityAttributes {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.root?.hasPopup,\n\t\t\t\troleDescription: this.accessibilityAttributes?.root?.roleDescription || (this._hideArrowButton ? undefined : SplitButton.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION)),\n\t\t\t\ttitle: this.accessibilityAttributes?.root?.title,\n\t\t\t\tariaKeyShortcuts: this.accessibilityAttributes?.root?.ariaKeyShortcuts,\n\t\t\t},\n\t\t\tarrowButton: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.arrowButton?.hasPopup || \"menu\" as AriaHasPopup,\n\t\t\t\texpanded: this.accessibilityAttributes?.arrowButton?.expanded || this.effectiveActiveArrowButton,\n\t\t\t\ttitle: this.accessibilityAttributes?.arrowButton?.title || this.arrowButtonTooltip,\n\t\t\t},\n\t\t};\n\t}\n\n\tget accInfo() {\n\t\treturn {\n\t\t\t\"keyboardHint\": SplitButton.i18nBundle.getText(SPLIT_BUTTON_KEYBOARD_HINT),\n\t\t\t\"description\": SplitButton.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION),\n\t\t};\n\t}\n\n\tget arrowButtonTooltip() {\n\t\treturn SplitButton.i18nBundle.getText(SPLIT_BUTTON_ARROW_BUTTON_TOOLTIP);\n\t}\n\n\tget ariaLabelText() {\n\t\treturn [SplitButton.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION), SplitButton.i18nBundle.getText(SPLIT_BUTTON_KEYBOARD_HINT)].join(\" \");\n\t}\n}\n\nSplitButton.define();\n\nexport default SplitButton;\nexport type {\n\tSplitButtonAccessibilityAttributes,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SplitButton.js","sourceRoot":"","sources":["../src/SplitButton.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,qBAAqB,MAAM,4DAA4D,CAAC;AAC/F,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,IAAI,EACJ,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAO,EACP,SAAS,EACT,aAAa,GACb,MAAM,sCAAsC,CAAC;AAG9C,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAK/E,OAAO,EACN,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,GACjC,MAAM,mCAAmC,CAAC;AAE3C,WAAW;AACX,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAE3D,SAAS;AACT,OAAO,cAAc,MAAM,uCAAuC,CAAC;AAMnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAsBH,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAkBC;;;;;WAKG;QAEH,sBAAiB,GAAG,KAAK,CAAC;QAE1B;;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,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;sDACrB;AAQ1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;uDACpB;AAa3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACT;AASlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qDACH;AA0BzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DACsC;AASjE;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;yCACb;AAGlB;IADN,IAAI,CAAC,oBAAoB,CAAC;qCACG;AA/IzB,WAAW;IArBhB,aAAa,CAAC;QACd,GAAG,EAAE,kBAAkB;QACvB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,cAAc;QACtB,QAAQ,EAAE,mBAAmB;KAC7B,CAAC;IACF;;;OAGG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;OAGG;;IACF,KAAK,CAAC,aAAa,EAAE;QACrB,OAAO,EAAE,IAAI;KACb,CAAC;GACI,WAAW,CAqYhB;AAED,WAAW,CAAC,MAAM,EAAE,CAAC;AAErB,eAAe,WAAW,CAAC;AAK3B,MAAM,CAAC,MAAM,uBAAuB,GAAG,qBAAqB,CAAc,eAAe,CAAC,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport createInstanceChecker from \"@ui5/webcomponents-base/dist/util/createInstanceChecker.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport {\n\tisEscape,\n\tisSpace,\n\tisEnter,\n\tisDown,\n\tisUp,\n\tisDownAlt,\n\tisUpAlt,\n\tisF4,\n\tisShift,\n\tisTabNext,\n\tisTabPrevious,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport type { AccessibilityAttributes } from \"@ui5/webcomponents-base/dist/types.js\";\nimport type { AriaHasPopup, UI5CustomEvent } from \"@ui5/webcomponents-base\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type ButtonDesign from \"./types/ButtonDesign.js\";\nimport type Button from \"./Button.js\";\n\nimport {\n\tSPLIT_BUTTON_DESCRIPTION,\n\tSPLIT_BUTTON_KEYBOARD_HINT,\n\tSPLIT_BUTTON_ARROW_BUTTON_TOOLTIP,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Template\nimport SplitButtonTemplate from \"./SplitButtonTemplate.js\";\n\n// Styles\nimport SplitButtonCss from \"./generated/themes/SplitButton.css.js\";\n\ntype SplitButtonRootAccAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"roleDescription\" | \"title\" | \"ariaKeyShortcuts\">;\ntype SplitButtonArrowButtonAccAtributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"expanded\" | \"title\">;\ntype SplitButtonAccessibilityAttributes = {root?: SplitButtonRootAccAttributes, arrowButton?: SplitButtonArrowButtonAccAtributes}\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-split-button` enables users to trigger actions. It is constructed of two separate actions -\n * default action and arrow action that can be activated by clicking or tapping, or by\n * pressing certain keyboard keys - `Space` or `Enter` for default action,\n * and `Arrow Down` or `Arrow Up` for arrow action.\n *\n * ### Usage\n *\n * `ui5-split-button` consists two separate buttons:\n *\n * - for the first one (default action) you can define some `text` or an `icon`, or both.\n * - the second one (arrow action) contains only `slim-arrow-down` icon.\n *\n * You can choose a `design` from a set of predefined types (the same as for ui5-button) that offer\n * different styling to correspond to the triggered action. Both text and arrow actions have the same design.\n *\n * You can set the `ui5-split-button` as enabled or disabled. Both parts of an enabled\n * `ui5-split-button` can be pressed by clicking or tapping it, or by certain keys, which changes\n * the style to provide visual feedback to the user that it is pressed or hovered over with\n * the mouse cursor. A disabled `ui5-split-button` appears inactive and any of the two buttons\n * cannot be pressed.\n *\n * ### Keyboard Handling\n *\n * - `Space` or `Enter` - triggers the default action\n * - `Shift` or `Escape` - if `Space` is pressed, releases the default action button without triggering the click event.\n * - `Arrow Down`, `Arrow Up`, `Alt`+`Arrow Down`, `Alt`+`Arrow Up`, or `F4` - triggers the arrow action\n * There are separate events that are fired on activating of `ui5-split-button` parts:\n *\n * - `click` for the first button (default action)\n * - `arrow-click` for the second button (arrow action)\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/SplitButton.js\";`\n * @csspart button - Used to style the native button element\n * @csspart icon - Used to style the icon in the native button element\n * @csspart endIcon - Used to style the end icon in the native button element\n * @constructor\n * @extends UI5Element\n * @public\n * @since 1.1.0\n */\n@customElement({\n\ttag: \"ui5-split-button\",\n\trenderer: jsxRenderer,\n\tstyles: SplitButtonCss,\n\ttemplate: SplitButtonTemplate,\n})\n/**\n * Fired when the user clicks on the default action.\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the user clicks on the arrow action.\n * @public\n */\n@event(\"arrow-click\", {\n\tbubbles: true,\n})\nclass SplitButton extends UI5Element {\n\teventDetails!: {\n\t\tclick: void;\n\t\t\"arrow-click\": void;\n\t}\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * Example:\n\t *\n\t * See all available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines whether the arrow button should have the active state styles or not.\n\t * @default false\n\t * @public\n\t * @since 1.21.0\n\t */\n\t@property({ type: Boolean })\n\tactiveArrowButton = false;\n\n\t/**\n\t * Defines the component design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign: `${ButtonDesign}` = \"Default\";\n\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the tabIndex of the component.\n\t * @default \"0\"\n\t * @private\n\t */\n\t@property({ type: Number, noAttribute: true })\n\t_tabIndex = 0\n\n\t/**\n\t * Indicates if there is Shift or Escape key pressed while Space key is down.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_shiftOrEscapePressedDuringSpace = false;\n\n\t/**\n\t * Defines the active state of the text button\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_textButtonActive = false;\n\n\t/**\n\t * Defines the state of the internal Button used for the Arrow button of the SplitButton.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_activeArrowButton = false;\n\n\t/**\n\t * Defines the display of the end icon as a graphical element within the default action of the component after the button text.\n\t * The SAP-icons font provides different options.\n\t *\n\t * Example:\n\t *\n\t * See all available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @private\n\t */\n\t@property({ type: String })\n\t_endIcon?: string;\n\n\t/**\n\t * Defines the visibility of the arrow button of the component.\n\t *\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_hideArrowButton = false;\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The `accessibilityAttributes` property accepts an object with the following optional fields:\n\t *\n\t * - **root**: Attributes that will be applied to the main (text) button.\n\t * - **hasPopup**: Indicates the presence and type of popup triggered by the button.\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **roleDescription**: Provides a human-readable description for the role of the button.\n\t * Accepts any string value.\n\t * - **title**: Specifies a tooltip or description for screen readers.\n\t * Accepts any string value.\n\t * \t- **ariaKeyShortcuts**: Defines keyboard shortcuts that activate or give focus to the button.\n\t *\n\t * - **arrowButton**: Attributes applied specifically to the arrow (split) button.\n\t * - **hasPopup**: Indicates the presence and type of popup triggered by the arrow button.\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **expanded**: Indicates whether the popup triggered by the arrow button is currently expanded.\n\t * Accepts boolean values: `true` or `false`.\n\t *\n\t * @default {}\n\t * @public\n\t * @since 2.13.0\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: SplitButtonAccessibilityAttributes = {};\n\n\t/**\n\t * Defines the text of the component.\n\t *\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: Node, \"default\": true })\n\ttext!: DefaultSlot<Node>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tonBeforeRendering() {\n\t\tif (this.disabled) {\n\t\t\tthis._tabIndex = -1;\n\t\t}\n\t}\n\n\t_handleMouseClick(e: UI5CustomEvent<Button, \"click\">) {\n\t\tthis._fireClick(e);\n\t}\n\n\t_onFocusOut() {\n\t\tif (this.disabled || this.getFocusDomRef()!.matches(\":has(:focus-within)\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._resetActionButtonStates();\n\t\tthis._setTabIndexValue();\n\t}\n\n\thandleTouchStart(e: TouchEvent | MouseEvent) {\n\t\te.stopPropagation();\n\t\tthis._textButtonActive = true;\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_onInnerButtonFocusIn(e: FocusEvent) {\n\t\te.stopPropagation();\n\t\tthis._setTabIndexValue(true);\n\t\tconst target = e.target as Button;\n\t\ttarget.focus();\n\t}\n\n\t_onKeyDown(e: KeyboardEvent) {\n\t\tif (this._isArrowKeyAction(e)) {\n\t\t\tthis._handleArrowButtonAction(e);\n\t\t\tthis._activeArrowButton = true;\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isDefaultAction(e)) {\n\t\t\tthis._handleDefaultAction(e);\n\t\t\treturn;\n\t\t}\n\n\t\tif ((isShift(e) || isEscape(e)) && this._textButtonActive) {\n\t\t\te.preventDefault();\n\t\t\tthis._shiftOrEscapePressedDuringSpace = true;\n\t\t}\n\n\t\tif (isEscape(e) && !this._textButtonActive) {\n\t\t\tthis._resetActionButtonStates();\n\t\t}\n\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_onKeyUp(e: KeyboardEvent) {\n\t\tconst target = e.target as Button;\n\t\tif (this._isArrowKeyAction(e)) {\n\t\t\te.preventDefault();\n\t\t\tthis._activeArrowButton = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis._textButtonActive = false;\n\t\t\tif (!this._shiftOrEscapePressedDuringSpace) { // Do not fire click if Arrow button is focused by mouse and Space is pressed afterwards\n\t\t\t\tif (target !== this.arrowButton) {\n\t\t\t\t\tthis._fireClick();\n\t\t\t\t} else {\n\t\t\t\t\tthis._fireArrowClick();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._shiftOrEscapePressedDuringSpace = false;\n\t\t\treturn;\n\t\t}\n\n\t\tconst shouldToggleTextButtonActiveStateOff = isEnter(e) || (isShift(e) && this._textButtonActive);\n\n\t\tif (shouldToggleTextButtonActiveStateOff) {\n\t\t\tthis._textButtonActive = false;\n\t\t}\n\t}\n\n\t_resetActionButtonStates() {\n\t\tthis._activeArrowButton = false;\n\t\tthis._textButtonActive = false;\n\t\tthis._shiftOrEscapePressedDuringSpace = false;\n\t}\n\n\t_fireClick(e?: Event) {\n\t\te?.stopPropagation();\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t_fireArrowClick(e?: Event) {\n\t\te?.stopPropagation();\n\n\t\tthis.fireDecoratorEvent(\"arrow-click\");\n\t}\n\n\t_textButtonRelease() {\n\t\tthis._textButtonActive = false;\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_arrowButtonPress(e: MouseEvent) {\n\t\te.stopPropagation();\n\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_arrowButtonRelease(e: MouseEvent) {\n\t\te.preventDefault();\n\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_setTabIndexValue(innerButtonPressed?: boolean) {\n\t\tthis._tabIndex = this.disabled ? -1 : 0;\n\n\t\tif (this._tabIndex === -1 && innerButtonPressed) {\n\t\t\tthis._tabIndex = 0;\n\t\t}\n\t}\n\n\t_onArrowButtonActiveStateChange(e: CustomEvent) {\n\t\tif (this.activeArrowButton) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the pressed key is an arrow key.\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_isArrowKeyAction(e: KeyboardEvent): boolean {\n\t\treturn isDown(e) || isUp(e) || isDownAlt(e) || isUpAlt(e) || isF4(e);\n\t}\n\n\t/**\n\t * Checks if the pressed key is a default action key (Space or Enter).\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_isDefaultAction(e: KeyboardEvent): boolean {\n\t\treturn isSpace(e) || isEnter(e);\n\t}\n\n\t/**\n\t * Handles the click event and the focus on the arrow button.\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_handleArrowButtonAction(e: UI5CustomEvent<Button, \"click\"> | KeyboardEvent) {\n\t\te.preventDefault();\n\n\t\tthis._fireArrowClick(e);\n\t}\n\n\t/**\n\t * Handles the default action and the active state of the respective button.\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_handleDefaultAction(e: KeyboardEvent) {\n\t\te.preventDefault();\n\t\tconst target = e.target as Button;\n\n\t\tif (isEnter(e)) {\n\t\t\tif (this.arrowButton && target === this.arrowButton) {\n\t\t\t\tthis._activeArrowButton = true;\n\t\t\t\tthis._fireArrowClick();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._textButtonActive = true;\n\t\t\tthis._fireClick(e);\n\t\t\treturn;\n\t\t}\n\n\t\tif (isTabPrevious(e) || isTabNext(e)) {\n\t\t\tthis._resetActionButtonStates();\n\t\t}\n\t}\n\n\tget effectiveActiveArrowButton() {\n\t\treturn this.activeArrowButton || this._activeArrowButton;\n\t}\n\n\tget buttonTextContent() {\n\t\treturn this.textContent;\n\t}\n\n\tget isTextButton() {\n\t\treturn !!this.textContent;\n\t}\n\n\tget textButton() {\n\t\treturn this.getDomRef()?.querySelector<Button>(\".ui5-split-text-button\");\n\t}\n\n\tget arrowButton() {\n\t\treturn this.getDomRef()?.querySelector<Button>(\".ui5-split-arrow-button\");\n\t}\n\n\tget _computedAccessibilityAttributes(): SplitButtonAccessibilityAttributes {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.root?.hasPopup,\n\t\t\t\troleDescription: this.accessibilityAttributes?.root?.roleDescription || (this._hideArrowButton ? undefined : SplitButton.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION)),\n\t\t\t\ttitle: this.accessibilityAttributes?.root?.title,\n\t\t\t\tariaKeyShortcuts: this.accessibilityAttributes?.root?.ariaKeyShortcuts,\n\t\t\t},\n\t\t\tarrowButton: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.arrowButton?.hasPopup || \"menu\" as AriaHasPopup,\n\t\t\t\texpanded: this.accessibilityAttributes?.arrowButton?.expanded || this.effectiveActiveArrowButton,\n\t\t\t\ttitle: this.accessibilityAttributes?.arrowButton?.title || this.arrowButtonTooltip,\n\t\t\t},\n\t\t};\n\t}\n\n\tget accInfo() {\n\t\treturn {\n\t\t\t\"keyboardHint\": SplitButton.i18nBundle.getText(SPLIT_BUTTON_KEYBOARD_HINT),\n\t\t\t\"description\": SplitButton.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION),\n\t\t};\n\t}\n\n\tget arrowButtonTooltip() {\n\t\treturn SplitButton.i18nBundle.getText(SPLIT_BUTTON_ARROW_BUTTON_TOOLTIP);\n\t}\n\n\tget isSplitButton(): boolean {\n\t\treturn true;\n\t}\n\n\tget ariaLabelText() {\n\t\treturn [SplitButton.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION), SplitButton.i18nBundle.getText(SPLIT_BUTTON_KEYBOARD_HINT)].join(\" \");\n\t}\n}\n\nSplitButton.define();\n\nexport default SplitButton;\nexport type {\n\tSplitButtonAccessibilityAttributes,\n};\n\nexport const isInstanceOfSplitButton = createInstanceChecker<SplitButton>(\"isSplitButton\");\n"]}
|