vueless 0.0.392 → 0.0.394

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.394",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -25,7 +25,7 @@ const props = defineProps({
25
25
  },
26
26
 
27
27
  /**
28
- * Nested items align (flex align-items).
28
+ * Items horizontal align (align-items).
29
29
  * @values start, end, center, stretch, baseline
30
30
  */
31
31
  align: {
@@ -34,7 +34,16 @@ const props = defineProps({
34
34
  },
35
35
 
36
36
  /**
37
- * Nested items horizontally align (flex justify-content).
37
+ * Items horizontal align for multi-row flex containers (align-content).
38
+ * @values start, end, center, around, evenly, between, normal, stretch, baseline
39
+ */
40
+ content: {
41
+ type: String,
42
+ default: getDefault(defaultConfig, UCol).content,
43
+ },
44
+
45
+ /**
46
+ * Items vertical align (justify-content).
38
47
  * @values start, end, center, around, evenly, between
39
48
  */
40
49
  justify: {
@@ -36,11 +36,23 @@ export default /*tw*/ {
36
36
  evenly: "justify-evenly",
37
37
  between: "justify-between",
38
38
  },
39
+ content: {
40
+ end: "content-end",
41
+ start: "content-start",
42
+ center: "content-center",
43
+ around: "content-around",
44
+ evenly: "content-evenly",
45
+ normal: "content-normal",
46
+ stretch: "content-stretch",
47
+ between: "content-between",
48
+ baseline: "content-baseline",
49
+ },
39
50
  },
40
51
  },
41
52
  defaults: {
42
53
  gap: "md",
43
54
  align: "start",
55
+ content: "start",
44
56
  justify: "start",
45
57
  wrap: false,
46
58
  reverse: false,
@@ -25,7 +25,7 @@ const props = defineProps({
25
25
  },
26
26
 
27
27
  /**
28
- * Nested items vertical align (flex align-items).
28
+ * Items vertical align (align-items).
29
29
  * @values start, end, center, stretch, baseline
30
30
  */
31
31
  align: {
@@ -34,7 +34,16 @@ const props = defineProps({
34
34
  },
35
35
 
36
36
  /**
37
- * Nested items horizontally align (flex justify-content).
37
+ * Items vertical align for multi-row flex containers (align-content).
38
+ * @values start, end, center, around, evenly, between, normal, stretch, baseline
39
+ */
40
+ content: {
41
+ type: String,
42
+ default: getDefault(defaultConfig, URow).content,
43
+ },
44
+
45
+ /**
46
+ * Items horizontally align (justify-content).
38
47
  * @values start, end, center, around, evenly, between
39
48
  */
40
49
  justify: {
@@ -37,11 +37,23 @@ export default /*tw*/ {
37
37
  evenly: "justify-evenly",
38
38
  between: "justify-between",
39
39
  },
40
+ content: {
41
+ end: "content-end",
42
+ start: "content-start",
43
+ center: "content-center",
44
+ around: "content-around",
45
+ evenly: "content-evenly",
46
+ normal: "content-normal",
47
+ stretch: "content-stretch",
48
+ between: "content-between",
49
+ baseline: "content-baseline",
50
+ },
40
51
  },
41
52
  },
42
53
  defaults: {
43
54
  gap: "md",
44
55
  align: "start",
56
+ content: "start",
45
57
  justify: "start",
46
58
  wrap: false,
47
59
  reverse: false,
@@ -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.394",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -1852,16 +1852,25 @@
1852
1852
  },
1853
1853
  {
1854
1854
  "name": "align",
1855
- "description": "Nested items align (flex align-items).",
1855
+ "description": "Items horizontal align (align-items).",
1856
1856
  "value": {
1857
1857
  "kind": "expression",
1858
1858
  "type": "'start' | 'end' | 'center' | 'stretch' | 'baseline'"
1859
1859
  },
1860
1860
  "default": "start"
1861
1861
  },
1862
+ {
1863
+ "name": "content",
1864
+ "description": "Items horizontal align for multi-row flex containers (align-content).",
1865
+ "value": {
1866
+ "kind": "expression",
1867
+ "type": "'start' | 'end' | 'center' | 'around' | 'evenly' | 'between' | 'normal' | 'stretch' | 'baseline'"
1868
+ },
1869
+ "default": "start"
1870
+ },
1862
1871
  {
1863
1872
  "name": "justify",
1864
- "description": "Nested items horizontally align (flex justify-content).",
1873
+ "description": "Items vertical align (justify-content).",
1865
1874
  "value": {
1866
1875
  "kind": "expression",
1867
1876
  "type": "'start' | 'end' | 'center' | 'around' | 'evenly' | 'between'"
@@ -7258,16 +7267,25 @@
7258
7267
  },
7259
7268
  {
7260
7269
  "name": "align",
7261
- "description": "Nested items vertical align (flex align-items).",
7270
+ "description": "Items vertical align (align-items).",
7262
7271
  "value": {
7263
7272
  "kind": "expression",
7264
7273
  "type": "'start' | 'end' | 'center' | 'stretch' | 'baseline'"
7265
7274
  },
7266
7275
  "default": "start"
7267
7276
  },
7277
+ {
7278
+ "name": "content",
7279
+ "description": "Items vertical align for multi-row flex containers (align-content).",
7280
+ "value": {
7281
+ "kind": "expression",
7282
+ "type": "'start' | 'end' | 'center' | 'around' | 'evenly' | 'between' | 'normal' | 'stretch' | 'baseline'"
7283
+ },
7284
+ "default": "start"
7285
+ },
7268
7286
  {
7269
7287
  "name": "justify",
7270
- "description": "Nested items horizontally align (flex justify-content).",
7288
+ "description": "Items horizontally align (justify-content).",
7271
7289
  "value": {
7272
7290
  "kind": "expression",
7273
7291
  "type": "'start' | 'end' | 'center' | 'around' | 'evenly' | 'between'"