Merge branch 'master' into v4
commit
a3725abc1e
|
@ -270,6 +270,11 @@
|
||||||
"name": "Splitter",
|
"name": "Splitter",
|
||||||
"to": "/splitter"
|
"to": "/splitter"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Stepper",
|
||||||
|
"to": "/stepper",
|
||||||
|
"badge": "NEW"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "TabView",
|
"name": "TabView",
|
||||||
"to": "/tabview"
|
"to": "/tabview"
|
||||||
|
|
|
@ -79,7 +79,7 @@ import ThemeSwitcher from './components/ThemeSwitcher.vue';`;
|
||||||
} else {
|
} else {
|
||||||
// main.js
|
// main.js
|
||||||
pvTheme += `import "primeflex/primeflex.css";
|
pvTheme += `import "primeflex/primeflex.css";
|
||||||
import "primevue/resources/themes/lara-light-green/theme.css";`;
|
import "primevue/resources/themes/aura-light-green/theme.css";`;
|
||||||
|
|
||||||
// package.json
|
// package.json
|
||||||
dependencies['primeflex'] = app_dependencies['primeflex'] || 'latest';
|
dependencies['primeflex'] = app_dependencies['primeflex'] || 'latest';
|
||||||
|
@ -155,6 +155,7 @@ import Badge from 'primevue/badge';
|
||||||
import BadgeDirective from "primevue/badgedirective";
|
import BadgeDirective from "primevue/badgedirective";
|
||||||
import BlockUI from 'primevue/blockui';
|
import BlockUI from 'primevue/blockui';
|
||||||
import Button from 'primevue/button';
|
import Button from 'primevue/button';
|
||||||
|
import ButtonGroup from 'primevue/buttongroup';
|
||||||
import Breadcrumb from 'primevue/breadcrumb';
|
import Breadcrumb from 'primevue/breadcrumb';
|
||||||
import Calendar from 'primevue/calendar';
|
import Calendar from 'primevue/calendar';
|
||||||
import Card from 'primevue/card';
|
import Card from 'primevue/card';
|
||||||
|
@ -202,6 +203,7 @@ import MegaMenu from 'primevue/megamenu';
|
||||||
import Menu from 'primevue/menu';
|
import Menu from 'primevue/menu';
|
||||||
import Menubar from 'primevue/menubar';
|
import Menubar from 'primevue/menubar';
|
||||||
import Message from 'primevue/message';
|
import Message from 'primevue/message';
|
||||||
|
import MeterGroup from 'primevue/metergroup';
|
||||||
import MultiSelect from 'primevue/multiselect';
|
import MultiSelect from 'primevue/multiselect';
|
||||||
import OrderList from 'primevue/orderlist';
|
import OrderList from 'primevue/orderlist';
|
||||||
import OrganizationChart from 'primevue/organizationchart';
|
import OrganizationChart from 'primevue/organizationchart';
|
||||||
|
@ -227,6 +229,8 @@ import SpeedDial from 'primevue/speeddial';
|
||||||
import SplitButton from 'primevue/splitbutton';
|
import SplitButton from 'primevue/splitbutton';
|
||||||
import Splitter from 'primevue/splitter';
|
import Splitter from 'primevue/splitter';
|
||||||
import SplitterPanel from 'primevue/splitterpanel';
|
import SplitterPanel from 'primevue/splitterpanel';
|
||||||
|
import Stepper from 'primevue/stepper';
|
||||||
|
import StepperPanel from 'primevue/stepperpanel';
|
||||||
import Steps from 'primevue/steps';
|
import Steps from 'primevue/steps';
|
||||||
import StyleClass from 'primevue/styleclass';
|
import StyleClass from 'primevue/styleclass';
|
||||||
import TabMenu from 'primevue/tabmenu';
|
import TabMenu from 'primevue/tabmenu';
|
||||||
|
@ -273,6 +277,7 @@ app.component('Badge', Badge);
|
||||||
app.component('BlockUI', BlockUI);
|
app.component('BlockUI', BlockUI);
|
||||||
app.component('Breadcrumb', Breadcrumb);
|
app.component('Breadcrumb', Breadcrumb);
|
||||||
app.component('Button', Button);
|
app.component('Button', Button);
|
||||||
|
app.component('ButtonGroup', ButtonGroup);
|
||||||
app.component('Calendar', Calendar);
|
app.component('Calendar', Calendar);
|
||||||
app.component('Card', Card);
|
app.component('Card', Card);
|
||||||
app.component('Carousel', Carousel);
|
app.component('Carousel', Carousel);
|
||||||
|
@ -316,6 +321,7 @@ app.component('MegaMenu', MegaMenu);
|
||||||
app.component('Menu', Menu);
|
app.component('Menu', Menu);
|
||||||
app.component('Menubar', Menubar);
|
app.component('Menubar', Menubar);
|
||||||
app.component('Message', Message);
|
app.component('Message', Message);
|
||||||
|
app.component('MeterGroup', MeterGroup);
|
||||||
app.component('MultiSelect', MultiSelect);
|
app.component('MultiSelect', MultiSelect);
|
||||||
app.component('OrderList', OrderList);
|
app.component('OrderList', OrderList);
|
||||||
app.component('OrganizationChart', OrganizationChart);
|
app.component('OrganizationChart', OrganizationChart);
|
||||||
|
@ -340,6 +346,8 @@ app.component('SpeedDial', SpeedDial);
|
||||||
app.component('SplitButton', SplitButton);
|
app.component('SplitButton', SplitButton);
|
||||||
app.component('Splitter', Splitter);
|
app.component('Splitter', Splitter);
|
||||||
app.component('SplitterPanel', SplitterPanel);
|
app.component('SplitterPanel', SplitterPanel);
|
||||||
|
app.component('Stepper', Stepper);
|
||||||
|
app.component('StepperPanel', StepperPanel);
|
||||||
app.component('Steps', Steps);
|
app.component('Steps', Steps);
|
||||||
app.component('TabMenu', TabMenu);
|
app.component('TabMenu', TabMenu);
|
||||||
app.component('TabView', TabView);
|
app.component('TabView', TabView);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" v-bind="ptm('root')">
|
<div :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<div v-for="(tab, i) of tabs" :key="getKey(tab, i)" :class="cx('tab.root', { tab, index: i })" v-bind="getTabPT(tab, 'root', i)" data-pc-name="accordiontab" :data-pc-index="i" :data-p-active="isTabActive(i)">
|
<div v-for="(tab, i) of tabs" :key="getKey(tab, i)" :class="cx('tab.root', { tab, index: i })" v-bind="getTabPT(tab, 'root', i)" data-pc-name="accordiontab" :data-pc-index="i" :data-p-active="isTabActive(i)">
|
||||||
<div
|
<div
|
||||||
:style="getTabProp(tab, 'headerStyle')"
|
:style="getTabProp(tab, 'headerStyle')"
|
||||||
|
@ -64,6 +64,7 @@ import BaseAccordion from './BaseAccordion.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Accordion',
|
name: 'Accordion',
|
||||||
extends: BaseAccordion,
|
extends: BaseAccordion,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:activeIndex', 'tab-open', 'tab-close', 'tab-click'],
|
emits: ['update:activeIndex', 'tab-open', 'tab-close', 'tab-click'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import BaseAccordionTab from './BaseAccordionTab.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AccordionTab',
|
name: 'AccordionTab',
|
||||||
extends: BaseAccordionTab
|
extends: BaseAccordionTab,
|
||||||
|
inheritAttrs: false
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
:aria-expanded="overlayVisible"
|
:aria-expanded="overlayVisible"
|
||||||
:aria-controls="id + '_list'"
|
:aria-controls="id + '_list'"
|
||||||
:aria-activedescendant="focused ? focusedOptionId : undefined"
|
:aria-activedescendant="focused ? focusedOptionId : undefined"
|
||||||
|
:aria-invalid="invalid || undefined"
|
||||||
@focus="onFocus"
|
@focus="onFocus"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@keydown="onKeyDown"
|
@keydown="onKeyDown"
|
||||||
|
@ -78,6 +79,7 @@
|
||||||
:aria-expanded="overlayVisible"
|
:aria-expanded="overlayVisible"
|
||||||
:aria-controls="id + '_list'"
|
:aria-controls="id + '_list'"
|
||||||
:aria-activedescendant="focused ? focusedOptionId : undefined"
|
:aria-activedescendant="focused ? focusedOptionId : undefined"
|
||||||
|
:aria-invalid="invalid || undefined"
|
||||||
@focus="onFocus"
|
@focus="onFocus"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@keydown="onKeyDown"
|
@keydown="onKeyDown"
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* AvatarGroup is a helper component for Avatar.
|
* A set of Avatars can be displayed together using the AvatarGroup component.
|
||||||
*
|
*
|
||||||
* [Live Demo](https://www.primevue.org/accordion/)
|
* [Live Demo](https://www.primevue.org/accordion/)
|
||||||
*
|
*
|
||||||
* @module avatargroup
|
* @module avatargroup
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
import { VNode } from 'vue';
|
||||||
import { ComponentHooks } from '../basecomponent';
|
import { ComponentHooks } from '../basecomponent';
|
||||||
import { PassThroughOptions } from '../passthrough';
|
import { PassThroughOptions } from '../passthrough';
|
||||||
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
||||||
|
@ -60,7 +61,12 @@ export interface AvatarGroupProps {
|
||||||
/**
|
/**
|
||||||
* Defines valid slots in AvatarGroup component.
|
* Defines valid slots in AvatarGroup component.
|
||||||
*/
|
*/
|
||||||
export interface AvatarGroupSlots {}
|
export interface AvatarGroupSlots {
|
||||||
|
/**
|
||||||
|
* Default slot to detect Avatar components.
|
||||||
|
*/
|
||||||
|
default(): VNode[];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines valid emits in AvatarGroup component.
|
* Defines valid emits in AvatarGroup component.
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
<script>
|
||||||
|
import BaseComponent from 'primevue/basecomponent';
|
||||||
|
import ButtonGroupStyle from 'primevue/buttongroup/style';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'BaseButtonGroup',
|
||||||
|
extends: BaseComponent,
|
||||||
|
style: ButtonGroupStyle,
|
||||||
|
provide() {
|
||||||
|
return {
|
||||||
|
$parentInstance: this
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,113 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* A set of Buttons can be displayed together using the ButtonGroup component.
|
||||||
|
*
|
||||||
|
* [Live Demo](https://www.primevue.org/button/)
|
||||||
|
*
|
||||||
|
* @module buttongroup
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
import { VNode } from 'vue';
|
||||||
|
import { ComponentHooks } from '../basecomponent/BaseComponent';
|
||||||
|
import { PassThroughOptions } from '../passthrough';
|
||||||
|
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
||||||
|
|
||||||
|
export declare type ButtonGroupPassThroughOptionType = ButtonGroupPassThroughAttributes | ((options: ButtonGroupPassThroughMethodOptions) => ButtonGroupPassThroughAttributes | string) | string | null | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom passthrough(pt) option method.
|
||||||
|
*/
|
||||||
|
export interface ButtonGroupPassThroughMethodOptions {
|
||||||
|
/**
|
||||||
|
* Defines instance.
|
||||||
|
*/
|
||||||
|
instance: any;
|
||||||
|
/**
|
||||||
|
* Defines valid properties.
|
||||||
|
*/
|
||||||
|
props: ButtonGroupProps;
|
||||||
|
/**
|
||||||
|
* Defines passthrough(pt) options in global config.
|
||||||
|
*/
|
||||||
|
global: object | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom passthrough(pt) options.
|
||||||
|
* @see {@link ButtonGroupProps.pt}
|
||||||
|
*/
|
||||||
|
export interface ButtonGroupPassThroughOptions {
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the root's DOM element.
|
||||||
|
*/
|
||||||
|
root?: ButtonGroupPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to manage all lifecycle hooks.
|
||||||
|
* @see {@link BaseComponent.ComponentHooks}
|
||||||
|
*/
|
||||||
|
hooks?: ComponentHooks;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom passthrough attributes for each DOM elements
|
||||||
|
*/
|
||||||
|
export interface ButtonGroupPassThroughAttributes {
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines valid properties in ButtonGroup component.
|
||||||
|
*/
|
||||||
|
export interface ButtonGroupProps {
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to DOM elements inside the component.
|
||||||
|
* @type {ButtonGroupPassThroughOptions}
|
||||||
|
*/
|
||||||
|
pt?: PassThrough<ButtonGroupPassThroughOptions>;
|
||||||
|
/**
|
||||||
|
* Used to configure passthrough(pt) options of the component.
|
||||||
|
* @type {PassThroughOptions}
|
||||||
|
*/
|
||||||
|
ptOptions?: PassThroughOptions;
|
||||||
|
/**
|
||||||
|
* When enabled, it removes component related styles in the core.
|
||||||
|
* @defaultValue false
|
||||||
|
*/
|
||||||
|
unstyled?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines valid slots in ButtonGroup component.
|
||||||
|
*/
|
||||||
|
export interface ButtonGroupSlots {
|
||||||
|
/**
|
||||||
|
* Default slot to detect Button components.
|
||||||
|
*/
|
||||||
|
default(): VNode[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines valid emits in ButtonGroup component.
|
||||||
|
*/
|
||||||
|
export interface ButtonGroupEmits {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* **PrimeVue - ButtonGroup**
|
||||||
|
*
|
||||||
|
* _A set of Buttons can be displayed together using the ButtonGroup component._
|
||||||
|
*
|
||||||
|
* [Live Demo](https://www.primevue.org/button/)
|
||||||
|
* --- ---
|
||||||
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
||||||
|
*
|
||||||
|
* @group Component
|
||||||
|
*/
|
||||||
|
declare class ButtonGroup extends ClassComponent<ButtonGroupProps, ButtonGroupSlots, ButtonGroupEmits> {}
|
||||||
|
|
||||||
|
declare module '@vue/runtime-core' {
|
||||||
|
interface GlobalComponents {
|
||||||
|
ButtonGroup: GlobalComponentConstructor<ButtonGroup>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ButtonGroup;
|
|
@ -0,0 +1,15 @@
|
||||||
|
<template>
|
||||||
|
<span :class="cx('root')" role="group" v-bind="ptmi('root')">
|
||||||
|
<slot />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BaseButtonGroup from './BaseButtonGroup.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ButtonGroup',
|
||||||
|
extends: BaseButtonGroup,
|
||||||
|
inheritAttrs: false
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"main": "./buttongroup.cjs.js",
|
||||||
|
"module": "./buttongroup.esm.js",
|
||||||
|
"unpkg": "./buttongroup.min.js",
|
||||||
|
"types": "./ButtonGroup.d.ts",
|
||||||
|
"browser": {
|
||||||
|
"./sfc": "./ButtonGroup.vue"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
import { BaseStyle } from '../../base/style/BaseStyle';
|
||||||
|
|
||||||
|
export interface ButtonGroupStyle extends BaseStyle {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
import BaseStyle from 'primevue/base/style';
|
||||||
|
|
||||||
|
const classes = {
|
||||||
|
root: 'p-button-group p-component'
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BaseStyle.extend({
|
||||||
|
name: 'buttongroup',
|
||||||
|
classes
|
||||||
|
});
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"main": "./buttongroupstyle.cjs.js",
|
||||||
|
"module": "./buttongroupstyle.esm.js",
|
||||||
|
"unpkg": "./buttongroupstyle.min.js",
|
||||||
|
"types": "./ButtonGroupStyle.d.ts"
|
||||||
|
}
|
|
@ -16,6 +16,7 @@
|
||||||
:aria-controls="panelId"
|
:aria-controls="panelId"
|
||||||
:aria-labelledby="ariaLabelledby"
|
:aria-labelledby="ariaLabelledby"
|
||||||
:aria-label="ariaLabel"
|
:aria-label="ariaLabel"
|
||||||
|
:aria-invalid="invalid || undefined"
|
||||||
inputmode="none"
|
inputmode="none"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:readonly="!manualInput || readonly"
|
:readonly="!manualInput || readonly"
|
||||||
|
@ -1809,7 +1810,7 @@ export default {
|
||||||
let parts = text.split(' ');
|
let parts = text.split(' ');
|
||||||
|
|
||||||
if (this.timeOnly) {
|
if (this.timeOnly) {
|
||||||
date = new Date(this.modelValue);
|
date = new Date();
|
||||||
this.populateTime(date, parts[0], parts[1]);
|
this.populateTime(date, parts[0], parts[1]);
|
||||||
} else {
|
} else {
|
||||||
const dateFormat = this.datePattern;
|
const dateFormat = this.datePattern;
|
||||||
|
|
|
@ -9,7 +9,7 @@ const classes = {
|
||||||
'p-calendar p-component p-inputwrapper',
|
'p-calendar p-component p-inputwrapper',
|
||||||
{
|
{
|
||||||
'p-calendar-w-btn': props.showIcon && props.iconDisplay === 'button',
|
'p-calendar-w-btn': props.showIcon && props.iconDisplay === 'button',
|
||||||
'p-input-icon-right': props.showIcon && props.iconDisplay === 'input',
|
'p-icon-field p-icon-field-right': props.showIcon && props.iconDisplay === 'input',
|
||||||
'p-calendar-timeonly': props.timeOnly,
|
'p-calendar-timeonly': props.timeOnly,
|
||||||
'p-calendar-disabled': props.disabled,
|
'p-calendar-disabled': props.disabled,
|
||||||
'p-invalid': props.invalid,
|
'p-invalid': props.invalid,
|
||||||
|
@ -25,7 +25,7 @@ const classes = {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
dropdownButton: 'p-datepicker-trigger',
|
dropdownButton: 'p-datepicker-trigger',
|
||||||
inputIcon: 'p-datepicker-trigger-icon',
|
inputIcon: 'p-datepicker-trigger-icon p-input-icon',
|
||||||
panel: ({ instance, props, state }) => [
|
panel: ({ instance, props, state }) => [
|
||||||
'p-datepicker p-component',
|
'p-datepicker p-component',
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
:aria-expanded="overlayVisible"
|
:aria-expanded="overlayVisible"
|
||||||
:aria-controls="id + '_tree'"
|
:aria-controls="id + '_tree'"
|
||||||
:aria-activedescendant="focused ? focusedOptionId : undefined"
|
:aria-activedescendant="focused ? focusedOptionId : undefined"
|
||||||
|
:aria-invalid="invalid || undefined"
|
||||||
@focus="onFocus"
|
@focus="onFocus"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@keydown="onKeyDown"
|
@keydown="onKeyDown"
|
||||||
|
@ -283,13 +284,24 @@ export default {
|
||||||
|
|
||||||
const { index, level, parentKey, children } = processedOption;
|
const { index, level, parentKey, children } = processedOption;
|
||||||
const grouped = ObjectUtils.isNotEmpty(children);
|
const grouped = ObjectUtils.isNotEmpty(children);
|
||||||
|
const root = ObjectUtils.isEmpty(processedOption.parent);
|
||||||
|
const selected = this.isSelected(processedOption);
|
||||||
|
|
||||||
const activeOptionPath = this.activeOptionPath.filter((p) => p.parentKey !== parentKey);
|
if (selected) {
|
||||||
|
const { index, key, level, parentKey } = processedOption;
|
||||||
|
|
||||||
activeOptionPath.push(processedOption);
|
this.focusedOptionInfo = { index, level, parentKey };
|
||||||
|
this.activeOptionPath = this.activeOptionPath.filter((p) => key !== p.key && key.startsWith(p.key));
|
||||||
|
|
||||||
this.focusedOptionInfo = { index, level, parentKey };
|
this.dirty = !root;
|
||||||
this.activeOptionPath = activeOptionPath;
|
} else {
|
||||||
|
const activeOptionPath = this.activeOptionPath.filter((p) => p.parentKey !== parentKey);
|
||||||
|
|
||||||
|
activeOptionPath.push(processedOption);
|
||||||
|
|
||||||
|
this.focusedOptionInfo = { index, level, parentKey };
|
||||||
|
this.activeOptionPath = activeOptionPath;
|
||||||
|
}
|
||||||
|
|
||||||
grouped ? this.onOptionGroupSelect(originalEvent, processedOption) : this.onOptionSelect(originalEvent, processedOption, isHide);
|
grouped ? this.onOptionGroupSelect(originalEvent, processedOption) : this.onOptionSelect(originalEvent, processedOption, isHide);
|
||||||
isFocus && DomHandler.focus(this.$refs.focusInput);
|
isFocus && DomHandler.focus(this.$refs.focusInput);
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
:required="required"
|
:required="required"
|
||||||
:aria-labelledby="ariaLabelledby"
|
:aria-labelledby="ariaLabelledby"
|
||||||
:aria-label="ariaLabel"
|
:aria-label="ariaLabel"
|
||||||
|
:aria-invalid="invalid || undefined"
|
||||||
@focus="onFocus"
|
@focus="onFocus"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
:style="inputStyle"
|
:style="inputStyle"
|
||||||
:disabled="disabled || maxedOut"
|
:disabled="disabled || maxedOut"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
|
:aria-invalid="invalid || undefined"
|
||||||
@focus="onFocus($event)"
|
@focus="onFocus($event)"
|
||||||
@blur="onBlur($event)"
|
@blur="onBlur($event)"
|
||||||
@input="onInput"
|
@input="onInput"
|
||||||
|
|
|
@ -4,6 +4,7 @@ import BaseColumn from './BaseColumn.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Column',
|
name: 'Column',
|
||||||
extends: BaseColumn,
|
extends: BaseColumn,
|
||||||
|
inheritAttrs: false,
|
||||||
inject: ['$columns'],
|
inject: ['$columns'],
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$columns?.add(this.$);
|
this.$columns?.add(this.$);
|
||||||
|
|
|
@ -4,6 +4,7 @@ import BaseColumnGroup from './BaseColumnGroup.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'ColumnGroup',
|
name: 'ColumnGroup',
|
||||||
extends: BaseColumnGroup,
|
extends: BaseColumnGroup,
|
||||||
|
inheritAttrs: false,
|
||||||
inject: ['$columnGroups'],
|
inject: ['$columnGroups'],
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$columnGroups?.add(this.$);
|
this.$columnGroups?.add(this.$);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<Portal>
|
<Portal>
|
||||||
<transition name="p-confirm-popup" @enter="onEnter" @after-enter="onAfterEnter" @leave="onLeave" @after-leave="onAfterLeave" v-bind="ptm('transition')">
|
<transition name="p-confirm-popup" @enter="onEnter" @after-enter="onAfterEnter" @leave="onLeave" @after-leave="onAfterLeave" v-bind="ptm('transition')">
|
||||||
<div v-if="visible" :ref="containerRef" v-focustrap role="alertdialog" :class="cx('root')" :aria-modal="visible" @click="onOverlayClick" @keydown="onOverlayKeydown" v-bind="{ ...$attrs, ...ptm('root') }">
|
<div v-if="visible" :ref="containerRef" v-focustrap role="alertdialog" :class="cx('root')" :aria-modal="visible" @click="onOverlayClick" @keydown="onOverlayKeydown" v-bind="ptmi('root')">
|
||||||
<slot v-if="$slots.container" name="container" :message="confirmation" :onAccept="accept" :onReject="reject" :acceptCallback="accept" :rejectCallback="reject"></slot>
|
<slot v-if="$slots.container" name="container" :message="confirmation" :onAccept="accept" :onReject="reject" :acceptCallback="accept" :rejectCallback="reject"></slot>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<template v-if="!$slots.message">
|
<template v-if="!$slots.message">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<Portal :appendTo="appendTo">
|
<Portal :appendTo="appendTo">
|
||||||
<transition name="p-contextmenu" @enter="onEnter" @after-enter="onAfterEnter" @leave="onLeave" @after-leave="onAfterLeave" v-bind="ptm('transition')">
|
<transition name="p-contextmenu" @enter="onEnter" @after-enter="onAfterEnter" @leave="onLeave" @after-leave="onAfterLeave" v-bind="ptm('transition')">
|
||||||
<div v-if="visible" :ref="containerRef" :class="cx('root')" v-bind="{ ...$attrs, ...ptm('root') }">
|
<div v-if="visible" :ref="containerRef" :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<ContextMenuSub
|
<ContextMenuSub
|
||||||
:ref="listRef"
|
:ref="listRef"
|
||||||
:id="id + '_list'"
|
:id="id + '_list'"
|
||||||
|
@ -27,6 +27,7 @@
|
||||||
@keydown="onKeyDown"
|
@keydown="onKeyDown"
|
||||||
@item-click="onItemClick"
|
@item-click="onItemClick"
|
||||||
@item-mouseenter="onItemMouseEnter"
|
@item-mouseenter="onItemMouseEnter"
|
||||||
|
@item-mousemove="onItemMouseMove"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
@ -247,6 +248,11 @@ export default {
|
||||||
onItemMouseEnter(event) {
|
onItemMouseEnter(event) {
|
||||||
this.onItemChange(event);
|
this.onItemChange(event);
|
||||||
},
|
},
|
||||||
|
onItemMouseMove(event) {
|
||||||
|
if (this.focused) {
|
||||||
|
this.changeFocusedItemIndex(event, event.processedItem.index);
|
||||||
|
}
|
||||||
|
},
|
||||||
onArrowDownKey(event) {
|
onArrowDownKey(event) {
|
||||||
const itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex();
|
const itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex();
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,16 @@
|
||||||
:data-p-focused="isItemFocused(processedItem)"
|
:data-p-focused="isItemFocused(processedItem)"
|
||||||
:data-p-disabled="isItemDisabled(processedItem)"
|
:data-p-disabled="isItemDisabled(processedItem)"
|
||||||
>
|
>
|
||||||
<div :class="cx('content')" @click="onItemClick($event, processedItem)" @mouseenter="onItemMouseEnter($event, processedItem)" v-bind="getPTOptions('content', processedItem, index)">
|
<div
|
||||||
|
:class="cx('content')"
|
||||||
|
@click="onItemClick($event, processedItem)"
|
||||||
|
@mouseenter="onItemMouseEnter($event, processedItem)"
|
||||||
|
@mousemove="onItemMouseMove($event, processedItem)"
|
||||||
|
v-bind="getPTOptions('content', processedItem, index)"
|
||||||
|
>
|
||||||
<template v-if="!templates.item">
|
<template v-if="!templates.item">
|
||||||
<a v-ripple :href="getItemProp(processedItem, 'url')" :class="cx('action')" :target="getItemProp(processedItem, 'target')" tabindex="-1" aria-hidden="true" v-bind="getPTOptions('action', processedItem, index)">
|
<a v-ripple :href="getItemProp(processedItem, 'url')" :class="cx('action')" :target="getItemProp(processedItem, 'target')" tabindex="-1" aria-hidden="true" v-bind="getPTOptions('action', processedItem, index)">
|
||||||
<component v-if="templates.itemicon" :is="templates.itemicon" :item="processedItem.item" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" />
|
<component v-if="templates.itemicon" :is="templates.itemicon" :item="processedItem.item" :class="cx('icon')" />
|
||||||
<span v-else-if="getItemProp(processedItem, 'icon')" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" v-bind="getPTOptions('icon', processedItem, index)" />
|
<span v-else-if="getItemProp(processedItem, 'icon')" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" v-bind="getPTOptions('icon', processedItem, index)" />
|
||||||
<span :id="getItemLabelId(processedItem)" :class="cx('label')" v-bind="getPTOptions('label', processedItem, index)">{{ getItemLabel(processedItem) }}</span>
|
<span :id="getItemLabelId(processedItem)" :class="cx('label')" v-bind="getPTOptions('label', processedItem, index)">{{ getItemLabel(processedItem) }}</span>
|
||||||
<template v-if="getItemProp(processedItem, 'items')">
|
<template v-if="getItemProp(processedItem, 'items')">
|
||||||
|
@ -50,6 +56,7 @@
|
||||||
:unstyled="unstyled"
|
:unstyled="unstyled"
|
||||||
@item-click="$emit('item-click', $event)"
|
@item-click="$emit('item-click', $event)"
|
||||||
@item-mouseenter="$emit('item-mouseenter', $event)"
|
@item-mouseenter="$emit('item-mouseenter', $event)"
|
||||||
|
@item-mousemove="$emit('item-mousemove', $event)"
|
||||||
:aria-labelledby="getItemLabelId(processedItem)"
|
:aria-labelledby="getItemLabelId(processedItem)"
|
||||||
v-bind="ptm('submenu')"
|
v-bind="ptm('submenu')"
|
||||||
/>
|
/>
|
||||||
|
@ -78,7 +85,7 @@ export default {
|
||||||
name: 'ContextMenuSub',
|
name: 'ContextMenuSub',
|
||||||
hostName: 'ContextMenu',
|
hostName: 'ContextMenu',
|
||||||
extends: BaseComponent,
|
extends: BaseComponent,
|
||||||
emits: ['item-click', 'item-mouseenter'],
|
emits: ['item-click', 'item-mouseenter', 'item-mousemove'],
|
||||||
props: {
|
props: {
|
||||||
items: {
|
items: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
@ -166,6 +173,9 @@ export default {
|
||||||
onItemMouseEnter(event, processedItem) {
|
onItemMouseEnter(event, processedItem) {
|
||||||
this.$emit('item-mouseenter', { originalEvent: event, processedItem });
|
this.$emit('item-mouseenter', { originalEvent: event, processedItem });
|
||||||
},
|
},
|
||||||
|
onItemMouseMove(event, processedItem) {
|
||||||
|
this.$emit('item-mousemove', { originalEvent: event, processedItem, isFocus: true });
|
||||||
|
},
|
||||||
getAriaSetSize() {
|
getAriaSetSize() {
|
||||||
return this.items.filter((processedItem) => this.isItemVisible(processedItem) && !this.getItemProp(processedItem, 'separator')).length;
|
return this.items.filter((processedItem) => this.isItemVisible(processedItem) && !this.getItemProp(processedItem, 'separator')).length;
|
||||||
},
|
},
|
||||||
|
|
|
@ -425,9 +425,6 @@ export default {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isEditingCellValid() {
|
|
||||||
return DomHandler.find(this.$el, '.p-invalid').length === 0;
|
|
||||||
},
|
|
||||||
onRowEditInit(event) {
|
onRowEditInit(event) {
|
||||||
this.$emit('row-edit-init', { originalEvent: event, data: this.rowData, newData: this.editingRowData, field: this.field, index: this.rowIndex });
|
this.$emit('row-edit-init', { originalEvent: event, data: this.rowData, newData: this.editingRowData, field: this.field, index: this.rowIndex });
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" data-scrollselectors=".p-datatable-wrapper" v-bind="ptm('root')">
|
<div :class="cx('root')" data-scrollselectors=".p-datatable-wrapper" v-bind="ptmi('root')">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<div v-if="loading" :class="cx('loadingOverlay')" v-bind="ptm('loadingOverlay')">
|
<div v-if="loading" :class="cx('loadingOverlay')" v-bind="ptm('loadingOverlay')">
|
||||||
<slot v-if="$slots.loading" name="loading"></slot>
|
<slot v-if="$slots.loading" name="loading"></slot>
|
||||||
|
@ -293,6 +293,7 @@ import TableHeader from './TableHeader.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'DataTable',
|
name: 'DataTable',
|
||||||
extends: BaseDataTable,
|
extends: BaseDataTable,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: [
|
emits: [
|
||||||
'value-change',
|
'value-change',
|
||||||
'update:first',
|
'update:first',
|
||||||
|
@ -863,13 +864,14 @@ export default {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (event.code === 'KeyA' && metaKey) {
|
if (event.code === 'KeyA' && metaKey && this.isMultipleSelectionMode()) {
|
||||||
const data = this.dataToRender(slotProps.rows);
|
const data = this.dataToRender(slotProps.rows);
|
||||||
|
|
||||||
this.$emit('update:selection', data);
|
this.$emit('update:selection', data);
|
||||||
event.preventDefault();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" v-bind="ptm('root')">
|
<div :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<div v-if="$slots.header" :class="cx('header')" v-bind="ptm('header')">
|
<div v-if="$slots.header" :class="cx('header')" v-bind="ptm('header')">
|
||||||
<slot name="header"></slot>
|
<slot name="header"></slot>
|
||||||
</div>
|
</div>
|
||||||
|
@ -72,6 +72,7 @@ import BaseDataView from './BaseDataView.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'DataView',
|
name: 'DataView',
|
||||||
extends: BaseDataView,
|
extends: BaseDataView,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:first', 'update:rows', 'page'],
|
emits: ['update:first', 'update:rows', 'page'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" role="group" v-bind="ptm('root')">
|
<div :class="cx('root')" role="group" v-bind="ptmi('root')">
|
||||||
<button :aria-label="listViewAriaLabel" :class="cx('listButton')" @click="changeLayout('list')" type="button" :aria-pressed="isListButtonPressed" v-bind="ptm('listButton')">
|
<button :aria-label="listViewAriaLabel" :class="cx('listButton')" @click="changeLayout('list')" type="button" :aria-pressed="isListButtonPressed" v-bind="ptm('listButton')">
|
||||||
<slot name="listicon">
|
<slot name="listicon">
|
||||||
<BarsIcon v-bind="ptm('listIcon')" />
|
<BarsIcon v-bind="ptm('listIcon')" />
|
||||||
|
@ -21,6 +21,7 @@ import BaseDataViewLayoutOptions from './BaseDataViewLayoutOptions.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'DataViewLayoutOptions',
|
name: 'DataViewLayoutOptions',
|
||||||
extends: BaseDataViewLayoutOptions,
|
extends: BaseDataViewLayoutOptions,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue'],
|
emits: ['update:modelValue'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import BaseStyle from 'primevue/base/style';
|
import BaseStyle from 'primevue/base/style';
|
||||||
|
|
||||||
const classes = {
|
const classes = {
|
||||||
root: 'p-dataview-layout-options p-selectbutton p-buttonset',
|
root: 'p-dataview-layout-options p-selectbutton p-button-group',
|
||||||
listButton: ({ props }) => [
|
listButton: ({ props }) => [
|
||||||
'p-button p-button-icon-only',
|
'p-button p-button-icon-only',
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div ref="container" v-bind="ptm('root')">
|
<div ref="container" v-bind="ptmi('root')">
|
||||||
<slot v-if="loaded"></slot>
|
<slot v-if="loaded"></slot>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -11,6 +11,7 @@ import DeferredContentStyle from 'primevue/deferredcontent/style';
|
||||||
export default {
|
export default {
|
||||||
name: 'DeferredContent',
|
name: 'DeferredContent',
|
||||||
extends: BaseComponent,
|
extends: BaseComponent,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['load'],
|
emits: ['load'],
|
||||||
style: DeferredContentStyle,
|
style: DeferredContentStyle,
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<Portal :appendTo="appendTo">
|
<Portal :appendTo="appendTo">
|
||||||
<div v-if="containerVisible" :ref="maskRef" :class="cx('mask')" :style="sx('mask', true, { position, modal })" @click="onMaskClick" v-bind="ptm('mask')">
|
<div v-if="containerVisible" :ref="maskRef" :class="cx('mask')" :style="sx('mask', true, { position, modal })" @click="onMaskClick" v-bind="ptm('mask')">
|
||||||
<transition name="p-dialog" @before-enter="onBeforeEnter" @enter="onEnter" @before-leave="onBeforeLeave" @leave="onLeave" @after-leave="onAfterLeave" appear v-bind="ptm('transition')">
|
<transition name="p-dialog" @before-enter="onBeforeEnter" @enter="onEnter" @before-leave="onBeforeLeave" @leave="onLeave" @after-leave="onAfterLeave" appear v-bind="ptm('transition')">
|
||||||
<div v-if="visible" :ref="containerRef" v-focustrap="{ disabled: !modal }" :class="cx('root')" :style="sx('root')" role="dialog" :aria-labelledby="ariaLabelledById" :aria-modal="modal" v-bind="{ ...$attrs, ...ptm('root') }">
|
<div v-if="visible" :ref="containerRef" v-focustrap="{ disabled: !modal }" :class="cx('root')" :style="sx('root')" role="dialog" :aria-labelledby="ariaLabelledById" :aria-modal="modal" v-bind="ptmi('root')">
|
||||||
<slot v-if="$slots.container" name="container" :onClose="close" :onMaximize="(event) => maximize(event)" :closeCallback="close" :maximizeCallback="(event) => maximize(event)"></slot>
|
<slot v-if="$slots.container" name="container" :onClose="close" :onMaximize="(event) => maximize(event)" :closeCallback="close" :maximizeCallback="(event) => maximize(event)"></slot>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div v-if="showHeader" :ref="headerContainerRef" :class="cx('header')" @mousedown="initDrag" v-bind="ptm('header')">
|
<div v-if="showHeader" :ref="headerContainerRef" :class="cx('header')" @mousedown="initDrag" v-bind="ptm('header')">
|
||||||
|
@ -301,7 +301,7 @@ export default {
|
||||||
this.lastPageY = event.pageY;
|
this.lastPageY = event.pageY;
|
||||||
|
|
||||||
this.container.style.margin = '0';
|
this.container.style.margin = '0';
|
||||||
document.body.setAttribute('data-p-unselectable-text', '');
|
document.body.setAttribute('data-p-unselectable-text', 'true');
|
||||||
!this.isUnstyled && DomHandler.addClass(document.body, 'p-unselectable-text');
|
!this.isUnstyled && DomHandler.addClass(document.body, 'p-unselectable-text');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" :style="sx('root')" role="separator" :aria-orientation="layout" v-bind="ptm('root')">
|
<div :class="cx('root')" :style="sx('root')" role="separator" :aria-orientation="layout" v-bind="ptmi('root')">
|
||||||
<div v-if="$slots.default" :class="cx('content')" v-bind="ptm('content')">
|
<div v-if="$slots.default" :class="cx('content')" v-bind="ptm('content')">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,6 +11,7 @@ import BaseDivider from './BaseDivider.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Divider',
|
name: 'Divider',
|
||||||
extends: BaseDivider
|
extends: BaseDivider,
|
||||||
|
inheritAttrs: false
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
:aria-expanded="overlayVisible"
|
:aria-expanded="overlayVisible"
|
||||||
:aria-controls="id + '_list'"
|
:aria-controls="id + '_list'"
|
||||||
:aria-activedescendant="focused ? focusedOptionId : undefined"
|
:aria-activedescendant="focused ? focusedOptionId : undefined"
|
||||||
|
:aria-invalid="invalid || undefined"
|
||||||
@focus="onFocus"
|
@focus="onFocus"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@keydown="onKeyDown"
|
@keydown="onKeyDown"
|
||||||
|
|
|
@ -76,7 +76,7 @@ export default {
|
||||||
emits: ['activeitem-change', 'mask-hide'],
|
emits: ['activeitem-change', 'mask-hide'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
id: this.$attrs.id,
|
id: this.$attrs.id || UniqueComponentId(),
|
||||||
activeIndex: this.$attrs.activeIndex,
|
activeIndex: this.$attrs.activeIndex,
|
||||||
numVisible: this.$attrs.numVisible,
|
numVisible: this.$attrs.numVisible,
|
||||||
slideShowActive: false
|
slideShowActive: false
|
||||||
|
|
|
@ -2,9 +2,10 @@ import BaseStyle from 'primevue/base/style';
|
||||||
|
|
||||||
const classes = {
|
const classes = {
|
||||||
root: ({ props }) => [
|
root: ({ props }) => [
|
||||||
|
'p-icon-field',
|
||||||
{
|
{
|
||||||
'p-input-icon-right': props.iconPosition === 'right',
|
'p-icon-field-right': props.iconPosition === 'right',
|
||||||
'p-input-icon-left': props.iconPosition === 'left'
|
'p-icon-field-left': props.iconPosition === 'left'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,6 +6,9 @@ export default {
|
||||||
name: 'BaseInputIcon',
|
name: 'BaseInputIcon',
|
||||||
extends: BaseComponent,
|
extends: BaseComponent,
|
||||||
style: InputIconStyle,
|
style: InputIconStyle,
|
||||||
|
props: {
|
||||||
|
class: null
|
||||||
|
},
|
||||||
provide() {
|
provide() {
|
||||||
return {
|
return {
|
||||||
$parentInstance: this
|
$parentInstance: this
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<slot />
|
<span :class="containerClass" v-bind="ptmi('root')">
|
||||||
|
<slot />
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -7,6 +9,12 @@ import BaseInputIcon from './BaseInputIcon.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'InputIcon',
|
name: 'InputIcon',
|
||||||
extends: BaseInputIcon
|
extends: BaseInputIcon,
|
||||||
|
inheritAttrs: false,
|
||||||
|
computed: {
|
||||||
|
containerClass() {
|
||||||
|
return [this.cx('root'), this.class];
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1 +1,10 @@
|
||||||
export default {};
|
import BaseStyle from 'primevue/base/style';
|
||||||
|
|
||||||
|
const classes = {
|
||||||
|
root: 'p-input-icon'
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BaseStyle.extend({
|
||||||
|
name: 'inputicon',
|
||||||
|
classes
|
||||||
|
});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<input :class="cx('root')" :readonly="readonly" @input="onInput" @focus="onFocus" @blur="onBlur" @keydown="onKeyDown" @keypress="onKeyPress" @paste="onPaste" v-bind="ptmi('root', ptmParams)" />
|
<input :class="cx('root')" :readonly="readonly" :aria-invalid="invalid || undefined" @input="onInput" @focus="onFocus" @blur="onBlur" @keydown="onKeyDown" @keypress="onKeyPress" @paste="onPaste" v-bind="ptmi('root', ptmParams)" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:aria-labelledby="ariaLabelledby"
|
:aria-labelledby="ariaLabelledby"
|
||||||
:aria-label="ariaLabel"
|
:aria-label="ariaLabel"
|
||||||
|
:aria-invalid="invalid || undefined"
|
||||||
@input="onUserInput"
|
@input="onUserInput"
|
||||||
@keydown="onInputKeyDown"
|
@keydown="onInputKeyDown"
|
||||||
@keypress="onInputKeyPress"
|
@keypress="onInputKeyPress"
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
:aria-checked="checked"
|
:aria-checked="checked"
|
||||||
:aria-labelledby="ariaLabelledby"
|
:aria-labelledby="ariaLabelledby"
|
||||||
:aria-label="ariaLabel"
|
:aria-label="ariaLabel"
|
||||||
|
:aria-invalid="invalid || undefined"
|
||||||
@focus="onFocus"
|
@focus="onFocus"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<input :class="cx('root')" :value="modelValue" @input="onInput" v-bind="getPTOptions('root')" />
|
<input :class="cx('root')" :value="modelValue" :aria-invalid="invalid || undefined" @input="onInput" v-bind="getPTOptions('root')" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -8,10 +8,13 @@ import BaseInputText from './BaseInputText.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'InputText',
|
name: 'InputText',
|
||||||
extends: BaseInputText,
|
extends: BaseInputText,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue'],
|
emits: ['update:modelValue'],
|
||||||
methods: {
|
methods: {
|
||||||
getPTOptions(key) {
|
getPTOptions(key) {
|
||||||
return this.ptm(key, {
|
const _ptm = key === 'root' ? this.ptmi : this.ptm;
|
||||||
|
|
||||||
|
return _ptm(key, {
|
||||||
context: {
|
context: {
|
||||||
filled: this.filled,
|
filled: this.filled,
|
||||||
disabled: this.$attrs.disabled || this.$attrs.disabled === ''
|
disabled: this.$attrs.disabled || this.$attrs.disabled === ''
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" v-bind="ptm('root')">
|
<div :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<svg
|
<svg
|
||||||
viewBox="0 0 100 100"
|
viewBox="0 0 100 100"
|
||||||
role="slider"
|
role="slider"
|
||||||
|
@ -35,6 +35,7 @@ const Math_PI = 3.14159265358979;
|
||||||
export default {
|
export default {
|
||||||
name: 'Knob',
|
name: 'Knob',
|
||||||
extends: BaseKnob,
|
extends: BaseKnob,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue', 'change'],
|
emits: ['update:modelValue', 'change'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :id="id" :class="cx('root')" @focusout="onFocusout" v-bind="ptm('root')">
|
<div :id="id" :class="cx('root')" @focusout="onFocusout" v-bind="ptmi('root')">
|
||||||
<span
|
<span
|
||||||
ref="firstHiddenFocusableElement"
|
ref="firstHiddenFocusableElement"
|
||||||
role="presentation"
|
role="presentation"
|
||||||
|
@ -132,6 +132,7 @@ import BaseListbox from './BaseListbox.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Listbox',
|
name: 'Listbox',
|
||||||
extends: BaseListbox,
|
extends: BaseListbox,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue', 'change', 'focus', 'blur', 'filter'],
|
emits: ['update:modelValue', 'change', 'focus', 'blur', 'filter'],
|
||||||
list: null,
|
list: null,
|
||||||
virtualScroller: null,
|
virtualScroller: null,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :ref="containerRef" :id="id" :class="cx('root')" v-bind="ptm('root')">
|
<div :ref="containerRef" :id="id" :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<div v-if="$slots.start" :class="cx('start')" v-bind="ptm('start')">
|
<div v-if="$slots.start" :class="cx('start')" v-bind="ptm('start')">
|
||||||
<slot name="start"></slot>
|
<slot name="start"></slot>
|
||||||
</div>
|
</div>
|
||||||
|
@ -64,6 +64,7 @@ import MegaMenuSub from './MegaMenuSub.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'MegaMenu',
|
name: 'MegaMenu',
|
||||||
extends: BaseMegaMenu,
|
extends: BaseMegaMenu,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['focus', 'blur'],
|
emits: ['focus', 'blur'],
|
||||||
outsideClickListener: null,
|
outsideClickListener: null,
|
||||||
resizeListener: null,
|
resizeListener: null,
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<div :class="cx('content')" @click="onItemClick($event, processedItem)" @mouseenter="onItemMouseEnter($event, processedItem)" v-bind="getPTOptions(processedItem, index, 'content')">
|
<div :class="cx('content')" @click="onItemClick($event, processedItem)" @mouseenter="onItemMouseEnter($event, processedItem)" v-bind="getPTOptions(processedItem, index, 'content')">
|
||||||
<template v-if="!templates.item">
|
<template v-if="!templates.item">
|
||||||
<a v-ripple :href="getItemProp(processedItem, 'url')" :class="cx('action')" :target="getItemProp(processedItem, 'target')" tabindex="-1" aria-hidden="true" v-bind="getPTOptions(processedItem, index, 'action')">
|
<a v-ripple :href="getItemProp(processedItem, 'url')" :class="cx('action')" :target="getItemProp(processedItem, 'target')" tabindex="-1" aria-hidden="true" v-bind="getPTOptions(processedItem, index, 'action')">
|
||||||
<component v-if="templates.itemicon" :is="templates.itemicon" :item="processedItem.item" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" />
|
<component v-if="templates.itemicon" :is="templates.itemicon" :item="processedItem.item" :class="cx('icon')" />
|
||||||
<span v-else-if="getItemProp(processedItem, 'icon')" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" v-bind="getPTOptions(processedItem, index, 'icon')" />
|
<span v-else-if="getItemProp(processedItem, 'icon')" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" v-bind="getPTOptions(processedItem, index, 'icon')" />
|
||||||
<span :class="level === 0 ? cx('label') : cx('submenuLabel')" v-bind="level === 0 ? getPTOptions(processedItem, index, 'label') : getPTOptions(processedItem, index, 'submenuLabel')">{{ getItemLabel(processedItem) }}</span>
|
<span :class="level === 0 ? cx('label') : cx('submenuLabel')" v-bind="level === 0 ? getPTOptions(processedItem, index, 'label') : getPTOptions(processedItem, index, 'submenuLabel')">{{ getItemLabel(processedItem) }}</span>
|
||||||
<template v-if="isItemGroup(processedItem)">
|
<template v-if="isItemGroup(processedItem)">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<Portal :appendTo="appendTo" :disabled="!popup">
|
<Portal :appendTo="appendTo" :disabled="!popup">
|
||||||
<transition name="p-connected-overlay" @enter="onEnter" @leave="onLeave" @after-leave="onAfterLeave" v-bind="ptm('transition')">
|
<transition name="p-connected-overlay" @enter="onEnter" @leave="onLeave" @after-leave="onAfterLeave" v-bind="ptm('transition')">
|
||||||
<div v-if="popup ? overlayVisible : true" :ref="containerRef" :id="id" :class="cx('root')" @click="onOverlayClick" v-bind="{ ...$attrs, ...ptm('root') }">
|
<div v-if="popup ? overlayVisible : true" :ref="containerRef" :id="id" :class="cx('root')" @click="onOverlayClick" v-bind="ptmi('root')">
|
||||||
<div v-if="$slots.start" :class="cx('start')" v-bind="ptm('start')">
|
<div v-if="$slots.start" :class="cx('start')" v-bind="ptm('start')">
|
||||||
<slot name="start"></slot>
|
<slot name="start"></slot>
|
||||||
</div>
|
</div>
|
||||||
|
@ -25,12 +25,21 @@
|
||||||
<slot name="submenuheader" :item="item">{{ label(item) }}</slot>
|
<slot name="submenuheader" :item="item">{{ label(item) }}</slot>
|
||||||
</li>
|
</li>
|
||||||
<template v-for="(child, j) of item.items" :key="child.label + i + '_' + j">
|
<template v-for="(child, j) of item.items" :key="child.label + i + '_' + j">
|
||||||
<PVMenuitem v-if="visible(child) && !child.separator" :id="id + '_' + i + '_' + j" :item="child" :templates="$slots" :focusedOptionId="focusedOptionId" @item-click="itemClick" :pt="pt" />
|
<PVMenuitem
|
||||||
|
v-if="visible(child) && !child.separator"
|
||||||
|
:id="id + '_' + i + '_' + j"
|
||||||
|
:item="child"
|
||||||
|
:templates="$slots"
|
||||||
|
:focusedOptionId="focusedOptionId"
|
||||||
|
@item-click="itemClick"
|
||||||
|
@item-mousemove="itemMouseMove"
|
||||||
|
:pt="pt"
|
||||||
|
/>
|
||||||
<li v-else-if="visible(child) && child.separator" :key="'separator' + i + j" :class="[cx('separator'), item.class]" :style="child.style" role="separator" v-bind="ptm('separator')"></li>
|
<li v-else-if="visible(child) && child.separator" :key="'separator' + i + j" :class="[cx('separator'), item.class]" :style="child.style" role="separator" v-bind="ptm('separator')"></li>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<li v-else-if="visible(item) && item.separator" :key="'separator' + i.toString()" :class="[cx('separator'), item.class]" :style="item.style" role="separator" v-bind="ptm('separator')"></li>
|
<li v-else-if="visible(item) && item.separator" :key="'separator' + i.toString()" :class="[cx('separator'), item.class]" :style="item.style" role="separator" v-bind="ptm('separator')"></li>
|
||||||
<PVMenuitem v-else :key="label(item) + i.toString()" :id="id + '_' + i" :item="item" :index="i" :templates="$slots" :focusedOptionId="focusedOptionId" @item-click="itemClick" :pt="pt" />
|
<PVMenuitem v-else :key="label(item) + i.toString()" :id="id + '_' + i" :item="item" :index="i" :templates="$slots" :focusedOptionId="focusedOptionId" @item-click="itemClick" @item-mousemove="itemMouseMove" :pt="pt" />
|
||||||
</template>
|
</template>
|
||||||
</ul>
|
</ul>
|
||||||
<div v-if="$slots.end" :class="cx('end')" v-bind="ptm('end')">
|
<div v-if="$slots.end" :class="cx('end')" v-bind="ptm('end')">
|
||||||
|
@ -116,15 +125,14 @@ export default {
|
||||||
this.focusedOptionIndex = event.id;
|
this.focusedOptionIndex = event.id;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
itemMouseMove(event) {
|
||||||
|
if (this.focused) {
|
||||||
|
this.focusedOptionIndex = event.id;
|
||||||
|
}
|
||||||
|
},
|
||||||
onListFocus(event) {
|
onListFocus(event) {
|
||||||
this.focused = true;
|
this.focused = true;
|
||||||
|
!this.popup && this.changeFocusedOptionIndex(0);
|
||||||
if (!this.popup) {
|
|
||||||
if (this.selectedOptionIndex !== -1) {
|
|
||||||
this.changeFocusedOptionIndex(this.selectedOptionIndex);
|
|
||||||
this.selectedOptionIndex = -1;
|
|
||||||
} else this.changeFocusedOptionIndex(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$emit('focus', event);
|
this.$emit('focus', event);
|
||||||
},
|
},
|
||||||
|
@ -255,7 +263,6 @@ export default {
|
||||||
|
|
||||||
if (this.popup) {
|
if (this.popup) {
|
||||||
DomHandler.focus(this.list);
|
DomHandler.focus(this.list);
|
||||||
this.changeFocusedOptionIndex(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$emit('show');
|
this.$emit('show');
|
||||||
|
|
|
@ -11,10 +11,10 @@
|
||||||
:data-p-focused="isItemFocused()"
|
:data-p-focused="isItemFocused()"
|
||||||
:data-p-disabled="disabled() || false"
|
:data-p-disabled="disabled() || false"
|
||||||
>
|
>
|
||||||
<div :class="cx('content')" @click="onItemClick($event)" v-bind="getPTOptions('content')">
|
<div :class="cx('content')" @click="onItemClick($event)" @mousemove="onItemMouseMove($event)" v-bind="getPTOptions('content')">
|
||||||
<template v-if="!templates.item">
|
<template v-if="!templates.item">
|
||||||
<a v-ripple :href="item.url" :class="cx('action')" :target="item.target" tabindex="-1" aria-hidden="true" v-bind="getPTOptions('action')">
|
<a v-ripple :href="item.url" :class="cx('action')" :target="item.target" tabindex="-1" aria-hidden="true" v-bind="getPTOptions('action')">
|
||||||
<component v-if="templates.itemicon" :is="templates.itemicon" :item="item" :class="[cx('icon'), item.icon]" />
|
<component v-if="templates.itemicon" :is="templates.itemicon" :item="item" :class="cx('icon')" />
|
||||||
<span v-else-if="item.icon" :class="[cx('icon'), item.icon]" v-bind="getPTOptions('icon')" />
|
<span v-else-if="item.icon" :class="[cx('icon'), item.icon]" v-bind="getPTOptions('icon')" />
|
||||||
<span :class="cx('label')" v-bind="getPTOptions('label')">{{ label() }}</span>
|
<span :class="cx('label')" v-bind="getPTOptions('label')">{{ label() }}</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -35,7 +35,7 @@ export default {
|
||||||
hostName: 'Menu',
|
hostName: 'Menu',
|
||||||
extends: BaseComponent,
|
extends: BaseComponent,
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
emits: ['item-click'],
|
emits: ['item-click', 'item-mousemove'],
|
||||||
props: {
|
props: {
|
||||||
item: null,
|
item: null,
|
||||||
templates: null,
|
templates: null,
|
||||||
|
@ -66,6 +66,9 @@ export default {
|
||||||
command && command({ originalEvent: event, item: this.item.item });
|
command && command({ originalEvent: event, item: this.item.item });
|
||||||
this.$emit('item-click', { originalEvent: event, item: this.item, id: this.id });
|
this.$emit('item-click', { originalEvent: event, item: this.item, id: this.id });
|
||||||
},
|
},
|
||||||
|
onItemMouseMove(event) {
|
||||||
|
this.$emit('item-mousemove', { originalEvent: event, item: this.item, id: this.id });
|
||||||
|
},
|
||||||
visible() {
|
visible() {
|
||||||
return typeof this.item.visible === 'function' ? this.item.visible() : this.item.visible !== false;
|
return typeof this.item.visible === 'function' ? this.item.visible() : this.item.visible !== false;
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :ref="containerRef" :class="cx('root')" v-bind="ptm('root')">
|
<div :ref="containerRef" :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<div v-if="$slots.start" :class="cx('start')" v-bind="ptm('start')">
|
<div v-if="$slots.start" :class="cx('start')" v-bind="ptm('start')">
|
||||||
<slot name="start"></slot>
|
<slot name="start"></slot>
|
||||||
</div>
|
</div>
|
||||||
|
@ -46,6 +46,7 @@
|
||||||
@keydown="onKeyDown"
|
@keydown="onKeyDown"
|
||||||
@item-click="onItemClick"
|
@item-click="onItemClick"
|
||||||
@item-mouseenter="onItemMouseEnter"
|
@item-mouseenter="onItemMouseEnter"
|
||||||
|
@item-mousemove="onItemMouseMove"
|
||||||
/>
|
/>
|
||||||
<div v-if="$slots.end" :class="cx('end')" v-bind="ptm('end')">
|
<div v-if="$slots.end" :class="cx('end')" v-bind="ptm('end')">
|
||||||
<slot name="end"></slot>
|
<slot name="end"></slot>
|
||||||
|
@ -62,6 +63,7 @@ import MenubarSub from './MenubarSub.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Menubar',
|
name: 'Menubar',
|
||||||
extends: BaseMenubar,
|
extends: BaseMenubar,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['focus', 'blur'],
|
emits: ['focus', 'blur'],
|
||||||
matchMediaListener: null,
|
matchMediaListener: null,
|
||||||
data() {
|
data() {
|
||||||
|
@ -148,8 +150,6 @@ export default {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
},
|
},
|
||||||
show() {
|
show() {
|
||||||
this.focusedItemInfo = { index: this.findFirstFocusedItemIndex(), level: 0, parentKey: '' };
|
|
||||||
|
|
||||||
DomHandler.focus(this.menubar);
|
DomHandler.focus(this.menubar);
|
||||||
},
|
},
|
||||||
hide(event, isFocus) {
|
hide(event, isFocus) {
|
||||||
|
@ -168,7 +168,11 @@ export default {
|
||||||
},
|
},
|
||||||
onFocus(event) {
|
onFocus(event) {
|
||||||
this.focused = true;
|
this.focused = true;
|
||||||
this.focusedItemInfo = this.focusedItemInfo.index !== -1 ? this.focusedItemInfo : { index: this.findFirstFocusedItemIndex(), level: 0, parentKey: '' };
|
|
||||||
|
if (!this.popup) {
|
||||||
|
this.focusedItemInfo = this.focusedItemInfo.index !== -1 ? this.focusedItemInfo : { index: this.findFirstFocusedItemIndex(), level: 0, parentKey: '' };
|
||||||
|
}
|
||||||
|
|
||||||
this.$emit('focus', event);
|
this.$emit('focus', event);
|
||||||
},
|
},
|
||||||
onBlur(event) {
|
onBlur(event) {
|
||||||
|
@ -289,6 +293,11 @@ export default {
|
||||||
this.onItemChange(event);
|
this.onItemChange(event);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onItemMouseMove(event) {
|
||||||
|
if (this.focused) {
|
||||||
|
this.changeFocusedItemIndex(event, event.processedItem.index);
|
||||||
|
}
|
||||||
|
},
|
||||||
menuButtonClick(event) {
|
menuButtonClick(event) {
|
||||||
this.toggle(event);
|
this.toggle(event);
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
:data-p-focused="isItemFocused(processedItem)"
|
:data-p-focused="isItemFocused(processedItem)"
|
||||||
:data-p-disabled="isItemDisabled(processedItem)"
|
:data-p-disabled="isItemDisabled(processedItem)"
|
||||||
>
|
>
|
||||||
<div :class="cx('content')" @click="onItemClick($event, processedItem)" @mouseenter="onItemMouseEnter($event, processedItem)" v-bind="getPTOptions(processedItem, index, 'content')">
|
<div :class="cx('content')" @click="onItemClick($event, processedItem)" @mouseenter="onItemMouseEnter($event, processedItem)" @mousemove="onItemMouseMove($event, processedItem)" v-bind="getPTOptions(processedItem, index, 'content')">
|
||||||
<template v-if="!templates.item">
|
<template v-if="!templates.item">
|
||||||
<a v-ripple :href="getItemProp(processedItem, 'url')" :class="cx('action')" :target="getItemProp(processedItem, 'target')" tabindex="-1" aria-hidden="true" v-bind="getPTOptions(processedItem, index, 'action')">
|
<a v-ripple :href="getItemProp(processedItem, 'url')" :class="cx('action')" :target="getItemProp(processedItem, 'target')" tabindex="-1" aria-hidden="true" v-bind="getPTOptions(processedItem, index, 'action')">
|
||||||
<component v-if="templates.itemicon" :is="templates.itemicon" :item="processedItem.item" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" />
|
<component v-if="templates.itemicon" :is="templates.itemicon" :item="processedItem.item" :class="cx('icon')" />
|
||||||
<span v-else-if="getItemProp(processedItem, 'icon')" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" v-bind="getPTOptions(processedItem, index, 'icon')" />
|
<span v-else-if="getItemProp(processedItem, 'icon')" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" v-bind="getPTOptions(processedItem, index, 'icon')" />
|
||||||
<span :id="getItemLabelId(processedItem)" :class="cx('label')" v-bind="getPTOptions(processedItem, index, 'label')">{{ getItemLabel(processedItem) }}</span>
|
<span :id="getItemLabelId(processedItem)" :class="cx('label')" v-bind="getPTOptions(processedItem, index, 'label')">{{ getItemLabel(processedItem) }}</span>
|
||||||
<template v-if="getItemProp(processedItem, 'items')">
|
<template v-if="getItemProp(processedItem, 'items')">
|
||||||
|
@ -49,6 +49,7 @@
|
||||||
:unstyled="unstyled"
|
:unstyled="unstyled"
|
||||||
@item-click="$emit('item-click', $event)"
|
@item-click="$emit('item-click', $event)"
|
||||||
@item-mouseenter="$emit('item-mouseenter', $event)"
|
@item-mouseenter="$emit('item-mouseenter', $event)"
|
||||||
|
@item-mousemove="$emit('item-mousemove', $event)"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
<li
|
<li
|
||||||
|
@ -75,7 +76,7 @@ export default {
|
||||||
name: 'MenubarSub',
|
name: 'MenubarSub',
|
||||||
hostName: 'Menubar',
|
hostName: 'Menubar',
|
||||||
extends: BaseComponent,
|
extends: BaseComponent,
|
||||||
emits: ['item-mouseenter', 'item-click'],
|
emits: ['item-mouseenter', 'item-click', 'item-mousemove'],
|
||||||
props: {
|
props: {
|
||||||
items: {
|
items: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
@ -165,6 +166,9 @@ export default {
|
||||||
onItemMouseEnter(event, processedItem) {
|
onItemMouseEnter(event, processedItem) {
|
||||||
this.$emit('item-mouseenter', { originalEvent: event, processedItem });
|
this.$emit('item-mouseenter', { originalEvent: event, processedItem });
|
||||||
},
|
},
|
||||||
|
onItemMouseMove(event, processedItem) {
|
||||||
|
this.$emit('item-mousemove', { originalEvent: event, processedItem });
|
||||||
|
},
|
||||||
getAriaSetSize() {
|
getAriaSetSize() {
|
||||||
return this.items.filter((processedItem) => this.isItemVisible(processedItem) && !this.getItemProp(processedItem, 'separator')).length;
|
return this.items.filter((processedItem) => this.isItemVisible(processedItem) && !this.getItemProp(processedItem, 'separator')).length;
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<transition name="p-message" appear v-bind="ptm('transition')">
|
<transition name="p-message" appear v-bind="ptmi('transition')">
|
||||||
<div v-show="visible" :class="cx('root')" role="alert" aria-live="assertive" aria-atomic="true" v-bind="ptm('root')">
|
<div v-show="visible" :class="cx('root')" role="alert" aria-live="assertive" aria-atomic="true" v-bind="ptm('root')">
|
||||||
<slot v-if="$slots.container" name="container" :onClose="close" :closeCallback="close"></slot>
|
<slot v-if="$slots.container" name="container" :onClose="close" :closeCallback="close"></slot>
|
||||||
<div v-else :class="cx('wrapper')" v-bind="ptm('wrapper')">
|
<div v-else :class="cx('wrapper')" v-bind="ptm('wrapper')">
|
||||||
|
@ -32,6 +32,7 @@ import BaseMessage from './BaseMessage.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Message',
|
name: 'Message',
|
||||||
extends: BaseMessage,
|
extends: BaseMessage,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['close', 'life-end'],
|
emits: ['close', 'life-end'],
|
||||||
timeout: null,
|
timeout: null,
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" role="meter" :aria-valuemin="min" :aria-valuemax="max" :aria-valuenow="totalPercent" v-bind="ptm('root')">
|
<div :class="cx('root')" role="meter" :aria-valuemin="min" :aria-valuemax="max" :aria-valuenow="totalPercent" v-bind="ptmi('root')">
|
||||||
<slot v-if="labelPosition === 'start'" name="label" :value="value" :totalPercent="totalPercent" :percentages="percentages">
|
<slot v-if="labelPosition === 'start'" name="label" :value="value" :totalPercent="totalPercent" :percentages="percentages">
|
||||||
<MeterGroupLabel :value="value" :labelPosition="labelPosition" :labelOrientation="labelOrientation" :unstyled="unstyled" :pt="pt" />
|
<MeterGroupLabel :value="value" :labelPosition="labelPosition" :labelOrientation="labelOrientation" :unstyled="unstyled" :pt="pt" />
|
||||||
</slot>
|
</slot>
|
||||||
|
@ -25,6 +25,7 @@ import MeterGroupLabel from './MeterGroupLabel.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'MeterGroup',
|
name: 'MeterGroup',
|
||||||
extends: BaseMeterGroup,
|
extends: BaseMeterGroup,
|
||||||
|
inheritAttrs: false,
|
||||||
methods: {
|
methods: {
|
||||||
getPTOptions(key, value, index) {
|
getPTOptions(key, value, index) {
|
||||||
return this.ptm(key, {
|
return this.ptm(key, {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div ref="container" :class="cx('root')" @click="onContainerClick" v-bind="ptm('root')">
|
<div ref="container" :class="cx('root')" @click="onContainerClick" v-bind="ptmi('root')">
|
||||||
<div class="p-hidden-accessible" v-bind="ptm('hiddenInputWrapper')" :data-p-hidden-accessible="true">
|
<div class="p-hidden-accessible" v-bind="ptm('hiddenInputWrapper')" :data-p-hidden-accessible="true">
|
||||||
<input
|
<input
|
||||||
ref="focusInput"
|
ref="focusInput"
|
||||||
|
@ -16,6 +16,7 @@
|
||||||
:aria-expanded="overlayVisible"
|
:aria-expanded="overlayVisible"
|
||||||
:aria-controls="id + '_list'"
|
:aria-controls="id + '_list'"
|
||||||
:aria-activedescendant="focused ? focusedOptionId : undefined"
|
:aria-activedescendant="focused ? focusedOptionId : undefined"
|
||||||
|
:aria-invalid="invalid || undefined"
|
||||||
@focus="onFocus"
|
@focus="onFocus"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@keydown="onKeyDown"
|
@keydown="onKeyDown"
|
||||||
|
@ -214,6 +215,7 @@ import BaseMultiSelect from './BaseMultiSelect.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'MultiSelect',
|
name: 'MultiSelect',
|
||||||
extends: BaseMultiSelect,
|
extends: BaseMultiSelect,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue', 'change', 'focus', 'blur', 'before-show', 'before-hide', 'show', 'hide', 'filter', 'selectall-change'],
|
emits: ['update:modelValue', 'change', 'focus', 'blur', 'before-show', 'before-hide', 'show', 'hide', 'filter', 'selectall-change'],
|
||||||
outsideClickListener: null,
|
outsideClickListener: null,
|
||||||
scrollHandler: null,
|
scrollHandler: null,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" v-bind="ptm('root')">
|
<div :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<div :class="cx('controls')" v-bind="ptm('controls')">
|
<div :class="cx('controls')" v-bind="ptm('controls')">
|
||||||
<slot name="controlsstart"></slot>
|
<slot name="controlsstart"></slot>
|
||||||
<OLButton type="button" @click="moveUp" :aria-label="moveUpAriaLabel" :disabled="moveDisabled()" v-bind="moveUpButtonProps" :pt="ptm('moveUpButton')" :unstyled="unstyled">
|
<OLButton type="button" @click="moveUp" :aria-label="moveUpAriaLabel" :disabled="moveDisabled()" v-bind="moveUpButtonProps" :pt="ptm('moveUpButton')" :unstyled="unstyled">
|
||||||
|
@ -90,6 +90,7 @@ import BaseOrderList from './BaseOrderList.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'OrderList',
|
name: 'OrderList',
|
||||||
extends: BaseOrderList,
|
extends: BaseOrderList,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue', 'reorder', 'update:selection', 'selection-change', 'focus', 'blur'],
|
emits: ['update:modelValue', 'reorder', 'update:selection', 'selection-change', 'focus', 'blur'],
|
||||||
itemTouched: false,
|
itemTouched: false,
|
||||||
reorderDirection: null,
|
reorderDirection: null,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" v-bind="ptm('root')">
|
<div :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<OrganizationChartNode
|
<OrganizationChartNode
|
||||||
:node="value"
|
:node="value"
|
||||||
:templates="$slots"
|
:templates="$slots"
|
||||||
|
@ -22,6 +22,7 @@ import OrganizationChartNode from './OrganizationChartNode.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'OrganizationChart',
|
name: 'OrganizationChart',
|
||||||
extends: BaseOrganizationChart,
|
extends: BaseOrganizationChart,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['node-unselect', 'node-select', 'update:selectionKeys', 'node-expand', 'node-collapse', 'update:collapsedKeys'],
|
emits: ['node-unselect', 'node-select', 'update:selectionKeys', 'node-expand', 'node-collapse', 'update:collapsedKeys'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<Portal :appendTo="appendTo">
|
<Portal :appendTo="appendTo">
|
||||||
<transition name="p-overlaypanel" @enter="onEnter" @leave="onLeave" @after-leave="onAfterLeave" v-bind="ptm('transition')">
|
<transition name="p-overlaypanel" @enter="onEnter" @leave="onLeave" @after-leave="onAfterLeave" v-bind="ptm('transition')">
|
||||||
<div v-if="visible" :ref="containerRef" v-focustrap role="dialog" :aria-modal="visible" @click="onOverlayClick" :class="cx('root')" v-bind="{ ...$attrs, ...ptm('root') }">
|
<div v-if="visible" :ref="containerRef" v-focustrap role="dialog" :aria-modal="visible" @click="onOverlayClick" :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<slot v-if="$slots.container" name="container" :onClose="hide" :onKeydown="(event) => onButtonKeydown(event)" :closeCallback="hide" :keydownCallback="(event) => onButtonKeydown(event)"></slot>
|
<slot v-if="$slots.container" name="container" :onClose="hide" :onKeydown="(event) => onButtonKeydown(event)" :closeCallback="hide" :keydownCallback="(event) => onButtonKeydown(event)"></slot>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div :class="cx('content')" @click="onContentClick" @mousedown="onContentClick" @keydown="onContentKeydown" v-bind="ptm('content')">
|
<div :class="cx('content')" @click="onContentClick" @mousedown="onContentClick" @keydown="onContentKeydown" v-bind="ptm('content')">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<nav v-if="alwaysShow ? true : pageLinks && pageLinks.length > 1" v-bind="ptm('paginatorWrapper')">
|
<nav v-if="alwaysShow ? true : pageLinks && pageLinks.length > 1" v-bind="ptmi('paginatorWrapper')">
|
||||||
<div v-for="(value, key) in templateItems" :key="key" ref="paginator" :class="cx('paginator', { key })" v-bind="ptm('root')">
|
<div v-for="(value, key) in templateItems" :key="key" ref="paginator" :class="cx('paginator', { key })" v-bind="ptm('root')">
|
||||||
<div v-if="$slots.start" :class="cx('start')" v-bind="ptm('start')">
|
<div v-if="$slots.start" :class="cx('start')" v-bind="ptm('start')">
|
||||||
<slot name="start" :state="currentState"></slot>
|
<slot name="start" :state="currentState"></slot>
|
||||||
|
@ -70,6 +70,7 @@ import RowsPerPageDropdown from './RowsPerPageDropdown.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Paginator',
|
name: 'Paginator',
|
||||||
extends: BasePaginator,
|
extends: BasePaginator,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:first', 'update:rows', 'page'],
|
emits: ['update:first', 'update:rows', 'page'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :id="id" :class="cx('root')" v-bind="ptm('root')">
|
<div :id="id" :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<template v-for="(item, index) of model" :key="getPanelKey(index)">
|
<template v-for="(item, index) of model" :key="getPanelKey(index)">
|
||||||
<div v-if="isItemVisible(item)" :style="getItemProp(item, 'style')" :class="[cx('panel'), getItemProp(item, 'class')]" v-bind="ptm('panel')">
|
<div v-if="isItemVisible(item)" :style="getItemProp(item, 'style')" :class="[cx('panel'), getItemProp(item, 'class')]" v-bind="ptm('panel')">
|
||||||
<div
|
<div
|
||||||
|
@ -63,6 +63,7 @@ import PanelMenuList from './PanelMenuList.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'PanelMenu',
|
name: 'PanelMenu',
|
||||||
extends: BasePanelMenu,
|
extends: BasePanelMenu,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:expandedKeys', 'panel-open', 'panel-close'],
|
emits: ['update:expandedKeys', 'panel-open', 'panel-close'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@keydown="onKeyDown"
|
@keydown="onKeyDown"
|
||||||
@item-toggle="onItemToggle"
|
@item-toggle="onItemToggle"
|
||||||
|
@item-mousemove="onItemMouseMove"
|
||||||
:pt="pt"
|
:pt="pt"
|
||||||
:unstyled="unstyled"
|
:unstyled="unstyled"
|
||||||
v-bind="ptm('menu')"
|
v-bind="ptm('menu')"
|
||||||
|
@ -225,6 +226,11 @@ export default {
|
||||||
this.focusedItem = processedItem;
|
this.focusedItem = processedItem;
|
||||||
DomHandler.focus(this.$el);
|
DomHandler.focus(this.$el);
|
||||||
},
|
},
|
||||||
|
onItemMouseMove(event) {
|
||||||
|
if (this.focused) {
|
||||||
|
this.focusedItem = event.processedItem;
|
||||||
|
}
|
||||||
|
},
|
||||||
isElementInPanel(event, element) {
|
isElementInPanel(event, element) {
|
||||||
const panel = event.currentTarget.closest('[data-pc-section="panel"]');
|
const panel = event.currentTarget.closest('[data-pc-section="panel"]');
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,14 @@
|
||||||
:data-p-focused="isItemFocused(processedItem)"
|
:data-p-focused="isItemFocused(processedItem)"
|
||||||
:data-p-disabled="isItemDisabled(processedItem)"
|
:data-p-disabled="isItemDisabled(processedItem)"
|
||||||
>
|
>
|
||||||
<div :class="cx('content')" @click="onItemClick($event, processedItem)" v-bind="getPTOptions('content', processedItem, index)">
|
<div :class="cx('content')" @click="onItemClick($event, processedItem)" @mousemove="onItemMouseMove($event, processedItem)" v-bind="getPTOptions('content', processedItem, index)">
|
||||||
<template v-if="!templates.item">
|
<template v-if="!templates.item">
|
||||||
<a v-ripple :href="getItemProp(processedItem, 'url')" :class="cx('action')" :target="getItemProp(processedItem, 'target')" tabindex="-1" aria-hidden="true" v-bind="getPTOptions('action', processedItem, index)">
|
<a v-ripple :href="getItemProp(processedItem, 'url')" :class="cx('action')" :target="getItemProp(processedItem, 'target')" tabindex="-1" aria-hidden="true" v-bind="getPTOptions('action', processedItem, index)">
|
||||||
<template v-if="isItemGroup(processedItem)">
|
<template v-if="isItemGroup(processedItem)">
|
||||||
<component v-if="templates.submenuicon" :is="templates.submenuicon" :class="cx('submenuIcon')" :active="isItemActive(processedItem)" v-bind="getPTOptions('submenuIcon', processedItem, index)" />
|
<component v-if="templates.submenuicon" :is="templates.submenuicon" :class="cx('submenuIcon')" :active="isItemActive(processedItem)" v-bind="getPTOptions('submenuIcon', processedItem, index)" />
|
||||||
<component v-else :is="isItemActive(processedItem) ? 'ChevronDownIcon' : 'ChevronRightIcon'" :class="cx('submenuIcon')" v-bind="getPTOptions('submenuIcon', processedItem, index)" />
|
<component v-else :is="isItemActive(processedItem) ? 'ChevronDownIcon' : 'ChevronRightIcon'" :class="cx('submenuIcon')" v-bind="getPTOptions('submenuIcon', processedItem, index)" />
|
||||||
</template>
|
</template>
|
||||||
<component v-if="templates.itemicon" :is="templates.itemicon" :item="processedItem.item" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" />
|
<component v-if="templates.itemicon" :is="templates.itemicon" :item="processedItem.item" :class="cx('icon')" />
|
||||||
<span v-else-if="getItemProp(processedItem, 'icon')" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" v-bind="getPTOptions('icon', processedItem, index)" />
|
<span v-else-if="getItemProp(processedItem, 'icon')" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" v-bind="getPTOptions('icon', processedItem, index)" />
|
||||||
<span :class="cx('label')" v-bind="getPTOptions('label', processedItem, index)">{{ getItemLabel(processedItem) }}</span>
|
<span :class="cx('label')" v-bind="getPTOptions('label', processedItem, index)">{{ getItemLabel(processedItem) }}</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -52,6 +52,7 @@
|
||||||
:templates="templates"
|
:templates="templates"
|
||||||
:activeItemPath="activeItemPath"
|
:activeItemPath="activeItemPath"
|
||||||
@item-toggle="onItemToggle"
|
@item-toggle="onItemToggle"
|
||||||
|
@item-mousemove="$emit('item-mousemove', $event)"
|
||||||
:pt="pt"
|
:pt="pt"
|
||||||
:unstyled="unstyled"
|
:unstyled="unstyled"
|
||||||
v-bind="ptm('submenu')"
|
v-bind="ptm('submenu')"
|
||||||
|
@ -82,7 +83,7 @@ export default {
|
||||||
name: 'PanelMenuSub',
|
name: 'PanelMenuSub',
|
||||||
hostName: 'PanelMenu',
|
hostName: 'PanelMenu',
|
||||||
extends: BaseComponent,
|
extends: BaseComponent,
|
||||||
emits: ['item-toggle'],
|
emits: ['item-toggle', 'item-mousemove'],
|
||||||
props: {
|
props: {
|
||||||
panelId: {
|
panelId: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -159,6 +160,9 @@ export default {
|
||||||
onItemToggle(event) {
|
onItemToggle(event) {
|
||||||
this.$emit('item-toggle', event);
|
this.$emit('item-toggle', event);
|
||||||
},
|
},
|
||||||
|
onItemMouseMove(event, processedItem) {
|
||||||
|
this.$emit('item-mousemove', { originalEvent: event, processedItem });
|
||||||
|
},
|
||||||
getAriaSetSize() {
|
getAriaSetSize() {
|
||||||
return this.items.filter((processedItem) => this.isItemVisible(processedItem) && !this.getItemProp(processedItem, 'separator')).length;
|
return this.items.filter((processedItem) => this.isItemVisible(processedItem) && !this.getItemProp(processedItem, 'separator')).length;
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" :style="sx('root')" v-bind="ptm('root')">
|
<div :class="cx('root')" :style="sx('root')" v-bind="ptmi('root')">
|
||||||
<PInputText
|
<PInputText
|
||||||
ref="input"
|
ref="input"
|
||||||
:id="inputId"
|
:id="inputId"
|
||||||
|
@ -27,10 +27,10 @@
|
||||||
:unstyled="unstyled"
|
:unstyled="unstyled"
|
||||||
/>
|
/>
|
||||||
<slot v-if="toggleMask && unmasked" name="hideicon" :onClick="onMaskToggle" :toggleCallback="onMaskToggle">
|
<slot v-if="toggleMask && unmasked" name="hideicon" :onClick="onMaskToggle" :toggleCallback="onMaskToggle">
|
||||||
<component :is="hideIcon ? 'i' : 'EyeSlashIcon'" :class="hideIcon" @click="onMaskToggle" v-bind="ptm('hideIcon')" />
|
<component :is="hideIcon ? 'i' : 'EyeSlashIcon'" :class="[cx('hideIcon'), hideIcon]" @click="onMaskToggle" v-bind="ptm('hideIcon')" />
|
||||||
</slot>
|
</slot>
|
||||||
<slot v-if="toggleMask && !unmasked" name="showicon" :onClick="onMaskToggle" :toggleCallback="onMaskToggle">
|
<slot v-if="toggleMask && !unmasked" name="showicon" :onClick="onMaskToggle" :toggleCallback="onMaskToggle">
|
||||||
<component :is="showIcon ? 'i' : 'EyeIcon'" :class="showIcon" @click="onMaskToggle" v-bind="ptm('showIcon')" />
|
<component :is="showIcon ? 'i' : 'EyeIcon'" :class="[cx('showIcon'), showIcon]" @click="onMaskToggle" v-bind="ptm('showIcon')" />
|
||||||
</slot>
|
</slot>
|
||||||
<span class="p-hidden-accessible" aria-live="polite" v-bind="ptm('hiddenAccesible')" :data-p-hidden-accessible="true">
|
<span class="p-hidden-accessible" aria-live="polite" v-bind="ptm('hiddenAccesible')" :data-p-hidden-accessible="true">
|
||||||
{{ infoText }}
|
{{ infoText }}
|
||||||
|
@ -64,6 +64,7 @@ import BasePassword from './BasePassword.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Password',
|
name: 'Password',
|
||||||
extends: BasePassword,
|
extends: BasePassword,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue', 'change', 'focus', 'blur', 'invalid'],
|
emits: ['update:modelValue', 'change', 'focus', 'blur', 'invalid'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -10,7 +10,7 @@ const classes = {
|
||||||
{
|
{
|
||||||
'p-inputwrapper-filled': instance.filled,
|
'p-inputwrapper-filled': instance.filled,
|
||||||
'p-inputwrapper-focus': instance.focused,
|
'p-inputwrapper-focus': instance.focused,
|
||||||
'p-input-icon-right': props.toggleMask
|
'p-icon-field p-icon-field-right': props.toggleMask
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
input: ({ props }) => [
|
input: ({ props }) => [
|
||||||
|
@ -19,7 +19,9 @@ const classes = {
|
||||||
'p-disabled': props.disabled
|
'p-disabled': props.disabled
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
panel: ({ props, instance }) => [
|
hideIcon: 'p-input-icon',
|
||||||
|
showIcon: 'p-input-icon',
|
||||||
|
panel: ({ instance }) => [
|
||||||
'p-password-panel p-component',
|
'p-password-panel p-component',
|
||||||
{
|
{
|
||||||
'p-ripple-disabled': instance.$primevue.config.ripple === false
|
'p-ripple-disabled': instance.$primevue.config.ripple === false
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" v-bind="ptm('root')">
|
<div :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<div v-if="showSourceControls" :class="cx('sourceControls')" v-bind="ptm('sourceControls')" data-pc-group-section="controls">
|
<div v-if="showSourceControls" :class="cx('sourceControls')" v-bind="ptm('sourceControls')" data-pc-group-section="controls">
|
||||||
<slot name="sourcecontrolsstart"></slot>
|
<slot name="sourcecontrolsstart"></slot>
|
||||||
<PLButton :aria-label="moveUpAriaLabel" :disabled="moveDisabled(0)" type="button" @click="moveUp($event, 0)" v-bind="moveUpButtonProps" :pt="ptm('sourceMoveUpButton')" :unstyled="unstyled">
|
<PLButton :aria-label="moveUpAriaLabel" :disabled="moveDisabled(0)" type="button" @click="moveUp($event, 0)" v-bind="moveUpButtonProps" :pt="ptm('sourceMoveUpButton')" :unstyled="unstyled">
|
||||||
|
@ -201,6 +201,7 @@ import BasePickList from './BasePickList.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'PickList',
|
name: 'PickList',
|
||||||
extends: BasePickList,
|
extends: BasePickList,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue', 'reorder', 'update:selection', 'selection-change', 'move-to-target', 'move-to-source', 'move-all-to-target', 'move-all-to-source', 'focus', 'blur'],
|
emits: ['update:modelValue', 'reorder', 'update:selection', 'selection-change', 'move-to-target', 'move-to-source', 'move-all-to-target', 'move-all-to-source', 'focus', 'blur'],
|
||||||
itemTouched: false,
|
itemTouched: false,
|
||||||
reorderDirection: null,
|
reorderDirection: null,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div role="progressbar" :class="cx('root')" aria-valuemin="0" :aria-valuenow="value" aria-valuemax="100" v-bind="ptm('root')">
|
<div role="progressbar" :class="cx('root')" aria-valuemin="0" :aria-valuenow="value" aria-valuemax="100" v-bind="ptmi('root')">
|
||||||
<div v-if="determinate" :class="cx('value')" :style="progressStyle" v-bind="ptm('value')">
|
<div v-if="determinate" :class="cx('value')" :style="progressStyle" v-bind="ptm('value')">
|
||||||
<div v-if="value != null && value !== 0 && showValue" :class="cx('label')" v-bind="ptm('label')">
|
<div v-if="value != null && value !== 0 && showValue" :class="cx('label')" v-bind="ptm('label')">
|
||||||
<slot>{{ value + '%' }}</slot>
|
<slot>{{ value + '%' }}</slot>
|
||||||
|
@ -17,6 +17,7 @@ import BaseProgressBar from './BaseProgressBar.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'ProgressBar',
|
name: 'ProgressBar',
|
||||||
extends: BaseProgressBar,
|
extends: BaseProgressBar,
|
||||||
|
inheritAttrs: false,
|
||||||
computed: {
|
computed: {
|
||||||
progressStyle() {
|
progressStyle() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" role="progressbar" v-bind="ptm('root')">
|
<div :class="cx('root')" role="progressbar" v-bind="ptmi('root')">
|
||||||
<svg :class="cx('spinner')" viewBox="25 25 50 50" :style="svgStyle" v-bind="ptm('spinner')">
|
<svg :class="cx('spinner')" viewBox="25 25 50 50" :style="svgStyle" v-bind="ptm('spinner')">
|
||||||
<circle :class="cx('circle')" cx="50" cy="50" r="20" :fill="fill" :stroke-width="strokeWidth" strokeMiterlimit="10" v-bind="ptm('circle')" />
|
<circle :class="cx('circle')" cx="50" cy="50" r="20" :fill="fill" :stroke-width="strokeWidth" strokeMiterlimit="10" v-bind="ptm('circle')" />
|
||||||
</svg>
|
</svg>
|
||||||
|
@ -12,6 +12,7 @@ import BaseProgressSpinner from './BaseProgressSpinner.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'ProgressSpinner',
|
name: 'ProgressSpinner',
|
||||||
extends: BaseProgressSpinner,
|
extends: BaseProgressSpinner,
|
||||||
|
inheritAttrs: false,
|
||||||
computed: {
|
computed: {
|
||||||
svgStyle() {
|
svgStyle() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
:aria-labelledby="ariaLabelledby"
|
:aria-labelledby="ariaLabelledby"
|
||||||
:aria-label="ariaLabel"
|
:aria-label="ariaLabel"
|
||||||
|
:aria-invalid="invalid || undefined"
|
||||||
@focus="onFocus"
|
@focus="onFocus"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
|
@ -31,10 +32,13 @@ import BaseRadioButton from './BaseRadioButton.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'RadioButton',
|
name: 'RadioButton',
|
||||||
extends: BaseRadioButton,
|
extends: BaseRadioButton,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
||||||
methods: {
|
methods: {
|
||||||
getPTOptions(key) {
|
getPTOptions(key) {
|
||||||
return this.ptm(key, {
|
const _ptm = key === 'root' ? this.ptmi : this.ptm;
|
||||||
|
|
||||||
|
return _ptm(key, {
|
||||||
context: {
|
context: {
|
||||||
checked: this.checked,
|
checked: this.checked,
|
||||||
disabled: this.disabled
|
disabled: this.disabled
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" v-bind="ptm('root')">
|
<div :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<div v-if="cancel" :class="cx('cancelItem')" @click="onOptionClick($event, 0)" v-bind="getPTOptions('cancelItem', 0)" :data-p-focused="focusedOptionIndex === 0">
|
<div v-if="cancel" :class="cx('cancelItem')" @click="onOptionClick($event, 0)" v-bind="getPTOptions('cancelItem', 0)" :data-p-focused="focusedOptionIndex === 0">
|
||||||
<span class="p-hidden-accessible" v-bind="ptm('hiddenCancelInputWrapper')" :data-p-hidden-accessible="true">
|
<span class="p-hidden-accessible" v-bind="ptm('hiddenCancelInputWrapper')" :data-p-hidden-accessible="true">
|
||||||
<input
|
<input
|
||||||
|
@ -58,6 +58,7 @@ import BaseRating from './BaseRating.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Rating',
|
name: 'Rating',
|
||||||
extends: BaseRating,
|
extends: BaseRating,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" v-bind="ptm('root')">
|
<div :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<div :class="cx('wrapper')" v-bind="ptm('wrapper')">
|
<div :class="cx('wrapper')" v-bind="ptm('wrapper')">
|
||||||
<div ref="content" :id="contentId" :class="cx('content')" @scroll="onScroll" @mouseenter="moveBar" v-bind="ptm('content')">
|
<div ref="content" :id="contentId" :class="cx('content')" @scroll="onScroll" @mouseenter="moveBar" v-bind="ptm('content')">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
@ -46,6 +46,7 @@ import BaseScrollPanel from './BaseScrollPanel.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'ScrollPanel',
|
name: 'ScrollPanel',
|
||||||
extends: BaseScrollPanel,
|
extends: BaseScrollPanel,
|
||||||
|
inheritAttrs: false,
|
||||||
initialized: false,
|
initialized: false,
|
||||||
documentResizeListener: null,
|
documentResizeListener: null,
|
||||||
documentMouseMoveListener: null,
|
documentMouseMoveListener: null,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<transition name="p-scrolltop" appear @enter="onEnter" @after-leave="onAfterLeave" v-bind="ptm('transition')">
|
<transition name="p-scrolltop" appear @enter="onEnter" @after-leave="onAfterLeave" v-bind="ptm('transition')">
|
||||||
<button v-if="visible" :ref="containerRef" :class="cx('root')" @click="onClick" type="button" :aria-label="scrollTopAriaLabel" v-bind="ptm('root')">
|
<button v-if="visible" :ref="containerRef" :class="cx('root')" @click="onClick" type="button" :aria-label="scrollTopAriaLabel" v-bind="ptmi('root')">
|
||||||
<slot name="icon" :class="cx('icon')">
|
<slot name="icon" :class="cx('icon')">
|
||||||
<component :is="icon ? 'span' : 'ChevronUpIcon'" :class="[cx('icon'), icon]" v-bind="ptm('icon')" />
|
<component :is="icon ? 'span' : 'ChevronUpIcon'" :class="[cx('icon'), icon]" v-bind="ptm('icon')" />
|
||||||
</slot>
|
</slot>
|
||||||
|
@ -16,6 +16,7 @@ import BaseScrollTop from './BaseScrollTop.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'ScrollTop',
|
name: 'ScrollTop',
|
||||||
extends: BaseScrollTop,
|
extends: BaseScrollTop,
|
||||||
|
inheritAttrs: false,
|
||||||
scrollListener: null,
|
scrollListener: null,
|
||||||
container: null,
|
container: null,
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<div ref="container" :class="cx('root')" role="group" :aria-labelledby="ariaLabelledby" v-bind="ptm('root')">
|
<div ref="container" :class="cx('root')" role="group" :aria-labelledby="ariaLabelledby" v-bind="ptmi('root')">
|
||||||
<div
|
<div
|
||||||
v-for="(option, i) of options"
|
v-for="(option, i) of options"
|
||||||
:key="getOptionRenderKey(option)"
|
:key="getOptionRenderKey(option)"
|
||||||
v-ripple
|
v-ripple
|
||||||
:tabindex="i === focusedIndex ? '0' : '-1'"
|
:tabindex="findTabindex(option, i)"
|
||||||
:aria-label="getOptionLabel(option)"
|
:aria-label="getOptionLabel(option)"
|
||||||
:role="multiple ? 'checkbox' : 'radio'"
|
:role="multiple ? 'checkbox' : 'radio'"
|
||||||
:aria-checked="isSelected(option)"
|
:aria-checked="isSelected(option)"
|
||||||
|
@ -33,6 +33,7 @@ import BaseSelectButton from './BaseSelectButton.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'SelectButton',
|
name: 'SelectButton',
|
||||||
extends: BaseSelectButton,
|
extends: BaseSelectButton,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue', 'focus', 'blur', 'change'],
|
emits: ['update:modelValue', 'focus', 'blur', 'change'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -129,7 +130,7 @@ export default {
|
||||||
case 'ArrowDown':
|
case 'ArrowDown':
|
||||||
|
|
||||||
case 'ArrowRight': {
|
case 'ArrowRight': {
|
||||||
this.changeTabIndexes(event, 'next');
|
this.onArrowRightKey(event.target);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -137,7 +138,7 @@ export default {
|
||||||
case 'ArrowUp':
|
case 'ArrowUp':
|
||||||
|
|
||||||
case 'ArrowLeft': {
|
case 'ArrowLeft': {
|
||||||
this.changeTabIndexes(event, 'prev');
|
this.onArrowLeftKey(event.target);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -147,23 +148,46 @@ export default {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeTabIndexes(event, direction) {
|
onArrowRightKey(target) {
|
||||||
let firstTabableChild, index;
|
const nextEl = this.findNextElement(target);
|
||||||
|
|
||||||
for (let i = 0; i <= this.$refs.container.children.length - 1; i++) {
|
if (nextEl) {
|
||||||
if (this.$refs.container.children[i].getAttribute('tabindex') === '0') firstTabableChild = { elem: this.$refs.container.children[i], index: i };
|
this.focusedIndex = ObjectUtils.findIndexInList(nextEl, this.findAllElements());
|
||||||
|
DomHandler.focus(nextEl);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onArrowLeftKey(target) {
|
||||||
|
const prevEl = this.findPrevElement(target);
|
||||||
|
|
||||||
|
if (prevEl) {
|
||||||
|
this.focusedIndex = ObjectUtils.findIndexInList(prevEl, this.findAllElements());
|
||||||
|
DomHandler.focus(prevEl);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
findAllElements() {
|
||||||
|
return DomHandler.find(this.$refs.container, '[data-pc-section="button"]');
|
||||||
|
},
|
||||||
|
findNextElement(target) {
|
||||||
|
if (target.nextElementSibling) {
|
||||||
|
if (DomHandler.getAttribute(target.nextElementSibling, 'data-p-disabled')) {
|
||||||
|
return this.findNextElement(target.nextElementSibling);
|
||||||
|
}
|
||||||
|
|
||||||
|
return target.nextElementSibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (direction === 'prev') {
|
return null;
|
||||||
if (firstTabableChild.index === 0) index = this.$refs.container.children.length - 1;
|
},
|
||||||
else index = firstTabableChild.index - 1;
|
findPrevElement(target) {
|
||||||
} else {
|
if (target.previousElementSibling) {
|
||||||
if (firstTabableChild.index === this.$refs.container.children.length - 1) index = 0;
|
if (DomHandler.getAttribute(target.previousElementSibling, 'data-p-disabled')) {
|
||||||
else index = firstTabableChild.index + 1;
|
return this.findPrevElement(target.previousElementSibling);
|
||||||
|
}
|
||||||
|
|
||||||
|
return target.previousElementSibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.focusedIndex = index;
|
return null;
|
||||||
this.$refs.container.children[index].focus();
|
|
||||||
},
|
},
|
||||||
onFocus(event) {
|
onFocus(event) {
|
||||||
this.$emit('focus', event);
|
this.$emit('focus', event);
|
||||||
|
@ -174,6 +198,9 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$emit('blur', event, option);
|
this.$emit('blur', event, option);
|
||||||
|
},
|
||||||
|
findTabindex(option, index) {
|
||||||
|
return this.disabled || this.isOptionDisabled(option) || index !== this.focusedIndex ? '-1' : '0';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import BaseStyle from 'primevue/base/style';
|
||||||
|
|
||||||
const classes = {
|
const classes = {
|
||||||
root: ({ props }) => [
|
root: ({ props }) => [
|
||||||
'p-selectbutton p-buttonset p-component',
|
'p-selectbutton p-button-group p-component',
|
||||||
{
|
{
|
||||||
'p-disabled': props.disabled,
|
'p-disabled': props.disabled,
|
||||||
'p-invalid': props.invalid
|
'p-invalid': props.invalid
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<Portal>
|
<Portal>
|
||||||
<div v-if="containerVisible" :ref="maskRef" @mousedown="onMaskClick" :class="cx('mask')" :style="sx('mask', true, { position })" v-bind="ptm('mask')">
|
<div v-if="containerVisible" :ref="maskRef" @mousedown="onMaskClick" :class="cx('mask')" :style="sx('mask', true, { position })" v-bind="ptm('mask')">
|
||||||
<transition name="p-sidebar" @enter="onEnter" @after-enter="onAfterEnter" @before-leave="onBeforeLeave" @leave="onLeave" @after-leave="onAfterLeave" appear v-bind="ptm('transition')">
|
<transition name="p-sidebar" @enter="onEnter" @after-enter="onAfterEnter" @before-leave="onBeforeLeave" @leave="onLeave" @after-leave="onAfterLeave" appear v-bind="ptm('transition')">
|
||||||
<div v-if="visible" :ref="containerRef" v-focustrap :class="cx('root')" role="complementary" :aria-modal="modal" v-bind="{ ...$attrs, ...ptm('root') }">
|
<div v-if="visible" :ref="containerRef" v-focustrap :class="cx('root')" role="complementary" :aria-modal="modal" v-bind="ptmi('root')">
|
||||||
<slot v-if="$slots.container" name="container" :onClose="hide" :closeCallback="hide"></slot>
|
<slot v-if="$slots.container" name="container" :onClose="hide" :closeCallback="hide"></slot>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div :ref="headerContainerRef" :class="cx('header')" v-bind="ptm('header')">
|
<div :ref="headerContainerRef" :class="cx('header')" v-bind="ptm('header')">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" :style="[sx('root'), containerStyle]" aria-hidden="true" v-bind="ptm('root')"></div>
|
<div :class="cx('root')" :style="[sx('root'), containerStyle]" aria-hidden="true" v-bind="ptmi('root')"></div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -8,6 +8,7 @@ import BaseSkeleton from './BaseSkeleton.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Skeleton',
|
name: 'Skeleton',
|
||||||
extends: BaseSkeleton,
|
extends: BaseSkeleton,
|
||||||
|
inheritAttrs: false,
|
||||||
computed: {
|
computed: {
|
||||||
containerStyle() {
|
containerStyle() {
|
||||||
if (this.size) return { width: this.size, height: this.size, borderRadius: this.borderRadius };
|
if (this.size) return { width: this.size, height: this.size, borderRadius: this.borderRadius };
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" @click="onBarClick" v-bind="ptm('root')" :data-p-sliding="false">
|
<div :class="cx('root')" @click="onBarClick" v-bind="ptmi('root')" :data-p-sliding="false">
|
||||||
<span :class="cx('range')" :style="[sx('range'), rangeStyle]" v-bind="ptm('range')"></span>
|
<span :class="cx('range')" :style="[sx('range'), rangeStyle]" v-bind="ptm('range')"></span>
|
||||||
<span
|
<span
|
||||||
v-if="!range"
|
v-if="!range"
|
||||||
|
@ -68,6 +68,7 @@ import BaseSlider from './BaseSlider.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Slider',
|
name: 'Slider',
|
||||||
extends: BaseSlider,
|
extends: BaseSlider,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:modelValue', 'change', 'slideend'],
|
emits: ['update:modelValue', 'change', 'slideend'],
|
||||||
dragging: false,
|
dragging: false,
|
||||||
handleIndex: null,
|
handleIndex: null,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :ref="containerRef" :class="containerClass" :style="[style, sx('root')]" v-bind="ptm('root')">
|
<div :ref="containerRef" :class="containerClass" :style="[style, sx('root')]" v-bind="ptmi('root')">
|
||||||
<slot name="button" :onClick="onClick" :toggleCallback="onClick">
|
<slot name="button" :onClick="onClick" :toggleCallback="onClick">
|
||||||
<SDButton
|
<SDButton
|
||||||
type="button"
|
type="button"
|
||||||
|
@ -63,6 +63,7 @@ import BaseSpeedDial from './BaseSpeedDial.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'SpeedDial',
|
name: 'SpeedDial',
|
||||||
extends: BaseSpeedDial,
|
extends: BaseSpeedDial,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['click', 'show', 'hide', 'focus', 'blur'],
|
emits: ['click', 'show', 'hide', 'focus', 'blur'],
|
||||||
documentClickListener: null,
|
documentClickListener: null,
|
||||||
container: null,
|
container: null,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" :style="sx('root')" :data-p-resizing="false" v-bind="ptm('root', getPTOptions())">
|
<div :class="cx('root')" :style="sx('root')" :data-p-resizing="false" v-bind="ptmi('root', getPTOptions())">
|
||||||
<template v-for="(panel, i) of panels" :key="i">
|
<template v-for="(panel, i) of panels" :key="i">
|
||||||
<component :is="panel" tabindex="-1"></component>
|
<component :is="panel" tabindex="-1"></component>
|
||||||
<div
|
<div
|
||||||
|
@ -28,6 +28,7 @@ import BaseSplitter from './BaseSplitter.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Splitter',
|
name: 'Splitter',
|
||||||
extends: BaseSplitter,
|
extends: BaseSplitter,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['resizestart', 'resizeend', 'resize'],
|
emits: ['resizestart', 'resizeend', 'resize'],
|
||||||
dragging: false,
|
dragging: false,
|
||||||
mouseMoveListener: null,
|
mouseMoveListener: null,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div ref="container" :class="cx('root')" v-bind="ptm('root', getPTOptions)">
|
<div ref="container" :class="cx('root')" v-bind="ptmi('root', getPTOptions)">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -10,6 +10,7 @@ import BaseSplitterPanel from './BaseSplitterPanel.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'SplitterPanel',
|
name: 'SplitterPanel',
|
||||||
extends: BaseSplitterPanel,
|
extends: BaseSplitterPanel,
|
||||||
|
inheritAttrs: false,
|
||||||
computed: {
|
computed: {
|
||||||
isNested() {
|
isNested() {
|
||||||
return this.$slots.default().some((child) => {
|
return this.$slots.default().some((child) => {
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
<script>
|
||||||
|
import BaseComponent from 'primevue/basecomponent';
|
||||||
|
import StepperStyle from 'primevue/stepper/style';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'BaseStepper',
|
||||||
|
extends: BaseComponent,
|
||||||
|
props: {
|
||||||
|
activeStep: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
orientation: {
|
||||||
|
type: String,
|
||||||
|
default: 'horizontal'
|
||||||
|
},
|
||||||
|
linear: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
style: StepperStyle,
|
||||||
|
provide() {
|
||||||
|
return {
|
||||||
|
$parentInstance: this
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,191 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Stepper is a component that streamlines a wizard-like workflow, organizing content into coherent steps and visually guiding users through a numbered progression in a multi-step process.
|
||||||
|
*
|
||||||
|
* [Live Demo](https://www.primevue.org/stepper/)
|
||||||
|
*
|
||||||
|
* @module stepper
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
import { ComponentHooks } from '../basecomponent';
|
||||||
|
import { PassThroughOptions } from '../passthrough';
|
||||||
|
import { StepperPanelPassThroughOptionType } from '../stepperpanel';
|
||||||
|
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
||||||
|
|
||||||
|
export declare type StepperPassThroughOptionType = StepperPassThroughAttributes | ((options: StepperPassThroughMethodOptions) => StepperPassThroughAttributes | string) | string | null | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom passthrough(pt) option method.
|
||||||
|
*/
|
||||||
|
export interface StepperPassThroughMethodOptions {
|
||||||
|
/**
|
||||||
|
* Defines instance.
|
||||||
|
*/
|
||||||
|
instance: any;
|
||||||
|
/**
|
||||||
|
* Defines valid properties.
|
||||||
|
*/
|
||||||
|
props: StepperProps;
|
||||||
|
/**
|
||||||
|
* Defines current inline state.
|
||||||
|
*/
|
||||||
|
state: StepperState;
|
||||||
|
/**
|
||||||
|
* Defines valid attributes.
|
||||||
|
*/
|
||||||
|
attrs: any;
|
||||||
|
/**
|
||||||
|
* Defines parent options.
|
||||||
|
*/
|
||||||
|
parent: any;
|
||||||
|
/**
|
||||||
|
* Defines passthrough(pt) options in global config.
|
||||||
|
*/
|
||||||
|
global: object | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom passthrough(pt) options.
|
||||||
|
* @see {@link StepperProps.pt}
|
||||||
|
*/
|
||||||
|
export interface StepperPassThroughOptions {
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the root's DOM element.
|
||||||
|
*/
|
||||||
|
root?: StepperPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the nav container's DOM element.
|
||||||
|
*/
|
||||||
|
navContainer?: StepperPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the nav's DOM element.
|
||||||
|
*/
|
||||||
|
nav?: StepperPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the panel container's DOM element.
|
||||||
|
*/
|
||||||
|
panelContainer?: StepperPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the end handler's DOM element.
|
||||||
|
*/
|
||||||
|
stepperpanel?: StepperPanelPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to manage all lifecycle hooks.
|
||||||
|
* @see {@link BaseComponent.ComponentHooks}
|
||||||
|
*/
|
||||||
|
hooks?: ComponentHooks;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom passthrough attributes for each DOM elements
|
||||||
|
*/
|
||||||
|
export interface StepperPassThroughAttributes {
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines current inline state in Stepper component.
|
||||||
|
*/
|
||||||
|
export interface StepperState {
|
||||||
|
/**
|
||||||
|
* Current active index state.
|
||||||
|
*/
|
||||||
|
d_activeStep: number;
|
||||||
|
/**
|
||||||
|
* Unique id for the Stepper component.
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom tab change event.
|
||||||
|
* @see {@link StepperEmits['step-change']}
|
||||||
|
*/
|
||||||
|
export interface StepperChangeEvent {
|
||||||
|
/**
|
||||||
|
* Browser event
|
||||||
|
*/
|
||||||
|
originalEvent: Event;
|
||||||
|
/**
|
||||||
|
* Index of the selected stepper panel
|
||||||
|
*/
|
||||||
|
index: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines valid properties in Stepper component.
|
||||||
|
*/
|
||||||
|
export interface StepperProps {
|
||||||
|
/**
|
||||||
|
* Active step index of stepper.
|
||||||
|
* @defaultValue 0
|
||||||
|
*/
|
||||||
|
activeStep?: number | undefined;
|
||||||
|
/**
|
||||||
|
* Orientation of the stepper.
|
||||||
|
* @defaultValue horizontal
|
||||||
|
*/
|
||||||
|
orientation?: 'horizontal' | 'vertical' | undefined;
|
||||||
|
/**
|
||||||
|
* Whether the steps are clickable or not.
|
||||||
|
* @defaultValue false
|
||||||
|
*/
|
||||||
|
linear?: boolean | undefined;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to DOM elements inside the component.
|
||||||
|
* @type {StepperPassThroughOptions}
|
||||||
|
*/
|
||||||
|
pt?: PassThrough<StepperPassThroughOptions>;
|
||||||
|
/**
|
||||||
|
* Used to configure passthrough(pt) options of the component.
|
||||||
|
* @type {PassThroughOptions}
|
||||||
|
*/
|
||||||
|
ptOptions?: PassThroughOptions;
|
||||||
|
/**
|
||||||
|
* When enabled, it removes component related styles in the core.
|
||||||
|
* @defaultValue false
|
||||||
|
*/
|
||||||
|
unstyled?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines valid slots in Stepper component.
|
||||||
|
*/
|
||||||
|
export interface StepperSlots {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines valid emits in Stepper component.
|
||||||
|
*/
|
||||||
|
export interface StepperEmits {
|
||||||
|
/**
|
||||||
|
* Emitted when the value changes.
|
||||||
|
* @param {number | number[]} value - New value.
|
||||||
|
*/
|
||||||
|
'update:activeStep'(value: number): void;
|
||||||
|
/**
|
||||||
|
* Callback to invoke when an active panel is changed.
|
||||||
|
*/
|
||||||
|
'step-change'(event: StepperChangeEvent): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* **PrimeVue - Stepper**
|
||||||
|
*
|
||||||
|
* _Stepper is a component that streamlines a wizard-like workflow, organizing content into coherent steps and visually guiding users through a numbered progression in a multi-step process._
|
||||||
|
*
|
||||||
|
* [Live Demo](https://www.primevue.org/stepper/)
|
||||||
|
* --- ---
|
||||||
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
||||||
|
*
|
||||||
|
* @group Component
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
declare class Stepper extends ClassComponent<StepperProps, StepperSlots, StepperEmits> {}
|
||||||
|
|
||||||
|
declare module '@vue/runtime-core' {
|
||||||
|
interface GlobalComponents {
|
||||||
|
Stepper: GlobalComponentConstructor<Stepper>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Stepper;
|
|
@ -0,0 +1,269 @@
|
||||||
|
<template>
|
||||||
|
<div :class="cx('root')" role="tablist" v-bind="ptmi('root')">
|
||||||
|
<slot v-if="$slots.start" name="start" />
|
||||||
|
|
||||||
|
<template v-if="orientation === 'horizontal'">
|
||||||
|
<div :class="cx('navContainer')" v-bind="ptm('navContainer')">
|
||||||
|
<ul ref="nav" :class="cx('nav')" v-bind="ptm('nav')">
|
||||||
|
<li
|
||||||
|
v-for="(step, index) of stepperpanels"
|
||||||
|
:key="getStepKey(step, index)"
|
||||||
|
:class="cx('stepper.header', { step, index })"
|
||||||
|
:aria-current="isStepActive(index) ? 'step' : undefined"
|
||||||
|
role="presentation"
|
||||||
|
v-bind="{ ...getStepPT(step, 'root', index), ...getStepPT(step, 'header', index) }"
|
||||||
|
data-pc-name="stepperpanel"
|
||||||
|
:data-p-highlight="isStepActive(index)"
|
||||||
|
:data-p-disabled="isItemDisabled(index)"
|
||||||
|
:data-pc-index="index"
|
||||||
|
:data-p-active="isStepActive(index)"
|
||||||
|
>
|
||||||
|
<slot name="header">
|
||||||
|
<StepperHeader
|
||||||
|
:id="getStepHeaderActionId(index)"
|
||||||
|
:template="step.children?.header"
|
||||||
|
:stepperpanel="step"
|
||||||
|
:index="index"
|
||||||
|
:disabled="isItemDisabled(index)"
|
||||||
|
:active="isStepActive(index)"
|
||||||
|
:highlighted="index < d_activeStep"
|
||||||
|
:class="cx('stepper.action')"
|
||||||
|
:aria-controls="getStepContentId(index)"
|
||||||
|
:clickCallback="(event) => onItemClick(event, index)"
|
||||||
|
:getStepPT="getStepPT"
|
||||||
|
:getStepProp="getStepProp"
|
||||||
|
/>
|
||||||
|
</slot>
|
||||||
|
<slot v-if="index !== stepperpanels.length - 1" name="separator">
|
||||||
|
<StepperSeparator
|
||||||
|
v-if="index !== stepperpanels.length - 1"
|
||||||
|
:template="step.children?.separator"
|
||||||
|
:separatorClass="cx('stepper.separator')"
|
||||||
|
:stepperpanel="step"
|
||||||
|
:index="index"
|
||||||
|
:active="isStepActive(index)"
|
||||||
|
:highlighted="index < d_activeStep"
|
||||||
|
:getStepPT="getStepPT(step, 'separator', index)"
|
||||||
|
/>
|
||||||
|
</slot>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div :class="cx('panelContainer')" v-bind="ptm('panelContainer')">
|
||||||
|
<template v-for="(step, index) of stepperpanels" :key="getStepKey(step, index)">
|
||||||
|
<StepperContent
|
||||||
|
v-if="isStepActive(index)"
|
||||||
|
:id="getStepContentId(index)"
|
||||||
|
:template="step?.children?.content"
|
||||||
|
:stepperpanel="step"
|
||||||
|
:index="index"
|
||||||
|
:active="isStepActive(index)"
|
||||||
|
:highlighted="index < d_activeStep"
|
||||||
|
:clickCallback="(event) => onItemClick(event, index)"
|
||||||
|
:prevCallback="(event) => prevCallback(event, index)"
|
||||||
|
:nextCallback="(event) => nextCallback(event, index)"
|
||||||
|
:getStepPT="getStepPT"
|
||||||
|
:aria-labelledby="getStepHeaderActionId(index)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="orientation === 'vertical'">
|
||||||
|
<div
|
||||||
|
v-for="(step, index) of stepperpanels"
|
||||||
|
ref="nav"
|
||||||
|
:key="getStepKey(step, index)"
|
||||||
|
:class="cx('panel', { step, index })"
|
||||||
|
:aria-current="isStepActive(index) ? 'step' : undefined"
|
||||||
|
v-bind="{ ...getStepPT(step, 'root', index), ...getStepPT(step, 'panel', index) }"
|
||||||
|
data-pc-name="stepperpanel"
|
||||||
|
:data-p-highlight="isStepActive(index)"
|
||||||
|
:data-p-disabled="isItemDisabled(index)"
|
||||||
|
:data-pc-index="index"
|
||||||
|
:data-p-active="isStepActive(index)"
|
||||||
|
>
|
||||||
|
<div :class="cx('stepper.header', { step, index })" v-bind="getStepPT(step, 'header', index)">
|
||||||
|
<slot name="header">
|
||||||
|
<StepperHeader
|
||||||
|
:id="getStepHeaderActionId(index)"
|
||||||
|
:template="step.children?.header"
|
||||||
|
:stepperpanel="step"
|
||||||
|
:index="index"
|
||||||
|
:disabled="isItemDisabled(index)"
|
||||||
|
:active="isStepActive(index)"
|
||||||
|
:highlighted="index < d_activeStep"
|
||||||
|
:class="cx('stepper.action')"
|
||||||
|
:aria-controls="getStepContentId(index)"
|
||||||
|
:clickCallback="(event) => onItemClick(event, index)"
|
||||||
|
:getStepPT="getStepPT"
|
||||||
|
:getStepProp="getStepProp"
|
||||||
|
/>
|
||||||
|
</slot>
|
||||||
|
</div>
|
||||||
|
<div :class="cx('stepper.toggleableContent')" v-bind="getStepPT(step, 'toggleableContent', index)">
|
||||||
|
<slot v-if="index !== stepperpanels.length - 1" name="separator">
|
||||||
|
<StepperSeparator
|
||||||
|
v-if="index !== stepperpanels.length - 1"
|
||||||
|
:template="step.children?.separator"
|
||||||
|
:separatorClass="cx('stepper.separator')"
|
||||||
|
:stepperpanel="step"
|
||||||
|
:index="index"
|
||||||
|
:active="isStepActive(index)"
|
||||||
|
:highlighted="index < d_activeStep"
|
||||||
|
:getStepPT="getStepPT(step, 'separator', index)"
|
||||||
|
/>
|
||||||
|
</slot>
|
||||||
|
<transition name="p-toggleable-content" v-bind="getStepPT(step, 'transition', index)">
|
||||||
|
<slot name="content">
|
||||||
|
<StepperContent
|
||||||
|
v-show="isStepActive(index)"
|
||||||
|
:id="getStepContentId(index)"
|
||||||
|
:template="step?.children?.content"
|
||||||
|
:stepperpanel="step"
|
||||||
|
:index="index"
|
||||||
|
:active="isStepActive(index)"
|
||||||
|
:highlighted="index < d_activeStep"
|
||||||
|
:clickCallback="(event) => onItemClick(event, index)"
|
||||||
|
:prevCallback="(event) => prevCallback(event, index)"
|
||||||
|
:nextCallback="(event) => nextCallback(event, index)"
|
||||||
|
:getStepPT="getStepPT"
|
||||||
|
:aria-labelledby="getStepHeaderActionId(index)"
|
||||||
|
/>
|
||||||
|
</slot>
|
||||||
|
</transition>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<slot v-if="$slots.end" name="end" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { UniqueComponentId } from 'primevue/utils';
|
||||||
|
import { mergeProps } from 'vue';
|
||||||
|
import BaseStepper from './BaseStepper.vue';
|
||||||
|
import StepperContent from './StepperContent.vue';
|
||||||
|
import StepperHeader from './StepperHeader.vue';
|
||||||
|
import StepperSeparator from './StepperSeparator.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Stepper',
|
||||||
|
extends: BaseStepper,
|
||||||
|
nheritAttrs: false,
|
||||||
|
emits: ['update:activeStep', 'step-change'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
id: this.$attrs.id,
|
||||||
|
d_activeStep: this.activeStep
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'$attrs.id': function (newValue) {
|
||||||
|
this.id = newValue || UniqueComponentId();
|
||||||
|
},
|
||||||
|
activeStep(newValue) {
|
||||||
|
this.d_activeStep = newValue;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.id = this.id || UniqueComponentId();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
isStep(child) {
|
||||||
|
return child.type.name === 'StepperPanel';
|
||||||
|
},
|
||||||
|
isStepActive(index) {
|
||||||
|
return this.d_activeStep === index;
|
||||||
|
},
|
||||||
|
getStepProp(step, name) {
|
||||||
|
return step.props ? step.props[name] : undefined;
|
||||||
|
},
|
||||||
|
getStepKey(step, index) {
|
||||||
|
return this.getStepProp(step, 'header') || index;
|
||||||
|
},
|
||||||
|
getStepHeaderActionId(index) {
|
||||||
|
return `${this.id}_${index}_header_action`;
|
||||||
|
},
|
||||||
|
getStepContentId(index) {
|
||||||
|
return `${this.id}_${index}_content`;
|
||||||
|
},
|
||||||
|
getStepPT(step, key, index) {
|
||||||
|
const count = this.stepperpanels.length;
|
||||||
|
const stepMetaData = {
|
||||||
|
props: step.props,
|
||||||
|
parent: {
|
||||||
|
instance: this,
|
||||||
|
props: this.$props,
|
||||||
|
state: this.$data
|
||||||
|
},
|
||||||
|
context: {
|
||||||
|
index,
|
||||||
|
count,
|
||||||
|
first: index === 0,
|
||||||
|
last: index === count - 1,
|
||||||
|
active: this.isStepActive(index),
|
||||||
|
highlighted: index < this.d_activeStep,
|
||||||
|
disabled: this.isItemDisabled(index)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return mergeProps(this.ptm(`stepperpanel.${key}`, { stepperpanel: stepMetaData }), this.ptm(`stepperpanel.${key}`, stepMetaData), this.ptmo(this.getStepProp(step, 'pt'), key, stepMetaData));
|
||||||
|
},
|
||||||
|
updateActiveStep(event, index) {
|
||||||
|
this.d_activeStep = index;
|
||||||
|
|
||||||
|
this.$emit('update:activeStep', index);
|
||||||
|
this.$emit('step-change', {
|
||||||
|
originalEvent: event,
|
||||||
|
index
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onItemClick(event, index) {
|
||||||
|
if (this.linear) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index !== this.d_activeStep) {
|
||||||
|
this.updateActiveStep(event, index);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isItemDisabled(index) {
|
||||||
|
return this.linear && !this.isStepActive(index);
|
||||||
|
},
|
||||||
|
prevCallback(event, index) {
|
||||||
|
if (index !== 0) {
|
||||||
|
this.onItemClick(event, index - 1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
nextCallback(event, index) {
|
||||||
|
if (index !== this.stepperpanels.length - 1) {
|
||||||
|
this.onItemClick(event, index + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
stepperpanels() {
|
||||||
|
return this.$slots.default().reduce((stepperpanels, child) => {
|
||||||
|
if (this.isStep(child)) {
|
||||||
|
stepperpanels.push(child);
|
||||||
|
} else if (child.children && child.children instanceof Array) {
|
||||||
|
child.children.forEach((nestedChild) => {
|
||||||
|
if (this.isStep(nestedChild)) {
|
||||||
|
stepperpanels.push(nestedChild);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return stepperpanels;
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
StepperContent,
|
||||||
|
StepperHeader,
|
||||||
|
StepperSeparator
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,47 @@
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
:id="id"
|
||||||
|
:class="cx('stepper.content', { stepperpanel, index })"
|
||||||
|
role="tabpanel"
|
||||||
|
:aria-labelledby="ariaLabelledby"
|
||||||
|
v-bind="{ ...getStepPT(stepperpanel, 'root', index), ...getStepPT(stepperpanel, 'content', index) }"
|
||||||
|
data-pc-name="stepperpanel"
|
||||||
|
:data-pc-index="index"
|
||||||
|
:data-p-active="active"
|
||||||
|
>
|
||||||
|
<component
|
||||||
|
v-if="template"
|
||||||
|
:is="template"
|
||||||
|
:index="index"
|
||||||
|
:active="active"
|
||||||
|
:highlighted="highlighted"
|
||||||
|
:clickCallback="(event) => onItemClick(event, index)"
|
||||||
|
:prevCallback="(event) => prevCallback(event, index)"
|
||||||
|
:nextCallback="(event) => nextCallback(event, index)"
|
||||||
|
></component>
|
||||||
|
<component v-else :is="stepperpanel"></component>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BaseComponent from 'primevue/basecomponent';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'StepperContent',
|
||||||
|
hostName: 'Stepper',
|
||||||
|
extends: BaseComponent,
|
||||||
|
props: {
|
||||||
|
id: null,
|
||||||
|
template: null,
|
||||||
|
ariaLabelledby: null,
|
||||||
|
stepperpanel: null,
|
||||||
|
index: null,
|
||||||
|
active: null,
|
||||||
|
highlighted: null,
|
||||||
|
clickCallback: null,
|
||||||
|
prevCallback: null,
|
||||||
|
nextCallback: null,
|
||||||
|
getStepPT: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,30 @@
|
||||||
|
<template>
|
||||||
|
<component v-if="template" :is="template" :index="index" :active="active" :highlighted="highlighted" :class="cx('stepper.action')" :clickCallback="(event) => clickCallback(event, index)" />
|
||||||
|
<button v-else :id="id" :class="cx('stepper.action')" role="tab" :tabindex="disabled ? -1 : undefined" :aria-controls="ariaControls" @click="clickCallback($event, index)" v-bind="getStepPT(stepperpanel, 'action', index)">
|
||||||
|
<span :class="cx('stepper.number')" v-bind="getStepPT(stepperpanel, 'number', index)">{{ index + 1 }}</span>
|
||||||
|
<span :class="cx('stepper.title')" v-bind="getStepPT(stepperpanel, 'title', index)">{{ getStepProp(stepperpanel, 'header') }}</span>
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BaseComponent from 'primevue/basecomponent';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'StepperHeader',
|
||||||
|
hostName: 'Stepper',
|
||||||
|
extends: BaseComponent,
|
||||||
|
props: {
|
||||||
|
id: null,
|
||||||
|
template: null,
|
||||||
|
stepperpanel: null,
|
||||||
|
index: null,
|
||||||
|
disabled: null,
|
||||||
|
active: null,
|
||||||
|
highlighted: null,
|
||||||
|
ariaControls: null,
|
||||||
|
clickCallback: null,
|
||||||
|
getStepPT: null,
|
||||||
|
getStepProp: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,23 @@
|
||||||
|
<template>
|
||||||
|
<component v-if="template" :is="template" :class="separatorClass" :index="index" :active="active" :highlighted="highlighted" />
|
||||||
|
<span v-else :class="separatorClass" aria-hidden="true" v-bind="getStepPT" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BaseComponent from 'primevue/basecomponent';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'StepperSeparator',
|
||||||
|
hostName: 'Stepper',
|
||||||
|
extends: BaseComponent,
|
||||||
|
props: {
|
||||||
|
template: null,
|
||||||
|
separatorClass: null,
|
||||||
|
stepperpanel: null,
|
||||||
|
index: null,
|
||||||
|
active: null,
|
||||||
|
highlighted: null,
|
||||||
|
getStepPT: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"main": "./stepper.cjs.js",
|
||||||
|
"module": "./stepper.esm.js",
|
||||||
|
"unpkg": "./stepper.min.js",
|
||||||
|
"types": "./Stepper.d.ts",
|
||||||
|
"browser": {
|
||||||
|
"./sfc": "./Stepper.vue"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
import { BaseStyle } from '../../base/style';
|
||||||
|
|
||||||
|
export interface StepperStyle extends BaseStyle {}
|
|
@ -0,0 +1,46 @@
|
||||||
|
import BaseStyle from 'primevue/base/style';
|
||||||
|
|
||||||
|
const classes = {
|
||||||
|
root: ({ props }) => [
|
||||||
|
'p-stepper p-component',
|
||||||
|
{
|
||||||
|
'p-stepper-horizontal': props.orientation === 'horizontal',
|
||||||
|
'p-stepper-vertical': props.orientation === 'vertical',
|
||||||
|
'p-readonly': props.linear
|
||||||
|
}
|
||||||
|
],
|
||||||
|
navContainer: 'p-stepper-nav-container',
|
||||||
|
nav: 'p-stepper-nav',
|
||||||
|
stepper: {
|
||||||
|
header: ({ instance, step, index }) => [
|
||||||
|
'p-stepper-header',
|
||||||
|
{
|
||||||
|
'p-highlight': instance.isStepActive(index),
|
||||||
|
'p-disabled': instance.isItemDisabled(step, index)
|
||||||
|
}
|
||||||
|
],
|
||||||
|
action: 'p-stepper-action',
|
||||||
|
number: 'p-stepper-number',
|
||||||
|
title: 'p-stepper-title',
|
||||||
|
separator: 'p-stepper-separator',
|
||||||
|
toggleableContent: 'p-stepper-toggleable-content',
|
||||||
|
content: ({ props }) => [
|
||||||
|
'p-stepper-content',
|
||||||
|
{
|
||||||
|
'p-toggleable-content': props.orientation === 'vertical'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
panelContainer: 'p-stepper-panels',
|
||||||
|
panel: ({ instance, props, index }) => [
|
||||||
|
'p-stepper-panel',
|
||||||
|
{
|
||||||
|
'p-stepper-panel-active': props.orientation === 'vertical' && instance.isStepActive(index)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BaseStyle.extend({
|
||||||
|
name: 'stepper',
|
||||||
|
classes
|
||||||
|
});
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"main": "./stepperpanel.cjs.js",
|
||||||
|
"module": "./stepperpanel.esm.js",
|
||||||
|
"unpkg": "./stepperpanel.min.js",
|
||||||
|
"types": "./StepperPanel.d.ts"
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
<script>
|
||||||
|
import BaseComponent from 'primevue/basecomponent';
|
||||||
|
import StepperPanelStyle from 'primevue/stepperpanel/style';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'BaseStepperPanel',
|
||||||
|
extends: BaseComponent,
|
||||||
|
props: {
|
||||||
|
header: null
|
||||||
|
},
|
||||||
|
style: StepperPanelStyle,
|
||||||
|
provide() {
|
||||||
|
return {
|
||||||
|
$parentInstance: this
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,274 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* StepperPanel is a helper component for StepperPanel component.
|
||||||
|
*
|
||||||
|
* [Live Demo](https://www.primevue.org/stepper/)
|
||||||
|
*
|
||||||
|
* @module stepperpanel
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
import { TransitionProps, VNode } from 'vue';
|
||||||
|
import { ComponentHooks } from '../basecomponent';
|
||||||
|
import { PassThroughOptions } from '../passthrough';
|
||||||
|
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
||||||
|
|
||||||
|
export declare type StepperPanelPassThroughOptionType = StepperPanelPassThroughAttributes | ((options: StepperPanelPassThroughMethodOptions) => StepperPanelPassThroughAttributes | string) | string | null | undefined;
|
||||||
|
|
||||||
|
export declare type StepperPanelPassThroughTransitionType = TransitionProps | ((options: StepperPanelPassThroughMethodOptions) => TransitionProps) | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom passthrough(pt) option method.
|
||||||
|
*/
|
||||||
|
export interface StepperPanelPassThroughMethodOptions {
|
||||||
|
/**
|
||||||
|
* Defines instance.
|
||||||
|
*/
|
||||||
|
instance: any;
|
||||||
|
/**
|
||||||
|
* Defines valid properties.
|
||||||
|
*/
|
||||||
|
props: StepperPanelProps;
|
||||||
|
/**
|
||||||
|
* Defines current options.
|
||||||
|
*/
|
||||||
|
context: StepperPanelContext;
|
||||||
|
/**
|
||||||
|
* Defines valid attributes.
|
||||||
|
*/
|
||||||
|
attrs: any;
|
||||||
|
/**
|
||||||
|
* Defines parent options.
|
||||||
|
*/
|
||||||
|
parent: any;
|
||||||
|
/**
|
||||||
|
* Defines passthrough(pt) options in global config.
|
||||||
|
*/
|
||||||
|
global: object | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom passthrough(pt) options.
|
||||||
|
* @see {@link StepperPanelProps.pt}
|
||||||
|
*/
|
||||||
|
export interface StepperPanelPassThroughOptions {
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the root's DOM element.
|
||||||
|
*/
|
||||||
|
root?: StepperPanelPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the header's DOM element.
|
||||||
|
*/
|
||||||
|
header?: StepperPanelPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the action's DOM element.
|
||||||
|
*/
|
||||||
|
action?: StepperPanelPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the number's DOM element.
|
||||||
|
*/
|
||||||
|
number?: StepperPanelPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the title's DOM element.
|
||||||
|
*/
|
||||||
|
title?: StepperPanelPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the separator's DOM element.
|
||||||
|
*/
|
||||||
|
separator?: StepperPanelPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the content's DOM element.
|
||||||
|
*/
|
||||||
|
content?: StepperPanelPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the panel's DOM element.
|
||||||
|
*/
|
||||||
|
panel?: StepperPanelPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to the toggleable content's DOM element.
|
||||||
|
*/
|
||||||
|
toggleableContent?: StepperPanelPassThroughOptionType;
|
||||||
|
/**
|
||||||
|
* Used to control Vue Transition API.
|
||||||
|
*/
|
||||||
|
transition?: StepperPanelPassThroughTransitionType;
|
||||||
|
/**
|
||||||
|
* Used to manage all lifecycle hooks.
|
||||||
|
* @see {@link BaseComponent.ComponentHooks}
|
||||||
|
*/
|
||||||
|
hooks?: ComponentHooks;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StepperPanelPassThroughAttributes {
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines valid properties in StepperPanel component.
|
||||||
|
*/
|
||||||
|
export interface StepperPanelProps {
|
||||||
|
/**
|
||||||
|
* Orientation of tab headers.
|
||||||
|
*/
|
||||||
|
header?: string | undefined;
|
||||||
|
/**
|
||||||
|
* Used to pass attributes to DOM elements inside the component.
|
||||||
|
* @type {StepperPanelPassThroughOptions}
|
||||||
|
*/
|
||||||
|
pt?: PassThrough<StepperPanelPassThroughOptions>;
|
||||||
|
/**
|
||||||
|
* Used to configure passthrough(pt) options of the component.
|
||||||
|
* @type {PassThroughOptions}
|
||||||
|
*/
|
||||||
|
ptOptions?: PassThroughOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines current options in StepperPanel component.
|
||||||
|
*/
|
||||||
|
export interface StepperPanelContext {
|
||||||
|
/**
|
||||||
|
* Current index of the stepperpanel.
|
||||||
|
*/
|
||||||
|
index: number;
|
||||||
|
/**
|
||||||
|
* Count of stepperpanels
|
||||||
|
*/
|
||||||
|
count: number;
|
||||||
|
/**
|
||||||
|
* Whether the stepperpanel is first.
|
||||||
|
*/
|
||||||
|
first: boolean;
|
||||||
|
/**
|
||||||
|
* Whether the stepperpanel is last.
|
||||||
|
*/
|
||||||
|
last: boolean;
|
||||||
|
/**
|
||||||
|
* Whether the stepperpanel is active.
|
||||||
|
*/
|
||||||
|
active: boolean;
|
||||||
|
/**
|
||||||
|
* Whether the stepperpanel is highlighted.
|
||||||
|
*/
|
||||||
|
highlighted: boolean;
|
||||||
|
/**
|
||||||
|
* Whether the stepperpanel is disabled.
|
||||||
|
*/
|
||||||
|
disabled: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines valid slots in StepperPanel slots.
|
||||||
|
*/
|
||||||
|
export interface StepperPanelSlots {
|
||||||
|
/**
|
||||||
|
* Custom content template.
|
||||||
|
*/
|
||||||
|
default(): VNode[];
|
||||||
|
/**
|
||||||
|
* Custom header template.
|
||||||
|
*/
|
||||||
|
header(scope: {
|
||||||
|
/**
|
||||||
|
* Index of the stepperpanel
|
||||||
|
*/
|
||||||
|
index: number;
|
||||||
|
/**
|
||||||
|
* Current active state of the stepperpanel
|
||||||
|
*/
|
||||||
|
active: boolean;
|
||||||
|
/**
|
||||||
|
* Current highlighted state of the stepperpanel
|
||||||
|
*/
|
||||||
|
highlighted: boolean;
|
||||||
|
/**
|
||||||
|
* Style class of the stepperpanel
|
||||||
|
*/
|
||||||
|
class: string;
|
||||||
|
/**
|
||||||
|
* Header click function.
|
||||||
|
* @param {Event} event - Browser event
|
||||||
|
*/
|
||||||
|
clickCallback: (event: Event) => void;
|
||||||
|
}): VNode[];
|
||||||
|
/**
|
||||||
|
* Custom content template.
|
||||||
|
*/
|
||||||
|
content(scope: {
|
||||||
|
/**
|
||||||
|
* Index of the stepperpanel
|
||||||
|
*/
|
||||||
|
index: number;
|
||||||
|
/**
|
||||||
|
* Current active state of the stepperpanel
|
||||||
|
*/
|
||||||
|
active: boolean;
|
||||||
|
/**
|
||||||
|
* Current highlighted state of the stepperpanel
|
||||||
|
*/
|
||||||
|
highlighted: boolean;
|
||||||
|
/**
|
||||||
|
* Style class of the stepperpanel
|
||||||
|
*/
|
||||||
|
class: string;
|
||||||
|
/**
|
||||||
|
* Content click function.
|
||||||
|
* @param {Event} event - Browser event
|
||||||
|
*/
|
||||||
|
clickCallback: (event: Event) => void;
|
||||||
|
/**
|
||||||
|
* Content previous panel click function.
|
||||||
|
* @param {Event} event - Browser event
|
||||||
|
*/
|
||||||
|
prevCallback: (event: Event) => void;
|
||||||
|
/**
|
||||||
|
* Content next panel click function.
|
||||||
|
* @param {Event} event - Browser event
|
||||||
|
*/
|
||||||
|
nextCallback: (event: Event) => void;
|
||||||
|
}): VNode[];
|
||||||
|
/**
|
||||||
|
* Custom separator template.
|
||||||
|
*/
|
||||||
|
separator(scope: {
|
||||||
|
/**
|
||||||
|
* Index of the stepperpanel
|
||||||
|
*/
|
||||||
|
index: number;
|
||||||
|
/**
|
||||||
|
* Current active state of the stepperpanel
|
||||||
|
*/
|
||||||
|
active: boolean;
|
||||||
|
/**
|
||||||
|
* Current highlighted state of the stepperpanel
|
||||||
|
*/
|
||||||
|
highlighted: boolean;
|
||||||
|
/**
|
||||||
|
* Style class of the stepperpanel
|
||||||
|
*/
|
||||||
|
class: string;
|
||||||
|
}): VNode[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StepperPanelEmits {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* **PrimeVue - StepperPanel**
|
||||||
|
*
|
||||||
|
* _StepperPanel is a helper component for Stepper component._
|
||||||
|
*
|
||||||
|
* [Live Demo](https://www.primevue.org/stepper/)
|
||||||
|
* --- ---
|
||||||
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
||||||
|
*
|
||||||
|
* @group Component
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
declare class StepperPanel extends ClassComponent<StepperPanelProps, StepperPanelSlots, StepperPanelEmits> {}
|
||||||
|
|
||||||
|
declare module '@vue/runtime-core' {
|
||||||
|
interface GlobalComponents {
|
||||||
|
StepperPanel: GlobalComponentConstructor<StepperPanel>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default StepperPanel;
|
|
@ -0,0 +1,12 @@
|
||||||
|
<template>
|
||||||
|
<slot />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BaseStepperPanel from './BaseStepperPanel.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'StepperPanel',
|
||||||
|
extends: BaseStepperPanel
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"main": "./stepperpanel.cjs.js",
|
||||||
|
"module": "./stepperpanel.esm.js",
|
||||||
|
"unpkg": "./stepperpanel.min.js",
|
||||||
|
"types": "./StepperPanel.d.ts",
|
||||||
|
"browser": {
|
||||||
|
"./sfc": "./StepperPanel.vue"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
import { BaseStyle } from '../../base/style';
|
||||||
|
|
||||||
|
export interface StepperPanelStyle extends BaseStyle {}
|
|
@ -0,0 +1 @@
|
||||||
|
export default {};
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"main": "./stepperpanelstyle.cjs.js",
|
||||||
|
"module": "./stepperpanelstyle.esm.js",
|
||||||
|
"unpkg": "./stepperpanelstyle.min.js",
|
||||||
|
"types": "./StepperPanelStyle.d.ts"
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<nav :id="id" :class="cx('root')" v-bind="ptm('root')">
|
<nav :id="id" :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<ol ref="list" :class="cx('menu')" v-bind="ptm('menu')">
|
<ol ref="list" :class="cx('menu')" v-bind="ptm('menu')">
|
||||||
<template v-for="(item, index) of model" :key="label(item) + '_' + index.toString()">
|
<template v-for="(item, index) of model" :key="label(item) + '_' + index.toString()">
|
||||||
<li
|
<li
|
||||||
|
@ -34,6 +34,7 @@ import BaseSteps from './BaseSteps.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Steps',
|
name: 'Steps',
|
||||||
extends: BaseSteps,
|
extends: BaseSteps,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:activeStep', 'step-change'],
|
emits: ['update:activeStep', 'step-change'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" v-bind="ptm('root')">
|
<div :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<ul ref="nav" :class="cx('menu')" role="menubar" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="ptm('menu')">
|
<ul ref="nav" :class="cx('menu')" role="menubar" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="ptm('menu')">
|
||||||
<template v-for="(item, i) of model" :key="label(item) + '_' + i.toString()">
|
<template v-for="(item, i) of model" :key="label(item) + '_' + i.toString()">
|
||||||
<li
|
<li
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
>
|
>
|
||||||
<template v-if="!$slots.item">
|
<template v-if="!$slots.item">
|
||||||
<a ref="tabLink" v-ripple role="menuitem" :href="item.url" :class="cx('action')" :target="item.target" :aria-label="label(item)" :aria-disabled="disabled(item)" :tabindex="-1" v-bind="getPTOptions('action', item, i)">
|
<a ref="tabLink" v-ripple role="menuitem" :href="item.url" :class="cx('action')" :target="item.target" :aria-label="label(item)" :aria-disabled="disabled(item)" :tabindex="-1" v-bind="getPTOptions('action', item, i)">
|
||||||
<component v-if="$slots.itemicon" :is="$slots.itemicon" :item="item" :class="[cx('icon'), item.icon]" />
|
<component v-if="$slots.itemicon" :is="$slots.itemicon" :item="item" :class="cx('icon')" />
|
||||||
<span v-else-if="item.icon" :class="[cx('icon'), item.icon]" v-bind="getPTOptions('icon', item, i)" />
|
<span v-else-if="item.icon" :class="[cx('icon'), item.icon]" v-bind="getPTOptions('icon', item, i)" />
|
||||||
<span :class="cx('label')" v-bind="getPTOptions('label', item, i)">{{ label(item) }}</span>
|
<span :class="cx('label')" v-bind="getPTOptions('label', item, i)">{{ label(item) }}</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -37,6 +37,7 @@ import BaseTabMenu from './BaseTabMenu.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'TabMenu',
|
name: 'TabMenu',
|
||||||
extends: BaseTabMenu,
|
extends: BaseTabMenu,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:activeIndex', 'tab-change'],
|
emits: ['update:activeIndex', 'tab-change'],
|
||||||
timeout: null,
|
timeout: null,
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -181,7 +181,7 @@ export interface TabPanelEmits {}
|
||||||
/**
|
/**
|
||||||
* **PrimeVue - TabPanel**
|
* **PrimeVue - TabPanel**
|
||||||
*
|
*
|
||||||
* _TabPanel is a helper component for TabPanel component._
|
* _TabPanel is a helper component for TabView component._
|
||||||
*
|
*
|
||||||
* [Live Demo](https://www.primevue.org/tabview/)
|
* [Live Demo](https://www.primevue.org/tabview/)
|
||||||
* --- ---
|
* --- ---
|
||||||
|
|
|
@ -13,7 +13,37 @@ import { PassThroughOptions } from '../passthrough';
|
||||||
import { TabPanelPassThroughOptionType } from '../tabpanel';
|
import { TabPanelPassThroughOptionType } from '../tabpanel';
|
||||||
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
||||||
|
|
||||||
export declare type TabViewPassThroughOptionType = TabViewPassThroughAttributes | ((options: { props: TabViewProps; state: TabViewState }) => TabViewPassThroughAttributes | string) | string | null | undefined;
|
export declare type TabViewPassThroughOptionType = TabViewPassThroughAttributes | ((options: TabViewPassThroughMethodOptions) => TabViewPassThroughAttributes | string) | string | null | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom passthrough(pt) option method.
|
||||||
|
*/
|
||||||
|
export interface TabViewPassThroughMethodOptions {
|
||||||
|
/**
|
||||||
|
* Defines instance.
|
||||||
|
*/
|
||||||
|
instance: any;
|
||||||
|
/**
|
||||||
|
* Defines valid properties.
|
||||||
|
*/
|
||||||
|
props: TabViewProps;
|
||||||
|
/**
|
||||||
|
* Defines current inline state.
|
||||||
|
*/
|
||||||
|
state: TabViewState;
|
||||||
|
/**
|
||||||
|
* Defines valid attributes.
|
||||||
|
*/
|
||||||
|
attrs: any;
|
||||||
|
/**
|
||||||
|
* Defines parent options.
|
||||||
|
*/
|
||||||
|
parent: any;
|
||||||
|
/**
|
||||||
|
* Defines passthrough(pt) options in global config.
|
||||||
|
*/
|
||||||
|
global: object | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom tab change event.
|
* Custom tab change event.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" role="tablist" v-bind="ptm('root')">
|
<div :class="cx('root')" role="tablist" v-bind="ptmi('root')">
|
||||||
<div :class="cx('navContainer')" v-bind="ptm('navContainer')">
|
<div :class="cx('navContainer')" v-bind="ptm('navContainer')">
|
||||||
<button
|
<button
|
||||||
v-if="scrollable && !isPrevButtonDisabled"
|
v-if="scrollable && !isPrevButtonDisabled"
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
v-bind="{ ...previousButtonProps, ...ptm('previousButton') }"
|
v-bind="{ ...previousButtonProps, ...ptm('previousButton') }"
|
||||||
data-pc-group-section="navbutton"
|
data-pc-group-section="navbutton"
|
||||||
>
|
>
|
||||||
<slot name="previcon">
|
<slot name="previousicon">
|
||||||
<component :is="prevIcon ? 'span' : 'ChevronLeftIcon'" aria-hidden="true" :class="prevIcon" v-bind="ptm('previousIcon')" />
|
<component :is="prevIcon ? 'span' : 'ChevronLeftIcon'" aria-hidden="true" :class="prevIcon" v-bind="ptm('previousIcon')" />
|
||||||
</slot>
|
</slot>
|
||||||
</button>
|
</button>
|
||||||
|
@ -102,6 +102,7 @@ import BaseTabView from './BaseTabView.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'TabView',
|
name: 'TabView',
|
||||||
extends: BaseTabView,
|
extends: BaseTabView,
|
||||||
|
inheritAttrs: false,
|
||||||
emits: ['update:activeIndex', 'tab-change', 'tab-click'],
|
emits: ['update:activeIndex', 'tab-change', 'tab-click'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<span :class="cx('root')" v-bind="ptm('root')">
|
<span :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<component v-if="$slots.icon" :is="$slots.icon" :class="cx('icon')" v-bind="ptm('icon')" />
|
<component v-if="$slots.icon" :is="$slots.icon" :class="cx('icon')" v-bind="ptm('icon')" />
|
||||||
<span v-else-if="icon" :class="[cx('icon'), icon]" v-bind="ptm('icon')"></span>
|
<span v-else-if="icon" :class="[cx('icon'), icon]" v-bind="ptm('icon')"></span>
|
||||||
<slot v-if="value || $slots.default">
|
<slot v-if="value || $slots.default">
|
||||||
|
@ -13,6 +13,7 @@ import BaseTag from './BaseTag.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Tag',
|
name: 'Tag',
|
||||||
extends: BaseTag
|
extends: BaseTag,
|
||||||
|
inheritAttrs: false
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="cx('root')" @click="onClick" v-bind="ptm('root')">
|
<div :class="cx('root')" @click="onClick" v-bind="ptmi('root')">
|
||||||
<div v-if="welcomeMessage" v-bind="ptm('welcomeMessage')">{{ welcomeMessage }}</div>
|
<div v-if="welcomeMessage" v-bind="ptm('welcomeMessage')">{{ welcomeMessage }}</div>
|
||||||
<div :class="cx('content')" v-bind="ptm('content')">
|
<div :class="cx('content')" v-bind="ptm('content')">
|
||||||
<div v-for="(command, i) of commands" :key="command.text + i.toString()" v-bind="ptm('commands')">
|
<div v-for="(command, i) of commands" :key="command.text + i.toString()" v-bind="ptm('commands')">
|
||||||
|
@ -22,6 +22,7 @@ import BaseTerminal from './BaseTerminal.vue';
|
||||||
export default {
|
export default {
|
||||||
name: 'Terminal',
|
name: 'Terminal',
|
||||||
extends: BaseTerminal,
|
extends: BaseTerminal,
|
||||||
|
inheritAttrs: false,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
commandText: null,
|
commandText: null,
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue