vueless 0.0.79 → 0.0.80

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.79",
3
+ "version": "0.0.80",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -65,6 +65,7 @@ export default /*tw*/ {
65
65
  color: "brand",
66
66
  type: "link",
67
67
  size: "md",
68
+ ariaCurrentValue: "page",
68
69
  activeClass: "",
69
70
  exactActiveClass: "",
70
71
  wrapperActiveClass: "",
@@ -75,6 +76,8 @@ export default /*tw*/ {
75
76
  dashed: false,
76
77
  disabled: false,
77
78
  targetBlank: false,
79
+ custom: false,
80
+ replace: false,
78
81
  },
79
82
  safelist: (colors) => [
80
83
  { pattern: `decoration-(${colors})-500` },
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div v-bind="wrapperAttrs" ref="wrapperRef" tabindex="-1">
3
- <div v-if="hasSlotContent(slots['left'])" v-bind="leftSlotAttrs">
3
+ <div v-if="hasSlotContent($slots['left'])" v-bind="leftSlotAttrs">
4
4
  <!-- @slot Use it to add something before text. -->
5
5
  <slot name="left" />
6
6
  </div>
@@ -19,7 +19,7 @@
19
19
  >
20
20
  <!-- @slot Use it replace the text. -->
21
21
  <slot>
22
- <span v-if="!hasSlotContent(slots['default'])" v-bind="textAttrs" v-text="label" />
22
+ <span v-if="!hasSlotContent($slots['default'])" v-bind="textAttrs" v-text="label" />
23
23
  </slot>
24
24
  </router-link>
25
25
 
@@ -37,11 +37,11 @@
37
37
  >
38
38
  <!-- @slot Use it replace the text. -->
39
39
  <slot>
40
- <span v-if="!hasSlotContent(slots['default'])" v-bind="textAttrs" v-text="label" />
40
+ <span v-if="!hasSlotContent($slots['default'])" v-bind="textAttrs" v-text="label" />
41
41
  </slot>
42
42
  </a>
43
43
 
44
- <div v-if="hasSlotContent(slots['right'])" v-bind="rightSlotAttrs">
44
+ <div v-if="hasSlotContent($slots['right'])" v-bind="rightSlotAttrs">
45
45
  <!-- @slot Use it to add something after text. -->
46
46
  <slot name="right" />
47
47
  </div>
@@ -49,7 +49,7 @@
49
49
  </template>
50
50
 
51
51
  <script setup>
52
- import { computed, useSlots, ref } from "vue";
52
+ import { computed, ref } from "vue";
53
53
  import { RouterLink, useLink } from "vue-router";
54
54
  import UIService from "../service.ui";
55
55
 
@@ -122,6 +122,30 @@ const props = defineProps({
122
122
  default: UIService.get(defaultConfig, ULink).default.targetBlank,
123
123
  },
124
124
 
125
+ /**
126
+ * Pass value to the attribute aria-current when the link is exact active.
127
+ */
128
+ ariaCurrentValue: {
129
+ type: String,
130
+ default: UIService.get(defaultConfig, ULink).default.ariaCurrentValue,
131
+ },
132
+
133
+ /**
134
+ * Whether RouterLink should not wrap its content in an a tag.
135
+ */
136
+ custom: {
137
+ type: Boolean,
138
+ default: UIService.get(defaultConfig, ULink).default.custom,
139
+ },
140
+
141
+ /**
142
+ * Whether RouterLink should not wrap its content in an a tag.
143
+ */
144
+ replace: {
145
+ type: Boolean,
146
+ default: UIService.get(defaultConfig, ULink).default.replace,
147
+ },
148
+
125
149
  /**
126
150
  * Apply classes to the link when its route is active or when it matches any parent route.
127
151
  */
@@ -211,8 +235,20 @@ const props = defineProps({
211
235
  },
212
236
  });
213
237
 
214
- const slots = useSlots();
215
- const { route, isActive, isExactActive } = useLink({ to: props.route });
238
+ const isPresentRoute = computed(() => {
239
+ for (let key in props.route) return true;
240
+
241
+ return false;
242
+ });
243
+
244
+ const { route, isActive, isExactActive } = useLink({
245
+ activeClass: props.activeClass,
246
+ ariaCurrentValue: props.ariaCurrentValue,
247
+ exactActiveClass: props.exactActiveClass,
248
+ custom: props.custom,
249
+ replace: props.replace,
250
+ to: isPresentRoute.value ? props.route : "/",
251
+ });
216
252
 
217
253
  const wrapperRef = ref(null);
218
254
 
@@ -235,12 +271,6 @@ const href = computed(() => {
235
271
  return `${types[props.type]}${props.url}`;
236
272
  });
237
273
 
238
- const isPresentRoute = computed(() => {
239
- for (let key in props.route) return true;
240
-
241
- return false;
242
- });
243
-
244
274
  function onClick(event) {
245
275
  !props.url || props.disabled ? emit("click", event) : window.open(href.value, props.targetValue);
246
276
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div v-bind="wrapperAttrs">
3
- <div v-if="!hasSlotContent(slots['default'])">
3
+ <div v-if="!hasSlotContent($slots['default'])">
4
4
  <ULabel
5
5
  :label="props.label"
6
6
  :description="props.description"
@@ -65,7 +65,7 @@ import Uppy from "@uppy/core";
65
65
  import DragDrop from "@uppy/vue/src/drag-drop";
66
66
  import { merge } from "lodash-es";
67
67
 
68
- import { computed, onBeforeUnmount, onMounted, ref, useSlots, watch } from "vue";
68
+ import { computed, onBeforeUnmount, onMounted, ref, watch } from "vue";
69
69
 
70
70
  import UIcon from "../ui.image-icon";
71
71
  import ULabel from "../ui.form-label";
@@ -191,8 +191,6 @@ const props = defineProps({
191
191
  },
192
192
  });
193
193
 
194
- const slots = useSlots();
195
-
196
194
  const emit = defineEmits(["changeFiles", "deleteFile"]);
197
195
 
198
196
  const { tm } = useLocale();
@@ -26,7 +26,7 @@
26
26
  <slot name="right" />
27
27
 
28
28
  <UButton
29
- v-if="searchButton && !hasSlotContent(slots['right'])"
29
+ v-if="searchButton && !hasSlotContent($slots['right'])"
30
30
  :label="text"
31
31
  v-bind="buttonAttrs"
32
32
  :data-cy="`${dataCy}-right`"
@@ -62,7 +62,7 @@
62
62
  </template>
63
63
 
64
64
  <script setup>
65
- import { computed, useSlots } from "vue";
65
+ import { computed } from "vue";
66
66
 
67
67
  import UIcon from "../ui.image-icon";
68
68
  import UInput from "../ui.form-input";
@@ -184,7 +184,6 @@ const props = defineProps({
184
184
  },
185
185
  });
186
186
 
187
- const slots = useSlots();
188
187
  const emit = defineEmits(["update:modelValue", "clear", "search"]);
189
188
 
190
189
  const { config, inputAttrs, searchIconAttrs, closeIconAttrs, buttonAttrs, hasSlotContent } =
@@ -4,7 +4,7 @@
4
4
  <!-- @slot Use it to add something inside. -->
5
5
  <slot />
6
6
 
7
- <div v-if="!hasSlotContent(slots['default'])" v-html="html" />
7
+ <div v-if="!hasSlotContent($slots['default'])" v-html="html" />
8
8
  </div>
9
9
 
10
10
  <UButton size="sm" variant="thirdary" :color="color" square v-bind="buttonAttrs">
@@ -23,7 +23,7 @@
23
23
  </template>
24
24
 
25
25
  <script setup>
26
- import { onMounted, ref, useSlots } from "vue";
26
+ import { onMounted, ref } from "vue";
27
27
 
28
28
  import UIcon from "../ui.image-icon";
29
29
  import UButton from "../ui.button";
@@ -103,7 +103,6 @@ const props = defineProps({
103
103
  },
104
104
  });
105
105
 
106
- const slots = useSlots();
107
106
  const emit = defineEmits(["hidden"]);
108
107
 
109
108
  const isShownAlert = ref(true);
@@ -1,14 +1,12 @@
1
1
  <template>
2
2
  <div v-bind="wrapperAttrs" :data-cy="dataCy">
3
3
  <!-- @slot Use it to add something. -->
4
- <div v-if="!hasSlotContent(slots['default'])" v-html="html" />
4
+ <div v-if="!hasSlotContent($slots['default'])" v-html="html" />
5
5
  <slot />
6
6
  </div>
7
7
  </template>
8
8
 
9
9
  <script setup>
10
- import { useSlots } from "vue";
11
-
12
10
  import UIService from "../service.ui";
13
11
 
14
12
  import { UText } from "./constatns";
@@ -70,7 +68,5 @@ const props = defineProps({
70
68
  },
71
69
  });
72
70
 
73
- const slots = useSlots();
74
-
75
71
  const { wrapperAttrs, hasSlotContent } = useAttrs(props);
76
72
  </script>
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.79",
4
+ "version": "0.0.80",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -4302,6 +4302,33 @@
4302
4302
  },
4303
4303
  "default": "false"
4304
4304
  },
4305
+ {
4306
+ "name": "ariaCurrentValue",
4307
+ "description": "Pass value to the attribute aria-current when the link is exact active.",
4308
+ "value": {
4309
+ "kind": "expression",
4310
+ "type": "string"
4311
+ },
4312
+ "default": "page"
4313
+ },
4314
+ {
4315
+ "name": "custom",
4316
+ "description": "Whether RouterLink should not wrap its content in an a tag.",
4317
+ "value": {
4318
+ "kind": "expression",
4319
+ "type": "boolean"
4320
+ },
4321
+ "default": "false"
4322
+ },
4323
+ {
4324
+ "name": "replace",
4325
+ "description": "Whether RouterLink should not wrap its content in an a tag.",
4326
+ "value": {
4327
+ "kind": "expression",
4328
+ "type": "boolean"
4329
+ },
4330
+ "default": "false"
4331
+ },
4305
4332
  {
4306
4333
  "name": "activeClass",
4307
4334
  "description": "Apply classes to the link when its route is active or when it matches any parent route.",