@limetech/lime-elements 36.3.0-next.9 → 36.3.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/README.md +2 -2
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-badge.cjs.entry.js +4 -6
- package/dist/cjs/limel-button-group.cjs.entry.js +21 -6
- package/dist/cjs/limel-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-callout.cjs.entry.js +54 -0
- package/dist/cjs/limel-chip-set.cjs.entry.js +13 -3
- package/dist/cjs/limel-code-editor.cjs.entry.js +1 -1
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +3 -12
- package/dist/cjs/limel-color-picker-palette.cjs.entry.js +1 -1
- package/dist/cjs/limel-color-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-date-picker.cjs.entry.js +47 -7
- package/dist/cjs/limel-dialog.cjs.entry.js +1 -1
- package/dist/cjs/limel-dock-button.cjs.entry.js +7 -2
- package/dist/cjs/limel-dock.cjs.entry.js +1 -1
- package/dist/cjs/limel-file.cjs.entry.js +1 -1
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +99 -118
- package/dist/cjs/limel-form.cjs.entry.js +79 -1
- package/dist/cjs/limel-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js +4 -1
- package/dist/cjs/limel-input-field.cjs.entry.js +2 -2
- package/dist/cjs/limel-list_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-menu-list.cjs.entry.js +7 -1
- package/dist/cjs/limel-menu.cjs.entry.js +10 -2
- package/dist/cjs/limel-portal.cjs.entry.js +3 -4
- package/dist/cjs/limel-select.cjs.entry.js +1 -1
- package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
- package/dist/cjs/limel-slider.cjs.entry.js +5 -5
- package/dist/cjs/limel-snackbar.cjs.entry.js +2 -2
- package/dist/cjs/limel-spinner.cjs.entry.js +1 -1
- package/dist/cjs/limel-split-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-tab-bar.cjs.entry.js +1 -1
- package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dateFormatter-d7a8d40d.js → sv-dffe48b5.js} +222 -173
- package/dist/cjs/{translations-ca7279bc.js → translations-f8080c48.js} +30 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/badge/badge.css +34 -19
- package/dist/collection/components/badge/badge.js +7 -7
- package/dist/collection/components/banner/banner.css +1 -2
- package/dist/collection/components/button/button.css +31 -41
- package/dist/collection/components/button-group/button-group.css +44 -42
- package/dist/collection/components/button-group/button-group.js +25 -6
- package/dist/collection/components/callout/callout.css +77 -0
- package/dist/collection/components/callout/callout.helpers.js +27 -0
- package/dist/collection/components/callout/callout.js +139 -0
- package/dist/collection/components/callout/callout.types.js +1 -0
- package/dist/collection/components/checkbox/checkbox.css +22 -45
- package/dist/collection/components/chip-set/chip-set.css +219 -405
- package/dist/collection/components/chip-set/chip-set.js +6 -2
- package/dist/collection/components/circular-progress/circular-progress.css +8 -0
- package/dist/collection/components/code-editor/code-editor.css +11 -8
- package/dist/collection/components/collapsible-section/collapsible-section.css +87 -55
- package/dist/collection/components/collapsible-section/collapsible-section.js +2 -11
- package/dist/collection/components/color-picker/color-picker-palette.css +16 -14
- package/dist/collection/components/color-picker/color-picker.css +7 -5
- package/dist/collection/components/date-picker/date-picker.js +30 -5
- package/dist/collection/components/date-picker/dateFormatter.js +7 -3
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.css +11 -1
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +23 -8
- package/dist/collection/components/date-picker/pickers/Picker.js +11 -8
- package/dist/collection/components/dialog/dialog.css +14 -27
- package/dist/collection/components/dock/dock-button/dock-button.css +17 -2
- package/dist/collection/components/dock/dock-button/dock-button.js +6 -1
- package/dist/collection/components/dock/dock.css +19 -1
- package/dist/collection/components/dock/dock.js +1 -0
- package/dist/collection/components/file/file.js +1 -1
- package/dist/collection/components/form/form.css +122 -18
- package/dist/collection/components/form/form.js +1 -0
- package/dist/collection/components/form/form.types.js +8 -0
- package/dist/collection/components/form/row/row.js +47 -0
- package/dist/collection/components/form/templates/object-field.js +5 -0
- package/dist/collection/components/form/templates/row-layout.js +20 -0
- package/dist/collection/components/header/header.css +8 -0
- package/dist/collection/components/icon-button/icon-button.css +15 -12
- package/dist/collection/components/info-tile/info-tile.css +13 -17
- package/dist/collection/components/info-tile/info-tile.js +3 -0
- package/dist/collection/components/input-field/input-field.css +197 -363
- package/dist/collection/components/input-field/input-field.js +1 -1
- package/dist/collection/components/linear-progress/linear-progress.css +7 -14
- package/dist/collection/components/list/list.css +388 -751
- package/dist/collection/components/menu/menu.css +19 -1
- package/dist/collection/components/menu/menu.js +10 -1
- package/dist/collection/components/menu-list/menu-list-renderer.js +6 -1
- package/dist/collection/components/menu-list/menu-list.css +400 -752
- package/dist/collection/components/menu-surface/menu-surface.css +13 -26
- package/dist/collection/components/popover-surface/popover-surface.css +8 -0
- package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +8 -0
- package/dist/collection/components/select/select.css +174 -323
- package/dist/collection/components/shortcut/shortcut.css +9 -7
- package/dist/collection/components/slider/slider.css +87 -98
- package/dist/collection/components/slider/slider.js +5 -5
- package/dist/collection/components/snackbar/snackbar.css +19 -34
- package/dist/collection/components/snackbar/snackbar.js +1 -1
- package/dist/collection/components/spinner/spinner.css +4 -0
- package/dist/collection/components/split-button/split-button.css +15 -4
- package/dist/collection/components/switch/switch.css +21 -49
- package/dist/collection/components/tab-bar/tab-bar.css +20 -19
- package/dist/collection/components/tab-panel/tab-panel.css +5 -0
- package/dist/collection/components/table/table.css +33 -0
- package/dist/collection/icons/idea.svg +593 -0
- package/dist/collection/icons/info.svg +593 -0
- package/dist/collection/style/internal/z-index.scss +0 -1
- package/dist/collection/style/mixins.scss +15 -4
- package/dist/collection/translations/da.js +5 -0
- package/dist/collection/translations/en.js +5 -0
- package/dist/collection/translations/fi.js +5 -0
- package/dist/collection/translations/nl.js +5 -0
- package/dist/collection/translations/no.js +5 -0
- package/dist/collection/translations/sv.js +5 -0
- package/dist/esm/{keycodes-9f971b46.js → keycodes-44c01beb.js} +1 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-badge.entry.js +4 -6
- package/dist/esm/limel-button-group.entry.js +21 -6
- package/dist/esm/limel-button.entry.js +1 -1
- package/dist/esm/limel-callout.entry.js +50 -0
- package/dist/esm/limel-chip-set.entry.js +14 -4
- package/dist/esm/limel-code-editor.entry.js +1 -1
- package/dist/esm/limel-collapsible-section.entry.js +3 -12
- package/dist/esm/limel-color-picker-palette.entry.js +1 -1
- package/dist/esm/limel-color-picker.entry.js +1 -1
- package/dist/esm/limel-date-picker.entry.js +46 -6
- package/dist/esm/limel-dialog.entry.js +1 -1
- package/dist/esm/limel-dock-button.entry.js +7 -2
- package/dist/esm/limel-dock.entry.js +1 -1
- package/dist/esm/limel-file.entry.js +1 -1
- package/dist/esm/limel-flatpickr-adapter.entry.js +99 -118
- package/dist/esm/limel-form.entry.js +79 -1
- package/dist/esm/limel-icon-button.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js +4 -1
- package/dist/esm/limel-input-field.entry.js +3 -3
- package/dist/esm/limel-list_2.entry.js +2 -2
- package/dist/esm/limel-menu-list.entry.js +7 -1
- package/dist/esm/limel-menu.entry.js +10 -2
- package/dist/esm/limel-picker.entry.js +1 -1
- package/dist/esm/limel-popover_4.entry.js +1 -1
- package/dist/esm/limel-portal.entry.js +3 -4
- package/dist/esm/limel-select.entry.js +2 -2
- package/dist/esm/limel-shortcut.entry.js +1 -1
- package/dist/esm/limel-slider.entry.js +6 -6
- package/dist/esm/limel-snackbar.entry.js +2 -2
- package/dist/esm/limel-spinner.entry.js +1 -1
- package/dist/esm/limel-split-button.entry.js +1 -1
- package/dist/esm/limel-tab-bar.entry.js +1 -1
- package/dist/esm/limel-tab-panel.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dateFormatter-784c3334.js → sv-336c4576.js} +222 -173
- package/dist/esm/{translations-0d0ee941.js → translations-f88bb584.js} +30 -0
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-a8d38277.entry.js → p-10e259de.entry.js} +1 -1
- package/dist/lime-elements/{p-934456bc.entry.js → p-123f5fbb.entry.js} +1 -1
- package/dist/lime-elements/{p-c234a991.entry.js → p-157e0417.entry.js} +2 -2
- package/dist/lime-elements/p-2f9918a3.entry.js +1 -0
- package/dist/lime-elements/p-2fd478df.entry.js +1 -0
- package/dist/lime-elements/p-3be2dfc7.entry.js +1 -0
- package/dist/lime-elements/{p-06f2f6b4.entry.js → p-3fda3473.entry.js} +1 -1
- package/dist/lime-elements/p-46a76d55.entry.js +1 -0
- package/dist/lime-elements/p-4a62273c.entry.js +1 -0
- package/dist/lime-elements/{p-73df4d83.js → p-4dd9a5a5.js} +5 -3
- package/dist/lime-elements/{p-d1187867.entry.js → p-4eeabc1f.entry.js} +1 -1
- package/dist/lime-elements/{p-2f2ea041.entry.js → p-4fcd3337.entry.js} +1 -1
- package/dist/lime-elements/{p-029360c8.entry.js → p-50dbd665.entry.js} +1 -1
- package/dist/lime-elements/{p-e5213a54.entry.js → p-55c8cb64.entry.js} +4 -4
- package/dist/lime-elements/{p-cad7cda1.entry.js → p-58e9df30.entry.js} +1 -1
- package/dist/lime-elements/p-73613abb.entry.js +82 -0
- package/dist/lime-elements/{p-6784c5c3.entry.js → p-7d7d19de.entry.js} +1 -1
- package/dist/lime-elements/{p-9ec08ebc.entry.js → p-8178b348.entry.js} +3 -3
- package/dist/lime-elements/{p-004aad18.entry.js → p-9336fd7f.entry.js} +1 -1
- package/dist/lime-elements/{p-a0c78744.entry.js → p-a88f2922.entry.js} +2 -2
- package/dist/lime-elements/p-b1ae3d1f.entry.js +126 -0
- package/dist/lime-elements/p-b40f37d7.entry.js +1 -0
- package/dist/lime-elements/p-b59e4287.js +1 -0
- package/dist/lime-elements/{p-405207fa.entry.js → p-b80de0ea.entry.js} +1 -1
- package/dist/lime-elements/p-c47cb4c3.entry.js +1 -0
- package/dist/lime-elements/{p-b079fc71.entry.js → p-cc3529bb.entry.js} +1 -1
- package/dist/lime-elements/{p-93ad8b90.entry.js → p-d0084a70.entry.js} +1 -1
- package/dist/lime-elements/p-d16b27b9.entry.js +1 -0
- package/dist/lime-elements/{p-216ffe20.js → p-d7801e00.js} +1 -1
- package/dist/lime-elements/p-d87e2f26.entry.js +1 -0
- package/dist/lime-elements/p-d955c169.entry.js +59 -0
- package/dist/lime-elements/p-da536426.entry.js +1 -0
- package/dist/lime-elements/p-e69231c2.entry.js +16 -0
- package/dist/lime-elements/p-eda87f8c.entry.js +1 -0
- package/dist/lime-elements/{p-0bf916a0.entry.js → p-edbd8d62.entry.js} +1 -1
- package/dist/lime-elements/p-f11e7ce1.entry.js +1 -0
- package/dist/lime-elements/{p-5409b92f.entry.js → p-f979c0f2.entry.js} +1 -1
- package/dist/lime-elements/style/internal/z-index.scss +0 -1
- package/dist/lime-elements/style/mixins.scss +15 -4
- package/dist/scss/mixins.scss +186 -0
- package/dist/types/components/badge/badge.d.ts +4 -2
- package/dist/types/components/button/button.types.d.ts +4 -0
- package/dist/types/components/button-group/button-group.d.ts +4 -0
- package/dist/types/components/callout/callout.d.ts +52 -0
- package/dist/types/components/callout/callout.helpers.d.ts +2 -0
- package/dist/types/components/callout/callout.types.d.ts +11 -0
- package/dist/types/components/chip-set/chip-set.d.ts +1 -1
- package/dist/types/components/collapsible-section/collapsible-section.d.ts +0 -1
- package/dist/types/components/date-picker/date-picker.d.ts +10 -0
- package/dist/types/components/date-picker/date.types.d.ts +1 -1
- package/dist/types/components/date-picker/dateFormatter.d.ts +3 -2
- package/dist/types/components/date-picker/flatpickr-adapter/flatpickr-adapter.d.ts +1 -1
- package/dist/types/components/date-picker/pickers/Picker.d.ts +4 -2
- package/dist/types/components/dock/dock-button/dock-button.d.ts +1 -0
- package/dist/types/components/dock/dock.d.ts +1 -0
- package/dist/types/components/dock/dock.types.d.ts +4 -0
- package/dist/types/components/form/form.d.ts +1 -0
- package/dist/types/components/form/form.types.d.ts +16 -1
- package/dist/types/components/form/row/row.d.ts +16 -0
- package/dist/types/components/form/templates/row-layout.d.ts +11 -0
- package/dist/types/components/form/templates/types.d.ts +3 -0
- package/dist/types/components/menu/menu.d.ts +3 -0
- package/dist/types/components/menu/menu.types.d.ts +4 -0
- package/dist/types/components/menu-list/menu-list-renderer.d.ts +1 -0
- package/dist/types/components.d.ts +57 -1
- package/dist/types/interface.d.ts +1 -0
- package/dist/types/translations/da.d.ts +5 -0
- package/dist/types/translations/en.d.ts +5 -0
- package/dist/types/translations/fi.d.ts +5 -0
- package/dist/types/translations/nl.d.ts +5 -0
- package/dist/types/translations/no.d.ts +5 -0
- package/dist/types/translations/sv.d.ts +5 -0
- package/package.json +23 -20
- package/dist/lime-elements/p-15c3ec8e.entry.js +0 -1
- package/dist/lime-elements/p-246862ec.js +0 -1
- package/dist/lime-elements/p-52e18d94.entry.js +0 -1
- package/dist/lime-elements/p-5393213b.entry.js +0 -1
- package/dist/lime-elements/p-61b3352f.entry.js +0 -1
- package/dist/lime-elements/p-65a3be2c.entry.js +0 -1
- package/dist/lime-elements/p-90961075.entry.js +0 -1
- package/dist/lime-elements/p-91604294.entry.js +0 -1
- package/dist/lime-elements/p-95fd48d0.entry.js +0 -82
- package/dist/lime-elements/p-c4a89055.entry.js +0 -16
- package/dist/lime-elements/p-cc9f89a9.entry.js +0 -1
- package/dist/lime-elements/p-d379f4d6.entry.js +0 -59
- package/dist/lime-elements/p-d512656b.entry.js +0 -1
- package/dist/lime-elements/p-e6a11b73.entry.js +0 -1
- package/dist/lime-elements/p-f9958763.entry.js +0 -1
- package/dist/lime-elements/p-ff340a70.entry.js +0 -126
|
@@ -23,6 +23,7 @@ export class DatePickerCalendar {
|
|
|
23
23
|
this.isOpen = undefined;
|
|
24
24
|
this.inputElement = undefined;
|
|
25
25
|
this.language = 'en';
|
|
26
|
+
this.formatter = undefined;
|
|
26
27
|
}
|
|
27
28
|
componentWillLoad() {
|
|
28
29
|
switch (this.type) {
|
|
@@ -49,12 +50,10 @@ export class DatePickerCalendar {
|
|
|
49
50
|
this.picker = new DatetimePicker(this.format, this.language, this.change);
|
|
50
51
|
break;
|
|
51
52
|
}
|
|
53
|
+
this.picker.formatDate = this.formatter;
|
|
52
54
|
}
|
|
53
55
|
componentDidUpdate() {
|
|
54
|
-
if (this.flatPickrCreated) {
|
|
55
|
-
this.redrawFlatpickr();
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
56
|
+
if (!this.flatPickrCreated) {
|
|
58
57
|
this.createFlatpickr();
|
|
59
58
|
}
|
|
60
59
|
this.tryFixConfusingWidthBug();
|
|
@@ -89,9 +88,6 @@ export class DatePickerCalendar {
|
|
|
89
88
|
this.picker.init(this.inputElement, this.container, this.value);
|
|
90
89
|
this.flatPickrCreated = true;
|
|
91
90
|
}
|
|
92
|
-
redrawFlatpickr() {
|
|
93
|
-
this.picker.redraw();
|
|
94
|
-
}
|
|
95
91
|
destroyFlatpickr() {
|
|
96
92
|
this.picker.destroy();
|
|
97
93
|
}
|
|
@@ -217,7 +213,7 @@ export class DatePickerCalendar {
|
|
|
217
213
|
"mutable": false,
|
|
218
214
|
"complexType": {
|
|
219
215
|
"original": "Languages",
|
|
220
|
-
"resolved": "\"da\" | \"en\" | \"fi\" | \"nb\" | \"nl\" | \"no\" | \"sv\"",
|
|
216
|
+
"resolved": "\"da\" | \"de\" | \"en\" | \"fi\" | \"fr\" | \"nb\" | \"nl\" | \"no\" | \"sv\"",
|
|
221
217
|
"references": {
|
|
222
218
|
"Languages": {
|
|
223
219
|
"location": "import",
|
|
@@ -234,6 +230,25 @@ export class DatePickerCalendar {
|
|
|
234
230
|
"attribute": "language",
|
|
235
231
|
"reflect": false,
|
|
236
232
|
"defaultValue": "'en'"
|
|
233
|
+
},
|
|
234
|
+
"formatter": {
|
|
235
|
+
"type": "unknown",
|
|
236
|
+
"mutable": false,
|
|
237
|
+
"complexType": {
|
|
238
|
+
"original": "(date: Date) => string",
|
|
239
|
+
"resolved": "(date: Date) => string",
|
|
240
|
+
"references": {
|
|
241
|
+
"Date": {
|
|
242
|
+
"location": "global"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"required": true,
|
|
247
|
+
"optional": false,
|
|
248
|
+
"docs": {
|
|
249
|
+
"tags": [],
|
|
250
|
+
"text": ""
|
|
251
|
+
}
|
|
237
252
|
}
|
|
238
253
|
};
|
|
239
254
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import flatpickr from 'flatpickr';
|
|
2
2
|
import FlatpickrLanguages from 'flatpickr/dist/l10n';
|
|
3
3
|
import 'moment/locale/da';
|
|
4
|
+
import 'moment/locale/de';
|
|
4
5
|
import 'moment/locale/fi';
|
|
6
|
+
import 'moment/locale/fr';
|
|
5
7
|
import 'moment/locale/nb';
|
|
8
|
+
import 'moment/locale/nl';
|
|
6
9
|
import 'moment/locale/sv';
|
|
7
10
|
import moment from 'moment/moment';
|
|
8
11
|
import { isAndroidDevice, isIOSDevice } from '../../../util/device';
|
|
9
|
-
import { DateFormatter } from '../dateFormatter';
|
|
10
12
|
export class Picker {
|
|
11
13
|
constructor(dateFormat, language, change) {
|
|
12
14
|
this.change = change;
|
|
@@ -17,12 +19,10 @@ export class Picker {
|
|
|
17
19
|
if (dateFormat) {
|
|
18
20
|
this.dateFormat = dateFormat;
|
|
19
21
|
}
|
|
20
|
-
this.dateFormatter = new DateFormatter(language);
|
|
21
22
|
this.getWeek = this.getWeek.bind(this);
|
|
22
23
|
this.handleClose = this.handleClose.bind(this);
|
|
23
24
|
this.handleOnClose = this.handleOnClose.bind(this);
|
|
24
25
|
this.parseDate = this.parseDate.bind(this);
|
|
25
|
-
this.formatDate = this.formatDate.bind(this);
|
|
26
26
|
this.getFlatpickrLang = this.getFlatpickrLang.bind(this);
|
|
27
27
|
}
|
|
28
28
|
init(element, container, value) {
|
|
@@ -56,9 +56,6 @@ export class Picker {
|
|
|
56
56
|
}
|
|
57
57
|
this.flatpickr.destroy();
|
|
58
58
|
}
|
|
59
|
-
formatDate(date) {
|
|
60
|
-
return this.dateFormatter.formatDate(date, this.dateFormat);
|
|
61
|
-
}
|
|
62
59
|
handleClose(selectedDates) {
|
|
63
60
|
return new Promise((resolve) => {
|
|
64
61
|
setTimeout(() => {
|
|
@@ -69,10 +66,16 @@ export class Picker {
|
|
|
69
66
|
});
|
|
70
67
|
}
|
|
71
68
|
getFlatpickrLang() {
|
|
72
|
-
|
|
69
|
+
if (this.language === 'nb') {
|
|
70
|
+
return 'no';
|
|
71
|
+
}
|
|
72
|
+
return this.language;
|
|
73
73
|
}
|
|
74
74
|
getMomentLang() {
|
|
75
|
-
|
|
75
|
+
if (this.language === 'no') {
|
|
76
|
+
return 'nb';
|
|
77
|
+
}
|
|
78
|
+
return this.language;
|
|
76
79
|
}
|
|
77
80
|
getPickerDate(selectedDates) {
|
|
78
81
|
return selectedDates[0] ? new Date(selectedDates[0].toJSON()) : null;
|
|
@@ -395,14 +395,12 @@
|
|
|
395
395
|
width: 100%;
|
|
396
396
|
height: 100%;
|
|
397
397
|
top: 0;
|
|
398
|
-
/* @noflip */
|
|
399
|
-
/*rtl:ignore*/
|
|
398
|
+
/* @noflip */ /*rtl:ignore*/
|
|
400
399
|
left: 0;
|
|
401
400
|
}
|
|
402
401
|
[dir=rtl] .mdc-dialog__surface, .mdc-dialog__surface[dir=rtl] {
|
|
403
402
|
/*rtl:begin:ignore*/
|
|
404
|
-
/* @noflip */
|
|
405
|
-
/*rtl:ignore*/
|
|
403
|
+
/* @noflip */ /*rtl:ignore*/
|
|
406
404
|
text-align: right;
|
|
407
405
|
/*rtl:end:ignore*/
|
|
408
406
|
}
|
|
@@ -449,8 +447,7 @@
|
|
|
449
447
|
}
|
|
450
448
|
[dir=rtl] .mdc-dialog__title, .mdc-dialog__title[dir=rtl] {
|
|
451
449
|
/*rtl:begin:ignore*/
|
|
452
|
-
/* @noflip */
|
|
453
|
-
/*rtl:ignore*/
|
|
450
|
+
/* @noflip */ /*rtl:ignore*/
|
|
454
451
|
text-align: right;
|
|
455
452
|
/*rtl:end:ignore*/
|
|
456
453
|
}
|
|
@@ -538,51 +535,41 @@
|
|
|
538
535
|
}
|
|
539
536
|
|
|
540
537
|
.mdc-dialog__button {
|
|
541
|
-
/* @noflip */
|
|
542
|
-
/*rtl:ignore*/
|
|
538
|
+
/* @noflip */ /*rtl:ignore*/
|
|
543
539
|
margin-left: 8px;
|
|
544
|
-
/* @noflip */
|
|
545
|
-
/*rtl:ignore*/
|
|
540
|
+
/* @noflip */ /*rtl:ignore*/
|
|
546
541
|
margin-right: 0;
|
|
547
542
|
max-width: 100%;
|
|
548
|
-
/* @noflip */
|
|
549
|
-
/*rtl:ignore*/
|
|
543
|
+
/* @noflip */ /*rtl:ignore*/
|
|
550
544
|
text-align: right;
|
|
551
545
|
}
|
|
552
546
|
[dir=rtl] .mdc-dialog__button, .mdc-dialog__button[dir=rtl] {
|
|
553
547
|
/*rtl:begin:ignore*/
|
|
554
|
-
/* @noflip */
|
|
555
|
-
/*rtl:ignore*/
|
|
548
|
+
/* @noflip */ /*rtl:ignore*/
|
|
556
549
|
margin-left: 0;
|
|
557
|
-
/* @noflip */
|
|
558
|
-
/*rtl:ignore*/
|
|
550
|
+
/* @noflip */ /*rtl:ignore*/
|
|
559
551
|
margin-right: 8px;
|
|
560
552
|
/*rtl:end:ignore*/
|
|
561
553
|
}
|
|
562
554
|
|
|
563
555
|
.mdc-dialog__button:first-child {
|
|
564
|
-
/* @noflip */
|
|
565
|
-
/*rtl:ignore*/
|
|
556
|
+
/* @noflip */ /*rtl:ignore*/
|
|
566
557
|
margin-left: 0;
|
|
567
|
-
/* @noflip */
|
|
568
|
-
/*rtl:ignore*/
|
|
558
|
+
/* @noflip */ /*rtl:ignore*/
|
|
569
559
|
margin-right: 0;
|
|
570
560
|
}
|
|
571
561
|
[dir=rtl] .mdc-dialog__button:first-child, .mdc-dialog__button:first-child[dir=rtl] {
|
|
572
562
|
/*rtl:begin:ignore*/
|
|
573
|
-
/* @noflip */
|
|
574
|
-
/*rtl:ignore*/
|
|
563
|
+
/* @noflip */ /*rtl:ignore*/
|
|
575
564
|
margin-left: 0;
|
|
576
|
-
/* @noflip */
|
|
577
|
-
/*rtl:ignore*/
|
|
565
|
+
/* @noflip */ /*rtl:ignore*/
|
|
578
566
|
margin-right: 0;
|
|
579
567
|
/*rtl:end:ignore*/
|
|
580
568
|
}
|
|
581
569
|
|
|
582
570
|
[dir=rtl] .mdc-dialog__button, .mdc-dialog__button[dir=rtl] {
|
|
583
571
|
/*rtl:begin:ignore*/
|
|
584
|
-
/* @noflip */
|
|
585
|
-
/*rtl:ignore*/
|
|
572
|
+
/* @noflip */ /*rtl:ignore*/
|
|
586
573
|
text-align: left;
|
|
587
574
|
/*rtl:end:ignore*/
|
|
588
575
|
}
|
|
@@ -647,6 +634,7 @@
|
|
|
647
634
|
|
|
648
635
|
.mdc-dialog {
|
|
649
636
|
z-index: var(--dialog-z-index, 7);
|
|
637
|
+
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
|
|
650
638
|
}
|
|
651
639
|
@media (max-width: 16032px) {
|
|
652
640
|
.mdc-dialog .mdc-dialog__surface {
|
|
@@ -744,7 +732,6 @@ slot[name=button] {
|
|
|
744
732
|
slot[name=button] {
|
|
745
733
|
flex-direction: column-reverse;
|
|
746
734
|
}
|
|
747
|
-
|
|
748
735
|
.mdc-dialog__actions {
|
|
749
736
|
padding: min(1.5rem, 3vw);
|
|
750
737
|
padding-top: 1rem;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Note! This file is exported to `dist/scss/` in the published
|
|
3
|
+
* node module, for consumer projects to import.
|
|
4
|
+
* That means this file cannot import from any file that isn't
|
|
5
|
+
* also exported, keeping the same relative path.
|
|
6
|
+
*
|
|
7
|
+
* Or, just don't import anything, that works too.
|
|
8
|
+
*/
|
|
1
9
|
/*
|
|
2
10
|
* This file is imported into every component!
|
|
3
11
|
*
|
|
@@ -12,14 +20,15 @@
|
|
|
12
20
|
*/
|
|
13
21
|
.button {
|
|
14
22
|
all: unset;
|
|
15
|
-
|
|
23
|
+
isolation: isolate;
|
|
24
|
+
position: relative;
|
|
16
25
|
transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;
|
|
26
|
+
cursor: pointer;
|
|
17
27
|
color: var(--limel-dock-item-text-color);
|
|
18
28
|
background-color: var(--dock-background-color);
|
|
19
29
|
box-sizing: border-box;
|
|
20
30
|
display: flex;
|
|
21
31
|
align-items: center;
|
|
22
|
-
position: relative;
|
|
23
32
|
width: 100%;
|
|
24
33
|
height: var(--dock-item-height);
|
|
25
34
|
border-radius: 0.375rem;
|
|
@@ -77,4 +86,10 @@ limel-popover {
|
|
|
77
86
|
width: calc(var(--dock-item-height) - 1rem);
|
|
78
87
|
height: calc(var(--dock-item-height) - 1rem);
|
|
79
88
|
color: var(--dock-item-icon-color, var(--limel-dock-item-text-color));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
limel-badge {
|
|
92
|
+
position: absolute;
|
|
93
|
+
top: -0.125rem;
|
|
94
|
+
right: -0.125rem;
|
|
80
95
|
}
|
|
@@ -5,6 +5,11 @@ import { createRandomString } from '../../../util/random-string';
|
|
|
5
5
|
*/
|
|
6
6
|
export class DockButton {
|
|
7
7
|
constructor() {
|
|
8
|
+
this.renderNotification = () => {
|
|
9
|
+
if (this.item.badge !== undefined) {
|
|
10
|
+
return h("limel-badge", { label: this.item.badge });
|
|
11
|
+
}
|
|
12
|
+
};
|
|
8
13
|
this.openPopover = (event) => {
|
|
9
14
|
event.stopPropagation();
|
|
10
15
|
this.isOpen = true;
|
|
@@ -57,7 +62,7 @@ export class DockButton {
|
|
|
57
62
|
return (h("button", { slot: slot, tabindex: "0", id: this.tooltipId, type: "button", class: {
|
|
58
63
|
button: true,
|
|
59
64
|
selected: (_a = this.item) === null || _a === void 0 ? void 0 : _a.selected,
|
|
60
|
-
}, onClick: handleClick }, this.renderIcon(), this.renderLabel(), this.renderTooltip()));
|
|
65
|
+
}, onClick: handleClick, "aria-live": "polite" }, this.renderIcon(), this.renderLabel(), this.renderTooltip(), this.renderNotification()));
|
|
61
66
|
}
|
|
62
67
|
renderIcon() {
|
|
63
68
|
if (!this.item.icon) {
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Note! This file is exported to `dist/scss/` in the published
|
|
3
|
+
* node module, for consumer projects to import.
|
|
4
|
+
* That means this file cannot import from any file that isn't
|
|
5
|
+
* also exported, keeping the same relative path.
|
|
6
|
+
*
|
|
7
|
+
* Or, just don't import anything, that works too.
|
|
8
|
+
*/
|
|
1
9
|
/*
|
|
2
10
|
* This file is imported into every component!
|
|
3
11
|
*
|
|
@@ -17,9 +25,15 @@
|
|
|
17
25
|
* @prop --dock-item-text-color: Text of dock items, defaults to `--contrast-1100`.
|
|
18
26
|
* @prop --dock-item-text-color--selected: Text color of selected dock item, defaults to `--contrast-1300`.
|
|
19
27
|
* @prop --dock-item-icon-color: Color of the optional icons used in each dock item. Only affects inactive dock items, defaults to text colors for default or selected states.
|
|
28
|
+
* @prop --dock-padding-top: Space of top side of the Dock. Can be used with environment variables, to take into account safe areas on mobile devices with rounded screen corners or those that have a "notch". For instance can be set to `env(safe-area-inset-top)`.
|
|
29
|
+
* @prop --dock-padding-right: Space of the right side of the Dock. Can be used with environment variables, to take into account safe areas on mobile devices with rounded screen corners or those that have a "notch". For instance can be set to `env(safe-area-inset-right)`.
|
|
30
|
+
* @prop --dock-padding-bottom: Space of the bottom side of the Dock. Can be used with environment variables, to take into account safe areas on mobile devices with rounded screen corners or those that have a "notch". For instance can be set to `env(safe-area-inset-bottom)`.
|
|
31
|
+
* @prop --dock-padding-left: Space of the left side of the Dock. Can be used with environment variables, to take into account safe areas on mobile devices with rounded screen corners or those that have a "notch". For instance can be set to `env(safe-area-inset-left)`.
|
|
20
32
|
* @prop --popover-surface-width: Defines the width of the popover that is opened for dock items with custom components. Defaults to `auto`.
|
|
21
33
|
*/
|
|
22
34
|
:host(limel-dock) {
|
|
35
|
+
--badge-background-color: rgb(var(--color-red-default));
|
|
36
|
+
--badge-text-color: rgb(var(--color-white));
|
|
23
37
|
--dock-item-height: 2.75rem;
|
|
24
38
|
--dock-padding: 0.25rem;
|
|
25
39
|
--dock-expand-shrink-button-height: 1rem;
|
|
@@ -37,6 +51,10 @@
|
|
|
37
51
|
flex-direction: column;
|
|
38
52
|
background-color: var(--dock-background-color, rgb(var(--contrast-100)));
|
|
39
53
|
box-shadow: var(--shadow-depth-8);
|
|
54
|
+
padding-top: var(--dock-padding-top);
|
|
55
|
+
padding-right: var(--dock-padding-right);
|
|
56
|
+
padding-bottom: var(--dock-padding-bottom);
|
|
57
|
+
padding-left: var(--dock-padding-left);
|
|
40
58
|
}
|
|
41
59
|
|
|
42
60
|
:host(limel-dock:not(.has-mobile-layout)) {
|
|
@@ -76,9 +94,9 @@ nav::-webkit-scrollbar {
|
|
|
76
94
|
all: unset;
|
|
77
95
|
box-sizing: border-box;
|
|
78
96
|
transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;
|
|
97
|
+
cursor: pointer;
|
|
79
98
|
color: var(--mdc-theme-on-surface);
|
|
80
99
|
background-color: transparent;
|
|
81
|
-
cursor: pointer;
|
|
82
100
|
display: flex;
|
|
83
101
|
justify-content: center;
|
|
84
102
|
align-items: center;
|
|
@@ -3,6 +3,7 @@ const DEFAULT_MOBILE_BREAKPOINT = 700;
|
|
|
3
3
|
/**
|
|
4
4
|
* @exampleComponent limel-example-dock-basic
|
|
5
5
|
* @exampleComponent limel-example-dock-custom-component
|
|
6
|
+
* @exampleComponent limel-example-dock-notification
|
|
6
7
|
* @exampleComponent limel-example-dock-mobile
|
|
7
8
|
* @exampleComponent limel-example-dock-expanded
|
|
8
9
|
* @exampleComponent limel-example-dock-colors-css
|
|
@@ -303,7 +303,7 @@ export class File {
|
|
|
303
303
|
"mutable": false,
|
|
304
304
|
"complexType": {
|
|
305
305
|
"original": "Languages",
|
|
306
|
-
"resolved": "\"da\" | \"en\" | \"fi\" | \"nb\" | \"nl\" | \"no\" | \"sv\"",
|
|
306
|
+
"resolved": "\"da\" | \"de\" | \"en\" | \"fi\" | \"fr\" | \"nb\" | \"nl\" | \"no\" | \"sv\"",
|
|
307
307
|
"references": {
|
|
308
308
|
"Languages": {
|
|
309
309
|
"location": "import",
|
|
@@ -65,7 +65,12 @@
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
* @prop --form-body-padding: space around content of the form
|
|
68
|
+
* @prop --form-body-padding: space around content of the form. Defaults to `1rem`.
|
|
69
|
+
* @prop --form-column-gap: defines the vertical space between elements of the form with `grid` and `default` layouts. Defaults to `1rem`.
|
|
70
|
+
* @prop --form-row-gap: defines the horizontal space between elements of the form with `grid` and `default` layouts. Defaults to `1rem`.
|
|
71
|
+
* @prop --form-gap: defines the space between elements of the form with `grid` and `default` layouts. Defaults to `1rem`.
|
|
72
|
+
* @prop --form-background-color-of-even-rows: Background of even rows in the form, when layout type is `row`. Defaults to `transparent`.
|
|
73
|
+
* @prop --form-background-color-of-odd-rows:Background of odd rows in the form, when layout type is `row`. Defaults to `--contrast-200`.
|
|
69
74
|
*/
|
|
70
75
|
.mdc-typography {
|
|
71
76
|
-moz-osx-font-smoothing: grayscale;
|
|
@@ -413,10 +418,13 @@
|
|
|
413
418
|
text-transform: var(--mdc-typography-overline-text-transform, uppercase);
|
|
414
419
|
}
|
|
415
420
|
|
|
421
|
+
.form-group {
|
|
422
|
+
min-width: 0;
|
|
423
|
+
}
|
|
424
|
+
|
|
416
425
|
.limel-form-array-item--simple {
|
|
417
426
|
display: flex;
|
|
418
427
|
align-items: center;
|
|
419
|
-
margin-right: 0.625rem;
|
|
420
428
|
}
|
|
421
429
|
.limel-form-array-item--simple *:first-child {
|
|
422
430
|
flex-grow: 1;
|
|
@@ -427,17 +435,17 @@
|
|
|
427
435
|
}
|
|
428
436
|
|
|
429
437
|
.limel-form-layout--default {
|
|
430
|
-
--gap: 1rem;
|
|
431
438
|
display: grid;
|
|
432
|
-
gap: var(--gap);
|
|
439
|
+
column-gap: var(--form-column-gap, 1rem);
|
|
440
|
+
row-gap: var(--form-row-gap, 1rem);
|
|
433
441
|
padding: var(--form-body-padding, 1rem);
|
|
434
442
|
}
|
|
435
443
|
|
|
436
444
|
.limel-form-layout--grid {
|
|
437
|
-
--
|
|
438
|
-
--min-height-of-one-row: 4.71rem;
|
|
445
|
+
--min-height-of-one-row: 3.5rem;
|
|
439
446
|
display: grid;
|
|
440
|
-
gap: var(--gap);
|
|
447
|
+
column-gap: var(--form-column-gap, 1rem);
|
|
448
|
+
row-gap: var(--form-row-gap, 1rem);
|
|
441
449
|
padding: var(--form-body-padding, 1rem);
|
|
442
450
|
grid-template-columns: repeat(var(--number-of-columns), minmax(0, 1fr));
|
|
443
451
|
}
|
|
@@ -505,9 +513,7 @@
|
|
|
505
513
|
|
|
506
514
|
.limel-form-layout--grid limel-checkbox,
|
|
507
515
|
.limel-form-layout--grid limel-switch {
|
|
508
|
-
min-height:
|
|
509
|
-
var(--min-height-of-one-row) - 0.9375rem
|
|
510
|
-
);
|
|
516
|
+
min-height: var(--min-height-of-one-row);
|
|
511
517
|
}
|
|
512
518
|
.limel-form-layout--grid limel-checkbox {
|
|
513
519
|
margin-top: 0.5rem;
|
|
@@ -543,9 +549,13 @@
|
|
|
543
549
|
.form-group .mdc-typography--headline1 {
|
|
544
550
|
--mdc-typography-headline1-font-size: 2rem;
|
|
545
551
|
--mdc-typography-headline1-line-height: 2.25rem;
|
|
546
|
-
--mdc-typography-headline1-letter-spacing: -0.
|
|
552
|
+
--mdc-typography-headline1-letter-spacing: -0.01rem;
|
|
547
553
|
--mdc-typography-headline1-font-weight: 400;
|
|
548
554
|
margin-top: 1.5rem;
|
|
555
|
+
margin-bottom: 0.25rem;
|
|
556
|
+
}
|
|
557
|
+
.form-group .mdc-typography--body1 {
|
|
558
|
+
margin-top: 0;
|
|
549
559
|
margin-bottom: 0.5rem;
|
|
550
560
|
}
|
|
551
561
|
.form-group .form-group .mdc-typography--headline1,
|
|
@@ -556,8 +566,7 @@
|
|
|
556
566
|
--mdc-typography-headline1-font-size: 1.625rem;
|
|
557
567
|
--mdc-typography-headline1-line-height: 1.25rem;
|
|
558
568
|
--mdc-typography-headline1-font-weight: 300;
|
|
559
|
-
margin-top:
|
|
560
|
-
margin-bottom: 0.5rem;
|
|
569
|
+
margin-top: 1rem;
|
|
561
570
|
}
|
|
562
571
|
.form-group .form-group .mdc-typography--headline1:before {
|
|
563
572
|
content: "";
|
|
@@ -580,9 +589,7 @@
|
|
|
580
589
|
.form-group .form-group .form-group .mdc-typography--headline1 {
|
|
581
590
|
--mdc-typography-headline1-font-size: 1.375rem;
|
|
582
591
|
--mdc-typography-headline1-line-height: 1.5rem;
|
|
583
|
-
|
|
584
|
-
margin-top: 1rem;
|
|
585
|
-
margin-bottom: 0.5rem;
|
|
592
|
+
margin-top: 0.5rem;
|
|
586
593
|
}
|
|
587
594
|
.form-group .form-group .form-group .mdc-typography--headline1:before {
|
|
588
595
|
display: none;
|
|
@@ -594,10 +601,107 @@
|
|
|
594
601
|
.form-group .form-group .form-group .form-group .mdc-typography--headline1 {
|
|
595
602
|
--mdc-typography-headline1-font-size: 1.25rem;
|
|
596
603
|
--mdc-typography-headline1-line-height: 1.25rem;
|
|
597
|
-
--mdc-typography-headline1-font-weight: 300;
|
|
598
604
|
margin-top: 1rem;
|
|
599
|
-
margin-bottom: 0.5rem;
|
|
600
605
|
}
|
|
601
606
|
.form-group .form-group .form-group .form-group .mdc-typography--headline1:before {
|
|
602
607
|
display: none;
|
|
608
|
+
}
|
|
609
|
+
.form-group .form-group .form-group .form-group .mdc-typography--headline1,
|
|
610
|
+
.form-group .form-group .form-group .form-group .mdc-typography--body1 {
|
|
611
|
+
color: rgb(var(--contrast-1400));
|
|
612
|
+
}
|
|
613
|
+
.form-group .form-group .form-group .form-group .mdc-typography--headline1 {
|
|
614
|
+
--mdc-typography-headline1-font-size: 1.25rem;
|
|
615
|
+
--mdc-typography-headline1-line-height: 1.25rem;
|
|
616
|
+
margin-top: 0.25rem;
|
|
617
|
+
}
|
|
618
|
+
.form-group .form-group .form-group .form-group .mdc-typography--headline1:before {
|
|
619
|
+
display: none;
|
|
620
|
+
}
|
|
621
|
+
.form-group .form-group .form-group .form-group .form-group .mdc-typography--headline1,
|
|
622
|
+
.form-group .form-group .form-group .form-group .form-group .mdc-typography--body1 {
|
|
623
|
+
color: rgb(var(--contrast-1400));
|
|
624
|
+
}
|
|
625
|
+
.form-group .form-group .form-group .form-group .form-group .mdc-typography--headline1 {
|
|
626
|
+
--mdc-typography-headline1-font-size: 1rem;
|
|
627
|
+
--mdc-typography-headline1-line-height: 1rem;
|
|
628
|
+
margin-top: 0.25rem;
|
|
629
|
+
}
|
|
630
|
+
.form-group .form-group .form-group .form-group .form-group .mdc-typography--headline1:before {
|
|
631
|
+
display: none;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Note! This file is exported to `dist/scss/` in the published
|
|
636
|
+
* node module, for consumer projects to import.
|
|
637
|
+
* That means this file cannot import from any file that isn't
|
|
638
|
+
* also exported, keeping the same relative path.
|
|
639
|
+
*
|
|
640
|
+
* Or, just don't import anything, that works too.
|
|
641
|
+
*/
|
|
642
|
+
.limel-form-row--layout {
|
|
643
|
+
--limel-form-row-border-radius: 0.375rem;
|
|
644
|
+
--limel-form-row-icon-size: 1.75rem;
|
|
645
|
+
--limel-form-row-main-information-gap: 0.5rem;
|
|
646
|
+
display: flex;
|
|
647
|
+
flex-direction: column;
|
|
648
|
+
}
|
|
649
|
+
.limel-form-row--layout .row {
|
|
650
|
+
display: flex;
|
|
651
|
+
gap: 0.5rem;
|
|
652
|
+
flex-direction: column;
|
|
653
|
+
padding: 0.5rem 1rem;
|
|
654
|
+
}
|
|
655
|
+
.limel-form-row--layout .row:nth-child(odd) {
|
|
656
|
+
background-color: var(--form-background-color-of-odd-rows, rgb(var(--contrast-200)));
|
|
657
|
+
}
|
|
658
|
+
.limel-form-row--layout .row:nth-child(even) {
|
|
659
|
+
background-color: var(--form-background-color-of-even-rows, transparent);
|
|
660
|
+
}
|
|
661
|
+
.limel-form-row--layout .row:first-child {
|
|
662
|
+
border-radius: var(--limel-form-row-border-radius) var(--limel-form-row-border-radius) 0 0;
|
|
663
|
+
}
|
|
664
|
+
.limel-form-row--layout .row:last-child {
|
|
665
|
+
border-radius: 0 0 var(--limel-form-row-border-radius) var(--limel-form-row-border-radius);
|
|
666
|
+
}
|
|
667
|
+
.limel-form-row--layout .main-information {
|
|
668
|
+
display: flex;
|
|
669
|
+
flex-direction: row;
|
|
670
|
+
align-items: center;
|
|
671
|
+
gap: var(--limel-form-row-main-information-gap);
|
|
672
|
+
min-width: 0;
|
|
673
|
+
}
|
|
674
|
+
.limel-form-row--layout limel-icon {
|
|
675
|
+
color: rgb(var(--contrast-1200));
|
|
676
|
+
width: var(--limel-form-row-icon-size);
|
|
677
|
+
flex-shrink: 0;
|
|
678
|
+
min-width: 0;
|
|
679
|
+
}
|
|
680
|
+
.limel-form-row--layout .title {
|
|
681
|
+
overflow: hidden;
|
|
682
|
+
white-space: nowrap;
|
|
683
|
+
text-overflow: ellipsis;
|
|
684
|
+
margin: 0;
|
|
685
|
+
font-weight: normal;
|
|
686
|
+
flex-grow: 1;
|
|
687
|
+
color: var(--mdc-theme-on-surface);
|
|
688
|
+
font-size: var(--mdc-typography-subtitle1-font-size, 0.875rem);
|
|
689
|
+
}
|
|
690
|
+
.limel-form-row--layout .description {
|
|
691
|
+
margin: 0;
|
|
692
|
+
color: var(--mdc-theme-text-secondary-on-background);
|
|
693
|
+
font-size: var(--mdc-typography-body2-font-size, 0.8125rem);
|
|
694
|
+
line-height: 1.5;
|
|
695
|
+
}
|
|
696
|
+
.limel-form-row--layout .has-icon .description {
|
|
697
|
+
padding-left: calc(var(--limel-form-row-icon-size) + var(--limel-form-row-main-information-gap));
|
|
698
|
+
}
|
|
699
|
+
.limel-form-row--layout .form-group.field {
|
|
700
|
+
flex-shrink: 0;
|
|
701
|
+
display: flex;
|
|
702
|
+
align-content: center;
|
|
703
|
+
}
|
|
704
|
+
.limel-form-row--layout .form-group.field limel-slider {
|
|
705
|
+
min-width: 8rem;
|
|
706
|
+
display: block;
|
|
603
707
|
}
|
|
@@ -23,6 +23,7 @@ import { mapValues } from 'lodash-es';
|
|
|
23
23
|
* @exampleComponent limel-example-form-span-fields
|
|
24
24
|
* @exampleComponent limel-example-custom-error-message
|
|
25
25
|
* @exampleComponent limel-example-server-errors
|
|
26
|
+
* @exampleComponent limel-example-form-row-layout
|
|
26
27
|
*/
|
|
27
28
|
export class Form {
|
|
28
29
|
constructor() {
|
|
@@ -8,4 +8,12 @@ export var FormLayoutType;
|
|
|
8
8
|
* Render the form fields using a responsive grid layout
|
|
9
9
|
*/
|
|
10
10
|
FormLayoutType["Grid"] = "grid";
|
|
11
|
+
/**
|
|
12
|
+
* Render the form fields in full-width rows.
|
|
13
|
+
* Each row can have a leading `icon`, and a field.
|
|
14
|
+
* `title` and `description` provided by the schema will be placed
|
|
15
|
+
* on the row itself, and not on the field.
|
|
16
|
+
* This layout is good for creating UIs for user settings pages.
|
|
17
|
+
*/
|
|
18
|
+
FormLayoutType["Row"] = "row";
|
|
11
19
|
})(FormLayoutType || (FormLayoutType = {}));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export class Row extends React.Component {
|
|
3
|
+
constructor(props) {
|
|
4
|
+
super(props);
|
|
5
|
+
this.props = props;
|
|
6
|
+
}
|
|
7
|
+
render() {
|
|
8
|
+
const classes = ['row'];
|
|
9
|
+
if (this.icon) {
|
|
10
|
+
classes.push('has-icon');
|
|
11
|
+
}
|
|
12
|
+
return React.createElement('div', {
|
|
13
|
+
className: classes.join(' '),
|
|
14
|
+
}, this.renderMainInformation(), this.renderDescription());
|
|
15
|
+
}
|
|
16
|
+
renderIcon() {
|
|
17
|
+
if (this.icon) {
|
|
18
|
+
return React.createElement('limel-icon', {
|
|
19
|
+
name: this.icon,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
renderMainInformation() {
|
|
24
|
+
return React.createElement('div', { className: 'main-information' }, this.renderIcon(), this.renderTitle(), this.renderChildren());
|
|
25
|
+
}
|
|
26
|
+
renderTitle() {
|
|
27
|
+
var _a;
|
|
28
|
+
return React.createElement('h1', { className: 'title' }, (_a = this.schema) === null || _a === void 0 ? void 0 : _a.title);
|
|
29
|
+
}
|
|
30
|
+
renderDescription() {
|
|
31
|
+
var _a;
|
|
32
|
+
if ((_a = this.schema) === null || _a === void 0 ? void 0 : _a.description) {
|
|
33
|
+
return React.createElement('p', { className: 'description' }, this.schema.description);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
renderChildren() {
|
|
37
|
+
const children = this.props.children;
|
|
38
|
+
return Object.assign(Object.assign({}, children), { props: Object.assign(Object.assign({}, children.props), { schema: Object.assign(Object.assign({}, children.props.schema), { title: null, description: null }) }) });
|
|
39
|
+
}
|
|
40
|
+
get schema() {
|
|
41
|
+
return this.props.children.props.schema;
|
|
42
|
+
}
|
|
43
|
+
get icon() {
|
|
44
|
+
var _a, _b, _c;
|
|
45
|
+
return (_c = (_b = (_a = this.schema) === null || _a === void 0 ? void 0 : _a.lime) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.icon;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { FormLayoutType } from '../form.types';
|
|
3
3
|
import { renderDescription, renderTitle } from './common';
|
|
4
4
|
import { GridLayout } from './grid-layout';
|
|
5
|
+
import { RowLayout } from './row-layout';
|
|
5
6
|
export const ObjectFieldTemplate = (props) => {
|
|
6
7
|
const id = props.idSchema.$id;
|
|
7
8
|
if (id === 'root' || !isCollapsible(props.schema)) {
|
|
@@ -41,6 +42,7 @@ function renderLayout(properties, layout) {
|
|
|
41
42
|
const layouts = {
|
|
42
43
|
default: renderDefaultLayout,
|
|
43
44
|
grid: renderGridLayout,
|
|
45
|
+
row: renderRowLayout,
|
|
44
46
|
};
|
|
45
47
|
return layouts[type](properties, layout);
|
|
46
48
|
}
|
|
@@ -54,6 +56,9 @@ function renderGridLayout(properties, layout) {
|
|
|
54
56
|
options: layout,
|
|
55
57
|
}, properties.map((element) => element.content));
|
|
56
58
|
}
|
|
59
|
+
function renderRowLayout(properties) {
|
|
60
|
+
return React.createElement(RowLayout, {}, properties.map((element) => element.content));
|
|
61
|
+
}
|
|
57
62
|
function isCollapsible(schema) {
|
|
58
63
|
var _a;
|
|
59
64
|
return !!((_a = schema.lime) === null || _a === void 0 ? void 0 : _a.collapsible);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Row } from '../row/row';
|
|
3
|
+
export class RowLayout extends React.Component {
|
|
4
|
+
constructor(props) {
|
|
5
|
+
super(props);
|
|
6
|
+
this.props = props;
|
|
7
|
+
this.elementRef = React.createRef();
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
const classes = ['limel-form-row--layout'];
|
|
11
|
+
return React.createElement('div', {
|
|
12
|
+
className: classes.join(' '),
|
|
13
|
+
ref: this.elementRef,
|
|
14
|
+
}, this.props.children.map((child, index) => {
|
|
15
|
+
return React.createElement(Row, {
|
|
16
|
+
key: index.toString(),
|
|
17
|
+
}, child);
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
}
|