+
@@ -28,6 +28,18 @@ export default {
disabled: {
type: Boolean,
default: false
+ },
+ closeIcon: {
+ type: String,
+ default: 'pi pi-times'
+ },
+ displayProps: {
+ type: null,
+ default: null
+ },
+ closeButtonProps: {
+ type: null,
+ default: null
}
},
data() {
@@ -54,6 +66,9 @@ export default {
this.$emit('close', event);
this.d_active = false;
this.$emit('update:active', false);
+ setTimeout(() => {
+ this.$refs.display.focus();
+ }, 0);
}
},
computed: {
@@ -62,6 +77,9 @@ export default {
},
displayClass() {
return ['p-inplace-display', { 'p-disabled': this.disabled }];
+ },
+ closeAriaLabel() {
+ return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;
}
},
components: {
diff --git a/components/inputnumber/InputNumber.d.ts b/components/inputnumber/InputNumber.d.ts
index 32ffc21b6..04a0db070 100755
--- a/components/inputnumber/InputNumber.d.ts
+++ b/components/inputnumber/InputNumber.d.ts
@@ -134,6 +134,11 @@ export interface InputNumberProps {
* Default value is true.
*/
allowEmpty?: boolean | undefined;
+ /**
+ * Highlights automatically the input value.
+ * Default value is false.
+ */
+ highlightOnFocus?: boolean | undefined;
/**
* When present, it specifies that the component should be disabled.
*/
diff --git a/components/inputnumber/InputNumber.spec.js b/components/inputnumber/InputNumber.spec.js
index 59ed237d8..080dab187 100644
--- a/components/inputnumber/InputNumber.spec.js
+++ b/components/inputnumber/InputNumber.spec.js
@@ -18,24 +18,24 @@ describe('InputNumber.vue', () => {
});
it('is keydown called when down and up keys pressed', async () => {
- await wrapper.vm.onInputKeyDown({ which: 38, target: { value: 1 }, preventDefault: () => {} });
+ await wrapper.vm.onInputKeyDown({ code: 'ArrowUp', target: { value: 1 }, preventDefault: () => {} });
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([2]);
- await wrapper.vm.onInputKeyDown({ which: 40, target: { value: 2 }, preventDefault: () => {} });
+ await wrapper.vm.onInputKeyDown({ code: 'ArrowDown', target: { value: 2 }, preventDefault: () => {} });
expect(wrapper.emitted()['update:modelValue'][1]).toEqual([1]);
});
it('is keydown called when tab key pressed', async () => {
- await wrapper.vm.onInputKeyDown({ which: 9, target: { value: '12' }, preventDefault: () => {} });
+ await wrapper.vm.onInputKeyDown({ code: 'Tab', target: { value: '12' }, preventDefault: () => {} });
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([12]);
expect(wrapper.find('input.p-inputnumber-input').attributes()['aria-valuenow']).toBe('12');
});
it('is keydown called when enter key pressed', async () => {
- await wrapper.vm.onInputKeyDown({ which: 13, target: { value: '12' }, preventDefault: () => {} });
+ await wrapper.vm.onInputKeyDown({ code: 'Enter', target: { value: '12' }, preventDefault: () => {} });
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([12]);
expect(wrapper.find('input.p-inputnumber-input').attributes()['aria-valuenow']).toBe('12');
@@ -60,11 +60,11 @@ describe('InputNumber.vue', () => {
it('should have min boundary', async () => {
await wrapper.setProps({ modelValue: 95, min: 95 });
- await wrapper.vm.onInputKeyDown({ which: 40, target: { value: 96 }, preventDefault: () => {} });
+ await wrapper.vm.onInputKeyDown({ code: 'ArrowDown', target: { value: 96 }, preventDefault: () => {} });
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([95]);
- await wrapper.vm.onInputKeyDown({ which: 40, target: { value: 95 }, preventDefault: () => {} });
+ await wrapper.vm.onInputKeyDown({ code: 'ArrowDown', target: { value: 95 }, preventDefault: () => {} });
expect(wrapper.emitted()['update:modelValue'][1]).toEqual([95]);
});
@@ -72,11 +72,11 @@ describe('InputNumber.vue', () => {
it('should have max boundary', async () => {
await wrapper.setProps({ modelValue: 99, max: 100 });
- await wrapper.vm.onInputKeyDown({ which: 38, target: { value: 99 }, preventDefault: () => {} });
+ await wrapper.vm.onInputKeyDown({ code: 'ArrowUp', target: { value: 99 }, preventDefault: () => {} });
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([100]);
- await wrapper.vm.onInputKeyDown({ which: 38, target: { value: 100 }, preventDefault: () => {} });
+ await wrapper.vm.onInputKeyDown({ code: 'ArrowUp', target: { value: 100 }, preventDefault: () => {} });
expect(wrapper.emitted()['update:modelValue'][1]).toEqual([100]);
});
diff --git a/components/inputnumber/InputNumber.vue b/components/inputnumber/InputNumber.vue
index 72cb66cc8..806b55c30 100755
--- a/components/inputnumber/InputNumber.vue
+++ b/components/inputnumber/InputNumber.vue
@@ -35,8 +35,9 @@
@@ -406,7 +674,7 @@ export default {
top: 0;
}
-.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem > .p-menuitem-link > .p-submenu-icon {
+.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem > .p-menuitem-content > .p-menuitem-link > .p-submenu-icon {
margin-left: auto;
}
diff --git a/components/megamenu/MegaMenuSub.vue b/components/megamenu/MegaMenuSub.vue
new file mode 100644
index 000000000..c7d741e68
--- /dev/null
+++ b/components/megamenu/MegaMenuSub.vue
@@ -0,0 +1,231 @@
+
+
+ - {{ getItemLabel(submenu) }}
+
+ -
+
+
+
+
+
+
+
+
+
diff --git a/components/menu/Menu.d.ts b/components/menu/Menu.d.ts
index 627544819..e72c4118b 100755
--- a/components/menu/Menu.d.ts
+++ b/components/menu/Menu.d.ts
@@ -1,6 +1,6 @@
import { VNode } from 'vue';
-import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
import { MenuItem } from '../menuitem';
+import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
type MenuAppendToType = 'body' | 'self' | string | undefined | HTMLElement;
@@ -34,6 +34,18 @@ export interface MenuProps {
* Default value is true.
*/
exact?: boolean | undefined;
+ /**
+ * Index of the element in tabbing order.
+ */
+ tabindex?: number | string | undefined;
+ /**
+ * Defines a string value that labels an interactive element.
+ */
+ 'aria-label'?: string | undefined;
+ /**
+ * Identifier of the underlying input element.
+ */
+ 'aria-labelledby'?: string | undefined;
}
export interface MenuSlots {
@@ -44,7 +56,18 @@ export interface MenuSlots {
item: (scope: { item: MenuItem }) => VNode[];
}
-export declare type MenuEmits = {};
+export declare type MenuEmits = {
+ /**
+ * Callback to invoke when the component receives focus.
+ * @param {Event} event - Browser event.
+ */
+ focus: (event: Event) => void;
+ /**
+ * Callback to invoke when the component loses focus.
+ * @param {Event} event - Browser event.
+ */
+ blur: (event: Event) => void;
+};
declare class Menu extends ClassComponent
{
/**
diff --git a/components/menu/Menu.spec.js b/components/menu/Menu.spec.js
index 0fc9551e2..653d9d82a 100644
--- a/components/menu/Menu.spec.js
+++ b/components/menu/Menu.spec.js
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
-import PrimeVue from '../config/PrimeVue';
+import PrimeVue from 'primevue/config';
import Menu from './Menu.vue';
describe('Menu.vue', () => {
diff --git a/components/menu/Menu.vue b/components/menu/Menu.vue
old mode 100755
new mode 100644
index 8f3402f97..e3c9e5817
--- a/components/menu/Menu.vue
+++ b/components/menu/Menu.vue
@@ -1,20 +1,32 @@
-
-