@maggioli-design-system/mds-table-row 5.1.0 → 5.2.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-table-row.cjs.entry.js +1 -1
- package/dist/collection/common/floating-controller.js +3 -3
- package/dist/collection/common/string.js +30 -0
- package/dist/collection/components/mds-table-row/mds-table-row.css +121 -0
- package/dist/collection/dictionary/keyboard.js +84 -0
- package/dist/collection/type/keyboard.js +1 -0
- package/dist/components/mds-table-row.js +1 -1
- package/dist/documentation.json +1 -1
- package/dist/esm/mds-table-row.entry.js +1 -1
- package/dist/esm-es5/mds-table-row.entry.js +2 -2
- package/dist/mds-table-row/mds-table-row.esm.js +1 -1
- package/dist/mds-table-row/p-11048c96.system.js +1 -1
- package/dist/mds-table-row/p-64bc1c7b.entry.js +6 -0
- package/dist/mds-table-row/p-c5e9ab44.system.entry.js +6 -0
- package/dist/stats.json +22 -16
- 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 +21 -1
- package/package.json +3 -3
- package/src/common/floating-controller.ts +6 -6
- package/src/common/string.ts +42 -0
- package/src/components/mds-table-row/mds-table-row.css +4 -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-table-row.esm.js +1 -1
- package/www/build/p-11048c96.system.js +1 -1
- package/www/build/p-64bc1c7b.entry.js +6 -0
- package/www/build/p-c5e9ab44.system.entry.js +6 -0
- package/dist/mds-table-row/p-12e458ac.entry.js +0 -6
- package/dist/mds-table-row/p-95fc715e.system.entry.js +0 -6
- package/www/build/p-12e458ac.entry.js +0 -6
- package/www/build/p-95fc715e.system.entry.js +0 -6
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,n,e,r){function a(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,i){function d(t){try{o(r.next(t))}catch(t){i(t)}}function s(t){try{o(r["throw"](t))}catch(t){i(t)}}function o(t){t.done?e(t.value):a(t.value).then(d,s)}o((r=r.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,a,i,d;return d={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(d[Symbol.iterator]=function(){return this}),d;function s(t){return function(n){return o([t,n])}}function o(s){if(r)throw new TypeError("Generator is already executing.");while(d&&(d=0,s[0]&&(e=0)),e)try{if(r=1,a&&(i=s[0]&2?a["return"]:s[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;if(a=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;a=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){e.label=s[1];break}if(s[0]===6&&e.label<i[1]){e.label=i[1];i=s;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(s);break}if(i[2])e.ops.pop();e.trys.pop();continue}s=n.call(t,e)}catch(t){s=[6,t];a=0}finally{r=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-88f814c9.system.js"],(function(t){"use strict";var n,e,r,a;return{setters:[function(t){n=t.r;e=t.h;r=t.H;a=t.g}],execute:function(){var i=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var d={exports:{}};(function(t,n){(function(n,e){t.exports=e()})(i,(function(){
|
|
2
|
+
/*!
|
|
3
|
+
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
4
|
+
* http://github.com/janl/mustache.js
|
|
5
|
+
*/
|
|
6
|
+
var t=Object.prototype.toString;var n=Array.isArray||function n(e){return t.call(e)==="[object Array]"};function e(t){return typeof t==="function"}function r(t){return n(t)?"array":typeof t}function a(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function i(t,n){return t!=null&&typeof t==="object"&&n in t}function d(t,n){return t!=null&&typeof t!=="object"&&t.hasOwnProperty&&t.hasOwnProperty(n)}var s=RegExp.prototype.test;function o(t,n){return s.call(t,n)}var h=/\S/;function c(t){return!o(h,t)}var l={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function f(t){return String(t).replace(/[&<>"'`=\/]/g,(function t(n){return l[n]}))}var u=/\s*/;var y=/\s+/;var m=/\s*=/;var b=/\s*\}/;var v=/#|\^|\/|>|\{|&|=|!/;function p(t,e){if(!t)return[];var r=false;var i=[];var d=[];var s=[];var o=false;var h=false;var l="";var f=0;function p(){if(o&&!h){while(s.length)delete d[s.pop()]}else{s=[]}o=false;h=false}var x,R,E;function S(t){if(typeof t==="string")t=t.split(y,2);if(!n(t)||t.length!==2)throw new Error("Invalid tags: "+t);x=new RegExp(a(t[0])+"\\s*");R=new RegExp("\\s*"+a(t[1]));E=new RegExp("\\s*"+a("}"+t[1]))}S(e||j.tags);var _=new k(t);var z,X,C,D,O,T;while(!_.eos()){z=_.pos;C=_.scanUntil(x);if(C){for(var U=0,A=C.length;U<A;++U){D=C.charAt(U);if(c(D)){s.push(d.length);l+=D}else{h=true;r=true;l+=" "}d.push(["text",D,z,z+1]);z+=1;if(D==="\n"){p();l="";f=0;r=false}}}if(!_.scan(x))break;o=true;X=_.scan(v)||"name";_.scan(u);if(X==="="){C=_.scanUntil(m);_.scan(m);_.scanUntil(R)}else if(X==="{"){C=_.scanUntil(E);_.scan(b);_.scanUntil(R);X="&"}else{C=_.scanUntil(R)}if(!_.scan(R))throw new Error("Unclosed tag at "+_.pos);if(X==">"){O=[X,C,z,_.pos,l,f,r]}else{O=[X,C,z,_.pos]}f++;d.push(O);if(X==="#"||X==="^"){i.push(O)}else if(X==="/"){T=i.pop();if(!T)throw new Error('Unopened section "'+C+'" at '+z);if(T[1]!==C)throw new Error('Unclosed section "'+T[1]+'" at '+z)}else if(X==="name"||X==="{"||X==="&"){h=true}else if(X==="="){S(C)}}p();T=i.pop();if(T)throw new Error('Unclosed section "'+T[1]+'" at '+_.pos);return g(w(d))}function w(t){var n=[];var e,r;for(var a=0,i=t.length;a<i;++a){e=t[a];if(e){if(e[0]==="text"&&r&&r[0]==="text"){r[1]+=e[1];r[3]=e[3]}else{n.push(e);r=e}}}return n}function g(t){var n=[];var e=n;var r=[];var a,i;for(var d=0,s=t.length;d<s;++d){a=t[d];switch(a[0]){case"#":case"^":e.push(a);r.push(a);e=a[4]=[];break;case"/":i=r.pop();i[5]=a[2];e=r.length>0?r[r.length-1][4]:n;break;default:e.push(a)}}return n}function k(t){this.string=t;this.tail=t;this.pos=0}k.prototype.eos=function t(){return this.tail===""};k.prototype.scan=function t(n){var e=this.tail.match(n);if(!e||e.index!==0)return"";var r=e[0];this.tail=this.tail.substring(r.length);this.pos+=r.length;return r};k.prototype.scanUntil=function t(n){var e=this.tail.search(n),r;switch(e){case-1:r=this.tail;this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,e);this.tail=this.tail.substring(e)}this.pos+=r.length;return r};function x(t,n){this.view=t;this.cache={".":this.view};this.parent=n}x.prototype.push=function t(n){return new x(n,this)};x.prototype.lookup=function t(n){var r=this.cache;var a;if(r.hasOwnProperty(n)){a=r[n]}else{var s=this,o,h,c,l=false;while(s){if(n.indexOf(".")>0){o=s.view;h=n.split(".");c=0;while(o!=null&&c<h.length){if(c===h.length-1)l=i(o,h[c])||d(o,h[c]);o=o[h[c++]]}}else{o=s.view[n];l=i(s.view,n)}if(l){a=o;break}s=s.parent}r[n]=a}if(e(a))a=a.call(this.view);return a};function R(){this.templateCache={_cache:{},set:function t(n,e){this._cache[n]=e},get:function t(n){return this._cache[n]},clear:function t(){this._cache={}}}}R.prototype.clearCache=function t(){if(typeof this.templateCache!=="undefined"){this.templateCache.clear()}};R.prototype.parse=function t(n,e){var r=this.templateCache;var a=n+":"+(e||j.tags).join(":");var i=typeof r!=="undefined";var d=i?r.get(a):undefined;if(d==undefined){d=p(n,e);i&&r.set(a,d)}return d};R.prototype.render=function t(n,e,r,a){var i=this.getConfigTags(a);var d=this.parse(n,i);var s=e instanceof x?e:new x(e,undefined);return this.renderTokens(d,s,r,n,a)};R.prototype.renderTokens=function t(n,e,r,a,i){var d="";var s,o,h;for(var c=0,l=n.length;c<l;++c){h=undefined;s=n[c];o=s[0];if(o==="#")h=this.renderSection(s,e,r,a,i);else if(o==="^")h=this.renderInverted(s,e,r,a,i);else if(o===">")h=this.renderPartial(s,e,r,i);else if(o==="&")h=this.unescapedValue(s,e);else if(o==="name")h=this.escapedValue(s,e,i);else if(o==="text")h=this.rawValue(s);if(h!==undefined)d+=h}return d};R.prototype.renderSection=function t(r,a,i,d,s){var o=this;var h="";var c=a.lookup(r[1]);function l(t){return o.render(t,a,i,s)}if(!c)return;if(n(c)){for(var f=0,u=c.length;f<u;++f){h+=this.renderTokens(r[4],a.push(c[f]),i,d,s)}}else if(typeof c==="object"||typeof c==="string"||typeof c==="number"){h+=this.renderTokens(r[4],a.push(c),i,d,s)}else if(e(c)){if(typeof d!=="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(a.view,d.slice(r[3],r[5]),l);if(c!=null)h+=c}else{h+=this.renderTokens(r[4],a,i,d,s)}return h};R.prototype.renderInverted=function t(e,r,a,i,d){var s=r.lookup(e[1]);if(!s||n(s)&&s.length===0)return this.renderTokens(e[4],r,a,i,d)};R.prototype.indentPartial=function t(n,e,r){var a=e.replace(/[^ \t]/g,"");var i=n.split("\n");for(var d=0;d<i.length;d++){if(i[d].length&&(d>0||!r)){i[d]=a+i[d]}}return i.join("\n")};R.prototype.renderPartial=function t(n,r,a,i){if(!a)return;var d=this.getConfigTags(i);var s=e(a)?a(n[1]):a[n[1]];if(s!=null){var o=n[6];var h=n[5];var c=n[4];var l=s;if(h==0&&c){l=this.indentPartial(s,c,o)}var f=this.parse(l,d);return this.renderTokens(f,r,a,l,i)}};R.prototype.unescapedValue=function t(n,e){var r=e.lookup(n[1]);if(r!=null)return r};R.prototype.escapedValue=function t(n,e,r){var a=this.getConfigEscape(r)||j.escape;var i=e.lookup(n[1]);if(i!=null)return typeof i==="number"&&a===j.escape?String(i):a(i)};R.prototype.rawValue=function t(n){return n[1]};R.prototype.getConfigTags=function t(e){if(n(e)){return e}else if(e&&typeof e==="object"){return e.tags}else{return undefined}};R.prototype.getConfigEscape=function t(e){if(e&&typeof e==="object"&&!n(e)){return e.escape}else{return undefined}};var j={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:undefined,escape:undefined,parse:undefined,render:undefined,Scanner:undefined,Context:undefined,Writer:undefined,set templateCache(t){E.templateCache=t},get templateCache(){return E.templateCache}};var E=new R;j.clearCache=function t(){return E.clearCache()};j.parse=function t(n,e){return E.parse(n,e)};j.render=function t(n,e,a,i){if(typeof n!=="string"){throw new TypeError('Invalid template! Template should be a "string" '+'but "'+r(n)+'" was given as the first '+"argument for mustache#render(template, view, partials)")}return E.render(n,e,a,i)};j.escape=f;j.Scanner=k;j.Context=x;j.Writer=R;return j}))})(d);var s=function(){function t(t){var n=this;this.rollbackLanguage="en";this.set=function(t){n.config=t};this.lang=function(t){n.element=t;n.closestElement=n.element.closest("[lang]");if(n.closestElement){if(n.closestElement.lang){n.language=n.closestElement.lang;return n.language}}n.language=n.rollbackLanguage;return n.language};this.update=function(t){var e=t!==null&&t!==void 0?t:n.element.shadowRoot;e&&e.querySelectorAll("*").forEach((function(t){if(t.tagName.toLowerCase().startsWith("mds-")){if(t&&"updateLang"in t){t.updateLang()}}}))};this.pluralize=function(t,e){var r=n.config[n.language]?n.config[n.language][t]:n.config[n.rollbackLanguage][t];var a=[];if(Array.isArray(r)){a.push(r[0]);a.push(r[1])}else{a.push(r);a.push(r)}var i=a[0];var s=i;var o=Object.keys(e);if(o.length>0){var h=o[0];if(typeof e[h]==="number"){if(e[h]!==1){s=a[1]}}}return d.exports.render(s,e)};this.get=function(t,e){if(e){return n.pluralize(t,e)}return n.config[n.language]?n.config[n.language][t]:n.config[n.rollbackLanguage][t]};if(t){this.set(t)}}return t}();var o="Επιλογή γραμμής";var h="Αποεπιλογή γραμμής";var c={selectRow:o,unselectRow:h};var l="Select row";var f="Deselect row";var u={selectRow:l,unselectRow:f};var y="Seleccionar fila";var m="Deseleccionar fila";var b={selectRow:y,unselectRow:m};var v="Seleziona riga";var p="Deseleziona riga";var w={selectRow:v,unselectRow:p};var g='@tailwind components;\n@tailwind utilities;\n\n:host(:not(:is([hydrated], .hydrated))) {\n -webkit-animation-duration: 0s;\n animation-duration: 0s;\n border-color: transparent;\n -webkit-box-shadow: 0 0 0 transparent;\n box-shadow: 0 0 0 transparent;\n opacity: 0;\n outline-color: transparent;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n visibility: hidden;\n}\n\n/* TODO refact(stencil): Uses only used selector from parent shadowDOM component */\n\nmds-accordion:not(:is([hydrated], .hydrated)),\nmds-accordion-item:not(:is([hydrated], .hydrated)),\nmds-accordion-timer:not(:is([hydrated], .hydrated)),\nmds-accordion-timer-item:not(:is([hydrated], .hydrated)),\nmds-author:not(:is([hydrated], .hydrated)),\nmds-avatar:not(:is([hydrated], .hydrated)),\nmds-badge:not(:is([hydrated], .hydrated)),\nmds-banner:not(:is([hydrated], .hydrated)),\nmds-benchmark-bar:not(:is([hydrated], .hydrated)),\nmds-bibliography:not(:is([hydrated], .hydrated)),\nmds-breadcrumb:not(:is([hydrated], .hydrated)),\nmds-breadcrumb-item:not(:is([hydrated], .hydrated)),\nmds-button:not(:is([hydrated], .hydrated)),\nmds-card:not(:is([hydrated], .hydrated)),\nmds-card-content:not(:is([hydrated], .hydrated)),\nmds-card-footer:not(:is([hydrated], .hydrated)),\nmds-card-header:not(:is([hydrated], .hydrated)),\nmds-card-media:not(:is([hydrated], .hydrated)),\nmds-chip:not(:is([hydrated], .hydrated)),\nmds-details:not(:is([hydrated], .hydrated)),\nmds-dropdown:not(:is([hydrated], .hydrated)),\nmds-entity:not(:is([hydrated], .hydrated)),\nmds-file:not(:is([hydrated], .hydrated)),\nmds-file-preview:not(:is([hydrated], .hydrated)),\nmds-filter:not(:is([hydrated], .hydrated)),\nmds-filter-item:not(:is([hydrated], .hydrated)),\nmds-header:not(:is([hydrated], .hydrated)),\nmds-header-bar:not(:is([hydrated], .hydrated)),\nmds-help:not(:is([hydrated], .hydrated)),\nmds-horizontal-scroll:not(:is([hydrated], .hydrated)),\nmds-hr:not(:is([hydrated], .hydrated)),\nmds-icon:not(:is([hydrated], .hydrated)),\nmds-img:not(:is([hydrated], .hydrated)),\nmds-input:not(:is([hydrated], .hydrated)),\nmds-input-field:not(:is([hydrated], .hydrated)),\nmds-input-range:not(:is([hydrated], .hydrated)),\nmds-input-select:not(:is([hydrated], .hydrated)),\nmds-input-switch:not(:is([hydrated], .hydrated)),\nmds-input-tip:not(:is([hydrated], .hydrated)),\nmds-input-tip-item:not(:is([hydrated], .hydrated)),\nmds-input-upload:not(:is([hydrated], .hydrated)),\nmds-keyboard:not(:is([hydrated], .hydrated)),\nmds-keyboard-key:not(:is([hydrated], .hydrated)),\nmds-kpi:not(:is([hydrated], .hydrated)),\nmds-kpi-item:not(:is([hydrated], .hydrated)),\nmds-label:not(:is([hydrated], .hydrated)),\nmds-list:not(:is([hydrated], .hydrated)),\nmds-list-item:not(:is([hydrated], .hydrated)),\nmds-modal:not(:is([hydrated], .hydrated)),\nmds-note:not(:is([hydrated], .hydrated)),\nmds-notification:not(:is([hydrated], .hydrated)),\nmds-paginator:not(:is([hydrated], .hydrated)),\nmds-paginator-item:not(:is([hydrated], .hydrated)),\nmds-pref:not(:is([hydrated], .hydrated)),\nmds-pref-animation:not(:is([hydrated], .hydrated)),\nmds-pref-consumption:not(:is([hydrated], .hydrated)),\nmds-pref-contrast:not(:is([hydrated], .hydrated)),\nmds-pref-language:not(:is([hydrated], .hydrated)),\nmds-pref-language-item:not(:is([hydrated], .hydrated)),\nmds-pref-theme:not(:is([hydrated], .hydrated)),\nmds-price-table:not(:is([hydrated], .hydrated)),\nmds-price-table-features:not(:is([hydrated], .hydrated)),\nmds-price-table-features-cell:not(:is([hydrated], .hydrated)),\nmds-price-table-features-row:not(:is([hydrated], .hydrated)),\nmds-price-table-header:not(:is([hydrated], .hydrated)),\nmds-price-table-list:not(:is([hydrated], .hydrated)),\nmds-price-table-list-item:not(:is([hydrated], .hydrated)),\nmds-progress:not(:is([hydrated], .hydrated)),\nmds-push-notification:not(:is([hydrated], .hydrated)),\nmds-push-notifications:not(:is([hydrated], .hydrated)),\nmds-quote:not(:is([hydrated], .hydrated)),\nmds-separator:not(:is([hydrated], .hydrated)),\nmds-spinner:not(:is([hydrated], .hydrated)),\nmds-stepper-bar:not(:is([hydrated], .hydrated)),\nmds-stepper-bar-item:not(:is([hydrated], .hydrated)),\nmds-tab:not(:is([hydrated], .hydrated)),\nmds-tab-bar:not(:is([hydrated], .hydrated)),\nmds-tab-bar-item:not(:is([hydrated], .hydrated)),\nmds-tab-item:not(:is([hydrated], .hydrated)),\nmds-table:not(:is([hydrated], .hydrated)),\nmds-table-body:not(:is([hydrated], .hydrated)),\nmds-table-cell:not(:is([hydrated], .hydrated)),\nmds-table-footer:not(:is([hydrated], .hydrated)),\nmds-table-header:not(:is([hydrated], .hydrated)),\nmds-table-header-cell:not(:is([hydrated], .hydrated)),\nmds-table-row:not(:is([hydrated], .hydrated)),\nmds-text:not(:is([hydrated], .hydrated)),\nmds-toast:not(:is([hydrated], .hydrated)),\nmds-tooltip:not(:is([hydrated], .hydrated)),\nmds-tree:not(:is([hydrated], .hydrated)),\nmds-tree-item:not(:is([hydrated], .hydrated)),\nmds-url-view:not(:is([hydrated], .hydrated)),\nmds-usage:not(:is([hydrated], .hydrated)),\nmds-video-wall:not(:is([hydrated], .hydrated)),\nmds-zero:not(:is([hydrated], .hydrated))\n{\n -webkit-animation-duration: 0s;\n animation-duration: 0s;\n border-color: transparent;\n -webkit-box-shadow: 0 0 0 transparent;\n box-shadow: 0 0 0 transparent;\n opacity: 0;\n outline-color: transparent;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n visibility: hidden;\n}\n\n\n:host {\n\n --mds-table-row-color-hover: var(--mds-table-color, rgb(var(--tone-neutral-02)));\n --mds-table-row-color-alt: var(--mds-table-color-alt, rgb(var(--tone-neutral-02)));\n --mds-table-row-background-hover: var(--mds-table-background, rgb(var(--tone-neutral)));\n --mds-table-row-background-alt: var(--mds-table-background-alt, rgb(var(--tone-neutral)));\n --mds-table-row-actions-gap: var(--mds-table-actions-gap, 1rem);\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-timing-function: cubic-bezier(0, 0, 0.2, 1);\n transition-timing-function: cubic-bezier(0, 0, 0.2, 1);\n\n color: var(--mds-table-row-color);\n display: table-row;\n position: relative;\n -webkit-transition-property: color;\n transition-property: color;\n\n}\n\n.selection-cell {\n vertical-align: middle;\n}\n\n.checkbox-wrapper {\n display: -ms-flexbox;\n display: flex;\n}\n\n:host([interactive]:hover) {\n\n --mds-table-row-actions-background: var(--mds-table-row-background-hover);\n --mds-table-row-background: var(--mds-table-row-background-hover);\n --mds-table-row-color: var(--mds-table-row-color-hover);\n}\n\n:host([selected]) {\n\n --mds-table-row-background: var(--mds-table-row-background-hover);\n --mds-table-row-color: var(--mds-table-row-color-hover);\n}\n\n:host([sorted]) {\n\n --mds-table-row-background: var(--mds-table-row-background-alt);\n --mds-table-row-color: var(--mds-table-row-color-alt);\n}\n\n:host([sorted][selected]) {\n\n --mds-table-row-background: var(--mds-table-row-background-hover);\n --mds-table-row-color: var(--mds-table-row-color-hover);\n}\n\n.actions-view {\n -ms-flex-align: center;\n align-items: center;\n display: -ms-flexbox;\n display: flex;\n inset: 0;\n -ms-flex-pack: end;\n justify-content: end;\n pointer-events: none;\n position: absolute;\n}\n\n.actions {\n\n --mds-table-row-actions-background: var(--mds-table-row-background);\n\n -ms-flex-align: center;\n\n align-items: center;\n background-color: var(--mds-table-row-actions-background);\n border-bottom-left-radius: calc(0.5rem + var(--mds-table-border-width) * 2);\n border-top-left-radius: calc(0.5rem + var(--mds-table-border-width) * 2);\n display: -ms-inline-flexbox;\n display: inline-flex;\n gap: var(--mds-table-row-actions-gap);\n inset: 0;\n margin-right: 100%;\n padding: calc(var(--mds-table-border-width) * 2);\n padding-right: 0;\n pointer-events: auto;\n position: -webkit-sticky;\n position: sticky;\n right: 0;\n -webkit-transform: translateX(100%);\n transform: translateX(100%);\n -webkit-transition-duration: 500ms;\n transition-duration: 500ms;\n -webkit-transition-property: background-color, padding-right, -webkit-transform;\n transition-property: background-color, padding-right, -webkit-transform;\n transition-property: transform, background-color, padding-right;\n transition-property: transform, background-color, padding-right, -webkit-transform;\n -webkit-transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);\n transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);\n}\n\n:host(:hover) .actions {\n -webkit-transform: translateX(100%);\n transform: translateX(100%);\n}\n\n:host([overlay-actions]) .actions {\n padding-right: var(--mds-table-cell-padding);\n -webkit-transform: translateX(100%);\n transform: translateX(100%);\n}\n\n:host([overlay-actions]:hover) .actions {\n\n --mds-table-row-actions-background: var(--mds-table-row-background);\n\n -webkit-transform: translateX(0);\n\n transform: translateX(0);\n}\n\n:host(:hover):host-context(mds-table[interactive="false"]) .actions,\n:host(:hover):host-context(mds-table:not([interactive])) .actions {\n\n --mds-table-row-actions-background: var(--mds-table-row-background-hover);\n}\n\n:host(:not([selected]):hover):host-context(mds-table[selection]:not([interactive])) .actions,\n:host(:not([selected]):hover):host-context(mds-table[selection][interactive="false"]) .actions,\n:host([selected="false"]:hover):host-context(mds-table[selection]:not([interactive])) .actions,\n:host([selected="false"]:hover):host-context(mds-table[selection][interactive="false"]) .actions {\n\n --mds-table-row-actions-background: var(--mds-table-row-background-alt);\n}\n\n@container style(--magma-pref-animation: reduce) {\n :host,\n .actions {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n\n@container style(--magma-pref-animation: system) {\n\n @media (prefers-reduced-motion) {\n :host,\n .actions {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n }\n}\n\n';var k=g;var x=t("mds_table_row",function(){function t(t){var e=this;n(this,t);this.t=new s({el:c,en:u,es:b,it:w});this.selectable=undefined;this.handleSelectionChange=function(t){var n;e.selected=t.detail.checked;(n=e.host.closest("mds-table"))===null||n===void 0?void 0:n.updateSelection()}}t.prototype.updateLang=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.language=this.t.lang(this.host);this.t.update();return[2]}))}))};t.prototype.componentWillLoad=function(){this.language=this.t.lang(this.host);this.hasActions=this.host.querySelector('[slot="action"]')!==null};t.prototype.componentDidLoad=function(){var t;if(this.hasActions){this.actions=(t=this.host.shadowRoot)===null||t===void 0?void 0:t.querySelector(".actions");this.sizerWidth="".concat(this.actions.offsetWidth.toString(),"px")}};t.prototype.render=function(){return e(r,{key:"4905591b94a0af846d25e3cf55fe5805ecec76be",role:"row"},this.selectable&&e("mds-table-cell",{key:"07f8596969f20148250cc42fde0a806435825274",class:"selection-cell"},e("div",{key:"2d0bb74f3f5edaf6180c68a60457b374dcd7a4bd",class:"checkbox-wrapper"},e("mds-input-switch",{key:"e04fafd6a53ed1c6a4208b0317419fe21d08f28e",title:this.t.get(this.selected?"unselectRow":"selectRow"),lang:this.language,type:"checkbox",checked:this.selected,onMdsInputSwitchChange:this.handleSelectionChange}))),e("slot",{key:"d71c2ec9e675fd8190eeeb7d816a5e2566c6afc4"}),this.hasActions&&e("mds-table-cell",{key:"0ede2c5f98d7541920c4170d70c21f9f61ac93cb",class:"actions-cell"},e("div",{key:"8a097d4b04bd594778f51bedfe438fe1fd3479b3",class:"actions-sizer",style:{minHeight:"1px",maxWidth:this.sizerWidth,minWidth:this.sizerWidth}}),e("div",{key:"31f1fe8d7e4ee01f33f1c6a5b76e23fd875dfd82",class:"actions-view"},e("div",{key:"762785e31a306ba3c1e7654218bdf8cb33044cd3",class:"actions",style:{marginRight:"calc(".concat(this.sizerWidth," + var(--mds-table-cell-padding))")}},e("slot",{key:"05ea2b5edc71e58859e55e52c1ab65ca0c5354f8",name:"action"})))))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());x.style=k}}}));
|
package/dist/stats.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2025-02-
|
|
2
|
+
"timestamp": "2025-02-25T15:13:44",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "node",
|
|
5
5
|
"version": "22.11.0"
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"fsNamespace": "mds-table-row",
|
|
10
10
|
"components": 1,
|
|
11
11
|
"entries": 1,
|
|
12
|
-
"bundles":
|
|
12
|
+
"bundles": 100,
|
|
13
13
|
"outputs": [
|
|
14
14
|
{
|
|
15
15
|
"name": "dist-collection",
|
|
16
|
-
"files":
|
|
16
|
+
"files": 52,
|
|
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",
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
"./dist/collection/dictionary/floating-ui.js",
|
|
42
43
|
"./dist/collection/dictionary/icon.js",
|
|
43
44
|
"./dist/collection/dictionary/input.js",
|
|
45
|
+
"./dist/collection/dictionary/keyboard.js",
|
|
44
46
|
"./dist/collection/dictionary/loading.js",
|
|
45
47
|
"./dist/collection/dictionary/text.js",
|
|
46
48
|
"./dist/collection/dictionary/tree.js",
|
|
@@ -57,6 +59,7 @@
|
|
|
57
59
|
"./dist/collection/type/form-rel.js",
|
|
58
60
|
"./dist/collection/type/header-bar.js",
|
|
59
61
|
"./dist/collection/type/input.js",
|
|
62
|
+
"./dist/collection/type/keyboard.js",
|
|
60
63
|
"./dist/collection/type/loading.js",
|
|
61
64
|
"./dist/collection/type/preference.js",
|
|
62
65
|
"./dist/collection/type/text.js",
|
|
@@ -104,23 +107,23 @@
|
|
|
104
107
|
"./dist/mds-table-row/mds-table-row.esm.js",
|
|
105
108
|
"./dist/mds-table-row/mds-table-row.js",
|
|
106
109
|
"./dist/mds-table-row/p-11048c96.system.js",
|
|
107
|
-
"./dist/mds-table-row/p-12e458ac.entry.js",
|
|
108
110
|
"./dist/mds-table-row/p-22d4881a.js",
|
|
109
111
|
"./dist/mds-table-row/p-50ea2036.system.js",
|
|
110
112
|
"./dist/mds-table-row/p-56ba5cbf.system.js",
|
|
113
|
+
"./dist/mds-table-row/p-64bc1c7b.entry.js",
|
|
111
114
|
"./dist/mds-table-row/p-88f814c9.system.js",
|
|
112
|
-
"./dist/mds-table-row/p-
|
|
115
|
+
"./dist/mds-table-row/p-c5e9ab44.system.entry.js",
|
|
113
116
|
"./dist/mds-table-row/p-e1255160.js",
|
|
114
117
|
"./www/build/index.esm.js",
|
|
115
118
|
"./www/build/mds-table-row.esm.js",
|
|
116
119
|
"./www/build/mds-table-row.js",
|
|
117
120
|
"./www/build/p-11048c96.system.js",
|
|
118
|
-
"./www/build/p-12e458ac.entry.js",
|
|
119
121
|
"./www/build/p-22d4881a.js",
|
|
120
122
|
"./www/build/p-50ea2036.system.js",
|
|
121
123
|
"./www/build/p-56ba5cbf.system.js",
|
|
124
|
+
"./www/build/p-64bc1c7b.entry.js",
|
|
122
125
|
"./www/build/p-88f814c9.system.js",
|
|
123
|
-
"./www/build/p-
|
|
126
|
+
"./www/build/p-c5e9ab44.system.entry.js",
|
|
124
127
|
"./www/build/p-e1255160.js"
|
|
125
128
|
]
|
|
126
129
|
},
|
|
@@ -154,12 +157,12 @@
|
|
|
154
157
|
"components": [
|
|
155
158
|
"mds-table-row"
|
|
156
159
|
],
|
|
157
|
-
"bundleId": "p-
|
|
158
|
-
"fileName": "p-
|
|
160
|
+
"bundleId": "p-64bc1c7b",
|
|
161
|
+
"fileName": "p-64bc1c7b.entry.js",
|
|
159
162
|
"imports": [
|
|
160
163
|
"p-22d4881a.js"
|
|
161
164
|
],
|
|
162
|
-
"originalByteSize":
|
|
165
|
+
"originalByteSize": 41351
|
|
163
166
|
}
|
|
164
167
|
],
|
|
165
168
|
"esm": [
|
|
@@ -173,7 +176,7 @@
|
|
|
173
176
|
"imports": [
|
|
174
177
|
"index-8134a00a.js"
|
|
175
178
|
],
|
|
176
|
-
"originalByteSize":
|
|
179
|
+
"originalByteSize": 41355
|
|
177
180
|
}
|
|
178
181
|
],
|
|
179
182
|
"es5": [
|
|
@@ -187,7 +190,7 @@
|
|
|
187
190
|
"imports": [
|
|
188
191
|
"index-8134a00a.js"
|
|
189
192
|
],
|
|
190
|
-
"originalByteSize":
|
|
193
|
+
"originalByteSize": 41355
|
|
191
194
|
}
|
|
192
195
|
],
|
|
193
196
|
"system": [
|
|
@@ -196,12 +199,12 @@
|
|
|
196
199
|
"components": [
|
|
197
200
|
"mds-table-row"
|
|
198
201
|
],
|
|
199
|
-
"bundleId": "p-
|
|
200
|
-
"fileName": "p-
|
|
202
|
+
"bundleId": "p-c5e9ab44.system",
|
|
203
|
+
"fileName": "p-c5e9ab44.system.entry.js",
|
|
201
204
|
"imports": [
|
|
202
205
|
"p-88f814c9.system.js"
|
|
203
206
|
],
|
|
204
|
-
"originalByteSize":
|
|
207
|
+
"originalByteSize": 43961
|
|
205
208
|
}
|
|
206
209
|
],
|
|
207
210
|
"commonjs": [
|
|
@@ -215,7 +218,7 @@
|
|
|
215
218
|
"imports": [
|
|
216
219
|
"index-cb928c36.js"
|
|
217
220
|
],
|
|
218
|
-
"originalByteSize":
|
|
221
|
+
"originalByteSize": 41462
|
|
219
222
|
}
|
|
220
223
|
]
|
|
221
224
|
},
|
|
@@ -665,6 +668,7 @@
|
|
|
665
668
|
"./src/common/keyboard-manager.ts": [],
|
|
666
669
|
"./src/common/locale.ts": [],
|
|
667
670
|
"./src/common/slot.ts": [],
|
|
671
|
+
"./src/common/string.ts": [],
|
|
668
672
|
"./src/common/unit.ts": [],
|
|
669
673
|
"./src/common/yugop/core.ts": [
|
|
670
674
|
"./src/common/yugop/utils/math",
|
|
@@ -699,6 +703,7 @@
|
|
|
699
703
|
"./src/fixtures/iconsauce.json"
|
|
700
704
|
],
|
|
701
705
|
"./src/dictionary/input.ts": [],
|
|
706
|
+
"./src/dictionary/keyboard.ts": [],
|
|
702
707
|
"./src/dictionary/loading.ts": [],
|
|
703
708
|
"./src/dictionary/text.ts": [],
|
|
704
709
|
"./src/dictionary/tree.ts": [],
|
|
@@ -715,6 +720,7 @@
|
|
|
715
720
|
"./src/type/form-rel.ts": [],
|
|
716
721
|
"./src/type/header-bar.ts": [],
|
|
717
722
|
"./src/type/input.ts": [],
|
|
723
|
+
"./src/type/keyboard.ts": [],
|
|
718
724
|
"./src/type/loading.ts": [],
|
|
719
725
|
"./src/type/preference.ts": [],
|
|
720
726
|
"./src/type/text.ts": [],
|
|
@@ -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",
|
|
@@ -399,6 +399,11 @@
|
|
|
399
399
|
"docstring": "",
|
|
400
400
|
"path": "src/components/mds-header/meta/event-detail.ts"
|
|
401
401
|
},
|
|
402
|
+
"src/components/mds-header/meta/event-detail.ts::MdsHeaderVisibilityEventDetail": {
|
|
403
|
+
"declaration": "export interface MdsHeaderVisibilityEventDetail {\n visibility: boolean\n}",
|
|
404
|
+
"docstring": "",
|
|
405
|
+
"path": "src/components/mds-header/meta/event-detail.ts"
|
|
406
|
+
},
|
|
402
407
|
"src/components/mds-horizontal-scroll/meta/types.ts::ViewportType": {
|
|
403
408
|
"declaration": "export type ViewportType =\n | 'all'\n | 'tv'\n | 'xlarge'\n | 'large'\n | 'wide'\n | 'desktop'\n | 'tablet'\n | 'none'",
|
|
404
409
|
"docstring": "",
|
|
@@ -514,6 +519,16 @@
|
|
|
514
519
|
"docstring": "",
|
|
515
520
|
"path": "src/components/mds-input-upload/meta/types.ts"
|
|
516
521
|
},
|
|
522
|
+
"src/components/mds-keyboard/meta/type.ts::KeyboardTest": {
|
|
523
|
+
"declaration": "export type KeyboardTest =\n | 'pass'\n | 'fail'",
|
|
524
|
+
"docstring": "",
|
|
525
|
+
"path": "src/components/mds-keyboard/meta/type.ts"
|
|
526
|
+
},
|
|
527
|
+
"src/type/keyboard.ts::KeyboardKeyName": {
|
|
528
|
+
"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'",
|
|
529
|
+
"docstring": "",
|
|
530
|
+
"path": "src/type/keyboard.ts"
|
|
531
|
+
},
|
|
517
532
|
"src/type/typography.ts::TypographyType": {
|
|
518
533
|
"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'",
|
|
519
534
|
"docstring": "",
|
|
@@ -534,6 +549,11 @@
|
|
|
534
549
|
"docstring": "",
|
|
535
550
|
"path": "src/components/mds-modal/meta/types.ts"
|
|
536
551
|
},
|
|
552
|
+
"src/components/mds-modal/meta/types.ts::ModalOverflowType": {
|
|
553
|
+
"declaration": "export type ModalOverflowType =\n | 'auto'\n | 'manual'",
|
|
554
|
+
"docstring": "",
|
|
555
|
+
"path": "src/components/mds-modal/meta/types.ts"
|
|
556
|
+
},
|
|
537
557
|
"src/type/variant.ts::LabelVariantType": {
|
|
538
558
|
"declaration": "export type LabelVariantType =\n | 'amaranth'\n | 'aqua'\n | 'blue'\n | 'green'\n | 'lime'\n | 'orange'\n | 'orchid'\n | 'sky'\n | 'violet'\n | 'yellow'",
|
|
539
559
|
"docstring": "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maggioli-design-system/mds-table-row",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "mds-table-row 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",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"prepublishOnly": "npm run build"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@maggioli-design-system/mds-table-cell": "5.0
|
|
27
|
-
"@maggioli-design-system/styles": "15.
|
|
26
|
+
"@maggioli-design-system/mds-table-cell": "5.1.0",
|
|
27
|
+
"@maggioli-design-system/styles": "15.8.0",
|
|
28
28
|
"@stencil/core": "4.25.1"
|
|
29
29
|
},
|
|
30
30
|
"license": "MIT",
|
|
@@ -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 {
|
|
@@ -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
|
+
}
|
|
@@ -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
|
]
|