@hostlink/nuxt-light 1.31.0 → 1.31.1

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,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.31.0",
4
+ "version": "1.31.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
7
7
  "unbuild": "3.5.0"
@@ -9,8 +9,6 @@ import { collect } from "#imports";
9
9
  import { useI18n } from "vue-i18n";
10
10
  const $q = useQuasar();
11
11
  const { t } = useI18n();
12
- const minimized = defineModel("minimized", { type: Boolean, ...{ default: false } });
13
- const maximized = defineModel("maximized", { type: Boolean, ...{ default: false } });
14
12
  const errors = ref([]);
15
13
  const props = defineProps({
16
14
  fullscreen: { type: Boolean, required: false, skipCheck: true, default: false },
@@ -95,9 +93,7 @@ const props = defineProps({
95
93
  actions: { type: Array, required: false, default: () => [] },
96
94
  sortBy: { type: null, required: false },
97
95
  modelName: { type: null, required: false },
98
- searchable: { type: null, required: false, default: false },
99
- maximizable: { type: Boolean, required: false, default: false },
100
- minimizable: { type: Boolean, required: false, default: false },
96
+ searchable: { type: Boolean, required: false, default: false },
101
97
  onRequestData: { type: Function, required: false },
102
98
  addComponent: { type: Object, required: false },
103
99
  addComponentProps: { type: null, required: false }
@@ -453,16 +449,21 @@ const onAdd = () => {
453
449
  </script>
454
450
 
455
451
  <template>
456
- <l-card v-bind="attrs" :maximizable="maximizable" :minimizable="minimizable" :title="title"
457
- v-model:minimized="minimized" v-model:maximized="maximized">
458
-
459
- <q-toolbar v-if="addComponent">
460
- <q-btn icon="sym_o_add" :label="$t('Add')" :color="$light.color" @click="onAdd" v-if="addComponent"
461
- outline />
462
- </q-toolbar>
463
-
452
+ <q-table v-bind="attrs" :loading="loading" :rows="rows" ref="table" @request="onLocalRequest" :columns="columns"
453
+ v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected" :color="$light.color">
454
+
455
+ <template #header="props">
456
+ <q-tr :props="props">
457
+ <q-td v-if="selection != 'none'" auto-width>
458
+ <q-checkbox v-model="props.selected" />
459
+ </q-td>
460
+ <q-th v-if="hasRowExpand" auto-width></q-th>
461
+ <q-th v-if="hasActions" auto-width></q-th>
462
+ <q-th v-for="col in props.cols" :key="col.name" :props="props">{{ col.label }}</q-th>
463
+ </q-tr>
464
+ </template>
464
465
 
465
- <template v-if="errors.length > 0">
466
+ <template #top v-if="errors.length > 0">
466
467
  <div class="q-mb-sm">
467
468
  <div class="q-gutter-sm">
468
469
  <l-alert type="negative" v-for="e in errors">{{ e }}</l-alert>
@@ -470,96 +471,86 @@ const onAdd = () => {
470
471
  </div>
471
472
  </template>
472
473
 
473
- <q-table v-bind="attrs" :loading="loading" :rows="rows" ref="table" @request="onLocalRequest" :columns="columns"
474
- v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected" :color="$light.color">
475
-
476
- <template #header="props">
477
- <q-tr :props="props">
478
- <q-td v-if="selection != 'none'" auto-width>
479
- <q-checkbox v-model="props.selected" />
480
- </q-td>
481
- <q-th v-if="hasRowExpand" auto-width></q-th>
482
- <q-th v-if="hasActions" auto-width></q-th>
483
- <q-th v-for="col in props.cols" :key="col.name" :props="props">{{ col.label }}</q-th>
484
- </q-tr>
485
- </template>
486
474
 
475
+ <template #top-left v-if="addComponent">
476
+ <q-btn icon="sym_o_add" :label="$t('Add')" :color="$light.color" @click="onAdd" outline />
477
+ </template>
487
478
 
488
479
 
489
- <template #body="props">
490
- <q-tr :props="props">
491
- <q-td v-if="selection != 'none'" auto-width>
492
- <q-checkbox v-model="props.selected" />
493
- </q-td>
494
- <q-td v-if="hasRowExpand" auto-width>
495
- <q-btn :class="{ 'text-grey-8': !isDark }" flat round size="sm"
496
- :icon="props.expand ? 'sym_o_expand_more' : 'sym_o_expand_less'"
497
- @click="props.expand = !props.expand"></q-btn>
498
- </q-td>
480
+ <template #body="props">
481
+ <q-tr :props="props">
482
+ <q-td v-if="selection != 'none'" auto-width>
483
+ <q-checkbox v-model="props.selected" />
484
+ </q-td>
485
+ <q-td v-if="hasRowExpand" auto-width>
486
+ <q-btn :class="{ 'text-grey-8': !isDark }" flat round size="sm"
487
+ :icon="props.expand ? 'sym_o_expand_more' : 'sym_o_expand_less'"
488
+ @click="props.expand = !props.expand"></q-btn>
489
+ </q-td>
499
490
 
500
- <q-td v-if="hasActions" auto-width>
501
- <div :class="{ 'text-grey-8': !isDark }" v-if="primaryKey">
491
+ <q-td v-if="hasActions" auto-width>
492
+ <div :class="{ 'text-grey-8': !isDark }" v-if="primaryKey">
502
493
 
503
- <l-view-btn v-if="actionView && props.row.canView"
504
- :to="`/${modelName}/${props.row[primaryKey]}/view`" size="sm" />
494
+ <l-view-btn v-if="actionView && props.row.canView"
495
+ :to="`/${modelName}/${props.row[primaryKey]}/view`" size="sm" />
505
496
 
506
- <l-edit-btn v-if="activeEdit && props.row.canUpdate"
507
- :to="`/${modelName}/${props.row[primaryKey]}/edit`" size="sm" />
497
+ <l-edit-btn v-if="activeEdit && props.row.canUpdate"
498
+ :to="`/${modelName}/${props.row[primaryKey]}/edit`" size="sm" />
508
499
 
509
- <l-delete-btn v-if="actionDelete && props.row.canDelete"
510
- @submit="onDelete(props.row[primaryKey])" size="sm"></l-delete-btn>
500
+ <l-delete-btn v-if="actionDelete && props.row.canDelete"
501
+ @submit="onDelete(props.row[primaryKey])" size="sm"></l-delete-btn>
511
502
 
512
- <slot name="actions" v-bind="props"></slot>
513
- </div>
503
+ <slot name="actions" v-bind="props"></slot>
504
+ </div>
514
505
 
515
- </q-td>
506
+ </q-td>
516
507
 
517
508
 
518
509
 
519
- <template v-for="col in props.cols">
520
- <template v-if="ss.indexOf('body-cell-' + col.name) >= 0">
521
- <slot :name="'body-cell-' + col.name" v-bind="props"></slot>
522
- </template>
523
- <template v-else>
524
- <q-td :key="col.name" :props="props" :auto-width="col.autoWidth ?? false"
525
- :style="getCellStyle(col, props.row)" :class="getCellClass(col, props.row)"><template
526
- v-if="col.to" class="bg-primary">
527
- <l-link :to="col.to(props.row)">{{ col.value }}</l-link>
528
- </template>
529
- <template v-else-if="col.component">
530
- <component :is="col.component" v-model="props.row"
531
- v-bind="col.componentProps ? col.componentProps(props.row) : null" />
532
- </template>
533
- <template v-else>
534
- {{ col.value }}
535
- </template>
536
- </q-td>
537
- </template>
510
+ <template v-for="col in props.cols">
511
+ <template v-if="ss.indexOf('body-cell-' + col.name) >= 0">
512
+ <slot :name="'body-cell-' + col.name" v-bind="props"></slot>
538
513
  </template>
539
- </q-tr>
540
- <q-tr v-show="props.expand" :props="props">
541
- <q-td colspan="100%">
542
- <slot name="row-expand" v-bind="props"></slot>
543
- </q-td>
544
- </q-tr>
545
- </template>
546
-
547
-
548
- <template #top-right="props" v-if="searchable">
549
- <q-input v-if="searchable" outlined dense debounce="300" v-model="filter" :placeholder="$t('Search')"
550
- :color="$light.color">
551
- <template v-slot:append>
552
- <q-icon name="search" />
514
+ <template v-else>
515
+ <q-td :key="col.name" :props="props" :auto-width="col.autoWidth ?? false"
516
+ :style="getCellStyle(col, props.row)" :class="getCellClass(col, props.row)"><template
517
+ v-if="col.to" class="bg-primary">
518
+ <l-link :to="col.to(props.row)">{{ col.value }}</l-link>
519
+ </template>
520
+ <template v-else-if="col.component">
521
+ <component :is="col.component" v-model="props.row"
522
+ v-bind="col.componentProps ? col.componentProps(props.row) : null" />
523
+ </template>
524
+ <template v-else>
525
+ {{ col.value }}
526
+ </template>
527
+ </q-td>
553
528
  </template>
554
- </q-input>
529
+ </template>
530
+ </q-tr>
531
+ <q-tr v-show="props.expand" :props="props">
532
+ <q-td colspan="100%">
533
+ <slot name="row-expand" v-bind="props"></slot>
534
+ </q-td>
535
+ </q-tr>
536
+ </template>
555
537
 
556
538
 
539
+ <template #top-right="props" v-if="searchable">
540
+ <q-input v-if="searchable" outlined dense debounce="300" v-model="filter" :placeholder="$t('Search')"
541
+ :color="$light.color">
542
+ <template v-slot:append>
543
+ <q-icon name="search" />
544
+ </template>
545
+ </q-input>
557
546
 
558
547
 
559
- </template>
560
548
 
561
549
 
562
- <!-- template v-for="col in toColumns" v-slot:[col.slot_name]="props">
550
+ </template>
551
+
552
+
553
+ <!-- template v-for="col in toColumns" v-slot:[col.slot_name]="props">
563
554
  <q-td :props="props">
564
555
  <l-link :to="col.to(props.row)">
565
556
  {{ col.field(props.row) }}
@@ -568,49 +559,47 @@ const onAdd = () => {
568
559
  </template -->
569
560
 
570
561
 
571
- <template #top-row="props" v-if="hasSearch && isServerSide">
572
- <q-tr>
573
- <q-td v-if="selection != 'none'" auto-width />
574
- <q-td v-if="hasRowExpand" auto-width />
575
- <q-td v-if="hasActions" auto-width />
576
- <q-td v-for="col in props.cols">
577
- <template v-if="col.searchable">
562
+ <template #top-row="props" v-if="hasSearch && isServerSide">
563
+ <q-tr>
564
+ <q-td v-if="selection != 'none'" auto-width />
565
+ <q-td v-if="hasRowExpand" auto-width />
566
+ <q-td v-if="hasActions" auto-width />
567
+ <q-td v-for="col in props.cols">
568
+ <template v-if="col.searchable">
578
569
 
579
- <template v-if="col.searchType == 'number'">
580
- <q-input style="min-width: 80px;" dense clearable filled square
581
- v-model.number="filters[col.name]" @keydown.enter.prevent="onFilters"
582
- @clear="onFilters" mask="##########" :enterkeyhint="$t('search')"></q-input>
583
- </template>
570
+ <template v-if="col.searchType == 'number'">
571
+ <q-input style="min-width: 80px;" dense clearable filled square
572
+ v-model.number="filters[col.name]" @keydown.enter.prevent="onFilters" @clear="onFilters"
573
+ mask="##########" :enterkeyhint="$t('search')"></q-input>
574
+ </template>
584
575
 
585
- <template v-if="col.searchType == 'select'">
586
- <q-select dense clearable filled square v-model="filters[col.name]"
587
- @update:model-value="onFilters" options-dense :options="col.searchOptions"
588
- emit-value map-options :multiple="col.searchMultiple" :color="$light.color" />
576
+ <template v-if="col.searchType == 'select'">
577
+ <q-select dense clearable filled square v-model="filters[col.name]"
578
+ @update:model-value="onFilters" options-dense :options="col.searchOptions" emit-value
579
+ map-options :multiple="col.searchMultiple" :color="$light.color" />
589
580
 
590
- </template>
581
+ </template>
591
582
 
592
583
 
593
- <template v-if="col.searchType == 'date'">
594
- <l-date-picker dense clearable filled square :outlined="false" hide-bottom-space
595
- v-model="filters[col.name]" @update:model-value="onFilters" range
596
- @clear="onFilters" />
597
- </template>
584
+ <template v-if="col.searchType == 'date'">
585
+ <l-date-picker dense clearable filled square :outlined="false" hide-bottom-space
586
+ v-model="filters[col.name]" @update:model-value="onFilters" range @clear="onFilters" />
587
+ </template>
598
588
 
599
- <template v-if="!col.searchType || col.searchType == 'text'">
600
- <q-input style="min-width: 80px;" dense clearable filled square
601
- v-model="filters[col.name]" @keydown.enter.prevent="onFilters" @clear="onFilters"
602
- :enterkeyhint="$t('search')" :color="$light.color"></q-input>
603
-
604
- </template>
589
+ <template v-if="!col.searchType || col.searchType == 'text'">
590
+ <q-input style="min-width: 80px;" dense clearable filled square v-model="filters[col.name]"
591
+ @keydown.enter.prevent="onFilters" @clear="onFilters" :enterkeyhint="$t('search')"
592
+ :color="$light.color"></q-input>
605
593
 
606
594
  </template>
607
- </q-td>
608
- </q-tr>
609
- </template>
610
-
611
- <template v-for="slot of ss" v-slot:[slot]="props">
612
- <slot :name="slot" v-bind="props"></slot>
613
- </template>
614
- </q-table>
615
- </l-card>
595
+
596
+ </template>
597
+ </q-td>
598
+ </q-tr>
599
+ </template>
600
+
601
+ <template v-for="slot of ss" v-slot:[slot]="props">
602
+ <slot :name="slot" v-bind="props"></slot>
603
+ </template>
604
+ </q-table>
616
605
  </template>
@@ -1,7 +1,5 @@
1
1
  import { QTable, Dialog } from 'quasar';
2
2
  import type { QTableColumn, QTableProps } from 'quasar';
3
- declare const minimized: import("vue").ModelRef<boolean, string, boolean, boolean>;
4
- declare const maximized: import("vue").ModelRef<boolean, string, boolean, boolean>;
5
3
  export interface LTableColumn extends QTableColumn {
6
4
  searchable?: boolean;
7
5
  searchType?: string;
@@ -18,16 +16,13 @@ export type LTableProps = QTableProps & {
18
16
  sortBy?: any;
19
17
  rowKey?: string;
20
18
  modelName?: any;
21
- searchable?: any;
19
+ searchable?: boolean;
22
20
  selected?: Array<any>;
23
- maximizable?: boolean;
24
- minimizable?: boolean;
25
21
  onRequestData?: (request: LTableRequest) => void;
26
22
  addComponent?: Dialog;
27
23
  addComponentProps?: any;
28
24
  rows?: Array<any>;
29
25
  };
30
- type __VLS_Props = LTableProps;
31
26
  declare const isServerSide: boolean;
32
27
  declare const pagination: import("vue").Ref<{
33
28
  sortBy?: string | null | undefined;
@@ -107,25 +102,19 @@ declare const getCellClass: (col: any, row: any) => any;
107
102
  declare const localSelected: import("vue").WritableComputedRef<any[], any[]>;
108
103
  declare function requestServerInteraction(): void;
109
104
  declare const onAdd: () => void;
110
- type __VLS_PublicProps = __VLS_Props & {
111
- "minimized"?: boolean;
112
- "maximized"?: boolean;
113
- };
114
105
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
115
- declare var __VLS_100: any, __VLS_103: string, __VLS_104: any, __VLS_126: any, __VLS_192: string, __VLS_193: any;
106
+ declare var __VLS_91: any, __VLS_94: string, __VLS_95: any, __VLS_117: any, __VLS_183: string, __VLS_184: any;
116
107
  type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
117
- [K in NonNullable<typeof __VLS_103>]?: (props: typeof __VLS_104) => any;
108
+ [K in NonNullable<typeof __VLS_94>]?: (props: typeof __VLS_95) => any;
118
109
  } & {
119
- [K in NonNullable<typeof __VLS_192>]?: (props: typeof __VLS_193) => any;
110
+ [K in NonNullable<typeof __VLS_183>]?: (props: typeof __VLS_184) => any;
120
111
  } & {
121
- actions?: (props: typeof __VLS_100) => any;
112
+ actions?: (props: typeof __VLS_91) => any;
122
113
  } & {
123
- 'row-expand'?: (props: typeof __VLS_126) => any;
114
+ 'row-expand'?: (props: typeof __VLS_117) => any;
124
115
  }>;
125
- declare const __VLS_self: import("vue").DefineComponent<__VLS_PublicProps, {
116
+ declare const __VLS_self: import("vue").DefineComponent<LTableProps, {
126
117
  QTable: typeof QTable;
127
- minimized: typeof minimized;
128
- maximized: typeof maximized;
129
118
  errors: typeof errors;
130
119
  isServerSide: typeof isServerSide;
131
120
  pagination: typeof pagination;
@@ -154,14 +143,10 @@ declare const __VLS_self: import("vue").DefineComponent<__VLS_PublicProps, {
154
143
  onAdd: typeof onAdd;
155
144
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
156
145
  delete: (p: any) => any;
157
- "update:minimized": (value: boolean) => any;
158
- "update:maximized": (value: boolean) => any;
159
146
  "request-data": (p: LTableRequest) => any;
160
147
  "update:selected": (p: any[]) => any;
161
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
148
+ }, string, import("vue").PublicProps, Readonly<LTableProps> & Readonly<{
162
149
  onDelete?: ((p: any) => any) | undefined;
163
- "onUpdate:minimized"?: ((value: boolean) => any) | undefined;
164
- "onUpdate:maximized"?: ((value: boolean) => any) | undefined;
165
150
  "onRequest-data"?: ((p: LTableRequest) => any) | undefined;
166
151
  "onUpdate:selected"?: ((p: any[]) => any) | undefined;
167
152
  }>, {
@@ -170,8 +155,6 @@ declare const __VLS_self: import("vue").DefineComponent<__VLS_PublicProps, {
170
155
  dark: boolean | null;
171
156
  bordered: boolean;
172
157
  fullscreen: boolean;
173
- minimizable: boolean;
174
- maximizable: boolean;
175
158
  selected: any[];
176
159
  actions: Array<string>;
177
160
  pagination: {
@@ -186,20 +169,16 @@ declare const __VLS_self: import("vue").DefineComponent<__VLS_PublicProps, {
186
169
  noDataLabel: string;
187
170
  rowsPerPageOptions: readonly any[];
188
171
  rowsPerPageLabel: string;
189
- searchable: any;
172
+ searchable: boolean;
190
173
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
191
- declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {
174
+ declare const __VLS_component: import("vue").DefineComponent<LTableProps, {
192
175
  requestServerInteraction: typeof requestServerInteraction;
193
176
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
194
177
  delete: (p: any) => any;
195
- "update:minimized": (value: boolean) => any;
196
- "update:maximized": (value: boolean) => any;
197
178
  "request-data": (p: LTableRequest) => any;
198
179
  "update:selected": (p: any[]) => any;
199
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
180
+ }, string, import("vue").PublicProps, Readonly<LTableProps> & Readonly<{
200
181
  onDelete?: ((p: any) => any) | undefined;
201
- "onUpdate:minimized"?: ((value: boolean) => any) | undefined;
202
- "onUpdate:maximized"?: ((value: boolean) => any) | undefined;
203
182
  "onRequest-data"?: ((p: LTableRequest) => any) | undefined;
204
183
  "onUpdate:selected"?: ((p: any[]) => any) | undefined;
205
184
  }>, {
@@ -208,8 +187,6 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
208
187
  dark: boolean | null;
209
188
  bordered: boolean;
210
189
  fullscreen: boolean;
211
- minimizable: boolean;
212
- maximizable: boolean;
213
190
  selected: any[];
214
191
  actions: Array<string>;
215
192
  pagination: {
@@ -224,7 +201,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
224
201
  noDataLabel: string;
225
202
  rowsPerPageOptions: readonly any[];
226
203
  rowsPerPageLabel: string;
227
- searchable: any;
204
+ searchable: boolean;
228
205
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
229
206
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
230
207
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.31.0",
3
+ "version": "1.31.1",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",