Fixed #5266 - New Stepper component

This commit is contained in:
tugcekucukoglu 2024-02-13 09:22:45 +03:00
parent 3ddf127783
commit 62e6aaeb28
17 changed files with 976 additions and 0 deletions

View file

@ -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>

View file

@ -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;

View file

@ -0,0 +1,12 @@
<template>
<slot />
</template>
<script>
import BaseStepperPanel from './BaseStepperPanel.vue';
export default {
name: 'StepperPanel',
extends: BaseStepperPanel
};
</script>

View file

@ -0,0 +1,9 @@
{
"main": "./stepperpanel.cjs.js",
"module": "./stepperpanel.esm.js",
"unpkg": "./stepperpanel.min.js",
"types": "./StepperPanel.d.ts",
"browser": {
"./sfc": "./StepperPanel.vue"
}
}

View file

@ -0,0 +1,3 @@
import { BaseStyle } from '../../base/style';
export interface StepperPanelStyle extends BaseStyle {}

View file

@ -0,0 +1 @@
export default {};

View file

@ -0,0 +1,6 @@
{
"main": "./stepperpanelstyle.cjs.js",
"module": "./stepperpanelstyle.esm.js",
"unpkg": "./stepperpanelstyle.min.js",
"types": "./StepperPanelStyle.d.ts"
}