@sveltia/ui 0.3.0 → 0.3.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.
|
@@ -36,8 +36,11 @@
|
|
|
36
36
|
on:dragover|preventDefault
|
|
37
37
|
on:drop|preventDefault
|
|
38
38
|
on:contextmenu={(event) => {
|
|
39
|
-
//
|
|
40
|
-
if (
|
|
39
|
+
// Enable the native context menu only in the developer mode or on text fields
|
|
40
|
+
if (
|
|
41
|
+
!document.documentElement.matches('[data-env="dev"]') &&
|
|
42
|
+
!(/** @type {HTMLElement} */ (event.target)?.matches('input[type="text"], textarea'))
|
|
43
|
+
) {
|
|
41
44
|
event.preventDefault();
|
|
42
45
|
}
|
|
43
46
|
}}
|
|
@@ -128,6 +128,7 @@ class Group {
|
|
|
128
128
|
this.activeMembers.forEach((element) => {
|
|
129
129
|
const isTarget = element === newTarget;
|
|
130
130
|
const isSelected = element.matches('[aria-selected="true"]');
|
|
131
|
+
const isMenuItemRadio = element.matches('[role="menuitemradio"]');
|
|
131
132
|
const controls = element.getAttribute('aria-controls');
|
|
132
133
|
|
|
133
134
|
if (this.multi && isTarget && event.type === 'click') {
|
|
@@ -136,9 +137,8 @@ class Group {
|
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
if (
|
|
139
|
-
(element.
|
|
140
|
-
|
|
141
|
-
!this.multi
|
|
140
|
+
(isMenuItemRadio && element.closest(this.parentGroupSelector) === targetParentGroup) ||
|
|
141
|
+
(!isMenuItemRadio && !this.multi)
|
|
142
142
|
) {
|
|
143
143
|
element.setAttribute(this.childSelectedAttr, String(isTarget));
|
|
144
144
|
element.dispatchEvent(new CustomEvent(isTarget ? 'select' : 'unselect'));
|
|
@@ -82,8 +82,6 @@ class Popup {
|
|
|
82
82
|
* @param {PopupPosition} position Where to show the popup content.
|
|
83
83
|
*/
|
|
84
84
|
constructor(anchorElement, popupElement, position) {
|
|
85
|
-
console.info({ anchorElement, popupElement, position });
|
|
86
|
-
|
|
87
85
|
this.anchorElement = anchorElement;
|
|
88
86
|
this.popupElement = popupElement; // = backdrop
|
|
89
87
|
this.position = position;
|
|
@@ -99,8 +97,6 @@ class Popup {
|
|
|
99
97
|
});
|
|
100
98
|
|
|
101
99
|
this.anchorElement.addEventListener('keydown', (event) => {
|
|
102
|
-
console.info(event);
|
|
103
|
-
|
|
104
100
|
const { key, ctrlKey, metaKey, shiftKey, altKey } = event;
|
|
105
101
|
const hasModifier = shiftKey || altKey || ctrlKey || metaKey;
|
|
106
102
|
|
|
@@ -127,8 +123,6 @@ class Popup {
|
|
|
127
123
|
});
|
|
128
124
|
|
|
129
125
|
this.popupElement.addEventListener('keydown', (event) => {
|
|
130
|
-
console.info(event);
|
|
131
|
-
|
|
132
126
|
const { key, ctrlKey, metaKey, shiftKey, altKey } = event;
|
|
133
127
|
const hasModifier = shiftKey || altKey || ctrlKey || metaKey;
|
|
134
128
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltia/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -26,24 +26,24 @@
|
|
|
26
26
|
"svelte": "^3.55.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@playwright/test": "^1.35.
|
|
29
|
+
"@playwright/test": "^1.35.1",
|
|
30
30
|
"@sveltejs/adapter-auto": "2.1.0",
|
|
31
|
-
"@sveltejs/kit": "1.20.
|
|
31
|
+
"@sveltejs/kit": "1.20.4",
|
|
32
32
|
"@sveltejs/package": "^2.0.2",
|
|
33
33
|
"cspell": "^6.31.1",
|
|
34
|
-
"eslint": "^8.
|
|
34
|
+
"eslint": "^8.43.0",
|
|
35
35
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
36
36
|
"eslint-config-prettier": "^8.8.0",
|
|
37
37
|
"eslint-plugin-import": "^2.27.5",
|
|
38
38
|
"eslint-plugin-jsdoc": "^46.2.6",
|
|
39
|
-
"eslint-plugin-svelte": "^2.
|
|
39
|
+
"eslint-plugin-svelte": "^2.31.0",
|
|
40
40
|
"npm-run-all": "^4.1.5",
|
|
41
41
|
"postcss": "^8.4.24",
|
|
42
42
|
"postcss-html": "^1.5.0",
|
|
43
43
|
"prettier": "^2.8.8",
|
|
44
44
|
"prettier-plugin-svelte": "^2.10.1",
|
|
45
|
-
"sass": "^1.63.
|
|
46
|
-
"stylelint": "^15.
|
|
45
|
+
"sass": "^1.63.4",
|
|
46
|
+
"stylelint": "^15.8.0",
|
|
47
47
|
"stylelint-config-recommended-scss": "^12.0.0",
|
|
48
48
|
"stylelint-scss": "^5.0.1",
|
|
49
49
|
"svelte-check": "^3.4.3",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"svelte-preprocess": "^5.0.4",
|
|
53
53
|
"tslib": "^2.5.3",
|
|
54
54
|
"vite": "^4.3.9",
|
|
55
|
-
"vitest": "^0.32.
|
|
55
|
+
"vitest": "^0.32.2"
|
|
56
56
|
},
|
|
57
57
|
"exports": {
|
|
58
58
|
"./package.json": "./package.json",
|