@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,117 @@
|
|
|
1
|
+
import { AttachInternals, Component, Element, Event, EventEmitter, Host, h, Prop, Watch, State } from '@stencil/core'
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
tag: 'mds-input-range',
|
|
5
|
+
styleUrl: 'mds-input-range.css',
|
|
6
|
+
formAssociated: true,
|
|
7
|
+
shadow: true,
|
|
8
|
+
})
|
|
9
|
+
export class MdsInputRange {
|
|
10
|
+
|
|
11
|
+
@State() private progress: number
|
|
12
|
+
private inputElement: HTMLInputElement
|
|
13
|
+
|
|
14
|
+
@Element() private element: HTMLMdsInputRangeElement
|
|
15
|
+
@AttachInternals() internals: ElementInternals
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The greatest value in the range of permitted values
|
|
19
|
+
*/
|
|
20
|
+
@Prop() readonly max: number = 100
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The lowest value in the range of permitted values
|
|
24
|
+
*/
|
|
25
|
+
@Prop() readonly min: number = 0
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The step attribute is a number that specifies the granularity that
|
|
29
|
+
* the value must adhere to, or the special value any, which is described below.
|
|
30
|
+
*/
|
|
31
|
+
@Prop() readonly step: number = 1
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The value attribute contains a number which contains a representation of the selected number.
|
|
35
|
+
*/
|
|
36
|
+
@Prop({ mutable: true, reflect: true }) value: number
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Emits when the input range is changed
|
|
40
|
+
*/
|
|
41
|
+
@Event({ eventName: 'mdsInputRangeChange' }) changeEvent: EventEmitter<number>
|
|
42
|
+
|
|
43
|
+
calculateProgress (): void {
|
|
44
|
+
// validate value
|
|
45
|
+
let v = parseInt(this.inputElement.value)
|
|
46
|
+
if (v > this.max) v = this.max
|
|
47
|
+
else if (v < this.min) v = this.min
|
|
48
|
+
if ((v - this.min) % (this.step) !== 0) v = Math.round(v / this.step) * this.step - this.min
|
|
49
|
+
this.value = v
|
|
50
|
+
|
|
51
|
+
this.internals.setFormValue(this.value.toString())
|
|
52
|
+
const total = this.max - this.min
|
|
53
|
+
const current = this.value - this.min
|
|
54
|
+
this.progress = current * 100 / total
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private onInput = () => {
|
|
58
|
+
// trigger valueChanged that update progress and emit event
|
|
59
|
+
this.value = parseInt(this.inputElement.value)
|
|
60
|
+
}
|
|
61
|
+
@Watch('value')
|
|
62
|
+
valueChanged (): void {
|
|
63
|
+
this.inputElement.value = this.value.toString()
|
|
64
|
+
this.calculateProgress()
|
|
65
|
+
this.changeEvent.emit(this.value)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@Watch('min')
|
|
69
|
+
minChanged (): void {
|
|
70
|
+
this.calculateProgress()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@Watch('max')
|
|
74
|
+
maxChanged (): void {
|
|
75
|
+
this.calculateProgress()
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@Watch('step')
|
|
79
|
+
stepChanged (): void {
|
|
80
|
+
if (this.step < 1) throw Error('step cant be negative or zero')
|
|
81
|
+
this.calculateProgress()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
componentDidLoad (): void {
|
|
85
|
+
this.inputElement = this.element.shadowRoot?.querySelector('.field') as HTMLInputElement
|
|
86
|
+
this.value = parseInt(this.inputElement.value)
|
|
87
|
+
this.calculateProgress()
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
render () {
|
|
91
|
+
return (
|
|
92
|
+
<Host>
|
|
93
|
+
<header class="header">
|
|
94
|
+
<mds-text class="label" typography="label"><slot/></mds-text>
|
|
95
|
+
<mds-text class="value" typography="label">{ this.value }</mds-text>
|
|
96
|
+
</header>
|
|
97
|
+
<div class="range">
|
|
98
|
+
<div class="track">
|
|
99
|
+
<div class="track-total">
|
|
100
|
+
<div class="track-progress" style={{ width: `${this.progress}%` }}></div>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
<input
|
|
104
|
+
class="field"
|
|
105
|
+
max={this.max}
|
|
106
|
+
min={this.min}
|
|
107
|
+
onInput={this.onInput}
|
|
108
|
+
step={this.step}
|
|
109
|
+
type="range"
|
|
110
|
+
value={this.value}
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</Host>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# mds-input-range
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<!-- Auto Generated Below -->
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Properties
|
|
9
|
+
|
|
10
|
+
| Property | Attribute | Description | Type | Default |
|
|
11
|
+
| -------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
|
|
12
|
+
| `max` | `max` | The greatest value in the range of permitted values | `number` | `100` |
|
|
13
|
+
| `min` | `min` | The lowest value in the range of permitted values | `number` | `0` |
|
|
14
|
+
| `step` | `step` | The step attribute is a number that specifies the granularity that the value must adhere to, or the special value any, which is described below. | `number` | `1` |
|
|
15
|
+
| `value` | `value` | The value attribute contains a number which contains a representation of the selected number. | `number` | `undefined` |
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Events
|
|
19
|
+
|
|
20
|
+
| Event | Description | Type |
|
|
21
|
+
| --------------------- | ------------------------------------- | --------------------- |
|
|
22
|
+
| `mdsInputRangeChange` | Emits when the input range is changed | `CustomEvent<number>` |
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## CSS Custom Properties
|
|
26
|
+
|
|
27
|
+
| Name | Description |
|
|
28
|
+
| --------------------------------------------- | ------------------------------------------------ |
|
|
29
|
+
| `--mds-input-range-thumb-background` | |
|
|
30
|
+
| `--mds-input-range-thumb-size` | Sets the thumb width and height of the component |
|
|
31
|
+
| `--mds-input-range-track-background` | |
|
|
32
|
+
| `--mds-input-range-track-progress-background` | |
|
|
33
|
+
| `--mds-input-range-track-size` | |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
----------------------------------------------
|
|
37
|
+
|
|
38
|
+
Built with love @ [Gruppo Maggioli](https://www.maggioli.com) from [R&D Department](https://www.maggioli.com/it-it/chi-siamo/ricerca-sviluppo)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing'
|
|
2
|
+
|
|
3
|
+
describe('mds-input-range', () => {
|
|
4
|
+
it('renders', async () => {
|
|
5
|
+
const page = await newE2EPage()
|
|
6
|
+
await page.setContent('<mds-input-range></mds-input-range>')
|
|
7
|
+
|
|
8
|
+
const element = await page.find('mds-input-range')
|
|
9
|
+
expect(element).toHaveAttribute('hydrated')
|
|
10
|
+
expect(true).toBe(true)
|
|
11
|
+
})
|
|
12
|
+
})
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { h } from '@stencil/core'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Form / Range',
|
|
5
|
+
argTypes: {
|
|
6
|
+
min: {
|
|
7
|
+
type: { name: 'number', required: true },
|
|
8
|
+
description: 'The lowest value in the range of permitted values',
|
|
9
|
+
},
|
|
10
|
+
max: {
|
|
11
|
+
type: { name: 'number', required: true },
|
|
12
|
+
description: 'The greatest value in the range of permitted values',
|
|
13
|
+
},
|
|
14
|
+
step: {
|
|
15
|
+
type: { name: 'number', required: true },
|
|
16
|
+
description: 'The step attribute is a number that specifies the granularity that the value must adhere to, or the special value any, which is described below',
|
|
17
|
+
},
|
|
18
|
+
value: {
|
|
19
|
+
type: { name: 'number', required: true },
|
|
20
|
+
description: 'The value attribute contains a number which contains a representation of the selected number',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const Template = args =>
|
|
26
|
+
<mds-input-range {...args}>
|
|
27
|
+
Range label
|
|
28
|
+
</mds-input-range>
|
|
29
|
+
|
|
30
|
+
export const Default = Template.bind({})
|
|
31
|
+
|
|
32
|
+
export const Min = Template.bind({})
|
|
33
|
+
Min.args = {
|
|
34
|
+
min: -100,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const Max = Template.bind({})
|
|
38
|
+
Max.args = {
|
|
39
|
+
max: 200,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const Step = Template.bind({})
|
|
43
|
+
Step.args = {
|
|
44
|
+
step: 10,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const Value = Template.bind({})
|
|
48
|
+
Value.args = {
|
|
49
|
+
value: 90,
|
|
50
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/**
|
|
4
|
+
* This is an autogenerated file created by the Stencil compiler.
|
|
5
|
+
* It contains typing information for all components that exist in this project.
|
|
6
|
+
*/
|
|
7
|
+
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
|
|
8
|
+
export namespace Components {
|
|
9
|
+
interface MdsInputRange {
|
|
10
|
+
/**
|
|
11
|
+
* The greatest value in the range of permitted values
|
|
12
|
+
*/
|
|
13
|
+
"max": number;
|
|
14
|
+
/**
|
|
15
|
+
* The lowest value in the range of permitted values
|
|
16
|
+
*/
|
|
17
|
+
"min": number;
|
|
18
|
+
/**
|
|
19
|
+
* The step attribute is a number that specifies the granularity that the value must adhere to, or the special value any, which is described below.
|
|
20
|
+
*/
|
|
21
|
+
"step": number;
|
|
22
|
+
/**
|
|
23
|
+
* The value attribute contains a number which contains a representation of the selected number.
|
|
24
|
+
*/
|
|
25
|
+
"value": number;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export interface MdsInputRangeCustomEvent<T> extends CustomEvent<T> {
|
|
29
|
+
detail: T;
|
|
30
|
+
target: HTMLMdsInputRangeElement;
|
|
31
|
+
}
|
|
32
|
+
declare global {
|
|
33
|
+
interface HTMLMdsInputRangeElementEventMap {
|
|
34
|
+
"mdsInputRangeChange": number;
|
|
35
|
+
}
|
|
36
|
+
interface HTMLMdsInputRangeElement extends Components.MdsInputRange, HTMLStencilElement {
|
|
37
|
+
addEventListener<K extends keyof HTMLMdsInputRangeElementEventMap>(type: K, listener: (this: HTMLMdsInputRangeElement, ev: MdsInputRangeCustomEvent<HTMLMdsInputRangeElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
38
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
39
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
40
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
41
|
+
removeEventListener<K extends keyof HTMLMdsInputRangeElementEventMap>(type: K, listener: (this: HTMLMdsInputRangeElement, ev: MdsInputRangeCustomEvent<HTMLMdsInputRangeElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
42
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
43
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
44
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
45
|
+
}
|
|
46
|
+
var HTMLMdsInputRangeElement: {
|
|
47
|
+
prototype: HTMLMdsInputRangeElement;
|
|
48
|
+
new (): HTMLMdsInputRangeElement;
|
|
49
|
+
};
|
|
50
|
+
interface HTMLElementTagNameMap {
|
|
51
|
+
"mds-input-range": HTMLMdsInputRangeElement;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
declare namespace LocalJSX {
|
|
55
|
+
interface MdsInputRange {
|
|
56
|
+
/**
|
|
57
|
+
* The greatest value in the range of permitted values
|
|
58
|
+
*/
|
|
59
|
+
"max"?: number;
|
|
60
|
+
/**
|
|
61
|
+
* The lowest value in the range of permitted values
|
|
62
|
+
*/
|
|
63
|
+
"min"?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Emits when the input range is changed
|
|
66
|
+
*/
|
|
67
|
+
"onMdsInputRangeChange"?: (event: MdsInputRangeCustomEvent<number>) => void;
|
|
68
|
+
/**
|
|
69
|
+
* The step attribute is a number that specifies the granularity that the value must adhere to, or the special value any, which is described below.
|
|
70
|
+
*/
|
|
71
|
+
"step"?: number;
|
|
72
|
+
/**
|
|
73
|
+
* The value attribute contains a number which contains a representation of the selected number.
|
|
74
|
+
*/
|
|
75
|
+
"value"?: number;
|
|
76
|
+
}
|
|
77
|
+
interface IntrinsicElements {
|
|
78
|
+
"mds-input-range": MdsInputRange;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export { LocalJSX as JSX };
|
|
82
|
+
declare module "@stencil/core" {
|
|
83
|
+
export namespace JSX {
|
|
84
|
+
interface IntrinsicElements {
|
|
85
|
+
"mds-input-range": LocalJSX.MdsInputRange & JSXBase.HTMLAttributes<HTMLMdsInputRangeElement>;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const autoCompleteDictionary = [
|
|
2
|
+
'additional-name',
|
|
3
|
+
'address',
|
|
4
|
+
'address-level1',
|
|
5
|
+
'address-level2',
|
|
6
|
+
'address-level3',
|
|
7
|
+
'address-level4',
|
|
8
|
+
'address-line1',
|
|
9
|
+
'address-line2',
|
|
10
|
+
'address-line3',
|
|
11
|
+
'bday',
|
|
12
|
+
'bday-day',
|
|
13
|
+
'bday-month',
|
|
14
|
+
'bday-year',
|
|
15
|
+
'cc-additional-name',
|
|
16
|
+
'cc-csc',
|
|
17
|
+
'cc-exp',
|
|
18
|
+
'cc-exp-month',
|
|
19
|
+
'cc-exp-year',
|
|
20
|
+
'cc-family-name',
|
|
21
|
+
'cc-family-name',
|
|
22
|
+
'cc-given-name',
|
|
23
|
+
'cc-name',
|
|
24
|
+
'cc-number',
|
|
25
|
+
'cc-type',
|
|
26
|
+
'country',
|
|
27
|
+
'country-name',
|
|
28
|
+
'current-password',
|
|
29
|
+
'email',
|
|
30
|
+
'family-name',
|
|
31
|
+
'given-name',
|
|
32
|
+
'honorific-prefix',
|
|
33
|
+
'honorific-suffix',
|
|
34
|
+
'impp',
|
|
35
|
+
'language',
|
|
36
|
+
'name',
|
|
37
|
+
'new-password',
|
|
38
|
+
'nickname',
|
|
39
|
+
'off',
|
|
40
|
+
'on',
|
|
41
|
+
'one-time-code',
|
|
42
|
+
'organization',
|
|
43
|
+
'organization-title',
|
|
44
|
+
'photo',
|
|
45
|
+
'postal-code',
|
|
46
|
+
'sex',
|
|
47
|
+
'street-address',
|
|
48
|
+
'tel',
|
|
49
|
+
'tel-area-code',
|
|
50
|
+
'tel-country-code',
|
|
51
|
+
'tel-extension',
|
|
52
|
+
'tel-local',
|
|
53
|
+
'tel-national',
|
|
54
|
+
'transaction-amount',
|
|
55
|
+
'transaction-currency',
|
|
56
|
+
'url',
|
|
57
|
+
'username',
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
autoCompleteDictionary,
|
|
62
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const buttonVariantDictionary = [
|
|
2
|
+
'dark',
|
|
3
|
+
'error',
|
|
4
|
+
'info',
|
|
5
|
+
'light',
|
|
6
|
+
'primary',
|
|
7
|
+
'success',
|
|
8
|
+
'warning',
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
const buttonToneVariantDictionary = [
|
|
12
|
+
'strong',
|
|
13
|
+
'weak',
|
|
14
|
+
'ghost',
|
|
15
|
+
'quiet',
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
const buttonTargetDictionary = [
|
|
19
|
+
'blank',
|
|
20
|
+
'self',
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
const buttonSizeDictionary = [
|
|
24
|
+
'sm',
|
|
25
|
+
'md',
|
|
26
|
+
'lg',
|
|
27
|
+
'xl',
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
const buttonIconPositionDictionary = [
|
|
31
|
+
'left',
|
|
32
|
+
'right',
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
buttonIconPositionDictionary,
|
|
37
|
+
buttonSizeDictionary,
|
|
38
|
+
buttonTargetDictionary,
|
|
39
|
+
buttonToneVariantDictionary,
|
|
40
|
+
buttonVariantDictionary,
|
|
41
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const colorLabelDictionary = [
|
|
2
|
+
'amaranth',
|
|
3
|
+
'aqua',
|
|
4
|
+
'blue',
|
|
5
|
+
'green',
|
|
6
|
+
'lime',
|
|
7
|
+
'orange',
|
|
8
|
+
'orchid',
|
|
9
|
+
'sky',
|
|
10
|
+
'violet',
|
|
11
|
+
'yellow',
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
const colorStatusDictionary = [
|
|
15
|
+
'error',
|
|
16
|
+
'info',
|
|
17
|
+
'success',
|
|
18
|
+
'warning',
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
colorLabelDictionary,
|
|
23
|
+
colorStatusDictionary,
|
|
24
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
interface FileExtenstion {
|
|
2
|
+
[key: string]: ExtensionInfo
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
interface ExtensionInfo {
|
|
6
|
+
preview?: boolean
|
|
7
|
+
format: string
|
|
8
|
+
description: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const fileExtensionsDictionary: FileExtenstion = {
|
|
12
|
+
'7z': { format: 'archive', description: 'Archivio compresso' },
|
|
13
|
+
ace: { format: 'archive', description: 'Archivio compresso' },
|
|
14
|
+
ai: { format: 'vector', description: 'Vettoriale Adobe Illustrator' },
|
|
15
|
+
dart: { format: 'code', description: 'Dart' },
|
|
16
|
+
db: { format: 'data', description: 'File di database' },
|
|
17
|
+
default: { format: 'attachment', description: 'Formato sconosciuto' },
|
|
18
|
+
dmg: { format: 'executable', description: 'Apple Disk Image' },
|
|
19
|
+
doc: { format: 'text', description: 'Documento Microsoft Word' },
|
|
20
|
+
docm: { format: 'text', description: 'Documento Microsoft Word' },
|
|
21
|
+
docx: { format: 'text', description: 'Documento Microsoft Word Compresso' },
|
|
22
|
+
eml: { format: 'email', description: 'E-mail di posta elettronica' },
|
|
23
|
+
eps: { format: 'vector', description: 'Vettoriale Corel Draw' },
|
|
24
|
+
exe: { format: 'executable', description: 'File eseguibile Windows' },
|
|
25
|
+
flac: { format: 'audio', description: 'Audio non compresso' },
|
|
26
|
+
gif: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
27
|
+
htm: { format: 'markup', description: 'Pagina web' },
|
|
28
|
+
heic: { format: 'image', description: 'High Efficiency Image File Format' },
|
|
29
|
+
html: { format: 'markup', description: 'Pagina web' },
|
|
30
|
+
jpe: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
31
|
+
jpeg: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
32
|
+
jpg: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
33
|
+
js: { format: 'code', description: 'JavaScript' },
|
|
34
|
+
json: { format: 'data', description: 'JavaScript Object Notation' },
|
|
35
|
+
jsx: { format: 'code', description: 'JavaScript' },
|
|
36
|
+
m2v: { format: 'video', description: 'Filmato SD' },
|
|
37
|
+
mp2: { format: 'audio', description: 'Audio compresso' },
|
|
38
|
+
mp3: { format: 'audio', description: 'Audio compresso' },
|
|
39
|
+
mp4: { format: 'video', description: 'Filmato HD' },
|
|
40
|
+
mp4v: { format: 'video', description: 'Filmato HD' },
|
|
41
|
+
mpeg: { format: 'video', description: 'Filmato SD' },
|
|
42
|
+
mpg4: { format: 'video', description: 'Filmato SD' },
|
|
43
|
+
mpg: { format: 'video', description: 'Filmato SD' },
|
|
44
|
+
mpga: { format: 'audio', description: 'Audio compresso' },
|
|
45
|
+
odp: { format: 'slide', description: 'Slide di presentazione LibreOffice' },
|
|
46
|
+
ods: { format: 'spreadsheet', description: 'Foglio di calcolo LibreOffice' },
|
|
47
|
+
odt: { format: 'text', description: 'File di testo LibreOffice' },
|
|
48
|
+
pdf: { format: 'document', description: 'Documento Adobe' },
|
|
49
|
+
php: { format: 'code', description: 'Hypertext Preprocessor' },
|
|
50
|
+
png: { format: 'image', description: 'Immagine Portable Network Graphics', preview: true },
|
|
51
|
+
ppt: { format: 'slide', description: 'Slide di presentazione PowerPoint' },
|
|
52
|
+
rar: { format: 'archive', description: 'Archivio compresso' },
|
|
53
|
+
rtf: { format: 'text', description: 'Documento di testo Rich Text Format' },
|
|
54
|
+
sass: { format: 'code', description: 'Syntactically Awesome StyleSheets' },
|
|
55
|
+
shtml: { format: 'markup', description: 'Pagina web' },
|
|
56
|
+
svg: { format: 'vector', description: 'Scalable Vector Graphics', preview: true },
|
|
57
|
+
tar: { format: 'archive', description: 'Archivio non compresso' },
|
|
58
|
+
tiff: { format: 'image', description: 'Tag Image File Format' },
|
|
59
|
+
ts: { format: 'code', description: 'TypeScript' },
|
|
60
|
+
tsx: { format: 'code', description: 'TypeScript Extended Syntax' },
|
|
61
|
+
txt: { format: 'text', description: 'Documento di testo non formattato' },
|
|
62
|
+
wav: { format: 'audio', description: 'Audio non compresso' },
|
|
63
|
+
webp: { format: 'image', description: 'Immagine Web Picture', preview: true },
|
|
64
|
+
xar: { format: 'archive', description: 'Archivio compresso' },
|
|
65
|
+
xls: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
|
|
66
|
+
xlsx: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
|
|
67
|
+
zip: { format: 'archive', description: 'Archivio compresso' },
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const genericMimeToExt: Map<string, string[]> = new Map([
|
|
71
|
+
['image', ['.png', '.jpg', '.jpeg', '.tiff', '.webp', '.jpe', '.gif', '.heic']],
|
|
72
|
+
['audio', ['.mp2', '.mp3', '.mpga', '.wav', '.flac']],
|
|
73
|
+
['video', ['.mv2', '.mp4', '.mp4v', '.mpeg', '.mpg4', '.mpg']],
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
FileExtenstion,
|
|
78
|
+
ExtensionInfo,
|
|
79
|
+
fileExtensionsDictionary,
|
|
80
|
+
genericMimeToExt,
|
|
81
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
const floatingUIPlacementDictionary = [
|
|
3
|
+
'bottom',
|
|
4
|
+
'bottom-end',
|
|
5
|
+
'bottom-start',
|
|
6
|
+
'left',
|
|
7
|
+
'left-end',
|
|
8
|
+
'left-start',
|
|
9
|
+
'right',
|
|
10
|
+
'right-end',
|
|
11
|
+
'right-start',
|
|
12
|
+
'top',
|
|
13
|
+
'top-end',
|
|
14
|
+
'top-start',
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
const floatingUIStrategyDictionary = [
|
|
18
|
+
'absolute',
|
|
19
|
+
'fixed',
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
floatingUIPlacementDictionary,
|
|
24
|
+
floatingUIStrategyDictionary,
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import jsonIconsDictionary from '../fixtures/icons.json'
|
|
2
|
+
import jsonMggIconsDictionary from '../fixtures/iconsauce.json'
|
|
3
|
+
const iconsDictionary = jsonIconsDictionary
|
|
4
|
+
const mggIconsDictionary = jsonMggIconsDictionary
|
|
5
|
+
const svgIconsDictionary = [
|
|
6
|
+
`${location.origin}/svg/mi/baseline/email.svg`,
|
|
7
|
+
'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjQiPjxwYXRoIGQ9Im0yMzMtODAgNjUtMjgxTDgwLTU1MGwyODgtMjUgMTEyLTI2NSAxMTIgMjY1IDI4OCAyNS0yMTggMTg5IDY1IDI4MS0yNDctMTQ5TDIzMy04MFoiLz48L3N2Zz4=',
|
|
8
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6s-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8s-3.58-8-8-8z"/></svg>',
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
iconsDictionary,
|
|
13
|
+
mggIconsDictionary,
|
|
14
|
+
svgIconsDictionary,
|
|
15
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const inputTextTypeDictionary = [
|
|
2
|
+
'date',
|
|
3
|
+
'email',
|
|
4
|
+
'number',
|
|
5
|
+
'password',
|
|
6
|
+
'search',
|
|
7
|
+
'tel',
|
|
8
|
+
'text',
|
|
9
|
+
'textarea',
|
|
10
|
+
'time',
|
|
11
|
+
'url',
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
const inputFieldTypeDictionary = [
|
|
15
|
+
'date',
|
|
16
|
+
'email',
|
|
17
|
+
'number',
|
|
18
|
+
'password',
|
|
19
|
+
'search',
|
|
20
|
+
'tel',
|
|
21
|
+
'text',
|
|
22
|
+
'textarea',
|
|
23
|
+
'time',
|
|
24
|
+
'url',
|
|
25
|
+
'cc',
|
|
26
|
+
'cf',
|
|
27
|
+
'isbn',
|
|
28
|
+
'piva',
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const inputControlsLayoutDictionary = [
|
|
33
|
+
'horizontal',
|
|
34
|
+
'vertical',
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
const inputControlsIconDictionary = [
|
|
38
|
+
'arrow',
|
|
39
|
+
'arithmetic',
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
inputControlsIconDictionary,
|
|
44
|
+
inputControlsLayoutDictionary,
|
|
45
|
+
inputTextTypeDictionary,
|
|
46
|
+
inputFieldTypeDictionary,
|
|
47
|
+
}
|
|
48
|
+
|