@limetech/lime-elements 37.59.0 → 37.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/cjs/{component-55b926ef.js → component-3f00c197.js} +7 -8
- package/dist/cjs/component-3f00c197.js.map +1 -0
- package/dist/cjs/{component-37425b99.js → component-44f52caf.js} +50 -51
- package/dist/cjs/component-44f52caf.js.map +1 -0
- package/dist/cjs/{component-cba208a8.js → component-864afce0.js} +13 -14
- package/dist/cjs/component-864afce0.js.map +1 -0
- package/dist/cjs/{component-a4eb183b.js → component-a8e11c4c.js} +12 -13
- package/dist/cjs/component-a8e11c4c.js.map +1 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-action-bar_4.cjs.entry.js +1 -1
- package/dist/cjs/limel-breadcrumbs_5.cjs.entry.js +21 -22
- package/dist/cjs/limel-breadcrumbs_5.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-callout.cjs.entry.js +1 -1
- package/dist/cjs/limel-checkbox.cjs.entry.js +18 -19
- package/dist/cjs/limel-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +6 -7
- package/dist/cjs/limel-chip_2.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-date-picker.cjs.entry.js +4 -5
- package/dist/cjs/limel-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-dialog.cjs.entry.js +9 -10
- package/dist/cjs/limel-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-dynamic-label_4.cjs.entry.js +2 -3
- package/dist/cjs/limel-dynamic-label_4.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limel-file.cjs.entry.js +1 -1
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-linear-progress.cjs.entry.js +17 -396
- package/dist/cjs/limel-linear-progress.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-select.cjs.entry.js +8 -9
- package/dist/cjs/limel-select.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-slider.cjs.entry.js +10 -11
- package/dist/cjs/limel-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-snackbar.cjs.entry.js +5 -8
- package/dist/cjs/limel-snackbar.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-switch.cjs.entry.js +16 -17
- package/dist/cjs/limel-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-tab-bar.cjs.entry.js +42 -43
- package/dist/cjs/limel-tab-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{component-b37fd9bc.js → ponyfill-63966294.js} +75 -1
- package/dist/cjs/ponyfill-63966294.js.map +1 -0
- package/dist/cjs/{translations-6d759b59.js → translations-e12a6869.js} +13 -1
- package/dist/cjs/translations-e12a6869.js.map +1 -0
- package/dist/collection/components/chip/chip.css +0 -2
- package/dist/collection/components/info-tile/info-tile.css +0 -2
- package/dist/collection/components/linear-progress/linear-progress.css +58 -250
- package/dist/collection/components/linear-progress/linear-progress.js +62 -29
- package/dist/collection/components/linear-progress/linear-progress.js.map +1 -1
- package/dist/collection/components/snackbar/snackbar.js +4 -7
- package/dist/collection/components/snackbar/snackbar.js.map +1 -1
- package/dist/collection/translations/da.js +2 -0
- package/dist/collection/translations/da.js.map +1 -1
- package/dist/collection/translations/en.js +2 -0
- package/dist/collection/translations/en.js.map +1 -1
- package/dist/collection/translations/fi.js +2 -0
- package/dist/collection/translations/fi.js.map +1 -1
- package/dist/collection/translations/nl.js +2 -0
- package/dist/collection/translations/nl.js.map +1 -1
- package/dist/collection/translations/no.js +2 -0
- package/dist/collection/translations/no.js.map +1 -1
- package/dist/collection/translations/sv.js +2 -0
- package/dist/collection/translations/sv.js.map +1 -1
- package/dist/esm/{component-db286494.js → component-5e233629.js} +2 -3
- package/dist/esm/component-5e233629.js.map +1 -0
- package/dist/esm/{component-f972b8db.js → component-a531729c.js} +2 -3
- package/dist/esm/component-a531729c.js.map +1 -0
- package/dist/esm/{component-fc0a08f6.js → component-b934161d.js} +2 -3
- package/dist/esm/component-b934161d.js.map +1 -0
- package/dist/esm/{component-58f68f3e.js → component-e6eb55fa.js} +4 -5
- package/dist/esm/component-e6eb55fa.js.map +1 -0
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-action-bar_4.entry.js +1 -1
- package/dist/esm/limel-breadcrumbs_5.entry.js +5 -6
- package/dist/esm/limel-breadcrumbs_5.entry.js.map +1 -1
- package/dist/esm/limel-callout.entry.js +1 -1
- package/dist/esm/limel-checkbox.entry.js +2 -3
- package/dist/esm/limel-checkbox.entry.js.map +1 -1
- package/dist/esm/limel-chip_2.entry.js +6 -7
- package/dist/esm/limel-chip_2.entry.js.map +1 -1
- package/dist/esm/limel-date-picker.entry.js +4 -5
- package/dist/esm/limel-date-picker.entry.js.map +1 -1
- package/dist/esm/limel-dialog.entry.js +2 -3
- package/dist/esm/limel-dialog.entry.js.map +1 -1
- package/dist/esm/limel-dynamic-label_4.entry.js +2 -3
- package/dist/esm/limel-dynamic-label_4.entry.js.map +1 -1
- package/dist/esm/limel-file-viewer.entry.js +1 -1
- package/dist/esm/limel-file.entry.js +1 -1
- package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js.map +1 -1
- package/dist/esm/limel-linear-progress.entry.js +18 -397
- package/dist/esm/limel-linear-progress.entry.js.map +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/limel-select.entry.js +2 -3
- package/dist/esm/limel-select.entry.js.map +1 -1
- package/dist/esm/limel-slider.entry.js +2 -3
- package/dist/esm/limel-slider.entry.js.map +1 -1
- package/dist/esm/limel-snackbar.entry.js +5 -8
- package/dist/esm/limel-snackbar.entry.js.map +1 -1
- package/dist/esm/limel-switch.entry.js +2 -3
- package/dist/esm/limel-switch.entry.js.map +1 -1
- package/dist/esm/limel-tab-bar.entry.js +2 -3
- package/dist/esm/limel-tab-bar.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{component-8b6ce3e9.js → ponyfill-9f1f6cd2.js} +73 -2
- package/dist/esm/ponyfill-9f1f6cd2.js.map +1 -0
- package/dist/esm/{translations-aee148ca.js → translations-d6a1fb0b.js} +13 -1
- package/dist/esm/translations-d6a1fb0b.js.map +1 -0
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js.map +1 -1
- package/dist/lime-elements/{p-d2077011.entry.js → p-02e9b8ce.entry.js} +2 -2
- package/dist/lime-elements/{p-9b437537.entry.js → p-20440a35.entry.js} +2 -2
- package/dist/lime-elements/{p-83648c76.entry.js → p-216eb1cf.entry.js} +2 -2
- package/dist/lime-elements/{p-c36a9afa.entry.js → p-2512011c.entry.js} +4 -4
- package/dist/lime-elements/{p-f1d08f33.entry.js → p-30ca30ec.entry.js} +5 -5
- package/dist/lime-elements/{p-f1d08f33.entry.js.map → p-30ca30ec.entry.js.map} +1 -1
- package/dist/lime-elements/{p-ef5539b0.entry.js → p-3e1e3fe6.entry.js} +2 -2
- package/dist/lime-elements/{p-11d5d44e.js → p-5a478c15.js} +3 -3
- package/dist/lime-elements/{p-9375145d.entry.js → p-6b0ef5ee.entry.js} +3 -3
- package/dist/lime-elements/p-6c74fcaa.entry.js +2 -0
- package/dist/lime-elements/{p-c66da652.entry.js.map → p-6c74fcaa.entry.js.map} +1 -1
- package/dist/lime-elements/{p-25ff5385.entry.js → p-715d4a78.entry.js} +2 -2
- package/dist/lime-elements/p-715d4a78.entry.js.map +1 -0
- package/dist/lime-elements/p-78889be5.entry.js +2 -0
- package/dist/lime-elements/{p-2367b082.entry.js.map → p-78889be5.entry.js.map} +1 -1
- package/dist/lime-elements/{p-9ab3a908.js → p-85a982f9.js} +3 -3
- package/dist/lime-elements/{p-cb63f2d7.entry.js → p-9452ff1b.entry.js} +2 -2
- package/dist/lime-elements/{p-5e0ee0be.entry.js → p-9bb104b1.entry.js} +2 -2
- package/dist/lime-elements/p-9bb104b1.entry.js.map +1 -0
- package/dist/lime-elements/p-9f722992.js +68 -0
- package/dist/{cjs/component-b37fd9bc.js.map → lime-elements/p-9f722992.js.map} +1 -1
- package/dist/lime-elements/{p-fe1decdc.entry.js → p-a80507e5.entry.js} +2 -2
- package/dist/lime-elements/p-afefcd43.entry.js +2 -0
- package/dist/lime-elements/p-afefcd43.entry.js.map +1 -0
- package/dist/lime-elements/{p-16ad4500.entry.js → p-c4760e4a.entry.js} +2 -2
- package/dist/lime-elements/{p-16ad4500.entry.js.map → p-c4760e4a.entry.js.map} +1 -1
- package/dist/lime-elements/{p-6fc349f0.entry.js → p-c544c575.entry.js} +2 -2
- package/dist/lime-elements/p-c85589d6.entry.js +2 -0
- package/dist/lime-elements/{p-7603dc0d.entry.js.map → p-c85589d6.entry.js.map} +1 -1
- package/dist/lime-elements/{p-8da06871.entry.js → p-cd04c508.entry.js} +2 -2
- package/dist/lime-elements/{p-f764b655.js → p-d528606a.js} +8 -8
- package/dist/lime-elements/{p-43c83a69.entry.js → p-dd85a0b2.entry.js} +2 -2
- package/dist/lime-elements/{p-083d1db4.js → p-e7281e6a.js} +3 -3
- package/dist/lime-elements/p-f63f1114.js +2 -0
- package/dist/lime-elements/p-f63f1114.js.map +1 -0
- package/dist/types/components/linear-progress/linear-progress.d.ts +19 -7
- package/dist/types/components/snackbar/snackbar.d.ts +1 -2
- package/dist/types/components.d.ts +32 -4
- package/dist/types/translations/da.d.ts +2 -0
- package/dist/types/translations/en.d.ts +2 -0
- package/dist/types/translations/fi.d.ts +2 -0
- package/dist/types/translations/nl.d.ts +2 -0
- package/dist/types/translations/no.d.ts +2 -0
- package/dist/types/translations/sv.d.ts +2 -0
- package/package.json +1 -1
- package/dist/cjs/component-37425b99.js.map +0 -1
- package/dist/cjs/component-55b926ef.js.map +0 -1
- package/dist/cjs/component-a4eb183b.js.map +0 -1
- package/dist/cjs/component-cba208a8.js.map +0 -1
- package/dist/cjs/ponyfill-98ca4766.js +0 -78
- package/dist/cjs/ponyfill-98ca4766.js.map +0 -1
- package/dist/cjs/translations-6d759b59.js.map +0 -1
- package/dist/esm/component-58f68f3e.js.map +0 -1
- package/dist/esm/component-8b6ce3e9.js.map +0 -1
- package/dist/esm/component-db286494.js.map +0 -1
- package/dist/esm/component-f972b8db.js.map +0 -1
- package/dist/esm/component-fc0a08f6.js.map +0 -1
- package/dist/esm/ponyfill-30263d5e.js +0 -74
- package/dist/esm/ponyfill-30263d5e.js.map +0 -1
- package/dist/esm/translations-aee148ca.js.map +0 -1
- package/dist/lime-elements/p-2367b082.entry.js +0 -2
- package/dist/lime-elements/p-25ff5385.entry.js.map +0 -1
- package/dist/lime-elements/p-2ff3f85e.js +0 -46
- package/dist/lime-elements/p-2ff3f85e.js.map +0 -1
- package/dist/lime-elements/p-4d503318.js +0 -2
- package/dist/lime-elements/p-4d503318.js.map +0 -1
- package/dist/lime-elements/p-5e0ee0be.entry.js.map +0 -1
- package/dist/lime-elements/p-7603dc0d.entry.js +0 -2
- package/dist/lime-elements/p-9605854b.entry.js +0 -68
- package/dist/lime-elements/p-9605854b.entry.js.map +0 -1
- package/dist/lime-elements/p-c66da652.entry.js +0 -2
- package/dist/lime-elements/p-dcc97cc2.js +0 -24
- package/dist/lime-elements/p-dcc97cc2.js.map +0 -1
- /package/dist/lime-elements/{p-d2077011.entry.js.map → p-02e9b8ce.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-9b437537.entry.js.map → p-20440a35.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-83648c76.entry.js.map → p-216eb1cf.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-c36a9afa.entry.js.map → p-2512011c.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-ef5539b0.entry.js.map → p-3e1e3fe6.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-11d5d44e.js.map → p-5a478c15.js.map} +0 -0
- /package/dist/lime-elements/{p-9375145d.entry.js.map → p-6b0ef5ee.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-9ab3a908.js.map → p-85a982f9.js.map} +0 -0
- /package/dist/lime-elements/{p-cb63f2d7.entry.js.map → p-9452ff1b.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-fe1decdc.entry.js.map → p-a80507e5.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-6fc349f0.entry.js.map → p-c544c575.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-8da06871.entry.js.map → p-cd04c508.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-f764b655.js.map → p-d528606a.js.map} +0 -0
- /package/dist/lime-elements/{p-43c83a69.entry.js.map → p-dd85a0b2.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-083d1db4.js.map → p-e7281e6a.js.map} +0 -0
|
@@ -67,272 +67,80 @@
|
|
|
67
67
|
/**
|
|
68
68
|
* @prop --background-color: Color to use for progress-bar track.
|
|
69
69
|
*/
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
animation-timing-function: cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);
|
|
80
|
-
transform: translateX(83.67142%);
|
|
81
|
-
/* @alternate */
|
|
82
|
-
transform: translateX(var(--mdc-linear-progress-primary-half, 83.67142%));
|
|
83
|
-
}
|
|
84
|
-
100% {
|
|
85
|
-
transform: translateX(200.611057%);
|
|
86
|
-
/* @alternate */
|
|
87
|
-
transform: translateX(var(--mdc-linear-progress-primary-full, 200.611057%));
|
|
88
|
-
}
|
|
70
|
+
:host(limel-linear-progress) {
|
|
71
|
+
isolation: isolate;
|
|
72
|
+
position: relative;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
display: flex;
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 0.25rem;
|
|
77
|
+
border-radius: 0.25rem;
|
|
78
|
+
background-color: var(--background-color, rgb(var(--contrast-800), 0.5));
|
|
89
79
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
transform: scaleX(0.08);
|
|
97
|
-
}
|
|
98
|
-
69.15% {
|
|
99
|
-
animation-timing-function: cubic-bezier(0.06, 0.11, 0.6, 1);
|
|
100
|
-
transform: scaleX(0.661479);
|
|
101
|
-
}
|
|
102
|
-
100% {
|
|
103
|
-
transform: scaleX(0.08);
|
|
104
|
-
}
|
|
80
|
+
|
|
81
|
+
.progress {
|
|
82
|
+
height: 100%;
|
|
83
|
+
width: var(--percentage, 0%);
|
|
84
|
+
border-radius: 0.25rem;
|
|
85
|
+
background-color: var(--mdc-theme-primary);
|
|
105
86
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
25% {
|
|
112
|
-
animation-timing-function: cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);
|
|
113
|
-
transform: translateX(37.651913%);
|
|
114
|
-
/* @alternate */
|
|
115
|
-
transform: translateX(var(--mdc-linear-progress-secondary-quarter, 37.651913%));
|
|
116
|
-
}
|
|
117
|
-
48.35% {
|
|
118
|
-
animation-timing-function: cubic-bezier(0.4, 0.627035, 0.6, 0.902026);
|
|
119
|
-
transform: translateX(84.386165%);
|
|
120
|
-
/* @alternate */
|
|
121
|
-
transform: translateX(var(--mdc-linear-progress-secondary-half, 84.386165%));
|
|
122
|
-
}
|
|
123
|
-
100% {
|
|
124
|
-
transform: translateX(160.277782%);
|
|
125
|
-
/* @alternate */
|
|
126
|
-
transform: translateX(var(--mdc-linear-progress-secondary-full, 160.277782%));
|
|
127
|
-
}
|
|
87
|
+
|
|
88
|
+
:host(limel-linear-progress[indeterminate]) .progress {
|
|
89
|
+
background-color: transparent;
|
|
90
|
+
width: 100%;
|
|
128
91
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
44.15% {
|
|
139
|
-
animation-timing-function: cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);
|
|
140
|
-
transform: scaleX(0.72796);
|
|
141
|
-
}
|
|
142
|
-
100% {
|
|
143
|
-
transform: scaleX(0.08);
|
|
144
|
-
}
|
|
92
|
+
:host(limel-linear-progress[indeterminate]) .progress:before, :host(limel-linear-progress[indeterminate]) .progress:after {
|
|
93
|
+
will-change: left, right, opacity;
|
|
94
|
+
content: "";
|
|
95
|
+
position: absolute;
|
|
96
|
+
inset: 0;
|
|
97
|
+
height: 100%;
|
|
98
|
+
border-radius: 0.25rem;
|
|
99
|
+
opacity: 0;
|
|
100
|
+
background-color: var(--mdc-theme-primary);
|
|
145
101
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
102
|
+
:host(limel-linear-progress[indeterminate]) .progress:before {
|
|
103
|
+
animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
|
104
|
+
}
|
|
105
|
+
:host(limel-linear-progress[indeterminate]) .progress:after {
|
|
106
|
+
animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite 1.15s;
|
|
150
107
|
}
|
|
151
|
-
|
|
108
|
+
|
|
109
|
+
@keyframes indeterminate {
|
|
152
110
|
0% {
|
|
153
|
-
|
|
111
|
+
left: -35%;
|
|
112
|
+
right: 100%;
|
|
113
|
+
opacity: 0;
|
|
154
114
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
transform: translateX(0);
|
|
115
|
+
10%, 80% {
|
|
116
|
+
opacity: 1;
|
|
158
117
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
/* @alternate */
|
|
163
|
-
transform: translateX(var(--mdc-linear-progress-primary-half-neg, -83.67142%));
|
|
118
|
+
60% {
|
|
119
|
+
left: 100%;
|
|
120
|
+
right: -90%;
|
|
164
121
|
}
|
|
165
122
|
100% {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
123
|
+
left: 100%;
|
|
124
|
+
right: -90%;
|
|
125
|
+
opacity: 0;
|
|
169
126
|
}
|
|
170
127
|
}
|
|
171
|
-
@keyframes
|
|
128
|
+
@keyframes indeterminate-short {
|
|
172
129
|
0% {
|
|
173
|
-
|
|
174
|
-
|
|
130
|
+
left: -200%;
|
|
131
|
+
right: 100%;
|
|
132
|
+
opacity: 0;
|
|
175
133
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
transform: translateX(-37.651913%);
|
|
179
|
-
/* @alternate */
|
|
180
|
-
transform: translateX(var(--mdc-linear-progress-secondary-quarter-neg, -37.651913%));
|
|
134
|
+
10%, 80% {
|
|
135
|
+
opacity: 1;
|
|
181
136
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
/* @alternate */
|
|
186
|
-
transform: translateX(var(--mdc-linear-progress-secondary-half-neg, -84.386165%));
|
|
137
|
+
60% {
|
|
138
|
+
left: 107%;
|
|
139
|
+
right: -8%;
|
|
187
140
|
}
|
|
188
141
|
100% {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
142
|
+
left: 107%;
|
|
143
|
+
right: -8%;
|
|
144
|
+
opacity: 0;
|
|
192
145
|
}
|
|
193
|
-
}
|
|
194
|
-
@keyframes mdc-linear-progress-buffering-reverse {
|
|
195
|
-
from {
|
|
196
|
-
transform: translateX(-10px);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
.mdc-linear-progress {
|
|
200
|
-
position: relative;
|
|
201
|
-
width: 100%;
|
|
202
|
-
height: 4px;
|
|
203
|
-
transform: translateZ(0);
|
|
204
|
-
outline: 1px solid transparent;
|
|
205
|
-
overflow: hidden;
|
|
206
|
-
transition: opacity 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1);
|
|
207
|
-
}
|
|
208
|
-
.mdc-linear-progress__bar {
|
|
209
|
-
position: absolute;
|
|
210
|
-
width: 100%;
|
|
211
|
-
height: 100%;
|
|
212
|
-
animation: none;
|
|
213
|
-
transform-origin: top left;
|
|
214
|
-
transition: transform 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1);
|
|
215
|
-
}
|
|
216
|
-
.mdc-linear-progress__bar-inner {
|
|
217
|
-
display: inline-block;
|
|
218
|
-
position: absolute;
|
|
219
|
-
width: 100%;
|
|
220
|
-
animation: none;
|
|
221
|
-
border-top: 4px solid;
|
|
222
|
-
}
|
|
223
|
-
.mdc-linear-progress__buffer {
|
|
224
|
-
display: flex;
|
|
225
|
-
position: absolute;
|
|
226
|
-
width: 100%;
|
|
227
|
-
height: 100%;
|
|
228
|
-
}
|
|
229
|
-
.mdc-linear-progress__buffer-dots {
|
|
230
|
-
background-repeat: repeat-x;
|
|
231
|
-
background-size: 10px 4px;
|
|
232
|
-
flex: auto;
|
|
233
|
-
transform: rotate(180deg);
|
|
234
|
-
animation: mdc-linear-progress-buffering 250ms infinite linear;
|
|
235
|
-
}
|
|
236
|
-
.mdc-linear-progress__buffer-bar {
|
|
237
|
-
flex: 0 1 100%;
|
|
238
|
-
transition: flex-basis 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1);
|
|
239
|
-
}
|
|
240
|
-
.mdc-linear-progress__primary-bar {
|
|
241
|
-
transform: scaleX(0);
|
|
242
|
-
}
|
|
243
|
-
.mdc-linear-progress__secondary-bar {
|
|
244
|
-
display: none;
|
|
245
|
-
}
|
|
246
|
-
.mdc-linear-progress--indeterminate .mdc-linear-progress__bar {
|
|
247
|
-
transition: none;
|
|
248
|
-
}
|
|
249
|
-
.mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar {
|
|
250
|
-
left: -145.166611%;
|
|
251
|
-
}
|
|
252
|
-
.mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar {
|
|
253
|
-
left: -54.888891%;
|
|
254
|
-
display: block;
|
|
255
|
-
}
|
|
256
|
-
.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar {
|
|
257
|
-
animation: mdc-linear-progress-primary-indeterminate-translate 2s infinite linear;
|
|
258
|
-
}
|
|
259
|
-
.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar > .mdc-linear-progress__bar-inner {
|
|
260
|
-
animation: mdc-linear-progress-primary-indeterminate-scale 2s infinite linear;
|
|
261
|
-
}
|
|
262
|
-
.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar {
|
|
263
|
-
animation: mdc-linear-progress-secondary-indeterminate-translate 2s infinite linear;
|
|
264
|
-
}
|
|
265
|
-
.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar > .mdc-linear-progress__bar-inner {
|
|
266
|
-
animation: mdc-linear-progress-secondary-indeterminate-scale 2s infinite linear;
|
|
267
|
-
}
|
|
268
|
-
[dir=rtl] .mdc-linear-progress, .mdc-linear-progress[dir=rtl] {
|
|
269
|
-
/*rtl:begin:ignore*/
|
|
270
|
-
/*rtl:end:ignore*/
|
|
271
|
-
}
|
|
272
|
-
[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__bar, .mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__bar {
|
|
273
|
-
/* @noflip */ /*rtl:ignore*/
|
|
274
|
-
right: 0;
|
|
275
|
-
/* @noflip */ /*rtl:ignore*/
|
|
276
|
-
-webkit-transform-origin: center right;
|
|
277
|
-
/* @noflip */ /*rtl:ignore*/
|
|
278
|
-
transform-origin: center right;
|
|
279
|
-
}
|
|
280
|
-
[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar, .mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar {
|
|
281
|
-
animation-name: mdc-linear-progress-primary-indeterminate-translate-reverse;
|
|
282
|
-
}
|
|
283
|
-
[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar, .mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar {
|
|
284
|
-
animation-name: mdc-linear-progress-secondary-indeterminate-translate-reverse;
|
|
285
|
-
}
|
|
286
|
-
[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__buffer-dots, .mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__buffer-dots {
|
|
287
|
-
animation: mdc-linear-progress-buffering-reverse 250ms infinite linear;
|
|
288
|
-
transform: rotate(0);
|
|
289
|
-
}
|
|
290
|
-
[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar, .mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar {
|
|
291
|
-
/* @noflip */ /*rtl:ignore*/
|
|
292
|
-
right: -145.166611%;
|
|
293
|
-
/* @noflip */ /*rtl:ignore*/
|
|
294
|
-
left: auto;
|
|
295
|
-
}
|
|
296
|
-
[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar, .mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar {
|
|
297
|
-
/* @noflip */ /*rtl:ignore*/
|
|
298
|
-
right: -54.888891%;
|
|
299
|
-
/* @noflip */ /*rtl:ignore*/
|
|
300
|
-
left: auto;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.mdc-linear-progress--closed {
|
|
304
|
-
opacity: 0;
|
|
305
|
-
}
|
|
306
|
-
.mdc-linear-progress--closed-animation-off .mdc-linear-progress__buffer-dots {
|
|
307
|
-
animation: none;
|
|
308
|
-
}
|
|
309
|
-
.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar,
|
|
310
|
-
.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar .mdc-linear-progress__bar-inner {
|
|
311
|
-
animation: none;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
.mdc-linear-progress__bar-inner {
|
|
315
|
-
border-color: #26a69a;
|
|
316
|
-
/* @alternate */
|
|
317
|
-
border-color: var(--mdc-theme-primary, #26a69a);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.mdc-linear-progress__buffer-dots {
|
|
321
|
-
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23e6e6e6'/%3E%3C/svg%3E");
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.mdc-linear-progress__buffer-bar {
|
|
325
|
-
background-color: #e6e6e6;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.mdc-linear-progress {
|
|
329
|
-
text-align: left;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.mdc-linear-progress__buffer-dots {
|
|
333
|
-
background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='var(--background-color, rgba(var(--contrast-800), 0.5))'/%3E%3C/svg%3E");
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.mdc-linear-progress__buffer-bar {
|
|
337
|
-
background-color: var(--background-color, rgba(var(--contrast-800), 0.5));
|
|
338
146
|
}
|
|
@@ -1,49 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
|
2
|
+
import translate from '../../global/translations';
|
|
3
|
+
const PERCENT = 100;
|
|
3
4
|
/**
|
|
5
|
+
* The linear progress component can be used to visualize the current state of a progress in a scale;
|
|
6
|
+
* for example percentage of completion of a task.
|
|
7
|
+
*
|
|
4
8
|
* @exampleComponent limel-example-linear-progress
|
|
5
|
-
* @exampleComponent limel-example-linear-progress-color
|
|
6
9
|
* @exampleComponent limel-example-linear-progress-indeterminate
|
|
10
|
+
* @exampleComponent limel-example-linear-progress-accessible-label
|
|
11
|
+
* @exampleComponent limel-example-linear-progress-color
|
|
7
12
|
*/
|
|
8
13
|
export class LinearProgress {
|
|
9
14
|
constructor() {
|
|
15
|
+
this.language = 'en';
|
|
10
16
|
this.value = 0;
|
|
11
17
|
this.indeterminate = false;
|
|
12
|
-
|
|
13
|
-
connectedCallback() {
|
|
14
|
-
this.initialize();
|
|
15
|
-
}
|
|
16
|
-
componentDidLoad() {
|
|
17
|
-
this.initialize();
|
|
18
|
-
}
|
|
19
|
-
initialize() {
|
|
20
|
-
const element = this.host.shadowRoot.querySelector('.mdc-linear-progress');
|
|
21
|
-
if (!element) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
this.mdcLinearProgress = new MDCLinearProgress(element);
|
|
25
|
-
this.mdcLinearProgress.progress = this.value;
|
|
26
|
-
}
|
|
27
|
-
disconnectedCallback() {
|
|
28
|
-
if (this.mdcLinearProgress) {
|
|
29
|
-
this.mdcLinearProgress.destroy();
|
|
30
|
-
}
|
|
18
|
+
this.accessibleLabel = undefined;
|
|
31
19
|
}
|
|
32
20
|
render() {
|
|
33
21
|
if (!this.isFinite(this.value)) {
|
|
34
22
|
return;
|
|
35
23
|
}
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return (h(
|
|
24
|
+
const loadingText = translate.get('loading', this.language);
|
|
25
|
+
const ariaLabel = translate.get('progress-bar', this.language);
|
|
26
|
+
const ariaValueNow = this.indeterminate ? undefined : this.value;
|
|
27
|
+
const ariaValueText = this.indeterminate ? loadingText : undefined;
|
|
28
|
+
return (h(Host, { role: "progressbar", "aria-label": this.accessibleLabel || ariaLabel, "aria-live": "polite", "aria-valuemin": "0", "aria-valuemax": "1", "aria-valuenow": ariaValueNow, "aria-valuetext": ariaValueText, style: { '--percentage': `${this.value * PERCENT}%` } }, h("div", { class: "progress" })));
|
|
41
29
|
}
|
|
42
30
|
watchValue(newValue) {
|
|
43
|
-
if (!this.
|
|
31
|
+
if (!this.isFinite(newValue)) {
|
|
44
32
|
return;
|
|
45
33
|
}
|
|
46
|
-
this.
|
|
34
|
+
this.updateProgress(newValue);
|
|
35
|
+
}
|
|
36
|
+
updateProgress(value) {
|
|
37
|
+
if (this.host) {
|
|
38
|
+
this.host.style.setProperty('--percentage', `${value * PERCENT}%`);
|
|
39
|
+
}
|
|
47
40
|
}
|
|
48
41
|
isFinite(value) {
|
|
49
42
|
return Number.isFinite(value);
|
|
@@ -62,6 +55,29 @@ export class LinearProgress {
|
|
|
62
55
|
}
|
|
63
56
|
static get properties() {
|
|
64
57
|
return {
|
|
58
|
+
"language": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"mutable": false,
|
|
61
|
+
"complexType": {
|
|
62
|
+
"original": "Languages",
|
|
63
|
+
"resolved": "\"da\" | \"de\" | \"en\" | \"fi\" | \"fr\" | \"nb\" | \"nl\" | \"no\" | \"sv\"",
|
|
64
|
+
"references": {
|
|
65
|
+
"Languages": {
|
|
66
|
+
"location": "import",
|
|
67
|
+
"path": "../date-picker/date.types"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"required": false,
|
|
72
|
+
"optional": false,
|
|
73
|
+
"docs": {
|
|
74
|
+
"tags": [],
|
|
75
|
+
"text": "Defines the language for translations.\nWill translate the translatable strings on the components."
|
|
76
|
+
},
|
|
77
|
+
"attribute": "language",
|
|
78
|
+
"reflect": true,
|
|
79
|
+
"defaultValue": "'en'"
|
|
80
|
+
},
|
|
65
81
|
"value": {
|
|
66
82
|
"type": "number",
|
|
67
83
|
"mutable": false,
|
|
@@ -97,6 +113,23 @@ export class LinearProgress {
|
|
|
97
113
|
"attribute": "indeterminate",
|
|
98
114
|
"reflect": true,
|
|
99
115
|
"defaultValue": "false"
|
|
116
|
+
},
|
|
117
|
+
"accessibleLabel": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"mutable": false,
|
|
120
|
+
"complexType": {
|
|
121
|
+
"original": "string",
|
|
122
|
+
"resolved": "string",
|
|
123
|
+
"references": {}
|
|
124
|
+
},
|
|
125
|
+
"required": false,
|
|
126
|
+
"optional": true,
|
|
127
|
+
"docs": {
|
|
128
|
+
"tags": [],
|
|
129
|
+
"text": "A label used to describe the purpose of the element to users\nof assistive technologies, like screen readers.\nIf not provided, the generic word of \"Progress bar\" will be used."
|
|
130
|
+
},
|
|
131
|
+
"attribute": "accessible-label",
|
|
132
|
+
"reflect": true
|
|
100
133
|
}
|
|
101
134
|
};
|
|
102
135
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linear-progress.js","sourceRoot":"","sources":["../../../src/components/linear-progress/linear-progress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"linear-progress.js","sourceRoot":"","sources":["../../../src/components/linear-progress/linear-progress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,SAA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,GAAG,KAAK,GAAG,OAAO,GAAG,CAAC,CAAC;KACtE;EACL,CAAC;EAEO,QAAQ,CAAC,KAAc;IAC3B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;EAClC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\nimport { Languages } from '../date-picker/date.types';\nimport translate from '../../global/translations';\n\nconst PERCENT = 100;\n\n/**\n * The linear progress component can be used to visualize the current state of a progress in a scale;\n * for example percentage of completion of a task.\n *\n * @exampleComponent limel-example-linear-progress\n * @exampleComponent limel-example-linear-progress-indeterminate\n * @exampleComponent limel-example-linear-progress-accessible-label\n * @exampleComponent limel-example-linear-progress-color\n */\n@Component({\n tag: 'limel-linear-progress',\n shadow: true,\n styleUrl: 'linear-progress.scss',\n})\nexport class LinearProgress {\n /**\n * Defines the language for translations.\n * Will translate the translatable strings on the components.\n */\n @Prop({ reflect: true })\n public language: Languages = 'en';\n\n /**\n * The value of the progress bar. Should be between `0` and `1`.\n */\n @Prop({ reflect: true })\n public value: number = 0;\n\n /**\n * Puts the progress bar in an indeterminate state\n */\n @Prop({ reflect: true })\n public indeterminate: boolean = false;\n\n /**\n * A label used to describe the purpose of the element to users\n * of assistive technologies, like screen readers.\n * If not provided, the generic word of \"Progress bar\" will be used.\n */\n @Prop({ reflect: true })\n public accessibleLabel?: string;\n\n @Element()\n private host: HTMLLimelLinearProgressElement;\n\n public render() {\n if (!this.isFinite(this.value)) {\n return;\n }\n\n const loadingText = translate.get('loading', this.language);\n const ariaLabel = translate.get('progress-bar', this.language);\n const ariaValueNow = this.indeterminate ? undefined : this.value;\n const ariaValueText = this.indeterminate ? loadingText : undefined;\n\n return (\n <Host\n role=\"progressbar\"\n aria-label={this.accessibleLabel || ariaLabel}\n aria-live=\"polite\"\n aria-valuemin=\"0\"\n aria-valuemax=\"1\"\n aria-valuenow={ariaValueNow}\n aria-valuetext={ariaValueText}\n style={{ '--percentage': `${this.value * PERCENT}%` }}\n >\n <div class=\"progress\" />\n </Host>\n );\n }\n\n @Watch('value')\n protected watchValue(newValue: number) {\n if (!this.isFinite(newValue)) {\n return;\n }\n\n this.updateProgress(newValue);\n }\n\n private updateProgress(value: number): void {\n if (this.host) {\n this.host.style.setProperty('--percentage', `${value * PERCENT}%`);\n }\n }\n\n private isFinite(value: unknown) {\n return Number.isFinite(value);\n }\n}\n"]}
|
|
@@ -35,11 +35,11 @@ const hideAnimationDuration = 300;
|
|
|
35
35
|
*/
|
|
36
36
|
export class Snackbar {
|
|
37
37
|
constructor() {
|
|
38
|
-
this.firstRender = true;
|
|
39
38
|
this.handleOpen = () => {
|
|
40
39
|
if (this.isOpen) {
|
|
41
40
|
return;
|
|
42
41
|
}
|
|
42
|
+
this.isOpen = true;
|
|
43
43
|
this.closing = false;
|
|
44
44
|
container.add(this.host);
|
|
45
45
|
if (this.timeout) {
|
|
@@ -77,12 +77,10 @@ export class Snackbar {
|
|
|
77
77
|
this.closing = true;
|
|
78
78
|
this.snackbarId = createRandomString();
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
if (
|
|
82
|
-
|
|
80
|
+
componentDidLoad() {
|
|
81
|
+
if (this.open) {
|
|
82
|
+
requestAnimationFrame(this.handleOpen);
|
|
83
83
|
}
|
|
84
|
-
this.firstRender = false;
|
|
85
|
-
requestAnimationFrame(() => this.watchOpen());
|
|
86
84
|
}
|
|
87
85
|
onChangeIndex(event) {
|
|
88
86
|
event.stopPropagation();
|
|
@@ -106,7 +104,6 @@ export class Snackbar {
|
|
|
106
104
|
console.warn('The `show` method in `limel-snackbar` is deprecated. Please use the `open` property instead.');
|
|
107
105
|
if (!this.open) {
|
|
108
106
|
this.handleOpen();
|
|
109
|
-
this.isOpen = true;
|
|
110
107
|
}
|
|
111
108
|
}
|
|
112
109
|
render() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snackbar.js","sourceRoot":"","sources":["../../../src/components/snackbar/snackbar.tsx"],"names":[],"mappings":"AACA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,SAAS,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAC1C,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAMH,MAAM,OAAO,QAAQ;EA+EjB;IAFQ,gBAAW,GAAG,IAAI,CAAC;IAiDpB,eAAU,GAAG,GAAG,EAAE;MACrB,IAAI,IAAI,CAAC,MAAM,EAAE;QACb,OAAO;OACV;MAED,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;MACrB,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;MAEzB,IAAI,IAAI,CAAC,OAAO,EAAE;QACd,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,UAAU,CAC9B,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,qBAAqB,EAAE,CAAC,CAAC,CACpD,CAAC;OACL;IACL,CAAC,CAAC;IAEM,gBAAW,GAAG,GAAG,EAAE;MACvB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;QACd,OAAO;OACV;MAED,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;MAEpB,IAAI,IAAI,CAAC,SAAS,EAAE;QAChB,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7B,IAAI,C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event,\n EventEmitter,\n h,\n Listen,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport translate from '../../global/translations';\nimport { SnackbarContainer } from './container';\nimport { createRandomString } from 'src/util/random-string';\n\nconst container = new SnackbarContainer();\nconst hideAnimationDuration = 300;\n\n/**\n * A Snackbar –also known as \"Toast\"– is used to inform the end user\n * about an action or a process in the system.\n * The information could vary from announcing that a process has just started,\n * is taking place now, has ended, or has been interrupted or canceled.\n *\n * The information that you provide using a snackbar should be:\n * - temporary\n * - contextual\n * - short\n * - and most importantly, ignorable.\n *\n * It means if the user misses the information, it shouldn't be a big deal.\n *\n * :::note\n * If the information you want to display has a higher importance or priority,\n * and you need to make sure that the user takes an action to dismiss it,\n * consider using the [Banner](/#/component/limel-banner/) component instead.\n * For more complex interactions and for delivering more detailed information,\n * [Dialog](/#/component/limel-dialog/) is a better choice.\n * :::\n *\n * @exampleComponent limel-example-snackbar\n * @exampleComponent limel-example-snackbar-with-action\n * @exampleComponent limel-example-snackbar-with-changing-messages\n * @exampleComponent limel-example-snackbar-dismissible\n * @exampleComponent limel-example-snackbar-persistent\n * @exampleComponent limel-example-snackbar-persistent-non-dismissible\n */\n@Component({\n tag: 'limel-snackbar',\n shadow: true,\n styleUrl: 'snackbar.scss',\n})\nexport class Snackbar {\n /**\n * `true` if the snackbar is open, `false` otherwise.\n */\n @Prop({ reflect: true })\n public open: boolean = false;\n\n /**\n * The text message to display.\n */\n @Prop()\n public message: string;\n\n /**\n * The amount of time in milliseconds to show the snackbar.\n * If set to `null`, the snackbar will be persistent.\n * This means:\n * - either the end user will need to close is manually,\n * which requires the `dismissible` property to be set to `true`.\n * - or the snackbar needs to be closed programmatically.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line no-magic-numbers\n public timeout?: number = 5000;\n\n /**\n * The text to display for the action button.\n */\n @Prop()\n public actionText: string;\n\n /**\n * When `true` displays a dismiss button on the snackbar,\n * allowing users to close it.\n */\n @Prop()\n public dismissible: boolean = true;\n\n /**\n * Whether to show the snackbar with space for multiple lines of text\n * @deprecated Setting this property no longer has any effect. The property will be removed in a future major version.\n */\n @Prop()\n public multiline: boolean;\n\n /**\n * Defines the language for translations.\n */\n @Prop()\n public language: Languages = 'en';\n\n @Element()\n private host: HTMLLimelSnackbarElement;\n\n /**\n * Emitted when the action button is pressed\n */\n @Event()\n private action: EventEmitter<void>;\n\n /**\n * Emitted when the snackbar hides itself\n */\n @Event()\n private hide: EventEmitter<void>;\n\n @State()\n private offset: number = 0;\n\n @State()\n private isOpen: boolean = false;\n\n @State()\n private closing: boolean = true;\n\n private snackbarId: string;\n private timeoutId?: number;\n private firstRender = true;\n\n public constructor() {\n this.snackbarId = createRandomString();\n }\n\n public componentDidRender() {\n if (!this.firstRender) {\n return;\n }\n\n this.firstRender = false;\n\n requestAnimationFrame(() => this.watchOpen());\n }\n\n @Listen('changeOffset')\n protected onChangeIndex(event: CustomEvent<number>) {\n event.stopPropagation();\n this.offset = event.detail;\n }\n\n @Watch('open')\n protected watchOpen() {\n if (this.open) {\n this.handleOpen();\n } else {\n this.handleClose();\n }\n\n this.isOpen = this.open;\n }\n\n /**\n * Show the snackbar\n * @deprecated Use the `open` property instead.\n */\n @Method()\n public async show() {\n // eslint-disable-next-line no-console\n console.warn(\n 'The `show` method in `limel-snackbar` is deprecated. Please use the `open` property instead.',\n );\n if (!this.open) {\n this.handleOpen();\n this.isOpen = true;\n }\n }\n\n public handleOpen = () => {\n if (this.isOpen) {\n return;\n }\n\n this.closing = false;\n container.add(this.host);\n\n if (this.timeout) {\n this.timeoutId = window.setTimeout(\n this.handleClose,\n Math.max(this.timeout - hideAnimationDuration, 0),\n );\n }\n };\n\n private handleClose = () => {\n if (!this.isOpen) {\n return;\n }\n\n this.closing = true;\n\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n this.timeoutId = undefined;\n }\n\n setTimeout(() => {\n this.isOpen = false;\n container.remove(this.host);\n this.hide.emit();\n this.offset = 0;\n }, hideAnimationDuration);\n };\n\n public render() {\n return (\n <aside\n popover=\"manual\"\n style={{\n '--snackbar-timeout': `${this.timeout}ms`,\n '--snackbar-distance-to-top-edge': `${this.offset}px`,\n }}\n class={{\n open: this.open,\n 'is-closing': this.closing,\n }}\n id={this.snackbarId}\n role={this.setAriaRoles()}\n aria-relevant={this.open ? 'additions' : undefined}\n >\n <div class=\"surface\" aria-atomic=\"false\">\n <div class=\"label\">{this.message}</div>\n {this.renderActions(this.actionText)}\n {this.renderDismissButton(this.dismissible)}\n </div>\n </aside>\n );\n }\n\n private setAriaRoles() {\n if (!this.open) {\n return undefined;\n }\n\n if (!this.timeout) {\n return 'alertdialog';\n }\n\n return 'status';\n }\n\n private handleClickAction = () => {\n this.action.emit();\n };\n\n private renderActions(actionText: string) {\n if (!actionText) {\n return;\n }\n\n return (\n <div class=\"actions\" aria-atomic=\"true\">\n {this.renderActionButton(actionText)}\n </div>\n );\n }\n\n private renderActionButton(actionText: string) {\n if (!actionText) {\n return;\n }\n\n return (\n <limel-button label={actionText} onClick={this.handleClickAction} />\n );\n }\n\n private renderDismissButton(dismissible: boolean) {\n if (!dismissible) {\n return;\n }\n\n const label = translate.get('snackbar.dismiss', this.language);\n\n return (\n <div class=\"dismiss\">\n {this.renderTimeoutVisualization()}\n <limel-icon-button\n class=\"dismiss-button\"\n icon=\"multiply\"\n label={label}\n onClick={this.handleClose}\n aria-controls={this.snackbarId}\n />\n </div>\n );\n }\n\n private renderTimeoutVisualization() {\n if (!this.timeout) {\n return;\n }\n\n return (\n <svg width=\"36\" height=\"36\" viewBox=\"0 0 36 36\">\n <circle r=\"18\" cx=\"18\" cy=\"18\" fill=\"var(--track-color)\" />\n <path\n class=\"track\"\n d=\"M 18,18 m -16,0 a 16,16 0 1,0 32,0 a 16,16 0 1,0 -32,0\"\n stroke=\"var(--fill-color)\"\n />\n </svg>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"snackbar.js","sourceRoot":"","sources":["../../../src/components/snackbar/snackbar.tsx"],"names":[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AC,GAAG,CAAC,kBAAkB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAE/D,OAAO,CACH,WAAK,KAAK,EAAC,SAAS;MACf,IAAI,CAAC,0BAA0B,EAAE;MAClC,yBACI,KAAK,EAAC,gBAAgB,EACtB,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,IAAI,CAAC,WAAW,mBACV,IAAI,CAAC,UAAU,GAChC,CACA,CACT,CAAC;EACN,CAAC;EAEO,0BAA0B;IAC9B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;MACf,OAAO;KACV;IAED,OAAO,CACH,WAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW;MAC3C,cAAQ,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,IAAI,EAAC,oBAAoB,GAAG;MAC3D,YACI,KAAK,EAAC,OAAO,EACb,CAAC,EAAC,wDAAwD,EAC1D,MAAM,EAAC,mBAAmB,GAC5B,CACA,CACT,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Languages } from '../date-picker/date.types';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Listen,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport translate from '../../global/translations';\nimport { SnackbarContainer } from './container';\nimport { createRandomString } from 'src/util/random-string';\n\nconst container = new SnackbarContainer();\nconst hideAnimationDuration = 300;\n\n/**\n * A Snackbar –also known as \"Toast\"– is used to inform the end user\n * about an action or a process in the system.\n * The information could vary from announcing that a process has just started,\n * is taking place now, has ended, or has been interrupted or canceled.\n *\n * The information that you provide using a snackbar should be:\n * - temporary\n * - contextual\n * - short\n * - and most importantly, ignorable.\n *\n * It means if the user misses the information, it shouldn't be a big deal.\n *\n * :::note\n * If the information you want to display has a higher importance or priority,\n * and you need to make sure that the user takes an action to dismiss it,\n * consider using the [Banner](/#/component/limel-banner/) component instead.\n * For more complex interactions and for delivering more detailed information,\n * [Dialog](/#/component/limel-dialog/) is a better choice.\n * :::\n *\n * @exampleComponent limel-example-snackbar\n * @exampleComponent limel-example-snackbar-with-action\n * @exampleComponent limel-example-snackbar-with-changing-messages\n * @exampleComponent limel-example-snackbar-dismissible\n * @exampleComponent limel-example-snackbar-persistent\n * @exampleComponent limel-example-snackbar-persistent-non-dismissible\n */\n@Component({\n tag: 'limel-snackbar',\n shadow: true,\n styleUrl: 'snackbar.scss',\n})\nexport class Snackbar {\n /**\n * `true` if the snackbar is open, `false` otherwise.\n */\n @Prop({ reflect: true })\n public open: boolean = false;\n\n /**\n * The text message to display.\n */\n @Prop()\n public message: string;\n\n /**\n * The amount of time in milliseconds to show the snackbar.\n * If set to `null`, the snackbar will be persistent.\n * This means:\n * - either the end user will need to close is manually,\n * which requires the `dismissible` property to be set to `true`.\n * - or the snackbar needs to be closed programmatically.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line no-magic-numbers\n public timeout?: number = 5000;\n\n /**\n * The text to display for the action button.\n */\n @Prop()\n public actionText: string;\n\n /**\n * When `true` displays a dismiss button on the snackbar,\n * allowing users to close it.\n */\n @Prop()\n public dismissible: boolean = true;\n\n /**\n * Whether to show the snackbar with space for multiple lines of text\n * @deprecated Setting this property no longer has any effect. The property will be removed in a future major version.\n */\n @Prop()\n public multiline: boolean;\n\n /**\n * Defines the language for translations.\n */\n @Prop()\n public language: Languages = 'en';\n\n @Element()\n private host: HTMLLimelSnackbarElement;\n\n /**\n * Emitted when the action button is pressed\n */\n @Event()\n private action: EventEmitter<void>;\n\n /**\n * Emitted when the snackbar hides itself\n */\n @Event()\n private hide: EventEmitter<void>;\n\n @State()\n private offset: number = 0;\n\n @State()\n private isOpen: boolean = false;\n\n @State()\n private closing: boolean = true;\n\n private snackbarId: string;\n private timeoutId?: number;\n\n public constructor() {\n this.snackbarId = createRandomString();\n }\n\n public componentDidLoad() {\n if (this.open) {\n requestAnimationFrame(this.handleOpen);\n }\n }\n\n @Listen('changeOffset')\n protected onChangeIndex(event: CustomEvent<number>) {\n event.stopPropagation();\n this.offset = event.detail;\n }\n\n @Watch('open')\n protected watchOpen() {\n if (this.open) {\n this.handleOpen();\n } else {\n this.handleClose();\n }\n\n this.isOpen = this.open;\n }\n\n /**\n * Show the snackbar\n * @deprecated Use the `open` property instead.\n */\n @Method()\n public async show() {\n // eslint-disable-next-line no-console\n console.warn(\n 'The `show` method in `limel-snackbar` is deprecated. Please use the `open` property instead.',\n );\n if (!this.open) {\n this.handleOpen();\n }\n }\n\n public handleOpen = () => {\n if (this.isOpen) {\n return;\n }\n\n this.isOpen = true;\n this.closing = false;\n container.add(this.host);\n\n if (this.timeout) {\n this.timeoutId = window.setTimeout(\n this.handleClose,\n Math.max(this.timeout - hideAnimationDuration, 0),\n );\n }\n };\n\n private handleClose = () => {\n if (!this.isOpen) {\n return;\n }\n\n this.closing = true;\n\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n this.timeoutId = undefined;\n }\n\n setTimeout(() => {\n this.isOpen = false;\n container.remove(this.host);\n this.hide.emit();\n this.offset = 0;\n }, hideAnimationDuration);\n };\n\n public render() {\n return (\n <aside\n popover=\"manual\"\n style={{\n '--snackbar-timeout': `${this.timeout}ms`,\n '--snackbar-distance-to-top-edge': `${this.offset}px`,\n }}\n class={{\n open: this.open,\n 'is-closing': this.closing,\n }}\n id={this.snackbarId}\n role={this.setAriaRoles()}\n aria-relevant={this.open ? 'additions' : undefined}\n >\n <div class=\"surface\" aria-atomic=\"false\">\n <div class=\"label\">{this.message}</div>\n {this.renderActions(this.actionText)}\n {this.renderDismissButton(this.dismissible)}\n </div>\n </aside>\n );\n }\n\n private setAriaRoles() {\n if (!this.open) {\n return undefined;\n }\n\n if (!this.timeout) {\n return 'alertdialog';\n }\n\n return 'status';\n }\n\n private handleClickAction = () => {\n this.action.emit();\n };\n\n private renderActions(actionText: string) {\n if (!actionText) {\n return;\n }\n\n return (\n <div class=\"actions\" aria-atomic=\"true\">\n {this.renderActionButton(actionText)}\n </div>\n );\n }\n\n private renderActionButton(actionText: string) {\n if (!actionText) {\n return;\n }\n\n return (\n <limel-button label={actionText} onClick={this.handleClickAction} />\n );\n }\n\n private renderDismissButton(dismissible: boolean) {\n if (!dismissible) {\n return;\n }\n\n const label = translate.get('snackbar.dismiss', this.language);\n\n return (\n <div class=\"dismiss\">\n {this.renderTimeoutVisualization()}\n <limel-icon-button\n class=\"dismiss-button\"\n icon=\"multiply\"\n label={label}\n onClick={this.handleClose}\n aria-controls={this.snackbarId}\n />\n </div>\n );\n }\n\n private renderTimeoutVisualization() {\n if (!this.timeout) {\n return;\n }\n\n return (\n <svg width=\"36\" height=\"36\" viewBox=\"0 0 36 36\">\n <circle r=\"18\" cx=\"18\" cy=\"18\" fill=\"var(--track-color)\" />\n <path\n class=\"track\"\n d=\"M 18,18 m -16,0 a 16,16 0 1,0 32,0 a 16,16 0 1,0 -32,0\"\n stroke=\"var(--fill-color)\"\n />\n </svg>\n );\n }\n}\n"]}
|
|
@@ -2,6 +2,7 @@ export default {
|
|
|
2
2
|
remove: 'Fjern',
|
|
3
3
|
save: 'Gem',
|
|
4
4
|
cancel: 'Annullér',
|
|
5
|
+
loading: 'Indlæser…',
|
|
5
6
|
'callout.note': 'Bemærk',
|
|
6
7
|
'callout.important': 'Vigtig',
|
|
7
8
|
'callout.tip': 'Tip',
|
|
@@ -32,5 +33,6 @@ export default {
|
|
|
32
33
|
'editor-link-menu.link': 'Link',
|
|
33
34
|
'editor-menu.code-block': 'Kodeblok',
|
|
34
35
|
'editor-menu.code': 'Kode',
|
|
36
|
+
'progress-bar': 'Fremskridtsindikator',
|
|
35
37
|
};
|
|
36
38
|
//# sourceMappingURL=da.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"da.js","sourceRoot":"","sources":["../../src/translations/da.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,OAAO;EACf,IAAI,EAAE,KAAK;EACX,MAAM,EAAE,UAAU;EAClB,cAAc,EAAE,QAAQ;EACxB,mBAAmB,EAAE,QAAQ;EAC7B,aAAa,EAAE,KAAK;EACpB,iBAAiB,EAAE,UAAU;EAC7B,iBAAiB,EAAE,UAAU;EAC7B,mBAAmB,EAAE,MAAM;EAC3B,2BAA2B,EAAE,OAAO;EACpC,6BAA6B,EAAE,SAAS;EACxC,0BAA0B,EAAE,IAAI;EAChC,oBAAoB,EAAE,UAAU;EAChC,yBAAyB,EACrB,oDAAoD;EACxD,0CAA0C,EAAE,2BAA2B;EACvE,sBAAsB,EAAE,MAAM;EAC9B,6BAA6B,EAAE,kBAAkB;EACjD,gCAAgC,EAAE,kBAAkB;EACpD,6BAA6B,EAAE,kBAAkB;EACjD,0BAA0B,EAAE,OAAO;EACnC,kBAAkB,EAAE,KAAK;EACzB,oBAAoB,EAAE,QAAQ;EAC9B,gBAAgB,EAAE,cAAc;EAChC,gBAAgB,EAAE,cAAc;EAChC,gBAAgB,EAAE,cAAc;EAChC,2BAA2B,EAAE,YAAY;EACzC,2BAA2B,EAAE,kBAAkB;EAC/C,wBAAwB,EAAE,WAAW;EACrC,kBAAkB,EAAE,aAAa;EACjC,uBAAuB,EAAE,OAAO;EAChC,uBAAuB,EAAE,MAAM;EAC/B,wBAAwB,EAAE,UAAU;EACpC,kBAAkB,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"da.js","sourceRoot":"","sources":["../../src/translations/da.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,OAAO;EACf,IAAI,EAAE,KAAK;EACX,MAAM,EAAE,UAAU;EAClB,OAAO,EAAE,WAAW;EACpB,cAAc,EAAE,QAAQ;EACxB,mBAAmB,EAAE,QAAQ;EAC7B,aAAa,EAAE,KAAK;EACpB,iBAAiB,EAAE,UAAU;EAC7B,iBAAiB,EAAE,UAAU;EAC7B,mBAAmB,EAAE,MAAM;EAC3B,2BAA2B,EAAE,OAAO;EACpC,6BAA6B,EAAE,SAAS;EACxC,0BAA0B,EAAE,IAAI;EAChC,oBAAoB,EAAE,UAAU;EAChC,yBAAyB,EACrB,oDAAoD;EACxD,0CAA0C,EAAE,2BAA2B;EACvE,sBAAsB,EAAE,MAAM;EAC9B,6BAA6B,EAAE,kBAAkB;EACjD,gCAAgC,EAAE,kBAAkB;EACpD,6BAA6B,EAAE,kBAAkB;EACjD,0BAA0B,EAAE,OAAO;EACnC,kBAAkB,EAAE,KAAK;EACzB,oBAAoB,EAAE,QAAQ;EAC9B,gBAAgB,EAAE,cAAc;EAChC,gBAAgB,EAAE,cAAc;EAChC,gBAAgB,EAAE,cAAc;EAChC,2BAA2B,EAAE,YAAY;EACzC,2BAA2B,EAAE,kBAAkB;EAC/C,wBAAwB,EAAE,WAAW;EACrC,kBAAkB,EAAE,aAAa;EACjC,uBAAuB,EAAE,OAAO;EAChC,uBAAuB,EAAE,MAAM;EAC/B,wBAAwB,EAAE,UAAU;EACpC,kBAAkB,EAAE,MAAM;EAC1B,cAAc,EAAE,sBAAsB;CACzC,CAAC","sourcesContent":["export default {\n remove: 'Fjern',\n save: 'Gem',\n cancel: 'Annullér',\n loading: 'Indlæser…',\n 'callout.note': 'Bemærk',\n 'callout.important': 'Vigtig',\n 'callout.tip': 'Tip',\n 'callout.caution': 'Advarsel',\n 'callout.warning': 'Advarsel',\n 'date-picker.today': 'Idag',\n 'date-picker.month.heading': 'Måned',\n 'date-picker.quarter.heading': 'Kvartal',\n 'date-picker.year.heading': 'År',\n 'chip-set.clear-all': 'Ryd alle',\n 'file.drag-and-drop-tips':\n 'Træk & slip filen her, eller klik for at gennemse.',\n 'file-viewer.message.unsupported-filetype': 'Denne fil kan ikke vises!',\n 'file-viewer.download': 'Hent',\n 'file-viewer.exit-fullscreen': 'Afslut fuldskærm',\n 'file-viewer.open-in-fullscreen': 'Åbn i fuld skærm',\n 'file-viewer.open-in-new-tab': 'Åbn i en ny fane',\n 'file-viewer.more-actions': 'Mere…',\n 'editor-menu.bold': 'Fed',\n 'editor-menu.italic': 'Kursiv',\n 'editor-menu.h1': 'Overskrift 1',\n 'editor-menu.h2': 'Overskrift 2',\n 'editor-menu.h3': 'Overskrift 3',\n 'editor-menu.bulleted-list': 'Punktliste',\n 'editor-menu.numbered-list': 'Nummereret liste',\n 'editor-menu.blockquote': 'Blokcitat',\n 'editor-menu.link': 'Tilføj link',\n 'editor-link-menu.text': 'Tekst',\n 'editor-link-menu.link': 'Link',\n 'editor-menu.code-block': 'Kodeblok',\n 'editor-menu.code': 'Kode',\n 'progress-bar': 'Fremskridtsindikator',\n};\n"]}
|
|
@@ -2,6 +2,7 @@ export default {
|
|
|
2
2
|
remove: 'Remove',
|
|
3
3
|
save: 'Save',
|
|
4
4
|
cancel: 'Cancel',
|
|
5
|
+
loading: 'Loading…',
|
|
5
6
|
'callout.note': 'Note',
|
|
6
7
|
'callout.important': 'Important',
|
|
7
8
|
'callout.tip': 'Tip',
|
|
@@ -33,5 +34,6 @@ export default {
|
|
|
33
34
|
'editor-link-menu.link': 'Link',
|
|
34
35
|
'editor-menu.code-block': 'Code block',
|
|
35
36
|
'editor-menu.code': 'Code',
|
|
37
|
+
'progress-bar': 'Progress bar',
|
|
36
38
|
};
|
|
37
39
|
//# sourceMappingURL=en.js.map
|