renusify 1.1.3 → 1.1.4

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.
@@ -2,6 +2,7 @@
2
2
  <r-select-input
3
3
  :label="$t('country','renusify')"
4
4
  v-model="country"
5
+ v-if="!defaultCountry"
5
6
  @update:model-value="emit(true,true)"
6
7
  value="id"
7
8
  :searchLink="`https://codenus.com/api/apps/address?lang=${$r.lang}`"
@@ -56,11 +57,12 @@ export default {
56
57
  hideZipCode: Boolean,
57
58
  hideStreet: Boolean,
58
59
  tile: Boolean,
60
+ defaultCountry: Object,
59
61
  modelValue: Object
60
62
  },
61
63
  data() {
62
64
  return {
63
- country: this.modelValue ? this.modelValue.country : null,
65
+ country: this.modelValue ? this.modelValue.country : this.defaultCountry,
64
66
  state: this.modelValue ? this.modelValue.state : null,
65
67
  city: this.modelValue ? this.modelValue.city : null,
66
68
  zip_code: this.modelValue ? this.modelValue.zip_code : null,
@@ -18,7 +18,7 @@
18
18
  </span>
19
19
  <span class="ms-2 color-primary-text" @click="emit">
20
20
  <span class="color-error-text" v-if="isRequired">*</span>
21
- {{ label }}
21
+ <slot name="label">{{ label }}</slot>
22
22
  </span>
23
23
  </div>
24
24
  </template>
@@ -5,17 +5,17 @@
5
5
  />
6
6
  </r-input>
7
7
  <r-modal :model-value="show" @update:model-value="close()" :closebtn="false" closable class="text-center">
8
- <div v-if="!showTime" :class="`${$r.prefix}date-picker`">
9
- <div class="sheet">
10
- <r-container>
11
- <r-row>
12
- <r-col class="col-auto">
13
- <r-btn v-if="tab!=='month'" icon
14
- @click.prevent="tab==='day'?incrementMonth(-1):incrementYear(-12)">
15
- <r-icon v-html="$r.icons.arrow_left"></r-icon>
16
- </r-btn>
17
- </r-col>
18
- <r-col class="text-center">
8
+ <div v-if="!showTime" :class="`${$r.prefix}date-input`">
9
+ <div class="sheet">
10
+ <r-container>
11
+ <r-row>
12
+ <r-col class="col-auto">
13
+ <r-btn v-if="tab!=='month'" icon
14
+ @click.prevent="tab==='day'?incrementMonth(-1):incrementYear(-12)">
15
+ <r-icon v-html="$r.icons.arrow_left"></r-icon>
16
+ </r-btn>
17
+ </r-col>
18
+ <r-col class="text-center">
19
19
  <r-btn class="me-2" text @click.prevent="tab==='month'?tab='day':tab='month'">
20
20
  <r-icon v-html="tab==='month'?$r.icons.chevron_up:$r.icons.chevron_down"></r-icon>
21
21
  {{
@@ -370,17 +370,17 @@ export default {
370
370
  <style lang="scss">
371
371
  @import "../../../style/include";
372
372
 
373
- .#{$prefix}date-picker {
374
- position: relative;
375
- display: inline-block;
376
- font-size: 10px;
377
- color: #303030;
373
+ .#{$prefix}date-input {
374
+ position: relative;
375
+ display: inline-block;
376
+ font-size: 10px;
377
+ color: #303030;
378
378
 
379
- .cell {
380
- &.today {
381
- color: var(--color-one);
379
+ .cell {
380
+ &.today {
381
+ color: var(--color-one);
382
382
 
383
- .cellContent {
383
+ .cellContent {
384
384
  border: solid 1px var(--color-one);
385
385
  }
386
386
  }
@@ -6,11 +6,11 @@
6
6
  <slot :item="item" :index="i" :disableDel="disDel">
7
7
  <div class="d-flex flex-wrap pt-5">
8
8
  <template v-for="(v,k) in item" :key="i+'-'+k">
9
- <r-text-input v-if="typeof v==='string'" class="flex-grow-0 me-1" :label="k"
9
+ <r-text-input v-if="typeof v==='string'" class="flex-grow-0 me-1" :label="t(k)"
10
10
  v-model="item[k]"></r-text-input>
11
- <r-number-input v-else-if="typeof v==='number'" class="flex-grow-0 me-1" :label="k"
11
+ <r-number-input v-else-if="typeof v==='number'" class="flex-grow-0 me-1" :label="t(k)"
12
12
  v-model="item[k]"></r-number-input>
13
- <r-switch-input v-else-if="typeof v==='boolean'" class="flex-grow-0 me-1" :label="k"
13
+ <r-switch-input v-else-if="typeof v==='boolean'" class="flex-grow-0 me-1" :label="t(k)"
14
14
  v-model="item[k]"></r-switch-input>
15
15
  </template>
16
16
  </div>
@@ -48,6 +48,7 @@ export default {
48
48
  modelValue: Array,
49
49
  size: Number,
50
50
  disableAdd: Boolean,
51
+ translate: Boolean,
51
52
  template: Object
52
53
  },
53
54
  data() {
@@ -68,6 +69,12 @@ export default {
68
69
  }
69
70
  },
70
71
  methods: {
72
+ t(k) {
73
+ if (this.translate) {
74
+ return this.$t(k)
75
+ }
76
+ return k
77
+ },
71
78
  disDel(value) {
72
79
  this.disabledDel[value] = true
73
80
  },
@@ -133,4 +140,4 @@ export default {
133
140
  }
134
141
  }
135
142
  }
136
- </style>
143
+ </style>
@@ -3,7 +3,7 @@
3
3
  :class="{
4
4
  [`${$r.prefix}input-container`]:true,
5
5
  [c_color]:c_color&&!isDisabled,
6
- 'color-error-text':hasError&&genMessages.length>0,
6
+ 'color-error-text':hasError&&validations.length>0,
7
7
  'hide-detail':c_hide,
8
8
  'input-focused':active,
9
9
  'input-disabled':isDisabled,
@@ -28,7 +28,7 @@
28
28
  :class="{
29
29
  'massage-active':genMessages.length>0,
30
30
  }">
31
- <div :class="{'animation-shake-3':c_msgShake}">{{ genMessages[0] }}</div>
31
+ <div :class="{'animation-shake-3':c_msgShake}">{{ genMessages.join(',') }}</div>
32
32
 
33
33
  </div>
34
34
  </div>
@@ -113,10 +113,11 @@ export default {
113
113
  return this.errorBucket.length > 0
114
114
  },
115
115
  genMessages() {
116
+ let m = []
116
117
  if (this.msg) {
117
- return [this.msg]
118
+ m = [this.msg]
118
119
  }
119
- return this.hasMessages ? this.validations : []
120
+ return this.hasMessages ? this.validations : m
120
121
  },
121
122
  hasMessages() {
122
123
  return this.validationTarget.length > 0
@@ -1,181 +1,186 @@
1
1
  <template>
2
- <div :class="`${$r.prefix}input-tel`">
3
- <r-modal
4
- v-model="open"
5
- >
6
- <r-card class="pa-2">
7
- <r-text-input
8
- :label="$t('search','renusify')"
9
- v-model="search"
10
- ></r-text-input>
11
- <r-list :items="countries" :filter="search" @update:model-value="choose">
12
- <template v-slot="{item}">
13
- <div
14
- :class="item.iso2.toLowerCase()"
15
- class="iti-flag"></div>
16
- <div class="list-title">{{item.name}}</div>
17
- <r-spacer></r-spacer>
18
- <span class="ltr">+{{ item.dialCode }}</span>
19
- </template>
20
- </r-list>
21
- </r-card>
22
- </r-modal>
23
- <r-btn class="btn-country ltr mx-1"
24
- :rounded="!tile" :disabled="!select" @click.stop="toggleDropdown" outlined>
25
- <div :class="activeCountry.iso2.toLowerCase()" class="iti-flag"></div>
26
- <span class="country-code pa-1"> +{{ activeCountry.dialCode }} </span>
27
- <span class="dropdown-arrow">{{ open ? "▲" : "▼" }}</span>
28
- </r-btn>
29
- <r-text-input class="input-phone" :label="label?label:$t('phone','renusify')"
30
- @update:model-value="emit"
31
- :tile="tile"
32
- :rules="[required&&'required']"
33
- v-model="tel.phone"
34
- >
35
- </r-text-input>
2
+ <div :class="`${$r.prefix}input-tel`">
3
+ <r-modal
4
+ v-model="open"
5
+ >
6
+ <r-card class="pa-2">
7
+ <r-text-input
8
+ :label="$t('search','renusify')"
9
+ v-model="search"
10
+ ></r-text-input>
11
+ <r-list :items="countries" :filter="search" @update:model-value="choose">
12
+ <template v-slot="{item}">
13
+ <div
14
+ :class="item.iso2.toLowerCase()"
15
+ class="iti-flag"></div>
16
+ <div class="list-title">{{ item.name }}</div>
17
+ <r-spacer></r-spacer>
18
+ <span class="ltr">+{{ item.dialCode }}</span>
19
+ </template>
20
+ </r-list>
21
+ </r-card>
22
+ </r-modal>
23
+ <r-btn class="btn-country ltr mx-1"
24
+ :rounded="!tile" :disabled="!select||readonly" @click.stop="toggleDropdown" outlined>
25
+ <div :class="activeCountry.iso2.toLowerCase()" class="iti-flag"></div>
26
+ <span class="country-code pa-1"> +{{ activeCountry.dialCode }} </span>
27
+ <span class="dropdown-arrow">{{ open ? "▲" : "▼" }}</span>
28
+ </r-btn>
29
+ <r-text-input class="input-phone" :label="label?label:$t('phone','renusify')"
30
+ @update:model-value="emit"
31
+ :tile="tile"
32
+ :readonly="readonly"
33
+ :rules="required?['required']:[]"
34
+ v-model="tel.phone"
35
+ >
36
+ </r-text-input>
36
37
 
37
- </div>
38
+ </div>
38
39
  </template>
39
40
 
40
41
  <script>
41
- import allCountries from './assets/all-countries.js'
42
+ import allCountries from './assets/all-countries.js'
42
43
 
43
- export default {
44
- name: 'inputTel',
45
- props: {
46
- label: {
47
- type: String
48
- },
49
- modelValue: {
50
- type: Object,
51
- default: () => {
52
- return {
53
- 'phone': '',
54
- 'country_code': ''
55
- }
56
- }
57
- },
58
- defaultCountry: {
59
- // Default country code, ie: 'AU'
60
- // Will override the current country of user
61
- type: String,
62
- default: ''
63
- },
64
- tile: Boolean,
65
- required: Boolean,
66
- select: {
67
- type: Boolean,
68
- default: false
69
- }
44
+ export default {
45
+ name: 'inputTel',
46
+ props: {
47
+ label: {
48
+ type: String
49
+ },
50
+ modelValue: {
51
+ type: String
52
+ },
53
+ defaultCountry: {
54
+ // Default country code, ie: 'AU'
55
+ // Will override the current country of user
56
+ type: String,
57
+ default: ''
58
+ },
59
+ tile: Boolean,
60
+ required: Boolean,
61
+ readonly: Boolean,
62
+ select: {
63
+ type: Boolean,
64
+ default: false
65
+ }
70
66
 
71
- },
72
- data() {
73
- return {
74
- tel: this.modelValue,
75
- search: '',
76
- countries: [],
77
- activeCountry: {iso2: 'US', dialCode: '1'},
78
- open: false
79
- }
80
- },
81
- mounted() {
82
- this.initializeCountry()
83
- this.countries = allCountries
84
- },
85
- created() {
86
- if (this.modelValue) {
87
- this.activeCountry.dialCode = this.modelValue.country_code
88
- }
89
- },
90
- methods: {
91
- initializeCountry() {
92
- /**
93
- * 1. Use default country if passed from parent
94
- */
95
- if (this.defaultCountry) {
96
- const defaultCountry = this.findCountry(this.defaultCountry)
97
- if (defaultCountry) {
98
- this.activeCountry = defaultCountry
99
- return
100
- }
101
- }
102
- /**
103
- * 2. Check if fetching country based on user's IP is allowed, set it as the default country
104
- */
105
- fetch('http://ip-api.com/json/', {
106
- method: 'get'
107
- }).then((response) => {
108
- const that = this
109
- response.json().then(function (data) {
110
- that.activeCountry = that.findCountry(data.countryCode) || that.activeCountry
111
- })
112
- }).catch((error) => {
113
- return Promise.reject(error)
114
- })
115
- },
116
- /**
117
- * Get the list of countries from the list of iso2 code
118
- */
119
- getCountries(list = []) {
120
- return list
121
- .map(countryCode => this.findCountry(countryCode))
122
- .filter(Boolean)
123
- },
124
- findCountry(iso = '') {
125
- return allCountries.find(country => country.iso2 === iso)
126
- },
67
+ },
68
+ data() {
69
+ return {
70
+ tel: {
71
+ 'phone': '',
72
+ 'country_code': ''
73
+ },
74
+ search: '',
75
+ countries: [],
76
+ activeCountry: {iso2: 'US', dialCode: '1'},
77
+ open: false
78
+ }
79
+ },
80
+ mounted() {
81
+ this.initializeCountry()
82
+ this.countries = allCountries
83
+ },
84
+ created() {
85
+ if (this.modelValue) {
86
+ let a = this.modelValue.split(' ')
87
+ this.tel.country_code = a[0]
88
+ this.tel.phone = a[1]
89
+ this.activeCountry.dialCode = this.tel.country_code
90
+ }
91
+ },
92
+ methods: {
93
+ initializeCountry() {
94
+ /**
95
+ * 1. Use default country if passed from parent
96
+ */
97
+ if (this.defaultCountry) {
98
+ const defaultCountry = this.findCountry(this.defaultCountry)
99
+ if (defaultCountry) {
100
+ this.activeCountry = defaultCountry
101
+ return
102
+ }
103
+ }
104
+ /**
105
+ * 2. Check if fetching country based on user's IP is allowed, set it as the default country
106
+ */
107
+ fetch('http://ip-api.com/json/', {
108
+ method: 'get'
109
+ }).then((response) => {
110
+ const that = this
111
+ response.json().then(function (data) {
112
+ that.activeCountry = that.findCountry(data.countryCode) || that.activeCountry
113
+ })
114
+ }).catch((error) => {
115
+ return Promise.reject(error)
116
+ })
117
+ },
118
+ /**
119
+ * Get the list of countries from the list of iso2 code
120
+ */
121
+ getCountries(list = []) {
122
+ return list
123
+ .map(countryCode => this.findCountry(countryCode))
124
+ .filter(Boolean)
125
+ },
126
+ findCountry(iso = '') {
127
+ return allCountries.find(country => country.iso2 === iso)
128
+ },
127
129
 
128
- choose(country) {
129
- this.activeCountry = country
130
- this.emit()
131
- this.reset()
132
- },
133
- reset() {
134
- this.search = ''
135
- this.countries = allCountries
136
- this.open = false
137
- },
130
+ choose(country) {
131
+ this.activeCountry = country
132
+ this.emit()
133
+ this.reset()
134
+ },
135
+ reset() {
136
+ this.search = ''
137
+ this.countries = allCountries
138
+ this.open = false
139
+ },
138
140
 
139
- emit(e) {
140
- this.tel.country_code = this.activeCountry.dialCode
141
- if (this.tel.phone.startsWith('0')) {
142
- setTimeout(() => {
143
- this.tel.phone = this.tel.phone.substr(1, this.tel.phone.length)
144
- this.$emit('update:modelValue', this.tel)
145
- }, 1)
146
- } else {
147
- this.$emit('update:modelValue', this.tel)
141
+ emit(e) {
142
+ if (this.readonly) {
143
+ return
144
+ }
145
+ this.tel.country_code = this.activeCountry.dialCode
146
+ if (this.tel.phone.startsWith('0')) {
147
+ setTimeout(() => {
148
+ this.tel.phone = this.tel.phone.substr(1, this.tel.phone.length)
149
+ this.$emit('update:modelValue', this.tel.country_code + ' ' + this.tel.phone)
150
+ }, 1)
151
+ } else {
152
+ this.$emit('update:modelValue', this.tel.country_code + ' ' + this.tel.phone)
148
153
 
149
- }
154
+ }
150
155
 
151
- },
152
- toggleDropdown() {
153
- this.open = !this.open
154
- },
155
- clickedOutside() {
156
- this.open = false
157
- }
158
- }
156
+ },
157
+ toggleDropdown() {
158
+ this.open = !this.open
159
+ },
160
+ clickedOutside() {
161
+ this.open = false
159
162
  }
163
+ }
164
+ }
160
165
  </script>
161
166
 
162
167
  <style src="./assets/sprite.css"></style>
163
168
  <style lang="scss">
164
- @import "../../../style/include";
169
+ @import "../../../style/include";
165
170
 
166
- .#{$prefix}input-tel {
167
- display: flex;
168
- align-items: baseline;
169
- direction: ltr;
171
+ .#{$prefix}input-tel {
172
+ display: flex;
173
+ align-items: baseline;
174
+ direction: ltr;
170
175
 
171
- .btn-country {
172
- width: 120px;
173
- border-color: var(--color-border)
176
+ .btn-country {
177
+ width: 120px;
178
+ border-color: var(--color-border)
174
179
 
175
- }
180
+ }
176
181
 
177
- .input-phone {
178
- width: calc(100% - 120px);
179
- }
180
- }
181
- </style>
182
+ .input-phone {
183
+ width: calc(100% - 120px);
184
+ }
185
+ }
186
+ </style>
@@ -1,15 +1,16 @@
1
1
  <template>
2
- <r-input :error="error?true:false" :rules="required?['required']:[]" :msg="error?error:undefined" :modelValue="lazyVal" :active="active" class="ltr">
3
- <input
4
- v-model="lazyVal"
5
- @complete="onComplete"
6
- @accept="onAccept"
7
- @backspace="onBackspace"
8
- autocomplete="no"
9
- @paste.prevent="onPaste"
10
- @focusin="active=true"
11
- @focusout="active=false"
12
- v-mask="mask"
2
+ <r-input :error="error?true:false" ltr :rules="required?['required']:[]" :msg="error?error:undefined"
3
+ :modelValue="lazyVal" :active="active">
4
+ <input
5
+ v-model="lazyVal"
6
+ @complete="onComplete"
7
+ @accept="onAccept"
8
+ @backspace="onBackspace"
9
+ autocomplete="no"
10
+ @paste.prevent="onPaste"
11
+ @focusin="active=true"
12
+ @focusout="active=false"
13
+ v-mask="mask"
13
14
  />
14
15
 
15
16
  </r-input>
@@ -6,7 +6,10 @@
6
6
  :modelValue="$helper.ifHas(chips,null,0,value)"
7
7
  @click.prevent="handleClick()">
8
8
  <div class="select-wrap v-center"
9
- :class="{'flex-nowrap':!multiple}">
9
+ :class="{
10
+ 'h-center':disableSearch,
11
+ 'flex-nowrap':!multiple
12
+ }">
10
13
  <r-chip
11
14
  class="my-0 ms-0"
12
15
  :close="multiple&&!textChip"
@@ -20,6 +23,7 @@
20
23
  </r-chip>
21
24
  <span>
22
25
  <input :type="type"
26
+ v-if="!disableSearch"
23
27
  @focusin="focusInput(true)"
24
28
  @focusout="focusInput(false)"
25
29
  @keydown.enter="add"
@@ -85,7 +89,7 @@ export default {
85
89
  type: String,
86
90
  default: 'value'
87
91
  },
88
- combo: Boolean,
92
+ disableSearch: Boolean,
89
93
  readonly: Boolean,
90
94
  textChip: Boolean,
91
95
  items: Array,
@@ -217,6 +221,8 @@ export default {
217
221
  handleClick() {
218
222
  if (this.$refs.input) {
219
223
  this.$refs.input.focus()
224
+ } else {
225
+ this.focusInput(true)
220
226
  }
221
227
  },
222
228
  add() {
@@ -225,7 +231,7 @@ export default {
225
231
  if (!this.multiple) {
226
232
  this.chips = []
227
233
  }
228
- if (!this.combo && !this.tags) {
234
+ if (!this.tags) {
229
235
  const exist = this.$helper.searchArray(this.genItems, this.text, val[this.text])
230
236
  if (exist !== false) {
231
237
  this.chips.push(val)
@@ -242,8 +248,7 @@ export default {
242
248
  this.chips = this.$helper.uniqArray(this.chips)
243
249
 
244
250
  let val = this.chips
245
-
246
- if (this.tags) {
251
+ if (this.justValue) {
247
252
  val = []
248
253
  for (let i in this.chips) {
249
254
  if (this.$helper.hasKey(this.chips, i)) {
@@ -251,12 +256,9 @@ export default {
251
256
  }
252
257
  }
253
258
  }
254
- if (!this.multiple && !this.tags) {
259
+ if (!this.multiple) {
255
260
  val = val[0]
256
261
  if (val) {
257
- if (this.justValue) {
258
- val = val[this.value]
259
- }
260
262
  this.closeList()
261
263
  }
262
264
  }
@@ -6,10 +6,10 @@
6
6
  <r-form ref="form" v-model="valid" @submit.prevent="save">
7
7
  <r-row>
8
8
  <template :key="key" v-for="(item,key) in options">
9
- <r-col class="col-12" v-if="item['formInput']!==false">
9
+ <r-col class="col-12" v-if="item['formInput']!==false&&iff(options[key])">
10
10
  <component
11
11
  :is="'r-'+item['type']"
12
- :label="$t(key,'renusify')"
12
+ :label="$t(key)"
13
13
  v-model="editedItem[key]"
14
14
  v-bind="getAttr(options[key])"
15
15
  ></component>
@@ -96,11 +96,64 @@ export default {
96
96
  }
97
97
  },
98
98
  methods: {
99
+ iff(data) {
100
+ const that = this
101
+
102
+ function get(item, key) {
103
+ if (key.toString().startsWith('$')) {
104
+ return that.$helper.ifHas(item, null, ...key.substring(1).split('.'))
105
+ }
106
+ return key
107
+ }
108
+
109
+ if ('$if' in data) {
110
+ for (let i = 0; i < data['$if'].length; i++) {
111
+ const item = data['$if'][i]
112
+ let can = true
113
+ const one = get(this.editedItem, item[0])
114
+ const op = item[1]
115
+ const two = get(this.editedItem, item[2])
116
+ if (op === '===' || op === '==') {
117
+ can = one === two
118
+ } else if (op === '>') {
119
+ can = one > two
120
+ } else if (op === '>=') {
121
+ can = one >= two
122
+ } else if (op === '<') {
123
+ can = one < two
124
+ } else if (op === '<=') {
125
+ can = one <= two
126
+ } else if (op === '!=') {
127
+ can = one !== two
128
+ } else if (op === 'in') {
129
+ if (two && typeof two === 'object') {
130
+ can = two.includes(one)
131
+ } else {
132
+ can = false
133
+ }
134
+ } else {
135
+ can = false
136
+ console.error(`operator '${op}' is not defined.(form creator)`)
137
+ }
138
+ if (can === false) {
139
+ return false
140
+ }
141
+ }
142
+ }
143
+ return true
144
+ },
99
145
  getAttr(data) {
100
146
  let res = {}
101
147
  for (let i in data) {
102
- if (this.$helper.hasKey(data, i) && !['formInput', 'sortable', 'type', 'tableShow', 'priority'].includes(i)) {
103
- res[i] = data[i]
148
+ if (this.$helper.hasKey(data, i) && !['formInput', 'sortable', 'type', 'tableShow', 'priority', '$if'].includes(i)) {
149
+ if (i === '$bind') {
150
+ data[i].forEach((item) => {
151
+ res[item[0]] = this.editedItem[item[1]]
152
+ })
153
+
154
+ } else {
155
+ res[i] = data[i]
156
+ }
104
157
  }
105
158
  }
106
159
  return res
@@ -10,6 +10,7 @@
10
10
  {name: '100', value: 100},
11
11
  {name: '200', value: 200},
12
12
  ]"
13
+ disable-search
13
14
  @update:modelValue="perPageE"
14
15
  :modelValue="perPage"></r-select-input>
15
16
  </r-col>
@@ -22,7 +23,7 @@
22
23
  <r-icon v-html="this.$r.icons.chevron_left"></r-icon>
23
24
 
24
25
  </r-btn>
25
- <input type="text" :value="page" @input="pageN" class="input-page text-center">
26
+ <input name="input-page" type="text" :value="page" @input="pageN" class="input-page text-center">
26
27
  <r-btn :disabled="endPage" @click.prevent="pageBtn('next')" class="btn-shaped"
27
28
  icon
28
29
  text>
@@ -125,7 +125,7 @@
125
125
  </r-btn>
126
126
  </r-col>
127
127
  </r-row>
128
- <r-row class="v-baseline" v-else-if="['date-picker','time-ago'].includes(item.option.type)">
128
+ <r-row class="v-baseline" v-else-if="['date-input','time-ago'].includes(item.option.type)">
129
129
  <r-col class="col-5 md-3" :a="item.advance.t='date'">
130
130
  <r-select-input v-model="item.advance.action"
131
131
  :items="[
@@ -214,7 +214,7 @@
214
214
  header() {
215
215
  let res = []
216
216
  this.headerTable.forEach((item) => {
217
- if (['text-input', 'text-area', 'number', 'switch', 'select', 'date-picker', 'time-ago'].includes(item.option.type)) {
217
+ if (['text-input', 'text-area', 'number', 'switch', 'select', 'date-input', 'time-ago'].includes(item.option.type)) {
218
218
  res.push(item)
219
219
  }
220
220
  })
@@ -102,24 +102,25 @@
102
102
  <r-icon v-html="props.opened!==props.key?$r.icons.plus:$r.icons.minus"></r-icon>
103
103
  </r-btn>
104
104
  <slot name="cell" :value="value" :item="props.item" :editItem="editItem">
105
- <div v-if="value['option']['type']==='date-picker' && props.item[value['value']]!==undefined">
106
- {{$d(new Date(props.item[value['value']]),value['option']['format']||'short')}}
107
- </div>
108
- <div v-else-if="value['option']['type']==='time-ago' && props.item[value['value']]!==undefined">
109
- <r-time-ago :time="props.item[value['value']]"></r-time-ago>
110
- </div>
111
- <div v-else-if="value['option']['type']==='switch'">
112
- <r-switch
113
- :readonly="value['option']['formInput']===false"
114
- :modelValue="props.item[value['value']]"
115
- @update:modelValue="value['option']['formInput']!==false?editItem(props.item,true,value['value']):''"
116
- class="mt-0"
117
- ></r-switch>
118
- </div>
119
- <div v-else-if="value['option']['type'] === 'number'">
120
- {{ $n(props.item[value["value"]]) }}
121
- </div>
122
- <div v-else-if="value['option']['type']!=='action'">
105
+ <div v-if="value['option']['type']==='date-input' && props.item[value['value']]!==undefined">
106
+ {{ $d(new Date(props.item[value['value']]), value['option']['format'] || 'short') }}
107
+ </div>
108
+ <div
109
+ v-else-if="value['option']['type']==='time-ago' && props.item[value['value']]!==undefined">
110
+ <r-time-ago :time="props.item[value['value']]"></r-time-ago>
111
+ </div>
112
+ <div v-else-if="value['option']['type']==='switch-input'">
113
+ <r-switch-input
114
+ :readonly="value['option']['formInput']===false"
115
+ :modelValue="props.item[value['value']]"
116
+ @update:modelValue="value['option']['formInput']!==false?editItem(props.item,true,value['value']):''"
117
+ class="mt-0"
118
+ ></r-switch-input>
119
+ </div>
120
+ <div v-else-if="value['option']['type'] === 'number-input'">
121
+ {{ $n(props.item[value["value"]]) }}
122
+ </div>
123
+ <div v-else-if="value['option']['type']!=='action'">
123
124
  {{value['value'] in cast?
124
125
  $helper.ifHas(props.item,'',value['value'],cast[value['value']])
125
126
  :props.item[value['value']]}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "renusify",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Vue3 Framework",
5
5
  "keywords": [
6
6
  "vuejs",