mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #5612 - Chips / InputChips
This commit is contained in:
parent
55ae9908d1
commit
365879a41c
16 changed files with 696 additions and 574 deletions
3
components/lib/inputchips/style/InputChipsStyle.d.ts
vendored
Normal file
3
components/lib/inputchips/style/InputChipsStyle.d.ts
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { BaseStyle } from '../../base/style';
|
||||
|
||||
export interface InputChipsStyle extends BaseStyle {}
|
29
components/lib/inputchips/style/InputChipsStyle.js
Normal file
29
components/lib/inputchips/style/InputChipsStyle.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
import BaseStyle from 'primevue/base/style';
|
||||
|
||||
const classes = {
|
||||
root: ({ instance, props }) => [
|
||||
'p-inputchips p-component p-inputwrapper',
|
||||
{
|
||||
'p-disabled': props.disabled,
|
||||
'p-invalid': props.invalid,
|
||||
'p-focus': instance.focused,
|
||||
'p-inputwrapper-filled': (props.modelValue && props.modelValue.length) || (instance.inputValue && instance.inputValue.length),
|
||||
'p-inputwrapper-focus': instance.focused
|
||||
}
|
||||
],
|
||||
container: ({ props, instance }) => [
|
||||
'p-inputchips-input',
|
||||
{
|
||||
'p-variant-filled': props.variant ? props.variant === 'filled' : instance.$primevue.config.inputStyle === 'filled'
|
||||
}
|
||||
],
|
||||
token: ({ state, index }) => ['p-inputchips-chip', { 'p-focus': state.focusedIndex === index }],
|
||||
label: 'p-inputchips-chip-label',
|
||||
removeTokenIcon: 'p-inputchips-chip-icon',
|
||||
inputToken: 'p-inputchips-input-item'
|
||||
};
|
||||
|
||||
export default BaseStyle.extend({
|
||||
name: 'inputchips',
|
||||
classes
|
||||
});
|
6
components/lib/inputchips/style/package.json
Normal file
6
components/lib/inputchips/style/package.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"main": "./inputchipsstyle.cjs.js",
|
||||
"module": "./inputchipsstyle.esm.js",
|
||||
"unpkg": "./inputchipsstyle.min.js",
|
||||
"types": "./InputChipsStyle.d.ts"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue