@spectric/ui 0.0.7 → 0.0.8
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/dist/components/Button.d.ts +8 -3
- package/dist/components/index.d.ts +2 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/pagination.d.ts +60 -0
- package/dist/components/table/body.d.ts +44 -0
- package/dist/components/table/cell.d.ts +53 -0
- package/dist/components/table/header.d.ts +42 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/table.d.ts +90 -0
- package/dist/custom-elements.json +103 -4
- package/dist/index.es.js +1439 -1130
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +180 -74
- 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 -4
- package/src/components/button.css.ts +66 -0
- package/src/components/index.ts +3 -1
- package/src/components/pagination/index.ts +1 -0
- package/src/components/pagination/pagination.css +10 -0
- package/src/components/pagination/pagination.ts +133 -0
- package/src/components/table/body.ts +69 -0
- package/src/components/table/cell.ts +117 -0
- package/src/components/table/header.ts +68 -0
- package/src/components/table/index.ts +1 -0
- package/src/components/table/table.css +36 -0
- package/src/components/table/table.ts +131 -0
- package/src/stories/Button.stories.ts +3 -2
- package/src/stories/pagination.stories.ts +63 -0
- package/src/stories/table.stories.ts +74 -0
|
@@ -3,9 +3,12 @@ import { HTMLElementTagWithEvents, ReactElementWithPropsAndEvents } from './type
|
|
|
3
3
|
export declare enum ButtonSizes {
|
|
4
4
|
large = "large",
|
|
5
5
|
medium = "medium",
|
|
6
|
-
small = "small"
|
|
6
|
+
small = "small",
|
|
7
|
+
xsmall = "xsmall",
|
|
8
|
+
xxsmall = "xxsmall",
|
|
9
|
+
tiny = "tiny"
|
|
7
10
|
}
|
|
8
|
-
type ButtonSizesTypes = `${ButtonSizes}`;
|
|
11
|
+
export type ButtonSizesTypes = `${ButtonSizes}`;
|
|
9
12
|
export declare enum ButtonVariants {
|
|
10
13
|
primary = "primary",
|
|
11
14
|
secondary = "secondary",
|
|
@@ -22,15 +25,17 @@ export interface ButtonProps {
|
|
|
22
25
|
label?: string;
|
|
23
26
|
disabled: boolean;
|
|
24
27
|
danger?: boolean;
|
|
28
|
+
icon?: boolean;
|
|
25
29
|
}
|
|
26
30
|
export declare class SpectricButton extends LitElement implements ButtonProps {
|
|
27
31
|
static styles?: CSSResultGroup | undefined;
|
|
28
32
|
variant: 'primary' | 'secondary' | 'text';
|
|
29
33
|
disabled: boolean;
|
|
30
34
|
backgroundColor?: string | undefined;
|
|
31
|
-
size:
|
|
35
|
+
size: ButtonSizesTypes;
|
|
32
36
|
label?: string;
|
|
33
37
|
danger: boolean;
|
|
38
|
+
icon: boolean;
|
|
34
39
|
connectedCallback(): void;
|
|
35
40
|
disconnectedCallback(): void;
|
|
36
41
|
private _onClick;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './pagination';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { HTMLElementTagWithEvents, ReactElementWithPropsAndEvents } from '../types';
|
|
3
|
+
import { ButtonSizesTypes } from '../Button';
|
|
4
|
+
export declare const PaginationElementTag = "spectric-pagination";
|
|
5
|
+
export type { PaginationProps, PaginationChangeProps, PaginationEvents };
|
|
6
|
+
interface PaginationChangeProps {
|
|
7
|
+
page: number;
|
|
8
|
+
pageSize: number;
|
|
9
|
+
}
|
|
10
|
+
interface PaginationProps extends PaginationChangeProps {
|
|
11
|
+
size: ButtonSizesTypes;
|
|
12
|
+
totalItems?: number;
|
|
13
|
+
pageSizeOptions?: number[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Pagination Element
|
|
17
|
+
*/
|
|
18
|
+
export declare class PaginationElement extends LitElement implements PaginationProps {
|
|
19
|
+
page: number;
|
|
20
|
+
pageSize: number;
|
|
21
|
+
totalItems?: number;
|
|
22
|
+
pageSizeOptions: number[];
|
|
23
|
+
/**
|
|
24
|
+
* Size of the pagination buttons
|
|
25
|
+
*/
|
|
26
|
+
size: ButtonSizesTypes;
|
|
27
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
28
|
+
protected updated(_changedProperties: PropertyValues): void;
|
|
29
|
+
private _handlePageUp;
|
|
30
|
+
private _handlePageDown;
|
|
31
|
+
private _handleSizeChange;
|
|
32
|
+
private _emitChange;
|
|
33
|
+
protected render(): unknown;
|
|
34
|
+
}
|
|
35
|
+
interface PaginationEvents {
|
|
36
|
+
'change': (event: CustomEvent<PaginationChangeProps>) => void;
|
|
37
|
+
}
|
|
38
|
+
declare global {
|
|
39
|
+
interface HTMLElementTagNameMap {
|
|
40
|
+
[PaginationElementTag]: HTMLElementTagWithEvents<PaginationElement, PaginationEvents>;
|
|
41
|
+
}
|
|
42
|
+
namespace JSX {
|
|
43
|
+
interface IntrinsicElements {
|
|
44
|
+
/**
|
|
45
|
+
* @see {@link DialogElement}
|
|
46
|
+
*/
|
|
47
|
+
[PaginationElementTag]: ReactElementWithPropsAndEvents<PaginationElement, PaginationProps, PaginationEvents>;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
namespace React {
|
|
51
|
+
namespace JSX {
|
|
52
|
+
interface IntrinsicElements {
|
|
53
|
+
/**
|
|
54
|
+
* @see {@link DialogElement}
|
|
55
|
+
*/
|
|
56
|
+
[PaginationElementTag]: ReactElementWithPropsAndEvents<PaginationElement, PaginationProps, PaginationEvents>;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { HTMLElementTagWithEvents, ReactElementWithPropsAndEvents } from '../types';
|
|
3
|
+
import { ColumnSettings, TableElement } from './table';
|
|
4
|
+
export declare const TableBodyElementTag = "spectric-table-body";
|
|
5
|
+
interface BodyProps<T> {
|
|
6
|
+
columns: ColumnSettings<T>[];
|
|
7
|
+
data: T[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Pagination Element
|
|
11
|
+
*/
|
|
12
|
+
export declare class TableBodyElement<T> extends LitElement implements BodyProps<T> {
|
|
13
|
+
data: T[];
|
|
14
|
+
columns: ColumnSettings<T>[];
|
|
15
|
+
table: TableElement<T>;
|
|
16
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
17
|
+
protected render(): unknown;
|
|
18
|
+
}
|
|
19
|
+
interface TableBodyEvents {
|
|
20
|
+
}
|
|
21
|
+
declare global {
|
|
22
|
+
interface HTMLElementTagNameMap {
|
|
23
|
+
[TableBodyElementTag]: HTMLElementTagWithEvents<TableBodyElement<any>, TableBodyEvents>;
|
|
24
|
+
}
|
|
25
|
+
namespace JSX {
|
|
26
|
+
interface IntrinsicElements {
|
|
27
|
+
/**
|
|
28
|
+
* @see {@link DialogElement}
|
|
29
|
+
*/
|
|
30
|
+
[TableBodyElementTag]: ReactElementWithPropsAndEvents<TableBodyElement<any>, BodyProps<any>, TableBodyEvents>;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
namespace React {
|
|
34
|
+
namespace JSX {
|
|
35
|
+
interface IntrinsicElements {
|
|
36
|
+
/**
|
|
37
|
+
* @see {@link DialogElement}
|
|
38
|
+
*/
|
|
39
|
+
[TableBodyElementTag]: ReactElementWithPropsAndEvents<TableBodyElement<any>, BodyProps<any>, TableBodyEvents>;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { HTMLElementTagWithEvents, ReactElementWithPropsAndEvents } from '../types';
|
|
3
|
+
import { ColumnSettings, TableElement } from './table';
|
|
4
|
+
export declare const TableCellElementTag = "spectric-table-cell";
|
|
5
|
+
interface CellProps<T> {
|
|
6
|
+
column: ColumnSettings<T>;
|
|
7
|
+
row: T;
|
|
8
|
+
}
|
|
9
|
+
export type FilterEvent<T> = {
|
|
10
|
+
value?: T;
|
|
11
|
+
include: boolean;
|
|
12
|
+
column: ColumnSettings<T>;
|
|
13
|
+
row: T;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Pagination Element
|
|
17
|
+
*/
|
|
18
|
+
export declare class TableCellElement<T> extends LitElement implements CellProps<T> {
|
|
19
|
+
row: T;
|
|
20
|
+
column: ColumnSettings<T>;
|
|
21
|
+
table: TableElement<T>;
|
|
22
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
23
|
+
_handleFilterOut: () => void;
|
|
24
|
+
_handleFilterFor: () => void;
|
|
25
|
+
protected render(): unknown;
|
|
26
|
+
}
|
|
27
|
+
interface TableBodyEvents {
|
|
28
|
+
'filter': (event: CustomEvent<ColumnSettings<any>>) => void;
|
|
29
|
+
}
|
|
30
|
+
declare global {
|
|
31
|
+
interface HTMLElementTagNameMap {
|
|
32
|
+
[TableCellElementTag]: HTMLElementTagWithEvents<TableCellElement<any>, TableBodyEvents>;
|
|
33
|
+
}
|
|
34
|
+
namespace JSX {
|
|
35
|
+
interface IntrinsicElements {
|
|
36
|
+
/**
|
|
37
|
+
* @see {@link DialogElement}
|
|
38
|
+
*/
|
|
39
|
+
[TableCellElementTag]: ReactElementWithPropsAndEvents<TableCellElement<any>, CellProps<any>, TableBodyEvents>;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
namespace React {
|
|
43
|
+
namespace JSX {
|
|
44
|
+
interface IntrinsicElements {
|
|
45
|
+
/**
|
|
46
|
+
* @see {@link DialogElement}
|
|
47
|
+
*/
|
|
48
|
+
[TableCellElementTag]: ReactElementWithPropsAndEvents<TableCellElement<any>, CellProps<any>, TableBodyEvents>;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { HTMLElementTagWithEvents, ReactElementWithPropsAndEvents } from '../types';
|
|
3
|
+
import { ColumnSettings } from './table';
|
|
4
|
+
export declare const TableHeaderElementTag = "spectric-table-header";
|
|
5
|
+
interface HeaderProps<T> {
|
|
6
|
+
columns: ColumnSettings<T>[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Pagination Element
|
|
10
|
+
*/
|
|
11
|
+
export declare class TableHeaderElement<T> extends LitElement implements HeaderProps<T> {
|
|
12
|
+
columns: ColumnSettings<T>[];
|
|
13
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
14
|
+
protected render(): unknown;
|
|
15
|
+
}
|
|
16
|
+
interface TableHeaderEvents {
|
|
17
|
+
'sort': (event: CustomEvent<ColumnSettings<any>>) => void;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
[TableHeaderElementTag]: HTMLElementTagWithEvents<TableHeaderElement<any>, TableHeaderEvents>;
|
|
22
|
+
}
|
|
23
|
+
namespace JSX {
|
|
24
|
+
interface IntrinsicElements {
|
|
25
|
+
/**
|
|
26
|
+
* @see {@link DialogElement}
|
|
27
|
+
*/
|
|
28
|
+
[TableHeaderElementTag]: ReactElementWithPropsAndEvents<TableHeaderElement<any>, HeaderProps<any>, TableHeaderEvents>;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
namespace React {
|
|
32
|
+
namespace JSX {
|
|
33
|
+
interface IntrinsicElements {
|
|
34
|
+
/**
|
|
35
|
+
* @see {@link DialogElement}
|
|
36
|
+
*/
|
|
37
|
+
[TableHeaderElementTag]: ReactElementWithPropsAndEvents<TableHeaderElement<any>, HeaderProps<any>, TableHeaderEvents>;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './table';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import { HTMLElementTagWithEvents, ReactElementWithPropsAndEvents } from '../types';
|
|
3
|
+
import { PaginationChangeProps, PaginationProps } from '../pagination';
|
|
4
|
+
import { FilterEvent } from './cell';
|
|
5
|
+
export declare const TableElementTag = "spectric-table";
|
|
6
|
+
export type { TableProps, TableEvents };
|
|
7
|
+
export type DomRenderable = HTMLElement | TemplateResult | string | number | null;
|
|
8
|
+
export type ColumnSettings<T> = {
|
|
9
|
+
hidden?: boolean;
|
|
10
|
+
sortable?: boolean;
|
|
11
|
+
filterable?: boolean;
|
|
12
|
+
title?: string;
|
|
13
|
+
key?: string;
|
|
14
|
+
render?: (row: T, table: TableElement<T>) => DomRenderable;
|
|
15
|
+
};
|
|
16
|
+
interface TableProps<T> {
|
|
17
|
+
pagination?: PaginationProps;
|
|
18
|
+
columns: ColumnSettings<T>[];
|
|
19
|
+
data: T[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Table Element
|
|
23
|
+
*
|
|
24
|
+
* The table element is a bit more complex and the column settings and data can only be set through the properties
|
|
25
|
+
*
|
|
26
|
+
*
|
|
27
|
+
* React
|
|
28
|
+
*
|
|
29
|
+
* ``` tsx
|
|
30
|
+
* <spectric-table data={[{col1:1}]} columns={[{key:"col1",}]} ></spectric-table>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* Javascript
|
|
34
|
+
*
|
|
35
|
+
* ``` js
|
|
36
|
+
* table = document.createElement("spectric-table")
|
|
37
|
+
* table.data = [{col1:1}]
|
|
38
|
+
* table.columns = [{key:"col1",}]
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* HTML
|
|
42
|
+
*
|
|
43
|
+
* ``` html
|
|
44
|
+
* <spectric-table id="table"></spectric-table>
|
|
45
|
+
* <script>
|
|
46
|
+
* document.querySelector("#table")
|
|
47
|
+
* table.data = [{col1:1}]
|
|
48
|
+
* table.columns = [{key:"col1",}]
|
|
49
|
+
* </script>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare class TableElement<T> extends LitElement implements TableProps<T> {
|
|
53
|
+
data: T[];
|
|
54
|
+
pagination?: PaginationProps | undefined;
|
|
55
|
+
columns: ColumnSettings<T>[];
|
|
56
|
+
private _handlePaginationChange;
|
|
57
|
+
private _emitChange;
|
|
58
|
+
private __DO_NOT_USE_filter;
|
|
59
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
60
|
+
protected render(): unknown;
|
|
61
|
+
}
|
|
62
|
+
interface TableEvents {
|
|
63
|
+
'change': (event: CustomEvent<{
|
|
64
|
+
pagination: PaginationChangeProps;
|
|
65
|
+
}>) => void;
|
|
66
|
+
'filter': (event: CustomEvent<FilterEvent<any>>) => void;
|
|
67
|
+
}
|
|
68
|
+
declare global {
|
|
69
|
+
interface HTMLElementTagNameMap {
|
|
70
|
+
[TableElementTag]: HTMLElementTagWithEvents<TableElement<any>, TableEvents>;
|
|
71
|
+
}
|
|
72
|
+
namespace JSX {
|
|
73
|
+
interface IntrinsicElements {
|
|
74
|
+
/**
|
|
75
|
+
* @see {@link DialogElement}
|
|
76
|
+
*/
|
|
77
|
+
[TableElementTag]: ReactElementWithPropsAndEvents<TableElement<any>, TableProps<any>, TableEvents>;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
namespace React {
|
|
81
|
+
namespace JSX {
|
|
82
|
+
interface IntrinsicElements {
|
|
83
|
+
/**
|
|
84
|
+
* @see {@link DialogElement}
|
|
85
|
+
*/
|
|
86
|
+
[TableElementTag]: ReactElementWithPropsAndEvents<TableElement<any>, TableProps<any>, TableEvents>;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -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` {`\"
|
|
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`} - ",
|
|
83
83
|
"attributes": [
|
|
84
84
|
{
|
|
85
85
|
"name": "variant",
|
|
@@ -103,16 +103,25 @@
|
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
"name": "size",
|
|
106
|
-
"description": "`size` {`\"
|
|
106
|
+
"description": "`size` {`\"large\" | \"medium\" | \"small\" | \"xsmall\" | \"xxsmall\" | \"tiny\"`} - How large should the button be?\n\nProperty: size\n\nDefault: small",
|
|
107
107
|
"values": [
|
|
108
108
|
{
|
|
109
|
-
"name": "
|
|
109
|
+
"name": "large"
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
112
|
"name": "medium"
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
|
-
"name": "
|
|
115
|
+
"name": "small"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "xsmall"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "xxsmall"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "tiny"
|
|
116
125
|
}
|
|
117
126
|
]
|
|
118
127
|
},
|
|
@@ -131,6 +140,11 @@
|
|
|
131
140
|
"description": "`danger` {`boolean`} - \n\nProperty: danger\n\nDefault: false",
|
|
132
141
|
"valueSet": "v"
|
|
133
142
|
},
|
|
143
|
+
{
|
|
144
|
+
"name": "icon",
|
|
145
|
+
"description": "`icon` {`boolean`} - \n\nProperty: icon\n\nDefault: false",
|
|
146
|
+
"valueSet": "v"
|
|
147
|
+
},
|
|
134
148
|
{
|
|
135
149
|
"name": "onclick",
|
|
136
150
|
"description": "`click` {`CustomEvent<MouseEvent>`} - "
|
|
@@ -1814,6 +1828,57 @@
|
|
|
1814
1828
|
}
|
|
1815
1829
|
]
|
|
1816
1830
|
},
|
|
1831
|
+
{
|
|
1832
|
+
"name": "spectric-pagination",
|
|
1833
|
+
"description": "Pagination Element\n\nEvents:\n\n * `change` {`CustomEvent<PaginationChangeProps>`} - \n\nAttributes:\n\n * `size` {`\"large\" | \"medium\" | \"small\" | \"xsmall\" | \"xxsmall\" | \"tiny\"`} - Size of the pagination buttons\n\n * `totalItems` {`number | undefined`} - \n\n * `pageSizeOptions` {`number[]`} - \n\n * `page` {`number`} - \n\n * `pageSize` {`number`} - \n\nProperties:\n\n * `_handlePageUp` - \n\n * `_handlePageDown` - \n\n * `_handleSizeChange` - \n\n * `_emitChange` - \n\n * `size` {`\"large\" | \"medium\" | \"small\" | \"xsmall\" | \"xxsmall\" | \"tiny\"`} - Size of the pagination buttons\n\n * `totalItems` {`number | undefined`} - \n\n * `pageSizeOptions` {`number[]`} - \n\n * `page` {`number`} - \n\n * `pageSize` {`number`} - ",
|
|
1834
|
+
"attributes": [
|
|
1835
|
+
{
|
|
1836
|
+
"name": "size",
|
|
1837
|
+
"description": "`size` {`\"large\" | \"medium\" | \"small\" | \"xsmall\" | \"xxsmall\" | \"tiny\"`} - Size of the pagination buttons\n\nProperty: size\n\nDefault: small",
|
|
1838
|
+
"values": [
|
|
1839
|
+
{
|
|
1840
|
+
"name": "large"
|
|
1841
|
+
},
|
|
1842
|
+
{
|
|
1843
|
+
"name": "medium"
|
|
1844
|
+
},
|
|
1845
|
+
{
|
|
1846
|
+
"name": "small"
|
|
1847
|
+
},
|
|
1848
|
+
{
|
|
1849
|
+
"name": "xsmall"
|
|
1850
|
+
},
|
|
1851
|
+
{
|
|
1852
|
+
"name": "xxsmall"
|
|
1853
|
+
},
|
|
1854
|
+
{
|
|
1855
|
+
"name": "tiny"
|
|
1856
|
+
}
|
|
1857
|
+
]
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
"name": "totalItems",
|
|
1861
|
+
"description": "`totalItems` {`number | undefined`} - \n\nProperty: totalItems",
|
|
1862
|
+
"values": []
|
|
1863
|
+
},
|
|
1864
|
+
{
|
|
1865
|
+
"name": "pageSizeOptions",
|
|
1866
|
+
"description": "`pageSizeOptions` {`number[]`} - \n\nProperty: pageSizeOptions\n\nDefault: 10,20,50,100,1000"
|
|
1867
|
+
},
|
|
1868
|
+
{
|
|
1869
|
+
"name": "page",
|
|
1870
|
+
"description": "`page` {`number`} - \n\nProperty: page\n\nDefault: 1"
|
|
1871
|
+
},
|
|
1872
|
+
{
|
|
1873
|
+
"name": "pageSize",
|
|
1874
|
+
"description": "`pageSize` {`number`} - \n\nProperty: pageSize\n\nDefault: 10"
|
|
1875
|
+
},
|
|
1876
|
+
{
|
|
1877
|
+
"name": "onchange",
|
|
1878
|
+
"description": "`change` {`CustomEvent<PaginationChangeProps>`} - "
|
|
1879
|
+
}
|
|
1880
|
+
]
|
|
1881
|
+
},
|
|
1817
1882
|
{
|
|
1818
1883
|
"name": "spectric-query",
|
|
1819
1884
|
"description": "The Query component will take Opensearch Dashboard Query language and transform it into various outputs\n\nEvents:\n\n * `change` {`CustomEvent<any>`} - \n\nAttributes:\n\n * `outputLanguage` {`\"toMongo\" | \"toCql\" | \"toDSL\" | \"AST\"`} - The output of the query in a specific format\n\n * `value` {`string`} - The value of the input.\n\n * `fields` {`FieldTypes[]`} - Fields that are used for the auto complete\n\n * `placeholder` {`string`} - Input placeholder\n\nProperties:\n\n * `_value` {`string`} - The internal value.\n\n * `suggestion` {`Suggestion | undefined`} - \n\n * `completions` {`Completion[]`} - \n\n * `completionIndex` {`number`} - \n\n * `_autocomplete` {`HTMLDivElement | undefined`} - \n\n * `_asyncAutocomplete` {`Promise<HTMLDivElement>`} - \n\n * `_input` {`SpectricInput`} - The underlying input element\n\n * `_parseQuery` - \n\n * `_selectCompletion` - \n\n * `_handleArrows` - \n\n * `uuid` {`string`} - \n\n * `outputLanguage` {`\"toMongo\" | \"toCql\" | \"toDSL\" | \"AST\"`} - The output of the query in a specific format\n\n * `value` {`string`} - The value of the input.\n\n * `fields` {`FieldTypes[]`} - Fields that are used for the auto complete\n\n * `getValuesForField` - Callback that will provide values for specific fields\n\n * `placeholder` {`string`} - Input placeholder",
|
|
@@ -1899,6 +1964,40 @@
|
|
|
1899
1964
|
}
|
|
1900
1965
|
]
|
|
1901
1966
|
},
|
|
1967
|
+
{
|
|
1968
|
+
"name": "spectric-table-body",
|
|
1969
|
+
"description": "Pagination Element\n\nProperties:\n\n * `table` {`TableElement<T>`} - \n\n * `columns` {`ColumnSettings<T>[]`} - \n\n * `data` {`T[]`} - ",
|
|
1970
|
+
"attributes": []
|
|
1971
|
+
},
|
|
1972
|
+
{
|
|
1973
|
+
"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`} - ",
|
|
1975
|
+
"attributes": [
|
|
1976
|
+
{
|
|
1977
|
+
"name": "onfilter",
|
|
1978
|
+
"description": "`filter` {`CustomEvent<FilterEvent<T>>`} - "
|
|
1979
|
+
}
|
|
1980
|
+
]
|
|
1981
|
+
},
|
|
1982
|
+
{
|
|
1983
|
+
"name": "spectric-table-header",
|
|
1984
|
+
"description": "Pagination Element\n\nProperties:\n\n * `columns` {`ColumnSettings<T>[]`} - ",
|
|
1985
|
+
"attributes": []
|
|
1986
|
+
},
|
|
1987
|
+
{
|
|
1988
|
+
"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[]`} - ",
|
|
1990
|
+
"attributes": [
|
|
1991
|
+
{
|
|
1992
|
+
"name": "onchange",
|
|
1993
|
+
"description": "`change` {`CustomEvent<{ pagination?: PaginationChangeProps | undefined; }>`} - "
|
|
1994
|
+
},
|
|
1995
|
+
{
|
|
1996
|
+
"name": "onfilter",
|
|
1997
|
+
"description": "`filter` {`CustomEvent<FilterEvent<T>>`} - "
|
|
1998
|
+
}
|
|
1999
|
+
]
|
|
2000
|
+
},
|
|
1902
2001
|
{
|
|
1903
2002
|
"name": "spectric-storybook-example-content",
|
|
1904
2003
|
"description": "Attributes:\n\n * `frameWidth` {`number`} - \n\nProperties:\n\n * `frameWidth` {`number`} - \n\n * `dialogOpen` {`boolean`} - ",
|