mirror of
https://github.com/tenrok/vue-cron-editor-bootstrap.git
synced 2026-06-23 20:50:33 +03:00
decrease size
This commit is contained in:
Vendored
+3
@@ -14,6 +14,9 @@
|
||||
"[jsonc]": {
|
||||
"editor.defaultFormatter": "vscode.json-language-features"
|
||||
},
|
||||
"[md]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[](https://www.npmjs.com/package/@tenrok/vue-cron-editor-bootstrap)
|
||||
[](https://github.com/tenrok/vue-cron-editor-bootstrap/blob/main/LICENSE)
|
||||
[](https://github.com/vuejs/vue)
|
||||
[](https://github.com/vuejs/vue)
|
||||
[](https://github.com/tenrok/vue-cron-editor-bootstrap)
|
||||
[](https://npmcharts.com/compare/@tenrok/vue-cron-editor-bootstrap?minimal=true)
|
||||
[](https://tenrok.github.io/vue-cron-editor-bootstrap/)
|
||||
@@ -13,36 +13,49 @@ Inspired by https://github.com/karoletrych/vue-cron-editor
|
||||
# Requirements
|
||||
|
||||
- Vue ^2.0
|
||||
- @tenrok/bootstrap-vue ^2.23.2
|
||||
- Bootstrap-Vue ^2.23.1
|
||||
|
||||
# Installation
|
||||
# Quickstart
|
||||
|
||||
Install using
|
||||
|
||||
```
|
||||
npm install @tenrok/vue-cron-editor-bootstrap --save
|
||||
```
|
||||
|
||||
# Usage
|
||||
Then, initalize the plugin in the starting point of your app (most likely src/main.js):
|
||||
|
||||
```js
|
||||
// main.js
|
||||
import { Plugin } from '@tenrok/vue-cron-editor-bootstrap'
|
||||
Vue.use(Plugin)
|
||||
```
|
||||
|
||||
The components will be registered globally and you can use them immediately.
|
||||
|
||||
You can also import individual components into .vue SFC (Single File Component):
|
||||
|
||||
```html
|
||||
<!-- Vue component (.vue) -->
|
||||
<template>
|
||||
<VueCronEditor v-model="cronExpression" />
|
||||
{{cronExpression}}
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VueCronEditor from '@tenrok/vue-cron-editor-bootstrap';
|
||||
import VueCronEditor from '@tenrok/vue-cron-editor-bootstrap'
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
VueCronEditor
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cronExpression: "*/1 * * * *"
|
||||
}
|
||||
},
|
||||
};
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
VueCronEditor,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cronExpression: '*/1 * * * *',
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
@@ -56,11 +69,8 @@ To preserve expression on switch to **advanced** tab set the `preserveStateOnSwi
|
||||
|
||||
The language of the component can be selected with the `locale` prop.
|
||||
|
||||
```
|
||||
<VueCronEditor
|
||||
v-model="expression"
|
||||
locale="pl"
|
||||
/>
|
||||
```html
|
||||
<VueCronEditor v-model="expression" locale="pl" />
|
||||
```
|
||||
|
||||
Currently supported languages:
|
||||
@@ -70,37 +80,38 @@ Currently supported languages:
|
||||
|
||||
Custom locales can be provided via a `customLocales` prop:
|
||||
|
||||
```
|
||||
<!-- prettier-ignore -->
|
||||
```html
|
||||
<VueCronEditor
|
||||
v-model="expression"
|
||||
locale="test"
|
||||
:custom-locales="{
|
||||
v-model="expression"
|
||||
locale="test"
|
||||
:custom-locales="{
|
||||
test: {
|
||||
every: "Every",
|
||||
mminutes: "minute(s)",
|
||||
hoursOnMinute: "hour(s) on minute",
|
||||
daysAt: "day(s) at",
|
||||
at: "at",
|
||||
onThe: "On the",
|
||||
dayOfEvery: "day, of every",
|
||||
monthsAt: "month(s), at",
|
||||
mon: "Mon",
|
||||
tue: "Tue",
|
||||
wed: "Wed",
|
||||
thu: "Thu",
|
||||
fri: "Fri",
|
||||
sat: "Sat",
|
||||
sun: "Sun",
|
||||
minutes: "MINUTES",
|
||||
hourly: "HOURLY",
|
||||
daily: "DAILY",
|
||||
weekly: "WEEKLY",
|
||||
monthly: "MONTHLY",
|
||||
advanced: "ADVANCED",
|
||||
cronExpression: "cron expression:",
|
||||
onlyOn: "Only on"
|
||||
every: "Every",
|
||||
mminutes: "minute(s)",
|
||||
hoursOnMinute: "hour(s) on minute",
|
||||
daysAt: "day(s) at",
|
||||
at: "at",
|
||||
onThe: "On the",
|
||||
dayOfEvery: "day, of every",
|
||||
monthsAt: "month(s), at",
|
||||
mon: "Mon",
|
||||
tue: "Tue",
|
||||
wed: "Wed",
|
||||
thu: "Thu",
|
||||
fri: "Fri",
|
||||
sat: "Sat",
|
||||
sun: "Sun",
|
||||
minutes: "MINUTES",
|
||||
hourly: "HOURLY",
|
||||
daily: "DAILY",
|
||||
weekly: "WEEKLY",
|
||||
monthly: "MONTHLY",
|
||||
advanced: "ADVANCED",
|
||||
cronExpression: "cron expression:",
|
||||
onlyOn: "Only on"
|
||||
}
|
||||
}"
|
||||
}"
|
||||
/>
|
||||
```
|
||||
|
||||
|
||||
@@ -34,17 +34,9 @@
|
||||
<div class="col d-flex align-items-center">
|
||||
<span class="mr-3">{{ translate('onlyOn') }}</span>
|
||||
|
||||
<!-- <b-form-checkbox v-model="editorData.days" value="0" class="mr-3">{{ translate('sun') }}</b-form-checkbox> -->
|
||||
<!-- <b-form-checkbox v-model="editorData.days" value="1" class="mr-3">{{ translate('mon') }}</b-form-checkbox> -->
|
||||
<!-- <b-form-checkbox v-model="editorData.days" value="2" class="mr-3">{{ translate('tue') }}</b-form-checkbox> -->
|
||||
<!-- <b-form-checkbox v-model="editorData.days" value="3" class="mr-3">{{ translate('wed') }}</b-form-checkbox> -->
|
||||
<!-- <b-form-checkbox v-model="editorData.days" value="4" class="mr-3">{{ translate('thu') }}</b-form-checkbox> -->
|
||||
<!-- <b-form-checkbox v-model="editorData.days" value="5" class="mr-3">{{ translate('fri') }}</b-form-checkbox> -->
|
||||
<!-- <b-form-checkbox v-model="editorData.days" value="6" class="mr-3">{{ translate('sat') }}</b-form-checkbox> -->
|
||||
|
||||
<div v-for="(a, idx) in uids" :key="`${a[0]}`" class="mr-3 custom-control custom-checkbox">
|
||||
<input :id="`${a[1]}`" v-model="editorData.days" type="checkbox" class="custom-control-input" :value="`${idx}`" />
|
||||
<label class="custom-control-label" :for="`${a[1]}`">{{ translate(a[0]) }}</label>
|
||||
<div v-for="(ch, idx) in checkboxes" :key="`${ch.day}`" class="mr-3 custom-control custom-checkbox">
|
||||
<input :id="`${ch.id}`" v-model="editorData.days" type="checkbox" class="custom-control-input" :value="`${idx}`" />
|
||||
<label class="custom-control-label" :for="`${ch.id}`">{{ translate(ch.day) }}</label>
|
||||
</div>
|
||||
|
||||
<span class="mr-1">{{ translate('at') }}</span>
|
||||
@@ -78,18 +70,13 @@
|
||||
|
||||
<script lang="ts">
|
||||
import VueCronEditorMixin from '../core/vueCronEditorMixin'
|
||||
import { BTabs, BTab, BFormInput, BFormTimepicker } from '@tenrok/bootstrap-vue'
|
||||
import { BTabs, BTab, BFormInput, BFormTimepicker } from 'bootstrap-vue'
|
||||
import { TabKey } from 'lib/core/cronExpressions'
|
||||
|
||||
interface Tab {
|
||||
idx: number
|
||||
key: string
|
||||
}
|
||||
|
||||
interface Data {
|
||||
activeTabIndex?: number
|
||||
tabs: Tab[]
|
||||
uids: string[][]
|
||||
tabs: { idx: number; key: string }[]
|
||||
checkboxes: { day: string; id: string }[]
|
||||
}
|
||||
|
||||
export default VueCronEditorMixin.extend({
|
||||
@@ -111,7 +98,7 @@
|
||||
{ idx: 4, key: 'monthly' },
|
||||
{ idx: 5, key: 'advanced' },
|
||||
],
|
||||
uids: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'].map(x => [x, crypto.randomUUID()]),
|
||||
checkboxes: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'].map(day => ({ day, id: crypto.randomUUID() })),
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ import VueCronEditor from './components/VueCronEditor.vue'
|
||||
|
||||
const components: { [key: string]: VueConstructor } = { VueCronEditor }
|
||||
|
||||
const VueCronEditorPlugin: PluginObject<any> = {
|
||||
const Plugin: PluginObject<any> = {
|
||||
install(Vue) {
|
||||
for (const key in components) {
|
||||
Vue.component(key, components[key])
|
||||
@@ -12,4 +12,4 @@ const VueCronEditorPlugin: PluginObject<any> = {
|
||||
}
|
||||
|
||||
export default VueCronEditor
|
||||
export { VueCronEditor, VueCronEditorPlugin }
|
||||
export { VueCronEditor, Plugin }
|
||||
|
||||
Generated
+40
-34
@@ -1,19 +1,18 @@
|
||||
{
|
||||
"name": "@tenrok/vue-cron-editor-bootstrap",
|
||||
"version": "0.2.3",
|
||||
"version": "0.3.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@tenrok/vue-cron-editor-bootstrap",
|
||||
"version": "0.2.3",
|
||||
"version": "0.3.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bootstrap": "^4.6.0",
|
||||
"core-js": "^3.33.1",
|
||||
"cron-validator": "^1.3.1",
|
||||
"cronstrue": "^2.14.0",
|
||||
"vue": "^2.7.15"
|
||||
"cronstrue": "^2.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
||||
@@ -32,7 +31,8 @@
|
||||
"vue-template-compiler": "^2.7.15"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tenrok/bootstrap-vue": "^2.23.2"
|
||||
"bootstrap-vue": "^2.23.1",
|
||||
"vue": "^2.7.15"
|
||||
}
|
||||
},
|
||||
"node_modules/@aashutoshrathi/word-wrap": {
|
||||
@@ -2323,20 +2323,6 @@
|
||||
"integrity": "sha512-T7VNNlYVM1SgQ+VsMYhnDkcGmWhQdL0bDyGm5TlQ3GBXnJscEClUUOKduWTmm2zCnvNLC1hc3JpuXjs/nFOc5w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tenrok/bootstrap-vue": {
|
||||
"version": "2.23.2",
|
||||
"resolved": "https://registry.npmjs.org/@tenrok/bootstrap-vue/-/bootstrap-vue-2.23.2.tgz",
|
||||
"integrity": "sha512-xwCgToSE+/f05wru/+fk3stjZO2dQUCeBeFyg/fDmNVPh1T7sMBm+eldRhqxIH48ZyFM/PRi2RdZUxtS+GFKfg==",
|
||||
"hasInstallScript": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@nuxt/opencollective": "^0.3.2",
|
||||
"bootstrap": "^4.6.1",
|
||||
"popper.js": "^1.16.1",
|
||||
"portal-vue": "^2.1.7",
|
||||
"vue-functional-data-merge": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@trysound/sax": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz",
|
||||
@@ -3226,6 +3212,7 @@
|
||||
"version": "2.7.15",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.15.tgz",
|
||||
"integrity": "sha512-FCvIEevPmgCgqFBH7wD+3B97y7u7oj/Wr69zADBf403Tui377bThTjBvekaZvlRr4IwUAu3M6hYZeULZFJbdYg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.18.4",
|
||||
"postcss": "^8.4.14",
|
||||
@@ -4045,6 +4032,20 @@
|
||||
"popper.js": "^1.16.1"
|
||||
}
|
||||
},
|
||||
"node_modules/bootstrap-vue": {
|
||||
"version": "2.23.1",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.23.1.tgz",
|
||||
"integrity": "sha512-SEWkG4LzmMuWjQdSYmAQk1G/oOKm37dtNfjB5kxq0YafnL2W6qUAmeDTcIZVbPiQd2OQlIkWOMPBRGySk/zGsg==",
|
||||
"hasInstallScript": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@nuxt/opencollective": "^0.3.2",
|
||||
"bootstrap": "^4.6.1",
|
||||
"popper.js": "^1.16.1",
|
||||
"portal-vue": "^2.1.7",
|
||||
"vue-functional-data-merge": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
@@ -4966,7 +4967,8 @@
|
||||
"node_modules/csstype": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
|
||||
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ=="
|
||||
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/de-indent": {
|
||||
"version": "1.0.2",
|
||||
@@ -10800,6 +10802,7 @@
|
||||
"version": "2.7.15",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-2.7.15.tgz",
|
||||
"integrity": "sha512-a29fsXd2G0KMRqIFTpRgpSbWaNBK3lpCTOLuGLEDnlHWdjB8fwl6zyYZ8xCrqkJdatwZb4mGHiEfJjnw0Q6AwQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-sfc": "2.7.15",
|
||||
"csstype": "^3.1.0"
|
||||
@@ -13248,19 +13251,6 @@
|
||||
"integrity": "sha512-T7VNNlYVM1SgQ+VsMYhnDkcGmWhQdL0bDyGm5TlQ3GBXnJscEClUUOKduWTmm2zCnvNLC1hc3JpuXjs/nFOc5w==",
|
||||
"dev": true
|
||||
},
|
||||
"@tenrok/bootstrap-vue": {
|
||||
"version": "2.23.2",
|
||||
"resolved": "https://registry.npmjs.org/@tenrok/bootstrap-vue/-/bootstrap-vue-2.23.2.tgz",
|
||||
"integrity": "sha512-xwCgToSE+/f05wru/+fk3stjZO2dQUCeBeFyg/fDmNVPh1T7sMBm+eldRhqxIH48ZyFM/PRi2RdZUxtS+GFKfg==",
|
||||
"peer": true,
|
||||
"requires": {
|
||||
"@nuxt/opencollective": "^0.3.2",
|
||||
"bootstrap": "^4.6.1",
|
||||
"popper.js": "^1.16.1",
|
||||
"portal-vue": "^2.1.7",
|
||||
"vue-functional-data-merge": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"@trysound/sax": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz",
|
||||
@@ -13942,6 +13932,7 @@
|
||||
"version": "2.7.15",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.15.tgz",
|
||||
"integrity": "sha512-FCvIEevPmgCgqFBH7wD+3B97y7u7oj/Wr69zADBf403Tui377bThTjBvekaZvlRr4IwUAu3M6hYZeULZFJbdYg==",
|
||||
"peer": true,
|
||||
"requires": {
|
||||
"@babel/parser": "^7.18.4",
|
||||
"postcss": "^8.4.14",
|
||||
@@ -14572,6 +14563,19 @@
|
||||
"integrity": "sha512-51Bbp/Uxr9aTuy6ca/8FbFloBUJZLHwnhTcnjIeRn2suQWsWzcuJhGjKDB5eppVte/8oCdOL3VuwxvZDUggwGQ==",
|
||||
"requires": {}
|
||||
},
|
||||
"bootstrap-vue": {
|
||||
"version": "2.23.1",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.23.1.tgz",
|
||||
"integrity": "sha512-SEWkG4LzmMuWjQdSYmAQk1G/oOKm37dtNfjB5kxq0YafnL2W6qUAmeDTcIZVbPiQd2OQlIkWOMPBRGySk/zGsg==",
|
||||
"peer": true,
|
||||
"requires": {
|
||||
"@nuxt/opencollective": "^0.3.2",
|
||||
"bootstrap": "^4.6.1",
|
||||
"popper.js": "^1.16.1",
|
||||
"portal-vue": "^2.1.7",
|
||||
"vue-functional-data-merge": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
@@ -15222,7 +15226,8 @@
|
||||
"csstype": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
|
||||
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ=="
|
||||
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==",
|
||||
"peer": true
|
||||
},
|
||||
"de-indent": {
|
||||
"version": "1.0.2",
|
||||
@@ -19533,6 +19538,7 @@
|
||||
"version": "2.7.15",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-2.7.15.tgz",
|
||||
"integrity": "sha512-a29fsXd2G0KMRqIFTpRgpSbWaNBK3lpCTOLuGLEDnlHWdjB8fwl6zyYZ8xCrqkJdatwZb4mGHiEfJjnw0Q6AwQ==",
|
||||
"peer": true,
|
||||
"requires": {
|
||||
"@vue/compiler-sfc": "2.7.15",
|
||||
"csstype": "^3.1.0"
|
||||
|
||||
+3
-3
@@ -34,8 +34,7 @@
|
||||
"bootstrap": "^4.6.0",
|
||||
"core-js": "^3.33.1",
|
||||
"cron-validator": "^1.3.1",
|
||||
"cronstrue": "^2.14.0",
|
||||
"vue": "^2.7.15"
|
||||
"cronstrue": "^2.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
||||
@@ -54,6 +53,7 @@
|
||||
"vue-template-compiler": "^2.7.15"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tenrok/bootstrap-vue": "^2.23.2"
|
||||
"bootstrap-vue": "^2.23.1",
|
||||
"vue": "^2.7.15"
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
|
||||
import { VueCronEditorPlugin } from '../lib'
|
||||
Vue.use(VueCronEditorPlugin)
|
||||
import { Plugin } from '../lib'
|
||||
Vue.use(Plugin)
|
||||
|
||||
import 'bootstrap/dist/css/bootstrap.css'
|
||||
import '@tenrok/bootstrap-vue/dist/bootstrap-vue.css'
|
||||
import 'bootstrap-vue/dist/bootstrap-vue.css'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
|
||||
+2
-2
@@ -11,9 +11,9 @@ module.exports = {
|
||||
chainWebpack: config => {
|
||||
if (isProduction) {
|
||||
config.externals({
|
||||
'@tenrok/bootstrap-vue': '@tenrok/bootstrap-vue',
|
||||
vue: 'vue',
|
||||
'bootstrap-vue': 'bootstrap-vue',
|
||||
})
|
||||
// config.merge({ devtool: 'source-map' })
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user