renusify 2.2.1 → 2.2.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.
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div ref="containerMessage"
3
- class="container-message-list" v-scroll="handle">
3
+ v-scroll.window="handle" class="container-message-list">
4
4
  <div v-for="message in messages" :key="message._id" class="message-container">
5
5
  <r-chat-message @see="$emit('see', $event)" :message="message" :is-me="message.user_id===myself.id"
6
6
  :user="message.user_id===myself.id?myself:participants[message.user_id]"></r-chat-message>
@@ -5,7 +5,7 @@
5
5
  v-for="(item, i) in allWPH"
6
6
  :key="i"
7
7
  :class="{ 'color-one-text': item === currentWPH }"
8
- class="me-1 mb-1 cursor-pointer"
8
+ class="ma-1 cursor-pointer"
9
9
  label
10
10
  outlined
11
11
  @click.prevent="changeWPH(item)"
@@ -15,7 +15,7 @@
15
15
  v-model="state"
16
16
  :disabled="!country"
17
17
  :key="country&&country['id']"
18
- v-if="!hideState"
18
+ v-if="show_state"
19
19
  @update:model-value="emit(false,true)"
20
20
  :searchLink="country&&`https://codenus.com/api/apps/address/${country['id']}?lang=${$r.lang}`"
21
21
  :rules="required?['required']:[]"
@@ -25,7 +25,7 @@
25
25
  :tile="tile">
26
26
 
27
27
  </r-select-input>
28
- <r-select-input v-if="!hideCity"
28
+ <r-select-input v-if="show_city"
29
29
  v-model="city"
30
30
  :disabled="!state"
31
31
  :key="state&&(country['id']+'-'+state['id'])"
@@ -39,13 +39,13 @@
39
39
  :tile="tile">
40
40
 
41
41
  </r-select-input>
42
- <r-text-input v-if="!hideZipCode" @update:model-value="emit(false,false)"
42
+ <r-text-input v-if="show_zip" @update:model-value="emit(false,false)"
43
43
  :label="$t('zip_code','renusify')"
44
44
  v-model="zip_code"
45
45
  :tile="tile"
46
46
  :readonly="readonly"
47
47
  :rules="required?['required']:[]"></r-text-input>
48
- <r-text-area v-if="!hideStreet" @update:model-value="emit(false,false)"
48
+ <r-text-area v-if="show_street" @update:model-value="emit(false,false)"
49
49
  :label="$t('street','renusify')"
50
50
  v-model="street"
51
51
  :tile="tile"
@@ -59,6 +59,7 @@ export default {
59
59
  inheritAttrs: false,
60
60
  props: {
61
61
  required: Boolean,
62
+ stepShow: Boolean,
62
63
  allowCountries: Array,
63
64
  hideState: Boolean,
64
65
  hideCity: Boolean,
@@ -81,13 +82,43 @@ export default {
81
82
  },
82
83
  watch: {
83
84
  modelValue() {
84
- this.country = this.modelValue ? this.modelValue.country : null
85
+ this.country = this.modelValue ? this.modelValue.country : (this.defaultCountry ? this.defaultCountry : null)
85
86
  this.state = this.modelValue ? this.modelValue.state : null
86
87
  this.city = this.modelValue ? this.modelValue.city : null
87
88
  this.zip_code = this.modelValue ? this.modelValue.zip_code : null
88
89
  this.street = this.modelValue ? this.modelValue.street : null
89
90
  }
90
91
  },
92
+ computed: {
93
+ show_state() {
94
+ if (this.stepShow) {
95
+ return !this.hideState && this.country
96
+ } else {
97
+ return !this.hideState
98
+ }
99
+ },
100
+ show_city() {
101
+ if (this.stepShow) {
102
+ return !this.hideCity && this.state
103
+ } else {
104
+ return !this.hideCity
105
+ }
106
+ },
107
+ show_street() {
108
+ if (this.stepShow) {
109
+ return !this.hideStreet && this.city
110
+ } else {
111
+ return !this.hideStreet
112
+ }
113
+ },
114
+ show_zip() {
115
+ if (this.stepShow) {
116
+ return !this.hideZipCode && this.city
117
+ } else {
118
+ return !this.hideZipCode
119
+ }
120
+ }
121
+ },
91
122
  methods: {
92
123
  emit(clearState = false, clearCity = false) {
93
124
  setTimeout(() => {
@@ -56,7 +56,7 @@ export default {
56
56
  let wPH = []
57
57
  if (is_array) {
58
58
  this.wPH.forEach((item) => {
59
- item = item.split('/')
59
+ item = item.toString().split('/')
60
60
  if (item.length === 2) {
61
61
  wPH.push(parseFloat(item[0]) / parseFloat(item[1]))
62
62
 
@@ -21,7 +21,8 @@
21
21
  @click.prevent="open">
22
22
  <r-icon v-html="$r.icons.plus"></r-icon>
23
23
  </r-btn>
24
- <div v-else-if="show" class="d-flex v-baseline">
24
+ <div v-else-if="show" class="d-flex v-baseline flex-wrap">
25
+ <slot :add="add" :info="info">
25
26
  <r-text-input
26
27
  v-if="!is_array"
27
28
  v-model="info.key"
@@ -50,6 +51,7 @@
50
51
  :tile="tile"
51
52
  v-model="info.value" :label="valueLabel||$t('value','renusify')"></r-switch-input>
52
53
  <r-btn :rounded="!c_tile" class="ms-1 color-success" @click.prevent="add">{{ $t('add', 'renusify') }}</r-btn>
54
+ </slot>
53
55
  </div>
54
56
  </div>
55
57
  <div v-else :class="{'state-error':error}" class="json-highlight ltr">
@@ -1,5 +1,19 @@
1
1
  <template>
2
2
  <div :class="`${$r.prefix}input-tel`">
3
+ <r-btn :disabled="!select||readonly"
4
+ :rounded="!c_tile" class="btn-country ltr ms-1" outlined @click.stop="toggleDropdown">
5
+ <div :class="activeCountry.iso2.toLowerCase()" class="iti-flag"></div>
6
+ <span class="country-code pa-1"> +{{ activeCountry.dialCode }} </span>
7
+ <span class="dropdown-arrow">{{ open ? "▲" : "▼" }}</span>
8
+ </r-btn>
9
+ <r-text-input v-model="tel.phone" :label="label?label:$t('phone','renusify')"
10
+ :readonly="readonly"
11
+ :rules="required?['required','number']:['number']"
12
+ :tile="c_tile"
13
+ class="input-phone"
14
+ @update:model-value="emit"
15
+ >
16
+ </r-text-input>
3
17
  <r-modal
4
18
  v-model="open"
5
19
  >
@@ -20,21 +34,6 @@
20
34
  </r-list>
21
35
  </div>
22
36
  </r-modal>
23
- <r-btn class="btn-country ltr ms-1"
24
- :rounded="!c_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="c_tile"
32
- :readonly="readonly"
33
- :rules="required?['required','number']:['number']"
34
- v-model="tel.phone"
35
- >
36
- </r-text-input>
37
-
38
37
  </div>
39
38
  </template>
40
39
 
@@ -62,7 +61,7 @@ export default {
62
61
  }
63
62
 
64
63
  },
65
- emits:['update:modelValue'],
64
+ emits: ['update:modelValue'],
66
65
  data() {
67
66
  return {
68
67
  tel: {
@@ -75,19 +74,19 @@ export default {
75
74
  open: false
76
75
  }
77
76
  },
78
- mounted() {
79
- import('./assets/all-countries.js').then((d)=>{
77
+ created() {
78
+ import('./assets/all-countries.js').then((d) => {
80
79
  this.countries = d.default;
81
- this.initializeCountry()
80
+ if (this.modelValue) {
81
+ let a = this.modelValue.split(' ')
82
+ this.tel.country_code = a[0]
83
+ this.tel.phone = a[1]
84
+ this.activeCountry = this.findCountryByCode(this.tel.country_code)
85
+ } else {
86
+ this.initializeCountry()
87
+ }
82
88
  })
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
- }
89
+
91
90
  },
92
91
  computed: {
93
92
  c_tile() {
@@ -109,6 +108,9 @@ export default {
109
108
  findCountry(iso = '') {
110
109
  return this.countries.find(country => country.iso2 === iso)
111
110
  },
111
+ findCountryByCode(code = '') {
112
+ return this.countries.find(country => country.dialCode === code)
113
+ },
112
114
 
113
115
  choose(country) {
114
116
  this.activeCountry = country
@@ -152,15 +154,16 @@ export default {
152
154
  display: flex;
153
155
  align-items: baseline;
154
156
  direction: ltr;
155
-
157
+ flex-wrap: wrap;
156
158
  .btn-country {
157
- width: 120px;
159
+ width: 100px;
158
160
  border-color: var(--color-sheet-low)
159
161
 
160
162
  }
161
163
 
162
164
  .input-phone {
163
- width: calc(100% - 120px);
165
+ width: calc(100% - 104px);
166
+ min-width: 150px;
164
167
  }
165
168
  }
166
169
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div v-intersect[modifier]="check" :class="{
2
+ <div v-intersect.[modifier]="check" :class="{
3
3
  [$r.prefix+'img']:true,
4
4
  'img-hoverZoom':hoverZoom,'img-hoverDark':hoverDark,'img-hoverTitle':hoverTitle}"
5
5
  ref="rImg">
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="infinite-page">
3
- <div class="infinite-page-container" v-scroll="onScroll">
3
+ <div v-scroll.window="onScroll" class="infinite-page-container">
4
4
  <slot :items="datacollection" :total="total"></slot>
5
5
  </div>
6
6
  <r-progress-line color="color-two"
@@ -34,7 +34,7 @@
34
34
  @focusout="active = false"
35
35
  @input="handle"
36
36
  />
37
- <r-icon v-html="$r.icons.search"></r-icon>
37
+ <r-icon class="mx-1" v-html="$r.icons.search"></r-icon>
38
38
  </span>
39
39
  </div>
40
40
  <r-card
@@ -305,6 +305,8 @@ export default {
305
305
  list-style: none;
306
306
  padding: 0;
307
307
  white-space: nowrap;
308
+ max-width: 100%;
309
+ overflow: auto;
308
310
  }
309
311
 
310
312
  .slider-dot {
@@ -1,252 +1,155 @@
1
1
  <template>
2
- <div>
3
- <r-container class="container-fluid">
4
- <r-row class="h-start h-space-between">
5
- <r-col class="col-auto">
6
- <r-btn @click.prevent="newItem"
7
- v-if="!disableAdd"
8
- class="color-success-text"
9
- outlined
10
- rounded>{{ $t('new', 'renusify') }}
2
+ <div>
3
+ <r-container class="container-fluid">
4
+ <r-row class="h-start h-space-between">
5
+ <r-col class="col-auto">
6
+ <r-btn v-if="!disableAdd"
7
+ class="color-success-text"
8
+ outlined
9
+ rounded
10
+ @click.prevent="newItem">{{ $t('new', 'renusify') }}
11
+ </r-btn>
12
+ </r-col>
13
+ <r-col class="col-auto">
14
+ <template v-if="mcud">
15
+ <r-btn class="color-error mx-1" icon @click.prevent="showConfirm=true">
16
+ <r-icon v-html="$r.icons.delete"></r-icon>
11
17
  </r-btn>
12
- </r-col>
13
- <r-col class="col-auto">
14
- <template v-if="mcud">
15
- <r-btn class="color-error mx-1" icon @click.prevent="showConfirm=true">
16
- <r-icon v-html="$r.icons.delete"></r-icon>
17
- </r-btn>
18
- <r-btn icon class="color-success mx-1" @click.prevent="$emit('copy',true)">
19
- <r-icon v-html="$r.icons.copy"></r-icon>
20
- </r-btn>
21
- <r-btn icon class="color-info mx-1" @click.prevent="$emit('edit',true)">
22
- <r-icon v-html="$r.icons.edit"></r-icon>
23
- </r-btn>
24
- </template>
25
- <r-btn @click.prevent="open"
26
- v-if="advanceSearch"
27
- :class="{'color-info':!show,'color-error':show}"
28
- rounded>{{$t(!show?'advance_search':'search','renusify')}}
29
- </r-btn>
30
- </r-col>
31
- <r-col v-if="!show" class="col-12">
32
- <r-text-input :label="$t('search','renusify')"
33
- @update:modelValue="$emit('update:modelValue',$event)"
34
- :model-value="search"></r-text-input>
35
- </r-col>
36
- <r-col v-else class="col-12">
37
- <r-container class="pa-0" full-width>
38
- <r-select-input :model-value="select" :items="header" text="text" disableSearch
39
- :label="$t('add','renusify')" @update:model-value="add"></r-select-input>
40
- <r-divider class="my-3"></r-divider>
41
- <template v-for="(item,i) in inputs" :key="i">
42
- <r-row v-if="['r-text-input','r-text-area'].includes(item.option.type)" class="v-baseline">
43
- <r-col class="col-5 md-3">
44
- <r-select-input v-model="item.advance.action"
45
- :items="[
46
- {name:$t('advance_search_like','renusify'),value:'r'},
47
- {name:$t('advance_search_not_like','renusify'),value:'nr'},
48
- {name:$t('advance_search_equal','renusify'),value:'e'},
49
- {name:$t('advance_search_not_equal','renusify'),value:'ne'},
50
- {name:$t('advance_search_id','renusify'),value:'_id'}
51
- ]"
52
- justValue
53
- disableSearch
54
- firstSelect
55
- :label="$t('advance_search_operator','renusify')"></r-select-input>
56
- </r-col>
57
- <r-col class="col-6 md-8">
58
- <r-text-input v-model="item.advance.search" :label="item.text"></r-text-input>
59
- </r-col>
60
- <r-col class="col-1">
61
- <r-btn class="color-error" icon @click.prevent="del(i)">
62
- <r-icon v-html="$r.icons.delete"></r-icon>
63
- </r-btn>
64
- </r-col>
65
- </r-row>
66
- <r-row v-else-if="'r-number-input'===item.option.type" class="v-baseline">
67
- <r-col class="col-6 md-3">
68
- <r-select-input v-model="item.advance.action"
69
- :items="[
18
+ <r-btn class="color-success mx-1" icon @click.prevent="$emit('copy',true)">
19
+ <r-icon v-html="$r.icons.copy"></r-icon>
20
+ </r-btn>
21
+ <r-btn class="color-info mx-1" icon @click.prevent="$emit('edit',true)">
22
+ <r-icon v-html="$r.icons.edit"></r-icon>
23
+ </r-btn>
24
+ </template>
25
+ <r-btn v-if="advanceSearch"
26
+ :class="{'color-info':!show,'color-error':show}"
27
+ rounded
28
+ @click.prevent="open">{{ $t(!show ? 'advance_search' : 'search', 'renusify') }}
29
+ </r-btn>
30
+ </r-col>
31
+ <r-col v-if="!show" class="col-12">
32
+ <r-text-input :label="$t('search','renusify')"
33
+ :model-value="search"
34
+ @update:modelValue="$emit('update:modelValue',$event)"></r-text-input>
35
+ </r-col>
36
+ <r-col v-else class="col-12">
37
+ <r-container class="pa-0" full-width>
38
+ <r-json-input v-model="advance"
39
+ :label="$t('search','renusify')">
40
+ <template v-slot="{info,add}">
41
+ <r-select-input v-model="info.key"
42
+ :items="headers[0]"
43
+ :label="$t('name','renusify')"
44
+ just-value></r-select-input>
45
+ <div v-if="info.key" :key="info.key">
46
+ <r-select-input v-model="info.action"
47
+ :items="[
70
48
  {name:$t('advance_search_equal','renusify'),value:'e'},
71
49
  {name:$t('advance_search_not_equal','renusify'),value:'ne'},
72
50
  {name:$t('advance_search_gt','renusify'),value:'gt'},
73
- {name:$t('advance_search_gte','renusify'),value:'gte'},
74
- {name:$t('advance_search_lt','renusify'),value:'lt'},
75
- {name:$t('advance_search_lte','renusify'),value:'lte'}]"
76
- firstSelect
77
- justValue
78
- disableSearch
79
- :label="$t('advance_search_operator','renusify')"></r-select-input>
80
- </r-col>
81
- <r-col class="col-6 md-8">
82
- <r-number-input v-model="item.advance.search" :label="item.text"></r-number-input>
83
- </r-col>
84
- <r-col class="col-1">
85
- <r-btn class="color-error" icon @click.prevent="del(i)">
86
- <r-icon v-html="$r.icons.delete"></r-icon>
87
- </r-btn>
88
- </r-col>
89
- </r-row>
90
- <r-row v-else-if="'r-switch-input'===item.option.type" class="v-baseline">
91
- <r-col class="col-5 md-3">
92
- <r-select-input v-model="item.advance.action"
93
- :items="[
94
- {name:$t('advance_search_equal','renusify'),value:'e'}
95
- ]"
96
- justValue
97
- firstSelect
98
- disableSearch
99
- :label="$t('advance_search_operator','renusify')"></r-select-input>
100
- </r-col>
101
- <r-col class="col-6 md-8">
102
- <r-switch-input v-model="item.advance.search" :label="item.text"></r-switch-input>
103
- </r-col>
104
- <r-col class="col-1">
105
- <r-btn class="color-error" icon @click.prevent="del(i)">
106
- <r-icon v-html="$r.icons.delete"></r-icon>
107
- </r-btn>
108
- </r-col>
109
- </r-row>
110
- <r-row v-else-if="'r-select-input'===item.option.type" class="v-baseline">
111
- <r-col class="col-5 md-3">
112
- <r-select-input v-model="item.advance.action"
113
- :items="[
114
- {name:$t('advance_search_in','renusify'),value:'in'},
115
- {name:$t('advance_search_not_in','renusify'),value:'nin'}
116
- ]"
117
- justValue
118
- firstSelect
119
- disableSearch
120
- :label="$t('advance_search_operator','renusify')"></r-select-input>
121
- </r-col>
122
- <r-col class="col-6 md-8">
123
- <r-select-input v-model="item.advance.search" :label="item.text" :items="item.option.items"
124
- justValue multiple tags></r-select-input>
125
- </r-col>
126
- <r-col class="col-1">
127
- <r-btn class="color-error" icon @click.prevent="del(i)">
128
- <r-icon v-html="$r.icons.delete"></r-icon>
129
- </r-btn>
130
- </r-col>
131
- </r-row>
132
- <r-row v-else-if="'r-json-input'===item.option.type" class="v-baseline">
133
- <r-col class="col-5 md-3">
134
- <r-select-input v-model="item.advance.action"
135
- :items="[
136
- {name:$t('advance_search_equal','renusify'),value:'e'},
137
- {name:$t('advance_search_not_equal','renusify'),value:'ne'}
138
- ]"
139
- :label="$t('advance_search_operator','renusify')"
140
- disableSearch
141
- firstSelect
142
- justValue></r-select-input>
143
- </r-col>
144
- <r-col class="col-6 md-8">
145
- <r-json-input v-model="item.advance.search" :label="item.text"></r-json-input>
146
- </r-col>
147
- <r-col class="col-1">
148
- <r-btn class="color-error" icon @click.prevent="del(i)">
149
- <r-icon v-html="$r.icons.delete"></r-icon>
150
- </r-btn>
151
- </r-col>
152
- </r-row>
153
- <r-row v-else-if="['r-date-input','r-time-ago'].includes(item.option.type)" class="v-baseline">
154
- <r-col class="col-5 md-3" :a="item.advance.t='date'">
155
- <r-select-input v-model="item.advance.action"
156
- :items="[
157
- {name:$t('advance_search_gt','renusify'),value:'gt'},
158
- {name:$t('advance_search_gte','renusify'),value:'gte'},
159
- {name:$t('advance_search_lt','renusify'),value:'lt'},
160
- {name:$t('advance_search_lte','renusify'),value:'lte'}
161
- ]"
162
- justValue
163
- disableSearch
164
- firstSelect
165
- :label="$t('advance_search_operator','renusify')"></r-select-input>
166
- </r-col>
167
- <r-col class="col-6 md-8">
168
- <r-date-input with-time v-model="item.advance.search" :label="item.text"></r-date-input>
169
- </r-col>
170
- <r-col class="col-1">
171
- <r-btn class="color-error" icon @click.prevent="del(i)">
172
- <r-icon v-html="$r.icons.delete"></r-icon>
173
- </r-btn>
174
- </r-col>
175
- </r-row>
176
- </template>
177
- <r-btn block rounded class="color-info" :loading="loading" @click.prevent="send">{{$t('search','renusify')}}</r-btn>
178
- </r-container>
179
- </r-col>
180
- </r-row>
181
- </r-container>
182
- <r-progress-line v-if="loading" color="color-one"></r-progress-line>
183
- <r-confirm
184
- hard
185
- v-model="showConfirm"
186
- v-on:accept="accept"
187
- v-on:cancel="showConfirm = false"
188
- />
189
- </div>
51
+ {name:$t('advance_search_lt','renusify'),value:'lt'}]"
52
+ :label="$t('advance_search_operator','renusify')"
53
+ disableSearch
54
+ firstSelect
55
+ justValue></r-select-input>
56
+ </div>
57
+ <div v-if="info.key" :key="info.key">
58
+ <component :is="headers[1][info.key].type" v-if="headers[1][info.key].type"
59
+ v-model="info.value"
60
+ :label="$t('search','renusify')"
61
+ v-bind="headers[1][info.key].props"></component>
62
+ </div>
63
+ <r-btn :rounded="!$r.inputs.tile" class="ms-1 color-success" @click.prevent="added(info,add)">
64
+ {{ $t('add', 'renusify') }}
65
+ </r-btn>
66
+ </template>
67
+ </r-json-input>
68
+
69
+ <r-btn :loading="loading" block class="color-info mt-2" rounded @click.prevent="send">
70
+ {{ $t('search', 'renusify') }}
71
+ </r-btn>
72
+ </r-container>
73
+ </r-col>
74
+ </r-row>
75
+ </r-container>
76
+ <r-progress-line v-if="loading" color="color-one"></r-progress-line>
77
+ <r-confirm
78
+ v-model="showConfirm"
79
+ hard
80
+ v-on:accept="accept"
81
+ v-on:cancel="showConfirm = false"
82
+ />
83
+ </div>
190
84
  </template>
191
85
  <script>
192
- export default {
193
- name: 'manageHeader',
194
- props: {
195
- headerTable: Object,
196
- loading: Boolean,
197
- disableAdd: Boolean,
198
- advanceSearch: Boolean,
199
- mcud: Boolean,
200
- newItem: Function,
201
- search: String
202
- },
203
- emits:['update:modelValue','copy','edit','delete','a-search'],
204
- data() {
205
- return {
206
- show: false,
207
- showConfirm: false,
208
- select: [],
209
- inputs: []
210
- }
211
- },
212
- methods: {
213
- accept(){
214
- this.$emit('delete',true)
215
- this.showConfirm=false
216
- },
217
- send() {
218
- this.$emit('update:modelValue', '')
219
- let r = []
220
- this.inputs.forEach((item) => {
221
- r.push({'name': item.value, 'advance': item.advance})
222
- })
223
- this.$emit('a-search', r)
224
- },
225
- del(i){
226
- this.inputs.splice(i,1)
227
- },
228
- open(){
229
- this.show=!this.show
230
- },
231
- add($event) {
232
- this.inputs.push($event)
233
- $event.advance = {}
234
- if ($event.option.type === 'r-switch-input') {
235
- $event.advance.search = false
236
- }
237
- this.select = []
238
- }
239
- },
240
- computed: {
241
- header() {
242
- let res = []
243
- this.headerTable.forEach((item) => {
244
- if (['r-text-input', 'r-text-area', 'r-number-input', 'r-switch-input', 'r-select-input', 'r-json-input', 'r-date-input', 'r-time-ago'].includes(item.option.type)) {
245
- res.push(item)
246
- }
247
- })
248
- return res
249
- }
250
- }
86
+ export default {
87
+ name: 'manageHeader',
88
+ props: {
89
+ headerTable: Object,
90
+ loading: Boolean,
91
+ disableAdd: Boolean,
92
+ advanceSearch: Boolean,
93
+ mcud: Boolean,
94
+ newItem: Function,
95
+ search: String
96
+ },
97
+ emits: ['update:modelValue', 'copy', 'edit', 'delete', 'a-search'],
98
+ data() {
99
+ return {
100
+ show: false,
101
+ showConfirm: false,
102
+ advance: null
103
+ }
104
+ },
105
+ computed: {
106
+ headers() {
107
+ let r = []
108
+ let r2 = {}
109
+ for (let i = 0; i < this.headerTable.length; i++) {
110
+ r.push({'name': this.$t(this.headerTable[i].text), 'value': this.headerTable[i].value})
111
+ r2[this.headerTable[i].value] = this.headerTable[i].option
112
+ }
113
+ return [r, r2]
251
114
  }
115
+ },
116
+ methods: {
117
+ added(info, add) {
118
+ let item = this.headers[1][info.key]
119
+ if (info.key === '_id' || item.is_object_id) {
120
+ info.value = {'$oid': info.value}
121
+ } else if (item.type === 'r-date-input' || item.type === 'r-time-ago') {
122
+ if (info.action === 'eq') {
123
+ info.value = {'$date': info.value}
124
+ } else if (info.action === 'ne') {
125
+ info.value = {'$ne': {'$date': info.value}}
126
+ } else if (info.action === 'gt') {
127
+ info.value = {'$gt': {'$date': info.value}}
128
+ } else if (info.action === 'lt') {
129
+ info.value = {'$lt': {'$date': info.value}}
130
+ }
131
+ } else {
132
+ if (info.action === 'ne') {
133
+ info.value = {'$ne': info.value}
134
+ } else if (info.action === 'gt') {
135
+ info.value = {'$gt': info.value}
136
+ } else if (info.action === 'lt') {
137
+ info.value = {'$lt': info.value}
138
+ }
139
+ }
140
+ add()
141
+ },
142
+ accept() {
143
+ this.$emit('delete', true)
144
+ this.showConfirm = false
145
+ },
146
+ send() {
147
+ this.$emit('update:modelValue', '')
148
+ this.$emit('a-search', this.advance)
149
+ },
150
+ open() {
151
+ this.show = !this.show
152
+ },
153
+ }
154
+ }
252
155
  </script>
@@ -14,7 +14,4 @@ export * as l_col from '../../container/col.js'
14
14
  export * as l_divider from '../../container/divider.js'
15
15
  export * as l_json from '../../form/jsonInput/index.js'
16
16
  export * as l_text from '../../form/textInput/index.js'
17
- export * as l_select from '../../form/selectInput/index.js'
18
- export * as l_date from '../../form/dateInput/index.js'
19
- export * as l_number from '../../form/numberInput/index.js'
20
17
  export * as l_switch from '../../form/switchInput/index.js'
@@ -400,7 +400,7 @@ export default {
400
400
  params.a_search = JSON.stringify(this.a_search)
401
401
  }
402
402
 
403
- this.setup('/' + this.link, params)
403
+ this.setup(this.link, params)
404
404
  },
405
405
  searching() {
406
406
  clearTimeout(this.time_out_id)
@@ -3,7 +3,12 @@ function mounted (el, binding) {
3
3
  const options = binding.options || {
4
4
  passive: true
5
5
  }
6
- const target = binding.arg ? document.querySelector(binding.arg) : window
6
+ let target = el
7
+ if (binding.modifiers.window) {
8
+ target = window
9
+ } else if (binding.arg) {
10
+ target = document.querySelector(binding.arg)
11
+ }
7
12
  if (!target) return
8
13
  target.addEventListener('scroll', callback, options)
9
14
  el._onScroll = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "renusify",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "Vue3 Framework",
5
5
  "keywords": [
6
6
  "vuejs",