Coder Social home page Coder Social logo

primefaces / primevue Goto Github PK

View Code? Open in Web Editor NEW
8.0K 77.0 1.0K 135.98 MB

Next Generation Vue UI Component Library

Home Page: https://primevue.org

License: MIT License

JavaScript 7.09% Vue 8.47% CSS 84.07% SCSS 0.38%
vue vuejs vue-components vue-library vue-ui-components vue-datepicker vue-component vue-table vue-datatable vue-grid

primevue's Introduction

License: MIT npm version Discord Chat Prime Discussions

PrimeVue Hero

PrimeVue

PrimeVue is a rich set of open source UI Components for Vue. See PrimeVue homepage for live showcase and documentation.

Download

PrimeVue is available at npm.

# Using npm
npm install primevue

# Using yarn
yarn add primevue

# Using pnpm
pnpm add primevue

Plugin

PrimeVue plugin is required to be installed with the use function to set up the default configuration.

import { createApp } from 'vue';
import PrimeVue from 'primevue/config';
const app = createApp(App);

app.use(PrimeVue);

Theming

PrimeVue has two theming has modes; styled or unstyled.

Styled Mode

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 Themes section for the complete list of available themes to choose from.

// theme
import 'primevue/resources/themes/aura-light-green/theme.css';

Unstyled Mode

Unstyled mode is disabled by default for all components. Using the PrimeVue plugin during installation, set unstyled as true to enable it globally. Visit the Unstyled mode documentation for more information and examples.

import { createApp } from 'vue';
import PrimeVue from 'primevue/config';
const app = createApp(App);

app.use(PrimeVue, { unstyled: true });

Usage

Each component can be imported individually so that you only bundle what you use. Import path is available in the documentation of the corresponding component.

import Button from 'primevue/button';

const app = createApp(App);
app.component('Button', Button);

Prop Cases

Component prop names are described as camel case throughout the documentation however kebab-case is also fully supported. Events on the other hand should always be kebab-case.

<Dialog :showHeader="false"></Dialog>

<!-- can be written as -->

<Dialog :show-header="false"></Dialog>

Nuxt Integration

The nuxt-primevue package is the official module by PrimeTek.

# Using npm
npm install --save-dev nuxt-primevue

# Using yarn
yarn add --dev nuxt-primevue

# Using pnpm
pnpm add -D nuxt-primevue

The module is enabled by adding nuxt-primevue to the modules option. Configuration values are defined with the primevue property.

export default defineNuxtConfig({
    modules: ['nuxt-primevue'],
    primevue: {
        /* Options */
    }
});

Whether to install the PrimeVue plugin, defaults to true. Disable this option if you prefer to configure PrimeVue manually e.g. with a Nuxt plugin.

primevue: {
    usePrimeVue: true;
}

The names of the components, directives and composables to import and register are provided using the include property. When the value is ignored or set using the * alias, all of the components, directives and composables are registered respectively.

primevue: {
    components: {
        include: ['Button', 'DataTable']
    },
    directives: {
        include: ['Ripple', 'Tooltip']
    },
    composables: {
        include: ['useStyle']
    }
}

In styled mode, the theme can be defined at Nuxt configuration with the css property. Note that this only applies to styled mode, in unstyled mode a theme file is not required as styling is done externally.

export default defineNuxtConfig({
    css: ['primevue/resources/themes/aura-dark-green/theme.css']
});

For detailed information

Example

We've created various samples for the popular options in the Vue ecosystem. Visit the primevue-examples repository for the samples.

Contributors

primevue's People

Contributors

amal-qb avatar andrewguy avatar atakantepe avatar bahadirsofuoglu avatar benjaminmink avatar betavs avatar cagataycivici avatar dcyaner avatar flipwarthog avatar habubey avatar hugeletters avatar i7slegend avatar ig-onoffice-de avatar james-laidlaw avatar kadirboylu avatar lochstar avatar magiczne avatar melloware avatar mertsincan avatar merve7 avatar navedqb avatar nestorrente avatar nikogj avatar onursenture avatar sezisfurkan avatar tamas-hi avatar thielpa avatar titou10titou10 avatar tugcekucukoglu avatar yigitfindikli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

primevue's Issues

Column component registration fails with Typescript

Following the basic example of your documentation, DataTable does not work.

I report the console log error:

vue.runtime.esm.js?2b0e:619 [Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option...

Dependencies

  • Vue 2.6.10
  • core-js 2.6.5
  • primevue-1.0.0-beta6

InputMask pressing enter

InputMask gives error when pressing enter. Keydown event doesn't work, I can use only keyup to check if user pressed enter.

Vue warn]: Error in v-on handler: "TypeError: $vm.onBlur is not a function"
found in

---> at node_modules/primevue/components/inputmask/InputMask.vue
at src/components/TesztComp/SearchPanel.vue
at src/components/TesztComp/TesztComp.vue

at src/App.vue

input Editor acts weird

input Editor elements in the provided sample acts quite weird. In chrome when you type it's got written backwards. In firefox it's got written vertically.

Transpile ObjectUtils.js when installing from npm

Hi, this is not really an issue but a proposal to avoid an error:

ERROR  Failed to compile with 1 errors

error  in ./node_modules/primevue/components/utils/ObjectUtils.js

Module parse failed: Unexpected token (134:29)
You may need an appropriate loader to handle this file type.
|     }
| 
>     static filterConstraints = {
| 
|         startsWith(value, filter) {
....

This is caused by babel-loader that by default ignores node_modules folder, so this file is not transpiled. This error doesn't affect every component but those that are dependent of this file.

I think in the README file there could be an advice about adding to the vue.config.js file of the project:

module.exports = {
    [...,]
    transpileDependencies: [
        "primevue"
    ]
}

to get this file transpiled by the vue cli. Source: https://cli.vuejs.org/config/#transpiledependencies

Thank you and regards.

MultiSelect not showing selected items

Got an array of LookupVm class which has an id and a name properties. Binding everything together seems not working. Selected items not shown on the MultiSelect. Please see the code bellow:

<template>
...
<div class="p-col-12 p-md-4">
    <label for="roles">Role</label>
</div>
<div class="p-col-12 p-md-8">
    <MultiSelect id="roles" v-model="selectedRoles" optionLabel="name" :options="roleList" />
</div>
...
</template>
<script lang="ts">
	import Vue from "vue";
	import { UserService, LookupVm } from "@/services/index";

	export default Vue.extend({
		data() {
			return {
				selectedRoles: new Array<LookupVm>(),
				roleList: new Array<LookupVm>(),
			}
		},
		mounted() {
			this.loadRoleList();
		},
		methods: {
			loadRoleList() {
				UserService.getRolesLookup().then((result) => { this.roleList = result; })
			}
		},
	});
</script>

Screens:
image

image

image

Use Typescript to develop PrimeVue?

Hi,
This is a great initiative and will help Vue community a lot. As we understand Vue 3 will itself be written in Typescript.
As this is a new project, is their any specific reason for not using Typescript for building components?

Cannot find module './components/column/Column'

Hi Guys,

I am trying to start a new project with primevue but I encountered an issue with Column component.
When I compile typescript it says Cannot find module './components/column/Column' in node_modules/primevue/column.d.ts:1:15
Is that something wrong with my dependency setup or it is an issue with primevue itself?
Any other primevue components are fine. I am using target: es5 and module esNext. PrimeVue version is 1.0.0-beta.7.

Very appreciate.

Wrong date with "yy.mm.dd" date format

Typing date with dateFormat="yy.mm.dd" gives wrong date, in day section automatically inserts leading zero and cannot be typed e.q. "23" to day, it forces "02" when "2" is pressed. And without specifying dateFormat in the component it gives date in default format, however it's set in "hu" locale.

Component:
Calendar v-model="myDate" :showIcon="true" :locale="hu" :showOnFocus="false" dateFormat="yy.mm.dd"

function returns "hu" data:
return {
firstDayOfWeek: 1,
dayNames: ["Vasárnap", "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat"],
dayNamesShort: ["Vas", "Hét", "Ke", "Sze", "Csü", "Pén", "Szo"],
dayNamesMin: ["Vas", "Hét", "Ke", "Sze", "Csü", "Pén", "Szo"],
monthNames: [ "Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December" ],
monthNamesShort: [ "Jan", "Feb", "Már", "Ápr", "Máj", "Jún","Júl", "Aug", "Szep", "Okt", "Nov", "Dec" ],
today: 'Ma',
clear: 'Törlés',
dateFormat: 'yy.mm.dd',
weekHeader: 'Wk'
}

Time does not stop spinning in Calendar

Hi!

When I click in the up/down arrow, keep holding the button and release it out of the calendar, then:

  • The spinner doesn't stop incrementing
  • The calendar popover is closed

Maybe a general issue

Methods that run after the component is destroyed fail due to non-safe access to refs ($refs?.x) (they become undefined when destroying), maybe it's worth taking a look. I had this problem with the Dropdown.vue

Reimplement TabView with Templating

I get an error when trying to import the TabView component:

You may need an additional loader to handle the result of these loaders.

This is because of the use of JSX for this component, commit is here: b3036ec

Is it a requirement we must include https://github.com/vuejs/jsx in order to build this project? Can we refactor the JSX back to Vue template format? It's not clear to me why it had to be changed.

Dependency was not found

This dependency was not found:

  • -!../../../node_modules/@vue/cli-service/node_modules/css-loader/index.js??ref--6-oneOf-3-1!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-3-2!../../components/listbox/Listbox.css in ./node_modules/@vue/cli-service/node_modules/css-loader??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??ref--6-oneOf-3-2!./src/assets/styles/primevue.css

To install it, you can run: npm install --save -!../../../node_modules/@vue/cli-service/node_modules/css-loader/index.js??ref--6-oneOf-3-1!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-3-2!../../components/listbox/Listbox.css

These relative modules were not found:

  • ./components/listbox/Listbox in ./src/main.js
  • ./views/listbox/ListboxDemo.vue in ./src/router.js

image

New Component: DataTable

Implement a DataTable with the initial features;

Static and Dynamic Columns
Templating
Single Column and Multiple Columns Sorting
Pagination
Lazy Loading for Large Datasets
Filtering
Selection
Column Toggler
Responsive
CSV Export

Listbox demo error

npm run serve is produces the following error

 ERROR  Failed to compile with 3 errors                                                                                                                                                                         9:56:15 AM

This dependency was not found:

* -!../../../node_modules/css-loader/index.js??ref--6-oneOf-3-1!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-3-2!../../components/listbox/Listbox.css in ./node_modules/css-loader??ref--6-oneOf-3-1!./
node_modules/postcss-loader/src??ref--6-oneOf-3-2!./src/assets/styles/primevue.css

To install it, you can run: npm install --save -!../../../node_modules/css-loader/index.js??ref--6-oneOf-3-1!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-3-2!../../components/listbox/Listbox.css


These relative modules were not found:

* ./components/listbox/Listbox in ./src/main.js
* ./views/listbox/ListboxDemo.vue in ./src/router.js

main.js import Listbox from './components/listbox/Listbox'; name is wrong Listbox b letter must be capital

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.