@maggioli-design-system/mds-input-tip 1.2.3 → 1.3.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/cjs/mds-input-tip.cjs.entry.js +1 -1
- package/dist/collection/common/floating-controller.js +3 -3
- package/dist/collection/common/slot.js +10 -1
- package/dist/collection/common/string.js +30 -0
- package/dist/collection/components/mds-input-tip/mds-input-tip.css +123 -0
- package/dist/collection/dictionary/keyboard.js +84 -0
- package/dist/collection/type/keyboard.js +1 -0
- package/dist/components/mds-input-tip.js +1 -1
- package/dist/documentation.json +8 -2
- package/dist/esm/mds-input-tip.entry.js +1 -1
- package/dist/esm-es5/mds-input-tip.entry.js +1 -1
- package/dist/mds-input-tip/mds-input-tip.esm.js +1 -1
- package/dist/mds-input-tip/p-27388d25.entry.js +1 -0
- package/dist/mds-input-tip/p-c7ede63a.system.js +1 -1
- package/dist/mds-input-tip/p-d876075e.system.entry.js +1 -0
- package/dist/stats.json +30 -17
- package/dist/types/common/slot.d.ts +2 -1
- package/dist/types/common/string.d.ts +4 -0
- package/dist/types/dictionary/keyboard.d.ts +2 -0
- package/dist/types/type/keyboard.d.ts +12 -0
- package/documentation.json +28 -2
- package/package.json +3 -3
- package/readme.md +7 -0
- package/src/common/floating-controller.ts +6 -6
- package/src/common/slot.ts +11 -0
- package/src/common/string.ts +42 -0
- package/src/components/mds-input-tip/mds-input-tip.css +5 -0
- package/src/components/mds-input-tip/readme.md +7 -0
- package/src/dictionary/keyboard.ts +87 -0
- package/src/fixtures/icons.json +18 -1
- package/src/meta/keyboard/keys.json +83 -0
- package/src/tailwind/components.css +11 -0
- package/src/tailwind/fouc.css +118 -0
- package/src/type/keyboard.ts +93 -0
- package/www/build/mds-input-tip.esm.js +1 -1
- package/www/build/p-27388d25.entry.js +1 -0
- package/www/build/p-c7ede63a.system.js +1 -1
- package/www/build/p-d876075e.system.entry.js +1 -0
- package/dist/mds-input-tip/p-3bf85392.entry.js +0 -1
- package/dist/mds-input-tip/p-5c7f52a4.system.entry.js +0 -1
- package/www/build/p-3bf85392.entry.js +0 -1
- package/www/build/p-5c7f52a4.system.entry.js +0 -1
package/dist/stats.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"timestamp": "2025-02-
|
2
|
+
"timestamp": "2025-02-25T14:48:59",
|
3
3
|
"compiler": {
|
4
4
|
"name": "node",
|
5
5
|
"version": "22.11.0"
|
@@ -9,11 +9,11 @@
|
|
9
9
|
"fsNamespace": "mds-input-tip",
|
10
10
|
"components": 1,
|
11
11
|
"entries": 1,
|
12
|
-
"bundles":
|
12
|
+
"bundles": 103,
|
13
13
|
"outputs": [
|
14
14
|
{
|
15
15
|
"name": "dist-collection",
|
16
|
-
"files":
|
16
|
+
"files": 55,
|
17
17
|
"generatedFiles": [
|
18
18
|
"./dist/collection/common/aria.js",
|
19
19
|
"./dist/collection/common/date.js",
|
@@ -24,6 +24,7 @@
|
|
24
24
|
"./dist/collection/common/keyboard-manager.js",
|
25
25
|
"./dist/collection/common/locale.js",
|
26
26
|
"./dist/collection/common/slot.js",
|
27
|
+
"./dist/collection/common/string.js",
|
27
28
|
"./dist/collection/common/unit.js",
|
28
29
|
"./dist/collection/common/yugop/core.js",
|
29
30
|
"./dist/collection/common/yugop/index.js",
|
@@ -44,6 +45,7 @@
|
|
44
45
|
"./dist/collection/dictionary/floating-ui.js",
|
45
46
|
"./dist/collection/dictionary/icon.js",
|
46
47
|
"./dist/collection/dictionary/input.js",
|
48
|
+
"./dist/collection/dictionary/keyboard.js",
|
47
49
|
"./dist/collection/dictionary/loading.js",
|
48
50
|
"./dist/collection/dictionary/text.js",
|
49
51
|
"./dist/collection/dictionary/tree.js",
|
@@ -60,6 +62,7 @@
|
|
60
62
|
"./dist/collection/type/form-rel.js",
|
61
63
|
"./dist/collection/type/header-bar.js",
|
62
64
|
"./dist/collection/type/input.js",
|
65
|
+
"./dist/collection/type/keyboard.js",
|
63
66
|
"./dist/collection/type/loading.js",
|
64
67
|
"./dist/collection/type/preference.js",
|
65
68
|
"./dist/collection/type/text.js",
|
@@ -106,24 +109,24 @@
|
|
106
109
|
"./dist/mds-input-tip/index.esm.js",
|
107
110
|
"./dist/mds-input-tip/mds-input-tip.esm.js",
|
108
111
|
"./dist/mds-input-tip/mds-input-tip.js",
|
109
|
-
"./dist/mds-input-tip/p-
|
112
|
+
"./dist/mds-input-tip/p-27388d25.entry.js",
|
110
113
|
"./dist/mds-input-tip/p-50ea2036.system.js",
|
111
114
|
"./dist/mds-input-tip/p-56ba5cbf.system.js",
|
112
|
-
"./dist/mds-input-tip/p-5c7f52a4.system.entry.js",
|
113
115
|
"./dist/mds-input-tip/p-7eeec96b.system.js",
|
114
116
|
"./dist/mds-input-tip/p-b8376582.js",
|
115
117
|
"./dist/mds-input-tip/p-c7ede63a.system.js",
|
118
|
+
"./dist/mds-input-tip/p-d876075e.system.entry.js",
|
116
119
|
"./dist/mds-input-tip/p-e1255160.js",
|
117
120
|
"./www/build/index.esm.js",
|
118
121
|
"./www/build/mds-input-tip.esm.js",
|
119
122
|
"./www/build/mds-input-tip.js",
|
120
|
-
"./www/build/p-
|
123
|
+
"./www/build/p-27388d25.entry.js",
|
121
124
|
"./www/build/p-50ea2036.system.js",
|
122
125
|
"./www/build/p-56ba5cbf.system.js",
|
123
|
-
"./www/build/p-5c7f52a4.system.entry.js",
|
124
126
|
"./www/build/p-7eeec96b.system.js",
|
125
127
|
"./www/build/p-b8376582.js",
|
126
128
|
"./www/build/p-c7ede63a.system.js",
|
129
|
+
"./www/build/p-d876075e.system.entry.js",
|
127
130
|
"./www/build/p-e1255160.js"
|
128
131
|
]
|
129
132
|
},
|
@@ -157,12 +160,12 @@
|
|
157
160
|
"components": [
|
158
161
|
"mds-input-tip"
|
159
162
|
],
|
160
|
-
"bundleId": "p-
|
161
|
-
"fileName": "p-
|
163
|
+
"bundleId": "p-27388d25",
|
164
|
+
"fileName": "p-27388d25.entry.js",
|
162
165
|
"imports": [
|
163
166
|
"p-b8376582.js"
|
164
167
|
],
|
165
|
-
"originalByteSize":
|
168
|
+
"originalByteSize": 8294
|
166
169
|
}
|
167
170
|
],
|
168
171
|
"esm": [
|
@@ -176,7 +179,7 @@
|
|
176
179
|
"imports": [
|
177
180
|
"index-4e431d49.js"
|
178
181
|
],
|
179
|
-
"originalByteSize":
|
182
|
+
"originalByteSize": 8298
|
180
183
|
}
|
181
184
|
],
|
182
185
|
"es5": [
|
@@ -190,7 +193,7 @@
|
|
190
193
|
"imports": [
|
191
194
|
"index-4e431d49.js"
|
192
195
|
],
|
193
|
-
"originalByteSize":
|
196
|
+
"originalByteSize": 8298
|
194
197
|
}
|
195
198
|
],
|
196
199
|
"system": [
|
@@ -199,12 +202,12 @@
|
|
199
202
|
"components": [
|
200
203
|
"mds-input-tip"
|
201
204
|
],
|
202
|
-
"bundleId": "p-
|
203
|
-
"fileName": "p-
|
205
|
+
"bundleId": "p-d876075e.system",
|
206
|
+
"fileName": "p-d876075e.system.entry.js",
|
204
207
|
"imports": [
|
205
208
|
"p-7eeec96b.system.js"
|
206
209
|
],
|
207
|
-
"originalByteSize":
|
210
|
+
"originalByteSize": 8609
|
208
211
|
}
|
209
212
|
],
|
210
213
|
"commonjs": [
|
@@ -218,7 +221,7 @@
|
|
218
221
|
"imports": [
|
219
222
|
"index-66d8bb25.js"
|
220
223
|
],
|
221
|
-
"originalByteSize":
|
224
|
+
"originalByteSize": 8368
|
222
225
|
}
|
223
226
|
]
|
224
227
|
},
|
@@ -389,7 +392,14 @@
|
|
389
392
|
],
|
390
393
|
"internal": false,
|
391
394
|
"assetsDirs": [],
|
392
|
-
"styleDocs": [
|
395
|
+
"styleDocs": [
|
396
|
+
{
|
397
|
+
"name": "--mds-input-tip-active-translate",
|
398
|
+
"docs": "Set the translate of the tip when it is active.",
|
399
|
+
"annotation": "prop",
|
400
|
+
"mode": "$"
|
401
|
+
}
|
402
|
+
],
|
393
403
|
"docs": {
|
394
404
|
"tags": [],
|
395
405
|
"text": ""
|
@@ -480,6 +490,7 @@
|
|
480
490
|
"./src/common/keyboard-manager.ts": [],
|
481
491
|
"./src/common/locale.ts": [],
|
482
492
|
"./src/common/slot.ts": [],
|
493
|
+
"./src/common/string.ts": [],
|
483
494
|
"./src/common/unit.ts": [],
|
484
495
|
"./src/common/yugop/core.ts": [
|
485
496
|
"./src/common/yugop/utils/math",
|
@@ -514,6 +525,7 @@
|
|
514
525
|
"./src/fixtures/iconsauce.json"
|
515
526
|
],
|
516
527
|
"./src/dictionary/input.ts": [],
|
528
|
+
"./src/dictionary/keyboard.ts": [],
|
517
529
|
"./src/dictionary/loading.ts": [],
|
518
530
|
"./src/dictionary/text.ts": [],
|
519
531
|
"./src/dictionary/tree.ts": [],
|
@@ -530,6 +542,7 @@
|
|
530
542
|
"./src/type/form-rel.ts": [],
|
531
543
|
"./src/type/header-bar.ts": [],
|
532
544
|
"./src/type/input.ts": [],
|
545
|
+
"./src/type/keyboard.ts": [],
|
533
546
|
"./src/type/loading.ts": [],
|
534
547
|
"./src/type/preference.ts": [],
|
535
548
|
"./src/type/text.ts": [],
|
@@ -1,3 +1,4 @@
|
|
1
1
|
declare const hasSlottedElements: (el: HTMLElement, name?: string) => boolean;
|
2
2
|
declare const hasSlottedNodes: (el: HTMLElement, name?: string) => boolean;
|
3
|
-
|
3
|
+
declare const hasSlotted: (el: HTMLElement, name?: string) => boolean;
|
4
|
+
export { hasSlottedElements, hasSlottedNodes, hasSlotted, };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export type KeyboardKeyData = {
|
2
|
+
alias: string;
|
3
|
+
description: string;
|
4
|
+
group: string;
|
5
|
+
keyCodes: string[];
|
6
|
+
keyboardPosition?: {
|
7
|
+
left?: boolean;
|
8
|
+
right?: boolean;
|
9
|
+
};
|
10
|
+
};
|
11
|
+
export type KeyboardKeyName = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' | 'alt' | 'altleft' | 'altright' | 'arrowdown' | 'arrowleft' | 'arrowright' | 'arrowup' | 'b' | 'backspace' | 'c' | 'capslock' | 'command' | 'commandleft' | 'commandright' | 'control' | 'controlleft' | 'controlright' | 'd' | 'delete' | 'e' | 'end' | 'enter' | 'escape' | 'f' | 'f1' | 'f10' | 'f11' | 'f12' | 'f2' | 'f3' | 'f4' | 'f5' | 'f6' | 'f7' | 'f8' | 'f9' | 'g' | 'h' | 'home' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'option' | 'optionleft' | 'optionright' | 'p' | 'pagedown' | 'pageup' | 'q' | 'r' | 's' | 'shift' | 'shiftleft' | 'shiftright' | 'space' | 't' | 'tab' | 'u' | 'v' | 'w' | 'windows' | 'windowsleft' | 'windowsright' | 'x' | 'y' | 'z';
|
12
|
+
export type KeyboardKeyMap = Record<KeyboardKeyName, KeyboardKeyData>;
|
package/documentation.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"timestamp": "2025-02-
|
2
|
+
"timestamp": "2025-02-25T13:09:05",
|
3
3
|
"compiler": {
|
4
4
|
"name": "@stencil/core",
|
5
5
|
"version": "4.25.1",
|
@@ -84,7 +84,13 @@
|
|
84
84
|
"methods": [],
|
85
85
|
"events": [],
|
86
86
|
"listeners": [],
|
87
|
-
"styles": [
|
87
|
+
"styles": [
|
88
|
+
{
|
89
|
+
"name": "--mds-input-tip-active-translate",
|
90
|
+
"annotation": "prop",
|
91
|
+
"docs": "Set the translate of the tip when it is active."
|
92
|
+
}
|
93
|
+
],
|
88
94
|
"slots": [],
|
89
95
|
"parts": [],
|
90
96
|
"dependents": [
|
@@ -298,6 +304,11 @@
|
|
298
304
|
"docstring": "",
|
299
305
|
"path": "src/components/mds-header/meta/event-detail.ts"
|
300
306
|
},
|
307
|
+
"src/components/mds-header/meta/event-detail.ts::MdsHeaderVisibilityEventDetail": {
|
308
|
+
"declaration": "export interface MdsHeaderVisibilityEventDetail {\n visibility: boolean\n}",
|
309
|
+
"docstring": "",
|
310
|
+
"path": "src/components/mds-header/meta/event-detail.ts"
|
311
|
+
},
|
301
312
|
"src/components/mds-horizontal-scroll/meta/types.ts::ViewportType": {
|
302
313
|
"declaration": "export type ViewportType =\n | 'all'\n | 'tv'\n | 'xlarge'\n | 'large'\n | 'wide'\n | 'desktop'\n | 'tablet'\n | 'none'",
|
303
314
|
"docstring": "",
|
@@ -413,6 +424,16 @@
|
|
413
424
|
"docstring": "",
|
414
425
|
"path": "src/components/mds-input-upload/meta/types.ts"
|
415
426
|
},
|
427
|
+
"src/components/mds-keyboard/meta/type.ts::KeyboardTest": {
|
428
|
+
"declaration": "export type KeyboardTest =\n | 'pass'\n | 'fail'",
|
429
|
+
"docstring": "",
|
430
|
+
"path": "src/components/mds-keyboard/meta/type.ts"
|
431
|
+
},
|
432
|
+
"src/type/keyboard.ts::KeyboardKeyName": {
|
433
|
+
"declaration": "export type KeyboardKeyName =\n | '0'\n | '1'\n | '2'\n | '3'\n | '4'\n | '5'\n | '6'\n | '7'\n | '8'\n | '9'\n | 'a'\n | 'alt'\n | 'altleft'\n | 'altright'\n | 'arrowdown'\n | 'arrowleft'\n | 'arrowright'\n | 'arrowup'\n | 'b'\n | 'backspace'\n | 'c'\n | 'capslock'\n | 'command'\n | 'commandleft'\n | 'commandright'\n | 'control'\n | 'controlleft'\n | 'controlright'\n | 'd'\n | 'delete'\n | 'e'\n | 'end'\n | 'enter'\n | 'escape'\n | 'f'\n | 'f1'\n | 'f10'\n | 'f11'\n | 'f12'\n | 'f2'\n | 'f3'\n | 'f4'\n | 'f5'\n | 'f6'\n | 'f7'\n | 'f8'\n | 'f9'\n | 'g'\n | 'h'\n | 'home'\n | 'i'\n | 'j'\n | 'k'\n | 'l'\n | 'm'\n | 'n'\n | 'o'\n | 'option'\n | 'optionleft'\n | 'optionright'\n | 'p'\n | 'pagedown'\n | 'pageup'\n | 'q'\n | 'r'\n | 's'\n | 'shift'\n | 'shiftleft'\n | 'shiftright'\n | 'space'\n | 't'\n | 'tab'\n | 'u'\n | 'v'\n | 'w'\n | 'windows'\n | 'windowsleft'\n | 'windowsright'\n | 'x'\n | 'y'\n | 'z'",
|
434
|
+
"docstring": "",
|
435
|
+
"path": "src/type/keyboard.ts"
|
436
|
+
},
|
416
437
|
"src/type/typography.ts::TypographyType": {
|
417
438
|
"declaration": "export type TypographyType =\n | 'action'\n | 'caption'\n | 'snippet'\n | 'detail'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'hack'\n | 'label'\n | 'option'\n | 'paragraph'\n | 'tip'",
|
418
439
|
"docstring": "",
|
@@ -433,6 +454,11 @@
|
|
433
454
|
"docstring": "",
|
434
455
|
"path": "src/components/mds-modal/meta/types.ts"
|
435
456
|
},
|
457
|
+
"src/components/mds-modal/meta/types.ts::ModalOverflowType": {
|
458
|
+
"declaration": "export type ModalOverflowType =\n | 'auto'\n | 'manual'",
|
459
|
+
"docstring": "",
|
460
|
+
"path": "src/components/mds-modal/meta/types.ts"
|
461
|
+
},
|
436
462
|
"src/type/variant.ts::LabelVariantType": {
|
437
463
|
"declaration": "export type LabelVariantType =\n | 'amaranth'\n | 'aqua'\n | 'blue'\n | 'green'\n | 'lime'\n | 'orange'\n | 'orchid'\n | 'sky'\n | 'violet'\n | 'yellow'",
|
438
464
|
"docstring": "",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@maggioli-design-system/mds-input-tip",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.3.0",
|
4
4
|
"description": "mds-input-tip is a web-component from Magma Design System, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScript framework you are using.",
|
5
5
|
"main": "dist/index.cjs.js",
|
6
6
|
"module": "dist/index.js",
|
@@ -24,8 +24,8 @@
|
|
24
24
|
"test": "stencil test --spec --e2e"
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
|
-
"@maggioli-design-system/mds-input-tip-item": "1.
|
28
|
-
"@maggioli-design-system/styles": "15.
|
27
|
+
"@maggioli-design-system/mds-input-tip-item": "1.3.0",
|
28
|
+
"@maggioli-design-system/styles": "15.8.0",
|
29
29
|
"@stencil/core": "4.25.1"
|
30
30
|
},
|
31
31
|
"license": "MIT",
|
package/readme.md
CHANGED
@@ -13,6 +13,13 @@
|
|
13
13
|
| `position` | `position` | Specifies the position of the element relative to its container | `"bottom" \| "top" \| undefined` | `'top'` |
|
14
14
|
|
15
15
|
|
16
|
+
## CSS Custom Properties
|
17
|
+
|
18
|
+
| Name | Description |
|
19
|
+
| ---------------------------------- | ----------------------------------------------- |
|
20
|
+
| `--mds-input-tip-active-translate` | Set the translate of the tip when it is active. |
|
21
|
+
|
22
|
+
|
16
23
|
## Dependencies
|
17
24
|
|
18
25
|
### Used by
|
@@ -214,21 +214,21 @@ export class FloatingController {
|
|
214
214
|
}
|
215
215
|
|
216
216
|
export class Backdrop {
|
217
|
-
private readonly defaultBackdropId = '
|
217
|
+
private readonly defaultBackdropId = 'magma-backdrop'
|
218
218
|
private readonly backdropBackgroundVisible = 'rgba(var(--magma-backdrop-color, 0 0 0) / var(--magma-backdrop-opacity, 0.1))'
|
219
219
|
private readonly backdropBackgroundHidden = 'rgba(var(--magma-backdrop-color, 0 0 0) / 0)'
|
220
220
|
|
221
|
-
private readonly backdropId
|
222
|
-
private readonly cssBackdropZIndex
|
223
|
-
private readonly cssBackdropDuration
|
221
|
+
private readonly backdropId: string
|
222
|
+
private readonly cssBackdropZIndex: string
|
223
|
+
private readonly cssBackdropDuration: string
|
224
224
|
|
225
225
|
private backdropEl: HTMLElement
|
226
226
|
private backdropTimer: NodeJS.Timeout
|
227
227
|
|
228
228
|
constructor (backdropId?: string) {
|
229
229
|
this.backdropId = backdropId ?? this.defaultBackdropId
|
230
|
-
this.cssBackdropZIndex = `var(--${this.backdropId}-z-index)`
|
231
|
-
this.cssBackdropDuration = `var(--${this.backdropId}-duration)`
|
230
|
+
this.cssBackdropZIndex = `var(--${this.backdropId}-z-index, 4000)`
|
231
|
+
this.cssBackdropDuration = `var(--${this.backdropId}-animation-duration, 300ms)`
|
232
232
|
}
|
233
233
|
|
234
234
|
attachBackdrop (): void {
|
package/src/common/slot.ts
CHANGED
@@ -18,7 +18,18 @@ const hasSlottedNodes = (el: HTMLElement, name?: string): boolean => {
|
|
18
18
|
return false
|
19
19
|
}
|
20
20
|
|
21
|
+
const hasSlotted = (el: HTMLElement, name?: string): boolean => {
|
22
|
+
const query = name ? `slot[name="${name}"]` : 'slot:not([name])'
|
23
|
+
|
24
|
+
const slot: HTMLSlotElement = el.shadowRoot?.querySelector(query) as HTMLSlotElement
|
25
|
+
if (slot) {
|
26
|
+
return slot.assignedNodes().length > 0 || slot.assignedElements().length > 0
|
27
|
+
}
|
28
|
+
return false
|
29
|
+
}
|
30
|
+
|
21
31
|
export {
|
22
32
|
hasSlottedElements,
|
23
33
|
hasSlottedNodes,
|
34
|
+
hasSlotted,
|
24
35
|
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
const levenshteinDistance = (a: string, b: string): number => {
|
2
|
+
const dp: number[][] = Array.from({ length: a.length + 1 }, (_, i) =>
|
3
|
+
// eslint-disable-next-line no-nested-ternary
|
4
|
+
Array.from({ length: b.length + 1 }, (_, j) => (i === 0 ? j : j === 0 ? i : 0)),
|
5
|
+
)
|
6
|
+
|
7
|
+
for (let i = 1; i <= a.length; i++) {
|
8
|
+
for (let j = 1; j <= b.length; j++) {
|
9
|
+
if (a[i - 1] === b[j - 1]) {
|
10
|
+
dp[i][j] = dp[i - 1][j - 1]
|
11
|
+
} else {
|
12
|
+
dp[i][j] = 1 + Math.min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1])
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
return dp[a.length][b.length]
|
18
|
+
}
|
19
|
+
|
20
|
+
|
21
|
+
const closest = (input: string, validCodes: string[]): string => {
|
22
|
+
let [closest] = validCodes
|
23
|
+
let minDistance = levenshteinDistance(input, closest)
|
24
|
+
|
25
|
+
for (const code of validCodes) {
|
26
|
+
const distance = levenshteinDistance(input, code)
|
27
|
+
if (distance < minDistance) {
|
28
|
+
minDistance = distance
|
29
|
+
closest = code
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
return closest
|
34
|
+
}
|
35
|
+
|
36
|
+
const firstLetterUppercase = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1)
|
37
|
+
|
38
|
+
export {
|
39
|
+
closest,
|
40
|
+
firstLetterUppercase,
|
41
|
+
levenshteinDistance,
|
42
|
+
}
|
@@ -1,5 +1,9 @@
|
|
1
1
|
@tailwind utilities;
|
2
2
|
|
3
|
+
/**
|
4
|
+
* @prop --mds-input-tip-active-translate: Set the translate of the tip when it is active.
|
5
|
+
*/
|
6
|
+
|
3
7
|
:host {
|
4
8
|
|
5
9
|
--mds-input-tip-active-translate: translate(0, 0);
|
@@ -52,3 +56,4 @@
|
|
52
56
|
}
|
53
57
|
|
54
58
|
@import './css/mds-input-tip-pref-animation.css';
|
59
|
+
@import '../../tailwind/fouc.css';
|
@@ -13,6 +13,13 @@
|
|
13
13
|
| `position` | `position` | Specifies the position of the element relative to its container | `"bottom" \| "top" \| undefined` | `'top'` |
|
14
14
|
|
15
15
|
|
16
|
+
## CSS Custom Properties
|
17
|
+
|
18
|
+
| Name | Description |
|
19
|
+
| ---------------------------------- | ----------------------------------------------- |
|
20
|
+
| `--mds-input-tip-active-translate` | Set the translate of the tip when it is active. |
|
21
|
+
|
22
|
+
|
16
23
|
----------------------------------------------
|
17
24
|
|
18
25
|
Built with love @ [Gruppo Maggioli](https://www.maggioli.com) from [R&D Department](https://www.maggioli.com/it-it/chi-siamo/ricerca-sviluppo)
|
@@ -0,0 +1,87 @@
|
|
1
|
+
const keyboardKeyNameDictionary = [
|
2
|
+
'0',
|
3
|
+
'1',
|
4
|
+
'2',
|
5
|
+
'3',
|
6
|
+
'4',
|
7
|
+
'5',
|
8
|
+
'6',
|
9
|
+
'7',
|
10
|
+
'8',
|
11
|
+
'9',
|
12
|
+
'a',
|
13
|
+
'alt',
|
14
|
+
'altleft',
|
15
|
+
'altright',
|
16
|
+
'arrowdown',
|
17
|
+
'arrowleft',
|
18
|
+
'arrowright',
|
19
|
+
'arrowup',
|
20
|
+
'b',
|
21
|
+
'backspace',
|
22
|
+
'c',
|
23
|
+
'capslock',
|
24
|
+
'command',
|
25
|
+
'commandleft',
|
26
|
+
'commandright',
|
27
|
+
'control',
|
28
|
+
'controlleft',
|
29
|
+
'controlright',
|
30
|
+
'd',
|
31
|
+
'delete',
|
32
|
+
'e',
|
33
|
+
'end',
|
34
|
+
'enter',
|
35
|
+
'escape',
|
36
|
+
'f',
|
37
|
+
'f1',
|
38
|
+
'f10',
|
39
|
+
'f11',
|
40
|
+
'f12',
|
41
|
+
'f2',
|
42
|
+
'f3',
|
43
|
+
'f4',
|
44
|
+
'f5',
|
45
|
+
'f6',
|
46
|
+
'f7',
|
47
|
+
'f8',
|
48
|
+
'f9',
|
49
|
+
'g',
|
50
|
+
'h',
|
51
|
+
'home',
|
52
|
+
'i',
|
53
|
+
'j',
|
54
|
+
'k',
|
55
|
+
'l',
|
56
|
+
'm',
|
57
|
+
'n',
|
58
|
+
'o',
|
59
|
+
'option',
|
60
|
+
'optionleft',
|
61
|
+
'optionright',
|
62
|
+
'p',
|
63
|
+
'pagedown',
|
64
|
+
'pageup',
|
65
|
+
'q',
|
66
|
+
'r',
|
67
|
+
's',
|
68
|
+
'shift',
|
69
|
+
'shiftleft',
|
70
|
+
'shiftright',
|
71
|
+
'space',
|
72
|
+
't',
|
73
|
+
'tab',
|
74
|
+
'u',
|
75
|
+
'v',
|
76
|
+
'w',
|
77
|
+
'windows',
|
78
|
+
'windowsleft',
|
79
|
+
'windowsright',
|
80
|
+
'x',
|
81
|
+
'y',
|
82
|
+
'z',
|
83
|
+
]
|
84
|
+
|
85
|
+
export {
|
86
|
+
keyboardKeyNameDictionary,
|
87
|
+
}
|
package/src/fixtures/icons.json
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
[
|
2
2
|
"mdi/alien",
|
3
|
+
"mdi/apple-keyboard-shift",
|
3
4
|
"mdi/barley",
|
4
5
|
"mdi/baseball",
|
5
6
|
"mdi/crown",
|
@@ -12,8 +13,10 @@
|
|
12
13
|
"mdi/folder-open",
|
13
14
|
"mdi/handshake",
|
14
15
|
"mdi/harddisk",
|
16
|
+
"mdi/keyboard-space",
|
15
17
|
"mdi/license",
|
16
18
|
"mdi/map-marker",
|
19
|
+
"mdi/npm",
|
17
20
|
"mdi/replay",
|
18
21
|
"mdi/vector-curve",
|
19
22
|
"mgg/abitazione-principale",
|
@@ -368,8 +371,16 @@
|
|
368
371
|
"mi/baseline/indeterminate-check-box",
|
369
372
|
"mi/baseline/info",
|
370
373
|
"mi/baseline/insert-drive-file",
|
374
|
+
"mi/baseline/keyboard",
|
371
375
|
"mi/baseline/keyboard-arrow-down",
|
376
|
+
"mi/baseline/keyboard-arrow-left",
|
377
|
+
"mi/baseline/keyboard-arrow-right",
|
372
378
|
"mi/baseline/keyboard-arrow-up",
|
379
|
+
"mi/baseline/keyboard-capslock",
|
380
|
+
"mi/baseline/keyboard-command-key",
|
381
|
+
"mi/baseline/keyboard-option-key",
|
382
|
+
"mi/baseline/keyboard-return",
|
383
|
+
"mi/baseline/keyboard-tab",
|
373
384
|
"mi/baseline/light-mode",
|
374
385
|
"mi/baseline/local-activity",
|
375
386
|
"mi/baseline/location-city",
|
@@ -379,6 +390,7 @@
|
|
379
390
|
"mi/baseline/meeting-room",
|
380
391
|
"mi/baseline/more-vert",
|
381
392
|
"mi/baseline/navigate-next",
|
393
|
+
"mi/baseline/north",
|
382
394
|
"mi/baseline/panorama",
|
383
395
|
"mi/baseline/person",
|
384
396
|
"mi/baseline/pets",
|
@@ -389,6 +401,7 @@
|
|
389
401
|
"mi/baseline/route",
|
390
402
|
"mi/baseline/send",
|
391
403
|
"mi/baseline/settings",
|
404
|
+
"mi/baseline/south",
|
392
405
|
"mi/baseline/sports",
|
393
406
|
"mi/baseline/sports-soccer",
|
394
407
|
"mi/baseline/stadium",
|
@@ -397,6 +410,8 @@
|
|
397
410
|
"mi/baseline/tv",
|
398
411
|
"mi/baseline/unfold-less",
|
399
412
|
"mi/baseline/unfold-more",
|
413
|
+
"mi/baseline/vertical-align-bottom",
|
414
|
+
"mi/baseline/vertical-align-top",
|
400
415
|
"mi/baseline/videocam",
|
401
416
|
"mi/baseline/visibility",
|
402
417
|
"mi/baseline/visibility-off",
|
@@ -405,6 +420,7 @@
|
|
405
420
|
"mi/baseline/web",
|
406
421
|
"mi/baseline/wysiwyg",
|
407
422
|
"mi/outline/auto-awesome",
|
423
|
+
"mi/outline/backspace",
|
408
424
|
"mi/outline/circle",
|
409
425
|
"mi/outline/dark-mode",
|
410
426
|
"mi/outline/help-outline",
|
@@ -413,5 +429,6 @@
|
|
413
429
|
"mi/round/email",
|
414
430
|
"mi/round/menu",
|
415
431
|
"mi/round/more-vert",
|
416
|
-
"mi/round/person"
|
432
|
+
"mi/round/person",
|
433
|
+
"mi/sharp/window"
|
417
434
|
]
|