igniteui-cli 9.0.3 → 9.0.4
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/package.json +3 -3
- package/templates/webcomponents/igc-ts/grid/grid-editing/files/src/app/__path__/DataGridSharedData.ts +2 -1
- package/templates/webcomponents/igc-ts/grid/grid-editing/files/src/app/__path__/__filePrefix__.ts +39 -37
- package/templates/webcomponents/igc-ts/grid/grid-summaries/files/src/app/__path__/DataGridSharedData.ts +2 -1
- package/templates/webcomponents/igc-ts/grid/grid-summaries/files/src/app/__path__/__filePrefix__.ts +7 -4
- package/templates/webcomponents/igc-ts/projects/empty/files/src/app.ts +1 -0
- package/templates/webcomponents/igc-ts/projects/empty/files/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "igniteui-cli",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.4",
|
|
4
4
|
"description": "CLI tool for creating Ignite UI projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"all": true
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@igniteui/angular-templates": "~13.0.
|
|
76
|
-
"@igniteui/cli-core": "~9.0.
|
|
75
|
+
"@igniteui/angular-templates": "~13.0.904",
|
|
76
|
+
"@igniteui/cli-core": "~9.0.4",
|
|
77
77
|
"chalk": "^2.3.2",
|
|
78
78
|
"fs-extra": "^3.0.1",
|
|
79
79
|
"glob": "^7.1.2",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-param-reassign */
|
|
1
2
|
export class DataGridSharedData {
|
|
2
3
|
public static getEmployees(count?: number): any[] {
|
|
3
4
|
if (count === undefined) {
|
|
@@ -102,7 +103,7 @@ export class DataGridSharedData {
|
|
|
102
103
|
const items = this.getRandomNumber(10, 80);
|
|
103
104
|
const value = price * items;
|
|
104
105
|
const margin = this.getRandomNumber(3, 10);
|
|
105
|
-
const profit = Math.round((price * margin / 100) * items);
|
|
106
|
+
const profit = Math.round((price * (margin / 100)) * items);
|
|
106
107
|
const country = this.getRandomItem(countries);
|
|
107
108
|
sales.push({
|
|
108
109
|
BundlePrice: price,
|
package/templates/webcomponents/igc-ts/grid/grid-editing/files/src/app/__path__/__filePrefix__.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable import/extensions */
|
|
1
2
|
import {
|
|
2
3
|
IgcDataGridModule,
|
|
3
4
|
IgcGridColumnOptionsModule,
|
|
@@ -80,6 +81,11 @@ export default class $(ClassName) extends HTMLElement {
|
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
connectedCallback() {
|
|
84
|
+
const grid = document.getElementsByTagName('app-grid-editing')[0].shadowRoot!.getElementById('grid') as IgcDataGridComponent;
|
|
85
|
+
const commitButton = document.getElementsByTagName('app-grid-editing')[0].shadowRoot!.getElementById('commitClick') as HTMLButtonElement;
|
|
86
|
+
const undoButton = document.getElementsByTagName('app-grid-editing')[0].shadowRoot!.getElementById('undoClick') as HTMLButtonElement;
|
|
87
|
+
const redoButton = document.getElementsByTagName('app-grid-editing')[0].shadowRoot!.getElementById('redoClick') as HTMLButtonElement;
|
|
88
|
+
|
|
83
89
|
const onCommitClick = () => {
|
|
84
90
|
grid.commitEdits();
|
|
85
91
|
commitButton.disabled = true;
|
|
@@ -115,7 +121,35 @@ export default class $(ClassName) extends HTMLElement {
|
|
|
115
121
|
}
|
|
116
122
|
};
|
|
117
123
|
|
|
118
|
-
|
|
124
|
+
if (commitButton !== null) {
|
|
125
|
+
commitButton.onclick = onCommitClick;
|
|
126
|
+
}
|
|
127
|
+
if (undoButton !== null) {
|
|
128
|
+
undoButton.onclick = onUndoClick;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (redoButton !== null) {
|
|
132
|
+
redoButton.onclick = onRedoClick;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const onDeleteRowClick = (e: MouseEvent) => {
|
|
136
|
+
const button = e.srcElement as HTMLButtonElement;
|
|
137
|
+
const viewIndex = parseInt(button.id, 10);
|
|
138
|
+
const rowItem = grid.actualDataSource.getItemAtIndex(viewIndex);
|
|
139
|
+
|
|
140
|
+
if (grid.editMode === EditModeType.CellBatch || grid.editMode === EditModeType.Row) {
|
|
141
|
+
grid.removeItem(rowItem);
|
|
142
|
+
commitButton.disabled = !grid.canCommit;
|
|
143
|
+
redoButton.disabled = !grid.canRedo;
|
|
144
|
+
undoButton.disabled = !grid.canUndo;
|
|
145
|
+
} else if (grid.editMode === EditModeType.Cell) {
|
|
146
|
+
// delete grid row immediately
|
|
147
|
+
grid.removeItem(rowItem);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const onDeleteCellUpdating = (s: IgcTemplateColumnComponent,
|
|
152
|
+
e: IgcTemplateCellUpdatingEventArgs) => {
|
|
119
153
|
const content = e.content as HTMLDivElement;
|
|
120
154
|
if (content.childElementCount === 0) {
|
|
121
155
|
const button = document.createElement('button') as HTMLButtonElement;
|
|
@@ -143,22 +177,6 @@ export default class $(ClassName) extends HTMLElement {
|
|
|
143
177
|
grid.editModeClickAction = event.target.value;
|
|
144
178
|
};
|
|
145
179
|
|
|
146
|
-
const onDeleteRowClick = (e: MouseEvent) => {
|
|
147
|
-
const button = e.srcElement as HTMLButtonElement;
|
|
148
|
-
const viewIndex = parseInt(button.id);
|
|
149
|
-
const rowItem = grid.actualDataSource.getItemAtIndex(viewIndex);
|
|
150
|
-
|
|
151
|
-
if (grid.editMode === EditModeType.CellBatch || grid.editMode === EditModeType.Row) {
|
|
152
|
-
grid.removeItem(rowItem);
|
|
153
|
-
commitButton.disabled = !grid.canCommit;
|
|
154
|
-
redoButton.disabled = !grid.canRedo;
|
|
155
|
-
undoButton.disabled = !grid.canUndo;
|
|
156
|
-
} else if (grid.editMode === EditModeType.Cell) {
|
|
157
|
-
//delete grid row immediately
|
|
158
|
-
grid.removeItem(rowItem);
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
|
|
162
180
|
const onCellValueChanging = (s: IgcDataGridComponent, e: IgcGridCellValueChangingEventArgs) => {
|
|
163
181
|
if (s.editMode === EditModeType.CellBatch || grid.editMode === EditModeType.Row) {
|
|
164
182
|
commitButton.disabled = !grid.canCommit;
|
|
@@ -170,9 +188,8 @@ export default class $(ClassName) extends HTMLElement {
|
|
|
170
188
|
commitButton.disabled = true;
|
|
171
189
|
s.setEditError(e.editID, 'Error, cell is empty');
|
|
172
190
|
}
|
|
173
|
-
|
|
191
|
+
};
|
|
174
192
|
|
|
175
|
-
const grid = document.getElementsByTagName('app-$(path)')[0].shadowRoot!.getElementById('grid') as IgcDataGridComponent;
|
|
176
193
|
if (grid !== null) {
|
|
177
194
|
grid.dataSource = this.data;
|
|
178
195
|
grid.activationMode = GridActivationMode.Cell;
|
|
@@ -181,32 +198,17 @@ export default class $(ClassName) extends HTMLElement {
|
|
|
181
198
|
grid.cellValueChanging = onCellValueChanging;
|
|
182
199
|
}
|
|
183
200
|
|
|
184
|
-
const dropDown = document.getElementsByTagName('app
|
|
201
|
+
const dropDown = document.getElementsByTagName('app-grid-editing')[0].shadowRoot!.getElementById('editModeDropBox');
|
|
185
202
|
if (dropDown !== null) {
|
|
186
203
|
dropDown.onchange = editModeChanged;
|
|
187
204
|
}
|
|
188
205
|
|
|
189
|
-
const dropDown2 = document.getElementsByTagName('app
|
|
206
|
+
const dropDown2 = document.getElementsByTagName('app-grid-editing')[0].shadowRoot!.getElementById('editModeClickActionDropBox');
|
|
190
207
|
if (dropDown2 !== null) {
|
|
191
208
|
dropDown2.onchange = editModeClickActionChanged;
|
|
192
209
|
}
|
|
193
210
|
|
|
194
|
-
|
|
195
|
-
if (commitButton !== null) {
|
|
196
|
-
commitButton.onclick = onCommitClick;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
let undoButton = document.getElementsByTagName('app-$(path)')[0].shadowRoot!.getElementById('undoClick') as HTMLButtonElement;
|
|
200
|
-
if (undoButton !== null) {
|
|
201
|
-
undoButton.onclick = onUndoClick;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
let redoButton = document.getElementsByTagName('app-$(path)')[0].shadowRoot!.getElementById('redoClick') as HTMLButtonElement;
|
|
205
|
-
if (redoButton !== null) {
|
|
206
|
-
redoButton.onclick = onRedoClick;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
const deleteRowColumn = document.getElementsByTagName('app-$(path)')[0].shadowRoot!.getElementById('deleteRowColumn') as IgcTemplateColumnComponent;
|
|
211
|
+
const deleteRowColumn = document.getElementsByTagName('app-grid-editing')[0].shadowRoot!.getElementById('deleteRowColumn') as IgcTemplateColumnComponent;
|
|
210
212
|
if (deleteRowColumn !== null) {
|
|
211
213
|
deleteRowColumn.cellUpdating = onDeleteCellUpdating;
|
|
212
214
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-param-reassign */
|
|
1
2
|
export class DataGridSharedData {
|
|
2
3
|
public static getEmployees(count?: number): any[] {
|
|
3
4
|
if (count === undefined) {
|
|
@@ -102,7 +103,7 @@ export class DataGridSharedData {
|
|
|
102
103
|
const items = this.getRandomNumber(10, 80);
|
|
103
104
|
const value = price * items;
|
|
104
105
|
const margin = this.getRandomNumber(3, 10);
|
|
105
|
-
const profit = Math.round((price * margin / 100) * items);
|
|
106
|
+
const profit = Math.round((price * (margin / 100)) * items);
|
|
106
107
|
const country = this.getRandomItem(countries);
|
|
107
108
|
sales.push({
|
|
108
109
|
BundlePrice: price,
|
package/templates/webcomponents/igc-ts/grid/grid-summaries/files/src/app/__path__/__filePrefix__.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable import/extensions, max-classes-per-file, class-methods-use-this */
|
|
1
2
|
import {
|
|
2
3
|
IgcDataGridModule,
|
|
3
4
|
IgcGridColumnOptionsModule,
|
|
@@ -62,6 +63,8 @@ export default class $(ClassName) extends HTMLElement {
|
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
connectedCallback() {
|
|
66
|
+
const grid = document.getElementsByTagName('app-grid-summaries')[0].shadowRoot!.getElementById('grid') as IgcDataGridComponent;
|
|
67
|
+
|
|
65
68
|
// Custom Calculator - calculates the count for all USA.
|
|
66
69
|
class CustomDomestic extends SummaryCalculator {
|
|
67
70
|
get displayName(): string {
|
|
@@ -81,13 +84,14 @@ export default class $(ClassName) extends HTMLElement {
|
|
|
81
84
|
|
|
82
85
|
public aggregate(a: any): void {
|
|
83
86
|
if (a.Countries === 'USA') {
|
|
84
|
-
|
|
87
|
+
this.usCountries += 1;
|
|
85
88
|
}
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
|
|
89
|
-
const onProvideCalculator = (s: IgcColumnSummaryDescription,
|
|
90
|
-
|
|
92
|
+
const onProvideCalculator = (s: IgcColumnSummaryDescription,
|
|
93
|
+
e: IgcProvideCalculatorEventArgs) => {
|
|
94
|
+
e.calculator = new CustomDomestic();
|
|
91
95
|
};
|
|
92
96
|
|
|
93
97
|
const onLoad = () => {
|
|
@@ -175,7 +179,6 @@ export default class $(ClassName) extends HTMLElement {
|
|
|
175
179
|
grid.summaryDescriptions.add(countries);
|
|
176
180
|
};
|
|
177
181
|
|
|
178
|
-
const grid = document.getElementsByTagName('app-grid-summaries')[0].shadowRoot!.getElementById('grid') as IgcDataGridComponent;
|
|
179
182
|
grid.dataSource = DataGridSharedData.getSales();
|
|
180
183
|
|
|
181
184
|
onLoad();
|