@govtechsg/sgds-web-component 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +571 -41
- package/base/card-element.d.ts +4 -4
- package/base/dropdown-element.d.ts +29 -8
- package/base/link-element.d.ts +8 -0
- package/components/Accordion/index.d.ts +2 -2
- package/components/Accordion/sgds-accordion-item.d.ts +8 -4
- package/components/Accordion/sgds-accordion.d.ts +4 -2
- package/components/ActionCard/index.d.ts +1 -1
- package/components/ActionCard/sgds-action-card.d.ts +38 -10
- package/components/Alert/index.d.ts +1 -1
- package/components/Badge/index.d.ts +1 -1
- package/components/Button/index.d.ts +1 -1
- package/components/Button/sgds-button.d.ts +16 -10
- package/components/Card/index.d.ts +1 -0
- package/components/Card/sgds-card.d.ts +24 -0
- package/components/Checkbox/index.d.ts +1 -1
- package/components/Checkbox/sgds-checkbox.d.ts +26 -7
- package/components/Dropdown/index.d.ts +2 -3
- package/components/Dropdown/sgds-dropdown-item.d.ts +6 -2
- package/components/Dropdown/sgds-dropdown.d.ts +19 -0
- package/components/FileUpload/index.d.ts +1 -1
- package/components/FileUpload/sgds-file-upload.d.ts +44 -0
- package/components/Footer/index.d.ts +1 -1
- package/components/Footer/sgds-footer.d.ts +35 -1
- package/components/Input/index.d.ts +1 -1
- package/components/Input/sgds-input.d.ts +46 -13
- package/components/Mainnav/index.d.ts +3 -3
- package/components/Mainnav/sgds-mainnav-dropdown.d.ts +4 -0
- package/components/Mainnav/sgds-mainnav-item.d.ts +5 -1
- package/components/Mainnav/sgds-mainnav.d.ts +20 -5
- package/components/Masthead/index.d.ts +1 -1
- package/components/Masthead/sgds-masthead.d.ts +17 -0
- package/components/Modal/index.d.ts +1 -1
- package/components/Modal/sgds-modal.d.ts +45 -0
- package/components/QuantityToggle/index.d.ts +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.d.ts +39 -14
- package/components/Radio/index.d.ts +2 -2
- package/components/Radio/sgds-radio-group.d.ts +27 -12
- package/components/Radio/sgds-radio.d.ts +12 -3
- package/components/Sidenav/index.d.ts +3 -3
- package/components/Sidenav/sgds-sidenav-item.d.ts +27 -6
- package/components/Sidenav/sgds-sidenav-link.d.ts +6 -1
- package/components/Sidenav/sgds-sidenav.d.ts +8 -1
- package/components/Spinner/index.d.ts +1 -0
- package/components/Spinner/sgds-spinner.d.ts +11 -0
- package/components/Stepper/sgds-stepper.d.ts +31 -7
- package/components/Tab/index.d.ts +3 -3
- package/components/Table/sgds-table.d.ts +54 -3
- package/components/Textarea/index.d.ts +1 -1
- package/components/Textarea/sgds-textarea.d.ts +44 -15
- package/components/Toast/index.d.ts +1 -1
- package/components/Tooltip/index.d.ts +1 -1
- package/index.d.ts +2 -0
- package/index.js +1331 -824
- package/index.js.map +1 -1
- package/main.d.ts +1 -0
- package/package.json +1 -1
- package/react/action-card/index.d.ts +3 -1
- package/react/{fileupload → card}/index.d.ts +1 -1
- package/react/checkbox/index.d.ts +3 -1
- package/react/cjs/index.js +1521 -949
- package/react/cjs/index.js.map +1 -1
- package/react/dropdown/index.d.ts +6 -1
- package/react/file-upload/index.d.ts +5 -0
- package/react/index.d.ts +4 -2
- package/react/index.js +1493 -923
- package/react/index.js.map +1 -1
- package/react/input/index.d.ts +6 -1
- package/react/mainnav-dropdown/index.d.ts +6 -1
- package/react/modal/index.d.ts +7 -1
- package/react/quantity-toggle/index.d.ts +4 -1
- package/react/radio/index.d.ts +4 -1
- package/react/radio-group/index.d.ts +3 -1
- package/react/spinner/index.d.ts +3 -0
- package/react/stepper/index.d.ts +8 -1
- package/react/textarea/index.d.ts +6 -1
- package/umd/index.js +1280 -844
- package/umd/index.js.map +1 -1
- package/utils/form.d.ts +16 -0
- package/components/FileUpload/sgds-fileupload.d.ts +0 -22
|
@@ -1,48 +1,77 @@
|
|
|
1
1
|
import SgdsElement from "../../base/sgds-element";
|
|
2
|
-
|
|
2
|
+
import { SgdsFormControl } from "../../utils/form";
|
|
3
|
+
/**
|
|
4
|
+
* @summary Text areas allow for the collection of input longer than a single line.
|
|
5
|
+
*
|
|
6
|
+
* @event sgds-change - Emitted when an alteration to the control's value is committed by the user.
|
|
7
|
+
* @event sgds-input - Emitted when the control receives input and its value changes.
|
|
8
|
+
* @event sgds-focus - Emitted when textarea is in focus.
|
|
9
|
+
* @event sgds-blur - Emitted when textarea loses focus.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SgdsTextarea extends SgdsElement implements SgdsFormControl {
|
|
3
12
|
static styles: import("lit").CSSResultGroup[];
|
|
13
|
+
/**@internal */
|
|
4
14
|
textarea: HTMLTextAreaElement;
|
|
5
|
-
|
|
15
|
+
/**@internal */
|
|
6
16
|
private readonly formSubmitController;
|
|
17
|
+
/**@internal */
|
|
7
18
|
private resizeObserver;
|
|
19
|
+
/**The textarea's label */
|
|
8
20
|
label: string;
|
|
9
|
-
|
|
10
|
-
name:
|
|
11
|
-
|
|
21
|
+
/**The textarea's name attribute */
|
|
22
|
+
name: string;
|
|
23
|
+
/**Forwarded to the HTML native textarea element. Can be used to insert any bootstrap classes such as mt-2 */
|
|
24
|
+
textareaClasses?: string;
|
|
25
|
+
/**The textarea's value attribute. */
|
|
12
26
|
value: string;
|
|
13
|
-
|
|
14
|
-
|
|
27
|
+
/**Sets the minimum length of the textarea */
|
|
28
|
+
minlength: number;
|
|
29
|
+
/**Sets the maximum length of the textarea */
|
|
30
|
+
maxlength: number;
|
|
31
|
+
/**Enables spell checking on the textarea */
|
|
15
32
|
spellcheck: boolean;
|
|
16
33
|
/** The number of rows to display by default. */
|
|
17
34
|
rows: number;
|
|
35
|
+
/**The textarea's placeholder text. */
|
|
18
36
|
placeholder: string;
|
|
37
|
+
/**Feedback text for error state when validated */
|
|
19
38
|
invalidFeedback: string;
|
|
39
|
+
/**Autofocus the textarea */
|
|
20
40
|
autofocus: boolean;
|
|
41
|
+
/**Disables the textarea. */
|
|
21
42
|
disabled: boolean;
|
|
43
|
+
/**Makes the textarea a required field. */
|
|
22
44
|
required: boolean;
|
|
23
|
-
/** Makes the
|
|
45
|
+
/** Makes the textarea readonly. */
|
|
24
46
|
readonly: boolean;
|
|
25
|
-
invalid: boolean;
|
|
26
|
-
valid: boolean;
|
|
27
47
|
/** Controls how the textarea can be resized. */
|
|
28
48
|
resize: "none" | "vertical" | "auto";
|
|
29
|
-
/** The textarea's inputmode attribute. */
|
|
49
|
+
/** The native textarea's inputmode attribute. It hints at the type of data that might be entered by the user while editing the element or its contents. This allows a browser to display an appropriate virtual keyboard. */
|
|
30
50
|
inputmode: "none" | "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url";
|
|
51
|
+
/** The native textarea's autocorrect attribute. */
|
|
31
52
|
autocorrect: string;
|
|
32
53
|
/** Gets or sets the default value used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */
|
|
33
54
|
defaultValue: string;
|
|
55
|
+
/** Allows invalidFeedback, invalid and valid styles to be visible with the input */
|
|
56
|
+
hasFeedback: boolean;
|
|
57
|
+
/**@internal */
|
|
58
|
+
invalid: boolean;
|
|
59
|
+
/**@internal */
|
|
60
|
+
valid: boolean;
|
|
61
|
+
/** @internal The textarea's unique id */
|
|
62
|
+
private textareaId;
|
|
34
63
|
connectedCallback(): void;
|
|
35
64
|
disconnectedCallback(): void;
|
|
36
65
|
/** Sets focus on the textarea. */
|
|
37
66
|
focus(options?: FocusOptions): void;
|
|
38
67
|
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
39
68
|
reportValidity(): boolean;
|
|
40
|
-
|
|
69
|
+
/** Selects all the text in the textarea. */
|
|
70
|
+
select(): void;
|
|
71
|
+
handleInvalid(e: Event): void;
|
|
41
72
|
handleChange(event: string): void;
|
|
42
73
|
handleFocus(): void;
|
|
43
74
|
handleBlur(): void;
|
|
44
|
-
/** Selects all the text in the textarea. */
|
|
45
|
-
select(): void;
|
|
46
75
|
handleKeyDown(event: KeyboardEvent): void;
|
|
47
76
|
handleRowsChange(): void;
|
|
48
77
|
setTextareaHeight(): void;
|
|
@@ -50,4 +79,4 @@ export declare class SgdsTextArea extends SgdsElement {
|
|
|
50
79
|
handleValueChange(): void;
|
|
51
80
|
render(): import("lit").TemplateResult;
|
|
52
81
|
}
|
|
53
|
-
export default
|
|
82
|
+
export default SgdsTextarea;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SgdsToast } from "./sgds-toast";
|
|
1
|
+
export { SgdsToast, ToastVariant } from "./sgds-toast";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { SgdsTooltip } from "./sgds-tooltip";
|
package/index.d.ts
CHANGED