mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
chore: complete first pass of apply jsdoc annotations to component props
This commit is contained in:
parent
566a281d81
commit
f30755b237
97 changed files with 2327 additions and 259 deletions
|
@ -1,4 +1,7 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to use the vertical variant
|
||||
*/
|
||||
export let vertical = false;
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the current step index
|
||||
* @type {number} [currentIndex=0]
|
||||
*/
|
||||
export let currentIndex = 0;
|
||||
|
||||
/**
|
||||
* Set to `true` to use the vertical variant
|
||||
*/
|
||||
export let vertical = false;
|
||||
|
||||
import { createEventDispatcher, setContext } from "svelte";
|
||||
|
@ -7,27 +15,27 @@
|
|||
|
||||
const dispatch = createEventDispatcher();
|
||||
const steps = writable([]);
|
||||
const stepsById = derived(steps, $ =>
|
||||
const stepsById = derived(steps, ($) =>
|
||||
$.reduce((a, c) => ({ ...a, [c.id]: c }), {})
|
||||
);
|
||||
|
||||
setContext("ProgressIndicator", {
|
||||
steps,
|
||||
stepsById,
|
||||
add: step => {
|
||||
steps.update(_ => [
|
||||
add: (step) => {
|
||||
steps.update((_) => [
|
||||
..._,
|
||||
{
|
||||
...step,
|
||||
index: _.length,
|
||||
current: _.length === currentIndex,
|
||||
complete: _.length <= currentIndex
|
||||
}
|
||||
complete: _.length <= currentIndex,
|
||||
},
|
||||
]);
|
||||
},
|
||||
change: index => {
|
||||
change: (index) => {
|
||||
dispatch("change", index);
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,15 +1,44 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` for the complete variant
|
||||
* @type {boolean} [complete=false]
|
||||
*/
|
||||
export let complete = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to use the current variant
|
||||
* @type {boolean} [current=false]
|
||||
*/
|
||||
export let current = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the progress step
|
||||
* @type {boolean} [disabled=false]
|
||||
*/
|
||||
export let disabled = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to indicate an invalid state
|
||||
* @type {boolean} [invalid=false]
|
||||
*/
|
||||
export let invalid = false;
|
||||
|
||||
/**
|
||||
* Specify the step description
|
||||
* @type {string} [descripton=""]
|
||||
*/
|
||||
export let description = "";
|
||||
|
||||
/**
|
||||
* Specify the step label
|
||||
* @type {string} [label=""]
|
||||
*/
|
||||
export let label = "";
|
||||
|
||||
/**
|
||||
* Specify the step secondary label
|
||||
* @type {string} [secondaryLabel=""]
|
||||
*/
|
||||
export let secondaryLabel = "";
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue