apex-grid 1.0.0-rc.0
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/LICENSE +0 -0
- package/README.md +16 -0
- package/dist/bundle.js +2069 -0
- package/dist/docs/.nojekyll +1 -0
- package/dist/docs/assets/highlight.css +22 -0
- package/dist/docs/assets/main.js +54 -0
- package/dist/docs/assets/search.js +1 -0
- package/dist/docs/assets/style.css +1257 -0
- package/dist/docs/classes/ApexGrid.html +240 -0
- package/dist/docs/index.html +79 -0
- package/dist/docs/interfaces/ApexCellContext.html +92 -0
- package/dist/docs/interfaces/ApexFilteringEvent.html +78 -0
- package/dist/docs/interfaces/ApexGridEventMap.html +101 -0
- package/dist/docs/interfaces/ApexHeaderContext.html +78 -0
- package/dist/docs/interfaces/ColumnConfiguration.html +168 -0
- package/dist/docs/interfaces/ColumnFilterConfiguration.html +76 -0
- package/dist/docs/interfaces/ColumnSortConfiguration.html +93 -0
- package/dist/docs/interfaces/FilterExpression.html +97 -0
- package/dist/docs/interfaces/GridRemoteConfig.html +78 -0
- package/dist/docs/interfaces/GridSortConfiguration.html +73 -0
- package/dist/docs/interfaces/SortExpression.html +111 -0
- package/dist/docs/modules.html +89 -0
- package/dist/docs/types/DataType.html +63 -0
- package/dist/docs/types/FilterCriteria.html +63 -0
- package/dist/docs/types/Keys.html +68 -0
- package/dist/docs/types/RemoteFilterHook.html +84 -0
- package/dist/docs/types/RemoteSortHook.html +84 -0
- package/dist/docs/types/SortState.html +68 -0
- package/dist/docs/types/SortingDirection.html +65 -0
- package/dist/docs/types/Values.html +68 -0
- package/dist/src/components/cell.d.ts +19 -0
- package/dist/src/components/cell.d.ts.map +1 -0
- package/dist/src/components/cell.js +45 -0
- package/dist/src/components/cell.js.map +1 -0
- package/dist/src/components/filter-row.d.ts +47 -0
- package/dist/src/components/filter-row.d.ts.map +1 -0
- package/dist/src/components/filter-row.js +307 -0
- package/dist/src/components/filter-row.js.map +1 -0
- package/dist/src/components/grid-body.d.ts +12 -0
- package/dist/src/components/grid-body.d.ts.map +1 -0
- package/dist/src/components/grid-body.js +27 -0
- package/dist/src/components/grid-body.js.map +1 -0
- package/dist/src/components/grid.d.ts +183 -0
- package/dist/src/components/grid.d.ts.map +1 -0
- package/dist/src/components/grid.js +303 -0
- package/dist/src/components/grid.js.map +1 -0
- package/dist/src/components/header-row.d.ts +23 -0
- package/dist/src/components/header-row.d.ts.map +1 -0
- package/dist/src/components/header-row.js +77 -0
- package/dist/src/components/header-row.js.map +1 -0
- package/dist/src/components/header.d.ts +23 -0
- package/dist/src/components/header.d.ts.map +1 -0
- package/dist/src/components/header.js +143 -0
- package/dist/src/components/header.js.map +1 -0
- package/dist/src/components/row.d.ts +21 -0
- package/dist/src/components/row.d.ts.map +1 -0
- package/dist/src/components/row.js +64 -0
- package/dist/src/components/row.js.map +1 -0
- package/dist/src/controllers/data-operation.d.ts +18 -0
- package/dist/src/controllers/data-operation.d.ts.map +1 -0
- package/dist/src/controllers/data-operation.js +37 -0
- package/dist/src/controllers/data-operation.js.map +1 -0
- package/dist/src/controllers/dom.d.ts +17 -0
- package/dist/src/controllers/dom.d.ts.map +1 -0
- package/dist/src/controllers/dom.js +31 -0
- package/dist/src/controllers/dom.js.map +1 -0
- package/dist/src/controllers/filter.d.ts +22 -0
- package/dist/src/controllers/filter.d.ts.map +1 -0
- package/dist/src/controllers/filter.js +79 -0
- package/dist/src/controllers/filter.js.map +1 -0
- package/dist/src/controllers/navigation.d.ts +31 -0
- package/dist/src/controllers/navigation.d.ts.map +1 -0
- package/dist/src/controllers/navigation.js +88 -0
- package/dist/src/controllers/navigation.js.map +1 -0
- package/dist/src/controllers/resize.d.ts +28 -0
- package/dist/src/controllers/resize.d.ts.map +1 -0
- package/dist/src/controllers/resize.js +70 -0
- package/dist/src/controllers/resize.js.map +1 -0
- package/dist/src/controllers/sort.d.ts +16 -0
- package/dist/src/controllers/sort.d.ts.map +1 -0
- package/dist/src/controllers/sort.js +90 -0
- package/dist/src/controllers/sort.js.map +1 -0
- package/dist/src/controllers/state.d.ts +22 -0
- package/dist/src/controllers/state.d.ts.map +1 -0
- package/dist/src/controllers/state.js +27 -0
- package/dist/src/controllers/state.js.map +1 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +8 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/internal/constants.d.ts +9 -0
- package/dist/src/internal/constants.d.ts.map +1 -0
- package/dist/src/internal/constants.js +19 -0
- package/dist/src/internal/constants.js.map +1 -0
- package/dist/src/internal/icon-registry.d.ts +2 -0
- package/dist/src/internal/icon-registry.d.ts.map +1 -0
- package/dist/src/internal/icon-registry.js +29 -0
- package/dist/src/internal/icon-registry.js.map +1 -0
- package/dist/src/internal/is-defined.d.ts +2 -0
- package/dist/src/internal/is-defined.d.ts.map +1 -0
- package/dist/src/internal/is-defined.js +4 -0
- package/dist/src/internal/is-defined.js.map +1 -0
- package/dist/src/internal/mixins/event-emitter.d.ts +8 -0
- package/dist/src/internal/mixins/event-emitter.d.ts.map +1 -0
- package/dist/src/internal/mixins/event-emitter.js +18 -0
- package/dist/src/internal/mixins/event-emitter.js.map +1 -0
- package/dist/src/internal/normalize-case.d.ts +2 -0
- package/dist/src/internal/normalize-case.d.ts.map +1 -0
- package/dist/src/internal/normalize-case.js +4 -0
- package/dist/src/internal/normalize-case.js.map +1 -0
- package/dist/src/internal/part-map.d.ts +5 -0
- package/dist/src/internal/part-map.d.ts.map +1 -0
- package/dist/src/internal/part-map.js +6 -0
- package/dist/src/internal/part-map.js.map +1 -0
- package/dist/src/internal/tags.d.ts +8 -0
- package/dist/src/internal/tags.d.ts.map +1 -0
- package/dist/src/internal/tags.js +8 -0
- package/dist/src/internal/tags.js.map +1 -0
- package/dist/src/internal/types.d.ts +181 -0
- package/dist/src/internal/types.d.ts.map +1 -0
- package/dist/src/internal/types.js +2 -0
- package/dist/src/internal/types.js.map +1 -0
- package/dist/src/internal/utils.d.ts +10 -0
- package/dist/src/internal/utils.d.ts.map +1 -0
- package/dist/src/internal/utils.js +37 -0
- package/dist/src/internal/utils.js.map +1 -0
- package/dist/src/internal/watch.d.ts +6 -0
- package/dist/src/internal/watch.d.ts.map +1 -0
- package/dist/src/internal/watch.js +19 -0
- package/dist/src/internal/watch.js.map +1 -0
- package/dist/src/operations/base.d.ts +7 -0
- package/dist/src/operations/base.d.ts.map +1 -0
- package/dist/src/operations/base.js +11 -0
- package/dist/src/operations/base.js.map +1 -0
- package/dist/src/operations/filter/operands/base.d.ts +8 -0
- package/dist/src/operations/filter/operands/base.d.ts.map +1 -0
- package/dist/src/operations/filter/operands/base.js +15 -0
- package/dist/src/operations/filter/operands/base.js.map +1 -0
- package/dist/src/operations/filter/operands/boolean.d.ts +11 -0
- package/dist/src/operations/filter/operands/boolean.d.ts.map +1 -0
- package/dist/src/operations/filter/operands/boolean.js +36 -0
- package/dist/src/operations/filter/operands/boolean.js.map +1 -0
- package/dist/src/operations/filter/operands/number.d.ts +14 -0
- package/dist/src/operations/filter/operands/number.d.ts.map +1 -0
- package/dist/src/operations/filter/operands/number.js +51 -0
- package/dist/src/operations/filter/operands/number.js.map +1 -0
- package/dist/src/operations/filter/operands/string.d.ts +14 -0
- package/dist/src/operations/filter/operands/string.d.ts.map +1 -0
- package/dist/src/operations/filter/operands/string.js +52 -0
- package/dist/src/operations/filter/operands/string.js.map +1 -0
- package/dist/src/operations/filter/state.d.ts +17 -0
- package/dist/src/operations/filter/state.d.ts.map +1 -0
- package/dist/src/operations/filter/state.js +42 -0
- package/dist/src/operations/filter/state.js.map +1 -0
- package/dist/src/operations/filter/tree.d.ts +17 -0
- package/dist/src/operations/filter/tree.d.ts.map +1 -0
- package/dist/src/operations/filter/tree.js +44 -0
- package/dist/src/operations/filter/tree.js.map +1 -0
- package/dist/src/operations/filter/types.d.ts +44 -0
- package/dist/src/operations/filter/types.d.ts.map +1 -0
- package/dist/src/operations/filter/types.js +2 -0
- package/dist/src/operations/filter/types.js.map +1 -0
- package/dist/src/operations/filter.d.ts +9 -0
- package/dist/src/operations/filter.d.ts.map +1 -0
- package/dist/src/operations/filter.js +22 -0
- package/dist/src/operations/filter.js.map +1 -0
- package/dist/src/operations/sort/types.d.ts +38 -0
- package/dist/src/operations/sort/types.d.ts.map +1 -0
- package/dist/src/operations/sort/types.js +2 -0
- package/dist/src/operations/sort/types.js.map +1 -0
- package/dist/src/operations/sort.d.ts +10 -0
- package/dist/src/operations/sort.d.ts.map +1 -0
- package/dist/src/operations/sort.js +37 -0
- package/dist/src/operations/sort.js.map +1 -0
- package/dist/src/styles/body-cell/body-cell-styles.d.ts +3 -0
- package/dist/src/styles/body-cell/body-cell-styles.d.ts.map +1 -0
- package/dist/src/styles/body-cell/body-cell-styles.js +70 -0
- package/dist/src/styles/body-cell/body-cell-styles.js.map +1 -0
- package/dist/src/styles/body-row/body-row-styles.d.ts +3 -0
- package/dist/src/styles/body-row/body-row-styles.d.ts.map +1 -0
- package/dist/src/styles/body-row/body-row-styles.js +38 -0
- package/dist/src/styles/body-row/body-row-styles.js.map +1 -0
- package/dist/src/styles/filter-row/filter-row-styles.d.ts +3 -0
- package/dist/src/styles/filter-row/filter-row-styles.d.ts.map +1 -0
- package/dist/src/styles/filter-row/filter-row-styles.js +96 -0
- package/dist/src/styles/filter-row/filter-row-styles.js.map +1 -0
- package/dist/src/styles/grid/themes/light/grid.bootstrap-styles.d.ts +3 -0
- package/dist/src/styles/grid/themes/light/grid.bootstrap-styles.d.ts.map +1 -0
- package/dist/src/styles/grid/themes/light/grid.bootstrap-styles.js +82 -0
- package/dist/src/styles/grid/themes/light/grid.bootstrap-styles.js.map +1 -0
- package/dist/src/styles/grid/themes/light/grid.fluent-styles.d.ts +3 -0
- package/dist/src/styles/grid/themes/light/grid.fluent-styles.d.ts.map +1 -0
- package/dist/src/styles/grid/themes/light/grid.fluent-styles.js +82 -0
- package/dist/src/styles/grid/themes/light/grid.fluent-styles.js.map +1 -0
- package/dist/src/styles/grid/themes/light/grid.indigo-styles.d.ts +3 -0
- package/dist/src/styles/grid/themes/light/grid.indigo-styles.d.ts.map +1 -0
- package/dist/src/styles/grid/themes/light/grid.indigo-styles.js +82 -0
- package/dist/src/styles/grid/themes/light/grid.indigo-styles.js.map +1 -0
- package/dist/src/styles/grid/themes/light/grid.material-styles.d.ts +3 -0
- package/dist/src/styles/grid/themes/light/grid.material-styles.d.ts.map +1 -0
- package/dist/src/styles/grid/themes/light/grid.material-styles.js +82 -0
- package/dist/src/styles/grid/themes/light/grid.material-styles.js.map +1 -0
- package/dist/src/styles/header-cell/header-cell-styles.d.ts +3 -0
- package/dist/src/styles/header-cell/header-cell-styles.d.ts.map +1 -0
- package/dist/src/styles/header-cell/header-cell-styles.js +141 -0
- package/dist/src/styles/header-cell/header-cell-styles.js.map +1 -0
- package/dist/src/styles/header-row/header-row.base-styles.d.ts +3 -0
- package/dist/src/styles/header-row/header-row.base-styles.d.ts.map +1 -0
- package/dist/src/styles/header-row/header-row.base-styles.js +35 -0
- package/dist/src/styles/header-row/header-row.base-styles.js.map +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { NAVIGATION_STATE, SENTINEL_NODE } from '../internal/constants.js';
|
|
2
|
+
export class NavigationController {
|
|
3
|
+
get nextNode() {
|
|
4
|
+
const node = this.state.get('current');
|
|
5
|
+
return node === SENTINEL_NODE
|
|
6
|
+
? { column: this.firstColumn, row: 0 }
|
|
7
|
+
: { ...node };
|
|
8
|
+
}
|
|
9
|
+
get columns() {
|
|
10
|
+
return this.host.columns;
|
|
11
|
+
}
|
|
12
|
+
get firstColumn() {
|
|
13
|
+
var _a;
|
|
14
|
+
return (_a = this.host.getColumn(0).key) !== null && _a !== void 0 ? _a : '';
|
|
15
|
+
}
|
|
16
|
+
getPreviousColumn(key) {
|
|
17
|
+
return this.columns[Math.max(this.columns.indexOf(this.host.getColumn(key)) - 1, 0)].key;
|
|
18
|
+
}
|
|
19
|
+
getNextColumn(key) {
|
|
20
|
+
return this.columns[Math.min(this.columns.indexOf(this.host.getColumn(key)) + 1, this.columns.length - 1)].key;
|
|
21
|
+
}
|
|
22
|
+
get active() {
|
|
23
|
+
return this._active;
|
|
24
|
+
}
|
|
25
|
+
set active(node) {
|
|
26
|
+
this._active = node;
|
|
27
|
+
this.state.set('previous', this._active);
|
|
28
|
+
this.state.set('current', node);
|
|
29
|
+
this.host.requestUpdate();
|
|
30
|
+
}
|
|
31
|
+
constructor(host) {
|
|
32
|
+
this.host = host;
|
|
33
|
+
this.handlers = new Map(Object.entries({
|
|
34
|
+
ArrowDown: this.arrowDown,
|
|
35
|
+
ArrowUp: this.arrowUp,
|
|
36
|
+
ArrowLeft: this.arrowLeft,
|
|
37
|
+
ArrowRight: this.arrowRight,
|
|
38
|
+
Home: this.home,
|
|
39
|
+
End: this.end,
|
|
40
|
+
}));
|
|
41
|
+
this.state = NAVIGATION_STATE;
|
|
42
|
+
this._active = SENTINEL_NODE;
|
|
43
|
+
this.host.addController(this);
|
|
44
|
+
}
|
|
45
|
+
isNotSentinel(node) {
|
|
46
|
+
return node !== SENTINEL_NODE;
|
|
47
|
+
}
|
|
48
|
+
home(container) {
|
|
49
|
+
this.active = Object.assign(this.nextNode, { row: 0 });
|
|
50
|
+
container.scrollToIndex(this.active.row, 'center');
|
|
51
|
+
}
|
|
52
|
+
end(container) {
|
|
53
|
+
this.active = Object.assign(this.nextNode, { row: this.host.totalItems - 1 });
|
|
54
|
+
container.scrollToIndex(this.active.row, 'center');
|
|
55
|
+
}
|
|
56
|
+
arrowDown(container) {
|
|
57
|
+
const next = this.nextNode;
|
|
58
|
+
this.active = Object.assign(this.nextNode, {
|
|
59
|
+
row: Math.min(next.row + 1, this.host.totalItems - 1),
|
|
60
|
+
});
|
|
61
|
+
container.scrollToIndex(next.row, 'center');
|
|
62
|
+
}
|
|
63
|
+
arrowUp(container) {
|
|
64
|
+
const next = this.nextNode;
|
|
65
|
+
this.active = Object.assign(next, { row: Math.max(0, next.row - 1) });
|
|
66
|
+
container.scrollToIndex(next.row, 'center');
|
|
67
|
+
}
|
|
68
|
+
arrowLeft() {
|
|
69
|
+
const next = this.nextNode;
|
|
70
|
+
this.active = Object.assign(next, { column: this.getPreviousColumn(next.column) });
|
|
71
|
+
}
|
|
72
|
+
arrowRight() {
|
|
73
|
+
const next = this.nextNode;
|
|
74
|
+
this.active = Object.assign(next, { column: this.getNextColumn(next.column) });
|
|
75
|
+
}
|
|
76
|
+
hostConnected() { }
|
|
77
|
+
hostDisconnected() {
|
|
78
|
+
this.active = SENTINEL_NODE;
|
|
79
|
+
this.state = NAVIGATION_STATE;
|
|
80
|
+
}
|
|
81
|
+
navigate(event, container) {
|
|
82
|
+
if (this.handlers.has(event.key)) {
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
this.handlers.get(event.key).call(this, container);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=navigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../src/controllers/navigation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI3E,MAAM,OAAO,oBAAoB;IAe/B,IAAc,QAAQ;QACpB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAE,CAAC;QACxC,OAAO,IAAI,KAAK,aAAa;YAC3B,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE;YACtC,CAAC,CAAE,EAAE,GAAG,IAAI,EAAoB,CAAC;IACrC,CAAC;IAED,IAAc,OAAO;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAED,IAAc,WAAW;;QACvB,OAAO,MAAA,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CA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Body from '../components/grid-body.js';\nimport type { ActiveNode, GridHost, Keys } from '../internal/types.js';\n\nexport class NavigationController<T extends object> implements ReactiveController {\n protected handlers = new Map(\n Object.entries({\n ArrowDown: this.arrowDown,\n ArrowUp: this.arrowUp,\n ArrowLeft: this.arrowLeft,\n ArrowRight: this.arrowRight,\n Home: this.home,\n End: this.end,\n }),\n );\n\n protected state = NAVIGATION_STATE;\n protected _active = SENTINEL_NODE;\n\n protected get nextNode() {\n const node = this.state.get('current')!;\n return node === SENTINEL_NODE\n ? { column: this.firstColumn, row: 0 }\n : ({ ...node } as ActiveNode<T>);\n }\n\n protected get columns() {\n return this.host.columns;\n }\n\n protected get firstColumn() {\n return this.host.getColumn(0)!.key ?? '';\n }\n\n protected getPreviousColumn(key: Keys<T>) {\n return this.columns[Math.max(this.columns.indexOf(this.host.getColumn(key)!) - 1, 0)].key;\n }\n\n protected getNextColumn(key: Keys<T>) {\n return this.columns[\n Math.min(this.columns.indexOf(this.host.getColumn(key)!) + 1, this.columns.length - 1)\n ].key;\n }\n\n public get active() {\n return this._active as ActiveNode<T>;\n }\n\n public set active(node: ActiveNode<T>) {\n this._active = node;\n this.state.set('previous', this._active);\n this.state.set('current', node);\n this.host.requestUpdate();\n }\n\n constructor(protected host: GridHost<T>) {\n this.host.addController(this);\n }\n\n protected isNotSentinel(node: ActiveNode<T>) {\n return node !== SENTINEL_NODE;\n }\n\n protected home(container: ApexGridBody) {\n this.active = Object.assign(this.nextNode, { row: 0 });\n container.scrollToIndex(this.active.row, 'center');\n }\n\n protected end(container: ApexGridBody) {\n this.active = Object.assign(this.nextNode, { row: this.host.totalItems - 1 });\n container.scrollToIndex(this.active.row, 'center');\n }\n\n protected arrowDown(container: ApexGridBody) {\n const next = this.nextNode;\n\n this.active = Object.assign(this.nextNode, {\n row: Math.min(next.row + 1, this.host.totalItems - 1),\n });\n container.scrollToIndex(next.row, 'center');\n }\n\n protected arrowUp(container: ApexGridBody) {\n const next = this.nextNode;\n this.active = Object.assign(next, { row: Math.max(0, next.row - 1) });\n container.scrollToIndex(next.row, 'center');\n }\n\n protected arrowLeft() {\n const next = this.nextNode;\n this.active = Object.assign(next, { column: this.getPreviousColumn(next.column) });\n }\n\n protected arrowRight() {\n const next = this.nextNode;\n this.active = Object.assign(next, { column: this.getNextColumn(next.column) });\n }\n\n public hostConnected() {}\n\n public hostDisconnected() {\n this.active = SENTINEL_NODE as ActiveNode<T>;\n this.state = NAVIGATION_STATE;\n }\n\n public navigate(event: KeyboardEvent, container: ApexGridBody) {\n if (this.handlers.has(event.key)) {\n event.preventDefault();\n this.handlers.get(event.key)!.call(this, container);\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { nothing, ReactiveController } from 'lit';
|
|
2
|
+
import ApexGridHeader from '../components/header.js';
|
|
3
|
+
import type { ColumnConfiguration, GridHost } from '../internal/types.js';
|
|
4
|
+
export declare class ResizeController<T extends object> implements ReactiveController {
|
|
5
|
+
#private;
|
|
6
|
+
protected host: GridHost<T>;
|
|
7
|
+
constructor(host: GridHost<T>);
|
|
8
|
+
indicatorActive: boolean;
|
|
9
|
+
indicatorOffset: number;
|
|
10
|
+
/**
|
|
11
|
+
* Begins resizing a column by showing and positioning the resize indicator in relation to the column.
|
|
12
|
+
*
|
|
13
|
+
* @param header the
|
|
14
|
+
*/
|
|
15
|
+
start(header: ApexGridHeader<T>): void;
|
|
16
|
+
/**
|
|
17
|
+
* Stops and resets the resizing state.
|
|
18
|
+
*/
|
|
19
|
+
stop(): void;
|
|
20
|
+
resize(column: ColumnConfiguration<T>, width: number, sizerOffset?: number): void;
|
|
21
|
+
autosize(column: ColumnConfiguration<T>, header: ApexGridHeader<T>): Promise<void>;
|
|
22
|
+
hostConnected(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Renders the resize indicator in the grid.
|
|
25
|
+
*/
|
|
26
|
+
renderIndicator(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=resize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize.d.ts","sourceRoot":"","sources":["../../../src/controllers/resize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAExD,OAAO,cAAc,MAAM,yBAAyB,CAAC;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAQ,MAAM,sBAAsB,CAAC;AAEhF,qBAAa,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAE,YAAW,kBAAkB;;IAC/D,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;gBAAjB,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAIhC,eAAe,UAAS;IACxB,eAAe,SAAK;IAU3B;;;;OAIG;IACI,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;IAMtC;;OAEG;IACI,IAAI;IAKJ,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;IASpE,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;IAUxE,aAAa;IAEpB;;OAEG;IACI,eAAe;CAUvB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _ResizeController_instances, _ResizeController_maxSize;
|
|
7
|
+
import { html, nothing } from 'lit';
|
|
8
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
9
|
+
import { MIN_COL_RESIZE_WIDTH } from '../internal/constants.js';
|
|
10
|
+
export class ResizeController {
|
|
11
|
+
constructor(host) {
|
|
12
|
+
this.host = host;
|
|
13
|
+
_ResizeController_instances.add(this);
|
|
14
|
+
this.indicatorActive = false;
|
|
15
|
+
this.indicatorOffset = 0;
|
|
16
|
+
this.host.addController(this);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Begins resizing a column by showing and positioning the resize indicator in relation to the column.
|
|
20
|
+
*
|
|
21
|
+
* @param header the
|
|
22
|
+
*/
|
|
23
|
+
start(header) {
|
|
24
|
+
this.indicatorActive = true;
|
|
25
|
+
this.indicatorOffset = header.offsetLeft + header.offsetWidth;
|
|
26
|
+
this.host.requestUpdate();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Stops and resets the resizing state.
|
|
30
|
+
*/
|
|
31
|
+
stop() {
|
|
32
|
+
this.indicatorActive = false;
|
|
33
|
+
this.host.requestUpdate();
|
|
34
|
+
}
|
|
35
|
+
resize(column, width, sizerOffset) {
|
|
36
|
+
if (sizerOffset) {
|
|
37
|
+
this.indicatorOffset = sizerOffset;
|
|
38
|
+
}
|
|
39
|
+
column.width = `${width}px`;
|
|
40
|
+
this.host.requestUpdate();
|
|
41
|
+
}
|
|
42
|
+
async autosize(column, header) {
|
|
43
|
+
column.width = `max-content`;
|
|
44
|
+
this.host.requestUpdate();
|
|
45
|
+
await this.host.updateComplete;
|
|
46
|
+
column.width = `${__classPrivateFieldGet(this, _ResizeController_instances, "m", _ResizeController_maxSize).call(this, column.key, header.offsetWidth)}px`;
|
|
47
|
+
this.host.requestUpdate();
|
|
48
|
+
}
|
|
49
|
+
hostConnected() { }
|
|
50
|
+
/**
|
|
51
|
+
* Renders the resize indicator in the grid.
|
|
52
|
+
*/
|
|
53
|
+
renderIndicator() {
|
|
54
|
+
return this.indicatorActive
|
|
55
|
+
? html `<div
|
|
56
|
+
part="resize-indicator"
|
|
57
|
+
style=${styleMap({
|
|
58
|
+
transform: `translateX(${this.indicatorOffset}px)`,
|
|
59
|
+
})}
|
|
60
|
+
></div>`
|
|
61
|
+
: nothing;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
_ResizeController_instances = new WeakSet(), _ResizeController_maxSize = function _ResizeController_maxSize(key, headerWidth) {
|
|
65
|
+
const max = this.host.rows
|
|
66
|
+
.map(row => row.cells.find(cell => cell.column.key === key))
|
|
67
|
+
.reduce((prev, current) => (current.offsetWidth > prev ? current.offsetWidth : prev), 0);
|
|
68
|
+
return Math.max(...[MIN_COL_RESIZE_WIDTH, max, headerWidth]);
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=resize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize.js","sourceRoot":"","sources":["../../../src/controllers/resize.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAsB,MAAM,KAAK,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,MAAM,OAAO,gBAAgB;IAC3B,YAAsB,IAAiB;QAAjB,SAAI,GAAJ,IAAI,CAAa;;QAIhC,oBAAe,GAAG,KAAK,CAAC;QACxB,oBAAe,GAAG,CAAC,CAAC;QAJzB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAaD;;;;OAIG;IACI,KAAK,CAAC,MAAyB;QACpC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;QAC9D,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACI,IAAI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,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3F,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,oBAAoB,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["import { html, nothing, ReactiveController } from 'lit';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport ApexGridHeader from '../components/header.js';\nimport { MIN_COL_RESIZE_WIDTH } from '../internal/constants.js';\nimport type { ColumnConfiguration, GridHost, Keys } from '../internal/types.js';\n\nexport class ResizeController<T extends object> implements ReactiveController {\n constructor(protected host: GridHost<T>) {\n this.host.addController(this);\n }\n\n public indicatorActive = false;\n public indicatorOffset = 0;\n\n #maxSize(key: Keys<T>, headerWidth: number) {\n const max = this.host.rows\n .map(row => row.cells.find(cell => cell.column.key === key)!)\n .reduce((prev, current) => (current.offsetWidth > prev ? current.offsetWidth : prev), 0);\n\n return Math.max(...[MIN_COL_RESIZE_WIDTH, max, headerWidth]);\n }\n\n /**\n * Begins resizing a column by showing and positioning the resize indicator in relation to the column.\n *\n * @param header the\n */\n public start(header: ApexGridHeader<T>) {\n this.indicatorActive = true;\n this.indicatorOffset = header.offsetLeft + header.offsetWidth;\n this.host.requestUpdate();\n }\n\n /**\n * Stops and resets the resizing state.\n */\n public stop() {\n this.indicatorActive = false;\n this.host.requestUpdate();\n }\n\n public resize(column: ColumnConfiguration<T>, width: number, sizerOffset?: number) {\n if (sizerOffset) {\n this.indicatorOffset = sizerOffset;\n }\n\n column.width = `${width}px`;\n this.host.requestUpdate();\n }\n\n public async autosize(column: ColumnConfiguration<T>, header: ApexGridHeader<T>) {\n column.width = `max-content`;\n\n this.host.requestUpdate();\n await this.host.updateComplete;\n\n column.width = `${this.#maxSize(column.key, header.offsetWidth)}px`;\n this.host.requestUpdate();\n }\n\n public hostConnected() {}\n\n /**\n * Renders the resize indicator in the grid.\n */\n public renderIndicator() {\n return this.indicatorActive\n ? html`<div\n part=\"resize-indicator\"\n style=${styleMap({\n transform: `translateX(${this.indicatorOffset}px)`,\n })}\n ></div>`\n : nothing;\n }\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactiveController } from 'lit';
|
|
2
|
+
import type { ColumnConfiguration, GridHost, Keys } from '../internal/types.js';
|
|
3
|
+
import type { SortExpression, SortState } from '../operations/sort/types.js';
|
|
4
|
+
export declare class SortController<T extends object> implements ReactiveController {
|
|
5
|
+
#private;
|
|
6
|
+
protected host: GridHost<T>;
|
|
7
|
+
constructor(host: GridHost<T>);
|
|
8
|
+
state: SortState<T>;
|
|
9
|
+
sortFromHeaderClick(column: ColumnConfiguration<T>): Promise<void>;
|
|
10
|
+
prepareExpression({ key, sort: options }: ColumnConfiguration<T>): SortExpression<T>;
|
|
11
|
+
reset(key?: Keys<T>): void;
|
|
12
|
+
protected _sort(expressions: SortExpression<T> | SortExpression<T>[]): void;
|
|
13
|
+
sort(expressions: SortExpression<T> | SortExpression<T>[]): void;
|
|
14
|
+
hostConnected(): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=sort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../../src/controllers/sort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAGzC,OAAO,KAAK,EACV,mBAAmB,EAEnB,QAAQ,EACR,IAAI,EACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAoB,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAE/F,qBAAa,cAAc,CAAC,CAAC,SAAS,MAAM,CAAE,YAAW,kBAAkB;;IAC7D,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;gBAAjB,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAIhC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAa;IAoD1B,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAsBxD,iBAAiB,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC;IAcpF,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IAI1B,SAAS,CAAC,KAAK,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE;IAK7D,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE;IAQzD,aAAa;CACrB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _SortController_instances, _SortController_isMultipleSort_get, _SortController_isTriStateSort_get, _SortController_resolveSortOptions, _SortController_createDefaultExpression, _SortController_orderBy, _SortController_emitSortingEvent, _SortController_emitSortedEvent;
|
|
7
|
+
import { PIPELINE } from '../internal/constants.js';
|
|
8
|
+
import { asArray } from '../internal/utils.js';
|
|
9
|
+
export class SortController {
|
|
10
|
+
constructor(host) {
|
|
11
|
+
this.host = host;
|
|
12
|
+
_SortController_instances.add(this);
|
|
13
|
+
this.state = new Map();
|
|
14
|
+
this.host.addController(this);
|
|
15
|
+
}
|
|
16
|
+
async sortFromHeaderClick(column) {
|
|
17
|
+
const expression = this.prepareExpression(column);
|
|
18
|
+
if (!__classPrivateFieldGet(this, _SortController_instances, "m", _SortController_emitSortingEvent).call(this, expression)) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (!__classPrivateFieldGet(this, _SortController_instances, "a", _SortController_isMultipleSort_get)) {
|
|
22
|
+
this.reset();
|
|
23
|
+
}
|
|
24
|
+
if (expression.direction == 'none') {
|
|
25
|
+
this.reset(expression.key);
|
|
26
|
+
this.host.requestUpdate(PIPELINE);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this._sort(expression);
|
|
30
|
+
}
|
|
31
|
+
await this.host.updateComplete;
|
|
32
|
+
__classPrivateFieldGet(this, _SortController_instances, "m", _SortController_emitSortedEvent).call(this, expression);
|
|
33
|
+
}
|
|
34
|
+
prepareExpression({ key, sort: options }) {
|
|
35
|
+
if (this.state.has(key)) {
|
|
36
|
+
const expr = this.state.get(key);
|
|
37
|
+
return Object.assign(expr, {
|
|
38
|
+
direction: __classPrivateFieldGet(this, _SortController_instances, "m", _SortController_orderBy).call(this, expr.direction),
|
|
39
|
+
...__classPrivateFieldGet(this, _SortController_instances, "m", _SortController_resolveSortOptions).call(this, options),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
// Initial state
|
|
43
|
+
return __classPrivateFieldGet(this, _SortController_instances, "m", _SortController_createDefaultExpression).call(this, key);
|
|
44
|
+
}
|
|
45
|
+
reset(key) {
|
|
46
|
+
key ? this.state.delete(key) : this.state.clear();
|
|
47
|
+
}
|
|
48
|
+
_sort(expressions) {
|
|
49
|
+
asArray(expressions).forEach(expr => this.state.set(expr.key, { ...expr }));
|
|
50
|
+
this.host.requestUpdate(PIPELINE);
|
|
51
|
+
}
|
|
52
|
+
sort(expressions) {
|
|
53
|
+
this._sort(asArray(expressions).map(expr => { var _a; return Object.assign((_a = this.state.get(expr.key)) !== null && _a !== void 0 ? _a : __classPrivateFieldGet(this, _SortController_instances, "m", _SortController_createDefaultExpression).call(this, expr.key), expr); }));
|
|
54
|
+
}
|
|
55
|
+
hostConnected() { }
|
|
56
|
+
}
|
|
57
|
+
_SortController_instances = new WeakSet(), _SortController_isMultipleSort_get = function _SortController_isMultipleSort_get() {
|
|
58
|
+
return this.host.sortConfiguration.multiple;
|
|
59
|
+
}, _SortController_isTriStateSort_get = function _SortController_isTriStateSort_get() {
|
|
60
|
+
return this.host.sortConfiguration.triState;
|
|
61
|
+
}, _SortController_resolveSortOptions = function _SortController_resolveSortOptions(options) {
|
|
62
|
+
const guard = (obj) => obj !== undefined && typeof obj !== 'boolean';
|
|
63
|
+
return {
|
|
64
|
+
caseSensitive: guard(options) ? options.caseSensitive : false,
|
|
65
|
+
comparer: guard(options) ? options.comparer : undefined,
|
|
66
|
+
};
|
|
67
|
+
}, _SortController_createDefaultExpression = function _SortController_createDefaultExpression(key) {
|
|
68
|
+
var _a;
|
|
69
|
+
const options = (_a = this.host.getColumn(key)) === null || _a === void 0 ? void 0 : _a.sort;
|
|
70
|
+
return {
|
|
71
|
+
key,
|
|
72
|
+
direction: 'ascending',
|
|
73
|
+
...__classPrivateFieldGet(this, _SortController_instances, "m", _SortController_resolveSortOptions).call(this, options),
|
|
74
|
+
};
|
|
75
|
+
}, _SortController_orderBy = function _SortController_orderBy(dir) {
|
|
76
|
+
return __classPrivateFieldGet(this, _SortController_instances, "a", _SortController_isTriStateSort_get)
|
|
77
|
+
? dir === 'ascending'
|
|
78
|
+
? 'descending'
|
|
79
|
+
: dir === 'descending'
|
|
80
|
+
? 'none'
|
|
81
|
+
: 'ascending'
|
|
82
|
+
: dir === 'ascending'
|
|
83
|
+
? 'descending'
|
|
84
|
+
: 'ascending';
|
|
85
|
+
}, _SortController_emitSortingEvent = function _SortController_emitSortingEvent(detail) {
|
|
86
|
+
return this.host.emitEvent('sorting', { detail, cancelable: true });
|
|
87
|
+
}, _SortController_emitSortedEvent = function _SortController_emitSortedEvent(detail) {
|
|
88
|
+
return this.host.emitEvent('sorted', { detail });
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=sort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort.js","sourceRoot":"","sources":["../../../src/controllers/sort.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAS/C,MAAM,OAAO,cAAc;IACzB,YAAsB,IAAiB;QAAjB,SAAI,GAAJ,IAAI,CAAa;;QAIhC,UAAK,GAAiB,IAAI,GAAG,EAAE,CAAC;QAHrC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAsDM,KAAK,CAAC,mBAAmB,CAAC,MAA8B;QAC7D,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAElD,IAAI,CAAC,uBAAA,IAAI,mEAAkB,MAAtB,IAAI,EAAmB,UAAU,CAAC,EAAE;YACvC,OAAO;SACR;QAED,IAAI,CAAC,uBAAA,IAAI,qEAAgB,EAAE;YACzB,IAAI,CAAC,KAAK,EAAE,CAAC;SACd;QAED,IAAI,UAAU,CAAC,SAAS,IAAI,MAAM,EAAE;YAClC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YAC3B,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;SACnC;aAAM;YACL,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;SACxB;QAED,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;QAC/B,uBAAA,IAAI,kEAAiB,MAArB,IAAI,EAAkB,UAAU,CAAC,CAAC;IACpC,CAAC;IAEM,iBAAiB,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAA0B;QACrE,I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AAI,EAAE,CAAC,CAAC;AACtE,CAAC,6EAEgB,MAAyB;IACxC,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import { ReactiveController } from 'lit';\nimport { PIPELINE } from '../internal/constants.js';\nimport { asArray } from '../internal/utils.js';\nimport type {\n ColumnConfiguration,\n ColumnSortConfiguration,\n GridHost,\n Keys,\n} from '../internal/types.js';\nimport type { SortExpression, SortingDirection, SortState } from '../operations/sort/types.js';\n\nexport class SortController<T extends object> implements ReactiveController {\n constructor(protected host: GridHost<T>) {\n this.host.addController(this);\n }\n\n public state: SortState<T> = new Map();\n\n get #isMultipleSort() {\n return this.host.sortConfiguration.multiple;\n }\n\n get #isTriStateSort() {\n return this.host.sortConfiguration.triState;\n }\n\n #resolveSortOptions(\n options: boolean | undefined | ColumnSortConfiguration<T>,\n ): Partial<SortExpression<T>> {\n const guard = (\n obj: boolean | undefined | ColumnSortConfiguration<T>,\n ): obj is ColumnSortConfiguration<T> => obj !== undefined && typeof obj !== 'boolean';\n return {\n caseSensitive: guard(options) ? options.caseSensitive : false,\n comparer: guard(options) ? options.comparer : undefined,\n };\n }\n\n #createDefaultExpression(key: Keys<T>): SortExpression<T> {\n const options = this.host.getColumn(key)?.sort;\n\n return {\n key,\n direction: 'ascending',\n ...this.#resolveSortOptions(options),\n };\n }\n\n #orderBy(dir?: SortingDirection): SortingDirection {\n return this.#isTriStateSort\n ? dir === 'ascending'\n ? 'descending'\n : dir === 'descending'\n ? 'none'\n : 'ascending'\n : dir === 'ascending'\n ? 'descending'\n : 'ascending';\n }\n\n #emitSortingEvent(detail: SortExpression<T>) {\n return this.host.emitEvent('sorting', { detail, cancelable: true });\n }\n\n #emitSortedEvent(detail: SortExpression<T>) {\n return this.host.emitEvent('sorted', { detail });\n }\n\n public async sortFromHeaderClick(column: ColumnConfiguration<T>) {\n const expression = this.prepareExpression(column);\n\n if (!this.#emitSortingEvent(expression)) {\n return;\n }\n\n if (!this.#isMultipleSort) {\n this.reset();\n }\n\n if (expression.direction == 'none') {\n this.reset(expression.key);\n this.host.requestUpdate(PIPELINE);\n } else {\n this._sort(expression);\n }\n\n await this.host.updateComplete;\n this.#emitSortedEvent(expression);\n }\n\n public prepareExpression({ key, sort: options }: ColumnConfiguration<T>): SortExpression<T> {\n if (this.state.has(key)) {\n const expr = this.state.get(key)!;\n\n return Object.assign(expr, {\n direction: this.#orderBy(expr.direction),\n ...this.#resolveSortOptions(options),\n });\n }\n\n // Initial state\n return this.#createDefaultExpression(key);\n }\n\n public reset(key?: Keys<T>) {\n key ? this.state.delete(key) : this.state.clear();\n }\n\n protected _sort(expressions: SortExpression<T> | SortExpression<T>[]) {\n asArray(expressions).forEach(expr => this.state.set(expr.key, { ...expr }));\n this.host.requestUpdate(PIPELINE);\n }\n\n public sort(expressions: SortExpression<T> | SortExpression<T>[]) {\n this._sort(\n asArray(expressions).map(expr =>\n Object.assign(this.state.get(expr.key) ?? this.#createDefaultExpression(expr.key), expr),\n ),\n );\n }\n\n public hostConnected() {}\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactiveController } from 'lit';
|
|
2
|
+
import { FilterController } from './filter.js';
|
|
3
|
+
import { NavigationController } from './navigation.js';
|
|
4
|
+
import { SortController } from './sort.js';
|
|
5
|
+
import { ResizeController } from './resize.js';
|
|
6
|
+
import type { ActiveNode, GridHost } from '../internal/types.js';
|
|
7
|
+
export declare class StateController<T extends object> implements ReactiveController {
|
|
8
|
+
host: GridHost<T>;
|
|
9
|
+
sorting: SortController<T>;
|
|
10
|
+
filtering: FilterController<T>;
|
|
11
|
+
navigation: NavigationController<T>;
|
|
12
|
+
resizing: ResizeController<T>;
|
|
13
|
+
get active(): ActiveNode<T>;
|
|
14
|
+
set active(node: ActiveNode<T>);
|
|
15
|
+
constructor(host: GridHost<T>);
|
|
16
|
+
protected init(): void;
|
|
17
|
+
hostConnected(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare const gridStateContext: {
|
|
20
|
+
__context__: StateController<any>;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/controllers/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEjE,qBAAa,eAAe,CAAC,CAAC,SAAS,MAAM,CAAE,YAAW,kBAAkB;IAcvD,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAb7B,OAAO,EAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IAC5B,SAAS,EAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAChC,UAAU,EAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACrC,QAAQ,EAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAEtC,IAAW,MAAM,IAIO,UAAU,CAAC,CAAC,CAAC,CAFpC;IAED,IAAW,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,EAEpC;gBAEkB,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAKpC,SAAS,CAAC,IAAI;IAOP,aAAa;CACrB;AAED,eAAO,MAAM,gBAAgB;;CAA6D,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createContext } from '@lit-labs/context';
|
|
2
|
+
import { FilterController } from './filter.js';
|
|
3
|
+
import { NavigationController } from './navigation.js';
|
|
4
|
+
import { SortController } from './sort.js';
|
|
5
|
+
import { ResizeController } from './resize.js';
|
|
6
|
+
export class StateController {
|
|
7
|
+
get active() {
|
|
8
|
+
return this.navigation.active;
|
|
9
|
+
}
|
|
10
|
+
set active(node) {
|
|
11
|
+
this.navigation.active = node;
|
|
12
|
+
}
|
|
13
|
+
constructor(host) {
|
|
14
|
+
this.host = host;
|
|
15
|
+
this.host.addController(this);
|
|
16
|
+
this.init();
|
|
17
|
+
}
|
|
18
|
+
init() {
|
|
19
|
+
this.sorting = new SortController(this.host);
|
|
20
|
+
this.filtering = new FilterController(this.host);
|
|
21
|
+
this.navigation = new NavigationController(this.host);
|
|
22
|
+
this.resizing = new ResizeController(this.host);
|
|
23
|
+
}
|
|
24
|
+
hostConnected() { }
|
|
25
|
+
}
|
|
26
|
+
export const gridStateContext = createContext('gridStateController');
|
|
27
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/controllers/state.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,OAAO,eAAe;IAM1B,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IAChC,CAAC;IAED,IAAW,MAAM,CAAC,IAAmB;QACnC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC;IAChC,CAAC;IAED,YAAmB,IAAiB;QAAjB,SAAI,GAAJ,IAAI,CAAa;QAClC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAES,IAAI;QACZ,IAAI,CAAC,OAAO,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,SAAS,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAEM,aAAa,KAAI,CAAC;CAC1B;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAuB,qBAAqB,CAAC,CAAC","sourcesContent":["import { ReactiveController } from 'lit';\nimport { createContext } from '@lit-labs/context';\nimport { FilterController } from './filter.js';\nimport { NavigationController } from './navigation.js';\nimport { SortController } from './sort.js';\nimport { ResizeController } from './resize.js';\nimport type { ActiveNode, GridHost } from '../internal/types.js';\n\nexport class StateController<T extends object> implements ReactiveController {\n public sorting!: SortController<T>;\n public filtering!: FilterController<T>;\n public navigation!: NavigationController<T>;\n public resizing!: ResizeController<T>;\n\n public get active() {\n return this.navigation.active;\n }\n\n public set active(node: ActiveNode<T>) {\n this.navigation.active = node;\n }\n\n constructor(public host: GridHost<T>) {\n this.host.addController(this);\n this.init();\n }\n\n protected init() {\n this.sorting = new SortController(this.host);\n this.filtering = new FilterController(this.host);\n this.navigation = new NavigationController(this.host);\n this.resizing = new ResizeController(this.host);\n }\n\n public hostConnected() {}\n}\n\nexport const gridStateContext = createContext<StateController<any>>('gridStateController');\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as ApexGrid } from './components/grid.js';
|
|
2
|
+
export type { ApexGridEventMap, ApexFilteringEvent } from './components/grid.js';
|
|
3
|
+
export { BaseOperands } from './operations/filter/operands/base.js';
|
|
4
|
+
export { BooleanOperands } from './operations/filter/operands/boolean.js';
|
|
5
|
+
export { NumberOperands } from './operations/filter/operands/number.js';
|
|
6
|
+
export { StringOperands } from './operations/filter/operands/string.js';
|
|
7
|
+
export { FilterState } from './operations/filter/state.js';
|
|
8
|
+
export { FilterExpressionTree } from './operations/filter/tree.js';
|
|
9
|
+
export type { SortExpression, SortingDirection, SortState } from './operations/sort/types.js';
|
|
10
|
+
export type { FilterCriteria, FilterExpression, OperandKeys, FilterOperation, FilterOperationLogic, } from './operations/filter/types.js';
|
|
11
|
+
export type { ApexCellContext, ApexHeaderContext, ColumnConfiguration, ColumnFilterConfiguration, GridSortConfiguration, ColumnSortConfiguration, DataType, Keys, Values, GridRemoteConfig, RemoteFilterHook, RemoteSortHook, } from './internal/types.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC3D,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC9F,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as ApexGrid } from './components/grid.js';
|
|
2
|
+
export { BaseOperands } from './operations/filter/operands/base.js';
|
|
3
|
+
export { BooleanOperands } from './operations/filter/operands/boolean.js';
|
|
4
|
+
export { NumberOperands } from './operations/filter/operands/number.js';
|
|
5
|
+
export { StringOperands } from './operations/filter/operands/string.js';
|
|
6
|
+
export { FilterState } from './operations/filter/state.js';
|
|
7
|
+
export { FilterExpressionTree } from './operations/filter/tree.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export { default as ApexGrid } from './components/grid.js';\nexport type { ApexGridEventMap, ApexFilteringEvent } from './components/grid.js';\n\nexport { BaseOperands } from './operations/filter/operands/base.js';\nexport { BooleanOperands } from './operations/filter/operands/boolean.js';\nexport { NumberOperands } from './operations/filter/operands/number.js';\nexport { StringOperands } from './operations/filter/operands/string.js';\n\nexport { FilterState } from './operations/filter/state.js';\nexport { FilterExpressionTree } from './operations/filter/tree.js';\n\nexport type { SortExpression, SortingDirection, SortState } from './operations/sort/types.js';\nexport type {\n FilterCriteria,\n FilterExpression,\n OperandKeys,\n FilterOperation,\n FilterOperationLogic,\n} from './operations/filter/types.js';\nexport type {\n ApexCellContext,\n ApexHeaderContext,\n ColumnConfiguration,\n ColumnFilterConfiguration,\n GridSortConfiguration,\n ColumnSortConfiguration,\n DataType,\n Keys,\n Values,\n GridRemoteConfig,\n RemoteFilterHook,\n RemoteSortHook,\n} from './internal/types.js';\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ActiveNode, ColumnConfiguration, NavigationState } from './types.js';
|
|
2
|
+
export declare const PIPELINE = "pipeline";
|
|
3
|
+
export declare const SORT_ICON_ASCENDING: "arrow-upward";
|
|
4
|
+
export declare const SORT_ICON_DESCENDING: "arrow-downward";
|
|
5
|
+
export declare const MIN_COL_RESIZE_WIDTH = 80;
|
|
6
|
+
export declare const SENTINEL_NODE: Readonly<ActiveNode<any>>;
|
|
7
|
+
export declare const DEFAULT_COLUMN_CONFIG: ColumnConfiguration<any>;
|
|
8
|
+
export declare const NAVIGATION_STATE: Map<NavigationState, ActiveNode<any>>;
|
|
9
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/internal/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAInF,eAAO,MAAM,QAAQ,aAAa,CAAC;AACnC,eAAO,MAAM,mBAAmB,gBAA0B,CAAC;AAC3D,eAAO,MAAM,oBAAoB,kBAA4B,CAAC;AAE9D,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAA0C,CAAC;AAC/F,eAAO,MAAM,qBAAqB,EAAE,mBAAmB,CAAC,GAAG,CASzD,CAAC;AACH,eAAO,MAAM,gBAAgB,EAAE,GAAG,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG,CAAC,CAGjE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const columnKey = Symbol();
|
|
2
|
+
export const PIPELINE = 'pipeline';
|
|
3
|
+
export const SORT_ICON_ASCENDING = 'arrow-upward';
|
|
4
|
+
export const SORT_ICON_DESCENDING = 'arrow-downward';
|
|
5
|
+
export const MIN_COL_RESIZE_WIDTH = 80;
|
|
6
|
+
export const SENTINEL_NODE = Object.freeze({ column: '', row: -1 });
|
|
7
|
+
export const DEFAULT_COLUMN_CONFIG = Object.freeze({
|
|
8
|
+
key: columnKey,
|
|
9
|
+
type: 'string',
|
|
10
|
+
resizable: false,
|
|
11
|
+
hidden: false,
|
|
12
|
+
sort: false,
|
|
13
|
+
filter: false,
|
|
14
|
+
});
|
|
15
|
+
export const NAVIGATION_STATE = new Map([
|
|
16
|
+
['previous', SENTINEL_NODE],
|
|
17
|
+
['current', SENTINEL_NODE],
|
|
18
|
+
]);
|
|
19
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/internal/constants.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;AAE3B,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;AACnC,MAAM,CAAC,MAAM,mBAAmB,GAAG,cAAuB,CAAC;AAC3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAyB,CAAC;AAE9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC,MAAM,CAAC,MAAM,aAAa,GAA8B,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AAC/F,MAAM,CAAC,MAAM,qBAAqB,GAA6B,MAAM,CAAC,MAAM,CAE1E;IACA,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,KAAK;CACd,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA0C,IAAI,GAAG,CAAC;IAC7E,CAAC,UAAU,EAAE,aAAa,CAAC;IAC3B,CAAC,SAAS,EAAE,aAAa,CAAC;CAC3B,CAAC,CAAC","sourcesContent":["import type { ActiveNode, ColumnConfiguration, NavigationState } from './types.js';\n\nconst columnKey = Symbol();\n\nexport const PIPELINE = 'pipeline';\nexport const SORT_ICON_ASCENDING = 'arrow-upward' as const;\nexport const SORT_ICON_DESCENDING = 'arrow-downward' as const;\n\nexport const MIN_COL_RESIZE_WIDTH = 80;\n\nexport const SENTINEL_NODE: Readonly<ActiveNode<any>> = Object.freeze({ column: '', row: -1 });\nexport const DEFAULT_COLUMN_CONFIG: ColumnConfiguration<any> = Object.freeze<\n ColumnConfiguration<any>\n>({\n key: columnKey,\n type: 'string',\n resizable: false,\n hidden: false,\n sort: false,\n filter: false,\n});\nexport const NAVIGATION_STATE: Map<NavigationState, ActiveNode<any>> = new Map([\n ['previous', SENTINEL_NODE],\n ['current', SENTINEL_NODE],\n]);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-registry.d.ts","sourceRoot":"","sources":["../../../src/internal/icon-registry.ts"],"names":[],"mappings":"AA2CA,wBAAgB,iBAAiB,SAIhC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { registerIconFromText } from 'igniteui-webcomponents';
|
|
2
|
+
const internalIcons = {
|
|
3
|
+
'arrow-upward': '<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-downward" role="img" viewBox="0 0 45 45"><path d="M22.5 40V13.7L10.1 26.1 8 24 24 8l16 16-2.1 2.1-12.4-12.4V40Z"/></svg>',
|
|
4
|
+
'arrow-downward': '<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-downward" role="img" viewBox="0 0 45 45"><path fill="currentColor" d="M24 40 8 24l2.1-2.1 12.4 12.4V8h3v26.3l12.4-12.4L40 24Z"/></svg>',
|
|
5
|
+
all: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-labelledby="agall-desc agall-title"><title id="agall-title">Select All Icon</title><desc id="agall-desc">A picture showing tree lines and a check mark.</desc><path d="M2 14h8v2H2zm0-8h12v2H2zm14 11l-3-3-1.5 1.5L16 20l7-7-1.5-1.5L16 17zM2 10h12v2H2z"/></svg>',
|
|
6
|
+
contains: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-labelledby="czcontains-desc czcontains-title"><title id="czcontains-title">Contains Icon</title><desc id="czcontains-desc">A picture showing the lowercase letter A in a square box.</desc><path d="M3 3v18h18V3zm16 16H5V5h14z"/><path d="M12 11.3a4.39 4.39 0 00-2.54.63 2.07 2.07 0 00-.9 1.78 2.29 2.29 0 00.66 1.74 2.63 2.63 0 001.89.63 2.39 2.39 0 001.32-.37 3.05 3.05 0 001-.93 3.72 3.72 0 00.08.57c0 .19.1.38.16.58h1.79a4.51 4.51 0 01-.21-.88 5.57 5.57 0 01-.07-.93v-3.5a2.44 2.44 0 00-.84-2 3.34 3.34 0 00-2.22-.7 3.54 3.54 0 00-2.3.72A1.93 1.93 0 009 10.29h1.71a.93.93 0 01.29-.71 1.5 1.5 0 011-.29 1.45 1.45 0 011 .35 1.3 1.3 0 01.37 1v.69zm1.4 1.08v1.17a1.61 1.61 0 01-.71.77 2.27 2.27 0 01-1.21.34 1.18 1.18 0 01-.84-.27.92.92 0 01-.3-.72 1.16 1.16 0 01.44-.9 1.76 1.76 0 011.22-.39z"/></svg>',
|
|
7
|
+
doesNotContain: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-labelledby="eadoes-not-contain-desc eadoes-not-contain-title"><title id="eadoes-not-contain-title">Does-Not-Contain Icon</title><desc id="eadoes-not-contain-desc">A picture showing the lowercase letter A in a crossed-out square box.</desc><path d="M21 19.74V3H4.26L2.89 1.63 1.63 2.92 3 4.29V21h16.73l1.37 1.37 1.27-1.26zM5 19V6.28l5.28 5.27a3.19 3.19 0 00-.81.38 2.07 2.07 0 00-.9 1.78 2.29 2.29 0 00.66 1.74 2.63 2.63 0 001.89.63 2.39 2.39 0 001.32-.37 3.05 3.05 0 001-.93 3.72 3.72 0 00.08.57c0 .19.1.38.16.58h1L17.73 19zm5.79-6.23a1.31 1.31 0 01.45-.25l1.37 1.36.28.29a1.57 1.57 0 01-.19.15 2.27 2.27 0 01-1.21.34 1.18 1.18 0 01-.84-.27.92.92 0 01-.3-.72 1.16 1.16 0 01.44-.9zm2.6-1.47h-.83l-1.62-1.62.08-.1a1.5 1.5 0 011-.29 1.45 1.45 0 011 .35 1.3 1.3 0 01.37 1zM19 17.74l-3.85-3.85v-3.27a2.44 2.44 0 00-.84-2 3.34 3.34 0 00-2.22-.7 3.64 3.64 0 00-2.24.67L6.26 5H19z"/></svg>',
|
|
8
|
+
greaterThan: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-labelledby="fygreater-than-desc fygreater-than-title"><title id="fygreater-than-title">Greater Than Icon</title><desc id="fygreater-than-desc">A picture showing the greater-than symbol.</desc><path d="M6 7.11L15.09 12 6 16.89V19l12-6.46v-1.08L6 5v2.11z"/></svg>',
|
|
9
|
+
greaterThanOrEqual: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-labelledby="fzgreater-than-or-equal-desc fzgreater-than-or-equal-title"><title id="fzgreater-than-or-equal-title">Greater Than or Equal Icon</title><desc id="fzgreater-than-or-equal-desc">A picture showing the grater-than or equal symbol.</desc><path d="M5.99 19h12.02v2H5.99zM18 9.47L6 3v2.11L15.09 10 6 14.9v2.11l12-6.47V9.47z"/></svg>',
|
|
10
|
+
empty: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-labelledby="gsis-empty-desc gsis-empty-title"><title id="gsis-empty-title">Is Empty Icon</title><desc id="gsis-empty-desc">A picture showing a dotted square.</desc><path d="M5 17h2v2H5zm8 0h2v2h-2zm-8-4h2v2H5zm12 4h2v2h-2zM13 5h2v2h-2zM9 17h2v2H9zm8-8h2v2h-2zm0 4h2v2h-2zm0-8h2v2h-2zM5 9h2v2H5zm0-4h2v2H5zm4 0h2v2H9z"/></svg>',
|
|
11
|
+
endsWith: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-labelledby="enends-with-desc enends-with-title"><title id="enends-with-title">Ends With Icon</title><desc id="enends-with-desc">A picture showing three dots followed by lowercase a.</desc><path d="M3 14.5h2v2H3zm8 0h2v2h-2zm-4 0h2v2H7zm13.8.3v-3A2.1 2.1 0 0020 10a3 3 0 00-2-.6 3 3 0 00-2 .6 1.7 1.7 0 00-.7 1.5h1.5a.8.8 0 01.3-.7 1.3 1.3 0 01.9-.3 1.3 1.3 0 01.9.4 1.1 1.1 0 01.3.8v.6H18a3.8 3.8 0 00-2.2.6 1.8 1.8 0 00-.8 1.5 2 2 0 00.6 1.6 2.3 2.3 0 001.6.6 2.1 2.1 0 001.2-.4 2.8 2.8 0 00.8-.8 4.3 4.3 0 00.1.5l.1.5H21a4.1 4.1 0 01-.2-.7 5.4 5.4 0 010-1zm-1.6-.5a1.5 1.5 0 01-.6.7 2 2 0 01-1 .2 1.1 1.1 0 01-.8-.2.8.8 0 01-.2-.6 1 1 0 01.3-.8 1.5 1.5 0 011.1-.3h1.2z"/></svg>',
|
|
12
|
+
equals: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-labelledby="eoequals-desc eoequals-title"><title id="eoequals-title">Equals Icon</title><desc id="eoequals-desc">A picture showing the equals sign.</desc><path d="M5 13.5h14v2H5zm0-5h14v2H5z"/></svg>',
|
|
13
|
+
false: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-labelledby="gtis-false-desc gtis-false-title"><title id="gtis-false-title">Is False Icon</title><desc id="gtis-false-desc">A picture showing an encircled X symbol.</desc><path d="M8 5a7 7 0 107 7 7 7 0 00-7-7zm4.31 9.79l-1.52 1.52L8 13.52l-2.79 2.79-1.52-1.52L6.48 12 3.69 9.21l1.52-1.52L8 10.48l2.79-2.79 1.52 1.52L9.52 12zM18 7a5 5 0 00-3 1.06 7.48 7.48 0 01.49 1 3.89 3.89 0 110 5.82 8.08 8.08 0 01-.49 1A5 5 0 1018 7z"/><path d="M17.52 13.85l2.91-2.92-.78-.78-2.13 2.12-1.17-1.15-.38.37-.41.41.42.42L17 13.34l.52.51z"/></svg>',
|
|
14
|
+
lessThan: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-labelledby="hhless-than-desc hhless-than-title"><title id="hhless-than-title">Less Than Icon</title><desc id="hhless-than-desc">A picture showing the less-than symbol.</desc><path d="M6 12.54L18 19v-2.11L8.91 12 18 7.11V5L6 11.46v1.08z"/></svg>',
|
|
15
|
+
lessThanOrEqual: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-labelledby="hiless-than-or-equal-desc hiless-than-or-equal-title"><title id="hiless-than-or-equal-title">Less Than or Equal Icon</title><desc id="hiless-than-or-equal-desc">A picture showing the lass-than or equal symbol.</desc><path d="M5.99 19h12.02v2H5.99zM18 14.9L8.91 10 18 5.11V3L6 9.47v1.07l12 6.47V14.9z"/></svg>',
|
|
16
|
+
notEmpty: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-labelledby="ionot-empty-desc ionot-empty-title"><title id="ionot-empty-title">Not Empty Icon</title><desc id="ionot-empty-desc">A picture showing a crossed-out dotted square.</desc><path d="M5 9h2v2H5zm4 8h2v2H9zm4 0h2v2h-2zm4-8h2v2h-2zm0-4h2v2h-2zM5 17h2v2H5zm8-12h2v2h-2zm-8 8h2v2H5zm14 2v-2h-2v.47L18.53 15H19zm-8-8V5H9v.46L10.54 7H11zM2.76 1.76L1.5 3.06 20.97 22.5l1.26-1.26-8.89-8.89L2.76 1.76z"/></svg>',
|
|
17
|
+
doesNotEqual: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-labelledby="ipnot-equal-desc ipnot-equal-title"><title id="ipnot-equal-title">Not Equal Icon</title><desc id="ipnot-equal-desc">A picture showing a crossed-out equals symbol.</desc><path d="M17.37 4.71l-1.74-1-2.76 4.79H5v2h6.71l-1.73 3H5v2h3.82l-2.19 3.79 1.74 1 2.76-4.79H19v-2h-6.71l1.73-3H19v-2h-3.82l2.19-3.79z"/></svg>',
|
|
18
|
+
startsWith: '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" width="512" height="512" aria-labelledby="lqstarts-with-desc lqstarts-with-title"><title id="lqstarts-with-title">Starts With Icon</title><desc id="lqstarts-with-desc">A picture showing the uppercase letter A followed by three dots.</desc><path d="M5.9 7.5l-3.9 9h1.7l.7-1.8h4.1l.7 1.8H11l-3.9-9H5.9zM5 13.2l1.5-4.1L8 13.2H5zm7 1.3h2v2h-2v-2zm8 0h2v2h-2v-2zm-4 0h2v2h-2v-2z"/></svg>',
|
|
19
|
+
true: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="512" height="512" aria-labelledby="gwis-true-desc gwis-true-title"><title id="gwis-true-title">is True Icon</title><desc id="gwis-true-desc">A picture showing an encircled check mark symbol.</desc><path d="M19.44 14.22zm-2.88 0zm0 0L18 12.79l1.44 1.43.78-.78L18.79 12l1.43-1.44-.78-.78L18 11.21l-1.44-1.43-.78.78L17.21 12l-1.43 1.44.78.78z"/><path d="M18 7a5 5 0 00-3 1.06 7.48 7.48 0 01.49 1 3.89 3.89 0 110 5.82 8.08 8.08 0 01-.49 1A5 5 0 1018 7zM8 5a7 7 0 107 7 7 7 0 00-7-7zm-.93 10.18l-3.38-3.37 1.13-1.12 2.25 2.25 4.11-4.12 1.13 1.12z"/></svg>',
|
|
20
|
+
filter: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 45 45"><path d="M20 36v-3h8v3Zm-8-10.5v-3h24v3ZM6 15v-3h36v3Z"/></svg>',
|
|
21
|
+
close: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="m12.45 37.65-2.1-2.1L21.9 24 10.35 12.45l2.1-2.1L24 21.9l11.55-11.55 2.1 2.1L26.1 24l11.55 11.55-2.1 2.1L24 26.1Z"/></svg>',
|
|
22
|
+
refresh: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M24 40q-6.65 0-11.325-4.675Q8 30.65 8 24q0-6.65 4.675-11.325Q17.35 8 24 8q4.25 0 7.45 1.725T37 14.45V8h3v12.7H27.3v-3h8.4q-1.9-3-4.85-4.85Q27.9 11 24 11q-5.45 0-9.225 3.775Q11 18.55 11 24q0 5.45 3.775 9.225Q18.55 37 24 37q4.15 0 7.6-2.375 3.45-2.375 4.8-6.275h3.1q-1.45 5.25-5.75 8.45Q29.45 40 24 40Z"/></svg>',
|
|
23
|
+
};
|
|
24
|
+
export function registerGridIcons() {
|
|
25
|
+
for (const [name, svg] of Object.entries(internalIcons)) {
|
|
26
|
+
registerIconFromText(name, svg, 'internal');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=icon-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-registry.js","sourceRoot":"","sources":["../../../src/internal/icon-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,aAAa,GAA2B;IAC5C,cAAc,EACZ,0OAA0O;IAC5O,gBAAgB,EACd,wPAAwP;IAC1P,GAAG,EAAE,oUAAoU;IACzU,QAAQ,EACN,i2BAAi2B;IACn2B,cAAc,EACZ,o7BAAo7B;IACt7B,WAAW,EACT,wUAAwU;IAC1U,kBAAkB,EAChB,oZAAoZ;IACtZ,KAAK,EACH,wYAAwY;IAC1Y,QAAQ,EACN,0uBAA0uB;IAC5uB,MAAM,EACJ,0QAA0Q;IAC5Q,KAAK,EACH,olBAAolB;IACtlB,QAAQ,EACN,uTAAuT;IACzT,eAAe,EACb,mYAAmY;IACrY,QAAQ,EACN,2dAA2d;IAC7d,YAAY,EACV,uYAAuY;IACzY,UAAU,EACR,4bAA4b;IAC9b,IAAI,EAAE,2mBAA2mB;IACjnB,MAAM,EACJ,6HAA6H;IAC/H,KAAK,EACH,iMAAiM;IACnM,OAAO,EACL,4XAA4X;CAC/X,CAAC;AAEF,MAAM,UAAU,iBAAiB;IAC/B,KAAK,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACvD,oBAAoB,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;KAC7C;AACH,CAAC","sourcesContent":["import { registerIconFromText } from 'igniteui-webcomponents';\n\nconst internalIcons: Record<string, string> = {\n 'arrow-upward':\n '<svg xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"arrow-downward\" role=\"img\" viewBox=\"0 0 45 45\"><path d=\"M22.5 40V13.7L10.1 26.1 8 24 24 8l16 16-2.1 2.1-12.4-12.4V40Z\"/></svg>',\n 'arrow-downward':\n '<svg xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"arrow-downward\" role=\"img\" viewBox=\"0 0 45 45\"><path fill=\"currentColor\" d=\"M24 40 8 24l2.1-2.1 12.4 12.4V8h3v26.3l12.4-12.4L40 24Z\"/></svg>',\n all: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" aria-labelledby=\"agall-desc agall-title\"><title id=\"agall-title\">Select All Icon</title><desc id=\"agall-desc\">A picture showing tree lines and a check mark.</desc><path d=\"M2 14h8v2H2zm0-8h12v2H2zm14 11l-3-3-1.5 1.5L16 20l7-7-1.5-1.5L16 17zM2 10h12v2H2z\"/></svg>',\n contains:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" aria-labelledby=\"czcontains-desc czcontains-title\"><title id=\"czcontains-title\">Contains Icon</title><desc id=\"czcontains-desc\">A picture showing the lowercase letter A in a square box.</desc><path d=\"M3 3v18h18V3zm16 16H5V5h14z\"/><path d=\"M12 11.3a4.39 4.39 0 00-2.54.63 2.07 2.07 0 00-.9 1.78 2.29 2.29 0 00.66 1.74 2.63 2.63 0 001.89.63 2.39 2.39 0 001.32-.37 3.05 3.05 0 001-.93 3.72 3.72 0 00.08.57c0 .19.1.38.16.58h1.79a4.51 4.51 0 01-.21-.88 5.57 5.57 0 01-.07-.93v-3.5a2.44 2.44 0 00-.84-2 3.34 3.34 0 00-2.22-.7 3.54 3.54 0 00-2.3.72A1.93 1.93 0 009 10.29h1.71a.93.93 0 01.29-.71 1.5 1.5 0 011-.29 1.45 1.45 0 011 .35 1.3 1.3 0 01.37 1v.69zm1.4 1.08v1.17a1.61 1.61 0 01-.71.77 2.27 2.27 0 01-1.21.34 1.18 1.18 0 01-.84-.27.92.92 0 01-.3-.72 1.16 1.16 0 01.44-.9 1.76 1.76 0 011.22-.39z\"/></svg>',\n doesNotContain:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" aria-labelledby=\"eadoes-not-contain-desc eadoes-not-contain-title\"><title id=\"eadoes-not-contain-title\">Does-Not-Contain Icon</title><desc id=\"eadoes-not-contain-desc\">A picture showing the lowercase letter A in a crossed-out square box.</desc><path d=\"M21 19.74V3H4.26L2.89 1.63 1.63 2.92 3 4.29V21h16.73l1.37 1.37 1.27-1.26zM5 19V6.28l5.28 5.27a3.19 3.19 0 00-.81.38 2.07 2.07 0 00-.9 1.78 2.29 2.29 0 00.66 1.74 2.63 2.63 0 001.89.63 2.39 2.39 0 001.32-.37 3.05 3.05 0 001-.93 3.72 3.72 0 00.08.57c0 .19.1.38.16.58h1L17.73 19zm5.79-6.23a1.31 1.31 0 01.45-.25l1.37 1.36.28.29a1.57 1.57 0 01-.19.15 2.27 2.27 0 01-1.21.34 1.18 1.18 0 01-.84-.27.92.92 0 01-.3-.72 1.16 1.16 0 01.44-.9zm2.6-1.47h-.83l-1.62-1.62.08-.1a1.5 1.5 0 011-.29 1.45 1.45 0 011 .35 1.3 1.3 0 01.37 1zM19 17.74l-3.85-3.85v-3.27a2.44 2.44 0 00-.84-2 3.34 3.34 0 00-2.22-.7 3.64 3.64 0 00-2.24.67L6.26 5H19z\"/></svg>',\n greaterThan:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" aria-labelledby=\"fygreater-than-desc fygreater-than-title\"><title id=\"fygreater-than-title\">Greater Than Icon</title><desc id=\"fygreater-than-desc\">A picture showing the greater-than symbol.</desc><path d=\"M6 7.11L15.09 12 6 16.89V19l12-6.46v-1.08L6 5v2.11z\"/></svg>',\n greaterThanOrEqual:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" aria-labelledby=\"fzgreater-than-or-equal-desc fzgreater-than-or-equal-title\"><title id=\"fzgreater-than-or-equal-title\">Greater Than or Equal Icon</title><desc id=\"fzgreater-than-or-equal-desc\">A picture showing the grater-than or equal symbol.</desc><path d=\"M5.99 19h12.02v2H5.99zM18 9.47L6 3v2.11L15.09 10 6 14.9v2.11l12-6.47V9.47z\"/></svg>',\n empty:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" aria-labelledby=\"gsis-empty-desc gsis-empty-title\"><title id=\"gsis-empty-title\">Is Empty Icon</title><desc id=\"gsis-empty-desc\">A picture showing a dotted square.</desc><path d=\"M5 17h2v2H5zm8 0h2v2h-2zm-8-4h2v2H5zm12 4h2v2h-2zM13 5h2v2h-2zM9 17h2v2H9zm8-8h2v2h-2zm0 4h2v2h-2zm0-8h2v2h-2zM5 9h2v2H5zm0-4h2v2H5zm4 0h2v2H9z\"/></svg>',\n endsWith:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" aria-labelledby=\"enends-with-desc enends-with-title\"><title id=\"enends-with-title\">Ends With Icon</title><desc id=\"enends-with-desc\">A picture showing three dots followed by lowercase a.</desc><path d=\"M3 14.5h2v2H3zm8 0h2v2h-2zm-4 0h2v2H7zm13.8.3v-3A2.1 2.1 0 0020 10a3 3 0 00-2-.6 3 3 0 00-2 .6 1.7 1.7 0 00-.7 1.5h1.5a.8.8 0 01.3-.7 1.3 1.3 0 01.9-.3 1.3 1.3 0 01.9.4 1.1 1.1 0 01.3.8v.6H18a3.8 3.8 0 00-2.2.6 1.8 1.8 0 00-.8 1.5 2 2 0 00.6 1.6 2.3 2.3 0 001.6.6 2.1 2.1 0 001.2-.4 2.8 2.8 0 00.8-.8 4.3 4.3 0 00.1.5l.1.5H21a4.1 4.1 0 01-.2-.7 5.4 5.4 0 010-1zm-1.6-.5a1.5 1.5 0 01-.6.7 2 2 0 01-1 .2 1.1 1.1 0 01-.8-.2.8.8 0 01-.2-.6 1 1 0 01.3-.8 1.5 1.5 0 011.1-.3h1.2z\"/></svg>',\n equals:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" aria-labelledby=\"eoequals-desc eoequals-title\"><title id=\"eoequals-title\">Equals Icon</title><desc id=\"eoequals-desc\">A picture showing the equals sign.</desc><path d=\"M5 13.5h14v2H5zm0-5h14v2H5z\"/></svg>',\n false:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" aria-labelledby=\"gtis-false-desc gtis-false-title\"><title id=\"gtis-false-title\">Is False Icon</title><desc id=\"gtis-false-desc\">A picture showing an encircled X symbol.</desc><path d=\"M8 5a7 7 0 107 7 7 7 0 00-7-7zm4.31 9.79l-1.52 1.52L8 13.52l-2.79 2.79-1.52-1.52L6.48 12 3.69 9.21l1.52-1.52L8 10.48l2.79-2.79 1.52 1.52L9.52 12zM18 7a5 5 0 00-3 1.06 7.48 7.48 0 01.49 1 3.89 3.89 0 110 5.82 8.08 8.08 0 01-.49 1A5 5 0 1018 7z\"/><path d=\"M17.52 13.85l2.91-2.92-.78-.78-2.13 2.12-1.17-1.15-.38.37-.41.41.42.42L17 13.34l.52.51z\"/></svg>',\n lessThan:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" aria-labelledby=\"hhless-than-desc hhless-than-title\"><title id=\"hhless-than-title\">Less Than Icon</title><desc id=\"hhless-than-desc\">A picture showing the less-than symbol.</desc><path d=\"M6 12.54L18 19v-2.11L8.91 12 18 7.11V5L6 11.46v1.08z\"/></svg>',\n lessThanOrEqual:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" aria-labelledby=\"hiless-than-or-equal-desc hiless-than-or-equal-title\"><title id=\"hiless-than-or-equal-title\">Less Than or Equal Icon</title><desc id=\"hiless-than-or-equal-desc\">A picture showing the lass-than or equal symbol.</desc><path d=\"M5.99 19h12.02v2H5.99zM18 14.9L8.91 10 18 5.11V3L6 9.47v1.07l12 6.47V14.9z\"/></svg>',\n notEmpty:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" aria-labelledby=\"ionot-empty-desc ionot-empty-title\"><title id=\"ionot-empty-title\">Not Empty Icon</title><desc id=\"ionot-empty-desc\">A picture showing a crossed-out dotted square.</desc><path d=\"M5 9h2v2H5zm4 8h2v2H9zm4 0h2v2h-2zm4-8h2v2h-2zm0-4h2v2h-2zM5 17h2v2H5zm8-12h2v2h-2zm-8 8h2v2H5zm14 2v-2h-2v.47L18.53 15H19zm-8-8V5H9v.46L10.54 7H11zM2.76 1.76L1.5 3.06 20.97 22.5l1.26-1.26-8.89-8.89L2.76 1.76z\"/></svg>',\n doesNotEqual:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" aria-labelledby=\"ipnot-equal-desc ipnot-equal-title\"><title id=\"ipnot-equal-title\">Not Equal Icon</title><desc id=\"ipnot-equal-desc\">A picture showing a crossed-out equals symbol.</desc><path d=\"M17.37 4.71l-1.74-1-2.76 4.79H5v2h6.71l-1.73 3H5v2h3.82l-2.19 3.79 1.74 1 2.76-4.79H19v-2h-6.71l1.73-3H19v-2h-3.82l2.19-3.79z\"/></svg>',\n startsWith:\n '<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" width=\"512\" height=\"512\" aria-labelledby=\"lqstarts-with-desc lqstarts-with-title\"><title id=\"lqstarts-with-title\">Starts With Icon</title><desc id=\"lqstarts-with-desc\">A picture showing the uppercase letter A followed by three dots.</desc><path d=\"M5.9 7.5l-3.9 9h1.7l.7-1.8h4.1l.7 1.8H11l-3.9-9H5.9zM5 13.2l1.5-4.1L8 13.2H5zm7 1.3h2v2h-2v-2zm8 0h2v2h-2v-2zm-4 0h2v2h-2v-2z\"/></svg>',\n true: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"512\" height=\"512\" aria-labelledby=\"gwis-true-desc gwis-true-title\"><title id=\"gwis-true-title\">is True Icon</title><desc id=\"gwis-true-desc\">A picture showing an encircled check mark symbol.</desc><path d=\"M19.44 14.22zm-2.88 0zm0 0L18 12.79l1.44 1.43.78-.78L18.79 12l1.43-1.44-.78-.78L18 11.21l-1.44-1.43-.78.78L17.21 12l-1.43 1.44.78.78z\"/><path d=\"M18 7a5 5 0 00-3 1.06 7.48 7.48 0 01.49 1 3.89 3.89 0 110 5.82 8.08 8.08 0 01-.49 1A5 5 0 1018 7zM8 5a7 7 0 107 7 7 7 0 00-7-7zm-.93 10.18l-3.38-3.37 1.13-1.12 2.25 2.25 4.11-4.12 1.13 1.12z\"/></svg>',\n filter:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 45 45\"><path d=\"M20 36v-3h8v3Zm-8-10.5v-3h24v3ZM6 15v-3h36v3Z\"/></svg>',\n close:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><path d=\"m12.45 37.65-2.1-2.1L21.9 24 10.35 12.45l2.1-2.1L24 21.9l11.55-11.55 2.1 2.1L26.1 24l11.55 11.55-2.1 2.1L24 26.1Z\"/></svg>',\n refresh:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><path d=\"M24 40q-6.65 0-11.325-4.675Q8 30.65 8 24q0-6.65 4.675-11.325Q17.35 8 24 8q4.25 0 7.45 1.725T37 14.45V8h3v12.7H27.3v-3h8.4q-1.9-3-4.85-4.85Q27.9 11 24 11q-5.45 0-9.225 3.775Q11 18.55 11 24q0 5.45 3.775 9.225Q18.55 37 24 37q4.15 0 7.6-2.375 3.45-2.375 4.8-6.275h3.1q-1.45 5.25-5.75 8.45Q29.45 40 24 40Z\"/></svg>',\n};\n\nexport function registerGridIcons() {\n for (const [name, svg] of Object.entries(internalIcons)) {\n registerIconFromText(name, svg, 'internal');\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-defined.d.ts","sourceRoot":"","sources":["../../../src/internal/is-defined.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,CAEjF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-defined.js","sourceRoot":"","sources":["../../../src/internal/is-defined.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAI,KAA2B;IACtD,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;AAC/C,CAAC","sourcesContent":["export function isDefined<T>(value: T | null | undefined): value is NonNullable<T> {\n return value !== undefined && value !== null;\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export type UnpackCustomEvent<T> = T extends CustomEvent<infer U> ? U : never;
|
|
3
|
+
export declare class EventEmitterBase<E> extends LitElement {
|
|
4
|
+
addEventListener<K extends keyof M, M extends E & HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: M[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
5
|
+
removeEventListener<K extends keyof M, M extends E & HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: M[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
6
|
+
emitEvent<K extends keyof E, D extends UnpackCustomEvent<E[K]>>(type: K, eventInitDict?: CustomEventInit<D>): boolean;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=event-emitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-emitter.d.ts","sourceRoot":"","sources":["../../../../src/internal/mixins/event-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE9E,qBAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,UAAU;IACjC,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,mBAAmB,EACnF,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAC9C,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI;IASS,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,mBAAmB,EACtF,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAC9C,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GACvC,IAAI;IAQA,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,SAAS,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACnE,IAAI,EAAE,CAAC,EACP,aAAa,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GACjC,OAAO;CAgBX"}
|