@spectric/ui 0.0.8 → 0.0.9
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 +5 -28
- package/dist/components/Button.d.ts +6 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/input.d.ts +5 -1
- package/dist/components/table/body.d.ts +1 -1
- package/dist/components/table/cell.d.ts +6 -1
- package/dist/components/table/table.d.ts +11 -1
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/tooltip.d.ts +95 -0
- package/dist/custom-elements.json +103 -8
- package/dist/index.es.js +1828 -1645
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +116 -83
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Button.ts +12 -1
- package/src/components/button.css.ts +19 -2
- package/src/components/index.ts +2 -1
- package/src/components/input.css +6 -1
- package/src/components/input.ts +26 -5
- package/src/components/pagination/pagination.ts +3 -3
- package/src/components/table/body.ts +2 -2
- package/src/components/table/cell.ts +21 -5
- package/src/components/table/table.css +12 -2
- package/src/components/table/table.ts +46 -3
- package/src/components/tooltip/index.ts +1 -0
- package/src/components/tooltip/tooltip.css +52 -0
- package/src/components/tooltip/tooltip.ts +228 -0
- package/src/docs/HTML-Vue-Python Integration.mdx +18 -0
- package/src/docs/React.mdx +20 -0
- package/src/docs/welcome.mdx +29 -0
- package/src/stories/Button.stories.ts +22 -0
- package/src/stories/fixtures/ExampleContent.ts +39 -4
- package/src/stories/fixtures/data.ts +20 -2
- package/src/stories/table.stories.ts +27 -13
- package/src/stories/tooltip.stories.ts +68 -0
package/README.MD
CHANGED
|
@@ -1,50 +1,27 @@
|
|
|
1
1
|
# Component Examples and playground
|
|
2
|
+
|
|
2
3
|
https://pages.spectric.com/web/spectric-ui/?path=/docs/spectric-ui-components-ui-page--docs
|
|
3
4
|
|
|
4
5
|
# Developing
|
|
6
|
+
|
|
5
7
|
```
|
|
6
8
|
nvm use
|
|
7
9
|
npm start
|
|
8
10
|
```
|
|
11
|
+
|
|
9
12
|
# Publishing
|
|
10
13
|
|
|
11
14
|
To publish a new version run
|
|
15
|
+
|
|
12
16
|
```
|
|
13
17
|
npm version patch
|
|
14
18
|
git push --follow-tags
|
|
15
19
|
```
|
|
20
|
+
|
|
16
21
|
This will trigger a pipeline to run and build the source and publish to our internal gitlab NPM
|
|
17
22
|
|
|
18
23
|
# Installing In your project
|
|
19
|
-
Internally (for now) we use gitlab as the package registry. To configure npm to use gitlab for `@spectric` packages follow the one time steps below
|
|
20
|
-
1. Create an access token for npm [Personal Access Token](https://gitlab.spectric.com/-/user_settings/personal_access_tokens)
|
|
21
|
-
- ensure it has api access
|
|
22
|
-
2. Point npm to install `@spectric` packages from gitlab
|
|
23
|
-
- run `npm config set -- @spectric:registry=https://gitlab.spectric.com/api/v4/groups/585/-/packages/npm/`
|
|
24
|
-
3. Have npm use the access token created in 1. to authenticate
|
|
25
|
-
- run `npm config set -- //gitlab.spectric.com/api/v4/groups/585/-/packages/npm/:_authToken <token>`
|
|
26
|
-
|
|
27
|
-
After you have setup npm witht he steps above you can install this package normally.
|
|
28
24
|
|
|
29
25
|
```
|
|
30
26
|
npm i @spectric/ui
|
|
31
27
|
```
|
|
32
|
-
|
|
33
|
-
# Javascript/typescript integration
|
|
34
|
-
The types files produced when building seemlessly integrate the custom elements into javascript giving full type hinting
|
|
35
|
-
|
|
36
|
-
# HTML integration
|
|
37
|
-
Add the dist/custom-element.json to the html.languge settings
|
|
38
|
-
https://code.visualstudio.com/docs/languages/html#_html-custom-data
|
|
39
|
-

|
|
40
|
-
|
|
41
|
-
# VUE Integration
|
|
42
|
-
Complete steps to include custom elements in the HTML language server
|
|
43
|
-
then
|
|
44
|
-
Add the HTML language server in the @ext:Vue.volar extention
|
|
45
|
-

|
|
46
|
-
Once setup hovering over spectric elements will provide documentation
|
|
47
|
-

|
|
48
|
-
|
|
49
|
-
# Python Jinja
|
|
50
|
-
Same as HTML Integration
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { CSSResultGroup, LitElement } from 'lit';
|
|
2
2
|
import { HTMLElementTagWithEvents, ReactElementWithPropsAndEvents } from './types';
|
|
3
|
+
import { DomRenderable } from './table';
|
|
4
|
+
import { TooltipPostionsTypes } from './tooltip';
|
|
3
5
|
export declare enum ButtonSizes {
|
|
4
6
|
large = "large",
|
|
5
7
|
medium = "medium",
|
|
@@ -26,6 +28,8 @@ export interface ButtonProps {
|
|
|
26
28
|
disabled: boolean;
|
|
27
29
|
danger?: boolean;
|
|
28
30
|
icon?: boolean;
|
|
31
|
+
tooltip?: DomRenderable;
|
|
32
|
+
tooltipPosition?: TooltipPostionsTypes;
|
|
29
33
|
}
|
|
30
34
|
export declare class SpectricButton extends LitElement implements ButtonProps {
|
|
31
35
|
static styles?: CSSResultGroup | undefined;
|
|
@@ -36,6 +40,8 @@ export declare class SpectricButton extends LitElement implements ButtonProps {
|
|
|
36
40
|
label?: string;
|
|
37
41
|
danger: boolean;
|
|
38
42
|
icon: boolean;
|
|
43
|
+
tooltip?: DomRenderable;
|
|
44
|
+
tooltipPosition?: TooltipPostionsTypes;
|
|
39
45
|
connectedCallback(): void;
|
|
40
46
|
disconnectedCallback(): void;
|
|
41
47
|
private _onClick;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
2
|
import { ReactElementWithPropsAndEvents } from './types';
|
|
3
|
+
import { ButtonSizesTypes } from './Button';
|
|
3
4
|
export declare enum InputVariants {
|
|
4
5
|
Text = "text",
|
|
5
6
|
TextArea = "text-area",
|
|
@@ -10,7 +11,8 @@ export declare enum InputVariants {
|
|
|
10
11
|
email = "email",
|
|
11
12
|
file = "file",//display drop area
|
|
12
13
|
hidden = "hidden",//display drop area
|
|
13
|
-
password = "password"
|
|
14
|
+
password = "password",
|
|
15
|
+
checkbox = "checkbox"
|
|
14
16
|
}
|
|
15
17
|
type InputVariantsTypes = `${InputVariants}`;
|
|
16
18
|
export interface InputProps {
|
|
@@ -60,6 +62,8 @@ export interface InputProps {
|
|
|
60
62
|
autocomplete: HTMLInputElement['autocomplete'];
|
|
61
63
|
}
|
|
62
64
|
export declare class SpectricInput extends LitElement implements InputProps {
|
|
65
|
+
checked?: boolean;
|
|
66
|
+
size?: ButtonSizesTypes;
|
|
63
67
|
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
64
68
|
placeholder: string;
|
|
65
69
|
readonly: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
2
|
import { HTMLElementTagWithEvents, ReactElementWithPropsAndEvents } from '../types';
|
|
3
3
|
import { ColumnSettings, TableElement } from './table';
|
|
4
4
|
export declare const TableCellElementTag = "spectric-table-cell";
|
|
@@ -18,7 +18,12 @@ export type FilterEvent<T> = {
|
|
|
18
18
|
export declare class TableCellElement<T> extends LitElement implements CellProps<T> {
|
|
19
19
|
row: T;
|
|
20
20
|
column: ColumnSettings<T>;
|
|
21
|
+
columns: ColumnSettings<T>[];
|
|
21
22
|
table: TableElement<T>;
|
|
23
|
+
styleRules: CSSStyleDeclaration;
|
|
24
|
+
td: HTMLTableCellElement;
|
|
25
|
+
constructor();
|
|
26
|
+
protected updated(_changedProperties: PropertyValues): void;
|
|
22
27
|
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
23
28
|
_handleFilterOut: () => void;
|
|
24
29
|
_handleFilterFor: () => void;
|
|
@@ -6,18 +6,25 @@ export declare const TableElementTag = "spectric-table";
|
|
|
6
6
|
export type { TableProps, TableEvents };
|
|
7
7
|
export type DomRenderable = HTMLElement | TemplateResult | string | number | null;
|
|
8
8
|
export type ColumnSettings<T> = {
|
|
9
|
+
width?: number;
|
|
10
|
+
whiteSpace?: "nowrap";
|
|
9
11
|
hidden?: boolean;
|
|
10
12
|
sortable?: boolean;
|
|
11
13
|
filterable?: boolean;
|
|
12
|
-
title?:
|
|
14
|
+
title?: DomRenderable;
|
|
13
15
|
key?: string;
|
|
14
16
|
render?: (row: T, table: TableElement<T>) => DomRenderable;
|
|
15
17
|
};
|
|
18
|
+
type TableSelectOptions = "multi" | "single";
|
|
16
19
|
interface TableProps<T> {
|
|
17
20
|
pagination?: PaginationProps;
|
|
18
21
|
columns: ColumnSettings<T>[];
|
|
19
22
|
data: T[];
|
|
23
|
+
select?: TableSelectOptions;
|
|
20
24
|
}
|
|
25
|
+
type DomEvent<T> = Event & {
|
|
26
|
+
target: T;
|
|
27
|
+
};
|
|
21
28
|
/**
|
|
22
29
|
* Table Element
|
|
23
30
|
*
|
|
@@ -53,10 +60,13 @@ export declare class TableElement<T> extends LitElement implements TableProps<T>
|
|
|
53
60
|
data: T[];
|
|
54
61
|
pagination?: PaginationProps | undefined;
|
|
55
62
|
columns: ColumnSettings<T>[];
|
|
63
|
+
select?: TableSelectOptions;
|
|
56
64
|
private _handlePaginationChange;
|
|
57
65
|
private _emitChange;
|
|
58
66
|
private __DO_NOT_USE_filter;
|
|
67
|
+
selected: T[];
|
|
59
68
|
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
69
|
+
_handleSelectAllChange: (e: DomEvent<HTMLInputElement>) => void;
|
|
60
70
|
protected render(): unknown;
|
|
61
71
|
}
|
|
62
72
|
interface TableEvents {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tooltip';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { HTMLElementTagWithEvents, ReactElementWithPropsAndEvents } from '../types';
|
|
2
|
+
import { CSSResultGroup, LitElement } from 'lit-element';
|
|
3
|
+
import { DomRenderable } from '../table';
|
|
4
|
+
export declare const TooltipElementTag = "spectric-tooltip";
|
|
5
|
+
export type { TooltipProps, TooltipEvents };
|
|
6
|
+
export declare enum TooltipPostions {
|
|
7
|
+
top = "top",
|
|
8
|
+
bottom = "bottom",
|
|
9
|
+
left = "left",
|
|
10
|
+
right = "right",
|
|
11
|
+
mouse = "mouse"
|
|
12
|
+
}
|
|
13
|
+
export type TooltipPostionsTypes = `${TooltipPostions}`;
|
|
14
|
+
interface TooltipProps {
|
|
15
|
+
/**
|
|
16
|
+
* How long you need to hover before the tooltip displays
|
|
17
|
+
*/
|
|
18
|
+
delay: number;
|
|
19
|
+
/**
|
|
20
|
+
* How long the fade in animation should run
|
|
21
|
+
*/
|
|
22
|
+
animationDuration: number;
|
|
23
|
+
/**
|
|
24
|
+
* Tooltip contents
|
|
25
|
+
*/
|
|
26
|
+
text: DomRenderable;
|
|
27
|
+
/**
|
|
28
|
+
* Where to anchor the tooltip
|
|
29
|
+
*/
|
|
30
|
+
position: TooltipPostionsTypes;
|
|
31
|
+
/**
|
|
32
|
+
* Sets a max width for the contents (default:300) you can disable this by setting to 0 or -1
|
|
33
|
+
*/
|
|
34
|
+
maxWidth?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Container the tool tip will be attached to. (default:document.body)
|
|
37
|
+
*/
|
|
38
|
+
portalTarget?: HTMLElement;
|
|
39
|
+
/**
|
|
40
|
+
* The element that triggers the tooltip. (default:node.parentElement) This is used for special cases like in the shadow dom if you want to target a host element instead of the immediate parent element
|
|
41
|
+
*/
|
|
42
|
+
triggerTarget?: HTMLElement;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Spectric tooltip will add a tooltip to any container
|
|
46
|
+
*/
|
|
47
|
+
export declare class TooltipElement extends LitElement implements TooltipProps {
|
|
48
|
+
delay: number;
|
|
49
|
+
animationDuration: number;
|
|
50
|
+
text: DomRenderable;
|
|
51
|
+
position: TooltipPostionsTypes;
|
|
52
|
+
maxWidth?: number;
|
|
53
|
+
private portalElement;
|
|
54
|
+
private mouseLocation?;
|
|
55
|
+
static styles?: CSSResultGroup | undefined;
|
|
56
|
+
portalTarget: HTMLElement;
|
|
57
|
+
private timer?;
|
|
58
|
+
private open;
|
|
59
|
+
mouseframe?: number;
|
|
60
|
+
triggerTarget?: HTMLElement;
|
|
61
|
+
private get target();
|
|
62
|
+
connectedCallback(): void;
|
|
63
|
+
disconnectedCallback(): void;
|
|
64
|
+
private _getMousePosition;
|
|
65
|
+
_hideTooltip: () => void;
|
|
66
|
+
private showToolTip;
|
|
67
|
+
private applyStyle;
|
|
68
|
+
private positionTooltip;
|
|
69
|
+
protected render(): void;
|
|
70
|
+
}
|
|
71
|
+
interface TooltipEvents {
|
|
72
|
+
}
|
|
73
|
+
declare global {
|
|
74
|
+
interface HTMLElementTagNameMap {
|
|
75
|
+
[TooltipElementTag]: HTMLElementTagWithEvents<TooltipElement, TooltipEvents>;
|
|
76
|
+
}
|
|
77
|
+
namespace JSX {
|
|
78
|
+
interface IntrinsicElements {
|
|
79
|
+
/**
|
|
80
|
+
* @see {@link DialogElement}
|
|
81
|
+
*/
|
|
82
|
+
[TooltipElementTag]: ReactElementWithPropsAndEvents<TooltipElement, TooltipProps, TooltipEvents>;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
namespace React {
|
|
86
|
+
namespace JSX {
|
|
87
|
+
interface IntrinsicElements {
|
|
88
|
+
/**
|
|
89
|
+
* @see {@link DialogElement}
|
|
90
|
+
*/
|
|
91
|
+
[TooltipElementTag]: ReactElementWithPropsAndEvents<TooltipElement, TooltipProps, TooltipEvents>;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"name": "spectric-button",
|
|
82
|
-
"description": "Events:\n\n * `click` {`CustomEvent<MouseEvent>`} - \n\nAttributes:\n\n * `variant` {`\"text\" | \"primary\" | \"secondary\"`} - Is this the principal call to action on the page?\n\n * `backgroundColor` {`string | undefined`} - What background color to use\n\n * `size` {`\"large\" | \"medium\" | \"small\" | \"xsmall\" | \"xxsmall\" | \"tiny\"`} - How large should the button be?\n\n * `label` {`string | undefined`} - \n\n * `disabled` {`boolean`} - \n\n * `danger` {`boolean`} - \n\n * `icon` {`boolean`} - \n\nProperties:\n\n * `styles` {`CSSResultGroup | undefined`} - \n\n * `_onClick` - \n\n * `variant` {`\"text\" | \"primary\" | \"secondary\"`} - Is this the principal call to action on the page?\n\n * `backgroundColor` {`string | undefined`} - What background color to use\n\n * `size` {`\"large\" | \"medium\" | \"small\" | \"xsmall\" | \"xxsmall\" | \"tiny\"`} - How large should the button be?\n\n * `label` {`string | undefined`} - \n\n * `disabled` {`boolean`} - \n\n * `danger` {`boolean`} - \n\n * `icon` {`boolean`} - ",
|
|
82
|
+
"description": "Events:\n\n * `click` {`CustomEvent<MouseEvent>`} - \n\nAttributes:\n\n * `variant` {`\"text\" | \"primary\" | \"secondary\"`} - Is this the principal call to action on the page?\n\n * `backgroundColor` {`string | undefined`} - What background color to use\n\n * `size` {`\"large\" | \"medium\" | \"small\" | \"xsmall\" | \"xxsmall\" | \"tiny\"`} - How large should the button be?\n\n * `label` {`string | undefined`} - \n\n * `disabled` {`boolean`} - \n\n * `danger` {`boolean`} - \n\n * `icon` {`boolean`} - \n\n * `tooltip` {`DomRenderable | undefined`} - \n\n * `tooltipPosition` {`\"top\" | \"bottom\" | \"left\" | \"right\" | \"mouse\" | undefined`} - \n\nProperties:\n\n * `styles` {`CSSResultGroup | undefined`} - \n\n * `_onClick` - \n\n * `variant` {`\"text\" | \"primary\" | \"secondary\"`} - Is this the principal call to action on the page?\n\n * `backgroundColor` {`string | undefined`} - What background color to use\n\n * `size` {`\"large\" | \"medium\" | \"small\" | \"xsmall\" | \"xxsmall\" | \"tiny\"`} - How large should the button be?\n\n * `label` {`string | undefined`} - \n\n * `disabled` {`boolean`} - \n\n * `danger` {`boolean`} - \n\n * `icon` {`boolean`} - \n\n * `tooltip` {`DomRenderable | undefined`} - \n\n * `tooltipPosition` {`\"top\" | \"bottom\" | \"left\" | \"right\" | \"mouse\" | undefined`} - ",
|
|
83
83
|
"attributes": [
|
|
84
84
|
{
|
|
85
85
|
"name": "variant",
|
|
@@ -145,6 +145,32 @@
|
|
|
145
145
|
"description": "`icon` {`boolean`} - \n\nProperty: icon\n\nDefault: false",
|
|
146
146
|
"valueSet": "v"
|
|
147
147
|
},
|
|
148
|
+
{
|
|
149
|
+
"name": "tooltip",
|
|
150
|
+
"description": "`tooltip` {`DomRenderable | undefined`} - \n\nProperty: tooltip",
|
|
151
|
+
"values": []
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "tooltipPosition",
|
|
155
|
+
"description": "`tooltipPosition` {`\"top\" | \"bottom\" | \"left\" | \"right\" | \"mouse\" | undefined`} - \n\nProperty: tooltipPosition\n\nDefault: right",
|
|
156
|
+
"values": [
|
|
157
|
+
{
|
|
158
|
+
"name": "top"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "bottom"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "left"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "right"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"name": "mouse"
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
148
174
|
{
|
|
149
175
|
"name": "onclick",
|
|
150
176
|
"description": "`click` {`CustomEvent<MouseEvent>`} - "
|
|
@@ -406,8 +432,13 @@
|
|
|
406
432
|
},
|
|
407
433
|
{
|
|
408
434
|
"name": "spectric-input",
|
|
409
|
-
"description": "Events:\n\n * `change` {`Event`} - \n\nAttributes:\n\n * `hidePasswordLabel` {`string`} - \"Hide password\" tooltip text on password visibility toggle\n\n * `showPasswordLabel` {`string`} - \"Show password\" tooltip text on password visibility toggle\n\n * `value` {`string | number | boolean`} - The value of the input.\n\n * `variant` {`\"number\" | \"text\" | \"text-area\" | \"color\" | \"date\" | \"datetime-local\" | \"email\" | \"file\" | \"hidden\" | \"password\"`} - Input type\n\n * `label` {`string`} - Label to display above the input\n\n * `placeholder` {`string`} - placeholder text to display\n\n * `disabled` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `helperText` {`string`} - The helper text.\n\n * `invalid` {`boolean`} - Specify if the currently value is invalid.\n\n * `invalidText` {`string | TemplateResult<1>`} - Message which is displayed if the value is invalid.\n\n * `maxCount` {`number`} - Max character count allowed for input. This is needed in order for enableCounter to display\n\n * `required` {`boolean`} - Boolean property to set the required status\n\n * `showPasswordVisibilityToggle` {`boolean`} - Boolean property to render password visibility toggle\n\n * `name` {`string`} - Name for the input used for form data events //TODO make sure this works\n\n * `pattern` {`string`} - Pattern to validate the input against for HTML validity checking\n\n * `autocomplete` {`AutoFill`} - The sets the autocomplete for the input.\n\nProperties:\n\n * `hidePasswordLabel` {`string`} - \"Hide password\" tooltip text on password visibility toggle\n\n * `showPasswordLabel` {`string`} - \"Show password\" tooltip text on password visibility toggle\n\n * `_value` {`string | number | boolean`} - The internal value.\n\n * `_showPassword` {`boolean`} - \n\n * `selectionStart` {`number | null`} - \n\n * `value` {`string | number | boolean`} - The value of the input.\n\n * `_handleInput` - Handles `oninput` event on the `<input>`.\n\n * `_input` {`HTMLInputElement | undefined`} - The underlying input element\n\n * `handleTogglePasswordVisibility` - \n\n * `variant` {`\"number\" | \"text\" | \"text-area\" | \"color\" | \"date\" | \"datetime-local\" | \"email\" | \"file\" | \"hidden\" | \"password\"`} - Input type\n\n * `label` {`string`} - Label to display above the input\n\n * `placeholder` {`string`} - placeholder text to display\n\n * `disabled` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `helperText` {`string`} - The helper text.\n\n * `invalid` {`boolean`} - Specify if the currently value is invalid.\n\n * `invalidText` {`string | TemplateResult<1>`} - Message which is displayed if the value is invalid.\n\n * `maxCount` {`number`} - Max character count allowed for input. This is needed in order for enableCounter to display\n\n * `required` {`boolean`} - Boolean property to set the required status\n\n * `showPasswordVisibilityToggle` {`boolean`} - Boolean property to render password visibility toggle\n\n * `name` {`string`} - Name for the input used for form data events //TODO make sure this works\n\n * `pattern` {`string`} - Pattern to validate the input against for HTML validity checking\n\n * `autocomplete` {`AutoFill`} - The sets the autocomplete for the input.",
|
|
435
|
+
"description": "Events:\n\n * `change` {`Event`} - \n\nAttributes:\n\n * `checked` {`boolean | undefined`} - \n\n * `hidePasswordLabel` {`string`} - \"Hide password\" tooltip text on password visibility toggle\n\n * `showPasswordLabel` {`string`} - \"Show password\" tooltip text on password visibility toggle\n\n * `value` {`string | number | boolean`} - The value of the input.\n\n * `variant` {`\"number\" | \"text\" | \"text-area\" | \"color\" | \"date\" | \"datetime-local\" | \"email\" | \"file\" | \"hidden\" | \"password\" | \"checkbox\"`} - Input type\n\n * `label` {`string`} - Label to display above the input\n\n * `placeholder` {`string`} - placeholder text to display\n\n * `disabled` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `helperText` {`string`} - The helper text.\n\n * `invalid` {`boolean`} - Specify if the currently value is invalid.\n\n * `invalidText` {`string | TemplateResult<1>`} - Message which is displayed if the value is invalid.\n\n * `maxCount` {`number`} - Max character count allowed for input. This is needed in order for enableCounter to display\n\n * `required` {`boolean`} - Boolean property to set the required status\n\n * `showPasswordVisibilityToggle` {`boolean`} - Boolean property to render password visibility toggle\n\n * `name` {`string`} - Name for the input used for form data events //TODO make sure this works\n\n * `pattern` {`string`} - Pattern to validate the input against for HTML validity checking\n\n * `autocomplete` {`AutoFill`} - The sets the autocomplete for the input.\n\nProperties:\n\n * `checked` {`boolean | undefined`} - \n\n * `size` {`\"large\" | \"medium\" | \"small\" | \"xsmall\" | \"xxsmall\" | \"tiny\" | undefined`} - \n\n * `hidePasswordLabel` {`string`} - \"Hide password\" tooltip text on password visibility toggle\n\n * `showPasswordLabel` {`string`} - \"Show password\" tooltip text on password visibility toggle\n\n * `_value` {`string | number | boolean`} - The internal value.\n\n * `_showPassword` {`boolean`} - \n\n * `selectionStart` {`number | null`} - \n\n * `value` {`string | number | boolean`} - The value of the input.\n\n * `_handleInput` - Handles `oninput` event on the `<input>`.\n\n * `_input` {`HTMLInputElement | undefined`} - The underlying input element\n\n * `handleTogglePasswordVisibility` - \n\n * `variant` {`\"number\" | \"text\" | \"text-area\" | \"color\" | \"date\" | \"datetime-local\" | \"email\" | \"file\" | \"hidden\" | \"password\" | \"checkbox\"`} - Input type\n\n * `label` {`string`} - Label to display above the input\n\n * `placeholder` {`string`} - placeholder text to display\n\n * `disabled` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `helperText` {`string`} - The helper text.\n\n * `invalid` {`boolean`} - Specify if the currently value is invalid.\n\n * `invalidText` {`string | TemplateResult<1>`} - Message which is displayed if the value is invalid.\n\n * `maxCount` {`number`} - Max character count allowed for input. This is needed in order for enableCounter to display\n\n * `required` {`boolean`} - Boolean property to set the required status\n\n * `showPasswordVisibilityToggle` {`boolean`} - Boolean property to render password visibility toggle\n\n * `name` {`string`} - Name for the input used for form data events //TODO make sure this works\n\n * `pattern` {`string`} - Pattern to validate the input against for HTML validity checking\n\n * `autocomplete` {`AutoFill`} - The sets the autocomplete for the input.",
|
|
410
436
|
"attributes": [
|
|
437
|
+
{
|
|
438
|
+
"name": "checked",
|
|
439
|
+
"description": "`checked` {`boolean | undefined`} - \n\nProperty: checked",
|
|
440
|
+
"values": []
|
|
441
|
+
},
|
|
411
442
|
{
|
|
412
443
|
"name": "hidePasswordLabel",
|
|
413
444
|
"description": "`hidePasswordLabel` {`string`} - \"Hide password\" tooltip text on password visibility toggle\n\nProperty: hidePasswordLabel\n\nDefault: Hide"
|
|
@@ -423,7 +454,7 @@
|
|
|
423
454
|
},
|
|
424
455
|
{
|
|
425
456
|
"name": "variant",
|
|
426
|
-
"description": "`variant` {`\"number\" | \"text\" | \"text-area\" | \"color\" | \"date\" | \"datetime-local\" | \"email\" | \"file\" | \"hidden\" | \"password\"`} - Input type\n\nProperty: variant\n\nDefault: text",
|
|
457
|
+
"description": "`variant` {`\"number\" | \"text\" | \"text-area\" | \"color\" | \"date\" | \"datetime-local\" | \"email\" | \"file\" | \"hidden\" | \"password\" | \"checkbox\"`} - Input type\n\nProperty: variant\n\nDefault: text",
|
|
427
458
|
"values": [
|
|
428
459
|
{
|
|
429
460
|
"name": "number"
|
|
@@ -454,6 +485,9 @@
|
|
|
454
485
|
},
|
|
455
486
|
{
|
|
456
487
|
"name": "password"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"name": "checkbox"
|
|
457
491
|
}
|
|
458
492
|
]
|
|
459
493
|
},
|
|
@@ -1834,7 +1868,7 @@
|
|
|
1834
1868
|
"attributes": [
|
|
1835
1869
|
{
|
|
1836
1870
|
"name": "size",
|
|
1837
|
-
"description": "`size` {`\"large\" | \"medium\" | \"small\" | \"xsmall\" | \"xxsmall\" | \"tiny\"`} - Size of the pagination buttons\n\nProperty: size\n\nDefault:
|
|
1871
|
+
"description": "`size` {`\"large\" | \"medium\" | \"small\" | \"xsmall\" | \"xxsmall\" | \"tiny\"`} - Size of the pagination buttons\n\nProperty: size\n\nDefault: xsmall",
|
|
1838
1872
|
"values": [
|
|
1839
1873
|
{
|
|
1840
1874
|
"name": "large"
|
|
@@ -1966,12 +2000,12 @@
|
|
|
1966
2000
|
},
|
|
1967
2001
|
{
|
|
1968
2002
|
"name": "spectric-table-body",
|
|
1969
|
-
"description": "
|
|
2003
|
+
"description": "Table Body Element\n\nProperties:\n\n * `table` {`TableElement<T>`} - \n\n * `columns` {`ColumnSettings<T>[]`} - \n\n * `data` {`T[]`} - ",
|
|
1970
2004
|
"attributes": []
|
|
1971
2005
|
},
|
|
1972
2006
|
{
|
|
1973
2007
|
"name": "spectric-table-cell",
|
|
1974
|
-
"description": "Pagination Element\n\nEvents:\n\n * `filter` {`CustomEvent<FilterEvent<T>>`} - \n\nProperties:\n\n * `table` {`TableElement<T>`} - \n\n * `_handleFilterOut` - \n\n * `_handleFilterFor` - \n\n * `column` {`ColumnSettings<T>`} - \n\n * `row` {`T`} - ",
|
|
2008
|
+
"description": "Pagination Element\n\nEvents:\n\n * `filter` {`CustomEvent<FilterEvent<T>>`} - \n\nProperties:\n\n * `columns` {`ColumnSettings<T>[]`} - \n\n * `table` {`TableElement<T>`} - \n\n * `td` {`HTMLTableCellElement`} - \n\n * `_handleFilterOut` - \n\n * `_handleFilterFor` - \n\n * `styleRules` {`CSSStyleDeclaration`} - \n\n * `column` {`ColumnSettings<T>`} - \n\n * `row` {`T`} - ",
|
|
1975
2009
|
"attributes": [
|
|
1976
2010
|
{
|
|
1977
2011
|
"name": "onfilter",
|
|
@@ -1986,8 +2020,20 @@
|
|
|
1986
2020
|
},
|
|
1987
2021
|
{
|
|
1988
2022
|
"name": "spectric-table",
|
|
1989
|
-
"description": "Table Element\n\nThe table element is a bit more complex and the column settings and data can only be set through the properties\n\n\nReact\n\n``` tsx\n<spectric-table data={[{col1:1}]} columns={[{key:\"col1\",}]} ></spectric-table>\n```\n\nJavascript\n\n``` js\ntable = document.createElement(\"spectric-table\")\ntable.data = [{col1:1}]\ntable.columns = [{key:\"col1\",}]\n```\n\nHTML \n\n``` html\n<spectric-table id=\"table\"></spectric-table>\n<script>\ndocument.querySelector(\"#table\")\ntable.data = [{col1:1}]\ntable.columns = [{key:\"col1\",}]\n</script>\n```\n\nEvents:\n\n * `change` {`CustomEvent<{ pagination?: PaginationChangeProps | undefined; }>`} - \n\n * `filter` {`CustomEvent<FilterEvent<T>>`} - \n\nProperties:\n\n * `_handlePaginationChange` - \n\n * `_emitChange` - \n\n * `__DO_NOT_USE_filter` - \n\n * `pagination` {`PaginationProps | undefined`} - \n\n * `columns` {`ColumnSettings<T>[]`} - \n\n * `data` {`T[]`} - ",
|
|
2023
|
+
"description": "Table Element\n\nThe table element is a bit more complex and the column settings and data can only be set through the properties\n\n\nReact\n\n``` tsx\n<spectric-table data={[{col1:1}]} columns={[{key:\"col1\",}]} ></spectric-table>\n```\n\nJavascript\n\n``` js\ntable = document.createElement(\"spectric-table\")\ntable.data = [{col1:1}]\ntable.columns = [{key:\"col1\",}]\n```\n\nHTML \n\n``` html\n<spectric-table id=\"table\"></spectric-table>\n<script>\ndocument.querySelector(\"#table\")\ntable.data = [{col1:1}]\ntable.columns = [{key:\"col1\",}]\n</script>\n```\n\nEvents:\n\n * `change` {`CustomEvent<{ pagination?: PaginationChangeProps | undefined; }>`} - \n\n * `filter` {`CustomEvent<FilterEvent<T>>`} - \n\n * `select` {`CustomEvent<T[]>`} - \n\nAttributes:\n\n * `select` {`TableSelectOptions | undefined`} - \n\nProperties:\n\n * `_handlePaginationChange` - \n\n * `_emitChange` - \n\n * `__DO_NOT_USE_filter` - \n\n * `selected` {`T[]`} - \n\n * `_handleSelectAllChange` - \n\n * `pagination` {`PaginationProps | undefined`} - \n\n * `columns` {`ColumnSettings<T>[]`} - \n\n * `data` {`T[]`} - \n\n * `select` {`TableSelectOptions | undefined`} - ",
|
|
1990
2024
|
"attributes": [
|
|
2025
|
+
{
|
|
2026
|
+
"name": "select",
|
|
2027
|
+
"description": "`select` {`TableSelectOptions | undefined`} - \n\nProperty: select",
|
|
2028
|
+
"values": [
|
|
2029
|
+
{
|
|
2030
|
+
"name": "multi"
|
|
2031
|
+
},
|
|
2032
|
+
{
|
|
2033
|
+
"name": "single"
|
|
2034
|
+
}
|
|
2035
|
+
]
|
|
2036
|
+
},
|
|
1991
2037
|
{
|
|
1992
2038
|
"name": "onchange",
|
|
1993
2039
|
"description": "`change` {`CustomEvent<{ pagination?: PaginationChangeProps | undefined; }>`} - "
|
|
@@ -1995,12 +2041,61 @@
|
|
|
1995
2041
|
{
|
|
1996
2042
|
"name": "onfilter",
|
|
1997
2043
|
"description": "`filter` {`CustomEvent<FilterEvent<T>>`} - "
|
|
2044
|
+
},
|
|
2045
|
+
{
|
|
2046
|
+
"name": "onselect",
|
|
2047
|
+
"description": "`select` {`CustomEvent<T[]>`} - "
|
|
2048
|
+
}
|
|
2049
|
+
]
|
|
2050
|
+
},
|
|
2051
|
+
{
|
|
2052
|
+
"name": "spectric-tooltip",
|
|
2053
|
+
"description": "Spectric tooltip will add a tooltip to any container\n\nAttributes:\n\n * `delay` {`number`} - How long you need to hover before the tooltip displays\n\n * `animationDuration` {`number`} - How long the fade in animation should run\n\n * `text` {`DomRenderable`} - Tooltip contents\n\n * `position` {`\"top\" | \"bottom\" | \"left\" | \"right\" | \"mouse\"`} - Where to anchor the tooltip\n\n * `maxWidth` {`number | undefined`} - Sets a max width for the contents (default:300) you can disable this by setting to 0 or -1\n\nProperties:\n\n * `portalElement` {`HTMLDivElement`} - \n\n * `mouseLocation` {`{ left: number; top: number; } | undefined`} - \n\n * `styles` {`CSSResultGroup | undefined`} - \n\n * `timer` {`number | undefined`} - \n\n * `open` {`boolean`} - \n\n * `mouseframe` {`number | undefined`} - \n\n * `target` {`HTMLElement | null`} - \n\n * `_getMousePosition` - \n\n * `_hideTooltip` - \n\n * `showToolTip` - \n\n * `applyStyle` - \n\n * `positionTooltip` - \n\n * `delay` {`number`} - How long you need to hover before the tooltip displays\n\n * `animationDuration` {`number`} - How long the fade in animation should run\n\n * `text` {`DomRenderable`} - Tooltip contents\n\n * `position` {`\"top\" | \"bottom\" | \"left\" | \"right\" | \"mouse\"`} - Where to anchor the tooltip\n\n * `maxWidth` {`number | undefined`} - Sets a max width for the contents (default:300) you can disable this by setting to 0 or -1\n\n * `portalTarget` {`HTMLElement`} - Container the tool tip will be attached to. (default:document.body)\n\n * `triggerTarget` {`HTMLElement | undefined`} - The element that triggers the tooltip. (default:node.parentElement) This is used for special cases like in the shadow dom if you want to target a host element instead of the immediate parent element",
|
|
2054
|
+
"attributes": [
|
|
2055
|
+
{
|
|
2056
|
+
"name": "delay",
|
|
2057
|
+
"description": "`delay` {`number`} - How long you need to hover before the tooltip displays\n\nProperty: delay\n\nDefault: 100"
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
"name": "animationDuration",
|
|
2061
|
+
"description": "`animationDuration` {`number`} - How long the fade in animation should run\n\nProperty: animationDuration\n\nDefault: 0"
|
|
2062
|
+
},
|
|
2063
|
+
{
|
|
2064
|
+
"name": "text",
|
|
2065
|
+
"description": "`text` {`DomRenderable`} - Tooltip contents\n\nProperty: text\n\nDefault: ",
|
|
2066
|
+
"values": []
|
|
2067
|
+
},
|
|
2068
|
+
{
|
|
2069
|
+
"name": "position",
|
|
2070
|
+
"description": "`position` {`\"top\" | \"bottom\" | \"left\" | \"right\" | \"mouse\"`} - Where to anchor the tooltip\n\nProperty: position\n\nDefault: right",
|
|
2071
|
+
"values": [
|
|
2072
|
+
{
|
|
2073
|
+
"name": "top"
|
|
2074
|
+
},
|
|
2075
|
+
{
|
|
2076
|
+
"name": "bottom"
|
|
2077
|
+
},
|
|
2078
|
+
{
|
|
2079
|
+
"name": "left"
|
|
2080
|
+
},
|
|
2081
|
+
{
|
|
2082
|
+
"name": "right"
|
|
2083
|
+
},
|
|
2084
|
+
{
|
|
2085
|
+
"name": "mouse"
|
|
2086
|
+
}
|
|
2087
|
+
]
|
|
2088
|
+
},
|
|
2089
|
+
{
|
|
2090
|
+
"name": "maxWidth",
|
|
2091
|
+
"description": "`maxWidth` {`number | undefined`} - Sets a max width for the contents (default:300) you can disable this by setting to 0 or -1\n\nProperty: maxWidth\n\nDefault: 300",
|
|
2092
|
+
"values": []
|
|
1998
2093
|
}
|
|
1999
2094
|
]
|
|
2000
2095
|
},
|
|
2001
2096
|
{
|
|
2002
2097
|
"name": "spectric-storybook-example-content",
|
|
2003
|
-
"description": "Attributes:\n\n * `frameWidth` {`number`} - \n\nProperties:\n\n * `frameWidth` {`number`} - \n\n * `dialogOpen` {`boolean`} - ",
|
|
2098
|
+
"description": "Attributes:\n\n * `frameWidth` {`number`} - \n\nProperties:\n\n * `frameWidth` {`number`} - \n\n * `query` {`SpectricQuery`} - \n\n * `dialogOpen` {`boolean`} - \n\n * `tableData` {`TestData[]`} - \n\n * `pagination` {`{ page: number; pageSize: number; size: string; totalItems: number; }`} - \n\n * `_handleFilter` - \n\n * `_handlePaginationChange` - ",
|
|
2004
2099
|
"attributes": [
|
|
2005
2100
|
{
|
|
2006
2101
|
"name": "frameWidth",
|