@oicl/openbridge-webcomponents-svelte 2.0.0-next.81 → 2.0.0-next.82
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/dist/components/progress-bar/ObcProgressBar.svelte +34 -16
- package/dist/components/progress-bar/ObcProgressBar.svelte.d.ts +17 -1
- package/dist/components/progress-button/ObcProgressButton.svelte +49 -21
- package/dist/components/progress-button/ObcProgressButton.svelte.d.ts +18 -2
- package/package.json +2 -2
|
@@ -9,25 +9,41 @@
|
|
|
9
9
|
export interface Props {
|
|
10
10
|
class?: string;
|
|
11
11
|
style?: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
/** Layout type: `linear` (horizontal bar) or `circular` (ring). */
|
|
13
|
+
type?: ProgressBarType;
|
|
14
|
+
/** Progress mode: `determinate` tracks `value`, `indeterminate` loops indefinitely. */
|
|
15
|
+
mode?: ProgressBarMode;
|
|
16
|
+
/** Circular display state: `determinate` (numeric ring), `indeterminate` (animated ring with
|
|
17
|
+
icon), or `icon` (ring framing the icon slot). */
|
|
18
|
+
circularState?: CircularProgressState;
|
|
19
|
+
/** Progress percentage (0–100); clamped when rendered. */
|
|
20
|
+
value?: number;
|
|
21
|
+
/** Shows the value label above the bar (percentage when determinate, "Loading" when indeterminate). */
|
|
22
|
+
showValue?: boolean;
|
|
23
|
+
/** Appends a `%` unit next to the centered value. */
|
|
24
|
+
showUnit?: boolean;
|
|
25
|
+
/** Shows the `description` text below the bar. */
|
|
26
|
+
hasDescription?: boolean;
|
|
27
|
+
/** Description text rendered below the bar. */
|
|
28
|
+
description?: string;
|
|
29
|
+
/** Shows the `stateLabel` next to the value.
|
|
30
|
+
|
|
31
|
+
**TODO(designer):** Confirm the intended purpose of the state indicator — the story labels
|
|
32
|
+
this a "future feature". */
|
|
33
|
+
showState?: boolean;
|
|
34
|
+
/** Text shown alongside the value when `showState` is enabled. */
|
|
35
|
+
stateLabel?: string;
|
|
36
|
+
/** Uses a progressive indeterminate ring (spinning arc that grows with `value`); takes
|
|
37
|
+
precedence over `circularState`. */
|
|
38
|
+
progressiveIndeterminate?: boolean
|
|
23
39
|
}
|
|
24
40
|
export interface Events {
|
|
25
41
|
|
|
26
42
|
}
|
|
27
43
|
export interface Slots {
|
|
28
|
-
|
|
44
|
+
icon?: Snippet
|
|
29
45
|
}
|
|
30
|
-
const { class: className, style,
|
|
46
|
+
const { class: className, style, icon, ...props} = $props<Props & Events & Slots>();
|
|
31
47
|
|
|
32
48
|
</script>
|
|
33
49
|
<obc-progress-bar
|
|
@@ -36,7 +52,9 @@
|
|
|
36
52
|
style={style}
|
|
37
53
|
>
|
|
38
54
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
55
|
+
{#if icon}
|
|
56
|
+
<div slot="icon">
|
|
57
|
+
{@render icon()}
|
|
58
|
+
</div>
|
|
59
|
+
{/if}
|
|
42
60
|
</obc-progress-bar>
|
|
@@ -4,22 +4,38 @@ import type { Snippet } from 'svelte';
|
|
|
4
4
|
export interface Props {
|
|
5
5
|
class?: string;
|
|
6
6
|
style?: string;
|
|
7
|
+
/** Layout type: `linear` (horizontal bar) or `circular` (ring). */
|
|
7
8
|
type?: ProgressBarType;
|
|
9
|
+
/** Progress mode: `determinate` tracks `value`, `indeterminate` loops indefinitely. */
|
|
8
10
|
mode?: ProgressBarMode;
|
|
11
|
+
/** Circular display state: `determinate` (numeric ring), `indeterminate` (animated ring with
|
|
12
|
+
icon), or `icon` (ring framing the icon slot). */
|
|
9
13
|
circularState?: CircularProgressState;
|
|
14
|
+
/** Progress percentage (0–100); clamped when rendered. */
|
|
10
15
|
value?: number;
|
|
16
|
+
/** Shows the value label above the bar (percentage when determinate, "Loading" when indeterminate). */
|
|
11
17
|
showValue?: boolean;
|
|
18
|
+
/** Appends a `%` unit next to the centered value. */
|
|
12
19
|
showUnit?: boolean;
|
|
20
|
+
/** Shows the `description` text below the bar. */
|
|
13
21
|
hasDescription?: boolean;
|
|
22
|
+
/** Description text rendered below the bar. */
|
|
14
23
|
description?: string;
|
|
24
|
+
/** Shows the `stateLabel` next to the value.
|
|
25
|
+
|
|
26
|
+
**TODO(designer):** Confirm the intended purpose of the state indicator — the story labels
|
|
27
|
+
this a "future feature". */
|
|
15
28
|
showState?: boolean;
|
|
29
|
+
/** Text shown alongside the value when `showState` is enabled. */
|
|
16
30
|
stateLabel?: string;
|
|
31
|
+
/** Uses a progressive indeterminate ring (spinning arc that grows with `value`); takes
|
|
32
|
+
precedence over `circularState`. */
|
|
17
33
|
progressiveIndeterminate?: boolean;
|
|
18
34
|
}
|
|
19
35
|
export interface Events {
|
|
20
36
|
}
|
|
21
37
|
export interface Slots {
|
|
22
|
-
|
|
38
|
+
icon?: Snippet;
|
|
23
39
|
}
|
|
24
40
|
type $$ComponentProps = Props & Events & Slots;
|
|
25
41
|
declare const ObcProgressBar: import("svelte").Component<$$ComponentProps, {
|
|
@@ -1,43 +1,71 @@
|
|
|
1
1
|
|
|
2
2
|
<script lang="ts">
|
|
3
|
-
export type {ProgressButtonType, ButtonStyle, ProgressMode} from '@oicl/openbridge-webcomponents/dist/components/progress-button/progress-button.js';
|
|
3
|
+
export type {ProgressButtonClickEvent, ProgressButtonType, ButtonStyle, ProgressMode} from '@oicl/openbridge-webcomponents/dist/components/progress-button/progress-button.js';
|
|
4
4
|
import '@oicl/openbridge-webcomponents/dist/components/progress-button/progress-button.js';
|
|
5
5
|
import { setProperties } from "../../util.js";
|
|
6
|
-
import type {ProgressButtonType, ButtonStyle, ProgressMode} from '@oicl/openbridge-webcomponents/dist/components/progress-button/progress-button.js';
|
|
6
|
+
import type {ProgressButtonClickEvent, ProgressButtonType, ButtonStyle, ProgressMode} from '@oicl/openbridge-webcomponents/dist/components/progress-button/progress-button.js';
|
|
7
7
|
import type { Snippet } from 'svelte';
|
|
8
8
|
|
|
9
9
|
export interface Props {
|
|
10
10
|
class?: string;
|
|
11
11
|
style?: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
/** Layout type of the button: `linear` (label + bar) or `circular` (icon + ring). */
|
|
13
|
+
type?: ProgressButtonType;
|
|
14
|
+
/** Elevation style of the button surface. */
|
|
15
|
+
buttonStyle?: ButtonStyle;
|
|
16
|
+
/** Progress mode: `determinate` tracks `value`, `indeterminate` loops indefinitely. */
|
|
17
|
+
mode?: ProgressMode;
|
|
18
|
+
/** Progress percentage (0–100); clamped when rendered. */
|
|
19
|
+
value?: number;
|
|
20
|
+
/** Text shown in the button (linear) or below it (circular, when `showLabel`). */
|
|
21
|
+
label?: string;
|
|
22
|
+
/** Blocks interaction and suppresses the `obc-click` event. */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** Reveals the progress bar/ring. */
|
|
25
|
+
showProgress?: boolean;
|
|
26
|
+
/** Renders the `leading-icon` slot. */
|
|
27
|
+
hasLeadingIcon?: boolean;
|
|
28
|
+
/** Renders the `trailing-icon` slot. */
|
|
29
|
+
hasTrailingIcon?: boolean;
|
|
30
|
+
/** Shows an alert (error) ring/border around the button. */
|
|
31
|
+
hasAlert?: boolean;
|
|
32
|
+
/** Uses a progressive indeterminate ring that animates while advancing toward `value`. */
|
|
33
|
+
progressiveIndeterminate?: boolean;
|
|
34
|
+
/** Shows the `label` below the circular button. */
|
|
35
|
+
showLabel?: boolean
|
|
24
36
|
}
|
|
25
37
|
export interface Events {
|
|
26
|
-
|
|
38
|
+
onObcClick?: (event: CustomEvent<ProgressButtonClickEvent>) => void
|
|
27
39
|
}
|
|
28
40
|
export interface Slots {
|
|
29
|
-
|
|
41
|
+
leadingIcon?: Snippet;
|
|
42
|
+
trailingIcon?: Snippet;
|
|
43
|
+
icon?: Snippet
|
|
30
44
|
}
|
|
31
|
-
const { class: className, style,
|
|
45
|
+
const {onObcClick, class: className, style, leadingIcon, trailingIcon, icon, ...props} = $props<Props & Events & Slots>();
|
|
32
46
|
|
|
33
47
|
</script>
|
|
34
48
|
<obc-progress-button
|
|
35
49
|
use:setProperties={props}
|
|
36
50
|
class={className}
|
|
37
51
|
style={style}
|
|
38
|
-
|
|
52
|
+
onobc-click={onObcClick} >
|
|
39
53
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
54
|
+
{#if leadingIcon}
|
|
55
|
+
<div slot="leading-icon">
|
|
56
|
+
{@render leadingIcon()}
|
|
57
|
+
</div>
|
|
58
|
+
{/if}
|
|
59
|
+
|
|
60
|
+
{#if trailingIcon}
|
|
61
|
+
<div slot="trailing-icon">
|
|
62
|
+
{@render trailingIcon()}
|
|
63
|
+
</div>
|
|
64
|
+
{/if}
|
|
65
|
+
|
|
66
|
+
{#if icon}
|
|
67
|
+
<div slot="icon">
|
|
68
|
+
{@render icon()}
|
|
69
|
+
</div>
|
|
70
|
+
{/if}
|
|
43
71
|
</obc-progress-button>
|
|
@@ -1,29 +1,45 @@
|
|
|
1
1
|
import '@oicl/openbridge-webcomponents/dist/components/progress-button/progress-button.js';
|
|
2
|
-
import type { ProgressButtonType, ButtonStyle, ProgressMode } from '@oicl/openbridge-webcomponents/dist/components/progress-button/progress-button.js';
|
|
2
|
+
import type { ProgressButtonClickEvent, ProgressButtonType, ButtonStyle, ProgressMode } from '@oicl/openbridge-webcomponents/dist/components/progress-button/progress-button.js';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
4
|
export interface Props {
|
|
5
5
|
class?: string;
|
|
6
6
|
style?: string;
|
|
7
|
+
/** Layout type of the button: `linear` (label + bar) or `circular` (icon + ring). */
|
|
7
8
|
type?: ProgressButtonType;
|
|
9
|
+
/** Elevation style of the button surface. */
|
|
8
10
|
buttonStyle?: ButtonStyle;
|
|
11
|
+
/** Progress mode: `determinate` tracks `value`, `indeterminate` loops indefinitely. */
|
|
9
12
|
mode?: ProgressMode;
|
|
13
|
+
/** Progress percentage (0–100); clamped when rendered. */
|
|
10
14
|
value?: number;
|
|
15
|
+
/** Text shown in the button (linear) or below it (circular, when `showLabel`). */
|
|
11
16
|
label?: string;
|
|
17
|
+
/** Blocks interaction and suppresses the `obc-click` event. */
|
|
12
18
|
disabled?: boolean;
|
|
19
|
+
/** Reveals the progress bar/ring. */
|
|
13
20
|
showProgress?: boolean;
|
|
21
|
+
/** Renders the `leading-icon` slot. */
|
|
14
22
|
hasLeadingIcon?: boolean;
|
|
23
|
+
/** Renders the `trailing-icon` slot. */
|
|
15
24
|
hasTrailingIcon?: boolean;
|
|
25
|
+
/** Shows an alert (error) ring/border around the button. */
|
|
16
26
|
hasAlert?: boolean;
|
|
27
|
+
/** Uses a progressive indeterminate ring that animates while advancing toward `value`. */
|
|
17
28
|
progressiveIndeterminate?: boolean;
|
|
29
|
+
/** Shows the `label` below the circular button. */
|
|
18
30
|
showLabel?: boolean;
|
|
19
31
|
}
|
|
20
32
|
export interface Events {
|
|
33
|
+
onObcClick?: (event: CustomEvent<ProgressButtonClickEvent>) => void;
|
|
21
34
|
}
|
|
22
35
|
export interface Slots {
|
|
23
|
-
|
|
36
|
+
leadingIcon?: Snippet;
|
|
37
|
+
trailingIcon?: Snippet;
|
|
38
|
+
icon?: Snippet;
|
|
24
39
|
}
|
|
25
40
|
type $$ComponentProps = Props & Events & Slots;
|
|
26
41
|
declare const ObcProgressButton: import("svelte").Component<$$ComponentProps, {
|
|
42
|
+
ProgressButtonClickEvent: typeof ProgressButtonClickEvent;
|
|
27
43
|
ProgressButtonType: typeof ProgressButtonType;
|
|
28
44
|
ButtonStyle: typeof ButtonStyle;
|
|
29
45
|
ProgressMode: typeof ProgressMode;
|
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.82",
|
|
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.81"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"svelte": "^5.0.0"
|