vueless 0.0.392 → 0.0.393

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.
@@ -31,7 +31,7 @@ export function useAutoPosition(anchorElement, targetElement, position, preferre
31
31
  return localPosition.value.x === POSITION.left;
32
32
  }
33
33
 
34
- return preferredOpenDirectionX.value === POSITION.right;
34
+ return preferredOpenDirectionX.value === POSITION.left;
35
35
  });
36
36
 
37
37
  const isBottom = computed(() => {
@@ -60,12 +60,12 @@ export function useAutoPosition(anchorElement, targetElement, position, preferre
60
60
  const hasEnoughSpaceAbove =
61
61
  spaceAbove > localTargetElement.value.getBoundingClientRect().height;
62
62
 
63
- if (localPreferredPosition.value.y === POSITION.top) {
63
+ if (localPreferredPosition.value.y === POSITION.bottom) {
64
64
  preferredOpenDirectionY.value =
65
65
  hasEnoughSpaceBelow || spaceBelow > spaceAbove ? POSITION.bottom : POSITION.top;
66
66
  }
67
67
 
68
- if (localPreferredPosition.value.y === POSITION.bottom) {
68
+ if (localPreferredPosition.value.y === POSITION.top) {
69
69
  preferredOpenDirectionY.value =
70
70
  hasEnoughSpaceAbove || spaceAbove > spaceBelow ? POSITION.top : POSITION.bottom;
71
71
  }
@@ -79,12 +79,12 @@ export function useAutoPosition(anchorElement, targetElement, position, preferre
79
79
  const hasEnoughSpaceLeft = spaceLeft > localTargetElement.value.getBoundingClientRect().width;
80
80
  const hasEnoughSpaceRight = spaceRight > localTargetElement.value.getBoundingClientRect().width;
81
81
 
82
- if (localPreferredPosition.value.x === POSITION.left) {
82
+ if (localPreferredPosition.value.x === POSITION.right) {
83
83
  preferredOpenDirectionX.value =
84
84
  hasEnoughSpaceRight || spaceRight > spaceLeft ? POSITION.right : POSITION.left;
85
85
  }
86
86
 
87
- if (localPreferredPosition.value.x === POSITION.right) {
87
+ if (localPreferredPosition.value.x === POSITION.left) {
88
88
  preferredOpenDirectionX.value =
89
89
  hasEnoughSpaceLeft || spaceLeft > spaceRight ? POSITION.left : POSITION.right;
90
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.392",
3
+ "version": "0.0.393",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -14,7 +14,7 @@
14
14
  :size="size"
15
15
  :left-icon="leftIcon"
16
16
  :right-icon="rightIcon"
17
- v-bind="inputAttrs"
17
+ v-bind="isShownCalendar ? activeInputAttrs : inputAttrs"
18
18
  @focus="activate"
19
19
  >
20
20
  <template #left>
@@ -317,7 +317,7 @@ const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props
317
317
 
318
318
  const elementId = props.id || useId();
319
319
 
320
- const { config, inputAttrs, calendarAttrs, wrapperAttrs } = useAttrs(props, {
320
+ const { config, inputAttrs, activeInputAttrs, calendarAttrs, wrapperAttrs } = useAttrs(props, {
321
321
  isShownCalendar,
322
322
  isTop,
323
323
  isRight,
@@ -1,9 +1,9 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: "relative",
3
3
  input: "{UInput}",
4
- inputFocused: {
4
+ activeInput: {
5
5
  component: "{UInput}",
6
- block: "ring-dynamic ring-offset-dynamic ring-brand-700/15 border-brand-500 hover:border-brand-500",
6
+ block: "ring-dynamic rounded-dynamic ring-offset-dynamic ring-brand-700/15 border-brand-500 hover:border-brand-500",
7
7
  },
8
8
  calendar: {
9
9
  component: "{UCalendar}",
@@ -5,11 +5,8 @@ import useUI from "../composables/useUI.js";
5
5
  import defaultConfig from "./config.js";
6
6
  import { POSITION } from "../composables/useAutoPosition.js";
7
7
 
8
- export default function useAttrs(props, { isShownCalendar, isTop, isRight }) {
9
- const { config, getKeysAttrs, hasSlotContent, getExtendingKeysClasses } = useUI(
10
- defaultConfig,
11
- () => props.config,
12
- );
8
+ export default function useAttrs(props, { isTop, isRight }) {
9
+ const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
13
10
 
14
11
  const mutatedProps = computed(() => ({
15
12
  openDirectionY: isTop.value ? POSITION.top : POSITION.bottom,
@@ -18,14 +15,7 @@ export default function useAttrs(props, { isShownCalendar, isTop, isRight }) {
18
15
  description: Boolean(props.description),
19
16
  }));
20
17
 
21
- const extendingKeys = ["inputFocused"];
22
- const extendingKeysClasses = getExtendingKeysClasses(extendingKeys, mutatedProps);
23
-
24
- const keysAttrs = getKeysAttrs(mutatedProps, extendingKeys, {
25
- input: {
26
- extend: computed(() => [isShownCalendar.value && extendingKeysClasses.inputFocused.value]),
27
- },
28
- });
18
+ const keysAttrs = getKeysAttrs(mutatedProps);
29
19
 
30
20
  /* Merging DatePicker's i18n translations into Calendar's i18n translations. */
31
21
  watchEffect(() => {
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.392",
4
+ "version": "0.0.393",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",