Refactor #3965 - Update Base components

pull/4011/head
mertsincan 2023-05-30 12:03:42 +01:00
parent 911c4de1fe
commit b6ec58de65
10 changed files with 62 additions and 73 deletions

View File

@ -45,7 +45,7 @@ const classes = {
}
};
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_accordion_style', manual: true });
const { load: loadStyle } = useStyle(styles, { id: 'primevue_accordion_style', manual: true });
export default {
name: 'BaseAccordion',
@ -81,15 +81,13 @@ export default {
}
},
css: {
classes
classes,
loadStyle
},
watch: {
isUnstyled: {
immediate: true,
handler(newValue) {
!newValue && loadStyle();
}
}
provide() {
return {
$parentInstance: this
};
}
};
</script>

View File

@ -14,6 +14,11 @@ export default {
contentClass: null,
contentProps: null,
disabled: Boolean
},
provide() {
return {
$parentInstance: this
};
}
};
</script>

View File

@ -146,7 +146,7 @@
@click="onOptionSelect($event, option)"
@mousemove="onOptionMouseMove($event, getOptionIndex(i, getItemOptions))"
:data-p-highlight="isSelected(option)"
:data-p-focus="focusedOptionIndex === getOptionIndex(index, getItemOptions)"
:data-p-focus="focusedOptionIndex === getOptionIndex(i, getItemOptions)"
:data-p-disabled="isOptionDisabled(option)"
v-bind="getPTOptions(option, getItemOptions, i, 'item')"
>

View File

@ -148,7 +148,7 @@ const classes = {
hiddenSelectedMessage: 'p-hidden-accessible'
};
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_autocomplete_style', manual: true });
const { load: loadStyle } = useStyle(styles, { id: 'primevue_autocomplete_style', manual: true });
export default {
name: 'BaseAutoComplete',
@ -312,15 +312,13 @@ export default {
},
css: {
classes,
inlineStyles
inlineStyles,
loadStyle
},
watch: {
isUnstyled: {
immediate: true,
handler(newValue) {
!newValue && loadStyle();
}
}
provide() {
return {
$parentInstance: this
};
}
};
</script>

View File

@ -222,7 +222,7 @@ const classes = {
clearButton: 'p-button-text'
};
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_calendar_style', manual: true });
const { load: loadStyle } = useStyle(styles, { id: 'primevue_calendar_style', manual: true });
export default {
name: 'BaseCalendar',
@ -445,15 +445,13 @@ export default {
},
css: {
inlineStyles,
classes
classes,
loadStyle
},
watch: {
isUnstyled: {
immediate: true,
handler(newValue) {
!newValue && loadStyle();
}
}
provide() {
return {
$parentInstance: this
};
}
};
</script>

View File

@ -43,7 +43,7 @@ const classes = {
icon: 'p-checkbox-icon'
};
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_checkbox_style', manual: true });
const { load: loadStyle } = useStyle(styles, { id: 'primevue_checkbox_style', manual: true });
export default {
name: 'BaseCheckbox',
@ -106,15 +106,13 @@ export default {
}
},
css: {
classes
classes,
loadStyle
},
watch: {
isUnstyled: {
immediate: true,
handler(newValue) {
!newValue && loadStyle();
}
}
provide() {
return {
$parentInstance: this
};
}
};
</script>

View File

@ -67,7 +67,7 @@ const classes = {
inputToken: 'p-chips-input-token'
};
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_chips_style', manual: true });
const { load: loadStyle } = useStyle(styles, { id: 'primevue_chips_style', manual: true });
export default {
name: 'BaseChips',
@ -131,15 +131,13 @@ export default {
}
},
css: {
classes
classes,
loadStyle
},
watch: {
isUnstyled: {
immediate: true,
handler(newValue) {
!newValue && loadStyle();
}
}
provide() {
return {
$parentInstance: this
};
}
};
</script>

View File

@ -32,7 +32,7 @@ const classes = {
hueHandle: 'p-colorpicker-hue-handle'
};
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_colorpicker_style', manual: true });
const { load: loadStyle } = useStyle(styles, { id: 'primevue_colorpicker_style', manual: true });
export default {
name: 'BaseColorPicker',
@ -77,15 +77,13 @@ export default {
panelClass: null
},
css: {
classes
classes,
loadStyle
},
watch: {
isUnstyled: {
immediate: true,
handler(newValue) {
!newValue && loadStyle();
}
}
provide() {
return {
$parentInstance: this
};
}
};
</script>

View File

@ -153,7 +153,7 @@ const classes = {
hiddenLastFocusableEl: 'p-hidden-accessible p-hidden-focusable'
};
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_dropdown_style', manual: true });
const { load: loadStyle } = useStyle(styles, { id: 'primevue_dropdown_style', manual: true });
export default {
name: 'BaseDropdown',
@ -310,15 +310,13 @@ export default {
},
css: {
inlineStyles,
classes
classes,
loadStyle
},
watch: {
isUnstyled: {
immediate: true,
handler(newValue) {
!newValue && loadStyle();
}
}
provide() {
return {
$parentInstance: this
};
}
};
</script>

View File

@ -38,7 +38,7 @@ const classes = {
content: 'p-fieldset-content'
};
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_fieldset_style', manual: true });
const { load: loadStyle } = useStyle(styles, { id: 'primevue_fieldset_style', manual: true });
export default {
name: 'BaseFieldset',
@ -53,15 +53,13 @@ export default {
}
},
css: {
classes
classes,
loadStyle
},
watch: {
isUnstyled: {
immediate: true,
handler(newValue) {
!newValue && loadStyle();
}
}
provide() {
return {
$parentInstance: this
};
}
};
</script>