@hostlink/nuxt-light 1.40.4 → 1.41.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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.40.4",
4
+ "version": "1.41.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
7
7
  "unbuild": "3.5.0"
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { useLight, q, m } from "#imports";
3
- import { ref, computed, useSlots, onMounted } from "vue";
3
+ import { ref, computed, onMounted } from "vue";
4
+ import { useStorage } from "@vueuse/core";
4
5
  const emit = defineEmits(["close"]);
5
6
  const minimized = defineModel("minimized", { type: Boolean, ...{ default: false } });
6
7
  const maximized = defineModel("maximized", { type: Boolean, ...{ default: false } });
@@ -12,12 +13,17 @@ const props = defineProps({
12
13
  closeable: { type: Boolean, required: false },
13
14
  minimizable: { type: Boolean, required: false },
14
15
  maximizable: { type: Boolean, required: false },
16
+ name: { type: String, required: false },
15
17
  dark: { type: [Boolean, null], required: false, skipCheck: true },
16
18
  square: { type: Boolean, required: false, skipCheck: true, default: void 0 },
17
19
  flat: { type: Boolean, required: false, skipCheck: true, default: void 0 },
18
20
  bordered: { type: Boolean, required: false, skipCheck: true, default: void 0 },
19
21
  tag: { type: null, required: false }
20
22
  });
23
+ const storedMinimized = props.name ? useStorage(`l-card-minimized-${props.name}`, false) : ref(false);
24
+ if (props.name && storedMinimized.value) {
25
+ minimized.value = storedMinimized.value;
26
+ }
21
27
  const attrs = computed(() => {
22
28
  return { ...light.styles.card, ...Object.fromEntries(Object.entries(props).filter(([key, value]) => value !== void 0)) };
23
29
  });
@@ -84,6 +90,12 @@ onMounted(async () => {
84
90
  const onClose = () => {
85
91
  emit("close");
86
92
  };
93
+ const onMinimize = () => {
94
+ minimized.value = !minimized.value;
95
+ if (props.name) {
96
+ storedMinimized.value = minimized.value;
97
+ }
98
+ };
87
99
  </script>
88
100
 
89
101
  <template>
@@ -106,7 +118,7 @@ const onClose = () => {
106
118
  </q-menu>
107
119
  </q-btn>
108
120
 
109
- <q-btn dense flat :icon="minimized ? 'sym_o_add' : 'sym_o_remove'" @click="minimized = !minimized"
121
+ <q-btn dense flat :icon="minimized ? 'sym_o_add' : 'sym_o_remove'" @click="onMinimize"
110
122
  v-if="minimizable && !maximized" />
111
123
  <q-btn dense flat @click="maximized = !maximized"
112
124
  :icon="maximized ? 'sym_o_select_window_2' : 'sym_o_crop_square'" v-if="maximizable" />
@@ -9,6 +9,7 @@ export interface LCardProps extends QCardProps {
9
9
  closeable?: boolean;
10
10
  minimizable?: boolean;
11
11
  maximizable?: boolean;
12
+ name?: string;
12
13
  }
13
14
  type __VLS_Props = LCardProps;
14
15
  type __VLS_PublicProps = __VLS_Props & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.40.4",
3
+ "version": "1.41.0",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,6 +36,7 @@
36
36
  "@nuxt/module-builder": "^1.0.1",
37
37
  "@quasar/extras": "^1.17.0",
38
38
  "@quasar/quasar-ui-qmarkdown": "^2.0.5",
39
+ "@vueuse/core": "^13.9.0",
39
40
  "axios": "^1.12.2",
40
41
  "defu": "^6.1.4",
41
42
  "diff2html": "^3.4.47",