@m3ui-vue/m3ui-vue 1.0.2 → 1.1.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/dist/API.md +666 -12
- package/dist/MMenuItem-BOkcVtEe.js +809 -0
- package/dist/MMenuItem-BOkcVtEe.js.map +1 -0
- package/dist/MSlider-BXsBv0ox.js +1402 -0
- package/dist/MSlider-BXsBv0ox.js.map +1 -0
- package/dist/MTextField-rML9jnXs.js +671 -0
- package/dist/MTextField-rML9jnXs.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MBottomSheet.vue.d.ts +20 -1
- package/dist/components/MDialog.vue.d.ts +17 -8
- package/dist/components/MDragDropList.vue.d.ts +1 -1
- package/dist/components/MIconButton.vue.d.ts +1 -1
- package/dist/components/MMap.vue.d.ts +74 -0
- package/dist/components/MMapBaseLayers.vue.d.ts +15 -0
- package/dist/components/MMapControl.vue.d.ts +40 -0
- package/dist/components/MMapFeatureInfo.vue.d.ts +25 -0
- package/dist/components/MMapFilter.vue.d.ts +19 -0
- package/dist/components/MMapGeoJson.vue.d.ts +34 -0
- package/dist/components/MMapHover.vue.d.ts +17 -0
- package/dist/components/MMapIdentify.vue.d.ts +37 -0
- package/dist/components/MMapLayers.vue.d.ts +31 -0
- package/dist/components/MMapMarker.vue.d.ts +45 -0
- package/dist/components/MMapMeasure.vue.d.ts +43 -0
- package/dist/components/MMapPopup.vue.d.ts +45 -0
- package/dist/components/MMapSearch.vue.d.ts +28 -0
- package/dist/components/MMenuItem.vue.d.ts +2 -2
- package/dist/components/MSeekBar.vue.d.ts +122 -0
- package/dist/components/MSplitButton.vue.d.ts +2 -2
- package/dist/components/_MMapAttribution.vue.d.ts +7 -0
- package/dist/components/_MMapLayerItem.vue.d.ts +25 -0
- package/dist/composables/_mapGeometry.d.ts +13 -0
- package/dist/composables/_mapPin.d.ts +5 -0
- package/dist/composables/_popupPosition.d.ts +12 -0
- package/dist/composables/_ssrState.d.ts +30 -0
- package/dist/composables/_storageKeys.d.ts +3 -0
- package/dist/composables/_useCalendarMonth.d.ts +24 -0
- package/dist/composables/_useEscapeStack.d.ts +3 -0
- package/dist/composables/_useScrollLock.d.ts +8 -0
- package/dist/composables/_useSheetMotion.d.ts +16 -1
- package/dist/composables/_useThemeTokens.d.ts +7 -0
- package/dist/composables/mapAdapters.d.ts +111 -0
- package/dist/composables/mapSearch.d.ts +31 -0
- package/dist/composables/themeInitScript.d.ts +4 -3
- package/dist/composables/useColorPalette.d.ts +173 -7
- package/dist/composables/useLocale.d.ts +38 -0
- package/dist/composables/useMap.d.ts +47 -0
- package/dist/composables/useMapFilter.d.ts +10 -0
- package/dist/composables/useMapLayers.d.ts +30 -0
- package/dist/composables/useTheme.d.ts +2 -1
- package/dist/index.d.ts +4 -1
- package/dist/locales/index.js +273 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +7913 -8625
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +24 -0
- package/dist/map.js +2067 -0
- package/dist/map.js.map +1 -0
- package/dist/plugin.d.ts +18 -2
- package/dist/rich-text-editor.js +26 -25
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/{useLocale-CuvWRZ1h.js → useLocale-CqQrhWFl.js} +40 -2
- package/dist/useLocale-CqQrhWFl.js.map +1 -0
- package/package.json +11 -2
- package/src/__tests__/MDialog.test.ts +30 -0
- package/src/__tests__/MFab.test.ts +52 -6
- package/src/__tests__/MMap.test.ts +422 -0
- package/src/__tests__/MMapLayers.test.ts +257 -0
- package/src/__tests__/MMapTools.test.ts +233 -0
- package/src/__tests__/MSeekBar.test.ts +170 -0
- package/src/__tests__/MTooltip.test.ts +110 -0
- package/src/__tests__/_fakeMaplibre.ts +161 -0
- package/src/__tests__/calendarMonth.test.ts +59 -0
- package/src/__tests__/hydration.test.ts +33 -0
- package/src/__tests__/pickerModals.test.ts +128 -0
- package/src/__tests__/popupPosition.test.ts +224 -0
- package/src/__tests__/scrollLock.test.ts +110 -0
- package/src/__tests__/sheets.test.ts +158 -0
- package/src/__tests__/ssr.test.ts +63 -1
- package/src/__tests__/ssrState.test.ts +155 -0
- package/src/__tests__/themeInitScript.test.ts +18 -0
- package/src/components/MAutocomplete.vue +2 -4
- package/src/components/MBottomSheet.vue +211 -13
- package/src/components/MCommandPalette.vue +4 -6
- package/src/components/MContextMenu.vue +19 -5
- package/src/components/MDatePicker.vue +29 -70
- package/src/components/MDatePickerModal.vue +116 -172
- package/src/components/MDateRangePicker.vue +29 -51
- package/src/components/MDateRangePickerModal.vue +84 -162
- package/src/components/MDialog.vue +87 -63
- package/src/components/MFab.vue +29 -7
- package/src/components/MIconButton.vue +1 -1
- package/src/components/MLightbox.vue +12 -5
- package/src/components/MMap.vue +568 -0
- package/src/components/MMapBaseLayers.vue +67 -0
- package/src/components/MMapControl.vue +175 -0
- package/src/components/MMapFeatureInfo.vue +41 -0
- package/src/components/MMapFilter.vue +80 -0
- package/src/components/MMapGeoJson.vue +136 -0
- package/src/components/MMapHover.vue +131 -0
- package/src/components/MMapIdentify.vue +104 -0
- package/src/components/MMapLayers.vue +111 -0
- package/src/components/MMapMarker.vue +109 -0
- package/src/components/MMapMeasure.vue +452 -0
- package/src/components/MMapPopup.vue +103 -0
- package/src/components/MMapSearch.vue +162 -0
- package/src/components/MMenu.vue +31 -12
- package/src/components/MMenuItem.vue +21 -4
- package/src/components/MMultiAutocomplete.vue +2 -4
- package/src/components/MMultiSelect.vue +2 -4
- package/src/components/MNavigationDrawer.vue +2 -8
- package/src/components/MNavigationRail.vue +2 -3
- package/src/components/MSearchBar.vue +2 -5
- package/src/components/MSeekBar.vue +593 -0
- package/src/components/MSelect.vue +2 -8
- package/src/components/MSplitButton.vue +23 -7
- package/src/components/MSpotlightSearch.vue +4 -6
- package/src/components/MTimePicker.vue +23 -6
- package/src/components/MTimePickerModal.vue +213 -226
- package/src/components/MTooltip.vue +99 -3
- package/src/components/_MMapAttribution.vue +81 -0
- package/src/components/_MMapLayerItem.vue +77 -0
- package/src/composables/_mapGeometry.ts +75 -0
- package/src/composables/_mapPin.ts +25 -0
- package/src/composables/_popupPosition.ts +39 -0
- package/src/composables/_ssrState.ts +80 -0
- package/src/composables/_storageKeys.ts +6 -0
- package/src/composables/_useCalendarMonth.ts +74 -0
- package/src/composables/_useEscapeStack.ts +33 -0
- package/src/composables/_useScrollLock.ts +41 -0
- package/src/composables/_useSheetMotion.ts +82 -20
- package/src/composables/_useThemeTokens.ts +42 -0
- package/src/composables/mapAdapters.ts +208 -0
- package/src/composables/mapSearch.ts +56 -0
- package/src/composables/themeInitScript.ts +6 -4
- package/src/composables/useColorPalette.ts +23 -9
- package/src/composables/useLocale.ts +78 -0
- package/src/composables/useMap.ts +98 -0
- package/src/composables/useMapFilter.ts +45 -0
- package/src/composables/useMapLayers.ts +124 -0
- package/src/composables/useTheme.ts +8 -3
- package/src/composables/useWindowSizeClass.ts +14 -5
- package/src/index.ts +4 -1
- package/src/locales/de.ts +39 -1
- package/src/locales/es.ts +39 -1
- package/src/locales/fr.ts +39 -1
- package/src/locales/ja.ts +39 -1
- package/src/locales/ko.ts +39 -1
- package/src/locales/pt.ts +39 -1
- package/src/locales/zh.ts +39 -1
- package/src/map.ts +32 -0
- package/src/plugin.ts +54 -3
- package/dist/MTextField-BPbFeI9M.js +0 -1368
- package/dist/MTextField-BPbFeI9M.js.map +0 -1
- package/dist/useLocale-CuvWRZ1h.js.map +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
1
2
|
import { type SeedOptions } from './dynamicColor';
|
|
3
|
+
import { STYLE_ID } from './_storageKeys';
|
|
2
4
|
export interface Palette {
|
|
3
5
|
id: string;
|
|
4
6
|
label: string;
|
|
@@ -8,6 +10,170 @@ export interface Palette {
|
|
|
8
10
|
*/
|
|
9
11
|
seed: string;
|
|
10
12
|
}
|
|
13
|
+
declare const builtInPalettes: readonly [{
|
|
14
|
+
readonly id: "purple";
|
|
15
|
+
readonly label: "Purple";
|
|
16
|
+
readonly seed: "#6750A4";
|
|
17
|
+
}, {
|
|
18
|
+
readonly id: "indigo";
|
|
19
|
+
readonly label: "Indigo";
|
|
20
|
+
readonly seed: "#4355B9";
|
|
21
|
+
}, {
|
|
22
|
+
readonly id: "navy";
|
|
23
|
+
readonly label: "Navy";
|
|
24
|
+
readonly seed: "#354BA0";
|
|
25
|
+
}, {
|
|
26
|
+
readonly id: "blue";
|
|
27
|
+
readonly label: "Blue";
|
|
28
|
+
readonly seed: "#005AC1";
|
|
29
|
+
}, {
|
|
30
|
+
readonly id: "cyan";
|
|
31
|
+
readonly label: "Cyan";
|
|
32
|
+
readonly seed: "#006874";
|
|
33
|
+
}, {
|
|
34
|
+
readonly id: "teal";
|
|
35
|
+
readonly label: "Teal";
|
|
36
|
+
readonly seed: "#006B5F";
|
|
37
|
+
}, {
|
|
38
|
+
readonly id: "green";
|
|
39
|
+
readonly label: "Green";
|
|
40
|
+
readonly seed: "#386A20";
|
|
41
|
+
}, {
|
|
42
|
+
readonly id: "lime";
|
|
43
|
+
readonly label: "Lime";
|
|
44
|
+
readonly seed: "#4C6706";
|
|
45
|
+
}, {
|
|
46
|
+
readonly id: "olive";
|
|
47
|
+
readonly label: "Olive";
|
|
48
|
+
readonly seed: "#636118";
|
|
49
|
+
}, {
|
|
50
|
+
readonly id: "amber";
|
|
51
|
+
readonly label: "Amber";
|
|
52
|
+
readonly seed: "#785900";
|
|
53
|
+
}, {
|
|
54
|
+
readonly id: "sand";
|
|
55
|
+
readonly label: "Sand";
|
|
56
|
+
readonly seed: "#715C2E";
|
|
57
|
+
}, {
|
|
58
|
+
readonly id: "orange";
|
|
59
|
+
readonly label: "Orange";
|
|
60
|
+
readonly seed: "#8B5000";
|
|
61
|
+
}, {
|
|
62
|
+
readonly id: "deep-orange";
|
|
63
|
+
readonly label: "Deep Orange";
|
|
64
|
+
readonly seed: "#96480A";
|
|
65
|
+
}, {
|
|
66
|
+
readonly id: "brown";
|
|
67
|
+
readonly label: "Brown";
|
|
68
|
+
readonly seed: "#6E4C32";
|
|
69
|
+
}, {
|
|
70
|
+
readonly id: "red";
|
|
71
|
+
readonly label: "Red";
|
|
72
|
+
readonly seed: "#B82000";
|
|
73
|
+
}, {
|
|
74
|
+
readonly id: "coral";
|
|
75
|
+
readonly label: "Coral";
|
|
76
|
+
readonly seed: "#A03530";
|
|
77
|
+
}, {
|
|
78
|
+
readonly id: "crimson";
|
|
79
|
+
readonly label: "Crimson";
|
|
80
|
+
readonly seed: "#9C4068";
|
|
81
|
+
}, {
|
|
82
|
+
readonly id: "pink";
|
|
83
|
+
readonly label: "Pink";
|
|
84
|
+
readonly seed: "#9C4057";
|
|
85
|
+
}, {
|
|
86
|
+
readonly id: "violet";
|
|
87
|
+
readonly label: "Violet";
|
|
88
|
+
readonly seed: "#7C39A4";
|
|
89
|
+
}, {
|
|
90
|
+
readonly id: "slate";
|
|
91
|
+
readonly label: "Slate";
|
|
92
|
+
readonly seed: "#4A6269";
|
|
93
|
+
}, {
|
|
94
|
+
readonly id: "graphite";
|
|
95
|
+
readonly label: "Graphite";
|
|
96
|
+
readonly seed: "#5C5C5C";
|
|
97
|
+
}, {
|
|
98
|
+
readonly id: "charcoal";
|
|
99
|
+
readonly label: "Charcoal";
|
|
100
|
+
readonly seed: "#3C3C3C";
|
|
101
|
+
}, {
|
|
102
|
+
readonly id: "steel";
|
|
103
|
+
readonly label: "Steel";
|
|
104
|
+
readonly seed: "#5A6A72";
|
|
105
|
+
}, {
|
|
106
|
+
readonly id: "ash";
|
|
107
|
+
readonly label: "Ash";
|
|
108
|
+
readonly seed: "#6B6560";
|
|
109
|
+
}, {
|
|
110
|
+
readonly id: "iron";
|
|
111
|
+
readonly label: "Iron";
|
|
112
|
+
readonly seed: "#505864";
|
|
113
|
+
}, {
|
|
114
|
+
readonly id: "fog";
|
|
115
|
+
readonly label: "Fog";
|
|
116
|
+
readonly seed: "#625E6E";
|
|
117
|
+
}, {
|
|
118
|
+
readonly id: "pewter";
|
|
119
|
+
readonly label: "Pewter";
|
|
120
|
+
readonly seed: "#5A6360";
|
|
121
|
+
}, {
|
|
122
|
+
readonly id: "smoke";
|
|
123
|
+
readonly label: "Smoke";
|
|
124
|
+
readonly seed: "#4D5C66";
|
|
125
|
+
}, {
|
|
126
|
+
readonly id: "stone";
|
|
127
|
+
readonly label: "Stone";
|
|
128
|
+
readonly seed: "#68635A";
|
|
129
|
+
}, {
|
|
130
|
+
readonly id: "zinc";
|
|
131
|
+
readonly label: "Zinc";
|
|
132
|
+
readonly seed: "#585B5E";
|
|
133
|
+
}, {
|
|
134
|
+
readonly id: "monochrome";
|
|
135
|
+
readonly label: "Monochrome";
|
|
136
|
+
readonly seed: "#000000";
|
|
137
|
+
}, {
|
|
138
|
+
readonly id: "rust";
|
|
139
|
+
readonly label: "Rust";
|
|
140
|
+
readonly seed: "#9C441E";
|
|
141
|
+
}, {
|
|
142
|
+
readonly id: "gold";
|
|
143
|
+
readonly label: "Gold";
|
|
144
|
+
readonly seed: "#715C00";
|
|
145
|
+
}, {
|
|
146
|
+
readonly id: "emerald";
|
|
147
|
+
readonly label: "Emerald";
|
|
148
|
+
readonly seed: "#006D39";
|
|
149
|
+
}, {
|
|
150
|
+
readonly id: "turquoise";
|
|
151
|
+
readonly label: "Turquoise";
|
|
152
|
+
readonly seed: "#006A68";
|
|
153
|
+
}, {
|
|
154
|
+
readonly id: "cobalt";
|
|
155
|
+
readonly label: "Cobalt";
|
|
156
|
+
readonly seed: "#006684";
|
|
157
|
+
}, {
|
|
158
|
+
readonly id: "sapphire";
|
|
159
|
+
readonly label: "Sapphire";
|
|
160
|
+
readonly seed: "#006399";
|
|
161
|
+
}, {
|
|
162
|
+
readonly id: "amethyst";
|
|
163
|
+
readonly label: "Amethyst";
|
|
164
|
+
readonly seed: "#5953AC";
|
|
165
|
+
}, {
|
|
166
|
+
readonly id: "magenta";
|
|
167
|
+
readonly label: "Magenta";
|
|
168
|
+
readonly seed: "#8D3F92";
|
|
169
|
+
}, {
|
|
170
|
+
readonly id: "mauve";
|
|
171
|
+
readonly label: "Mauve";
|
|
172
|
+
readonly seed: "#914277";
|
|
173
|
+
}];
|
|
174
|
+
/** The id of a palette that ships with the library (`palettes.css`, plus the `purple` baseline). */
|
|
175
|
+
export type PaletteId = (typeof builtInPalettes)[number]['id'];
|
|
176
|
+
/** Every palette: the built-in ones, plus `createM3UI({ customPalettes })`. */
|
|
11
177
|
export declare const palettes: Palette[];
|
|
12
178
|
/** The palette id used while a seed color is active (`useColorPalette().setSeed()`). */
|
|
13
179
|
export declare const SEED_PALETTE = "seed";
|
|
@@ -22,12 +188,12 @@ export declare const CSS_KEY = "m3-palette-css";
|
|
|
22
188
|
* `@m3ui-vue/m3ui-vue/palettes-contrast` imported for medium and high; seed palettes are regenerated.
|
|
23
189
|
*/
|
|
24
190
|
export type ContrastLevel = 'standard' | 'medium' | 'high' | 'system';
|
|
25
|
-
export
|
|
191
|
+
export { STYLE_ID };
|
|
26
192
|
export declare function useColorPalette(): {
|
|
27
|
-
palette:
|
|
193
|
+
palette: Ref<string, string>;
|
|
28
194
|
palettes: Palette[];
|
|
29
|
-
set: (id: string) => void;
|
|
30
|
-
seed: Readonly<
|
|
195
|
+
set: (id: PaletteId | (string & {})) => void;
|
|
196
|
+
seed: Readonly<Ref<{
|
|
31
197
|
readonly seed: string;
|
|
32
198
|
readonly variant?: import("./dynamicColor").SchemeVariant | undefined;
|
|
33
199
|
readonly contrast?: number | undefined;
|
|
@@ -37,10 +203,10 @@ export declare function useColorPalette(): {
|
|
|
37
203
|
readonly contrast?: number | undefined;
|
|
38
204
|
} | null>>;
|
|
39
205
|
setSeed: (seed: string, options?: SeedOptions) => Promise<void>;
|
|
40
|
-
contrast: Readonly<
|
|
41
|
-
activeContrast:
|
|
206
|
+
contrast: Readonly<Ref<ContrastLevel>>;
|
|
207
|
+
activeContrast: Ref<"medium" | "standard" | "high", "medium" | "standard" | "high">;
|
|
42
208
|
setContrast: (level: ContrastLevel) => void;
|
|
43
|
-
persistPalette:
|
|
209
|
+
persistPalette: Ref<boolean, boolean>;
|
|
44
210
|
setPersistPalette: (enabled: boolean) => void;
|
|
45
211
|
};
|
|
46
212
|
/**
|
|
@@ -25,6 +25,10 @@ export interface M3Locale {
|
|
|
25
25
|
maxSizePrefix: string;
|
|
26
26
|
remove: string;
|
|
27
27
|
selectDate: string;
|
|
28
|
+
ok: string;
|
|
29
|
+
dateToggleInput: string;
|
|
30
|
+
dateToggleCalendar: string;
|
|
31
|
+
dateInputLabel: string;
|
|
28
32
|
selectTime: string;
|
|
29
33
|
timeHourSelection: string;
|
|
30
34
|
timeMinuteSelection: string;
|
|
@@ -35,6 +39,10 @@ export interface M3Locale {
|
|
|
35
39
|
sheetExpand: string;
|
|
36
40
|
sheetCollapse: string;
|
|
37
41
|
sheetDismiss: string;
|
|
42
|
+
seekBar: string;
|
|
43
|
+
seekBarValue: string;
|
|
44
|
+
seekBarShowRemaining: string;
|
|
45
|
+
seekBarShowDuration: string;
|
|
38
46
|
selectRange: string;
|
|
39
47
|
pickStart: string;
|
|
40
48
|
pickEnd: string;
|
|
@@ -146,6 +154,36 @@ export interface M3Locale {
|
|
|
146
154
|
nextPage: string;
|
|
147
155
|
carousel: string;
|
|
148
156
|
carouselItem: string;
|
|
157
|
+
mapTitle: string;
|
|
158
|
+
mapMarker: string;
|
|
159
|
+
mapZoomIn: string;
|
|
160
|
+
mapZoomOut: string;
|
|
161
|
+
mapResetBearing: string;
|
|
162
|
+
mapFindMyLocation: string;
|
|
163
|
+
mapLocationNotAvailable: string;
|
|
164
|
+
mapEnterFullscreen: string;
|
|
165
|
+
mapExitFullscreen: string;
|
|
166
|
+
mapToggleAttribution: string;
|
|
167
|
+
mapFeedback: string;
|
|
168
|
+
mapCtrlScroll: string;
|
|
169
|
+
mapCmdScroll: string;
|
|
170
|
+
mapTwoFingers: string;
|
|
171
|
+
mapLayers: string;
|
|
172
|
+
mapSearchLayers: string;
|
|
173
|
+
mapNoLayers: string;
|
|
174
|
+
mapShowLayer: string;
|
|
175
|
+
mapHideLayer: string;
|
|
176
|
+
mapOpacity: string;
|
|
177
|
+
mapDownload: string;
|
|
178
|
+
mapNoBaseLayer: string;
|
|
179
|
+
mapHoverInfo: string;
|
|
180
|
+
mapNoValue: string;
|
|
181
|
+
mapMeasureDistance: string;
|
|
182
|
+
mapMeasureArea: string;
|
|
183
|
+
mapClearMeasurements: string;
|
|
184
|
+
mapDeleteMeasurement: string;
|
|
185
|
+
mapTotal: string;
|
|
186
|
+
mapSearchPlaces: string;
|
|
149
187
|
}
|
|
150
188
|
export declare const defaultLocale: M3Locale;
|
|
151
189
|
export declare const M3_LOCALE_KEY: InjectionKey<MaybeRef<Partial<M3Locale>>>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type ComputedRef, type InjectionKey, type Ref, type ShallowRef } from 'vue';
|
|
2
|
+
import type * as Maplibre from 'maplibre-gl';
|
|
3
|
+
import type { MapLayerModel } from './mapAdapters';
|
|
4
|
+
import type { MapLayerState } from './useMapLayers';
|
|
5
|
+
/** The `maplibre-gl` module (its classes: `Map`, `Marker`, `Popup`…) */
|
|
6
|
+
export type MaplibreModule = typeof import('maplibre-gl');
|
|
7
|
+
/** What `MMap` provides to everything inside it. */
|
|
8
|
+
export interface MapContext {
|
|
9
|
+
/** The MapLibre map, once created (never on the server) */
|
|
10
|
+
map: ShallowRef<Maplibre.Map | undefined>;
|
|
11
|
+
/** The `maplibre-gl` module, loaded with the map (so nothing imports it on the server) */
|
|
12
|
+
maplibre: ShallowRef<MaplibreModule | undefined>;
|
|
13
|
+
/** Bumped on every `style.load`: sources and layers added by components are re-added after a style change */
|
|
14
|
+
styleVersion: Ref<number>;
|
|
15
|
+
/** The style as `MMap`'s `adapter` reads it (undefined without one) */
|
|
16
|
+
model: ShallowRef<MapLayerModel | undefined>;
|
|
17
|
+
/** Visibility and opacity of the model's layers */
|
|
18
|
+
layerState: MapLayerState;
|
|
19
|
+
/**
|
|
20
|
+
* The tool that owns the map's clicks right now (`'measure'` while measuring), or null: `MMapIdentify` stays quiet
|
|
21
|
+
* meanwhile. Set it from tools of your own the same way
|
|
22
|
+
*/
|
|
23
|
+
activeTool: Ref<string | null>;
|
|
24
|
+
}
|
|
25
|
+
export declare const MAP_KEY: InjectionKey<MapContext>;
|
|
26
|
+
type MapEventType = keyof Maplibre.MapEventType;
|
|
27
|
+
type LayerEventType = keyof Maplibre.MapLayerEventType;
|
|
28
|
+
/**
|
|
29
|
+
* The map of the enclosing `MMap`, for your own controls, layers and handlers (call it in a component inside
|
|
30
|
+
* `MMap`). Listeners added through it are removed when the component unmounts.
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* const { map, onLayer } = useMap()
|
|
34
|
+
* onLayer('click', 'parcels-fill', (e) => console.log(e.features?.[0]?.properties))
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function useMap(): {
|
|
38
|
+
map: ComputedRef<Maplibre.Map | undefined>;
|
|
39
|
+
maplibre: ComputedRef<MaplibreModule | undefined>;
|
|
40
|
+
styleVersion: ComputedRef<number>;
|
|
41
|
+
/** The tool that owns the map's clicks (null: none): set it while yours does, and leave it alone otherwise */
|
|
42
|
+
activeTool: Ref<string | null, string | null>;
|
|
43
|
+
onReady: (fn: (map: Maplibre.Map, maplibre: MaplibreModule) => void) => void;
|
|
44
|
+
on: <T extends MapEventType>(type: T, listener: (e: Maplibre.MapEventType[T] & object) => void) => void;
|
|
45
|
+
onLayer: <T extends LayerEventType>(type: T, layerId: string, listener: (e: Maplibre.MapLayerEventType[T] & object) => void) => void;
|
|
46
|
+
};
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Maplibre from 'maplibre-gl';
|
|
2
|
+
/**
|
|
3
|
+
* Filters for the layers of the enclosing `MMap`, on top of the filters their style already has (a layer that only
|
|
4
|
+
* draws parks keeps doing so): `setFilter(layer, expression)` combines both, `setFilter(layer, null)` brings the
|
|
5
|
+
* style's back. `MMapFilter` is built on it; use it for filters of your own (a range slider, a date, a search…).
|
|
6
|
+
*/
|
|
7
|
+
export declare function useMapFilter(): {
|
|
8
|
+
setFilter: (layerId: string, filter: Maplibre.FilterSpecification | null) => void;
|
|
9
|
+
valuesOf: (layerId: string, property: string) => (string | number)[];
|
|
10
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type * as Maplibre from 'maplibre-gl';
|
|
2
|
+
import type { MapLayerInfo, MapLayerModel } from './mapAdapters';
|
|
3
|
+
/** Visibility and opacity of the model's layers, shared by everything inside one `MMap`. */
|
|
4
|
+
export interface MapLayerState {
|
|
5
|
+
visible: Record<string, boolean>;
|
|
6
|
+
opacity: Record<string, number>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createLayerState(): MapLayerState;
|
|
9
|
+
export declare function readLayerState(state: MapLayerState, map: Maplibre.Map, model: MapLayerModel | undefined): void;
|
|
10
|
+
/**
|
|
11
|
+
* The layers of the enclosing `MMap`'s style as its `adapter` describes them, with their visibility and opacity, for a
|
|
12
|
+
* layer panel or a base layer switcher of your own (`MMapLayers` and `MMapBaseLayers` are built on it). Changes go to
|
|
13
|
+
* the map and to every component using it; a layer's `children` follow it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useMapLayers(): {
|
|
16
|
+
/** The adapter's model (undefined without an `adapter`) */
|
|
17
|
+
model: import("vue").ComputedRef<MapLayerModel | undefined>;
|
|
18
|
+
layers: import("vue").ComputedRef<MapLayerInfo[]>;
|
|
19
|
+
isVisible: (id: string) => boolean;
|
|
20
|
+
setVisible: (id: string, visible: boolean) => void;
|
|
21
|
+
toggle: (id: string) => void;
|
|
22
|
+
opacityOf: (id: string) => number;
|
|
23
|
+
setOpacity: (id: string, opacity: number) => void;
|
|
24
|
+
layersOf: (group: string | null) => MapLayerInfo[];
|
|
25
|
+
groupState: (group: string) => "visible" | "hidden" | "partial";
|
|
26
|
+
setGroupVisible: (group: string, visible: boolean) => void;
|
|
27
|
+
baseLayers: import("vue").ComputedRef<MapLayerInfo[]>;
|
|
28
|
+
baseLayer: import("vue").ComputedRef<string | null>;
|
|
29
|
+
setBaseLayer: (id: string | null) => void;
|
|
30
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { THEME_KEY } from './_storageKeys';
|
|
1
2
|
export type Theme = 'light' | 'dark' | 'system';
|
|
2
|
-
export
|
|
3
|
+
export { THEME_KEY };
|
|
3
4
|
export declare function useTheme(): {
|
|
4
5
|
theme: import("vue").Ref<Theme, Theme>;
|
|
5
6
|
cycle: () => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { createM3UI } from './plugin';
|
|
2
2
|
export type { M3UIOptions } from './plugin';
|
|
3
|
+
export type { M3InitialState } from './composables/_ssrState';
|
|
3
4
|
export { useTheme } from './composables/useTheme';
|
|
4
5
|
export type { Theme } from './composables/useTheme';
|
|
5
6
|
export { useColorPalette, palettes } from './composables/useColorPalette';
|
|
6
|
-
export type { Palette, ActiveSeed, ContrastLevel } from './composables/useColorPalette';
|
|
7
|
+
export type { Palette, PaletteId, ActiveSeed, ContrastLevel } from './composables/useColorPalette';
|
|
7
8
|
export { SEED_PALETTE } from './composables/useColorPalette';
|
|
8
9
|
export { themeInitScript } from './composables/themeInitScript';
|
|
9
10
|
export type { ThemeInitOptions } from './composables/themeInitScript';
|
|
@@ -134,6 +135,7 @@ export { default as MScheduler } from './components/MScheduler.vue';
|
|
|
134
135
|
export { default as MScrollable } from './components/MScrollable.vue';
|
|
135
136
|
export { default as MSearchBar } from './components/MSearchBar.vue';
|
|
136
137
|
export { default as MSection } from './components/MSection.vue';
|
|
138
|
+
export { default as MSeekBar } from './components/MSeekBar.vue';
|
|
137
139
|
export { default as MSegmentedButton } from './components/MSegmentedButton.vue';
|
|
138
140
|
export { default as MScrollField } from './components/MScrollField.vue';
|
|
139
141
|
export { default as MSelect } from './components/MSelect.vue';
|
|
@@ -203,6 +205,7 @@ export type { SpeedDialItem } from './components/MFab.vue';
|
|
|
203
205
|
export type { FabMenuItem } from './components/MFabMenu.vue';
|
|
204
206
|
export type { NavRailItem } from './components/MNavigationRail.vue';
|
|
205
207
|
export type { SchedulerEvent } from './components/MScheduler.vue';
|
|
208
|
+
export type { SeekBarChapter } from './components/MSeekBar.vue';
|
|
206
209
|
export type { SegmentedOption } from './components/MSegmentedButton.vue';
|
|
207
210
|
export type { SpotlightResult } from './components/MSpotlightSearch.vue';
|
|
208
211
|
export type { StepItem } from './components/MStepper.vue';
|