quasar-ui-danx 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quasar-ui-danx",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "author": "Dan <dan@flytedesk.com>",
5
5
  "description": "DanX Vue / Quasar component library",
6
6
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "repository": {
16
16
  "type": "git",
17
- "url": "https://github.com/flytedan/quasar-app-extension-danx"
17
+ "url": "https://github.com/flytedan/quasar-ui-danx"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@quasar/extras": "^1.16.4",
@@ -6,15 +6,20 @@
6
6
  <div
7
7
  v-for="item in allowedItems"
8
8
  :key="'nav-item-' + item.label"
9
+ class="nav-menu-item"
10
+ :class="item.class || itemClass"
9
11
  >
10
- <a class="nav-link" @click="item.onClick">
11
- <component
12
- :is="item.icon"
13
- class="nav-icon"
14
- />
15
- <div class="label ml-2">{{ item.label }}</div>
16
- <QTooltip v-if="collapsed">{{ item.label }}</QTooltip>
17
- </a>
12
+ <div class="flex flex-nowrap" @click="item.onClick">
13
+ <div v-if="item.icon">
14
+ <component
15
+ :is="item.icon"
16
+ class="nav-icon"
17
+ :class="item.iconClass"
18
+ />
19
+ </div>
20
+ <div class="label ml-2" :class="item.labelClass">{{ item.label }}</div>
21
+ <QTooltip v-if="collapsed" v-bind="item.tooltip">{{ item.tooltip?.text || item.label }}</QTooltip>
22
+ </div>
18
23
  <QSeparator
19
24
  v-if="item.separator"
20
25
  :key="'separator-' + item.label"
@@ -28,6 +33,14 @@ import { computed } from "vue";
28
33
 
29
34
  const props = defineProps({
30
35
  collapsed: Boolean,
36
+ itemClass: {
37
+ type: String,
38
+ default: "hover:bg-gray-200"
39
+ },
40
+ activeClass: {
41
+ type: String,
42
+ default: "bg-blue-200"
43
+ },
31
44
  items: {
32
45
  type: Array,
33
46
  required: true
@@ -38,27 +51,15 @@ const allowedItems = computed(() => props.items.filter((item) => !item.hidden));
38
51
  </script>
39
52
 
40
53
  <style lang="scss">
41
- .nav-link {
42
- display: block !important;
54
+ .nav-menu-item {
43
55
  padding: 1.2em;
44
56
  border-radius: 0.5em;
45
57
  font-weight: bold;
46
58
  font-size: 14px;
47
- color: black;
48
59
  height: 3.8em;
49
60
  width: 13em;
50
- transition: all 150ms;
51
-
52
- &:hover {
53
- @apply bg-gray-200;
54
- .nav-icon {
55
- @apply text-gray-700;
56
- }
57
- }
58
-
59
- &.is-active {
60
- @apply bg-blue-100;
61
- }
61
+ transition: all 150ms, color 0ms;
62
+ cursor: pointer;
62
63
 
63
64
  &.is-disabled {
64
65
  @apply bg-inherit;
@@ -69,7 +70,7 @@ const allowedItems = computed(() => props.items.filter((item) => !item.hidden));
69
70
  }
70
71
 
71
72
  .nav-icon {
72
- @apply w-5 h-5 flex-shrink-0 text-black;
73
+ @apply w-5 h-5 flex-shrink-0;
73
74
  }
74
75
  }
75
76
 
@@ -1,9 +1,8 @@
1
1
  <template>
2
- <div class="relative flex justify-center bg-gray-100" :class="{'rounded-2xl': !square}">
2
+ <div class="relative flex justify-center bg-gray-100 overflow-hidden" :class="{'rounded-2xl': !square}">
3
3
  <template v-if="computedImage">
4
4
  <div
5
- class="grow h-full overflow-hidden"
6
- :class="{'rounded-2xl': !square}"
5
+ class="grow h-full"
7
6
  @click="showPreview = true"
8
7
  >
9
8
  <div