@oicl/openbridge-webcomponents-svelte 2.0.0-next.84 → 2.0.0-next.85
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
<script lang="ts">
|
|
3
|
-
|
|
3
|
+
export type {TabItemBadge} from '@oicl/openbridge-webcomponents/dist/components/tab-item/tab-item.js';
|
|
4
4
|
import '@oicl/openbridge-webcomponents/dist/components/tab-item/tab-item.js';
|
|
5
5
|
import { setProperties } from "../../util.js";
|
|
6
|
-
|
|
6
|
+
import type {TabItemBadge} from '@oicl/openbridge-webcomponents/dist/components/tab-item/tab-item.js';
|
|
7
7
|
import type { Snippet } from 'svelte';
|
|
8
8
|
|
|
9
9
|
export interface Props {
|
|
@@ -44,11 +44,16 @@ Useful for visually separating tabs.
|
|
|
44
44
|
|
|
45
45
|
Default: false */
|
|
46
46
|
hasDivider?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
Configure badge appearance via `badgeCount`, `badgeType`, `badgeSize`, etc.
|
|
47
|
+
/** One or more badges (count/status) to display on the tab.
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
hasBadge
|
|
49
|
+
When this array is non-empty it takes precedence over the deprecated
|
|
50
|
+
single-badge props (`hasBadge`, `badgeType`, `badgeSize`, `badgeCount`,
|
|
51
|
+
`badgeShowNumber`, `showLeadingBadgeIcon`). When empty, the deprecated
|
|
52
|
+
props are used instead (gated by `hasBadge`).
|
|
53
|
+
|
|
54
|
+
Default: [] */
|
|
55
|
+
badges?: TabItemBadge[];
|
|
56
|
+
hasBadge?: boolean;
|
|
52
57
|
/** (Deprecated/Unused) Icon name for the tab.
|
|
53
58
|
Icon content should be provided via the `leading-icon` slot.
|
|
54
59
|
|
|
@@ -71,29 +76,11 @@ subtitle?: string;
|
|
|
71
76
|
|
|
72
77
|
Default: false */
|
|
73
78
|
disabled?: boolean;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
/** Size of the badge ('regular' or 'large').
|
|
80
|
-
See `BadgeSize` enum for available options.
|
|
81
|
-
|
|
82
|
-
Default: 'regular' */
|
|
83
|
-
badgeSize?: string;
|
|
84
|
-
/** Shows the badge's numeric value. When false, only the badge background is rendered (for status-only badges).
|
|
85
|
-
|
|
86
|
-
Default: true */
|
|
87
|
-
badgeShowNumber?: boolean;
|
|
88
|
-
/** The numeric value to display in the badge (e.g., count of notifications).
|
|
89
|
-
|
|
90
|
-
Default: 0 */
|
|
91
|
-
badgeCount?: number;
|
|
92
|
-
/** Shows an icon inside the badge.
|
|
93
|
-
Supply icon content via the `badge-icon` slot.
|
|
94
|
-
|
|
95
|
-
Default: false */
|
|
96
|
-
showLeadingBadgeIcon?: boolean
|
|
79
|
+
badgeType?: string;
|
|
80
|
+
badgeSize?: string;
|
|
81
|
+
badgeShowNumber?: boolean;
|
|
82
|
+
badgeCount?: number;
|
|
83
|
+
showLeadingBadgeIcon?: boolean
|
|
97
84
|
}
|
|
98
85
|
export interface Events {
|
|
99
86
|
onTabClick?: (event: CustomEvent<{title: string}>) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '@oicl/openbridge-webcomponents/dist/components/tab-item/tab-item.js';
|
|
2
|
+
import type { TabItemBadge } from '@oicl/openbridge-webcomponents/dist/components/tab-item/tab-item.js';
|
|
2
3
|
import type { Snippet } from 'svelte';
|
|
3
4
|
export interface Props {
|
|
4
5
|
class?: string;
|
|
@@ -38,10 +39,15 @@ Useful for visually separating tabs.
|
|
|
38
39
|
|
|
39
40
|
Default: false */
|
|
40
41
|
hasDivider?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
Configure badge appearance via `badgeCount`, `badgeType`, `badgeSize`, etc.
|
|
42
|
+
/** One or more badges (count/status) to display on the tab.
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
When this array is non-empty it takes precedence over the deprecated
|
|
45
|
+
single-badge props (`hasBadge`, `badgeType`, `badgeSize`, `badgeCount`,
|
|
46
|
+
`badgeShowNumber`, `showLeadingBadgeIcon`). When empty, the deprecated
|
|
47
|
+
props are used instead (gated by `hasBadge`).
|
|
48
|
+
|
|
49
|
+
Default: [] */
|
|
50
|
+
badges?: TabItemBadge[];
|
|
45
51
|
hasBadge?: boolean;
|
|
46
52
|
/** (Deprecated/Unused) Icon name for the tab.
|
|
47
53
|
Icon content should be provided via the `leading-icon` slot.
|
|
@@ -65,28 +71,10 @@ Default: '' */
|
|
|
65
71
|
|
|
66
72
|
Default: false */
|
|
67
73
|
disabled?: boolean;
|
|
68
|
-
/** Type of badge to display (e.g., 'regular', 'alarm', 'warning', etc.).
|
|
69
|
-
See `BadgeType` enum for available options.
|
|
70
|
-
|
|
71
|
-
Default: 'regular' */
|
|
72
74
|
badgeType?: string;
|
|
73
|
-
/** Size of the badge ('regular' or 'large').
|
|
74
|
-
See `BadgeSize` enum for available options.
|
|
75
|
-
|
|
76
|
-
Default: 'regular' */
|
|
77
75
|
badgeSize?: string;
|
|
78
|
-
/** Shows the badge's numeric value. When false, only the badge background is rendered (for status-only badges).
|
|
79
|
-
|
|
80
|
-
Default: true */
|
|
81
76
|
badgeShowNumber?: boolean;
|
|
82
|
-
/** The numeric value to display in the badge (e.g., count of notifications).
|
|
83
|
-
|
|
84
|
-
Default: 0 */
|
|
85
77
|
badgeCount?: number;
|
|
86
|
-
/** Shows an icon inside the badge.
|
|
87
|
-
Supply icon content via the `badge-icon` slot.
|
|
88
|
-
|
|
89
|
-
Default: false */
|
|
90
78
|
showLeadingBadgeIcon?: boolean;
|
|
91
79
|
}
|
|
92
80
|
export interface Events {
|
|
@@ -103,6 +91,8 @@ export interface Slots {
|
|
|
103
91
|
badgeIcon?: Snippet;
|
|
104
92
|
}
|
|
105
93
|
type $$ComponentProps = Props & Events & Slots;
|
|
106
|
-
declare const ObcTabItem: import("svelte").Component<$$ComponentProps, {
|
|
94
|
+
declare const ObcTabItem: import("svelte").Component<$$ComponentProps, {
|
|
95
|
+
TabItemBadge: typeof TabItemBadge;
|
|
96
|
+
}, "">;
|
|
107
97
|
type ObcTabItem = ReturnType<typeof ObcTabItem>;
|
|
108
98
|
export default ObcTabItem;
|
|
@@ -16,12 +16,13 @@
|
|
|
16
16
|
- `subtitle` (string): Contextual text shown below the title when subtitle display is enabled.
|
|
17
17
|
- `showSubtitle` (boolean): Optional per-tab override for displaying the subtitle.
|
|
18
18
|
- `hasLeadingIcon` (boolean): Whether to show a leading icon (default: true).
|
|
19
|
-
- `
|
|
20
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
19
|
+
- `badges` (TabItemBadge[]): One or more badges to display on the tab. Takes precedence over the deprecated single-badge fields below.
|
|
20
|
+
- `hasBadge` (boolean, deprecated): Whether to show a badge on the tab.
|
|
21
|
+
- `badgeCount` (number, deprecated): Number to display in the badge.
|
|
22
|
+
- `badgeType` (BadgeType, deprecated): Visual style of the badge (e.g., notification, alarm, enhance).
|
|
23
|
+
- `badgeSize` (BadgeSize, deprecated): Size of the badge (e.g., regular, large).
|
|
24
|
+
- `badgeShowNumber` (boolean, deprecated): If true, shows the badge number.
|
|
25
|
+
- `showLeadingBadgeIcon` (boolean, deprecated): If true, shows a badge icon.
|
|
25
26
|
- `disabled` (boolean): If true, disables the tab. */
|
|
26
27
|
tabs?: TabData[];
|
|
27
28
|
/** The `id` of the currently selected tab. Only one tab can be selected at a time.
|
|
@@ -32,6 +33,7 @@ selectedTabId?: string;
|
|
|
32
33
|
|
|
33
34
|
Default: `false`. */
|
|
34
35
|
hasClose?: boolean;
|
|
36
|
+
centerContent?: boolean;
|
|
35
37
|
/** Enables "hug" mode for a more compact tab layout with reduced padding.
|
|
36
38
|
|
|
37
39
|
Default: `false`. */
|
|
@@ -52,9 +54,9 @@ hasAddNewTab?: boolean
|
|
|
52
54
|
}
|
|
53
55
|
export interface Slots {
|
|
54
56
|
tabIcon?: Snippet<[any]>;
|
|
55
|
-
|
|
57
|
+
tab?: Snippet<[any]>
|
|
56
58
|
}
|
|
57
|
-
const {onTabSelected, onTabClosed, onAddNewTab, class: className, style, tabIcon,
|
|
59
|
+
const {onTabSelected, onTabClosed, onAddNewTab, class: className, style, tabIcon, tab, ...props} = $props<Props & Events & Slots>();
|
|
58
60
|
|
|
59
61
|
</script>
|
|
60
62
|
<obc-tab-row
|
|
@@ -73,10 +75,10 @@ hasAddNewTab?: boolean
|
|
|
73
75
|
{/each}
|
|
74
76
|
{/if}
|
|
75
77
|
|
|
76
|
-
{#if props.tabs &&
|
|
78
|
+
{#if props.tabs && tab}
|
|
77
79
|
{#each props.tabs as item}
|
|
78
|
-
<div slot="tab-{item.id}
|
|
79
|
-
{@render
|
|
80
|
+
<div slot="tab-{item.id}-<iconSlotName>">
|
|
81
|
+
{@render tab(item)}
|
|
80
82
|
</div>
|
|
81
83
|
{/each}
|
|
82
84
|
{/if}
|
|
@@ -11,12 +11,13 @@ export interface Props {
|
|
|
11
11
|
- `subtitle` (string): Contextual text shown below the title when subtitle display is enabled.
|
|
12
12
|
- `showSubtitle` (boolean): Optional per-tab override for displaying the subtitle.
|
|
13
13
|
- `hasLeadingIcon` (boolean): Whether to show a leading icon (default: true).
|
|
14
|
-
- `
|
|
15
|
-
- `
|
|
16
|
-
- `
|
|
17
|
-
- `
|
|
18
|
-
- `
|
|
19
|
-
- `
|
|
14
|
+
- `badges` (TabItemBadge[]): One or more badges to display on the tab. Takes precedence over the deprecated single-badge fields below.
|
|
15
|
+
- `hasBadge` (boolean, deprecated): Whether to show a badge on the tab.
|
|
16
|
+
- `badgeCount` (number, deprecated): Number to display in the badge.
|
|
17
|
+
- `badgeType` (BadgeType, deprecated): Visual style of the badge (e.g., notification, alarm, enhance).
|
|
18
|
+
- `badgeSize` (BadgeSize, deprecated): Size of the badge (e.g., regular, large).
|
|
19
|
+
- `badgeShowNumber` (boolean, deprecated): If true, shows the badge number.
|
|
20
|
+
- `showLeadingBadgeIcon` (boolean, deprecated): If true, shows a badge icon.
|
|
20
21
|
- `disabled` (boolean): If true, disables the tab. */
|
|
21
22
|
tabs?: TabData[];
|
|
22
23
|
/** The `id` of the currently selected tab. Only one tab can be selected at a time.
|
|
@@ -27,6 +28,7 @@ Changing this property updates the selected tab visually and emits the `tab-sele
|
|
|
27
28
|
|
|
28
29
|
Default: `false`. */
|
|
29
30
|
hasClose?: boolean;
|
|
31
|
+
centerContent?: boolean;
|
|
30
32
|
/** Enables "hug" mode for a more compact tab layout with reduced padding.
|
|
31
33
|
|
|
32
34
|
Default: `false`. */
|
|
@@ -55,7 +57,7 @@ export interface Events {
|
|
|
55
57
|
}
|
|
56
58
|
export interface Slots {
|
|
57
59
|
tabIcon?: Snippet<[any]>;
|
|
58
|
-
|
|
60
|
+
tab?: Snippet<[any]>;
|
|
59
61
|
}
|
|
60
62
|
type $$ComponentProps = Props & Events & Slots;
|
|
61
63
|
declare const ObcTabRow: import("svelte").Component<$$ComponentProps, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oicl/openbridge-webcomponents-svelte",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.85",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build && npm run prepack",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@oicl/openbridge-webcomponents": "^2.0.0-next.
|
|
34
|
+
"@oicl/openbridge-webcomponents": "^2.0.0-next.84"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"svelte": "^5.0.0"
|