igniteui-cli 15.3.1-beta.1 → 15.4.1-beta.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.
Files changed (73) hide show
  1. package/lib/PromptSession.d.ts +1 -1
  2. package/lib/PromptSession.js +2 -3
  3. package/lib/commands/new.js +49 -1
  4. package/lib/commands/types.d.ts +4 -0
  5. package/lib/templates/IgniteUIForWebComponentsTemplate.js +3 -2
  6. package/package.json +4 -4
  7. package/templates/blazor/igb/index.js +1 -1
  8. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/sizing.md +11 -9
  9. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/structure.md +2 -1
  10. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/types.md +2 -2
  11. package/templates/blazor/igb/projects/empty/index.d.ts +24 -0
  12. package/templates/blazor/igb/projects/empty/index.js +67 -0
  13. package/templates/blazor/index.js +1 -1
  14. package/templates/react/igr-ts/grid/basic/files/src/app/__path__/__filePrefix__.tsx +49 -40
  15. package/templates/react/igr-ts/grid/basic/files/src/app/__path__/style.module.css +17 -7
  16. package/templates/react/igr-ts/grid/basic/index.js +31 -0
  17. package/templates/react/igr-ts/hierarchical-grid/basic/files/src/app/__path__/__filePrefix__.test.tsx +13 -0
  18. package/templates/react/igr-ts/hierarchical-grid/basic/files/src/app/__path__/__filePrefix__.tsx +43 -0
  19. package/templates/react/igr-ts/hierarchical-grid/basic/files/src/app/__path__/style.module.css +27 -0
  20. package/templates/react/igr-ts/hierarchical-grid/basic/index.d.ts +1 -0
  21. package/templates/react/igr-ts/hierarchical-grid/basic/index.js +50 -0
  22. package/templates/react/igr-ts/hierarchical-grid/index.d.ts +1 -0
  23. package/templates/react/igr-ts/hierarchical-grid/index.js +12 -0
  24. package/templates/react/igr-ts/pivot-grid/basic/files/src/app/__path__/__filePrefix__.test.tsx +13 -0
  25. package/templates/react/igr-ts/pivot-grid/basic/files/src/app/__path__/__filePrefix__.tsx +54 -0
  26. package/templates/react/igr-ts/pivot-grid/basic/files/src/app/__path__/style.module.css +27 -0
  27. package/templates/react/igr-ts/pivot-grid/basic/index.d.ts +1 -0
  28. package/templates/react/igr-ts/pivot-grid/basic/index.js +50 -0
  29. package/templates/react/igr-ts/pivot-grid/index.d.ts +1 -0
  30. package/templates/react/igr-ts/pivot-grid/index.js +12 -0
  31. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/SKILL.md +1 -0
  32. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/CHARTS-GRIDS.md +9 -0
  33. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/gotchas.md +4 -0
  34. package/templates/react/igr-ts/projects/side-nav/files/src/app/app.tsx +5 -3
  35. package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/app.tsx +5 -3
  36. package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/app.tsx +4 -3
  37. package/templates/react/igr-ts/projects/side-nav-mini-auth/files/src/app/app.tsx +4 -3
  38. package/templates/react/igr-ts/tree-grid/basic/files/src/app/__path__/__filePrefix__.test.tsx +13 -0
  39. package/templates/react/igr-ts/tree-grid/basic/files/src/app/__path__/__filePrefix__.tsx +30 -0
  40. package/templates/react/igr-ts/tree-grid/basic/files/src/app/__path__/style.module.css +27 -0
  41. package/templates/react/igr-ts/tree-grid/basic/index.d.ts +1 -0
  42. package/templates/react/igr-ts/tree-grid/basic/index.js +50 -0
  43. package/templates/react/igr-ts/tree-grid/index.d.ts +1 -0
  44. package/templates/react/igr-ts/tree-grid/index.js +12 -0
  45. package/templates/webcomponents/igc-ts/grid/default/files/src/app/__path__/__filePrefix__.ts +65 -52
  46. package/templates/webcomponents/igc-ts/grid/default/index.js +31 -0
  47. package/templates/webcomponents/igc-ts/hierarchical-grid/basic/files/src/app/__path__/__filePrefix__.test.ts +9 -0
  48. package/templates/webcomponents/igc-ts/hierarchical-grid/basic/files/src/app/__path__/__filePrefix__.ts +100 -0
  49. package/templates/webcomponents/igc-ts/hierarchical-grid/basic/index.d.ts +1 -0
  50. package/templates/webcomponents/igc-ts/hierarchical-grid/basic/index.js +48 -0
  51. package/templates/webcomponents/igc-ts/hierarchical-grid/index.d.ts +1 -0
  52. package/templates/webcomponents/igc-ts/hierarchical-grid/index.js +12 -0
  53. package/templates/webcomponents/igc-ts/pivot-grid/basic/files/src/app/__path__/__filePrefix__.test.ts +9 -0
  54. package/templates/webcomponents/igc-ts/pivot-grid/basic/files/src/app/__path__/__filePrefix__.ts +113 -0
  55. package/templates/webcomponents/igc-ts/pivot-grid/basic/index.d.ts +1 -0
  56. package/templates/webcomponents/igc-ts/pivot-grid/basic/index.js +48 -0
  57. package/templates/webcomponents/igc-ts/pivot-grid/index.d.ts +1 -0
  58. package/templates/webcomponents/igc-ts/pivot-grid/index.js +12 -0
  59. package/templates/webcomponents/igc-ts/projects/_base/files/index.html +1 -0
  60. package/templates/webcomponents/igc-ts/projects/_base_with_home/files/index.html +1 -0
  61. package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +15 -1
  62. package/templates/webcomponents/igc-ts/projects/side-nav/files/src/app/app.ts +10 -3
  63. package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/index.html +1 -0
  64. package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/app.ts +9 -3
  65. package/templates/webcomponents/igc-ts/projects/side-nav-mini/files/src/app/app.ts +10 -3
  66. package/templates/webcomponents/igc-ts/projects/side-nav-mini-auth/files/src/app/app.ts +10 -3
  67. package/templates/webcomponents/igc-ts/tree-grid/basic/files/src/app/__path__/__filePrefix__.test.ts +9 -0
  68. package/templates/webcomponents/igc-ts/tree-grid/basic/files/src/app/__path__/__filePrefix__.ts +87 -0
  69. package/templates/webcomponents/igc-ts/tree-grid/basic/index.d.ts +1 -0
  70. package/templates/webcomponents/igc-ts/tree-grid/basic/index.js +48 -0
  71. package/templates/webcomponents/igc-ts/tree-grid/index.d.ts +1 -0
  72. package/templates/webcomponents/igc-ts/tree-grid/index.js +12 -0
  73. package/templates/react/igr-ts/grid/basic/files/src/app/__path__/data.tsx +0 -46
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const IgniteUIForReactTemplate_1 = require("../../../../../lib/templates/IgniteUIForReactTemplate");
27
+ const constants_1 = require("../../constants");
28
+ const path = __importStar(require("path"));
29
+ const SHARED_DATA_ROOT = path.join(path.dirname(require.resolve("@igniteui/angular-templates/package.json")), "shared-data");
30
+ class HierarchicalGridTemplate extends IgniteUIForReactTemplate_1.IgniteUIForReactTemplate {
31
+ constructor() {
32
+ super(__dirname);
33
+ this.id = "hierarchical-grid";
34
+ this.name = "Hierarchical Grid";
35
+ this.widget = "igHierarchicalGrid";
36
+ this.description = "IgrHierarchicalGrid template for React";
37
+ this.projectType = "igr-ts";
38
+ this.components = ["Hierarchical Grid"];
39
+ this.controlGroup = "Data Grids";
40
+ this.packages = [constants_1.IGNITEUI_REACT_GRIDS_PACKAGE];
41
+ this.hasExtraConfiguration = false;
42
+ }
43
+ get templatePaths() {
44
+ return [
45
+ ...super.templatePaths,
46
+ path.join(SHARED_DATA_ROOT, "hierarchical-grid", "files")
47
+ ];
48
+ }
49
+ }
50
+ module.exports = new HierarchicalGridTemplate();
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cli_core_1 = require("@igniteui/cli-core");
4
+ class IgrTsHierarchicalGridComponent extends cli_core_1.BaseComponent {
5
+ constructor() {
6
+ super(__dirname);
7
+ this.name = "Hierarchical Grid";
8
+ this.group = "Grids & Lists";
9
+ this.description = "IgrHierarchicalGrid component for React";
10
+ }
11
+ }
12
+ module.exports = new IgrTsHierarchicalGridComponent();
@@ -0,0 +1,13 @@
1
+ import { beforeAll, expect, test } from 'vitest';
2
+ import { render } from '@testing-library/react';
3
+ import $(ClassName) from './$(path)';
4
+ import { setupTestMocks } from '../../setupTests';
5
+
6
+ beforeAll(() => {
7
+ setupTestMocks();
8
+ })
9
+
10
+ test('renders $(ClassName) component', () => {
11
+ const wrapper = render(<$(ClassName) />);
12
+ expect(wrapper).toBeTruthy();
13
+ });
@@ -0,0 +1,54 @@
1
+ import style from './style.module.css';
2
+ import { IgrPivotGrid } from 'igniteui-react-grids';
3
+ import 'igniteui-react-grids/grids/themes/light/bootstrap.css';
4
+
5
+ import { DATA } from './data';
6
+
7
+ export default function $(ClassName)() {
8
+ const title = '$(name)';
9
+
10
+ const pivotConfiguration = {
11
+ columns: [
12
+ {
13
+ memberName: 'Product',
14
+ memberFunction: (data: any) => data.Product.Name,
15
+ enabled: true
16
+ }
17
+ ],
18
+ rows: [
19
+ {
20
+ memberName: 'Seller',
21
+ memberFunction: (data: any) => data.Seller.Name,
22
+ enabled: true
23
+ }
24
+ ],
25
+ values: [
26
+ {
27
+ member: 'NumberOfUnits',
28
+ aggregate: {
29
+ aggregatorName: 'SUM',
30
+ key: 'sum',
31
+ label: 'Sum'
32
+ },
33
+ enabled: true
34
+ }
35
+ ],
36
+ filters: null
37
+ };
38
+
39
+ return (
40
+ <div className={style.page}>
41
+ <p className={style.title}>{title}</p>
42
+ <p className={style.subtitle}>
43
+ Basic IgrPivotGrid component.<br />
44
+ You can read more about configuring the IgrPivotGrid component in the&nbsp;
45
+ <a href="https://www.infragistics.com/products/ignite-ui-react/react/components/grids/pivot-grid/overview.html" target="_blank" rel="noopener noreferrer">
46
+ official documentation
47
+ </a>.
48
+ </p>
49
+ <div className={style.grid}>
50
+ <IgrPivotGrid data={DATA} pivotConfiguration={pivotConfiguration} height="650px" width="100%" />
51
+ </div>
52
+ </div>
53
+ );
54
+ }
@@ -0,0 +1,27 @@
1
+ :local(.page) {
2
+ width: 100%;
3
+ margin-top: 40px;
4
+ padding: 0 48px;
5
+ display: flex;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ }
9
+
10
+ :local(.title) {
11
+ color: rgb(0, 153, 255);
12
+ text-align: center;
13
+ font-size: 2.5rem;
14
+ font-weight: 600;
15
+ }
16
+
17
+ :local(.subtitle) {
18
+ text-align: center;
19
+ margin-bottom: 32px;
20
+ margin-top: 16px;
21
+ font-size: 14px;
22
+ }
23
+
24
+ :local(.grid) {
25
+ width: 100%;
26
+ max-width: 1200px;
27
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const IgniteUIForReactTemplate_1 = require("../../../../../lib/templates/IgniteUIForReactTemplate");
27
+ const constants_1 = require("../../constants");
28
+ const path = __importStar(require("path"));
29
+ const SHARED_DATA_ROOT = path.join(path.dirname(require.resolve("@igniteui/angular-templates/package.json")), "shared-data");
30
+ class PivotGridTemplate extends IgniteUIForReactTemplate_1.IgniteUIForReactTemplate {
31
+ constructor() {
32
+ super(__dirname);
33
+ this.id = "pivot-grid";
34
+ this.name = "Pivot Grid";
35
+ this.widget = "igPivotGrid";
36
+ this.description = "IgrPivotGrid template for React";
37
+ this.projectType = "igr-ts";
38
+ this.components = ["Pivot Grid"];
39
+ this.controlGroup = "Data Grids";
40
+ this.packages = [constants_1.IGNITEUI_REACT_GRIDS_PACKAGE];
41
+ this.hasExtraConfiguration = false;
42
+ }
43
+ get templatePaths() {
44
+ return [
45
+ ...super.templatePaths,
46
+ path.join(SHARED_DATA_ROOT, "pivot-grid", "files")
47
+ ];
48
+ }
49
+ }
50
+ module.exports = new PivotGridTemplate();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cli_core_1 = require("@igniteui/cli-core");
4
+ class IgrTsPivotGridComponent extends cli_core_1.BaseComponent {
5
+ constructor() {
6
+ super(__dirname);
7
+ this.name = "Pivot Grid";
8
+ this.group = "Grids & Lists";
9
+ this.description = "IgrPivotGrid component for React";
10
+ }
11
+ }
12
+ module.exports = new IgrTsPivotGridComponent();
@@ -178,3 +178,4 @@ Use [COMPONENT-CATALOGUE.md](./reference/COMPONENT-CATALOGUE.md) to map any UI n
178
178
  6. **Handle events as `CustomEvent`** — not `React.SyntheticEvent`
179
179
  7. **Use refs sparingly** — prefer declarative props
180
180
  8. **Check slot names** in the docs
181
+ 9. **Never add `width` to grid columns by default** — `IgrGridLiteColumn` defaults to `minmax(136px, 1fr)` (responsive) and `IgrColumn` auto-sizes. Adding explicit pixel widths leaves empty space and breaks responsiveness. Only set `width` when the user explicitly requests it. If some columns have explicit widths, leave at least one column without a `width` to fill remaining space.
@@ -383,6 +383,15 @@ export default function OrderList() {
383
383
  }
384
384
  ```
385
385
 
386
+ ## Column Width Rule (Grid Lite and Advanced Grids)
387
+
388
+ > **⚠️ Do NOT set `width` on columns unless the user explicitly asks for specific column widths.**
389
+ >
390
+ > - `IgrGridLiteColumn` defaults to `minmax(136px, 1fr)` — columns are already responsive and fill all available space.
391
+ > - `IgrColumn` (in `IgrGrid`, `IgrTreeGrid`, `IgrHierarchicalGrid`) also auto-sizes by default.
392
+ > - Adding explicit pixel widths causes a fixed layout that leaves empty space on the right side of the grid.
393
+ > - If widths are set on some columns, leave at least one column without a `width` so it expands to fill the remaining space.
394
+
386
395
  > **Column configuration notes:**
387
396
  > - `dataType` accepts `"string"` (default), `"number"`, `"boolean"` — set it explicitly so sorting and filtering work correctly for each column type.
388
397
  > - `cellTemplate` receives an `IgrCellContext<T>` where `ctx.value` is the cell value and `ctx.row.data` is the full row object.
@@ -99,6 +99,10 @@ In a flexible CSS Grid track, set `min-height: 0` on the grid cell and make the
99
99
  ### `roundShape` does NOT exist on `IgrAvatar`
100
100
  Use the supported `shape` input alone. Do not add `roundShape`.
101
101
 
102
+ ### Omit column `width` — both grid types are fluid by default
103
+
104
+ Do not add `width` to `IgrGridLiteColumn` or `IgrColumn` — columns are responsive by default. Fixed pixel widths leave empty space on the right side of the grid. Only set `width` if the user explicitly asks for it. If some columns need explicit widths, leave at least one column without a `width` to fill the remaining space.
105
+
102
106
  ### Tabs used for navigation should be label-only
103
107
  When a screenshot shows tabs that drive routed page content, use label-only `IgrTab` items and keep the routed content outside the `IgrTabs` component. Do not place inline tab panel content inside router-driven tabs.
104
108
 
@@ -50,8 +50,10 @@ export default function App() {
50
50
  return () => mediaQuery.removeEventListener("change", updateDrawerState);
51
51
  }, []);
52
52
 
53
+ const toAbsPath = (p: string) => p.startsWith('/') ? p : `/${p}`;
54
+
53
55
  const handleRouteClick = (path: string) => {
54
- navigate(path);
56
+ navigate(toAbsPath(path));
55
57
 
56
58
  if (window.matchMedia("(max-width: 1024px)").matches) {
57
59
  setDrawerOpen(false);
@@ -80,7 +82,7 @@ export default function App() {
80
82
  {visibleRoutes.map((route) => (
81
83
  <IgrNavDrawerItem
82
84
  key={route.path}
83
- active={location.pathname === route.path}
85
+ active={location.pathname === toAbsPath(route.path)}
84
86
  onClick={() => handleRouteClick(route.path)}
85
87
  >
86
88
  <IgrIcon
@@ -88,7 +90,7 @@ export default function App() {
88
90
  name={route.icon || "home"}
89
91
  collection="material"
90
92
  style={{
91
- color: location.pathname === route.path ? "#0075D2" : undefined,
93
+ color: location.pathname === toAbsPath(route.path) ? "#0075D2" : undefined,
92
94
  }}
93
95
  />
94
96
  <span slot="content">{route.text}</span>
@@ -60,8 +60,10 @@ function AppContent() {
60
60
  return () => mediaQuery.removeEventListener("change", updateDrawerState);
61
61
  }, []);
62
62
 
63
+ const toAbsPath = (p: string) => p.startsWith('/') ? p : `/${p}`;
64
+
63
65
  const handleRouteClick = (path: string) => {
64
- navigate(path);
66
+ navigate(toAbsPath(path));
65
67
 
66
68
  if (window.matchMedia("(max-width: 1024px)").matches) {
67
69
  setDrawerOpen(false);
@@ -92,7 +94,7 @@ function AppContent() {
92
94
  {visibleRoutes.map((route) => (
93
95
  <IgrNavDrawerItem
94
96
  key={route.path}
95
- active={location.pathname === route.path}
97
+ active={location.pathname === toAbsPath(route.path)}
96
98
  onClick={() => handleRouteClick(route.path)}
97
99
  >
98
100
  <IgrIcon
@@ -100,7 +102,7 @@ function AppContent() {
100
102
  name={route.icon || "home"}
101
103
  collection="material"
102
104
  style={{
103
- color: location.pathname === route.path ? "#0075D2" : "#2d2d2d",
105
+ color: location.pathname === toAbsPath(route.path) ? "#0075D2" : "#2d2d2d",
104
106
  }}
105
107
  />
106
108
  <span slot="content">{route.text}</span>
@@ -32,6 +32,7 @@ export default function App() {
32
32
  const [drawerOpen, setDrawerOpen] = useState(true);
33
33
  const navigate = useNavigate();
34
34
  const location = useLocation();
35
+ const toAbsPath = (p: string) => p.startsWith('/') ? p : `/${p}`;
35
36
 
36
37
  useEffect(() => {
37
38
  const mq = window.matchMedia('(min-width: 1025px)');
@@ -59,14 +60,14 @@ export default function App() {
59
60
  {navRoutes.map((route) => (
60
61
  <IgrNavDrawerItem
61
62
  key={route.path}
62
- active={location.pathname === route.path}
63
- onClick={() => navigate(route.path)}
63
+ active={location.pathname === toAbsPath(route.path)}
64
+ onClick={() => navigate(toAbsPath(route.path))}
64
65
  >
65
66
  <IgrIcon
66
67
  slot="icon"
67
68
  name={route.icon || 'apps'}
68
69
  collection="material"
69
- style={location.pathname === route.path ? { color: '#0075D2' } : undefined}
70
+ style={location.pathname === toAbsPath(route.path) ? { color: '#0075D2' } : undefined}
70
71
  />
71
72
  <span slot="content">{route.text}</span>
72
73
  </IgrNavDrawerItem>
@@ -36,6 +36,7 @@ function AppContent() {
36
36
  const navigate = useNavigate();
37
37
  const location = useLocation();
38
38
  const { currentUser } = useAuth();
39
+ const toAbsPath = (p: string) => p.startsWith('/') ? p : `/${p}`;
39
40
 
40
41
  const navRoutes = useMemo(() => routes.filter((r) => {
41
42
  if (!r.text) return false;
@@ -71,14 +72,14 @@ function AppContent() {
71
72
  {navRoutes.map((route) => (
72
73
  <IgrNavDrawerItem
73
74
  key={route.path}
74
- active={location.pathname === route.path}
75
- onClick={() => navigate(route.path)}
75
+ active={location.pathname === toAbsPath(route.path)}
76
+ onClick={() => navigate(toAbsPath(route.path))}
76
77
  >
77
78
  <IgrIcon
78
79
  slot="icon"
79
80
  name={route.icon || 'apps'}
80
81
  collection="material"
81
- style={location.pathname === route.path ? { color: '#0075D2' } : undefined}
82
+ style={location.pathname === toAbsPath(route.path) ? { color: '#0075D2' } : undefined}
82
83
  />
83
84
  <span slot="content">{route.text}</span>
84
85
  </IgrNavDrawerItem>
@@ -0,0 +1,13 @@
1
+ import { beforeAll, expect, test } from 'vitest';
2
+ import { render } from '@testing-library/react';
3
+ import $(ClassName) from './$(path)';
4
+ import { setupTestMocks } from '../../setupTests';
5
+
6
+ beforeAll(() => {
7
+ setupTestMocks();
8
+ })
9
+
10
+ test('renders $(ClassName) component', () => {
11
+ const wrapper = render(<$(ClassName) />);
12
+ expect(wrapper).toBeTruthy();
13
+ });
@@ -0,0 +1,30 @@
1
+ import style from './style.module.css';
2
+ import { IgrTreeGrid, IgrColumn } from 'igniteui-react-grids';
3
+ import 'igniteui-react-grids/grids/themes/light/bootstrap.css';
4
+
5
+ import { EMPLOYEE_DATA } from './data';
6
+
7
+ export default function $(ClassName)() {
8
+ const title = '$(name)';
9
+
10
+ return (
11
+ <div className={style.page}>
12
+ <p className={style.title}>{title}</p>
13
+ <p className={style.subtitle}>
14
+ IgrTreeGrid component displaying hierarchical data using a child collection.<br />
15
+ You can read more about configuring the IgrTreeGrid component in the&nbsp;
16
+ <a href="https://www.infragistics.com/products/ignite-ui-react/react/components/grids/tree-grid/overview.html" target="_blank" rel="noopener noreferrer">
17
+ official documentation
18
+ </a>.
19
+ </p>
20
+ <div className={style.grid}>
21
+ <IgrTreeGrid data={EMPLOYEE_DATA} primaryKey="ID" childDataKey="Employees" autoGenerate={false} height="650px" width="100%">
22
+ <IgrColumn field="Name" dataType="string" />
23
+ <IgrColumn field="Location" dataType="string" />
24
+ <IgrColumn field="HireDate" header="Hire Date" dataType="date" />
25
+ <IgrColumn field="Age" dataType="number" />
26
+ </IgrTreeGrid>
27
+ </div>
28
+ </div>
29
+ );
30
+ }
@@ -0,0 +1,27 @@
1
+ :local(.page) {
2
+ width: 100%;
3
+ margin-top: 40px;
4
+ padding: 0 48px;
5
+ display: flex;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ }
9
+
10
+ :local(.title) {
11
+ color: rgb(0, 153, 255);
12
+ text-align: center;
13
+ font-size: 2.5rem;
14
+ font-weight: 600;
15
+ }
16
+
17
+ :local(.subtitle) {
18
+ text-align: center;
19
+ margin-bottom: 32px;
20
+ margin-top: 16px;
21
+ font-size: 14px;
22
+ }
23
+
24
+ :local(.grid) {
25
+ width: 100%;
26
+ max-width: 1200px;
27
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const IgniteUIForReactTemplate_1 = require("../../../../../lib/templates/IgniteUIForReactTemplate");
27
+ const constants_1 = require("../../constants");
28
+ const path = __importStar(require("path"));
29
+ const SHARED_DATA_ROOT = path.join(path.dirname(require.resolve("@igniteui/angular-templates/package.json")), "shared-data");
30
+ class TreeGridTemplate extends IgniteUIForReactTemplate_1.IgniteUIForReactTemplate {
31
+ constructor() {
32
+ super(__dirname);
33
+ this.id = "tree-grid";
34
+ this.name = "Tree Grid";
35
+ this.widget = "igTreeGrid";
36
+ this.description = "IgrTreeGrid template for React";
37
+ this.projectType = "igr-ts";
38
+ this.components = ["Tree Grid"];
39
+ this.controlGroup = "Data Grids";
40
+ this.packages = [constants_1.IGNITEUI_REACT_GRIDS_PACKAGE];
41
+ this.hasExtraConfiguration = false;
42
+ }
43
+ get templatePaths() {
44
+ return [
45
+ ...super.templatePaths,
46
+ path.join(SHARED_DATA_ROOT, "tree-grid", "files")
47
+ ];
48
+ }
49
+ }
50
+ module.exports = new TreeGridTemplate();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cli_core_1 = require("@igniteui/cli-core");
4
+ class IgrTsTreeGridComponent extends cli_core_1.BaseComponent {
5
+ constructor() {
6
+ super(__dirname);
7
+ this.name = "Tree Grid";
8
+ this.group = "Grids & Lists";
9
+ this.description = "IgrTreeGrid component for React";
10
+ }
11
+ }
12
+ module.exports = new IgrTsTreeGridComponent();