Skip to content

Commit ca8e9be

Browse files
committed
feat(docs): upgrade to vuepress@next
1 parent b4f3a6d commit ca8e9be

29 files changed

+1066
-4342
lines changed

docs/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
},
1616
"license": "MIT",
1717
"devDependencies": {
18-
"vuepress": "^1.8.2"
18+
"@vuepress/plugin-register-components": "^2.0.0-beta.49",
19+
"vuepress": "^2.0.0-beta.49"
1920
},
2021
"dependencies": {
21-
"@vue-js-cron/core": "2.0.0",
22+
"@vue-js-cron/core": "^2.0.0",
2223
"@vue-js-cron/light": "^1.0.1",
23-
"@vue-js-cron/vuetify": "2.0.0"
24+
"@vue-js-cron/vuetify": "^2.0.0",
25+
"vuetify": "^3.0.0-beta.7"
2426
}
2527
}

docs/src/.vuepress/client.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import CronCore from '@vue-js-cron/core'
2+
import CronLight from '@vue-js-cron/light'
3+
import '@vue-js-cron/light/dist/light.css'
4+
import CronVuetify from '@vue-js-cron/vuetify'
5+
import '@vue-js-cron/vuetify/dist/vuetify.css'
6+
7+
import { createVuetify } from 'vuetify'
8+
import * as components from 'vuetify/components'
9+
import 'vuetify/styles'
10+
11+
import { defineClientConfig } from '@vuepress/client'
12+
13+
import { variables } from './vars'
14+
15+
const vuetify = createVuetify({
16+
components
17+
})
18+
19+
export default defineClientConfig({
20+
enhance({ app, router, siteData }){
21+
app.use(vuetify)
22+
app.use(CronCore)
23+
app.use(CronVuetify)
24+
app.use(CronLight)
25+
26+
app.mixin({
27+
computed: {
28+
$vars() {
29+
return variables
30+
}
31+
}
32+
})
33+
},
34+
setup(){},
35+
rootComponents: [],
36+
})
37+
38+
// export default ({
39+
// Vue, // the version of Vue being used in the VuePress app
40+
// options, // the options for the root Vue instance
41+
// router, // the router instance for the app
42+
// siteData // site metadata
43+
// }) => {
44+
// Vue.use(Vuetify)
45+
// options.vuetify = new Vuetify({})
46+
// Vue.use(CronCore)
47+
// Vue.use(CronVuetify)
48+
// Vue.use(CronLight)
49+
// }

docs/src/.vuepress/components/api/core-events.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default {
1818
{ name: 'Description', value: 'desc' }
1919
],
2020
items: [
21-
{ name: 'input', desc: 'emitted when the cron expression changed' },
21+
{ name: 'update:model-value', desc: 'emitted when the cron expression changed' },
2222
{ name: 'error', desc: 'emitted when the cron expression is invalid' },
2323
...this.appendItems
2424
]

docs/src/.vuepress/components/api/core-props.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default {
2626
{ name: 'Description', value: 'desc' }
2727
],
2828
items: [
29-
{ name: 'value', type: '`string`', default: '`"* * * * *"`', desc: 'the current cron expression' },
29+
{ name: 'model-value', type: '`string`', default: '`"* * * * *"`', desc: 'the current cron expression' },
3030
{ name: 'fields', type: '`Field[]`', default: '...', desc: 'each field defines on position of the cron expression' },
3131
{ name: 'periods', type: '`Period[]`', default: '...', desc: 'the `value` porperty of a period determines which fields are visible' },
3232
{ name: 'locale', type: '`string`', default: '`"en"`', desc: '' },

docs/src/.vuepress/components/code-example.vue

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
2-
<v-app>
2+
<div>
33

4-
<v-card class="code-example">
5-
<v-toolbar dense class="elevation-1">
6-
<v-toolbar-title v-if="title">{{title}}</v-toolbar-title>
4+
5+
<v-toolbar dense class="elevation-0 bg-transparent">
6+
<v-toolbar-title class="pa-0 ma-0" v-if="title">{{title}}</v-toolbar-title>
77

88
<v-spacer></v-spacer>
99

@@ -24,17 +24,14 @@
2424
</div>
2525
</v-expand-transition>
2626

27-
<v-card-text>
27+
<div>
2828
<slot></slot>
29-
</v-card-text>
30-
</v-card>
29+
</div>
30+
3131

32-
<v-card-text>
33-
34-
</v-card-text>
3532
<slot name="code"></slot>
3633

37-
</v-app>
34+
</div>
3835
</template>
3936

4037
<script>
@@ -55,7 +52,8 @@ export default {
5552

5653
<style>
5754
.code-example pre {
58-
margin: 0 !important;
55+
margin-top: 0 !important;
56+
margin-bottom: 0 !important;
5957
}
6058
.code-example .source {
6159
margin: 0.2em;

docs/src/.vuepress/components/custom-fields.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
<template>
2-
<v-app>
2+
<div>
33
<div class="mb-2">{{value}}</div>
4-
<CronLight v-model="value" :periods="periods" :fields="fields" @error="error=$event" :custom-locale="customLocale"></CronLight>
5-
</v-app>
4+
<CronLight
5+
v-model="value"
6+
:periods="periods"
7+
:fields="fields"
8+
@error="error=$event"
9+
:custom-locale="customLocale" />
10+
</div>
611
</template>
712

813
<script>

docs/src/.vuepress/components/custom-periods.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<template>
2-
<v-app>
3-
2+
<div>
43
<div class="mb-2">{{value}}</div>
54
<CronLight v-model="value" :periods="periods" @error="error=$event"></CronLight>
6-
7-
</v-app>
5+
</div>
86
</template>
97

108
<script>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
<template>
3+
4+
</template>
5+
6+
<script>
7+
export default {
8+
data () {
9+
return {
10+
value: '* * * * *'
11+
}
12+
},
13+
methods: {
14+
15+
}
16+
}
17+
</script>

docs/src/.vuepress/components/getting-started-light.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<template>
2-
<div class="getting-started-light">
2+
<div class="pt-2">
3+
34
<CronLight v-model="value" @error="error=$event"></CronLight>
4-
<div class="mt-2 grey--text text--darken-1">cron expression: {{value}}</div>
5+
<div class="text-lightest pt-2">cron expression: {{value}}</div>
6+
57
</div>
68
</template>
79

docs/src/.vuepress/components/getting-started-renderless.vue

Lines changed: 45 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,66 @@
11
<template>
2-
<v-app>
3-
<CronCore v-model="value">
4-
<template #default="{fields, period, error}">
5-
<div>
2+
<div>
3+
<CronCore v-model="value" v-slot="{fields, period, error}">
4+
<div>
65

7-
<v-row align="baseline" dense>
6+
<!-- period selection -->
7+
{{period.prefix}}
8+
<v-chip>
9+
{{period.attrs.modelValue}}
10+
<v-menu activator="parent">
11+
<v-list>
12+
<v-list-item v-for="item in period.items" :key="item.id" @click="period.events['update:model-value'](item.id)">
13+
{{item.text}}
14+
</v-list-item>
15+
</v-list>
16+
</v-menu>
17+
</v-chip>
18+
{{period.suffix}}
819

9-
<!-- period selection -->
10-
<v-col v-if="period.prefix" class="flex-grow-0">{{period.prefix}}</v-col>
11-
<v-col cols="auto">
12-
<v-select class="fit" v-bind="period.attrs" :items="period.items" @input="period.events.input" item-value="id" dense :menu-props="{'offset-y': true}"></v-select>
13-
</v-col>
14-
<v-col v-if="period.suffix" class="flex-grow-0">{{period.suffix}}</v-col>
1520

16-
<!-- cron expression fields -->
17-
<template v-for="f in fields">
18-
<v-col v-if="f.prefix" class="flex-grow-0" :key="f.id+'-prefix'">{{f.prefix}}</v-col>
19-
20-
<!-- custom select -->
21-
<v-menu offset-y :key="f.id" :close-on-content-click="false" max-height="300">
22-
23-
<!-- menu activator -->
24-
<template v-slot:activator="{ on, attrs }">
25-
<v-col v-on="on" v-bind="attrs">
26-
<v-text-field :value="f.selectedStr" dense readonly></v-text-field>
27-
</v-col>
28-
</template>
21+
<!-- cron expression fields -->
22+
<template v-for="f in fields" :key="f.id">
23+
{{f.prefix}}
24+
25+
<v-chip>
26+
{{f.selectedStr}}
27+
<v-menu activator="parent" :close-on-content-click="false">
2928

3029
<!-- list of field items -->
31-
<v-list dense>
32-
<v-list-item-group v-bind="f.attrs" @change="f.events.input" multiple>
33-
<v-list-item v-for="item in f.items" :value="item.value" :key="item.value">
34-
<v-list-item-content>
35-
<v-list-item-title v-text="item.text"></v-list-item-title>
36-
</v-list-item-content>
37-
</v-list-item>
38-
</v-list-item-group>
30+
<v-list :selected="f.attrs.modelValue" @update:selected="f.events['update:model-value']" select-strategy="multiple">
31+
<v-list-item v-for="item in f.items" :value="item.value" :key="item.value">
32+
{{item.text}}
33+
</v-list-item>
3934
</v-list>
4035

4136
</v-menu>
37+
</v-chip>
38+
{{f.suffix}}
39+
</template>
4240

43-
<v-col v-if="f.suffix" class="flex-grow-0" :key="f.id+'-suffix'">{{f.suffix}}</v-col>
44-
</template>
45-
46-
</v-row>
41+
<!-- editable cron expression -->
42+
<v-text-field
43+
class="mt-4"
44+
:modelValue="value"
45+
@update:model-value="nextValue = $event"
46+
@blur="value = nextValue"
47+
label="cron expression"
48+
:error-messages="error" />
4749

48-
<!-- editable cron expression -->
49-
<v-row class="mt-0">
50-
<v-col class="pt-0">
51-
<v-text-field :value="value" @change="value = $event" label="cron expression" :error-messages="error" />
52-
</v-col>
53-
</v-row>
54-
55-
</div>
56-
</template>
50+
</div>
5751
</CronCore>
58-
</v-app>
52+
</div>
5953
</template>
6054

6155
<script>
6256
export default {
6357
data () {
58+
59+
const value = '* * * * *'
60+
6461
return {
65-
value: '* * * * *'
62+
value,
63+
nextValue: value
6664
}
6765
},
6866
methods: {

docs/src/.vuepress/components/getting-started-vuetify.vue

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
<template>
2-
<v-app>
2+
<div>
33

44
<CronVuetify v-model="value" @error="error=$event"></CronVuetify>
5-
5+
66
<!-- editable cron expression -->
7-
<v-row class="mt-0">
8-
<v-col class="pt-0">
9-
<v-text-field :value="value" @change="value = $event" label="cron expression" :error-messages="error" />
10-
</v-col>
11-
</v-row>
7+
<v-text-field
8+
class="pt-3"
9+
:modelValue="value"
10+
@update:model-value="nextValue = $event"
11+
@blur="value = nextValue"
12+
label="cron expression"
13+
:error-messages="error" />
1214

13-
</v-app>
15+
</div>
1416
</template>
1517

1618
<script>
@@ -26,6 +28,7 @@ export default {
2628
data () {
2729
return {
2830
value: this.init,
31+
nextValue: this.init,
2932
error: ''
3033
}
3134
},

docs/src/.vuepress/components/md-table.vue

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44
<th v-for="header in headers" :key="header.value">{{header.name}}</th>
55
</tr>
66
<tr v-for="item, i in items" :key="i">
7-
<template v-for="header, j in headers">
8-
<td :key="j">
9-
<slot :name="'r'+i+'c'+j">
10-
<span v-html="renderMd(item[header.value])" />
11-
</slot>
12-
</td>
13-
</template>
14-
7+
<td v-for="header, j in headers" :key="j">
8+
<slot :name="'r'+i+'c'+j">
9+
<span v-html="renderMd(item[header.value])" />
10+
</slot>
11+
</td>
1512
</tr>
1613
</table>
1714
</template>

0 commit comments

Comments
 (0)