@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,31 +1,52 @@
|
|
|
1
|
-
import { Dropdown } from "bootstrap";
|
|
2
|
-
import * as Popper from "@popperjs/core";
|
|
3
1
|
import type { StrictModifiers } from "@popperjs/core";
|
|
2
|
+
import * as Popper from "@popperjs/core";
|
|
3
|
+
import { Dropdown } from "bootstrap";
|
|
4
4
|
import { Ref } from "lit/directives/ref.js";
|
|
5
5
|
import { SgdsDropdownItem } from "../components/Dropdown/sgds-dropdown-item";
|
|
6
6
|
import SgdsElement from "./sgds-element";
|
|
7
|
-
export type DropdownButtonVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark";
|
|
8
7
|
export type DropDirection = "left" | "right" | "up" | "down";
|
|
8
|
+
/**
|
|
9
|
+
* @event sgds-show - Emitted event when show instance is called
|
|
10
|
+
* @event sgds-after-show - Emitted event when dropdown has been made visible to the user and CSS transitions have completed
|
|
11
|
+
* @event sgds-hide - Emitted event when hide instance is called
|
|
12
|
+
* @event sgds-after-hide - Emitted event when dropdown has hidden to the user and CSS transitions have completed
|
|
13
|
+
*/
|
|
9
14
|
export declare class DropdownElement extends SgdsElement {
|
|
10
15
|
static styles: import("lit").CSSResultGroup;
|
|
16
|
+
/** @internal */
|
|
11
17
|
myDropdown: Ref<HTMLElement>;
|
|
18
|
+
/** @internal */
|
|
12
19
|
bsDropdown: Dropdown;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
/** @internal Controls auto-flipping of menu */
|
|
21
|
+
protected noFlip: boolean;
|
|
22
|
+
/** @internal When true, aligns right edge of menu with right edge of button */
|
|
23
|
+
protected menuAlignRight: boolean;
|
|
24
|
+
/** @internal The drop position of menu relative to the toggle button */
|
|
25
|
+
protected drop: DropDirection;
|
|
26
|
+
/** Additional configuration to pass to Popper.js. See https://popper.js.org/ for config opts */
|
|
16
27
|
popperOpts: {};
|
|
17
|
-
|
|
28
|
+
/** @internal Forwards value to id attribute of toggle button of Dropdown. An unique id generated by default */
|
|
29
|
+
protected togglerId: string;
|
|
30
|
+
/** Sets the text content of Dropdown button */
|
|
18
31
|
togglerText: string;
|
|
19
|
-
|
|
32
|
+
/** When true, dropdown menu shows on first load */
|
|
20
33
|
menuIsOpen: boolean;
|
|
34
|
+
/** Controls the close behaviour of dropdown menu. By default menu auto-closes when SgdsDropdownItem or area outside dropdown is clicked */
|
|
21
35
|
close: "outside" | "default" | "inside";
|
|
36
|
+
/** Disables the dropdown toggle */
|
|
22
37
|
disabled: boolean;
|
|
38
|
+
/** @internal */
|
|
23
39
|
nextDropdownItemNo: number;
|
|
40
|
+
/** @internal */
|
|
24
41
|
prevDropdownItemNo: number;
|
|
42
|
+
/** @internal */
|
|
25
43
|
dropdownConfig: Partial<Popper.Options>;
|
|
44
|
+
/** @internal */
|
|
26
45
|
modifierOpt: StrictModifiers[];
|
|
27
46
|
firstUpdated(): void;
|
|
47
|
+
/** When invoked, opens the dropdown menu */
|
|
28
48
|
showMenu(): void;
|
|
49
|
+
/** When invoked, hides the dropdown menu */
|
|
29
50
|
hideMenu(): void;
|
|
30
51
|
_onClickButton(): void;
|
|
31
52
|
_resetMenu(): void;
|
package/base/link-element.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import SgdsElement from "./sgds-element";
|
|
2
|
+
/**
|
|
3
|
+
* @slot default - Default slot for SgdsMainnavItem anchor element
|
|
4
|
+
*/
|
|
2
5
|
export default class LinkElement extends SgdsElement {
|
|
3
6
|
static styles: import("lit").CSSResultGroup;
|
|
7
|
+
/** when true, sets the active stylings of .nav-link */
|
|
4
8
|
active: boolean;
|
|
9
|
+
/** Href attribute for anchor element in SgdsMainnavItem */
|
|
5
10
|
href: string;
|
|
11
|
+
/** Disables the SgdsMainnavItem */
|
|
6
12
|
disabled: boolean;
|
|
13
|
+
/** Where to display the linked URL, as the name for a browsing context. Forwards to the HTMLAnchor target attribute */
|
|
14
|
+
target: "_blank" | "_parent" | "_self" | "_top";
|
|
7
15
|
render(): import("lit").TemplateResult<1>;
|
|
8
16
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { SgdsAccordion } from "./sgds-accordion";
|
|
2
|
+
export { SgdsAccordionItem } from "./sgds-accordion-item";
|
|
@@ -10,6 +10,12 @@ import SgdsElement from "../../base/sgds-element";
|
|
|
10
10
|
* @csspart base - The accordion-item base wrapper
|
|
11
11
|
* @csspart header - The accordion-item button header
|
|
12
12
|
* @csspart content - The accordion-item content
|
|
13
|
+
*
|
|
14
|
+
* @cssprop --accordion-item-padding-y - The top and bottom padding for the container of accordion item's content
|
|
15
|
+
* @cssprop --accordion-item-padding-x - The right and left padding for the container of accordion item's content
|
|
16
|
+
* @cssprop --accordion-item-border-radius - The border radius of the accordion item
|
|
17
|
+
* @cssprop --accordion-item-font-weight - The font weight of accordion-button when it is not collapsed
|
|
18
|
+
* @cssprop --accordion-item-line-height - The line height of accordion
|
|
13
19
|
*/
|
|
14
20
|
export declare class SgdsAccordionItem extends SgdsElement {
|
|
15
21
|
static styles: import("lit").CSSResultGroup[];
|
|
@@ -21,12 +27,10 @@ export declare class SgdsAccordionItem extends SgdsElement {
|
|
|
21
27
|
body: HTMLElement;
|
|
22
28
|
/** Controls whether accordion-item is open or close */
|
|
23
29
|
open: boolean;
|
|
24
|
-
/**
|
|
30
|
+
/** The summary to show in the header of the accordion */
|
|
25
31
|
summary: string;
|
|
26
|
-
/** Disables the accordion-item. When true, accordion-item cannot open */
|
|
27
|
-
disabled: boolean;
|
|
28
32
|
/** Optional for accordion item. Can be used to insert any utility classes such as `me-auto` */
|
|
29
|
-
accordionItemClasses
|
|
33
|
+
accordionItemClasses: string;
|
|
30
34
|
firstUpdated(): void;
|
|
31
35
|
private handleSummaryClick;
|
|
32
36
|
private handleSummaryKeyDown;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import SgdsElement from "../../base/sgds-element";
|
|
2
2
|
import type SgdsAccordionItem from "./sgds-accordion-item";
|
|
3
3
|
/**
|
|
4
|
-
* @summary A dropdown mechanism that allow users to either show or hide related content.
|
|
4
|
+
* @summary A dropdown mechanism that allow users to either show or hide related content. `SgdsAccordion` is a wrapper to manage the behaviour for multiple `SgdsAccordionItems`
|
|
5
5
|
* @slot default - slot for accordion-item
|
|
6
6
|
*/
|
|
7
7
|
export declare class SgdsAccordion extends SgdsElement {
|
|
8
8
|
static styles: import("lit").CSSResultGroup[];
|
|
9
|
+
/** Allows multiple accordion items to be opened at the same time */
|
|
9
10
|
allowMultiple: boolean;
|
|
10
|
-
|
|
11
|
+
/** Optional for accordion wrapper. Can be used to insert any utility classes such as me-auto */
|
|
12
|
+
accordionClasses: string;
|
|
11
13
|
/** @internal */
|
|
12
14
|
private defaultNodes;
|
|
13
15
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { SgdsActionCard } from "./sgds-action-card";
|
|
@@ -1,20 +1,48 @@
|
|
|
1
1
|
import { Ref } from "lit/directives/ref.js";
|
|
2
2
|
import { CardElement } from "../../base/card-element";
|
|
3
|
-
|
|
3
|
+
import { SgdsCheckbox } from "../Checkbox";
|
|
4
|
+
import { SgdsRadio } from "../Radio";
|
|
4
5
|
export type TypeVariant = "checkbox" | "radio";
|
|
6
|
+
/**
|
|
7
|
+
* @summary Action Card are cards with built in checkbox or radio components. The ref of input is extended to the Card's body.
|
|
8
|
+
* @slot icon - Icon content in the card-subtitile
|
|
9
|
+
* @slot card-subtitle - The subtitle of the card
|
|
10
|
+
* @slot card-title - The title of the card
|
|
11
|
+
* @slot card-text - The paragrapher text of the card
|
|
12
|
+
*
|
|
13
|
+
* @event sgds-change - Emitted when the checked state of card's checkbox changes or when the selected card's radio has changed
|
|
14
|
+
*
|
|
15
|
+
* @csspart base - The action card base wrapper
|
|
16
|
+
* @csspart body - The action card body
|
|
17
|
+
* @csspart subtitle - The action card subtitle
|
|
18
|
+
* @csspart title - The action card title
|
|
19
|
+
* @csspart text - The action card text
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
5
22
|
export declare class SgdsActionCard extends CardElement {
|
|
6
23
|
static styles: import("lit").CSSResultGroup[];
|
|
7
24
|
/** @internal */
|
|
8
|
-
inputRef: Ref<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
25
|
+
inputRef: Ref<SgdsCheckbox | SgdsRadio>;
|
|
26
|
+
/** Name of the HTML form control. Submitted with the form as part of a name/value pair. */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Value of the HTML form control. Primarily used to differentiate a list of related checkboxes that have the same name. */
|
|
29
|
+
value: string;
|
|
30
|
+
/** Disables the input (so the user can't check / uncheck it). */
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
/** Draws the input in a checked state. */
|
|
33
|
+
checked: boolean;
|
|
34
|
+
/** The type of input of the action card */
|
|
35
|
+
type: TypeVariant;
|
|
36
|
+
/** Controls the active styling of the action card */
|
|
16
37
|
active: boolean;
|
|
17
|
-
|
|
38
|
+
/** Simulates a click on the input control*/
|
|
39
|
+
click(): void;
|
|
40
|
+
/** @internal Declare the click event listener*/
|
|
41
|
+
handleInputChange(): Promise<void>;
|
|
42
|
+
/** @internal The input's id. */
|
|
43
|
+
private inputId;
|
|
44
|
+
handleRadioCheckedChange(): Promise<void>;
|
|
45
|
+
handleDisabledChange(): Promise<void>;
|
|
18
46
|
handleKeyDown(event: KeyboardEvent): void;
|
|
19
47
|
render(): import("lit").TemplateResult;
|
|
20
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { SgdsAlert } from "./sgds-alert";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SgdsBadge } from "./sgds-badge";
|
|
1
|
+
export { SgdsBadge, BadgeVariant } from "./sgds-badge";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { SgdsButton, ButtonVariant } from "./sgds-button";
|
|
@@ -1,32 +1,37 @@
|
|
|
1
1
|
import SgdsElement from "../../base/sgds-element";
|
|
2
2
|
export type ButtonVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark" | "link" | "outline-primary" | "outline-secondary" | "outline-success" | "outline-danger" | "outline-warning" | "outline-info" | "outline-light" | "outline-dark";
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @summary Custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.
|
|
5
|
+
*
|
|
6
|
+
* @slot default - The button's label.
|
|
5
7
|
*
|
|
6
8
|
* @event sgds-blur - Emitted when the button is not focused.
|
|
7
9
|
* @event sgds-focus - Emitted when the button is focused.
|
|
8
10
|
*/
|
|
9
11
|
export declare class SgdsButton extends SgdsElement {
|
|
10
12
|
static styles: import("lit").CSSResultGroup[];
|
|
13
|
+
/** @internal */
|
|
11
14
|
button: HTMLButtonElement | HTMLLinkElement;
|
|
15
|
+
/** @internal */
|
|
12
16
|
private readonly formSubmitController;
|
|
13
|
-
|
|
14
|
-
/** The button's variant. */
|
|
17
|
+
/** One or more button variant combinations buttons may be one of a variety of visual variants such as: `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `dark`, `light`, `link` as well as "outline" versions (prefixed by `outline-*`) */
|
|
15
18
|
variant: ButtonVariant;
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
/** Optional for button. Can be used to insert any utility classes such as me-auto **/
|
|
20
|
+
buttonClasses: string;
|
|
21
|
+
/** Specifies a large or small button */
|
|
18
22
|
size: "sm" | "lg";
|
|
19
|
-
/**
|
|
23
|
+
/** Manually set the visual state of the button to `:active` */
|
|
20
24
|
active: boolean;
|
|
21
|
-
/**
|
|
25
|
+
/** The disabled state of the button */
|
|
22
26
|
disabled: boolean;
|
|
27
|
+
/** The behavior of the button with default as `type='button', `reset` resets all the controls to their initial values and `submit` submits the form data to the server */
|
|
23
28
|
type: "button" | "submit" | "reset";
|
|
24
29
|
/** When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. */
|
|
25
|
-
href
|
|
30
|
+
href: string;
|
|
26
31
|
/** Tells the browser where to open the link. Only used when `href` is set. */
|
|
27
|
-
target
|
|
32
|
+
target: "_blank" | "_parent" | "_self" | "_top";
|
|
28
33
|
/** Tells the browser to download the linked file as this filename. Only used when `href` is set. */
|
|
29
|
-
download
|
|
34
|
+
download: string;
|
|
30
35
|
/**
|
|
31
36
|
* The "form owner" to associate the button with. If omitted, the closest containing form will be used instead. The
|
|
32
37
|
* value of this attribute must be an id of a form in the same document or shadow root as the button.
|
|
@@ -49,6 +54,7 @@ export declare class SgdsButton extends SgdsElement {
|
|
|
49
54
|
handleBlur(): void;
|
|
50
55
|
handleFocus(): void;
|
|
51
56
|
handleClick(event: MouseEvent): void;
|
|
57
|
+
/** @internal */
|
|
52
58
|
clickHandler: () => void;
|
|
53
59
|
render(): import("lit").TemplateResult;
|
|
54
60
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SgdsCard } from "./sgds-card";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CardElement } from "../../base/card-element";
|
|
2
|
+
/**
|
|
3
|
+
* @summary Cards can be used for headers and footers, a wide variety of content, contain contextual background colors and images.
|
|
4
|
+
* @slot card-title - The title of the card
|
|
5
|
+
* @slot card-text - The paragrapher text of the card
|
|
6
|
+
* @slot card-image - Accepts an image or svg element of the card. Only a single element is allowed to be passed in.
|
|
7
|
+
* @slot card-link - Accepts an anchor element. Only a single element is allowed to be passed in.
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* @csspart base - The card base wrapper
|
|
11
|
+
* @csspart body - The card body
|
|
12
|
+
* @csspart title - The card title
|
|
13
|
+
* @csspart text - The card text
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export declare class SgdsCard extends CardElement {
|
|
17
|
+
static styles: import("lit").CSSResultGroup;
|
|
18
|
+
/** Extends the link passed in slot[name="link"] to the entire card */
|
|
19
|
+
stretchedLink: boolean;
|
|
20
|
+
handleLinkSlotChange(e: Event): void;
|
|
21
|
+
handleImgSlotChange(e: Event): void;
|
|
22
|
+
render(): import("lit").TemplateResult<1>;
|
|
23
|
+
}
|
|
24
|
+
export default SgdsCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { SgdsCheckbox } from "./sgds-checkbox";
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import SgdsElement from "../../base/sgds-element";
|
|
2
|
-
|
|
2
|
+
import { SgdsFormControl } from "../../utils/form";
|
|
3
|
+
/**
|
|
4
|
+
* @summary Checkbox component is used when you require users to select multiple items from a list.
|
|
5
|
+
*
|
|
6
|
+
* @slot default - The label of checkbox.
|
|
7
|
+
*
|
|
8
|
+
* @event sgds-change - Emitted when the checked state changes.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SgdsCheckbox extends SgdsElement implements SgdsFormControl {
|
|
3
11
|
static styles: import("lit").CSSResultGroup[];
|
|
12
|
+
/**@internal */
|
|
4
13
|
input: HTMLInputElement;
|
|
14
|
+
/**@internal */
|
|
5
15
|
private readonly formSubmitController;
|
|
6
16
|
/** Name of the HTML form control. Submitted with the form as part of a name/value pair. */
|
|
7
17
|
name: string;
|
|
8
|
-
/** For Id/For pair of the HTML form control. */
|
|
9
|
-
checkboxId: string;
|
|
10
18
|
/** For aria-label when there is no appropriate text label visible */
|
|
11
19
|
ariaLabel: string;
|
|
12
|
-
/** Manually style the input as valid */
|
|
13
|
-
valid: boolean;
|
|
14
|
-
/** Manually style the input as invalid */
|
|
15
|
-
invalid: boolean;
|
|
16
20
|
/** Value of the HTML form control. Primarily used to differentiate a list of related checkboxes that have the same name. */
|
|
17
21
|
value: string;
|
|
18
22
|
/** Makes the checkbox a required field. */
|
|
@@ -21,14 +25,29 @@ export declare class SgdsCheckbox extends SgdsElement {
|
|
|
21
25
|
checked: boolean;
|
|
22
26
|
/** Disables the checkbox (so the user can't check / uncheck it). */
|
|
23
27
|
disabled: boolean;
|
|
28
|
+
/** Allows invalidFeedback, invalid and valid styles to be visible with the input */
|
|
29
|
+
hasFeedback: boolean;
|
|
30
|
+
/**Feedback text for error state when validated */
|
|
31
|
+
invalidFeedback?: string;
|
|
24
32
|
/** 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. */
|
|
25
33
|
defaultChecked: boolean;
|
|
34
|
+
/** @internal */
|
|
35
|
+
valid: boolean;
|
|
36
|
+
/** @internal */
|
|
37
|
+
invalid: boolean;
|
|
38
|
+
/** @internal For Id/For pair of the HTML form control and label. */
|
|
39
|
+
private inputId;
|
|
26
40
|
/** Simulates a click on the checkbox. */
|
|
27
41
|
click(): void;
|
|
42
|
+
/** Sets focus on the checkbox. */
|
|
43
|
+
focus(options?: FocusOptions): void;
|
|
44
|
+
/** Removes focus from the checkbox. */
|
|
45
|
+
blur(): void;
|
|
28
46
|
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
29
47
|
reportValidity(): boolean;
|
|
30
48
|
handleChange(): void;
|
|
31
49
|
handleKeyDown(event: KeyboardEvent): void;
|
|
50
|
+
handleInvalid(e: Event): void;
|
|
32
51
|
handleDisabledChange(): void;
|
|
33
52
|
handleStateChange(): void;
|
|
34
53
|
render(): import("lit").TemplateResult<1>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export type { DropdownButtonVariant, DropDirection } from "../../base/dropdown-element";
|
|
1
|
+
export { SgdsDropdown, DropDirection, DropdownButtonVariant } from "./sgds-dropdown";
|
|
2
|
+
export { SgdsDropdownItem } from "./sgds-dropdown-item";
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import LinkElement from "../../base/link-element";
|
|
2
|
+
/**
|
|
3
|
+
* @summary `SgdsDropdownItem` are navigation links built with `HTMLAnchorElement`. It should be used in the default slot of `SgdsDropdown`
|
|
4
|
+
*/
|
|
2
5
|
export declare class SgdsDropdownItem extends LinkElement {
|
|
3
6
|
static styles: import("lit").CSSResultGroup[];
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
/**@internal */
|
|
8
|
+
private anchor;
|
|
9
|
+
connectedCallback(): void;
|
|
6
10
|
render(): import("lit").TemplateResult<1>;
|
|
7
11
|
}
|
|
8
12
|
export default SgdsDropdownItem;
|
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
import { DropdownElement } from "../../base/dropdown-element";
|
|
2
2
|
export type DropDirection = "left" | "right" | "up" | "down";
|
|
3
|
+
export type DropdownButtonVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark";
|
|
4
|
+
/**
|
|
5
|
+
* @summary `SgdsDropdown` toggles contextual overlays for displaying lists of links.
|
|
6
|
+
* @slot default - slot for sgds-dropdown-item passed into dropdown's menu
|
|
7
|
+
*
|
|
8
|
+
* @csspart menu - The dropdown's menu (ul element)
|
|
9
|
+
*/
|
|
3
10
|
export declare class SgdsDropdown extends DropdownElement {
|
|
4
11
|
static styles: import("lit").CSSResultGroup[];
|
|
5
12
|
constructor();
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
/** Controls auto-flipping of menu */
|
|
15
|
+
noFlip: boolean;
|
|
16
|
+
/** When true, aligns right edge of menu with right edge of button */
|
|
17
|
+
menuAlignRight: boolean;
|
|
18
|
+
/** The drop position of menu relative to the toggle button */
|
|
19
|
+
drop: DropDirection;
|
|
20
|
+
/** Sets color of Dropdown button */
|
|
21
|
+
variant: DropdownButtonVariant;
|
|
22
|
+
/**@internal */
|
|
23
|
+
private dropdownRef;
|
|
24
|
+
firstUpdated(): Promise<void>;
|
|
6
25
|
render(): import("lit").TemplateResult<1>;
|
|
7
26
|
}
|
|
8
27
|
export default SgdsDropdown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SgdsFileUpload } from "./sgds-
|
|
1
|
+
export { SgdsFileUpload, FileUploadButtonVariant } from "./sgds-file-upload";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import SgdsElement from "../../base/sgds-element";
|
|
2
|
+
export type FileUploadButtonVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark" | "link" | "outline-primary" | "outline-secondary" | "outline-success" | "outline-danger" | "outline-warning" | "outline-info" | "outline-light" | "outline-dark";
|
|
3
|
+
/**
|
|
4
|
+
* @summary Allows users to upload files of various sizes and formats
|
|
5
|
+
* @slot default - Label for file upload button
|
|
6
|
+
*
|
|
7
|
+
* @event sgds-files-selected - Emitted when files are selected for uploading
|
|
8
|
+
*
|
|
9
|
+
* @cssproperty --fileupload-file-icon-fill - Left icon fill color
|
|
10
|
+
* @cssproperty --fileupload-remove-icon-fill - Remove icon fill color
|
|
11
|
+
* @cssproperty --fileupload-remove-icon-hover-fill - Remove icon mouse over fill color
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export declare class SgdsFileUpload extends SgdsElement {
|
|
15
|
+
static styles: import("lit").CSSResultGroup[];
|
|
16
|
+
/** The button's variant. */
|
|
17
|
+
variant: FileUploadButtonVariant;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
/** Allows multiple files to be listed for uploading */
|
|
20
|
+
multiple: boolean;
|
|
21
|
+
/** Specify the acceptable file type */
|
|
22
|
+
accept: string;
|
|
23
|
+
/** Specifies a large or small button */
|
|
24
|
+
size: "sm" | "lg";
|
|
25
|
+
/** Customize the check icon with SVG */
|
|
26
|
+
checkedIcon: string;
|
|
27
|
+
/** Customize the cancel icon with SVG */
|
|
28
|
+
cancelIcon: string;
|
|
29
|
+
/** @internal */
|
|
30
|
+
private files;
|
|
31
|
+
/** @internal */
|
|
32
|
+
private selectedFiles;
|
|
33
|
+
setFileList(files: FileList): void;
|
|
34
|
+
/** @internal */
|
|
35
|
+
private inputRef;
|
|
36
|
+
/** @internal */
|
|
37
|
+
private handleClick;
|
|
38
|
+
/** @internal */
|
|
39
|
+
private handleInputChange;
|
|
40
|
+
/** @internal */
|
|
41
|
+
removeFileHandler(index: number): void;
|
|
42
|
+
render(): import("lit").TemplateResult<1>;
|
|
43
|
+
}
|
|
44
|
+
export default SgdsFileUpload;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { SgdsFooter, ColumnLinks, Links } from "./sgds-footer";
|
|
@@ -8,19 +8,53 @@ export interface ColumnLinks {
|
|
|
8
8
|
links: Links[];
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
+
* @summary The footer contains supporting information for your service at the bottom of your website. All .gov.sg digital services shall contain a Global Footer Bar across all pages. The Global Footer Bar should include the name of the digital service, contact information, a privacy statement and the terms of use.
|
|
12
|
+
*
|
|
11
13
|
* @csspart footer-top - The component's footer-top section container.
|
|
12
14
|
* @csspart footer-bottom - The component's footer-bottom section container.
|
|
15
|
+
*
|
|
16
|
+
* @cssproperty footer-top - The component's footer-top section container.
|
|
17
|
+
* @cssproperty footer-bottom - The component's footer-bottom section container.
|
|
13
18
|
*/
|
|
14
19
|
export declare class SgdsFooter extends SgdsElement {
|
|
15
20
|
static styles: import("lit").CSSResultGroup[];
|
|
21
|
+
/**
|
|
22
|
+
* Sets title of SgdsFooter
|
|
23
|
+
*/
|
|
16
24
|
title: string;
|
|
25
|
+
/**
|
|
26
|
+
* Sets description of SgdsFooter
|
|
27
|
+
*/
|
|
17
28
|
description: string;
|
|
29
|
+
/**
|
|
30
|
+
* Sets copyrightLiner of SgdsFooter
|
|
31
|
+
*/
|
|
32
|
+
copyrightLiner: string;
|
|
33
|
+
/**
|
|
34
|
+
* Array of type
|
|
35
|
+
*
|
|
36
|
+
* `interface ColumnLinks { title: string; links : Links[] } interface Links { href: string; label: string; }`
|
|
37
|
+
*/
|
|
18
38
|
links: ColumnLinks[];
|
|
39
|
+
/**
|
|
40
|
+
* String date for last updated date
|
|
41
|
+
*/
|
|
19
42
|
lastUpdatedDate: string;
|
|
43
|
+
/**
|
|
44
|
+
* href link for contacts
|
|
45
|
+
*/
|
|
20
46
|
contactHref: string;
|
|
47
|
+
/**
|
|
48
|
+
* href link for feedback
|
|
49
|
+
*/
|
|
21
50
|
feedbackHref: string;
|
|
22
|
-
|
|
51
|
+
/**
|
|
52
|
+
* href link for privacy statement
|
|
53
|
+
*/
|
|
23
54
|
privacyHref: string;
|
|
55
|
+
/**
|
|
56
|
+
* href link for terms of use
|
|
57
|
+
*/
|
|
24
58
|
termsOfUseHref: string;
|
|
25
59
|
render(): import("lit").TemplateResult<1>;
|
|
26
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { SgdsInput } from "./sgds-input";
|
|
@@ -1,33 +1,66 @@
|
|
|
1
1
|
import SgdsElement from "../../base/sgds-element";
|
|
2
|
-
|
|
2
|
+
import type { SgdsFormControl } from "../../utils/form";
|
|
3
|
+
/**
|
|
4
|
+
* @summary Text inputs allow your users to enter letters, numbers and symbols on 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 input is in focus.
|
|
9
|
+
* @event sgds-blur - Emitted when input is not in focus.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export declare class SgdsInput extends SgdsElement implements SgdsFormControl {
|
|
13
|
+
static styles: import("lit").CSSResultGroup;
|
|
14
|
+
/**@internal */
|
|
3
15
|
input: HTMLInputElement;
|
|
4
|
-
|
|
16
|
+
/**@internal */
|
|
5
17
|
private readonly formSubmitController;
|
|
6
|
-
|
|
18
|
+
/** The type of input which works the same as HTMLInputElement*/
|
|
7
19
|
type: "date" | "datetime-local" | "email" | "number" | "password" | "search" | "tel" | "text" | "time" | "url";
|
|
20
|
+
/** The input's label */
|
|
8
21
|
label: string;
|
|
22
|
+
/** The input's hint text below the label */
|
|
9
23
|
hintText: string;
|
|
10
|
-
|
|
24
|
+
/**The input's name attribute */
|
|
11
25
|
name: string;
|
|
26
|
+
/**Forwards classes to the native HTMLInputElement of the component. Can be used to insert any classes from bootstrap such as mt-2 */
|
|
12
27
|
inputClasses: string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
/**Optional. Pass svg html of icons in string form*/
|
|
29
|
+
icon: string;
|
|
30
|
+
/**Sets the minimum length of the input */
|
|
31
|
+
minlength: number;
|
|
32
|
+
/**Sets the maximum length of the input */
|
|
33
|
+
maxlength: number;
|
|
34
|
+
/**The input's placeholder text. */
|
|
17
35
|
placeholder: string;
|
|
18
|
-
pattern
|
|
19
|
-
|
|
36
|
+
/**A pattern to validate input against. */
|
|
37
|
+
pattern: string;
|
|
38
|
+
/**Autofocus the input */
|
|
20
39
|
autofocus: boolean;
|
|
40
|
+
/**Disables the input. */
|
|
21
41
|
disabled: boolean;
|
|
42
|
+
/**Makes the input a required field. */
|
|
22
43
|
required: boolean;
|
|
23
|
-
/**
|
|
44
|
+
/**Makes the input readonly. */
|
|
24
45
|
readonly: boolean;
|
|
46
|
+
/**The input's value attribute. */
|
|
47
|
+
value: string;
|
|
48
|
+
/**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. */
|
|
49
|
+
defaultValue: string;
|
|
50
|
+
/** Allows invalidFeedback, invalid and valid styles to be visible with the input */
|
|
51
|
+
hasFeedback: boolean;
|
|
52
|
+
/**Feedback text for error state when validated */
|
|
53
|
+
invalidFeedback: string;
|
|
54
|
+
/**@internal */
|
|
25
55
|
invalid: boolean;
|
|
56
|
+
/**@internal */
|
|
26
57
|
valid: boolean;
|
|
27
|
-
|
|
28
|
-
|
|
58
|
+
/**@internal */
|
|
59
|
+
private inputId;
|
|
29
60
|
/** Sets focus on the input. */
|
|
30
61
|
focus(options?: FocusOptions): void;
|
|
62
|
+
/** Sets blur on the input. */
|
|
63
|
+
blur(): void;
|
|
31
64
|
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
32
65
|
reportValidity(): boolean;
|
|
33
66
|
handleInvalid(): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export { SgdsMainnav, MainnavExpandSize } from "./sgds-mainnav";
|
|
2
|
+
export { SgdsMainnavItem } from "./sgds-mainnav-item";
|
|
3
|
+
export { SgdsMainnavDropdown } from "./sgds-mainnav-dropdown";
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { DropdownElement } from "../../base/dropdown-element";
|
|
2
2
|
export declare class SgdsMainnavDropdown extends DropdownElement {
|
|
3
3
|
static styles: import("lit").CSSResultGroup[];
|
|
4
|
+
connectedCallback(): void;
|
|
5
|
+
/**@internal */
|
|
6
|
+
dropdownRef: Promise<HTMLAnchorElement>;
|
|
7
|
+
firstUpdated(): Promise<void>;
|
|
4
8
|
render(): import("lit").TemplateResult<1>;
|
|
5
9
|
}
|
|
6
10
|
export default SgdsMainnavDropdown;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import LinkElement from "../../base/link-element";
|
|
2
2
|
/**
|
|
3
|
-
* @slot -
|
|
3
|
+
* @slot default - slot for SgdsMainnavItem element.
|
|
4
|
+
*
|
|
5
|
+
* @cssproperty --mainnav-item-theme-color - Hover and active color for mainnav items.
|
|
6
|
+
* @cssproperty --mainnav-item-color - Text color of nav item.
|
|
7
|
+
* @cssproperty --mainnav-item-borderBottom-width - border bottom width for hover and active state for nav item
|
|
4
8
|
*/
|
|
5
9
|
export declare class SgdsMainnavItem extends LinkElement {
|
|
6
10
|
static styles: import("lit").CSSResultGroup[];
|