mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 08:52:34 +00:00
Merged new Docs and Demos
This commit is contained in:
parent
296cc217fb
commit
dfcc8ef4e7
1235 changed files with 130757 additions and 122640 deletions
20
doc/progressbar/AccessibilityDoc.vue
Normal file
20
doc/progressbar/AccessibilityDoc.vue
Normal file
|
@ -0,0 +1,20 @@
|
|||
<template>
|
||||
<DocSectionText id="accessibility" label="Accessibility" v-bind="$attrs">
|
||||
<h3>Screen Reader</h3>
|
||||
<p>
|
||||
ProgressBar components uses <i>progressbar</i> role along with <i>aria-valuemin</i>, <i>aria-valuemax</i> and <i>aria-valuenow</i> attributes. Value to describe the component can be defined using <i>aria-labelledby</i> and
|
||||
<i>aria-label</i> props.
|
||||
</p>
|
||||
|
||||
<pre v-code><code>
|
||||
<span id="label_status /">
|
||||
<ProgressBar aria-labelledby="label_status /">
|
||||
|
||||
<ProgressBar aria-label="Status /">
|
||||
|
||||
</code></pre>
|
||||
|
||||
<h3>Keyboard Support</h3>
|
||||
<p>Not applicable.</p>
|
||||
</DocSectionText>
|
||||
</template>
|
42
doc/progressbar/BasicDoc.vue
Normal file
42
doc/progressbar/BasicDoc.vue
Normal file
|
@ -0,0 +1,42 @@
|
|||
<template>
|
||||
<DocSectionText v-bind="$attrs">
|
||||
<p>ProgressBar is used with the <i>value</i> property.</p>
|
||||
</DocSectionText>
|
||||
<div class="card">
|
||||
<ProgressBar :value="50"></ProgressBar>
|
||||
</div>
|
||||
<DocSectionCode :code="code" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
code: {
|
||||
basic: `
|
||||
<ProgressBar :value="50"></ProgressBar>`,
|
||||
options: `
|
||||
<template>
|
||||
<div class="card">
|
||||
<ProgressBar :value="50"></ProgressBar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script >
|
||||
|
||||
<\/script>`,
|
||||
composition: `
|
||||
<template>
|
||||
<div class="card">
|
||||
<ProgressBar :value="50"></ProgressBar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
<\/script>`
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
129
doc/progressbar/DynamicDoc.vue
Normal file
129
doc/progressbar/DynamicDoc.vue
Normal file
|
@ -0,0 +1,129 @@
|
|||
<template>
|
||||
<DocSectionText v-bind="$attrs">
|
||||
<p>Value is reactive so updating it dynamically changes the bar as well.</p>
|
||||
</DocSectionText>
|
||||
<div class="card">
|
||||
<ProgressBar :value="value"></ProgressBar>
|
||||
</div>
|
||||
<DocSectionCode :code="code" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: 0,
|
||||
interval: null,
|
||||
code: {
|
||||
basic: `
|
||||
<ProgressBar :value="value"></ProgressBar>`,
|
||||
options: `
|
||||
<template>
|
||||
<div class="card">
|
||||
<Toast></Toast>
|
||||
<ProgressBar :value="value1" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value1: 0,
|
||||
interval: null
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.startProgress();
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.endProgress();
|
||||
},
|
||||
methods: {
|
||||
startProgress() {
|
||||
this.interval = setInterval(() => {
|
||||
let newValue = this.value1 + Math.floor(Math.random() * 10) + 1;
|
||||
|
||||
if (newValue >= 100) {
|
||||
newValue = 100;
|
||||
this.$toast.add({ severity: 'info', summary: 'Success', detail: 'Process Completed', life: 1000 });
|
||||
}
|
||||
|
||||
this.value1 = newValue;
|
||||
}, 2000);
|
||||
},
|
||||
endProgress() {
|
||||
clearInterval(this.interval);
|
||||
this.interval = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
<\/script>`,
|
||||
composition: `
|
||||
<template>
|
||||
<div class="card">
|
||||
<Toast></Toast>
|
||||
<ProgressBar :value="value1" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onBeforeUnmount } from "vue";
|
||||
import { useToast } from "primevue/usetoast";
|
||||
|
||||
onMounted(() => {
|
||||
startProgress();
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
endProgress();
|
||||
});
|
||||
|
||||
const toast = useToast();
|
||||
const value1 = ref(0);
|
||||
const interval = ref();
|
||||
const startProgress = () => {
|
||||
interval.value = setInterval(() => {
|
||||
let newValue = value1.value + Math.floor(Math.random() * 10) + 1;
|
||||
if (newValue >= 100) {
|
||||
newValue = 100;
|
||||
toast.add({ severity: 'info', summary: 'Success', detail: 'Process Completed', life: 1000 });
|
||||
}
|
||||
value1.value = newValue;
|
||||
}, 2000);
|
||||
};
|
||||
const endProgress = () => {
|
||||
clearInterval(interval.value);
|
||||
interval.value = null;
|
||||
};
|
||||
<\/script>`
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.startProgress();
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.endProgress();
|
||||
},
|
||||
methods: {
|
||||
startProgress() {
|
||||
this.interval = setInterval(() => {
|
||||
let newValue = this.value + Math.floor(Math.random() * 10) + 1;
|
||||
|
||||
if (newValue >= 100) {
|
||||
newValue = 100;
|
||||
this.$toast.add({ severity: 'info', summary: 'Success', detail: 'Process Completed', life: 1000 });
|
||||
this.endProgress();
|
||||
}
|
||||
|
||||
this.value = newValue;
|
||||
}, 2000);
|
||||
},
|
||||
endProgress() {
|
||||
clearInterval(this.interval);
|
||||
this.interval = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
16
doc/progressbar/ImportDoc.vue
Normal file
16
doc/progressbar/ImportDoc.vue
Normal file
|
@ -0,0 +1,16 @@
|
|||
<template>
|
||||
<DocSectionText v-bind="$attrs" />
|
||||
<DocSectionCode :code="code" hideToggleCode import hideCodeSandbox hideStackBlitz />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
code: {
|
||||
basic: `import ProgressBar from 'primevue/progressbar';`
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
42
doc/progressbar/IndeterminateDoc.vue
Normal file
42
doc/progressbar/IndeterminateDoc.vue
Normal file
|
@ -0,0 +1,42 @@
|
|||
<template>
|
||||
<DocSectionText v-bind="$attrs">
|
||||
<p>For progresses with no value to track, set the <i>mode</i> property to <i>indeterminate</i>.</p>
|
||||
</DocSectionText>
|
||||
<div class="card">
|
||||
<ProgressBar mode="indeterminate" style="height: 6px"></ProgressBar>
|
||||
</div>
|
||||
<DocSectionCode :code="code" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
code: {
|
||||
basic: `
|
||||
<ProgressBar mode="indeterminate" style="height: 6px"></ProgressBar>`,
|
||||
options: `
|
||||
<template>
|
||||
<div class="card">
|
||||
<ProgressBar mode="indeterminate" style="height: 6px"></ProgressBar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
<\/script>`,
|
||||
composition: `
|
||||
<template>
|
||||
<div class="card">
|
||||
<ProgressBar mode="indeterminate" style="height: 6px"></ProgressBar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
<\/script>`
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
37
doc/progressbar/StyleDoc.vue
Normal file
37
doc/progressbar/StyleDoc.vue
Normal file
|
@ -0,0 +1,37 @@
|
|||
<template>
|
||||
<DocSectionText id="style" label="Style" v-bind="$attrs">
|
||||
<p>Following is the list of structural style classes, for theming classes visit <NuxtLink to="/theming"> theming</NuxtLink> page.</p>
|
||||
</DocSectionText>
|
||||
<div class="doc-tablewrapper">
|
||||
<table class="doc-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Element</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>p-progressbar</td>
|
||||
<td>Container element.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p-progressbar-determinate</td>
|
||||
<td>Container element of a determinate progressbar.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p-progressbar-indeterminate</td>
|
||||
<td>Container element of an indeterminate progressbar.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p-progressbar-value</td>
|
||||
<td>Element whose width changes according to value.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p-progressbar-label</td>
|
||||
<td>Label element that displays the current value.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</template>
|
51
doc/progressbar/TemplateDoc.vue
Normal file
51
doc/progressbar/TemplateDoc.vue
Normal file
|
@ -0,0 +1,51 @@
|
|||
<template>
|
||||
<DocSectionText v-bind="$attrs">
|
||||
<p>Custom content inside the ProgressBar is defined with the <i>default</i> slot.</p>
|
||||
</DocSectionText>
|
||||
<div class="card">
|
||||
<ProgressBar :value="value"> {{ value }}/100 </ProgressBar>
|
||||
</div>
|
||||
<DocSectionCode :code="code" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: 40,
|
||||
code: {
|
||||
basic: `
|
||||
<ProgressBar :value="40"> {{ value }}/100 </ProgressBar>`,
|
||||
options: `
|
||||
<template>
|
||||
<div class="card">
|
||||
<ProgressBar :value="40"> {{ value }}/100 </ProgressBar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: 40
|
||||
}
|
||||
}
|
||||
}
|
||||
<\/script>`,
|
||||
composition: `
|
||||
<template>
|
||||
<div class="card">
|
||||
<ProgressBar :value="40"> {{ value }}/100 </ProgressBar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
const value = ref(40);
|
||||
<\/script>`
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue