From d1f4ac5c8bab4163b86f69aa7a8af7e715e5c5ad Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Mon, 27 May 2024 12:24:31 +0300 Subject: [PATCH] Refactor #5785 --- api-generator/components/column.js | 6 +- api-generator/components/datatable.js | 2 +- api-generator/components/fieldset.js | 2 +- api-generator/components/organizationchart.js | 2 +- api-generator/components/panel.js | 2 +- api-generator/components/tree.js | 2 +- api-generator/components/treeselect.js | 2 +- api-generator/components/treetable.js | 2 +- components/lib/datatable/DataTable.vue | 2 +- .../organizationchart/OrganizationChart.d.ts | 11 +++ .../OrganizationChartNode.vue | 3 +- components/lib/tree/Tree.d.ts | 34 ++++++++- components/lib/tree/TreeNode.vue | 8 ++- components/lib/tree/style/TreeStyle.d.ts | 4 -- components/lib/tree/style/TreeStyle.js | 1 - components/lib/treeselect/TreeSelect.d.ts | 15 ++++ components/lib/treeselect/TreeSelect.vue | 6 +- doc/common/apidoc/index.json | 69 ++++++++++++++++--- 18 files changed, 138 insertions(+), 35 deletions(-) diff --git a/api-generator/components/column.js b/api-generator/components/column.js index dc142833a..7018f8ae5 100644 --- a/api-generator/components/column.js +++ b/api-generator/components/column.js @@ -301,11 +301,7 @@ const ColumnSlots = [ description: 'Custom loading template.' }, { - name: 'rowtogglericon', - description: 'Custom row toggler icon template.' - }, - { - name: 'rowtogglericon', + name: 'rowtoggleicon', description: 'Custom row toggler icon template.' }, { diff --git a/api-generator/components/datatable.js b/api-generator/components/datatable.js index 0ff00b8c0..d9396113c 100644 --- a/api-generator/components/datatable.js +++ b/api-generator/components/datatable.js @@ -1177,7 +1177,7 @@ const DataTableSlots = [ description: 'Custom reorder indicator down icon template.' }, { - name: 'rowgrouptogglericon', + name: 'rowgrouptoggleicon', description: 'Custom rowgroup toggler icon template.' }, { diff --git a/api-generator/components/fieldset.js b/api-generator/components/fieldset.js index c14b42828..a15a03b05 100644 --- a/api-generator/components/fieldset.js +++ b/api-generator/components/fieldset.js @@ -62,7 +62,7 @@ const FieldsetSlots = [ description: 'Custom legend template.' }, { - name: 'togglericon', + name: 'toggleicon', description: 'Custom toggler icon template.' } ]; diff --git a/api-generator/components/organizationchart.js b/api-generator/components/organizationchart.js index c96c59765..696712895 100644 --- a/api-generator/components/organizationchart.js +++ b/api-generator/components/organizationchart.js @@ -92,7 +92,7 @@ const OrganizationChartEvents = [ const OrganizationChartSlots = [ { - name: 'togglericon', + name: 'toggleicon', description: 'Custom toggler icon template.' } ]; diff --git a/api-generator/components/panel.js b/api-generator/components/panel.js index fc6c55e0a..f49cb01b4 100644 --- a/api-generator/components/panel.js +++ b/api-generator/components/panel.js @@ -66,7 +66,7 @@ const PanelSlots = [ description: "Custom content for the header's icon." }, { - name: 'togglericon', + name: 'toggleicon', description: "Custom content for the component's toggler icon." }, { diff --git a/api-generator/components/tree.js b/api-generator/components/tree.js index f38735277..f0cba052c 100644 --- a/api-generator/components/tree.js +++ b/api-generator/components/tree.js @@ -155,7 +155,7 @@ const TreeSlots = [ description: 'Custom search icon template.' }, { - name: 'togglericon', + name: 'toggleicon', description: 'Custom toggler icon template.' }, { diff --git a/api-generator/components/treeselect.js b/api-generator/components/treeselect.js index 5d77a42a7..3a210341b 100644 --- a/api-generator/components/treeselect.js +++ b/api-generator/components/treeselect.js @@ -224,7 +224,7 @@ const TreeSelectSlots = [ description: 'Custom content for the dropdown indicator' }, { - name: 'itemtogglericon', + name: 'itemtoggleicon', description: 'Custom item toggler icon template.' }, { diff --git a/api-generator/components/treetable.js b/api-generator/components/treetable.js index a85a360ba..0f1c6d42b 100644 --- a/api-generator/components/treetable.js +++ b/api-generator/components/treetable.js @@ -478,7 +478,7 @@ const TreeTableSlots = [ description: 'Custom loading icon template.' }, { - name: 'togglericon', + name: 'toggleicon', description: 'Custom toggler icon template.' }, { diff --git a/components/lib/datatable/DataTable.vue b/components/lib/datatable/DataTable.vue index 6c3c1a37c..491a4f422 100755 --- a/components/lib/datatable/DataTable.vue +++ b/components/lib/datatable/DataTable.vue @@ -792,7 +792,7 @@ export default { this.rowTouched = false; if (focusedItem) { - if (event.target?.getAttribute('data-pc-section') === 'rowtogglericon' || event.target?.parentElement?.getAttribute('data-pc-section') === 'rowtogglericon') return; + if (event.target?.getAttribute('data-pc-section') === 'rowtoggleicon' || event.target?.parentElement?.getAttribute('data-pc-section') === 'rowtoggleicon') return; const targetRow = event.target?.closest('tr[data-p-selectable-row="true"]'); diff --git a/components/lib/organizationchart/OrganizationChart.d.ts b/components/lib/organizationchart/OrganizationChart.d.ts index c6269ebf2..80df84341 100755 --- a/components/lib/organizationchart/OrganizationChart.d.ts +++ b/components/lib/organizationchart/OrganizationChart.d.ts @@ -293,6 +293,7 @@ export interface OrganizationChartSlots { */ [key: string]: (node: any) => VNode[]; /** + * @deprecated since v4.0. Use 'toggleicon' slot instead. * Custom toggler icon template. * @param {Object} scope - togglericon slot's params. */ @@ -302,6 +303,16 @@ export interface OrganizationChartSlots { */ expanded: boolean; }): VNode[]; + /** + * Custom toggler icon template. + * @param {Object} scope - togglericon slot's params. + */ + toggleicon(scope: { + /** + * Curent state of the node + */ + expanded: boolean; + }): VNode[]; } /** diff --git a/components/lib/organizationchart/OrganizationChartNode.vue b/components/lib/organizationchart/OrganizationChartNode.vue index b8fc71ee0..08d9882e3 100755 --- a/components/lib/organizationchart/OrganizationChartNode.vue +++ b/components/lib/organizationchart/OrganizationChartNode.vue @@ -6,7 +6,8 @@
- + +
diff --git a/components/lib/tree/Tree.d.ts b/components/lib/tree/Tree.d.ts index 85fcafa93..cbbeaafb6 100755 --- a/components/lib/tree/Tree.d.ts +++ b/components/lib/tree/Tree.d.ts @@ -378,8 +378,9 @@ export interface TreeSlots { class: string; }): VNode[]; /** - * Custom toggler icon template. - * @param {Object} scope - togglericon slot's params. + * @deprecated since v4.0. Use 'nodetoggleicon' slot instead. + * Custom toggle icon template. + * @param {Object} scope - toggleicon slot's params. */ togglericon(scope: { /** @@ -391,6 +392,35 @@ export interface TreeSlots { */ expanded: boolean; }): VNode[]; + /** + * @deprecated since v4.0. Use 'nodetoggleicon' slot instead. + * Custom node toggle icon template. + * @param {Object} scope - toggleicon slot's params. + */ + nodetogglericon(scope: { + /** + * Tree node instance + */ + node: TreeNode; + /** + * Expanded state of the node + */ + expanded: boolean; + }): VNode[]; + /** + * Custom node toggle icon template. + * @param {Object} scope - toggleicon slot's params. + */ + nodetoggleicon(scope: { + /** + * Tree node instance + */ + node: TreeNode; + /** + * Expanded state of the node + */ + expanded: boolean; + }): VNode[]; /** * Custom node icon template. * @param {Object} scope - nodeicon slot's params. diff --git a/components/lib/tree/TreeNode.vue b/components/lib/tree/TreeNode.vue index aabc290bf..ad7446e4c 100755 --- a/components/lib/tree/TreeNode.vue +++ b/components/lib/tree/TreeNode.vue @@ -17,11 +17,13 @@