@oicl/openbridge-webcomponents 2.1.0 → 2.2.0-next.2
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/bundle/openbridge-webcomponents.bundle.js +59 -16
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +152 -9
- package/dist/components/icon-button/icon-button.d.ts +2 -0
- package/dist/components/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/icon-button/icon-button.js +4 -0
- package/dist/components/icon-button/icon-button.js.map +1 -1
- package/dist/components/split-button/split-button.css.js +5 -0
- package/dist/components/split-button/split-button.css.js.map +1 -1
- package/dist/components/split-button/split-button.d.ts +43 -5
- package/dist/components/split-button/split-button.d.ts.map +1 -1
- package/dist/components/split-button/split-button.js +23 -5
- package/dist/components/split-button/split-button.js.map +1 -1
- package/dist/components/top-bar/top-bar.css.js +2 -2
- package/dist/components/top-bar/top-bar.css.js.map +1 -1
- package/dist/components/top-bar/top-bar.d.ts +23 -8
- package/dist/components/top-bar/top-bar.d.ts.map +1 -1
- package/dist/components/top-bar/top-bar.js +25 -9
- package/dist/components/top-bar/top-bar.js.map +1 -1
- package/package.json +1 -1
package/custom-elements.json
CHANGED
|
@@ -71776,6 +71776,26 @@
|
|
|
71776
71776
|
"description": "Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary.",
|
|
71777
71777
|
"attribute": "aria-label"
|
|
71778
71778
|
},
|
|
71779
|
+
{
|
|
71780
|
+
"kind": "method",
|
|
71781
|
+
"name": "focus",
|
|
71782
|
+
"privacy": "public",
|
|
71783
|
+
"return": {
|
|
71784
|
+
"type": {
|
|
71785
|
+
"text": "void"
|
|
71786
|
+
}
|
|
71787
|
+
},
|
|
71788
|
+
"parameters": [
|
|
71789
|
+
{
|
|
71790
|
+
"name": "options",
|
|
71791
|
+
"optional": true,
|
|
71792
|
+
"type": {
|
|
71793
|
+
"text": "FocusOptions"
|
|
71794
|
+
}
|
|
71795
|
+
}
|
|
71796
|
+
],
|
|
71797
|
+
"description": "Focus lands on the button inside, not on the host."
|
|
71798
|
+
},
|
|
71779
71799
|
{
|
|
71780
71800
|
"kind": "field",
|
|
71781
71801
|
"name": "progressSpinner",
|
|
@@ -82949,12 +82969,16 @@
|
|
|
82949
82969
|
"declarations": [
|
|
82950
82970
|
{
|
|
82951
82971
|
"kind": "class",
|
|
82952
|
-
"description": "`<obc-split-button>` – A composite button component combining a primary action and a dropdown menu for additional actions or selections. Also known as a split button, segmented button, or action menu button.\n\nProvides a main button for a default/primary action and a secondary dropdown button that reveals a context menu with configurable options. This pattern allows users to quickly trigger a common action or select from a list of related actions or filters, improving workflow efficiency and reducing UI clutter.\n\n### Features\n- **Dual-action layout:** Combines a primary button (for the main action) and a dropdown button (for menu access) in a single horizontal control.\n- **Configurable dropdown menu:** Supports multiple menu types via `menuType` (regular, checkboxes, flyout, multi-column, etc.) for different selection and grouping needs.\n- **Multi-select and group selection:** Allows single or multiple selections in the dropdown, with optional grouping and per-group selection logic.\n- **Customizable menu content:** Accepts an array of options or column groups, supports icons, subtitles, and multi-column layouts for complex menus.\n- **Optional icon in primary button:** Add a leading icon to the main button using the `hasIcon` property and `icon` slot.\n- **Title bar and menu title:** Optionally display a title bar with close button and custom title text in the dropdown.\n- **Full width mode:** Can stretch to fill its container using the `fullWidth` property.\n- **Disabled state:**
|
|
82972
|
+
"description": "`<obc-split-button>` – A composite button component combining a primary action and a dropdown menu for additional actions or selections. Also known as a split button, segmented button, or action menu button.\n\nProvides a main button for a default/primary action and a secondary dropdown button that reveals a context menu with configurable options. This pattern allows users to quickly trigger a common action or select from a list of related actions or filters, improving workflow efficiency and reducing UI clutter.\n\n### Features\n- **Dual-action layout:** Combines a primary button (for the main action) and a dropdown button (for menu access) in a single horizontal control.\n- **Configurable dropdown menu:** Supports multiple menu types via `menuType` (regular, checkboxes, flyout, multi-column, etc.) for different selection and grouping needs.\n- **Multi-select and group selection:** Allows single or multiple selections in the dropdown, with optional grouping and per-group selection logic.\n- **Customizable menu content:** Accepts an array of options or column groups, supports icons, subtitles, and multi-column layouts for complex menus.\n- **Optional icon in primary button:** Add a leading icon to the main button using the `hasIcon` property and `icon` slot.\n- **Replaceable dropdown icon:** The dropdown button shows a chevron; fill the `dropdown-icon` slot to show another symbol, for example one that says what the menu holds.\n- **Title bar and menu title:** Optionally display a title bar with close button and custom title text in the dropdown.\n- **Full width mode:** Can stretch to fill its container using the `fullWidth` property.\n- **Disabled state:** `disabled` disables both halves; `primaryDisabled` and `dropdownDisabled` disable one half each, so the primary action can be unavailable while the menu stays in use.\n- **Dropdown positioning:** The menu opens below the button and extends to the right. `openTop` opens it above and `openLeft` extends it to the left, for a button near the bottom or the right edge of its container.\n- **Selection persistence:** Optionally keeps the selected state visually persistent in the menu.\n- **Keyboard and pointer accessibility:** Follows standard button and menu accessibility patterns.\n\n### Variants (Menu Types)\n- **Regular:** Standard single-selection dropdown menu.\n- **Checkboxes:** Menu with checkboxes for multi-selection.\n- **Flyout:** Hierarchical/flyout menu for nested actions.\n- **Multi:** Multi-column menu for large sets of options.\n- **MultiWithSubtitles:** Multi-column menu with grouped options and subtitles.\n- See `ContextMenuType` enum for all supported menu types.\n\n### Usage Guidelines\nUse `obc-split-button` when you want to provide a primary action alongside a set of related secondary actions or filters, without overwhelming the main UI. Ideal for toolbars, filter bars, or any context where a default action is common but alternatives should be easily accessible. For example, use it for \"Save\" (primary) with \"Save As...\" and \"Export\" (dropdown), or for filter controls with quick presets.\n\n- Prefer this component over a standalone dropdown when a default action is expected to be used frequently.\n- For menus with many options, use multi-column or grouped variants for better organization.\n- If only a single action is needed, use a standard `<obc-button>` instead.\n- For persistent or always-visible lists of actions, consider a toolbar or action list.\n- **TODO(designer):** Confirm best practices for when to use multi-select vs. single-select, and any recommended limits on number of options or columns.\n\n### Slots\n| Slot Name | Renders When... | Purpose |\n|-----------------|---------------------|-----------------------------------------------------|\n| `icon` | `hasIcon` is true | Leading icon in the primary button (e.g., `<obi-placeholder></obi-placeholder>`) |\n| `dropdown-icon` | Always | Icon of the dropdown button; the chevron when empty |\n\n### Events\n- `click` – Fired when either the primary or dropdown button is clicked. The event detail includes `{action: 'primary' | 'dropdown'}` to distinguish which part was activated.\n- `change` – Fired when the menu selection changes. The event detail includes `{selectedValues, selectedOptions}`.\n\n### Keyboard\nThe primary half is a plain button. The dropdown half follows the\n[APG Menu Button](https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/):\n`Enter` and `Space` open the menu, `ArrowDown` and `Home` open it on the\nfirst item, `ArrowUp` and `End` on the last, and `Escape` closes it and\nreturns focus to the dropdown half. The menu is `obc-context-menu-input`.\n\nLeft out: `Enter` and `Space` land on the selected item rather than the\nfirst, so a reopened selection menu starts where the user left it.\n\n### Best Practices & Constraints\n- Only use multi-select when the menu type and use case require it; otherwise, prefer single selection for clarity.\n- Keep the primary action clear and distinct from dropdown actions.\n- For accessibility, ensure all menu options have clear labels and, if using icons, provide appropriate alt text or aria-labels.\n- Avoid overloading the dropdown with too many options; group or paginate if necessary.\n- The dropdown menu closes automatically when an option is selected (unless it is a group/flyout parent).\n- The component manages focus and pointer events to ensure proper menu closing when clicking outside.\n- **TODO(designer):** Specify recommended icon usage, menu title conventions, and any animation/timing guidelines for menu opening/closing.\n\n### Example:\n```html\n<obc-split-button\n label=\"Save\"\n .options=${[\n {value: 'save-as', label: 'Save As...'},\n {value: 'export', label: 'Export'},\n ]}\n hasIcon\n>\n <obi-placeholder slot=\"icon\"></obi-placeholder>\n</obc-split-button>\n```\nIn this example, the split button shows a \"Save\" action with a leading icon, and a dropdown menu with \"Save As...\" and \"Export\" options.",
|
|
82953
82973
|
"name": "ObcSplitButton",
|
|
82954
82974
|
"slots": [
|
|
82955
82975
|
{
|
|
82956
82976
|
"description": "Leading icon for the primary button (shown when `hasIcon` is true)",
|
|
82957
82977
|
"name": "icon"
|
|
82978
|
+
},
|
|
82979
|
+
{
|
|
82980
|
+
"description": "Icon of the dropdown button; the chevron when empty.",
|
|
82981
|
+
"name": "dropdown-icon"
|
|
82958
82982
|
}
|
|
82959
82983
|
],
|
|
82960
82984
|
"members": [
|
|
@@ -83091,6 +83115,36 @@
|
|
|
83091
83115
|
"description": "Whether both parts of the button are disabled. When true, disables both the primary and dropdown buttons.",
|
|
83092
83116
|
"attribute": "disabled"
|
|
83093
83117
|
},
|
|
83118
|
+
{
|
|
83119
|
+
"kind": "field",
|
|
83120
|
+
"name": "primaryDisabled",
|
|
83121
|
+
"type": {
|
|
83122
|
+
"text": "boolean"
|
|
83123
|
+
},
|
|
83124
|
+
"default": "false",
|
|
83125
|
+
"description": "Disables the primary button alone, for an action the user cannot take right now while the menu stays in use, for example to ask for the access the action needs.\n\nAvailable when `disabled==false`.",
|
|
83126
|
+
"attribute": "primaryDisabled",
|
|
83127
|
+
"availableWhen": "disabled==false",
|
|
83128
|
+
"availableWhenIf": {
|
|
83129
|
+
"arg": "disabled",
|
|
83130
|
+
"truthy": false
|
|
83131
|
+
}
|
|
83132
|
+
},
|
|
83133
|
+
{
|
|
83134
|
+
"kind": "field",
|
|
83135
|
+
"name": "dropdownDisabled",
|
|
83136
|
+
"type": {
|
|
83137
|
+
"text": "boolean"
|
|
83138
|
+
},
|
|
83139
|
+
"default": "false",
|
|
83140
|
+
"description": "Disables the dropdown button alone, leaving the primary action.\n\nAvailable when `disabled==false`.",
|
|
83141
|
+
"attribute": "dropdownDisabled",
|
|
83142
|
+
"availableWhen": "disabled==false",
|
|
83143
|
+
"availableWhenIf": {
|
|
83144
|
+
"arg": "disabled",
|
|
83145
|
+
"truthy": false
|
|
83146
|
+
}
|
|
83147
|
+
},
|
|
83094
83148
|
{
|
|
83095
83149
|
"kind": "field",
|
|
83096
83150
|
"name": "openTop",
|
|
@@ -83101,6 +83155,16 @@
|
|
|
83101
83155
|
"description": "Open context menu dropdown above (`true`) or below (`false`) the button. Useful for placement near the bottom of the viewport.",
|
|
83102
83156
|
"attribute": "openTop"
|
|
83103
83157
|
},
|
|
83158
|
+
{
|
|
83159
|
+
"kind": "field",
|
|
83160
|
+
"name": "openLeft",
|
|
83161
|
+
"type": {
|
|
83162
|
+
"text": "boolean"
|
|
83163
|
+
},
|
|
83164
|
+
"default": "false",
|
|
83165
|
+
"description": "Extend the menu to the left of the dropdown button (`true`), its right edge on the button's right edge, instead of to the right. For a button near the right edge of its container; combines with `openTop`.",
|
|
83166
|
+
"attribute": "openLeft"
|
|
83167
|
+
},
|
|
83104
83168
|
{
|
|
83105
83169
|
"kind": "field",
|
|
83106
83170
|
"name": "columnGroups",
|
|
@@ -83159,6 +83223,24 @@
|
|
|
83159
83223
|
},
|
|
83160
83224
|
"privacy": "private"
|
|
83161
83225
|
},
|
|
83226
|
+
{
|
|
83227
|
+
"kind": "field",
|
|
83228
|
+
"name": "isPrimaryDisabled",
|
|
83229
|
+
"type": {
|
|
83230
|
+
"text": "boolean"
|
|
83231
|
+
},
|
|
83232
|
+
"privacy": "private",
|
|
83233
|
+
"readonly": true
|
|
83234
|
+
},
|
|
83235
|
+
{
|
|
83236
|
+
"kind": "field",
|
|
83237
|
+
"name": "isDropdownDisabled",
|
|
83238
|
+
"type": {
|
|
83239
|
+
"text": "boolean"
|
|
83240
|
+
},
|
|
83241
|
+
"privacy": "private",
|
|
83242
|
+
"readonly": true
|
|
83243
|
+
},
|
|
83162
83244
|
{
|
|
83163
83245
|
"kind": "field",
|
|
83164
83246
|
"name": "handlePrimaryClick",
|
|
@@ -83348,6 +83430,24 @@
|
|
|
83348
83430
|
"description": "Whether both parts of the button are disabled. When true, disables both the primary and dropdown buttons.",
|
|
83349
83431
|
"fieldName": "disabled"
|
|
83350
83432
|
},
|
|
83433
|
+
{
|
|
83434
|
+
"name": "primaryDisabled",
|
|
83435
|
+
"type": {
|
|
83436
|
+
"text": "boolean"
|
|
83437
|
+
},
|
|
83438
|
+
"default": "false",
|
|
83439
|
+
"description": "Disables the primary button alone, for an action the user cannot take right now while the menu stays in use, for example to ask for the access the action needs.\n\nAvailable when `disabled==false`.",
|
|
83440
|
+
"fieldName": "primaryDisabled"
|
|
83441
|
+
},
|
|
83442
|
+
{
|
|
83443
|
+
"name": "dropdownDisabled",
|
|
83444
|
+
"type": {
|
|
83445
|
+
"text": "boolean"
|
|
83446
|
+
},
|
|
83447
|
+
"default": "false",
|
|
83448
|
+
"description": "Disables the dropdown button alone, leaving the primary action.\n\nAvailable when `disabled==false`.",
|
|
83449
|
+
"fieldName": "dropdownDisabled"
|
|
83450
|
+
},
|
|
83351
83451
|
{
|
|
83352
83452
|
"name": "openTop",
|
|
83353
83453
|
"type": {
|
|
@@ -83357,6 +83457,15 @@
|
|
|
83357
83457
|
"description": "Open context menu dropdown above (`true`) or below (`false`) the button. Useful for placement near the bottom of the viewport.",
|
|
83358
83458
|
"fieldName": "openTop"
|
|
83359
83459
|
},
|
|
83460
|
+
{
|
|
83461
|
+
"name": "openLeft",
|
|
83462
|
+
"type": {
|
|
83463
|
+
"text": "boolean"
|
|
83464
|
+
},
|
|
83465
|
+
"default": "false",
|
|
83466
|
+
"description": "Extend the menu to the left of the dropdown button (`true`), its right edge on the button's right edge, instead of to the right. For a button near the right edge of its container; combines with `openTop`.",
|
|
83467
|
+
"fieldName": "openLeft"
|
|
83468
|
+
},
|
|
83360
83469
|
{
|
|
83361
83470
|
"name": "columnGroups",
|
|
83362
83471
|
"type": {
|
|
@@ -91209,8 +91318,18 @@
|
|
|
91209
91318
|
"declarations": [
|
|
91210
91319
|
{
|
|
91211
91320
|
"kind": "class",
|
|
91212
|
-
"description": "`<obc-top-bar>` – A responsive top navigation bar component for application layouts.\n\nProvides a flexible, highly configurable top bar for application interfaces, supporting navigation, context display, quick actions, and status indicators. The top bar adapts to screen size and can show or hide elements such as menu, app icon, breadcrumbs, user/profile, clock, and alert notifications.\n\nAppears at the top of the UI, organizing primary navigation and contextual actions in a single, persistent region. Designed for use as the main app bar or header in multi-pane or dashboard-style layouts.\n\n## Features\n- **Configurable Sections:** Supports left and right-aligned groups for navigation, context, and actions.\n- **Menu Button:** Optional menu button for opening navigation drawers or sidebars; can be styled as wide or regular.\n- **App Icon Slot:** Customizable slot for displaying an application or brand icon.\n- **App Title & Page Name:** Displays the current application and page context.\n- **Breadcrumbs:** Optional breadcrumb navigation for hierarchical context (in settings mode).\n- **Command Button Slot:** Slot for inserting a primary command/action button.\n- **Alert/Notification Area:** Slot for alert indicators, notification badges, or custom alert components.\n- **Dimming Button:** Optional button for toggling display modes (e.g., day/night).\n- **User/Profile Button:** Optional user icon for profile/account actions.\n- **Apps Button:** Optional button for accessing additional applications or modules.\n- **Clock & Date:** Optional digital clock and date display, responsive to screen size.\n- **Responsive Layout:** Multiple breakpoint properties to control visibility and layout of elements based on viewport width.\n- **Settings Mode:** Special mode with close, back, and forward navigation, breadcrumbs, and app title.\n- **Tall Variant:** Optional increased height for touch or accessibility needs.\n- **Inactive State:** Disables interactive elements and visually de-emphasizes the bar.\n\n## Variants\n- **Regular:** Standard top bar with menu, app icon, title, page name, and action slots.\n- **Settings:** Shows close, back, forward buttons, breadcrumbs, and app title for configuration or settings screens.\n- **Inactive:** Visually muted and disables interaction (e.g., when the app is locked or in a modal state).\n- **Tall:** Increases the height of the bar for improved touch targets.\n\n## Usage Guidelines\nUse `<obc-top-bar>` as the persistent header for your application, providing navigation, context, and quick access to key actions or status. Configure which elements appear via boolean properties and slots. Adjust breakpoint properties to control responsive behavior for each section.\n\n- Place navigation, branding, and context (title, breadcrumbs) on the left; actions, alerts, and status (clock, user, apps) on the right.\n- Use the `settings` property for configuration or setup screens to enable close/back/forward navigation and breadcrumbs.\n- Use the `inactive` property to visually disable the bar and its actions when the app is not interactive.\n- Insert custom icons or buttons using the `app-icon` and `command-button` slots.\n- Use the `alerts` slot to display alert indicators, notification badges, or custom alert components.\n\n**TODO(designer):** Clarify recommended combinations of visible elements for different app contexts (e.g., when to show both user and apps buttons, or best practices for alert placement).\n\n## Slots\n\n| Slot Name | Renders When... | Purpose |\n|------------------|---------------------------------|----------------------------------------------------------------|\n| `app-icon` | `showAppIcon` is true | Custom icon representing the application or brand. |\n| `command-button` | Always (if provided) | Primary command or action button for the current context. |\n| `alerts` | Always (if provided) | Area for alert indicators, notification badges, or alert items.|\n| `clock` | Always (if provided) | Clock component for displaying the current time. |\n\n## Events\n- `menu-button-clicked` – Fired when the menu button is clicked.\n- `dimming-button-clicked` – Fired when the dimming (day/night) button is clicked.\n- `apps-button-clicked` – Fired when the apps button is clicked.\n- `
|
|
91321
|
+
"description": "`<obc-top-bar>` – A responsive top navigation bar component for application layouts.\n\nProvides a flexible, highly configurable top bar for application interfaces, supporting navigation, context display, quick actions, and status indicators. The top bar adapts to screen size and can show or hide elements such as menu, app icon, breadcrumbs, user/profile, clock, and alert notifications.\n\nAppears at the top of the UI, organizing primary navigation and contextual actions in a single, persistent region. Designed for use as the main app bar or header in multi-pane or dashboard-style layouts.\n\n## Features\n- **Configurable Sections:** Supports left and right-aligned groups for navigation, context, and actions.\n- **Menu Button:** Optional menu button for opening navigation drawers or sidebars; can be styled as wide or regular.\n- **App Icon Slot:** Customizable slot for displaying an application or brand icon.\n- **App Title & Page Name:** Displays the current application and page context.\n- **Breadcrumbs:** Optional breadcrumb navigation for hierarchical context (in settings mode).\n- **Command Button Slot:** Slot for inserting a primary command/action button.\n- **Alert/Notification Area:** Slot for alert indicators, notification badges, or custom alert components.\n- **Dimming Button:** Optional button for toggling display modes (e.g., day/night).\n- **User/Profile Button:** Optional user icon for profile/account actions.\n- **Apps Button:** Optional button for accessing additional applications or modules.\n- **Clock & Date:** Optional digital clock and date display, responsive to screen size.\n- **Responsive Layout:** Multiple breakpoint properties to control visibility and layout of elements based on viewport width.\n- **Settings Mode:** Special mode with close, back, and forward navigation, breadcrumbs, and app title.\n- **Tall Variant:** Optional increased height for touch or accessibility needs.\n- **Inactive State:** Disables interactive elements and visually de-emphasizes the bar.\n\n## Variants\n- **Regular:** Standard top bar with menu, app icon, title, page name, and action slots.\n- **Settings:** Shows close, back, forward buttons, breadcrumbs, and app title for configuration or settings screens.\n- **Inactive:** Visually muted and disables interaction (e.g., when the app is locked or in a modal state).\n- **Tall:** Increases the height of the bar for improved touch targets.\n\n## Usage Guidelines\nUse `<obc-top-bar>` as the persistent header for your application, providing navigation, context, and quick access to key actions or status. Configure which elements appear via boolean properties and slots. Adjust breakpoint properties to control responsive behavior for each section.\n\n- Place navigation, branding, and context (title, breadcrumbs) on the left; actions, alerts, and status (clock, user, apps) on the right.\n- Use the `settings` property for configuration or setup screens to enable close/back/forward navigation and breadcrumbs.\n- Use the `inactive` property to visually disable the bar and its actions when the app is not interactive.\n- Insert custom icons or buttons using the `app-icon` and `command-button` slots.\n- Use the `alerts` slot to display alert indicators, notification badges, or custom alert components.\n\n**TODO(designer):** Clarify recommended combinations of visible elements for different app contexts (e.g., when to show both user and apps buttons, or best practices for alert placement).\n\n## Slots\n\n| Slot Name | Renders When... | Purpose |\n|------------------|---------------------------------|----------------------------------------------------------------|\n| `app-icon` | `showAppIcon` is true | Custom icon representing the application or brand. |\n| `command-button` | Always (if provided) | Primary command or action button for the current context. |\n| `alerts` | Always (if provided) | Area for alert indicators, notification badges, or alert items.|\n| `clock` | Always (if provided) | Clock component for displaying the current time. |\n\n## Events\n- `menu-button-clicked` – Fired when the menu button is clicked.\n- `dimming-button-clicked` – Fired when the dimming (day/night) button is clicked.\n- `apps-button-clicked` – Fired when the apps button is clicked.\n- `more-button-clicked` – Fired when the more button is clicked.\n- `left-more-button-clicked` – Deprecated alias of `more-button-clicked`, fired with it; removed in 4.0.0.\n- `user-button-clicked` – Fired when the user/profile button is clicked.\n- `close` – Fired in settings mode when the close button is clicked.\n- `back` – Fired in settings mode when the back button is clicked.\n- `forward` – Fired in settings mode when the forward button is clicked.\n- `emergency-brightness-start` – Fired when the menu button is held for 500ms. This should increase the brightness of the screen slowly. Used when the screen is too dark.\n- `emergency-brightness-stop` – Fired when the menu button is released.\n\n## Keyboard\nEvery control in the bar is its own tab stop and activates on `Enter` and\n`Space`. The bar is a navigation landmark, not an APG toolbar: its controls\nare separate components and slotted consumer content, so a roving tabindex\nacross them is deliberately not implemented. The emergency-brightness hold\nis a pointer gesture only; from the keyboard the menu button opens the menu.\n\n## Best Practices and Constraints\n- Only show interactive elements relevant to the current context to avoid clutter.\n- Use the `alerts` slot for transient or critical notifications; persistent alerts may require a different component.\n- For accessibility, give all interactive elements labels and focus handling.\n- Adjust breakpoint properties to optimize the layout for different device sizes.\n- In settings mode, use breadcrumbs to provide clear navigation context.\n\n## Example\n\n```html\n<obc-top-bar\n appTitle=\"My App\"\n pageName=\"Dashboard\"\n showAppsButton\n showDimmingButton\n showClock\n showUserButton\n showAppIcon\n>\n <obi-placeholder slot=\"app-icon\"></obi-placeholder>\n <obc-command-button slot=\"command-button\"></obc-command-button>\n <obc-topbar-message-item slot=\"alerts\"></obc-topbar-message-item>\n <obc-clock slot=\"clock\"></obc-clock>\n</obc-top-bar>\n```",
|
|
91213
91322
|
"name": "ObcTopBar",
|
|
91323
|
+
"cssParts": [
|
|
91324
|
+
{
|
|
91325
|
+
"description": "The more button shown below the breakpoints.",
|
|
91326
|
+
"name": "more-button"
|
|
91327
|
+
},
|
|
91328
|
+
{
|
|
91329
|
+
"description": "Deprecated alias of the `more-button` part; removed in 4.0.0.",
|
|
91330
|
+
"name": "left-more-button"
|
|
91331
|
+
}
|
|
91332
|
+
],
|
|
91214
91333
|
"slots": [
|
|
91215
91334
|
{
|
|
91216
91335
|
"description": "Custom icon representing the application or brand (shown when `showAppIcon` is true)",
|
|
@@ -91297,19 +91416,28 @@
|
|
|
91297
91416
|
},
|
|
91298
91417
|
{
|
|
91299
91418
|
"kind": "field",
|
|
91300
|
-
"name": "
|
|
91419
|
+
"name": "moreButtonActivated",
|
|
91301
91420
|
"type": {
|
|
91302
91421
|
"text": "boolean"
|
|
91303
91422
|
},
|
|
91304
91423
|
"default": "false",
|
|
91305
|
-
"description": "Highlights the
|
|
91306
|
-
"attribute": "
|
|
91424
|
+
"description": "Highlights the more button as active.\n\nAvailable when `inactive==false`.",
|
|
91425
|
+
"attribute": "moreButtonActivated",
|
|
91307
91426
|
"availableWhen": "inactive==false",
|
|
91308
91427
|
"availableWhenIf": {
|
|
91309
91428
|
"arg": "inactive",
|
|
91310
91429
|
"truthy": false
|
|
91311
91430
|
}
|
|
91312
91431
|
},
|
|
91432
|
+
{
|
|
91433
|
+
"kind": "field",
|
|
91434
|
+
"name": "leftMoreButtonActivated",
|
|
91435
|
+
"type": {
|
|
91436
|
+
"text": "boolean | undefined"
|
|
91437
|
+
},
|
|
91438
|
+
"deprecated": "Use `moreButtonActivated`. Removed in 4.0.0.",
|
|
91439
|
+
"attribute": "leftMoreButtonActivated"
|
|
91440
|
+
},
|
|
91313
91441
|
{
|
|
91314
91442
|
"kind": "field",
|
|
91315
91443
|
"name": "userButtonActivated",
|
|
@@ -91510,7 +91638,7 @@
|
|
|
91510
91638
|
},
|
|
91511
91639
|
{
|
|
91512
91640
|
"kind": "method",
|
|
91513
|
-
"name": "
|
|
91641
|
+
"name": "moreButtonClicked",
|
|
91514
91642
|
"privacy": "private"
|
|
91515
91643
|
},
|
|
91516
91644
|
{
|
|
@@ -91614,12 +91742,19 @@
|
|
|
91614
91742
|
},
|
|
91615
91743
|
"description": "Fired when the apps button is clicked"
|
|
91616
91744
|
},
|
|
91745
|
+
{
|
|
91746
|
+
"name": "more-button-clicked",
|
|
91747
|
+
"type": {
|
|
91748
|
+
"text": "CustomEvent"
|
|
91749
|
+
},
|
|
91750
|
+
"description": "Fired when the more button is clicked"
|
|
91751
|
+
},
|
|
91617
91752
|
{
|
|
91618
91753
|
"name": "left-more-button-clicked",
|
|
91619
91754
|
"type": {
|
|
91620
91755
|
"text": "CustomEvent"
|
|
91621
91756
|
},
|
|
91622
|
-
"description": "Fired
|
|
91757
|
+
"description": "Deprecated: listen to `more-button-clicked` instead. Fired together with it; removed in 4.0.0."
|
|
91623
91758
|
},
|
|
91624
91759
|
{
|
|
91625
91760
|
"name": "user-button-clicked",
|
|
@@ -91723,12 +91858,20 @@
|
|
|
91723
91858
|
"fieldName": "appsButtonActivated"
|
|
91724
91859
|
},
|
|
91725
91860
|
{
|
|
91726
|
-
"name": "
|
|
91861
|
+
"name": "moreButtonActivated",
|
|
91727
91862
|
"type": {
|
|
91728
91863
|
"text": "boolean"
|
|
91729
91864
|
},
|
|
91730
91865
|
"default": "false",
|
|
91731
|
-
"description": "Highlights the
|
|
91866
|
+
"description": "Highlights the more button as active.\n\nAvailable when `inactive==false`.",
|
|
91867
|
+
"fieldName": "moreButtonActivated"
|
|
91868
|
+
},
|
|
91869
|
+
{
|
|
91870
|
+
"name": "leftMoreButtonActivated",
|
|
91871
|
+
"type": {
|
|
91872
|
+
"text": "boolean | undefined"
|
|
91873
|
+
},
|
|
91874
|
+
"deprecated": "Use `moreButtonActivated`. Removed in 4.0.0.",
|
|
91732
91875
|
"fieldName": "leftMoreButtonActivated"
|
|
91733
91876
|
},
|
|
91734
91877
|
{
|
|
@@ -124,6 +124,8 @@ export declare class ObcIconButton extends LitElement {
|
|
|
124
124
|
focusable: boolean;
|
|
125
125
|
/** Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary. */
|
|
126
126
|
ariaLabel: string | null;
|
|
127
|
+
/** Focus lands on the button inside, not on the host. */
|
|
128
|
+
focus(options?: FocusOptions): void;
|
|
127
129
|
get progressSpinner(): import('lit-html').TemplateResult<1> | typeof nothing;
|
|
128
130
|
render(): import('lit-html').TemplateResult<1>;
|
|
129
131
|
static styles: import('lit').CSSResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAQ,OAAO,EAAY,MAAM,KAAK,CAAC;AAQzD;;;;;;GAMG;AACH,oBAAY,iBAAiB;IAC3B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAA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EAAE,SAAS,GAAG,MAAM,CAAa;IAExC,QAAQ,EAAE,OAAO,CAAS;IAER,WAAW,UAAQ;IAEnB,SAAS,UAAQ;IAIrD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEzC,yDAAyD;IACzC,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAInD,IAAI,eAAe,0DAoDlB;IAEQ,MAAM;IAqCf,OAAgB,MAAM,0BAAwB;CAC/C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}
|
|
@@ -37,6 +37,10 @@ var ObcIconButton = class ObcIconButton extends LitElement {
|
|
|
37
37
|
this.focusable = true;
|
|
38
38
|
this.ariaLabel = null;
|
|
39
39
|
}
|
|
40
|
+
/** Focus lands on the button inside, not on the host. */
|
|
41
|
+
focus(options) {
|
|
42
|
+
this.shadowRoot?.querySelector("button")?.focus(options);
|
|
43
|
+
}
|
|
40
44
|
get progressSpinner() {
|
|
41
45
|
if (this.progress === void 0) return nothing;
|
|
42
46
|
if (this.progress === 100) return html`<div class="progress-spinner">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.js","names":[],"sources":["../../../src/components/icon-button/icon-button.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport iconStyle from './icon-button.css?inline';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\nimport {customElement} from '../../decorator.js';\nimport {degToRad} from '../../svghelpers/math.js';\n\n/**\n * The available visual variants for `<obc-icon-button>`.\n * - `normal`: Standard appearance for most use cases.\n * - `raised`: Adds elevation/shadow for prominence.\n * - `flat`: Minimal, backgroundless style for subtle actions.\n * - `integration`: For use in Integration Bar components\n */\nexport enum IconButtonVariant {\n normal = 'normal',\n raised = 'raised',\n flat = 'flat',\n integration = 'integration',\n}\n\n/**\n * `<obc-icon-button>` – An icon-only or icon-with-label button for quick actions.\n *\n * Provides a compact, visually prominent button that displays an icon (and optionally a label) for triggering actions. Commonly used for toolbars, navigation, or contextual actions where space is limited and a recognizable icon can represent the function.\n *\n * Appears as a circular or rounded button with configurable visual styles, supporting progress indication and various layout adaptations.\n *\n * ## Features\n * - **Variants:**\n * - `normal` (default): Standard appearance for most use cases.\n * - `raised`: Adds elevation/shadow for prominence.\n * - `flat`: Minimal, backgroundless style for subtle actions.\n * - `integration`: For use in Integration Bar components\n * - **Progress Indicator:**\n * - Shows a circular progress spinner overlay when the `progress` property is set (0–100). Useful for indicating loading or ongoing actions.\n * - **Label Support:**\n * - Optionally displays a text label below the icon when `hasLabel` is true and content is provided in the `label` slot.\n * - **Corner Alignment:**\n * - `cornerLeft` and `cornerRight` adjust the button's border radius and alignment for flush placement at the start or end of a container.\n * - **Active State:**\n * - `activated` visually highlights the button as selected or toggled.\n * - `activeColor` applies an accent color for emphasis.\n * - **Wide Mode:**\n * - `wide` increases the button's width for easier touch targets or visual balance.\n * - **Disabled State:**\n * - `disabled` prevents interaction and visually dims the button.\n *\n * ## Usage Guidelines\n * - Use `obc-icon-button` for actions represented by icons, such as toolbars, navigation, or quick-access commands.\n * - Add a label (with `hasLabel` and the `label` slot) when clarity is needed or when icons alone may not be universally understood.\n * - Use the progress indicator for actions that take time, such as uploads or background processes.\n * - Prefer the `normal` variant for most cases; use `raised` to draw attention, and `flat` for less prominent or inline actions.\n * - For grouped or edge-aligned layouts, use `cornerLeft` or `cornerRight` to visually merge with container edges.\n * - Avoid using icon buttons for destructive or critical actions unless paired with clear feedback.\n * - **TODO(designer):** Clarify recommended icon sizes and when to use label vs. icon-only.\n *\n * ## Slots\n * | Slot Name | Renders When... | Purpose |\n * |-----------|---------------------|----------------------------------------------|\n * | (default) | Always | The icon to display (e.g., `<obi-search>`) |\n * | label | If `hasLabel` is set | Optional label text below the icon |\n *\n * ## Events\n * - Emits a standard `click` event (`onClick` handler in framework wrappers) when activated.\n *\n * ## Best Practices\n * - Ensure icons are clear and universally recognizable.\n * - For accessibility, provide an `aria-label` or descriptive label for the button's action.\n * - When using the progress indicator, avoid showing it for very short actions to prevent visual flicker.\n *\n * ## Example:\n * ```\n * <obc-icon-button variant=\"normal\">\n * <obi-search></obi-search>\n * </obc-icon-button>\n *\n * <obc-icon-button variant=\"normal\" hasLabel>\n * <obi-arrow></obi-arrow>\n * <span slot=\"label\">Next</span>\n * </obc-icon-button>\n * ```\n *\n * @property activated - Whether the button is in an activated (selected/toggled) state.\n * Visually highlights the button to indicate selection.\n * @property cornerLeft - If true, aligns the button to the left edge and removes left border radius.\n * Useful for grouping or edge-aligned layouts.\n * @property cornerRight - If true, aligns the button to the right edge and removes right border radius.\n * Useful for grouping or edge-aligned layouts.\n * @property activeColor - Applies an accent color to the button for emphasis.\n * Used to visually distinguish active or important actions.\n * @property wide - Increases the button's width for larger touch targets or visual balance.\n * @property disabled - Disables the button, preventing user interaction and dimming its appearance.\n * @property progress - Shows a circular progress indicator overlay when set (0–100).\n * Use to indicate ongoing actions or loading states.\n * If undefined, no progress indicator is shown.\n * @property hasLabel - If true, displays a label below the icon using the `label` slot.\n * @property showDivider - If false, and cornerLeft or cornerRight is true, the divider is not shown.\n * @property ariaLabel - Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary.\n * @property focusable - Whether the button is in the tab sequence. Turn it off for a button inside a\n * composite widget that owns the tab stop, and give the widget a key for the action.\n * @property variant - Visual style: `normal` (default) is the standard appearance, `raised` adds\n * a shadow, `flat` drops the background.\n * @slot - Icon slot (default): Place an icon such as <obi-search> here.\n * @slot label - Optional label shown below the icon when `hasLabel` is true.\n * @fires click - Fired when the button is clicked (if not disabled).\n * @stable\n */\n@customElement('obc-icon-button')\nexport class ObcIconButton extends LitElement {\n @property({type: String}) variant: IconButtonVariant =\n IconButtonVariant.normal;\n\n @property({type: Boolean}) activated = false;\n\n @property({type: Boolean}) cornerLeft = false;\n\n @property({type: Boolean}) cornerRight = false;\n\n @property({type: Boolean}) activeColor = false;\n\n @property({type: Boolean}) wide = false;\n\n @property({type: Boolean}) disabled = false;\n\n @property({type: Number}) progress: undefined | number = undefined;\n\n @property({type: Boolean}) hasLabel: boolean = false;\n\n @property({type: Boolean, attribute: false}) showDivider = true;\n\n @property({type: Boolean, attribute: false}) focusable = true;\n\n // Reactive so a consumer swapping the name (Play → Pause) re-renders the shadow button.\n @property({type: String, attribute: 'aria-label'})\n override ariaLabel: string | null = null;\n\n get progressSpinner() {\n if (this.progress === undefined) {\n return nothing;\n }\n if (this.progress === 100) {\n return html`<div class=\"progress-spinner\">\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"18\"\n stroke=\"#325B9A\"\n stroke-width=\"4\"\n fill=\"none\"\n />\n </svg>\n </div>`;\n }\n const angleRad = degToRad(this.progress * 0.95 * 3.6);\n const x = 20 + 18 * Math.sin(angleRad);\n const y = 20 - 18 * Math.cos(angleRad);\n const largeArcFlag = angleRad > Math.PI ? 1 : 0;\n return html`<div class=\"progress-spinner\">\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"18\"\n stroke=\"var(--container-backdrop-color)\"\n stroke-width=\"4\"\n fill=\"none\"\n />\n <path\n d=\"M18 2 A18 18 0 ${largeArcFlag} 1 ${x} ${y}\"\n stroke=\"var(--instrument-enhanced-secondary-color)\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n />\n </svg>\n </div>`;\n }\n\n override render() {\n return html`\n <button\n class=${classMap({\n wrapper: true,\n ['variant-' + this.variant]: true,\n activated: this.activated,\n 'corner-left': this.cornerLeft,\n 'corner-right': this.cornerRight,\n 'active-color': this.activeColor,\n 'has-label': this.hasLabel,\n wide: this.wide,\n progress: this.progress !== undefined,\n 'hide-divider': !this.showDivider,\n })}\n ?disabled=${this.disabled}\n aria-label=${ifDefined(this.ariaLabel ?? undefined)}\n tabindex=${ifDefined(this.focusable ? undefined : -1)}\n part=\"wrapper\"\n >\n ${this.progress !== undefined ? this.progressSpinner : nothing}\n <div class=\"visible-wrapper\" part=\"visible-wrapper\">\n <div class=\"icon\" part=\"icon\">\n <slot></slot>\n </div>\n </div>\n ${\n this.hasLabel\n ? html`<div class=\"label\" part=\"label\">\n <slot name=\"label\"></slot>\n </div>`\n : nothing\n }\n </button>\n `;\n }\n\n static override styles = unsafeCSS(iconStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-icon-button': ObcIconButton;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,IAAY,oBAAL,yBAAA,mBAAA;CACL,kBAAA,YAAA;CACA,kBAAA,YAAA;CACA,kBAAA,UAAA;CACA,kBAAA,iBAAA;;AACF,EAAA,CAAA,CAAA;AA0FO,IAAM,gBAAN,MAAM,sBAAsB,WAAW;;;;EAIL,KAAA,YAAA;EAEC,KAAA,aAAA;EAEC,KAAA,cAAA;EAEA,KAAA,cAAA;EAEP,KAAA,OAAA;EAEI,KAAA,WAAA;EAEmB,KAAA,WAAA,KAAA;EAEV,KAAA,WAAA;EAEY,KAAA,cAAA;EAEF,KAAA,YAAA;EAIrB,KAAA,YAAA;;CAEpC,IAAI,kBAAkB;EACpB,IAAI,KAAK,aAAa,KAAA,GACpB,OAAO;EAET,IAAI,KAAK,aAAa,KACpB,OAAO,IAAI;;;;;;;;;;;;;;;;;;EAmBb,MAAM,WAAW,SAAS,KAAK,WAAW,MAAO,GAAG;EACpD,MAAM,IAAI,KAAK,KAAK,KAAK,IAAI,QAAQ;EACrC,MAAM,IAAI,KAAK,KAAK,KAAK,IAAI,QAAQ;EAErC,OAAO,IAAI;;;;;;;;;;;;;;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AA,CAAA;AAExB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,cAAA,WAAA,YAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,cAAA,WAAA,YAAA,KAAA,CAAA;AAExB,WAAA,CAAA,SAAS;CAAC,MAAM;CAAS,WAAW;AAAK,CAAC,CAAA,GAAA,cAAA,WAAA,eAAA,KAAA,CAAA;AAE1C,WAAA,CAAA,SAAS;CAAC,MAAM;CAAS,WAAW;AAAK,CAAC,CAAA,GAAA,cAAA,WAAA,aAAA,KAAA,CAAA;AAG1C,WAAA,CAAA,SAAS;CAAC,MAAM;CAAQ,WAAW;AAAY,CAAC,CAAA,GAAA,cAAA,WAAA,aAAA,KAAA,CAAA;AA1BlD,gBAAA,WAAA,CAAA,cAAc,iBAAiB,CAAA,GAAA,aAAA"}
|
|
1
|
+
{"version":3,"file":"icon-button.js","names":[],"sources":["../../../src/components/icon-button/icon-button.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport iconStyle from './icon-button.css?inline';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\nimport {customElement} from '../../decorator.js';\nimport {degToRad} from '../../svghelpers/math.js';\n\n/**\n * The available visual variants for `<obc-icon-button>`.\n * - `normal`: Standard appearance for most use cases.\n * - `raised`: Adds elevation/shadow for prominence.\n * - `flat`: Minimal, backgroundless style for subtle actions.\n * - `integration`: For use in Integration Bar components\n */\nexport enum IconButtonVariant {\n normal = 'normal',\n raised = 'raised',\n flat = 'flat',\n integration = 'integration',\n}\n\n/**\n * `<obc-icon-button>` – An icon-only or icon-with-label button for quick actions.\n *\n * Provides a compact, visually prominent button that displays an icon (and optionally a label) for triggering actions. Commonly used for toolbars, navigation, or contextual actions where space is limited and a recognizable icon can represent the function.\n *\n * Appears as a circular or rounded button with configurable visual styles, supporting progress indication and various layout adaptations.\n *\n * ## Features\n * - **Variants:**\n * - `normal` (default): Standard appearance for most use cases.\n * - `raised`: Adds elevation/shadow for prominence.\n * - `flat`: Minimal, backgroundless style for subtle actions.\n * - `integration`: For use in Integration Bar components\n * - **Progress Indicator:**\n * - Shows a circular progress spinner overlay when the `progress` property is set (0–100). Useful for indicating loading or ongoing actions.\n * - **Label Support:**\n * - Optionally displays a text label below the icon when `hasLabel` is true and content is provided in the `label` slot.\n * - **Corner Alignment:**\n * - `cornerLeft` and `cornerRight` adjust the button's border radius and alignment for flush placement at the start or end of a container.\n * - **Active State:**\n * - `activated` visually highlights the button as selected or toggled.\n * - `activeColor` applies an accent color for emphasis.\n * - **Wide Mode:**\n * - `wide` increases the button's width for easier touch targets or visual balance.\n * - **Disabled State:**\n * - `disabled` prevents interaction and visually dims the button.\n *\n * ## Usage Guidelines\n * - Use `obc-icon-button` for actions represented by icons, such as toolbars, navigation, or quick-access commands.\n * - Add a label (with `hasLabel` and the `label` slot) when clarity is needed or when icons alone may not be universally understood.\n * - Use the progress indicator for actions that take time, such as uploads or background processes.\n * - Prefer the `normal` variant for most cases; use `raised` to draw attention, and `flat` for less prominent or inline actions.\n * - For grouped or edge-aligned layouts, use `cornerLeft` or `cornerRight` to visually merge with container edges.\n * - Avoid using icon buttons for destructive or critical actions unless paired with clear feedback.\n * - **TODO(designer):** Clarify recommended icon sizes and when to use label vs. icon-only.\n *\n * ## Slots\n * | Slot Name | Renders When... | Purpose |\n * |-----------|---------------------|----------------------------------------------|\n * | (default) | Always | The icon to display (e.g., `<obi-search>`) |\n * | label | If `hasLabel` is set | Optional label text below the icon |\n *\n * ## Events\n * - Emits a standard `click` event (`onClick` handler in framework wrappers) when activated.\n *\n * ## Best Practices\n * - Ensure icons are clear and universally recognizable.\n * - For accessibility, provide an `aria-label` or descriptive label for the button's action.\n * - When using the progress indicator, avoid showing it for very short actions to prevent visual flicker.\n *\n * ## Example:\n * ```\n * <obc-icon-button variant=\"normal\">\n * <obi-search></obi-search>\n * </obc-icon-button>\n *\n * <obc-icon-button variant=\"normal\" hasLabel>\n * <obi-arrow></obi-arrow>\n * <span slot=\"label\">Next</span>\n * </obc-icon-button>\n * ```\n *\n * @property activated - Whether the button is in an activated (selected/toggled) state.\n * Visually highlights the button to indicate selection.\n * @property cornerLeft - If true, aligns the button to the left edge and removes left border radius.\n * Useful for grouping or edge-aligned layouts.\n * @property cornerRight - If true, aligns the button to the right edge and removes right border radius.\n * Useful for grouping or edge-aligned layouts.\n * @property activeColor - Applies an accent color to the button for emphasis.\n * Used to visually distinguish active or important actions.\n * @property wide - Increases the button's width for larger touch targets or visual balance.\n * @property disabled - Disables the button, preventing user interaction and dimming its appearance.\n * @property progress - Shows a circular progress indicator overlay when set (0–100).\n * Use to indicate ongoing actions or loading states.\n * If undefined, no progress indicator is shown.\n * @property hasLabel - If true, displays a label below the icon using the `label` slot.\n * @property showDivider - If false, and cornerLeft or cornerRight is true, the divider is not shown.\n * @property ariaLabel - Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary.\n * @property focusable - Whether the button is in the tab sequence. Turn it off for a button inside a\n * composite widget that owns the tab stop, and give the widget a key for the action.\n * @property variant - Visual style: `normal` (default) is the standard appearance, `raised` adds\n * a shadow, `flat` drops the background.\n * @slot - Icon slot (default): Place an icon such as <obi-search> here.\n * @slot label - Optional label shown below the icon when `hasLabel` is true.\n * @fires click - Fired when the button is clicked (if not disabled).\n * @stable\n */\n@customElement('obc-icon-button')\nexport class ObcIconButton extends LitElement {\n @property({type: String}) variant: IconButtonVariant =\n IconButtonVariant.normal;\n\n @property({type: Boolean}) activated = false;\n\n @property({type: Boolean}) cornerLeft = false;\n\n @property({type: Boolean}) cornerRight = false;\n\n @property({type: Boolean}) activeColor = false;\n\n @property({type: Boolean}) wide = false;\n\n @property({type: Boolean}) disabled = false;\n\n @property({type: Number}) progress: undefined | number = undefined;\n\n @property({type: Boolean}) hasLabel: boolean = false;\n\n @property({type: Boolean, attribute: false}) showDivider = true;\n\n @property({type: Boolean, attribute: false}) focusable = true;\n\n // Reactive so a consumer swapping the name (Play → Pause) re-renders the shadow button.\n @property({type: String, attribute: 'aria-label'})\n override ariaLabel: string | null = null;\n\n /** Focus lands on the button inside, not on the host. */\n public override focus(options?: FocusOptions): void {\n this.shadowRoot?.querySelector('button')?.focus(options);\n }\n\n get progressSpinner() {\n if (this.progress === undefined) {\n return nothing;\n }\n if (this.progress === 100) {\n return html`<div class=\"progress-spinner\">\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"18\"\n stroke=\"#325B9A\"\n stroke-width=\"4\"\n fill=\"none\"\n />\n </svg>\n </div>`;\n }\n const angleRad = degToRad(this.progress * 0.95 * 3.6);\n const x = 20 + 18 * Math.sin(angleRad);\n const y = 20 - 18 * Math.cos(angleRad);\n const largeArcFlag = angleRad > Math.PI ? 1 : 0;\n return html`<div class=\"progress-spinner\">\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"18\"\n stroke=\"var(--container-backdrop-color)\"\n stroke-width=\"4\"\n fill=\"none\"\n />\n <path\n d=\"M18 2 A18 18 0 ${largeArcFlag} 1 ${x} ${y}\"\n stroke=\"var(--instrument-enhanced-secondary-color)\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n />\n </svg>\n </div>`;\n }\n\n override render() {\n return html`\n <button\n class=${classMap({\n wrapper: true,\n ['variant-' + this.variant]: true,\n activated: this.activated,\n 'corner-left': this.cornerLeft,\n 'corner-right': this.cornerRight,\n 'active-color': this.activeColor,\n 'has-label': this.hasLabel,\n wide: this.wide,\n progress: this.progress !== undefined,\n 'hide-divider': !this.showDivider,\n })}\n ?disabled=${this.disabled}\n aria-label=${ifDefined(this.ariaLabel ?? undefined)}\n tabindex=${ifDefined(this.focusable ? undefined : -1)}\n part=\"wrapper\"\n >\n ${this.progress !== undefined ? this.progressSpinner : nothing}\n <div class=\"visible-wrapper\" part=\"visible-wrapper\">\n <div class=\"icon\" part=\"icon\">\n <slot></slot>\n </div>\n </div>\n ${\n this.hasLabel\n ? html`<div class=\"label\" part=\"label\">\n <slot name=\"label\"></slot>\n </div>`\n : nothing\n }\n </button>\n `;\n }\n\n static override styles = unsafeCSS(iconStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-icon-button': ObcIconButton;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,IAAY,oBAAL,yBAAA,mBAAA;CACL,kBAAA,YAAA;CACA,kBAAA,YAAA;CACA,kBAAA,UAAA;CACA,kBAAA,iBAAA;;AACF,EAAA,CAAA,CAAA;AA0FO,IAAM,gBAAN,MAAM,sBAAsB,WAAW;;;;EAIL,KAAA,YAAA;EAEC,KAAA,aAAA;EAEC,KAAA,cAAA;EAEA,KAAA,cAAA;EAEP,KAAA,OAAA;EAEI,KAAA,WAAA;EAEmB,KAAA,WAAA,KAAA;EAEV,KAAA,WAAA;EAEY,KAAA,cAAA;EAEF,KAAA,YAAA;EAIrB,KAAA,YAAA;;;CAGpC,MAAsB,SAA8B;EAClD,KAAK,YAAY,cAAc,QAAQ,CAAC,EAAE,MAAM,OAAO;CACzD;CAEA,IAAI,kBAAkB;EACpB,IAAI,KAAK,aAAa,KAAA,GACpB,OAAO;EAET,IAAI,KAAK,aAAa,KACpB,OAAO,IAAI;;;;;;;;;;;;;;;;;;EAmBb,MAAM,WAAW,SAAS,KAAK,WAAW,MAAO,GAAG;EACpD,MAAM,IAAI,KAAK,KAAK,KAAK,IAAI,QAAQ;EACrC,MAAM,IAAI,KAAK,KAAK,KAAK,IAAI,QAAQ;EAErC,OAAO,IAAI;;;;;;;;;;;;;;;;;8BAD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A;AAExB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,cAAA,WAAA,YAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,cAAA,WAAA,YAAA,KAAA,CAAA;AAExB,WAAA,CAAA,SAAS;CAAC,MAAM;CAAS,WAAW;AAAK,CAAC,CAAA,GAAA,cAAA,WAAA,eAAA,KAAA,CAAA;AAE1C,WAAA,CAAA,SAAS;CAAC,MAAM;CAAS,WAAW;AAAK,CAAC,CAAA,GAAA,cAAA,WAAA,aAAA,KAAA,CAAA;AAG1C,WAAA,CAAA,SAAS;CAAC,MAAM;CAAQ,WAAW;AAAY,CAAC,CAAA,GAAA,cAAA,WAAA,aAAA,KAAA,CAAA;AA1BlD,gBAAA,WAAA,CAAA,cAAc,iBAAiB,CAAA,GAAA,aAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button.css.js","names":[],"sources":["../../../src/components/split-button/split-button.css?inline"],"sourcesContent":[".wrapper {\n position: relative;\n display: flex;\n align-items: stretch;\n width: fit-content;\n\n anchor-name: --split-button-anchor;\n\n &.full-width {\n width: 100%;\n }\n}\n\n.primary-button {\n flex: 1;\n}\n\n.primary-button::part(visible-wrapper) {\n border-right: none;\n flex: 1;\n}\n\n.primary-button::part(wrapper) {\n padding-left: var(--split-button-padding-left, 8px);\n display: flex;\n flex-grow: 1;\n}\n\n/* Context menu positioning */\n.positioned-menu {\n position: fixed;\n position-anchor: --split-button-anchor;\n left: calc(anchor(right) - var(--ui-components-button-touch-target-size));\n top: anchor(bottom);\n}\n\n.wrapper.open-top {\n .positioned-menu {\n bottom: anchor(top);\n top: unset;\n }\n}\n\n.dropdown-button::part(visible-wrapper) {\n box-sizing: border-box;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"split-button.css.js","names":[],"sources":["../../../src/components/split-button/split-button.css?inline"],"sourcesContent":[".wrapper {\n position: relative;\n display: flex;\n align-items: stretch;\n width: fit-content;\n\n anchor-name: --split-button-anchor;\n\n &.full-width {\n width: 100%;\n }\n}\n\n.primary-button {\n flex: 1;\n}\n\n.primary-button::part(visible-wrapper) {\n border-right: none;\n flex: 1;\n}\n\n.primary-button::part(wrapper) {\n padding-left: var(--split-button-padding-left, 8px);\n display: flex;\n flex-grow: 1;\n}\n\n/* Context menu positioning */\n.positioned-menu {\n position: fixed;\n position-anchor: --split-button-anchor;\n left: calc(anchor(right) - var(--ui-components-button-touch-target-size));\n top: anchor(bottom);\n}\n\n.wrapper.open-top {\n .positioned-menu {\n bottom: anchor(top);\n top: unset;\n }\n}\n\n.wrapper.open-left {\n .positioned-menu {\n right: anchor(right);\n left: unset;\n }\n}\n\n.dropdown-button::part(visible-wrapper) {\n box-sizing: border-box;\n}\n"],"mappings":""}
|
|
@@ -24,10 +24,11 @@ export type ObcSplitButtonChangeEvent = CustomEvent<{
|
|
|
24
24
|
* - **Multi-select and group selection:** Allows single or multiple selections in the dropdown, with optional grouping and per-group selection logic.
|
|
25
25
|
* - **Customizable menu content:** Accepts an array of options or column groups, supports icons, subtitles, and multi-column layouts for complex menus.
|
|
26
26
|
* - **Optional icon in primary button:** Add a leading icon to the main button using the `hasIcon` property and `icon` slot.
|
|
27
|
+
* - **Replaceable dropdown icon:** The dropdown button shows a chevron; fill the `dropdown-icon` slot to show another symbol, for example one that says what the menu holds.
|
|
27
28
|
* - **Title bar and menu title:** Optionally display a title bar with close button and custom title text in the dropdown.
|
|
28
29
|
* - **Full width mode:** Can stretch to fill its container using the `fullWidth` property.
|
|
29
|
-
* - **Disabled state:**
|
|
30
|
-
* - **Dropdown positioning:**
|
|
30
|
+
* - **Disabled state:** `disabled` disables both halves; `primaryDisabled` and `dropdownDisabled` disable one half each, so the primary action can be unavailable while the menu stays in use.
|
|
31
|
+
* - **Dropdown positioning:** The menu opens below the button and extends to the right. `openTop` opens it above and `openLeft` extends it to the left, for a button near the bottom or the right edge of its container.
|
|
31
32
|
* - **Selection persistence:** Optionally keeps the selected state visually persistent in the menu.
|
|
32
33
|
* - **Keyboard and pointer accessibility:** Follows standard button and menu accessibility patterns.
|
|
33
34
|
*
|
|
@@ -49,14 +50,25 @@ export type ObcSplitButtonChangeEvent = CustomEvent<{
|
|
|
49
50
|
* - **TODO(designer):** Confirm best practices for when to use multi-select vs. single-select, and any recommended limits on number of options or columns.
|
|
50
51
|
*
|
|
51
52
|
* ### Slots
|
|
52
|
-
* | Slot Name
|
|
53
|
-
*
|
|
54
|
-
* | `icon`
|
|
53
|
+
* | Slot Name | Renders When... | Purpose |
|
|
54
|
+
* |-----------------|---------------------|-----------------------------------------------------|
|
|
55
|
+
* | `icon` | `hasIcon` is true | Leading icon in the primary button (e.g., `<obi-placeholder></obi-placeholder>`) |
|
|
56
|
+
* | `dropdown-icon` | Always | Icon of the dropdown button; the chevron when empty |
|
|
55
57
|
*
|
|
56
58
|
* ### Events
|
|
57
59
|
* - `click` – Fired when either the primary or dropdown button is clicked. The event detail includes `{action: 'primary' | 'dropdown'}` to distinguish which part was activated.
|
|
58
60
|
* - `change` – Fired when the menu selection changes. The event detail includes `{selectedValues, selectedOptions}`.
|
|
59
61
|
*
|
|
62
|
+
* ### Keyboard
|
|
63
|
+
* The primary half is a plain button. The dropdown half follows the
|
|
64
|
+
* [APG Menu Button](https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/):
|
|
65
|
+
* `Enter` and `Space` open the menu, `ArrowDown` and `Home` open it on the
|
|
66
|
+
* first item, `ArrowUp` and `End` on the last, and `Escape` closes it and
|
|
67
|
+
* returns focus to the dropdown half. The menu is `obc-context-menu-input`.
|
|
68
|
+
*
|
|
69
|
+
* Left out: `Enter` and `Space` land on the selected item rather than the
|
|
70
|
+
* first, so a reopened selection menu starts where the user left it.
|
|
71
|
+
*
|
|
60
72
|
* ### Best Practices & Constraints
|
|
61
73
|
* - Only use multi-select when the menu type and use case require it; otherwise, prefer single selection for clarity.
|
|
62
74
|
* - Keep the primary action clear and distinct from dropdown actions.
|
|
@@ -107,13 +119,23 @@ export type ObcSplitButtonChangeEvent = CustomEvent<{
|
|
|
107
119
|
* When true, the component stretches horizontally.
|
|
108
120
|
* @property disabled - Whether both parts of the button are disabled.
|
|
109
121
|
* When true, disables both the primary and dropdown buttons.
|
|
122
|
+
* @property primaryDisabled - Disables the primary button alone, for an action the user
|
|
123
|
+
* cannot take right now while the menu stays in use, for example to ask for the access
|
|
124
|
+
* the action needs.
|
|
125
|
+
* @availableWhen primaryDisabled disabled==false
|
|
126
|
+
* @property dropdownDisabled - Disables the dropdown button alone, leaving the primary action.
|
|
127
|
+
* @availableWhen dropdownDisabled disabled==false
|
|
110
128
|
* @property openTop - Open context menu dropdown above (`true`) or below (`false`) the button.
|
|
111
129
|
* Useful for placement near the bottom of the viewport.
|
|
130
|
+
* @property openLeft - Extend the menu to the left of the dropdown button (`true`), its right
|
|
131
|
+
* edge on the button's right edge, instead of to the right. For a button near the right
|
|
132
|
+
* edge of its container; combines with `openTop`.
|
|
112
133
|
* @property columnGroups - Array of column group definitions for multi-column/grouped menus.
|
|
113
134
|
* Use instead of `options` for grouped or subtitle layouts.
|
|
114
135
|
* @availableWhen columnGroups menuType==MultiWithSubtitles
|
|
115
136
|
* @property dropdownLabel - Accessible name of the dropdown button; the chevron carries none.
|
|
116
137
|
* @slot icon - Leading icon for the primary button (shown when `hasIcon` is true)
|
|
138
|
+
* @slot dropdown-icon - Icon of the dropdown button; the chevron when empty.
|
|
117
139
|
* @fires {ObcSplitButtonClickEvent} click - Fired when the primary or dropdown button is clicked.
|
|
118
140
|
* @fires {ObcSplitButtonChangeEvent} change - Fired when the dropdown menu selection changes.
|
|
119
141
|
* @beta
|
|
@@ -153,8 +175,22 @@ export declare class ObcSplitButton extends LitElement {
|
|
|
153
175
|
fullWidth: boolean;
|
|
154
176
|
/** Whether both parts of the button are disabled. When true, disables both the primary and dropdown buttons. */
|
|
155
177
|
disabled: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Disables the primary button alone, for an action the user cannot take right now while the menu stays in use, for example to ask for the access the action needs.
|
|
180
|
+
*
|
|
181
|
+
* Available when `disabled==false`.
|
|
182
|
+
*/
|
|
183
|
+
primaryDisabled: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Disables the dropdown button alone, leaving the primary action.
|
|
186
|
+
*
|
|
187
|
+
* Available when `disabled==false`.
|
|
188
|
+
*/
|
|
189
|
+
dropdownDisabled: boolean;
|
|
156
190
|
/** Open context menu dropdown above (`true`) or below (`false`) the button. Useful for placement near the bottom of the viewport. */
|
|
157
191
|
openTop: boolean;
|
|
192
|
+
/** Extend the menu to the left of the dropdown button (`true`), its right edge on the button's right edge, instead of to the right. For a button near the right edge of its container; combines with `openTop`. */
|
|
193
|
+
openLeft: boolean;
|
|
158
194
|
/**
|
|
159
195
|
* Array of column group definitions for multi-column/grouped menus. Use instead of `options` for grouped or subtitle layouts.
|
|
160
196
|
*
|
|
@@ -166,6 +202,8 @@ export declare class ObcSplitButton extends LitElement {
|
|
|
166
202
|
private menuFocusStrategy;
|
|
167
203
|
private menu?;
|
|
168
204
|
private dropdownButton?;
|
|
205
|
+
private get isPrimaryDisabled();
|
|
206
|
+
private get isDropdownDisabled();
|
|
169
207
|
private handlePrimaryClick;
|
|
170
208
|
private handleDropdownClick;
|
|
171
209
|
private focusMenuAfterOpen;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button.d.ts","sourceRoot":"","sources":["../../../src/components/split-button/split-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAMzD,OAAO,yCAAyC,CAAC;AACjD,OAAO,qBAAqB,CAAC;AAC7B,OAAO,+BAA+B,CAAC;AACvC,OAAO,+BAA+B,CAAC;AACvC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,WAAW,EACZ,MAAM,6CAA6C,CAAC;AAGrD,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC;IACjD,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EAAE,CAAM;IAE7B,QAAQ,EAAE,eAAe,CAA2B;IAEnD,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,cAAc,CAAC,EAAE,OAAO,CAAC;IAE1B,cAAc,EAAE,MAAM,CAAK;IAE1B,WAAW,UAAS;IAErB,SAAS,SAAM;IAEf,aAAa,SAAkB;IAE9B,SAAS,UAAS;IAElB,QAAQ,UAAS;IAEjB,eAAe,UAAS;IAExB,gBAAgB,UAAS;IAEzB,OAAO,UAAS;IAEhB,QAAQ,UAAS;IAEnB,YAAY,EAAE,WAAW,EAAE,CAAM;IAEjD,OAAO,CAAC,cAAc,CAAS;IAExC,OAAO,CAAC,mBAAmB,CAAS;IAEpC,OAAO,CAAC,iBAAiB,CAA6C;IAErC,OAAO,CAAC,IAAI,CAAC,CAAsB;IAEzC,OAAO,CAAC,cAAc,CAAC,CAAc;IAEhE,OAAO,KAAK,iBAAiB,GAE5B;IAED,OAAO,KAAK,kBAAkB,GAE7B;IAED,OAAO,CAAC,kBAAkB,CAOxB;IAEF,OAAO,CAAC,mBAAmB,CAczB;YAEY,kBAAkB;IAkBhC,OAAO,CAAC,qBAAqB,CAmD3B;IAEF,OAAO,CAAC,cAAc,CAKpB;IAEF,OAAO,CAAC,mBAAmB,CAYzB;IAEF,OAAO,KAAK,aAAa,GAQxB;IAED,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,eAAe,CAUrB;IAEO,oBAAoB;IAKpB,MAAM;IAyEf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
|
|
@@ -24,7 +24,10 @@ var ObcSplitButton = class ObcSplitButton extends LitElement {
|
|
|
24
24
|
this.dropdownLabel = "More options";
|
|
25
25
|
this.fullWidth = false;
|
|
26
26
|
this.disabled = false;
|
|
27
|
+
this.primaryDisabled = false;
|
|
28
|
+
this.dropdownDisabled = false;
|
|
27
29
|
this.openTop = false;
|
|
30
|
+
this.openLeft = false;
|
|
28
31
|
this.columnGroups = [];
|
|
29
32
|
this.isDropdownOpen = false;
|
|
30
33
|
this.restoreFocusOnClose = false;
|
|
@@ -43,7 +46,7 @@ var ObcSplitButton = class ObcSplitButton extends LitElement {
|
|
|
43
46
|
} else window.removeEventListener("pointerdown", this.closeOnOutside);
|
|
44
47
|
};
|
|
45
48
|
this.handleDropdownKeydown = (event) => {
|
|
46
|
-
if (this.
|
|
49
|
+
if (this.isDropdownDisabled) return;
|
|
47
50
|
switch (event.key) {
|
|
48
51
|
case "ArrowDown":
|
|
49
52
|
event.preventDefault();
|
|
@@ -105,8 +108,15 @@ var ObcSplitButton = class ObcSplitButton extends LitElement {
|
|
|
105
108
|
});
|
|
106
109
|
};
|
|
107
110
|
}
|
|
111
|
+
get isPrimaryDisabled() {
|
|
112
|
+
return this.disabled || this.primaryDisabled;
|
|
113
|
+
}
|
|
114
|
+
get isDropdownDisabled() {
|
|
115
|
+
return this.disabled || this.dropdownDisabled;
|
|
116
|
+
}
|
|
108
117
|
async focusMenuAfterOpen() {
|
|
109
118
|
await this.updateComplete;
|
|
119
|
+
await this.menu?.updateComplete;
|
|
110
120
|
if (!this.isDropdownOpen) return;
|
|
111
121
|
if (this.menuFocusStrategy === "last") this.menu?.focusLastItem();
|
|
112
122
|
else if (this.menuFocusStrategy === "first") this.menu?.focusFirstItem();
|
|
@@ -138,7 +148,8 @@ var ObcSplitButton = class ObcSplitButton extends LitElement {
|
|
|
138
148
|
wrapper: true,
|
|
139
149
|
"full-width": this.fullWidth,
|
|
140
150
|
"is-open": this.isDropdownOpen,
|
|
141
|
-
"open-top": this.openTop
|
|
151
|
+
"open-top": this.openTop,
|
|
152
|
+
"open-left": this.openLeft
|
|
142
153
|
})}
|
|
143
154
|
>
|
|
144
155
|
<obc-button
|
|
@@ -146,7 +157,7 @@ var ObcSplitButton = class ObcSplitButton extends LitElement {
|
|
|
146
157
|
.variant=${"normal"}
|
|
147
158
|
.segmentPosition=${segmentPosition.start}
|
|
148
159
|
.showLeadingIcon=${this.hasIcon}
|
|
149
|
-
.disabled=${this.
|
|
160
|
+
.disabled=${this.isPrimaryDisabled}
|
|
150
161
|
@click=${this.handlePrimaryClick}
|
|
151
162
|
.fullWidth=${this.fullWidth}
|
|
152
163
|
>
|
|
@@ -158,7 +169,7 @@ var ObcSplitButton = class ObcSplitButton extends LitElement {
|
|
|
158
169
|
class="dropdown-button"
|
|
159
170
|
.variant=${"normal"}
|
|
160
171
|
.cornerRight=${true}
|
|
161
|
-
.disabled=${this.
|
|
172
|
+
.disabled=${this.isDropdownDisabled}
|
|
162
173
|
.activated=${this.isDropdownOpen}
|
|
163
174
|
aria-label=${this.dropdownLabel}
|
|
164
175
|
@click=${this.handleDropdownClick}
|
|
@@ -166,7 +177,11 @@ var ObcSplitButton = class ObcSplitButton extends LitElement {
|
|
|
166
177
|
aria-expanded=${this.isDropdownOpen}
|
|
167
178
|
aria-haspopup="menu"
|
|
168
179
|
>
|
|
169
|
-
<
|
|
180
|
+
<slot name="dropdown-icon">
|
|
181
|
+
<obi-arrow-flyout-google
|
|
182
|
+
aria-hidden="true"
|
|
183
|
+
></obi-arrow-flyout-google>
|
|
184
|
+
</slot>
|
|
170
185
|
</obc-icon-button>
|
|
171
186
|
|
|
172
187
|
<!-- Context Menu -->
|
|
@@ -207,7 +222,10 @@ __decorate([property({ type: String })], ObcSplitButton.prototype, "menuTitle",
|
|
|
207
222
|
__decorate([property({ type: String })], ObcSplitButton.prototype, "dropdownLabel", void 0);
|
|
208
223
|
__decorate([property({ type: Boolean })], ObcSplitButton.prototype, "fullWidth", void 0);
|
|
209
224
|
__decorate([property({ type: Boolean })], ObcSplitButton.prototype, "disabled", void 0);
|
|
225
|
+
__decorate([property({ type: Boolean })], ObcSplitButton.prototype, "primaryDisabled", void 0);
|
|
226
|
+
__decorate([property({ type: Boolean })], ObcSplitButton.prototype, "dropdownDisabled", void 0);
|
|
210
227
|
__decorate([property({ type: Boolean })], ObcSplitButton.prototype, "openTop", void 0);
|
|
228
|
+
__decorate([property({ type: Boolean })], ObcSplitButton.prototype, "openLeft", void 0);
|
|
211
229
|
__decorate([property({ type: Array })], ObcSplitButton.prototype, "columnGroups", void 0);
|
|
212
230
|
__decorate([state()], ObcSplitButton.prototype, "isDropdownOpen", void 0);
|
|
213
231
|
__decorate([query("obc-context-menu-input")], ObcSplitButton.prototype, "menu", void 0);
|