renusify 3.0.1 → 3.0.2

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.
@@ -180,7 +180,7 @@ const saveImage = () => {
180
180
  overflow: hidden;
181
181
  background-color: var(--color-sheet);
182
182
 
183
- img, svg{
183
+ img, svg {
184
184
  width: 100%;
185
185
  height: 100%;
186
186
  object-fit: cover;
@@ -20,12 +20,12 @@
20
20
  </r-col>
21
21
  </r-row>
22
22
  <r-row class="h-end no-gutters">
23
- <r-btn :loading="loading"
23
+ <r-btn v-if="!loading"
24
24
  @click.stop="cancel"
25
25
  class="color-error-text mx-1"
26
26
  outlined
27
27
  rounded
28
- v-if="!loading">
28
+ :loading="loading">
29
29
  {{ cancelText || $t('cancel', 'renusify') }}
30
30
  </r-btn>
31
31
  <r-btn :disabled="hard&&!valid"
@@ -102,7 +102,7 @@ const toggle = () => {
102
102
  width: 100%;
103
103
  cursor: pointer;
104
104
 
105
- .checkbox-holder{
105
+ .checkbox-holder {
106
106
  display: flex;
107
107
  align-items: center;
108
108
  }
@@ -54,7 +54,7 @@
54
54
  :month="currentPeriod.month"
55
55
  :year="currentPeriod.year"></month>
56
56
 
57
- <div v-if="isRangeMode && rangeSelection.startDate && rangeSelection.endDate" class="range-info">
57
+ <div v-if="rangeMode && rangeSelection.startDate && rangeSelection.endDate" class="range-info">
58
58
  <div class="title-3">
59
59
  {{ $d(rangeSelection.startDate, withTime ? 'long' : 'medium', locale) }} -
60
60
  {{ $d(rangeSelection.endDate, withTime ? 'long' : 'medium', locale) }}
@@ -115,7 +115,7 @@
115
115
  </div>
116
116
  </div>
117
117
 
118
- <div v-if="isRangeMode&&!showTime" class="date-picker-actions mb-3">
118
+ <div v-if="rangeMode&&!showTime" class="date-picker-actions mb-3">
119
119
  <r-btn class="color-one mx-5" @click.prevent="confirmRange">{{ $t('confirm', 'renusify') }}</r-btn>
120
120
  <r-btn class="mx-5" text @click.prevent="resetRange">{{ $t('reset', 'renusify') }}</r-btn>
121
121
  </div>
@@ -212,7 +212,7 @@ const firstDayOfWeek = computed(() =>
212
212
  )
213
213
 
214
214
  const modelValueDate = computed(() => {
215
- if (props.isRangeMode && rangeSelection.value.startDate) {
215
+ if (props.rangeMode && rangeSelection.value.startDate) {
216
216
  return rangeSelection.value.startDate
217
217
  }
218
218
  if (!props.modelValue || !new Date(props.modelValue)) {
@@ -230,7 +230,7 @@ const lang_zone_offset = computed(() =>
230
230
  )
231
231
 
232
232
  const displayValue = computed(() => {
233
- if (props.isRangeMode) {
233
+ if (props.rangeMode) {
234
234
  const {startDate, endDate} = rangeSelection.value
235
235
  if (startDate && endDate) {
236
236
  const format = props.withTime ? 'long' : 'medium'
@@ -326,7 +326,7 @@ const createDateCell = (date) => {
326
326
  inRange: false
327
327
  }
328
328
 
329
- if (props.isRangeMode) {
329
+ if (props.rangeMode) {
330
330
  cell.isRangeStart = rangeSelection.value.startDate ? areSameDates(date, rangeSelection.value.startDate) : false
331
331
  cell.isRangeEnd = rangeSelection.value.endDate ? areSameDates(date, rangeSelection.value.endDate) : false
332
332
  cell.inRange = isDateInRange(date)
@@ -402,7 +402,7 @@ const setMonth = (monthIndex) => {
402
402
  * @param {Boolean} force - Force close even in range mode
403
403
  */
404
404
  const close = (force = false) => {
405
- if (force || !props.isRangeMode) {
405
+ if (force || !props.rangeMode) {
406
406
  show.value = false
407
407
  }
408
408
  showTime.value = false
@@ -415,7 +415,7 @@ const selectTime = () => {
415
415
  const times = (time.value ? time.value : '00:00:00').split(':')
416
416
  const [hours, minutes, seconds] = times.map(t => parseInt(t))
417
417
 
418
- if (props.isRangeMode) {
418
+ if (props.rangeMode) {
419
419
  handleRangeTimeSelection(hours, minutes, seconds)
420
420
  } else {
421
421
  handleSingleTimeSelection(hours, minutes, seconds)
@@ -478,7 +478,7 @@ const formatTime = (hours, minutes, seconds) => {
478
478
  */
479
479
  const selectDateItem = (item) => {
480
480
  if (!item.disabled) {
481
- if (props.isRangeMode) {
481
+ if (props.rangeMode) {
482
482
  handleRangeSelection(item.date)
483
483
  } else {
484
484
  if (props.withTime) {
@@ -581,7 +581,7 @@ $dateTime.set_format({
581
581
  'ye': {year: 'numeric', numberingSystem: 'latn'}
582
582
  })
583
583
 
584
- if (props.isRangeMode && Array.isArray(props.modelValue) && props.modelValue.length === 2) {
584
+ if (props.rangeMode && Array.isArray(props.modelValue) && props.modelValue.length === 2) {
585
585
  rangeSelection.value = {
586
586
  startDate: new Date(props.modelValue[0]),
587
587
  endDate: new Date(props.modelValue[1]),
@@ -3,15 +3,15 @@
3
3
  <div class="file-holder text-center">
4
4
  <div v-if="file || modelValue" class="image-canvas">
5
5
  <r-btn class="image-close color-white" icon size="xs">
6
- <r-icon @click.prevent="fileDelete()" class="color-error-text"
7
- v-html="$r.icons.delete"></r-icon>
6
+ <r-icon class="color-error-text" v-html="$r.icons.delete"
7
+ @click.prevent="fileDelete()"></r-icon>
8
8
  </r-btn>
9
9
  <r-progress-circle
10
- :indeterminate="false"
11
- :model-value="uploadPercentage"
12
- :width="2"
13
- class="image-progress"
14
- size="50"
10
+ :indeterminate="false"
11
+ :model-value="uploadPercentage"
12
+ :width="2"
13
+ class="image-progress"
14
+ size="50"
15
15
  >
16
16
  {{ `% ${uploadPercentage}` }}
17
17
  </r-progress-circle>
@@ -26,48 +26,48 @@
26
26
  </div>
27
27
  <div class="file-meta pa-1" v-if="meta && uploadPercentage===100">
28
28
  <r-text-input
29
- v-for="(m,k) in meta"
30
- :key="k"
31
- v-model="metaList[m]"
32
- :label="$t(m,'renusify')"
33
- :rules="metaRequired?['required']:[]"
34
- @update:model-value="emitFileLink"
29
+ v-for="(m,k) in meta"
30
+ :key="k"
31
+ v-model="metaList[m]"
32
+ :label="$t(m,'renusify')"
33
+ :rules="metaRequired?['required']:[]"
34
+ @update:model-value="emitFileLink"
35
35
  ></r-text-input>
36
36
  </div>
37
37
  </div>
38
38
 
39
39
  <r-icon
40
- v-if="showAdd"
41
- class="pick-icon cursor-pointer d-flex h-center v-center color-one-text"
42
- height="100"
43
- width="100"
44
- v-html="$r.icons.plus"
45
- @click.prevent.stop="pickFile"
40
+ v-if="showAdd"
41
+ class="pick-icon cursor-pointer d-flex h-center v-center color-one-text"
42
+ height="100"
43
+ width="100"
44
+ v-html="$r.icons.plus"
45
+ @click.prevent.stop="pickFile"
46
46
  ></r-icon>
47
47
  <input
48
- v-if="showFile"
49
- ref="fileInput"
50
- :accept="accept"
51
- style="display: none"
52
- type="file"
53
- @change="addFile"
48
+ v-if="showFile"
49
+ ref="fileInput"
50
+ :accept="accept"
51
+ style="display: none"
52
+ type="file"
53
+ @change="addFile"
54
54
  >
55
55
  <r-modal v-model="showCrop" max-width="300px" no-close-btn>
56
56
  <r-cropper
57
- v-if="wPH && file"
58
- :img-src="file"
59
- :select-img="false"
60
- :w-p-h="wPH || 1"
61
- get-blob
62
- show-cropped
63
- @cropped="handleCropped"
57
+ v-if="wPH && file"
58
+ :img-src="file"
59
+ :select-img="false"
60
+ :w-p-h="wPH || 1"
61
+ get-blob
62
+ show-cropped
63
+ @cropped="handleCropped"
64
64
  ></r-cropper>
65
65
  </r-modal>
66
66
  </div>
67
67
  </template>
68
68
 
69
69
  <script setup>
70
- import { ref, computed, watch, onMounted, nextTick, inject } from 'vue'
70
+ import {ref, computed, watch, onMounted, nextTick, inject} from 'vue'
71
71
 
72
72
  const props = defineProps({
73
73
  accept: {
@@ -202,7 +202,7 @@ const checkSave = () => {
202
202
  // Calculate allowed aspect ratios
203
203
  const allowedWPH = calculateAllowedWPH(props.wPH)
204
204
 
205
- img.onload = function() {
205
+ img.onload = function () {
206
206
  const currentWPH = parseFloat((this.width / this.height).toFixed(4))
207
207
 
208
208
  if (!allowedWPH.includes(currentWPH)) {
@@ -289,8 +289,8 @@ const saveImage = async () => {
289
289
  onUploadProgress: (progressEvent) => {
290
290
  if (progressEvent.total) {
291
291
  uploadPercentage.value = Math.min(
292
- parseInt(Math.floor((progressEvent.loaded * 100) / progressEvent.total)),
293
- 98
292
+ parseInt(Math.floor((progressEvent.loaded * 100) / progressEvent.total)),
293
+ 98
294
294
  )
295
295
  }
296
296
  },
@@ -313,7 +313,7 @@ const deleteImage = async () => {
313
313
 
314
314
  try {
315
315
  const response = await $axios.delete(props.uploadLink, {
316
- data: { link: fileLink.value },
316
+ data: {link: fileLink.value},
317
317
  headers: props.headers
318
318
  })
319
319
  return response
@@ -352,7 +352,7 @@ const getUrl = (value) => {
352
352
 
353
353
  const emitFileLink = () => {
354
354
  if (props.meta) {
355
- emit('file-link', { 'url': fileLink.value, 'meta': metaList.value })
355
+ emit('file-link', {'url': fileLink.value, 'meta': metaList.value})
356
356
  } else {
357
357
  emit('file-link', fileLink.value)
358
358
  }
@@ -365,7 +365,7 @@ watch(() => props.modelValue, (newVal, oldVal) => {
365
365
  if (JSON.stringify(newVal) !== JSON.stringify(oldVal)) {
366
366
  setValue(newVal)
367
367
  }
368
- }, { immediate: true })
368
+ }, {immediate: true})
369
369
 
370
370
  // Initialize
371
371
  onMounted(() => {
@@ -44,10 +44,10 @@ const autofocus = attr.autofocus
44
44
 
45
45
  const props = defineProps({
46
46
  /**
47
- * The input's model value (number or string)
48
- * @type {Number|String}
47
+ * The input's model value
48
+ * @type {String}
49
49
  */
50
- modelValue: [Number, String],
50
+ modelValue: String,
51
51
  /**
52
52
  * Step value for increment/decrement buttons
53
53
  * @type {Number}
@@ -78,7 +78,12 @@ const props = defineProps({
78
78
  * Maximum allowed value
79
79
  * @type {Number}
80
80
  */
81
- max: Number
81
+ max: Number,
82
+ /**
83
+ * allowe float number
84
+ * @type {Number}
85
+ */
86
+ isFloat: Boolean
82
87
  })
83
88
 
84
89
  const emit = defineEmits([
@@ -91,6 +96,9 @@ const emit = defineEmits([
91
96
 
92
97
  // Reactive data
93
98
  const number = ref(props.modelValue)
99
+ if (!props.isFloat && number.value !== undefined && number.value !== null && number.value !== "") {
100
+ number.value = parseInt(number.value).toString()
101
+ }
94
102
  const active = ref(false)
95
103
 
96
104
  // Methods
@@ -111,14 +119,16 @@ const emitValue = (e = false) => {
111
119
 
112
120
  let value = number.value
113
121
 
114
- if (props.max !== undefined && value > props.max) {
122
+ if (props.max !== undefined && parseFloat(value) > props.max) {
115
123
  value = props.max
116
124
  }
117
- if (props.min !== undefined && value < props.min) {
125
+ if (props.min !== undefined && parseFloat(value) < props.min) {
118
126
  emit('update:modelValue', undefined)
119
127
  return;
120
128
  }
121
-
129
+ if (!props.isFloat) {
130
+ value = parseInt(value).toString()
131
+ }
122
132
  number.value = value
123
133
  emit('update:modelValue', number.value)
124
134
  }
@@ -128,7 +138,7 @@ const emitValue = (e = false) => {
128
138
  */
129
139
  const plus = () => {
130
140
  const currentValue = parseFloat(props.modelValue || props.min || 0)
131
- number.value = currentValue + props.step
141
+ number.value = (currentValue + props.step).toString()
132
142
  emitValue()
133
143
  }
134
144
 
@@ -137,7 +147,7 @@ const plus = () => {
137
147
  */
138
148
  const minus = () => {
139
149
  const currentValue = parseFloat(props.modelValue || 0)
140
- number.value = currentValue - props.step
150
+ number.value = (currentValue - props.step).toString()
141
151
  emitValue()
142
152
  }
143
153
 
@@ -13,7 +13,7 @@
13
13
  v-for="(item,key) in chips"
14
14
  :key="key"
15
15
  :class="{'px-0':!multiple,'chip body-3':multiple}"
16
- class=" ms-0 d-flex v-center">
16
+ class="select-text ms-0 d-flex v-center">
17
17
  {{ item ? item[text] : '' }}
18
18
  <r-icon v-if="multiple" class="chip-icon cursor-pointer ms-1" height="16" width="16"
19
19
  @click="handleChip(false,key)"
@@ -21,7 +21,7 @@
21
21
 
22
22
  </span>
23
23
  <span>
24
- <input v-if="!disableSearch"
24
+ <input v-if="!disableSearch&&showMode!=='modal'"
25
25
  ref="inputRef"
26
26
  :autofocus="autofocus"
27
27
  :placeholder="modelValue?'':placeholder"
@@ -18,7 +18,7 @@
18
18
  </r-row>
19
19
  <template v-for="(item,i) in errors"
20
20
  :key="i">
21
- <div class="mb-2 br-md color-error d-flex">
21
+ <div class="mb-2 br-md color-error d-flex pa-3">
22
22
  <span>{{ $t(i) }}:</span>
23
23
  <span class="flex-grow-1">
24
24
  <div v-for="(er,k) in item" :key="k+'-'+i">
@@ -256,8 +256,8 @@ const getSize = () => {
256
256
  return false
257
257
  }
258
258
 
259
- const activate = (n=0) => {
260
- if (n>10)return;
259
+ const activate = (n = 0) => {
260
+ if (n > 10) return;
261
261
  getSize()
262
262
  if (size.value.width !== 0 || size.value.height) {
263
263
  load.value = true
@@ -3,16 +3,16 @@
3
3
  <div ref="chat"
4
4
  v-scroll="{handler:onScroll,target:target}"
5
5
  :style="{'max-height': height,'height': height}"
6
- class="infinite-page-container" :class="{'overflow-div':height}">
6
+ :class="{'overflow-div':height}" class="infinite-page-container">
7
7
  <transition-group :class="{'flex-column-reverse':isChat}"
8
8
  :name="isChat?'slide-up':'slide-down'"
9
9
  class="row"
10
10
  tag="div">
11
11
  <!-- Default slot for contents. Provide items, total props -->
12
12
  <slot :items="datacollection" :total="total">{{ datacollection }}</slot>
13
- <r-col class="col-12" key="loading">
14
- <r-progress-line color="color-two"
15
- v-show="loading"></r-progress-line>
13
+ <r-col key="loading" class="col-12">
14
+ <r-progress-line v-show="loading"
15
+ color="color-two"></r-progress-line>
16
16
  </r-col>
17
17
  </transition-group>
18
18
  </div>
@@ -31,7 +31,7 @@ import {
31
31
  onActivated,
32
32
  onDeactivated,
33
33
  watch,
34
- inject,nextTick
34
+ inject, nextTick
35
35
  } from 'vue'
36
36
 
37
37
  const props = defineProps({
@@ -2,14 +2,14 @@
2
2
  <div ref="menuRef" v-click-outside="close" :class="$r.prefix+'menu'">
3
3
  <div class="d-flex h-start flex-row v-center">
4
4
  <slot name="label">
5
- <span class="menu-label" v-if="label" @click.prevent="open">{{ label }}</span>
5
+ <span v-if="label" class="menu-label" @click.prevent="open">{{ label }}</span>
6
6
  </slot>
7
7
  <transition name="fade" mode="out-in">
8
8
  <!-- Header Navigation Menu Icons -->
9
- <r-btn icon text v-if="show" key="on" size="sm" @click.prevent="close">
9
+ <r-btn v-if="show" key="on" icon size="sm" text @click.prevent="close">
10
10
  <r-icon v-html="$r.icons.chevron_up"></r-icon>
11
11
  </r-btn>
12
- <r-btn icon text v-else key="off" size="sm" @click.prevent="open">
12
+ <r-btn v-else key="off" icon size="sm" text @click.prevent="open">
13
13
  <r-icon v-html="icon||$r.icons.chevron_down"></r-icon>
14
14
  </r-btn>
15
15
 
@@ -48,7 +48,7 @@
48
48
  </template>
49
49
 
50
50
  <script setup>
51
- import {ref, computed, onMounted, onUnmounted,watch} from 'vue'
51
+ import {ref, computed, onMounted, onUnmounted, watch} from 'vue'
52
52
 
53
53
  /**
54
54
  * @example // Slider usage
@@ -338,7 +338,9 @@ const goToSlide = (i) => {
338
338
  emit('index', currentIndex.value)
339
339
  }
340
340
 
341
- watch(()=>props.slides,()=>{init()})
341
+ watch(() => props.slides, () => {
342
+ init()
343
+ })
342
344
  onMounted(() => {
343
345
  init()
344
346
  })
@@ -4,11 +4,11 @@
4
4
  >
5
5
  <!-- @slot Previous navigation slot
6
6
  @binding {Function} previous - Function to navigate previous -->
7
- <slot name="previous" :previous="previous"></slot>
7
+ <slot :previous="previous" name="previous"></slot>
8
8
 
9
9
  <!-- @slot Next navigation slot
10
10
  @binding {Function} next - Function to navigate next -->
11
- <slot name="next" :next="next"></slot>
11
+ <slot :next="next" name="next"></slot>
12
12
 
13
13
  <div class="swiper-container"
14
14
  ref="containerRef"
@@ -49,7 +49,7 @@
49
49
  </template>
50
50
 
51
51
  <script setup>
52
- import { ref, computed, onMounted, onUnmounted, inject, nextTick, watch } from 'vue'
52
+ import {ref, computed, onMounted, onUnmounted, inject, nextTick, watch} from 'vue'
53
53
 
54
54
  /**
55
55
  * @example // Swiper usage
@@ -114,7 +114,7 @@ const props = defineProps({
114
114
  numShow: [Number, Object]
115
115
  })
116
116
 
117
- const { $r } = inject('renusify')
117
+ const {$r} = inject('renusify')
118
118
 
119
119
  const timer = ref(null)
120
120
  const inMove = ref(false)
@@ -156,16 +156,16 @@ const goToSlide = (n) => {
156
156
  * Navigates to the next slide
157
157
  */
158
158
  const next = () => {
159
- if(currentSlide.value+1>slides.value)return
160
- goToSlide(currentSlide.value+1)
159
+ if (currentSlide.value + 1 > slides.value) return
160
+ goToSlide(currentSlide.value + 1)
161
161
  }
162
162
 
163
163
  /**
164
164
  * Navigates to the previous slide
165
165
  */
166
166
  const previous = () => {
167
- if(currentSlide.value===1)return
168
- goToSlide(currentSlide.value-1)
167
+ if (currentSlide.value === 1) return
168
+ goToSlide(currentSlide.value - 1)
169
169
  }
170
170
 
171
171
  /**
@@ -259,7 +259,7 @@ watch(() => props.items, () => {
259
259
  currentSlide.value = 1
260
260
 
261
261
  handleResize()
262
- }, { deep: true })
262
+ }, {deep: true})
263
263
 
264
264
  defineExpose({
265
265
  /**
@@ -142,6 +142,7 @@
142
142
  </template>
143
143
  <r-table v-else :headers="headerTable" :items="table.data" :key-item="itemId"
144
144
  :responsive="responsive"
145
+ :editable="editable"
145
146
  transition="table-row">
146
147
  <template v-slot:header="{header}">
147
148
  <th v-for="(item,key) in header"
@@ -310,6 +311,11 @@ const props = defineProps({
310
311
  * @type {Boolean}
311
312
  */
312
313
  responsive: Boolean,
314
+ /**
315
+ * Enables editable table behavior
316
+ * @type {Boolean}
317
+ */
318
+ editable: Boolean,
313
319
  /**
314
320
  * Displays data in cards view instead of table
315
321
  * @type {Boolean}
@@ -33,7 +33,8 @@
33
33
  class="text-start text-no-wrap"
34
34
  @click.prevent="sorting(item.value)">
35
35
  {{ translate ? $t(item.text, 'renusify') : item.text }}
36
- <r-icon v-if="sortKey===item.value" :class="{'sort-desc':!sortAsc}" v-html="$r.icons.arrow_up"></r-icon>
36
+ <r-icon v-if="sortKey===item.value" :class="{'sort-desc':!sortAsc}"
37
+ v-html="$r.icons.arrow_up"></r-icon>
37
38
  </th>
38
39
  </slot>
39
40
  </tr>
@@ -207,6 +208,11 @@ const props = defineProps({
207
208
  * @type {Boolean}
208
209
  */
209
210
  editable: Boolean,
211
+ /**
212
+ * Table key for configuration editing
213
+ * @type {String}
214
+ */
215
+ tableKey: String,
210
216
  /**
211
217
  * Applies stripped row styling
212
218
  * @type {Boolean}
@@ -293,11 +299,22 @@ const lists = computed(() => {
293
299
 
294
300
  const th = computed(() => {
295
301
  const res = []
296
- const list = cols.value.length > 0 ? cols.value : th_all.value
302
+ const lng = cols.value.length
303
+ const list = lng > 0 ? cols.value : th_all.value
297
304
 
298
305
  list.forEach((item) => {
299
306
  if (item && !(item.value in hidden.value) && !(item.value in hidden_col.value)) {
300
- res.push(item)
307
+ if (lng > 0) {
308
+ for (let i = 0; i < lng; i++) {
309
+ const t = th_all.value[i]
310
+ if (t.value === item.value) {
311
+ res.push(t)
312
+ break
313
+ }
314
+ }
315
+ } else {
316
+ res.push(item)
317
+ }
301
318
  }
302
319
  })
303
320
  return res
@@ -324,7 +341,10 @@ const th_all = computed(() => {
324
341
  })
325
342
 
326
343
  const hash_key = computed(() => {
327
- let r = ''
344
+ let r = window.location
345
+ if (props.tableKey) {
346
+ r += props.tableKey
347
+ }
328
348
  th_all.value.forEach((item) => {
329
349
  if (item) {
330
350
  r += item.value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "renusify",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Vue3 Framework",
5
5
  "keywords": [
6
6
  "vuejs",