pull/5507/head
mertsincan 2024-04-01 11:13:05 +01:00
commit fbde280c8e
11 changed files with 165 additions and 207 deletions

View File

@ -0,0 +1,48 @@
<template>
<DocSectionText v-bind="$attrs">
<p>The <i>PrimeVue</i> plugin is replaced with <i>PrimeVueStyled</i> and <i>PrimeVueUnstyled</i> plugins depending on the theming mode.</p>
</DocSectionText>
<DocSectionCode :code="code1" hideToggleCode importCode hideStackBlitz />
<DocSectionCode :code="code2" hideToggleCode importCode hideStackBlitz />
</template>
<script>
export default {
data() {
return {
code1: {
basic: `
//v3 styled mode
import PrimeVue from 'primevue/config';
const app = createApp(App);
app.use(PrimeVue);
//v4 styled mode
import PrimeVueStyled from 'primevue/styled';
const app = createApp(App);
app.use(PrimeVueStyled);
`
},
code2: {
basic: `
///v3 unstyled mode
import PrimeVue from 'primevue/config';
const app = createApp(App);
app.use(PrimeVue, {
unstyled: true
});
///v4 unstyled mode
import PrimeVueUnstyled from 'primevue/styled';
const app = createApp(App);
app.use(PrimeVueUnstyled);
`
}
};
}
};
</script>

View File

@ -1,81 +0,0 @@
<template>
<DocSectionText v-bind="$attrs">
<p>
Styled mode is based on pre-skinned components with opinionated themes like Material, Bootstrap or PrimeOne themes. Theme is the required css file to be imported, visit the
<NuxtLink to="/theming/#themes">Themes</NuxtLink> section for the complete list of available themes to choose from.
</p>
<p>You may use the <i>app.vue</i> file to import a theme using a script.</p>
<DocSectionCode :code="code1" hideToggleCode hideStackBlitz />
<p>The style section may also be used with <i>@import</i>.</p>
<DocSectionCode :code="code2" hideToggleCode hideStackBlitz />
<p>Another alternative would be the <i>css</i> option in <i>nuxt.config</i>.</p>
<DocSectionCode :code="code3" hideToggleCode importCode hideStackBlitz />
<p>
The style classes of PrimeVue are defined under the <i>primevue</i> CSS layer to be easier to customize by having low specificity. If you are using a CSS library that styles default HTML elements such as Tailwind Preflight, Bootstrap,
Normalize, or similar, a custom CSS layer configuration might be necessary with the <i>cssLayerOrder</i> option to make sure primevue layer is defined afterward. This only applies to Styled Mode as Unstyled Mode does not use any default
styles or layers. View the <NuxtLink to="/csslayer">CSS Layer</NuxtLink> guide for more information.
</p>
<DocSectionCode :code="code4" hideToggleCode importCode hideStackBlitz />
<DocSectionCode :code="code5" hideToggleCode importCode hideStackBlitz />
</DocSectionText>
</template>
<script>
export default {
data() {
return {
code1: {
basic: `
<script>
import 'primevue/resources/themes/aura-light-green/theme.css'
<\/script>
`
},
code2: {
basic: `
<style>
@import url("primevue/resources/themes/aura-light-green/theme.css");
<\/style>
`
},
code3: {
basic: `
export default defineNuxtConfig({
modules: [
'nuxt-primevue'
],
primevue: {
/* Options */
},
css: ['primevue/resources/themes/aura-light-green/theme.css']
})
`
},
code4: {
basic: `
/* Reset CSS */
@layer reset {
button,
input {
/* CSS to Reset */
}
}
`
},
code5: {
basic: `
export default defineNuxtConfig({
modules: [
'nuxt-primevue'
],
primevue: {
cssLayerOrder: 'reset,primevue'
},
css: ['primevue/resources/themes/aura-light-green/theme.css']
})
`
}
};
}
};
</script>

View File

@ -1,49 +0,0 @@
<template>
<DocSectionText v-bind="$attrs">
<p>
Unstyled mode is disabled by default for all components. Set <i>unstyled</i> as true to enable it globally using a module configuration. Visit the <NuxtLink to="/unstyled">Unstyled mode</NuxtLink> documentation for more information and
examples.
</p>
<DocSectionCode :code="code1" hideToggleCode importCode hideStackBlitz />
<p>In unstyled mode, you'd need to style the components on your end. If you are using Tailwind CSS, see the <a href="https://tailwind.primevue.org/nuxt/">Tailwind CSS Presets</a> project to get you started.</p>
<DocSectionCode :code="code2" hideToggleCode importCode hideStackBlitz />
</DocSectionText>
</template>
<script>
export default {
data() {
return {
code1: {
basic: `
export default defineNuxtConfig({
modules: [
'nuxt-primevue'
],
primevue: {
options: {
unstyled: true
}
}
})
`
},
code2: {
basic: `
import path from 'path';
export default defineNuxtConfig({
modules: [
'nuxt-primevue'
],
primevue: {
unstyled: true,
importPT: { from: path.resolve(__dirname, './presets/lara/') } //import and apply preset
}
})
`
}
};
}
};
</script>

View File

@ -0,0 +1,57 @@
<template>
<DocSectionText v-bind="$attrs">
<p>Configures the theme configuration path for the customizations of a theme in styled mode.</p>
<DocSectionCode :code="code1" importCode hideToggleCode hideStackBlitz />
<DocSectionCode :code="code2" importCode hideToggleCode hideStackBlitz />
</DocSectionText>
</template>
<script>
export default {
data() {
return {
code1: {
basic: `
primevue: {
importTheme: { from: '@/themes/mytheme.js' },
}
`
},
code2: {
basic: `
import { definePreset } from 'primevue/themes';
import PrimeOne from 'primevue/themes/primeone';
import Aura from 'primevue/themes/primeone/aura';
const MyPreset = definePreset(Aura, {
semantic: {
primary: {
50: '{indigo.50}',
100: '{indigo.100}',
200: '{indigo.200}',
300: '{indigo.300}',
400: '{indigo.400}',
500: '{indigo.500}',
600: '{indigo.600}',
700: '{indigo.700}',
800: '{indigo.800}',
900: '{indigo.900}',
950: '{indigo.950}'
}
}
});
export default {
base: PrimeOne,
preset: MyPreset,
options: {
darkModeSelector: '.p-dark'
}
};
`
}
};
}
};
</script>

View File

@ -0,0 +1,22 @@
<template>
<DocSectionText v-bind="$attrs">
<p>Defines the theming mode, defaults to false.</p>
</DocSectionText>
<DocSectionCode :code="code" importCode hideToggleCode hideStackBlitz />
</template>
<script>
export default {
data() {
return {
code: {
basic: `
primevue: {
unstyled: true
}
`
}
};
}
};
</script>

View File

@ -1,16 +1,7 @@
<template> <template>
<DocSectionText v-bind="$attrs"> <DocSectionText v-bind="$attrs">
<p> <p>Styled mode is based on pre-skinned components with opinionated themes, default theme Aura with emerald as the primary color. See the <NuxtLink to="/theming/styled">styled mode</NuxtLink> documentation to for customization.</p>
Styled mode is based on pre-skinned components with opinionated themes like Material, Bootstrap or PrimeOne themes. Theme is the required css file to be imported, visit the <DocSectionCode :code="code" hideToggleCode importCode hideStackBlitz />
<NuxtLink to="/theming/#themes">Themes</NuxtLink> section for the complete list of available themes to choose from.
</p>
<DocSectionCode :code="code1" hideToggleCode importCode hideStackBlitz />
<p>
The style classes of PrimeVue are defined under the <i>primevue</i> CSS layer to be easier to customize by having low specificity. If you are using a CSS library that styles default HTML elements such as Tailwind Preflight, Bootstrap,
Normalize, or similar, a custom CSS layer configuration might be necessary. This only applies to Styled Mode as Unstyled Mode does not use any default styles or layers. View the <NuxtLink to="/csslayer">CSS Layer</NuxtLink> guide for more
information.
</p>
<DocSectionCode :code="code2" hideToggleCode importCode hideStackBlitz />
</DocSectionText> </DocSectionText>
</template> </template>
@ -18,24 +9,13 @@
export default { export default {
data() { data() {
return { return {
code1: { code: {
basic: ` basic: `
//in main.js import { createApp } from 'vue';
import 'primevue/resources/themes/aura-light-green/theme.css' import PrimeVueStyled from 'primevue/styled';
`
},
code2: {
basic: `
/* Order */
@layer reset, primevue;
/* Reset CSS */ const app = createApp(App);
@layer reset { app.use(PrimeVueStyled);
button,
input {
/* CSS to Reset */
}
}
` `
} }
}; };

View File

@ -1,11 +1,8 @@
<template> <template>
<DocSectionText v-bind="$attrs"> <DocSectionText v-bind="$attrs">
<p> <p>In unstyled mode, the components do not include any CSS so you'd need to style the components on your end. Visit the <NuxtLink to="/unstyled">Unstyled mode</NuxtLink> documentation for more information and examples.</p>
Unstyled mode is disabled by default for all components. Using the PrimeVue plugin during installation, set <i>unstyled</i> as true to enable it globally. Visit the <NuxtLink to="/unstyled">Unstyled mode</NuxtLink> documentation for more
information and examples.
</p>
<DocSectionCode :code="code1" hideToggleCode importCode hideStackBlitz /> <DocSectionCode :code="code1" hideToggleCode importCode hideStackBlitz />
<p>In unstyled mode, you'd need to style the components on your end. If you are using Tailwind CSS, see the <a href="https://tailwind.primevue.org/vite/">Tailwind CSS Presets</a> project to get you started.</p> <p>If you are using Tailwind CSS, see the <a href="https://tailwind.primevue.org/vite/">Tailwind CSS Presets</a> project to get you started with styling the components with Tailwind utility classes.</p>
<DocSectionCode :code="code2" hideToggleCode importCode hideStackBlitz /> <DocSectionCode :code="code2" hideToggleCode importCode hideStackBlitz />
</DocSectionText> </DocSectionText>
</template> </template>
@ -17,23 +14,20 @@ export default {
code1: { code1: {
basic: ` basic: `
import { createApp } from "vue"; import { createApp } from "vue";
import PrimeVue from "primevue/config"; import PrimeVueUnstyled from "primevue/config";
const app = createApp(App); const app = createApp(App);
app.use(PrimeVue, { app.use(PrimeVueUnstyled);
unstyled: true
});
` `
}, },
code2: { code2: {
basic: ` basic: `
import { createApp } from 'vue'; import { createApp } from 'vue';
import PrimeVue from 'primevue/config'; import PrimeVueUnstyled from 'primevue/config';
import Lara from '@/presets/lara'; //import preset import Lara from '@/presets/lara'; //import preset
const app = createApp(App); const app = createApp(App);
app.use(PrimeVue, { app.use(PrimeVueUnstyled, {
unstyled: true,
pt: Lara //apply preset pt: Lara //apply preset
}); });
` `

View File

@ -1,6 +1,9 @@
<template> <template>
<DocSectionText v-bind="$attrs"> <DocSectionText v-bind="$attrs">
<p>Each component can be imported and registered individually so that you only bundle what you use. Import path is available in the documentation of the corresponding component.</p> <p>
Each component can be imported and registered individually so that you only bundle what you use. Import path is available in the documentation of the corresponding component. You may also use
<NuxtLink to="/autoimport">auto imports</NuxtLink> via the unplugin-vue-components plugin.
</p>
</DocSectionText> </DocSectionText>
<div class="card flex justify-content-center"> <div class="card flex justify-content-center">
<Button label="Check" icon="pi pi-check" /> <Button label="Check" icon="pi pi-check" />

View File

@ -19,6 +19,7 @@
import NewFeaturesDoc from '@/doc/migration/v4/NewFeaturesDoc.vue'; import NewFeaturesDoc from '@/doc/migration/v4/NewFeaturesDoc.vue';
import OverviewDoc from '@/doc/migration/v4/OverviewDoc.vue'; import OverviewDoc from '@/doc/migration/v4/OverviewDoc.vue';
import ComponentsDoc from '@/doc/migration/v4/breakingchanges/ComponentsDoc.vue'; import ComponentsDoc from '@/doc/migration/v4/breakingchanges/ComponentsDoc.vue';
import PluginDoc from '@/doc/migration/v4/breakingchanges/PluginDoc.vue';
import StyledModeDoc from '@/doc/migration/v4/breakingchanges/StyledModeDoc.vue'; import StyledModeDoc from '@/doc/migration/v4/breakingchanges/StyledModeDoc.vue';
export default { export default {
@ -39,6 +40,11 @@ export default {
id: 'breakingchanges', id: 'breakingchanges',
label: 'Breaking Changes', label: 'Breaking Changes',
children: [ children: [
{
id: 'pluging',
label: 'Plugin',
component: PluginDoc
},
{ {
id: 'styledmode', id: 'styledmode',
label: 'Styled Mode', label: 'Styled Mode',

View File

@ -21,16 +21,15 @@
import DownloadDoc from '@/doc/nuxt/DownloadDoc.vue'; import DownloadDoc from '@/doc/nuxt/DownloadDoc.vue';
import ExamplesDoc from '@/doc/nuxt/ExamplesDoc.vue'; import ExamplesDoc from '@/doc/nuxt/ExamplesDoc.vue';
import ModuleSetupDoc from '@/doc/nuxt/ModuleSetupDoc.vue'; import ModuleSetupDoc from '@/doc/nuxt/ModuleSetupDoc.vue';
import StyledModeDoc from '@/doc/nuxt/StyledModeDoc.vue';
import UnstyledModeDoc from '@/doc/nuxt/UnstyledModeDoc.vue';
import UsageDoc from '@/doc/nuxt/UsageDoc.vue'; import UsageDoc from '@/doc/nuxt/UsageDoc.vue';
import VideoDoc from '@/doc/nuxt/VideoDoc.vue';
import CSSLayerOrderDoc from '@/doc/nuxt/configuration/CSSLayerOrderDoc.vue'; import CSSLayerOrderDoc from '@/doc/nuxt/configuration/CSSLayerOrderDoc.vue';
import ComponentsDoc from '@/doc/nuxt/configuration/ComponentsDoc.vue'; import ComponentsDoc from '@/doc/nuxt/configuration/ComponentsDoc.vue';
import ComposablesDoc from '@/doc/nuxt/configuration/ComposablesDoc.vue'; import ComposablesDoc from '@/doc/nuxt/configuration/ComposablesDoc.vue';
import DirectivesDoc from '@/doc/nuxt/configuration/DirectivesDoc.vue'; import DirectivesDoc from '@/doc/nuxt/configuration/DirectivesDoc.vue';
import ImportPTDoc from '@/doc/nuxt/configuration/ImportPTDoc.vue'; import ImportPTDoc from '@/doc/nuxt/configuration/ImportPTDoc.vue';
import ImportThemeDoc from '@/doc/nuxt/configuration/ImportThemeDoc.vue';
import OptionsDoc from '@/doc/nuxt/configuration/OptionsDoc.vue'; import OptionsDoc from '@/doc/nuxt/configuration/OptionsDoc.vue';
import UnstyledDoc from '@/doc/nuxt/configuration/UnstyledDoc.vue';
import UsePrimeVueDoc from '@/doc/nuxt/configuration/UsePrimeVueDoc.vue'; import UsePrimeVueDoc from '@/doc/nuxt/configuration/UsePrimeVueDoc.vue';
export default { export default {
@ -47,23 +46,6 @@ export default {
label: 'Module Setup', label: 'Module Setup',
component: ModuleSetupDoc component: ModuleSetupDoc
}, },
{
id: 'theming',
label: 'Theming',
description: 'PrimeVue has two theming modes; styled or unstyled.',
children: [
{
id: 'styled',
label: 'Styled Mode',
component: StyledModeDoc
},
{
id: 'unstyled',
label: 'Unstyled Mode',
component: UnstyledModeDoc
}
]
},
{ {
id: 'usage', id: 'usage',
label: 'Usage', label: 'Usage',
@ -78,6 +60,11 @@ export default {
label: 'usePrimeVue', label: 'usePrimeVue',
component: UsePrimeVueDoc component: UsePrimeVueDoc
}, },
{
id: 'unstyled',
label: 'unstyled',
component: UnstyledDoc
},
{ {
id: 'options', id: 'options',
label: 'options', label: 'options',
@ -103,6 +90,11 @@ export default {
label: 'importPT', label: 'importPT',
component: ImportPTDoc component: ImportPTDoc
}, },
{
id: 'importtheme',
label: 'importTheme',
component: ImportThemeDoc
},
{ {
id: 'layerorder', id: 'layerorder',
label: 'cssLayerOrder', label: 'cssLayerOrder',
@ -114,11 +106,6 @@ export default {
id: 'examples', id: 'examples',
label: 'Examples', label: 'Examples',
component: ExamplesDoc component: ExamplesDoc
},
{
id: 'video',
label: 'Video Tutorial',
component: VideoDoc
} }
] ]
}; };

View File

@ -22,7 +22,6 @@ import PluginDoc from '@/doc/vite/PluginDoc.vue';
import StyledModeDoc from '@/doc/vite/StyledModeDoc.vue'; import StyledModeDoc from '@/doc/vite/StyledModeDoc.vue';
import UnstyledModeDoc from '@/doc/vite/UnstyledModeDoc.vue'; import UnstyledModeDoc from '@/doc/vite/UnstyledModeDoc.vue';
import UsageDoc from '@/doc/vite/UsageDoc.vue'; import UsageDoc from '@/doc/vite/UsageDoc.vue';
import CreateVueDoc from '@/doc/vite/videos/CreateVueDoc.vue';
export default { export default {
data() { data() {
@ -36,12 +35,9 @@ export default {
{ {
id: 'plugin', id: 'plugin',
label: 'Plugin', label: 'Plugin',
component: PluginDoc component: PluginDoc,
}, description: `PrimeVue plugin is required to be installed as an application plugin to set up the default configuration. The plugin is lightweight, only sets up the configuration object without affecting your application. PrimeVue has two plugins; Styled and Unstyled. If you are
{ just getting started, we suggest to using the styled mode.`,
id: 'theming',
label: 'Theming',
description: 'PrimeVue has two theming modes; styled or unstyled.',
children: [ children: [
{ {
id: 'styled', id: 'styled',
@ -64,11 +60,6 @@ export default {
id: 'examples', id: 'examples',
label: 'Examples', label: 'Examples',
component: ExamplesDoc component: ExamplesDoc
},
{
id: 'videos',
label: 'Video Tutorial',
component: CreateVueDoc
} }
] ]
}; };