New IftaLabel component first implementation

pull/6424/head
tugcekucukoglu 2024-09-17 13:02:13 +03:00
parent 464fe2130f
commit 53985c1855
9 changed files with 214 additions and 0 deletions

View File

@ -13,6 +13,7 @@ export const form: MetaType[] = toMeta([
'FloatLabel', 'FloatLabel',
'Fluid', 'Fluid',
'IconField', 'IconField',
'IftaLabel',
'InputChips', 'InputChips',
'InputGroup', 'InputGroup',
'InputGroupAddon', 'InputGroupAddon',

View File

@ -138,6 +138,8 @@
"./galleria/style": "./src/galleria/style/GalleriaStyle.js", "./galleria/style": "./src/galleria/style/GalleriaStyle.js",
"./iconfield": "./src/iconfield/IconField.vue", "./iconfield": "./src/iconfield/IconField.vue",
"./iconfield/style": "./src/iconfield/style/IconFieldStyle.js", "./iconfield/style": "./src/iconfield/style/IconFieldStyle.js",
"./iftalabel": "./src/iftalabel/IftaLabel.vue",
"./iftalabel/style": "./src/iftalabel/style/IftaLabelStyle.js",
"./image": "./src/image/Image.vue", "./image": "./src/image/Image.vue",
"./image/style": "./src/image/style/ImageStyle.js", "./image/style": "./src/image/style/ImageStyle.js",
"./inlinemessage": "./src/inlinemessage/InlineMessage.vue", "./inlinemessage": "./src/inlinemessage/InlineMessage.vue",

View File

@ -0,0 +1,16 @@
<script>
import BaseComponent from '@primevue/core/basecomponent';
import IftaLabelStyle from 'primevue/iftalabel/style';
export default {
name: 'BaseIftaLabel',
extends: BaseComponent,
style: IftaLabelStyle,
provide() {
return {
$pcIftaLabel: this,
$parentInstance: this
};
}
};
</script>

View File

@ -0,0 +1,130 @@
/**
*
* FloatLabel appears on top of the input field when focused.
*
* [Live Demo](https://www.primevue.org/iftalabel/)
*
* @module iftalabel
*
*/
import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, PassThrough } from '@primevue/core';
import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { PassThroughOptions } from 'primevue/passthrough';
import { TransitionProps, VNode } from 'vue';
export declare type IftaLabelPassThroughOptionType = IftaLabelPassThroughAttributes | ((options: IftaLabelPassThroughMethodOptions) => IftaLabelPassThroughAttributes | string) | string | null | undefined;
export declare type IftaLabelPassThroughTransitionType = TransitionProps | ((options: IftaLabelPassThroughMethodOptions) => TransitionProps) | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface IftaLabelPassThroughMethodOptions {
/**
* Defines instance.
*/
instance: any;
/**
* Defines valid properties.
*/
props: IftaLabelProps;
/**
* 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 IftaLabelProps.pt}
*/
export interface IftaLabelPassThroughOptions {
/**
* Used to pass attributes to the root's DOM element.
*/
root?: IftaLabelPassThroughOptionType;
/**
* Used to manage all lifecycle hooks.
* @see {@link BaseComponent.ComponentHooks}
*/
hooks?: ComponentHooks;
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface IftaLabelPassThroughAttributes {
[key: string]: any;
}
/**
* Defines valid properties in IftaLabel component.
*/
export interface IftaLabelProps {
/**
* It generates scoped CSS variables using design tokens for the component.
*/
dt?: DesignToken<any>;
/**
* Used to pass attributes to DOM elements inside the component.
* @type {IftaLabelPassThroughOptions}
*/
pt?: PassThrough<IftaLabelPassThroughOptions>;
/**
* 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 IftaLabel component.
*/
export interface IftaLabelSlots {
/**
* Default content slot.
*/
default: () => VNode[];
}
/**
* Defines valid emits in IftaLabel component.
*/
export interface IftaLabelEmitsOptions {}
export declare type IftaLabelEmits = EmitFn<IftaLabelEmitsOptions>;
/**
* **PrimeVue - IftaLabel**
*
* _FloatLabel appears on top of the input field when focused._
*
* [Live Demo](https://www.primevue.org/inputtext/)
* --- ---
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
*
* @group Component
*
*/
declare const IftaLabel: DefineComponent<IftaLabelProps, IftaLabelSlots, IftaLabelEmits>;
declare module 'vue' {
export interface GlobalComponents {
IftaLabel: GlobalComponentConstructor<IftaLabelProps, IftaLabelSlots, IftaLabelEmits>;
}
}
export default IftaLabel;

View File

@ -0,0 +1,15 @@
<template>
<span :class="cx('root')" v-bind="ptmi('root')">
<slot />
</span>
</template>
<script>
import BaseIftaLabel from './BaseIftaLabel.vue';
export default {
name: 'IftaLabel',
extends: BaseIftaLabel,
inheritAttrs: false
};
</script>

View File

@ -0,0 +1,11 @@
{
"main": "./IftaLabel.vue",
"module": "./IftaLabel.vue",
"types": "./IftaLabel.d.ts",
"browser": {
"./sfc": "./IftaLabel.vue"
},
"sideEffects": [
"*.vue"
]
}

View File

@ -0,0 +1,19 @@
/**
*
* FloatLabel appears on top of the input field when focused.
*
* [Live Demo](https://www.primevue.org/floatlabel/)
*
* @module iftalabelstyle
*
*/
import type { BaseStyle } from '@primevue/core/base/style';
export enum IftaLabelClasses {
/**
* Class name of the root element
*/
root = 'p-iftalabel'
}
export interface IftaLabelStyle extends BaseStyle {}

View File

@ -0,0 +1,14 @@
import BaseStyle from '@primevue/core/base/style';
const theme = ({ dt }) => `
`;
const classes = {
root: 'p-iftalabel'
};
export default BaseStyle.extend({
name: 'iftalabel',
theme,
classes
});

View File

@ -0,0 +1,6 @@
{
"main": "./IftaLabelStyle.js",
"module": "./IftaLabelStyle.js",
"types": "./IftaLabelStyle.d.ts",
"sideEffects": false
}