@spectric/ui 0.0.22 → 0.0.24
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/query_bar/QueryBar.d.ts +2 -0
- package/dist/components/query_bar/querylanguage/kuery/index.d.ts +2 -1
- package/dist/components/query_bar/querylanguage/outputTypes/toHTML.d.ts +15 -0
- package/dist/components/table/table.d.ts +9 -0
- package/dist/custom-elements.json +2 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +2084 -1988
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +151 -138
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/input.css +5 -0
- package/src/components/input.ts +1 -2
- package/src/components/query_bar/QueryBar.css +43 -0
- package/src/components/query_bar/QueryBar.ts +21 -8
- package/src/components/query_bar/querylanguage/kuery/index.ts +11 -8
- package/src/components/query_bar/querylanguage/outputTypes/toHTML.ts +126 -0
- package/src/components/table/cell.ts +21 -8
- package/src/components/table/table.css +9 -3
- package/src/components/table/table.ts +14 -0
- package/src/stories/fixtures/ExampleContent.ts +144 -87
- package/src/stories/fixtures/data.ts +40 -7
- package/src/stories/table.stories.ts +8 -8
|
@@ -62,6 +62,7 @@ export declare const toLabelValue: (value: LabelValueOrString) => {
|
|
|
62
62
|
label: string;
|
|
63
63
|
value: string;
|
|
64
64
|
};
|
|
65
|
+
export declare const GeospatialOperators: Record<string, LabelValue>;
|
|
65
66
|
/**
|
|
66
67
|
* The Query component will take Opensearch Dashboard Query language and transform it into various outputs
|
|
67
68
|
*/
|
|
@@ -69,6 +70,7 @@ export declare class SpectricQuery extends LitElement implements IQueryProps {
|
|
|
69
70
|
private uuid;
|
|
70
71
|
placeholder: string;
|
|
71
72
|
valueHelper: any;
|
|
73
|
+
highlightedSyntax: any;
|
|
72
74
|
constructor();
|
|
73
75
|
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
74
76
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { DQLSyntaxError } from './kuery_syntax_error';
|
|
2
2
|
export { nodeTypes } from './node_types';
|
|
3
3
|
export * from './ast';
|
|
4
|
-
export { fromKueryExpression as parse, toOpenSearchQuery as toDSL } from './ast';
|
|
4
|
+
export { fromKueryExpression as parse, toOpenSearchQuery as toDSL, } from './ast';
|
|
5
5
|
export { toCql } from '../outputTypes/toCQL';
|
|
6
6
|
export { toMongo } from '../outputTypes/toMongo';
|
|
7
|
+
export { toHTML } from '../outputTypes/toHTML';
|
|
7
8
|
export * from './types';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FieldTypes, KueryNode } from '../..';
|
|
2
|
+
export declare const KQL_WILDCARD_SYMBOL = "@kuery-wildcard@";
|
|
3
|
+
export declare const KQL_NODE_TYPE_WILDCARD = "wildcard";
|
|
4
|
+
export type FunctionName = "is" | "and" | "or" | "not" | "range" | "exists" | "nested";
|
|
5
|
+
export declare const functions: {
|
|
6
|
+
is: (node: KueryNode, fields?: FieldTypes[]) => string;
|
|
7
|
+
and: (node: KueryNode, fields?: FieldTypes[]) => string;
|
|
8
|
+
or: (node: KueryNode, fields?: FieldTypes[]) => string;
|
|
9
|
+
not: (node: KueryNode, fields?: FieldTypes[]) => string;
|
|
10
|
+
range: (node: KueryNode) => string;
|
|
11
|
+
exists: (node: KueryNode) => string;
|
|
12
|
+
nested: (node: KueryNode) => string;
|
|
13
|
+
geospatial: (node: KueryNode) => string;
|
|
14
|
+
};
|
|
15
|
+
export declare const toHTML: (node: KueryNode, fields?: FieldTypes[]) => string;
|
|
@@ -2,6 +2,7 @@ import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
|
2
2
|
import { HTMLElementTagWithEvents, ReactElementWithPropsAndEvents } from '../types';
|
|
3
3
|
import { PaginationChangeProps, PaginationProps } from '../pagination';
|
|
4
4
|
import { FilterEvent } from './cell';
|
|
5
|
+
import { ButtonSizesTypes } from '../Button';
|
|
5
6
|
export declare const TableElementTag = "spectric-table";
|
|
6
7
|
export type { TableProps, TableEvents };
|
|
7
8
|
export type DomRenderable = HTMLElement | TemplateResult | string | number | null | undefined;
|
|
@@ -21,6 +22,11 @@ export declare enum TableSortDirection {
|
|
|
21
22
|
none = "none"
|
|
22
23
|
}
|
|
23
24
|
export type TableSortDirectionTypes = `${TableSortDirection}`;
|
|
25
|
+
export type CellAction<T> = {
|
|
26
|
+
tooltip: DomRenderable;
|
|
27
|
+
icon: DomRenderable;
|
|
28
|
+
onClick: (row: T, column: ColumnSettings<T>) => void;
|
|
29
|
+
};
|
|
24
30
|
export type ColumnSettings<T> = {
|
|
25
31
|
[TABLE_CREATED_SELECTION_COLUMN]?: boolean;
|
|
26
32
|
width?: number;
|
|
@@ -34,6 +40,7 @@ export type ColumnSettings<T> = {
|
|
|
34
40
|
sortDirection?: TableSortDirectionTypes;
|
|
35
41
|
filterable?: boolean;
|
|
36
42
|
disableCellOverflowTooltip?: boolean;
|
|
43
|
+
cellActions?: CellAction<T>[];
|
|
37
44
|
title?: DomRenderable | ((table: SpectricTableElement<T>) => DomRenderable);
|
|
38
45
|
/**
|
|
39
46
|
* Key to used for getting data from an object for a cell
|
|
@@ -85,6 +92,8 @@ export declare class SpectricTableElement<T = any> extends LitElement implements
|
|
|
85
92
|
* Needed for virtualization
|
|
86
93
|
*/
|
|
87
94
|
fontSize: number;
|
|
95
|
+
protected cellActionButtonSize: ButtonSizesTypes;
|
|
96
|
+
getCellActionButtonSize(): "small" | "large" | "medium" | "xsmall" | "xxsmall" | "tiny";
|
|
88
97
|
static getDefaultDataSorterAndPaginatior<T>(data: T[]): (props: TableDataOptions<T>) => T[];
|
|
89
98
|
private _handlePaginationChange;
|
|
90
99
|
private _handleSortChange;
|
|
@@ -1960,7 +1960,7 @@
|
|
|
1960
1960
|
},
|
|
1961
1961
|
{
|
|
1962
1962
|
"name": "spectric-query",
|
|
1963
|
-
"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 * `valueHelper` - \n\n * `_value` {`string`} - The internal value.\n\n * `suggestion` {`Suggestion | undefined`} - \n\n * `completions` {`Completion[]`} - \n\n * `completionIndex` {`number`} - \n\n * `_autocomplete` {`PopoverElement | undefined`} - \n\n * `_valueHelper` {`PopoverElement | undefined`} - \n\n * `_asyncAutocomplete` {`Promise<HTMLDivElement>`} - \n\n * `_input` {`SpectricInput`} - The underlying input element\n\n * `_checkClickLocation` - \n\n * `_setValue` - \n\n * `_showValueHelper` - Value helper is a popover above the query bar that will help users set/change/clear the value if it is complex (like date time or geoshape)\n\n * `_getSuggestion` - \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",
|
|
1963
|
+
"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 * `valueHelper` - \n\n * `highlightedSyntax` - \n\n * `_value` {`string`} - The internal value.\n\n * `suggestion` {`Suggestion | undefined`} - \n\n * `completions` {`Completion[]`} - \n\n * `completionIndex` {`number`} - \n\n * `_autocomplete` {`PopoverElement | undefined`} - \n\n * `_valueHelper` {`PopoverElement | undefined`} - \n\n * `_asyncAutocomplete` {`Promise<HTMLDivElement>`} - \n\n * `_input` {`SpectricInput`} - The underlying input element\n\n * `_checkClickLocation` - \n\n * `_setValue` - \n\n * `_showValueHelper` - Value helper is a popover above the query bar that will help users set/change/clear the value if it is complex (like date time or geoshape)\n\n * `_getSuggestion` - \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",
|
|
1964
1964
|
"attributes": [
|
|
1965
1965
|
{
|
|
1966
1966
|
"name": "outputLanguage",
|
|
@@ -2074,7 +2074,7 @@
|
|
|
2074
2074
|
},
|
|
2075
2075
|
{
|
|
2076
2076
|
"name": "spectric-table",
|
|
2077
|
-
"description": "React example\n<iframe width=\"100%\" height=\"400px\" src=\"https://stackblitz.com/edit/react-ts-2ue7azag?ctl=1&embed=1&file=App.tsx&hideExplorer=1&hideNavigation=1\"/>\n\nEvents:\n\n * `paginationChange` {`CustomEvent<PaginationChangeProps>`} - \n\n * `change` {`CustomEvent<TableDataOptions<T>>`} - \n\n * `filter` {`CustomEvent<FilterEvent<T>>`} - \n\n * `sortChange` {`CustomEvent<ColumnSettings<T>>`} - \n\n * `selected` {`CustomEvent<T[]>`} - \n\nAttributes:\n\n * `fontSize` {`number`} - Needed for virtualization\n\n * `select` {`\"none\" | \"multi\" | \"single\"`} - \n\n * `sort` {`\"multi\" | \"single\"`} - \n\n * `rowHeight` {`number`} - Needed for virtualization\n\n * `sortOrder` {`string[]`} - \n\nProperties:\n\n * `fontSize` {`number`} - Needed for virtualization\n\n * `_handlePaginationChange` - \n\n * `_handleSortChange` - \n\n * `_handleColumnResize` - \n\n * `_emitChange` - \n\n * `__DO_NOT_USE_filter` - \n\n * `selected` {`T[]`} - \n\n * `_getRowHeight` - \n\n * `_handleSelectAllChange` - \n\n * `selectColumnConfig` {`ColumnSettings<T>`} - \n\n * `data` {`T[]`} - \n\n * `select` {`\"none\" | \"multi\" | \"single\"`} - \n\n * `sort` {`\"multi\" | \"single\"`} - \n\n * `rowHeight` {`number`} - Needed for virtualization\n\n * `pagination` {`PaginationProps | undefined`} - \n\n * `columns` {`ColumnSettings<T>[]`} - \n\n * `sortOrder` {`string[]`} - ",
|
|
2077
|
+
"description": "React example\n<iframe width=\"100%\" height=\"400px\" src=\"https://stackblitz.com/edit/react-ts-2ue7azag?ctl=1&embed=1&file=App.tsx&hideExplorer=1&hideNavigation=1\"/>\n\nEvents:\n\n * `paginationChange` {`CustomEvent<PaginationChangeProps>`} - \n\n * `change` {`CustomEvent<TableDataOptions<T>>`} - \n\n * `filter` {`CustomEvent<FilterEvent<T>>`} - \n\n * `sortChange` {`CustomEvent<ColumnSettings<T>>`} - \n\n * `selected` {`CustomEvent<T[]>`} - \n\nAttributes:\n\n * `fontSize` {`number`} - Needed for virtualization\n\n * `select` {`\"none\" | \"multi\" | \"single\"`} - \n\n * `sort` {`\"multi\" | \"single\"`} - \n\n * `rowHeight` {`number`} - Needed for virtualization\n\n * `sortOrder` {`string[]`} - \n\nProperties:\n\n * `fontSize` {`number`} - Needed for virtualization\n\n * `cellActionButtonSize` {`\"large\" | \"medium\" | \"small\" | \"xsmall\" | \"xxsmall\" | \"tiny\"`} - \n\n * `_handlePaginationChange` - \n\n * `_handleSortChange` - \n\n * `_handleColumnResize` - \n\n * `_emitChange` - \n\n * `__DO_NOT_USE_filter` - \n\n * `selected` {`T[]`} - \n\n * `_getRowHeight` - \n\n * `_handleSelectAllChange` - \n\n * `selectColumnConfig` {`ColumnSettings<T>`} - \n\n * `data` {`T[]`} - \n\n * `select` {`\"none\" | \"multi\" | \"single\"`} - \n\n * `sort` {`\"multi\" | \"single\"`} - \n\n * `rowHeight` {`number`} - Needed for virtualization\n\n * `pagination` {`PaginationProps | undefined`} - \n\n * `columns` {`ColumnSettings<T>[]`} - \n\n * `sortOrder` {`string[]`} - ",
|
|
2078
2078
|
"attributes": [
|
|
2079
2079
|
{
|
|
2080
2080
|
"name": "fontSize",
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,10 @@ declare const module: {
|
|
|
23
23
|
label: string;
|
|
24
24
|
value: string;
|
|
25
25
|
};
|
|
26
|
+
GeospatialOperators: Record<string, {
|
|
27
|
+
label?: string;
|
|
28
|
+
value: string;
|
|
29
|
+
}>;
|
|
26
30
|
SpectricQuery: typeof components.SpectricQuery;
|
|
27
31
|
nodeTypes: import('./components/query_bar/querylanguage/kuery').NodeTypes;
|
|
28
32
|
SpectricPanel: typeof components.SpectricPanel;
|