free-fe-core-modules 0.0.50 → 0.0.52

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.
@@ -18,7 +18,7 @@
18
18
  :key="index"
19
19
  clickable
20
20
  v-close-popup
21
- @click="theme = tm"
21
+ @click="setTheme(tm)"
22
22
  :active="theme === tm"
23
23
  >
24
24
  <q-item-section>{{$t(tm)}}</q-item-section>
@@ -39,6 +39,7 @@ export default defineComponent({
39
39
  icon: { type: String, default: 'fas fa-palette' },
40
40
  dense: { type: Boolean, default: true },
41
41
  hide: { type: Boolean, default: false },
42
+ reload: { type: Boolean, default: false },
42
43
  },
43
44
  data() {
44
45
  return {
@@ -102,6 +103,17 @@ export default defineComponent({
102
103
  const appStore = useAppStore();
103
104
  this.theme = appStore.theme || this.ctx.config.defaultTheme || (this.themes && (this.themes.length > 0) && this.themes[0]);
104
105
  },
106
+ methods: {
107
+ setTheme(tm) {
108
+ if (!tm || this.theme === tm) return;
109
+
110
+ this.theme = tm;
111
+
112
+ if (this.reload) {
113
+ window.location.reload();
114
+ }
115
+ },
116
+ },
105
117
  });
106
118
  </script>
107
119
 
@@ -157,7 +157,7 @@ export default defineComponent({
157
157
 
158
158
  const inputNode = computed(() => h(QInput, {
159
159
  type: mask.value ? 'text' : 'number',
160
- mask,
160
+ mask: mask.value,
161
161
  maxlength: props.Field.Options?.MaxLength,
162
162
  autocomplete: 'off',
163
163
  // bottomSlots: true,
@@ -166,10 +166,10 @@
166
166
  {{$t(option.opt.Tooltip) || ''}}
167
167
  </q-tooltip>
168
168
  <div class="option-inner-extra" v-if="option.InnerExtra?.length">
169
- <input-field
169
+ <free-field
170
170
  v-for="(fld, idx) in option.InnerExtra || []" :key="idx"
171
171
  :Field="fld"
172
- :values="data"></input-field>
172
+ :values="data"></free-field>
173
173
  </div>
174
174
  </q-checkbox>
175
175
  </div>
@@ -164,7 +164,7 @@ export default defineComponent({
164
164
  }
165
165
  }
166
166
 
167
- .input-field-tabs-panel-field-empty {
167
+ .free-field-tabs-panel-field-empty {
168
168
  display: none;
169
169
  }
170
170
  }
@@ -1,3 +1,6 @@
1
+ import { h, getCurrentInstance, } from 'vue';
2
+ import { useQuasar } from 'quasar';
3
+
1
4
  import { useModelToggleProps, useModelToggleEmits } from 'quasar/src/composables/private.use-model-toggle/use-model-toggle.js';
2
5
 
3
6
  export default {
@@ -39,6 +42,32 @@ export default {
39
42
  this.height = event.data;
40
43
  });
41
44
  },
45
+ setup(props) {
46
+ const { proxy:vm } = getCurrentInstance();
47
+ const $q = useQuasar();
48
+
49
+ return () => {
50
+ if (props.src !== undefined && props.src.length > 0) {
51
+ return h(
52
+ 'div',
53
+ {
54
+ staticClass: 'q-pdfviewer',
55
+ class: props.contentClass,
56
+ style: props.contentStyle,
57
+ },
58
+ [
59
+ ($q.platform.is.electron || props.type === 'pdfjs')
60
+ // eslint-disable-next-line no-underscore-dangle
61
+ ? vm.__renderIFramePDFJS(h)
62
+ // eslint-disable-next-line no-underscore-dangle
63
+ : vm.__renderObject(h),
64
+ ],
65
+ );
66
+ }
67
+
68
+ return ''
69
+ };
70
+ },
42
71
  methods: {
43
72
  // eslint-disable-next-line no-underscore-dangle
44
73
  __renderObject(h) {
@@ -72,11 +101,9 @@ export default {
72
101
  'iframe',
73
102
  {
74
103
  staticClass: 'q-pdfviewer__iframe',
75
- attrs: {
76
- src: this.src,
77
- width: '100%',
78
- height: '100%',
79
- },
104
+ src: this.src,
105
+ width: '100%',
106
+ height: '100%',
80
107
  },
81
108
  );
82
109
  },
@@ -87,36 +114,11 @@ export default {
87
114
  'iframe',
88
115
  {
89
116
  staticClass: 'q-pdfviewer__iframe',
90
- attrs: {
91
- src: `pdfjs${this.version ? `_${this.version}` : ''}/web/viewer.html?file=${encodeURIComponent(this.src)}`,
92
- width: '100%',
93
- height: '100%',
94
- },
117
+ src: `pdfjs${this.version ? `_${this.version}` : ''}/web/viewer.html?file=${encodeURIComponent(this.src)}`,
118
+ width: '100%',
119
+ height: '100%',
95
120
  },
96
121
  );
97
122
  },
98
123
  },
99
-
100
- render(h) {
101
- if (this.value === true && this.src !== undefined && this.src.length > 0) {
102
- return h(
103
- 'div',
104
- {
105
- staticClass: 'q-pdfviewer',
106
- class: this.contentClass,
107
- style: this.contentStyle,
108
- attrs: {
109
- },
110
- },
111
- [
112
- this.$q.platform.is.electron || this.type === 'pdfjs'
113
- // eslint-disable-next-line no-underscore-dangle
114
- ? this.__renderIFramePDFJS(h)
115
- // eslint-disable-next-line no-underscore-dangle
116
- : this.__renderObject(h),
117
- ],
118
- );
119
- }
120
- return '';
121
- },
122
124
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-fe-core-modules",
3
- "version": "0.0.50",
3
+ "version": "0.0.52",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/freeeis/free-fe-core-modules.git",
6
6
  "author": "zhiquan",