renusify 2.3.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,20 @@
1
1
  <template>
2
- <laptop v-if="!$r.breakpoint.mdAndDown">
3
- <template #search="{item}">
4
- <slot name="search" :item="item"></slot>
5
- </template>
6
- </laptop>
7
- <mobile v-else>
8
- <template #search="{item}">
9
- <slot name="search" :item="item"></slot>
10
- </template>
11
- </mobile>
2
+ <laptop v-if="!$r.breakpoint.mdAndDown">
3
+ <template #search="{item}">
4
+ <slot name="search" :item="item"></slot>
5
+ </template>
6
+ <template #logo>
7
+ <slot name="logo"></slot>
8
+ </template>
9
+ </laptop>
10
+ <mobile v-else>
11
+ <template #search="{item}">
12
+ <slot name="search" :item="item"></slot>
13
+ </template>
14
+ <template #logo>
15
+ <slot name="logo"></slot>
16
+ </template>
17
+ </mobile>
12
18
  </template>
13
19
 
14
20
  <script>
@@ -16,14 +22,14 @@ import '../scss/toolbar.scss'
16
22
  import {defineAsyncComponent} from 'vue'
17
23
 
18
24
  export default {
19
- name: 'r-toolbar',
20
- components: {
21
- Laptop: defineAsyncComponent(() =>
22
- import("./laptop.vue")
23
- ),
24
- Mobile: defineAsyncComponent(() =>
25
- import("./mobile.vue")
26
- )
27
- }
28
- }
25
+ name: 'r-toolbar',
26
+ components: {
27
+ Laptop: defineAsyncComponent(() =>
28
+ import('./laptop.vue')
29
+ ),
30
+ Mobile: defineAsyncComponent(() =>
31
+ import('./mobile.vue')
32
+ )
33
+ }
34
+ }
29
35
  </script>
@@ -1,31 +1,33 @@
1
1
  <template>
2
- <div :class="classes">
3
- <header>
4
- <r-container class="pa-0">
5
- <div class="toolbar-content">
6
- <menu-laptop :menu="menu"></menu-laptop>
7
- <r-spacer></r-spacer>
8
- <div v-if="search" class="mt-n5">
9
- <r-search-box autofocus closable :label="searchLabel" :url="search">
10
- <template v-slot="{item}">
11
- <slot name="search" :item="item"></slot>
12
- </template>
13
- </r-search-box>
14
- </div>
15
- <div v-if="logo">
16
- <r-img :src="logo" alt="logo" :width="logoW" :height="logoH"></r-img>
17
- </div>
18
- </div>
19
- </r-container>
20
- </header>
21
- </div>
2
+ <div :class="classes">
3
+ <header>
4
+ <r-container class="pa-0">
5
+ <div class="toolbar-content">
6
+ <menu-laptop :menu="menu"></menu-laptop>
7
+ <r-spacer></r-spacer>
8
+ <div v-if="search" class="mt-n5">
9
+ <r-search-box autofocus closable :label="searchLabel" :url="search">
10
+ <template v-slot="{item}">
11
+ <slot name="search" :item="item"></slot>
12
+ </template>
13
+ </r-search-box>
14
+ </div>
15
+ <slot name="logo">
16
+ <div v-if="logo">
17
+ <r-img :src="logo" alt="logo" :width="logoW" :height="logoH"></r-img>
18
+ </div>
19
+ </slot>
20
+ </div>
21
+ </r-container>
22
+ </header>
23
+ </div>
22
24
  </template>
23
25
  <script>
24
26
  import {defineAsyncComponent} from 'vue'
25
- import {toolbar} from "./mixin.js";
27
+ import {toolbar} from './mixin.js'
26
28
 
27
29
  export default {
28
- components: {MenuLaptop:defineAsyncComponent(()=>import('./menuLaptop.vue'))},
29
- mixins: [toolbar]
30
- }
31
- </script>
30
+ components: {MenuLaptop: defineAsyncComponent(() => import('./menuLaptop.vue'))},
31
+ mixins: [toolbar]
32
+ }
33
+ </script>
@@ -1,33 +1,34 @@
1
1
  <template>
2
- <div :class="classes">
3
- <header>
4
- <r-container class="pa-0">
5
- <div class="toolbar-content">
6
- <r-btn icon text @click.prevent="open=!open">
7
- <r-icon v-html="$r.icons.menu"></r-icon>
8
- </r-btn>
9
- <r-spacer></r-spacer>
10
- <div v-if="search" class="mt-n5">
11
- <r-search-box closable autofocus
12
- :label="searchLabel" :url="search">
13
- <template v-slot="{item}">
14
- <slot name="search" :item="item"></slot>
15
- </template>
16
- </r-search-box>
17
- </div>
18
- </div>
19
- </r-container>
20
- </header>
21
- <menu-mobile :menu="menu" v-model="open" :logo="logo"
22
- :logoW="logoW" :logoH="logoH"></menu-mobile>
23
- </div>
2
+ <div :class="classes">
3
+ <header>
4
+ <r-container class="pa-0">
5
+ <div class="toolbar-content">
6
+ <r-btn icon text @click.prevent="open=!open">
7
+ <r-icon v-html="$r.icons.menu"></r-icon>
8
+ </r-btn>
9
+ <r-spacer></r-spacer>
10
+ <div v-if="search" class="mt-n5">
11
+ <r-search-box closable autofocus
12
+ :label="searchLabel" :url="search">
13
+ <template v-slot="{item}">
14
+ <slot name="search" :item="item"></slot>
15
+ </template>
16
+ </r-search-box>
17
+ </div>
18
+ <slot name="logo"></slot>
19
+ </div>
20
+ </r-container>
21
+ </header>
22
+ <menu-mobile :menu="menu" v-model="open" :logo="logo"
23
+ :logoW="logoW" :logoH="logoH"></menu-mobile>
24
+ </div>
24
25
  </template>
25
26
  <script>
26
27
  import {defineAsyncComponent} from 'vue'
27
- import {toolbar} from "./mixin.js";
28
+ import {toolbar} from './mixin.js'
28
29
 
29
30
  export default {
30
- components: {MenuMobile:defineAsyncComponent(()=>import('./menuMob.vue'))},
31
- mixins:[toolbar]
32
- }
33
- </script>
31
+ components: {MenuMobile: defineAsyncComponent(() => import('./menuMob.vue'))},
32
+ mixins: [toolbar]
33
+ }
34
+ </script>
@@ -73,17 +73,20 @@
73
73
  <r-modal :model-value="tab!=='day'" @update:model-value="tab='day'">
74
74
  <div class="py-5">
75
75
  <r-calendar-year-tab v-if="tab==='year'"
76
- :model-value='currentPeriod.year'
77
- @update:model-value="(tab='month',setYear($event))"
78
- :timezoneOffset="lang_zone_offset-timezoneOffset"
79
- :locale="locale"
80
- :month="currentPeriod.month"></r-calendar-year-tab>
76
+ :model-value='currentPeriod.year'
77
+ @update:model-value="(tab='month',incrementYear($event))"
78
+ :timezoneOffset="lang_zone_offset-timezoneOffset"
79
+ :locale="locale"
80
+ :month="currentPeriod.month"
81
+ ></r-calendar-year-tab>
81
82
  <r-calendar-month-tab v-if="tab==='month'"
82
- :model-value='currentPeriod.month'
83
- @update:model-value="(tab='day',setMonth($event))"
84
- :timezoneOffset="lang_zone_offset-timezoneOffset"
85
- :locale="locale"
86
- :year="currentPeriod.year"></r-calendar-month-tab>
83
+ :model-value='currentPeriod.month'
84
+ @update:model-value="(tab='day',setMonth($event))"
85
+ :timezoneOffset="lang_zone_offset-timezoneOffset"
86
+ :locale="locale"
87
+ :month="currentPeriod.month"
88
+ :year="currentPeriod.year"
89
+ ></r-calendar-month-tab>
87
90
  </div>
88
91
  </r-modal>
89
92
  </div>
@@ -114,8 +117,8 @@ export default {
114
117
  tab: 'day',
115
118
  direction: undefined,
116
119
  currentPeriod: {
117
- month: this.month || (new Date()).getMonth(),
118
- year: this.year || (new Date()).getFullYear()
120
+ month: (new Date()).getMonth() + 1,
121
+ year: (new Date()).getFullYear()
119
122
  }
120
123
  }
121
124
  },
@@ -128,6 +131,10 @@ export default {
128
131
  'me': {
129
132
  month: 'numeric',
130
133
  numberingSystem: 'latn'
134
+ },
135
+ 'ye': {
136
+ year: 'numeric',
137
+ numberingSystem: 'latn'
131
138
  }
132
139
  })
133
140
 
@@ -148,20 +155,16 @@ export default {
148
155
  today() {
149
156
  return new Date()
150
157
  },
151
- timezoneOffset() {
152
- return (new Date(this.currentPeriod.year, this.currentPeriod.month, 10)).getTimezoneOffset()
153
- },
154
158
  weekDays() {
155
159
  const first = parseInt(this.firstDayOfWeek, 10)
156
160
 
157
- return this.createRange(7).map(i => this.$d(new Date(2020, 2, first + i + 2, 0, this.timezoneOffset, 0), 'weekday', this.locale)) // 2017-02-02 is Sunday
161
+ return this.createRange(7).map(i => this.$d(new Date(2025, 2, first + i + 23, 0, this.lang_zone_offset - this.timezoneOffset, 0), 'narrow', this.locale)) // 2017-02-02 is Sunday
158
162
  },
159
163
  rangeLocalDate() {
160
164
  const {year, month} = this.currentPeriod
161
165
  let firstDay = 1
162
166
  let firstmonth = month
163
167
  let firstyear = year
164
-
165
168
  let first = new Date(firstyear, firstmonth, firstDay, 0, this.lang_zone_offset - this.timezoneOffset, 0)
166
169
  let lc = parseInt(this.$d(first, 'de', this.locale))
167
170
  first = new Date(firstyear, firstmonth, firstDay - lc + 1, 0, this.lang_zone_offset - this.timezoneOffset, 0)
@@ -178,7 +181,7 @@ export default {
178
181
  weekDaysBeforeFirstDayOfTheMonth() {
179
182
  const {start} = this.rangeLocalDate
180
183
  const weekDay = start.getDay()
181
- return (weekDay - this.firstDayOfWeek + 7) % 7
184
+ return (weekDay - parseInt(this.firstDayOfWeek) + 7) % 7
182
185
  },
183
186
  currentPeriodDates() {
184
187
  const {start, end} = this.rangeLocalDate
@@ -235,15 +238,11 @@ export default {
235
238
 
236
239
  return children
237
240
  },
241
+ timezoneOffset() {
242
+ return (new Date(this.currentPeriod.year, this.currentPeriod.month, 10)).getTimezoneOffset()
243
+ },
238
244
  lang_zone_offset() {
239
- let offset = this.$helper.ifHas(this.$dateTime.langs, 0, this.locale, 'time_zone_offset')
240
- let dst = this.$helper.ifHas(this.$dateTime.langs, false, this.locale, 'daylight_saving_time')
241
-
242
- const m = this.$d(new Date(this.currentPeriod.year, this.currentPeriod.month, 10), 'me', this.locale)
243
- if (parseInt(m) < 7 && dst) {
244
- offset += 60
245
- }
246
- return offset * -1
245
+ return this.$helper.ifHas(this.$dateTime.langs, 0, this.locale, 'time_zone_offset') * -1
247
246
  }
248
247
  },
249
248
  watch: {
@@ -287,13 +286,6 @@ export default {
287
286
  year: incrementDate.getFullYear()
288
287
  }
289
288
  },
290
- setYear(increment) {
291
- const incrementDate = new Date(increment, this.currentPeriod.month)
292
- this.currentPeriod = {
293
- month: incrementDate.getMonth(),
294
- year: incrementDate.getFullYear()
295
- }
296
- },
297
289
  selectDateItem(item) {
298
290
  if (!item.disabled) {
299
291
  this.$emit('select', item.date.toISOString())
@@ -1,13 +1,13 @@
1
1
  <template>
2
- <div class="d-flex flex-wrap">
3
- <r-btn v-for="i in 12"
2
+ <div class="d-flex flex-wrap h-space-around">
3
+ <r-btn v-for="i in ls"
4
4
  :key="i"
5
5
  outlined
6
- class="w-30 ma-2"
7
- :class="{'color-one-text':i+p===modelValue}"
8
- @click.prevent="emit(i+p)">
6
+ class="w-25 ma-1"
7
+ :class="{'color-one':i===modelValue}"
8
+ @click.prevent="emit(i)">
9
9
  {{
10
- $d(new Date(year, i + p, 1, 0, timezoneOffset), 'month', locale)
10
+ $d(new Date(year, i, 1, 0, timezoneOffset), 'month', locale)
11
11
  }}
12
12
  </r-btn>
13
13
  </div>
@@ -19,19 +19,44 @@ export default {
19
19
  modelValue: Number,
20
20
  timezoneOffset: Number,
21
21
  locale: String,
22
+ month: Number,
22
23
  year: Number
23
24
  },
24
25
  emits: ['update:modelValue'],
25
26
  data() {
26
27
  return {
27
- p: 0
28
+ ls: []
28
29
  }
29
30
  },
30
31
  beforeMount() {
31
- const c = this.$d(new Date(this.year, 1, 1, 0, this.timezoneOffset), 'me', this.locale)
32
- if (c > 1) {
33
- this.p = (13 - c)
32
+ const year = this.$d(new Date(this.year, this.month, 5, 0, this.timezoneOffset), 'ye', this.locale)
33
+ let ls = []
34
+ let first = 0
35
+ let n = 0
36
+ while (true) {
37
+ n++
38
+ if (n > 100) {
39
+ break
40
+ }
41
+ const y = this.$d(new Date(this.year, first, 5, 0, this.timezoneOffset), 'ye', this.locale)
42
+ const m = parseInt(this.$d(new Date(this.year, first, 5, 0, this.timezoneOffset), 'me', this.locale))
43
+ if (y === year && m === 1) {
44
+ break
45
+ }
46
+ if (y > year) {
47
+ first--
48
+ } else if (y < year) {
49
+ first++
50
+ } else if (m > 1) {
51
+ first--
52
+ } else {
53
+ first++
54
+ }
34
55
  }
56
+ for (let i = 0; i < 12; i++) {
57
+ ls.push(first + i)
58
+ }
59
+ this.ls = ls
35
60
  },
36
61
  methods: {
37
62
  emit(n) {
@@ -1,13 +1,13 @@
1
1
  <template>
2
- <div class="d-flex flex-wrap">
3
- <r-btn v-for="i in 12"
2
+ <div class="calendar-year-tab d-flex flex-wrap h-space-around">
3
+ <r-btn v-for="i in 200"
4
4
  :key="i"
5
- class="w-30 ma-2"
6
- :class="{'color-one-text':modelValue+i-6===modelValue}"
5
+ class="w-25 ma-1"
6
+ :class="{'color-one year-select':modelValue+i-100===modelValue}"
7
7
  outlined
8
- @click.prevent="emit(modelValue+i-6)">
8
+ @click.prevent="emit(modelValue+i-100)">
9
9
  {{
10
- $d(new Date(modelValue + i - 6, month, 1, 0, timezoneOffset), 'year', locale)
10
+ $d(new Date(modelValue + i - 100, month, 5, 0, timezoneOffset), 'year', locale)
11
11
  }}
12
12
  </r-btn>
13
13
  </div>
@@ -22,10 +22,21 @@ export default {
22
22
  month: Number
23
23
  },
24
24
  emits: ['update:modelValue'],
25
+ mounted() {
26
+ let el = document.querySelector('.year-select')
27
+ if (el) {
28
+ el.scrollIntoView(true)
29
+ }
30
+ },
25
31
  methods: {
26
32
  emit(n) {
27
- this.$emit('update:modelValue', n)
33
+ this.$emit('update:modelValue', n - this.modelValue)
28
34
  }
29
35
  }
30
36
  }
31
- </script>
37
+ </script>
38
+ <style>
39
+ .calendar-year-tab {
40
+ max-height: 300px;
41
+ }
42
+ </style>
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <component v-bind="att"
3
- :is="isClickable?route.tag:'div'"
4
- v-ripple="isClickable&&isRipple">
5
- <slot></slot>
6
- </component>
2
+ <component v-bind="att"
3
+ :is="isClickable?route.tag:'div'"
4
+ v-ripple="isClickable&&isRipple">
5
+ <slot></slot>
6
+ </component>
7
7
  </template>
8
8
 
9
9
  <script>
@@ -21,50 +21,50 @@ export default {
21
21
  isRipple: {
22
22
  type: Boolean,
23
23
  default: true
24
- },
25
- draggable:{
26
- type:Boolean,
27
- default:false
28
- }
29
- },
30
- computed: {
31
- att(){
32
- let res={'class':this.genClass}
33
- if(this.href){
34
- res['href']=this.route.data.attrs.href
35
- }
24
+ },
25
+ draggable: {
26
+ type: Boolean,
27
+ default: false
28
+ }
29
+ },
30
+ computed: {
31
+ att() {
32
+ let res = {'class': this.genClass}
33
+ if (this.href) {
34
+ res['href'] = this.route.data.attrs.href
35
+ }
36
36
 
37
- if(this.target){
38
- res['rel']='noreferrer'
39
- res['target']=this.route.data.attrs.target
40
- }
41
- if(this.to){
42
- res['to']=this.route.data.props.to
43
- }
44
- return res
45
- },
46
- genClass() {
47
- let c = this.$r.prefix+'card';
48
- if (this.flat) {
49
- c += ' card-flat';
50
- }else{
51
- c += ' card-sheet';
52
- }
53
- if (this.hover) {
54
- c += ' card-hover';
55
- }
56
- if (this.outlined) {
57
- c += ' card-outlined';
58
- }
59
- if (this.tile) {
60
- c += ' card-tile';
61
- }
62
- if (this.isClickable) {
63
- c += ' card-link';
64
- }
65
- return c;
66
- },
67
- },
37
+ if (this.target) {
38
+ res['rel'] = 'noreferrer'
39
+ res['target'] = this.route.data.attrs.target
40
+ }
41
+ if (this.to) {
42
+ res['to'] = this.route.data.props.to
43
+ }
44
+ return res
45
+ },
46
+ genClass() {
47
+ let c = this.$r.prefix + 'card';
48
+ if (this.flat) {
49
+ c += ' card-flat';
50
+ } else {
51
+ c += ' card-sheet';
52
+ }
53
+ if (this.hover) {
54
+ c += ' card-hover';
55
+ }
56
+ if (this.outlined) {
57
+ c += ' card-outlined';
58
+ }
59
+ if (this.tile) {
60
+ c += ' card-tile';
61
+ }
62
+ if (this.isClickable) {
63
+ c += ' card-link';
64
+ }
65
+ return c;
66
+ },
67
+ },
68
68
 
69
- };
69
+ };
70
70
  </script>
@@ -8,55 +8,43 @@
8
8
  spellcheck="false"
9
9
  @keydown="setTab"
10
10
  ></textarea>
11
- <div class="text-preview" v-html="build"></div>
11
+ <div class="text-preview" v-html="code"></div>
12
12
  </div>
13
13
  </template>
14
14
 
15
15
  <script>
16
16
  import mixin from './mixin.js'
17
+ import mixin_h from '../highlight/mixin.js'
17
18
 
18
19
  export default {
19
20
  name: "highlight-css",
20
21
  props: {
21
22
  modelValue: String,
22
23
  },
23
- mixins: [mixin],
24
+ mixins: [mixin, mixin_h],
24
25
  data() {
25
26
  return {
26
27
  d: this.modelValue,
27
- runnable: false,
28
28
  code: "",
29
29
  };
30
30
  },
31
+ async created() {
32
+ if (this.modelValue) {
33
+ await this.build_code()
34
+ }
35
+ },
31
36
  watch: {
32
37
  modelValue: function () {
33
38
  this.d = this.modelValue;
34
39
  },
35
- d: function () {
40
+ d: async function () {
41
+ await this.build_code()
36
42
  this.$emit("update:modelValue", this.d);
37
43
  },
38
44
  },
39
- computed: {
40
- build() {
41
- if (!this.d) {
42
- return "";
43
- }
44
- let res = this.d
45
- res = this.re_quote(res);
46
- res = this.re_func(res);
47
- res = this.re_class(res);
48
- res = this.re_id(res);
49
- res = this.re_comment(res);
50
- res = this.re_special(res, /([{};,:])/g, 'color-func2');
51
- return res;
52
- },
53
- },
54
45
  methods: {
55
- re_class(res) {
56
- return res = res.replace(/(\.+[_a-zA-Z0-9-:#{}$].*)\{/g, '<span class="color-func2 code-editor-span">$1</span>{')
57
- },
58
- re_id(res) {
59
- return res = res.replace(/(#+[_a-zA-Z0-9-:#{}$].*)\{/g, '<span class="color-func2 code-editor-span">$1</span>{')
46
+ async build_code() {
47
+ this.code = await this.highlight(this.d, "css", true)
60
48
  }
61
49
  },
62
50
  };
@@ -8,55 +8,44 @@
8
8
  spellcheck="false"
9
9
  @keydown="setKey"
10
10
  ></textarea>
11
- <div class="text-preview" v-html="build"></div>
11
+ <div class="text-preview" v-html="code"></div>
12
12
  </div>
13
13
  </template>
14
14
 
15
15
  <script>
16
16
  import mixin from './mixin.js'
17
+ import mixin_h from '../highlight/mixin.js'
17
18
 
18
19
  export default {
19
20
  name: "highlight-html",
20
21
  props: {
21
22
  modelValue: String,
22
23
  },
23
- mixins: [mixin],
24
+ mixins: [mixin, mixin_h],
24
25
  data() {
25
26
  return {
26
27
  d: this.modelValue,
27
- runnable: false,
28
- code: "",
29
- openTag: null
28
+ code: ""
30
29
  };
31
30
  },
31
+ async created() {
32
+ if (this.modelValue) {
33
+ await this.build_code()
34
+ }
35
+ },
32
36
  watch: {
33
37
  modelValue: function () {
34
38
  this.d = this.modelValue;
35
39
  },
36
- d: function () {
40
+ d: async function () {
41
+ await this.build_code()
37
42
  this.$emit("update:modelValue", this.d);
38
43
  },
39
44
  },
40
- computed: {
41
- build() {
42
- if (!this.d) {
43
- return "";
44
- }
45
- let data = this.d;
46
- data = this.$helper.replacer(data, "<", "&lt;");
47
- data = this.$helper.replacer(data, ">", "&gt;");
48
- let res = data;
49
- res = this.re_quote(res)
50
-
51
- res = this.re_comment(res);
52
- res = this.re_func(res);
53
-
54
- res = res.replace(/(&lt;+[\s\S]+&gt;)/g, '<span class="color-orange code-editor-span">$1</span>')
55
- res = res.replace(/\{\{([^}]+)}}/g, '<span class="color-blue code-editor-span">{{$1}}</span>')
56
- return res;
57
- },
58
- },
59
45
  methods: {
46
+ async build_code() {
47
+ this.code = await this.highlight(this.d, "html", true)
48
+ },
60
49
  setKey(event) {
61
50
  if (event.key === "<") {
62
51
  this.openTag = event.target.selectionEnd
@@ -82,10 +71,6 @@ export default {
82
71
  return false;
83
72
  }
84
73
  return this.setTab(event)
85
- },
86
- re_comment(res) {
87
- let regex = /(&lt;!--+[\s\S]+--&gt;)/g;
88
- return res.replace(regex, '<span class="color-comment code-editor-span">$1</span>')
89
74
  }
90
75
  },
91
76
  };