Skip to content

Commit 70114a1

Browse files
committed
feat: added queryElements() to element prototype. wiil automatically use attibutes if found on element as well as options could be passed
1 parent 08844ba commit 70114a1

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
// you must obtain a commercial license from CoCreate LLC.
2121
// For details, visit <https://cocreate.app/licenses/> or contact us at [email protected].
2222

23-
import { getAttribute } from './getAttribute';
24-
import { setValue } from './setValue';
25-
import { getValue } from './getValue';
23+
import { getAttribute } from "./getAttribute";
24+
import { setValue } from "./setValue";
25+
import { getValue } from "./getValue";
26+
import { queryElements } from "./queryElements";
2627

27-
export default { getAttribute, getValue, setValue }
28+
export default { getAttribute, getValue, setValue, queryElements };

src/queryElements.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import utils from "@cocreate/utils";
2+
3+
Element.prototype.queryElements = function (options = {}) {
4+
return utils.queryElements({ element: this, ...options });
5+
};

0 commit comments

Comments
 (0)