@xh/hoist 79.0.0-SNAPSHOT.1764016856678 → 79.0.0-SNAPSHOT.1764345478420
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/build/types/cmp/grid/GridModel.d.ts +17 -17
- package/cmp/grid/GridModel.ts +29 -21
- package/data/Store.ts +4 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -326,39 +326,39 @@ export declare class GridModel extends HoistModel {
|
|
|
326
326
|
localExport(filename: string, type: 'excel' | 'csv', params?: PlainObject): void;
|
|
327
327
|
/**
|
|
328
328
|
* Select records in the grid.
|
|
329
|
-
*
|
|
330
329
|
* @param records - one or more record(s) / ID(s) to select.
|
|
331
|
-
* @param
|
|
332
|
-
* ensureVisible - true to make selection visible if it is within a
|
|
333
|
-
* collapsed node or outside of the visible scroll window. Default true.
|
|
334
|
-
* clearSelection - true to clear previous selection (rather than
|
|
335
|
-
* add to it). Default true.
|
|
330
|
+
* @param opts - additional post-selection options
|
|
336
331
|
*/
|
|
337
332
|
selectAsync(records: Some<StoreRecordOrId>, opts?: {
|
|
333
|
+
/**
|
|
334
|
+
* True (default) to scroll the grid or expand nodes as needed to make selection
|
|
335
|
+
* visible if it is within a collapsed node or outside of the visible scroll window.
|
|
336
|
+
*/
|
|
338
337
|
ensureVisible?: boolean;
|
|
338
|
+
/** True (default) to clear previous selection (rather than add to it). */
|
|
339
339
|
clearSelection?: boolean;
|
|
340
340
|
}): Promise<void>;
|
|
341
341
|
/**
|
|
342
342
|
* Select the first row in the grid.
|
|
343
343
|
*
|
|
344
|
-
* See {@link preSelectFirstAsync} for a useful variant of this method
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
* @param opts -
|
|
349
|
-
* expandParentGroups - set to true to expand nodes to allow selection when the
|
|
350
|
-
* first selectable node is in a collapsed group. Default true.
|
|
351
|
-
* ensureVisible - set to to true to scroll to the selected row if it is outside of the
|
|
352
|
-
* visible scroll window. Default true.
|
|
353
|
-
*
|
|
344
|
+
* See {@link preSelectFirstAsync} for a useful variant of this method that will leave the
|
|
345
|
+
* any pre-existing selection unchanged, which is what apps typically want when reloading an
|
|
346
|
+
* already-populated grid.
|
|
354
347
|
*/
|
|
355
348
|
selectFirstAsync(opts?: {
|
|
349
|
+
/**
|
|
350
|
+
* True (default) to expand nodes as needed to allow selection when the first selectable
|
|
351
|
+
* node is in a collapsed group.
|
|
352
|
+
*/
|
|
356
353
|
expandParentGroups?: boolean;
|
|
354
|
+
/**
|
|
355
|
+
* True (default) to scroll the grid or expand nodes as needed to make selection
|
|
356
|
+
* visible if it is outside of the visible scroll window.
|
|
357
|
+
*/
|
|
357
358
|
ensureVisible?: boolean;
|
|
358
359
|
}): Promise<void>;
|
|
359
360
|
/**
|
|
360
361
|
* Select the first row in the grid, if no other selection present.
|
|
361
|
-
*
|
|
362
362
|
* This method delegates to {@link selectFirstAsync}.
|
|
363
363
|
*/
|
|
364
364
|
preSelectFirstAsync(): Promise<void>;
|
package/cmp/grid/GridModel.ts
CHANGED
|
@@ -751,19 +751,22 @@ export class GridModel extends HoistModel {
|
|
|
751
751
|
|
|
752
752
|
/**
|
|
753
753
|
* Select records in the grid.
|
|
754
|
-
*
|
|
755
754
|
* @param records - one or more record(s) / ID(s) to select.
|
|
756
|
-
* @param
|
|
757
|
-
* ensureVisible - true to make selection visible if it is within a
|
|
758
|
-
* collapsed node or outside of the visible scroll window. Default true.
|
|
759
|
-
* clearSelection - true to clear previous selection (rather than
|
|
760
|
-
* add to it). Default true.
|
|
755
|
+
* @param opts - additional post-selection options
|
|
761
756
|
*/
|
|
762
757
|
async selectAsync(
|
|
763
758
|
records: Some<StoreRecordOrId>,
|
|
764
|
-
opts
|
|
759
|
+
opts: {
|
|
760
|
+
/**
|
|
761
|
+
* True (default) to scroll the grid or expand nodes as needed to make selection
|
|
762
|
+
* visible if it is within a collapsed node or outside of the visible scroll window.
|
|
763
|
+
*/
|
|
764
|
+
ensureVisible?: boolean;
|
|
765
|
+
/** True (default) to clear previous selection (rather than add to it). */
|
|
766
|
+
clearSelection?: boolean;
|
|
767
|
+
} = {}
|
|
765
768
|
) {
|
|
766
|
-
const {ensureVisible = true, clearSelection = true} = opts
|
|
769
|
+
const {ensureVisible = true, clearSelection = true} = opts;
|
|
767
770
|
this.selModel.select(records, clearSelection);
|
|
768
771
|
if (ensureVisible) await this.ensureSelectionVisibleAsync();
|
|
769
772
|
}
|
|
@@ -771,19 +774,25 @@ export class GridModel extends HoistModel {
|
|
|
771
774
|
/**
|
|
772
775
|
* Select the first row in the grid.
|
|
773
776
|
*
|
|
774
|
-
* See {@link preSelectFirstAsync} for a useful variant of this method
|
|
775
|
-
*
|
|
776
|
-
*
|
|
777
|
-
*
|
|
778
|
-
* @param opts -
|
|
779
|
-
* expandParentGroups - set to true to expand nodes to allow selection when the
|
|
780
|
-
* first selectable node is in a collapsed group. Default true.
|
|
781
|
-
* ensureVisible - set to to true to scroll to the selected row if it is outside of the
|
|
782
|
-
* visible scroll window. Default true.
|
|
783
|
-
*
|
|
777
|
+
* See {@link preSelectFirstAsync} for a useful variant of this method that will leave the
|
|
778
|
+
* any pre-existing selection unchanged, which is what apps typically want when reloading an
|
|
779
|
+
* already-populated grid.
|
|
784
780
|
*/
|
|
785
|
-
async selectFirstAsync(
|
|
786
|
-
|
|
781
|
+
async selectFirstAsync(
|
|
782
|
+
opts: {
|
|
783
|
+
/**
|
|
784
|
+
* True (default) to expand nodes as needed to allow selection when the first selectable
|
|
785
|
+
* node is in a collapsed group.
|
|
786
|
+
*/
|
|
787
|
+
expandParentGroups?: boolean;
|
|
788
|
+
/**
|
|
789
|
+
* True (default) to scroll the grid or expand nodes as needed to make selection
|
|
790
|
+
* visible if it is outside of the visible scroll window.
|
|
791
|
+
*/
|
|
792
|
+
ensureVisible?: boolean;
|
|
793
|
+
} = {}
|
|
794
|
+
) {
|
|
795
|
+
const {expandParentGroups = true, ensureVisible = true} = opts;
|
|
787
796
|
await this.whenReadyAsync();
|
|
788
797
|
if (!this.isReady) return;
|
|
789
798
|
|
|
@@ -803,7 +812,6 @@ export class GridModel extends HoistModel {
|
|
|
803
812
|
|
|
804
813
|
/**
|
|
805
814
|
* Select the first row in the grid, if no other selection present.
|
|
806
|
-
*
|
|
807
815
|
* This method delegates to {@link selectFirstAsync}.
|
|
808
816
|
*/
|
|
809
817
|
async preSelectFirstAsync() {
|
package/data/Store.ts
CHANGED
|
@@ -763,7 +763,10 @@ export class Store extends HoistBase {
|
|
|
763
763
|
/** True if the store has changes which need to be committed. */
|
|
764
764
|
@computed
|
|
765
765
|
get isDirty(): boolean {
|
|
766
|
-
return
|
|
766
|
+
return (
|
|
767
|
+
this._current !== this._committed ||
|
|
768
|
+
(this.summaryRecords?.some(it => it.isModified) ?? false)
|
|
769
|
+
);
|
|
767
770
|
}
|
|
768
771
|
|
|
769
772
|
/** Alias for {@link Store.isDirty} */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "79.0.0-SNAPSHOT.
|
|
3
|
+
"version": "79.0.0-SNAPSHOT.1764345478420",
|
|
4
4
|
"description": "Hoist add-on for building and deploying React Applications.",
|
|
5
5
|
"repository": "github:xh/hoist-react",
|
|
6
6
|
"homepage": "https://xh.io",
|