@oicl/openbridge-webcomponents 2.0.0-next.78 → 2.0.0-next.79
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 +77 -8
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +77 -5
- package/dist/components/input/input.d.ts +1 -0
- package/dist/components/input/input.d.ts.map +1 -0
- package/dist/components/input/input.js +2 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/pagination/pagination.d.ts +9 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -1
- package/dist/components/pagination/pagination.js +12 -2
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/slider/slider.d.ts +14 -1
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/slider/slider.js +17 -0
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/slider-double/slider-double.d.ts +17 -1
- package/dist/components/slider-double/slider-double.d.ts.map +1 -1
- package/dist/components/slider-double/slider-double.js +15 -0
- package/dist/components/slider-double/slider-double.js.map +1 -1
- package/dist/components/toggle-button-group/toggle-button-group.d.ts +4 -0
- package/dist/components/toggle-button-group/toggle-button-group.d.ts.map +1 -1
- package/dist/components/toggle-button-group/toggle-button-group.js +15 -3
- package/dist/components/toggle-button-group/toggle-button-group.js.map +1 -1
- package/dist/components/toggle-button-vertical-group/toggle-button-vertical-group.d.ts +4 -0
- package/dist/components/toggle-button-vertical-group/toggle-button-vertical-group.d.ts.map +1 -1
- package/dist/components/toggle-button-vertical-group/toggle-button-vertical-group.js +10 -3
- package/dist/components/toggle-button-vertical-group/toggle-button-vertical-group.js.map +1 -1
- package/dist/components/toggle-switch/toggle-switch.d.ts +2 -0
- package/dist/components/toggle-switch/toggle-switch.d.ts.map +1 -1
- package/dist/components/toggle-switch/toggle-switch.js +8 -0
- package/dist/components/toggle-switch/toggle-switch.js.map +1 -1
- package/package.json +1 -1
package/custom-elements.json
CHANGED
|
@@ -54326,7 +54326,7 @@
|
|
|
54326
54326
|
"declarations": [
|
|
54327
54327
|
{
|
|
54328
54328
|
"kind": "class",
|
|
54329
|
-
"description": "`obc-pagination` – page navigation component for traversing multi-page content.\n\nProvides accessible, keyboard-navigable controls for moving between pages of content, such as tables, lists, or document sets. Includes support for ARIA live region updates and multiple visual variants to fit different UI layouts.\n\nAppears as a horizontal set of navigation buttons (first, previous, next, last) and page indicators, adapting its layout based on the selected variant. Designed for scenarios where users need to move between discrete pages of content, such as paginated tables, search results, or step-based flows.\n\n## Features\n\n- **Variants:**\n - `regular` (default): Standard pagination with numbered page buttons and navigation arrows.\n - `flat`: Minimalist style with reduced elevation and flat toggle buttons.\n - `condensed`: Compact mode showing only progress indicator dots and navigation arrows, ideal for limited space.\n- **Navigation Controls:**\n - First, previous, next, and last page buttons, each with ARIA labels and disabled states when navigation is not possible.\n- **Page Indicators:**\n - Numbered toggle buttons for each page (regular/flat), or progress dots (condensed).\n- **Full Width Option:**\n - Expands the pagination controls to fill the container width for better alignment in wide layouts.\n- **Accessibility:**\n - ARIA live region announces current page for assistive technologies.\n - All controls are keyboard accessible.\n- **Responsive:**\n - Condensed variant adapts to smaller containers with a simplified indicator.\n\n## Usage Guidelines\n\nUse `obc-pagination` to allow users to navigate through paged content, such as tables, lists, or multi-step flows.\n- Choose the `regular` or `flat` variant for standard pagination at the bottom of a page or section.\n- Use the `condensed` variant when space is limited or when a minimal indicator is preferred.\n- Set the `pages` property to the total number of pages, and `currentPage` to the active page (1-based index).\n- The component disables navigation buttons automatically at the first and last page.\n\n**Best Practices:**\n- Only use pagination when content is split into discrete, sequential pages.\n- For infinite scroll or continuous loading, consider alternative navigation patterns.\n- Keep the number of visible page buttons reasonable (Material Design recommends limiting to avoid overwhelming the user).\n- Always provide clear feedback about the current page (the component announces this for screen readers).\n\n**TODO(designer):** Confirm if there are recommended maximums for number of pages, or if there are design guidelines for when to use condensed vs. flat vs. regular in specific contexts.\n\n## Example\n\n```html\n<obc-pagination\n variant=\"regular\"\n pages=\"5\"\n current-page=\"2\"\n></obc-pagination>\n```\n\n## Events\n\n- `value` – Fired when the current page changes (via user interaction).\n- `navigate` – Fired when a navigation arrow (first, previous, next, last) is clicked.",
|
|
54329
|
+
"description": "`obc-pagination` – page navigation component for traversing multi-page content.\n\nProvides accessible, keyboard-navigable controls for moving between pages of content, such as tables, lists, or document sets. Includes support for ARIA live region updates and multiple visual variants to fit different UI layouts.\n\nAppears as a horizontal set of navigation buttons (first, previous, next, last) and page indicators, adapting its layout based on the selected variant. Designed for scenarios where users need to move between discrete pages of content, such as paginated tables, search results, or step-based flows.\n\n## Features\n\n- **Variants:**\n - `regular` (default): Standard pagination with numbered page buttons and navigation arrows.\n - `flat`: Minimalist style with reduced elevation and flat toggle buttons.\n - `condensed`: Compact mode showing only progress indicator dots and navigation arrows, ideal for limited space.\n- **Navigation Controls:**\n - First, previous, next, and last page buttons, each with ARIA labels and disabled states when navigation is not possible.\n- **Page Indicators:**\n - Numbered toggle buttons for each page (regular/flat), or progress dots (condensed).\n- **Full Width Option:**\n - Expands the pagination controls to fill the container width for better alignment in wide layouts.\n- **Accessibility:**\n - ARIA live region announces current page for assistive technologies.\n - All controls are keyboard accessible.\n- **Responsive:**\n - Condensed variant adapts to smaller containers with a simplified indicator.\n\n## Usage Guidelines\n\nUse `obc-pagination` to allow users to navigate through paged content, such as tables, lists, or multi-step flows.\n- Choose the `regular` or `flat` variant for standard pagination at the bottom of a page or section.\n- Use the `condensed` variant when space is limited or when a minimal indicator is preferred.\n- Set the `pages` property to the total number of pages, and `currentPage` to the active page (1-based index).\n- The component disables navigation buttons automatically at the first and last page.\n\n**Best Practices:**\n- Only use pagination when content is split into discrete, sequential pages.\n- For infinite scroll or continuous loading, consider alternative navigation patterns.\n- Keep the number of visible page buttons reasonable (Material Design recommends limiting to avoid overwhelming the user).\n- Always provide clear feedback about the current page (the component announces this for screen readers).\n\n**TODO(designer):** Confirm if there are recommended maximums for number of pages, or if there are design guidelines for when to use condensed vs. flat vs. regular in specific contexts.\n\n## Example\n\n```html\n<obc-pagination\n variant=\"regular\"\n pages=\"5\"\n current-page=\"2\"\n></obc-pagination>\n```\n\n## Events\n\n- `value` – Fired when the current page changes (via user interaction).\n- `navigate` – Fired when a navigation arrow (first, previous, next, last) is clicked.\n- `select-page` – Fired when a specific page is selected.",
|
|
54330
54330
|
"name": "ObcPagination",
|
|
54331
54331
|
"members": [
|
|
54332
54332
|
{
|
|
@@ -54513,6 +54513,10 @@
|
|
|
54513
54513
|
{
|
|
54514
54514
|
"description": "{ObcPaginationNavigateEvent} Emitted when a navigation arrow is clicked.",
|
|
54515
54515
|
"name": "navigate"
|
|
54516
|
+
},
|
|
54517
|
+
{
|
|
54518
|
+
"description": "{ObcPaginationSelectPageEvent} Emitted when a specific page is selected.",
|
|
54519
|
+
"name": "select-page"
|
|
54516
54520
|
}
|
|
54517
54521
|
],
|
|
54518
54522
|
"attributes": [
|
|
@@ -58328,7 +58332,7 @@
|
|
|
58328
58332
|
"declarations": [
|
|
58329
58333
|
{
|
|
58330
58334
|
"kind": "class",
|
|
58331
|
-
"description": "`<obc-slider-double>` – A dual-thumb range slider for selecting a value interval within a defined range.\n\nThis component allows users to select a minimum and maximum value by dragging two thumbs along a horizontal track. It is commonly used for filtering or specifying ranges (such as price, speed, or time intervals) in forms and dashboards. The slider supports both interactive and read-only display modes, as well as visual variants for different UI needs.\n\nAppears with two draggable handles (thumbs) and labels showing the current low and high values. Optionally, icons can be placed at each end of the slider via slots.\n\n## Features\n- **Dual-thumb range selection:** Users can adjust both the lower and upper bounds of a numeric interval.\n- **Variants:**\n - **Normal:** Standard slider with compact styling.\n - **Enhanced:** Larger track and thumb for increased prominence or touch accessibility.\n - **NoInput:** Read-only mode; disables all user interaction and presents the current range as static.\n- **Configurable range:** Set minimum (`min`), maximum (`max`), and step size (`step`) for precise control.\n- **Step click adjustment:** Use `stepClick` to define increment/decrement amount for keyboard or button-based changes.\n- **Seeking mode:** Enable `allowSeeking` to let users jump to a value by clicking on the track, with smooth animated transitions controlled by `seekingSpeed`.\n- **Custom labels:** Display formatted value labels with unit (`labelUnit`), decimal precision (`labelDecimals`), and adjustable label width (`labelWidth`).\n- **Hug container option:** Remove spacing between slider and container edges with the `hugcontainer` attribute for seamless layout integration.\n- **Icon slots:** Add icons to the left and right ends of the slider using `icon-left` and `icon-right` slots.\n\n## Usage Guidelines\nUse `obc-slider-double` when you need users to specify a numeric range, such as filtering results by minimum and maximum values. Ideal for scenarios like:\n- Filtering items by price, speed, or other continuous values.\n- Selecting a time interval or threshold range.\n- Any UI where a bounded numeric interval is required.\n\nFor single-value selection, use a standard slider component instead. In read-only or summary views, use the `no-input` variant to display the selected range without allowing changes.\n\n**TODO(designer):** Confirm if there are recommended minimum thumb separation or constraints for usability, and if there are best practices for using the enhanced variant.\n\n## Slots\n\n| Slot Name | Renders When... | Purpose |\n|---------------|-------------------------------|------------------------------------------------------------------------------------------------------------------|\n| icon-left | Always | Icon or content at the left end of the slider. Example: `<obi-placeholder slot=\"icon-left\"></obi-placeholder>` |\n| icon-right | Always | Icon or content at the right end of the slider. Example: `<obi-placeholder slot=\"icon-right\"></obi-placeholder>` |\n| left-readout | `showLeftReadout` is true | Custom content for the left (low) readout label. Falls back to the formatted `low` value. |\n| right-readout | `showRightReadout` is true | Custom content for the right (high) readout label. Falls back to the formatted `high` value. |\n\n## Properties and Attributes\n- `low` (number): The current lower bound of the selected range.\n- `high` (number): The current upper bound of the selected range.\n- `min` (number): The minimum allowed value (default: 0).\n- `max` (number): The maximum allowed value (default: 100).\n- `step` (number): The increment for value changes (default: 1).\n- `stepClick` (number): Step size for keyboard or button-based changes (default: 10).\n- `variant` (`normal` | `enhanced` | `no-input`): Visual and interaction style (default: `normal`).\n- `allowSeeking` (boolean): If true, clicking the track animates the thumb to the clicked position.\n- `seekingSpeed` (number): Animation speed for seeking (default: 1/3, i.e., full range in 3 seconds).\n- `labelUnit` (string): Unit label appended to value labels (e.g., `\"%\"`, `\"kn\"`).\n- `labelDecimals` (number): Number of decimal places for value labels.\n- `labelWidth` (string): CSS width for value labels (e.g., `\"5ch\"`, `\"60px\"`).\n- `showLeftReadout` (boolean, property only): Show the left (low) readout label. Default `true`.\n- `showRightReadout` (boolean, property only): Show the right (high) readout label. Default `true`.\n- `hugcontainer` (attribute): If present, removes spacing between slider and container edges.\n\n## Events\n- `value` – Fired whenever the low or high value changes. Event detail contains `{low, high}`.\n\n## Best Practices and Constraints\n- Ensure `low` is always less than or equal to `high`; the component enforces this automatically.\n- For accessibility, provide clear labels and units so users understand the meaning of the range.\n- Use the `no-input` variant for summary or review screens where editing is not allowed.\n- When using `allowSeeking`, set an appropriate `seekingSpeed` for smooth but responsive thumb movement.\n- Avoid setting `step` too small for large ranges, as this may make precise selection difficult.\n\n## Example\n\n```html\n<obc-slider-double\n min=\"0\"\n max=\"100\"\n low=\"20\"\n high=\"80\"\n step=\"5\"\n label-unit=\"%\"\n label-decimals=\"0\"\n variant=\"enhanced\"\n allowSeeking\n>\n <obi-placeholder slot=\"icon-left\"></obi-placeholder>\n <obi-placeholder slot=\"icon-right\"></obi-placeholder>\n</obc-slider-double>\n```\n\nIn this example, the slider allows selection of a percentage range from 0 to 100, with 5% increments, enhanced styling, and seeking enabled.",
|
|
58335
|
+
"description": "`<obc-slider-double>` – A dual-thumb range slider for selecting a value interval within a defined range.\n\nThis component allows users to select a minimum and maximum value by dragging two thumbs along a horizontal track. It is commonly used for filtering or specifying ranges (such as price, speed, or time intervals) in forms and dashboards. The slider supports both interactive and read-only display modes, as well as visual variants for different UI needs.\n\nAppears with two draggable handles (thumbs) and labels showing the current low and high values. Optionally, icons can be placed at each end of the slider via slots.\n\n## Features\n- **Dual-thumb range selection:** Users can adjust both the lower and upper bounds of a numeric interval.\n- **Variants:**\n - **Normal:** Standard slider with compact styling.\n - **Enhanced:** Larger track and thumb for increased prominence or touch accessibility.\n - **NoInput:** Read-only mode; disables all user interaction and presents the current range as static.\n- **Configurable range:** Set minimum (`min`), maximum (`max`), and step size (`step`) for precise control.\n- **Step click adjustment:** Use `stepClick` to define increment/decrement amount for keyboard or button-based changes.\n- **Seeking mode:** Enable `allowSeeking` to let users jump to a value by clicking on the track, with smooth animated transitions controlled by `seekingSpeed`.\n- **Custom labels:** Display formatted value labels with unit (`labelUnit`), decimal precision (`labelDecimals`), and adjustable label width (`labelWidth`).\n- **Hug container option:** Remove spacing between slider and container edges with the `hugcontainer` attribute for seamless layout integration.\n- **Icon slots:** Add icons to the left and right ends of the slider using `icon-left` and `icon-right` slots.\n\n## Usage Guidelines\nUse `obc-slider-double` when you need users to specify a numeric range, such as filtering results by minimum and maximum values. Ideal for scenarios like:\n- Filtering items by price, speed, or other continuous values.\n- Selecting a time interval or threshold range.\n- Any UI where a bounded numeric interval is required.\n\nFor single-value selection, use a standard slider component instead. In read-only or summary views, use the `no-input` variant to display the selected range without allowing changes.\n\n**TODO(designer):** Confirm if there are recommended minimum thumb separation or constraints for usability, and if there are best practices for using the enhanced variant.\n\n## Slots\n\n| Slot Name | Renders When... | Purpose |\n|---------------|-------------------------------|------------------------------------------------------------------------------------------------------------------|\n| icon-left | Always | Icon or content at the left end of the slider. Example: `<obi-placeholder slot=\"icon-left\"></obi-placeholder>` |\n| icon-right | Always | Icon or content at the right end of the slider. Example: `<obi-placeholder slot=\"icon-right\"></obi-placeholder>` |\n| left-readout | `showLeftReadout` is true | Custom content for the left (low) readout label. Falls back to the formatted `low` value. |\n| right-readout | `showRightReadout` is true | Custom content for the right (high) readout label. Falls back to the formatted `high` value. |\n\n## Properties and Attributes\n- `low` (number): The current lower bound of the selected range.\n- `high` (number): The current upper bound of the selected range.\n- `min` (number): The minimum allowed value (default: 0).\n- `max` (number): The maximum allowed value (default: 100).\n- `step` (number): The increment for value changes (default: 1).\n- `stepClick` (number): Step size for keyboard or button-based changes (default: 10).\n- `variant` (`normal` | `enhanced` | `no-input`): Visual and interaction style (default: `normal`).\n- `allowSeeking` (boolean): If true, clicking the track animates the thumb to the clicked position.\n- `seekingSpeed` (number): Animation speed for seeking (default: 1/3, i.e., full range in 3 seconds).\n- `labelUnit` (string): Unit label appended to value labels (e.g., `\"%\"`, `\"kn\"`).\n- `labelDecimals` (number): Number of decimal places for value labels.\n- `labelWidth` (string): CSS width for value labels (e.g., `\"5ch\"`, `\"60px\"`).\n- `showLeftReadout` (boolean, property only): Show the left (low) readout label. Default `true`.\n- `showRightReadout` (boolean, property only): Show the right (high) readout label. Default `true`.\n- `hugcontainer` (attribute): If present, removes spacing between slider and container edges.\n\n## Events\n- `value` – Fired continuously whenever the low or high value changes during user interaction. Event detail contains `{low, high}`.\n- `change` – Fired only after user interaction completes (mouse release). Event detail contains `{low, high}`.\n\n## Best Practices and Constraints\n- Ensure `low` is always less than or equal to `high`; the component enforces this automatically.\n- For accessibility, provide clear labels and units so users understand the meaning of the range.\n- Use the `no-input` variant for summary or review screens where editing is not allowed.\n- When using `allowSeeking`, set an appropriate `seekingSpeed` for smooth but responsive thumb movement.\n- Avoid setting `step` too small for large ranges, as this may make precise selection difficult.\n\n## Example\n\n```html\n<obc-slider-double\n min=\"0\"\n max=\"100\"\n low=\"20\"\n high=\"80\"\n step=\"5\"\n label-unit=\"%\"\n label-decimals=\"0\"\n variant=\"enhanced\"\n allowSeeking\n>\n <obi-placeholder slot=\"icon-left\"></obi-placeholder>\n <obi-placeholder slot=\"icon-right\"></obi-placeholder>\n</obc-slider-double>\n```\n\nIn this example, the slider allows selection of a percentage range from 0 to 100, with 5% increments, enhanced styling, and seeking enabled.",
|
|
58332
58336
|
"name": "ObcSliderDouble",
|
|
58333
58337
|
"slots": [
|
|
58334
58338
|
{
|
|
@@ -58621,6 +58625,12 @@
|
|
|
58621
58625
|
"name": "onInput",
|
|
58622
58626
|
"description": "Handles input changes from the slider thumbs.\nUpdates the low and high values and emits the `value` event."
|
|
58623
58627
|
},
|
|
58628
|
+
{
|
|
58629
|
+
"kind": "method",
|
|
58630
|
+
"name": "fireChangeEvent",
|
|
58631
|
+
"privacy": "private",
|
|
58632
|
+
"description": "Fires the `change` event with the current low and high values."
|
|
58633
|
+
},
|
|
58624
58634
|
{
|
|
58625
58635
|
"kind": "field",
|
|
58626
58636
|
"name": "THUMB_WIDTH",
|
|
@@ -58820,6 +58830,10 @@
|
|
|
58820
58830
|
"text": "CustomEvent"
|
|
58821
58831
|
},
|
|
58822
58832
|
"description": "{ObcSliderDoubleValueEvent} - Fires when the value is changed"
|
|
58833
|
+
},
|
|
58834
|
+
{
|
|
58835
|
+
"description": "{ObcSliderDoubleChangeEvent} - Fires when user interaction completes",
|
|
58836
|
+
"name": "change"
|
|
58823
58837
|
}
|
|
58824
58838
|
],
|
|
58825
58839
|
"attributes": [
|
|
@@ -58976,7 +58990,7 @@
|
|
|
58976
58990
|
"declarations": [
|
|
58977
58991
|
{
|
|
58978
58992
|
"kind": "class",
|
|
58979
|
-
"description": "`<obc-slider>` – A horizontal slider component for selecting a numeric value within a defined range.\n\nProvides a visual and interactive way for users to adjust values such as volume, brightness, or other continuous settings. The slider supports optional step increments, left/right icon buttons for quick adjustments, and can be configured for read-only display or enhanced visual prominence.\n\nAppears as a horizontal track with a draggable thumb, and may include optional icon buttons on either side for increment/decrement actions. The component can be used for both direct manipulation (dragging the thumb) and discrete changes (via buttons).\n\n---\n\n### Features\n- **Variants:**\n - **Normal:** Standard slider with a slim track and thumb.\n - **Enhanced:** Larger track and thumb for improved accessibility and visual emphasis.\n - **No Input:** Read-only mode; disables all user interaction and presents the current value visually.\n- **Value Range:** Supports configurable `min`, `max`, and `step` properties for precise control over allowed values.\n- **Step Buttons:** Optional left and right icon buttons allow users to increment or decrement the value by a defined step (`stepClick`).\n- **Icons:** Custom icons can be slotted into the left and right button positions for contextual meaning (e.g., `<obi-arrow></obi-arrow>, <obi-placeholder></obi-placeholder>`).\n- **Seeking:** When `allowSeeking` is enabled, users can click or drag along the track to set the value, with smooth animated transitions based on `seekingSpeed`.\n- **Hug Container:** The `hugcontainer` attribute removes spacing between the slider and its icon buttons, allowing for a compact layout.\n- **Accessibility:** Underlying input is a native `<input type=\"range\">` for keyboard and screen reader support.\n\n---\n\n### Usage Guidelines\nUse `obc-slider` when you need users to select or adjust a value within a continuous or stepped range, such as for volume, brightness, or similar controls. The enhanced variant is suitable for scenarios where the slider is a primary control or needs to be more visually prominent. The no-input variant is ideal for displaying a value without allowing user changes.\n\n- For discrete, step-based changes, provide `step` and/or `stepClick` values.\n- Use left/right icons to clarify the meaning of the adjustment (e.g., low/high, decrease/increase).\n- Enable `allowSeeking` for scenarios where users should be able to jump to a specific value by clicking the track.\n- Use `hugcontainer` when the slider should visually connect tightly with its icon buttons.\n\n**TODO(designer):** Clarify recommended use cases for each variant and when to use `allowSeeking` vs. standard interaction.\n\n---\n\n### Slots\n\n| Slot Name | Renders When... | Purpose |\n|-------------|---------------------------|--------------------------------------------|\n| icon-left | `hasLeftIcon` is true | Icon/button for decrement action |\n| icon-right | `hasRightIcon` is true | Icon/button for increment action |\n\n---\n\n### Properties and Attributes\n- `value` (number): Current slider value. Updates as the user interacts.\n- `min` (number): Minimum allowed value (default: 0).\n- `max` (number): Maximum allowed value (default: 100).\n- `step` (number): Step granularity for value changes (optional).\n- `stepClick` (number): Amount to increment/decrement when clicking icon buttons (default: 10).\n- `variant` (ObcSliderVariant): Visual/interaction style (`normal`, `enhanced`, `no-input`). Default: `normal`.\n- `hasLeftIcon`/`hasRightIcon` (boolean): Show icon button on left/right.\n- `allowSeeking` (boolean): Enables animated seeking to clicked value on the track.\n- `seekingSpeed` (number): Animation speed for seeking (default: 1/3; higher is faster).\n- `hugcontainer` (attribute): Removes spacing between slider and icon buttons for a compact layout.\n\n---\n\n### Events\n- `value` – Fired when the slider value changes
|
|
58993
|
+
"description": "`<obc-slider>` – A horizontal slider component for selecting a numeric value within a defined range.\n\nProvides a visual and interactive way for users to adjust values such as volume, brightness, or other continuous settings. The slider supports optional step increments, left/right icon buttons for quick adjustments, and can be configured for read-only display or enhanced visual prominence.\n\nAppears as a horizontal track with a draggable thumb, and may include optional icon buttons on either side for increment/decrement actions. The component can be used for both direct manipulation (dragging the thumb) and discrete changes (via buttons).\n\n---\n\n### Features\n- **Variants:**\n - **Normal:** Standard slider with a slim track and thumb.\n - **Enhanced:** Larger track and thumb for improved accessibility and visual emphasis.\n - **No Input:** Read-only mode; disables all user interaction and presents the current value visually.\n- **Value Range:** Supports configurable `min`, `max`, and `step` properties for precise control over allowed values.\n- **Step Buttons:** Optional left and right icon buttons allow users to increment or decrement the value by a defined step (`stepClick`).\n- **Icons:** Custom icons can be slotted into the left and right button positions for contextual meaning (e.g., `<obi-arrow></obi-arrow>, <obi-placeholder></obi-placeholder>`).\n- **Seeking:** When `allowSeeking` is enabled, users can click or drag along the track to set the value, with smooth animated transitions based on `seekingSpeed`.\n- **Hug Container:** The `hugcontainer` attribute removes spacing between the slider and its icon buttons, allowing for a compact layout.\n- **Accessibility:** Underlying input is a native `<input type=\"range\">` for keyboard and screen reader support.\n\n---\n\n### Usage Guidelines\nUse `obc-slider` when you need users to select or adjust a value within a continuous or stepped range, such as for volume, brightness, or similar controls. The enhanced variant is suitable for scenarios where the slider is a primary control or needs to be more visually prominent. The no-input variant is ideal for displaying a value without allowing user changes.\n\n- For discrete, step-based changes, provide `step` and/or `stepClick` values.\n- Use left/right icons to clarify the meaning of the adjustment (e.g., low/high, decrease/increase).\n- Enable `allowSeeking` for scenarios where users should be able to jump to a specific value by clicking the track.\n- Use `hugcontainer` when the slider should visually connect tightly with its icon buttons.\n\n**TODO(designer):** Clarify recommended use cases for each variant and when to use `allowSeeking` vs. standard interaction.\n\n---\n\n### Slots\n\n| Slot Name | Renders When... | Purpose |\n|-------------|---------------------------|--------------------------------------------|\n| icon-left | `hasLeftIcon` is true | Icon/button for decrement action |\n| icon-right | `hasRightIcon` is true | Icon/button for increment action |\n\n---\n\n### Properties and Attributes\n- `value` (number): Current slider value. Updates as the user interacts.\n- `min` (number): Minimum allowed value (default: 0).\n- `max` (number): Maximum allowed value (default: 100).\n- `step` (number): Step granularity for value changes (optional).\n- `stepClick` (number): Amount to increment/decrement when clicking icon buttons (default: 10).\n- `variant` (ObcSliderVariant): Visual/interaction style (`normal`, `enhanced`, `no-input`). Default: `normal`.\n- `hasLeftIcon`/`hasRightIcon` (boolean): Show icon button on left/right.\n- `allowSeeking` (boolean): Enables animated seeking to clicked value on the track.\n- `seekingSpeed` (number): Animation speed for seeking (default: 1/3; higher is faster).\n- `hugcontainer` (attribute): Removes spacing between slider and icon buttons for a compact layout.\n\n---\n\n### Events\n- `value` – Fired continuously when the slider value changes during user interaction or programmatically. The event detail contains the new value as a number.\n- `change` – Fired only after user interaction completes (mouse/touch release or button click). The event detail contains the new value as a number.\n\n---\n\n### Best Practices & Constraints\n- Only use `no-input` variant for read-only display; interactive controls should use `normal` or `enhanced`.\n- For accessibility, ensure the slider has a visible label or context.\n- Use step values that make sense for the range (e.g., avoid step=0.01 for a 0–10 range unless fine granularity is needed).\n- When using icon buttons, provide icons that clearly indicate their function.\n- The slider is horizontal only; for vertical sliders, use a different component.\n\n---\n\n### Example\n\n```html\n<obc-slider\n value=\"40\"\n min=\"0\"\n max=\"100\"\n step=\"10\"\n haslefticon\n hasrighticon\n variant=\"enhanced\"\n>\n <obi-arrow slot=\"icon-left\"></obi-arrow>\n <obi-arrow slot=\"icon-right\"></obi-arrow>\n</obc-slider>\n```\n\nIn this example, the slider allows selection from 0 to 100 in steps of 10, with left/right arrow icons for quick adjustments.",
|
|
58980
58994
|
"name": "ObcSlider",
|
|
58981
58995
|
"slots": [
|
|
58982
58996
|
{
|
|
@@ -59178,6 +59192,12 @@
|
|
|
59178
59192
|
],
|
|
59179
59193
|
"description": "Handles input changes from the slider or buttons.\nFires the `value` event with the new value."
|
|
59180
59194
|
},
|
|
59195
|
+
{
|
|
59196
|
+
"kind": "method",
|
|
59197
|
+
"name": "fireChangeEvent",
|
|
59198
|
+
"privacy": "private",
|
|
59199
|
+
"description": "Fires the `change` event with the current value."
|
|
59200
|
+
},
|
|
59181
59201
|
{
|
|
59182
59202
|
"kind": "method",
|
|
59183
59203
|
"name": "onReduceClick",
|
|
@@ -59323,6 +59343,10 @@
|
|
|
59323
59343
|
"text": "CustomEvent"
|
|
59324
59344
|
},
|
|
59325
59345
|
"description": "{ObcSliderValueEvent} - Fired when the value is changed"
|
|
59346
|
+
},
|
|
59347
|
+
{
|
|
59348
|
+
"description": "{ObcSliderChangeEvent} - Fired when user interaction completes and value has changed",
|
|
59349
|
+
"name": "change"
|
|
59326
59350
|
}
|
|
59327
59351
|
],
|
|
59328
59352
|
"attributes": [
|
|
@@ -65266,11 +65290,18 @@
|
|
|
65266
65290
|
}
|
|
65267
65291
|
},
|
|
65268
65292
|
{
|
|
65269
|
-
"name": "
|
|
65293
|
+
"name": "emitValueEvent",
|
|
65270
65294
|
"default": "true",
|
|
65271
65295
|
"type": {
|
|
65272
65296
|
"text": "boolean"
|
|
65273
65297
|
}
|
|
65298
|
+
},
|
|
65299
|
+
{
|
|
65300
|
+
"name": "emitChangeEvent",
|
|
65301
|
+
"default": "false",
|
|
65302
|
+
"type": {
|
|
65303
|
+
"text": "boolean"
|
|
65304
|
+
}
|
|
65274
65305
|
}
|
|
65275
65306
|
]
|
|
65276
65307
|
},
|
|
@@ -65323,6 +65354,13 @@
|
|
|
65323
65354
|
"text": "CustomEvent"
|
|
65324
65355
|
},
|
|
65325
65356
|
"description": "{CustomEvent<{value: string, previousValue: string}>} Fired when the selected value changes."
|
|
65357
|
+
},
|
|
65358
|
+
{
|
|
65359
|
+
"name": "change",
|
|
65360
|
+
"type": {
|
|
65361
|
+
"text": "CustomEvent"
|
|
65362
|
+
},
|
|
65363
|
+
"description": "{CustomEvent<{value: string}>} Fired when the selected value changes by user interaction."
|
|
65326
65364
|
}
|
|
65327
65365
|
],
|
|
65328
65366
|
"attributes": [
|
|
@@ -65930,11 +65968,18 @@
|
|
|
65930
65968
|
}
|
|
65931
65969
|
},
|
|
65932
65970
|
{
|
|
65933
|
-
"name": "
|
|
65971
|
+
"name": "emitValueEvent",
|
|
65934
65972
|
"default": "true",
|
|
65935
65973
|
"type": {
|
|
65936
65974
|
"text": "boolean"
|
|
65937
65975
|
}
|
|
65976
|
+
},
|
|
65977
|
+
{
|
|
65978
|
+
"name": "emitChangeEvent",
|
|
65979
|
+
"default": "false",
|
|
65980
|
+
"type": {
|
|
65981
|
+
"text": "boolean"
|
|
65982
|
+
}
|
|
65938
65983
|
}
|
|
65939
65984
|
]
|
|
65940
65985
|
},
|
|
@@ -65979,6 +66024,13 @@
|
|
|
65979
66024
|
"text": "CustomEvent"
|
|
65980
66025
|
},
|
|
65981
66026
|
"description": "{CustomEvent<{value: string, previousValue: string}>} Fired when the selected value changes."
|
|
66027
|
+
},
|
|
66028
|
+
{
|
|
66029
|
+
"name": "change",
|
|
66030
|
+
"type": {
|
|
66031
|
+
"text": "CustomEvent"
|
|
66032
|
+
},
|
|
66033
|
+
"description": "{CustomEvent<{value: string}>} Fired when the selected value changes by user interaction."
|
|
65982
66034
|
}
|
|
65983
66035
|
],
|
|
65984
66036
|
"attributes": [
|
|
@@ -66380,6 +66432,19 @@
|
|
|
66380
66432
|
}
|
|
66381
66433
|
],
|
|
66382
66434
|
"description": "Handles input events to change the toggle state.\nPrevents changes if the toggle is disabled."
|
|
66435
|
+
},
|
|
66436
|
+
{
|
|
66437
|
+
"kind": "method",
|
|
66438
|
+
"name": "_fireChangeEvent",
|
|
66439
|
+
"privacy": "private",
|
|
66440
|
+
"parameters": [
|
|
66441
|
+
{
|
|
66442
|
+
"name": "e",
|
|
66443
|
+
"type": {
|
|
66444
|
+
"text": "Event"
|
|
66445
|
+
}
|
|
66446
|
+
}
|
|
66447
|
+
]
|
|
66383
66448
|
}
|
|
66384
66449
|
],
|
|
66385
66450
|
"events": [
|
|
@@ -66389,6 +66454,13 @@
|
|
|
66389
66454
|
"text": "CustomEvent"
|
|
66390
66455
|
},
|
|
66391
66456
|
"description": "{ObcToggleSwitchInputEvent} Dispatched when the value of the input changes"
|
|
66457
|
+
},
|
|
66458
|
+
{
|
|
66459
|
+
"name": "change",
|
|
66460
|
+
"type": {
|
|
66461
|
+
"text": "CustomEvent"
|
|
66462
|
+
},
|
|
66463
|
+
"description": "Dispatched when the value of the input changes by user interaction"
|
|
66392
66464
|
}
|
|
66393
66465
|
],
|
|
66394
66466
|
"attributes": [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -34,6 +34,13 @@ export type ObcPaginationNavigateEvent = CustomEvent<{
|
|
|
34
34
|
action: 'first' | 'previous' | 'next' | 'last';
|
|
35
35
|
currentPage: number;
|
|
36
36
|
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Event fired when a page is selected.
|
|
39
|
+
* @event
|
|
40
|
+
*/
|
|
41
|
+
export type ObcPaginationSelectPageEvent = CustomEvent<{
|
|
42
|
+
page: number;
|
|
43
|
+
}>;
|
|
37
44
|
/**
|
|
38
45
|
* `obc-pagination` – page navigation component for traversing multi-page content.
|
|
39
46
|
*
|
|
@@ -89,9 +96,11 @@ export type ObcPaginationNavigateEvent = CustomEvent<{
|
|
|
89
96
|
*
|
|
90
97
|
* - `value` – Fired when the current page changes (via user interaction).
|
|
91
98
|
* - `navigate` – Fired when a navigation arrow (first, previous, next, last) is clicked.
|
|
99
|
+
* - `select-page` – Fired when a specific page is selected.
|
|
92
100
|
*
|
|
93
101
|
* @fires value {ObcPaginationValueChangeEvent} Emitted whenever the current page changes.
|
|
94
102
|
* @fires navigate {ObcPaginationNavigateEvent} Emitted when a navigation arrow is clicked.
|
|
103
|
+
* @fires select-page {ObcPaginationSelectPageEvent} Emitted when a specific page is selected.
|
|
95
104
|
*/
|
|
96
105
|
export declare class ObcPagination extends LitElement {
|
|
97
106
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAMhD,OAAO,iDAAiD,CAAC;AACzD,OAAO,+CAA+C,CAAC;AACvD,OAAO,+BAA+B,CAAC;AACvC,OAAO,uDAAuD,CAAC;AAC/D,OAAO,uCAAuC,CAAC;AAC/C,OAAO,yCAAyC,CAAC;AACjD,OAAO,0CAA0C,CAAC;AAClD,OAAO,sCAAsC,CAAC;AAG9C;;;;;;GAMG;AACH,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,SAAS,cAAc;CACxB;AAED;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC;AAEzE;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAAC;IACnD,MAAM,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/C,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AAEH
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAMhD,OAAO,iDAAiD,CAAC;AACzD,OAAO,+CAA+C,CAAC;AACvD,OAAO,+BAA+B,CAAC;AACvC,OAAO,uDAAuD,CAAC;AAC/D,OAAO,uCAAuC,CAAC;AAC/C,OAAO,yCAAyC,CAAC;AACjD,OAAO,0CAA0C,CAAC;AAClD,OAAO,sCAAsC,CAAC;AAG9C;;;;;;GAMG;AACH,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,S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EF,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,2BAA2B;IASnC,OAAO,CAAC,gBAAgB;IA6Df,MAAM;IAuBf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;CACF"}
|
|
@@ -36,7 +36,14 @@ let ObcPagination = class extends LitElement {
|
|
|
36
36
|
this.fullWidth = false;
|
|
37
37
|
this.disabled = false;
|
|
38
38
|
this.handlePageChange = (event) => {
|
|
39
|
-
this.setCurrentPage(Number(event.detail.value));
|
|
39
|
+
const success = this.setCurrentPage(Number(event.detail.value));
|
|
40
|
+
if (success) {
|
|
41
|
+
this.dispatchEvent(
|
|
42
|
+
new CustomEvent("select-page", {
|
|
43
|
+
detail: { page: Number(event.detail.value) }
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
}
|
|
40
47
|
};
|
|
41
48
|
this.handleFirstClick = () => {
|
|
42
49
|
if (!this.canNavigateFirst) return;
|
|
@@ -97,13 +104,16 @@ let ObcPagination = class extends LitElement {
|
|
|
97
104
|
}
|
|
98
105
|
setCurrentPage(newPage) {
|
|
99
106
|
const page = Math.max(1, Math.min(newPage, this.validatedPages));
|
|
100
|
-
if (page === this.currentPage)
|
|
107
|
+
if (page === this.currentPage) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
101
110
|
this.currentPage = page;
|
|
102
111
|
this.dispatchEvent(
|
|
103
112
|
new CustomEvent("value", {
|
|
104
113
|
detail: { value: page }
|
|
105
114
|
})
|
|
106
115
|
);
|
|
116
|
+
return true;
|
|
107
117
|
}
|
|
108
118
|
dispatchNavigateEvent(action) {
|
|
109
119
|
this.dispatchEvent(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sources":["../../../src/components/pagination/pagination.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {customElement} from '../../decorator.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport compentStyle from './pagination.css?inline';\n\nimport '../toggle-button-option/toggle-button-option.js';\nimport '../toggle-button-group/toggle-button-group.js';\nimport '../icon-button/icon-button.js';\nimport '../progress-indicator-dots/progress-indicator-dots.js';\nimport '../../icons/icon-page-first-google.js';\nimport '../../icons/icon-chevron-left-google.js';\nimport '../../icons/icon-chevron-right-google.js';\nimport '../../icons/icon-page-last-google.js';\nimport {ObcToggleButtonOptionVariant} from '../toggle-button-option/toggle-button-option.js';\n\n/**\n * Enumerates the supported style variants for the Pagination component.\n *\n * - `regular`: Default pagination styling.\n * - `flat`: Borderless, flat appearance.\n * - `condensed`: More compact layout for tighter spacing.\n */\nexport enum PaginationVariant {\n regular = 'regular',\n flat = 'flat',\n condensed = 'condensed',\n}\n\n/**\n * Event fired when the current page changes.\n * @event\n */\nexport type ObcPaginationValueChangeEvent = CustomEvent<{value: number}>;\n\n/**\n * Event fired when a navigation arrow is clicked.\n * @event\n */\nexport type ObcPaginationNavigateEvent = CustomEvent<{\n action: 'first' | 'previous' | 'next' | 'last';\n currentPage: number;\n}>;\n\n/**\n * `obc-pagination` – page navigation component for traversing multi-page content.\n *\n * Provides accessible, keyboard-navigable controls for moving between pages of content, such as tables, lists, or document sets. Includes support for ARIA live region updates and multiple visual variants to fit different UI layouts.\n *\n * Appears as a horizontal set of navigation buttons (first, previous, next, last) and page indicators, adapting its layout based on the selected variant. Designed for scenarios where users need to move between discrete pages of content, such as paginated tables, search results, or step-based flows.\n *\n * ## Features\n *\n * - **Variants:**\n * - `regular` (default): Standard pagination with numbered page buttons and navigation arrows.\n * - `flat`: Minimalist style with reduced elevation and flat toggle buttons.\n * - `condensed`: Compact mode showing only progress indicator dots and navigation arrows, ideal for limited space.\n * - **Navigation Controls:**\n * - First, previous, next, and last page buttons, each with ARIA labels and disabled states when navigation is not possible.\n * - **Page Indicators:**\n * - Numbered toggle buttons for each page (regular/flat), or progress dots (condensed).\n * - **Full Width Option:**\n * - Expands the pagination controls to fill the container width for better alignment in wide layouts.\n * - **Accessibility:**\n * - ARIA live region announces current page for assistive technologies.\n * - All controls are keyboard accessible.\n * - **Responsive:**\n * - Condensed variant adapts to smaller containers with a simplified indicator.\n *\n * ## Usage Guidelines\n *\n * Use `obc-pagination` to allow users to navigate through paged content, such as tables, lists, or multi-step flows.\n * - Choose the `regular` or `flat` variant for standard pagination at the bottom of a page or section.\n * - Use the `condensed` variant when space is limited or when a minimal indicator is preferred.\n * - Set the `pages` property to the total number of pages, and `currentPage` to the active page (1-based index).\n * - The component disables navigation buttons automatically at the first and last page.\n *\n * **Best Practices:**\n * - Only use pagination when content is split into discrete, sequential pages.\n * - For infinite scroll or continuous loading, consider alternative navigation patterns.\n * - Keep the number of visible page buttons reasonable (Material Design recommends limiting to avoid overwhelming the user).\n * - Always provide clear feedback about the current page (the component announces this for screen readers).\n *\n * **TODO(designer):** Confirm if there are recommended maximums for number of pages, or if there are design guidelines for when to use condensed vs. flat vs. regular in specific contexts.\n *\n * ## Example\n *\n * ```html\n * <obc-pagination\n * variant=\"regular\"\n * pages=\"5\"\n * current-page=\"2\"\n * ></obc-pagination>\n * ```\n *\n * ## Events\n *\n * - `value` – Fired when the current page changes (via user interaction).\n * - `navigate` – Fired when a navigation arrow (first, previous, next, last) is clicked.\n *\n * @fires value {ObcPaginationValueChangeEvent} Emitted whenever the current page changes.\n * @fires navigate {ObcPaginationNavigateEvent} Emitted when a navigation arrow is clicked.\n */\n@customElement('obc-pagination')\nexport class ObcPagination extends LitElement {\n /**\n * Visual style variant of the pagination component.\n *\n * - `regular`: Standard pagination with numbered page buttons and navigation arrows.\n * - `flat`: Minimalist, low-elevation style with flat toggle buttons.\n * - `condensed`: Compact mode with progress indicator dots and navigation arrows only.\n *\n * Default: `regular`\n */\n @property({type: String}) variant: PaginationVariant =\n PaginationVariant.regular;\n\n /**\n * Total number of pages available for navigation.\n *\n * Must be a positive integer (minimum 1). If set below 1, defaults to 1.\n *\n * Default: `3`\n */\n @property({type: Number}) pages = 3;\n\n /**\n * The currently selected (active) page, 1-based index.\n *\n * If set below 1 or above the total number of pages, it is clamped to the valid range.\n *\n * Default: `1`\n */\n @property({type: Number, attribute: 'current-page'}) currentPage = 1;\n\n /**\n * Expands the pagination controls to fill the width of the container.\n *\n * When enabled, the page indicators (toggle button group or progress dots) stretch to align with the container.\n *\n * Default: `false`\n */\n @property({type: Boolean, attribute: 'full-width', reflect: true}) fullWidth =\n false;\n\n @property({type: Boolean}) disabled = false;\n\n private get isCondensed() {\n return this.variant === PaginationVariant.condensed;\n }\n\n private get toggleButtonVariant() {\n return this.variant === PaginationVariant.flat\n ? ObcToggleButtonOptionVariant.flat\n : ObcToggleButtonOptionVariant.regular;\n }\n\n private get validatedPages() {\n return Math.max(1, this.pages);\n }\n\n private get validatedCurrentPage() {\n return Math.max(1, Math.min(this.currentPage, this.validatedPages));\n }\n\n private get canNavigatePrevious() {\n return !this.disabled && this.validatedCurrentPage > 1;\n }\n\n private get canNavigateNext() {\n console.log(\n 'canNavigateNext',\n this.disabled,\n this.validatedCurrentPage,\n this.validatedPages\n );\n return !this.disabled && this.validatedCurrentPage < this.validatedPages;\n }\n\n private get canNavigateFirst() {\n return !this.disabled && this.canNavigatePrevious;\n }\n\n private get canNavigateLast() {\n return !this.disabled && this.canNavigateNext;\n }\n\n private get pageNumbers() {\n return Array.from({length: this.validatedPages}, (_, i) => i + 1);\n }\n\n private get announceMessage() {\n return `Page ${this.validatedCurrentPage} of ${this.validatedPages}`;\n }\n\n private setCurrentPage(newPage: number) {\n const page = Math.max(1, Math.min(newPage, this.validatedPages));\n if (page === this.currentPage) return;\n this.currentPage = page;\n this.dispatchEvent(\n new CustomEvent('value', {\n detail: {value: page},\n }) as ObcPaginationValueChangeEvent\n );\n }\n\n private dispatchNavigateEvent(\n action: 'first' | 'previous' | 'next' | 'last'\n ) {\n this.dispatchEvent(\n new CustomEvent('navigate', {\n detail: {action, currentPage: this.validatedCurrentPage},\n }) as ObcPaginationNavigateEvent\n );\n }\n\n private handlePageChange = (event: CustomEvent<{value: string}>) => {\n this.setCurrentPage(Number(event.detail.value));\n };\n\n private handleFirstClick = () => {\n if (!this.canNavigateFirst) return;\n this.setCurrentPage(1);\n this.dispatchNavigateEvent('first');\n };\n\n private handlePreviousClick = () => {\n if (!this.canNavigatePrevious) return;\n this.setCurrentPage(this.validatedCurrentPage - 1);\n this.dispatchNavigateEvent('previous');\n };\n\n private handleNextClick = () => {\n if (!this.canNavigateNext) return;\n this.setCurrentPage(this.validatedCurrentPage + 1);\n this.dispatchNavigateEvent('next');\n };\n\n private handleLastClick = () => {\n if (!this.canNavigateLast) return;\n this.setCurrentPage(this.validatedPages);\n this.dispatchNavigateEvent('last');\n };\n\n private renderToggleButtons() {\n return this.pageNumbers.map(\n (num) =>\n html`<obc-toggle-button-option\n .value=${num.toString()}\n .variant=${this.toggleButtonVariant}\n .selected=${num === this.validatedCurrentPage}\n .ariaLabel=${`Page ${num} of ${this.validatedPages}`}\n >\n ${num}\n </obc-toggle-button-option>`\n );\n }\n\n private renderProgressIndicatorDots() {\n return html`\n <obc-progress-indicator-dots\n .totalSteps=${this.validatedPages}\n .currentStep=${this.validatedCurrentPage}\n ></obc-progress-indicator-dots>\n `;\n }\n\n private renderNavigation() {\n return html`\n <div\n class=${classMap({'navigation-wrapper': true, disabled: this.disabled})}\n role=\"navigation\"\n aria-label=\"Pagination\"\n >\n <obc-icon-button\n variant=\"flat\"\n aria-label=\"First page\"\n aria-disabled=${this.canNavigateFirst}\n ?disabled=${!this.canNavigateFirst}\n @click=${this.handleFirstClick}\n >\n <obi-page-first-google></obi-page-first-google>\n </obc-icon-button>\n\n <obc-icon-button\n variant=\"flat\"\n aria-label=\"Previous page\"\n aria-disabled=${this.canNavigatePrevious}\n ?disabled=${!this.canNavigatePrevious}\n @click=${this.handlePreviousClick}\n >\n <obi-chevron-left-google></obi-chevron-left-google>\n </obc-icon-button>\n\n ${this.isCondensed\n ? this.renderProgressIndicatorDots()\n : html`<obc-toggle-button-group\n .value=${this.validatedCurrentPage.toString()}\n .variant=${this.toggleButtonVariant}\n ?disabled=${this.disabled}\n @value=${this.handlePageChange}\n >\n ${this.renderToggleButtons()}\n </obc-toggle-button-group>`}\n\n <obc-icon-button\n variant=\"flat\"\n aria-label=\"Next page\"\n aria-disabled=${this.canNavigateNext}\n ?disabled=${!this.canNavigateNext}\n @click=${this.handleNextClick}\n >\n <obi-chevron-right-google></obi-chevron-right-google>\n </obc-icon-button>\n\n <obc-icon-button\n variant=\"flat\"\n aria-label=\"Last page\"\n aria-disabled=${this.canNavigateLast}\n ?disabled=${!this.canNavigateLast}\n @click=${this.handleLastClick}\n >\n <obi-page-last-google></obi-page-last-google>\n </obc-icon-button>\n </div>\n `;\n }\n\n override render() {\n return html`\n <div\n class=${classMap({\n wrapper: true,\n 'type-regular': this.variant === PaginationVariant.regular,\n 'type-flat': this.variant === PaginationVariant.flat,\n 'type-condensed': this.variant === PaginationVariant.condensed,\n disabled: this.disabled,\n })}\n >\n <div class=\"content-container\">${this.renderNavigation()}</div>\n <span\n aria-live=\"polite\"\n aria-atomic=\"true\"\n style=\"position:absolute;width:1px;height:1px;margin:-1px;clip:rect(0 0 0 0);overflow:hidden;\"\n >\n ${this.announceMessage}\n </span>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-pagination': ObcPagination;\n }\n}\n"],"names":["PaginationVariant"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBO,IAAK,sCAAAA,uBAAL;AACLA,qBAAA,SAAA,IAAU;AACVA,qBAAA,MAAA,IAAO;AACPA,qBAAA,WAAA,IAAY;AAHF,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAiFL,IAAM,gBAAN,cAA4B,WAAW;AAAA,EAAvC,cAAA;AAAA,UAAA,GAAA,SAAA;AAUqB,SAAA,UACxB;AASwB,SAAA,QAAQ;AAS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Pa,cAuPK,SAAS,UAAU,YAAY;AA7OrB,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAVb,cAUe,WAAA,WAAA,CAAA;AAUA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GApBb,cAoBe,WAAA,SAAA,CAAA;AAS2B,gBAAA;AAAA,EAApD,SAAS,EAAC,MAAM,QAAQ,WAAW,gBAAe;AAAA,GA7BxC,cA6B0C,WAAA,eAAA,CAAA;AASc,gBAAA;AAAA,EAAlE,SAAS,EAAC,MAAM,SAAS,WAAW,cAAc,SAAS,MAAK;AAAA,GAtCtD,cAsCwD,WAAA,aAAA,CAAA;AAGxC,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAzCd,cAyCgB,WAAA,YAAA,CAAA;AAzChB,gBAAN,gBAAA;AAAA,EADN,cAAc,gBAAgB;AAAA,GAClB,aAAA;"}
|
|
1
|
+
{"version":3,"file":"pagination.js","sources":["../../../src/components/pagination/pagination.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {customElement} from '../../decorator.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport compentStyle from './pagination.css?inline';\n\nimport '../toggle-button-option/toggle-button-option.js';\nimport '../toggle-button-group/toggle-button-group.js';\nimport '../icon-button/icon-button.js';\nimport '../progress-indicator-dots/progress-indicator-dots.js';\nimport '../../icons/icon-page-first-google.js';\nimport '../../icons/icon-chevron-left-google.js';\nimport '../../icons/icon-chevron-right-google.js';\nimport '../../icons/icon-page-last-google.js';\nimport {ObcToggleButtonOptionVariant} from '../toggle-button-option/toggle-button-option.js';\n\n/**\n * Enumerates the supported style variants for the Pagination component.\n *\n * - `regular`: Default pagination styling.\n * - `flat`: Borderless, flat appearance.\n * - `condensed`: More compact layout for tighter spacing.\n */\nexport enum PaginationVariant {\n regular = 'regular',\n flat = 'flat',\n condensed = 'condensed',\n}\n\n/**\n * Event fired when the current page changes.\n * @event\n */\nexport type ObcPaginationValueChangeEvent = CustomEvent<{value: number}>;\n\n/**\n * Event fired when a navigation arrow is clicked.\n * @event\n */\nexport type ObcPaginationNavigateEvent = CustomEvent<{\n action: 'first' | 'previous' | 'next' | 'last';\n currentPage: number;\n}>;\n\n/**\n * Event fired when a page is selected.\n * @event\n */\nexport type ObcPaginationSelectPageEvent = CustomEvent<{\n page: number;\n}>;\n\n/**\n * `obc-pagination` – page navigation component for traversing multi-page content.\n *\n * Provides accessible, keyboard-navigable controls for moving between pages of content, such as tables, lists, or document sets. Includes support for ARIA live region updates and multiple visual variants to fit different UI layouts.\n *\n * Appears as a horizontal set of navigation buttons (first, previous, next, last) and page indicators, adapting its layout based on the selected variant. Designed for scenarios where users need to move between discrete pages of content, such as paginated tables, search results, or step-based flows.\n *\n * ## Features\n *\n * - **Variants:**\n * - `regular` (default): Standard pagination with numbered page buttons and navigation arrows.\n * - `flat`: Minimalist style with reduced elevation and flat toggle buttons.\n * - `condensed`: Compact mode showing only progress indicator dots and navigation arrows, ideal for limited space.\n * - **Navigation Controls:**\n * - First, previous, next, and last page buttons, each with ARIA labels and disabled states when navigation is not possible.\n * - **Page Indicators:**\n * - Numbered toggle buttons for each page (regular/flat), or progress dots (condensed).\n * - **Full Width Option:**\n * - Expands the pagination controls to fill the container width for better alignment in wide layouts.\n * - **Accessibility:**\n * - ARIA live region announces current page for assistive technologies.\n * - All controls are keyboard accessible.\n * - **Responsive:**\n * - Condensed variant adapts to smaller containers with a simplified indicator.\n *\n * ## Usage Guidelines\n *\n * Use `obc-pagination` to allow users to navigate through paged content, such as tables, lists, or multi-step flows.\n * - Choose the `regular` or `flat` variant for standard pagination at the bottom of a page or section.\n * - Use the `condensed` variant when space is limited or when a minimal indicator is preferred.\n * - Set the `pages` property to the total number of pages, and `currentPage` to the active page (1-based index).\n * - The component disables navigation buttons automatically at the first and last page.\n *\n * **Best Practices:**\n * - Only use pagination when content is split into discrete, sequential pages.\n * - For infinite scroll or continuous loading, consider alternative navigation patterns.\n * - Keep the number of visible page buttons reasonable (Material Design recommends limiting to avoid overwhelming the user).\n * - Always provide clear feedback about the current page (the component announces this for screen readers).\n *\n * **TODO(designer):** Confirm if there are recommended maximums for number of pages, or if there are design guidelines for when to use condensed vs. flat vs. regular in specific contexts.\n *\n * ## Example\n *\n * ```html\n * <obc-pagination\n * variant=\"regular\"\n * pages=\"5\"\n * current-page=\"2\"\n * ></obc-pagination>\n * ```\n *\n * ## Events\n *\n * - `value` – Fired when the current page changes (via user interaction).\n * - `navigate` – Fired when a navigation arrow (first, previous, next, last) is clicked.\n * - `select-page` – Fired when a specific page is selected.\n *\n * @fires value {ObcPaginationValueChangeEvent} Emitted whenever the current page changes.\n * @fires navigate {ObcPaginationNavigateEvent} Emitted when a navigation arrow is clicked.\n * @fires select-page {ObcPaginationSelectPageEvent} Emitted when a specific page is selected.\n */\n@customElement('obc-pagination')\nexport class ObcPagination extends LitElement {\n /**\n * Visual style variant of the pagination component.\n *\n * - `regular`: Standard pagination with numbered page buttons and navigation arrows.\n * - `flat`: Minimalist, low-elevation style with flat toggle buttons.\n * - `condensed`: Compact mode with progress indicator dots and navigation arrows only.\n *\n * Default: `regular`\n */\n @property({type: String}) variant: PaginationVariant =\n PaginationVariant.regular;\n\n /**\n * Total number of pages available for navigation.\n *\n * Must be a positive integer (minimum 1). If set below 1, defaults to 1.\n *\n * Default: `3`\n */\n @property({type: Number}) pages = 3;\n\n /**\n * The currently selected (active) page, 1-based index.\n *\n * If set below 1 or above the total number of pages, it is clamped to the valid range.\n *\n * Default: `1`\n */\n @property({type: Number, attribute: 'current-page'}) currentPage = 1;\n\n /**\n * Expands the pagination controls to fill the width of the container.\n *\n * When enabled, the page indicators (toggle button group or progress dots) stretch to align with the container.\n *\n * Default: `false`\n */\n @property({type: Boolean, attribute: 'full-width', reflect: true}) fullWidth =\n false;\n\n @property({type: Boolean}) disabled = false;\n\n private get isCondensed() {\n return this.variant === PaginationVariant.condensed;\n }\n\n private get toggleButtonVariant() {\n return this.variant === PaginationVariant.flat\n ? ObcToggleButtonOptionVariant.flat\n : ObcToggleButtonOptionVariant.regular;\n }\n\n private get validatedPages() {\n return Math.max(1, this.pages);\n }\n\n private get validatedCurrentPage() {\n return Math.max(1, Math.min(this.currentPage, this.validatedPages));\n }\n\n private get canNavigatePrevious() {\n return !this.disabled && this.validatedCurrentPage > 1;\n }\n\n private get canNavigateNext() {\n console.log(\n 'canNavigateNext',\n this.disabled,\n this.validatedCurrentPage,\n this.validatedPages\n );\n return !this.disabled && this.validatedCurrentPage < this.validatedPages;\n }\n\n private get canNavigateFirst() {\n return !this.disabled && this.canNavigatePrevious;\n }\n\n private get canNavigateLast() {\n return !this.disabled && this.canNavigateNext;\n }\n\n private get pageNumbers() {\n return Array.from({length: this.validatedPages}, (_, i) => i + 1);\n }\n\n private get announceMessage() {\n return `Page ${this.validatedCurrentPage} of ${this.validatedPages}`;\n }\n\n private setCurrentPage(newPage: number) {\n const page = Math.max(1, Math.min(newPage, this.validatedPages));\n if (page === this.currentPage) {\n return false;\n }\n\n this.currentPage = page;\n this.dispatchEvent(\n new CustomEvent('value', {\n detail: {value: page},\n }) as ObcPaginationValueChangeEvent\n );\n\n return true;\n }\n\n private dispatchNavigateEvent(\n action: 'first' | 'previous' | 'next' | 'last'\n ) {\n this.dispatchEvent(\n new CustomEvent('navigate', {\n detail: {action, currentPage: this.validatedCurrentPage},\n }) as ObcPaginationNavigateEvent\n );\n }\n\n private handlePageChange = (event: CustomEvent<{value: string}>) => {\n const success = this.setCurrentPage(Number(event.detail.value));\n\n if (success) {\n this.dispatchEvent(\n new CustomEvent('select-page', {\n detail: {page: Number(event.detail.value)},\n }) as ObcPaginationSelectPageEvent\n );\n }\n };\n\n private handleFirstClick = () => {\n if (!this.canNavigateFirst) return;\n this.setCurrentPage(1);\n this.dispatchNavigateEvent('first');\n };\n\n private handlePreviousClick = () => {\n if (!this.canNavigatePrevious) return;\n this.setCurrentPage(this.validatedCurrentPage - 1);\n this.dispatchNavigateEvent('previous');\n };\n\n private handleNextClick = () => {\n if (!this.canNavigateNext) return;\n this.setCurrentPage(this.validatedCurrentPage + 1);\n this.dispatchNavigateEvent('next');\n };\n\n private handleLastClick = () => {\n if (!this.canNavigateLast) return;\n this.setCurrentPage(this.validatedPages);\n this.dispatchNavigateEvent('last');\n };\n\n private renderToggleButtons() {\n return this.pageNumbers.map(\n (num) =>\n html`<obc-toggle-button-option\n .value=${num.toString()}\n .variant=${this.toggleButtonVariant}\n .selected=${num === this.validatedCurrentPage}\n .ariaLabel=${`Page ${num} of ${this.validatedPages}`}\n >\n ${num}\n </obc-toggle-button-option>`\n );\n }\n\n private renderProgressIndicatorDots() {\n return html`\n <obc-progress-indicator-dots\n .totalSteps=${this.validatedPages}\n .currentStep=${this.validatedCurrentPage}\n ></obc-progress-indicator-dots>\n `;\n }\n\n private renderNavigation() {\n return html`\n <div\n class=${classMap({'navigation-wrapper': true, disabled: this.disabled})}\n role=\"navigation\"\n aria-label=\"Pagination\"\n >\n <obc-icon-button\n variant=\"flat\"\n aria-label=\"First page\"\n aria-disabled=${this.canNavigateFirst}\n ?disabled=${!this.canNavigateFirst}\n @click=${this.handleFirstClick}\n >\n <obi-page-first-google></obi-page-first-google>\n </obc-icon-button>\n\n <obc-icon-button\n variant=\"flat\"\n aria-label=\"Previous page\"\n aria-disabled=${this.canNavigatePrevious}\n ?disabled=${!this.canNavigatePrevious}\n @click=${this.handlePreviousClick}\n >\n <obi-chevron-left-google></obi-chevron-left-google>\n </obc-icon-button>\n\n ${this.isCondensed\n ? this.renderProgressIndicatorDots()\n : html`<obc-toggle-button-group\n .value=${this.validatedCurrentPage.toString()}\n .variant=${this.toggleButtonVariant}\n ?disabled=${this.disabled}\n @value=${this.handlePageChange}\n >\n ${this.renderToggleButtons()}\n </obc-toggle-button-group>`}\n\n <obc-icon-button\n variant=\"flat\"\n aria-label=\"Next page\"\n aria-disabled=${this.canNavigateNext}\n ?disabled=${!this.canNavigateNext}\n @click=${this.handleNextClick}\n >\n <obi-chevron-right-google></obi-chevron-right-google>\n </obc-icon-button>\n\n <obc-icon-button\n variant=\"flat\"\n aria-label=\"Last page\"\n aria-disabled=${this.canNavigateLast}\n ?disabled=${!this.canNavigateLast}\n @click=${this.handleLastClick}\n >\n <obi-page-last-google></obi-page-last-google>\n </obc-icon-button>\n </div>\n `;\n }\n\n override render() {\n return html`\n <div\n class=${classMap({\n wrapper: true,\n 'type-regular': this.variant === PaginationVariant.regular,\n 'type-flat': this.variant === PaginationVariant.flat,\n 'type-condensed': this.variant === PaginationVariant.condensed,\n disabled: this.disabled,\n })}\n >\n <div class=\"content-container\">${this.renderNavigation()}</div>\n <span\n aria-live=\"polite\"\n aria-atomic=\"true\"\n style=\"position:absolute;width:1px;height:1px;margin:-1px;clip:rect(0 0 0 0);overflow:hidden;\"\n >\n ${this.announceMessage}\n </span>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-pagination': ObcPagination;\n }\n}\n"],"names":["PaginationVariant"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBO,IAAK,sCAAAA,uBAAL;AACLA,qBAAA,SAAA,IAAU;AACVA,qBAAA,MAAA,IAAO;AACPA,qBAAA,WAAA,IAAY;AAHF,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AA2FL,IAAM,gBAAN,cAA4B,WAAW;AAAA,EAAvC,cAAA;AAAA,UAAA,GAAA,SAAA;AAUqB,SAAA,UACxB;AASwB,SAAA,QAAQ;AASmB,SAAA,cAAc;AASA,SAAA,YACjE;AAEyB,SAAA,WAAW;AA4EtC,SAAQ,mBAAmB,CAAC,UAAwC;AAClE,YAAM,UAAU,KAAK,eAAe,OAAO,MAAM,OAAO,KAAK,CAAC;AAE9D,UAAI,SAAS;AACX,aAAK;AAAA,UACH,IAAI,YAAY,eAAe;AAAA,YAC7B,QAAQ,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U,YAAY;AA1PrB,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAVb,cAUe,WAAA,WAAA,CAAA;AAUA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GApBb,cAoBe,WAAA,SAAA,CAAA;AAS2B,gBAAA;AAAA,EAApD,SAAS,EAAC,MAAM,QAAQ,WAAW,gBAAe;AAAA,GA7BxC,cA6B0C,WAAA,eAAA,CAAA;AASc,gBAAA;AAAA,EAAlE,SAAS,EAAC,MAAM,SAAS,WAAW,cAAc,SAAS,MAAK;AAAA,GAtCtD,cAsCwD,WAAA,aAAA,CAAA;AAGxC,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAzCd,cAyCgB,WAAA,YAAA,CAAA;AAzChB,gBAAN,gBAAA;AAAA,EADN,cAAc,gBAAgB;AAAA,GAClB,aAAA;"}
|
|
@@ -17,6 +17,11 @@ export declare enum ObcSliderVariant {
|
|
|
17
17
|
* The event detail contains the new numeric value.
|
|
18
18
|
*/
|
|
19
19
|
export type ObcSliderValueEvent = CustomEvent<number>;
|
|
20
|
+
/**
|
|
21
|
+
* Custom event type for slider change event (fired after user interaction completes).
|
|
22
|
+
* The event detail contains the new numeric value.
|
|
23
|
+
*/
|
|
24
|
+
export type ObcSliderChangeEvent = CustomEvent<number>;
|
|
20
25
|
/**
|
|
21
26
|
* `<obc-slider>` – A horizontal slider component for selecting a numeric value within a defined range.
|
|
22
27
|
*
|
|
@@ -76,7 +81,8 @@ export type ObcSliderValueEvent = CustomEvent<number>;
|
|
|
76
81
|
* ---
|
|
77
82
|
*
|
|
78
83
|
* ### Events
|
|
79
|
-
* - `value` – Fired when the slider value changes
|
|
84
|
+
* - `value` – Fired continuously when the slider value changes during user interaction or programmatically. The event detail contains the new value as a number.
|
|
85
|
+
* - `change` – Fired only after user interaction completes (mouse/touch release or button click). The event detail contains the new value as a number.
|
|
80
86
|
*
|
|
81
87
|
* ---
|
|
82
88
|
*
|
|
@@ -112,6 +118,7 @@ export type ObcSliderValueEvent = CustomEvent<number>;
|
|
|
112
118
|
* @slot icon-right - Slot for the right icon button (shown when `hasRightIcon` is true)
|
|
113
119
|
* @attr hugcontainer - If set, the slider will not have any spacing between the slider icons and the container
|
|
114
120
|
* @fires value {ObcSliderValueEvent} - Fired when the value is changed
|
|
121
|
+
* @fires change {ObcSliderChangeEvent} - Fired when user interaction completes and value has changed
|
|
115
122
|
*/
|
|
116
123
|
export declare class ObcSlider extends LitElement {
|
|
117
124
|
/**
|
|
@@ -200,6 +207,12 @@ export declare class ObcSlider extends LitElement {
|
|
|
200
207
|
* @fires value
|
|
201
208
|
*/
|
|
202
209
|
onInput(value: number): void;
|
|
210
|
+
/**
|
|
211
|
+
* Fires the `change` event with the current value.
|
|
212
|
+
*
|
|
213
|
+
* @fires change
|
|
214
|
+
*/
|
|
215
|
+
private fireChangeEvent;
|
|
203
216
|
/**
|
|
204
217
|
* Decrements the value by `stepClick` when the left icon button is clicked.
|
|
205
218
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../src/components/slider/slider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAKhD,OAAO,+BAA+B,CAAC;AAIvC;;;;;;GAMG;AACH,oBAAY,gBAAgB;IAC1B,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,OAAO,aAAa;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../src/components/slider/slider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAKhD,OAAO,+BAA+B,CAAC;AAIvC;;;;;;GAMG;AACH,oBAAY,gBAAgB;IAC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AAe;IAmBvB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,iBAAiB,CAEvB;IAEF,OAAO,CAAC,eAAe,CAErB;IAEF,OAAO,CAAC,iBAAiB,CAEvB;IAEF,OAAO,CAAC,gBAAgB,CAEtB;IAEF,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,cAAc;IA0DtB,OAAO,CAAC,aAAa;IAOZ,MAAM;IA8Ef,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
|
@@ -73,12 +73,23 @@ let ObcSlider = class extends LitElement {
|
|
|
73
73
|
this.value = value;
|
|
74
74
|
this.dispatchEvent(new CustomEvent("value", { detail: this.value }));
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Fires the `change` event with the current value.
|
|
78
|
+
*
|
|
79
|
+
* @fires change
|
|
80
|
+
*/
|
|
81
|
+
fireChangeEvent() {
|
|
82
|
+
this.dispatchEvent(
|
|
83
|
+
new CustomEvent("change", { detail: this.value })
|
|
84
|
+
);
|
|
85
|
+
}
|
|
76
86
|
/**
|
|
77
87
|
* Decrements the value by `stepClick` when the left icon button is clicked.
|
|
78
88
|
*/
|
|
79
89
|
onReduceClick() {
|
|
80
90
|
if (this.disabled) return;
|
|
81
91
|
this.onInput(Math.max(this.value - this.stepClick, this.min));
|
|
92
|
+
this.fireChangeEvent();
|
|
82
93
|
}
|
|
83
94
|
/**
|
|
84
95
|
* Increments the value by `stepClick` when the right icon button is clicked.
|
|
@@ -86,6 +97,7 @@ let ObcSlider = class extends LitElement {
|
|
|
86
97
|
onIncreaseClick() {
|
|
87
98
|
if (this.disabled) return;
|
|
88
99
|
this.onInput(Math.min(this.value + this.stepClick, this.max));
|
|
100
|
+
this.fireChangeEvent();
|
|
89
101
|
}
|
|
90
102
|
get slider() {
|
|
91
103
|
return this.renderRoot.querySelector('input[type="range"]');
|
|
@@ -143,12 +155,14 @@ let ObcSlider = class extends LitElement {
|
|
|
143
155
|
window.removeEventListener("mousemove", this.onWindowMouseMove);
|
|
144
156
|
window.removeEventListener("mouseup", this.onWindowMouseUp);
|
|
145
157
|
this.stopAnimation();
|
|
158
|
+
this.fireChangeEvent();
|
|
146
159
|
}
|
|
147
160
|
onTouchEnd() {
|
|
148
161
|
this.isTouchActive = false;
|
|
149
162
|
window.removeEventListener("touchmove", this.onWindowTouchMove);
|
|
150
163
|
window.removeEventListener("touchend", this.onWindowTouchEnd);
|
|
151
164
|
this.stopAnimation();
|
|
165
|
+
this.fireChangeEvent();
|
|
152
166
|
}
|
|
153
167
|
updateTargetValue(e) {
|
|
154
168
|
const rect = this.slider.getBoundingClientRect();
|
|
@@ -242,6 +256,9 @@ let ObcSlider = class extends LitElement {
|
|
|
242
256
|
@input=${(event) => {
|
|
243
257
|
this.value = Number(event.target.value);
|
|
244
258
|
this.dispatchEvent(new CustomEvent("value", { detail: this.value }));
|
|
259
|
+
}}
|
|
260
|
+
@change=${() => {
|
|
261
|
+
this.fireChangeEvent();
|
|
245
262
|
}}
|
|
246
263
|
@mousedown=${this.onMouseDown}
|
|
247
264
|
@touchstart=${this.onTouchStart}
|