From b85be19225edb0edcd63ea2ad93c6a06cdc60a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Wed, 7 Jun 2023 16:50:56 +0300 Subject: [PATCH] Refactor #3965 - Reimplementation DataTable for VirtualScroller --- .../lib/basecomponent/BaseComponent.vue | 13 ++++++ components/lib/datatable/BodyCell.vue | 32 +++++++-------- components/lib/datatable/ColumnFilter.vue | 40 +++++++++---------- components/lib/datatable/FooterCell.vue | 2 +- components/lib/datatable/HeaderCell.vue | 12 +++--- components/lib/datatable/HeaderCheckbox.vue | 10 ++--- components/lib/datatable/RowCheckbox.vue | 10 ++--- components/lib/datatable/RowRadioButton.vue | 8 ++-- components/lib/datatable/TableBody.vue | 22 +++++----- components/lib/datatable/TableFooter.vue | 2 +- components/lib/datatable/TableHeader.vue | 2 +- 11 files changed, 83 insertions(+), 70 deletions(-) diff --git a/components/lib/basecomponent/BaseComponent.vue b/components/lib/basecomponent/BaseComponent.vue index b7ec02fc5..ed10c7fd4 100644 --- a/components/lib/basecomponent/BaseComponent.vue +++ b/components/lib/basecomponent/BaseComponent.vue @@ -76,6 +76,9 @@ export default { cx(key = '', params = {}) { return !this.isUnstyled ? this._getOptionValue(this.$css.classes, key, { instance: this, props: this.$props, state: this.$data, parentInstance: this.$parentInstance, ...params }) : undefined; }, + cxo(key = '', params = {}) { + return !this.isUnstyled ? this._getOptionValue(this.$parentInstance.$parentInstance.$css.classes, key, { instance: this, props: this.$props, state: this.$data, parentInstance: this.$parentInstance, ...params }) : undefined; + }, sx(key = '', when = true, params = {}) { if (when) { const self = this._getOptionValue(this.$css.inlineStyles, key, { instance: this, props: this.$props, state: this.$data, parentInstance: this.$parentInstance, ...params }); @@ -84,6 +87,16 @@ export default { return [base, self]; } + return undefined; + }, + sxo(key = '', when = true, params = {}) { + if (when) { + const self = this._getOptionValue(this.$parentInstance.$parentInstance.$css.inlineStyles, key, { instance: this, props: this.$props, state: this.$data, parentInstance: this.$parentInstance, ...params }); + const base = this._getOptionValue(inlineStyles, key, { instance: this, props: this.$props, state: this.$data, parentInstance: this.$parentInstance, ...params }); + + return [base, self]; + } + return undefined; } }, diff --git a/components/lib/datatable/BodyCell.vue b/components/lib/datatable/BodyCell.vue index 078cab88f..18e3706d7 100755 --- a/components/lib/datatable/BodyCell.vue +++ b/components/lib/datatable/BodyCell.vue @@ -15,7 +15,7 @@ :data-p-cell-editing="d_editing" :data-p-frozen-column="columnProp('frozen')" > - {{ columnProp('header') }} + {{ columnProp('header') }} @@ -464,7 +464,7 @@ export default { return this.columnProp('field'); }, containerClass() { - return [this.columnProp('bodyClass'), this.columnProp('class'), this.cx('bodyCell')]; + return [this.columnProp('bodyClass'), this.columnProp('class'), this.cxo('bodyCell')]; }, containerStyle() { let bodyStyle = this.columnProp('bodyStyle'); diff --git a/components/lib/datatable/ColumnFilter.vue b/components/lib/datatable/ColumnFilter.vue index 3ab266eb0..1f0d111d6 100644 --- a/components/lib/datatable/ColumnFilter.vue +++ b/components/lib/datatable/ColumnFilter.vue @@ -1,6 +1,6 @@