@db-ux/v-core-components 4.7.0-tabs-34782eb → 4.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # @db-ux/v-core-components
2
2
 
3
+ ## 4.7.1
4
+
5
+ _version bump_
6
+
7
+
3
8
  ## 4.7.0
4
9
 
5
10
  ### Minor Changes
package/agent/Tabs.md CHANGED
@@ -8,44 +8,41 @@
8
8
  <h2>1. Default Tabs</h2>
9
9
  <DBTabs
10
10
  ><DBTabList
11
- ><DBTabItem>Def Tab 1</DBTabItem><DBTabItem>Def Tab 2</DBTabItem
12
- ><DBTabItem>Def Tab 3</DBTabItem></DBTabList
13
- ><DBTabPanel>Def Panel 1</DBTabPanel><DBTabPanel>Def Panel 2</DBTabPanel
14
- ><DBTabPanel>Def Panel 3</DBTabPanel></DBTabs
11
+ ><DBTabItem>Tab 1</DBTabItem><DBTabItem>Tab 2</DBTabItem
12
+ ><DBTabItem>Tab 3</DBTabItem></DBTabList
13
+ ><DBTabPanel>Tab Panel 1</DBTabPanel><DBTabPanel>Tab Panel 2</DBTabPanel
14
+ ><DBTabPanel>Tab Panel 3</DBTabPanel></DBTabs
15
15
  >
16
16
  <h2>2. Behavior Variants</h2>
17
17
  <DBTabs behavior="scrollbar"
18
18
  ><DBTabList
19
- ><DBTabItem>Scroll Tab 1</DBTabItem><DBTabItem>Scroll Tab 2</DBTabItem
20
- ><DBTabItem>Scroll Tab 3</DBTabItem></DBTabList
21
- ><DBTabPanel>Scroll Panel 1</DBTabPanel
22
- ><DBTabPanel>Scroll Panel 2</DBTabPanel
23
- ><DBTabPanel>Scroll Panel 3</DBTabPanel></DBTabs
19
+ ><DBTabItem>Tab 1</DBTabItem><DBTabItem>Tab 2</DBTabItem
20
+ ><DBTabItem>Tab 3</DBTabItem></DBTabList
21
+ ><DBTabPanel>Tab Panel 1</DBTabPanel><DBTabPanel>Tab Panel 2</DBTabPanel
22
+ ><DBTabPanel>Tab Panel 3</DBTabPanel></DBTabs
24
23
  >
25
24
  <DBTabs behavior="arrows"
26
25
  ><DBTabList
27
- ><DBTabItem>Arrow Tab 1</DBTabItem><DBTabItem>Arrow Tab 2</DBTabItem
28
- ><DBTabItem>Arrow Tab 3</DBTabItem></DBTabList
29
- ><DBTabPanel>Arrow Panel 1</DBTabPanel><DBTabPanel>Arrow Panel 2</DBTabPanel
30
- ><DBTabPanel>Arrow Panel 3</DBTabPanel></DBTabs
26
+ ><DBTabItem>Tab 1</DBTabItem><DBTabItem>Tab 2</DBTabItem
27
+ ><DBTabItem>Tab 3</DBTabItem></DBTabList
28
+ ><DBTabPanel>Tab Panel 1</DBTabPanel><DBTabPanel>Tab Panel 2</DBTabPanel
29
+ ><DBTabPanel>Tab Panel 3</DBTabPanel></DBTabs
31
30
  >
32
31
  <h2>3. Initial Selected Index</h2>
33
32
  <DBTabs :initialSelectedIndex="1"
34
33
  ><DBTabList
35
- ><DBTabItem>InitIdx Tab 1</DBTabItem><DBTabItem>InitIdx Tab 2</DBTabItem
36
- ><DBTabItem>InitIdx Tab 3</DBTabItem></DBTabList
37
- ><DBTabPanel>InitIdx Panel 1</DBTabPanel
38
- ><DBTabPanel>InitIdx Panel 2</DBTabPanel
39
- ><DBTabPanel>InitIdx Panel 3</DBTabPanel></DBTabs
34
+ ><DBTabItem>Tab 1</DBTabItem><DBTabItem>Tab 2</DBTabItem
35
+ ><DBTabItem>Tab 3</DBTabItem></DBTabList
36
+ ><DBTabPanel>Tab Panel 1</DBTabPanel><DBTabPanel>Tab Panel 2</DBTabPanel
37
+ ><DBTabPanel>Tab Panel 3</DBTabPanel></DBTabs
40
38
  >
41
39
  <h2>4. Initial Selected Mode</h2>
42
40
  <DBTabs initialSelectedMode="manually"
43
41
  ><DBTabList
44
- ><DBTabItem>Manually Tab 1</DBTabItem><DBTabItem>Manually Tab 2</DBTabItem
45
- ><DBTabItem>Manually Tab 3</DBTabItem></DBTabList
46
- ><DBTabPanel>Manually Panel 1</DBTabPanel
47
- ><DBTabPanel>Manually Panel 2</DBTabPanel
48
- ><DBTabPanel>Manually Panel 3</DBTabPanel></DBTabs
42
+ ><DBTabItem>Tab 1</DBTabItem><DBTabItem>Tab 2</DBTabItem
43
+ ><DBTabItem>Tab 3</DBTabItem></DBTabList
44
+ ><DBTabPanel>Tab Panel 1</DBTabPanel><DBTabPanel>Tab Panel 2</DBTabPanel
45
+ ><DBTabPanel>Tab Panel 3</DBTabPanel></DBTabs
49
46
  >
50
47
  </template>
51
48
 
@@ -1,5 +1,9 @@
1
- import { ActiveProps, ClickEventProps, GlobalProps, GlobalState, IconLeadingProps, IconProps, IconTrailingProps, InitializedState, ShowIconLeadingProps, ShowIconProps, ShowIconTrailingProps, WidthProps } from '../../shared/model';
1
+ import { ActiveProps, ChangeEventProps, ChangeEventState, GlobalProps, GlobalState, IconLeadingProps, IconProps, IconTrailingProps, InitializedState, NameProps, NameState, ShowIconLeadingProps, ShowIconProps, ShowIconTrailingProps } from '../../shared/model';
2
2
  export type DBTabItemDefaultProps = {
3
+ /**
4
+ * To control the component
5
+ */
6
+ checked?: boolean | string;
3
7
  /**
4
8
  * The disabled attribute can be set to keep a user from clicking on the tab-item.
5
9
  */
@@ -12,33 +16,12 @@ export type DBTabItemDefaultProps = {
12
16
  * Define the text next to the icon specified via the icon Property to get hidden.
13
17
  */
14
18
  noText?: boolean | string;
15
- /**
16
- * Set the tabIndex manually (internal use for roving tabindex).
17
- */
18
- tabIndex?: number | string;
19
- /**
20
- * The id of the panel this tab controls (WAI-ARIA).
21
- */
22
- ariaControls?: string;
23
- /**
24
- * Semantic value of this tab item. When set, onIndexChange will emit this value
25
- * (via the onValueChange event) instead of only the numeric index.
26
- * Useful for form binding (e.g. Angular FormControl, React useState).
27
- */
28
- value?: string;
29
19
  };
30
- export type DBTabItemProps = DBTabItemDefaultProps & GlobalProps & ClickEventProps<HTMLButtonElement> & IconProps & ShowIconProps & IconTrailingProps & IconLeadingProps & ShowIconTrailingProps & ShowIconLeadingProps & ActiveProps & WidthProps;
20
+ export type DBTabItemProps = GlobalProps & DBTabItemDefaultProps & IconProps & IconTrailingProps & IconLeadingProps & ShowIconLeadingProps & ShowIconTrailingProps & ActiveProps & ChangeEventProps<HTMLInputElement> & ShowIconProps & NameProps;
31
21
  export type DBTabItemDefaultState = {
32
- internalActive: boolean | undefined;
33
- internalTabIndex: number;
34
- getCurrentTabIndex: () => number;
35
- _resizeObserver: ResizeObserver | null | undefined;
36
- _ariaSelectedListener: {
37
- fn: (event: any) => void;
38
- } | null;
39
- handleClick: (event: any) => void;
40
- isTruncated: boolean;
41
- checkTruncation: () => void;
42
- tooltipText: string;
22
+ _selected: boolean;
23
+ _listenerAdded: boolean;
24
+ boundSetSelectedOnChange?: (event: any) => void;
25
+ setSelectedOnChange: (event: any) => void;
43
26
  };
44
- export type DBTabItemState = DBTabItemDefaultState & GlobalState & InitializedState;
27
+ export type DBTabItemState = DBTabItemDefaultState & GlobalState & ChangeEventState<HTMLInputElement> & InitializedState & NameState;
@@ -3,13 +3,19 @@ declare var __VLS_1: {};
3
3
  type __VLS_Slots = {} & {
4
4
  default?: (props: typeof __VLS_1) => any;
5
5
  };
6
- declare const __VLS_base: import("vue").DefineComponent<DBTabItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DBTabItemProps> & Readonly<{}>, {
6
+ declare const __VLS_base: import("vue").DefineComponent<DBTabItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ "update:checked": (...args: any[]) => void;
8
+ }, string, import("vue").PublicProps, Readonly<DBTabItemProps> & Readonly<{
9
+ "onUpdate:checked"?: ((...args: any[]) => any) | undefined;
10
+ }>, {
7
11
  id: string;
12
+ children: any;
8
13
  className: string;
14
+ propOverrides: import("../..").PropOverridesType;
15
+ name: string;
9
16
  label: string;
10
- value: string;
11
17
  disabled: boolean | string;
12
- onClick: (event: import("../..").ClickEvent<HTMLButtonElement>) => void;
18
+ onChange: (event: import("../..").ChangeEvent<HTMLInputElement>) => void;
13
19
  icon: import("@db-ux/core-foundations").IconTypes;
14
20
  showIcon: boolean | string;
15
21
  showIconLeading: boolean | string;
@@ -17,9 +23,8 @@ declare const __VLS_base: import("vue").DefineComponent<DBTabItemProps, {}, {},
17
23
  iconLeading: import("@db-ux/core-foundations").IconTypes;
18
24
  iconTrailing: import("@db-ux/core-foundations").IconTypes;
19
25
  noText: boolean | string;
20
- tabIndex: number | string;
26
+ checked: boolean | string;
21
27
  active: boolean | string;
22
- ariaControls: string;
23
28
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
29
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
25
30
  declare const _default: typeof __VLS_export;
@@ -1,15 +1,5 @@
1
- import { GlobalProps, GlobalState, OrientationProps } from '../../shared/model';
2
- export type DBTabListDefaultProps = {
3
- /**
4
- * Defines a string value that labels the current element (WAI-ARIA).
5
- */
6
- ariaLabel?: string;
7
- /**
8
- * Identifies the element (or elements) that labels the current element (WAI-ARIA).
9
- */
10
- ariaLabelledby?: string;
11
- };
12
- export type DBTabListProps = DBTabListDefaultProps & GlobalProps & OrientationProps;
13
- export interface DBTabListState extends GlobalState {
14
- _id?: string;
15
- }
1
+ import { GlobalProps } from '../../shared/model';
2
+ export type DBTabListDefaultProps = {};
3
+ export type DBTabListProps = DBTabListDefaultProps & GlobalProps;
4
+ export type DBTabListDefaultState = {};
5
+ export type DBTabListState = DBTabListDefaultState;
@@ -1,15 +1,12 @@
1
- import { DBTabListProps } from "./model";
2
1
  declare var __VLS_1: {};
3
2
  type __VLS_Slots = {} & {
4
3
  default?: (props: typeof __VLS_1) => any;
5
4
  };
6
- declare const __VLS_base: import("vue").DefineComponent<DBTabListProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DBTabListProps> & Readonly<{}>, {
5
+ declare const __VLS_base: import("vue").DefineComponent<import("../..").GlobalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("../..").GlobalProps> & Readonly<{}>, {
7
6
  id: string;
8
7
  children: any;
9
8
  className: string;
10
- ariaLabel: string;
11
- ariaLabelledby: string;
12
- orientation: import("../..").OrientationType;
9
+ propOverrides: import("../..").PropOverridesType;
13
10
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
11
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
15
12
  declare const _default: typeof __VLS_export;
@@ -1,20 +1,10 @@
1
- import { GlobalProps } from '../../shared/model';
1
+ import { GlobalProps, GlobalState } from '../../shared/model';
2
2
  export type DBTabPanelDefaultProps = {
3
3
  /**
4
4
  * The content if you don't want to use children.
5
5
  */
6
6
  content?: string;
7
- /**
8
- * If the panel is hidden.
9
- */
10
- hidden?: boolean;
11
- /**
12
- * The id of the tab that labels this panel (WAI-ARIA).
13
- */
14
- ariaLabelledby?: string;
15
- /**
16
- * Accessible label for the panel, overrides ariaLabelledby for the accessible name.
17
- */
18
- ariaLabel?: string;
19
7
  };
20
8
  export type DBTabPanelProps = DBTabPanelDefaultProps & GlobalProps;
9
+ export type DBTabPanelDefaultState = {};
10
+ export type DBTabPanelState = DBTabPanelDefaultState & GlobalState;
@@ -3,7 +3,13 @@ declare var __VLS_1: {};
3
3
  type __VLS_Slots = {} & {
4
4
  default?: (props: typeof __VLS_1) => any;
5
5
  };
6
- declare const __VLS_base: import("vue").DefineComponent<DBTabPanelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DBTabPanelProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const __VLS_base: import("vue").DefineComponent<DBTabPanelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DBTabPanelProps> & Readonly<{}>, {
7
+ id: string;
8
+ children: any;
9
+ className: string;
10
+ propOverrides: import("../..").PropOverridesType;
11
+ content: string;
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
13
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
14
  declare const _default: typeof __VLS_export;
9
15
  export default _default;
@@ -1,4 +1,4 @@
1
- import { GlobalProps, InitializedState, OrientationProps, TabItemAlignmentProps, WidthType } from '../../shared/model';
1
+ import { AlignmentProps, GlobalProps, InitializedState, InputEvent, OrientationProps, WidthProps } from '../../shared/model';
2
2
  import { DBTabItemProps } from '../tab-item/model';
3
3
  import { DBTabPanelProps } from '../tab-panel/model';
4
4
  export declare const TabsBehaviorList: readonly ["scrollbar", "arrows"];
@@ -19,12 +19,6 @@ export type DBTabsDefaultProps = {
19
19
  * Default behavior is auto selecting the first tab, change selected tab by index
20
20
  */
21
21
  initialSelectedIndex?: number | string;
22
- /**
23
- * Controlled active tab index. When set, the component becomes controlled:
24
- * the consumer is responsible for updating this value in the onIndexChange handler.
25
- * Takes precedence over initialSelectedIndex after mount.
26
- */
27
- activeIndex?: number | string;
28
22
  /**
29
23
  * Default behavior is auto selecting the first tab, disable it with 'manually'
30
24
  */
@@ -37,18 +31,6 @@ export type DBTabsDefaultProps = {
37
31
  * Provide simple tabs with label + text as content
38
32
  */
39
33
  tabs?: DBSimpleTabProps[] | string;
40
- /**
41
- * Width of the tab-items. Auto width based on tab-item size, full width based on parent elements width.
42
- */
43
- tabItemWidth?: WidthType | string;
44
- /**
45
- * Accessible label for the "scroll towards start" button (i18n). Only used with behavior="arrows".
46
- */
47
- scrollStartLabel?: string;
48
- /**
49
- * Accessible label for the "scroll towards end" button (i18n). Only used with behavior="arrows".
50
- */
51
- scrollEndLabel?: string;
52
34
  };
53
35
  export type DBTabsEventProps = {
54
36
  /**
@@ -60,42 +42,26 @@ export type DBTabsEventProps = {
60
42
  */
61
43
  onIndexChange?: (index?: number) => void;
62
44
  /**
63
- * Fires when the active tab changes and a `value` prop is set on the tab items.
64
- * Payload is the `value` string of the newly active tab item, or undefined
65
- * if the tab item has no `value` prop set.
66
- * Use this for form binding (e.g. Angular FormControl, React controlled state).
45
+ * Informs the user if another tab has been selected.
46
+ */
47
+ onTabSelect?: (event?: InputEvent<HTMLElement>) => void;
48
+ /**
49
+ * Informs the user if another tab has been selected.
67
50
  */
68
- onValueChange?: (value?: string) => void;
51
+ tabSelect?: (event?: InputEvent<HTMLElement>) => void;
69
52
  };
70
- export type DBTabsProps = DBTabsDefaultProps & GlobalProps & OrientationProps & TabItemAlignmentProps & DBTabsEventProps;
53
+ export type DBTabsProps = DBTabsDefaultProps & GlobalProps & OrientationProps & WidthProps & AlignmentProps & DBTabsEventProps;
71
54
  export type DBTabsDefaultState = {
72
- _generatedId: string;
73
- _generatedName: string;
74
- _id: () => string;
75
- _name: () => string;
76
- _getScrollContainer: () => Element | null;
77
- scroll: (toStart?: boolean) => void;
78
- showScrollStart?: boolean;
79
- showScrollEnd?: boolean;
80
- _isRtl: () => boolean;
55
+ _name: string;
56
+ scrollContainer?: Element | null;
57
+ scroll: (left?: boolean) => void;
58
+ showScrollLeft?: boolean;
59
+ showScrollRight?: boolean;
81
60
  evaluateScrollButtons: (tabList: Element) => void;
82
- _cachedTabs: DBSimpleTabProps[];
83
- _updateCachedTabs: () => void;
61
+ convertTabs: () => DBSimpleTabProps[];
84
62
  initTabList: () => void;
85
- initTabs: (activeIndex?: number) => void;
86
- _resizeObserver?: ResizeObserver | null;
87
- _observer?: MutationObserver | null;
88
- _pendingRafId: number | null;
89
- _scrollListener: {
90
- fn: () => void;
91
- } | null;
92
- activeTabIndex: number;
93
- activateTab: (index: number) => void;
94
- getTabId: (index: number | string) => string;
95
- getPanelId: (index: number | string) => string;
96
- handleClick: (event: any) => void;
97
- handleKeyDown: (event: any) => void;
98
- isIndexActive: (index: number | string) => boolean;
99
- getTabItemTabIndex: (index: number | string) => 0 | -1;
63
+ initTabs: (init?: boolean) => void;
64
+ handleChange: (event: InputEvent<HTMLElement>) => void;
65
+ _resizeObserver?: ResizeObserver;
100
66
  };
101
67
  export type DBTabsState = DBTabsDefaultState & InitializedState;
@@ -1,27 +1,25 @@
1
+ import { InputEvent } from "../../shared/model";
1
2
  import { DBSimpleTabProps, DBTabsProps } from "./model";
2
- declare var __VLS_24: {};
3
+ declare var __VLS_30: {};
3
4
  type __VLS_Slots = {} & {
4
- default?: (props: typeof __VLS_24) => any;
5
+ default?: (props: typeof __VLS_30) => any;
5
6
  };
6
7
  declare const __VLS_base: import("vue").DefineComponent<DBTabsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DBTabsProps> & Readonly<{}>, {
7
8
  id: string;
8
9
  children: any;
9
10
  className: string;
10
- propOverrides: import("../..").PropOverridesType;
11
+ propOverrides: import("../../shared/model").PropOverridesType;
11
12
  name: string;
12
13
  behavior: import("./model").TabsBehaviorType;
13
- orientation: import("../..").OrientationType;
14
+ width: import("../../shared/model").WidthType | string;
15
+ alignment: import("../../shared/model").AlignmentType | string;
14
16
  arrowScrollDistance: number | string;
15
17
  initialSelectedIndex: number | string;
16
- activeIndex: number | string;
17
18
  initialSelectedMode: import("./model").TabsInitialSelectedModeType;
18
19
  tabs: DBSimpleTabProps[] | string;
19
- tabItemWidth: import("../..").WidthType | string;
20
- scrollStartLabel: string;
21
- scrollEndLabel: string;
22
- tabItemAlignment: import("../..").TabItemAlignmentType | string;
20
+ orientation: import("../../shared/model").OrientationType;
23
21
  onIndexChange: (index?: number) => void;
24
- onValueChange: (value?: string) => void;
22
+ onTabSelect: (event?: InputEvent<HTMLElement>) => void;
25
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
24
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
25
  declare const _default: typeof __VLS_export;