@nosto/search-js 2.4.0 → 2.5.0
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/dist/utils/utils.cjs.js +1 -1
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.es.js +39 -15
- package/package.json +7 -7
package/dist/utils/utils.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../isEqual-DQXR__da.cjs"),c=require("../unique-BCAEb4ek.cjs"),q=require("../logger-DbHGgDgO.cjs"),b=require("../parseNumber-FsZ8w61u.cjs"),k=require("../pick-rYi1lc2m.cjs");function n(i){i.setAttribute("autocomplete","off")}function E(i,{onClick:f,onFocus:t,onInput:d,onKeyDown:s,onSubmit:u},{form:a=i.form??void 0}={}){const o=[];function r(e,l,v){e.addEventListener(l,v),o.push(()=>e.removeEventListener(l,v))}return(s||u)&&r(i,"keydown",e=>{s==null||s(i.value,e.key),s&&(e.key==="ArrowDown"||e.key==="ArrowUp")?e.preventDefault():u&&e.key==="Enter"&&(i.value!==""&&!e.repeat&&u(i.value),e.preventDefault())}),u&&a&&(r(a,"submit",e=>{e.preventDefault(),u(i.value)}),a.querySelectorAll("[type=submit]").forEach(e=>{r(e,"click",l=>{l.preventDefault(),u(i.value)})})),f&&r(i,"click",()=>f(i.value)),t&&r(i,"focus",()=>t(i.value)),d&&r(i,"input",()=>d(i.value)),{destroy(){o.forEach(e=>e())}}}exports.deepMerge=p.deepMerge;exports.isEqual=p.isEqual;exports.isPlainObject=p.isPlainObject;exports.isBot=c.isBot;exports.measure=c.measure;exports.mergeArrays=c.mergeArrays;exports.unique=c.unique;exports.logger=q.logger;exports.parseNumber=b.parseNumber;exports.pick=k.pick;exports.bindInput=E;exports.disableNativeAutocomplete=n;
|
package/dist/utils/utils.d.ts
CHANGED
package/dist/utils/utils.es.js
CHANGED
|
@@ -1,17 +1,41 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
import { i as
|
|
3
|
-
import { l as
|
|
4
|
-
import { p as
|
|
5
|
-
import { p as
|
|
1
|
+
import { d as t, i as x, a as A } from "../isEqual-BzZ3d1JM.js";
|
|
2
|
+
import { i as q, a as y, m as L, u as h } from "../unique-CyAMhegX.js";
|
|
3
|
+
import { l as j } from "../logger-DW5RVLX8.js";
|
|
4
|
+
import { p as M } from "../parseNumber-QA48nJLp.js";
|
|
5
|
+
import { p as P } from "../pick-DReBictn.js";
|
|
6
|
+
function d(s) {
|
|
7
|
+
s.setAttribute("autocomplete", "off");
|
|
8
|
+
}
|
|
9
|
+
function m(s, { onClick: l, onFocus: p, onInput: c, onKeyDown: u, onSubmit: i }, { form: a = s.form ?? void 0 } = {}) {
|
|
10
|
+
const o = [];
|
|
11
|
+
function r(e, f, v) {
|
|
12
|
+
e.addEventListener(f, v), o.push(() => e.removeEventListener(f, v));
|
|
13
|
+
}
|
|
14
|
+
return (u || i) && r(s, "keydown", (e) => {
|
|
15
|
+
u == null || u(s.value, e.key), u && (e.key === "ArrowDown" || e.key === "ArrowUp") ? e.preventDefault() : i && e.key === "Enter" && (s.value !== "" && !e.repeat && i(s.value), e.preventDefault());
|
|
16
|
+
}), i && a && (r(a, "submit", (e) => {
|
|
17
|
+
e.preventDefault(), i(s.value);
|
|
18
|
+
}), a.querySelectorAll("[type=submit]").forEach((e) => {
|
|
19
|
+
r(e, "click", (f) => {
|
|
20
|
+
f.preventDefault(), i(s.value);
|
|
21
|
+
});
|
|
22
|
+
})), l && r(s, "click", () => l(s.value)), p && r(s, "focus", () => p(s.value)), c && r(s, "input", () => c(s.value)), {
|
|
23
|
+
destroy() {
|
|
24
|
+
o.forEach((e) => e());
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
6
28
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
x as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
29
|
+
m as bindInput,
|
|
30
|
+
t as deepMerge,
|
|
31
|
+
d as disableNativeAutocomplete,
|
|
32
|
+
q as isBot,
|
|
33
|
+
x as isEqual,
|
|
34
|
+
A as isPlainObject,
|
|
35
|
+
j as logger,
|
|
36
|
+
y as measure,
|
|
37
|
+
L as mergeArrays,
|
|
38
|
+
M as parseNumber,
|
|
39
|
+
P as pick,
|
|
40
|
+
h as unique
|
|
17
41
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nosto/search-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
"@types/node": "^22.15.3",
|
|
91
91
|
"concurrently": "^9.1.2",
|
|
92
92
|
"copyfiles": "^2.4.1",
|
|
93
|
-
"eslint": "^9.
|
|
93
|
+
"eslint": "^9.26.0",
|
|
94
94
|
"eslint-config-prettier": "^10.1.2",
|
|
95
95
|
"eslint-plugin-barrel-files": "^3.0.1",
|
|
96
|
-
"eslint-plugin-prettier": "^5.
|
|
96
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
97
97
|
"eslint-plugin-react": "^7.37.5",
|
|
98
98
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
99
99
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
"isbot": "^5.1.27",
|
|
103
103
|
"jsdom": "^26.1.0",
|
|
104
104
|
"prettier": "^3.5.3",
|
|
105
|
-
"typedoc": "^0.28.
|
|
105
|
+
"typedoc": "^0.28.4",
|
|
106
106
|
"typescript": "^5.8.3",
|
|
107
|
-
"typescript-eslint": "^8.31.
|
|
108
|
-
"vite": "^6.3.
|
|
107
|
+
"typescript-eslint": "^8.31.1",
|
|
108
|
+
"vite": "^6.3.5",
|
|
109
109
|
"vite-plugin-dts": "^4.5.3",
|
|
110
|
-
"vitest": "^3.1.
|
|
110
|
+
"vitest": "^3.1.3",
|
|
111
111
|
"@commitlint/cli": "^19.8.0",
|
|
112
112
|
"@commitlint/config-conventional": "^19.8.0"
|
|
113
113
|
},
|