igniteui-grid-lite 0.0.1 → 0.1.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/README.md +233 -8
- package/components/cell.d.ts +1 -1
- package/components/cell.js +2 -3
- package/components/cell.js.map +1 -1
- package/components/column.d.ts +39 -0
- package/components/column.js +77 -0
- package/components/column.js.map +1 -0
- package/components/filter-row.d.ts +1 -1
- package/components/filter-row.js +45 -33
- package/components/filter-row.js.map +1 -1
- package/components/grid.d.ts +35 -35
- package/components/grid.js +147 -107
- package/components/grid.js.map +1 -1
- package/components/header-row.d.ts +5 -8
- package/components/header-row.js +18 -28
- package/components/header-row.js.map +1 -1
- package/components/header.d.ts +2 -1
- package/components/header.js +13 -11
- package/components/header.js.map +1 -1
- package/components/row.d.ts +3 -5
- package/components/row.js +6 -12
- package/components/row.js.map +1 -1
- package/components/virtualizer.d.ts +0 -1
- package/components/virtualizer.js +0 -5
- package/components/virtualizer.js.map +1 -1
- package/controllers/data-operation.d.ts +4 -1
- package/controllers/data-operation.js +5 -1
- package/controllers/data-operation.js.map +1 -1
- package/controllers/dom.d.ts +9 -10
- package/controllers/dom.js +20 -34
- package/controllers/dom.js.map +1 -1
- package/controllers/filter.d.ts +7 -4
- package/controllers/filter.js +8 -5
- package/controllers/filter.js.map +1 -1
- package/controllers/navigation.d.ts +8 -8
- package/controllers/navigation.js +28 -28
- package/controllers/navigation.js.map +1 -1
- package/controllers/sort.d.ts +4 -4
- package/controllers/sort.js +2 -2
- package/controllers/sort.js.map +1 -1
- package/controllers/state.d.ts +32 -15
- package/controllers/state.js +54 -17
- package/controllers/state.js.map +1 -1
- package/custom-elements.json +924 -190
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/highlight.css +27 -13
- package/docs/assets/main.js +2 -2
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +3 -3
- package/docs/classes/IgcGridLite.html +24 -26
- package/docs/classes/IgcGridLiteColumn.html +38 -0
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +193 -11
- package/docs/interfaces/BaseColumnConfiguration.html +11 -11
- package/docs/interfaces/BaseColumnSortConfiguration.html +4 -4
- package/docs/interfaces/BaseFilterExpression.html +6 -6
- package/docs/interfaces/BaseIgcCellContext.html +6 -6
- package/docs/interfaces/BaseSortingExpression.html +12 -0
- package/docs/interfaces/ColumnFilterConfiguration.html +3 -3
- package/docs/interfaces/DataPipelineConfiguration.html +4 -4
- package/docs/interfaces/GridLiteSortingOptions.html +4 -0
- package/docs/interfaces/IgcFilteredEvent.html +4 -4
- package/docs/interfaces/IgcFilteringEvent.html +5 -5
- package/docs/interfaces/IgcGridLiteEventMap.html +6 -6
- package/docs/interfaces/IgcHeaderContext.html +4 -4
- package/docs/media/LICENSE +9 -0
- package/docs/modules.html +1 -1
- package/docs/types/BasePropertyType.html +2 -2
- package/docs/types/BaseSortComparer.html +2 -2
- package/docs/types/ColumnConfiguration.html +2 -2
- package/docs/types/ColumnSortConfiguration.html +2 -2
- package/docs/types/DataPipelineHook.html +2 -2
- package/docs/types/DataPipelineParams.html +5 -5
- package/docs/types/DataType.html +2 -2
- package/docs/types/FilterCriteria.html +2 -2
- package/docs/types/FilterExpression.html +2 -2
- package/docs/types/IgcCellContext.html +2 -2
- package/docs/types/Keys.html +2 -2
- package/docs/types/PropertyType.html +2 -2
- package/docs/types/SortComparer.html +2 -2
- package/docs/types/SortState.html +2 -2
- package/docs/types/SortingDirection.html +2 -2
- package/docs/types/SortingExpression.html +2 -0
- package/index.d.ts +3 -2
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/internal/constants.js +5 -1
- package/internal/constants.js.map +1 -1
- package/internal/context.d.ts +9 -0
- package/internal/context.js +7 -0
- package/internal/context.js.map +1 -0
- package/internal/element-from-event-path.d.ts +2 -0
- package/internal/element-from-event-path.js +12 -0
- package/internal/element-from-event-path.js.map +1 -0
- package/internal/part-map.d.ts +16 -3
- package/internal/part-map.js +44 -4
- package/internal/part-map.js.map +1 -1
- package/internal/tags.d.ts +1 -0
- package/internal/tags.js +1 -0
- package/internal/tags.js.map +1 -1
- package/internal/theming.js +5 -7
- package/internal/theming.js.map +1 -1
- package/internal/types.d.ts +3 -7
- package/internal/types.js.map +1 -1
- package/internal/utils.d.ts +6 -2
- package/internal/utils.js +43 -14
- package/internal/utils.js.map +1 -1
- package/operations/filter/tree.d.ts +1 -1
- package/operations/sort/types.d.ts +4 -4
- package/operations/sort/types.js.map +1 -1
- package/operations/sort.d.ts +2 -2
- package/operations/sort.js.map +1 -1
- package/package.json +2 -2
- package/styles/_common.css.js +1 -1
- package/styles/_common.css.js.map +1 -1
- package/styles/body-cell/body-cell.css.js +1 -1
- package/styles/body-cell/body-cell.css.js.map +1 -1
- package/styles/body-row/body-row.css.js +1 -1
- package/styles/body-row/body-row.css.js.map +1 -1
- package/styles/filter-row/filter-row.css.js +1 -1
- package/styles/filter-row/filter-row.css.js.map +1 -1
- package/styles/header-cell/header-cell.css.js +1 -1
- package/styles/header-cell/header-cell.css.js.map +1 -1
- package/styles/header-row/header-row.base.css.js +1 -1
- package/styles/header-row/header-row.base.css.js.map +1 -1
- package/styles/themes/dark/_themes.css.js +3 -0
- package/styles/themes/dark/_themes.css.js.map +1 -0
- package/styles/themes/dark/grid.bootstrap.css.js +3 -0
- package/styles/themes/dark/grid.bootstrap.css.js.map +1 -0
- package/styles/themes/dark/grid.fluent.css.js +3 -0
- package/styles/themes/dark/grid.fluent.css.js.map +1 -0
- package/styles/themes/dark/grid.indigo.css.js +3 -0
- package/styles/themes/dark/grid.indigo.css.js.map +1 -0
- package/styles/themes/dark/grid.material.css.js +3 -0
- package/styles/themes/dark/grid.material.css.js.map +1 -0
- package/styles/themes/grid-header-themes.d.ts +2 -0
- package/styles/themes/grid-header-themes.js +21 -0
- package/styles/themes/grid-header-themes.js.map +1 -0
- package/styles/themes/grid-themes.d.ts +2 -0
- package/styles/{grid/themes/themes.js → themes/grid-themes.js} +17 -9
- package/styles/themes/grid-themes.js.map +1 -0
- package/styles/themes/grid.base.css.js +3 -0
- package/styles/themes/grid.base.css.js.map +1 -0
- package/styles/themes/light/_themes.css.js +3 -0
- package/styles/themes/light/_themes.css.js.map +1 -0
- package/styles/themes/light/grid.bootstrap.css.js +3 -0
- package/styles/themes/light/grid.bootstrap.css.js.map +1 -0
- package/styles/themes/light/grid.fluent.css.js +3 -0
- package/styles/themes/light/grid.fluent.css.js.map +1 -0
- package/styles/themes/light/grid.indigo.css.d.ts +1 -0
- package/styles/themes/light/grid.indigo.css.js +3 -0
- package/styles/themes/light/grid.indigo.css.js.map +1 -0
- package/styles/themes/light/grid.material.css.d.ts +1 -0
- package/styles/themes/light/grid.material.css.js +3 -0
- package/styles/themes/light/grid.material.css.js.map +1 -0
- package/styles/themes/light/grid.shared.css.d.ts +1 -0
- package/styles/themes/light/grid.shared.css.js +3 -0
- package/styles/themes/light/grid.shared.css.js.map +1 -0
- package/styles/themes/shared/grid.common.css.d.ts +1 -0
- package/styles/themes/shared/grid.common.css.js +3 -0
- package/styles/themes/shared/grid.common.css.js.map +1 -0
- package/styles/themes/shared/header.bootstrap.css.d.ts +1 -0
- package/styles/themes/shared/header.bootstrap.css.js +3 -0
- package/styles/themes/shared/header.bootstrap.css.js.map +1 -0
- package/styles/themes/shared/header.fluent.css.d.ts +1 -0
- package/styles/themes/shared/header.fluent.css.js +3 -0
- package/styles/themes/shared/header.fluent.css.js.map +1 -0
- package/docs/interfaces/BaseSortExpression.html +0 -12
- package/docs/interfaces/GridSortConfiguration.html +0 -6
- package/docs/types/SortExpression.html +0 -2
- package/styles/grid/themes/dark/grid.bootstrap.css.js +0 -3
- package/styles/grid/themes/dark/grid.bootstrap.css.js.map +0 -1
- package/styles/grid/themes/dark/grid.fluent.css.js +0 -3
- package/styles/grid/themes/dark/grid.fluent.css.js.map +0 -1
- package/styles/grid/themes/dark/grid.indigo.css.js +0 -3
- package/styles/grid/themes/dark/grid.indigo.css.js.map +0 -1
- package/styles/grid/themes/dark/grid.material.css.js +0 -3
- package/styles/grid/themes/dark/grid.material.css.js.map +0 -1
- package/styles/grid/themes/grid.base.css.js +0 -3
- package/styles/grid/themes/grid.base.css.js.map +0 -1
- package/styles/grid/themes/light/grid.bootstrap.css.js +0 -3
- package/styles/grid/themes/light/grid.bootstrap.css.js.map +0 -1
- package/styles/grid/themes/light/grid.fluent.css.js +0 -3
- package/styles/grid/themes/light/grid.fluent.css.js.map +0 -1
- package/styles/grid/themes/light/grid.indigo.css.js +0 -3
- package/styles/grid/themes/light/grid.indigo.css.js.map +0 -1
- package/styles/grid/themes/light/grid.material.css.js +0 -3
- package/styles/grid/themes/light/grid.material.css.js.map +0 -1
- package/styles/grid/themes/themes.d.ts +0 -2
- package/styles/grid/themes/themes.js.map +0 -1
- /package/styles/{grid/themes/dark/grid.bootstrap.css.d.ts → themes/dark/_themes.css.d.ts} +0 -0
- /package/styles/{grid/themes/light → themes/dark}/grid.bootstrap.css.d.ts +0 -0
- /package/styles/{grid/themes → themes}/dark/grid.fluent.css.d.ts +0 -0
- /package/styles/{grid/themes → themes}/dark/grid.indigo.css.d.ts +0 -0
- /package/styles/{grid/themes → themes}/dark/grid.material.css.d.ts +0 -0
- /package/styles/{grid/themes → themes}/grid.base.css.d.ts +0 -0
- /package/styles/{grid/themes/light/grid.fluent.css.d.ts → themes/light/_themes.css.d.ts} +0 -0
- /package/styles/{grid/themes/light/grid.indigo.css.d.ts → themes/light/grid.bootstrap.css.d.ts} +0 -0
- /package/styles/{grid/themes/light/grid.material.css.d.ts → themes/light/grid.fluent.css.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,17 +1,242 @@
|
|
|
1
1
|
# Ignite UI Grid Lite
|
|
2
2
|
[](https://github.com/IgniteUI/igniteui-grid-lite/actions/workflows/node.js.yml)
|
|
3
3
|
[](https://coveralls.io/github/IgniteUI/igniteui-grid-lite?branch=master)
|
|
4
|
+
[](https://badge.fury.io/js/igniteui-grid-lite)
|
|
4
5
|
|
|
6
|
+
Ignite UI Grid Lite is a high-performance, lightweight data grid built as a web component using [Lit](https://lit.dev/). It provides essential grid functionality with a small footprint, making it perfect for applications that need fast, efficient data visualization without the overhead of a full-featured grid.
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
## Table of Contents
|
|
9
|
+
- [Features](#features)
|
|
10
|
+
- [Browser Support](#browser-support)
|
|
11
|
+
- [Getting Started](#getting-started)
|
|
12
|
+
- [Usage](#usage)
|
|
13
|
+
- [Building the Library](#building-the-library)
|
|
14
|
+
- [Running Tests](#running-tests)
|
|
15
|
+
- [Documentation](#documentation)
|
|
16
|
+
- [Ignite UI Open-Source vs. Premium for Web Comonents](https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/general-open-source-vs-premium)
|
|
17
|
+
- [Contributing](#contributing)
|
|
18
|
+
- [Support](#support)
|
|
19
|
+
- [License](#license)
|
|
7
20
|
|
|
8
|
-
##
|
|
21
|
+
## Features
|
|
9
22
|
|
|
10
|
-
|
|
11
|
-
2. Run `npm install`
|
|
12
|
-
3. Run `npm run build`
|
|
13
|
-
3. Play and explore the codebase.
|
|
23
|
+
Ignite UI Grid Lite provides core data grid capabilities with an emphasis on performance and simplicity:
|
|
14
24
|
|
|
15
|
-
|
|
25
|
+
- **High Performance Row Virtualization** - Handles large datasets efficiently with built-in virtual scrolling
|
|
26
|
+
- **Column Filtering** - Built-in column filtering capabilities
|
|
27
|
+
- **Sorting** - Column sorting support for better data organization
|
|
28
|
+
- **Lightweight** - Minimal bundle size for fast load times
|
|
29
|
+
- **Web Standards** - Built with web components for framework-agnostic usage
|
|
30
|
+
- **Modern Architecture** - Built with Lit and TypeScript for maintainability
|
|
31
|
+
- **Customizable** - Flexible theming and styling options
|
|
32
|
+
- **Cell Templating** - Custom cell rendering for flexible data display
|
|
33
|
+
- **Header Templating** - Custom header rendering for enhanced grid headers
|
|
34
|
+
- **Accessible** - Designed with accessibility in mind
|
|
16
35
|
|
|
17
|
-
|
|
36
|
+
## Browser Support
|
|
37
|
+
|
|
38
|
+
Ignite UI Grid Lite supports all modern browsers:
|
|
39
|
+
|
|
40
|
+
| ![chrome] | ![firefox] | ![edge] | ![safari] | ![opera] |
|
|
41
|
+
|:---:|:---:|:---:|:---:|:---:|
|
|
42
|
+
| Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ |
|
|
43
|
+
|
|
44
|
+
## Getting Started
|
|
45
|
+
|
|
46
|
+
### Installation
|
|
47
|
+
|
|
48
|
+
Install via npm:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm install igniteui-grid-lite
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Quick Start
|
|
55
|
+
|
|
56
|
+
1. Import the grid component in your JavaScript/TypeScript file:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import 'igniteui-grid-lite';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
2. Use the grid in your HTML:
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<igc-grid-lite>
|
|
66
|
+
<!-- Grid configuration here -->
|
|
67
|
+
</igc-grid-lite>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
3. For a complete example, check out the [demo application](./demo).
|
|
71
|
+
|
|
72
|
+
## Usage
|
|
73
|
+
|
|
74
|
+
For detailed usage instructions and API documentation, visit:
|
|
75
|
+
- <a href="https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/grid-lite/overview">Grid Lite Overview</a>
|
|
76
|
+
- [API Documentation](https://igniteui.github.io/igniteui-grid-lite/)
|
|
77
|
+
|
|
78
|
+
## Building the Library
|
|
79
|
+
|
|
80
|
+
### Setup
|
|
81
|
+
|
|
82
|
+
Clone the repository and install dependencies:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
git clone https://github.com/IgniteUI/igniteui-grid-lite.git
|
|
86
|
+
cd igniteui-grid-lite
|
|
87
|
+
npm install
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Build
|
|
91
|
+
|
|
92
|
+
To build the library:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm run build
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
This will:
|
|
99
|
+
- Analyze custom elements
|
|
100
|
+
- Build the TypeScript source
|
|
101
|
+
- Generate API documentation
|
|
102
|
+
|
|
103
|
+
### Development
|
|
104
|
+
|
|
105
|
+
Start the development server with live reload:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npm start
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
This will open the demo page at `demo/index.html` with automatic rebuilding on file changes.
|
|
112
|
+
|
|
113
|
+
## Running Tests
|
|
114
|
+
|
|
115
|
+
Run tests once:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm test
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Run tests in watch mode:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
npm run test:watch
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Tests are written using [@web/test-runner](https://modern-web.dev/docs/test-runner/overview/) and [@open-wc/testing](https://open-wc.org/docs/testing/helpers/).
|
|
128
|
+
|
|
129
|
+
## Documentation
|
|
130
|
+
|
|
131
|
+
### API Documentation
|
|
132
|
+
|
|
133
|
+
The API documentation is generated using [TypeDoc](https://typedoc.org/). To build the docs:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npm run build
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Documentation will be available in the build output.
|
|
140
|
+
|
|
141
|
+
### Additional Resources
|
|
142
|
+
|
|
143
|
+
- <a href="https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/general-getting-started">Ignite UI Web Components Product Documentation</a>
|
|
144
|
+
- <a href="https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/grid-lite/overview">Grid Lite Documentation</a>
|
|
145
|
+
- [Web Components Guide](https://lit.dev/)
|
|
146
|
+
|
|
147
|
+
## Ignite UI Grid Lite vs. Ignite UI for Web Components
|
|
148
|
+
|
|
149
|
+
Ignite UI Grid Lite is designed as a lightweight, open-source alternative to the full-featured <a href="https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/grids/data-grid">Ignite UI for Web Components Data Grid</a>, while allowing for an easy swap with the full-featured grid, if application needs require it.
|
|
150
|
+
|
|
151
|
+
### Ignite UI Grid Lite (Open Source - MIT)
|
|
152
|
+
|
|
153
|
+
**Best for:**
|
|
154
|
+
- Applications requiring basic grid functionality
|
|
155
|
+
- Projects where bundle size is critical
|
|
156
|
+
- Framework-agnostic web applications
|
|
157
|
+
- Community-driven development
|
|
158
|
+
|
|
159
|
+
**Includes:**
|
|
160
|
+
- Core data virtualization
|
|
161
|
+
- Basic filtering and sorting
|
|
162
|
+
- Lightweight and fast
|
|
163
|
+
- MIT licensed and free for all use
|
|
164
|
+
|
|
165
|
+
**Best for:**
|
|
166
|
+
- Enterprise applications requiring advanced features
|
|
167
|
+
- Complex data scenarios with editing, grouping, and aggregation
|
|
168
|
+
- Applications needing professional support and SLA
|
|
169
|
+
|
|
170
|
+
**Includes:**
|
|
171
|
+
- All Grid Lite features plus:
|
|
172
|
+
- Advanced filtering with query builder
|
|
173
|
+
- Excel-style column filtering
|
|
174
|
+
- Grouping
|
|
175
|
+
- Cell editing, row editing, batch editing
|
|
176
|
+
- Summaries and aggregations
|
|
177
|
+
- Excel, PDF, and CSV export
|
|
178
|
+
- Column pinning, hiding, and resizing
|
|
179
|
+
- Row selection
|
|
180
|
+
- Paging
|
|
181
|
+
- Multi-column headers and collapsible column groups
|
|
182
|
+
- Cell merging
|
|
183
|
+
- Custom row layouts
|
|
184
|
+
- Master-detail views
|
|
185
|
+
- Hierarchical grid
|
|
186
|
+
- Tree grid
|
|
187
|
+
- Pivot grid
|
|
188
|
+
- 24/5 developer support
|
|
189
|
+
|
|
190
|
+
<a href="https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/general-open-source-vs-premium">Learn more about Open-Source vs Premium Ignite UI options</a>
|
|
191
|
+
|
|
192
|
+
## Contributing
|
|
193
|
+
|
|
194
|
+
We welcome contributions! Please see our [contributing guidelines](CONTRIBUTING.md) for details on:
|
|
195
|
+
- Code of conduct
|
|
196
|
+
- Development workflow
|
|
197
|
+
- Submitting pull requests
|
|
198
|
+
- Coding standards
|
|
199
|
+
|
|
200
|
+
To contribute:
|
|
201
|
+
|
|
202
|
+
1. Fork the repository
|
|
203
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
204
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
205
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
206
|
+
5. Open a Pull Request
|
|
207
|
+
|
|
208
|
+
## Support
|
|
209
|
+
|
|
210
|
+
### Community Support
|
|
211
|
+
|
|
212
|
+
Community support for open source usage of this product is available at:
|
|
213
|
+
- [GitHub Issues](https://github.com/IgniteUI/igniteui-grid-lite/issues) - Report bugs or request features
|
|
214
|
+
- [Stack Overflow](https://stackoverflow.com/questions/tagged/igniteui) - Ask questions using the `igniteui` tag
|
|
215
|
+
|
|
216
|
+
### Commercial Support
|
|
217
|
+
|
|
218
|
+
For professional support and access to the full Ignite UI for Web Components suite with advanced grid features:
|
|
219
|
+
- Visit [Infragistics Support](https://www.infragistics.com/support)
|
|
220
|
+
- Explore [Ignite UI for Web Components](https://www.infragistics.com/products/ignite-ui-web-components)
|
|
221
|
+
- [Register for a trial](https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/general-getting-started)
|
|
222
|
+
|
|
223
|
+
## License
|
|
224
|
+
|
|
225
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
226
|
+
|
|
227
|
+
**MIT License** - Free for commercial and non-commercial use.
|
|
228
|
+
|
|
229
|
+
© Copyright 2025 INFRAGISTICS. All Rights Reserved.
|
|
230
|
+
|
|
231
|
+
For the commercial Ignite UI for Angular product, please visit [Infragistics Licensing](https://www.infragistics.com/legal/license).
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
**Built with ❤️ by [Infragistics](https://www.infragistics.com/)**
|
|
236
|
+
|
|
237
|
+
<!-- Browser Logos -->
|
|
238
|
+
[chrome]: https://user-images.githubusercontent.com/2188411/168109445-fbd7b217-35f9-44d1-8002-1eb97e39cdc6.png "Google Chrome"
|
|
239
|
+
[firefox]: https://user-images.githubusercontent.com/2188411/168109465-e46305ee-f69f-4fa5-8f4a-14876f7fd3ca.png "Mozilla Firefox"
|
|
240
|
+
[edge]: https://user-images.githubusercontent.com/2188411/168109472-a730f8c0-3822-4ae6-9f54-785a66695245.png "Microsoft Edge"
|
|
241
|
+
[opera]: https://user-images.githubusercontent.com/2188411/168109520-b6865a6c-b69f-44a4-9948-748d8afd687c.png "Opera"
|
|
242
|
+
[safari]: https://user-images.githubusercontent.com/2188411/168109527-6c58f2cf-7386-4b97-98b1-cfe0ab4e8626.png "Safari"
|
package/components/cell.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export default class IgcGridLiteCell<T extends object> extends LitElement {
|
|
|
26
26
|
*/
|
|
27
27
|
row: IgcGridLiteRow<T>;
|
|
28
28
|
protected get context(): IgcCellContext<T>;
|
|
29
|
-
protected render():
|
|
29
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
30
30
|
}
|
|
31
31
|
declare global {
|
|
32
32
|
interface HTMLElementTagNameMap {
|
package/components/cell.js
CHANGED
|
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement } from 'lit';
|
|
8
8
|
import { property } from 'lit/decorators.js';
|
|
9
|
+
import { cache } from 'lit/directives/cache.js';
|
|
9
10
|
import { registerComponent } from '../internal/register.js';
|
|
10
11
|
import { GRID_CELL_TAG } from '../internal/tags.js';
|
|
11
12
|
import { styles } from '../styles/body-cell/body-cell.css.js';
|
|
@@ -30,9 +31,7 @@ export default class IgcGridLiteCell extends LitElement {
|
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
render() {
|
|
33
|
-
return this.column.cellTemplate
|
|
34
|
-
? this.column.cellTemplate(this.context)
|
|
35
|
-
: html `${this.value}`;
|
|
34
|
+
return html `${cache(this.column.cellTemplate ? this.column.cellTemplate(this.context) : html `${this.value}`)}`;
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
__decorate([
|
package/components/cell.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell.js","sourceRoot":"","sources":["../../src/components/cell.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAM9D,MAAM,CAAC,OAAO,OAAO,eAAkC,SAAQ,UAAU;IAAzE;;QA4BS,WAAM,GAAG,KAAK,CAAC;IAqBxB,CAAC;IAhDQ,MAAM,KAAK,OAAO;QACvB,OAAO,aAAa,CAAC;IACvB,CAAC;aAEsB,WAAM,GAAG,MAAM,AAAT,CAAU;IAEhC,MAAM,CAAC,QAAQ;QACpB,iBAAiB,CAAC,eAAe,CAAC,CAAC;IACrC,CAAC;IA0BD,IAAc,OAAO;QACnB,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;SACc,CAAC;IACpC,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY
|
|
1
|
+
{"version":3,"file":"cell.js","sourceRoot":"","sources":["../../src/components/cell.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAM9D,MAAM,CAAC,OAAO,OAAO,eAAkC,SAAQ,UAAU;IAAzE;;QA4BS,WAAM,GAAG,KAAK,CAAC;IAqBxB,CAAC;IAhDQ,MAAM,KAAK,OAAO;QACvB,OAAO,aAAa,CAAC;IACvB,CAAC;aAEsB,WAAM,GAAG,MAAM,AAAT,CAAU;IAEhC,MAAM,CAAC,QAAQ;QACpB,iBAAiB,CAAC,eAAe,CAAC,CAAC;IACrC,CAAC;IA0BD,IAAc,OAAO;QACnB,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;SACc,CAAC;IACpC,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA,GAAG,KAAK,CACjB,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,OAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,GAAG,IAAI,CAAC,KAAK,EAAE,CAC/F,EAAE,CAAC;IACN,CAAC;;AAjCM;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8CACA;AAMxB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+CACQ;AAOhC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACrB","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { cache } from 'lit/directives/cache.js';\nimport { registerComponent } from '../internal/register.js';\nimport { GRID_CELL_TAG } from '../internal/tags.js';\nimport type { ColumnConfiguration, IgcCellContext, PropertyType } from '../internal/types.js';\nimport { styles } from '../styles/body-cell/body-cell.css.js';\nimport type IgcGridLiteRow from './row.js';\n\n/**\n * Component representing a DOM cell of the Igc grid.\n */\nexport default class IgcGridLiteCell<T extends object> extends LitElement {\n public static get tagName() {\n return GRID_CELL_TAG;\n }\n\n public static override styles = styles;\n\n public static register(): void {\n registerComponent(IgcGridLiteCell);\n }\n\n /**\n * The value which will be rendered by the component.\n */\n @property({ attribute: false })\n public value!: PropertyType<T>;\n\n /**\n * A reference to the column configuration object.\n */\n @property({ attribute: false })\n public column!: ColumnConfiguration<T>;\n\n /**\n * Indicates whether this is the active cell in the grid.\n *\n */\n @property({ type: Boolean, reflect: true })\n public active = false;\n\n /**\n * The parent row component holding this cell.\n */\n public row!: IgcGridLiteRow<T>;\n\n protected get context(): IgcCellContext<T> {\n return {\n parent: this,\n row: this.row,\n column: this.column,\n value: this.value,\n } as unknown as IgcCellContext<T>;\n }\n\n protected override render() {\n return html`${cache(\n this.column.cellTemplate ? this.column.cellTemplate(this.context as any) : html`${this.value}`\n )}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [IgcGridLiteCell.tagName]: IgcGridLiteCell<object>;\n }\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
2
|
+
import type { BaseColumnConfiguration, ColumnFilterConfiguration, ColumnSortConfiguration, IgcCellContext, IgcHeaderContext } from '../internal/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* @element igc-grid-lite-column
|
|
5
|
+
*/
|
|
6
|
+
export declare class IgcGridLiteColumn<T extends object> extends LitElement implements BaseColumnConfiguration<T> {
|
|
7
|
+
static get tagName(): "igc-grid-lite-column";
|
|
8
|
+
static styles: import("lit").CSSResult;
|
|
9
|
+
static register(): void;
|
|
10
|
+
/** Callback context to notify the parent grid about configuration changes */
|
|
11
|
+
protected _setConfig?: (config: BaseColumnConfiguration<T>) => void;
|
|
12
|
+
/** The key of the column, used to identify the data field. */
|
|
13
|
+
key: keyof T;
|
|
14
|
+
/** The data type of the column's values. */
|
|
15
|
+
type?: 'number' | 'string' | 'boolean';
|
|
16
|
+
/** The header text of the column. */
|
|
17
|
+
headerText?: string;
|
|
18
|
+
/** The width of the column. */
|
|
19
|
+
width?: string;
|
|
20
|
+
/** Indicates whether the column is hidden. */
|
|
21
|
+
hidden: boolean;
|
|
22
|
+
/** Indicates whether the column is resizable. */
|
|
23
|
+
resizable: boolean;
|
|
24
|
+
/** Sort configuration for the column. */
|
|
25
|
+
sort?: ColumnSortConfiguration<T> | boolean;
|
|
26
|
+
/** Filter configuration for the column. */
|
|
27
|
+
filter?: ColumnFilterConfiguration | boolean;
|
|
28
|
+
/** Custom header template for the column. */
|
|
29
|
+
headerTemplate?: (params: IgcHeaderContext<T>) => unknown;
|
|
30
|
+
/** Custom cell template for the column. */
|
|
31
|
+
cellTemplate?: (params: IgcCellContext<T>) => unknown;
|
|
32
|
+
protected update(props: PropertyValues<this>): void;
|
|
33
|
+
protected render(): unknown;
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
interface HTMLElementTagNameMap {
|
|
37
|
+
[IgcGridLiteColumn.tagName]: IgcGridLiteColumn<object>;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { consume } from '@lit/context';
|
|
8
|
+
import { css, LitElement, nothing } from 'lit';
|
|
9
|
+
import { property } from 'lit/decorators.js';
|
|
10
|
+
import { COLUMN_UPDATE_CONTEXT } from '../internal/context.js';
|
|
11
|
+
import { registerComponent } from '../internal/register.js';
|
|
12
|
+
import { GRID_COLUMN_TAG } from '../internal/tags.js';
|
|
13
|
+
export class IgcGridLiteColumn extends LitElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.type = 'string';
|
|
17
|
+
this.hidden = false;
|
|
18
|
+
this.resizable = false;
|
|
19
|
+
this.sort = false;
|
|
20
|
+
this.filter = false;
|
|
21
|
+
}
|
|
22
|
+
static get tagName() {
|
|
23
|
+
return GRID_COLUMN_TAG;
|
|
24
|
+
}
|
|
25
|
+
static { this.styles = css `
|
|
26
|
+
:host {
|
|
27
|
+
display: none;
|
|
28
|
+
contain: strict;
|
|
29
|
+
}
|
|
30
|
+
`; }
|
|
31
|
+
static register() {
|
|
32
|
+
registerComponent(IgcGridLiteColumn);
|
|
33
|
+
}
|
|
34
|
+
update(props) {
|
|
35
|
+
if (this.hasUpdated && props.size > 0) {
|
|
36
|
+
this._setConfig?.(this);
|
|
37
|
+
}
|
|
38
|
+
super.update(props);
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
return nothing;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
__decorate([
|
|
45
|
+
consume({ context: COLUMN_UPDATE_CONTEXT })
|
|
46
|
+
], IgcGridLiteColumn.prototype, "_setConfig", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
property()
|
|
49
|
+
], IgcGridLiteColumn.prototype, "key", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
property()
|
|
52
|
+
], IgcGridLiteColumn.prototype, "type", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
property()
|
|
55
|
+
], IgcGridLiteColumn.prototype, "headerText", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
property()
|
|
58
|
+
], IgcGridLiteColumn.prototype, "width", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
property({ type: Boolean })
|
|
61
|
+
], IgcGridLiteColumn.prototype, "hidden", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
property({ type: Boolean })
|
|
64
|
+
], IgcGridLiteColumn.prototype, "resizable", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
property({ attribute: false })
|
|
67
|
+
], IgcGridLiteColumn.prototype, "sort", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
property({ attribute: false })
|
|
70
|
+
], IgcGridLiteColumn.prototype, "filter", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
property({ attribute: false })
|
|
73
|
+
], IgcGridLiteColumn.prototype, "headerTemplate", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
property({ attribute: false })
|
|
76
|
+
], IgcGridLiteColumn.prototype, "cellTemplate", void 0);
|
|
77
|
+
//# sourceMappingURL=column.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column.js","sourceRoot":"","sources":["../../src/components/column.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAYtD,MAAM,OAAO,iBACX,SAAQ,UAAU;IADpB;;QA6BS,SAAI,GAAqC,QAAQ,CAAC;QAYzC,WAAM,GAAG,KAAK,CAAC;QAIxB,cAAS,GAAG,KAAK,CAAC;QAIlB,SAAI,GAA0C,KAAK,CAAC;QAIpD,WAAM,GAAyC,KAAK,CAAC;IAqB9D,CAAC;IAtEQ,MAAM,KAAK,OAAO;QACvB,OAAO,eAAe,CAAC;IACzB,CAAC;aAEsB,WAAM,GAAG,GAAG,CAAA;;;;;GAKlC,AAL4B,CAK3B;IAEK,MAAM,CAAC,QAAQ;QACpB,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IA8CkB,MAAM,CAAC,KAA2B;QACnD,IAAI,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YACtC,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAEkB,MAAM;QACvB,OAAO,OAAO,CAAC;IACjB,CAAC;;AApDS;IADT,OAAO,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC;qDACwB;AAI7D;IADN,QAAQ,EAAE;8CACU;AAId;IADN,QAAQ,EAAE;+CAC8C;AAIlD;IADN,QAAQ,EAAE;qDACgB;AAIpB;IADN,QAAQ,EAAE;gDACW;AAIN;IADf,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDACG;AAIxB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACH;AAIlB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+CAC4B;AAIpD;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;iDAC6B;AAIrD;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;yDACkC;AAI1D;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;uDAC8B","sourcesContent":["import { consume } from '@lit/context';\nimport { css, LitElement, nothing, type PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { COLUMN_UPDATE_CONTEXT } from '../internal/context.js';\nimport { registerComponent } from '../internal/register.js';\nimport { GRID_COLUMN_TAG } from '../internal/tags.js';\nimport type {\n BaseColumnConfiguration,\n ColumnFilterConfiguration,\n ColumnSortConfiguration,\n IgcCellContext,\n IgcHeaderContext,\n} from '../internal/types.js';\n\n/**\n * @element igc-grid-lite-column\n */\nexport class IgcGridLiteColumn<T extends object>\n extends LitElement\n implements BaseColumnConfiguration<T>\n{\n public static get tagName() {\n return GRID_COLUMN_TAG;\n }\n\n public static override styles = css`\n :host {\n display: none;\n contain: strict;\n }\n `;\n\n public static register(): void {\n registerComponent(IgcGridLiteColumn);\n }\n\n /** Callback context to notify the parent grid about configuration changes */\n @consume({ context: COLUMN_UPDATE_CONTEXT })\n protected _setConfig?: (config: BaseColumnConfiguration<T>) => void;\n\n /** The key of the column, used to identify the data field. */\n @property()\n public key!: keyof T;\n\n /** The data type of the column's values. */\n @property()\n public type?: 'number' | 'string' | 'boolean' = 'string';\n\n /** The header text of the column. */\n @property()\n public headerText?: string;\n\n /** The width of the column. */\n @property()\n public width?: string;\n\n /** Indicates whether the column is hidden. */\n @property({ type: Boolean })\n public override hidden = false;\n\n /** Indicates whether the column is resizable. */\n @property({ type: Boolean })\n public resizable = false;\n\n /** Sort configuration for the column. */\n @property({ attribute: false })\n public sort?: ColumnSortConfiguration<T> | boolean = false;\n\n /** Filter configuration for the column. */\n @property({ attribute: false })\n public filter?: ColumnFilterConfiguration | boolean = false;\n\n /** Custom header template for the column. */\n @property({ attribute: false })\n public headerTemplate?: (params: IgcHeaderContext<T>) => unknown;\n\n /** Custom cell template for the column. */\n @property({ attribute: false })\n public cellTemplate?: (params: IgcCellContext<T>) => unknown;\n\n protected override update(props: PropertyValues<this>): void {\n if (this.hasUpdated && props.size > 0) {\n this._setConfig?.(this);\n }\n\n super.update(props);\n }\n\n protected override render(): unknown {\n return nothing;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [IgcGridLiteColumn.tagName]: IgcGridLiteColumn<object>;\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IgcDropdownComponent, type IgcIconComponent, IgcInputComponent } from 'igniteui-webcomponents';
|
|
2
2
|
import { LitElement, nothing } from 'lit';
|
|
3
|
-
import {
|
|
3
|
+
import type { StateController } from '../controllers/state.js';
|
|
4
4
|
import type { ColumnConfiguration } from '../internal/types.js';
|
|
5
5
|
import type { FilterExpressionTree } from '../operations/filter/tree.js';
|
|
6
6
|
import type { FilterExpression, FilterOperation } from '../operations/filter/types.js';
|
package/components/filter-row.js
CHANGED
|
@@ -9,19 +9,21 @@ import { IgcDropdownComponent, IgcInputComponent, } from 'igniteui-webcomponents
|
|
|
9
9
|
import { html, LitElement, nothing } from 'lit';
|
|
10
10
|
import { property, query } from 'lit/decorators.js';
|
|
11
11
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
12
|
-
import { gridStateContext } from '../controllers/state.js';
|
|
13
12
|
import { DEFAULT_COLUMN_CONFIG } from '../internal/constants.js';
|
|
13
|
+
import { GRID_STATE_CONTEXT } from '../internal/context.js';
|
|
14
14
|
import { registerComponent } from '../internal/register.js';
|
|
15
15
|
import { GRID_FILTER_ROW_TAG } from '../internal/tags.js';
|
|
16
16
|
import { getFilterOperandsFor } from '../internal/utils.js';
|
|
17
17
|
import { watch } from '../internal/watch.js';
|
|
18
18
|
import { styles } from '../styles/filter-row/filter-row.css.js';
|
|
19
19
|
function prefixedIcon(icon) {
|
|
20
|
-
return html
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
return html `
|
|
21
|
+
<igc-icon
|
|
22
|
+
slot="prefix"
|
|
23
|
+
name=${ifDefined(icon)}
|
|
24
|
+
collection="internal"
|
|
25
|
+
></igc-icon>
|
|
26
|
+
`;
|
|
25
27
|
}
|
|
26
28
|
export default class IgcFilterRow extends LitElement {
|
|
27
29
|
constructor() {
|
|
@@ -139,27 +141,31 @@ export default class IgcFilterRow extends LitElement {
|
|
|
139
141
|
}
|
|
140
142
|
renderCriteriaButton(expr, index) {
|
|
141
143
|
return index
|
|
142
|
-
? html
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
? html `
|
|
145
|
+
<igc-button
|
|
146
|
+
variant="flat"
|
|
147
|
+
@click=${this.#chipCriteriaFor(expr)}
|
|
148
|
+
>
|
|
149
|
+
${expr.criteria}
|
|
150
|
+
</igc-button>
|
|
151
|
+
`
|
|
148
152
|
: nothing;
|
|
149
153
|
}
|
|
150
154
|
renderExpressionChip(props) {
|
|
151
155
|
const { name, unary } = props.expression.condition;
|
|
152
156
|
const { searchTerm: term } = props.expression;
|
|
153
157
|
const prefix = html `<span slot="select"></span>${prefixedIcon(name)}`;
|
|
154
|
-
return html
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
return html `
|
|
159
|
+
<igc-chip
|
|
160
|
+
selectable
|
|
161
|
+
removable
|
|
162
|
+
?selected=${props.selected}
|
|
163
|
+
@igcRemove=${props.onRemove}
|
|
164
|
+
@igcSelect=${props.onSelect}
|
|
165
|
+
>
|
|
166
|
+
${prefix}${unary ? name : term}
|
|
167
|
+
</igc-chip>
|
|
168
|
+
`;
|
|
163
169
|
}
|
|
164
170
|
renderActiveChips() {
|
|
165
171
|
const state = this.filterController.get(this.column.key);
|
|
@@ -222,7 +228,8 @@ export default class IgcFilterRow extends LitElement {
|
|
|
222
228
|
</igc-icon>`;
|
|
223
229
|
}
|
|
224
230
|
renderInputArea() {
|
|
225
|
-
return html
|
|
231
|
+
return html `
|
|
232
|
+
<igc-input
|
|
226
233
|
outlined
|
|
227
234
|
value=${ifDefined(this.expression.searchTerm)}
|
|
228
235
|
placeholder="Add filter value"
|
|
@@ -232,14 +239,17 @@ export default class IgcFilterRow extends LitElement {
|
|
|
232
239
|
>
|
|
233
240
|
${this.renderDropdownTarget()}
|
|
234
241
|
</igc-input>
|
|
235
|
-
${this.renderDropdown()}
|
|
242
|
+
${this.renderDropdown()}
|
|
243
|
+
`;
|
|
236
244
|
}
|
|
237
245
|
renderActiveState() {
|
|
238
|
-
return html
|
|
239
|
-
<div part="
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
246
|
+
return html `
|
|
247
|
+
<div part="active-state">
|
|
248
|
+
<div part="filter-row-input">${this.renderInputArea()}</div>
|
|
249
|
+
<div part="filter-row-filters">${this.renderActiveChips()}</div>
|
|
250
|
+
<div part="filter-row-actions">${this.renderFilterActions()}</div>
|
|
251
|
+
</div>
|
|
252
|
+
`;
|
|
243
253
|
}
|
|
244
254
|
renderInactiveChips(column, state) {
|
|
245
255
|
return Array.from(state).map((expression, idx) => {
|
|
@@ -275,18 +285,20 @@ export default class IgcFilterRow extends LitElement {
|
|
|
275
285
|
return partial ? this.renderInactiveChips(column, state) : chip;
|
|
276
286
|
}
|
|
277
287
|
renderInactiveState() {
|
|
278
|
-
return this.state.
|
|
288
|
+
return this.state.columns.map((column) => column.hidden
|
|
279
289
|
? nothing
|
|
280
|
-
: html
|
|
281
|
-
|
|
282
|
-
|
|
290
|
+
: html `
|
|
291
|
+
<div part="filter-row-preview">
|
|
292
|
+
${column.filter ? this.renderFilterState(column) : nothing}
|
|
293
|
+
</div>
|
|
294
|
+
`);
|
|
283
295
|
}
|
|
284
296
|
render() {
|
|
285
297
|
return html `${this.active ? this.renderActiveState() : this.renderInactiveState()}`;
|
|
286
298
|
}
|
|
287
299
|
}
|
|
288
300
|
__decorate([
|
|
289
|
-
consume({ context:
|
|
301
|
+
consume({ context: GRID_STATE_CONTEXT, subscribe: true }),
|
|
290
302
|
property({ attribute: false })
|
|
291
303
|
], IgcFilterRow.prototype, "state", void 0);
|
|
292
304
|
__decorate([
|