@hostlink/nuxt-light 1.49.4 → 1.51.0

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.
Files changed (29) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +13 -3
  3. package/dist/runtime/components/l-app-main.d.vue.ts +3 -3
  4. package/dist/runtime/components/l-app-main.vue +16 -6
  5. package/dist/runtime/components/l-app-main.vue.d.ts +3 -3
  6. package/dist/runtime/components/l-select.d.vue.ts +1 -1
  7. package/dist/runtime/components/l-select.vue.d.ts +1 -1
  8. package/dist/runtime/components/l-table.d.vue.ts +7 -5
  9. package/dist/runtime/components/l-table.vue +106 -54
  10. package/dist/runtime/components/l-table.vue.d.ts +7 -5
  11. package/dist/runtime/composables/useLight.d.ts +0 -18
  12. package/dist/runtime/models/User.d.ts +0 -1
  13. package/dist/runtime/models/User.js +0 -1
  14. package/dist/runtime/pages/System/database/check.vue +149 -0
  15. package/dist/runtime/pages/System/database/table.vue +2 -3
  16. package/dist/runtime/pages/Translate/index.vue +5 -5
  17. package/dist/runtime/pages/User/index.vue +5 -5
  18. package/dist/runtime/pages/User/setting/favorite.d.vue.ts +2 -0
  19. package/dist/runtime/pages/User/setting/favorite.vue +164 -0
  20. package/dist/runtime/pages/User/setting/favorite.vue.d.ts +2 -0
  21. package/dist/runtime/pages/User/setting/index.vue +0 -1
  22. package/dist/runtime/pages/User/setting/menu.d.vue.ts +2 -0
  23. package/dist/runtime/pages/User/setting/menu.vue +422 -0
  24. package/dist/runtime/pages/User/setting/menu.vue.d.ts +2 -0
  25. package/dist/runtime/pages/User/setting.vue +4 -2
  26. package/package.json +5 -5
  27. package/dist/runtime/pages/User/setting/my_favorite.vue +0 -156
  28. /package/dist/runtime/pages/{User/setting/my_favorite.d.vue.ts → System/database/check.d.vue.ts} +0 -0
  29. /package/dist/runtime/pages/{User/setting/my_favorite.vue.d.ts → System/database/check.vue.d.ts} +0 -0
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.49.4",
4
+ "version": "1.51.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -131,6 +131,11 @@ const routes = [
131
131
  path: "/SystemValue/add",
132
132
  file: "runtime/pages/SystemValue/add.vue"
133
133
  },
134
+ {
135
+ name: "System-database-check",
136
+ path: "/System/database/check",
137
+ file: "runtime/pages/System/database/check.vue"
138
+ },
134
139
  {
135
140
  name: "System-database-process",
136
141
  path: "/System/database/process",
@@ -226,9 +231,14 @@ const routes = [
226
231
  file: "runtime/pages/User/setting/information.vue"
227
232
  },
228
233
  {
229
- name: "User-setting-my_favorite",
230
- path: "my_favorite",
231
- file: "runtime/pages/User/setting/my_favorite.vue"
234
+ name: "User-setting-favorite",
235
+ path: "favorite",
236
+ file: "runtime/pages/User/setting/favorite.vue"
237
+ },
238
+ {
239
+ name: "User-setting-menu",
240
+ path: "menu",
241
+ file: "runtime/pages/User/setting/menu.vue"
232
242
  },
233
243
  {
234
244
  name: "User-setting-open_id",
@@ -1,12 +1,12 @@
1
- declare var __VLS_30: {}, __VLS_180: {}, __VLS_267: {}, __VLS_273: {};
1
+ declare var __VLS_30: {}, __VLS_180: {}, __VLS_271: {}, __VLS_277: {};
2
2
  type __VLS_Slots = {} & {
3
3
  header?: (props: typeof __VLS_30) => any;
4
4
  } & {
5
5
  'user-menu'?: (props: typeof __VLS_180) => any;
6
6
  } & {
7
- 'page-top'?: (props: typeof __VLS_267) => any;
7
+ 'page-top'?: (props: typeof __VLS_271) => any;
8
8
  } & {
9
- 'page-bottom'?: (props: typeof __VLS_273) => any;
9
+ 'page-bottom'?: (props: typeof __VLS_277) => any;
10
10
  };
11
11
  declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
12
  logout: (...args: any[]) => void;
@@ -3,7 +3,7 @@ import { useRoute, useRouter } from "vue-router";
3
3
  import { useLight, q, m } from "#imports";
4
4
  import { useQuasar } from "quasar";
5
5
  import { useI18n } from "vue-i18n";
6
- import { ref, computed, reactive, provide, watch, toRaw, onBeforeUnmount } from "vue";
6
+ import { ref, computed, reactive, provide, watch, toRaw } from "vue";
7
7
  import { useRuntimeConfig } from "nuxt/app";
8
8
  import { api } from "#imports";
9
9
  const emits = defineEmits(["logout"]);
@@ -47,7 +47,8 @@ const tt = await q({
47
47
  label: true,
48
48
  path: true,
49
49
  icon: true
50
- }
50
+ },
51
+ menu: true
51
52
  }
52
53
  });
53
54
  let app = tt.app;
@@ -58,7 +59,6 @@ light.init(my.styles);
58
59
  light.setMyRoles(my.roles);
59
60
  light.setPermissions(my.permissions);
60
61
  light.setMyFavorites(toRaw(my.myFavorites));
61
- const _errorTimers = /* @__PURE__ */ new Map();
62
62
  const myFavorites = computed(() => {
63
63
  return light.getMyFavorites();
64
64
  });
@@ -75,6 +75,7 @@ for (let t of app.i18nMessages) {
75
75
  }
76
76
  i18n.setLocaleMessage(i18n.locale, messages);
77
77
  const menus = ref(app.menus);
78
+ const my_menus = ref(my.menu);
78
79
  const leftDrawerOpen = ref(false);
79
80
  const rightDrawerOpen = ref(false);
80
81
  const toggleLeftDrawer = () => {
@@ -126,8 +127,16 @@ const onChangeLocale = async (locale) => {
126
127
  window.location.reload();
127
128
  };
128
129
  const reloadMenu = async () => {
129
- let app2 = await q("app", ["menus"]);
130
+ let { app: app2, my: my2 } = await q({
131
+ app: {
132
+ menus: true
133
+ },
134
+ my: {
135
+ menu: true
136
+ }
137
+ });
130
138
  menus.value = app2.menus;
139
+ my_menus.value.menu = my2.menu;
131
140
  };
132
141
  provide("reloadMenu", reloadMenu);
133
142
  watch(() => style.footer, async (value) => await light.setStyle("footer", value));
@@ -292,7 +301,7 @@ const onLogout = async () => {
292
301
 
293
302
  <q-btn flat round dense icon="sym_o_person" class="q-mr-sm">
294
303
  <q-menu max-width="250px">
295
- <q-list>
304
+ <q-list :dense="style.dense">
296
305
  <q-item v-close-popup to="/User/profile">
297
306
  <q-item-section avatar>
298
307
  <q-icon name="sym_o_person" />
@@ -302,7 +311,7 @@ const onLogout = async () => {
302
311
 
303
312
  <q-item v-close-popup to="/User/setting">
304
313
  <q-item-section avatar>
305
- <q-icon name="sym_o_settings" />
314
+ <q-icon name="sym_o_settings_account_box" />
306
315
  </q-item-section>
307
316
  <q-item-section>{{ $t("Setting") }}</q-item-section>
308
317
  </q-item>
@@ -346,6 +355,7 @@ const onLogout = async () => {
346
355
  <!-- drawer content -->
347
356
  <q-scroll-area class="fit">
348
357
  <div class="q-mx-xs q-mt-xs">
358
+ <l-menu :value="my_menus" :dense="style.dense" />
349
359
  <l-fav-menu :value="myFavorites" :dense="style.dense" v-if="myFavoritesCount > 0" />
350
360
  <l-menu :value="menus" :dense="style.dense" />
351
361
  </div>
@@ -1,12 +1,12 @@
1
- declare var __VLS_30: {}, __VLS_180: {}, __VLS_267: {}, __VLS_273: {};
1
+ declare var __VLS_30: {}, __VLS_180: {}, __VLS_271: {}, __VLS_277: {};
2
2
  type __VLS_Slots = {} & {
3
3
  header?: (props: typeof __VLS_30) => any;
4
4
  } & {
5
5
  'user-menu'?: (props: typeof __VLS_180) => any;
6
6
  } & {
7
- 'page-top'?: (props: typeof __VLS_267) => any;
7
+ 'page-top'?: (props: typeof __VLS_271) => any;
8
8
  } & {
9
- 'page-bottom'?: (props: typeof __VLS_273) => any;
9
+ 'page-bottom'?: (props: typeof __VLS_277) => any;
10
10
  };
11
11
  declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
12
  logout: (...args: any[]) => void;
@@ -5,6 +5,7 @@ declare const _default: import("vue").DefineComponent<QSelectProps, {}, {}, {},
5
5
  square: boolean;
6
6
  dense: boolean;
7
7
  outlined: boolean;
8
+ optionValue: string | ((option: string | any) => any);
8
9
  filled: boolean;
9
10
  stackLabel: boolean;
10
11
  standout: string | boolean;
@@ -12,7 +13,6 @@ declare const _default: import("vue").DefineComponent<QSelectProps, {}, {}, {},
12
13
  emitValue: boolean;
13
14
  mapOptions: boolean;
14
15
  inputDebounce: string | number;
15
- optionValue: string | ((option: string | any) => any);
16
16
  optionLabel: string | ((option: string | any) => string);
17
17
  optionsDark: boolean | null;
18
18
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -5,6 +5,7 @@ declare const _default: import("vue").DefineComponent<QSelectProps, {}, {}, {},
5
5
  square: boolean;
6
6
  dense: boolean;
7
7
  outlined: boolean;
8
+ optionValue: string | ((option: string | any) => any);
8
9
  filled: boolean;
9
10
  stackLabel: boolean;
10
11
  standout: string | boolean;
@@ -12,7 +13,6 @@ declare const _default: import("vue").DefineComponent<QSelectProps, {}, {}, {},
12
13
  emitValue: boolean;
13
14
  mapOptions: boolean;
14
15
  inputDebounce: string | number;
15
- optionValue: string | ((option: string | any) => any);
16
16
  optionLabel: string | ((option: string | any) => string);
17
17
  optionsDark: boolean | null;
18
18
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -2,13 +2,13 @@ import type { Component } from "vue";
2
2
  import { Dialog } from 'quasar';
3
3
  import type { QTableColumn, QTableProps } from 'quasar';
4
4
  export type LTableColumn = QTableColumn & {
5
- searchType?: "date" | "text" | "number" | "select";
5
+ searchType?: "date" | "text" | "number" | "select" | "boolean";
6
6
  searchable?: boolean;
7
7
  searchOptions?: Record<string, any>[] | Function;
8
8
  searchMultiple?: boolean;
9
9
  searchIndex?: string;
10
10
  component?: Component;
11
- componentProps?: any;
11
+ componentProps?: ((row: any) => Record<string, any>);
12
12
  to?: (row: any) => string | null;
13
13
  gql?: Record<string, any>;
14
14
  /**
@@ -22,7 +22,7 @@ export type LTableColumn = QTableColumn & {
22
22
  export type LTableProps = QTableProps & {
23
23
  columns?: Array<LTableColumn>;
24
24
  actions?: Array<'view' | 'edit' | 'delete' | 'update'>;
25
- sortBy?: any;
25
+ sortBy?: string;
26
26
  rowKey?: string;
27
27
  modelName?: any;
28
28
  searchable?: boolean;
@@ -70,15 +70,17 @@ export interface LTableRequest {
70
70
  }) => void;
71
71
  }
72
72
  declare function requestServerInteraction(): void;
73
- declare var __VLS_91: any, __VLS_94: string, __VLS_95: any, __VLS_117: any, __VLS_203: string, __VLS_204: any;
73
+ declare var __VLS_91: any, __VLS_94: string, __VLS_95: any, __VLS_117: any, __VLS_119: any, __VLS_248: string, __VLS_249: any;
74
74
  type __VLS_Slots = {} & {
75
75
  [K in NonNullable<typeof __VLS_94>]?: (props: typeof __VLS_95) => any;
76
76
  } & {
77
- [K in NonNullable<typeof __VLS_203>]?: (props: typeof __VLS_204) => any;
77
+ [K in NonNullable<typeof __VLS_248>]?: (props: typeof __VLS_249) => any;
78
78
  } & {
79
79
  actions?: (props: typeof __VLS_91) => any;
80
80
  } & {
81
81
  'row-expand'?: (props: typeof __VLS_117) => any;
82
+ } & {
83
+ 'top-right'?: (props: typeof __VLS_119) => any;
82
84
  };
83
85
  declare const __VLS_component: import("vue").DefineComponent<LTableProps, {
84
86
  requestServerInteraction: typeof requestServerInteraction;
@@ -7,7 +7,7 @@ import model from "../composables/model";
7
7
  import { toQuery } from "@hostlink/light";
8
8
  import { list } from "#imports";
9
9
  import { useI18n } from "vue-i18n";
10
- import { useStorage } from "@vueuse/core";
10
+ import { useStorage, useSessionStorage } from "@vueuse/core";
11
11
  import { useRoute } from "#imports";
12
12
  const $q = useQuasar();
13
13
  const { t } = useI18n();
@@ -98,7 +98,7 @@ const props = defineProps({
98
98
  "onUpdate:expanded": { type: Function, required: false },
99
99
  onVirtualScroll: { type: Function, required: false },
100
100
  actions: { type: Array, required: false, default: () => [] },
101
- sortBy: { type: null, required: false },
101
+ sortBy: { type: String, required: false },
102
102
  modelName: { type: null, required: false },
103
103
  searchable: { type: Boolean, required: false, default: false },
104
104
  onRequestData: { type: Function, required: false },
@@ -108,6 +108,31 @@ const props = defineProps({
108
108
  searchStyle: { type: String, required: false }
109
109
  });
110
110
  const isServerSide = props.rows == void 0;
111
+ const simpleRouteName = computed(() => {
112
+ if ($route.name && typeof $route.name == "string") {
113
+ return $route.name;
114
+ }
115
+ return "";
116
+ });
117
+ const storageKey = computed(() => {
118
+ if (!props.name) return "l-table-storage-default";
119
+ return "l-table-storage-" + simpleRouteName.value + "-" + props.name;
120
+ });
121
+ const saveFilters = computed({
122
+ get() {
123
+ if (!props.name) return false;
124
+ return useStorage(storageKey.value, false).value;
125
+ },
126
+ set(value) {
127
+ if (!props.name) return;
128
+ const storage = useStorage(storageKey.value, false);
129
+ storage.value = value;
130
+ }
131
+ });
132
+ const filters = useSessionStorage(storageKey.value, {});
133
+ if (!saveFilters.value) {
134
+ filters.value = {};
135
+ }
111
136
  const light = useLight();
112
137
  const pagination = ref(props.pagination);
113
138
  if (props.rowsPerPageOptions[0] == 0) {
@@ -124,8 +149,8 @@ props.columns?.forEach((col) => {
124
149
  });
125
150
  if (props.columns) {
126
151
  for (let i = 0; i < props.columns.length; i++) {
127
- if (props.columns[i].searchOptions) {
128
- let opts = props.columns[i].searchOptions;
152
+ if (props.columns[i]?.searchOptions) {
153
+ let opts = props.columns[i]?.searchOptions;
129
154
  if (typeof opts == "function") {
130
155
  props.columns[i].searchOptions = await opts();
131
156
  }
@@ -153,7 +178,6 @@ const hasSearch = computed(() => {
153
178
  });
154
179
  });
155
180
  const table = ref();
156
- const filters = reactive({});
157
181
  const rows = ref(props.rows);
158
182
  if (rows.value == void 0) {
159
183
  rows.value = [];
@@ -307,26 +331,28 @@ const getFilterValue = () => {
307
331
  let f = {};
308
332
  props.columns?.forEach((col) => {
309
333
  if (col.searchable) {
310
- if (filters[col.name] !== null && filters[col.name] !== "" && filters[col.name] !== void 0) {
334
+ if (filters.value[col.name] !== null && filters.value[col.name] !== "" && filters.value[col.name] !== void 0) {
311
335
  const k = col.searchIndex ?? col.name;
312
- if (col.searchType == "number") {
313
- f[k] = filters[col.name];
336
+ if (col.searchType == "boolean") {
337
+ f[k] = filters.value[col.name];
338
+ } else if (col.searchType == "number") {
339
+ f[k] = filters.value[col.name];
314
340
  } else if (col.searchType == "date") {
315
- if (filters[k].from) {
341
+ if (filters.value[k].from) {
316
342
  f[k] = {
317
- between: [filters[col.name].from, filters[col.name].to]
343
+ _between: [filters.value[col.name].from, filters.value[col.name].to]
318
344
  };
319
345
  } else {
320
- f[k] = filters[k];
346
+ f[k] = filters.value[k];
321
347
  }
322
348
  } else if (col.searchType == "select") {
323
- f[k] = filters[col.name];
349
+ f[k] = filters.value[col.name];
324
350
  } else {
325
351
  if (col.searchMethod == "equals") {
326
- f[k] = filters[col.name];
352
+ f[k] = filters.value[col.name];
327
353
  } else {
328
354
  f[k] = {
329
- contains: filters[col.name]
355
+ contains: filters.value[col.name]
330
356
  };
331
357
  }
332
358
  }
@@ -405,17 +431,6 @@ const getCellStyle = (col, row) => {
405
431
  }
406
432
  return style;
407
433
  };
408
- const getCellClass = (col, row) => {
409
- const cl = [];
410
- if (col.cellClass) {
411
- if (typeof col.cellClass == "function") {
412
- cl.push(col.cellClass(row));
413
- } else {
414
- cl.push(col.cellClass);
415
- }
416
- }
417
- return cl;
418
- };
419
434
  const localSelected = computed({
420
435
  get() {
421
436
  return props.selected;
@@ -467,21 +482,21 @@ const searchSelectFilter = (val, update, name) => {
467
482
  }
468
483
  };
469
484
  const showTopRight = computed(() => {
470
- return props.searchable || props.name && (props.columns && props.columns.length > 0);
485
+ return props.name && hasFilters.value || props.searchable || props.name && (props.columns && props.columns.length > 0);
471
486
  });
472
487
  const hidableColumns = computed(() => {
473
488
  return props.columns?.filter((c) => !c.required) || [];
474
489
  });
475
- const simpleRouteName = computed(() => {
476
- if ($route.name && typeof $route.name == "string") {
477
- return $route.name;
478
- }
479
- return "";
480
- });
481
490
  const visibleColumns = props.name ? useStorage("l-table-visible-columns-" + simpleRouteName.value + "-" + props.name, hidableColumns.value.map((c) => c.name)) : ref(hidableColumns.value.map((c) => c.name));
482
491
  watch(filters, () => {
492
+ console.log("filters changed", filters.value);
483
493
  onFilters();
484
494
  }, { deep: true });
495
+ const tempFilters = ref({});
496
+ tempFilters.value = { ...filters.value };
497
+ const hasFilters = computed(() => {
498
+ return Object.keys(filters.value).length > 0;
499
+ });
485
500
  </script>
486
501
 
487
502
  <template>
@@ -491,7 +506,7 @@ watch(filters, () => {
491
506
  <template #header="props">
492
507
  <q-tr :props="props">
493
508
  <q-td v-if="selection != 'none'" auto-width>
494
- <q-checkbox v-model="props.selected" />
509
+ <q-checkbox v-model="props.selected" :color="$light.color" />
495
510
  </q-td>
496
511
  <q-th v-if="hasRowExpand" auto-width></q-th>
497
512
  <q-th v-if="hasActions" auto-width></q-th>
@@ -517,7 +532,7 @@ watch(filters, () => {
517
532
  <template #body="props">
518
533
  <q-tr :props="props">
519
534
  <q-td v-if="selection != 'none'" auto-width>
520
- <q-checkbox v-model="props.selected" />
535
+ <q-checkbox v-model="props.selected" :color="$light.color" />
521
536
  </q-td>
522
537
  <q-td v-if="hasRowExpand" auto-width>
523
538
  <q-btn flat round size="sm" :icon="props.expand ? 'sym_o_expand_more' : 'sym_o_expand_less'"
@@ -542,14 +557,13 @@ watch(filters, () => {
542
557
  </q-td>
543
558
 
544
559
 
545
-
546
560
  <template v-for="col in props.cols">
547
561
  <template v-if="ss.indexOf('body-cell-' + col.name) >= 0">
548
562
  <slot :name="'body-cell-' + col.name" v-bind="props"></slot>
549
563
  </template>
550
564
  <template v-else>
551
565
  <q-td :key="col.name" :props="props" :auto-width="col.autoWidth ?? false"
552
- :style="getCellStyle(col, props.row)" :class="getCellClass(col, props.row)"><template
566
+ :style="getCellStyle(col, props.row)"><template
553
567
  v-if="col.to" class="bg-primary">
554
568
  <l-link :to="col.to(props.row)" v-if="col.to(props.row)">{{ col.value }}</l-link>
555
569
  </template>
@@ -573,6 +587,15 @@ watch(filters, () => {
573
587
 
574
588
 
575
589
  <template #top-right="props" v-if="showTopRight">
590
+ <slot name="top-right" v-bind="props"></slot>
591
+
592
+ <q-btn v-if="$props.name" :disable="!hasFilters" dense flat icon="sym_o_filter_alt_off"
593
+ :color="$light.color" @click="filters = {};
594
+ tempFilters = {}">
595
+ <q-tooltip>{{ $t("Clear Filters") }}</q-tooltip>
596
+ </q-btn>
597
+
598
+
576
599
  <q-input outlined dense debounce="300" v-model="filter" :placeholder="$t('Search')" :color="$light.color"
577
600
  v-if="searchable">
578
601
  <template v-slot:append>
@@ -580,18 +603,32 @@ watch(filters, () => {
580
603
  </template>
581
604
  </q-input>
582
605
 
583
- <q-icon name="sym_o_view_column" size="sm" class="cursor-pointer" :color="$light.color">
606
+ <q-btn icon="sym_o_settings" flat dense :color="$light.color" v-if="$props.name">
607
+ <q-popup-proxy>
608
+ <q-card>
609
+ <q-card-section>
610
+ <q-checkbox label="Save filters" v-model="saveFilters" :color="$light.color" />
611
+ </q-card-section>
612
+ </q-card>
613
+ </q-popup-proxy>
614
+ </q-btn>
615
+
616
+ <q-btn icon="sym_o_view_column" flat dense :color="$light.color" v-if="$props.name">
584
617
  <q-popup-proxy>
585
618
  <q-card>
586
619
  <q-card-section>
587
- <div v-for="column in hidableColumns" :key="column.name" class="q-mb-xs">
588
- <q-checkbox v-model="visibleColumns" :val="column.name" :label="column.label"
589
- :color="$light.color" dense />
590
- </div>
620
+ <q-option-group :color="$light.color" type="checkbox" v-model="visibleColumns"
621
+ :options="hidableColumns" option-value="name">
622
+ </q-option-group>
591
623
  </q-card-section>
592
624
  </q-card>
593
625
  </q-popup-proxy>
594
- </q-icon>
626
+ </q-btn>
627
+
628
+
629
+ <q-btn icon="sym_o_refresh" flat dense :color="$light.color" @click="requestServerInteraction()">
630
+ <q-tooltip>{{ $t("Refresh") }}</q-tooltip>
631
+ </q-btn>
595
632
  </template>
596
633
 
597
634
 
@@ -614,29 +651,40 @@ watch(filters, () => {
614
651
 
615
652
  <template v-if="col.searchType == 'number'">
616
653
  <q-input style="min-width: 80px;" dense clearable filled square
617
- v-model.number="filters[col.name]" @keydown.enter.prevent="onFilters" @clear="onFilters"
618
- mask="##########" :enterkeyhint="$t('search')" :style="col.searchStyle"></q-input>
654
+ v-model.number="tempFilters[col.name]"
655
+ @keydown.enter.prevent="filters[col.name] = tempFilters[col.name]"
656
+ @clear="delete filters[col.name]" mask="##########" :enterkeyhint="$t('search')"
657
+ :style="col.searchStyle"></q-input>
619
658
  </template>
620
659
 
621
660
  <template v-if="col.searchType == 'select'">
622
- <q-select dense clearable filled square v-model="filters[col.name]"
623
- @update:model-value="onFilters" options-dense :options="localSearchOptions[col.name]"
624
- emit-value map-options :multiple="col.searchMultiple" :color="$light.color" use-input
625
- input-debounce="0" @filter="(val, update) => {
661
+ <q-select dense clearable filled square v-model="filters[col.name]" options-dense
662
+ :options="localSearchOptions[col.name]" emit-value map-options
663
+ :multiple="col.searchMultiple" :color="$light.color" use-input input-debounce="0"
664
+ @filter="(val, update) => {
626
665
  searchSelectFilter(val, update, col.name);
627
666
  }" :style="col.searchStyle" />
628
667
  </template>
629
668
 
630
669
  <template v-if="col.searchType == 'date'">
631
670
  <l-date-picker dense clearable filled square :outlined="false" hide-bottom-space
632
- v-model="filters[col.name]" range @clear="onFilters"
633
- :style="col.searchStyle" />
671
+ v-model="filters[col.name]" range :style="col.searchStyle" />
672
+ </template>
673
+
674
+
675
+ <template v-if="col.searchType == 'boolean'">
676
+ <q-select dense clearable filled square v-model="filters[col.name]" :options="[
677
+ { label: $t('Yes'), value: true },
678
+ { label: $t('No'), value: false }
679
+ ]" :color="$light.color" :style="col.searchStyle" emit-value map-options options-dense />
680
+
681
+
634
682
  </template>
635
683
 
636
684
  <template v-if="!col.searchType || col.searchType == 'text'">
637
- <q-input style="min-width: 80px;" dense clearable filled square v-model="filters[col.name]"
638
- @keydown.enter.prevent="onFilters" @clear="onFilters" :enterkeyhint="$t('search')"
639
- :color="$light.color" :style="col.searchStyle"></q-input>
685
+ <q-input style="min-width: 80px;" dense clearable filled square
686
+ v-model="tempFilters[col.name]" @keydown.enter.prevent="filters[col.name] = tempFilters[col.name]" @clear="delete filters[col.name]" :enterkeyhint="$t('search')" :color="$light.color"
687
+ :style="col.searchStyle"></q-input>
640
688
 
641
689
  </template>
642
690
 
@@ -645,8 +693,12 @@ watch(filters, () => {
645
693
  </q-tr>
646
694
  </template>
647
695
 
648
- <template v-for="slot of ss" v-slot:[slot]="props">
696
+ <template v-for="slot of Object.keys($slots)" v-slot:[slot]="props">
649
697
  <slot :name="slot" v-bind="props"></slot>
650
698
  </template>
699
+
700
+
701
+
702
+
651
703
  </q-table>
652
704
  </template>
@@ -2,13 +2,13 @@ import type { Component } from "vue";
2
2
  import { Dialog } from 'quasar';
3
3
  import type { QTableColumn, QTableProps } from 'quasar';
4
4
  export type LTableColumn = QTableColumn & {
5
- searchType?: "date" | "text" | "number" | "select";
5
+ searchType?: "date" | "text" | "number" | "select" | "boolean";
6
6
  searchable?: boolean;
7
7
  searchOptions?: Record<string, any>[] | Function;
8
8
  searchMultiple?: boolean;
9
9
  searchIndex?: string;
10
10
  component?: Component;
11
- componentProps?: any;
11
+ componentProps?: ((row: any) => Record<string, any>);
12
12
  to?: (row: any) => string | null;
13
13
  gql?: Record<string, any>;
14
14
  /**
@@ -22,7 +22,7 @@ export type LTableColumn = QTableColumn & {
22
22
  export type LTableProps = QTableProps & {
23
23
  columns?: Array<LTableColumn>;
24
24
  actions?: Array<'view' | 'edit' | 'delete' | 'update'>;
25
- sortBy?: any;
25
+ sortBy?: string;
26
26
  rowKey?: string;
27
27
  modelName?: any;
28
28
  searchable?: boolean;
@@ -70,15 +70,17 @@ export interface LTableRequest {
70
70
  }) => void;
71
71
  }
72
72
  declare function requestServerInteraction(): void;
73
- declare var __VLS_91: any, __VLS_94: string, __VLS_95: any, __VLS_117: any, __VLS_203: string, __VLS_204: any;
73
+ declare var __VLS_91: any, __VLS_94: string, __VLS_95: any, __VLS_117: any, __VLS_119: any, __VLS_248: string, __VLS_249: any;
74
74
  type __VLS_Slots = {} & {
75
75
  [K in NonNullable<typeof __VLS_94>]?: (props: typeof __VLS_95) => any;
76
76
  } & {
77
- [K in NonNullable<typeof __VLS_203>]?: (props: typeof __VLS_204) => any;
77
+ [K in NonNullable<typeof __VLS_248>]?: (props: typeof __VLS_249) => any;
78
78
  } & {
79
79
  actions?: (props: typeof __VLS_91) => any;
80
80
  } & {
81
81
  'row-expand'?: (props: typeof __VLS_117) => any;
82
+ } & {
83
+ 'top-right'?: (props: typeof __VLS_119) => any;
82
84
  };
83
85
  declare const __VLS_component: import("vue").DefineComponent<LTableProps, {
84
86
  requestServerInteraction: typeof requestServerInteraction;
@@ -525,9 +525,6 @@ declare const light: {
525
525
  readonly datetimeFormats: {};
526
526
  readonly numberFormats: {};
527
527
  readonly modifiers: import("vue-i18n").LinkedModifiers<import("vue-i18n").VueMessageType>;
528
- formatter: {
529
- interpolate: (message: string, values: any, path: string) => Array<any> | null;
530
- };
531
528
  missing: import("vue-i18n").MissingHandler | null;
532
529
  postTranslation: import("vue-i18n").PostTranslationHandler<import("vue-i18n").VueMessageType> | null;
533
530
  silentTranslationWarn: boolean | RegExp;
@@ -536,15 +533,11 @@ declare const light: {
536
533
  sync: boolean;
537
534
  warnHtmlInMessage: import("vue-i18n").WarnHtmlInMessageLevel;
538
535
  escapeParameterHtml: boolean;
539
- preserveDirectiveContent: boolean;
540
536
  pluralizationRules: import("@intlify/core-base").PluralizationRules;
541
537
  t: import("vue-i18n").VueI18nTranslation<{}, string, import("@intlify/core-base").RemoveIndexSignature<{
542
538
  [x: string]: import("vue-i18n").LocaleMessageValue<import("vue-i18n").VueMessageType>;
543
539
  }>, never, never, never>;
544
540
  rt: import("vue-i18n").VueI18nResolveLocaleMessageTranslation<string>;
545
- tc: import("vue-i18n").VueI18nTranslationChoice<{}, string, import("@intlify/core-base").RemoveIndexSignature<{
546
- [x: string]: import("vue-i18n").LocaleMessageValue<import("vue-i18n").VueMessageType>;
547
- }>, never, never, never>;
548
541
  te: <Str extends string, Key extends never = never>(key: Str | Key, locale?: string | undefined) => boolean;
549
542
  tm: <Key extends string, ResourceKeys extends never = never, Locale extends never = never, Target = import("@intlify/core-base").RemoveIndexSignature<{
550
543
  [x: string]: import("vue-i18n").LocaleMessageValue<import("vue-i18n").VueMessageType>;
@@ -576,9 +569,7 @@ declare const light: {
576
569
  [x: string]: import("@intlify/core-base").NumberFormatOptions;
577
570
  }> : NumberSchema, Formats extends FormatsType = FormatsType>(locale: LocaleSchema | Locale, format: Formats) => void;
578
571
  mergeNumberFormat: <NumberSchema extends Record<string, any> = never, LocaleSchema extends string = string, Locale extends never = never, Formats = import("vue-i18n").IsNever<NumberSchema> extends true ? Record<string, any> : NumberSchema>(locale: LocaleSchema | Locale, format: Formats) => void;
579
- getChoiceIndex: (choice: import("vue-i18n").Choice, choicesLength: number) => number;
580
572
  };
581
- readonly allowComposition: boolean;
582
573
  install: (app: import("vue").App, ...options: unknown[]) => void;
583
574
  dispose: () => void;
584
575
  } | null;
@@ -1131,9 +1122,6 @@ declare const _default: () => {
1131
1122
  readonly datetimeFormats: {};
1132
1123
  readonly numberFormats: {};
1133
1124
  readonly modifiers: import("vue-i18n").LinkedModifiers<import("vue-i18n").VueMessageType>;
1134
- formatter: {
1135
- interpolate: (message: string, values: any, path: string) => Array<any> | null;
1136
- };
1137
1125
  missing: import("vue-i18n").MissingHandler | null;
1138
1126
  postTranslation: import("vue-i18n").PostTranslationHandler<import("vue-i18n").VueMessageType> | null;
1139
1127
  silentTranslationWarn: boolean | RegExp;
@@ -1142,15 +1130,11 @@ declare const _default: () => {
1142
1130
  sync: boolean;
1143
1131
  warnHtmlInMessage: import("vue-i18n").WarnHtmlInMessageLevel;
1144
1132
  escapeParameterHtml: boolean;
1145
- preserveDirectiveContent: boolean;
1146
1133
  pluralizationRules: import("@intlify/core-base").PluralizationRules;
1147
1134
  t: import("vue-i18n").VueI18nTranslation<{}, string, import("@intlify/core-base").RemoveIndexSignature<{
1148
1135
  [x: string]: import("vue-i18n").LocaleMessageValue<import("vue-i18n").VueMessageType>;
1149
1136
  }>, never, never, never>;
1150
1137
  rt: import("vue-i18n").VueI18nResolveLocaleMessageTranslation<string>;
1151
- tc: import("vue-i18n").VueI18nTranslationChoice<{}, string, import("@intlify/core-base").RemoveIndexSignature<{
1152
- [x: string]: import("vue-i18n").LocaleMessageValue<import("vue-i18n").VueMessageType>;
1153
- }>, never, never, never>;
1154
1138
  te: <Str extends string, Key extends never = never>(key: Str | Key, locale?: string | undefined) => boolean;
1155
1139
  tm: <Key extends string, ResourceKeys extends never = never, Locale extends never = never, Target = import("@intlify/core-base").RemoveIndexSignature<{
1156
1140
  [x: string]: import("vue-i18n").LocaleMessageValue<import("vue-i18n").VueMessageType>;
@@ -1182,9 +1166,7 @@ declare const _default: () => {
1182
1166
  [x: string]: import("@intlify/core-base").NumberFormatOptions;
1183
1167
  }> : NumberSchema, Formats extends FormatsType = FormatsType>(locale: LocaleSchema | Locale, format: Formats) => void;
1184
1168
  mergeNumberFormat: <NumberSchema extends Record<string, any> = never, LocaleSchema extends string = string, Locale extends never = never, Formats = import("vue-i18n").IsNever<NumberSchema> extends true ? Record<string, any> : NumberSchema>(locale: LocaleSchema | Locale, format: Formats) => void;
1185
- getChoiceIndex: (choice: import("vue-i18n").Choice, choicesLength: number) => number;
1186
1169
  };
1187
- readonly allowComposition: boolean;
1188
1170
  install: (app: import("vue").App, ...options: unknown[]) => void;
1189
1171
  dispose: () => void;
1190
1172
  } | null;