@hostlink/nuxt-light 0.0.46 → 0.0.48

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.
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "0.0.46"
4
+ "version": "0.0.48"
5
5
  }
@@ -1,6 +1,17 @@
1
1
  <script setup>
2
- defineProps(["modelValue"])
2
+ import { computed } from "vue";
3
+
4
+ const emit = defineEmits(["update:modelValue"]);
5
+ const props = defineProps(["modelValue", "label"])
6
+
7
+ const localValue = computed({
8
+ get: () => props.modelValue,
9
+ set: (value) => {
10
+ // popup.value.hide();
11
+ emit('update:modelValue', value)
12
+ }
13
+ });
3
14
  </script>
4
15
  <template>
5
- <q-checkbox v-model="modelValue" />
16
+ <q-checkbox v-model="localValue" :label="$t(label)" />
6
17
  </template>
@@ -17,8 +17,8 @@ const props = defineProps({
17
17
  },
18
18
  label: {
19
19
  type: String,
20
- default: ""
21
20
  },
21
+
22
22
  required: {
23
23
  type: Boolean,
24
24
  default: false
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { useQuasar, QTable } from 'quasar';
3
3
  import { useRoute } from 'vue-router';
4
- import { ref, computed, onMounted, useSlots, reactive } from "vue";
4
+ import { ref, computed, onMounted, useSlots, reactive, useAttrs } from "vue";
5
5
  import { t, deleteObject, q, f, useLight } from '../';
6
6
 
7
7
  const route = useRoute();
@@ -9,7 +9,6 @@ const module = route.path.split("/")[1];
9
9
  const errors = ref<InstanceType<any>>([]);
10
10
 
11
11
  const light = useLight();
12
-
13
12
  const props = defineProps({
14
13
  columns: {
15
14
  type: Array<{
@@ -19,6 +18,7 @@ const props = defineProps({
19
18
  sortable?: boolean,
20
19
  searchable?: boolean,
21
20
  searchType?: string,
21
+ searchOptions?: Array<any>,
22
22
  field?: string | Object,
23
23
  }>
24
24
  },
@@ -26,10 +26,6 @@ const props = defineProps({
26
26
  type: Array,
27
27
  default: () => []
28
28
  },
29
- selection: {
30
- type: String,
31
- default: "none"
32
- },
33
29
  sortBy: {
34
30
  type: String,
35
31
  default: null
@@ -350,9 +346,6 @@ const onDelete = async (id: any) => {
350
346
 
351
347
 
352
348
  //style
353
- const dense = light.getStyle("tableDense", false);
354
- const flat = light.getStyle("tableFlat", true);
355
- const bordered = light.getStyle("tableBorder", true);
356
349
 
357
350
  let rowsPerPageOptions = [3, 5, 7, 10, 15, 20, 25, 50, 0];
358
351
  if (props.pagination == false) {
@@ -361,6 +354,16 @@ if (props.pagination == false) {
361
354
  rowsPerPageOptions = [0]
362
355
  }
363
356
 
357
+
358
+ const attrs = {
359
+ ...{
360
+ dense: light.getStyle("tableDense", false),
361
+ flat: light.getStyle("tableFlat", true),
362
+ bordered: light.getStyle("tableBorder", true),
363
+ },
364
+ ...useAttrs()
365
+ }
366
+
364
367
  </script>
365
368
  <template>
366
369
  <template v-if="errors.length > 0">
@@ -371,11 +374,10 @@ if (props.pagination == false) {
371
374
  </div>
372
375
  </template>
373
376
 
374
- <q-table :flat="flat" :bordered="bordered" :dense="dense" v-model:pagination="pagination" ref="table" :loading="loading"
375
- @request="onRequest" :selection="selection" :rows="rows" :rows-per-page-label="t(props.rowsPerPageLabel)"
376
- :hide-bottom="hideBottom" :columns="renderColumns"
377
- :rows-per-page-options="rowsPerPageOptions"
378
- >
377
+ <q-table v-bind="$attrs" :flat="attrs.flat" :dense="attrs.dense" :bordered="attrs.bordered" :row-key="rowKey"
378
+ :loading="loading" :hide-bottom="hideBottom" v-model:pagination="pagination" ref="table" @request="onRequest"
379
+ :rows="rows" :rows-per-page-label="t(props.rowsPerPageLabel)" :columns="renderColumns"
380
+ :rows-per-page-options="rowsPerPageOptions">
379
381
 
380
382
  <template v-for="s in ss" v-slot:[s]="props">
381
383
  <slot :name="s" v-bind="props"></slot>
@@ -8,6 +8,13 @@ const props = defineProps({
8
8
  }, required: {
9
9
  type: Boolean,
10
10
  default: false
11
+ },
12
+ label: {
13
+ type: String,
14
+ },
15
+ hint: {
16
+ type: String,
17
+ default: ""
11
18
  }
12
19
  });
13
20
 
@@ -21,7 +28,8 @@ const localValue = computed({
21
28
  }
22
29
  });
23
30
 
24
- const rules = ["time"];
31
+ const rules = ["timeOrFulltime"];
32
+ //const rules = [];
25
33
  if (props.required) {
26
34
  rules.push(val => !!val || 'Required.');
27
35
  }
@@ -29,10 +37,9 @@ if (props.required) {
29
37
 
30
38
 
31
39
 
32
-
33
40
  </script>
34
41
  <template>
35
- <q-input v-model="localValue" mask="time" :rules="rules">
42
+ <q-input v-model="localValue" mask="time" :rules="rules" :label="$t(label)" :hint="$t(hint)">
36
43
  <template v-slot:prepend>
37
44
  <q-btn icon="sym_o_access_time" round dense flat>
38
45
  <q-popup-proxy cover transition-show="scale" transition-hide="scale" ref="popup">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",