@hostlink/nuxt-light 0.0.94 → 0.0.96

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.94"
4
+ "version": "0.0.96"
5
5
  }
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { useLight } from '../'
3
3
  import { useAttrs, ref, computed } from 'vue'
4
+ import Style from '../pages/User/setting/style.vue';
4
5
 
5
6
  defineProps({
6
7
  loading: Boolean,
@@ -25,19 +26,33 @@ const cl = ["text-white", `bg-${color}`];
25
26
  const minimize = ref(false);
26
27
 
27
28
  const icon = computed(() => minimize.value ? "sym_o_add" : "sym_o_remove");
29
+
30
+ const fullScreen = ref(false);
31
+
32
+ const fullScreenIcon = computed(() => fullScreen.value ? "sym_o_fullscreen_exit" : "sym_o_fullscreen");
33
+
34
+ const showBody = computed(() => !minimize.value || fullScreen.value);
35
+
28
36
  </script>
29
37
  <template>
30
- <q-card v-bind="attrs">
38
+ <q-card v-bind="attrs" :class="{ 'fullscreen': fullScreen, 'no-margin': fullScreen }">
31
39
  <q-bar :class="cl" v-if="title">
32
40
  <div>{{ title }}</div>
33
41
  <q-space />
34
- <q-btn dense flat :icon="icon" @click="minimize = !minimize" />
42
+
43
+ <!-- q-btn-dropdown dense flat icon="sym_o_search" persistent>
44
+ <div class="q-ma-md">
45
+ <q-input></q-input>
46
+ </div>
47
+
48
+ </q-btn-dropdown -->
49
+ <q-btn dense flat @click="fullScreen = !fullScreen" :icon="fullScreenIcon" />
50
+ <q-btn dense flat :icon="icon" @click="minimize = !minimize" v-if="!fullScreen" />
35
51
  </q-bar>
36
- <template v-if="!minimize">
52
+ <template v-if="showBody">
37
53
  <slot></slot>
38
54
  </template>
39
55
 
40
-
41
56
  <q-inner-loading :showing="loading" label="Please wait..." label-class="text-primary" />
42
57
  </q-card>
43
58
  </template>
@@ -15,11 +15,12 @@ const props = defineProps({
15
15
  type: Array<{
16
16
  label: string,
17
17
  name: string,
18
- align?: string,
18
+ align?: "left" | "right" | "center" | undefined,
19
19
  sortable?: boolean,
20
20
  searchable?: boolean,
21
21
  searchType?: string,
22
22
  searchOptions?: Array<any>,
23
+ searchMultiple?: boolean,
23
24
  field?: string | Object,
24
25
  gqlField?: string | Array<string> | Object,
25
26
  }>
@@ -286,6 +287,7 @@ const onRequest = async (p: any) => {
286
287
  }
287
288
 
288
289
  let localFilters = getFilterValue();
290
+
289
291
  //merge the filters
290
292
  if (filters) {
291
293
  localFilters = {
@@ -301,6 +303,8 @@ const onRequest = async (p: any) => {
301
303
  sort = p.pagination.sortBy + ":" + (p.pagination.descending ? "desc" : "asc");
302
304
  }
303
305
 
306
+
307
+
304
308
  loading.value = true;
305
309
  const offset = (p.pagination.page - 1) * p.pagination.rowsPerPage;
306
310
  const limit = p.pagination.rowsPerPage;
@@ -345,6 +349,8 @@ const getFilterValue = () => {
345
349
  between: [filters.value[col.name].from, filters.value[col.name].to]
346
350
  }
347
351
  }
352
+ } else if (col.searchType == "select") {
353
+ f[col.name] = filters.value[col.name]
348
354
  } else {
349
355
  f[col.name] = {
350
356
  contains: filters.value[col.name]
@@ -415,7 +421,14 @@ const toColumns = props.columns?.filter((col: any) => {
415
421
  return col;
416
422
 
417
423
  })
418
-
424
+ /*
425
+ const filterFn = (val, update, abort) {
426
+ update(() => {
427
+ const needle = val.toLocaleLowerCase()
428
+ options.value = stringOptions.filter(v => v.toLocaleLowerCase().indexOf(needle) > -1)
429
+ })
430
+ },
431
+ */
419
432
  </script>
420
433
 
421
434
  <template>
@@ -439,8 +452,7 @@ const toColumns = props.columns?.filter((col: any) => {
439
452
  </pre>
440
453
  rows:{{ props.rows }}
441
454
  </template>
442
-
443
-
455
+
444
456
  <q-table v-bind="attrs" :row-key="rowKey" :loading="loading" :rows="rows" ref="table" @request="onRequest"
445
457
  :rows-per-page-label="$t(props.rowsPerPageLabel)" :columns="renderColumns"
446
458
  :rows-per-page-options="rowsPerPageOptions" :selection="selection" v-model:pagination="pagination" :filter="filter">
@@ -488,6 +500,7 @@ const toColumns = props.columns?.filter((col: any) => {
488
500
 
489
501
 
490
502
 
503
+
491
504
  <template #top-row="props" v-if="hasSearch">
492
505
  <q-tr>
493
506
  <q-td v-if="selection != 'none'" auto-width>
@@ -503,7 +516,8 @@ const toColumns = props.columns?.filter((col: any) => {
503
516
 
504
517
  <template v-if="col.searchType == 'select'">
505
518
  <q-select dense v-model="filters[col.name]" @update:model-value="onFilters" clearable
506
- :options="col.searchOptions" @clear="onFilters" emit-value />
519
+ :options="col.searchOptions" @clear="onFilters" emit-value map-options
520
+ :multiple="col.searchMultiple" />
507
521
 
508
522
  </template>
509
523
 
@@ -36,6 +36,12 @@ declare const _default: {
36
36
  };
37
37
  status: {
38
38
  label: string;
39
+ searchable: boolean;
40
+ searchType: string;
41
+ searchOptions: {
42
+ label: string;
43
+ value: number;
44
+ }[];
39
45
  format: (value: any) => string;
40
46
  };
41
47
  };
@@ -36,6 +36,15 @@ export default {
36
36
  },
37
37
  status: {
38
38
  label: "Status",
39
+ searchable: true,
40
+ searchType: "select",
41
+ searchOptions: [{
42
+ label: "Active",
43
+ value: 0
44
+ }, {
45
+ label: "Inactive",
46
+ value: 1
47
+ }],
39
48
  format: (value) => {
40
49
  return ["Active", "Inactive"][value];
41
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "0.0.94",
3
+ "version": "0.0.96",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",