diff --git a/CHANGELOG.md b/CHANGELOG.md index 365f8fd52..8d791d457 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,25 +1,65 @@ # Changelog +## [3.43.0](https://github.com/primefaces/primevue/tree/3.43.0) (2023-12-05) + +[Full Changelog](https://github.com/primefaces/primevue/compare/3.42.0...3.43.0) + +**Fixed bugs:** + +- Calendar: Overwrites date when in time-only mode [\#4901](https://github.com/primefaces/primevue/issues/4901) +- Binding and ordering pt options defect [\#4921](https://github.com/primefaces/primevue/issues/4921) +- Some icons are not displaying from PrimeIcons.js Api file [\#4897](https://github.com/primefaces/primevue/issues/4897) +- Treetable lazy load plus pagination toggler icon remain as open [\#4441](https://github.com/primefaces/primevue/issues/4441) + +**Implemented New Features and Enhancements:** + +- Add parent param to all pt method options [\#4929](https://github.com/primefaces/primevue/issues/4929) +- Media components Accessibility Improvements [\#4908](https://github.com/primefaces/primevue/issues/4908) +- Tree: Missing 'filter' event on search [\#4876](https://github.com/primefaces/primevue/issues/4876) + +## [3.42.0](https://github.com/primefaces/primevue/tree/3.42.0) (2023-11-28) + +[Full Changelog](https://github.com/primefaces/primevue/compare/3.41.1...3.42.0) + +**Breaking Changes:** + +- Menu components: width changed as min-width [\#4870](https://github.com/primefaces/primevue/issues/4870) + +**Fixed bugs:** + +- Splitter: aria-valuenow calculation defect [\#4889](https://github.com/primefaces/primevue/issues/4889) +- Listbox: select-on-focus causes a crash [\#4881](https://github.com/primefaces/primevue/issues/4881) +- Listbox: Tab key support defect when filter mode is on [\#4875](https://github.com/primefaces/primevue/issues/4875) +- Editor: Readonly prop does not react to any change [\#4872](https://github.com/primefaces/primevue/issues/4872) +- DataTable: Type definition doesn't match document [\#4662](https://github.com/primefaces/primevue/issues/4662) +- Wrong types issue with aria-label and aria-labelledby Props [\#4511](https://github.com/primefaces/primevue/issues/4511) + +**Implemented New Features and Enhancements:** + +- Tree / TreeTable: new loadingMode property [\#4886](https://github.com/primefaces/primevue/issues/4886) +- Improve InlineMessage Implementation for Accessibility [\#4880](https://github.com/primefaces/primevue/issues/4880) +- Calendar: new iconDisplay property [\#4871](https://github.com/primefaces/primevue/issues/4871) + ## [3.41.1](https://github.com/primefaces/primevue/tree/3.41.1) (2023-11-22) [Full Changelog](https://github.com/primefaces/primevue/compare/3.41.0...3.41.1) **Breaking Changes:** -- StyleClass: deprecate enterClass/leaveClass use enterFromClass/leaveFromClass [\#4866](https://github.com/primefaces/primevue/issues/486&) -- Listbox: metaKeySelection default changed as true [\#4865](https://github.com/primefaces/primevue/issues/4865) +- StyleClass: deprecate enterClass/leaveClass use enterFromClass/leaveFromClass [\#4866](https://github.com/primefaces/primevue/issues/486&) +- Listbox: metaKeySelection default changed as true [\#4865](https://github.com/primefaces/primevue/issues/4865) **Fixed bugs:** -- DataTable: restore state defect [\#4855](https://github.com/primefaces/primevue/issues/4855) -- PanelMenu: Menu items with no sub-items toggling border radius [\#4816](https://github.com/primefaces/primevue/issues/4816) -- Column: Missing typing for sorticon [\#4423](https://github.com/primefaces/primevue/issues/4423) +- DataTable: restore state defect [\#4855](https://github.com/primefaces/primevue/issues/4855) +- PanelMenu: Menu items with no sub-items toggling border radius [\#4816](https://github.com/primefaces/primevue/issues/4816) +- Column: Missing typing for sorticon [\#4423](https://github.com/primefaces/primevue/issues/4423) **Implemented New Features and Enhancements:** -- Button: new badgeSeverity property [\#4863](https://github.com/primefaces/primevue/issues/4863) -- MegaMenu / Menubar: menubutton templating [\#4862](https://github.com/primefaces/primevue/issues/4862) -- Calendar: Week Number customization [\#4669](https://github.com/primefaces/primevue/issues/4669) +- Button: new badgeSeverity property [\#4863](https://github.com/primefaces/primevue/issues/4863) +- MegaMenu / Menubar: menubutton templating [\#4862](https://github.com/primefaces/primevue/issues/4862) +- Calendar: Week Number customization [\#4669](https://github.com/primefaces/primevue/issues/4669) ## [3.41.0](https://github.com/primefaces/primevue/tree/3.41.0) (2023-11-20) @@ -2221,14 +2261,14 @@ **Implemented New Features and Enhancements:** -- v2 DataTable: Frozen column improvements [\#4795](https://github.com/primefaces/primevue/issues/4795) -- TreeTable: Add custom header for column [\#2941](https://github.com/primefaces/primevue/issues/2941) +- v2 DataTable: Frozen column improvements [\#4795](https://github.com/primefaces/primevue/issues/4795) +- TreeTable: Add custom header for column [\#2941](https://github.com/primefaces/primevue/issues/2941) **Fixed bugs:** -- OrderList: order of selection reversed when moving multiple items to top or bottom [\#4700](https://github.com/primefaces/primevue/issues/4700) -- Calendar: Crashes when Tab pressed and calendar overlay is not showing [\#4586](https://github.com/primefaces/primevue/issues/4586) -- Calendar: Months are not highlighted with selection-mode="multiple" [\#3988](https://github.com/primefaces/primevue/issues/3988) +- OrderList: order of selection reversed when moving multiple items to top or bottom [\#4700](https://github.com/primefaces/primevue/issues/4700) +- Calendar: Crashes when Tab pressed and calendar overlay is not showing [\#4586](https://github.com/primefaces/primevue/issues/4586) +- Calendar: Months are not highlighted with selection-mode="multiple" [\#3988](https://github.com/primefaces/primevue/issues/3988) ## [2.10.2](https://github.com/primefaces/primevue/tree/2.10.2) (2023-08-16) diff --git a/assets/data/news.json b/assets/data/news.json index 42f9ada36..d659a76a2 100644 --- a/assets/data/news.json +++ b/assets/data/news.json @@ -1,8 +1,8 @@ { - "id": 45, - "content": "🎉 Black Friday Sale! Up to 50% Off", - "linkText": "Buy Now", - "linkHref": "https://www.primefaces.org/store", + "id": 46, + "content": "Sakai Free Admin Template", + "linkText": "View Demo", + "linkHref": "https://sakai.primefaces.org", "backgroundStyle": "background-color:var(--primary-color)", "textStyle": "color:var(--primary-color-text);font-weight:500", "linkStyle": "color:var(--primary-color-text);font-weight:700;text-decoration: underline;" diff --git a/assets/menu/menu.json b/assets/menu/menu.json index e4021cf7a..d754d176c 100644 --- a/assets/menu/menu.json +++ b/assets/menu/menu.json @@ -448,10 +448,6 @@ "name": "Overview", "to": "/theming" }, - { - "name": "Visual Editor", - "href": "https://designer.primevue.org" - }, { "name": "Colors", "to": "/colors" diff --git a/components/doc/DocApiTable.vue b/components/doc/DocApiTable.vue index f9b99f517..b0e7d61f9 100644 --- a/components/doc/DocApiTable.vue +++ b/components/doc/DocApiTable.vue @@ -29,14 +29,14 @@ @@ -111,7 +111,7 @@ export default { }); }, isLinkType(value) { - if (this.label === 'Slots') return false; + if (this.label === 'Slots' || value.includes('SharedPassThroughOption') || value.includes('PassThrough<')) return false; const validValues = ['confirmationoptions', 'toastmessageoptions']; return value.toLowerCase().includes(this.id.split('.')[1]) || validValues.includes(value.toLowerCase()); diff --git a/components/doc/codeeditor/templates.js b/components/doc/codeeditor/templates.js index b857d2685..8ba1b306c 100644 --- a/components/doc/codeeditor/templates.js +++ b/components/doc/codeeditor/templates.js @@ -2,7 +2,7 @@ import pkg from '../../../package.json'; import { services } from './services'; const PrimeVue = { - version: '^3.40.0', + version: '^3.43.0', description: 'PrimeVue is an open source UI library for Vue featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock, which has 400+ ready to use UI blocks to build spectacular applications in no time.' }; @@ -60,7 +60,7 @@ const getVueApp = (props = {}, sourceType) => { if (embedded) { // main.js - unstyled += `, unstyled: true, pt: Tailwind, ptOptions: { mergeProps: true }`; + unstyled += `, unstyled: true, pt: Tailwind`; imports += `import Tailwind from 'primevue/passthrough/tailwind'; import ThemeSwitcher from './components/ThemeSwitcher.vue';`; element += `app.component('ThemeSwitcher', ThemeSwitcher);`; diff --git a/components/doc/helpers/PTHelper.js b/components/doc/helpers/PTHelper.js index 76675d28f..b6c79714e 100644 --- a/components/doc/helpers/PTHelper.js +++ b/components/doc/helpers/PTHelper.js @@ -7,10 +7,21 @@ export const getPTOption = (name) => { for (const [i, prop] of props.entries()) { if (options) { + let subCompName, subOptions; + let hasSubComp = prop.name !== 'hooks' && prop.type.indexOf('TransitionType') === -1 && prop.type.indexOf('<') > -1 && name.toLowerCase() !== prop.type.slice(0, prop.type.indexOf('<')).toLowerCase(); + + if (hasSubComp) { + subCompName = prop.type.slice(0, prop.type.indexOf('<')).replace('PassThroughOptions', '').replace('PassThroughOptionType', ''); + subOptions = APIDocs[subCompName.toLowerCase()].interfaces.values[`${subCompName}PassThroughMethodOptions`]; + const objToReplace = subOptions.props.find((opt) => opt.name === 'parent'); + + objToReplace.type = prop.type; + } + data.push({ value: i + 1, label: prop.name, - options: options?.props, + options: hasSubComp ? subOptions?.props : options?.props, description: prop.description }); } else { diff --git a/components/lib/accordion/Accordion.d.ts b/components/lib/accordion/Accordion.d.ts index b3f3fece9..fdb67e367 100755 --- a/components/lib/accordion/Accordion.d.ts +++ b/components/lib/accordion/Accordion.d.ts @@ -31,6 +31,10 @@ export interface AccordionPassThroughMethodOptions { * Defines current inline state. */ state: AccordionState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/accordion/Accordion.vue b/components/lib/accordion/Accordion.vue index 601382f12..2814f52dd 100755 --- a/components/lib/accordion/Accordion.vue +++ b/components/lib/accordion/Accordion.vue @@ -106,6 +106,7 @@ export default { const tabMetaData = { props: tab.props || {}, parent: { + instance: this, props: this.$props, state: this.$data }, diff --git a/components/lib/accordiontab/AccordionTab.d.ts b/components/lib/accordiontab/AccordionTab.d.ts index e7c54415a..41ca49c03 100755 --- a/components/lib/accordiontab/AccordionTab.d.ts +++ b/components/lib/accordiontab/AccordionTab.d.ts @@ -8,7 +8,6 @@ * */ import { AnchorHTMLAttributes, HTMLAttributes, TransitionProps, VNode } from 'vue'; -import { AccordionPassThroughOptions } from '../accordion'; import { PassThroughOptions } from '../passthrough'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; @@ -29,9 +28,9 @@ export interface AccordionTabPassThroughMethodOptions { */ props: AccordionTabProps; /** - * Defines parent instance. + * Defines parent options. */ - parent: AccordionPassThroughOptions; + parent: any; /** * Defines current options. */ diff --git a/components/lib/api/PrimeIcons.js b/components/lib/api/PrimeIcons.js index 6ac54c4a8..118cbab4a 100644 --- a/components/lib/api/PrimeIcons.js +++ b/components/lib/api/PrimeIcons.js @@ -193,20 +193,20 @@ const PrimeIcons = { SLIDERS_V: 'pi pi-sliders-v', SORT: 'pi pi-sort', SORT_ALPHA_DOWN: 'pi pi-sort-alpha-down', - SORT_ALPHA_ALT_DOWN: 'pi pi-sort-alpha-alt-down', + SORT_ALPHA_ALT_DOWN: 'pi pi-sort-alpha-down-alt', SORT_ALPHA_UP: 'pi pi-sort-alpha-up', - SORT_ALPHA_ALT_UP: 'pi pi-sort-alpha-alt-up', + SORT_ALPHA_ALT_UP: 'pi pi-sort-alpha-up-alt', SORT_ALT: 'pi pi-sort-alt', - SORT_ALT_SLASH: 'pi pi-sort-slash', + SORT_ALT_SLASH: 'pi pi-sort-alt-slash', SORT_AMOUNT_DOWN: 'pi pi-sort-amount-down', SORT_AMOUNT_DOWN_ALT: 'pi pi-sort-amount-down-alt', SORT_AMOUNT_UP: 'pi pi-sort-amount-up', SORT_AMOUNT_UP_ALT: 'pi pi-sort-amount-up-alt', SORT_DOWN: 'pi pi-sort-down', SORT_NUMERIC_DOWN: 'pi pi-sort-numeric-down', - SORT_NUMERIC_ALT_DOWN: 'pi pi-sort-numeric-alt-down', + SORT_NUMERIC_ALT_DOWN: 'pi pi-sort-numeric-down-alt', SORT_NUMERIC_UP: 'pi pi-sort-numeric-up', - SORT_NUMERIC_ALT_UP: 'pi pi-sort-numeric-alt-up', + SORT_NUMERIC_ALT_UP: 'pi pi-sort-numeric-up-alt', SORT_UP: 'pi pi-sort-up', SPINNER: 'pi pi-spinner', STAR: 'pi pi-star', @@ -216,7 +216,7 @@ const PrimeIcons = { STEP_FORWARD: 'pi pi-step-forward', STEP_FORWARD_ALT: 'pi pi-step-forward-alt', STOP: 'pi pi-stop', - STOPWATCH: 'pi pi-stop-watch', + STOPWATCH: 'pi pi-stopwatch', STOP_CIRCLE: 'pi pi-stop-circle', SUN: 'pi pi-sun', SYNC: 'pi pi-sync', diff --git a/components/lib/autocomplete/AutoComplete.d.ts b/components/lib/autocomplete/AutoComplete.d.ts index f808f8f35..0d0cb7183 100755 --- a/components/lib/autocomplete/AutoComplete.d.ts +++ b/components/lib/autocomplete/AutoComplete.d.ts @@ -9,7 +9,7 @@ */ import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; -import { ButtonPassThroughOptionType } from '../button'; +import { ButtonPassThroughOptions } from '../button'; import { PassThroughOptions } from '../passthrough'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; import { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from '../virtualscroller'; @@ -38,12 +38,30 @@ export interface AutoCompletePassThroughMethodOptions { * Defines current options. */ context: AutoCompleteContext; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ global: object | undefined; } +/** + * Custom shared passthrough(pt) option method. + */ +export interface AutoCompleteSharedPassThroughMethodOptions { + /** + * Defines valid properties. + */ + props: AutoCompleteProps; + /** + * Defines current inline state. + */ + state: AutoCompleteState; +} + /** * Custom change event. * @see {@link AutoCompleteEmits.change} @@ -150,8 +168,9 @@ export interface AutoCompletePassThroughOptions { loadingIcon?: AutoCompletePassThroughOptionType; /** * Used to pass attributes to the Button component. + * @see {@link ButtonPassThroughOptions} */ - dropdownButton?: ButtonPassThroughOptionType; + dropdownButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the panel's DOM element. */ diff --git a/components/lib/avatar/Avatar.d.ts b/components/lib/avatar/Avatar.d.ts index c2a23cb0f..94b3e9fe7 100644 --- a/components/lib/avatar/Avatar.d.ts +++ b/components/lib/avatar/Avatar.d.ts @@ -7,7 +7,6 @@ * @module avatar */ import { VNode } from 'vue'; -import { AvatarGroupPassThroughOptions } from '../avatargroup'; import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; @@ -27,9 +26,9 @@ export interface AvatarPassThroughMethodOptions { */ props: AvatarProps; /** - * Defines parent instance. + * Defines parent options. */ - parent: AvatarGroupPassThroughOptions; + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/avatar/Avatar.vue b/components/lib/avatar/Avatar.vue index 892e6fa58..4f772d63b 100644 --- a/components/lib/avatar/Avatar.vue +++ b/components/lib/avatar/Avatar.vue @@ -1,10 +1,10 @@ @@ -19,13 +19,6 @@ export default { methods: { onError(event) { this.$emit('error', event); - }, - getPTOptions(key) { - return this.ptm(key, { - parent: { - instance: this.$parent - } - }); } } }; diff --git a/components/lib/badge/Badge.d.ts b/components/lib/badge/Badge.d.ts index b91687a8b..6002e5770 100644 --- a/components/lib/badge/Badge.d.ts +++ b/components/lib/badge/Badge.d.ts @@ -12,12 +12,12 @@ import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; -export declare type BadgePassThroughOptionType = BadgePassThroughAttributes | ((options: BadgePassThroughMethodOptions) => BadgePassThroughAttributes | string) | string | null | undefined; +export declare type BadgePassThroughOptionType = BadgePassThroughAttributes | ((options: BadgePassThroughMethodOptions) => BadgePassThroughAttributes | string) | string | null | undefined; /** * Custom passthrough(pt) option method. */ -export interface BadgePassThroughMethodOptions { +export interface BadgePassThroughMethodOptions { /** * Defines instance. */ @@ -30,6 +30,10 @@ export interface BadgePassThroughMethodOptions { * Defines passthrough(pt) options in global config. */ global: object | undefined; + /** + * Defines parent instance. + */ + parent: T; } /** @@ -43,11 +47,11 @@ export interface BadgePassThroughAttributes { * Custom passthrough(pt) options. * @see {@link BadgeProps.pt} */ -export interface BadgePassThroughOptions { +export interface BadgePassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ - root?: BadgePassThroughOptionType; + root?: BadgePassThroughOptionType; /** * Used to manage all lifecycle hooks. * @see {@link BaseComponent.ComponentHooks} diff --git a/components/lib/badgedirective/BadgeDirective.d.ts b/components/lib/badgedirective/BadgeDirective.d.ts index 6fd22400c..37a04266e 100644 --- a/components/lib/badgedirective/BadgeDirective.d.ts +++ b/components/lib/badgedirective/BadgeDirective.d.ts @@ -18,6 +18,10 @@ export declare type BadgeDirectivePassThroughOptionType = BadgeDirectivePassThro */ export interface BadgePassThroughMethodOptions { context: BadgeContext; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/basecomponent/BaseComponent.vue b/components/lib/basecomponent/BaseComponent.vue index 5b1d13831..e0df910e1 100644 --- a/components/lib/basecomponent/BaseComponent.vue +++ b/components/lib/basecomponent/BaseComponent.vue @@ -202,7 +202,20 @@ export default { return this.unstyled !== undefined ? this.unstyled : this.$config?.unstyled; }, $params() { - return { instance: this, props: this.$props, state: this.$data, parentInstance: this.$parentInstance }; + const parentInstance = this.$parentInstance || this.$parent; + + return { + instance: this, + props: this.$props, + state: this.$data, + parent: { + instance: parentInstance, + props: parentInstance?.$props, + state: parentInstance?.$data + }, + /* @deprecated since v3.43.0. Use the `parent.instance` instead of the `parentInstance`.*/ + parentInstance + }; }, $style() { return { classes: undefined, inlineStyles: undefined, loadStyle: () => {}, loadCustomStyle: () => {}, ...(this._getHostInstance(this) || {}).$style, ...this.$options.style }; diff --git a/components/lib/blockui/BlockUI.d.ts b/components/lib/blockui/BlockUI.d.ts index e8819a7fb..8df41b3f4 100755 --- a/components/lib/blockui/BlockUI.d.ts +++ b/components/lib/blockui/BlockUI.d.ts @@ -30,6 +30,10 @@ export interface BlockUIPassThroughMethodOptions { * Defines current inline state. */ state: BlockUIState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/breadcrumb/Breadcrumb.d.ts b/components/lib/breadcrumb/Breadcrumb.d.ts index add4421ad..1156bd2ea 100755 --- a/components/lib/breadcrumb/Breadcrumb.d.ts +++ b/components/lib/breadcrumb/Breadcrumb.d.ts @@ -31,6 +31,10 @@ export interface BreadcrumbPassThroughMethodOptions { * Defines current options. */ context: BreadcrumbContext; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/button/Button.d.ts b/components/lib/button/Button.d.ts index bbda85ea1..768e3ff28 100755 --- a/components/lib/button/Button.d.ts +++ b/components/lib/button/Button.d.ts @@ -12,12 +12,12 @@ import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; -export declare type ButtonPassThroughOptionType = ButtonPassThroughAttributes | ((options: ButtonPassThroughMethodOptions) => ButtonPassThroughAttributes | string) | string | null | undefined; +export declare type ButtonPassThroughOptionType = ButtonPassThroughAttributes | ((options: ButtonPassThroughMethodOptions) => ButtonPassThroughAttributes | string) | string | null | undefined; /** * Custom passthrough(pt) option method. */ -export interface ButtonPassThroughMethodOptions { +export interface ButtonPassThroughMethodOptions { /** * Defines instance. */ @@ -33,7 +33,7 @@ export interface ButtonPassThroughMethodOptions { /** * Defines parent instance. */ - parent: any; + parent: T; /** * Defines passthrough(pt) options in global config. */ @@ -44,27 +44,27 @@ export interface ButtonPassThroughMethodOptions { * Custom passthrough(pt) options. * @see {@link ButtonProps.pt} */ -export interface ButtonPassThroughOptions { +export interface ButtonPassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ - root?: ButtonPassThroughOptionType; + root?: ButtonPassThroughOptionType; /** * Used to pass attributes to the loading icon's DOM element. */ - loadingIcon?: ButtonPassThroughOptionType; + loadingIcon?: ButtonPassThroughOptionType; /** * Used to pass attributes to the icon's DOM element. */ - icon?: ButtonPassThroughOptionType; + icon?: ButtonPassThroughOptionType; /** * Used to pass attributes to the label's DOM element. */ - label?: ButtonPassThroughOptionType; + label?: ButtonPassThroughOptionType; /** * Used to pass attributes to the badge's DOM element. */ - badge?: ButtonPassThroughOptionType; + badge?: ButtonPassThroughOptionType; /** * Used to manage all lifecycle hooks. * @see {@link BaseComponent.ComponentHooks} @@ -171,7 +171,7 @@ export interface ButtonProps extends ButtonHTMLAttributes { * Used to pass attributes to DOM elements inside the component. * @type {ButtonPassThroughOptions} */ - pt?: PassThrough; + pt?: PassThrough>; /** * Used to configure passthrough(pt) options of the component. * @type {PassThroughOptions} diff --git a/components/lib/button/Button.vue b/components/lib/button/Button.vue index 9c820d0ef..59bed7278 100755 --- a/components/lib/button/Button.vue +++ b/components/lib/button/Button.vue @@ -26,10 +26,6 @@ export default { methods: { getPTOptions(key) { return this.ptm(key, { - parent: { - props: this.$parent?.$props, - state: this.$parent?.$data - }, context: { disabled: this.disabled } @@ -41,7 +37,7 @@ export default { return this.$attrs.disabled || this.$attrs.disabled === '' || this.loading; }, defaultAriaLabel() { - return this.label ? this.label + (this.badge ? ' ' + this.badge : '') : this.$attrs['aria-label']; + return this.label ? this.label + (this.badge ? ' ' + this.badge : '') : this.$attrs.ariaLabel; }, hasIcon() { return this.icon || this.$slots.icon; diff --git a/components/lib/calendar/Calendar.d.ts b/components/lib/calendar/Calendar.d.ts index f2c5e06dd..59d067f00 100755 --- a/components/lib/calendar/Calendar.d.ts +++ b/components/lib/calendar/Calendar.d.ts @@ -9,7 +9,7 @@ */ import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; -import { ButtonPassThroughOptionType } from '../button'; +import { ButtonPassThroughOptions } from '../button'; import { PassThroughOptions } from '../passthrough'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; @@ -37,12 +37,30 @@ export interface CalendarPassThroughMethodOptions { * Defines current options. */ context: CalendarContext; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ global: object | undefined; } +/** + * Custom shared passthrough(pt) option method. + */ +export interface CalendarSharedPassThroughMethodOptions { + /** + * Defines valid properties. + */ + props: CalendarProps; + /** + * Defines current inline state. + */ + state: CalendarState; +} + /** * Custom Calendar responsive options metadata. */ @@ -117,9 +135,9 @@ export interface CalendarPassThroughOptions { input?: CalendarPassThroughOptionType; /** * Used to pass attributes to the Button component. - * @see {@link ButtonPassThroughOptionType} + * @see {@link ButtonPassThroughOptions} */ - dropdownButton?: ButtonPassThroughOptionType; + dropdownButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the panel's DOM element. */ @@ -138,9 +156,9 @@ export interface CalendarPassThroughOptions { header?: CalendarPassThroughOptionType; /** * Used to pass attributes to the Button component. - * @see {@link ButtonPassThroughOptionType} + * @see {@link ButtonPassThroughOptions} */ - previousButton?: ButtonPassThroughOptionType; + previousButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the title's DOM element. */ @@ -159,9 +177,9 @@ export interface CalendarPassThroughOptions { decadeTitle?: CalendarPassThroughOptionType; /** * Used to pass attributes to the Button component. - * @see {@link ButtonPassThroughOptionType} + * @see {@link ButtonPassThroughOptions} */ - nextButton?: ButtonPassThroughOptionType; + nextButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the container's DOM element. */ @@ -288,14 +306,14 @@ export interface CalendarPassThroughOptions { buttonbar?: CalendarPassThroughOptionType; /** * Used to pass attributes to the Button component. - * @see {@link ButtonPassThroughOptionType} + * @see {@link ButtonPassThroughOptions} */ - todayButton?: ButtonPassThroughOptionType; + todayButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the Button component. - * @see {@link ButtonPassThroughOptionType} + * @see {@link ButtonPassThroughOptions} */ - clearButton?: ButtonPassThroughOptionType; + clearButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the aria selected day's DOM element. */ @@ -798,6 +816,10 @@ export interface CalendarSlots { * Style class of the input icon */ class: any; + /** + * Click callback + */ + clickCallback: () => void; }): VNode[]; /** * Custom previous icon template. diff --git a/components/lib/calendar/Calendar.vue b/components/lib/calendar/Calendar.vue index 9adf5717a..db87418de 100755 --- a/components/lib/calendar/Calendar.vue +++ b/components/lib/calendar/Calendar.vue @@ -48,7 +48,7 @@ @@ -1272,14 +1272,10 @@ export default { let formattedValue = null; if (date) { - if (this.timeOnly) { - formattedValue = this.formatTime(date); - } else { - formattedValue = this.formatDate(date, this.datePattern); + formattedValue = this.formatDate(date, this.datePattern); - if (this.showTime) { - formattedValue += ' ' + this.formatTime(date); - } + if (this.showTime || this.timeOnly) { + formattedValue += ' ' + this.formatTime(date); } } @@ -1798,18 +1794,13 @@ export default { let date; let parts = text.split(' '); - if (this.timeOnly) { - date = new Date(); - this.populateTime(date, parts[0], parts[1]); - } else { - const dateFormat = this.datePattern; + const dateFormat = this.datePattern; - if (this.showTime) { - date = this.parseDate(parts[0], dateFormat); - this.populateTime(date, parts[1], parts[2]); - } else { - date = this.parseDate(text, dateFormat); - } + if (this.showTime || this.timeOnly) { + date = this.parseDate(parts[0], dateFormat); + this.populateTime(date, parts[1], parts[2]); + } else { + date = this.parseDate(text, dateFormat); } return date; diff --git a/components/lib/carousel/Carousel.d.ts b/components/lib/carousel/Carousel.d.ts index cbc767c69..92b95b798 100755 --- a/components/lib/carousel/Carousel.d.ts +++ b/components/lib/carousel/Carousel.d.ts @@ -34,6 +34,10 @@ export interface CarouselPassThroughMethodOptions { * Defines current options. */ context: CarouselContext; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/carousel/Carousel.vue b/components/lib/carousel/Carousel.vue index 0a8f782c5..cc3d974cb 100755 --- a/components/lib/carousel/Carousel.vue +++ b/components/lib/carousel/Carousel.vue @@ -101,7 +101,7 @@ import ChevronLeftIcon from 'primevue/icons/chevronleft'; import ChevronRightIcon from 'primevue/icons/chevronright'; import ChevronUpIcon from 'primevue/icons/chevronup'; import Ripple from 'primevue/ripple'; -import { DomHandler, UniqueComponentId, ObjectUtils } from 'primevue/utils'; +import { DomHandler, ObjectUtils, UniqueComponentId } from 'primevue/utils'; import BaseCarousel from './BaseCarousel.vue'; export default { @@ -453,6 +453,8 @@ export default { case 'ArrowUp': case 'ArrowDown': + case 'PageUp': + case 'PageDown': event.preventDefault(); break; @@ -481,7 +483,7 @@ export default { this.changedFocusedIndicator(activeIndex, 0); }, onEndKey() { - const indicators = [...DomHandler.find(this.$refs.indicatorContent, '[data-pc-section="indicator"]r')]; + const indicators = [...DomHandler.find(this.$refs.indicatorContent, '[data-pc-section="indicator"]')]; const activeIndex = this.findFocusedIndicatorIndex(); this.changedFocusedIndicator(activeIndex, indicators.length - 1); diff --git a/components/lib/cascadeselect/CascadeSelect.d.ts b/components/lib/cascadeselect/CascadeSelect.d.ts index 79a1d3230..d0da2ba0a 100644 --- a/components/lib/cascadeselect/CascadeSelect.d.ts +++ b/components/lib/cascadeselect/CascadeSelect.d.ts @@ -32,6 +32,10 @@ export interface CascadeSelectPassThroughMethodOptions { * Defines current inline state. */ state: CascadeSelectState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/chart/Chart.d.ts b/components/lib/chart/Chart.d.ts index 59454648a..2fde1c2e7 100755 --- a/components/lib/chart/Chart.d.ts +++ b/components/lib/chart/Chart.d.ts @@ -26,6 +26,10 @@ export interface ChartPassThroughMethodOptions { * Defines valid properties. */ props: ChartProps; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/chart/Chart.vue b/components/lib/chart/Chart.vue index f2c5f55de..4c326e593 100755 --- a/components/lib/chart/Chart.vue +++ b/components/lib/chart/Chart.vue @@ -1,5 +1,5 @@ diff --git a/components/lib/chart/style/ChartStyle.js b/components/lib/chart/style/ChartStyle.js index caec2009a..8fa6b3480 100644 --- a/components/lib/chart/style/ChartStyle.js +++ b/components/lib/chart/style/ChartStyle.js @@ -1,12 +1,8 @@ import BaseStyle from 'primevue/base/style'; -const css = ` -@layer primevue { - .p-chart { - position: relative; - } -} -`; +const inlineStyles = { + root: { position: 'relative' } +}; const classes = { root: 'p-chart' @@ -14,6 +10,6 @@ const classes = { export default BaseStyle.extend({ name: 'chart', - css, + inlineStyles, classes }); diff --git a/components/lib/checkbox/Checkbox.d.ts b/components/lib/checkbox/Checkbox.d.ts index ee522b93c..80153ce83 100755 --- a/components/lib/checkbox/Checkbox.d.ts +++ b/components/lib/checkbox/Checkbox.d.ts @@ -34,6 +34,10 @@ export interface CheckboxPassThroughMethodOptions { * Defines current options. */ context: CheckboxContext; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/chip/Chip.d.ts b/components/lib/chip/Chip.d.ts index c3529aa15..12836555b 100644 --- a/components/lib/chip/Chip.d.ts +++ b/components/lib/chip/Chip.d.ts @@ -30,6 +30,10 @@ export interface ChipPassThroughMethodOptions { * Defines current inline state. */ state: ChipState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/chips/Chips.d.ts b/components/lib/chips/Chips.d.ts index c70d56d77..28b3fbd54 100755 --- a/components/lib/chips/Chips.d.ts +++ b/components/lib/chips/Chips.d.ts @@ -30,6 +30,10 @@ export interface ChipsPassThroughMethodOptions { * Defines current inline state. */ state: ChipsState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/colorpicker/ColorPicker.d.ts b/components/lib/colorpicker/ColorPicker.d.ts index e9ad7f3ee..daf106952 100755 --- a/components/lib/colorpicker/ColorPicker.d.ts +++ b/components/lib/colorpicker/ColorPicker.d.ts @@ -32,6 +32,10 @@ export interface ColorPickerPassThroughMethodOptions { * Defines current inline state. */ state: ColorPickerState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/column/Column.d.ts b/components/lib/column/Column.d.ts index 093b17694..817307610 100755 --- a/components/lib/column/Column.d.ts +++ b/components/lib/column/Column.d.ts @@ -11,7 +11,7 @@ import { VNode } from 'vue'; import { ComponentHooks } from '../basecomponent'; -import { ButtonPassThroughOptionType } from '../button'; +import { ButtonPassThroughOptions } from '../button'; import { DataTablePassThroughOptions } from '../datatable'; import { DropdownPassThroughOptionType } from '../dropdown'; import { PassThroughOptions } from '../passthrough'; @@ -33,9 +33,9 @@ export interface ColumnPassThroughMethodOptions { */ props: ColumnProps; /** - * Defines parent instance. + * Defines parent options. */ - parent: DataTablePassThroughOptions; + parent: any; /** * Defines current options. */ @@ -46,6 +46,20 @@ export interface ColumnPassThroughMethodOptions { global: object | undefined; } +/** + * Custom shared passthrough(pt) option method. + */ +export interface ColumnSharedPassThroughMethodOptions { + /** + * Defines valid properties. + */ + props: ColumnProps; + /** + * Defines parent instance. + */ + parent: DataTablePassThroughOptions; +} + /** * Filter model metadata. */ @@ -194,7 +208,7 @@ export interface ColumnPassThroughOptions { * Used to pass attributes to the Dropdown component. * @see {@link DropdownPassThroughOptionType} */ - filterOperatorDropdown?: DropdownPassThroughOptionType; + filterOperatorDropdown?: DropdownPassThroughOptionType; /** * Used to pass attributes to the filter constraints' DOM element. */ @@ -207,39 +221,39 @@ export interface ColumnPassThroughOptions { * Used to pass attributes to the Dropdown component. * @see {@link DropdownPassThroughOptionType} */ - filterMatchModeDropdown?: DropdownPassThroughOptionType; + filterMatchModeDropdown?: DropdownPassThroughOptionType; /** * Used to pass attributes to the filter remove button container's DOM element. */ filterRemove?: ColumnPassThroughOptionType; /** * Used to pass attributes to the Button component. - * @see {@link ButtonPassThroughOptionType} + * @see {@link ButtonPassThroughOptions} */ - filterRemoveButton?: ButtonPassThroughOptionType; + filterRemoveButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the filter add rule's DOM element. */ filterAddRule?: ColumnPassThroughOptionType; /** * Used to pass attributes to the Button component. - * @see {@link ButtonPassThroughOptionType} + * @see {@link ButtonPassThroughOptions} */ - filterAddRuleButton?: ButtonPassThroughOptionType; + filterAddRuleButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the filter buttonbar's DOM element. */ filterButtonbar?: ColumnPassThroughOptionType; /** * Used to pass attributes to the Button component. - * @see {@link ButtonPassThroughOptionType} + * @see {@link ButtonPassThroughOptions} */ - filterClearButton?: ButtonPassThroughOptionType; + filterClearButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the Button component. - * @see {@link ButtonPassThroughOptionType} + * @see {@link ButtonPassThroughOptions} */ - filterApplyButton?: ButtonPassThroughOptionType; + filterApplyButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the body cell's DOM element. */ diff --git a/components/lib/columngroup/ColumnGroup.d.ts b/components/lib/columngroup/ColumnGroup.d.ts index 40d836217..b1819839f 100755 --- a/components/lib/columngroup/ColumnGroup.d.ts +++ b/components/lib/columngroup/ColumnGroup.d.ts @@ -6,7 +6,6 @@ * @module columngroup */ import { ComponentHooks } from '../basecomponent'; -import { DataTablePassThroughOptions } from '../datatable'; import { PassThroughOptions } from '../passthrough'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; @@ -25,9 +24,9 @@ export interface ColumnGroupPassThroughMethodOptions { */ props: ColumnGroupProps; /** - * Defines parent instance. + * Defines parent options. */ - parent: DataTablePassThroughOptions; + parent: any; /** * Defines current options. */ diff --git a/components/lib/config/PrimeVue.js b/components/lib/config/PrimeVue.js index de1f40376..d0daa7d23 100644 --- a/components/lib/config/PrimeVue.js +++ b/components/lib/config/PrimeVue.js @@ -92,7 +92,7 @@ export const defaultOptions = { moveToSource: 'Move to Source', moveAllToTarget: 'Move All to Target', moveAllToSource: 'Move All to Source', - pageLabel: '{page}', + pageLabel: 'Page {page}', firstPageLabel: 'First Page', lastPageLabel: 'Last Page', nextPageLabel: 'Next Page', diff --git a/components/lib/confirmdialog/ConfirmDialog.d.ts b/components/lib/confirmdialog/ConfirmDialog.d.ts index 20639a966..a0c6f7afc 100644 --- a/components/lib/confirmdialog/ConfirmDialog.d.ts +++ b/components/lib/confirmdialog/ConfirmDialog.d.ts @@ -32,12 +32,30 @@ export interface ConfirmDialogPassThroughMethodOptions { * Defines current inline state. */ state: ConfirmDialogState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ global: object | undefined; } +/** + * Custom shared passthrough(pt) option method. + */ +export interface ConfirmDialogSharedPassThroughMethodOptions { + /** + * Defines valid properties. + */ + props: ConfirmDialogProps; + /** + * Defines current inline state. + */ + state: ConfirmDialogState; +} + /** * Custom passthrough(pt) options. * @see {@link ConfirmDialogProps.pt} @@ -87,12 +105,12 @@ export interface ConfirmDialogPassThroughOptions { * Used to pass attributes to the Button component. * @see {@link ButtonPassThroughOptions} */ - rejectButton?: ButtonPassThroughOptions; + rejectButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the Button component. * @see {@link ButtonPassThroughOptions} */ - acceptButton?: ButtonPassThroughOptions; + acceptButton?: ButtonPassThroughOptions; /** * Used to manage all lifecycle hooks. * @see {@link BaseComponent.ComponentHooks} diff --git a/components/lib/confirmpopup/ConfirmPopup.d.ts b/components/lib/confirmpopup/ConfirmPopup.d.ts index a87c77c75..e2232ac0c 100644 --- a/components/lib/confirmpopup/ConfirmPopup.d.ts +++ b/components/lib/confirmpopup/ConfirmPopup.d.ts @@ -34,12 +34,30 @@ export interface ConfirmPopupPassThroughMethodOptions { * Defines current inline state. */ state: ConfirmPopupState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ global: object | undefined; } +/** + * Custom shared passthrough(pt) option method. + */ +export interface ConfirmPopupSharedPassThroughMethodOptions { + /** + * Defines valid properties. + */ + props: ConfirmPopupProps; + /** + * Defines current inline state. + */ + state: ConfirmPopupState; +} + /** * Custom passthrough(pt) options. * @see {@link ConfirmPopupProps.pt} @@ -69,12 +87,12 @@ export interface ConfirmPopupPassThroughOptions { * Used to pass attributes to the Button component. * @see {@link ButtonPassThroughOptions} */ - rejectButton?: ButtonPassThroughOptions; + rejectButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the Button component. * @see {@link ButtonPassThroughOptions} */ - acceptButton?: ButtonPassThroughOptions; + acceptButton?: ButtonPassThroughOptions; /** * Used to manage all lifecycle hooks. * @see {@link BaseComponent.ComponentHooks} diff --git a/components/lib/contextmenu/ContextMenu.d.ts b/components/lib/contextmenu/ContextMenu.d.ts index 8ebc0b531..f1cc9f52a 100755 --- a/components/lib/contextmenu/ContextMenu.d.ts +++ b/components/lib/contextmenu/ContextMenu.d.ts @@ -38,6 +38,10 @@ export interface ContextMenuPassThroughMethodOptions { * Defines current options. */ context: ContextMenuContext; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/datatable/BodyCell.vue b/components/lib/datatable/BodyCell.vue index ff3cf5499..89c99e78a 100755 --- a/components/lib/datatable/BodyCell.vue +++ b/components/lib/datatable/BodyCell.vue @@ -222,6 +222,7 @@ export default { const columnMetaData = { props: this.column.props, parent: { + instance: this, props: this.$props, state: this.$data }, diff --git a/components/lib/datatable/ColumnFilter.vue b/components/lib/datatable/ColumnFilter.vue index 9f94d6a64..fb3ca3883 100644 --- a/components/lib/datatable/ColumnFilter.vue +++ b/components/lib/datatable/ColumnFilter.vue @@ -330,6 +330,7 @@ export default { const columnMetaData = { props: this.column.props, parent: { + instance: this, props: this.$props, state: this.$data }, diff --git a/components/lib/datatable/DataTable.d.ts b/components/lib/datatable/DataTable.d.ts index b14382868..ba1eb3abd 100755 --- a/components/lib/datatable/DataTable.d.ts +++ b/components/lib/datatable/DataTable.d.ts @@ -41,12 +41,30 @@ export interface DataTablePassThroughMethodOptions { * Defines current options. */ context: DataTableContext; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ global: object | undefined; } +/** + * Custom shared passthrough(pt) option method. + */ +export interface DataTableSharedPassThroughMethodOptions { + /** + * Defines valid properties. + */ + props: DataTableProps; + /** + * Defines current inline state. + */ + state: DataTableState; +} + /** * Custom datatable export metadata. */ @@ -378,7 +396,7 @@ export interface DataTableRowExpandEvent { /** * Expanded row data */ - data: any[]; + data: any; } /** @@ -582,7 +600,7 @@ export interface DataTablePassThroughOptions { * Used to pass attributes to the Paginator component. * @see {@link PaginatorPassThroughOptionType} */ - paginator?: PaginatorPassThroughOptionType; + paginator?: PaginatorPassThroughOptionType; /** * Used to pass attributes to the wrapper's DOM element. */ diff --git a/components/lib/datatable/FooterCell.vue b/components/lib/datatable/FooterCell.vue index 89efacdd9..3b60cd467 100644 --- a/components/lib/datatable/FooterCell.vue +++ b/components/lib/datatable/FooterCell.vue @@ -47,6 +47,7 @@ export default { const columnMetaData = { props: this.column.props, parent: { + instance: this, props: this.$props, state: this.$data }, diff --git a/components/lib/datatable/HeaderCell.vue b/components/lib/datatable/HeaderCell.vue index b47ab2e48..b1050b389 100644 --- a/components/lib/datatable/HeaderCell.vue +++ b/components/lib/datatable/HeaderCell.vue @@ -206,6 +206,7 @@ export default { const columnMetaData = { props: this.column.props, parent: { + instance: this, props: this.$props, state: this.$data }, diff --git a/components/lib/datatable/HeaderCheckbox.vue b/components/lib/datatable/HeaderCheckbox.vue index ee5322b74..f92202611 100755 --- a/components/lib/datatable/HeaderCheckbox.vue +++ b/components/lib/datatable/HeaderCheckbox.vue @@ -50,6 +50,7 @@ export default { const columnMetaData = { props: this.column.props, parent: { + instance: this, props: this.$props, state: this.$data }, diff --git a/components/lib/datatable/RowCheckbox.vue b/components/lib/datatable/RowCheckbox.vue index 45f92008c..d3faec8a0 100755 --- a/components/lib/datatable/RowCheckbox.vue +++ b/components/lib/datatable/RowCheckbox.vue @@ -55,6 +55,7 @@ export default { const columnMetaData = { props: this.column.props, parent: { + instance: this, props: this.$props, state: this.$data }, diff --git a/components/lib/datatable/RowRadioButton.vue b/components/lib/datatable/RowRadioButton.vue index 437cbefd9..409b5a42e 100755 --- a/components/lib/datatable/RowRadioButton.vue +++ b/components/lib/datatable/RowRadioButton.vue @@ -40,6 +40,7 @@ export default { const columnMetaData = { props: this.column.props, parent: { + instance: this, props: this.$props, state: this.$data }, diff --git a/components/lib/datatable/TableBody.vue b/components/lib/datatable/TableBody.vue index 764dc7daa..72383249b 100755 --- a/components/lib/datatable/TableBody.vue +++ b/components/lib/datatable/TableBody.vue @@ -310,6 +310,7 @@ export default { getColumnPT(key) { const columnMetaData = { parent: { + instance: this, props: this.$props, state: this.$data } diff --git a/components/lib/datatable/TableFooter.vue b/components/lib/datatable/TableFooter.vue index 016d2e719..e915644ec 100755 --- a/components/lib/datatable/TableFooter.vue +++ b/components/lib/datatable/TableFooter.vue @@ -43,6 +43,7 @@ export default { const columnGroupMetaData = { props: this.getColumnGroupProps(), parent: { + instance: this, props: this.$props, state: this.$data }, @@ -61,6 +62,7 @@ export default { const rowMetaData = { props: row.props, parent: { + instance: this, props: this.$props, state: this.$data }, diff --git a/components/lib/datatable/TableHeader.vue b/components/lib/datatable/TableHeader.vue index 11f049b5f..87c15cce2 100755 --- a/components/lib/datatable/TableHeader.vue +++ b/components/lib/datatable/TableHeader.vue @@ -234,6 +234,7 @@ export default { const columnGroupMetaData = { props: this.getColumnGroupProps(), parent: { + instance: this, props: this.$props, state: this.$data }, @@ -252,6 +253,7 @@ export default { const rowMetaData = { props: row.props, parent: { + instance: this, props: this.$props, state: this.$data }, @@ -269,6 +271,7 @@ export default { const columnMetaData = { props: column.props, parent: { + instance: this, props: this.$props, state: this.$data }, diff --git a/components/lib/dataview/DataView.d.ts b/components/lib/dataview/DataView.d.ts index 64afb3291..9cb36756b 100755 --- a/components/lib/dataview/DataView.d.ts +++ b/components/lib/dataview/DataView.d.ts @@ -31,11 +31,30 @@ export interface DataViewPassThroughMethodOptions { * Defines current inline state. */ state: DataViewState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ global: object | undefined; } + +/** + * Custom shared passthrough(pt) option method. + */ +export interface DataViewSharedPassThroughMethodOptions { + /** + * Defines valid properties. + */ + props: DataViewProps; + /** + * Defines current inline state. + */ + state: DataViewState; +} + /** * Custom page event. * @see {@link DataViewEmits.page} @@ -76,7 +95,7 @@ export interface DataViewPassThroughOptions { * Used to pass attributes to the Paginator component. * @see {@link PaginatorPassThroughOptionType} */ - paginator?: PaginatorPassThroughOptionType; + paginator?: PaginatorPassThroughOptionType; /** * Used to pass attributes to the content's DOM element. */ diff --git a/components/lib/dataviewlayoutoptions/DataViewLayoutOptions.d.ts b/components/lib/dataviewlayoutoptions/DataViewLayoutOptions.d.ts index 922d5bdc8..69079c819 100755 --- a/components/lib/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +++ b/components/lib/dataviewlayoutoptions/DataViewLayoutOptions.d.ts @@ -35,6 +35,10 @@ export interface DataViewLayoutOptionsPassThroughMethodOptions { * Defines current inline state. */ state: DataViewLayoutOptionsState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/deferredcontent/DeferredContent.d.ts b/components/lib/deferredcontent/DeferredContent.d.ts index fe0ee670a..c2b10b093 100755 --- a/components/lib/deferredcontent/DeferredContent.d.ts +++ b/components/lib/deferredcontent/DeferredContent.d.ts @@ -30,6 +30,10 @@ export interface DeferredContentPassThroughMethodOptions { * Defines current inline state. */ state: DeferredContentState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/dialog/Dialog.d.ts b/components/lib/dialog/Dialog.d.ts index 55ff6e8ea..5cf3c5b19 100755 --- a/components/lib/dialog/Dialog.d.ts +++ b/components/lib/dialog/Dialog.d.ts @@ -12,14 +12,14 @@ import { ComponentHooks } from '../basecomponent'; import { PassThroughOptions } from '../passthrough'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; -export declare type DialogPassThroughOptionType = DialogPassThroughAttributes | ((options: DialogPassThroughMethodOptions) => DialogPassThroughAttributes | string) | string | null | undefined; +export declare type DialogPassThroughOptionType = DialogPassThroughAttributes | ((options: DialogPassThroughMethodOptions) => DialogPassThroughAttributes | string) | string | null | undefined; -export declare type DialogPassThroughTransitionType = TransitionProps | ((options: DialogPassThroughMethodOptions) => TransitionProps) | undefined; +export declare type DialogPassThroughTransitionType = TransitionProps | ((options: DialogPassThroughMethodOptions) => TransitionProps) | undefined; /** * Custom passthrough(pt) option method. */ -export interface DialogPassThroughMethodOptions { +export interface DialogPassThroughMethodOptions { /** * Defines instance. */ @@ -32,6 +32,10 @@ export interface DialogPassThroughMethodOptions { * Defines current inline state. */ state: DialogState; + /** + * Defines parent instance. + */ + parent: T; /** * Defines passthrough(pt) options in global config. */ @@ -42,51 +46,51 @@ export interface DialogPassThroughMethodOptions { * Custom passthrough(pt) options. * @see {@link DialogProps.pt} */ -export interface DialogPassThroughOptions { +export interface DialogPassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ - root?: DialogPassThroughOptionType; + root?: DialogPassThroughOptionType; /** * Used to pass attributes to the header's DOM element. */ - header?: DialogPassThroughOptionType; + header?: DialogPassThroughOptionType; /** * Used to pass attributes to the header title's DOM element. */ - title?: DialogPassThroughOptionType; + title?: DialogPassThroughOptionType; /** * Used to pass attributes to the header icons' DOM element. */ - icons?: DialogPassThroughOptionType; + icons?: DialogPassThroughOptionType; /** * Used to pass attributes to the maximizable button's DOM element. */ - maximizableButton?: DialogPassThroughOptionType; + maximizableButton?: DialogPassThroughOptionType; /** * Used to pass attributes to the maximizable icon's DOM element. */ - maximizableIcon?: DialogPassThroughOptionType; + maximizableIcon?: DialogPassThroughOptionType; /** * Used to pass attributes to the close button's component. */ - closeButton?: DialogPassThroughOptionType; + closeButton?: DialogPassThroughOptionType; /** * Used to pass attributes to the close button icon's component. */ - closeButtonIcon?: DialogPassThroughOptionType; + closeButtonIcon?: DialogPassThroughOptionType; /** * Used to pass attributes to the content's DOM element. */ - content?: DialogPassThroughOptionType; + content?: DialogPassThroughOptionType; /** * Used to pass attributes to the footer's DOM element. */ - footer?: DialogPassThroughOptionType; + footer?: DialogPassThroughOptionType; /** * Used to pass attributes to the mask's DOM element. */ - mask?: DialogPassThroughOptionType; + mask?: DialogPassThroughOptionType; /** * Used to manage all lifecycle hooks. * @see {@link BaseComponent.ComponentHooks} @@ -95,7 +99,7 @@ export interface DialogPassThroughOptions { /** * Used to control Vue Transition API. */ - transition?: DialogPassThroughTransitionType; + transition?: DialogPassThroughTransitionType; } /** diff --git a/components/lib/divider/Divider.d.ts b/components/lib/divider/Divider.d.ts index e3a9052cc..3d640f15b 100644 --- a/components/lib/divider/Divider.d.ts +++ b/components/lib/divider/Divider.d.ts @@ -26,6 +26,10 @@ export interface DividerPassThroughMethodOptions { * Defines valid properties. */ props: DividerProps; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/dock/Dock.d.ts b/components/lib/dock/Dock.d.ts index b7304c1a5..3ad0e8c92 100644 --- a/components/lib/dock/Dock.d.ts +++ b/components/lib/dock/Dock.d.ts @@ -35,6 +35,10 @@ export interface DockPassThroughMethodOptions { * Defines current options. */ context: DockContext; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/dropdown/Dropdown.d.ts b/components/lib/dropdown/Dropdown.d.ts index dee0b76d2..3e86a0347 100755 --- a/components/lib/dropdown/Dropdown.d.ts +++ b/components/lib/dropdown/Dropdown.d.ts @@ -13,14 +13,14 @@ import { PassThroughOptions } from '../passthrough'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; import { VirtualScrollerItemOptions, VirtualScrollerPassThroughOptionType, VirtualScrollerProps } from '../virtualscroller'; -export declare type DropdownPassThroughOptionType = DropdownPassThroughAttributes | ((options: DropdownPassThroughMethodOptions) => DropdownPassThroughAttributes | string) | string | null | undefined; +export declare type DropdownPassThroughOptionType = DropdownPassThroughAttributes | ((options: DropdownPassThroughMethodOptions) => DropdownPassThroughAttributes | string) | string | null | undefined; -export declare type DropdownPassThroughTransitionType = TransitionProps | ((options: DropdownPassThroughMethodOptions) => TransitionProps) | undefined; +export declare type DropdownPassThroughTransitionType = TransitionProps | ((options: DropdownPassThroughMethodOptions) => TransitionProps) | undefined; /** * Custom passthrough(pt) option method. */ -export interface DropdownPassThroughMethodOptions { +export interface DropdownPassThroughMethodOptions { /** * Defines instance. */ @@ -33,6 +33,10 @@ export interface DropdownPassThroughMethodOptions { * Defines current inline state. */ state: DropdownState; + /** + * Defines parent instance. + */ + parent: T | any; /** * Defines current options. */ @@ -77,51 +81,51 @@ export interface DropdownFilterEvent { * Custom passthrough(pt) options. * @see {@link DropdownProps.pt} */ -export interface DropdownPassThroughOptions { +export interface DropdownPassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ - root?: DropdownPassThroughOptionType; + root?: DropdownPassThroughOptionType; /** * Used to pass attributes to the input's DOM element. */ - input?: DropdownPassThroughOptionType; + input?: DropdownPassThroughOptionType; /** * Used to pass attributes to the clear icon's DOM element. */ - clearIcon?: DropdownPassThroughOptionType; + clearIcon?: DropdownPassThroughOptionType; /** * Used to pass attributes to the trigger' DOM element. */ - trigger?: DropdownPassThroughOptionType; + trigger?: DropdownPassThroughOptionType; /** * Used to pass attributes to the loading icon's DOM element. */ - loadingIcon?: DropdownPassThroughOptionType; + loadingIcon?: DropdownPassThroughOptionType; /** * Used to pass attributes to the panel's DOM element. */ - panel?: DropdownPassThroughOptionType; + panel?: DropdownPassThroughOptionType; /** * Used to pass attributes to the header's DOM element. */ - header?: DropdownPassThroughOptionType; + header?: DropdownPassThroughOptionType; /** * Used to pass attributes to the filter container's DOM element. */ - filterContainer?: DropdownPassThroughOptionType; + filterContainer?: DropdownPassThroughOptionType; /** * Used to pass attributes to the filter input's DOM element. */ - filterInput?: DropdownPassThroughOptionType; + filterInput?: DropdownPassThroughOptionType; /** * Used to pass attributes to the filter icon's DOM element. */ - filterIcon?: DropdownPassThroughOptionType; + filterIcon?: DropdownPassThroughOptionType; /** * Used to pass attributes to the wrapper's DOM element. */ - wrapper?: DropdownPassThroughOptionType; + wrapper?: DropdownPassThroughOptionType; /** * Used to pass attributes to the VirtualScroller component. * @see {@link VirtualScrollerPassThroughOptionType} @@ -130,39 +134,39 @@ export interface DropdownPassThroughOptions { /** * Used to pass attributes to the list's DOM element. */ - list?: DropdownPassThroughOptionType; + list?: DropdownPassThroughOptionType; /** * Used to pass attributes to the item group's DOM element. */ - itemGroup?: DropdownPassThroughOptionType; + itemGroup?: DropdownPassThroughOptionType; /** * Used to pass attributes to the item's DOM element. */ - item?: DropdownPassThroughOptionType; + item?: DropdownPassThroughOptionType; /** * Used to pass attributes to the empty message's DOM element. */ - emptyMessage?: DropdownPassThroughOptionType; + emptyMessage?: DropdownPassThroughOptionType; /** * Used to pass attributes to the hidden first focusable element's DOM element. */ - hiddenFirstFocusableEl?: DropdownPassThroughOptionType; + hiddenFirstFocusableEl?: DropdownPassThroughOptionType; /** * Used to pass attributes to the hidden filter result's DOM element. */ - hiddenFilterResult?: DropdownPassThroughOptionType; + hiddenFilterResult?: DropdownPassThroughOptionType; /** * Used to pass attributes to the hidden empty message's DOM element. */ - hiddenEmptyMessage?: DropdownPassThroughOptionType; + hiddenEmptyMessage?: DropdownPassThroughOptionType; /** * Used to pass attributes to the hidden selected message's DOM element. */ - hiddenSelectedMessage?: DropdownPassThroughOptionType; + hiddenSelectedMessage?: DropdownPassThroughOptionType; /** * Used to pass attributes to the hidden last focusable element's DOM element. */ - hiddenLastFocusableEl?: DropdownPassThroughOptionType; + hiddenLastFocusableEl?: DropdownPassThroughOptionType; /** * Used to manage all lifecycle hooks. * @see {@link BaseComponent.ComponentHooks} diff --git a/components/lib/dropdown/Dropdown.vue b/components/lib/dropdown/Dropdown.vue index 60a279a4d..001170d36 100755 --- a/components/lib/dropdown/Dropdown.vue +++ b/components/lib/dropdown/Dropdown.vue @@ -125,7 +125,7 @@ :data-p-highlight="isSelected(option)" :data-p-focused="focusedOptionIndex === getOptionIndex(i, getItemOptions)" :data-p-disabled="isOptionDisabled(option)" - v-bind="getPTOptions(option, getItemOptions, i, 'item')" + v-bind="getPTItemOptions(option, getItemOptions, i, 'item')" > {{ getOptionLabel(option) }} @@ -253,7 +253,7 @@ export default { getOptionRenderKey(option, index) { return (this.dataKey ? ObjectUtils.resolveFieldData(option, this.dataKey) : this.getOptionLabel(option)) + '_' + index; }, - getPTOptions(option, itemOptions, index, key) { + getPTItemOptions(option, itemOptions, index, key) { return this.ptm(key, { context: { selected: this.isSelected(option), diff --git a/components/lib/dropdown/style/DropdownStyle.js b/components/lib/dropdown/style/DropdownStyle.js index 9ddb31966..079838082 100644 --- a/components/lib/dropdown/style/DropdownStyle.js +++ b/components/lib/dropdown/style/DropdownStyle.js @@ -102,7 +102,7 @@ const classes = { 'p-dropdown p-component p-inputwrapper', { 'p-disabled': props.disabled, - 'p-dropdown-clearable': props.showClear && !props.disabled, + 'p-dropdown-clearable': props.showClear, 'p-focus': state.focused, 'p-inputwrapper-filled': instance.hasSelectedOption, 'p-inputwrapper-focus': state.focused || state.overlayVisible, diff --git a/components/lib/editor/Editor.d.ts b/components/lib/editor/Editor.d.ts index 2c5fa3819..db7d13d45 100755 --- a/components/lib/editor/Editor.d.ts +++ b/components/lib/editor/Editor.d.ts @@ -30,6 +30,10 @@ export interface EditorPassThroughMethodOptions { * Defines current inline state. */ state: EditorState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/fieldset/Fieldset.d.ts b/components/lib/fieldset/Fieldset.d.ts index 773222420..6d97de738 100755 --- a/components/lib/fieldset/Fieldset.d.ts +++ b/components/lib/fieldset/Fieldset.d.ts @@ -32,6 +32,10 @@ export interface FieldsetPassThroughMethodOptions { * Defines current inline state. */ state: FieldsetState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ diff --git a/components/lib/fieldset/Fieldset.vue b/components/lib/fieldset/Fieldset.vue index 18a94fefa..45d20cc09 100755 --- a/components/lib/fieldset/Fieldset.vue +++ b/components/lib/fieldset/Fieldset.vue @@ -77,7 +77,7 @@ export default { return UniqueComponentId(); }, buttonAriaLabel() { - return this.toggleButtonProps && this.toggleButtonProps['aria-label'] ? this.toggleButtonProps['aria-label'] : this.legend; + return this.toggleButtonProps && this.toggleButtonProps.ariaLabel ? this.toggleButtonProps.ariaLabel : this.legend; } }, directives: { diff --git a/components/lib/fileupload/FileUpload.d.ts b/components/lib/fileupload/FileUpload.d.ts index 53727f0f1..d626031a7 100755 --- a/components/lib/fileupload/FileUpload.d.ts +++ b/components/lib/fileupload/FileUpload.d.ts @@ -8,6 +8,7 @@ * */ import { VNode } from 'vue'; +import { BadgePassThroughOptions } from '../badge'; import { ComponentHooks } from '../basecomponent'; import { ButtonPassThroughOptions } from '../button'; import { MessagePassThroughOptions } from '../message'; @@ -32,12 +33,30 @@ export interface FileUploadPassThroughMethodOptions { * Defines current inline state. */ state: FileUploadState; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ global: object | undefined; } +/** + * Custom shared passthrough(pt) option method. + */ +export interface FileUploadPassThroughMethodOptions { + /** + * Defines valid properties. + */ + props: FileUploadProps; + /** + * Defines current inline state. + */ + state: FileUploadState; +} + /** * Custom select event. * @see {@link FileUploadEmits.select} @@ -199,12 +218,12 @@ export interface FileUploadPassThroughOptions { * Used to pass attributes to the upload button's DOM element. * @see {@link ButtonPassThroughOptions} */ - uploadButton?: ButtonPassThroughOptions; + uploadButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the cancel button's DOM element. * @see {@link ButtonPassThroughOptions} */ - cancelButton?: ButtonPassThroughOptions; + cancelButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the content's DOM element. */ @@ -217,7 +236,7 @@ export interface FileUploadPassThroughOptions { * Used to pass attributes to the messages' DOM element. * @see {@link MessagePassThroughOptions} */ - message?: MessagePassThroughOptions; + message?: MessagePassThroughOptions; /** * Used to pass attributes to the file's DOM element. */ @@ -239,9 +258,10 @@ export interface FileUploadPassThroughOptions { */ fileSize?: FileUploadPassThroughOptionType; /** - * Used to pass attributes to the badge's DOM element. + * Used to pass attributes to the Badge component. + * @see {@link BadgePassThroughOptions} */ - badge?: FileUploadPassThroughOptionType; + badge?: BadgePassThroughOptions; /** * Used to pass attributes to the actions's DOM element. */ @@ -250,7 +270,7 @@ export interface FileUploadPassThroughOptions { * Used to pass attributes to the remove button's DOM element. * @see {@link ButtonPassThroughOptions} */ - removeButton?: ButtonPassThroughOptions; + removeButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the empty's DOM element. */ diff --git a/components/lib/galleria/BaseGalleria.vue b/components/lib/galleria/BaseGalleria.vue index 983445518..51aade029 100644 --- a/components/lib/galleria/BaseGalleria.vue +++ b/components/lib/galleria/BaseGalleria.vue @@ -113,6 +113,14 @@ export default { nextButtonProps: { type: null, default: null + }, + ariaLabel: { + type: String, + default: null + }, + ariaRoledescription: { + type: String, + default: null } }, style: GalleriaStyle, diff --git a/components/lib/galleria/Galleria.d.ts b/components/lib/galleria/Galleria.d.ts index 9bf4a532c..0d9e62fbd 100755 --- a/components/lib/galleria/Galleria.d.ts +++ b/components/lib/galleria/Galleria.d.ts @@ -36,6 +36,10 @@ export interface GalleriaPassThroughMethodOptions { * Defines current options. */ context: GalleriaContext; + /** + * Defines parent options. + */ + parent: any; /** * Defines passthrough(pt) options in global config. */ @@ -390,6 +394,14 @@ export interface GalleriaProps { * Used to pass all properties of the HTMLButtonElement to the next navigation button. */ nextButtonProps?: ButtonHTMLAttributes | undefined; + /** + * Defines a string value that labels an interactive element. + */ + ariaLabel?: string | undefined; + /** + * Defines a string value that description for the role of the component. + */ + ariaRoledescription?: string | undefined; /** * Used to pass attributes to DOM elements inside the component. * @type {GalleriaPassThroughOptions} diff --git a/components/lib/galleria/Galleria.vue b/components/lib/galleria/Galleria.vue index 39c39c5d4..b04839093 100755 --- a/components/lib/galleria/Galleria.vue +++ b/components/lib/galleria/Galleria.vue @@ -1,6 +1,6 @@