element-vir 26.5.8 → 26.6.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/declarative-element/directives/attributes.directive.d.ts +2 -2
- package/dist/declarative-element/directives/attributes.directive.js +3 -0
- package/dist/declarative-element/directives/listen-to-activate.d.ts +7 -0
- package/dist/declarative-element/directives/listen-to-activate.js +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +11 -11
|
@@ -20,10 +20,10 @@ export type AttributeValues = {
|
|
|
20
20
|
*
|
|
21
21
|
* @category Directives
|
|
22
22
|
*/
|
|
23
|
-
export declare const attributes: (values_0: AttributeValues) => import("lit-html/directive.js").DirectiveResult<{
|
|
23
|
+
export declare const attributes: (values_0: AttributeValues | undefined) => import("lit-html/directive.js").DirectiveResult<{
|
|
24
24
|
new (partInfo: import("lit-html/directive.js").PartInfo): {
|
|
25
25
|
readonly element: HTMLElement;
|
|
26
|
-
render(params_0: AttributeValues): symbol;
|
|
26
|
+
render(params_0: AttributeValues | undefined): symbol;
|
|
27
27
|
readonly _$isConnected: boolean;
|
|
28
28
|
update(_part: import("lit-html").Part, props: Array<unknown>): unknown;
|
|
29
29
|
};
|
|
@@ -7,6 +7,9 @@ import { createMutateDirective } from './mutate.directive.js';
|
|
|
7
7
|
* @category Directives
|
|
8
8
|
*/
|
|
9
9
|
export const attributes = createMutateDirective('attributes', ({ element, params: [attributesToApply], directive: rawDirective }) => {
|
|
10
|
+
if (!attributesToApply) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
10
13
|
const directive = rawDirective;
|
|
11
14
|
const allAttributeNames = getOrSet(directive, 'allAttributesApplied', () => new Set());
|
|
12
15
|
getObjectTypedKeys(attributesToApply).forEach((attributeName) => {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type MaybePromise } from '@augment-vir/common';
|
|
2
|
+
/**
|
|
3
|
+
* Listens to enter, return, and space key hits on an element.
|
|
4
|
+
*
|
|
5
|
+
* @category Directives
|
|
6
|
+
*/
|
|
7
|
+
export declare function listenToActivate(callback: () => MaybePromise<void>): import("lit-html/directive.js").DirectiveResult<any>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { listen } from './listen.directive.js';
|
|
2
|
+
/**
|
|
3
|
+
* Listens to enter, return, and space key hits on an element.
|
|
4
|
+
*
|
|
5
|
+
* @category Directives
|
|
6
|
+
*/
|
|
7
|
+
export function listenToActivate(callback) {
|
|
8
|
+
return listen('keydown', async (event) => {
|
|
9
|
+
const key = event.code.toLowerCase();
|
|
10
|
+
if (key.includes('enter') || key.includes('return') || key === 'space') {
|
|
11
|
+
event.stopImmediatePropagation();
|
|
12
|
+
event.preventDefault();
|
|
13
|
+
await callback();
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './declarative-element/directives/async-prop.js';
|
|
|
8
8
|
export * from './declarative-element/directives/attributes.directive.js';
|
|
9
9
|
export * from './declarative-element/directives/create-attribute-directive.js';
|
|
10
10
|
export * from './declarative-element/directives/directive-helpers.js';
|
|
11
|
+
export * from './declarative-element/directives/listen-to-activate.js';
|
|
11
12
|
export * from './declarative-element/directives/listen.directive.js';
|
|
12
13
|
export * from './declarative-element/directives/mutate.directive.js';
|
|
13
14
|
export * from './declarative-element/directives/on-dom-created.directive.js';
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from './declarative-element/directives/async-prop.js';
|
|
|
8
8
|
export * from './declarative-element/directives/attributes.directive.js';
|
|
9
9
|
export * from './declarative-element/directives/create-attribute-directive.js';
|
|
10
10
|
export * from './declarative-element/directives/directive-helpers.js';
|
|
11
|
+
export * from './declarative-element/directives/listen-to-activate.js';
|
|
11
12
|
export * from './declarative-element/directives/listen.directive.js';
|
|
12
13
|
export * from './declarative-element/directives/mutate.directive.js';
|
|
13
14
|
export * from './declarative-element/directives/on-dom-created.directive.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "element-vir",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.6.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"custom",
|
|
6
6
|
"web",
|
|
@@ -39,19 +39,19 @@
|
|
|
39
39
|
"test:docs": "virmator docs check"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@augment-vir/assert": "^31.
|
|
43
|
-
"@augment-vir/common": "^31.
|
|
44
|
-
"date-vir": "^7.
|
|
45
|
-
"lit": "^3.3.
|
|
42
|
+
"@augment-vir/assert": "^31.28.0",
|
|
43
|
+
"@augment-vir/common": "^31.28.0",
|
|
44
|
+
"date-vir": "^7.4.0",
|
|
45
|
+
"lit": "^3.3.1",
|
|
46
46
|
"lit-css-vars": "^3.0.11",
|
|
47
|
-
"lit-html": "^3.3.
|
|
48
|
-
"object-shape-tester": "^5.
|
|
47
|
+
"lit-html": "^3.3.1",
|
|
48
|
+
"object-shape-tester": "^5.3.0",
|
|
49
49
|
"observavir": "^2.1.0",
|
|
50
50
|
"typed-event-target": "^4.1.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@augment-vir/test": "^31.
|
|
54
|
-
"@augment-vir/web": "^31.
|
|
53
|
+
"@augment-vir/test": "^31.28.0",
|
|
54
|
+
"@augment-vir/web": "^31.28.0",
|
|
55
55
|
"@web/dev-server-esbuild": "^1.0.4",
|
|
56
56
|
"@web/test-runner": "^0.20.2",
|
|
57
57
|
"@web/test-runner-commands": "^0.9.0",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"istanbul-smart-text-reporter": "^1.1.5",
|
|
62
62
|
"markdown-code-example-inserter": "^3.0.3",
|
|
63
63
|
"type-fest": "^4.41.0",
|
|
64
|
-
"typedoc": "0.28.
|
|
64
|
+
"typedoc": "^0.28.7",
|
|
65
65
|
"typescript": "5.8.3",
|
|
66
|
-
"vite": "^7.0.
|
|
66
|
+
"vite": "^7.0.6",
|
|
67
67
|
"vite-tsconfig-paths": "^5.1.4"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|