@wavemaker-ai/app-ng-runtime 12.0.1-rc.338 → 12.0.2-rc.344
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/components/base/bundles/index.umd.js +3 -0
- package/components/base/fesm2022/index.mjs +3 -0
- package/components/base/fesm2022/index.mjs.map +1 -1
- package/components/basic/tree/bundles/index.umd.js +3 -0
- package/components/basic/tree/fesm2022/index.mjs +3 -0
- package/components/basic/tree/fesm2022/index.mjs.map +1 -1
- package/components/data/form/bundles/index.umd.js +4 -0
- package/components/data/form/fesm2022/index.mjs +4 -0
- package/components/data/form/fesm2022/index.mjs.map +1 -1
- package/components/data/live-table/bundles/index.umd.js +7 -2
- package/components/data/live-table/fesm2022/index.mjs +7 -2
- package/components/data/live-table/fesm2022/index.mjs.map +1 -1
- package/components/data/table/bundles/index.umd.js +17 -0
- package/components/data/table/fesm2022/index.mjs +17 -0
- package/components/data/table/fesm2022/index.mjs.map +1 -1
- package/components/data/table/types/index.d.ts +1 -0
- package/components/input/epoch/date/bundles/index.umd.js +7 -1
- package/components/input/epoch/date/fesm2022/index.mjs +7 -1
- package/components/input/epoch/date/fesm2022/index.mjs.map +1 -1
- package/components/input/slider/bundles/index.umd.js +1 -1
- package/components/input/slider/fesm2022/index.mjs +1 -1
- package/components/input/slider/fesm2022/index.mjs.map +1 -1
- package/components/input/slider/types/index.d.ts +1 -1
- package/core/bundles/index.umd.js +6 -5
- package/core/fesm2022/index.mjs +6 -5
- package/core/fesm2022/index.mjs.map +1 -1
- package/core/types/index.d.ts +2 -1
- package/npm-shrinkwrap.json +2 -2
- package/package-lock.json +2 -2
- package/package.json +1 -1
|
@@ -94,8 +94,13 @@
|
|
|
94
94
|
}
|
|
95
95
|
focusFirstInput() {
|
|
96
96
|
const $firstInput = $(this.form.$element).find('input').first();
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
if (!$firstInput.length || !$firstInput.is(':visible')) {
|
|
98
|
+
setTimeout(() => { $firstInput.focus(); $firstInput.select(); }, 200);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
$firstInput.focus();
|
|
102
|
+
$firstInput.select();
|
|
103
|
+
}
|
|
99
104
|
}
|
|
100
105
|
onDialogOpen(action) {
|
|
101
106
|
const attrs = this?.form?.formFields?.[0]?.$attrs ?? new Map();
|
|
@@ -76,8 +76,13 @@ class LiveTableComponent extends StylableComponent {
|
|
|
76
76
|
}
|
|
77
77
|
focusFirstInput() {
|
|
78
78
|
const $firstInput = $(this.form.$element).find('input').first();
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
if (!$firstInput.length || !$firstInput.is(':visible')) {
|
|
80
|
+
setTimeout(() => { $firstInput.focus(); $firstInput.select(); }, 200);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
$firstInput.focus();
|
|
84
|
+
$firstInput.select();
|
|
85
|
+
}
|
|
81
86
|
}
|
|
82
87
|
onDialogOpen(action) {
|
|
83
88
|
const attrs = this?.form?.formFields?.[0]?.$attrs ?? new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../projects/components/widgets/data/live-table/src/live-table.props.ts","../../../../../projects/components/widgets/data/live-table/src/live-table.component.ts","../../../../../projects/components/widgets/data/live-table/src/live-table.component.html","../../../../../projects/components/widgets/data/live-table/src/index.ts"],"sourcesContent":["import { PROP_BOOLEAN, PROP_STRING, register } from '@wm/components/base';\n\nexport const registerProps = () => {\n register(\n 'wm-livetable',\n new Map(\n [\n ['class', PROP_STRING],\n ['formlayout', PROP_STRING],\n ['name', PROP_STRING],\n ['show', {value: true, ...PROP_BOOLEAN}],\n ]\n )\n );\n};\n","import {\n AfterContentInit,\n Attribute,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ElementRef,\n Inject,\n Injector,\n OnDestroy,\n Optional\n} from '@angular/core';\n\nimport {debounceTime} from 'rxjs/operators';\nimport {Subscription} from 'rxjs';\n\nimport {$appDigest, AbstractDialogService, App, getClonedObject, isDefined, triggerFn} from '@wm/core';\nimport {provideAsWidgetRef, StylableComponent, styler} from '@wm/components/base';\nimport {TableComponent} from '@wm/components/data/table';\n\nimport {registerProps} from './live-table.props';\n\ndeclare const $: any;\n\nconst DEFAULT_CLS = 'app-livegrid';\nconst WIDGET_CONFIG = {widgetType: 'wm-livetable', hostClass: DEFAULT_CLS};\n\n@Component({\n standalone: true,\n selector: '[wmLiveTable]',\n templateUrl: './live-table.component.html',\n providers: [\n provideAsWidgetRef(LiveTableComponent)\n ]\n})\nexport class LiveTableComponent extends StylableComponent implements AfterContentInit, OnDestroy {\n static readonly initializeProps = registerProps();\n @ContentChild(TableComponent) table: TableComponent;\n\n form;\n isLayoutDialog: boolean;\n\n private readonly dialogId;\n private $queue = [];\n private selectedItemChangeSubscription: Subscription;\n\n private readonly tableOptions: any = {\n 'multiselect': false,\n 'setGridEditMode': ''\n };\n\n constructor(\n inj: Injector,\n elRef: ElementRef,\n cdr: ChangeDetectorRef,\n private readonly dialogService: AbstractDialogService,\n private readonly app: App,\n @Attribute('formlayout') layoutType: string,\n @Attribute('dialogid') dialogId: string,\n @Inject('EXPLICIT_CONTEXT') @Optional() explicitContext: any\n ) {\n super(inj, WIDGET_CONFIG, explicitContext);\n styler(this.nativeElement, this);\n if (layoutType === 'dialog') {\n this.isLayoutDialog = true;\n this.dialogId = dialogId;\n }\n }\n\n ngAfterContentInit() {\n super.ngAfterContentInit();\n if (this.table) {\n this.table._liveTableParent = this;\n \n // Defer live-table configuration to ensure parent table datatable is initialized (Angular 20 timing)\n const configureLiveTable = () => {\n if (typeof this.table.datagridElement.datatable === 'function' && this.table.datagridElement.datatable('instance')) {\n this.table.datagridElement.datatable('option', this.tableOptions);\n\n this.selectedItemChangeSubscription = this.table.selectedItemChange$\n .pipe(debounceTime(250))\n .subscribe(this.onSelectedItemChange.bind(this));\n\n if (!this.isLayoutDialog && !this.form) {\n this.table.datagridElement.datatable('option', {\n 'beforeRowUpdate' : () => {\n this.showErrorMessage();\n },\n 'beforeRowDelete' : () => {\n this.showErrorMessage();\n },\n 'beforeRowInsert' : () => {\n this.showErrorMessage();\n }\n });\n }\n } else {\n // Parent table not initialized yet, retry\n setTimeout(configureLiveTable, 50);\n }\n };\n setTimeout(configureLiveTable, 0);\n }\n }\n\n openDialog() {\n this.dialogService.open(this.dialogId, this.viewParent);\n $appDigest();\n }\n\n closeDialog() {\n this.dialogService.close(this.dialogId, this.viewParent);\n }\n\n focusFirstInput() {\n const $firstInput = $(this.form.$element).find('input').first();\n $firstInput.focus();\n $firstInput.select();\n }\n\n onDialogOpen(action) {\n const attrs: Map<string, string> = this?.form?.formFields?.[0]?.$attrs ?? new Map();\n const hasDefault = [\"defaultvalue\", \"defaultvalue.bind\"].some(key => attrs.has(key));\n if (action == 'update'||!!hasDefault) {\n const firstFormField = $(\"form [wmformfield]\").first();\n if (firstFormField.find(\"div[widget='autocomplete']\").length != 1 && this?.form?.formFields?.[0]?.widgettype != 'autocomplete') { // prevent focusing first form field if widget is autocomplete\n this.focusFirstInput();\n }\n } else {\n this.focusFirstInput();\n }\n }\n\n setFormData(val) {\n if (!this.form.isDestroyed) {\n this.form.getWidget().formdata = val;\n }\n }\n\n private _addNewRow() {\n this.form.isSelected = true;\n this.setFormData('');\n\n this.form.new();\n\n if (this.isLayoutDialog) {\n this.onDialogOpen('add');\n }\n }\n\n addNewRow() {\n if (this.isLayoutDialog) {\n this.openDialog();\n this.$queue.push(this._addNewRow.bind(this));\n return;\n }\n\n this._addNewRow();\n }\n\n private _updateRow(row, eventName) {\n this.setFormData(row);\n this.form.isSelected = true;\n this.form.edit();\n\n if (this.isLayoutDialog) {\n this.form.isUpdateMode = (eventName === 'dblclick') ? this.form.updateMode : true;\n this.onDialogOpen('update');\n }\n }\n\n updateRow(row, eventName) {\n\n if (this.isLayoutDialog) {\n this.openDialog();\n this.$queue.push(this._updateRow.bind(this, row, eventName));\n return;\n }\n\n this._updateRow(row, eventName);\n }\n\n onSelectedItemChange(newValue) {\n let rowData;\n if (!this.form || !this.table) {\n return;\n }\n\n if (newValue && newValue.length > 0 && !this.form.isSelected) {\n this.form.isSelected = true;\n }\n\n /*Update the rowdata of only that grid form that is associated with the specific grid on which row selection is being performed...\n * Since both the grid & gridform are associated with the same \"parentgrid\", match the same*/\n if (newValue && newValue.length > 0) {\n if (this.table.multiselect) {\n rowData = newValue[0];\n } else {\n rowData = newValue[newValue.length - 1];\n }\n\n this.setFormData(getClonedObject(rowData));\n /*If the form is already in update mode, call the form update function*/\n if (this.form.isUpdateMode) {\n this.form.edit();\n }\n } else {\n this.form.isSelected = false;\n this.setFormData('');\n this.form.clearData();\n }\n }\n\n onCancel() {\n this.form.isUpdateMode = false;\n if (this.isLayoutDialog) {\n this.closeDialog();\n }\n }\n\n onResult(operation, response, newForm, updateMode) {\n this.form.isUpdateMode = isDefined(updateMode) ? updateMode : newForm ? true : false;\n switch (operation) {\n case 'insert':\n if (this.table.gridOptions.isNavTypeScrollOrOndemand()) {\n this.table.isNewRowInserted = true;\n }\n if (newForm) {\n /*if new form is to be shown after insert, skip the highlight of the row*/\n this.table.gridfirstrowselect = false;\n this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(), response, true);\n } else {\n /*The new row would always be inserted at the end of all existing records. Hence navigate to the last page and highlight the inserted row.*/\n this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(), response);\n }\n break;\n case 'update':\n /*The updated row would be found in the current page itself. Hence simply highlight the row in the current page.*/\n if (newForm) {\n this.table.gridfirstrowselect = false;\n this.table.initiateSelectItem('current', response, true);\n } else {\n this.table.initiateSelectItem('current', response);\n }\n break;\n case 'delete':\n this.table.onRecordDelete();\n break;\n }\n this.table.updateVariable();\n if (this.isLayoutDialog) {\n /*if new form is to be shown after update or insert, don't close the dialog*/\n if (newForm) {\n if (operation === 'insert') {\n this.form.new();\n } else if (operation === 'update') {\n this.form.edit();\n }\n } else {\n this.closeDialog();\n }\n }\n }\n\n showErrorMessage() {\n this.app.notifyApp(this.appLocale.LABEL_ACCESS_DENIED, 'error');\n }\n\n // In dialog mode, on form render call the queued functions\n onFormReady(form) {\n this.form = form;\n setTimeout(() => {\n triggerFn(this.$queue.pop());\n });\n }\n\n ngOnDestroy() {\n // MEMORY LEAK FIX: Unsubscribe from selectedItemChange$\n if (this.selectedItemChangeSubscription) {\n this.selectedItemChangeSubscription.unsubscribe();\n this.selectedItemChangeSubscription = null;\n }\n\n // MEMORY LEAK FIX: Clear ContentChild reference\n this.table = null;\n\n // MEMORY LEAK FIX: Clear queue array\n this.$queue = [];\n\n super.ngOnDestroy();\n }\n}\n","<ng-content></ng-content>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAEO,MAAM,aAAa,GAAG,MAAK;AAC9B,IAAA,QAAQ,CACJ,cAAc,EACd,IAAI,GAAG,CACH;QACI,CAAC,OAAO,EAAE,WAAW,CAAC;QACtB,CAAC,YAAY,EAAE,WAAW,CAAC;QAC3B,CAAC,MAAM,EAAE,WAAW,CAAC;QACrB,CAAC,MAAM,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,GAAG,YAAY,EAAC,CAAC;AAC3C,KAAA,CACJ,CACJ;AACL,CAAC;;ACUD,MAAM,WAAW,GAAG,cAAc;AAClC,MAAM,aAAa,GAAG,EAAC,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAC;AAUpE,MAAO,kBAAmB,SAAQ,iBAAiB,CAAA;AACrC,IAAA,SAAA,IAAA,CAAA,eAAe,GAAG,aAAa,EAAhB,CAAmB;AAelD,IAAA,WAAA,CACI,GAAa,EACb,KAAiB,EACjB,GAAsB,EACL,aAAoC,EACpC,GAAQ,EACA,UAAkB,EACpB,QAAgB,EACC,eAAoB,EAAA;AAE5D,QAAA,KAAK,CAAC,GAAG,EAAE,aAAa,EAAE,eAAe,CAAC;QANzB,IAAA,CAAA,aAAa,GAAb,aAAa;QACb,IAAA,CAAA,GAAG,G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.mjs","sources":["../../../../../projects/components/widgets/data/live-table/src/live-table.props.ts","../../../../../projects/components/widgets/data/live-table/src/live-table.component.ts","../../../../../projects/components/widgets/data/live-table/src/live-table.component.html","../../../../../projects/components/widgets/data/live-table/src/index.ts"],"sourcesContent":["import { PROP_BOOLEAN, PROP_STRING, register } from '@wm/components/base';\n\nexport const registerProps = () => {\n register(\n 'wm-livetable',\n new Map(\n [\n ['class', PROP_STRING],\n ['formlayout', PROP_STRING],\n ['name', PROP_STRING],\n ['show', {value: true, ...PROP_BOOLEAN}],\n ]\n )\n );\n};\n","import {\n AfterContentInit,\n Attribute,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ElementRef,\n Inject,\n Injector,\n OnDestroy,\n Optional\n} from '@angular/core';\n\nimport {debounceTime} from 'rxjs/operators';\nimport {Subscription} from 'rxjs';\n\nimport {$appDigest, AbstractDialogService, App, getClonedObject, isDefined, triggerFn} from '@wm/core';\nimport {provideAsWidgetRef, StylableComponent, styler} from '@wm/components/base';\nimport {TableComponent} from '@wm/components/data/table';\n\nimport {registerProps} from './live-table.props';\n\ndeclare const $: any;\n\nconst DEFAULT_CLS = 'app-livegrid';\nconst WIDGET_CONFIG = {widgetType: 'wm-livetable', hostClass: DEFAULT_CLS};\n\n@Component({\n standalone: true,\n selector: '[wmLiveTable]',\n templateUrl: './live-table.component.html',\n providers: [\n provideAsWidgetRef(LiveTableComponent)\n ]\n})\nexport class LiveTableComponent extends StylableComponent implements AfterContentInit, OnDestroy {\n static readonly initializeProps = registerProps();\n @ContentChild(TableComponent) table: TableComponent;\n\n form;\n isLayoutDialog: boolean;\n\n private readonly dialogId;\n private $queue = [];\n private selectedItemChangeSubscription: Subscription;\n\n private readonly tableOptions: any = {\n 'multiselect': false,\n 'setGridEditMode': ''\n };\n\n constructor(\n inj: Injector,\n elRef: ElementRef,\n cdr: ChangeDetectorRef,\n private readonly dialogService: AbstractDialogService,\n private readonly app: App,\n @Attribute('formlayout') layoutType: string,\n @Attribute('dialogid') dialogId: string,\n @Inject('EXPLICIT_CONTEXT') @Optional() explicitContext: any\n ) {\n super(inj, WIDGET_CONFIG, explicitContext);\n styler(this.nativeElement, this);\n if (layoutType === 'dialog') {\n this.isLayoutDialog = true;\n this.dialogId = dialogId;\n }\n }\n\n ngAfterContentInit() {\n super.ngAfterContentInit();\n if (this.table) {\n this.table._liveTableParent = this;\n\n // Defer live-table configuration to ensure parent table datatable is initialized (Angular 20 timing)\n const configureLiveTable = () => {\n if (typeof this.table.datagridElement.datatable === 'function' && this.table.datagridElement.datatable('instance')) {\n this.table.datagridElement.datatable('option', this.tableOptions);\n\n this.selectedItemChangeSubscription = this.table.selectedItemChange$\n .pipe(debounceTime(250))\n .subscribe(this.onSelectedItemChange.bind(this));\n\n if (!this.isLayoutDialog && !this.form) {\n this.table.datagridElement.datatable('option', {\n 'beforeRowUpdate' : () => {\n this.showErrorMessage();\n },\n 'beforeRowDelete' : () => {\n this.showErrorMessage();\n },\n 'beforeRowInsert' : () => {\n this.showErrorMessage();\n }\n });\n }\n } else {\n // Parent table not initialized yet, retry\n setTimeout(configureLiveTable, 50);\n }\n };\n setTimeout(configureLiveTable, 0);\n }\n }\n\n openDialog() {\n this.dialogService.open(this.dialogId, this.viewParent);\n $appDigest();\n }\n\n closeDialog() {\n this.dialogService.close(this.dialogId, this.viewParent);\n }\n\n focusFirstInput() {\n const $firstInput = $(this.form.$element).find('input').first();\n if (!$firstInput.length || !$firstInput.is(':visible')) {\n setTimeout(()=>{$firstInput.focus(); $firstInput.select();},200);\n }else{\n $firstInput.focus();\n $firstInput.select();\n }\n }\n\n onDialogOpen(action) {\n const attrs: Map<string, string> = this?.form?.formFields?.[0]?.$attrs ?? new Map();\n const hasDefault = [\"defaultvalue\", \"defaultvalue.bind\"].some(key => attrs.has(key));\n if (action == 'update'||!!hasDefault) {\n const firstFormField = $(\"form [wmformfield]\").first();\n if (firstFormField.find(\"div[widget='autocomplete']\").length != 1 && this?.form?.formFields?.[0]?.widgettype != 'autocomplete') { // prevent focusing first form field if widget is autocomplete\n this.focusFirstInput();\n }\n } else {\n this.focusFirstInput();\n }\n }\n\n setFormData(val) {\n if (!this.form.isDestroyed) {\n this.form.getWidget().formdata = val;\n }\n }\n\n private _addNewRow() {\n this.form.isSelected = true;\n this.setFormData('');\n\n this.form.new();\n\n if (this.isLayoutDialog) {\n this.onDialogOpen('add');\n }\n }\n\n addNewRow() {\n if (this.isLayoutDialog) {\n this.openDialog();\n this.$queue.push(this._addNewRow.bind(this));\n return;\n }\n\n this._addNewRow();\n }\n\n private _updateRow(row, eventName) {\n this.setFormData(row);\n this.form.isSelected = true;\n this.form.edit();\n\n if (this.isLayoutDialog) {\n this.form.isUpdateMode = (eventName === 'dblclick') ? this.form.updateMode : true;\n this.onDialogOpen('update');\n }\n }\n\n updateRow(row, eventName) {\n\n if (this.isLayoutDialog) {\n this.openDialog();\n this.$queue.push(this._updateRow.bind(this, row, eventName));\n return;\n }\n\n this._updateRow(row, eventName);\n }\n\n onSelectedItemChange(newValue) {\n let rowData;\n if (!this.form || !this.table) {\n return;\n }\n\n if (newValue && newValue.length > 0 && !this.form.isSelected) {\n this.form.isSelected = true;\n }\n\n /*Update the rowdata of only that grid form that is associated with the specific grid on which row selection is being performed...\n * Since both the grid & gridform are associated with the same \"parentgrid\", match the same*/\n if (newValue && newValue.length > 0) {\n if (this.table.multiselect) {\n rowData = newValue[0];\n } else {\n rowData = newValue[newValue.length - 1];\n }\n\n this.setFormData(getClonedObject(rowData));\n /*If the form is already in update mode, call the form update function*/\n if (this.form.isUpdateMode) {\n this.form.edit();\n }\n } else {\n this.form.isSelected = false;\n this.setFormData('');\n this.form.clearData();\n }\n }\n\n onCancel() {\n this.form.isUpdateMode = false;\n if (this.isLayoutDialog) {\n this.closeDialog();\n }\n }\n\n onResult(operation, response, newForm, updateMode) {\n this.form.isUpdateMode = isDefined(updateMode) ? updateMode : newForm ? true : false;\n switch (operation) {\n case 'insert':\n if (this.table.gridOptions.isNavTypeScrollOrOndemand()) {\n this.table.isNewRowInserted = true;\n }\n if (newForm) {\n /*if new form is to be shown after insert, skip the highlight of the row*/\n this.table.gridfirstrowselect = false;\n this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(), response, true);\n } else {\n /*The new row would always be inserted at the end of all existing records. Hence navigate to the last page and highlight the inserted row.*/\n this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(), response);\n }\n break;\n case 'update':\n /*The updated row would be found in the current page itself. Hence simply highlight the row in the current page.*/\n if (newForm) {\n this.table.gridfirstrowselect = false;\n this.table.initiateSelectItem('current', response, true);\n } else {\n this.table.initiateSelectItem('current', response);\n }\n break;\n case 'delete':\n this.table.onRecordDelete();\n break;\n }\n this.table.updateVariable();\n if (this.isLayoutDialog) {\n /*if new form is to be shown after update or insert, don't close the dialog*/\n if (newForm) {\n if (operation === 'insert') {\n this.form.new();\n } else if (operation === 'update') {\n this.form.edit();\n }\n } else {\n this.closeDialog();\n }\n }\n }\n\n showErrorMessage() {\n this.app.notifyApp(this.appLocale.LABEL_ACCESS_DENIED, 'error');\n }\n\n // In dialog mode, on form render call the queued functions\n onFormReady(form) {\n this.form = form;\n setTimeout(() => {\n triggerFn(this.$queue.pop());\n });\n }\n\n ngOnDestroy() {\n // MEMORY LEAK FIX: Unsubscribe from selectedItemChange$\n if (this.selectedItemChangeSubscription) {\n this.selectedItemChangeSubscription.unsubscribe();\n this.selectedItemChangeSubscription = null;\n }\n\n // MEMORY LEAK FIX: Clear ContentChild reference\n this.table = null;\n\n // MEMORY LEAK FIX: Clear queue array\n this.$queue = [];\n\n super.ngOnDestroy();\n }\n}\n","<ng-content></ng-content>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAEO,MAAM,aAAa,GAAG,MAAK;AAC9B,IAAA,QAAQ,CACJ,cAAc,EACd,IAAI,GAAG,CACH;QACI,CAAC,OAAO,EAAE,WAAW,CAAC;QACtB,CAAC,YAAY,EAAE,WAAW,C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,8BACb,kBAAkB,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAxBrB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,SAAA,EAJhB;YACP,kBAAkB,CAAC,kBAAkB;SACxC,EAAA,OAAA,EAAA,CAAA,EAAA,YAAA,EAAA,OAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAIa,cAAc,uECrChC,2BAAyB,EAAA,CAAA,CAAA;;4FDmCZ,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAR9B,SAAS;iCACM,IAAI,EAAA,QAAA,EACN,eAAe,EAAA,SAAA,EAEd;AACP,wBAAA,kBAAkB,CAAA,kBAAA;AACrB,qBAAA,EAAA,QAAA,EAAA,2BAAA,EAAA;;0BAwBI,SAAS;2BAAC,YAAY;;0BACtB,SAAS;2BAAC,UAAU;;0BACpB,MAAM;2BAAC,kBAAkB;;0BAAG;;sBAtBhC,YAAY;uBAAC,cAAc;;;AErChC;;AAEG;;;;"}
|
|
@@ -2195,6 +2195,10 @@
|
|
|
2195
2195
|
case 'show':
|
|
2196
2196
|
if (nv) {
|
|
2197
2197
|
this.invokeEventCallback('show');
|
|
2198
|
+
// recompute layout now that the table is visible again
|
|
2199
|
+
if (this.datagridElement) {
|
|
2200
|
+
this.redraw(false);
|
|
2201
|
+
}
|
|
2198
2202
|
}
|
|
2199
2203
|
else {
|
|
2200
2204
|
this.invokeEventCallback('hide');
|
|
@@ -4440,6 +4444,12 @@
|
|
|
4440
4444
|
}
|
|
4441
4445
|
}
|
|
4442
4446
|
loadFilterData() {
|
|
4447
|
+
// Skip re-populating with the full/unfiltered list when this filter is currently cascaded
|
|
4448
|
+
// from another row-filter's value (via "Filter On Field").
|
|
4449
|
+
const filterOnValue = this.filteronfilter && this.table?.rowFilter?.[this.filteronfilter]?.value;
|
|
4450
|
+
if (i2.isDefined(filterOnValue) && filterOnValue !== '') {
|
|
4451
|
+
return;
|
|
4452
|
+
}
|
|
4443
4453
|
// If filterdataset is not bound, get the data implicitly
|
|
4444
4454
|
if (this._isRowFilter && i4.isDataSetWidget(this.filterwidget) && !this.bindfilterdataset) {
|
|
4445
4455
|
// For live variable, get the data using distinct API
|
|
@@ -4572,12 +4582,19 @@
|
|
|
4572
4582
|
const content = item;
|
|
4573
4583
|
if (content instanceof Promise) {
|
|
4574
4584
|
content.then(res => {
|
|
4585
|
+
// the directive (and this.table) can be destroyed before an async summary value resolves
|
|
4586
|
+
if (!this.table) {
|
|
4587
|
+
return;
|
|
4588
|
+
}
|
|
4575
4589
|
this.table.callDataGridMethod('setSummaryRowDef', this.key, res, index, true);
|
|
4576
4590
|
});
|
|
4577
4591
|
}
|
|
4578
4592
|
else if (content.value && content.value instanceof Promise) {
|
|
4579
4593
|
const contentData = content;
|
|
4580
4594
|
content.value.then(res => {
|
|
4595
|
+
if (!this.table) {
|
|
4596
|
+
return;
|
|
4597
|
+
}
|
|
4581
4598
|
contentData.value = res;
|
|
4582
4599
|
this.table.callDataGridMethod('setSummaryRowDef', this.key, contentData, index, true);
|
|
4583
4600
|
});
|
|
@@ -2185,6 +2185,10 @@ class TableComponent extends StylableComponent {
|
|
|
2185
2185
|
case 'show':
|
|
2186
2186
|
if (nv) {
|
|
2187
2187
|
this.invokeEventCallback('show');
|
|
2188
|
+
// recompute layout now that the table is visible again
|
|
2189
|
+
if (this.datagridElement) {
|
|
2190
|
+
this.redraw(false);
|
|
2191
|
+
}
|
|
2188
2192
|
}
|
|
2189
2193
|
else {
|
|
2190
2194
|
this.invokeEventCallback('hide');
|
|
@@ -4430,6 +4434,12 @@ class TableColumnDirective extends BaseComponent {
|
|
|
4430
4434
|
}
|
|
4431
4435
|
}
|
|
4432
4436
|
loadFilterData() {
|
|
4437
|
+
// Skip re-populating with the full/unfiltered list when this filter is currently cascaded
|
|
4438
|
+
// from another row-filter's value (via "Filter On Field").
|
|
4439
|
+
const filterOnValue = this.filteronfilter && this.table?.rowFilter?.[this.filteronfilter]?.value;
|
|
4440
|
+
if (isDefined(filterOnValue) && filterOnValue !== '') {
|
|
4441
|
+
return;
|
|
4442
|
+
}
|
|
4433
4443
|
// If filterdataset is not bound, get the data implicitly
|
|
4434
4444
|
if (this._isRowFilter && isDataSetWidget(this.filterwidget) && !this.bindfilterdataset) {
|
|
4435
4445
|
// For live variable, get the data using distinct API
|
|
@@ -4562,12 +4572,19 @@ class TableColumnDirective extends BaseComponent {
|
|
|
4562
4572
|
const content = item;
|
|
4563
4573
|
if (content instanceof Promise) {
|
|
4564
4574
|
content.then(res => {
|
|
4575
|
+
// the directive (and this.table) can be destroyed before an async summary value resolves
|
|
4576
|
+
if (!this.table) {
|
|
4577
|
+
return;
|
|
4578
|
+
}
|
|
4565
4579
|
this.table.callDataGridMethod('setSummaryRowDef', this.key, res, index, true);
|
|
4566
4580
|
});
|
|
4567
4581
|
}
|
|
4568
4582
|
else if (content.value && content.value instanceof Promise) {
|
|
4569
4583
|
const contentData = content;
|
|
4570
4584
|
content.value.then(res => {
|
|
4585
|
+
if (!this.table) {
|
|
4586
|
+
return;
|
|
4587
|
+
}
|
|
4571
4588
|
contentData.value = res;
|
|
4572
4589
|
this.table.callDataGridMethod('setSummaryRowDef', this.key, contentData, index, true);
|
|
4573
4590
|
});
|