Theming API: Update `Theme` export

pull/5756/head
Mert Sincan 2024-05-13 22:57:53 +01:00
parent a82843f1ff
commit 792f02f9b5
11 changed files with 11 additions and 13 deletions

View File

@ -1,4 +1,4 @@
import Theme, { dt } from 'primevue/themes'; import { Theme, dt } from 'primevue/themes';
import { useStyle } from 'primevue/usestyle'; import { useStyle } from 'primevue/usestyle';
import { ObjectUtils } from 'primevue/utils'; import { ObjectUtils } from 'primevue/utils';

View File

@ -1,7 +1,7 @@
<script> <script>
import Base from 'primevue/base'; import Base from 'primevue/base';
import BaseStyle from 'primevue/base/style'; import BaseStyle from 'primevue/base/style';
import Theme, { ThemeService } from 'primevue/themes'; import { Theme, ThemeService } from 'primevue/themes';
import { DomHandler, ObjectUtils, UniqueComponentId } from 'primevue/utils'; import { DomHandler, ObjectUtils, UniqueComponentId } from 'primevue/utils';
import { mergeProps } from 'vue'; import { mergeProps } from 'vue';
import BaseComponentStyle from './style/BaseComponentStyle'; import BaseComponentStyle from './style/BaseComponentStyle';

View File

@ -1,7 +1,7 @@
import Base from 'primevue/base'; import Base from 'primevue/base';
import BaseStyle from 'primevue/base/style'; import BaseStyle from 'primevue/base/style';
import PrimeVueService from 'primevue/service'; import PrimeVueService from 'primevue/service';
import Theme, { ThemeService } from 'primevue/themes'; import { Theme, ThemeService } from 'primevue/themes';
import { ObjectUtils, UniqueComponentId } from 'primevue/utils'; import { ObjectUtils, UniqueComponentId } from 'primevue/utils';
import { mergeProps } from 'vue'; import { mergeProps } from 'vue';

View File

@ -1,6 +1,6 @@
import { FilterMatchMode } from 'primevue/api'; import { FilterMatchMode } from 'primevue/api';
import PrimeVueService from 'primevue/service'; import PrimeVueService from 'primevue/service';
import Theme, { ThemeService } from 'primevue/themes'; import { Theme, ThemeService } from 'primevue/themes';
import { inject, reactive, ref, watch } from 'vue'; import { inject, reactive, ref, watch } from 'vue';
export const defaultOptions = { export const defaultOptions = {

View File

@ -1,4 +1,4 @@
import Theme, { SharedUtils } from 'primevue/themes'; import { SharedUtils, Theme } from 'primevue/themes';
export default (...presets) => { export default (...presets) => {
const newPreset = SharedUtils.object.mergeKeys(Theme.getPreset(), ...presets); const newPreset = SharedUtils.object.mergeKeys(Theme.getPreset(), ...presets);

View File

@ -1,4 +1,4 @@
import Theme from 'primevue/themes'; import { Theme } from 'primevue/themes';
export default (...presets) => { export default (...presets) => {
const newPreset = SharedUtils.object.mergeKeys(...presets); const newPreset = SharedUtils.object.mergeKeys(...presets);

View File

@ -1,5 +1,4 @@
import { SharedUtils } from 'primevue/themes'; import { SharedUtils, Theme } from 'primevue/themes';
import Theme from 'primevue/themes/config';
export const $dt = (tokenPath) => { export const $dt = (tokenPath) => {
const theme = Theme.getTheme(); const theme = Theme.getTheme();

View File

@ -1,5 +1,4 @@
import { SharedUtils } from 'primevue/themes'; import { SharedUtils, Theme } from 'primevue/themes';
import Theme from 'primevue/themes/config';
export const $t = (theme = {}) => { export const $t = (theme = {}) => {
let { preset: _preset, options: _options } = theme; let { preset: _preset, options: _options } = theme;

View File

@ -1,4 +1,4 @@
import Theme, { SharedUtils } from 'primevue/themes'; import { SharedUtils, Theme } from 'primevue/themes';
export default function (theme, options = {}) { export default function (theme, options = {}) {
const VARIABLE = Theme.defaults.variable; const VARIABLE = Theme.defaults.variable;

View File

@ -1,5 +1,5 @@
export * from 'primevue/themes/actions'; export * from 'primevue/themes/actions';
export { default } from 'primevue/themes/config'; export { default as Theme } from 'primevue/themes/config';
export * from 'primevue/themes/helpers'; export * from 'primevue/themes/helpers';
export { default as ThemeService } from 'primevue/themes/service'; export { default as ThemeService } from 'primevue/themes/service';
export * from 'primevue/themes/utils'; export * from 'primevue/themes/utils';

View File

@ -55,7 +55,7 @@ export default defineNuxtModule({
${registered.styles.map((style) => `import ${style.as} from '${style.from}';`).join('\n')} ${registered.styles.map((style) => `import ${style.as} from '${style.from}';`).join('\n')}
${ ${
hasTheme hasTheme
? `import Theme from 'primevue/themes'; ? `import { Theme } from 'primevue/themes';
import ${importTheme.as} from '${importTheme.from}';\n` import ${importTheme.as} from '${importTheme.from}';\n`
: '' : ''
} }