quasar-ui-danx 0.2.18 → 0.2.20

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,8 +3,7 @@
3
3
  <div
4
4
  v-for="category in categories"
5
5
  :key="category"
6
- class="category-toggle border-gray-200"
7
- :class="{'has-visible-columns text-white bg-blue-600': categoryHasVisibleColumns(category)}"
6
+ :class="getCategoryClass(category)"
8
7
  >
9
8
  <QCheckbox
10
9
  toggle-indeterminate
@@ -46,7 +45,7 @@
46
45
  </div>
47
46
  </template>
48
47
  <script setup>
49
- import { computed, ref } from "vue";
48
+ import { computed, ref, useCssModule } from "vue";
50
49
  import { remove } from "../../../helpers";
51
50
  import { CaretDownIcon } from "../../../svg";
52
51
 
@@ -141,12 +140,18 @@ function toggleColumn(columnName, showColumn) {
141
140
 
142
141
  emit("update:hidden-column-names", hiddenColumnNames);
143
142
  }
143
+
144
+ const cls = useCssModule();
145
+ function getCategoryClass(category) {
146
+ return cls["category-toggle"] + (categoryHasVisibleColumns(category) ? (" " + cls["has-visible-columns"]) : "");
147
+ }
144
148
  </script>
145
- <style
146
- lang="scss"
147
- scoped
148
- >
149
+ <style lang="scss" module>
149
150
  .category-toggle {
150
- @apply text-xs font-bold rounded-lg border border-solid px-2 py-1 mx-1 cursor-pointer flex items-center;
151
+ @apply text-xs font-bold rounded-lg border border-solid px-2 py-1 mx-1 cursor-pointer flex items-center border-gray-200;
152
+
153
+ &.has-visible-columns {
154
+ @apply text-white bg-blue-600;
155
+ }
151
156
  }
152
157
  </style>
@@ -3,7 +3,7 @@
3
3
  :model-value="modelValue"
4
4
  vertical
5
5
  align="left"
6
- class="panel-tabs p-4 h-auto"
6
+ :class="cls['panel-tabs']"
7
7
  no-caps
8
8
  @update:model-value="$emit('update:model-value', $event)"
9
9
  >
@@ -39,26 +39,25 @@ defineProps({
39
39
  });
40
40
  </script>
41
41
 
42
- <style
43
- lang="scss"
44
- scoped
45
- >
42
+ <style lang="scss" module="cls">
46
43
  .panel-tabs {
47
- :deep(.q-tab) {
44
+ @apply p-4 h-auto;
45
+
46
+ :global(.q-tab) {
48
47
  justify-content: start !important;
49
48
  padding: 0;
50
49
  @apply text-left py-2.5 px-2 rounded-lg hover:bg-slate-200;
51
50
 
52
- .q-focus-helper, .q-tab__indicator {
51
+ :global(.q-focus-helper), :global(.q-tab__indicator) {
53
52
  display: none;
54
53
  }
55
54
 
56
- .q-tab__content {
55
+ :global(.q-tab__content) {
57
56
  @apply p-0;
58
57
  }
59
58
  }
60
59
 
61
- :deep(.q-tab.q-tab--active) {
60
+ :global(.q-tab.q-tab--active) {
62
61
  @apply text-white bg-blue-600;
63
62
  }
64
63
  }
@@ -15,7 +15,7 @@
15
15
  animated
16
16
  :thumbnails="files.length > 1"
17
17
  infinite
18
- class="carousel"
18
+ :class="cls['carousel']"
19
19
  >
20
20
  <QCarouselSlide
21
21
  v-for="file in files"
@@ -23,7 +23,7 @@
23
23
  :name="file.id"
24
24
  :img-src="getThumbUrl(file)"
25
25
  >
26
- <div class="slide-image">
26
+ <div :class="cls['slide-image']">
27
27
  <template v-if="isVideo(file)">
28
28
  <video
29
29
  class="max-h-full w-full"
@@ -80,7 +80,7 @@ function getThumbUrl(file) {
80
80
  }
81
81
  }
82
82
  </script>
83
- <style scoped lang="scss">
83
+ <style module="cls" lang="scss">
84
84
  .slide-image {
85
85
  width: 100%;
86
86
  height: 100%;
@@ -19,7 +19,7 @@
19
19
  :type="mimeType"
20
20
  />
21
21
  </video>
22
- <button class="play-button text-blue-lighter">
22
+ <button :class="cls['play-button']">
23
23
  <PlayIcon class="w-16" />
24
24
  </button>
25
25
  </div>
@@ -41,7 +41,7 @@
41
41
  </div>
42
42
  <div
43
43
  v-if="$slots['action-button']"
44
- class="action-button"
44
+ :class="cls['action-button']"
45
45
  >
46
46
  <slot name="action-button" />
47
47
  </div>
@@ -173,7 +173,7 @@ function onRemove() {
173
173
  }
174
174
  </script>
175
175
 
176
- <style scoped lang="scss">
176
+ <style module="cls" lang="scss">
177
177
  .action-button {
178
178
  position: absolute;
179
179
  bottom: 1.5em;
@@ -191,5 +191,6 @@ function onRemove() {
191
191
  width: 100%;
192
192
  height: 100%;
193
193
  pointer-events: none;
194
+ @apply text-blue-200;
194
195
  }
195
196
  </style>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
- class="collapsable-sidebar overflow-x-hidden overflow-y-scroll relative"
4
3
  :class="{
4
+ [cls['collapsable-sidebar']]: true,
5
5
  'is-collapsed': isCollapsed,
6
6
  'is-right-side': rightSide,
7
7
  [displayClass]: true,
@@ -109,11 +109,8 @@ watch(() => props.collapse, () => {
109
109
  });
110
110
  </script>
111
111
 
112
- <style
113
- scoped
114
- lang="scss"
115
- >
112
+ <style module="cls" lang="scss">
116
113
  .collapsable-sidebar {
117
- @apply overflow-y-auto scroll-smooth flex-shrink-0 border-r border-gray-200 transition-all;
114
+ @apply overflow-y-auto overflow-x-hidden scroll-smooth flex-shrink-0 border-r border-gray-200 transition-all relative;
118
115
  }
119
116
  </style>
@@ -9,15 +9,12 @@
9
9
  <div>
10
10
  <div
11
11
  v-if="title"
12
- class="dialog-title bg-slate-100 text-gray-500 border-gray-200"
12
+ :class="cls['dialog-title']"
13
13
  @click.stop.prevent
14
14
  >
15
15
  {{ title }}
16
16
  </div>
17
- <div
18
- class="dialog-content bg-white"
19
- :class="{ [contentClass]: true }"
20
- >
17
+ <div :class="{[cls['dialog-content']]: true, [contentClass]: true}">
21
18
  <slot />
22
19
  </div>
23
20
  </div>
@@ -53,18 +50,16 @@ const isShowing = computed({
53
50
  });
54
51
  </script>
55
52
 
56
- <style
57
- lang="scss"
58
- scoped
59
- >
53
+ <style lang="scss" module="cls">
60
54
  .dialog-title {
61
- @apply font-medium uppercase text-xs px-6 py-3 border-b rounded-t-md;
55
+ @apply font-medium uppercase text-xs px-6 py-3 border-b rounded-t-md bg-slate-100 text-gray-500 border-gray-200;
62
56
  font-family: "Roboto", sans-serif;
63
57
  letter-spacing: 0.05em;
64
58
  box-shadow: 0px -4px 12px rgba(0, 0, 0, 0.25);
65
59
  }
66
60
 
67
61
  .dialog-content {
62
+ @apply bg-white;
68
63
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
69
64
  }
70
65
  </style>
@@ -76,7 +76,7 @@ function onLeave(el, onComplete) {
76
76
  }
77
77
  </script>
78
78
 
79
- <style scoped lang="scss">
79
+ <style lang="scss">
80
80
  .list-move,
81
81
  .list-enter-active,
82
82
  .list-leave-active {
@@ -1,3 +1,4 @@
1
+ export * from "./actions";
1
2
  export * from "./array";
2
3
  export * from "./compatibility";
3
4
  export * from "./date";
@@ -9,7 +10,7 @@ export * from "./FlashMessages";
9
10
  export * from "./formats";
10
11
  export * from "./http";
11
12
  export * from "./multiFileUpload";
12
- export * from "./actions";
13
13
  export * from "./singleFileUpload";
14
14
  export * from "./storage";
15
+ export * from "./styles";
15
16
  export * from "./utils";
@@ -0,0 +1,18 @@
1
+ export function applyCssVars(styles: object, prefix: string = "") {
2
+ const cssVars = buildCssVars(styles, prefix);
3
+
4
+ // Create a new <style> tag and inject the CSS Vars
5
+ const style = document.createElement("style");
6
+ style.innerHTML = `:root {${cssVars}}`;
7
+ document.head.appendChild(style);
8
+ }
9
+
10
+ export function buildCssVars(styles: object, prefix: string = ""): string {
11
+ // Convert the object into a CSS Vars string
12
+ return Object.entries(styles).map(([key, value]) => {
13
+ if (typeof value === "object") {
14
+ return buildCssVars(value, `${prefix}${key}-`);
15
+ }
16
+ return `--${prefix}${key}: ${value}`;
17
+ }).join(";");
18
+ }
@@ -1,11 +1,24 @@
1
- /** @type {import('tailwindcss').Config} */
1
+ /** @type {import("tailwindcss").Config} */
2
+ import twColors from "tailwindcss/colors";
3
+
4
+ // Convert all TW colors to CSS Variables
5
+ const colorKeys = Object.keys(twColors).filter(c => twColors[c].hasOwnProperty("500"));
6
+ const colors = {};
7
+
8
+ for (const name of colorKeys) {
9
+ const twColor = twColors[name];
10
+ for (const offset of Object.keys(twColor)) {
11
+ colors[name] = colors[name] || {};
12
+ colors[name][offset] = `var(--tw-${name}-${offset}, ${twColor[offset]})`;
13
+ }
14
+ }
15
+
2
16
  export default {
3
- content: ['./*.html', './src/**/*.{vue,ts}'],
4
- safelist: [
5
- 'bg-slate-200'
6
- ],
17
+ content: ["./*.html", "./src/**/*.{vue,ts}"],
7
18
  theme: {
8
- extend: {}
19
+ extend: {
20
+ colors
21
+ }
9
22
  },
10
23
  plugins: []
11
24
  };