@naptics/vue-collection 0.2.0 → 0.2.2

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.
@@ -1,4 +1,4 @@
1
- import { createVNode as _createVNode, createTextVNode as _createTextVNode } from "vue";
1
+ import { createVNode as _createVNode } from "vue";
2
2
  import { createComponent } from '../utils/component';
3
3
  import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/vue/24/solid';
4
4
  import { computed, watch } from 'vue';
@@ -77,9 +77,7 @@ export default createComponent('NPagination', nPaginationProps, props => {
77
77
  }, [_createVNode("button", {
78
78
  "class": ['pagination-item selectable rounded-l-md', props.small ? '' : 'not-small'],
79
79
  "onClick": previous
80
- }, [_createVNode("span", {
81
- "class": "sr-only"
82
- }, [_createTextVNode("Previous")]), _createVNode(ChevronLeftIcon, {
80
+ }, [_createVNode(ChevronLeftIcon, {
83
81
  "class": "h-5 w-5",
84
82
  "aria-hidden": "true"
85
83
  }, null)]), items.value.map((item, index) => item.selectable ? _createVNode("button", {
@@ -92,9 +90,7 @@ export default createComponent('NPagination', nPaginationProps, props => {
92
90
  }, [item.label])), _createVNode("button", {
93
91
  "class": ['pagination-item selectable rounded-r-md', props.small ? '' : 'not-small'],
94
92
  "onClick": next
95
- }, [_createVNode("span", {
96
- "class": "sr-only"
97
- }, [_createTextVNode("Next")]), _createVNode(ChevronRightIcon, {
93
+ }, [_createVNode(ChevronRightIcon, {
98
94
  "class": "h-5 w-5",
99
95
  "aria-hidden": "true"
100
96
  }, null)])]);
@@ -41,10 +41,7 @@ export default createComponent('NSearchbar', nSearchbarProps, (props, context) =
41
41
  }
42
42
  };
43
43
  context.expose(exposed);
44
- return () => _createVNode("div", null, [_createVNode("label", {
45
- "for": "search",
46
- "class": "sr-only"
47
- }, [props.placeholder]), _createVNode("div", {
44
+ return () => _createVNode("div", {
48
45
  "class": "relative"
49
46
  }, [_createVNode("div", {
50
47
  "class": "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"
@@ -62,5 +59,5 @@ export default createComponent('NSearchbar', nSearchbarProps, (props, context) =
62
59
  "class": ['block w-full pl-10 pr-4 rounded-md border focus:outline-none focus:ring-1 transition placeholder-default-400 border-default-300 focus:border-primary-500 focus:ring-primary-500', props.small ? 'py-1' : 'py-2', props.inputClass],
63
60
  "onFocus": props.onFocus,
64
61
  "onBlur": props.onBlur
65
- }, null)])]);
62
+ }, null)]);
66
63
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@naptics/vue-collection",
3
3
  "author": "Timo Siegenthaler",
4
4
  "description": "Vue Collection is a collection of styled and fully functional Vue components which can easily be integrated into our projects.",
5
- "version": "0.2.0",
5
+ "version": "0.2.2",
6
6
  "main": "./index.js",
7
7
  "repository": {
8
8
  "type": "git",
package/utils/utils.d.ts CHANGED
@@ -21,6 +21,13 @@ export declare function isNullish(value: Nullish<unknown>): value is null | unde
21
21
  * @see notNullish
22
22
  */
23
23
  export declare function notNullishRef<T>(ref: Ref<T>): ref is Ref<NonNullable<T>>;
24
+ /**
25
+ * Determines if the value of a ref is null or undefined.
26
+ * @param ref the ref to check
27
+ * @returns `true` if the value of the ref is `null` or `undefined`.
28
+ * @see isNullish
29
+ */
30
+ export declare function isNullishRef(ref: Ref<Nullish<unknown>>): ref is Ref<null | undefined>;
24
31
  export type AnyObject = Record<string | number | symbol, unknown>;
25
32
  export type EmptyObject = Record<string | number | symbol, never>;
26
33
  export declare function isAnyObject(object: unknown): object is AnyObject;
package/utils/utils.js CHANGED
@@ -26,6 +26,15 @@ export function isNullish(value) {
26
26
  export function notNullishRef(ref) {
27
27
  return notNullish(ref.value);
28
28
  }
29
+ /**
30
+ * Determines if the value of a ref is null or undefined.
31
+ * @param ref the ref to check
32
+ * @returns `true` if the value of the ref is `null` or `undefined`.
33
+ * @see isNullish
34
+ */
35
+ export function isNullishRef(ref) {
36
+ return isNullish(ref.value);
37
+ }
29
38
  export function isAnyObject(object) {
30
39
  return typeof object === 'object' && !Array.isArray(object);
31
40
  }