@hostlink/nuxt-light 1.26.1 → 1.26.3

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.26.1",
4
+ "version": "1.26.3",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
@@ -1,21 +1,31 @@
1
1
  <script setup lang="ts">
2
2
  import { useLight } from '#imports';
3
+ import { QBar } from 'quasar';
3
4
  import type { QBarProps } from 'quasar';
4
- import { computed } from 'vue';
5
+ import { h, computed, useSlots } from 'vue';
6
+ export interface LBarProps extends QBarProps {
7
+ color?: string;
8
+ textColor?: string;
9
+ }
5
10
 
6
- export type LBarProps = QBarProps;
11
+ const props = withDefaults(defineProps<LBarProps>(), {
12
+ color: undefined,
13
+ textColor: "white"
14
+ });
7
15
 
8
16
  const light = useLight();
9
17
  const barClass = computed(() => {
10
- const c = ["text-white"];
11
- const color = light.color;
18
+ const c = [`text-${props.textColor}`];
19
+ const color = props.color || light.color;
12
20
  c.push(`bg-${color}`);
13
21
  return c;
14
22
  });
23
+
24
+ const root = h(QBar, {
25
+ ...props,
26
+ }, useSlots()) as any;
15
27
  </script>
16
28
 
17
29
  <template>
18
- <q-bar :class="barClass">
19
- <slot></slot>
20
- </q-bar>
30
+ <component :is="root" :class="barClass" />
21
31
  </template>
@@ -1,8 +1,8 @@
1
- <script setup lang="ts">
2
- import { useRouter } from "vue-router";
1
+ <script lang="ts" setup>
2
+ import { h, useSlots } from "vue";
3
+ import { useQuasar, QBtn } from "quasar";
4
+ import { useLight } from "#imports";
3
5
  import type { QBtnProps } from "quasar";
4
- import { useQuasar } from "quasar";
5
- const router = useRouter();
6
6
 
7
7
  export interface LBtnProps extends QBtnProps {
8
8
  permission?: string;
@@ -10,33 +10,37 @@ export interface LBtnProps extends QBtnProps {
10
10
  confirmTitle?: string;
11
11
  }
12
12
 
13
- const $q = useQuasar();
14
13
  const props = withDefaults(defineProps<LBtnProps>(), {
15
14
  permission: "",
16
15
  confirmMessage: "",
17
16
  confirmTitle: "Confirm",
18
17
  });
19
18
 
20
- const onClick = function () {
21
- const args = arguments;
22
- if (props.confirmMessage) {
23
- $q.dialog({
24
- title: props.confirmTitle,
25
- message: props.confirmMessage,
26
- ok: "Yes",
27
- cancel: "No",
28
- }).onOk(() => {
29
- props.onClick?.apply(null, args);
30
- });
31
- } else {
32
- props.onClick?.apply(null, args);
33
- }
34
- };
19
+ const $light = useLight();
20
+ const $q = useQuasar();
21
+ const slots = useSlots() as ReturnType<typeof useSlots>;
35
22
 
23
+ const root = h(QBtn, {
24
+ ...props,
25
+ ...$light.getButtonProps(props),
26
+ onClick: function () {
27
+ const args = arguments;
28
+ if (props.confirmMessage) {
29
+ $q.dialog({
30
+ title: props.confirmTitle,
31
+ message: props.confirmMessage,
32
+ ok: "Yes",
33
+ cancel: "No",
34
+ }).onOk(() => {
35
+ props.onClick?.apply(null, args as any);
36
+ });
37
+ } else {
38
+ props.onClick?.apply(null, args as any);
39
+ }
40
+ },
41
+ }, slots);
36
42
 
37
43
  </script>
38
44
  <template>
39
- <q-btn v-if="$light.isGranted(permission)" v-bind="$light.getButtonProps($props)" @click.capture.stop="onClick">
40
- <slot></slot>
41
- </q-btn>
45
+ <component :is="root" v-if="$light.isGranted($props.permission)"/>
42
46
  </template>
@@ -8,6 +8,7 @@ const { humanStorageSize } = format
8
8
  const light = useLight();
9
9
  const i18n = useI18n();
10
10
  const $q = useQuasar();
11
+ const $light = useLight();
11
12
 
12
13
  const emit = defineEmits(["input", "close"]);
13
14
 
@@ -324,10 +325,14 @@ const onDeleteSelected = () => {
324
325
 
325
326
  }
326
327
 
328
+
329
+
327
330
  const onNewFolder = () => {
328
331
  $q.dialog({
332
+ color: $light.color,
329
333
  title: "New Folder",
330
334
  prompt: {
335
+
331
336
  model: "",
332
337
  label: "Name",
333
338
  isValid: (val) => {
@@ -660,7 +665,7 @@ selectedNodePath.value = drives[0].index.toString();
660
665
  <q-list padding class="text-grey-8">
661
666
  <q-item>
662
667
  <q-item-section>
663
- <l-btn icon="add" label="New" :disable="!selectedNodePath">
668
+ <l-btn icon="add" label="New" :disable="!selectedNodePath" :color="$light.color">
664
669
  <q-menu>
665
670
  <q-list>
666
671
  <q-item clickable v-close-popup @click="onNewFolder" v-if="permission.includes('fs.folder.create')">
@@ -1,18 +1,13 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref } from "vue";
3
- import { useLight } from '#imports';
4
3
  import { type QSelectProps } from "quasar";
5
- import { useI18n } from "vue-i18n";
6
4
 
7
5
  const emits = defineEmits(["update:modelValue"]);
8
6
 
9
- const { t } = useI18n();
10
- const light = useLight();
11
7
  interface LSelectProps extends QSelectProps {
12
8
  required?: boolean,
13
9
  }
14
10
 
15
-
16
11
  const props = withDefaults(defineProps<LSelectProps>(), {
17
12
  rules: () => {
18
13
  return []
@@ -30,6 +25,7 @@ const props = withDefaults(defineProps<LSelectProps>(), {
30
25
  dense: undefined,
31
26
  square: undefined,
32
27
  stackLabel: undefined,
28
+ hideBottomSpace:true
33
29
 
34
30
  })
35
31
 
@@ -112,5 +108,5 @@ const localValue = computed({
112
108
  </script>
113
109
  <template>
114
110
  <q-select v-bind="$light.getInputProps($props)" v-model="localValue" :options="select_options" @filter="filterFn"
115
- :option-label="optionLabel" hide-bottom-space :rules="rules" :clearable="clearable" />
111
+ :option-label="optionLabel" :rules="rules" :clearable="clearable" />
116
112
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.26.1",
3
+ "version": "1.26.3",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",