@maggioli-design-system/mds-input-tip 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index-fe2df682.js +1571 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/mds-input-tip.cjs.entry.js +21 -0
- package/dist/cjs/mds-input-tip.cjs.js +23 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/common/aria.js +29 -0
- package/dist/collection/common/file.js +48 -0
- package/dist/collection/common/icon.js +15 -0
- package/dist/collection/common/keyboard-manager.js +45 -0
- package/dist/collection/common/locale.js +20 -0
- package/dist/collection/common/unit.js +22 -0
- package/dist/collection/common/yugop/core.js +16 -0
- package/dist/collection/common/yugop/index.js +3 -0
- package/dist/collection/common/yugop/random-text.js +59 -0
- package/dist/collection/common/yugop/utils/math.js +11 -0
- package/dist/collection/common/yugop/utils/noop.js +1 -0
- package/dist/collection/common/yugop/utils/prng.js +21 -0
- package/dist/collection/common/yugop/utils/string.js +2 -0
- package/dist/collection/components/mds-input-tip/mds-input-tip.css +280 -0
- package/dist/collection/components/mds-input-tip/mds-input-tip.js +68 -0
- package/dist/collection/components/mds-input-tip/meta/types.js +1 -0
- package/dist/collection/components/mds-input-tip/test/mds-input-tip.e2e.js +9 -0
- package/dist/collection/dictionary/autocomplete.js +59 -0
- package/dist/collection/dictionary/button.js +30 -0
- package/dist/collection/dictionary/color.js +19 -0
- package/dist/collection/dictionary/file-extensions.js +64 -0
- package/dist/collection/dictionary/floating-ui.js +19 -0
- package/dist/collection/dictionary/icon.js +10 -0
- package/dist/collection/dictionary/input.js +37 -0
- package/dist/collection/dictionary/loading.js +5 -0
- package/dist/collection/dictionary/text.js +6 -0
- package/dist/collection/dictionary/typography.js +67 -0
- package/dist/collection/dictionary/variant.js +90 -0
- package/dist/collection/fixtures/cities.js +110 -0
- package/dist/collection/fixtures/filenames.js +57 -0
- package/dist/collection/interface/input-value.js +1 -0
- package/dist/collection/type/autocomplete.js +1 -0
- package/dist/collection/type/button.js +1 -0
- package/dist/collection/type/file-types.js +1 -0
- package/dist/collection/type/floating-ui.js +1 -0
- package/dist/collection/type/form-rel.js +1 -0
- package/dist/collection/type/input.js +1 -0
- package/dist/collection/type/loading.js +1 -0
- package/dist/collection/type/text.js +1 -0
- package/dist/collection/type/typography.js +1 -0
- package/dist/collection/type/variant-file-format.js +120 -0
- package/dist/collection/type/variant.js +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +1 -0
- package/dist/components/mds-input-tip.d.ts +11 -0
- package/dist/components/mds-input-tip.js +38 -0
- package/dist/documentation.d.ts +401 -0
- package/dist/documentation.json +97 -0
- package/dist/esm/index-351c5c8a.js +1544 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +9 -0
- package/dist/esm/mds-input-tip.entry.js +17 -0
- package/dist/esm/mds-input-tip.js +18 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm-es5/index-351c5c8a.js +1 -0
- package/dist/esm-es5/index.js +0 -0
- package/dist/esm-es5/loader.js +1 -0
- package/dist/esm-es5/mds-input-tip.entry.js +1 -0
- package/dist/esm-es5/mds-input-tip.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/mds-input-tip/index.esm.js +0 -0
- package/dist/mds-input-tip/mds-input-tip.esm.js +1 -0
- package/dist/mds-input-tip/mds-input-tip.js +127 -0
- package/dist/mds-input-tip/p-22b86e20.js +2 -0
- package/dist/mds-input-tip/p-3428f886.system.js +2 -0
- package/dist/mds-input-tip/p-50ea2036.system.js +1 -0
- package/dist/mds-input-tip/p-630886b5.entry.js +1 -0
- package/dist/mds-input-tip/p-89e037f5.system.entry.js +1 -0
- package/dist/mds-input-tip/p-e5fe0b68.system.js +1 -0
- package/dist/stats.json +500 -0
- package/dist/types/common/aria.d.ts +5 -0
- package/dist/types/common/file.d.ts +12 -0
- package/dist/types/common/icon.d.ts +5 -0
- package/dist/types/common/keyboard-manager.d.ts +12 -0
- package/dist/types/common/locale.d.ts +14 -0
- package/dist/types/common/unit.d.ts +3 -0
- package/dist/types/common/yugop/core.d.ts +10 -0
- package/dist/types/common/yugop/index.d.ts +1 -0
- package/dist/types/common/yugop/random-text.d.ts +31 -0
- package/dist/types/common/yugop/utils/math.d.ts +3 -0
- package/dist/types/common/yugop/utils/noop.d.ts +1 -0
- package/dist/types/common/yugop/utils/prng.d.ts +8 -0
- package/dist/types/common/yugop/utils/string.d.ts +1 -0
- package/dist/types/components/mds-input-tip/mds-input-tip.d.ts +12 -0
- package/dist/types/components/mds-input-tip/meta/types.d.ts +1 -0
- package/dist/types/components.d.ts +55 -0
- package/dist/types/dictionary/autocomplete.d.ts +2 -0
- package/dist/types/dictionary/button.d.ts +6 -0
- package/dist/types/dictionary/color.d.ts +3 -0
- package/dist/types/dictionary/file-extensions.d.ts +11 -0
- package/dist/types/dictionary/floating-ui.d.ts +3 -0
- package/dist/types/dictionary/icon.d.ts +4 -0
- package/dist/types/dictionary/input.d.ts +5 -0
- package/dist/types/dictionary/loading.d.ts +2 -0
- package/dist/types/dictionary/text.d.ts +2 -0
- package/dist/types/dictionary/typography.d.ts +11 -0
- package/dist/types/dictionary/variant.d.ts +11 -0
- package/dist/types/fixtures/cities.d.ts +2 -0
- package/dist/types/fixtures/filenames.d.ts +2 -0
- package/dist/types/interface/input-value.d.ts +4 -0
- package/dist/types/stencil-public-runtime.d.ts +1681 -0
- package/dist/types/type/autocomplete.d.ts +2 -0
- package/dist/types/type/button.d.ts +5 -0
- package/dist/types/type/file-types.d.ts +1 -0
- package/dist/types/type/floating-ui.d.ts +2 -0
- package/dist/types/type/form-rel.d.ts +1 -0
- package/dist/types/type/input.d.ts +4 -0
- package/dist/types/type/loading.d.ts +1 -0
- package/dist/types/type/text.d.ts +1 -0
- package/dist/types/type/typography.d.ts +10 -0
- package/dist/types/type/variant-file-format.d.ts +11 -0
- package/dist/types/type/variant.d.ts +12 -0
- package/documentation.json +568 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +59 -0
- package/readme.md +33 -0
- package/src/common/aria.ts +39 -0
- package/src/common/file.ts +63 -0
- package/src/common/icon.ts +25 -0
- package/src/common/keyboard-manager.ts +50 -0
- package/src/common/locale.ts +31 -0
- package/src/common/unit.ts +33 -0
- package/src/common/yugop/core.ts +47 -0
- package/src/common/yugop/index.ts +4 -0
- package/src/common/yugop/random-text.ts +95 -0
- package/src/common/yugop/utils/math.ts +21 -0
- package/src/common/yugop/utils/noop.ts +1 -0
- package/src/common/yugop/utils/prng.ts +35 -0
- package/src/common/yugop/utils/string.ts +4 -0
- package/src/components/mds-input-tip/.gitlab-ci.yml +25 -0
- package/src/components/mds-input-tip/mds-input-tip.css +52 -0
- package/src/components/mds-input-tip/mds-input-tip.tsx +28 -0
- package/src/components/mds-input-tip/meta/types.ts +3 -0
- package/src/components/mds-input-tip/readme.md +18 -0
- package/src/components/mds-input-tip/test/mds-input-tip.e2e.ts +11 -0
- package/src/components.d.ts +55 -0
- package/src/dictionary/autocomplete.ts +62 -0
- package/src/dictionary/button.ts +41 -0
- package/src/dictionary/color.ts +24 -0
- package/src/dictionary/file-extensions.ts +81 -0
- package/src/dictionary/floating-ui.ts +25 -0
- package/src/dictionary/icon.ts +15 -0
- package/src/dictionary/input.ts +48 -0
- package/src/dictionary/loading.ts +9 -0
- package/src/dictionary/text.ts +9 -0
- package/src/dictionary/typography.ts +88 -0
- package/src/dictionary/variant.ts +111 -0
- package/src/fixtures/cities.ts +116 -0
- package/src/fixtures/filenames.ts +60 -0
- package/src/fixtures/icons.json +344 -0
- package/src/fixtures/iconsauce.json +257 -0
- package/src/interface/input-value.ts +5 -0
- package/src/tailwind/components.css +15 -0
- package/src/type/autocomplete.ts +69 -0
- package/src/type/button.ts +28 -0
- package/src/type/file-types.ts +55 -0
- package/src/type/floating-ui.ts +17 -0
- package/src/type/form-rel.ts +11 -0
- package/src/type/input.ts +25 -0
- package/src/type/loading.ts +3 -0
- package/src/type/text.ts +4 -0
- package/src/type/typography.ts +65 -0
- package/src/type/variant-file-format.ts +137 -0
- package/src/type/variant.ts +99 -0
- package/www/build/index.esm.js +0 -0
- package/www/build/mds-input-tip.esm.js +1 -0
- package/www/build/mds-input-tip.js +127 -0
- package/www/build/p-22b86e20.js +2 -0
- package/www/build/p-3428f886.system.js +2 -0
- package/www/build/p-50ea2036.system.js +1 -0
- package/www/build/p-630886b5.entry.js +1 -0
- package/www/build/p-89e037f5.system.entry.js +1 -0
- package/www/build/p-e5fe0b68.system.js +1 -0
- package/www/host.config.json +15 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-fe2df682.js');
|
6
|
+
|
7
|
+
const defineCustomElements = (win, options) => {
|
8
|
+
if (typeof window === 'undefined') return undefined;
|
9
|
+
return index.bootstrapLazy([["mds-input-tip.cjs",[[1,"mds-input-tip",{"active":[516],"position":[513]}]]]], options);
|
10
|
+
};
|
11
|
+
|
12
|
+
exports.setNonce = index.setNonce;
|
13
|
+
exports.defineCustomElements = defineCustomElements;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-fe2df682.js');
|
6
|
+
|
7
|
+
const mdsInputTipCss = ".static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.border{border-width:1px}.bg-label-amaranth-10{--tw-bg-opacity:1;background-color:rgb(var(--label-amaranth-10) / var(--tw-bg-opacity))}.bg-label-aqua-10{--tw-bg-opacity:1;background-color:rgb(var(--label-aqua-10) / var(--tw-bg-opacity))}.bg-label-blue-10{--tw-bg-opacity:1;background-color:rgb(var(--label-blue-10) / var(--tw-bg-opacity))}.bg-label-green-10{--tw-bg-opacity:1;background-color:rgb(var(--label-green-10) / var(--tw-bg-opacity))}.bg-label-lime-10{--tw-bg-opacity:1;background-color:rgb(var(--label-lime-10) / var(--tw-bg-opacity))}.bg-label-orange-10{--tw-bg-opacity:1;background-color:rgb(var(--label-orange-10) / var(--tw-bg-opacity))}.bg-label-orchid-10{--tw-bg-opacity:1;background-color:rgb(var(--label-orchid-10) / var(--tw-bg-opacity))}.bg-label-violet-10{--tw-bg-opacity:1;background-color:rgb(var(--label-violet-10) / var(--tw-bg-opacity))}.bg-label-yellow-10{--tw-bg-opacity:1;background-color:rgb(var(--label-yellow-10) / var(--tw-bg-opacity))}.bg-tone-neutral-10{--tw-bg-opacity:1;background-color:rgb(var(--tone-neutral-10) / var(--tw-bg-opacity))}.fill-label-amaranth-04{fill:rgb(var(--label-amaranth-04))}.fill-label-aqua-04{fill:rgb(var(--label-aqua-04))}.fill-label-blue-04{fill:rgb(var(--label-blue-04))}.fill-label-green-04{fill:rgb(var(--label-green-04))}.fill-label-lime-04{fill:rgb(var(--label-lime-04))}.fill-label-orange-04{fill:rgb(var(--label-orange-04))}.fill-label-orchid-04{fill:rgb(var(--label-orchid-04))}.fill-label-violet-04{fill:rgb(var(--label-violet-04))}.fill-label-yellow-04{fill:rgb(var(--label-yellow-04))}.fill-tone-neutral-04{fill:rgb(var(--tone-neutral-04))}.text-label-amaranth-04{--tw-text-opacity:1;color:rgb(var(--label-amaranth-04) / var(--tw-text-opacity))}.text-label-aqua-04{--tw-text-opacity:1;color:rgb(var(--label-aqua-04) / var(--tw-text-opacity))}.text-label-blue-04{--tw-text-opacity:1;color:rgb(var(--label-blue-04) / var(--tw-text-opacity))}.text-label-green-04{--tw-text-opacity:1;color:rgb(var(--label-green-04) / var(--tw-text-opacity))}.text-label-lime-04{--tw-text-opacity:1;color:rgb(var(--label-lime-04) / var(--tw-text-opacity))}.text-label-orange-04{--tw-text-opacity:1;color:rgb(var(--label-orange-04) / var(--tw-text-opacity))}.text-label-orchid-04{--tw-text-opacity:1;color:rgb(var(--label-orchid-04) / var(--tw-text-opacity))}.text-label-violet-04{--tw-text-opacity:1;color:rgb(var(--label-violet-04) / var(--tw-text-opacity))}.text-label-yellow-04{--tw-text-opacity:1;color:rgb(var(--label-yellow-04) / var(--tw-text-opacity))}.text-tone-neutral-04{--tw-text-opacity:1;color:rgb(var(--tone-neutral-04) / var(--tw-text-opacity))}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-input-tip-active-translate:translate(0, 0);left:0.25rem;right:0.25rem;gap:0.25rem;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;pointer-events:none;position:absolute;-webkit-transform:var(--mds-input-tip-active-translate);transform:var(--mds-input-tip-active-translate)}:host(:empty){display:none}:host([position=\"top\"]){top:0.25rem}:host([position=\"bottom\"]){bottom:0.25rem}:host([position=\"top\"][active]:not([active=\"false\"])){--mds-input-tip-active-translate:translate(calc(0.25rem * -1), calc(0.25rem * -1))}:host([position=\"top\"][active]:not([active=\"false\"])) ::slotted(mds-input-tip-item){border-top-left-radius:0;border-top-right-radius:0}:host([position=\"bottom\"][active]:not([active=\"false\"])){--mds-input-tip-active-translate:translate(calc(0.25rem * -1), 0.25rem)}:host([position=\"bottom\"][active]:not([active=\"false\"])) ::slotted(mds-input-tip-item){border-bottom-left-radius:0;border-bottom-right-radius:0}";
|
8
|
+
|
9
|
+
const MdsInputTip = class {
|
10
|
+
constructor(hostRef) {
|
11
|
+
index.registerInstance(this, hostRef);
|
12
|
+
this.active = false;
|
13
|
+
this.position = 'top';
|
14
|
+
}
|
15
|
+
render() {
|
16
|
+
return (index.h(index.Host, null, index.h("slot", null)));
|
17
|
+
}
|
18
|
+
};
|
19
|
+
MdsInputTip.style = mdsInputTipCss;
|
20
|
+
|
21
|
+
exports.mds_input_tip = MdsInputTip;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-fe2df682.js');
|
6
|
+
|
7
|
+
/*
|
8
|
+
Stencil Client Patch Browser v4.10.0 | MIT Licensed | https://stenciljs.com
|
9
|
+
*/
|
10
|
+
const patchBrowser = () => {
|
11
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-input-tip.cjs.js', document.baseURI).href));
|
12
|
+
const opts = {};
|
13
|
+
if (importMeta !== '') {
|
14
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
15
|
+
}
|
16
|
+
return index.promiseResolve(opts);
|
17
|
+
};
|
18
|
+
|
19
|
+
patchBrowser().then(options => {
|
20
|
+
return index.bootstrapLazy([["mds-input-tip.cjs",[[1,"mds-input-tip",{"active":[516],"position":[513]}]]]], options);
|
21
|
+
});
|
22
|
+
|
23
|
+
exports.setNonce = index.setNonce;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
const hash = (s) => {
|
2
|
+
let i, h;
|
3
|
+
for (i = 0, h = 0; i < s.length; i++) {
|
4
|
+
h = Math.imul(31, h) + s.charCodeAt(i) | 0;
|
5
|
+
}
|
6
|
+
return h.toString();
|
7
|
+
};
|
8
|
+
const randomInt = (max) => Math.floor(Math.random() * max);
|
9
|
+
const unslugName = (name) => {
|
10
|
+
var _a, _b, _c;
|
11
|
+
return (_c = (_b = (_a = name.split('/')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.replace(/-/g, ' ')) !== null && _c !== void 0 ? _c : name;
|
12
|
+
};
|
13
|
+
const setAttributeIfEmpty = (element, attribute, value) => {
|
14
|
+
var _a;
|
15
|
+
if (element.hasAttribute(attribute)) {
|
16
|
+
return (_a = element.getAttribute(attribute)) !== null && _a !== void 0 ? _a : '';
|
17
|
+
}
|
18
|
+
element.setAttribute(attribute, value);
|
19
|
+
return value;
|
20
|
+
};
|
21
|
+
const hashValue = (value) => `${value}-${hash(value)}`;
|
22
|
+
const hashRandomValue = (value) => {
|
23
|
+
const randomValue = randomInt(1000000);
|
24
|
+
if (value) {
|
25
|
+
return `${value}-${hash(randomValue.toString())}`;
|
26
|
+
}
|
27
|
+
return hash(randomValue.toString());
|
28
|
+
};
|
29
|
+
export { unslugName, setAttributeIfEmpty, hashRandomValue, hashValue, };
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { fileExtensionsDictionary } from "../dictionary/file-extensions";
|
2
|
+
import { fileFormatsVariant } from "../type/variant-file-format";
|
3
|
+
const sanitizeFilename = (filename, error = 'Attribute "filename" is undefined.') => {
|
4
|
+
var _a;
|
5
|
+
if (filename === undefined) {
|
6
|
+
throw console.error(error);
|
7
|
+
}
|
8
|
+
if (filename.includes('/')) {
|
9
|
+
return (_a = filename.split('/').pop()) !== null && _a !== void 0 ? _a : '';
|
10
|
+
}
|
11
|
+
return filename;
|
12
|
+
};
|
13
|
+
const sanitizeSuffix = (rawFilename) => {
|
14
|
+
var _a;
|
15
|
+
const filename = sanitizeFilename(rawFilename);
|
16
|
+
if (filename.includes('.')) {
|
17
|
+
return (_a = filename.split('.').pop()) !== null && _a !== void 0 ? _a : '';
|
18
|
+
}
|
19
|
+
return filename;
|
20
|
+
};
|
21
|
+
const getName = (rawFilename) => {
|
22
|
+
var _a;
|
23
|
+
const filename = sanitizeFilename(rawFilename);
|
24
|
+
if (filename.includes('.')) {
|
25
|
+
return (_a = filename.split('.')[0]) !== null && _a !== void 0 ? _a : '';
|
26
|
+
}
|
27
|
+
return filename;
|
28
|
+
};
|
29
|
+
const getSuffix = (rawFilename, suffixOverride) => {
|
30
|
+
const suffix = sanitizeSuffix(rawFilename);
|
31
|
+
const filename = sanitizeFilename(rawFilename);
|
32
|
+
if (suffixOverride !== null && suffixOverride !== undefined) {
|
33
|
+
return suffixOverride.toLowerCase();
|
34
|
+
}
|
35
|
+
if (suffix !== filename) {
|
36
|
+
return suffix;
|
37
|
+
}
|
38
|
+
return 'default';
|
39
|
+
};
|
40
|
+
const getExtensionInfos = (rawFilename, suffixOverride) => {
|
41
|
+
var _a;
|
42
|
+
const suffix = getSuffix(rawFilename, suffixOverride).toLocaleLowerCase();
|
43
|
+
return (_a = fileExtensionsDictionary[suffix]) !== null && _a !== void 0 ? _a : fileExtensionsDictionary.default;
|
44
|
+
};
|
45
|
+
const getFormatsVariant = (rawFilename, suffixOverride) => {
|
46
|
+
return fileFormatsVariant[getExtensionInfos(rawFilename, suffixOverride).format];
|
47
|
+
};
|
48
|
+
export { getExtensionInfos, getFormatsVariant, getSuffix, getName, };
|
@@ -0,0 +1,15 @@
|
|
1
|
+
const BASE64_SVG_ICON = 'data:image/svg+xml;base64,';
|
2
|
+
const MARKUP_SVG_ICON = '<svg ';
|
3
|
+
const isIconFormatIsBase64 = (icon) => {
|
4
|
+
if (!icon) {
|
5
|
+
return false;
|
6
|
+
}
|
7
|
+
return icon.startsWith(BASE64_SVG_ICON);
|
8
|
+
};
|
9
|
+
const isIconFormatIsSVG = (icon) => {
|
10
|
+
if (!icon) {
|
11
|
+
return false;
|
12
|
+
}
|
13
|
+
return icon.startsWith(MARKUP_SVG_ICON);
|
14
|
+
};
|
15
|
+
export { isIconFormatIsBase64, isIconFormatIsSVG, BASE64_SVG_ICON, MARKUP_SVG_ICON, };
|
@@ -0,0 +1,45 @@
|
|
1
|
+
export class KeyboardManager {
|
2
|
+
constructor() {
|
3
|
+
this.elements = new Map();
|
4
|
+
this.handleClickBehaviorDispatchEvent = (event) => {
|
5
|
+
if (event.code === 'Enter' || event.code === 'NumpadEnter') {
|
6
|
+
event.target.click();
|
7
|
+
}
|
8
|
+
};
|
9
|
+
this.handleEscapeBehaviorDispatchEvent = (event) => {
|
10
|
+
if (event.code === 'Escape' && this.escapeCallback) {
|
11
|
+
this.escapeCallback();
|
12
|
+
}
|
13
|
+
};
|
14
|
+
this.addElement = (el, name = 'element') => {
|
15
|
+
if (!el) {
|
16
|
+
throw Error(`Passed an ${el} element parameter to KeyboardManager.addElement`);
|
17
|
+
}
|
18
|
+
this.elements.set(name, el);
|
19
|
+
};
|
20
|
+
this.removeElement = (name = 'element') => {
|
21
|
+
this.detachClickBehavior(name);
|
22
|
+
this.elements.delete(name);
|
23
|
+
};
|
24
|
+
this.attachClickBehavior = (name = 'element') => {
|
25
|
+
var _a;
|
26
|
+
(_a = this.elements.get(name)) === null || _a === void 0 ? void 0 : _a.addEventListener('keydown', this.handleClickBehaviorDispatchEvent);
|
27
|
+
};
|
28
|
+
this.detachClickBehavior = (name = 'element') => {
|
29
|
+
var _a;
|
30
|
+
(_a = this.elements.get(name)) === null || _a === void 0 ? void 0 : _a.removeEventListener('keydown', this.handleClickBehaviorDispatchEvent);
|
31
|
+
};
|
32
|
+
this.attachEscapeBehavior = (callback) => {
|
33
|
+
this.escapeCallback = callback;
|
34
|
+
if (window !== undefined) {
|
35
|
+
window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
36
|
+
}
|
37
|
+
};
|
38
|
+
this.detachEscapeBehavior = () => {
|
39
|
+
this.escapeCallback = () => { return; };
|
40
|
+
if (window !== undefined) {
|
41
|
+
window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
42
|
+
}
|
43
|
+
};
|
44
|
+
}
|
45
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
export class Locale {
|
2
|
+
constructor(configData) {
|
3
|
+
this.defaultLanguage = 'en';
|
4
|
+
this.lang = (element) => {
|
5
|
+
const closestElement = element.closest('[lang]');
|
6
|
+
if (closestElement) {
|
7
|
+
if (closestElement.lang) {
|
8
|
+
this.language = closestElement.lang;
|
9
|
+
return;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
this.language = this.defaultLanguage;
|
13
|
+
};
|
14
|
+
this.get = (tag) => {
|
15
|
+
var _a;
|
16
|
+
return (_a = this.config[this.language][tag]) !== null && _a !== void 0 ? _a : this.config[this.defaultLanguage][tag];
|
17
|
+
};
|
18
|
+
this.config = configData;
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
const cssDurationToMilliseconds = (duration, defaultValue = 1000) => {
|
2
|
+
if (duration.includes('ms')) {
|
3
|
+
return Number(duration.replace('ms', ''));
|
4
|
+
}
|
5
|
+
if (duration.includes('s')) {
|
6
|
+
return Number(duration.replace('s', '')) * 1000;
|
7
|
+
}
|
8
|
+
return defaultValue;
|
9
|
+
};
|
10
|
+
const cssSizeToNumber = (size, defaultValue = 0) => {
|
11
|
+
if (size.includes('px')) {
|
12
|
+
return Number(size.replace('px', ''));
|
13
|
+
}
|
14
|
+
if (size.includes('rem')) {
|
15
|
+
return Number(size.replace('rem', '')) * 16;
|
16
|
+
}
|
17
|
+
if (size.includes('em')) {
|
18
|
+
return Number(size.replace('em', '')) * 16;
|
19
|
+
}
|
20
|
+
return defaultValue;
|
21
|
+
};
|
22
|
+
export { cssDurationToMilliseconds, cssSizeToNumber, };
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { generator } from "./utils/prng";
|
2
|
+
import { strToCharCodeArray } from "./utils/string";
|
3
|
+
import { randomSign, minMaxLooped } from "./utils/math";
|
4
|
+
const rand = generator();
|
5
|
+
const random = (base, offset) => () => (base + rand.range(0, offset)) * randomSign();
|
6
|
+
export const generateRandomCharCodeArray = (base, offset) => str => strToCharCodeArray(str).map(random(base, offset));
|
7
|
+
export const charCodeArrayToString = ({ str, minCharCode, maxCharCode, placeholderChar, charStep, }) => charCodes => charCodes.reduce((acc, item, index) => {
|
8
|
+
if (item !== 0) {
|
9
|
+
if (Math.abs(item) > charStep) {
|
10
|
+
return acc + placeholderChar;
|
11
|
+
}
|
12
|
+
return (acc +
|
13
|
+
String.fromCharCode(minMaxLooped(minCharCode, maxCharCode)(str.charCodeAt(index) + item)));
|
14
|
+
}
|
15
|
+
return acc + str.charAt(index);
|
16
|
+
}, '');
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import { generateRandomCharCodeArray, charCodeArrayToString } from "./core";
|
2
|
+
import { noop } from "./utils/noop";
|
3
|
+
class RandomText {
|
4
|
+
constructor(options) {
|
5
|
+
this.start = () => {
|
6
|
+
const { frameOffset, charOffset, str, speed } = this;
|
7
|
+
const randoms = generateRandomCharCodeArray(frameOffset, charOffset)(str);
|
8
|
+
this.stop();
|
9
|
+
this.rafId = requestAnimationFrame(() => {
|
10
|
+
this.step(randoms, speed, speed);
|
11
|
+
});
|
12
|
+
};
|
13
|
+
Object.assign(this, Object.assign(Object.assign({}, RandomText.defaults), options));
|
14
|
+
}
|
15
|
+
stop() {
|
16
|
+
cancelAnimationFrame(this.rafId);
|
17
|
+
}
|
18
|
+
step(randoms, stepCount, speed) {
|
19
|
+
const { str, charStep, minCharCode, maxCharCode, placeholderChar, onProgress, onComplete, } = this;
|
20
|
+
const stepArray = randoms.slice(0, stepCount);
|
21
|
+
const steppedArray = stepArray.map(item => {
|
22
|
+
if (item > 0)
|
23
|
+
return item - 1;
|
24
|
+
if (item < 0)
|
25
|
+
return item + 1;
|
26
|
+
return 0;
|
27
|
+
});
|
28
|
+
const output = charCodeArrayToString({
|
29
|
+
str,
|
30
|
+
minCharCode,
|
31
|
+
maxCharCode,
|
32
|
+
placeholderChar,
|
33
|
+
charStep,
|
34
|
+
})(steppedArray);
|
35
|
+
const updatedRandoms = [...steppedArray, ...randoms.slice(stepCount)];
|
36
|
+
onProgress(output);
|
37
|
+
if (output !== str) {
|
38
|
+
this.rafId = requestAnimationFrame(() => {
|
39
|
+
this.step(updatedRandoms, stepCount + speed, speed);
|
40
|
+
});
|
41
|
+
}
|
42
|
+
else {
|
43
|
+
onComplete(output);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
RandomText.defaults = {
|
48
|
+
str: '',
|
49
|
+
speed: 2,
|
50
|
+
placeholderChar: '_',
|
51
|
+
frameOffset: 30,
|
52
|
+
charOffset: 20,
|
53
|
+
charStep: 10,
|
54
|
+
minCharCode: 32,
|
55
|
+
maxCharCode: 122,
|
56
|
+
onProgress: noop,
|
57
|
+
onComplete: noop,
|
58
|
+
};
|
59
|
+
export default RandomText;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { generator } from "./prng";
|
2
|
+
const rand = generator();
|
3
|
+
export const randomSign = () => (Math.round(Math.random()) - 0.5) * 2;
|
4
|
+
export const generateRandomNumbers = base => charOffset => length => [...Array(length)].map(() => (base + rand.range(0, charOffset)) * randomSign());
|
5
|
+
export const minMaxLooped = (min, max) => value => {
|
6
|
+
if (value > max)
|
7
|
+
return min + (value - max);
|
8
|
+
if (value < min)
|
9
|
+
return max + (value - min);
|
10
|
+
return value;
|
11
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export const noop = () => { };
|
@@ -0,0 +1,21 @@
|
|
1
|
+
const int32 = 2147483647;
|
2
|
+
const gen = v => (v * 16807) % int32;
|
3
|
+
const randomFloat = v => gen(v) / int32;
|
4
|
+
const randomInt = v => gen(v);
|
5
|
+
export const generator = (seed = 1) => {
|
6
|
+
let value = seed < 1 ? 1 : seed;
|
7
|
+
const next = () => {
|
8
|
+
value = randomInt(value);
|
9
|
+
return value;
|
10
|
+
};
|
11
|
+
return {
|
12
|
+
random: () => next(),
|
13
|
+
randomFloat: () => randomFloat(next()),
|
14
|
+
range: (min, max) => {
|
15
|
+
const minimum = min - 0.4999;
|
16
|
+
const maximum = max + 0.4999;
|
17
|
+
return Math.round(minimum + (maximum - minimum) * randomFloat(next()));
|
18
|
+
},
|
19
|
+
rangeFloat: (min, max) => min + (max - min) * randomFloat(next()),
|
20
|
+
};
|
21
|
+
};
|
@@ -0,0 +1,280 @@
|
|
1
|
+
.static {
|
2
|
+
|
3
|
+
position: static;
|
4
|
+
}
|
5
|
+
|
6
|
+
.fixed {
|
7
|
+
|
8
|
+
position: fixed;
|
9
|
+
}
|
10
|
+
|
11
|
+
.absolute {
|
12
|
+
|
13
|
+
position: absolute;
|
14
|
+
}
|
15
|
+
|
16
|
+
.relative {
|
17
|
+
|
18
|
+
position: relative;
|
19
|
+
}
|
20
|
+
|
21
|
+
.border {
|
22
|
+
|
23
|
+
border-width: 1px;
|
24
|
+
}
|
25
|
+
|
26
|
+
.bg-label-amaranth-10 {
|
27
|
+
|
28
|
+
--tw-bg-opacity: 1;
|
29
|
+
|
30
|
+
background-color: rgb(var(--label-amaranth-10) / var(--tw-bg-opacity));
|
31
|
+
}
|
32
|
+
|
33
|
+
.bg-label-aqua-10 {
|
34
|
+
|
35
|
+
--tw-bg-opacity: 1;
|
36
|
+
|
37
|
+
background-color: rgb(var(--label-aqua-10) / var(--tw-bg-opacity));
|
38
|
+
}
|
39
|
+
|
40
|
+
.bg-label-blue-10 {
|
41
|
+
|
42
|
+
--tw-bg-opacity: 1;
|
43
|
+
|
44
|
+
background-color: rgb(var(--label-blue-10) / var(--tw-bg-opacity));
|
45
|
+
}
|
46
|
+
|
47
|
+
.bg-label-green-10 {
|
48
|
+
|
49
|
+
--tw-bg-opacity: 1;
|
50
|
+
|
51
|
+
background-color: rgb(var(--label-green-10) / var(--tw-bg-opacity));
|
52
|
+
}
|
53
|
+
|
54
|
+
.bg-label-lime-10 {
|
55
|
+
|
56
|
+
--tw-bg-opacity: 1;
|
57
|
+
|
58
|
+
background-color: rgb(var(--label-lime-10) / var(--tw-bg-opacity));
|
59
|
+
}
|
60
|
+
|
61
|
+
.bg-label-orange-10 {
|
62
|
+
|
63
|
+
--tw-bg-opacity: 1;
|
64
|
+
|
65
|
+
background-color: rgb(var(--label-orange-10) / var(--tw-bg-opacity));
|
66
|
+
}
|
67
|
+
|
68
|
+
.bg-label-orchid-10 {
|
69
|
+
|
70
|
+
--tw-bg-opacity: 1;
|
71
|
+
|
72
|
+
background-color: rgb(var(--label-orchid-10) / var(--tw-bg-opacity));
|
73
|
+
}
|
74
|
+
|
75
|
+
.bg-label-violet-10 {
|
76
|
+
|
77
|
+
--tw-bg-opacity: 1;
|
78
|
+
|
79
|
+
background-color: rgb(var(--label-violet-10) / var(--tw-bg-opacity));
|
80
|
+
}
|
81
|
+
|
82
|
+
.bg-label-yellow-10 {
|
83
|
+
|
84
|
+
--tw-bg-opacity: 1;
|
85
|
+
|
86
|
+
background-color: rgb(var(--label-yellow-10) / var(--tw-bg-opacity));
|
87
|
+
}
|
88
|
+
|
89
|
+
.bg-tone-neutral-10 {
|
90
|
+
|
91
|
+
--tw-bg-opacity: 1;
|
92
|
+
|
93
|
+
background-color: rgb(var(--tone-neutral-10) / var(--tw-bg-opacity));
|
94
|
+
}
|
95
|
+
|
96
|
+
.fill-label-amaranth-04 {
|
97
|
+
|
98
|
+
fill: rgb(var(--label-amaranth-04));
|
99
|
+
}
|
100
|
+
|
101
|
+
.fill-label-aqua-04 {
|
102
|
+
|
103
|
+
fill: rgb(var(--label-aqua-04));
|
104
|
+
}
|
105
|
+
|
106
|
+
.fill-label-blue-04 {
|
107
|
+
|
108
|
+
fill: rgb(var(--label-blue-04));
|
109
|
+
}
|
110
|
+
|
111
|
+
.fill-label-green-04 {
|
112
|
+
|
113
|
+
fill: rgb(var(--label-green-04));
|
114
|
+
}
|
115
|
+
|
116
|
+
.fill-label-lime-04 {
|
117
|
+
|
118
|
+
fill: rgb(var(--label-lime-04));
|
119
|
+
}
|
120
|
+
|
121
|
+
.fill-label-orange-04 {
|
122
|
+
|
123
|
+
fill: rgb(var(--label-orange-04));
|
124
|
+
}
|
125
|
+
|
126
|
+
.fill-label-orchid-04 {
|
127
|
+
|
128
|
+
fill: rgb(var(--label-orchid-04));
|
129
|
+
}
|
130
|
+
|
131
|
+
.fill-label-violet-04 {
|
132
|
+
|
133
|
+
fill: rgb(var(--label-violet-04));
|
134
|
+
}
|
135
|
+
|
136
|
+
.fill-label-yellow-04 {
|
137
|
+
|
138
|
+
fill: rgb(var(--label-yellow-04));
|
139
|
+
}
|
140
|
+
|
141
|
+
.fill-tone-neutral-04 {
|
142
|
+
|
143
|
+
fill: rgb(var(--tone-neutral-04));
|
144
|
+
}
|
145
|
+
|
146
|
+
.text-label-amaranth-04 {
|
147
|
+
|
148
|
+
--tw-text-opacity: 1;
|
149
|
+
|
150
|
+
color: rgb(var(--label-amaranth-04) / var(--tw-text-opacity));
|
151
|
+
}
|
152
|
+
|
153
|
+
.text-label-aqua-04 {
|
154
|
+
|
155
|
+
--tw-text-opacity: 1;
|
156
|
+
|
157
|
+
color: rgb(var(--label-aqua-04) / var(--tw-text-opacity));
|
158
|
+
}
|
159
|
+
|
160
|
+
.text-label-blue-04 {
|
161
|
+
|
162
|
+
--tw-text-opacity: 1;
|
163
|
+
|
164
|
+
color: rgb(var(--label-blue-04) / var(--tw-text-opacity));
|
165
|
+
}
|
166
|
+
|
167
|
+
.text-label-green-04 {
|
168
|
+
|
169
|
+
--tw-text-opacity: 1;
|
170
|
+
|
171
|
+
color: rgb(var(--label-green-04) / var(--tw-text-opacity));
|
172
|
+
}
|
173
|
+
|
174
|
+
.text-label-lime-04 {
|
175
|
+
|
176
|
+
--tw-text-opacity: 1;
|
177
|
+
|
178
|
+
color: rgb(var(--label-lime-04) / var(--tw-text-opacity));
|
179
|
+
}
|
180
|
+
|
181
|
+
.text-label-orange-04 {
|
182
|
+
|
183
|
+
--tw-text-opacity: 1;
|
184
|
+
|
185
|
+
color: rgb(var(--label-orange-04) / var(--tw-text-opacity));
|
186
|
+
}
|
187
|
+
|
188
|
+
.text-label-orchid-04 {
|
189
|
+
|
190
|
+
--tw-text-opacity: 1;
|
191
|
+
|
192
|
+
color: rgb(var(--label-orchid-04) / var(--tw-text-opacity));
|
193
|
+
}
|
194
|
+
|
195
|
+
.text-label-violet-04 {
|
196
|
+
|
197
|
+
--tw-text-opacity: 1;
|
198
|
+
|
199
|
+
color: rgb(var(--label-violet-04) / var(--tw-text-opacity));
|
200
|
+
}
|
201
|
+
|
202
|
+
.text-label-yellow-04 {
|
203
|
+
|
204
|
+
--tw-text-opacity: 1;
|
205
|
+
|
206
|
+
color: rgb(var(--label-yellow-04) / var(--tw-text-opacity));
|
207
|
+
}
|
208
|
+
|
209
|
+
.text-tone-neutral-04 {
|
210
|
+
|
211
|
+
--tw-text-opacity: 1;
|
212
|
+
|
213
|
+
color: rgb(var(--tone-neutral-04) / var(--tw-text-opacity));
|
214
|
+
}
|
215
|
+
|
216
|
+
.shadow {
|
217
|
+
|
218
|
+
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
219
|
+
|
220
|
+
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
221
|
+
|
222
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
223
|
+
}
|
224
|
+
|
225
|
+
:host {
|
226
|
+
|
227
|
+
--mds-input-tip-active-translate: translate(0, 0);
|
228
|
+
|
229
|
+
left: 0.25rem;
|
230
|
+
|
231
|
+
right: 0.25rem;
|
232
|
+
|
233
|
+
gap: 0.25rem;
|
234
|
+
|
235
|
+
transition-property: background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;
|
236
|
+
|
237
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
238
|
+
|
239
|
+
transition-duration: 300ms;
|
240
|
+
|
241
|
+
transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
|
242
|
+
|
243
|
+
display: flex;
|
244
|
+
justify-content: flex-end;
|
245
|
+
pointer-events: none;
|
246
|
+
position: absolute;
|
247
|
+
transform: var(--mds-input-tip-active-translate);
|
248
|
+
}
|
249
|
+
|
250
|
+
:host ( :empty ) {
|
251
|
+
display: none;
|
252
|
+
}
|
253
|
+
|
254
|
+
:host ( [position="top"] ) {
|
255
|
+
top: 0.25rem;
|
256
|
+
}
|
257
|
+
|
258
|
+
:host ( [position="bottom"] ) {
|
259
|
+
bottom: 0.25rem;
|
260
|
+
}
|
261
|
+
|
262
|
+
:host ( [position="top"][active]:not([active="false"]) ) {
|
263
|
+
|
264
|
+
--mds-input-tip-active-translate: translate(calc(0.25rem * -1), calc(0.25rem * -1));
|
265
|
+
}
|
266
|
+
|
267
|
+
:host( [position="top"][active]:not([active="false"]) ) ::slotted( mds-input-tip-item ) {
|
268
|
+
border-top-left-radius: 0;
|
269
|
+
border-top-right-radius: 0;
|
270
|
+
}
|
271
|
+
|
272
|
+
:host ( [position="bottom"][active]:not([active="false"]) ) {
|
273
|
+
|
274
|
+
--mds-input-tip-active-translate: translate(calc(0.25rem * -1), 0.25rem);
|
275
|
+
}
|
276
|
+
|
277
|
+
:host( [position="bottom"][active]:not([active="false"]) ) ::slotted( mds-input-tip-item ) {
|
278
|
+
border-bottom-left-radius: 0;
|
279
|
+
border-bottom-right-radius: 0;
|
280
|
+
}
|