@maggioli-design-system/mds-input-range 2.0.1 → 2.1.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.
Files changed (91) hide show
  1. package/dist/cjs/{index-f984e289.js → index-27635fed.js} +171 -73
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/mds-input-range.cjs.entry.js +30 -8
  4. package/dist/cjs/mds-input-range.cjs.js +3 -3
  5. package/dist/collection/collection-manifest.json +1 -1
  6. package/dist/collection/common/floating-controller.js +180 -0
  7. package/dist/collection/common/slot.js +19 -0
  8. package/dist/collection/components/mds-input-range/mds-input-range.css +22 -2
  9. package/dist/collection/components/mds-input-range/mds-input-range.js +57 -6
  10. package/dist/collection/components/mds-input-range/test/mds-input-range.stories.js +8 -0
  11. package/dist/collection/dictionary/animation.js +5 -0
  12. package/dist/collection/dictionary/file-extensions.js +6 -59
  13. package/dist/collection/dictionary/tree.js +13 -0
  14. package/dist/collection/fixtures/filenames.js +62 -1
  15. package/dist/collection/type/animation.js +1 -0
  16. package/dist/collection/type/tree.js +1 -0
  17. package/dist/collection/type/variant-file-format.js +5 -0
  18. package/dist/components/mds-input-range.js +31 -7
  19. package/dist/documentation.d.ts +8 -0
  20. package/dist/documentation.json +40 -6
  21. package/dist/esm/{index-e0ac0a55.js → index-c0c11860.js} +171 -73
  22. package/dist/esm/loader.js +3 -3
  23. package/dist/esm/mds-input-range.entry.js +30 -8
  24. package/dist/esm/mds-input-range.js +4 -4
  25. package/dist/esm-es5/index-c0c11860.js +1 -0
  26. package/dist/esm-es5/loader.js +1 -1
  27. package/dist/esm-es5/mds-input-range.entry.js +1 -1
  28. package/dist/esm-es5/mds-input-range.js +1 -1
  29. package/dist/mds-input-range/mds-input-range.esm.js +1 -1
  30. package/dist/mds-input-range/mds-input-range.js +1 -1
  31. package/dist/mds-input-range/p-16118dde.system.entry.js +1 -0
  32. package/dist/mds-input-range/p-71d27af5.system.js +2 -0
  33. package/dist/mds-input-range/p-7a612415.system.js +1 -0
  34. package/dist/mds-input-range/p-8951c4d3.entry.js +1 -0
  35. package/dist/mds-input-range/p-dd7b28fc.js +2 -0
  36. package/dist/stats.json +120 -41
  37. package/dist/types/common/floating-controller.d.ts +46 -0
  38. package/dist/types/common/slot.d.ts +3 -0
  39. package/dist/types/components/mds-input-range/mds-input-range.d.ts +6 -0
  40. package/dist/types/components/mds-input-range/test/mds-input-range.stories.d.ts +7 -0
  41. package/dist/types/components.d.ts +8 -0
  42. package/dist/types/dictionary/animation.d.ts +2 -0
  43. package/dist/types/dictionary/tree.d.ts +4 -0
  44. package/dist/types/fixtures/filenames.d.ts +62 -1
  45. package/dist/types/type/animation.d.ts +1 -0
  46. package/dist/types/type/file-types.d.ts +1 -1
  47. package/dist/types/type/tree.d.ts +3 -0
  48. package/dist/types/type/variant-file-format.d.ts +1 -1
  49. package/documentation.json +81 -17
  50. package/package.json +4 -4
  51. package/readme.md +7 -6
  52. package/src/common/floating-controller.ts +263 -0
  53. package/src/common/slot.ts +24 -0
  54. package/src/components/mds-input-range/css/mds-input-range-disabled.css +9 -0
  55. package/src/components/mds-input-range/mds-input-range.css +12 -2
  56. package/src/components/mds-input-range/mds-input-range.tsx +23 -0
  57. package/src/components/mds-input-range/readme.md +7 -6
  58. package/src/components/mds-input-range/test/mds-input-range.stories.tsx +9 -0
  59. package/src/components.d.ts +8 -0
  60. package/src/dictionary/animation.ts +8 -0
  61. package/src/dictionary/file-extensions.ts +6 -60
  62. package/src/dictionary/tree.ts +21 -0
  63. package/src/fixtures/filenames.ts +63 -0
  64. package/src/fixtures/icons.json +21 -0
  65. package/src/fixtures/iconsauce.json +6 -0
  66. package/src/meta/file-format/locale.el.json +26 -21
  67. package/src/meta/file-format/locale.en.json +26 -21
  68. package/src/meta/file-format/locale.es.json +26 -21
  69. package/src/meta/file-format/locale.it.json +26 -21
  70. package/src/type/animation.ts +3 -0
  71. package/src/type/file-types.ts +6 -0
  72. package/src/type/tree.ts +12 -0
  73. package/src/type/variant-file-format.ts +6 -0
  74. package/www/build/mds-input-range.esm.js +1 -1
  75. package/www/build/mds-input-range.js +1 -1
  76. package/www/build/p-16118dde.system.entry.js +1 -0
  77. package/www/build/p-71d27af5.system.js +2 -0
  78. package/www/build/p-7a612415.system.js +1 -0
  79. package/www/build/p-8951c4d3.entry.js +1 -0
  80. package/www/build/p-dd7b28fc.js +2 -0
  81. package/dist/esm-es5/index-e0ac0a55.js +0 -1
  82. package/dist/mds-input-range/p-48fdc5db.system.entry.js +0 -1
  83. package/dist/mds-input-range/p-4e0b934e.system.js +0 -2
  84. package/dist/mds-input-range/p-76412b19.system.js +0 -1
  85. package/dist/mds-input-range/p-d697edb0.entry.js +0 -1
  86. package/dist/mds-input-range/p-f6cc8c2e.js +0 -2
  87. package/www/build/p-48fdc5db.system.entry.js +0 -1
  88. package/www/build/p-4e0b934e.system.js +0 -2
  89. package/www/build/p-76412b19.system.js +0 -1
  90. package/www/build/p-d697edb0.entry.js +0 -1
  91. package/www/build/p-f6cc8c2e.js +0 -2
@@ -0,0 +1,180 @@
1
+ import { arrow, autoPlacement, autoUpdate, computePosition, flip, offset, shift, } from "@floating-ui/dom";
2
+ import { cssDurationToMilliseconds } from "./unit";
3
+ import { setAttributeIfEmpty } from "./aria";
4
+ export class FloatingController {
5
+ constructor(host, arrowEl) {
6
+ this.arrowInset = (middleware, arrowPosition) => {
7
+ const { arrow } = middleware;
8
+ const inset = { bottom: '', left: '', right: '', top: '' };
9
+ if (arrow === undefined) {
10
+ return {};
11
+ }
12
+ switch (arrowPosition) {
13
+ case 'bottom':
14
+ inset.left = arrow.x !== null ? `${arrow.x}px` : '';
15
+ inset.top = '100%';
16
+ break;
17
+ case 'left':
18
+ inset.right = '100%';
19
+ inset.top = arrow.y !== null ? `${arrow.y}px` : '';
20
+ break;
21
+ case 'right':
22
+ inset.left = '100%';
23
+ inset.top = arrow.y !== null ? `${arrow.y}px` : '';
24
+ break;
25
+ case 'top':
26
+ inset.left = arrow.x !== null ? `${arrow.x}px` : '';
27
+ inset.top = '';
28
+ break;
29
+ default:
30
+ break;
31
+ }
32
+ return inset;
33
+ };
34
+ this.arrowTransform = (arrowPosition) => {
35
+ let transformProps = this._host.arrow && this._host.visible ? 'scale(1)' : 'scale(0)';
36
+ switch (arrowPosition) {
37
+ case 'bottom':
38
+ transformProps = `rotate(180deg) ${transformProps} translate(0, -100%)`;
39
+ break;
40
+ case 'left':
41
+ transformProps = `rotate(-90deg) ${transformProps} translate(50%, -50%)`;
42
+ break;
43
+ case 'right':
44
+ transformProps = `rotate(90deg) ${transformProps} translate(-50%, -50%)`;
45
+ break;
46
+ case 'top':
47
+ transformProps = `rotate(0deg) ${transformProps} translate(0, 0)`;
48
+ break;
49
+ default:
50
+ break;
51
+ }
52
+ return { transform: transformProps };
53
+ };
54
+ this.arrowTransformOrigin = (arrowPosition) => {
55
+ switch (arrowPosition) {
56
+ case 'bottom':
57
+ return { transformOrigin: 'center top' };
58
+ case 'left':
59
+ return { transformOrigin: 'right center' };
60
+ case 'right':
61
+ return { transformOrigin: 'left center' };
62
+ case 'top':
63
+ return { transformOrigin: 'center bottom' };
64
+ default:
65
+ return { transformOrigin: 'center top' };
66
+ }
67
+ };
68
+ this.calculatePosition = () => {
69
+ if (!this._caller)
70
+ return;
71
+ const middleware = new Array();
72
+ const config = {};
73
+ if (this._host.shiftPadding) {
74
+ config.padding = this._host.shiftPadding;
75
+ }
76
+ if (this._host.autoPlacement) {
77
+ middleware.push(autoPlacement());
78
+ }
79
+ if (this._host.offset) {
80
+ middleware.push(offset(this._host.offset));
81
+ }
82
+ if (!this._host.autoPlacement && this._host.flip) {
83
+ middleware.push(flip(config));
84
+ }
85
+ if (this._host.shift) {
86
+ middleware.push(shift(config));
87
+ }
88
+ if (this.arrowEl && this._host.arrow) {
89
+ middleware.push(arrow({
90
+ element: this.arrowEl,
91
+ padding: this._host.arrowPadding,
92
+ }));
93
+ }
94
+ computePosition(this._caller, this._host, {
95
+ middleware,
96
+ placement: this._host.placement,
97
+ strategy: this._host.strategy,
98
+ }).then(({ x, y, placement, middlewareData }) => {
99
+ Object.assign(this._host.style, {
100
+ left: `${x}px`,
101
+ top: `${y}px`,
102
+ });
103
+ const arrowStyle = {};
104
+ const arrowPosition = {
105
+ top: 'bottom',
106
+ right: 'left',
107
+ bottom: 'top',
108
+ left: 'right',
109
+ }[placement.split('-')[0]];
110
+ if (arrowPosition && this.arrowEl) {
111
+ Object.assign(arrowStyle, this.arrowTransform(arrowPosition));
112
+ Object.assign(arrowStyle, this.arrowInset(middlewareData, arrowPosition));
113
+ Object.assign(arrowStyle, this.arrowTransformOrigin(arrowPosition));
114
+ Object.assign(this.arrowEl.style, arrowStyle);
115
+ }
116
+ });
117
+ };
118
+ this._host = host;
119
+ this.arrowEl = arrowEl;
120
+ }
121
+ updateCaller(target) {
122
+ var _a, _b, _c;
123
+ // search caller in document or rootNode of host (if target is in shadowDOM)
124
+ const caller = (_c = (_b = (_a = this._host.parentElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector(target)) !== null && _c !== void 0 ? _c : this._host.getRootNode().querySelector(target);
125
+ if (!caller) {
126
+ throw Error(`Target not found: ${target}`);
127
+ }
128
+ this._caller = caller;
129
+ setAttributeIfEmpty(this._caller, 'aria-haspopup', 'true');
130
+ setAttributeIfEmpty(this._caller, 'aria-controls', target);
131
+ setAttributeIfEmpty(this._host, 'role', 'menu');
132
+ setAttributeIfEmpty(this._host, 'aria-labelledby', target);
133
+ return caller;
134
+ }
135
+ updatePosition() {
136
+ if (this.cleanupAutoUpdate)
137
+ this.cleanupAutoUpdate();
138
+ this.cleanupAutoUpdate = autoUpdate(this._caller, this._host, this.calculatePosition);
139
+ }
140
+ dismiss() {
141
+ this.cleanupAutoUpdate();
142
+ }
143
+ }
144
+ export class Backdrop {
145
+ constructor(backdropId) {
146
+ this.defaultBackdropId = 'mds-backdrop';
147
+ this.backdropBackgroundVisible = 'rgba(var(--magma-backdrop-color, 0 0 0) / var(--magma-backdrop-opacity, 0.1))';
148
+ this.backdropBackgroundHidden = 'rgba(var(--magma-backdrop-color, 0 0 0) / 0)';
149
+ this.backdropId = backdropId !== null && backdropId !== void 0 ? backdropId : this.defaultBackdropId;
150
+ this.cssBackdropZIndex = `var(--${this.backdropId}-z-index)`;
151
+ this.cssBackdropDuration = `var(--${this.backdropId}-duration)`;
152
+ }
153
+ attachBackdrop() {
154
+ if (!this.backdropEl) {
155
+ this.backdropEl = document.createElement('div');
156
+ this.backdropEl.className = this.backdropId;
157
+ this.backdropEl.style.inset = '0';
158
+ this.backdropEl.style.pointerEvents = 'none';
159
+ this.backdropEl.style.position = 'fixed';
160
+ this.backdropEl.style.transition = `background-color ${this.cssBackdropDuration} ease-out`;
161
+ this.backdropEl.style.zIndex = this.cssBackdropZIndex;
162
+ }
163
+ this.backdropEl.style.backgroundColor = this.backdropBackgroundHidden;
164
+ document.body.appendChild(this.backdropEl);
165
+ clearTimeout(this.backdropTimer);
166
+ this.backdropTimer = setTimeout(() => {
167
+ this.backdropEl.style.backgroundColor = this.backdropBackgroundVisible;
168
+ }, 1);
169
+ }
170
+ detachBackdrop() {
171
+ if (!this.backdropEl) {
172
+ return;
173
+ }
174
+ this.backdropEl.style.backgroundColor = 'transparent';
175
+ clearTimeout(this.backdropTimer);
176
+ this.backdropTimer = setTimeout(() => {
177
+ this.backdropEl.remove();
178
+ }, cssDurationToMilliseconds(this.cssBackdropDuration));
179
+ }
180
+ }
@@ -0,0 +1,19 @@
1
+ const hasSlottedElements = (el, name) => {
2
+ var _a;
3
+ const query = name ? `slot[name="${name}"]` : 'slot:not([name])';
4
+ const slot = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(query);
5
+ if (slot) {
6
+ return slot.assignedElements({ flatten: true }).length > 0;
7
+ }
8
+ return false;
9
+ };
10
+ const hasSlottedNodes = (el, name) => {
11
+ var _a;
12
+ const query = name ? `slot[name="${name}"]` : 'slot:not([name])';
13
+ const slot = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(query);
14
+ if (slot) {
15
+ return slot.assignedNodes().length > 0;
16
+ }
17
+ return false;
18
+ };
19
+ export { hasSlottedElements, hasSlottedNodes, };
@@ -24,11 +24,15 @@
24
24
  --mds-input-range-thumb-size: 1rem;
25
25
  --mds-input-range-thumb-background: rgb(var(--variant-primary-04));
26
26
  --mds-input-range-thumb-shadow: 0 0 0 2px rgb(var(--tone-neutral));
27
- --mds-input-range-track-background: rgb(var(--tone-neutral-09));
27
+ --mds-input-range-track-background: rgb(var(--tone-neutral-08));
28
28
  --mds-input-range-track-size: 0.5rem;
29
29
  --mds-input-range-track-progress-background: rgb(var(--variant-primary-03));
30
+ --mds-input-range-thumb-background-disabled: rgb(var(--tone-neutral-06));
31
+ --mds-input-range-track-background-disabled: rgb(var(--tone-neutral-08));
32
+ --mds-input-range-track-progress-background-disabled: rgb(var(--tone-neutral-06));
30
33
  gap: 0.25rem;
31
- transition-duration: 200ms;
34
+ transition-duration: 300ms;
35
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
32
36
 
33
37
  display: grid;
34
38
  transition-property: color;
@@ -111,7 +115,11 @@
111
115
  }
112
116
 
113
117
  .field::-webkit-slider-thumb {
118
+ transition-duration: 300ms;
119
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
120
+
114
121
  -webkit-appearance: none;
122
+
115
123
  appearance: none;
116
124
  background-color: var(--mds-input-range-thumb-background);
117
125
  border: 0;
@@ -121,6 +129,8 @@
121
129
  height: var(--mds-input-range-thumb-size);
122
130
  line-height: 0;
123
131
  transform: translate(0, -50%);
132
+ -webkit-transition-property: background-color, box-shadow;
133
+ transition-property: background-color, box-shadow;
124
134
  width: var(--mds-input-range-thumb-size);
125
135
  }
126
136
 
@@ -162,6 +172,16 @@
162
172
  border-radius: var(--mds-input-range-track-size);
163
173
  }
164
174
 
175
+ :host([disabled]:not([disabled="false"])) {
176
+ --mds-input-range-thumb-background: var(--mds-input-range-thumb-background-disabled);
177
+ --mds-input-range-track-background: var(--mds-input-range-track-background-disabled);
178
+ --mds-input-range-track-progress-background: var(--mds-input-range-track-progress-background-disabled);
179
+ }
180
+
181
+ :host([disabled]:not([disabled="false"])) .field::-webkit-slider-thumb {
182
+ cursor: not-allowed;
183
+ }
184
+
165
185
  @tailwind utilities;
166
186
 
167
187
  @container style(--magma-pref-animation: reduce) {
@@ -4,15 +4,23 @@ import { Host, h } from "@stencil/core";
4
4
  */
5
5
  export class MdsInputRange {
6
6
  constructor() {
7
+ /**
8
+ * The greatest value in the range of permitted values
9
+ */
10
+ this.max = 100;
11
+ /**
12
+ * The lowest value in the range of permitted values
13
+ */
14
+ this.min = 0;
15
+ /**
16
+ * The step attribute is a number that specifies the granularity that
17
+ * the value must adhere to, or the special value any, which is described below.
18
+ */
19
+ this.step = 1;
7
20
  this.onInput = () => {
8
21
  // trigger valueChanged that update progress and emit event
9
22
  this.value = parseInt(this.inputElement.value);
10
23
  };
11
- this.progress = undefined;
12
- this.max = 100;
13
- this.min = 0;
14
- this.step = 1;
15
- this.value = undefined;
16
24
  }
17
25
  calculateProgress() {
18
26
  // validate value
@@ -29,6 +37,16 @@ export class MdsInputRange {
29
37
  const current = this.value - this.min;
30
38
  this.progress = current * 100 / total;
31
39
  }
40
+ disabledChanged(newValue) {
41
+ /**
42
+ * This is related to ALL disabled attributes set on Magma input components
43
+ * if solved, please check mds-button, mds-input, mds-input-*
44
+ * https://github.com/ionic-team/stencil/issues/5461
45
+ */
46
+ if (newValue) {
47
+ this.internals.setFormValue(null);
48
+ }
49
+ }
32
50
  valueChanged() {
33
51
  this.inputElement.value = this.value.toString();
34
52
  this.calculateProgress();
@@ -45,6 +63,9 @@ export class MdsInputRange {
45
63
  throw Error('step cant be negative or zero');
46
64
  this.calculateProgress();
47
65
  }
66
+ formResetCallback() {
67
+ this.internals.setFormValue('');
68
+ }
48
69
  componentDidLoad() {
49
70
  var _a, _b;
50
71
  this.label = (_a = this.element.textContent) !== null && _a !== void 0 ? _a : '';
@@ -53,7 +74,7 @@ export class MdsInputRange {
53
74
  this.calculateProgress();
54
75
  }
55
76
  render() {
56
- return (h(Host, { key: '4f58f56b2bf1af905741bbcab323e583dd907a35' }, h("header", { key: '69a2e6c483558f0ce70eca8e1ec45f4ce7f63b10', class: "header", part: "header" }, h("mds-text", { key: '1d5f89b89f5bdf1ca6746567eb23d2b96444c2d9', class: "label", typography: "label" }, h("slot", { key: '534eb663ff412980069c4308a2a15a784e2bf1cf' })), h("mds-text", { key: 'e187c33fb9124f1d20032c822b535d0ddc839fe3', class: "value", typography: "label" }, this.value)), h("div", { key: 'fb3245af7eefbab656b68810577d77a328e312c5', class: "range" }, h("div", { key: 'f146b8b59fbd5bbb3db2350d94686fad986b4dfc', class: "track" }, h("div", { key: '04aaec03384f51e3ad2ad8cc695274c36062d6bf', class: "contrast-area" }), h("div", { key: '2de981fb668e8056a24ca82163dca106fcc5878e', class: "track-total" }, h("div", { key: '2044a5ce25454e56d950c2c7f68ce11369babd87', class: "track-progress", style: { width: `${this.progress}%` } }))), h("input", { key: '423eb3d5b176748d0376374888c7ef3298dc54d9', class: "field", "aria-label": this.label, max: this.max, min: this.min, onInput: this.onInput, step: this.step, type: "range", value: this.value }))));
77
+ return (h(Host, { key: 'e1cf60063d451ad99e6e4943412119634a261dc6' }, h("header", { key: '786ee56712c0d48fce3b0107bf44e1a4e39a5cb2', class: "header", part: "header" }, h("mds-text", { key: 'b51d53ca91e1a39431b851dcefdbda983ae59a60', class: "label", typography: "label" }, h("slot", { key: '1e8a604c35454992794958088051f5074504a3cf' })), h("mds-text", { key: '64cdd428f13f52a6964ab55527707a74ef98d560', class: "value", typography: "label" }, this.value)), h("div", { key: '00f8ad9cd7bdaff91a766d7c8e50a5ad65b4983a', class: "range" }, h("div", { key: '64e70fc8df3951015535b0e0bee0177089c9c399', class: "track" }, h("div", { key: '255824ff26075a8da7e176f03e8a2e99d8e754e5', class: "contrast-area" }), h("div", { key: 'a5d3f15b29af3c95dcdaffe05ba3d9481bfafce2', class: "track-total" }, h("div", { key: 'f50dff46578030bc9ecd83d56dec99b4a099f0b5', class: "track-progress", style: { width: `${this.progress}%` } }))), h("input", { key: '34ba926affc23fb845c421c7813ec05f7ce03f5f', class: "field", "aria-label": this.label, disabled: this.disabled, max: this.max, min: this.min, onInput: this.onInput, step: this.step, type: "range", value: this.value }))));
57
78
  }
58
79
  static get is() { return "mds-input-range"; }
59
80
  static get encapsulation() { return "shadow"; }
@@ -84,6 +105,8 @@ export class MdsInputRange {
84
105
  "tags": [],
85
106
  "text": "The greatest value in the range of permitted values"
86
107
  },
108
+ "getter": false,
109
+ "setter": false,
87
110
  "attribute": "max",
88
111
  "reflect": false,
89
112
  "defaultValue": "100"
@@ -102,6 +125,8 @@ export class MdsInputRange {
102
125
  "tags": [],
103
126
  "text": "The lowest value in the range of permitted values"
104
127
  },
128
+ "getter": false,
129
+ "setter": false,
105
130
  "attribute": "min",
106
131
  "reflect": false,
107
132
  "defaultValue": "0"
@@ -120,10 +145,31 @@ export class MdsInputRange {
120
145
  "tags": [],
121
146
  "text": "The step attribute is a number that specifies the granularity that\nthe value must adhere to, or the special value any, which is described below."
122
147
  },
148
+ "getter": false,
149
+ "setter": false,
123
150
  "attribute": "step",
124
151
  "reflect": false,
125
152
  "defaultValue": "1"
126
153
  },
154
+ "disabled": {
155
+ "type": "boolean",
156
+ "mutable": true,
157
+ "complexType": {
158
+ "original": "boolean",
159
+ "resolved": "boolean | undefined",
160
+ "references": {}
161
+ },
162
+ "required": false,
163
+ "optional": true,
164
+ "docs": {
165
+ "tags": [],
166
+ "text": "Sets if the component is disabled"
167
+ },
168
+ "getter": false,
169
+ "setter": false,
170
+ "attribute": "disabled",
171
+ "reflect": true
172
+ },
127
173
  "value": {
128
174
  "type": "number",
129
175
  "mutable": true,
@@ -138,6 +184,8 @@ export class MdsInputRange {
138
184
  "tags": [],
139
185
  "text": "The value attribute contains a number which contains a representation of the selected number."
140
186
  },
187
+ "getter": false,
188
+ "setter": false,
141
189
  "attribute": "value",
142
190
  "reflect": true
143
191
  }
@@ -169,6 +217,9 @@ export class MdsInputRange {
169
217
  static get elementRef() { return "element"; }
170
218
  static get watchers() {
171
219
  return [{
220
+ "propName": "disabled",
221
+ "methodName": "disabledChanged"
222
+ }, {
172
223
  "propName": "value",
173
224
  "methodName": "valueChanged"
174
225
  }, {
@@ -2,6 +2,10 @@ import { h } from "@stencil/core";
2
2
  export default {
3
3
  title: 'Form / Range',
4
4
  argTypes: {
5
+ disabled: {
6
+ type: { name: 'boolean' },
7
+ description: 'Sets if the component is disabled',
8
+ },
5
9
  min: {
6
10
  type: { name: 'number' },
7
11
  description: 'The lowest value in the range of permitted values',
@@ -28,6 +32,10 @@ const hideHeaderCss = `
28
32
  `;
29
33
  const HideHeaderTemplate = args => h("div", null, h("style", null, hideHeaderCss), h("mds-input-range", Object.assign({}, args), "This shouldn't be visible"));
30
34
  export const Default = Template.bind({});
35
+ export const Disabled = Template.bind({});
36
+ Disabled.args = {
37
+ disabled: true,
38
+ };
31
39
  export const Min = Template.bind({});
32
40
  Min.args = {
33
41
  min: -100,
@@ -0,0 +1,5 @@
1
+ const horizontalActionsAnimationDictionary = [
2
+ 'fade',
3
+ 'slide',
4
+ ];
5
+ export { horizontalActionsAnimationDictionary, };
@@ -14,8 +14,8 @@ const fileExtensionsDictionary = {
14
14
  exe: { format: 'executable', description: 'fileEXE' },
15
15
  flac: { format: 'audio', description: 'uncompressedAudio' },
16
16
  gif: { format: 'image', description: 'compressedImage', preview: true },
17
- htm: { format: 'markup', description: 'documentWeb' },
18
17
  heic: { format: 'image', description: 'imageHEFF' },
18
+ htm: { format: 'markup', description: 'documentWeb' },
19
19
  html: { format: 'markup', description: 'documentWeb' },
20
20
  jpe: { format: 'image', description: 'compressedImage', preview: true },
21
21
  jpeg: { format: 'image', description: 'compressedImage', preview: true },
@@ -32,9 +32,12 @@ const fileExtensionsDictionary = {
32
32
  mpg4: { format: 'video', description: 'videoSD' },
33
33
  mpg: { format: 'video', description: 'videoSD' },
34
34
  mpga: { format: 'audio', description: 'compressedAudio' },
35
+ odf: { format: 'document', description: 'openDocumentFormat' },
35
36
  odp: { format: 'slide', description: 'slideLO' },
36
37
  ods: { format: 'spreadsheet', description: 'spreadsheetLO' },
37
38
  odt: { format: 'text', description: 'documentLO' },
39
+ ole: { format: 'document', description: 'objectLinkingAndEmbedding' },
40
+ p7m: { format: 'certificate', description: 'documentDigitalSingnature' },
38
41
  pdf: { format: 'document', description: 'documentAdobe' },
39
42
  php: { format: 'code', description: 'filePHP' },
40
43
  png: { format: 'image', description: 'imagePNG', preview: true },
@@ -47,6 +50,7 @@ const fileExtensionsDictionary = {
47
50
  tar: { format: 'archive', description: 'uncompressedArchive' },
48
51
  tiff: { format: 'image', description: 'imageTIFF' },
49
52
  ts: { format: 'code', description: 'fileTS' },
53
+ tsd: { format: 'certificate', description: 'certificateTSD' },
50
54
  tsx: { format: 'code', description: 'fileTSX' },
51
55
  txt: { format: 'text', description: 'documentTXT' },
52
56
  wav: { format: 'audio', description: 'uncompressedAudio' },
@@ -54,66 +58,9 @@ const fileExtensionsDictionary = {
54
58
  xar: { format: 'archive', description: 'compressedArchive' },
55
59
  xls: { format: 'spreadsheet', description: 'spreadsheetMS' },
56
60
  xlsx: { format: 'spreadsheet', description: 'spreadsheetMS' },
61
+ xml: { format: 'markup', description: 'extensibleMarkupLanguage' },
57
62
  zip: { format: 'archive', description: 'compressedArchive' },
58
63
  };
59
- // const fileExtensionsDictionary: FileExtenstion = {
60
- // '7z': { format: 'archive', description: 'Archivio compresso' },
61
- // ace: { format: 'archive', description: 'Archivio compresso' },
62
- // ai: { format: 'vector', description: 'Vettoriale Adobe Illustrator' },
63
- // dart: { format: 'code', description: 'Dart' },
64
- // db: { format: 'data', description: 'File di database' },
65
- // default: { format: 'attachment', description: 'Formato sconosciuto' },
66
- // dmg: { format: 'executable', description: 'Apple Disk Image' },
67
- // doc: { format: 'text', description: 'Documento Microsoft Word' },
68
- // docm: { format: 'text', description: 'Documento Microsoft Word' },
69
- // docx: { format: 'text', description: 'Documento Microsoft Word Compresso' },
70
- // eml: { format: 'email', description: 'E-mail di posta elettronica' },
71
- // eps: { format: 'vector', description: 'Vettoriale Corel Draw' },
72
- // exe: { format: 'executable', description: 'File eseguibile Windows' },
73
- // flac: { format: 'audio', description: 'Audio non compresso' },
74
- // gif: { format: 'image', description: 'Immagine compressa', preview: true },
75
- // htm: { format: 'markup', description: 'Pagina web' },
76
- // heic: { format: 'image', description: 'High Efficiency Image File Format' },
77
- // html: { format: 'markup', description: 'Pagina web' },
78
- // jpe: { format: 'image', description: 'Immagine compressa', preview: true },
79
- // jpeg: { format: 'image', description: 'Immagine compressa', preview: true },
80
- // jpg: { format: 'image', description: 'Immagine compressa', preview: true },
81
- // js: { format: 'code', description: 'JavaScript' },
82
- // json: { format: 'data', description: 'JavaScript Object Notation' },
83
- // jsx: { format: 'code', description: 'JavaScript' },
84
- // m2v: { format: 'video', description: 'Filmato SD' },
85
- // mp2: { format: 'audio', description: 'Audio compresso' },
86
- // mp3: { format: 'audio', description: 'Audio compresso' },
87
- // mp4: { format: 'video', description: 'Filmato HD' },
88
- // mp4v: { format: 'video', description: 'Filmato HD' },
89
- // mpeg: { format: 'video', description: 'Filmato SD' },
90
- // mpg4: { format: 'video', description: 'Filmato SD' },
91
- // mpg: { format: 'video', description: 'Filmato SD' },
92
- // mpga: { format: 'audio', description: 'Audio compresso' },
93
- // odp: { format: 'slide', description: 'Slide di presentazione LibreOffice' },
94
- // ods: { format: 'spreadsheet', description: 'Foglio di calcolo LibreOffice' },
95
- // odt: { format: 'text', description: 'File di testo LibreOffice' },
96
- // pdf: { format: 'document', description: 'Documento Adobe' },
97
- // php: { format: 'code', description: 'Hypertext Preprocessor' },
98
- // png: { format: 'image', description: 'Immagine Portable Network Graphics', preview: true },
99
- // ppt: { format: 'slide', description: 'Slide di presentazione PowerPoint' },
100
- // rar: { format: 'archive', description: 'Archivio compresso' },
101
- // rtf: { format: 'text', description: 'Documento di testo Rich Text Format' },
102
- // sass: { format: 'code', description: 'Syntactically Awesome StyleSheets' },
103
- // shtml: { format: 'markup', description: 'Pagina web' },
104
- // svg: { format: 'vector', description: 'Scalable Vector Graphics', preview: true },
105
- // tar: { format: 'archive', description: 'Archivio non compresso' },
106
- // tiff: { format: 'image', description: 'Tag Image File Format' },
107
- // ts: { format: 'code', description: 'TypeScript' },
108
- // tsx: { format: 'code', description: 'TypeScript Extended Syntax' },
109
- // txt: { format: 'text', description: 'Documento di testo non formattato' },
110
- // wav: { format: 'audio', description: 'Audio non compresso' },
111
- // webp: { format: 'image', description: 'Immagine Web Picture', preview: true },
112
- // xar: { format: 'archive', description: 'Archivio compresso' },
113
- // xls: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
114
- // xlsx: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
115
- // zip: { format: 'archive', description: 'Archivio compresso' },
116
- // }
117
64
  const genericMimeToExt = new Map([
118
65
  ['image', ['.png', '.jpg', '.jpeg', '.tiff', '.webp', '.jpe', '.gif', '.heic']],
119
66
  ['audio', ['.mp2', '.mp3', '.mpga', '.wav', '.flac']],
@@ -0,0 +1,13 @@
1
+ const treeActionsDictionary = [
2
+ 'auto',
3
+ 'visible',
4
+ ];
5
+ const treeAppearanceDictionary = [
6
+ 'depth',
7
+ 'none',
8
+ ];
9
+ const treeIconDictionary = [
10
+ 'folder',
11
+ 'chevron',
12
+ ];
13
+ export { treeActionsDictionary, treeAppearanceDictionary, treeIconDictionary, };
@@ -54,4 +54,65 @@ const filesList = [
54
54
  'wisconsin_bypassing_small.xar',
55
55
  'wooden.jsx',
56
56
  ];
57
- export { filesList, };
57
+ const namedFilesList = {
58
+ '7z': 'frozen_haptic.7z',
59
+ 'No extension file': 'this_is_an_extensionless_file',
60
+ 'png with URL': 'https://i2.wp.com/clipart.info/images/ccovers/1495750818Apple-PNG-Clip-Art.png',
61
+ ace: 'sky_marketing.ace',
62
+ ai: 'foreground_overriding.ai',
63
+ db: 'matrix_black_hat.db',
64
+ default: 'copying.default',
65
+ dmg: 'protocol_designer.dmg',
66
+ doc: 'forges.doc',
67
+ docm: 'officer_somalia.docm',
68
+ docx: 'upgradable_gold.docx',
69
+ eml: 'brunei_logistical.eml',
70
+ eps: 'alarm_circuit_plastic.eps',
71
+ exe: 'rss_systematic_avon.exe',
72
+ flac: 'liaison_panel_central.flac',
73
+ gif: 'initiatives_group.gif',
74
+ htm: 'books_monetize_arizona.htm',
75
+ html: 'flexibility_auto_money.html',
76
+ jpe: 'intelligent_radical.jpe',
77
+ jpeg: 'iowa_installation.jpeg',
78
+ jpg: 'buckinghamshire_macao.jpg',
79
+ js: 'monitor.js',
80
+ json: 'calculating.json',
81
+ jsx: 'wooden.jsx',
82
+ m2v: 'interface_bedfordshire_solid.m2v',
83
+ mp2: 'explicit.mp2',
84
+ mp3: 'optimization_radical.mp3',
85
+ mp4: 'nebraska.mp4',
86
+ mp4v: 'reduced_regional_greenland.mp4v',
87
+ mpeg: 'impactful_alarm_handmade.mpeg',
88
+ mpg4: 'revolutionize.mpg4',
89
+ mpg: 'complexity_deposit.mpg',
90
+ mpga: 'ports_copy_granite.mpga',
91
+ odf: 'This is a file_to_read.odf',
92
+ odp: 'needs_based_solid.odp',
93
+ ods: 'compressing_black_colorado.ods',
94
+ odt: 'salad_compressing.odt',
95
+ ole: 'Document-RPF_Open-new.ole',
96
+ p7m: 'file with certificate from government.pdf.p7m',
97
+ pdf: 'connect_local_visualize.pdf',
98
+ php: 'fish.php',
99
+ png: 'awesome_orchestration.png',
100
+ ppt: 'gorgeous_manager_savings.ppt',
101
+ rar: 'unbranded.rar',
102
+ rtf: 'pound.rtf',
103
+ sass: 'open_source_gorgeous.sass',
104
+ shtml: 'brand.shtml',
105
+ svg: 'b2c_tan_sports.svg',
106
+ tar: 'graphic_frozen_bedfordshire.tar',
107
+ ts: 'forge_face.ts',
108
+ tsd: 'Marked file-7483274hy6Fg6R8.tsd',
109
+ txt: 'bedfordshire_iceland_identity.txt',
110
+ wav: 'synergistic.wav',
111
+ webp: 'open_source.webp',
112
+ xar: 'wisconsin_bypassing_small.xar',
113
+ xls: 'metrics_lempira_account.xls',
114
+ xlsx: 'hdd_navigate_panama.xlsx',
115
+ xml: 'Markup language.xml',
116
+ zip: 'tuna_table_fall.zip',
117
+ };
118
+ export { filesList, namedFilesList, };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -3,6 +3,7 @@ import baselineAttachFile from "@icon/mi/baseline/attach-file.svg";
3
3
  import baselineAudiotrack from "@icon/mi/baseline/audiotrack.svg";
4
4
  import baselineTerminal from "@icon/mi/baseline/terminal.svg";
5
5
  import baselineInsertDriveFile from "@icon/mi/baseline/insert-drive-file.svg";
6
+ import mdiLicense from "@icon/mdi/license.svg";
6
7
  import mdiHardDisk from "@icon/mdi/harddisk.svg";
7
8
  import baselineEmail from "@icon/mi/baseline/email.svg";
8
9
  import baselineWysiwyg from "@icon/mi/baseline/wysiwyg.svg";
@@ -26,6 +27,10 @@ const fileFormatsVariant = {
26
27
  icon: baselineAudiotrack,
27
28
  variant: 'violet',
28
29
  },
30
+ certificate: {
31
+ icon: mdiLicense,
32
+ variant: 'orange',
33
+ },
29
34
  code: {
30
35
  icon: baselineTerminal,
31
36
  variant: 'yellow',