renusify 2.1.4 → 2.1.7

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.
@@ -44,14 +44,14 @@
44
44
  >&lt;script&gt;<br/>export default {</span
45
45
  >
46
46
  <highlight-script ref="h-js" v-model="scr"></highlight-script>
47
- <span v-show="scriptShow" class="color-orange">}<br/>&lt;script&gt;</span>
47
+ <span v-show="scriptShow" class="color-orange">}<br/>&lt;/script&gt;</span>
48
48
  </div>
49
49
  <div>
50
50
  <span v-show="styleShow" class="color-orange"
51
51
  >&lt;style lang<span class="color-green">="css"</span>&gt;</span
52
52
  >
53
53
  <highlight-css ref="h-css" v-model="sty"></highlight-css>
54
- <span v-show="styleShow" class="color-orange">&lt;style&gt;</span>
54
+ <span v-show="styleShow" class="color-orange">&lt;/style&gt;</span>
55
55
  </div>
56
56
  </div>
57
57
  </div>
@@ -1 +1 @@
1
- export * as rContDown from './index.vue'
1
+ export * as rCountDown from './index.vue'
@@ -51,7 +51,7 @@
51
51
  :multiple="multiple"
52
52
  :modelValue="chips"
53
53
  :text="text"
54
- :val="value"
54
+ :value="value"
55
55
  @update:modelValue="listInput"
56
56
  checked>
57
57
  <template v-slot="props">
@@ -183,7 +183,7 @@ export default {
183
183
  })
184
184
  },
185
185
  getValue() {
186
- if (!this.searchLink && this.modelValue !== undefined && this.modelValue !== null) {
186
+ if (!this.searchLink && !this.tags && this.modelValue !== undefined && this.modelValue !== null) {
187
187
  if (typeof this.modelValue === 'string' || typeof this.modelValue === 'number') {
188
188
  const index = this.$helper.searchArray(this.genItems, this.value, this.modelValue)
189
189
  if (index === false) {
@@ -29,7 +29,7 @@
29
29
  color: var(--color-one)
30
30
  }
31
31
 
32
- img {
32
+ img, video {
33
33
  max-width: 100%;
34
34
  }
35
35
 
@@ -1,25 +1,25 @@
1
1
  <template>
2
- <div :class="classes">
3
- <div
4
- class="list-item h-space-between"
5
- :class="{'list-item-active':$helper.searchArray(list,text,item_value[text])!==false}"
6
- :key="item_key"
7
- @click.prevent="handle(item_value)"
8
- v-for="(item_value,item_key) in genItems"
9
- v-ripple
10
- >
11
- <slot :item="item_value">
12
- <div class="list-title">{{ item_value[text] }}</div>
13
- <transition name="fade">
14
- <r-icon class="pe-1"
15
- exact
16
- v-html="$r.icons.check"
17
- v-if="(checked&&$helper.searchArray(list,text,item_value[text])!==false)"
18
- ></r-icon>
19
- </transition>
20
- </slot>
21
- </div>
2
+ <div :class="classes">
3
+ <div
4
+ v-for="(item_value,item_key) in genItems"
5
+ :key="item_key"
6
+ v-ripple
7
+ :class="{'list-item-active':$helper.searchArray(list,text,item_value[text])!==false}"
8
+ class="list-item h-space-between"
9
+ @click.prevent="handle(item_value)"
10
+ >
11
+ <slot :item="item_value">
12
+ <div class="list-title">{{ item_value[text] }}</div>
13
+ <transition name="fade">
14
+ <r-icon v-if="(checked&&$helper.searchArray(list,text,item_value[text])!==false)"
15
+ class="pe-1"
16
+ exact
17
+ v-html="$r.icons.check"
18
+ ></r-icon>
19
+ </transition>
20
+ </slot>
22
21
  </div>
22
+ </div>
23
23
  </template>
24
24
 
25
25
  <script>
@@ -27,95 +27,96 @@ import './style.scss'
27
27
  import Ripple from '../../directive/ripple/index'
28
28
 
29
29
  export default {
30
- name: 'r-list',
31
- directives: {ripple: Ripple},
32
- props: {
33
- disabled: Boolean,
34
- multiple: Boolean,
35
- min: {type: Number, default: 0},
36
- text: {type: String, default: 'name'},
37
- value: {type: String, default: 'value'},
38
- flat: Boolean,
39
- rounded: Boolean,
40
- subheader: Boolean,
41
- checked: Boolean,
42
- filter: String,
43
- items: Array,
44
- modelValue: {type: [Array, Object]}
45
- },
46
- emits:['update:modelValue'],
47
- computed: {
48
- list() {
49
- if (this.modelValue) {
50
- return this.modelValue
51
- }
52
- return []
53
- },
54
- classes() {
55
- let c = `${this.$r.prefix}list`
56
- if (this.disabled) {
57
- c += ' list-disabled'
58
- }
59
- if (this.flat) {
60
- c += ' list-flat'
61
- }
30
+ name: 'r-list',
31
+ directives: {ripple: Ripple},
32
+ props: {
33
+ disabled: Boolean,
34
+ multiple: Boolean,
35
+ min: {type: Number, default: 0},
36
+ text: {type: String, default: 'name'},
37
+ value: {type: String, default: 'value'},
38
+ flat: Boolean,
39
+ rounded: Boolean,
40
+ subheader: Boolean,
41
+ checked: Boolean,
42
+ filter: String,
43
+ items: Array,
44
+ modelValue: {type: [Array, Object]}
45
+ },
46
+ emits: ['update:modelValue'],
47
+ computed: {
48
+ list() {
49
+ if (this.modelValue) {
50
+ return this.modelValue
51
+ }
52
+ return []
53
+ },
54
+ classes() {
55
+ let c = `${this.$r.prefix}list`
56
+ if (this.disabled) {
57
+ c += ' list-disabled'
58
+ }
59
+ if (this.flat) {
60
+ c += ' list-flat'
61
+ }
62
62
 
63
- if (this.rounded) {
64
- c += ' list-rounded'
65
- }
63
+ if (this.rounded) {
64
+ c += ' list-rounded'
65
+ }
66
66
 
67
- if (this.subheader) {
68
- c += ' list-subheader'
69
- }
70
- return c
71
- },
72
- genItems() {
73
- const res = []
74
- if (this.items) {
75
- const lng=this.items.length
76
- for (let i = 0; i < lng; i++) {
77
- if (typeof this.items[i] === 'object') {
78
- res[i] = this.items[i]
79
- } else {
80
- res[i] = {name: this.items[i].toString(), value: this.items[i]}
81
- }
82
- }
83
- }
84
- if (this.filter) {
85
- const re = new RegExp(this.filter, 'gi')
86
- return res.filter(function (el) {
87
- if (el.name && el.name.match(re)) {
88
- return el
89
- }
90
- })
91
- }
92
- return res
93
- }
94
- },
95
- methods: {
96
- handle(item) {
97
- if (this.disabled) {
98
- return
99
- }
100
- let val = this.list
101
-
102
- const index = this.$helper.searchArray(val, this.text, item[this.text])
103
-
104
- if (index !== false) {
105
- if (val.length > this.min) {
106
- val.splice(index, 1)
107
- }
108
- } else {
109
- if (!this.multiple) {
110
- val = []
111
- }
67
+ if (this.subheader) {
68
+ c += ' list-subheader'
69
+ }
70
+ return c
71
+ },
72
+ genItems() {
73
+ const res = []
74
+ if (this.items) {
75
+ const lng = this.items.length
76
+ for (let i = 0; i < lng; i++) {
77
+ if (typeof this.items[i] === 'object') {
78
+ res[i] = this.items[i]
79
+ } else {
80
+ res[i] = {[this.text]: this.items[i].toString(), [this.value]: this.items[i]}
81
+ }
82
+ }
83
+ }
84
+ if (this.filter) {
85
+ const re = new RegExp(this.filter, 'gi')
86
+ const text = this.text
87
+ return res.filter(function (el) {
88
+ if (el[text] && el[text].match(re)) {
89
+ return el
90
+ }
91
+ })
92
+ }
93
+ return res
94
+ }
95
+ },
96
+ methods: {
97
+ handle(item) {
98
+ if (this.disabled) {
99
+ return
100
+ }
101
+ let val = this.list
112
102
 
113
- val.push(item)
114
- }
103
+ const index = this.$helper.searchArray(val, this.text, item[this.text])
115
104
 
116
- this.$emit('update:modelValue', this.multiple?val:val[0])
117
- }
105
+ if (index !== false) {
106
+ if (val.length > this.min) {
107
+ val.splice(index, 1)
118
108
  }
109
+ } else {
110
+ if (!this.multiple) {
111
+ val = []
112
+ }
113
+
114
+ val.push(item)
115
+ }
119
116
 
117
+ this.$emit('update:modelValue', this.multiple ? val : val[0])
120
118
  }
119
+ }
120
+
121
+ }
121
122
  </script>
@@ -27,7 +27,7 @@
27
27
 
28
28
  .modal-content {
29
29
  border: 1px solid var(--color-sheet-container-low);
30
- background-color: var(--color-sheet);
30
+ background-color: var(--color-sheet-container-low);
31
31
  color: var(--color-on-sheet)
32
32
  }
33
33
 
@@ -23,7 +23,7 @@
23
23
  >
24
24
  <r-icon v-html="$r.icons.delete"></r-icon>
25
25
  </r-btn-confirm>
26
- <slot :item="item"></slot>
26
+ <slot :item="item">{{ item }}</slot>
27
27
  </div>
28
28
 
29
29
  <div v-if="hasChildren" class="nestable-list ms-5">
@@ -54,7 +54,7 @@
54
54
  >
55
55
  <r-icon v-html="$r.icons.delete"></r-icon>
56
56
  </r-btn-confirm>
57
- <slot :item="item" itemscope></slot>
57
+ <slot :item="item" itemscope>{{ item }}</slot>
58
58
  </template>
59
59
  </NestableItem>
60
60
  </template>
@@ -1,7 +1,7 @@
1
1
  export default {
2
2
  data() {
3
3
  return {
4
- name: null,
4
+ form: {},
5
5
  };
6
6
  },
7
7
  methods: {
@@ -20,13 +20,13 @@ export default {
20
20
  },
21
21
  add() {
22
22
  let items = this.modelValue;
23
- items.push({
24
- title: this.name,
23
+ Object.assign(this.form, {
25
24
  [this.keyProp]: this.lastId(items) + 1,
26
25
  [this.childrenProp]: [],
27
- });
26
+ })
27
+ items.push(this.form);
28
28
  this.$emit("update:model-value", items);
29
- this.name = null;
29
+ this.form = {};
30
30
  },
31
31
  del(item) {
32
32
  const removePath = this.getSplicePath(
@@ -22,12 +22,14 @@
22
22
  </template>
23
23
  </div>
24
24
  <div v-if="editable" class="d-flex v-end w-full">
25
- <div class="pe-1 flex-grow-1">
26
- <r-text-input v-model="name" :label="labelInput"></r-text-input>
27
- </div>
28
- <r-btn :disabled="!name" class="color-success" icon @click="add">
29
- <r-icon v-html="$r.icons.plus"></r-icon>
30
- </r-btn>
25
+ <slot :add="add" :form="form" name="form">
26
+ <div class="pe-1 flex-grow-1">
27
+ <r-text-input v-model="form.title" :label="labelInput"></r-text-input>
28
+ </div>
29
+ <r-btn :disabled="!form.title" class="color-success" icon @click="add">
30
+ <r-icon v-html="$r.icons.plus"></r-icon>
31
+ </r-btn>
32
+ </slot>
31
33
  </div>
32
34
  </div>
33
35
  </template>
@@ -31,7 +31,7 @@
31
31
  :is="item['type']"
32
32
  :label="$t(key,'renusify')"
33
33
  v-model="copyItem['d'][key]"
34
- v-bind="getAttr(table.option[key],copyItem['t'])"
34
+ v-bind="getAttr(table.option[key],copyItem['t'])['props']"
35
35
  ></component>
36
36
  </template>
37
37
  </div>
package/index.js CHANGED
@@ -101,31 +101,39 @@ export default {
101
101
  }
102
102
  }
103
103
  }
104
-
104
+ app.provide('$r', app.config.globalProperties.$r)
105
105
  // renusify toast
106
106
  app.config.globalProperties.$toast = function (message, options) {
107
107
  Toast.show(message, options);
108
108
  }
109
+ app.provide('$toast', app.config.globalProperties.$toast)
109
110
  // renusify storage
110
111
  app.config.globalProperties.$storage = Storage
112
+ app.provide('$storage', app.config.globalProperties.$storage)
111
113
 
112
114
  // renusify helper
113
115
  app.config.globalProperties.$helper = helper
116
+ app.provide('$helper', app.config.globalProperties.$helper)
114
117
  // renusify translate
115
118
  app.config.globalProperties.$translate = new Translate(app.config.globalProperties.$r, app.config.globalProperties.$storage)
119
+ app.provide('$translate', app.config.globalProperties.$translate)
116
120
  app.config.globalProperties.$dateTime = new DateTime(app.config.globalProperties.$r, app.config.globalProperties.$r.langs)
121
+ app.provide('$dateTime', app.config.globalProperties.$dateTime)
117
122
  app.config.globalProperties.$t = (key, package_name = null, lang = null) => app.config.globalProperties.$translate.get(key, package_name, lang)
123
+ app.provide('$t', app.config.globalProperties.$t)
118
124
  app.config.globalProperties.$d = (value, key = 'long', local = null) => app.config.globalProperties.$dateTime.formatLocal(value, key, local)
125
+ app.provide('$d', app.config.globalProperties.$d)
119
126
  const c = new Currency(app.config.globalProperties.$r)
120
127
  app.config.globalProperties.$n = (value) => c.formatLocal(value)
128
+ app.provide('$n', app.config.globalProperties.$n)
121
129
  // renusify validation
122
130
  const v = new valid(app.config.globalProperties.$t)
123
131
  app.config.globalProperties.$v = (names) => v.checkType(names)
124
-
132
+ app.provide('$v', app.config.globalProperties.$v)
125
133
  // install components
126
134
  let required_directive = _register(app, options['components'] || {});
127
135
  if (options['directives']) {
128
- Object.assign(required_directive,options['directives'])
136
+ Object.assign(required_directive, options['directives'])
129
137
  }
130
138
  // install directives
131
139
  _registers(app, required_directive);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "renusify",
3
- "version": "2.1.4",
3
+ "version": "2.1.7",
4
4
  "description": "Vue3 Framework",
5
5
  "keywords": [
6
6
  "vuejs",
@@ -99,7 +99,7 @@ export default class Translate {
99
99
  return val;
100
100
  } else if (this.$r && this.$r.autoAddTranslate && pack && this._count < 100 && /^([0-9a-z_.])*$/.test(key)) {
101
101
  if (!this._store.includes(key)) {
102
- let url = '/translate/' + pack + '/' + key + '?v=';
102
+ let url = '/api/translate/' + pack + '/' + key + '?v=';
103
103
  const lng = variable.length
104
104
  for (let i = 0; i < lng; i++) {
105
105
  url += '{' + i + '}';