Skip to content

Commit ad35ce4

Browse files
committed
fix: added vitest, updated node and npm packages
1 parent d2d827d commit ad35ce4

30 files changed

+5150
-6873
lines changed

.eslintrc.js

-3
This file was deleted.

.github/workflows/release.yml

+14-10
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,41 @@ jobs:
1111
strategy:
1212
matrix:
1313
os: [ubuntu-latest]
14-
node: [20]
1514

1615
steps:
1716
- name: Checkout 🛎
18-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1918
with:
2019
fetch-depth: 0
2120

2221
- name: Setup node env 🏗
23-
uses: actions/setup-node@v3
22+
uses: actions/setup-node@v4
2423
with:
25-
node-version: ${{ matrix.node }}
24+
node-version-file: '.nvmrc'
2625
check-latest: true
2726

27+
- name: Setup pnpm 📦
28+
uses: pnpm/action-setup@v4
29+
with:
30+
package_json_file: package.json
31+
2832
- name: Install dependencies 📦
29-
run: npm install
33+
run: pnpm install
3034

3135
- name: Install semantic-release extra plugins 📦
32-
run: npm install --save-dev @semantic-release/changelog @semantic-release/git
36+
run: pnpm install --save-dev @semantic-release/changelog @semantic-release/git
3337

3438
- name: Run linter 👀
35-
run: npm run lint-fix
39+
run: pnpm run lint-fix
3640

3741
- name: Typecheck 👀
38-
run: npm run typecheck
42+
run: pnpm run typecheck
3943

4044
- name: Run tests 🧪
41-
run: npm run test:unit-coverage --if-present
45+
run: pnpm run test:unit-coverage --if-present
4246

4347
- name: Build
44-
run: npm run build
48+
run: pnpm run build
4549

4650
- name: Release
4751
env:

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18
1+
v23

babel.config.js

-16
This file was deleted.

commitlint.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
module.exports = {
1+
export default {
22
extends: ['@commitlint/config-conventional'],
33
rules: {
4-
'body-max-line-length': [1, 'always', 200]
5-
}
4+
'body-max-line-length': [1, 'always', 200],
5+
},
66
}

coverage/badge.svg

+1-1
Loading

coverage/coverage-summary.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{"total": {"lines":{"total":93,"covered":88,"skipped":0,"pct":94.62},"statements":{"total":101,"covered":95,"skipped":0,"pct":94.05},"functions":{"total":28,"covered":26,"skipped":0,"pct":92.85},"branches":{"total":79,"covered":72,"skipped":0,"pct":91.13},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}}
2-
,"/home/runner/work/vue-search-input/vue-search-input/src/SearchInput.types.ts": {"lines":{"total":1,"covered":1,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":1,"covered":1,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
3-
,"/home/runner/work/vue-search-input/vue-search-input/src/SearchInput.vue": {"lines":{"total":92,"covered":87,"skipped":0,"pct":94.56},"functions":{"total":28,"covered":26,"skipped":0,"pct":92.85},"statements":{"total":100,"covered":94,"skipped":0,"pct":94},"branches":{"total":79,"covered":72,"skipped":0,"pct":91.13}}
1+
{"total": {"lines":{"total":154,"covered":154,"skipped":0,"pct":100},"statements":{"total":154,"covered":154,"skipped":0,"pct":100},"functions":{"total":15,"covered":14,"skipped":0,"pct":93.33},"branches":{"total":52,"covered":51,"skipped":0,"pct":98.07},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}}
2+
,"/home/kouts/development/kouts/vue-search-input/src/SearchInput.types.ts": {"lines":{"total":1,"covered":1,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":1,"covered":1,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
3+
,"/home/kouts/development/kouts/vue-search-input/src/SearchInput.vue": {"lines":{"total":143,"covered":143,"skipped":0,"pct":100},"functions":{"total":14,"covered":13,"skipped":0,"pct":92.85},"statements":{"total":143,"covered":143,"skipped":0,"pct":100},"branches":{"total":47,"covered":46,"skipped":0,"pct":97.87}}
4+
,"/home/kouts/development/kouts/vue-search-input/src/filterObject.ts": {"lines":{"total":10,"covered":10,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":10,"covered":10,"skipped":0,"pct":100},"branches":{"total":5,"covered":5,"skipped":0,"pct":100}}
45
}

dist/styles.css

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
transition: border-color 0.15s ease-in-out;
1717
}
1818
.search-input-wrapper input[data-search-input=true]:focus {
19-
background-color: white;
19+
background-color: hsl(210, 50%, 122.6470588235%);
2020
border-color: #1ea7fd;
2121
outline: 0;
2222
box-shadow: none;
2323
}
2424
.search-input-wrapper .search-icon {
25-
color: #83add6;
25+
color: rgb(131.25, 172.5, 213.75);
2626
position: absolute;
2727
}
2828
.search-input-wrapper .search-icon.search {
@@ -45,7 +45,7 @@
4545
border-radius: 3px;
4646
width: 2px;
4747
height: 7px;
48-
background: #83add6;
48+
background: rgb(131.25, 172.5, 213.75);
4949
transform: rotate(-45deg);
5050
top: 11px;
5151
left: 12px;
@@ -56,7 +56,7 @@
5656
cursor: text;
5757
right: 8px;
5858
bottom: 7px;
59-
background-color: #e7eff7;
59+
background-color: rgb(230.7, 238.8, 246.9);
6060
border-radius: 3px;
6161
z-index: 50;
6262
}
@@ -72,7 +72,7 @@
7272
top: 4px;
7373
left: 10px;
7474
z-index: 51;
75-
background-color: #96b9dc;
75+
background-color: rgb(150.375, 185.25, 220.125);
7676
}
7777
.search-input-wrapper .search-icon.clear {
7878
right: 5px;
@@ -90,7 +90,7 @@
9090
outline: none;
9191
}
9292
.search-input-wrapper .search-icon.clear:focus {
93-
background: #e7eff7;
93+
background: rgb(230.7, 238.8, 246.9);
9494
}
9595
.search-input-wrapper .search-icon.clear::after, .search-input-wrapper .search-icon.clear::before {
9696
content: "";
@@ -99,7 +99,7 @@
9999
position: absolute;
100100
width: 16px;
101101
height: 2px;
102-
background: #83add6;
102+
background: rgb(131.25, 172.5, 213.75);
103103
transform: rotate(45deg);
104104
border-radius: 5px;
105105
top: 9px;

dist/types/SearchInput.vue.d.ts

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { FieldType } from './SearchInput.types';
21
import { PropType } from 'vue';
3-
4-
declare const _default: import('vue').DefineComponent<{
2+
import { FieldType } from './SearchInput.types';
3+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
54
type: {
65
type: PropType<FieldType>;
76
default: string;
@@ -51,9 +50,9 @@ declare const _default: import('vue').DefineComponent<{
5150
type: PropType<KeyboardEvent["key"]>;
5251
default: string;
5352
};
54-
}, {
55-
inputRef: import('vue').Ref<HTMLInputElement | null>;
56-
hasFocus: import('vue').Ref<boolean>;
53+
}>, {
54+
inputRef: import('vue').Ref<HTMLInputElement | null, HTMLInputElement | null>;
55+
hasFocus: import('vue').Ref<boolean, boolean>;
5756
clear: () => void;
5857
onInput: (e: Event) => void;
5958
onKeydown: (e: KeyboardEvent) => void;
@@ -65,7 +64,7 @@ declare const _default: import('vue').DefineComponent<{
6564
}>;
6665
showClearIcon: import('vue').ComputedRef<boolean>;
6766
showShortcutIcon: import('vue').ComputedRef<boolean>;
68-
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
67+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
6968
type: {
7069
type: PropType<FieldType>;
7170
default: string;
@@ -115,9 +114,9 @@ declare const _default: import('vue').DefineComponent<{
115114
type: PropType<KeyboardEvent["key"]>;
116115
default: string;
117116
};
118-
}>> & {
117+
}>> & Readonly<{
119118
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
120-
}, {
119+
}>, {
121120
type: "search" | "text" | "password";
122121
modelValue: string;
123122
wrapperClass: string;
@@ -130,5 +129,5 @@ declare const _default: import('vue').DefineComponent<{
130129
selectOnFocus: boolean;
131130
shortcutListenerEnabled: boolean;
132131
shortcutKey: string;
133-
}, {}>;
132+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
134133
export default _default;

dist/types/filterObject.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export declare const filterObject: (obj: {
2+
[key: string]: unknown;
3+
}, properties: (string | number)[], remove?: boolean) => {
4+
[key: string]: unknown;
5+
};

dist/types/filterObject.spec.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};

dist/vue-search-input.es.js

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { defineComponent as k, ref as I, computed as i, watch as b, onBeforeUnmount as K, openBlock as V, createElementBlock as B, normalizeProps as C, guardReactiveProps as L, renderSlot as u, createCommentVNode as y, createElementVNode as d, mergeProps as H, withKeys as M } from "vue";
2-
const P = ["search", "text", "password"], g = (e, t, l = !0) => {
1+
import { defineComponent as k, ref as I, computed as i, watch as b, onBeforeUnmount as K, createElementBlock as V, openBlock as B, normalizeProps as C, guardReactiveProps as L, renderSlot as u, createCommentVNode as y, createElementVNode as d, mergeProps as H, withKeys as M } from "vue";
2+
const g = (e, t, l = !0) => {
33
const r = {};
44
return Object.keys(e).forEach((o) => {
55
(l ? t.indexOf(o) === -1 : t.indexOf(o) >= 0) && (r[o] = e[o]);
66
}), r;
7-
}, a = (e = !0) => ({ type: Boolean, default: e }), R = k({
7+
}, P = ["search", "text", "password"], a = (e = !0) => ({ type: Boolean, default: e }), R = k({
8+
name: "SearchInput",
89
inheritAttrs: !1,
910
props: {
1011
type: {
@@ -38,7 +39,7 @@ const P = ["search", "text", "password"], g = (e, t, l = !0) => {
3839
const r = I(!1), o = I(null), f = i(() => g(l, ["class", "style"])), s = i(() => {
3940
const n = g(l, ["class", "style"], !1);
4041
return n.class || (n.class = e.wrapperClass), n;
41-
}), E = i(() => !!(e.clearIcon && e.modelValue.length > 0)), S = i(() => !!(e.shortcutIcon && !r.value && !e.hideShortcutIconOnBlur || e.shortcutIcon && !r.value && e.modelValue.length === 0)), m = () => {
42+
}), S = i(() => !!(e.clearIcon && e.modelValue.length > 0)), E = i(() => !!(e.shortcutIcon && !r.value && !e.hideShortcutIconOnBlur || e.shortcutIcon && !r.value && e.modelValue.length === 0)), m = () => {
4243
t("update:modelValue", "");
4344
}, O = (n) => {
4445
t("update:modelValue", n.target.value);
@@ -67,24 +68,21 @@ const P = ["search", "text", "password"], g = (e, t, l = !0) => {
6768
onKeydown: $,
6869
attrsStyles: s,
6970
attrsWithoutStyles: f,
70-
showClearIcon: E,
71-
showShortcutIcon: S
71+
showClearIcon: S,
72+
showShortcutIcon: E
7273
};
7374
}
7475
}), D = (e, t) => {
7576
const l = e.__vccOpts || e;
7677
for (const [r, o] of t)
7778
l[r] = o;
7879
return l;
79-
}, F = /* @__PURE__ */ d("i", { class: "search-icon search" }, null, -1), W = ["type", "data-shortcut-enabled", "value"], N = /* @__PURE__ */ d("i", {
80-
class: "search-icon shortcut",
81-
title: 'Press "/" to search'
82-
}, null, -1);
83-
function T(e, t, l, r, o, f) {
84-
return V(), B("div", C(L(e.attrsStyles)), [
80+
}, F = ["type", "data-shortcut-enabled", "value"];
81+
function W(e, t, l, r, o, f) {
82+
return B(), V("div", C(L(e.attrsStyles)), [
8583
u(e.$slots, "prepend"),
8684
e.searchIcon ? u(e.$slots, "search-icon", { key: 0 }, () => [
87-
F
85+
t[6] || (t[6] = d("i", { class: "search-icon search" }, null, -1))
8886
]) : y("", !0),
8987
u(e.$slots, "prepend-inner"),
9088
d("input", H({
@@ -98,10 +96,13 @@ function T(e, t, l, r, o, f) {
9896
onFocus: t[1] || (t[1] = (s) => e.hasFocus = !0),
9997
onBlur: t[2] || (t[2] = (s) => e.hasFocus = !1),
10098
onKeydown: t[3] || (t[3] = (...s) => e.onKeydown && e.onKeydown(...s))
101-
}), null, 16, W),
99+
}), null, 16, F),
102100
u(e.$slots, "append"),
103101
e.showShortcutIcon ? u(e.$slots, "shortcut-icon", { key: 1 }, () => [
104-
N
102+
t[7] || (t[7] = d("i", {
103+
class: "search-icon shortcut",
104+
title: 'Press "/" to search'
105+
}, null, -1))
105106
]) : y("", !0),
106107
e.showClearIcon ? u(e.$slots, "clear-icon", {
107108
key: 2,
@@ -117,7 +118,7 @@ function T(e, t, l, r, o, f) {
117118
u(e.$slots, "append-outer")
118119
], 16);
119120
}
120-
const z = /* @__PURE__ */ D(R, [["render", T]]);
121+
const T = /* @__PURE__ */ D(R, [["render", W]]);
121122
export {
122-
z as default
123+
T as default
123124
};

0 commit comments

Comments
 (0)