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
|
@ -13,7 +13,7 @@
|
||||||
export let open = false;
|
export let open = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the ARIA label for the accordion item chevron icon
|
* Specify the ARIA label for the accordion item chevron icon
|
||||||
* @type {string} [iconDescription="Expand/Collapse"]
|
* @type {string} [iconDescription="Expand/Collapse"]
|
||||||
*/
|
*/
|
||||||
export let iconDescription = "Expand/Collapse";
|
export let iconDescription = "Expand/Collapse";
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* Set to `true` to hide breadcrumb trailing slash
|
* Set to `true` to hide the breadcrumb trailing slash
|
||||||
* @type {boolean} [noTrailingSlash=false]
|
* @type {boolean} [noTrailingSlash=false]
|
||||||
*/
|
*/
|
||||||
export let noTrailingSlash = false;
|
export let noTrailingSlash = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set number of breadcrumb items to render
|
* Specify the number of breadcrumb items to render
|
||||||
* @type {number} [count=3]
|
* @type {number} [count=3]
|
||||||
*/
|
*/
|
||||||
export let count = 3;
|
export let count = 3;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* Set to `true` to hide breadcrumb trailing slash
|
* Set to `true` to hide the breadcrumb trailing slash
|
||||||
* @type {boolean} [noTrailingSlash=false]
|
* @type {boolean} [noTrailingSlash=false]
|
||||||
*/
|
*/
|
||||||
export let noTrailingSlash = false;
|
export let noTrailingSlash = false;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
export let href = undefined;
|
export let href = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` if item is the current page
|
* Set to `true` if the breadcrumb item represents the current page
|
||||||
* @type {boolean} [isCurrentPage=false]
|
* @type {boolean} [isCurrentPage=false]
|
||||||
*/
|
*/
|
||||||
export let isCurrentPage = false;
|
export let isCurrentPage = false;
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default { title: "Button", decorators: [withKnobs] };
|
||||||
const kinds = {
|
const kinds = {
|
||||||
"Primary button (primary)": "primary",
|
"Primary button (primary)": "primary",
|
||||||
"Secondary button (secondary)": "secondary",
|
"Secondary button (secondary)": "secondary",
|
||||||
|
"Tertiary button (tertiary)": "tertiary",
|
||||||
"Danger button (danger)": "danger",
|
"Danger button (danger)": "danger",
|
||||||
"Ghost button (ghost)": "ghost",
|
"Ghost button (ghost)": "ghost",
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,64 @@
|
||||||
<script>
|
<script>
|
||||||
export let as = undefined;
|
/**
|
||||||
|
* Specify the kind of button
|
||||||
|
* @type {"primary" | "secondary" | "tertiary" | "ghost" | "danger"} [kind="primary"]
|
||||||
|
*/
|
||||||
|
export let kind = "primary";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the size of button
|
||||||
|
* @type {"default" | "field" | "small"} [size="default"]
|
||||||
|
*/
|
||||||
|
export let size = "default";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` for the icon-only variant
|
||||||
|
* @type {boolean} [hasIconOnly=false]
|
||||||
|
*/
|
||||||
|
export let hasIconOnly = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the icon from `carbon-icons-svelte` to render
|
||||||
|
* @type {typeof import("carbon-icons-svelte/lib/Add16").default} [icon]
|
||||||
|
*/
|
||||||
|
export let icon = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the button icon
|
||||||
|
* @type {string} [iconDescription]
|
||||||
|
*/
|
||||||
|
export let iconDescription = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the alignment of the tooltip relative to the icon
|
||||||
|
* `hasIconOnly` must be set to `true`
|
||||||
|
* @type {"start" | "center" | "end"} [tooltipAlignment]
|
||||||
|
*/
|
||||||
|
export let tooltipAlignment = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the position of the tooltip relative to the icon
|
||||||
|
* @type {"top" | "right" | "bottom" | "left"} [tooltipPosition]
|
||||||
|
*/
|
||||||
|
export let tooltipPosition = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to render a custom HTML element
|
||||||
|
* Props are destructured as `props` in the default slot (e.g. <Button let:props><div {...props}>...</div></Button>)
|
||||||
|
* @type {boolean} [as=false]
|
||||||
|
*/
|
||||||
|
export let as = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to display the skeleton state
|
||||||
|
* @type {boolean} [skeleton=false]
|
||||||
|
*/
|
||||||
export let skeleton = false;
|
export let skeleton = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the button
|
||||||
|
* @type [boolean] [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -8,15 +66,23 @@
|
||||||
* @type {string} [href]
|
* @type {string} [href]
|
||||||
*/
|
*/
|
||||||
export let href = undefined;
|
export let href = undefined;
|
||||||
export let icon = undefined;
|
|
||||||
export let iconDescription = undefined;
|
/**
|
||||||
export let hasIconOnly = false;
|
* Specify the tabindex
|
||||||
export let kind = "primary";
|
* @type {string} [tabindex="0"]
|
||||||
export let size = "default";
|
*/
|
||||||
export let tabindex = "0";
|
export let tabindex = "0";
|
||||||
export let tooltipAlignment = undefined;
|
|
||||||
export let tooltipPosition = undefined;
|
/**
|
||||||
|
* Specify the `type` attribute for the button element
|
||||||
|
* @type {string} [type="button"]
|
||||||
|
*/
|
||||||
export let type = "button";
|
export let type = "button";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the HTML element
|
||||||
|
* @type {null | HTMLAnchorElement | HTMLButtonElement} [ref=null]
|
||||||
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain a reference to the input HTML element
|
* Obtain a reference to the input HTML element
|
||||||
* @type {null | HTMLElement} [ref=null]
|
* @type {null | HTMLInputElement} [ref=null]
|
||||||
*/
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
<script>
|
<script>
|
||||||
export let type = "single"; // "single" | "multi"
|
/**
|
||||||
|
* Set the type of code snippet
|
||||||
|
* @type {"single" | "inline" | "multi"} [type="single"]
|
||||||
|
*/
|
||||||
|
export let type = "single";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -29,12 +29,49 @@
|
||||||
* @type {boolean} [skeleton=false]
|
* @type {boolean} [skeleton=false]
|
||||||
*/
|
*/
|
||||||
export let skeleton = false;
|
export let skeleton = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the copy button icon
|
||||||
|
* @type {string} [copyButtonDescription]
|
||||||
|
*/
|
||||||
export let copyButtonDescription = undefined;
|
export let copyButtonDescription = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label of the copy button
|
||||||
|
* @type {string} [copyLabel]
|
||||||
|
*/
|
||||||
export let copyLabel = undefined;
|
export let copyLabel = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the feedback text displayed when clicking the snippet
|
||||||
|
* @type {string} [feedback="Copied!"]
|
||||||
|
*/
|
||||||
export let feedback = "Copied!";
|
export let feedback = "Copied!";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the timeout duration (ms) to display feedback text
|
||||||
|
* @type {number} [feedbackTimeout=2000]
|
||||||
|
*/
|
||||||
export let feedbackTimeout = 2000;
|
export let feedbackTimeout = 2000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the show less text
|
||||||
|
* `type` must be "multi"
|
||||||
|
* @type {string} [showLessText="Show less"]
|
||||||
|
*/
|
||||||
export let showLessText = "Show less";
|
export let showLessText = "Show less";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the show more text
|
||||||
|
* `type` must be "multi"
|
||||||
|
* @type {string} [showLessText="Show more"]
|
||||||
|
*/
|
||||||
export let showMoreText = "Show more";
|
export let showMoreText = "Show more";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to enable the show more/less button
|
||||||
|
* @type {boolean} [showMoreLess=false]
|
||||||
|
*/
|
||||||
export let showMoreLess = false;
|
export let showMoreLess = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,7 +82,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain a reference to the pre HTML element
|
* Obtain a reference to the pre HTML element
|
||||||
* @type {null | HTMLElement} [ref=null]
|
* @type {null | HTMLPreElement} [ref=null]
|
||||||
*/
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,67 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* @typedef {{ id: string; text: string; }} ComboBoxItem
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the combobox items
|
||||||
|
* @type {ComboBoxItem[]} [items=[]]
|
||||||
|
*/
|
||||||
|
export let items = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the display of a combobox item
|
||||||
|
* @type {(item: ComboBoxItem) => string;} [itemToString = (item: ComboBoxItem) => string;]
|
||||||
|
*/
|
||||||
|
export let itemToString = (item) => item.text || item.id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the selected item by value index
|
||||||
|
* @type {number} [selectedIndex=-1]
|
||||||
|
*/
|
||||||
|
export let selectedIndex = -1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the selected combobox value
|
||||||
|
* @type {string} [value=""]
|
||||||
|
*/
|
||||||
|
export let value = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the size of the combobox
|
||||||
|
* @type {"sm" | "xl"} [size]
|
||||||
|
*/
|
||||||
|
export let size = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the combobox
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the title text of the combobox
|
||||||
|
* @type {string} [titleText=""]
|
||||||
|
*/
|
||||||
|
export let titleText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the placeholder text
|
||||||
|
* @type {string} [placeholder=""]
|
||||||
|
*/
|
||||||
|
export let placeholder = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the helper text
|
||||||
|
* @type {string} [helperText=""]
|
||||||
|
*/
|
||||||
export let helperText = "";
|
export let helperText = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the list box component
|
* Specify the invalid state text
|
||||||
* @type {string} [id]
|
* @type {string} [invalidText=""]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let invalidText = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to indicate an invalid state
|
* Set to `true` to indicate an invalid state
|
||||||
|
@ -15,23 +70,45 @@
|
||||||
export let invalid = false;
|
export let invalid = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the invalid state text
|
* Set to `true` to enable the light variant
|
||||||
* @type {string} [invalidText=""]
|
* @type {boolean} [light=false]
|
||||||
*/
|
*/
|
||||||
export let invalidText = "";
|
|
||||||
|
|
||||||
export let items = [];
|
|
||||||
export let itemToString = (item) => item.text || item.id;
|
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to open the combobox menu dropdown
|
||||||
|
* @type {boolean} [open=false]
|
||||||
|
*/
|
||||||
export let open = false;
|
export let open = false;
|
||||||
export let placeholder = "";
|
|
||||||
export let selectedIndex = -1;
|
/**
|
||||||
|
* Determine if an item should be filtered given the current combobox value
|
||||||
|
* @type {(item: ComboBoxItem, value: string) => boolean} [shouldFilterItem=() => true]
|
||||||
|
*/
|
||||||
export let shouldFilterItem = () => true;
|
export let shouldFilterItem = () => true;
|
||||||
export let size = undefined;
|
|
||||||
export let titleText = "";
|
/**
|
||||||
|
* Override the default translation ids
|
||||||
|
* @type {(id: any) => string;} [translateWithId]
|
||||||
|
*/
|
||||||
export let translateWithId = undefined;
|
export let translateWithId = undefined;
|
||||||
export let value = "";
|
|
||||||
|
/**
|
||||||
|
* Set an id for the list box component
|
||||||
|
* @type {string} [id]
|
||||||
|
*/
|
||||||
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the input
|
||||||
|
* @type {string} [name]
|
||||||
|
*/
|
||||||
export let name = undefined;
|
export let name = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the input HTML element
|
||||||
|
* @type {null | HTMLInputElement} [ref=null]
|
||||||
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import { afterUpdate } from "svelte";
|
import { afterUpdate } from "svelte";
|
||||||
|
|
|
@ -18,13 +18,13 @@
|
||||||
export let danger = false;
|
export let danger = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define a class for the inner modal
|
* Specify a class for the inner modal
|
||||||
* @type {string} [containerClass=""]
|
* @type {string} [containerClass=""]
|
||||||
*/
|
*/
|
||||||
export let containerClass = "";
|
export let containerClass = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define a selector to be focused when opening the modal
|
* Specify a selector to be focused when opening the modal
|
||||||
* @type {string} [selectorPrimaryFocus="[data-modal-primary-focus]"]
|
* @type {string} [selectorPrimaryFocus="[data-modal-primary-focus]"]
|
||||||
*/
|
*/
|
||||||
export let selectorPrimaryFocus = "[data-modal-primary-focus]";
|
export let selectorPrimaryFocus = "[data-modal-primary-focus]";
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` if the modal contains form elements
|
||||||
|
* @type {boolean} [hasForm=false]
|
||||||
|
*/
|
||||||
export let hasForm = false;
|
export let hasForm = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` if the modal contains scrolling content
|
||||||
|
* @type {boolean} [hasScrollingContent=false]
|
||||||
|
*/
|
||||||
export let hasScrollingContent = false;
|
export let hasScrollingContent = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,38 @@
|
||||||
<script>
|
<script>
|
||||||
export let primaryClass = undefined;
|
/**
|
||||||
|
* Specify the primary button text
|
||||||
|
* @type {string} [primaryButtonText=""]
|
||||||
|
*/
|
||||||
export let primaryButtonText = "";
|
export let primaryButtonText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the primary button
|
||||||
|
* @type {boolean} [primaryButtonDisabled=false]
|
||||||
|
*/
|
||||||
export let primaryButtonDisabled = false;
|
export let primaryButtonDisabled = false;
|
||||||
export let secondaryClass = undefined;
|
|
||||||
|
/**
|
||||||
|
* Specify a class for the primary button
|
||||||
|
* @type {string} [primaryClass]
|
||||||
|
*/
|
||||||
|
export let primaryClass = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the secondary button text
|
||||||
|
* @type {string} [secondaryButtonText=""]
|
||||||
|
*/
|
||||||
export let secondaryButtonText = "";
|
export let secondaryButtonText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a class for the secondary button
|
||||||
|
* @type {string} [secondaryClass]
|
||||||
|
*/
|
||||||
|
export let secondaryClass = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the danger variant
|
||||||
|
* @type {boolean} [danger=false]
|
||||||
|
*/
|
||||||
export let danger = false;
|
export let danger = false;
|
||||||
|
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
|
|
|
@ -1,10 +1,44 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the modal title
|
||||||
|
* @type {string} [title=""]
|
||||||
|
*/
|
||||||
export let title = "";
|
export let title = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the modal label
|
||||||
|
* @type {string} [label=""]
|
||||||
|
*/
|
||||||
export let label = "";
|
export let label = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the label class
|
||||||
|
* @type {string} [labelClass=""]
|
||||||
|
*/
|
||||||
export let labelClass = "";
|
export let labelClass = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the title class
|
||||||
|
* @type {string} [titleClass=""]
|
||||||
|
*/
|
||||||
export let titleClass = "";
|
export let titleClass = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the close class
|
||||||
|
* @type {string} [closeClass=""]
|
||||||
|
*/
|
||||||
export let closeClass = "";
|
export let closeClass = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the close icon class
|
||||||
|
* @type {string} [closeIconClass=""]
|
||||||
|
*/
|
||||||
export let closeIconClass = "";
|
export let closeIconClass = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the close icon
|
||||||
|
* @type {string} [iconDescription="Close"]
|
||||||
|
*/
|
||||||
export let iconDescription = "Close";
|
export let iconDescription = "Close";
|
||||||
|
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain a reference to the button HTML element
|
* Obtain a reference to the button HTML element
|
||||||
* @type {null | HTMLElement} [ref=null]
|
* @type {null | HTMLButtonElement} [ref=null]
|
||||||
*/
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain a reference to the button HTML element
|
* Obtain a reference to the button HTML element
|
||||||
* @type {null | HTMLElement} [ref=null]
|
* @type {null | HTMLButtonElement} [ref=null]
|
||||||
*/
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,52 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the data table headers
|
||||||
|
* @type {{key: string; value: string;}} [headers=[]]
|
||||||
|
*/
|
||||||
|
export let headers = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the rows the data table should render
|
||||||
|
* keys defined in `headers` are used for the row ids
|
||||||
|
* @type {Object[]} [rows=[]]
|
||||||
|
*/
|
||||||
|
export let rows = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the size of the data table
|
* Set the size of the data table
|
||||||
* @type {"compact" | "short" | "tall"} [size]
|
* @type {"compact" | "short" | "tall"} [size]
|
||||||
*/
|
*/
|
||||||
export let size = undefined;
|
export let size = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the title of the data table
|
||||||
|
* @type {string} [title=""]
|
||||||
|
*/
|
||||||
export let title = "";
|
export let title = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the description of the data table
|
||||||
|
* @type {string} [description=""]
|
||||||
|
*/
|
||||||
export let description = "";
|
export let description = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use zebra styles
|
||||||
|
* @type {boolean} [zebra=false]
|
||||||
|
*/
|
||||||
export let zebra = false;
|
export let zebra = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` for the sortable variant
|
||||||
|
* @type {boolean} [sortable=false]
|
||||||
|
*/
|
||||||
export let sortable = false;
|
export let sortable = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to enable a sticky header
|
||||||
|
* @type {boolean} [stickyHeader=false]
|
||||||
|
*/
|
||||||
export let stickyHeader = false;
|
export let stickyHeader = false;
|
||||||
export let rows = [];
|
|
||||||
export let headers = [];
|
|
||||||
|
|
||||||
import { createEventDispatcher, setContext } from "svelte";
|
import { createEventDispatcher, setContext } from "svelte";
|
||||||
import { writable, derived } from "svelte/store";
|
import { writable, derived } from "svelte/store";
|
||||||
|
|
|
@ -1,9 +1,38 @@
|
||||||
<script>
|
<script>
|
||||||
export let size = undefined; // "compact" | "short" | "tall"
|
/**
|
||||||
|
* Set the size of the table
|
||||||
|
* @type {"compact" | "short" | "tall"} [size]
|
||||||
|
*/
|
||||||
|
export let size = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use zebra styles
|
||||||
|
* @type {boolean} [zebra=false]
|
||||||
|
*/
|
||||||
export let zebra = false;
|
export let zebra = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use static width
|
||||||
|
* @type {boolean} [useStaticWidth=false]
|
||||||
|
*/
|
||||||
export let useStaticWidth = false;
|
export let useStaticWidth = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` for the bordered variant
|
||||||
|
* @type {boolean} [shouldShowBorder=false]
|
||||||
|
*/
|
||||||
export let shouldShowBorder = false;
|
export let shouldShowBorder = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` for the sortable variant
|
||||||
|
* @type {boolean} [sortable=false]
|
||||||
|
*/
|
||||||
export let sortable = false;
|
export let sortable = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to enable a sticky header
|
||||||
|
* @type {boolean} [stickyHeader=false]
|
||||||
|
*/
|
||||||
export let stickyHeader = false;
|
export let stickyHeader = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,21 @@
|
||||||
<script>
|
<script>
|
||||||
export let stickyHeader = false;
|
/**
|
||||||
|
* Specify the title of the data table
|
||||||
|
* @type {string} [title=""]
|
||||||
|
*/
|
||||||
export let title = "";
|
export let title = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the description of the data table
|
||||||
|
* @type {string} [description=""]
|
||||||
|
*/
|
||||||
export let description = "";
|
export let description = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to enable a sticky header
|
||||||
|
* @type {boolean} [stickyHeader=false]
|
||||||
|
*/
|
||||||
|
export let stickyHeader = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the `scope` attribute
|
||||||
|
* @type {string} [scope="col"]
|
||||||
|
*/
|
||||||
export let scope = "col";
|
export let scope = "col";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the default id translations
|
||||||
|
* @type {() => string;} [translateWithId = () => "";]
|
||||||
|
*/
|
||||||
export let translateWithId = () => "";
|
export let translateWithId = () => "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to select the row
|
||||||
|
* @type {boolean} [isSelected=false]
|
||||||
|
*/
|
||||||
export let isSelected = false;
|
export let isSelected = false;
|
||||||
|
|
||||||
// TODO: include ariaLabel, onExpand, isExpanded, isSelected
|
// TODO: include ariaLabel, onExpand, isExpanded, isSelected
|
||||||
|
|
|
@ -1,28 +1,63 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the date picker type
|
||||||
|
* @type {"simple" | "single" | "range"} [datePickerType="simple"]
|
||||||
|
*/
|
||||||
|
export let datePickerType = "simple";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the date picker input value
|
||||||
|
* @type {string} [value=""]
|
||||||
|
*/
|
||||||
|
export let value = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the element to append the calendar to
|
* Specify the element to append the calendar to
|
||||||
* @type {HTMLElement} [appendTo=document.body]
|
* @type {HTMLElement} [appendTo=document.body]
|
||||||
*/
|
*/
|
||||||
export let appendTo = document.body;
|
export let appendTo = document.body;
|
||||||
export let dateFormat = "m/d/Y";
|
|
||||||
export let datePickerType = "simple";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the date picker element
|
* Specify the date format
|
||||||
* @type {string} [id]
|
* @type {string} [dateFormat="m/d/Y"]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let dateFormat = "m/d/Y";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the maximum date
|
||||||
|
* @type {null | string | Date} [maxDate=null]
|
||||||
|
*/
|
||||||
|
export let maxDate = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the minimum date
|
||||||
|
* @type {null | string | Date} [minDate=null]
|
||||||
|
*/
|
||||||
|
export let minDate = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the locale
|
||||||
|
* @type {string} [locale="en"]
|
||||||
|
*/
|
||||||
|
export let locale = "en";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the short variant
|
||||||
|
* @type {boolean} [short=false]
|
||||||
|
*/
|
||||||
|
export let short = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to enable the light variant
|
* Set to `true` to enable the light variant
|
||||||
* @type {boolean} [light=false]
|
* @type {boolean} [light=false]
|
||||||
*/
|
*/
|
||||||
export let light = false;
|
export let light = false;
|
||||||
export let locale = "en";
|
|
||||||
export let maxDate = null;
|
/**
|
||||||
export let minDate = null;
|
* Set an id for the date picker element
|
||||||
export let short = false;
|
* @type {string} [id]
|
||||||
export let value = "";
|
*/
|
||||||
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createEventDispatcher,
|
createEventDispatcher,
|
||||||
|
|
|
@ -4,6 +4,11 @@
|
||||||
* @type {"sm" | "xl"} [size]
|
* @type {"sm" | "xl"} [size]
|
||||||
*/
|
*/
|
||||||
export let size = undefined;
|
export let size = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the input type
|
||||||
|
* @type {string} [type="text"]
|
||||||
|
*/
|
||||||
export let type = "text";
|
export let type = "text";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +20,7 @@
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the ARIA label for the calendar icon
|
* Specify the ARIA label for the calendar icon
|
||||||
* @type {string} [iconDescription=""]
|
* @type {string} [iconDescription=""]
|
||||||
*/
|
*/
|
||||||
export let iconDescription = "";
|
export let iconDescription = "";
|
||||||
|
@ -44,7 +49,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain a reference to the input HTML element
|
* Obtain a reference to the input HTML element
|
||||||
* @type {null | HTMLElement} [ref=null]
|
* @type {null | HTMLInputElement} [ref=null]
|
||||||
*/
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,44 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* @typedef {string} DropdownItemId
|
||||||
|
* @typedef {string} DropdownItemText
|
||||||
|
* @typedef {{ id: DropdownItemId; text: DropdownItemText; }} DropdownItem
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the dropdown items
|
||||||
|
* @type {DropdownItem[]} [items=[]]
|
||||||
|
*/
|
||||||
|
export let items = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the display of a dropdown item
|
||||||
|
* @type {(item: DropdownItem) => string;} [itemToString = (item: DropdownItem) => DropdownItemText | DropdownItemId;]
|
||||||
|
*/
|
||||||
|
export let itemToString = (item) => item.text || item.id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the selected item index
|
||||||
|
* @type {number} [selectedIndex=-1]
|
||||||
|
*/
|
||||||
export let selectedIndex = -1;
|
export let selectedIndex = -1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the type of dropdown
|
||||||
|
* @type {"default" | "inline"} [type="default"]
|
||||||
|
*/
|
||||||
|
export let type = "default";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the size of the dropdown field
|
||||||
|
* @type {"sm" | "lg" | "xl"} [size]
|
||||||
|
*/
|
||||||
|
export let size = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to open the dropdown
|
||||||
|
* @type {boolean} [open=false]
|
||||||
|
*/
|
||||||
export let open = false;
|
export let open = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,8 +52,19 @@
|
||||||
* @type {boolean} [light=false]
|
* @type {boolean} [light=false]
|
||||||
*/
|
*/
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the dropdown
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the title text
|
||||||
|
* @type {string} [titleText=""]
|
||||||
|
*/
|
||||||
|
export let titleText = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to indicate an invalid state
|
* Set to `true` to indicate an invalid state
|
||||||
* @type {boolean} [invalid=false]
|
* @type {boolean} [invalid=false]
|
||||||
|
@ -27,22 +77,40 @@
|
||||||
*/
|
*/
|
||||||
export let invalidText = "";
|
export let invalidText = "";
|
||||||
|
|
||||||
export let items = [];
|
/**
|
||||||
export let itemToString = (item) => item.text || item.id;
|
* Specify the helper text
|
||||||
export let type = "default"; // "default" | "inline"
|
* @type {string} [helperText=""]
|
||||||
export let size = undefined; // "sm" | "lg" | "xl"
|
*/
|
||||||
|
export let helperText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the list box label
|
||||||
|
* @type {string} [label]
|
||||||
|
*/
|
||||||
|
export let label = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the default translation ids
|
||||||
|
* @type {(id: any) => string;} [translateWithId]
|
||||||
|
*/
|
||||||
|
export let translateWithId = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the list box component
|
* Set an id for the list box component
|
||||||
* @type {string} [id]
|
* @type {string} [id]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the list box
|
||||||
|
* @type {string} [name]
|
||||||
|
*/
|
||||||
export let name = undefined;
|
export let name = undefined;
|
||||||
|
|
||||||
export let helperText = "";
|
/**
|
||||||
export let label = undefined;
|
* Obtain a reference to the button HTML element
|
||||||
export let titleText = "";
|
* @type {null | HTMLButtonElement} [ref=null]
|
||||||
export let translateWithId = undefined;
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import { setContext } from "svelte";
|
import { setContext } from "svelte";
|
||||||
|
|
|
@ -1,14 +1,70 @@
|
||||||
<script>
|
<script>
|
||||||
export let status = "uploading"; // "uploading" | "edit" | "complete"
|
/**
|
||||||
|
* Specify the file uploader status
|
||||||
|
* @type {"uploading" | "edit" | "complete"} [status="uploading"]
|
||||||
|
*/
|
||||||
|
export let status = "uploading";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the accepted file types
|
||||||
|
* @type {string[]} [accept=[]]
|
||||||
|
*/
|
||||||
export let accept = [];
|
export let accept = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain the uploaded file names
|
||||||
|
* @type {string[]} [files=[]]
|
||||||
|
*/
|
||||||
export let files = [];
|
export let files = [];
|
||||||
export const clearFiles = () => (files = []);
|
|
||||||
export let buttonLabel = "";
|
/**
|
||||||
export let iconDescription = "Provide icon description";
|
* Set to `true` to allow multiple files
|
||||||
export let kind = "primary";
|
* @type {boolean} [multiple=false]
|
||||||
export let labelDescription = "";
|
*/
|
||||||
export let labelTitle = "";
|
|
||||||
export let multiple = false;
|
export let multiple = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the default behavior of clearing the array of uploaded files
|
||||||
|
* @type {() => any;} [clearFiles = () => void;]
|
||||||
|
*/
|
||||||
|
export const clearFiles = () => {
|
||||||
|
files = [];
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the label description
|
||||||
|
* @type {string} [labelDescription=""]
|
||||||
|
*/
|
||||||
|
export let labelDescription = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the label title
|
||||||
|
* @type {string} [labelTitle=""]
|
||||||
|
*/
|
||||||
|
export let labelTitle = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the kind of file uploader button
|
||||||
|
* @type {"primary" | "secondary" | "tertiary" | "ghost" | "danger"} [kind="primary"]
|
||||||
|
*/
|
||||||
|
export let kind = "primary";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the button label
|
||||||
|
* @type {string} [buttonLabel=""]
|
||||||
|
*/
|
||||||
|
export let buttonLabel = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label used for the status icons
|
||||||
|
* @type {string} [iconDescription=""]
|
||||||
|
*/
|
||||||
|
export let iconDescription = "Provide icon description";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the file button uploader input
|
||||||
|
* @type {string} [name]
|
||||||
|
*/
|
||||||
export let name = "";
|
export let name = "";
|
||||||
|
|
||||||
import { createEventDispatcher, afterUpdate } from "svelte";
|
import { createEventDispatcher, afterUpdate } from "svelte";
|
||||||
|
@ -23,7 +79,10 @@
|
||||||
if (files.length > prevFiles.length) {
|
if (files.length > prevFiles.length) {
|
||||||
dispatch("add", files);
|
dispatch("add", files);
|
||||||
} else {
|
} else {
|
||||||
dispatch("remove", prevFiles.filter(_ => !files.includes(_)));
|
dispatch(
|
||||||
|
"remove",
|
||||||
|
prevFiles.filter((_) => !files.includes(_))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
prevFiles = [...files];
|
prevFiles = [...files];
|
||||||
|
|
|
@ -1,11 +1,50 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the accepted file types
|
||||||
|
* @type {string[]} [accept=[]]
|
||||||
|
*/
|
||||||
export let accept = [];
|
export let accept = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to allow multiple files
|
||||||
|
* @type {boolean} [multiple=false]
|
||||||
|
*/
|
||||||
export let multiple = false;
|
export let multiple = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the input
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable label changes
|
||||||
|
* @type {boolean} [disableLabelChanges=false]
|
||||||
|
*/
|
||||||
export let disableLabelChanges = false;
|
export let disableLabelChanges = false;
|
||||||
export let kind = "primary"; // Button.kind
|
|
||||||
|
/**
|
||||||
|
* Specify the kind of file uploader button
|
||||||
|
* @type {"primary" | "secondary" | "tertiary" | "ghost" | "danger"} [kind="primary"]
|
||||||
|
*/
|
||||||
|
export let kind = "primary";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the label text
|
||||||
|
* @type {string} [labelText="Add file"]
|
||||||
|
*/
|
||||||
export let labelText = "Add file";
|
export let labelText = "Add file";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the label role
|
||||||
|
* @type {string} [role="button"]
|
||||||
|
*/
|
||||||
export let role = "button";
|
export let role = "button";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify `tabindex` attribute
|
||||||
|
* @type {string} [tabindex="0"]
|
||||||
|
*/
|
||||||
export let tabindex = "0";
|
export let tabindex = "0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,7 +52,17 @@
|
||||||
* @type {string} [id]
|
* @type {string} [id]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the input
|
||||||
|
* @type {string} [name]
|
||||||
|
*/
|
||||||
export let name = "";
|
export let name = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the input HTML element
|
||||||
|
* @type {null | HTMLInputElement} [ref=null]
|
||||||
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,49 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* @typedef {string[]} Files
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the accepted file types
|
||||||
|
* @type {string[]} [accept=[]]
|
||||||
|
*/
|
||||||
export let accept = [];
|
export let accept = [];
|
||||||
export let disabled = false;
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to allow multiple files
|
||||||
|
* @type {boolean} [multiple=false]
|
||||||
|
*/
|
||||||
export let multiple = false;
|
export let multiple = false;
|
||||||
export let validateFiles = files => files;
|
|
||||||
|
/**
|
||||||
|
* Override the default behavior of validating uploaded files
|
||||||
|
* The default behavior does not validate files
|
||||||
|
* @type {(files: Files) => Files} [validateFiles = (files: Files) => Files;]
|
||||||
|
*/
|
||||||
|
export let validateFiles = (files) => files;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the label text
|
||||||
|
* @type {string} [labelText="Add file"]
|
||||||
|
*/
|
||||||
export let labelText = "Add file";
|
export let labelText = "Add file";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the `role` attribute of the drop container
|
||||||
|
* @type {string} [role="button"]
|
||||||
|
*/
|
||||||
export let role = "button";
|
export let role = "button";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the input
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify `tabindex` attribute
|
||||||
|
* @type {string} [tabindex="0"]
|
||||||
|
*/
|
||||||
export let tabindex = "0";
|
export let tabindex = "0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,7 +51,17 @@
|
||||||
* @type {string} [id]
|
* @type {string} [id]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the input
|
||||||
|
* @type {string} [name=""]
|
||||||
|
*/
|
||||||
export let name = "";
|
export let name = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the input HTML element
|
||||||
|
* @type {null | HTMLInputElement} [ref=null]
|
||||||
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import { createEventDispatcher } from "svelte";
|
import { createEventDispatcher } from "svelte";
|
||||||
|
|
|
@ -1,16 +1,45 @@
|
||||||
<script>
|
<script>
|
||||||
export let errorBody = "";
|
/**
|
||||||
export let errorSubject = "";
|
* Specify the file uploader status
|
||||||
|
* @type {"uploading" | "edit" | "complete"} [status="uploading"]
|
||||||
|
*/
|
||||||
|
export let status = "uploading";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label used for the status icons
|
||||||
|
* @type {string} [iconDescription=""]
|
||||||
|
*/
|
||||||
export let iconDescription = "";
|
export let iconDescription = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to indicate an invalid state
|
||||||
|
* @type {boolean} [invalid=false]
|
||||||
|
*/
|
||||||
|
export let invalid = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the error subject text
|
||||||
|
* @type {string} [errorSubject=""]
|
||||||
|
*/
|
||||||
|
export let errorSubject = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the error body text
|
||||||
|
* @type {string} [errorBody=""]
|
||||||
|
*/
|
||||||
|
export let errorBody = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the top-level element
|
* Set an id for the top-level element
|
||||||
* @type {string} [id]
|
* @type {string} [id]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
export let invalid = false;
|
|
||||||
|
/**
|
||||||
|
* Specify the file uploader name
|
||||||
|
* @type {string} [name=""]
|
||||||
|
*/
|
||||||
export let name = "";
|
export let name = "";
|
||||||
export let status = "uploading";
|
|
||||||
|
|
||||||
import { createEventDispatcher } from "svelte";
|
import { createEventDispatcher } from "svelte";
|
||||||
import Filename from "./Filename.svelte";
|
import Filename from "./Filename.svelte";
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* Specify the filename status
|
* Specify the file name status
|
||||||
* @type {"uploading" | "edit" | "complete"} [status="uploading"]
|
* @type {"uploading" | "edit" | "complete"} [status="uploading"]
|
||||||
*/
|
*/
|
||||||
export let status = "uploading";
|
export let status = "uploading";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the ARIA label used for the status icons
|
* Specify the ARIA label used for the status icons
|
||||||
* @type {string} [iconDescription=""]
|
* @type {string} [iconDescription=""]
|
||||||
*/
|
*/
|
||||||
export let iconDescription = "";
|
export let iconDescription = "";
|
||||||
|
|
|
@ -1,35 +1,61 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to render a custom HTML element
|
||||||
|
* Props are destructured as `props` in the default slot (e.g. <Column let:props><article {...props}>...</article></Column>)
|
||||||
|
* @type {boolean} [as=false]
|
||||||
|
*/
|
||||||
export let as = false;
|
export let as = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to remove the gutter
|
||||||
|
* @type {boolean} [noGutter=false]
|
||||||
|
*/
|
||||||
export let noGutter = false;
|
export let noGutter = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to remove the left gutter
|
||||||
|
* @type {boolean} [noGutterLeft=false]
|
||||||
|
*/
|
||||||
export let noGutterLeft = false;
|
export let noGutterLeft = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to remove the right gutter
|
||||||
|
* @type {boolean} [noGutterRight=false]
|
||||||
|
*/
|
||||||
export let noGutterRight = false;
|
export let noGutterRight = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Aspect ratio of the column
|
* Specify the aspect ratio of the column
|
||||||
* @type {"2x1" | "16x9" | "9x16" | "1x2" | "4x3" | "3x4" | "1x1"} [aspectRatio]
|
* @type {"2x1" | "16x9" | "9x16" | "1x2" | "4x3" | "3x4" | "1x1"} [aspectRatio]
|
||||||
*/
|
*/
|
||||||
export let aspectRatio = undefined;
|
export let aspectRatio = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {boolean | number} ColumnSize
|
* @typedef {boolean | number} ColumnSize
|
||||||
* @typedef {{span?: ColumnSize: offset: number}} ColumnSizeDescriptor
|
* @typedef {{span?: ColumnSize: offset: number;}} ColumnSizeDescriptor
|
||||||
|
* @typedef {ColumnSize | ColumnSizeDescriptor} ColumnBreakpoint
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @type {ColumnSize | ColumnSizeDescriptor} [sm] */
|
/** @type {ColumnBreakpoint} [sm] */
|
||||||
export let sm = undefined;
|
export let sm = undefined;
|
||||||
|
|
||||||
/** @type {ColumnSize | ColumnSizeDescriptor} [md] */
|
/** @type {ColumnBreakpoint} [md] */
|
||||||
export let md = undefined;
|
export let md = undefined;
|
||||||
|
|
||||||
/** @type {ColumnSize | ColumnSizeDescriptor} [lg] */
|
/** @type {ColumnBreakpoint} [lg] */
|
||||||
export let lg = undefined;
|
export let lg = undefined;
|
||||||
|
|
||||||
/** @type {ColumnSize | ColumnSizeDescriptor} [xlg] */
|
/** @type {ColumnBreakpoint} [xlg] */
|
||||||
export let xlg = undefined;
|
export let xlg = undefined;
|
||||||
|
|
||||||
/** @type {ColumnSize | ColumnSizeDescriptor} [max] */
|
/** @type {ColumnBreakpoint} [max] */
|
||||||
export let max = undefined;
|
export let max = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Column breakpoints
|
||||||
|
* @constant
|
||||||
|
* @type {string[]}
|
||||||
|
*/
|
||||||
const breakpoints = ["sm", "md", "lg", "xlg", "max"];
|
const breakpoints = ["sm", "md", "lg", "xlg", "max"];
|
||||||
|
|
||||||
$: columnClass = [sm, md, lg, xlg, max]
|
$: columnClass = [sm, md, lg, xlg, max]
|
||||||
|
|
|
@ -1,10 +1,45 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to render a custom HTML element
|
||||||
|
* Props are destructured as `props` in the default slot (e.g. <Grid let:props><header {...props}>...</header></Grid>)
|
||||||
|
* @type {boolean} [as=false]
|
||||||
|
*/
|
||||||
export let as = false;
|
export let as = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the condensed variant
|
||||||
|
* @type {boolean} [condensed=false]
|
||||||
|
*/
|
||||||
export let condensed = false;
|
export let condensed = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the narrow variant
|
||||||
|
* @type {boolean} [narrow=false]
|
||||||
|
*/
|
||||||
export let narrow = false;
|
export let narrow = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the fullWidth variant
|
||||||
|
* @type {boolean} [fullWidth=false]
|
||||||
|
*/
|
||||||
export let fullWidth = false;
|
export let fullWidth = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to remove the gutter
|
||||||
|
* @type {boolean} [noGutter=false]
|
||||||
|
*/
|
||||||
export let noGutter = false;
|
export let noGutter = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to remove the left gutter
|
||||||
|
* @type {boolean} [noGutterLeft=false]
|
||||||
|
*/
|
||||||
export let noGutterLeft = false;
|
export let noGutterLeft = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to remove the right gutter
|
||||||
|
* @type {boolean} [noGutterRight=false]
|
||||||
|
*/
|
||||||
export let noGutterRight = false;
|
export let noGutterRight = false;
|
||||||
|
|
||||||
$: props = {
|
$: props = {
|
||||||
|
|
|
@ -1,9 +1,39 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to render a custom HTML element
|
||||||
|
* Props are destructured as `props` in the default slot (e.g. <Row let:props><section {...props}>...</section></Row>)
|
||||||
|
* @type {boolean} [as=false]
|
||||||
|
*/
|
||||||
export let as = false;
|
export let as = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the condensed variant
|
||||||
|
* @type {boolean} [condensed=false]
|
||||||
|
*/
|
||||||
export let condensed = false;
|
export let condensed = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the narrow variant
|
||||||
|
* @type {boolean} [narrow=false]
|
||||||
|
*/
|
||||||
export let narrow = false;
|
export let narrow = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to remove the gutter
|
||||||
|
* @type {boolean} [noGutter=false]
|
||||||
|
*/
|
||||||
export let noGutter = false;
|
export let noGutter = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to remove the left gutter
|
||||||
|
* @type {boolean} [noGutterLeft=false]
|
||||||
|
*/
|
||||||
export let noGutterLeft = false;
|
export let noGutterLeft = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to remove the right gutter
|
||||||
|
* @type {boolean} [noGutterRight=false]
|
||||||
|
*/
|
||||||
export let noGutterRight = false;
|
export let noGutterRight = false;
|
||||||
|
|
||||||
$: props = {
|
$: props = {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
/**
|
/**
|
||||||
* Specify the icon from `carbon-icons-svelte` to render
|
* Specify the icon from `carbon-icons-svelte` to render
|
||||||
* Icon size must be 16px (e.g. `Add16`, `Task16`)
|
* Icon size must be 16px (e.g. `Add16`, `Task16`)
|
||||||
* @type {typeof import("carbon-icons-svelte/lib/Add16")} [render]
|
* @type {typeof import("carbon-icons-svelte/lib/Add16").default} [render]
|
||||||
*/
|
*/
|
||||||
export let render = undefined;
|
export let render = undefined;
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
export let description = undefined;
|
export let description = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the ARIA label for the loading icon
|
* Specify the ARIA label for the loading icon
|
||||||
* @type {string} [iconDescription="Expand/Collapse"]
|
* @type {string} [iconDescription="Expand/Collapse"]
|
||||||
*/
|
*/
|
||||||
export let iconDescription = undefined;
|
export let iconDescription = undefined;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain a reference to the top-level HTML element
|
* Obtain a reference to the top-level HTML element
|
||||||
* @type {null | HTMLElement} [ref=null]
|
* @type {null | HTMLAnchorElement | HTMLParagraphElement} [ref=null]
|
||||||
*/
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* Set the size of list box
|
* Set the size of the list box
|
||||||
* @type {"sm" | "xl"} [size]
|
* @type {"sm" | "xl"} [size]
|
||||||
*/
|
*/
|
||||||
export let size = undefined;
|
export let size = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the type of list box
|
* Set the type of the list box
|
||||||
* @type {"default" | "inline"} [type="default"]
|
* @type {"default" | "inline"} [type="default"]
|
||||||
*/
|
*/
|
||||||
export let type = "default";
|
export let type = "default";
|
||||||
|
|
|
@ -1,8 +1,37 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the list box field
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the role attribute
|
||||||
|
* @type {string} [role="combobox"]
|
||||||
|
*/
|
||||||
export let role = "combobox";
|
export let role = "combobox";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the tabindex
|
||||||
|
* @type {string} [tabindex="-1"]
|
||||||
|
*/
|
||||||
export let tabindex = "-1";
|
export let tabindex = "-1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {"close" | "open"} ListBoxFieldTranslationId
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default translation ids
|
||||||
|
* @constant
|
||||||
|
* @type {{ close: "close"; open: "open"; }}
|
||||||
|
*/
|
||||||
export const translationIds = { close: "close", open: "open" };
|
export const translationIds = { close: "close", open: "open" };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the default translation ids
|
||||||
|
* @type {(id: ListBoxFieldTranslationId) => string;} [translateWithId = (id) => string;]
|
||||||
|
*/
|
||||||
export let translateWithId = (id) => defaultTranslations[id];
|
export let translateWithId = (id) => defaultTranslations[id];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,13 +1,32 @@
|
||||||
<script>
|
<script>
|
||||||
export const translationIds = { close: "close", open: "open" };
|
/**
|
||||||
|
* Set to `true` to open the list box menu icon
|
||||||
|
* @type {boolean} [open=false]
|
||||||
|
*/
|
||||||
export let open = false;
|
export let open = false;
|
||||||
export let translateWithId = id => defaultTranslations[id];
|
|
||||||
|
/**
|
||||||
|
* Default translation ids
|
||||||
|
* @constant
|
||||||
|
* @type {{ close: "close"; open: "open" }}
|
||||||
|
*/
|
||||||
|
export const translationIds = { close: "close", open: "open" };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {"close" | "open"} ListBoxMenuIconTranslationId
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the default translation ids
|
||||||
|
* @type {(id: ListBoxMenuIconTranslationId) => string;} [translateWithId = (id) => string;]
|
||||||
|
*/
|
||||||
|
export let translateWithId = (id) => defaultTranslations[id];
|
||||||
|
|
||||||
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16";
|
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16";
|
||||||
|
|
||||||
const defaultTranslations = {
|
const defaultTranslations = {
|
||||||
[translationIds.close]: "Close menu",
|
[translationIds.close]: "Close menu",
|
||||||
[translationIds.open]: "Open menu"
|
[translationIds.open]: "Open menu",
|
||||||
};
|
};
|
||||||
|
|
||||||
$: description = open ? translateWithId("close") : translateWithId("open");
|
$: description = open ? translateWithId("close") : translateWithId("open");
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to enable the active state
|
||||||
|
* @type {boolean} [active=false]
|
||||||
|
*/
|
||||||
export let active = false;
|
export let active = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to enable the highlighted state
|
||||||
|
* @type {boolean} [highlighted=false]
|
||||||
|
*/
|
||||||
export let highlighted = false;
|
export let highlighted = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,34 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the number of selected items
|
||||||
|
* @type {*} [selectionCount]
|
||||||
|
*/
|
||||||
|
export let selectionCount = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the list box selection
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {"clearAll" | "clearSelection"} ListBoxSelectionTranslationId
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default translation ids
|
||||||
|
* @constant
|
||||||
|
* @type {{ clearAll: "clearAll"; clearSelection: "clearSelection" }}
|
||||||
|
*/
|
||||||
export const translationIds = {
|
export const translationIds = {
|
||||||
clearAll: "clearAll",
|
clearAll: "clearAll",
|
||||||
clearSelection: "clearSelection",
|
clearSelection: "clearSelection",
|
||||||
};
|
};
|
||||||
export let disabled = false;
|
|
||||||
export let selectionCount = undefined;
|
/**
|
||||||
|
* Override the default translation ids
|
||||||
|
* @type {(id: ListBoxSelectionTranslationId) => string;} [translateWithId = (id) => string;]
|
||||||
|
*/
|
||||||
export let translateWithId = (id) => defaultTranslations[id];
|
export let translateWithId = (id) => defaultTranslations[id];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,19 +23,68 @@
|
||||||
*/
|
*/
|
||||||
export let passiveModal = false;
|
export let passiveModal = false;
|
||||||
|
|
||||||
export let hasForm = false;
|
/**
|
||||||
export let hasScrollingContent = false;
|
* Specify the modal heading
|
||||||
export let primaryButtonDisabled = false;
|
* @type {string} [modalHeading]
|
||||||
export let shouldSubmitOnEnter = true;
|
*/
|
||||||
export let modalAriaLabel = undefined;
|
|
||||||
export let modalHeading = undefined;
|
export let modalHeading = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the modal label
|
||||||
|
* @type {string} [modalLabel]
|
||||||
|
*/
|
||||||
export let modalLabel = undefined;
|
export let modalLabel = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the modal
|
||||||
|
* @type {string} [modalAriaLabel]
|
||||||
|
*/
|
||||||
|
export let modalAriaLabel = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the close icon
|
||||||
|
* @type {string} [iconDescription="Close the modal"]
|
||||||
|
*/
|
||||||
export let iconDescription = "Close the modal";
|
export let iconDescription = "Close the modal";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` if the modal contains form elements
|
||||||
|
* @type {boolean} [hasForm=false]
|
||||||
|
*/
|
||||||
|
export let hasForm = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` if the modal contains scrolling content
|
||||||
|
* @type {boolean} [hasScrollingContent=false]
|
||||||
|
*/
|
||||||
|
export let hasScrollingContent = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the primary button text
|
||||||
|
* @type {string} [primaryButtonText=""]
|
||||||
|
*/
|
||||||
export let primaryButtonText = "";
|
export let primaryButtonText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the primary button
|
||||||
|
* @type {boolean} [primaryButtonDisabled=false]
|
||||||
|
*/
|
||||||
|
export let primaryButtonDisabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` for the primary button to be triggered when pressing "Enter"
|
||||||
|
* @type {boolean} [shouldSubmitOnEnter=true]
|
||||||
|
*/
|
||||||
|
export let shouldSubmitOnEnter = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the secondary button text
|
||||||
|
* @type {string} [secondaryButtonText=""]
|
||||||
|
*/
|
||||||
export let secondaryButtonText = "";
|
export let secondaryButtonText = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define a selector to be focused when opening the modal
|
* Specify a selector to be focused when opening the modal
|
||||||
* @type {string} [selectorPrimaryFocus="[data-modal-primary-focus]"]
|
* @type {string} [selectorPrimaryFocus="[data-modal-primary-focus]"]
|
||||||
*/
|
*/
|
||||||
export let selectorPrimaryFocus = "[data-modal-primary-focus]";
|
export let selectorPrimaryFocus = "[data-modal-primary-focus]";
|
||||||
|
|
|
@ -1,18 +1,121 @@
|
||||||
<script>
|
<script>
|
||||||
export let size = undefined; // "sm" | "lg" | "xl"
|
/**
|
||||||
export let type = "default"; // "default" | "inline"
|
* @typedef {string} MultiSelectItemId
|
||||||
export let selectionFeedback = "top-after-reopen"; // "top" | "fixed" | "top-after-reopen"
|
* @typedef {string} MultiSelectItemText
|
||||||
|
* @typedef {{ id: MultiSelectItemId; text: MultiSelectItemText; }} MultiSelectItem
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the multiselect items
|
||||||
|
* @type {MultiSelectItem[]} [items=[]]
|
||||||
|
*/
|
||||||
|
export let items = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the display of a multiselect item
|
||||||
|
* @type {(item: MultiSelectItem) => string;} [itemToString = (item: MultiSelectItem) => MultiSelectItemText | MultiSelectItemId;]
|
||||||
|
*/
|
||||||
|
export let itemToString = (item) => item.text || item.id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the selected ids
|
||||||
|
* @type {MultiSelectItemId[]} [selectedIds=[]]
|
||||||
|
*/
|
||||||
|
export let selectedIds = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the multiselect value
|
||||||
|
* @type {string} [value=""]
|
||||||
|
*/
|
||||||
|
export let value = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the size of the combobox
|
||||||
|
* @type {"sm" | "lg" | "xl"} [size]
|
||||||
|
*/
|
||||||
|
export let size = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the type of multiselect
|
||||||
|
* @type {"default" | "inline"} [type="default"]
|
||||||
|
*/
|
||||||
|
export let type = "default";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the selection feedback after selecting items
|
||||||
|
* @type {"top" | "fixed" | "top-after-reopen"} [selectionFeedback="top-after-reopen"]
|
||||||
|
*/
|
||||||
|
export let selectionFeedback = "top-after-reopen";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the dropdown
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to filter items
|
||||||
|
* @type {boolean} [filterable=false]
|
||||||
|
*/
|
||||||
export let filterable = false;
|
export let filterable = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the filtering logic
|
||||||
|
* The default filtering is an exact string comparison
|
||||||
|
* @type {(item: MultiSelectItem, value: string) => string;} [filterItem = ((item: MultiSelectItem, value: string) => string;)]
|
||||||
|
*/
|
||||||
export let filterItem = (item, value) =>
|
export let filterItem = (item, value) =>
|
||||||
item.text.toLowerCase().includes(value.toLowerCase());
|
item.text.toLowerCase().includes(value.toLowerCase());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the list box component
|
* Set to `true` to open the dropdown
|
||||||
* @type {string} [id]
|
* @type {boolean} [open=false]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let open = false;
|
||||||
export let name = undefined;
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to enable the light variant
|
||||||
|
* @type {boolean} [light=false]
|
||||||
|
*/
|
||||||
|
export let light = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the locale
|
||||||
|
* @type {string} [locale="en"]
|
||||||
|
*/
|
||||||
|
export let locale = "en";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the placeholder text
|
||||||
|
* @type {string} [placeholder=""]
|
||||||
|
*/
|
||||||
|
export let placeholder = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the sorting logic
|
||||||
|
* The default sorting compare the item text value
|
||||||
|
* @type {(a: MultiSelectItem, b: MultiSelectItem) => MultiSelectItem;} [sortItem = (a: MultiSelectItem, b: MultiSelectItem) => MultiSelectItem]
|
||||||
|
*/
|
||||||
|
export let sortItem = (a, b) =>
|
||||||
|
a.text.localeCompare(b.text, locale, { numeric: true });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the default translation ids
|
||||||
|
* @type {(id: any) => string;} [translateWithId]
|
||||||
|
*/
|
||||||
|
export let translateWithId = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the title text
|
||||||
|
* @type {string} [titleText=""]
|
||||||
|
*/
|
||||||
|
export let titleText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to pass the item to `itemToString` in the checkbox
|
||||||
|
* @type {boolean} [useTitleInItem=false]
|
||||||
|
*/
|
||||||
|
export let useTitleInItem = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to indicate an invalid state
|
* Set to `true` to indicate an invalid state
|
||||||
|
@ -26,28 +129,29 @@
|
||||||
*/
|
*/
|
||||||
export let invalidText = "";
|
export let invalidText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the helper text
|
||||||
|
* @type {string} [helperText=""]
|
||||||
|
*/
|
||||||
export let helperText = "";
|
export let helperText = "";
|
||||||
export let items = [];
|
|
||||||
export let itemToString = (item) => item.text || item.id;
|
/**
|
||||||
|
* Specify the list box label
|
||||||
|
* @type {string} [label]
|
||||||
|
*/
|
||||||
export let label = "";
|
export let label = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to enable the light variant
|
* Set an id for the list box component
|
||||||
* @type {boolean} [light=false]
|
* @type {string} [id]
|
||||||
*/
|
*/
|
||||||
export let light = false;
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
export let locale = "en";
|
/**
|
||||||
export let open = false;
|
* Specify a name attribute for the select
|
||||||
export let placeholder = "";
|
* @type {string} [name]
|
||||||
export let selectedIds = [];
|
*/
|
||||||
export let sortItem = (a, b) =>
|
export let name = undefined;
|
||||||
a.text.localeCompare(b.text, locale, { numeric: true });
|
|
||||||
export let titleText = "";
|
|
||||||
export let translateWithId = undefined;
|
|
||||||
|
|
||||||
export let useTitleInItem = false;
|
|
||||||
export let value = "";
|
|
||||||
|
|
||||||
import { afterUpdate, setContext } from "svelte";
|
import { afterUpdate, setContext } from "svelte";
|
||||||
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
|
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set the type of notification
|
||||||
|
* @type {"toast" | "inline"} [notificationType="toast"]
|
||||||
|
*/
|
||||||
export let notificationType = "inline";
|
export let notificationType = "inline";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -6,13 +10,43 @@
|
||||||
* @type {"error" | "info" | "info-square" | "success" | "warning" | "warning-alt"} [kind="error"]
|
* @type {"error" | "info" | "info-square" | "success" | "warning" | "warning-alt"} [kind="error"]
|
||||||
*/
|
*/
|
||||||
export let kind = "error";
|
export let kind = "error";
|
||||||
export let role = "alert";
|
|
||||||
export let title = "provide a title";
|
/**
|
||||||
export let subtitle = "";
|
* Set to `true` to use the low contrast variant
|
||||||
export let iconDescription = "closes notification";
|
* @type {boolean} [lowContrast=false]
|
||||||
|
*/
|
||||||
export let lowContrast = false;
|
export let lowContrast = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the `role` attribute
|
||||||
|
* @type {string} [role="alert"]
|
||||||
|
*/
|
||||||
|
export let role = "alert";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the title text
|
||||||
|
* @type {string} [title="Title"]
|
||||||
|
*/
|
||||||
|
export let title = "Title";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the subtitle text
|
||||||
|
* @type {string} [subtitle=""]
|
||||||
|
*/
|
||||||
|
export let subtitle = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to hide the close button
|
||||||
|
* @type {boolean} [hideCloseButton=false]
|
||||||
|
*/
|
||||||
export let hideCloseButton = false;
|
export let hideCloseButton = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the icon
|
||||||
|
* @type {string} [iconDescription="Closes notification"]
|
||||||
|
*/
|
||||||
|
export let iconDescription = "Closes notification";
|
||||||
|
|
||||||
import { createEventDispatcher } from "svelte";
|
import { createEventDispatcher } from "svelte";
|
||||||
import NotificationIcon from "./NotificationIcon.svelte";
|
import NotificationIcon from "./NotificationIcon.svelte";
|
||||||
import NotificationTextDetails from "./NotificationTextDetails.svelte";
|
import NotificationTextDetails from "./NotificationTextDetails.svelte";
|
||||||
|
|
|
@ -4,18 +4,31 @@
|
||||||
* @type {"toast" | "inline"} [notificationType="toast"]
|
* @type {"toast" | "inline"} [notificationType="toast"]
|
||||||
*/
|
*/
|
||||||
export let notificationType = "toast";
|
export let notificationType = "toast";
|
||||||
export let iconDescription = "close icon";
|
|
||||||
|
/**
|
||||||
|
* Specify the icon from `carbon-icons-svelte` to render
|
||||||
|
* @type {typeof import("carbon-icons-svelte/lib/Add16").default} [renderIcon]
|
||||||
|
*/
|
||||||
export let renderIcon = Close20;
|
export let renderIcon = Close20;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the title of the icon
|
||||||
|
*/
|
||||||
export let title = undefined;
|
export let title = undefined;
|
||||||
export let type = "button";
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the icon
|
||||||
|
* @type {string} [iconDescription="Close icon"]
|
||||||
|
*/
|
||||||
|
export let iconDescription = "Close icon";
|
||||||
|
|
||||||
import Close20 from "carbon-icons-svelte/lib/Close20";
|
import Close20 from "carbon-icons-svelte/lib/Close20";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
aria-label={iconDescription}
|
aria-label={iconDescription}
|
||||||
title={iconDescription}
|
title={iconDescription}
|
||||||
{type}
|
|
||||||
class:bx--toast-notification__close-button={notificationType === 'toast'}
|
class:bx--toast-notification__close-button={notificationType === 'toast'}
|
||||||
class:bx--inline-notification__close-button={notificationType === 'inline'}
|
class:bx--inline-notification__close-button={notificationType === 'inline'}
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the kind of notification icon
|
||||||
|
* @type {"error" | "info" | "info-square" | "success" | "warning" | "warning-alt"} [kind="error"]
|
||||||
|
*/
|
||||||
export let kind = "error";
|
export let kind = "error";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -7,7 +11,11 @@
|
||||||
*/
|
*/
|
||||||
export let notificationType = "toast";
|
export let notificationType = "toast";
|
||||||
|
|
||||||
export let iconDescription = "closes notification";
|
/**
|
||||||
|
* Specify the ARIA label for the icon
|
||||||
|
* @type {string} [iconDescription="Closes notification"]
|
||||||
|
*/
|
||||||
|
export let iconDescription = "Closes notification";
|
||||||
|
|
||||||
import CheckmarkFilled20 from "carbon-icons-svelte/lib/CheckmarkFilled20";
|
import CheckmarkFilled20 from "carbon-icons-svelte/lib/CheckmarkFilled20";
|
||||||
import ErrorFilled20 from "carbon-icons-svelte/lib/ErrorFilled20";
|
import ErrorFilled20 from "carbon-icons-svelte/lib/ErrorFilled20";
|
||||||
|
|
|
@ -1,8 +1,27 @@
|
||||||
<script>
|
<script>
|
||||||
export let notificationType = "toast"; // "toast" | "inline"
|
/**
|
||||||
export let title = "title";
|
* Set the type of notification
|
||||||
|
* @type {"toast" | "inline"} [notificationType="toast"]
|
||||||
|
*/
|
||||||
|
export let notificationType = "toast";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the title text
|
||||||
|
* @type {string} [title="Title"]
|
||||||
|
*/
|
||||||
|
export let title = "Title";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the subtitle text
|
||||||
|
* @type {string} [subtitle=""]
|
||||||
|
*/
|
||||||
export let subtitle = "";
|
export let subtitle = "";
|
||||||
export let caption = "caption";
|
|
||||||
|
/**
|
||||||
|
* Specify the caption text
|
||||||
|
* @type {string} [caption="Caption"]
|
||||||
|
*/
|
||||||
|
export let caption = "Caption";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if notificationType === 'toast'}
|
{#if notificationType === 'toast'}
|
||||||
|
|
|
@ -1,14 +1,63 @@
|
||||||
<script>
|
<script>
|
||||||
export let iconDescription = "closes notification";
|
/**
|
||||||
export let notificationType = "toast"; // "toast" | "inline"
|
* Set the type of notification
|
||||||
|
* @type {"toast" | "inline"} [notificationType="toast"]
|
||||||
|
*/
|
||||||
|
export let notificationType = "toast";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the kind of notification
|
||||||
|
* @type {"error" | "info" | "info-square" | "success" | "warning" | "warning-alt"} [kind="error"]
|
||||||
|
*/
|
||||||
export let kind = "error";
|
export let kind = "error";
|
||||||
export let hideCloseButton = false;
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the low contrast variant
|
||||||
|
* @type {boolean} [lowContrast=false]
|
||||||
|
*/
|
||||||
export let lowContrast = false;
|
export let lowContrast = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the timeout duration (ms) to hide the notification after closing it
|
||||||
|
* @type {number} [timeout=0]
|
||||||
|
*/
|
||||||
export let timeout = 0;
|
export let timeout = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the `role` attribute
|
||||||
|
* @type {string} [role="alert"]
|
||||||
|
*/
|
||||||
export let role = "alert";
|
export let role = "alert";
|
||||||
export let title = "provide a title";
|
|
||||||
|
/**
|
||||||
|
* Specify the title text
|
||||||
|
* @type {string} [title="Title"]
|
||||||
|
*/
|
||||||
|
export let title = "Title";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the subtitle text
|
||||||
|
* @type {string} [subtitle=""]
|
||||||
|
*/
|
||||||
export let subtitle = "";
|
export let subtitle = "";
|
||||||
export let caption = "provide a caption";
|
|
||||||
|
/**
|
||||||
|
* Specify the caption text
|
||||||
|
* @type {string} [caption="Caption"]
|
||||||
|
*/
|
||||||
|
export let caption = "Caption";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the icon
|
||||||
|
* @type {string} [iconDescription="Closes notification"]
|
||||||
|
*/
|
||||||
|
export let iconDescription = "Closes notification";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to hide the close button
|
||||||
|
* @type {boolean} [hideCloseButton=false]
|
||||||
|
*/
|
||||||
|
export let hideCloseButton = false;
|
||||||
|
|
||||||
import { createEventDispatcher, onMount } from "svelte";
|
import { createEventDispatcher, onMount } from "svelte";
|
||||||
import NotificationButton from "./NotificationButton.svelte";
|
import NotificationButton from "./NotificationButton.svelte";
|
||||||
|
|
|
@ -1,8 +1,34 @@
|
||||||
<script>
|
<script>
|
||||||
export let size = undefined; // "sm" | "xl"
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the size of the input
|
||||||
|
* @type {"sm" | "xl"} [size]
|
||||||
|
*/
|
||||||
|
export let size = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the input value
|
||||||
|
* @type {string} [value=""]
|
||||||
|
*/
|
||||||
export let value = "";
|
export let value = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the step increment
|
||||||
|
* @type {number} [step=1]
|
||||||
|
*/
|
||||||
export let step = 1;
|
export let step = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the maximum value
|
||||||
|
* @type {number} [max]
|
||||||
|
*/
|
||||||
export let max = undefined;
|
export let max = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the minimum value
|
||||||
|
* @type {number} [min]
|
||||||
|
*/
|
||||||
export let min = undefined;
|
export let min = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,18 +37,35 @@
|
||||||
*/
|
*/
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` for the input to be read-only
|
||||||
|
* @type {boolean} [readonly=false]
|
||||||
|
*/
|
||||||
export let readonly = false;
|
export let readonly = false;
|
||||||
export let mobile = false;
|
|
||||||
export let allowEmpty = false;
|
|
||||||
export let disabled = false;
|
|
||||||
export let iconDescription = "";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the input element
|
* Set to `true` to enable the mobile variant
|
||||||
* @type {string} [id]
|
* @type {boolean} [mobile=false]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let mobile = false;
|
||||||
export let name = undefined;
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to allow for an empty value
|
||||||
|
* @type {boolean} [allowEmpty=false]
|
||||||
|
*/
|
||||||
|
export let allowEmpty = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the input
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the increment icons
|
||||||
|
* @type {string} [iconDescription=""]
|
||||||
|
*/
|
||||||
|
export let iconDescription = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to indicate an invalid state
|
* Set to `true` to indicate an invalid state
|
||||||
|
@ -36,21 +79,62 @@
|
||||||
*/
|
*/
|
||||||
export let invalidText = "";
|
export let invalidText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the helper text
|
||||||
|
* @type {string} [helperText=""]
|
||||||
|
*/
|
||||||
export let helperText = "";
|
export let helperText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the label text
|
||||||
|
* @type {string} [label=""]
|
||||||
|
*/
|
||||||
export let label = "";
|
export let label = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to visually hide the label text
|
||||||
|
* @type {boolean} [hideLabel=false]
|
||||||
|
*/
|
||||||
export let hideLabel = false;
|
export let hideLabel = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain a reference to the input HTML element
|
* @typedef {"increment" | "decrement"} NumberInputTranslationId
|
||||||
* @type {null | HTMLElement} [ref=null]
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the default translation ids
|
||||||
|
* @type {(id: NumberInputTranslationId) => string;} [translateWithId = (id: NumberInputTranslationId) => string;]
|
||||||
*/
|
*/
|
||||||
export let ref = null;
|
|
||||||
export let translateWithId = (id) => defaultTranslations[id];
|
export let translateWithId = (id) => defaultTranslations[id];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default translation ids
|
||||||
|
* @constant
|
||||||
|
* @type {{ increment: "increment"; decrement: "decrement" }}
|
||||||
|
*/
|
||||||
export const translationIds = {
|
export const translationIds = {
|
||||||
increment: "increment",
|
increment: "increment",
|
||||||
decrement: "decrement",
|
decrement: "decrement",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set an id for the input element
|
||||||
|
* @type {string} [id]
|
||||||
|
*/
|
||||||
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the input
|
||||||
|
* @type {string} [name]
|
||||||
|
*/
|
||||||
|
export let name = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the input HTML element
|
||||||
|
* @type {null | HTMLInputElement} [ref=null]
|
||||||
|
*/
|
||||||
|
export let ref = null;
|
||||||
|
|
||||||
import { createEventDispatcher, afterUpdate } from "svelte";
|
import { createEventDispatcher, afterUpdate } from "svelte";
|
||||||
import CaretDownGlyph from "carbon-icons-svelte/lib/CaretDownGlyph";
|
import CaretDownGlyph from "carbon-icons-svelte/lib/CaretDownGlyph";
|
||||||
import CaretUpGlyph from "carbon-icons-svelte/lib/CaretUpGlyph";
|
import CaretUpGlyph from "carbon-icons-svelte/lib/CaretUpGlyph";
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
*/
|
*/
|
||||||
export let direction = "bottom";
|
export let direction = "bottom";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to open the menu
|
||||||
|
* @type {boolean} [open=false]
|
||||||
|
*/
|
||||||
export let open = false;
|
export let open = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,11 +16,35 @@
|
||||||
* @type {boolean} [light=false]
|
* @type {boolean} [light=false]
|
||||||
*/
|
*/
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to flip the menu relative to the button
|
||||||
|
* @type {boolean} [flipped=false]
|
||||||
|
*/
|
||||||
export let flipped = false;
|
export let flipped = false;
|
||||||
|
|
||||||
export let tabindex = "0";
|
/**
|
||||||
|
* Specify the menu options class
|
||||||
|
* @type {string} [menuOptionsClass]
|
||||||
|
*/
|
||||||
|
export let menuOptionsClass = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the icon from `carbon-icons-svelte` to render
|
||||||
|
* @type {typeof import("carbon-icons-svelte/lib/Add16").default} [icon]
|
||||||
|
*/
|
||||||
export let icon = OverflowMenuVertical16;
|
export let icon = OverflowMenuVertical16;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the icon class
|
||||||
|
* @type {string} [iconClass]
|
||||||
|
*/
|
||||||
export let iconClass = undefined;
|
export let iconClass = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the icon
|
||||||
|
* @type {string} [iconDescription="Open and close list of options"]
|
||||||
|
*/
|
||||||
export let iconDescription = "Open and close list of options";
|
export let iconDescription = "Open and close list of options";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,7 +52,6 @@
|
||||||
* @type {string} [id]
|
* @type {string} [id]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
export let menuOptionsClass = undefined;
|
|
||||||
|
|
||||||
import { createEventDispatcher, setContext, afterUpdate } from "svelte";
|
import { createEventDispatcher, setContext, afterUpdate } from "svelte";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
|
@ -133,11 +160,11 @@
|
||||||
|
|
||||||
<button
|
<button
|
||||||
bind:this={buttonRef}
|
bind:this={buttonRef}
|
||||||
|
tabindex="0"
|
||||||
aria-haspopup
|
aria-haspopup
|
||||||
aria-expanded={open}
|
aria-expanded={open}
|
||||||
aria-label={ariaLabel}
|
aria-label={ariaLabel}
|
||||||
{id}
|
{id}
|
||||||
{tabindex}
|
|
||||||
class:bx--overflow-menu={true}
|
class:bx--overflow-menu={true}
|
||||||
class:bx--overflow-menu--open={open}
|
class:bx--overflow-menu--open={open}
|
||||||
class:bx--overflow-menu--light={light}
|
class:bx--overflow-menu--light={light}
|
||||||
|
|
|
@ -1,17 +1,57 @@
|
||||||
<script>
|
<script>
|
||||||
export let danger = false;
|
/**
|
||||||
export let disabled = false;
|
* Specify the item text
|
||||||
export let hasDivider = false;
|
* Alternatively, use the default slot for a custom element
|
||||||
export let href = "";
|
* @type {string} [text="Provide text"]
|
||||||
export let primaryFocus = false;
|
*/
|
||||||
export let requireTitle = true;
|
|
||||||
export let text = "Provide text";
|
export let text = "Provide text";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the `href` attribute if the item is a link
|
||||||
|
* @type {string} [href=""]
|
||||||
|
*/
|
||||||
|
export let href = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` if the item should be focused when opening the menu
|
||||||
|
* @type {boolean} [primaryFocus=false]
|
||||||
|
*/
|
||||||
|
export let primaryFocus = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the item
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to include a divider
|
||||||
|
* @type {boolean} [hasDivider=false]
|
||||||
|
*/
|
||||||
|
export let hasDivider = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the danger variant
|
||||||
|
* @type {boolean} [danger=false]
|
||||||
|
*/
|
||||||
|
export let danger = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `false` to omit the button `title` attribute
|
||||||
|
* @type {boolean} [requireTitle=false]
|
||||||
|
*/
|
||||||
|
export let requireTitle = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the top-level element
|
* Set an id for the top-level element
|
||||||
* @type {string} [id]
|
* @type {string} [id]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the HTML element
|
||||||
|
* @type {null | HTMLAnchorElement | HTMLButtonElement} [ref=null]
|
||||||
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import { getContext, afterUpdate } from "svelte";
|
import { getContext, afterUpdate } from "svelte";
|
||||||
|
|
|
@ -1,19 +1,88 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the current page index
|
||||||
|
* @type {number} [page=1]
|
||||||
|
*/
|
||||||
|
export let page = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the total number of items
|
||||||
|
* @type {number} [total=0]
|
||||||
|
*/
|
||||||
export let totalItems = 0;
|
export let totalItems = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the pagination
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the forward button text
|
||||||
|
* @type {string} [forwardText="Next page"]
|
||||||
|
*/
|
||||||
export let forwardText = "Next page";
|
export let forwardText = "Next page";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the backward button text
|
||||||
|
* @type {string} [backwardText="Previous page"]
|
||||||
|
*/
|
||||||
export let backwardText = "Previous page";
|
export let backwardText = "Previous page";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the items per page text
|
||||||
|
* @type {string} [itemsPerPageText="Items per page:"]
|
||||||
|
*/
|
||||||
|
export let itemsPerPageText = "Items per page:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the item text
|
||||||
|
* @type {(min: number, max: number) => string;} [itemText = (min: number, max: number) => string;]
|
||||||
|
*/
|
||||||
|
export let itemText = (min, max) => `${min}–${max} items`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the item range text
|
||||||
|
* @type {(min: number, max: number, total: number) => string;} [itemRangeText = (min: number, max: number, total: number) => string;]
|
||||||
|
*/
|
||||||
export let itemRangeText = (min, max, total) =>
|
export let itemRangeText = (min, max, total) =>
|
||||||
`${min}–${max} of ${total} items`;
|
`${min}–${max} of ${total} items`;
|
||||||
export let itemsPerPageText = "Items per page:";
|
|
||||||
export let itemText = (min, max) => `${min}–${max} items`;
|
/**
|
||||||
export let page = 1;
|
* Set to `true` to disable the page input
|
||||||
|
* @type {boolean} [pageInputDisabled=false]
|
||||||
|
*/
|
||||||
export let pageInputDisabled = false;
|
export let pageInputDisabled = false;
|
||||||
export let pageRangeText = (current, total) => `of ${total} pages`;
|
|
||||||
|
/**
|
||||||
|
* Specify the number of items to display in a page
|
||||||
|
* @type {number} [pageSize=10]
|
||||||
|
*/
|
||||||
export let pageSize = 10;
|
export let pageSize = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the available page sizes
|
||||||
|
* @type {number[]} [pageSizes=[10]]
|
||||||
|
*/
|
||||||
export let pageSizes = [10];
|
export let pageSizes = [10];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` if the number of pages is unknown
|
||||||
|
* @type {boolean} [pagesUnknown=false]
|
||||||
|
*/
|
||||||
export let pagesUnknown = false;
|
export let pagesUnknown = false;
|
||||||
export let pageText = page => `page ${page}`;
|
|
||||||
|
/**
|
||||||
|
* Override the page text
|
||||||
|
* @type {(page: number) => string;} [pageText = (current: number) => string;]
|
||||||
|
*/
|
||||||
|
export let pageText = (page) => `page ${page}`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the page range text
|
||||||
|
* @type {(current: number, total: number) => string;} [pageRangeText = (current: number, total: number) => string;]
|
||||||
|
*/
|
||||||
|
export let pageRangeText = (current, total) => `of ${total} pages`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the top-level element
|
* Set an id for the top-level element
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the current page index
|
||||||
|
* @type {number} [page=0]
|
||||||
|
*/
|
||||||
export let page = 0;
|
export let page = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the active state
|
||||||
|
* @type {boolean} [active=false]
|
||||||
|
*/
|
||||||
export let active = false;
|
export let active = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,38 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the current page index
|
||||||
|
* @type {number} [page=0]
|
||||||
|
*/
|
||||||
export let page = 0;
|
export let page = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the total number of pages
|
||||||
|
* @type {number} [total=10]
|
||||||
|
*/
|
||||||
export let total = 10;
|
export let total = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the total number of pages to show
|
||||||
|
* @type {number} [shown=10]
|
||||||
|
*/
|
||||||
export let shown = 10;
|
export let shown = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to loop the navigation
|
||||||
|
* @type {boolean} [loop=false]
|
||||||
|
*/
|
||||||
export let loop = false;
|
export let loop = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the forward button text
|
||||||
|
* @type {string} [forwardText="Next page"]
|
||||||
|
*/
|
||||||
export let forwardText = "Next page";
|
export let forwardText = "Next page";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the backward button text
|
||||||
|
* @type {string} [backwardText="Next page"]
|
||||||
|
*/
|
||||||
export let backwardText = "Previous page";
|
export let backwardText = "Previous page";
|
||||||
|
|
||||||
import { afterUpdate, createEventDispatcher } from "svelte";
|
import { afterUpdate, createEventDispatcher } from "svelte";
|
||||||
|
@ -14,7 +43,13 @@
|
||||||
import { Button } from "../Button";
|
import { Button } from "../Button";
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
const MIN = 4; // minimum items shown
|
|
||||||
|
/**
|
||||||
|
* Minimum number of items to be shown
|
||||||
|
* @constant
|
||||||
|
* @type {4}
|
||||||
|
*/
|
||||||
|
const MIN = 4;
|
||||||
|
|
||||||
afterUpdate(() => {
|
afterUpdate(() => {
|
||||||
dispatch("change", { page });
|
dispatch("change", { page });
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the pivot start index
|
||||||
|
* @type {number} [fromIndex=0]
|
||||||
|
*/
|
||||||
export let fromIndex = 0;
|
export let fromIndex = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the pivot end index
|
||||||
|
* @type {number} [count=0]
|
||||||
|
*/
|
||||||
export let count = 0;
|
export let count = 0;
|
||||||
|
|
||||||
import { createEventDispatcher } from "svelte";
|
import { createEventDispatcher } from "svelte";
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the vertical variant
|
||||||
|
*/
|
||||||
export let vertical = false;
|
export let vertical = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the current step index
|
||||||
|
* @type {number} [currentIndex=0]
|
||||||
|
*/
|
||||||
export let currentIndex = 0;
|
export let currentIndex = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the vertical variant
|
||||||
|
*/
|
||||||
export let vertical = false;
|
export let vertical = false;
|
||||||
|
|
||||||
import { createEventDispatcher, setContext } from "svelte";
|
import { createEventDispatcher, setContext } from "svelte";
|
||||||
|
@ -7,27 +15,27 @@
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
const steps = writable([]);
|
const steps = writable([]);
|
||||||
const stepsById = derived(steps, $ =>
|
const stepsById = derived(steps, ($) =>
|
||||||
$.reduce((a, c) => ({ ...a, [c.id]: c }), {})
|
$.reduce((a, c) => ({ ...a, [c.id]: c }), {})
|
||||||
);
|
);
|
||||||
|
|
||||||
setContext("ProgressIndicator", {
|
setContext("ProgressIndicator", {
|
||||||
steps,
|
steps,
|
||||||
stepsById,
|
stepsById,
|
||||||
add: step => {
|
add: (step) => {
|
||||||
steps.update(_ => [
|
steps.update((_) => [
|
||||||
..._,
|
..._,
|
||||||
{
|
{
|
||||||
...step,
|
...step,
|
||||||
index: _.length,
|
index: _.length,
|
||||||
current: _.length === currentIndex,
|
current: _.length === currentIndex,
|
||||||
complete: _.length <= currentIndex
|
complete: _.length <= currentIndex,
|
||||||
}
|
},
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
change: index => {
|
change: (index) => {
|
||||||
dispatch("change", index);
|
dispatch("change", index);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,44 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` for the complete variant
|
||||||
|
* @type {boolean} [complete=false]
|
||||||
|
*/
|
||||||
export let complete = false;
|
export let complete = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the current variant
|
||||||
|
* @type {boolean} [current=false]
|
||||||
|
*/
|
||||||
export let current = false;
|
export let current = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the progress step
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to indicate an invalid state
|
* Set to `true` to indicate an invalid state
|
||||||
* @type {boolean} [invalid=false]
|
* @type {boolean} [invalid=false]
|
||||||
*/
|
*/
|
||||||
export let invalid = false;
|
export let invalid = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the step description
|
||||||
|
* @type {string} [descripton=""]
|
||||||
|
*/
|
||||||
export let description = "";
|
export let description = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the step label
|
||||||
|
* @type {string} [label=""]
|
||||||
|
*/
|
||||||
export let label = "";
|
export let label = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the step secondary label
|
||||||
|
* @type {string} [secondaryLabel=""]
|
||||||
|
*/
|
||||||
export let secondaryLabel = "";
|
export let secondaryLabel = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,14 +1,28 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the value of the radio button
|
||||||
|
* @type {string} [value=""]
|
||||||
|
*/
|
||||||
export let value = "";
|
export let value = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to check the radio button
|
||||||
|
* @type {boolean} [checked=false]
|
||||||
|
*/
|
||||||
export let checked = false;
|
export let checked = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the radio button
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the input element
|
* Specify the label position
|
||||||
* @type {string} [id]
|
* @type {"right" | "left"} [labelPosition="right"]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let labelPosition = "right";
|
||||||
export let labelPosition = "right"; // "left" | "right"
|
|
||||||
/**
|
/**
|
||||||
* Specify the label text
|
* Specify the label text
|
||||||
* @type {string} [labelText=""]
|
* @type {string} [labelText=""]
|
||||||
|
@ -20,8 +34,25 @@
|
||||||
* @type {boolean} [hideLabel=false]
|
* @type {boolean} [hideLabel=false]
|
||||||
*/
|
*/
|
||||||
export let hideLabel = false;
|
export let hideLabel = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set an id for the input element
|
||||||
|
* @type {string} [id]
|
||||||
|
*/
|
||||||
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the checkbox input
|
||||||
|
* @type {string} [name=""]
|
||||||
|
*/
|
||||||
export let name = "";
|
export let name = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the input HTML element
|
||||||
|
* @type {null | HTMLInputElement} [ref=null]
|
||||||
|
*/
|
||||||
|
export let ref = null;
|
||||||
|
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
|
|
||||||
|
@ -42,6 +73,7 @@
|
||||||
class:bx--radio-button-wrapper--label-left={labelPosition === 'left'}
|
class:bx--radio-button-wrapper--label-left={labelPosition === 'left'}
|
||||||
{...$$restProps}>
|
{...$$restProps}>
|
||||||
<input
|
<input
|
||||||
|
bind:this={ref}
|
||||||
type="radio"
|
type="radio"
|
||||||
{id}
|
{id}
|
||||||
{name}
|
{name}
|
||||||
|
|
|
@ -1,8 +1,27 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set the selected radio button value
|
||||||
|
* @type {string} [selected]
|
||||||
|
*/
|
||||||
export let selected = undefined;
|
export let selected = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the radio buttons
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
export let labelPosition = "right"; // "right" | "left"
|
|
||||||
export let orientation = "horizontal"; // "horizontal" | "vertical"
|
/**
|
||||||
|
* Specify the label position
|
||||||
|
* @type {"right" | "left"} [labelPosition="right"]
|
||||||
|
*/
|
||||||
|
export let labelPosition = "right";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the orientation of the radio buttons
|
||||||
|
* @type {"horizontal" | "vertical"} [orientation="horizontal"]
|
||||||
|
*/
|
||||||
|
export let orientation = "horizontal";
|
||||||
|
|
||||||
import { createEventDispatcher, setContext } from "svelte";
|
import { createEventDispatcher, setContext } from "svelte";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
|
@ -17,9 +36,9 @@
|
||||||
selectedValue.set(value);
|
selectedValue.set(value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
update: value => {
|
update: (value) => {
|
||||||
selectedValue.set(value);
|
selectedValue.set(value);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
$: selected = $selectedValue;
|
$: selected = $selectedValue;
|
||||||
|
|
|
@ -1,22 +1,20 @@
|
||||||
<script>
|
<script>
|
||||||
export let autocomplete = "off";
|
/**
|
||||||
export let autofocus = false;
|
* Set to `true` to use the small variant
|
||||||
export let closeButtonLabelText = "Clear search input";
|
* @type {boolean} [small=false]
|
||||||
|
*/
|
||||||
|
export let small = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the input element
|
* Specify the size of the search input
|
||||||
* @type {string} [id]
|
* @type {"sm" | "lg"} [size]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let size = small ? "sm" : "xl";
|
||||||
export let type = "text";
|
|
||||||
export let value = "";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the label text
|
* Set to `true` to display the skeleton state
|
||||||
* @type {string} [labelText=""]
|
* @type {boolean} [skeleton=false]
|
||||||
*/
|
*/
|
||||||
export let labelText = "";
|
|
||||||
export let placeholder = "Search...";
|
|
||||||
export let skeleton = false;
|
export let skeleton = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,15 +24,56 @@
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to use the small variant
|
* Specify the value of the search input
|
||||||
* @type {boolean} [small=false]
|
* @type {string} [value="text"]
|
||||||
*/
|
*/
|
||||||
export let small = false;
|
export let value = "";
|
||||||
export let size = small ? "sm" : "xl";
|
|
||||||
|
/**
|
||||||
|
* Specify the `type` attribute of the search input
|
||||||
|
* @type {string} [type="text"]
|
||||||
|
*/
|
||||||
|
export let type = "text";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the `placeholder` attribute of the search input
|
||||||
|
* @type {string} [placeholder="Search..."]
|
||||||
|
*/
|
||||||
|
export let placeholder = "Search...";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the `autocomplete` attribute
|
||||||
|
* @type {"on" | "off"} [autocomplete="off"]
|
||||||
|
*/
|
||||||
|
export let autocomplete = "off";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to auto focus the search element
|
||||||
|
* @type {boolean} [autofocus=false]
|
||||||
|
*/
|
||||||
|
export let autofocus = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the close button label text
|
||||||
|
* @type {string} [closeButtonLabelText="Clear search input"]
|
||||||
|
*/
|
||||||
|
export let closeButtonLabelText = "Clear search input";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the label text
|
||||||
|
* @type {string} [labelText=""]
|
||||||
|
*/
|
||||||
|
export let labelText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set an id for the input element
|
||||||
|
* @type {string} [id]
|
||||||
|
*/
|
||||||
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain a reference to the input HTML element
|
* Obtain a reference to the input HTML element
|
||||||
* @type {null | HTMLElement} [ref=null]
|
* @type {null | HTMLInputElement} [ref=null]
|
||||||
*/
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
|
@ -55,9 +94,10 @@
|
||||||
{:else}
|
{:else}
|
||||||
<div
|
<div
|
||||||
class:bx--search={true}
|
class:bx--search={true}
|
||||||
class="bx--search--{size}"
|
|
||||||
class:bx--search--light={light}
|
class:bx--search--light={light}
|
||||||
{...$$restProps}>
|
{...$$restProps}
|
||||||
|
class="bx--search--{size}
|
||||||
|
{$$restProps.class}">
|
||||||
<Search16 class="bx--search-magnifier" />
|
<Search16 class="bx--search-magnifier" />
|
||||||
<label for={id} class:bx--label={true}>{labelText}</label>
|
<label for={id} class:bx--label={true}>{labelText}</label>
|
||||||
<!-- svelte-ignore a11y-autofocus -->
|
<!-- svelte-ignore a11y-autofocus -->
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to hide the label text
|
||||||
|
* @type {boolean} [hideLabel=false]
|
||||||
|
*/
|
||||||
export let hideLabel = false;
|
export let hideLabel = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,16 @@
|
||||||
<script>
|
<script>
|
||||||
export let size = undefined; // "sm" | "xl"
|
/**
|
||||||
|
* Specify the selected item value
|
||||||
|
* @type {string} [selected]
|
||||||
|
*/
|
||||||
export let selected = undefined;
|
export let selected = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the size of the select input
|
||||||
|
* @type {"sm" | "xl"} [size]
|
||||||
|
*/
|
||||||
|
export let size = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to use the inline variant
|
* Set to `true` to use the inline variant
|
||||||
* @type {boolean} [inline=false]
|
* @type {boolean} [inline=false]
|
||||||
|
@ -13,6 +22,11 @@
|
||||||
* @type {boolean} [light=false]
|
* @type {boolean} [light=false]
|
||||||
*/
|
*/
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the select element
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,6 +34,11 @@
|
||||||
* @type {string} [id]
|
* @type {string} [id]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the select element
|
||||||
|
* @type {string} [name]
|
||||||
|
*/
|
||||||
export let name = undefined;
|
export let name = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,8 +53,18 @@
|
||||||
*/
|
*/
|
||||||
export let invalidText = "";
|
export let invalidText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the helper text
|
||||||
|
* @type {string} [helperText=""]
|
||||||
|
*/
|
||||||
export let helperText = "";
|
export let helperText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to not render a label
|
||||||
|
* @type {boolean} [noLabel=false]
|
||||||
|
*/
|
||||||
export let noLabel = false;
|
export let noLabel = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the label text
|
* Specify the label text
|
||||||
* @type {string} [labelText=""]
|
* @type {string} [labelText=""]
|
||||||
|
@ -47,6 +76,11 @@
|
||||||
* @type {boolean} [hideLabel=false]
|
* @type {boolean} [hideLabel=false]
|
||||||
*/
|
*/
|
||||||
export let hideLabel = false;
|
export let hideLabel = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the select HTML element
|
||||||
|
* @type {null | HTMLSelectElement} [ref=null]
|
||||||
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import { createEventDispatcher, setContext, afterUpdate } from "svelte";
|
import { createEventDispatcher, setContext, afterUpdate } from "svelte";
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
let selected = false;
|
let selected = false;
|
||||||
|
|
||||||
const unsubscribe = ctx.selectedValue.subscribe($ => {
|
const unsubscribe = ctx.selectedValue.subscribe(($) => {
|
||||||
selected = $ === value;
|
selected = $ === value;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the optgroup element
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the label attribute of the optgroup element
|
||||||
|
* @type {string} [label="Provide label"]
|
||||||
|
*/
|
||||||
export let label = "Provide label";
|
export let label = "Provide label";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,12 @@
|
||||||
*/
|
*/
|
||||||
export let width = "100%";
|
export let width = "100%";
|
||||||
|
|
||||||
const randoms = [0.973, 0.153, 0.567];
|
/**
|
||||||
|
* Array of random numbers
|
||||||
|
* @constant
|
||||||
|
* @type {number[]}
|
||||||
|
*/
|
||||||
|
const RANDOM = [0.973, 0.153, 0.567];
|
||||||
|
|
||||||
$: rows = [];
|
$: rows = [];
|
||||||
$: widthNum = parseInt(width, 10);
|
$: widthNum = parseInt(width, 10);
|
||||||
|
@ -32,7 +37,7 @@
|
||||||
for (let i = 0; i < lines; i++) {
|
for (let i = 0; i < lines; i++) {
|
||||||
const min = widthPx ? widthNum - 75 : 0;
|
const min = widthPx ? widthNum - 75 : 0;
|
||||||
const max = widthPx ? widthNum : 75;
|
const max = widthPx ? widthNum : 75;
|
||||||
const rand = Math.floor(randoms[i % 3] * (max - min + 1)) + min + "px";
|
const rand = Math.floor(RANDOM[i % 3] * (max - min + 1)) + min + "px";
|
||||||
rows = [...rows, { width: widthPx ? rand : `calc(${width} - ${rand})` }];
|
rows = [...rows, { width: widthPx ? rand : `calc(${width} - ${rand})` }];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,11 +31,21 @@
|
||||||
export let maxLabel = "";
|
export let maxLabel = "";
|
||||||
export let min = 0;
|
export let min = 0;
|
||||||
export let minLabel = "";
|
export let minLabel = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a name for the slider element
|
||||||
|
* @type {string} [name=""]
|
||||||
|
*/
|
||||||
export let name = "";
|
export let name = "";
|
||||||
export let required = false;
|
export let required = false;
|
||||||
export let step = 1;
|
export let step = 1;
|
||||||
export let stepMultiplier = 4;
|
export let stepMultiplier = 4;
|
||||||
export let value = "";
|
export let value = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the HTML element
|
||||||
|
* @type {null | HTMLElement} [ref=null]
|
||||||
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import { createEventDispatcher, afterUpdate } from "svelte";
|
import { createEventDispatcher, afterUpdate } from "svelte";
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
<script>
|
<script>
|
||||||
export let border = false;
|
/**
|
||||||
|
* Specify the number of rows
|
||||||
|
* @type {number} [rows=5]
|
||||||
|
*/
|
||||||
export let rows = 5;
|
export let rows = 5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the bordered variant
|
||||||
|
* @type {boolean} [border=false]
|
||||||
|
*/
|
||||||
|
export let border = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section
|
<section
|
||||||
|
|
|
@ -1,6 +1,20 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the selected structured list row value
|
||||||
|
* @type {string} [selected]
|
||||||
|
*/
|
||||||
export let selected = undefined;
|
export let selected = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the bordered variant
|
||||||
|
* @type {boolean} [border=false]
|
||||||
|
*/
|
||||||
export let border = false;
|
export let border = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the selection variant
|
||||||
|
* @type {boolean} [selection=false]
|
||||||
|
*/
|
||||||
export let selection = false;
|
export let selection = false;
|
||||||
|
|
||||||
import { createEventDispatcher, setContext } from "svelte";
|
import { createEventDispatcher, setContext } from "svelte";
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to use as a header
|
||||||
|
* @type {boolean} [head=false]
|
||||||
|
*/
|
||||||
export let head = false;
|
export let head = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to prevent wrapping
|
||||||
|
* @type {boolean} [noWrap=false]
|
||||||
|
*/
|
||||||
export let noWrap = false;
|
export let noWrap = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,20 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to check the input
|
||||||
|
* @type {boolean} [checked=false]
|
||||||
|
*/
|
||||||
export let checked = false;
|
export let checked = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the title of the input
|
||||||
|
* @type {string} [title="title"]
|
||||||
|
*/
|
||||||
export let title = "title";
|
export let title = "title";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the value of the input
|
||||||
|
* @type {string} [value="value"]
|
||||||
|
*/
|
||||||
export let value = "value";
|
export let value = "value";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -8,7 +22,17 @@
|
||||||
* @type {string} [id]
|
* @type {string} [id]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the input
|
||||||
|
* @type {string} [name=""]
|
||||||
|
*/
|
||||||
export let name = "";
|
export let name = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the input HTML element
|
||||||
|
* @type {null | HTMLInputElement} [ref=null]
|
||||||
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
|
|
|
@ -1,6 +1,20 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to use as a header
|
||||||
|
* @type {boolean} [head=false]
|
||||||
|
*/
|
||||||
export let head = false;
|
export let head = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to render a label slot
|
||||||
|
* @type {boolean} [label=false]
|
||||||
|
*/
|
||||||
export let label = false;
|
export let label = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the tabindex
|
||||||
|
* @type {string} [tabindex="0"]
|
||||||
|
*/
|
||||||
export let tabindex = "0";
|
export let tabindex = "0";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
let dropdownHidden = true;
|
let dropdownHidden = true;
|
||||||
let tabs = writable([]);
|
let tabs = writable([]);
|
||||||
let tabsById = derived(tabs, _ =>
|
let tabsById = derived(tabs, (_) =>
|
||||||
_.reduce((a, c) => ({ ...a, [c.id]: c }), {})
|
_.reduce((a, c) => ({ ...a, [c.id]: c }), {})
|
||||||
);
|
);
|
||||||
let currentIndex = selected;
|
let currentIndex = selected;
|
||||||
|
@ -24,16 +24,16 @@
|
||||||
setContext("Tabs", {
|
setContext("Tabs", {
|
||||||
selectedTab,
|
selectedTab,
|
||||||
selectedContent,
|
selectedContent,
|
||||||
add: data => {
|
add: (data) => {
|
||||||
tabs.update(_ => [..._, { ...data, index: _.length }]);
|
tabs.update((_) => [..._, { ...data, index: _.length }]);
|
||||||
},
|
},
|
||||||
addContent: data => {
|
addContent: (data) => {
|
||||||
content.update(_ => [..._, { ...data, index: _.length }]);
|
content.update((_) => [..._, { ...data, index: _.length }]);
|
||||||
},
|
},
|
||||||
update: id => {
|
update: (id) => {
|
||||||
currentIndex = $tabsById[id].index;
|
currentIndex = $tabsById[id].index;
|
||||||
},
|
},
|
||||||
change: direction => {
|
change: (direction) => {
|
||||||
let index = currentIndex + direction;
|
let index = currentIndex + direction;
|
||||||
|
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
currentIndex = index;
|
currentIndex = index;
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
afterUpdate(() => {
|
afterUpdate(() => {
|
||||||
|
|
|
@ -1,7 +1,26 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the textarea value
|
||||||
|
* @type {string} [value=""]
|
||||||
|
*/
|
||||||
export let value = "";
|
export let value = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the placeholder text
|
||||||
|
* @type {string} [placeholder=""]
|
||||||
|
*/
|
||||||
export let placeholder = "";
|
export let placeholder = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the number of cols
|
||||||
|
* @type {number} [cols=50]
|
||||||
|
*/
|
||||||
export let cols = 50;
|
export let cols = 50;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the number of rows
|
||||||
|
* @type {number} [rows=4]
|
||||||
|
*/
|
||||||
export let rows = 4;
|
export let rows = 4;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,7 +28,17 @@
|
||||||
* @type {boolean} [light=false]
|
* @type {boolean} [light=false]
|
||||||
*/
|
*/
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the input
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the helper text
|
||||||
|
* @type {string} [helperText=""]
|
||||||
|
*/
|
||||||
export let helperText = "";
|
export let helperText = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,8 +53,6 @@
|
||||||
*/
|
*/
|
||||||
export let hideLabel = false;
|
export let hideLabel = false;
|
||||||
|
|
||||||
export let name = undefined;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to indicate an invalid state
|
* Set to `true` to indicate an invalid state
|
||||||
* @type {boolean} [invalid=false]
|
* @type {boolean} [invalid=false]
|
||||||
|
@ -33,7 +60,7 @@
|
||||||
export let invalid = false;
|
export let invalid = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the invalid state text
|
* Specify the text for the invalid state
|
||||||
* @type {string} [invalidText=""]
|
* @type {string} [invalidText=""]
|
||||||
*/
|
*/
|
||||||
export let invalidText = "";
|
export let invalidText = "";
|
||||||
|
@ -44,9 +71,15 @@
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the input
|
||||||
|
* @type {string} [name]
|
||||||
|
*/
|
||||||
|
export let name = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain a reference to the textarea HTML element
|
* Obtain a reference to the textarea HTML element
|
||||||
* @type {null | HTMLElement} [ref=null]
|
* @type {null | HTMLTextAreaElement} [ref=null]
|
||||||
*/
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,69 @@
|
||||||
<script>
|
<script>
|
||||||
export let size = undefined; // "sm" | "xl"
|
/**
|
||||||
export let type = "password";
|
* Set the size of the input
|
||||||
|
* @type {"sm" | "xl"} [size]
|
||||||
|
*/
|
||||||
|
export let size = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the input value
|
||||||
|
* @type {string} [value=""]
|
||||||
|
*/
|
||||||
export let value = "";
|
export let value = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the input type
|
||||||
|
* @type {string} [type="password"]
|
||||||
|
*/
|
||||||
|
export let type = "password";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the placeholder text
|
||||||
|
* @type {string} [placeholder=""]
|
||||||
|
*/
|
||||||
|
export let placeholder = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the hide password label text
|
||||||
|
* @type {string} [hidePasswordLabel="Hide password"]
|
||||||
|
*/
|
||||||
export let hidePasswordLabel = "Hide password";
|
export let hidePasswordLabel = "Hide password";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the show password label text
|
||||||
|
* @type {string} [showPasswordLabel="Show password"]
|
||||||
|
*/
|
||||||
export let showPasswordLabel = "Show password";
|
export let showPasswordLabel = "Show password";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the alignment of the tooltip relative to the icon
|
||||||
|
* @type {"start" | "center" | "end"} [tooltipAlignment="center"]
|
||||||
|
*/
|
||||||
|
export let tooltipAlignment = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the position of the tooltip relative to the icon
|
||||||
|
* @type {"top" | "right" | "bottom" | "left"} [tooltipPosition="bottom"]
|
||||||
|
*/
|
||||||
|
export let tooltipPosition = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to enable the light variant
|
* Set to `true` to enable the light variant
|
||||||
* @type {boolean} [light=false]
|
* @type {boolean} [light=false]
|
||||||
*/
|
*/
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the input
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
export let placeholder = "";
|
|
||||||
export let helperText = "";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the input element
|
* Specify the helper text
|
||||||
* @type {string} [id]
|
* @type {string} [helperText=""]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let helperText = "";
|
||||||
export let name = undefined;
|
|
||||||
export let invalid = false;
|
|
||||||
export let invalidText = "";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the label text
|
* Specify the label text
|
||||||
|
@ -35,8 +76,35 @@
|
||||||
* @type {boolean} [hideLabel=false]
|
* @type {boolean} [hideLabel=false]
|
||||||
*/
|
*/
|
||||||
export let hideLabel = false;
|
export let hideLabel = false;
|
||||||
export let tooltipAlignment = "center";
|
|
||||||
export let tooltipPosition = "bottom";
|
/**
|
||||||
|
* Set to `true` to indicate an invalid state
|
||||||
|
* @type {boolean} [invalid=false]
|
||||||
|
*/
|
||||||
|
export let invalid = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the text for the invalid state
|
||||||
|
* @type {string} [invalidText=""]
|
||||||
|
*/
|
||||||
|
export let invalidText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set an id for the input element
|
||||||
|
* @type {string} [id]
|
||||||
|
*/
|
||||||
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the input
|
||||||
|
* @type {string} [name]
|
||||||
|
*/
|
||||||
|
export let name = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the input HTML element
|
||||||
|
* @type {null | HTMLInputElement} [ref=null]
|
||||||
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
|
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
|
||||||
|
|
|
@ -1,7 +1,26 @@
|
||||||
<script>
|
<script>
|
||||||
export let size = undefined; // "sm" | "xl"
|
/**
|
||||||
export let type = "";
|
* Set the size of the input
|
||||||
|
* @type {"sm" | "xl"} [size]
|
||||||
|
*/
|
||||||
|
export let size = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the input value
|
||||||
|
* @type {string} [value=""]
|
||||||
|
*/
|
||||||
export let value = "";
|
export let value = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the input type
|
||||||
|
* @type {string} [type=""]
|
||||||
|
*/
|
||||||
|
export let type = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the placeholder text
|
||||||
|
* @type {string} [placeholder=""]
|
||||||
|
*/
|
||||||
export let placeholder = "";
|
export let placeholder = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,15 +29,30 @@
|
||||||
*/
|
*/
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the input
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the helper text
|
||||||
|
* @type {string} [helperText=""]
|
||||||
|
*/
|
||||||
|
export let helperText = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the input element
|
* Set an id for the input element
|
||||||
* @type {string} [id]
|
* @type {string} [id]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the input
|
||||||
|
* @type {string} [name]
|
||||||
|
*/
|
||||||
export let name = undefined;
|
export let name = undefined;
|
||||||
export let helperText = "";
|
|
||||||
/**
|
/**
|
||||||
* Specify the label text
|
* Specify the label text
|
||||||
* @type {string} [labelText=""]
|
* @type {string} [labelText=""]
|
||||||
|
@ -43,6 +77,10 @@
|
||||||
*/
|
*/
|
||||||
export let invalidText = "";
|
export let invalidText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the input HTML element
|
||||||
|
* @type {null | HTMLInputElement} [ref=null]
|
||||||
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
|
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
|
||||||
|
|
|
@ -10,10 +10,35 @@
|
||||||
* @type {boolean} [light=false]
|
* @type {boolean} [light=false]
|
||||||
*/
|
*/
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the max height of the tile (number of pixels)
|
||||||
|
* @type {number} [tileMaxHeight=0]
|
||||||
|
*/
|
||||||
export let tileMaxHeight = 0;
|
export let tileMaxHeight = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the padding of the tile (number of pixels)
|
||||||
|
* @type {number} [tilePadding=0]
|
||||||
|
*/
|
||||||
export let tilePadding = 0;
|
export let tilePadding = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the icon text of the collapsed tile
|
||||||
|
* @type {string} [tileCollapsedIconText="Interact to expand Tile"]
|
||||||
|
*/
|
||||||
export let tileCollapsedIconText = "Interact to expand Tile";
|
export let tileCollapsedIconText = "Interact to expand Tile";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the icon text of the expanded tile
|
||||||
|
* @type {string} [tileExpandedIconText="Interact to collapse Tile"]
|
||||||
|
*/
|
||||||
export let tileExpandedIconText = "Interact to collapse Tile";
|
export let tileExpandedIconText = "Interact to collapse Tile";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the tabindex
|
||||||
|
* @type {string} [tabindex="0"]
|
||||||
|
*/
|
||||||
export let tabindex = "0";
|
export let tabindex = "0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,6 +46,11 @@
|
||||||
* @type {string} [id]
|
* @type {string} [id]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the input HTML element
|
||||||
|
* @type {null | HTMLElement} [ref=null]
|
||||||
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import { afterUpdate } from "svelte";
|
import { afterUpdate } from "svelte";
|
||||||
|
|
|
@ -10,8 +10,23 @@
|
||||||
* @type {boolean} [light=false]
|
* @type {boolean} [light=false]
|
||||||
*/
|
*/
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the value of the radio input
|
||||||
|
* @type {string} [value=""]
|
||||||
|
*/
|
||||||
export let value = "";
|
export let value = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the tabindex
|
||||||
|
* @type {string} [tabindex="0"]
|
||||||
|
*/
|
||||||
export let tabindex = "0";
|
export let tabindex = "0";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the radio tile checkmark icon
|
||||||
|
* @type {string} [iconDescription="Tile checkmark"]
|
||||||
|
*/
|
||||||
export let iconDescription = "Tile checkmark";
|
export let iconDescription = "Tile checkmark";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,6 +34,11 @@
|
||||||
* @type {string} [id]
|
* @type {string} [id]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the input
|
||||||
|
* @type {string} [name=""]
|
||||||
|
*/
|
||||||
export let name = "";
|
export let name = "";
|
||||||
|
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
|
|
|
@ -10,9 +10,29 @@
|
||||||
* @type {boolean} [light=false]
|
* @type {boolean} [light=false]
|
||||||
*/
|
*/
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the title of the selectable tile
|
||||||
|
* @type {string} [title="title"]
|
||||||
|
*/
|
||||||
export let title = "title";
|
export let title = "title";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the value of the selectable tile
|
||||||
|
* @type {string} [value="value"]
|
||||||
|
*/
|
||||||
export let value = "value";
|
export let value = "value";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the tabindex
|
||||||
|
* @type {string} [tabindex="0"]
|
||||||
|
*/
|
||||||
export let tabindex = "0";
|
export let tabindex = "0";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the selectable tile checkmark icon
|
||||||
|
* @type {string} [iconDescription="Tile checkmark"]
|
||||||
|
*/
|
||||||
export let iconDescription = "Tile checkmark";
|
export let iconDescription = "Tile checkmark";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,7 +40,17 @@
|
||||||
* @type {string} [id]
|
* @type {string} [id]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the input
|
||||||
|
* @type {string} [name=""]
|
||||||
|
*/
|
||||||
export let name = "";
|
export let name = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the input HTML element
|
||||||
|
* @type {null | HTMLInputElement} [ref=null]
|
||||||
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import { createEventDispatcher } from "svelte";
|
import { createEventDispatcher } from "svelte";
|
||||||
|
|
|
@ -1,6 +1,20 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the selected tile value
|
||||||
|
* @type {string} [selected]
|
||||||
|
*/
|
||||||
export let selected = undefined;
|
export let selected = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the tile group
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the legend text
|
||||||
|
* @type {string} [legend]
|
||||||
|
*/
|
||||||
export let legend = "";
|
export let legend = "";
|
||||||
|
|
||||||
import { createEventDispatcher, setContext } from "svelte";
|
import { createEventDispatcher, setContext } from "svelte";
|
||||||
|
@ -16,9 +30,9 @@
|
||||||
selectedValue.set(value);
|
selectedValue.set(value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
update: value => {
|
update: (value) => {
|
||||||
selectedValue.set(value);
|
selectedValue.set(value);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
$: selected = $selectedValue;
|
$: selected = $selectedValue;
|
||||||
|
|
|
@ -1,8 +1,32 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the input value
|
||||||
|
* @type {string} [value=""]
|
||||||
|
*/
|
||||||
export let value = "";
|
export let value = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the input type
|
||||||
|
* @type {string} [type="text"]
|
||||||
|
*/
|
||||||
export let type = "text";
|
export let type = "text";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the input placeholder text
|
||||||
|
* @type {string} [placeholder="hh=mm"]
|
||||||
|
*/
|
||||||
export let placeholder = "hh=mm";
|
export let placeholder = "hh=mm";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the `pattern` attribute for the input element
|
||||||
|
* @type {string} [pattern="(1[012]|[1-9]):[0-5][0-9](\\s)?"]
|
||||||
|
*/
|
||||||
export let pattern = "(1[012]|[1-9]):[0-5][0-9](\\s)?";
|
export let pattern = "(1[012]|[1-9]):[0-5][0-9](\\s)?";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the `maxlength` input attribute
|
||||||
|
* @type {number} [maxLength=5]
|
||||||
|
*/
|
||||||
export let maxlength = 5;
|
export let maxlength = 5;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,17 +34,24 @@
|
||||||
* @type {boolean} [light=false]
|
* @type {boolean} [light=false]
|
||||||
*/
|
*/
|
||||||
export let light = false;
|
export let light = false;
|
||||||
export let disabled = false;
|
|
||||||
|
|
||||||
export let labelText = "";
|
|
||||||
export let hideLabel = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the input element
|
* Set to `true` to disable the input
|
||||||
* @type {string} [id]
|
* @type {boolean} [disabled=false]
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let disabled = false;
|
||||||
export let name = undefined;
|
|
||||||
|
/**
|
||||||
|
* Specify the label text
|
||||||
|
* @type {string} [labelText=""]
|
||||||
|
*/
|
||||||
|
export let labelText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to visually hide the label text
|
||||||
|
* @type {boolean} [hideLabel=false]
|
||||||
|
*/
|
||||||
|
export let hideLabel = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to indicate an invalid state
|
* Set to `true` to indicate an invalid state
|
||||||
|
@ -33,6 +64,24 @@
|
||||||
* @type {string} [invalidText="Invalid time format."]
|
* @type {string} [invalidText="Invalid time format."]
|
||||||
*/
|
*/
|
||||||
export let invalidText = "";
|
export let invalidText = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set an id for the input element
|
||||||
|
* @type {string} [id]
|
||||||
|
*/
|
||||||
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the input
|
||||||
|
* @type {string} [name]
|
||||||
|
*/
|
||||||
|
export let name = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the input HTML element
|
||||||
|
* @type {null | HTMLInputElement} [ref=null]
|
||||||
|
*/
|
||||||
|
export let ref = null;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
@ -57,6 +106,7 @@
|
||||||
</label>
|
</label>
|
||||||
{/if}
|
{/if}
|
||||||
<input
|
<input
|
||||||
|
bind:this={ref}
|
||||||
data-invalid={invalid || undefined}
|
data-invalid={invalid || undefined}
|
||||||
{pattern}
|
{pattern}
|
||||||
{placeholder}
|
{placeholder}
|
||||||
|
|
|
@ -1,11 +1,33 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the select value
|
||||||
|
* @type {string} [value=""]
|
||||||
|
*/
|
||||||
export let value = "";
|
export let value = "";
|
||||||
export let name = undefined;
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the select
|
||||||
|
* @type {boolean} [disabled=false]
|
||||||
|
*/
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the chevron icon
|
||||||
|
* @type {string} [iconDescription="Expand/Collapse"]
|
||||||
|
*/
|
||||||
export let iconDescription = "Open list of options";
|
export let iconDescription = "Open list of options";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the label text
|
||||||
|
* @type {string} [labelText=""]
|
||||||
|
*/
|
||||||
export let labelText = "";
|
export let labelText = "";
|
||||||
export let hideLabel = true;
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to visually hide the label text
|
||||||
|
* @type {boolean} [hideLabel=false]
|
||||||
|
*/
|
||||||
|
export let hideLabel = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an id for the select element
|
* Set an id for the select element
|
||||||
|
@ -13,6 +35,18 @@
|
||||||
*/
|
*/
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify a name attribute for the select element
|
||||||
|
* @type {string} [name]
|
||||||
|
*/
|
||||||
|
export let name = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the select HTML element
|
||||||
|
* @type {null | HTMLSelectElement} [ref=null]
|
||||||
|
*/
|
||||||
|
export let ref = null;
|
||||||
|
|
||||||
import { setContext } from "svelte";
|
import { setContext } from "svelte";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
import ChevronDownGlyph from "carbon-icons-svelte/lib/ChevronDownGlyph";
|
import ChevronDownGlyph from "carbon-icons-svelte/lib/ChevronDownGlyph";
|
||||||
|
@ -43,6 +77,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
<!-- svelte-ignore a11y-no-onchange -->
|
<!-- svelte-ignore a11y-no-onchange -->
|
||||||
<select
|
<select
|
||||||
|
bind:this={ref}
|
||||||
{id}
|
{id}
|
||||||
{name}
|
{name}
|
||||||
{disabled}
|
{disabled}
|
||||||
|
|
|
@ -20,18 +20,18 @@
|
||||||
/**
|
/**
|
||||||
* Specify the icon from `carbon-icons-svelte` to render for the tooltip button
|
* Specify the icon from `carbon-icons-svelte` to render for the tooltip button
|
||||||
* Icon size must be 16px (e.g. `Add16`, `Task16`)
|
* Icon size must be 16px (e.g. `Add16`, `Task16`)
|
||||||
* @type {typeof import("carbon-icons-svelte/lib/Information16")} [icon=Information16]
|
* @type {typeof import("carbon-icons-svelte/lib/Add16").default} [icon=Information16]
|
||||||
*/
|
*/
|
||||||
export let icon = Information16;
|
export let icon = Information16;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the ARIA label for the tooltip button
|
* Specify the ARIA label for the tooltip button
|
||||||
* @type {string} [iconDescription=""]
|
* @type {string} [iconDescription=""]
|
||||||
*/
|
*/
|
||||||
export let iconDescription = "";
|
export let iconDescription = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the icon name attribute
|
* Specify the icon name attribute
|
||||||
* @type {string} [iconName=""]
|
* @type {string} [iconName=""]
|
||||||
*/
|
*/
|
||||||
export let iconName = "";
|
export let iconName = "";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* Define the tooltip text
|
* Specify the tooltip text
|
||||||
* @type {string} [tooltipText=""]
|
* @type {string} [tooltipText=""]
|
||||||
*/
|
*/
|
||||||
export let tooltipText = "";
|
export let tooltipText = "";
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain a reference to the button HTML element
|
* Obtain a reference to the button HTML element
|
||||||
* @type {null | HTMLElement} [ref=null]
|
* @type {null | HTMLButtonElement} [ref=null]
|
||||||
*/
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* Define the tooltip text
|
* Specify the tooltip text
|
||||||
* @type {string} [tooltipText=""]
|
* @type {string} [tooltipText=""]
|
||||||
*/
|
*/
|
||||||
export let tooltipText = "";
|
export let tooltipText = "";
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain a reference to the button HTML element
|
* Obtain a reference to the button HTML element
|
||||||
* @type {null | HTMLElement} [ref=null]
|
* @type {null | HTMLButtonElement} [ref=null]
|
||||||
*/
|
*/
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* Set an id for the main element
|
* Specify the id for the main element
|
||||||
* @type {string} [id]
|
* @type {string} [id="main-content"]
|
||||||
*/
|
*/
|
||||||
export let id = "main-content";
|
export let id = "main-content";
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,9 +1,33 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to open the side nav
|
||||||
|
* @type {boolean} [isSideNavOpen=false]
|
||||||
|
*/
|
||||||
|
export let isSideNavOpen = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the header
|
||||||
|
* @type {string} [uiShellAriaLabel]
|
||||||
|
*/
|
||||||
export let uiShellAriaLabel = undefined;
|
export let uiShellAriaLabel = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the `href` attribute
|
||||||
|
* @type {string} [href]
|
||||||
|
*/
|
||||||
export let href = undefined;
|
export let href = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the company name
|
||||||
|
* @type {string} [company]
|
||||||
|
*/
|
||||||
export let company = undefined;
|
export let company = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the platform name
|
||||||
|
* @type {string} [platformName]
|
||||||
|
*/
|
||||||
export let platformName = undefined;
|
export let platformName = undefined;
|
||||||
export let isSideNavOpen = undefined;
|
|
||||||
|
|
||||||
import HamburgerMenu from "../SideNav/HamburgerMenu.svelte";
|
import HamburgerMenu from "../SideNav/HamburgerMenu.svelte";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
<script>
|
<script>
|
||||||
export let searchIsActive = undefined;
|
/**
|
||||||
|
* Set to `true` to focus the search
|
||||||
|
* @type {boolean} [searchIsActive=false]
|
||||||
|
*/
|
||||||
|
export let searchIsActive = false;
|
||||||
|
|
||||||
import { createEventDispatcher } from "svelte";
|
import { createEventDispatcher } from "svelte";
|
||||||
import Close20 from "carbon-icons-svelte/lib/Close20";
|
import Close20 from "carbon-icons-svelte/lib/Close20";
|
||||||
|
@ -18,7 +22,7 @@
|
||||||
function dispatchInputs(event) {
|
function dispatchInputs(event) {
|
||||||
const params = {
|
const params = {
|
||||||
action: "search",
|
action: "search",
|
||||||
textInput: event.target.value
|
textInput: event.target.value,
|
||||||
};
|
};
|
||||||
dispatch("inputSearch", params);
|
dispatch("inputSearch", params);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the nav
|
||||||
|
* @type {string} [ariaLabel]
|
||||||
|
*/
|
||||||
export let ariaLabel = undefined;
|
export let ariaLabel = undefined;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the `href` attribute
|
||||||
|
* @type {string} [href]
|
||||||
|
*/
|
||||||
export let href = undefined;
|
export let href = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the text
|
||||||
|
* @type {string} [text]
|
||||||
|
*/
|
||||||
export let text = undefined;
|
export let text = undefined;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,26 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to toggle the expanded state
|
||||||
|
* @type {boolean} [expanded=false]
|
||||||
|
*/
|
||||||
export let expanded = false;
|
export let expanded = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the `href` attribute
|
||||||
|
* @type {string} [href="/"]
|
||||||
|
*/
|
||||||
export let href = "/";
|
export let href = "/";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the text
|
||||||
|
* @type {string} [text]
|
||||||
|
*/
|
||||||
export let text = undefined;
|
export let text = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the chevron icon
|
||||||
|
* @type {string} [iconDescription="Expand/Collapse"]
|
||||||
|
*/
|
||||||
export let iconDescription = "Expand/Collapse";
|
export let iconDescription = "Expand/Collapse";
|
||||||
|
|
||||||
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16";
|
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16";
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the `href` attribute
|
||||||
|
* @type {string} [href]
|
||||||
|
*/
|
||||||
export let href = undefined;
|
export let href = undefined;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the button
|
||||||
|
* @type {string} [ariaLabel]
|
||||||
|
*/
|
||||||
export let ariaLabel = undefined;
|
export let ariaLabel = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to toggle the open state
|
||||||
|
* @type {boolean} [isOpen=false]
|
||||||
|
*/
|
||||||
export let isOpen = false;
|
export let isOpen = false;
|
||||||
|
|
||||||
import { fly } from "svelte/transition";
|
import { fly } from "svelte/transition";
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the ARIA label for the nav
|
||||||
|
* @type {string} [ariaLabel]
|
||||||
|
*/
|
||||||
export let ariaLabel = undefined;
|
export let ariaLabel = undefined;
|
||||||
export let isOpen = undefined;
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to toggle the expanded state
|
||||||
|
* @type {boolean} [isOpen=false]
|
||||||
|
*/
|
||||||
|
export let isOpen = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav
|
<nav
|
||||||
|
|
|
@ -1,7 +1,26 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to select the current link
|
||||||
|
* @type {boolean} [isSelected=false]
|
||||||
|
*/
|
||||||
export let isSelected = false;
|
export let isSelected = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the `href` attribute
|
||||||
|
* @type {string} [href]
|
||||||
|
*/
|
||||||
export let href = undefined;
|
export let href = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the text
|
||||||
|
* @type {string} [text]
|
||||||
|
*/
|
||||||
export let text = undefined;
|
export let text = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the icon props
|
||||||
|
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }} [icon]
|
||||||
|
*/
|
||||||
export let icon = undefined;
|
export let icon = undefined;
|
||||||
|
|
||||||
import { Icon } from "../../Icon";
|
import { Icon } from "../../Icon";
|
||||||
|
@ -9,7 +28,7 @@
|
||||||
|
|
||||||
<li class:bx--side-nav__item={true}>
|
<li class:bx--side-nav__item={true}>
|
||||||
<a
|
<a
|
||||||
aria-current={isSelected ? 'page' : ''}
|
aria-current={isSelected ? 'page' : undefined}
|
||||||
{href}
|
{href}
|
||||||
class:bx--side-nav__link={true}
|
class:bx--side-nav__link={true}
|
||||||
class:bx--side-nav__link--current={isSelected}
|
class:bx--side-nav__link--current={isSelected}
|
||||||
|
|
|
@ -1,6 +1,20 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to toggle the expanded state
|
||||||
|
* @type {boolean} [expanded]
|
||||||
|
*/
|
||||||
export let expanded = false;
|
export let expanded = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the text
|
||||||
|
* @type {string} [text]
|
||||||
|
*/
|
||||||
export let text = undefined;
|
export let text = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the icon props
|
||||||
|
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }} [icon]
|
||||||
|
*/
|
||||||
export let icon = undefined;
|
export let icon = undefined;
|
||||||
|
|
||||||
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16";
|
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16";
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<li role="none" class:bx--side-nav__menu-item={true}>
|
<li role="none" class:bx--side-nav__menu-item={true}>
|
||||||
<a
|
<a
|
||||||
role="menuitem"
|
role="menuitem"
|
||||||
aria-current={isSelected ? 'page' : ''}
|
aria-current={isSelected ? 'page' : undefined}
|
||||||
{href}
|
{href}
|
||||||
class:bx--side-nav__link={true}
|
class:bx--side-nav__link={true}
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the `href` attribute
|
||||||
|
* @type {string} [href="#main-content"]
|
||||||
|
*/
|
||||||
export let href = "#main-content";
|
export let href = "#main-content";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the tabindex
|
||||||
|
* @type {string} [tabindex="0"]
|
||||||
|
*/
|
||||||
export let tabindex = "0";
|
export let tabindex = "0";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue