mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
build: use svelte compiler to generate typescript definitions
This commit is contained in:
parent
ba2e77eb47
commit
5c829b5afc
16 changed files with 4948 additions and 948 deletions
|
@ -16,7 +16,17 @@
|
|||
* @type {string} [placeholder=""]
|
||||
*/
|
||||
export let placeholder = "";
|
||||
|
||||
/**
|
||||
* Specify the Regular Expression for the input value
|
||||
* @type {string} [placeholder="\\d{1,2}\\/\\d{1,2}\\/\\d{4}"]
|
||||
*/
|
||||
export let pattern = "\\d{1,2}\\/\\d{1,2}\\/\\d{4}";
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the input
|
||||
* @type {boolean} [disabled=false]
|
||||
*/
|
||||
export let disabled = false;
|
||||
|
||||
/**
|
||||
|
@ -30,7 +40,17 @@
|
|||
* @type {string} [id]
|
||||
*/
|
||||
export let id = "ccs-" + Math.random().toString(36);
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
|
@ -45,6 +65,10 @@
|
|||
*/
|
||||
export let invalidText = "";
|
||||
|
||||
/**
|
||||
* Set a name for the input element
|
||||
* @type {string} [name=""]
|
||||
*/
|
||||
export let name = undefined;
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,10 +3,24 @@
|
|||
* Set to `true` to indicate an invalid state
|
||||
* @type {boolean} [invalid=false]
|
||||
*/
|
||||
export let invalid = false;
|
||||
export let invalid = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to render a form requirement
|
||||
* @type {boolean} [message=false]
|
||||
*/
|
||||
export let message = false;
|
||||
|
||||
/**
|
||||
* Specify the message text
|
||||
* @type {string} [messageText=""]
|
||||
*/
|
||||
export let messageText = "";
|
||||
|
||||
/**
|
||||
* Specify the legend text
|
||||
* @type {string} [legendText=""]
|
||||
*/
|
||||
export let legendText = "";
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
<script>
|
||||
/**
|
||||
* @typedef {string} MultiSelectItemId
|
||||
* @typedef {string} MultiSelectItemText
|
||||
* @typedef {{ id: MultiSelectItemId; text: MultiSelectItemText; }} MultiSelectItem
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set the multiselect items
|
||||
* @type {MultiSelectItem[]} [items=[]]
|
||||
|
@ -153,6 +147,12 @@
|
|||
*/
|
||||
export let name = undefined;
|
||||
|
||||
/**
|
||||
* @typedef {string} MultiSelectItemId
|
||||
* @typedef {string} MultiSelectItemText
|
||||
* @typedef {{ id: MultiSelectItemId; text: MultiSelectItemText; }} MultiSelectItem
|
||||
*/
|
||||
|
||||
import { afterUpdate, setContext } from "svelte";
|
||||
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
|
||||
import { Checkbox } from "../Checkbox";
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
/**
|
||||
* Specify the title of the icon
|
||||
* @type {string} [title]
|
||||
*/
|
||||
export let title = undefined;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to use the vertical variant
|
||||
* @type {boolean} [vertical=false]
|
||||
*/
|
||||
export let vertical = false;
|
||||
</script>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
/**
|
||||
* Set to `true` to use the vertical variant
|
||||
* @type {boolean} [vertical=false]
|
||||
*/
|
||||
export let vertical = false;
|
||||
|
||||
|
|
|
@ -1,9 +1,28 @@
|
|||
<script>
|
||||
export let disabled = false;
|
||||
export let hidden = false;
|
||||
export let text = "";
|
||||
/**
|
||||
* Specify the option value
|
||||
* @type {string} [value=""]
|
||||
*/
|
||||
export let value = "";
|
||||
|
||||
/**
|
||||
* Specify the option text
|
||||
* @type {string} [text=""]
|
||||
*/
|
||||
export let text = "";
|
||||
|
||||
/**
|
||||
* Set to `true` to hide the option
|
||||
* @type {boolean} [hidden=false]
|
||||
*/
|
||||
export let hidden = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the option
|
||||
* @type {boolean} [disabled=false]
|
||||
*/
|
||||
export let disabled = false;
|
||||
|
||||
import { getContext, onDestroy } from "svelte";
|
||||
|
||||
const ctx = getContext("Select") || getContext("TimePickerSelect");
|
||||
|
|
|
@ -1,5 +1,74 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the value of the slider
|
||||
* @type {string} [value=""]
|
||||
*/
|
||||
export let value = "";
|
||||
|
||||
/**
|
||||
* Set the maximum slider value
|
||||
* @type {number} [max=100]
|
||||
*/
|
||||
export let max = 100;
|
||||
|
||||
/**
|
||||
* Specify the label for the max value
|
||||
* @type {string} [maxLabel=""]
|
||||
*/
|
||||
export let maxLabel = "";
|
||||
|
||||
/**
|
||||
* Set the minimum slider value
|
||||
* @type {number} [min=100]
|
||||
*/
|
||||
export let min = 0;
|
||||
|
||||
/**
|
||||
* Specify the label for the min value
|
||||
* @type {string} [minLabel=""]
|
||||
*/
|
||||
export let minLabel = "";
|
||||
|
||||
/**
|
||||
* Set the step value
|
||||
* @type {number} [step=1]
|
||||
*/
|
||||
export let step = 1;
|
||||
|
||||
/**
|
||||
* Set the step multiplier value
|
||||
* @type {number} [stepMultiplier=4]
|
||||
*/
|
||||
export let stepMultiplier = 4;
|
||||
|
||||
/**
|
||||
* Set to `true` to require a value
|
||||
* @type {boolean} [required=false]
|
||||
*/
|
||||
export let required = false;
|
||||
|
||||
/**
|
||||
* Specify the input type
|
||||
* @type {string} [inputType="number"]
|
||||
*/
|
||||
export let inputType = "number";
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the slider
|
||||
* @type {boolean} [disabled=false]
|
||||
*/
|
||||
export let disabled = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @type {boolean} [light=false]
|
||||
*/
|
||||
export let light = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to hide the text input
|
||||
* @type {boolean} [hideTextInput=false]
|
||||
*/
|
||||
export let hideTextInput = false;
|
||||
|
||||
/**
|
||||
|
@ -7,7 +76,6 @@
|
|||
* @type {string} [id]
|
||||
*/
|
||||
export let id = "ccs-" + Math.random().toString(36);
|
||||
export let inputType = "number";
|
||||
|
||||
/**
|
||||
* Set to `true` to indicate an invalid state
|
||||
|
@ -21,26 +89,11 @@
|
|||
*/
|
||||
export let labelText = "";
|
||||
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @type {boolean} [light=false]
|
||||
*/
|
||||
export let light = false;
|
||||
|
||||
export let max = 100;
|
||||
export let maxLabel = "";
|
||||
export let min = 0;
|
||||
export let minLabel = "";
|
||||
|
||||
/**
|
||||
* Set a name for the slider element
|
||||
* @type {string} [name=""]
|
||||
*/
|
||||
export let name = "";
|
||||
export let required = false;
|
||||
export let step = 1;
|
||||
export let stepMultiplier = 4;
|
||||
export let value = "";
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML element
|
||||
|
|
|
@ -1,6 +1,20 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to select the item
|
||||
* @type {boolean} [isSelected]
|
||||
*/
|
||||
export let isSelected = undefined;
|
||||
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href]
|
||||
*/
|
||||
export let href = undefined;
|
||||
|
||||
/**
|
||||
* Specify the item text
|
||||
* @type {string} [text]
|
||||
*/
|
||||
export let text = undefined;
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue