From 7cfe3d852e88e493c614dd99ed5dcb560b915693 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Mon, 28 Oct 2024 12:59:00 +0300 Subject: [PATCH 01/13] Refactor #6647 - For ScrollPanel --- .../primevue/src/scrollpanel/ScrollPanel.vue | 43 ++++++++++++++++--- .../src/scrollpanel/style/ScrollPanelStyle.js | 5 +-- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/packages/primevue/src/scrollpanel/ScrollPanel.vue b/packages/primevue/src/scrollpanel/ScrollPanel.vue index 72cdeef3a..9e53e0ec8 100644 --- a/packages/primevue/src/scrollpanel/ScrollPanel.vue +++ b/packages/primevue/src/scrollpanel/ScrollPanel.vue @@ -40,8 +40,8 @@ diff --git a/packages/primevue/src/cascadeselect/style/CascadeSelectStyle.d.ts b/packages/primevue/src/cascadeselect/style/CascadeSelectStyle.d.ts index dfd38f03a..9cf49c015 100644 --- a/packages/primevue/src/cascadeselect/style/CascadeSelectStyle.d.ts +++ b/packages/primevue/src/cascadeselect/style/CascadeSelectStyle.d.ts @@ -26,6 +26,10 @@ export enum CascadeSelectClasses { * Class name of the loading icon element */ loadingIcon = 'p-cascadeselect-loading-icon', + /** + * Class name of the dropdown icon element + */ + clearIcon = 'p-cascadeselect-clear-icon', /** * Class name of the dropdown icon element */ diff --git a/packages/primevue/src/cascadeselect/style/CascadeSelectStyle.js b/packages/primevue/src/cascadeselect/style/CascadeSelectStyle.js index 0337b74c2..268e59dd7 100644 --- a/packages/primevue/src/cascadeselect/style/CascadeSelectStyle.js +++ b/packages/primevue/src/cascadeselect/style/CascadeSelectStyle.js @@ -60,6 +60,14 @@ const theme = ({ dt }) => ` border-end-end-radius: ${dt('border.radius.md')}; } +.p-cascadeselect-clear-icon { + position: absolute; + top: 50%; + margin-top: -0.5rem; + color: ${dt('cascadeselect.clear.icon.color')}; + inset-inline-end: ${dt('cascadeselect.dropdown.width')}; +} + .p-cascadeselect-label { display: block; white-space: nowrap; @@ -262,6 +270,7 @@ const classes = { 'p-cascadeselect-label-empty': !instance.$slots['value'] && (instance.label === 'p-emptylabel' || instance.label.length === 0) } ], + clearIcon: 'p-cascadeselect-clear-icon', dropdown: 'p-cascadeselect-dropdown', loadingIcon: 'p-cascadeselect-loading-icon', dropdownIcon: 'p-cascadeselect-dropdown-icon', From 64a2df2dd5b0f3efb650c3930c1fcd6f3f97d251 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot <> Date: Mon, 28 Oct 2024 10:49:59 +0000 Subject: [PATCH 07/13] Update API doc --- apps/showcase/doc/common/apidoc/index.json | 36 ++++++++++++++++++++++ pnpm-lock.yaml | 31 ++++++++----------- 2 files changed, 49 insertions(+), 18 deletions(-) diff --git a/apps/showcase/doc/common/apidoc/index.json b/apps/showcase/doc/common/apidoc/index.json index 4e7126786..77641830f 100644 --- a/apps/showcase/doc/common/apidoc/index.json +++ b/apps/showcase/doc/common/apidoc/index.json @@ -8950,6 +8950,22 @@ "default": "", "description": "A property to uniquely identify an option." }, + { + "name": "showClear", + "optional": true, + "readonly": false, + "type": "boolean", + "default": "false", + "description": "When enabled, a clear icon is displayed to clear the value." + }, + { + "name": "clearIcon", + "optional": true, + "readonly": false, + "type": "string", + "default": "", + "description": "Icon to display in clear button." + }, { "name": "inputId", "optional": true, @@ -9298,6 +9314,19 @@ ], "returnType": "VNode[]", "description": "Custom footer template." + }, + { + "name": "clearicon", + "parameters": [ + { + "name": "scope", + "optional": false, + "type": "{\n \t clearCallback: (event: Event) ⇒ void, // Clear icon click function.\n}", + "description": "clear icon slot's params." + } + ], + "returnType": "VNode[]", + "description": "Custom clear icon template." } ] }, @@ -9545,6 +9574,13 @@ "value": "\"p-cascadeselect-loading-icon\"", "description": "Class name of the loading icon element" }, + { + "name": "clearIcon", + "optional": false, + "readonly": false, + "value": "\"p-cascadeselect-clear-icon\"", + "description": "Class name of the dropdown icon element" + }, { "name": "dropdownIcon", "optional": false, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d41911c5a..68ec60359 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -234,7 +234,7 @@ importers: devDependencies: '@nuxt/devtools': specifier: ^0.8.5 - version: 0.8.5(nuxt@3.3.2(@types/node@18.19.59)(encoding@0.1.13)(eslint@8.57.1)(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.24.2)(terser@5.36.0)(typescript@5.6.3))(rollup@4.24.2)(vite@5.4.10(@types/node@18.19.59)(terser@5.36.0)) + version: 0.8.5(nuxt@3.3.2(@types/node@18.19.59)(encoding@0.1.13)(eslint@8.57.1)(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.24.2)(terser@5.36.0)(typescript@5.6.3))(rollup@4.24.2) '@nuxt/eslint-config': specifier: ^0.2.0 version: 0.2.0(eslint@8.57.1) @@ -246,7 +246,7 @@ importers: version: 3.13.2(rollup@4.24.2) '@nuxt/test-utils': specifier: ^3.7.3 - version: 3.14.4(@vue/test-utils@2.4.6)(h3@1.13.0)(magicast@0.3.5)(nitropack@2.9.7(encoding@0.1.13)(magicast@0.3.5))(rollup@4.24.2)(vite@5.4.10(@types/node@18.19.59)(terser@5.36.0))(vitest@1.6.0(@types/node@18.19.59)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.12(typescript@5.6.3)))(vue@3.5.12(typescript@5.6.3)) + version: 3.14.4(@vue/test-utils@2.4.6)(h3@1.13.0)(magicast@0.3.5)(nitropack@2.9.7(encoding@0.1.13)(magicast@0.3.5))(rollup@4.24.2)(vitest@1.6.0(@types/node@18.19.59)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.12(typescript@5.6.3)))(vue@3.5.12(typescript@5.6.3)) '@primevue/themes': specifier: workspace:* version: link:../themes @@ -8315,13 +8315,12 @@ snapshots: '@nuxt/devalue@2.0.2': {} - '@nuxt/devtools-kit@0.8.5(magicast@0.3.5)(nuxt@3.3.2(@types/node@18.19.59)(encoding@0.1.13)(eslint@8.57.1)(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.24.2)(terser@5.36.0)(typescript@5.6.3))(rollup@4.24.2)(vite@5.4.10(@types/node@18.19.59)(terser@5.36.0))': + '@nuxt/devtools-kit@0.8.5(magicast@0.3.5)(nuxt@3.3.2(@types/node@18.19.59)(encoding@0.1.13)(eslint@8.57.1)(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.24.2)(terser@5.36.0)(typescript@5.6.3))(rollup@4.24.2)': dependencies: '@nuxt/kit': 3.13.2(magicast@0.3.5)(rollup@4.24.2) '@nuxt/schema': 3.13.2(rollup@4.24.2) execa: 7.2.0 nuxt: 3.3.2(@types/node@18.19.59)(encoding@0.1.13)(eslint@8.57.1)(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.24.2)(terser@5.36.0)(typescript@5.6.3) - vite: 5.4.10(@types/node@18.19.59)(terser@5.36.0) transitivePeerDependencies: - magicast - rollup @@ -8341,10 +8340,10 @@ snapshots: rc9: 2.1.2 semver: 7.6.3 - '@nuxt/devtools@0.8.5(nuxt@3.3.2(@types/node@18.19.59)(encoding@0.1.13)(eslint@8.57.1)(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.24.2)(terser@5.36.0)(typescript@5.6.3))(rollup@4.24.2)(vite@5.4.10(@types/node@18.19.59)(terser@5.36.0))': + '@nuxt/devtools@0.8.5(nuxt@3.3.2(@types/node@18.19.59)(encoding@0.1.13)(eslint@8.57.1)(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.24.2)(terser@5.36.0)(typescript@5.6.3))(rollup@4.24.2)': dependencies: '@antfu/utils': 0.7.10 - '@nuxt/devtools-kit': 0.8.5(magicast@0.3.5)(nuxt@3.3.2(@types/node@18.19.59)(encoding@0.1.13)(eslint@8.57.1)(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.24.2)(terser@5.36.0)(typescript@5.6.3))(rollup@4.24.2)(vite@5.4.10(@types/node@18.19.59)(terser@5.36.0)) + '@nuxt/devtools-kit': 0.8.5(magicast@0.3.5)(nuxt@3.3.2(@types/node@18.19.59)(encoding@0.1.13)(eslint@8.57.1)(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.24.2)(terser@5.36.0)(typescript@5.6.3))(rollup@4.24.2) '@nuxt/devtools-wizard': 0.8.5 '@nuxt/kit': 3.13.2(magicast@0.3.5)(rollup@4.24.2) birpc: 0.2.19 @@ -8375,9 +8374,8 @@ snapshots: simple-git: 3.27.0 sirv: 2.0.4 unimport: 3.13.1(rollup@4.24.2) - vite: 5.4.10(@types/node@18.19.59)(terser@5.36.0) - vite-plugin-inspect: 0.7.42(@nuxt/kit@3.13.2(magicast@0.3.5)(rollup@4.24.2))(rollup@4.24.2)(vite@5.4.10(@types/node@18.19.59)(terser@5.36.0)) - vite-plugin-vue-inspector: 3.7.2(vite@5.4.10(@types/node@18.19.59)(terser@5.36.0)) + vite-plugin-inspect: 0.7.42(@nuxt/kit@3.13.2(magicast@0.3.5)(rollup@4.24.2))(rollup@4.24.2) + vite-plugin-vue-inspector: 3.7.2 wait-on: 7.2.0 which: 3.0.1 ws: 8.18.0 @@ -8687,7 +8685,7 @@ snapshots: - supports-color - webpack-sources - '@nuxt/test-utils@3.14.4(@vue/test-utils@2.4.6)(h3@1.13.0)(magicast@0.3.5)(nitropack@2.9.7(encoding@0.1.13)(magicast@0.3.5))(rollup@4.24.2)(vite@5.4.10(@types/node@18.19.59)(terser@5.36.0))(vitest@1.6.0(@types/node@18.19.59)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.12(typescript@5.6.3)))(vue@3.5.12(typescript@5.6.3))': + '@nuxt/test-utils@3.14.4(@vue/test-utils@2.4.6)(h3@1.13.0)(magicast@0.3.5)(nitropack@2.9.7(encoding@0.1.13)(magicast@0.3.5))(rollup@4.24.2)(vitest@1.6.0(@types/node@18.19.59)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.12(typescript@5.6.3)))(vue@3.5.12(typescript@5.6.3))': dependencies: '@nuxt/kit': 3.13.2(magicast@0.3.5)(rollup@4.24.2) '@nuxt/schema': 3.13.2(rollup@4.24.2) @@ -8713,8 +8711,7 @@ snapshots: ufo: 1.5.4 unenv: 1.10.0 unplugin: 1.14.1(webpack-sources@3.2.3) - vite: 5.4.10(@types/node@18.19.59)(terser@5.36.0) - vitest-environment-nuxt: 1.0.1(@vue/test-utils@2.4.6)(h3@1.13.0)(magicast@0.3.5)(nitropack@2.9.7(encoding@0.1.13)(magicast@0.3.5))(rollup@4.24.2)(vite@5.4.10(@types/node@18.19.59)(terser@5.36.0))(vitest@1.6.0(@types/node@18.19.59)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.12(typescript@5.6.3)))(vue@3.5.12(typescript@5.6.3)) + vitest-environment-nuxt: 1.0.1(@vue/test-utils@2.4.6)(h3@1.13.0)(magicast@0.3.5)(nitropack@2.9.7(encoding@0.1.13)(magicast@0.3.5))(rollup@4.24.2)(vitest@1.6.0(@types/node@18.19.59)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.12(typescript@5.6.3)))(vue@3.5.12(typescript@5.6.3)) vue: 3.5.12(typescript@5.6.3) vue-router: 4.4.5(vue@3.5.12(typescript@5.6.3)) optionalDependencies: @@ -14234,7 +14231,7 @@ snapshots: optionator: 0.9.4 typescript: 5.6.3 - vite-plugin-inspect@0.7.42(@nuxt/kit@3.13.2(magicast@0.3.5)(rollup@4.24.2))(rollup@4.24.2)(vite@5.4.10(@types/node@18.19.59)(terser@5.36.0)): + vite-plugin-inspect@0.7.42(@nuxt/kit@3.13.2(magicast@0.3.5)(rollup@4.24.2))(rollup@4.24.2): dependencies: '@antfu/utils': 0.7.10 '@rollup/pluginutils': 5.1.3(rollup@4.24.2) @@ -14244,14 +14241,13 @@ snapshots: open: 9.1.0 picocolors: 1.1.1 sirv: 2.0.4 - vite: 5.4.10(@types/node@18.19.59)(terser@5.36.0) optionalDependencies: '@nuxt/kit': 3.13.2(magicast@0.3.5)(rollup@4.24.2) transitivePeerDependencies: - rollup - supports-color - vite-plugin-vue-inspector@3.7.2(vite@5.4.10(@types/node@18.19.59)(terser@5.36.0)): + vite-plugin-vue-inspector@3.7.2: dependencies: '@babel/core': 7.26.0 '@babel/plugin-proposal-decorators': 7.25.9(@babel/core@7.26.0) @@ -14262,7 +14258,6 @@ snapshots: '@vue/compiler-dom': 3.5.12 kolorist: 1.8.0 magic-string: 0.30.12 - vite: 5.4.10(@types/node@18.19.59)(terser@5.36.0) transitivePeerDependencies: - supports-color @@ -14299,9 +14294,9 @@ snapshots: fsevents: 2.3.3 terser: 5.36.0 - vitest-environment-nuxt@1.0.1(@vue/test-utils@2.4.6)(h3@1.13.0)(magicast@0.3.5)(nitropack@2.9.7(encoding@0.1.13)(magicast@0.3.5))(rollup@4.24.2)(vite@5.4.10(@types/node@18.19.59)(terser@5.36.0))(vitest@1.6.0(@types/node@18.19.59)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.12(typescript@5.6.3)))(vue@3.5.12(typescript@5.6.3)): + vitest-environment-nuxt@1.0.1(@vue/test-utils@2.4.6)(h3@1.13.0)(magicast@0.3.5)(nitropack@2.9.7(encoding@0.1.13)(magicast@0.3.5))(rollup@4.24.2)(vitest@1.6.0(@types/node@18.19.59)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.12(typescript@5.6.3)))(vue@3.5.12(typescript@5.6.3)): dependencies: - '@nuxt/test-utils': 3.14.4(@vue/test-utils@2.4.6)(h3@1.13.0)(magicast@0.3.5)(nitropack@2.9.7(encoding@0.1.13)(magicast@0.3.5))(rollup@4.24.2)(vite@5.4.10(@types/node@18.19.59)(terser@5.36.0))(vitest@1.6.0(@types/node@18.19.59)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.12(typescript@5.6.3)))(vue@3.5.12(typescript@5.6.3)) + '@nuxt/test-utils': 3.14.4(@vue/test-utils@2.4.6)(h3@1.13.0)(magicast@0.3.5)(nitropack@2.9.7(encoding@0.1.13)(magicast@0.3.5))(rollup@4.24.2)(vitest@1.6.0(@types/node@18.19.59)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.12(typescript@5.6.3)))(vue@3.5.12(typescript@5.6.3)) transitivePeerDependencies: - '@cucumber/cucumber' - '@jest/globals' From c5250dc92d5a10f29c6ff247e27a71497d4bde5c Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Mon, 28 Oct 2024 13:53:23 +0300 Subject: [PATCH 08/13] Update CascadeSelect.d.ts --- packages/primevue/src/cascadeselect/CascadeSelect.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/primevue/src/cascadeselect/CascadeSelect.d.ts b/packages/primevue/src/cascadeselect/CascadeSelect.d.ts index cc1bf6e4a..e7db1a3e8 100644 --- a/packages/primevue/src/cascadeselect/CascadeSelect.d.ts +++ b/packages/primevue/src/cascadeselect/CascadeSelect.d.ts @@ -88,6 +88,10 @@ export interface CascadeSelectPassThroughOptions { * Used to pass attributes to the label's DOM element. */ label?: CascadeSelectPassThroughOptionType; + /** + * Used to pass attributes to the label's DOM element. + */ + clearIcon?: CascadeSelectPassThroughOptionType; /** * Used to pass attributes to the dropdown button's DOM element. */ From aa7965204fdc4e4641da60d743619d1e8fe024c5 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot <> Date: Mon, 28 Oct 2024 10:54:29 +0000 Subject: [PATCH 09/13] Update API doc --- apps/showcase/doc/common/apidoc/index.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/showcase/doc/common/apidoc/index.json b/apps/showcase/doc/common/apidoc/index.json index 77641830f..13c29858f 100644 --- a/apps/showcase/doc/common/apidoc/index.json +++ b/apps/showcase/doc/common/apidoc/index.json @@ -8517,6 +8517,14 @@ "default": "", "description": "Used to pass attributes to the label's DOM element." }, + { + "name": "clearIcon", + "optional": true, + "readonly": false, + "type": "CascadeSelectPassThroughOptionType", + "default": "", + "description": "Used to pass attributes to the label's DOM element." + }, { "name": "dropdown", "optional": true, From b019abd939e77e4427f8ed6e9317f5956baca1ae Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Mon, 28 Oct 2024 14:00:24 +0300 Subject: [PATCH 10/13] Refactor #6654 - For MultiSelect --- .../src/multiselect/BaseMultiSelect.vue | 12 ++++++++ .../primevue/src/multiselect/MultiSelect.d.ts | 29 +++++++++++++++++++ .../primevue/src/multiselect/MultiSelect.vue | 14 ++++++++- .../src/multiselect/style/MultiSelectStyle.js | 9 ++++++ 4 files changed, 63 insertions(+), 1 deletion(-) diff --git a/packages/primevue/src/multiselect/BaseMultiSelect.vue b/packages/primevue/src/multiselect/BaseMultiSelect.vue index a8a6bc616..ccdff789e 100644 --- a/packages/primevue/src/multiselect/BaseMultiSelect.vue +++ b/packages/primevue/src/multiselect/BaseMultiSelect.vue @@ -38,6 +38,18 @@ export default { default: null }, dataKey: null, + showClear: { + type: Boolean, + default: false + }, + clearIcon: { + type: String, + default: undefined + }, + resetFilterOnClear: { + type: Boolean, + default: false + }, filter: Boolean, filterPlaceholder: String, filterLocale: String, diff --git a/packages/primevue/src/multiselect/MultiSelect.d.ts b/packages/primevue/src/multiselect/MultiSelect.d.ts index 450a01c37..a5b11320a 100755 --- a/packages/primevue/src/multiselect/MultiSelect.d.ts +++ b/packages/primevue/src/multiselect/MultiSelect.d.ts @@ -131,6 +131,10 @@ export interface MultiSelectPassThroughOptions { * Used to pass attributes to the label's DOM element. */ label?: MultiSelectPassThroughOptionType; + /** + * Used to pass attributes to the label's DOM element. + */ + clearIcon?: MultiSelectPassThroughOptionType; /** * Used to pass attributes to the chip's DOM element. */ @@ -407,6 +411,20 @@ export interface MultiSelectProps { * A property to uniquely identify an option. */ dataKey?: string | undefined; + /** + * When enabled, a clear icon is displayed to clear the value. + * @defaultValue false + */ + showClear?: boolean | undefined; + /** + * Icon to display in clear button. + */ + clearIcon?: string | undefined; + /** + * Clears the filter value when clicking on the clear icon. + * @defaultValue false + */ + resetFilterOnClear?: boolean; /** * When specified, displays a filter input at header. * @defaultValue false @@ -803,6 +821,17 @@ export interface MultiSelectSlots { */ class: string; }): VNode[]; + /** + * Custom clear icon template. + * @param {Object} scope - clear icon slot's params. + */ + clearicon(scope: { + /** + * Clear icon click function. + * @param {Event} event - Browser event + */ + clearCallback: (event: Event) => void; + }): VNode[]; /** * Custom dropdown icon template. * @param {Object} scope - dropdownicon slot's params. diff --git a/packages/primevue/src/multiselect/MultiSelect.vue b/packages/primevue/src/multiselect/MultiSelect.vue index ef8171d06..e41e677d4 100755 --- a/packages/primevue/src/multiselect/MultiSelect.vue +++ b/packages/primevue/src/multiselect/MultiSelect.vue @@ -50,6 +50,9 @@ + + +