@maggioli-design-system/mds-input-range 1.0.1
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/index-5f49298d.js +1790 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/mds-input-range.cjs.entry.js +81 -0
- package/dist/cjs/mds-input-range.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/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-range/mds-input-range.css +280 -0
- package/dist/collection/components/mds-input-range/mds-input-range.js +182 -0
- package/dist/collection/components/mds-input-range/test/mds-input-range.e2e.js +10 -0
- package/dist/collection/components/mds-input-range/test/mds-input-range.stories.js +40 -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-range.d.ts +11 -0
- package/dist/components/mds-input-range.js +100 -0
- package/dist/documentation.d.ts +401 -0
- package/dist/documentation.json +158 -0
- package/dist/esm/index-1ed4544f.js +1761 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +9 -0
- package/dist/esm/mds-input-range.entry.js +77 -0
- package/dist/esm/mds-input-range.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-1ed4544f.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-range.entry.js +1 -0
- package/dist/esm-es5/mds-input-range.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/mds-input-range/index.esm.js +0 -0
- package/dist/mds-input-range/mds-input-range.esm.js +1 -0
- package/dist/mds-input-range/mds-input-range.js +127 -0
- package/dist/mds-input-range/p-1afe8cf0.system.entry.js +1 -0
- package/dist/mds-input-range/p-50ea2036.system.js +1 -0
- package/dist/mds-input-range/p-5dcf9ad8.js +2 -0
- package/dist/mds-input-range/p-7a418e68.system.js +1 -0
- package/dist/mds-input-range/p-c87cd964.entry.js +1 -0
- package/dist/mds-input-range/p-e5d9d1a5.system.js +2 -0
- package/dist/stats.json +669 -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/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-range/mds-input-range.d.ts +36 -0
- package/dist/types/components/mds-input-range/test/mds-input-range.stories.d.ts +39 -0
- package/dist/types/components.d.ts +88 -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 +596 -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 +49 -0
- package/readme.md +53 -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/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-range/.gitlab-ci.yml +25 -0
- package/src/components/mds-input-range/mds-input-range.css +109 -0
- package/src/components/mds-input-range/mds-input-range.tsx +117 -0
- package/src/components/mds-input-range/readme.md +38 -0
- package/src/components/mds-input-range/test/mds-input-range.e2e.ts +12 -0
- package/src/components/mds-input-range/test/mds-input-range.stories.tsx +50 -0
- package/src/components.d.ts +88 -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 +332 -0
- package/src/fixtures/iconsauce.json +253 -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-range.esm.js +1 -0
- package/www/build/mds-input-range.js +127 -0
- package/www/build/p-1afe8cf0.system.entry.js +1 -0
- package/www/build/p-50ea2036.system.js +1 -0
- package/www/build/p-5dcf9ad8.js +2 -0
- package/www/build/p-7a418e68.system.js +1 -0
- package/www/build/p-c87cd964.entry.js +1 -0
- package/www/build/p-e5d9d1a5.system.js +2 -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-5f49298d.js');
|
|
6
|
+
|
|
7
|
+
const defineCustomElements = (win, options) => {
|
|
8
|
+
if (typeof window === 'undefined') return undefined;
|
|
9
|
+
return index.bootstrapLazy([["mds-input-range.cjs",[[65,"mds-input-range",{"max":[2],"min":[2],"step":[2],"value":[1538],"progress":[32]},null,{"value":["valueChanged"],"min":["minChanged"],"max":["maxChanged"],"step":["stepChanged"]}]]]], options);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.setNonce = index.setNonce;
|
|
13
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-5f49298d.js');
|
|
6
|
+
|
|
7
|
+
const mdsInputRangeCss = "@-webkit-keyframes focus-bounce{0%,75%,100%{outline-offset:var(--magma-outline-focus-offset, 6px)}50%{outline-offset:var(--magma-outline-blur-offset, 2px)}}@keyframes focus-bounce{0%,75%,100%{outline-offset:var(--magma-outline-focus-offset, 6px)}50%{outline-offset:var(--magma-outline-blur-offset, 2px)}}@tailwind components; .svg{display:-ms-flexbox;display:flex}.svg svg{aspect-ratio:1/1;height:100%;width:100%}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.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-range-thumb-size:1rem;--mds-input-range-thumb-background:rgb(var(--brand-maggioli-03));--mds-input-range-track-background:rgb(var(--tone-neutral-09));--mds-input-range-track-size:0.5rem;--mds-input-range-track-progress-background:var(--mds-input-range-thumb-background);gap:0.25rem;display:grid}.header{gap:0.5rem;display:-ms-flexbox;display:flex}.label{min-width:0rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.value{margin-left:auto}.range{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;height:var(--mds-input-range-thumb-size);position:relative}.track{width:100%;--margin:calc(var(--mds-input-range-track-size) / 2);-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 var(--margin);position:absolute}.field{-webkit-animation-duration:var(--magma-outline-animation-duration, 1s);animation-duration:var(--magma-outline-animation-duration, 1s);-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:focus-bounce;animation-name:focus-bounce;-webkit-animation-play-state:paused;animation-play-state:paused;-webkit-animation-timing-function:cubic-bezier(0, 0, 0.2, 1);animation-timing-function:cubic-bezier(0, 0, 0.2, 1);outline:var(--magma-outline-blur);-webkit-transition-duration:200ms;transition-duration:200ms;-webkit-transition-property:background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform;transition-property:background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out}.field:focus-visible{--magma-outline-blur:var(--magma-outline-focus);-webkit-animation-play-state:running;animation-play-state:running}.field{z-index:20;height:1rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border-radius:1000px;-ms-flex-positive:1;flex-grow:1;margin:0}.field:focus-visible{--magma-outline-blur:var(--magma-outline-focus);-webkit-animation-play-state:running;animation-play-state:running}.field::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:var(--mds-input-range-thumb-background);border:0;border-radius:var(--mds-input-range-thumb-size);cursor:pointer;height:var(--mds-input-range-thumb-size);line-height:0;-webkit-transform:translate(0, -50%);transform:translate(0, -50%);width:var(--mds-input-range-thumb-size)}.field::-webkit-slider-runnable-track{-webkit-appearance:none;appearance:none;border:0;height:0;width:100%}.track-progress{background-color:var(--mds-input-range-track-progress-background);display:-ms-flexbox;display:flex;height:var(--mds-input-range-track-size)}.track-total{background-color:var(--mds-input-range-track-background);border-radius:var(--mds-input-range-track-size);display:-ms-flexbox;display:flex;height:var(--mds-input-range-track-size);overflow:hidden;width:100%}";
|
|
8
|
+
|
|
9
|
+
const MdsInputRange = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.changeEvent = index.createEvent(this, "mdsInputRangeChange", 7);
|
|
13
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
14
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
18
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
19
|
+
}
|
|
20
|
+
this.onInput = () => {
|
|
21
|
+
// trigger valueChanged that update progress and emit event
|
|
22
|
+
this.value = parseInt(this.inputElement.value);
|
|
23
|
+
};
|
|
24
|
+
this.progress = undefined;
|
|
25
|
+
this.max = 100;
|
|
26
|
+
this.min = 0;
|
|
27
|
+
this.step = 1;
|
|
28
|
+
this.value = undefined;
|
|
29
|
+
}
|
|
30
|
+
calculateProgress() {
|
|
31
|
+
// validate value
|
|
32
|
+
let v = parseInt(this.inputElement.value);
|
|
33
|
+
if (v > this.max)
|
|
34
|
+
v = this.max;
|
|
35
|
+
else if (v < this.min)
|
|
36
|
+
v = this.min;
|
|
37
|
+
if ((v - this.min) % (this.step) !== 0)
|
|
38
|
+
v = Math.round(v / this.step) * this.step - this.min;
|
|
39
|
+
this.value = v;
|
|
40
|
+
this.internals.setFormValue(this.value.toString());
|
|
41
|
+
const total = this.max - this.min;
|
|
42
|
+
const current = this.value - this.min;
|
|
43
|
+
this.progress = current * 100 / total;
|
|
44
|
+
}
|
|
45
|
+
valueChanged() {
|
|
46
|
+
this.inputElement.value = this.value.toString();
|
|
47
|
+
this.calculateProgress();
|
|
48
|
+
this.changeEvent.emit(this.value);
|
|
49
|
+
}
|
|
50
|
+
minChanged() {
|
|
51
|
+
this.calculateProgress();
|
|
52
|
+
}
|
|
53
|
+
maxChanged() {
|
|
54
|
+
this.calculateProgress();
|
|
55
|
+
}
|
|
56
|
+
stepChanged() {
|
|
57
|
+
if (this.step < 1)
|
|
58
|
+
throw Error('step cant be negative or zero');
|
|
59
|
+
this.calculateProgress();
|
|
60
|
+
}
|
|
61
|
+
componentDidLoad() {
|
|
62
|
+
var _a;
|
|
63
|
+
this.inputElement = (_a = this.element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.field');
|
|
64
|
+
this.value = parseInt(this.inputElement.value);
|
|
65
|
+
this.calculateProgress();
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
return (index.h(index.Host, null, index.h("header", { class: "header" }, index.h("mds-text", { class: "label", typography: "label" }, index.h("slot", null)), index.h("mds-text", { class: "value", typography: "label" }, this.value)), index.h("div", { class: "range" }, index.h("div", { class: "track" }, index.h("div", { class: "track-total" }, index.h("div", { class: "track-progress", style: { width: `${this.progress}%` } }))), index.h("input", { class: "field", max: this.max, min: this.min, onInput: this.onInput, step: this.step, type: "range", value: this.value }))));
|
|
69
|
+
}
|
|
70
|
+
static get formAssociated() { return true; }
|
|
71
|
+
get element() { return index.getElement(this); }
|
|
72
|
+
static get watchers() { return {
|
|
73
|
+
"value": ["valueChanged"],
|
|
74
|
+
"min": ["minChanged"],
|
|
75
|
+
"max": ["maxChanged"],
|
|
76
|
+
"step": ["stepChanged"]
|
|
77
|
+
}; }
|
|
78
|
+
};
|
|
79
|
+
MdsInputRange.style = mdsInputRangeCss;
|
|
80
|
+
|
|
81
|
+
exports.mds_input_range = MdsInputRange;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-5f49298d.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-range.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-range.cjs",[[65,"mds-input-range",{"max":[2],"min":[2],"step":[2],"value":[1538],"progress":[32]},null,{"value":["valueChanged"],"min":["minChanged"],"max":["maxChanged"],"step":["stepChanged"]}]]]], 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,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
|
+
};
|