@flxgde/gigamenu 0.5.4 → 0.7.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/fesm2022/flxgde-gigamenu.mjs +95 -52
- package/fesm2022/flxgde-gigamenu.mjs.map +1 -1
- package/package.json +5 -4
- package/styles.css +2 -2
- package/types/flxgde-gigamenu.d.ts +11 -11
|
@@ -33,11 +33,16 @@ const DEFAULT_PROVIDER_OPTIONS = {
|
|
|
33
33
|
};
|
|
34
34
|
class GigamenuService {
|
|
35
35
|
_router;
|
|
36
|
-
_items = signal(new Map(),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
_items = signal(new Map(), /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "_items" }] : /* istanbul ignore next */ []));
|
|
38
|
+
_providers = signal(new Map(), /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "_providers" }] : /* istanbul ignore next */ []));
|
|
40
|
+
_isOpen = signal(false, /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "_isOpen" }] : /* istanbul ignore next */ []));
|
|
42
|
+
_config = signal(DEFAULT_CONFIG, /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "_config" }] : /* istanbul ignore next */ []));
|
|
44
|
+
items = computed(() => Array.from(this._items().values()), /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
41
46
|
providers = this._providers.asReadonly();
|
|
42
47
|
isOpen = this._isOpen.asReadonly();
|
|
43
48
|
config = this._config.asReadonly();
|
|
@@ -210,10 +215,10 @@ class GigamenuService {
|
|
|
210
215
|
.replace(/[-_]/g, ' ')
|
|
211
216
|
.replace(/\b\w/g, (c) => c.toUpperCase());
|
|
212
217
|
}
|
|
213
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
214
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
218
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
219
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuService, providedIn: 'root' });
|
|
215
220
|
}
|
|
216
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
221
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuService, decorators: [{
|
|
217
222
|
type: Injectable,
|
|
218
223
|
args: [{ providedIn: 'root' }]
|
|
219
224
|
}] });
|
|
@@ -234,10 +239,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
234
239
|
*/
|
|
235
240
|
class GigamenuItemTemplate {
|
|
236
241
|
template = inject(TemplateRef);
|
|
237
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
238
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
242
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuItemTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
243
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.5", type: GigamenuItemTemplate, isStandalone: true, selector: "[gmItem]", ngImport: i0 });
|
|
239
244
|
}
|
|
240
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuItemTemplate, decorators: [{
|
|
241
246
|
type: Directive,
|
|
242
247
|
args: [{
|
|
243
248
|
selector: '[gmItem]',
|
|
@@ -258,10 +263,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
258
263
|
*/
|
|
259
264
|
class GigamenuEmptyTemplate {
|
|
260
265
|
template = inject(TemplateRef);
|
|
261
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
262
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
266
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuEmptyTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
267
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.5", type: GigamenuEmptyTemplate, isStandalone: true, selector: "[gmEmpty]", ngImport: i0 });
|
|
263
268
|
}
|
|
264
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
269
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuEmptyTemplate, decorators: [{
|
|
265
270
|
type: Directive,
|
|
266
271
|
args: [{
|
|
267
272
|
selector: '[gmEmpty]',
|
|
@@ -282,10 +287,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
282
287
|
*/
|
|
283
288
|
class GigamenuHeaderTemplate {
|
|
284
289
|
template = inject(TemplateRef);
|
|
285
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
286
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
290
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuHeaderTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
291
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.5", type: GigamenuHeaderTemplate, isStandalone: true, selector: "[gmHeader]", ngImport: i0 });
|
|
287
292
|
}
|
|
288
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuHeaderTemplate, decorators: [{
|
|
289
294
|
type: Directive,
|
|
290
295
|
args: [{
|
|
291
296
|
selector: '[gmHeader]',
|
|
@@ -306,10 +311,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
306
311
|
*/
|
|
307
312
|
class GigamenuFooterTemplate {
|
|
308
313
|
template = inject(TemplateRef);
|
|
309
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
310
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
314
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuFooterTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
315
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.5", type: GigamenuFooterTemplate, isStandalone: true, selector: "[gmFooter]", ngImport: i0 });
|
|
311
316
|
}
|
|
312
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuFooterTemplate, decorators: [{
|
|
313
318
|
type: Directive,
|
|
314
319
|
args: [{
|
|
315
320
|
selector: '[gmFooter]',
|
|
@@ -318,10 +323,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
318
323
|
}] });
|
|
319
324
|
class GigamenuPanelTemplate {
|
|
320
325
|
template = inject(TemplateRef);
|
|
321
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
322
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
326
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuPanelTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
327
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.5", type: GigamenuPanelTemplate, isStandalone: true, selector: "[gmPanel]", ngImport: i0 });
|
|
323
328
|
}
|
|
324
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
329
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuPanelTemplate, decorators: [{
|
|
325
330
|
type: Directive,
|
|
326
331
|
args: [{
|
|
327
332
|
selector: '[gmPanel]',
|
|
@@ -1107,10 +1112,10 @@ class FrecencyService {
|
|
|
1107
1112
|
// Storage full or unavailable
|
|
1108
1113
|
}
|
|
1109
1114
|
}
|
|
1110
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1111
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1115
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: FrecencyService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1116
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: FrecencyService, providedIn: 'root' });
|
|
1112
1117
|
}
|
|
1113
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: FrecencyService, decorators: [{
|
|
1114
1119
|
type: Injectable,
|
|
1115
1120
|
args: [{ providedIn: 'root' }]
|
|
1116
1121
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
@@ -1121,40 +1126,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1121
1126
|
class GigamenuComponent {
|
|
1122
1127
|
service;
|
|
1123
1128
|
frecency;
|
|
1124
|
-
searchInput = viewChild('searchInput',
|
|
1125
|
-
|
|
1129
|
+
searchInput = viewChild('searchInput', /* @ts-ignore */
|
|
1130
|
+
...(ngDevMode ? [{ debugName: "searchInput" }] : /* istanbul ignore next */ []));
|
|
1131
|
+
listContainer = viewChild('listContainer', /* @ts-ignore */
|
|
1132
|
+
...(ngDevMode ? [{ debugName: "listContainer" }] : /* istanbul ignore next */ []));
|
|
1126
1133
|
isBrowser;
|
|
1127
1134
|
// Template queries
|
|
1128
|
-
itemTemplate = contentChild(GigamenuItemTemplate,
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1135
|
+
itemTemplate = contentChild(GigamenuItemTemplate, /* @ts-ignore */
|
|
1136
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
1137
|
+
emptyTemplate = contentChild(GigamenuEmptyTemplate, /* @ts-ignore */
|
|
1138
|
+
...(ngDevMode ? [{ debugName: "emptyTemplate" }] : /* istanbul ignore next */ []));
|
|
1139
|
+
headerTemplate = contentChild(GigamenuHeaderTemplate, /* @ts-ignore */
|
|
1140
|
+
...(ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []));
|
|
1141
|
+
footerTemplate = contentChild(GigamenuFooterTemplate, /* @ts-ignore */
|
|
1142
|
+
...(ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []));
|
|
1143
|
+
panelTemplate = contentChild(GigamenuPanelTemplate, /* @ts-ignore */
|
|
1144
|
+
...(ngDevMode ? [{ debugName: "panelTemplate" }] : /* istanbul ignore next */ []));
|
|
1133
1145
|
// Core state signals
|
|
1134
|
-
query = signal('',
|
|
1135
|
-
|
|
1146
|
+
query = signal('', /* @ts-ignore */
|
|
1147
|
+
...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
|
|
1148
|
+
selectedIndex = signal(0, /* @ts-ignore */
|
|
1149
|
+
...(ngDevMode ? [{ debugName: "selectedIndex" }] : /* istanbul ignore next */ []));
|
|
1136
1150
|
// Step-by-step input state
|
|
1137
|
-
lockedAction = signal(null,
|
|
1138
|
-
|
|
1151
|
+
lockedAction = signal(null, /* @ts-ignore */
|
|
1152
|
+
...(ngDevMode ? [{ debugName: "lockedAction" }] : /* istanbul ignore next */ []));
|
|
1153
|
+
paramValues = signal([], /* @ts-ignore */
|
|
1154
|
+
...(ngDevMode ? [{ debugName: "paramValues" }] : /* istanbul ignore next */ []));
|
|
1139
1155
|
// Autocomplete state signals
|
|
1140
|
-
autocompleteSuggestions = signal([],
|
|
1156
|
+
autocompleteSuggestions = signal([], /* @ts-ignore */
|
|
1157
|
+
...(ngDevMode ? [{ debugName: "autocompleteSuggestions" }] : /* istanbul ignore next */ []));
|
|
1141
1158
|
autocompleteCache = new Map();
|
|
1142
|
-
selectedParamOptions = signal(new Map(),
|
|
1159
|
+
selectedParamOptions = signal(new Map(), /* @ts-ignore */
|
|
1160
|
+
...(ngDevMode ? [{ debugName: "selectedParamOptions" }] : /* istanbul ignore next */ []));
|
|
1143
1161
|
// Dynamic provider state
|
|
1144
|
-
providerResults = signal(new Map(),
|
|
1162
|
+
providerResults = signal(new Map(), /* @ts-ignore */
|
|
1163
|
+
...(ngDevMode ? [{ debugName: "providerResults" }] : /* istanbul ignore next */ []));
|
|
1145
1164
|
providerTimers = new Map();
|
|
1146
1165
|
providerInvocation = 0;
|
|
1147
1166
|
// Query parsing (simplified - only used for filtering)
|
|
1148
1167
|
queryParser = computed(() => {
|
|
1149
1168
|
const separator = this.service.config().argSeparator ?? ' ';
|
|
1150
1169
|
return new QueryParser(separator);
|
|
1151
|
-
},
|
|
1170
|
+
}, /* @ts-ignore */
|
|
1171
|
+
...(ngDevMode ? [{ debugName: "queryParser" }] : /* istanbul ignore next */ []));
|
|
1152
1172
|
// Selected item from display list
|
|
1153
1173
|
selectedItem = computed(() => {
|
|
1154
1174
|
const items = this.displayItems();
|
|
1155
1175
|
const index = this.selectedIndex();
|
|
1156
1176
|
return items[index] ?? null;
|
|
1157
|
-
},
|
|
1177
|
+
}, /* @ts-ignore */
|
|
1178
|
+
...(ngDevMode ? [{ debugName: "selectedItem" }] : /* istanbul ignore next */ []));
|
|
1158
1179
|
currentParamIndex = computed(() => {
|
|
1159
1180
|
const action = this.lockedAction();
|
|
1160
1181
|
if (!action || !action.params)
|
|
@@ -1163,27 +1184,31 @@ class GigamenuComponent {
|
|
|
1163
1184
|
if (filled >= action.params.length)
|
|
1164
1185
|
return null;
|
|
1165
1186
|
return filled;
|
|
1166
|
-
},
|
|
1187
|
+
}, /* @ts-ignore */
|
|
1188
|
+
...(ngDevMode ? [{ debugName: "currentParamIndex" }] : /* istanbul ignore next */ []));
|
|
1167
1189
|
currentParamName = computed(() => {
|
|
1168
1190
|
const action = this.lockedAction();
|
|
1169
1191
|
const idx = this.currentParamIndex();
|
|
1170
1192
|
if (!action || idx === null || !action.params)
|
|
1171
1193
|
return null;
|
|
1172
1194
|
return action.params[idx] ?? null;
|
|
1173
|
-
},
|
|
1195
|
+
}, /* @ts-ignore */
|
|
1196
|
+
...(ngDevMode ? [{ debugName: "currentParamName" }] : /* istanbul ignore next */ []));
|
|
1174
1197
|
hasAutocomplete = computed(() => {
|
|
1175
1198
|
const action = this.lockedAction();
|
|
1176
1199
|
const paramName = this.currentParamName();
|
|
1177
1200
|
if (!action || !paramName)
|
|
1178
1201
|
return false;
|
|
1179
1202
|
return computeHasAutocomplete(action, paramName);
|
|
1180
|
-
},
|
|
1203
|
+
}, /* @ts-ignore */
|
|
1204
|
+
...(ngDevMode ? [{ debugName: "hasAutocomplete" }] : /* istanbul ignore next */ []));
|
|
1181
1205
|
currentState = computed(() => {
|
|
1182
1206
|
return computeInputState({
|
|
1183
1207
|
isOpen: this.service.isOpen(),
|
|
1184
1208
|
hasLockedAction: this.lockedAction() !== null,
|
|
1185
1209
|
});
|
|
1186
|
-
},
|
|
1210
|
+
}, /* @ts-ignore */
|
|
1211
|
+
...(ngDevMode ? [{ debugName: "currentState" }] : /* istanbul ignore next */ []));
|
|
1187
1212
|
filteredItems = computed(() => {
|
|
1188
1213
|
const searchTerm = this.query().toLowerCase().trim();
|
|
1189
1214
|
const items = this.service.items();
|
|
@@ -1195,7 +1220,8 @@ class GigamenuComponent {
|
|
|
1195
1220
|
const matched = filterItems(items, searchTerm, this.queryParser());
|
|
1196
1221
|
const scores = this.frecency.getScores(searchTerm);
|
|
1197
1222
|
return sortByFrecency(matched, scores).slice(0, maxResults);
|
|
1198
|
-
},
|
|
1223
|
+
}, /* @ts-ignore */
|
|
1224
|
+
...(ngDevMode ? [{ debugName: "filteredItems" }] : /* istanbul ignore next */ []));
|
|
1199
1225
|
// Display items: actions in ActionSelection, suggestions in ParameterInput
|
|
1200
1226
|
displayItems = computed(() => {
|
|
1201
1227
|
const state = this.currentState();
|
|
@@ -1216,7 +1242,8 @@ class GigamenuComponent {
|
|
|
1216
1242
|
dynamic.push(...items);
|
|
1217
1243
|
}
|
|
1218
1244
|
return [...staticItems, ...dynamic];
|
|
1219
|
-
},
|
|
1245
|
+
}, /* @ts-ignore */
|
|
1246
|
+
...(ngDevMode ? [{ debugName: "displayItems" }] : /* istanbul ignore next */ []));
|
|
1220
1247
|
// Template helper
|
|
1221
1248
|
getParamColor = getParamColor;
|
|
1222
1249
|
constructor(service, frecency, platformId) {
|
|
@@ -1229,6 +1256,22 @@ class GigamenuComponent {
|
|
|
1229
1256
|
setTimeout(() => this.searchInput()?.nativeElement.focus(), 0);
|
|
1230
1257
|
}
|
|
1231
1258
|
});
|
|
1259
|
+
// Scroll lock: prevent page scrolling while the menu is open
|
|
1260
|
+
effect(() => {
|
|
1261
|
+
if (!this.isBrowser)
|
|
1262
|
+
return;
|
|
1263
|
+
const open = this.service.isOpen();
|
|
1264
|
+
const body = document.body;
|
|
1265
|
+
if (open) {
|
|
1266
|
+
const previous = body.style.overflow;
|
|
1267
|
+
body.dataset['gigamenuPrevOverflow'] = previous;
|
|
1268
|
+
body.style.overflow = 'hidden';
|
|
1269
|
+
}
|
|
1270
|
+
else if ('gigamenuPrevOverflow' in body.dataset) {
|
|
1271
|
+
body.style.overflow = body.dataset['gigamenuPrevOverflow'] ?? '';
|
|
1272
|
+
delete body.dataset['gigamenuPrevOverflow'];
|
|
1273
|
+
}
|
|
1274
|
+
});
|
|
1232
1275
|
// Frecency auto-select effect (only in ActionSelection mode)
|
|
1233
1276
|
effect(() => {
|
|
1234
1277
|
const state = this.currentState();
|
|
@@ -1635,12 +1678,12 @@ class GigamenuComponent {
|
|
|
1635
1678
|
this.selectedIndex.set(0);
|
|
1636
1679
|
}
|
|
1637
1680
|
}
|
|
1638
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1639
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1681
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuComponent, deps: [{ token: GigamenuService }, { token: FrecencyService }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
|
|
1682
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: GigamenuComponent, isStandalone: true, selector: "gm-gigamenu", host: { listeners: { "document:keydown": "onGlobalKeydown($event)" } }, queries: [{ propertyName: "itemTemplate", first: true, predicate: GigamenuItemTemplate, descendants: true, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: GigamenuEmptyTemplate, descendants: true, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: GigamenuHeaderTemplate, descendants: true, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: GigamenuFooterTemplate, descendants: true, isSignal: true }, { propertyName: "panelTemplate", first: true, predicate: GigamenuPanelTemplate, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "listContainer", first: true, predicate: ["listContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (service.isOpen()) {\n<div\n class=\"fixed inset-0 z-50 flex items-stretch justify-center sm:items-start sm:pt-[15vh]\"\n (click)=\"onBackdropClick($event)\"\n>\n <div class=\"fixed inset-0 bg-black/50 backdrop-blur-sm\"></div>\n\n <!-- Custom panel template -->\n @if (panelTemplate(); as pt) {\n <ng-container\n [ngTemplateOutlet]=\"pt.template\"\n [ngTemplateOutletContext]=\"getPanelContext()\"\n ></ng-container>\n } @else {\n <!-- Default panel -->\n <div\n class=\"relative z-10 w-full flex flex-col overflow-hidden border border-neutral-200 bg-white shadow-2xl dark:border-neutral-700 dark:bg-neutral-900 sm:max-w-xl sm:min-h-50 sm:flex-none sm:rounded-xl\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Command menu\"\n >\n <!-- Header -->\n @if (headerTemplate(); as ht) {\n <ng-container\n [ngTemplateOutlet]=\"ht.template\"\n [ngTemplateOutletContext]=\"getHeaderContext()\"\n ></ng-container>\n } @else {\n <div class=\"border-b border-neutral-200 dark:border-neutral-700\">\n <!-- Breadcrumb (when action is locked) -->\n @if (lockedAction(); as action) {\n <div class=\"flex flex-wrap items-center gap-1 px-4 py-2 text-sm\">\n <button\n type=\"button\"\n (click)=\"unlockActionFromUI()\"\n class=\"inline-flex items-center gap-1.5 rounded-md bg-blue-100 px-2 py-1 font-medium text-blue-800 hover:bg-blue-200 dark:bg-blue-900/40 dark:text-blue-300 dark:hover:bg-blue-900/60\"\n >\n @if (action.icon) {\n <span>{{ action.icon }}</span>\n }\n {{ action.label }}\n </button>\n @for (value of paramValues(); track $index) {\n <span class=\"text-neutral-400\">\u203A</span>\n <button\n type=\"button\"\n (click)=\"goToParam($index)\"\n [class]=\"'rounded-md px-2 py-1 font-medium hover:opacity-80 ' + getParamColor($index)\"\n >\n <span class=\"text-xs opacity-60\">{{ action.params?.[$index] }}:</span>\n {{ value }}\n </button>\n }\n @if (currentParamName(); as paramName) {\n <span class=\"text-neutral-400\">\u203A</span>\n <span class=\"text-neutral-500 dark:text-neutral-400 italic\">{{ paramName }}:</span>\n }\n </div>\n }\n\n <!-- Search input row -->\n <div class=\"flex items-center px-4\">\n <svg\n class=\"h-5 w-5 text-neutral-400\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z\"\n />\n </svg>\n <input\n #searchInput\n type=\"text\"\n [placeholder]=\"lockedAction() ? (currentParamName() ?? 'Enter value...') : service.config().placeholder\"\n [value]=\"query()\"\n (input)=\"onQueryChange($event)\"\n (keydown)=\"onInputKeydown($event)\"\n class=\"w-full px-3 py-4 text-base text-neutral-900 placeholder-neutral-400 outline-none dark:text-neutral-100 bg-transparent\"\n />\n <kbd\n class=\"rounded border border-neutral-200 bg-neutral-100 px-1.5 py-0.5 text-xs text-neutral-500 dark:border-neutral-600 dark:bg-neutral-800 dark:text-neutral-400\"\n >\n ESC\n </kbd>\n </div>\n </div>\n }\n\n <!-- Items list -->\n <div #listContainer class=\"flex-1 overflow-y-auto p-2 sm:flex-none sm:max-h-80\">\n @if (displayItems().length === 0) {\n <!-- Empty state -->\n @if (emptyTemplate(); as et) {\n <ng-container\n [ngTemplateOutlet]=\"et.template\"\n [ngTemplateOutletContext]=\"getEmptyContext()\"\n ></ng-container>\n } @else {\n <div class=\"px-3 py-8 text-center text-neutral-500\">\n @if (lockedAction()) {\n @if (hasAutocomplete()) {\n Type to search...\n } @else {\n Enter a value and press Tab or Enter\n }\n } @else {\n No results found\n }\n </div>\n }\n } @else {\n @for (item of displayItems(); track item.id; let i = $index) {\n <!-- Custom item template -->\n @if (itemTemplate(); as it) {\n <ng-container\n [ngTemplateOutlet]=\"it.template\"\n [ngTemplateOutletContext]=\"getItemContext(item, i)\"\n ></ng-container>\n } @else {\n <!-- Default item -->\n <button\n type=\"button\"\n (click)=\"onItemClick(item, i)\"\n (mouseenter)=\"selectedIndex.set(i)\"\n [attr.data-index]=\"i\"\n [class]=\"\n 'flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left transition-colors ' +\n (selectedIndex() === i\n ? 'bg-neutral-100 dark:bg-neutral-800'\n : 'hover:bg-neutral-50 dark:hover:bg-neutral-800/50')\n \"\n >\n @if (!lockedAction()) {\n <!-- Action mode: show icon -->\n @if (item.iconClass) {\n <i [class]=\"item.iconClass + ' text-lg text-neutral-600 dark:text-neutral-300'\"></i>\n } @else if (item.icon) {\n <span class=\"text-lg\">{{ item.icon }}</span>\n } @else {\n <span\n class=\"flex h-6 w-6 items-center justify-center rounded bg-neutral-200 text-xs font-medium text-neutral-600 dark:bg-neutral-700 dark:text-neutral-300\"\n >\n {{ item.category === 'page' ? 'P' : 'C' }}\n </span>\n }\n }\n <div class=\"flex-1 min-w-0\">\n <div class=\"truncate font-medium text-neutral-900 dark:text-neutral-100\">\n {{ item.label }}@if (!lockedAction() && item.params) { @for (param of item.params; track $index) {<span class=\"whitespace-pre\"> </span><span [class]=\"getParamColor($index)\"><{{ param }}></span>}@if (item.paramProviders) {<span class=\"ml-2 inline-flex items-center rounded border border-neutral-300 bg-neutral-100 px-1 py-0.5 text-[10px] font-normal text-neutral-500 dark:border-neutral-600 dark:bg-neutral-700 dark:text-neutral-400\">Tab</span>}}\n </div>\n @if (item.description) {\n <div class=\"truncate text-sm text-neutral-500 dark:text-neutral-400\">\n {{ item.description }}\n </div>\n }\n </div>\n @if (!lockedAction()) {\n <span\n class=\"rounded-full px-2 py-0.5 text-xs\"\n [class]=\"\n item.category === 'page'\n ? 'bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400'\n : 'bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400'\n \"\n >\n {{ item.category }}\n </span>\n }\n </button>\n }\n }\n }\n </div>\n\n <!-- Footer -->\n @if (footerTemplate(); as ft) {\n <ng-container\n [ngTemplateOutlet]=\"ft.template\"\n [ngTemplateOutletContext]=\"getFooterContext()\"\n ></ng-container>\n } @else {\n <div\n class=\"flex items-center justify-between border-t border-neutral-200 px-4 py-2 text-xs text-neutral-500 dark:border-neutral-700\"\n >\n <div class=\"flex items-center gap-3\">\n <span class=\"flex items-center gap-1\">\n <kbd class=\"rounded border border-neutral-300 bg-neutral-100 px-1 dark:border-neutral-600 dark:bg-neutral-800\">\u2191</kbd>\n <kbd class=\"rounded border border-neutral-300 bg-neutral-100 px-1 dark:border-neutral-600 dark:bg-neutral-800\">\u2193</kbd>\n navigate\n </span>\n <span class=\"flex items-center gap-1\">\n <kbd class=\"rounded border border-neutral-300 bg-neutral-100 px-1 dark:border-neutral-600 dark:bg-neutral-800\">Tab</kbd>\n @if (lockedAction()) {\n next\n } @else {\n params\n }\n </span>\n <span class=\"flex items-center gap-1\">\n <kbd class=\"rounded border border-neutral-300 bg-neutral-100 px-1 dark:border-neutral-600 dark:bg-neutral-800\">\u21B5</kbd>\n @if (lockedAction()) {\n execute\n } @else {\n select\n }\n </span>\n </div>\n <span>gigamenu</span>\n </div>\n }\n </div>\n }\n</div>\n}\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1640
1683
|
}
|
|
1641
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1684
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GigamenuComponent, decorators: [{
|
|
1642
1685
|
type: Component,
|
|
1643
|
-
args: [{ selector: 'gm-gigamenu', standalone: true, imports: [NgTemplateOutlet], template: "@if (service.isOpen()) {\n<div\n class=\"fixed inset-0 z-50 flex items-
|
|
1686
|
+
args: [{ selector: 'gm-gigamenu', standalone: true, imports: [NgTemplateOutlet], template: "@if (service.isOpen()) {\n<div\n class=\"fixed inset-0 z-50 flex items-stretch justify-center sm:items-start sm:pt-[15vh]\"\n (click)=\"onBackdropClick($event)\"\n>\n <div class=\"fixed inset-0 bg-black/50 backdrop-blur-sm\"></div>\n\n <!-- Custom panel template -->\n @if (panelTemplate(); as pt) {\n <ng-container\n [ngTemplateOutlet]=\"pt.template\"\n [ngTemplateOutletContext]=\"getPanelContext()\"\n ></ng-container>\n } @else {\n <!-- Default panel -->\n <div\n class=\"relative z-10 w-full flex flex-col overflow-hidden border border-neutral-200 bg-white shadow-2xl dark:border-neutral-700 dark:bg-neutral-900 sm:max-w-xl sm:min-h-50 sm:flex-none sm:rounded-xl\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Command menu\"\n >\n <!-- Header -->\n @if (headerTemplate(); as ht) {\n <ng-container\n [ngTemplateOutlet]=\"ht.template\"\n [ngTemplateOutletContext]=\"getHeaderContext()\"\n ></ng-container>\n } @else {\n <div class=\"border-b border-neutral-200 dark:border-neutral-700\">\n <!-- Breadcrumb (when action is locked) -->\n @if (lockedAction(); as action) {\n <div class=\"flex flex-wrap items-center gap-1 px-4 py-2 text-sm\">\n <button\n type=\"button\"\n (click)=\"unlockActionFromUI()\"\n class=\"inline-flex items-center gap-1.5 rounded-md bg-blue-100 px-2 py-1 font-medium text-blue-800 hover:bg-blue-200 dark:bg-blue-900/40 dark:text-blue-300 dark:hover:bg-blue-900/60\"\n >\n @if (action.icon) {\n <span>{{ action.icon }}</span>\n }\n {{ action.label }}\n </button>\n @for (value of paramValues(); track $index) {\n <span class=\"text-neutral-400\">\u203A</span>\n <button\n type=\"button\"\n (click)=\"goToParam($index)\"\n [class]=\"'rounded-md px-2 py-1 font-medium hover:opacity-80 ' + getParamColor($index)\"\n >\n <span class=\"text-xs opacity-60\">{{ action.params?.[$index] }}:</span>\n {{ value }}\n </button>\n }\n @if (currentParamName(); as paramName) {\n <span class=\"text-neutral-400\">\u203A</span>\n <span class=\"text-neutral-500 dark:text-neutral-400 italic\">{{ paramName }}:</span>\n }\n </div>\n }\n\n <!-- Search input row -->\n <div class=\"flex items-center px-4\">\n <svg\n class=\"h-5 w-5 text-neutral-400\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z\"\n />\n </svg>\n <input\n #searchInput\n type=\"text\"\n [placeholder]=\"lockedAction() ? (currentParamName() ?? 'Enter value...') : service.config().placeholder\"\n [value]=\"query()\"\n (input)=\"onQueryChange($event)\"\n (keydown)=\"onInputKeydown($event)\"\n class=\"w-full px-3 py-4 text-base text-neutral-900 placeholder-neutral-400 outline-none dark:text-neutral-100 bg-transparent\"\n />\n <kbd\n class=\"rounded border border-neutral-200 bg-neutral-100 px-1.5 py-0.5 text-xs text-neutral-500 dark:border-neutral-600 dark:bg-neutral-800 dark:text-neutral-400\"\n >\n ESC\n </kbd>\n </div>\n </div>\n }\n\n <!-- Items list -->\n <div #listContainer class=\"flex-1 overflow-y-auto p-2 sm:flex-none sm:max-h-80\">\n @if (displayItems().length === 0) {\n <!-- Empty state -->\n @if (emptyTemplate(); as et) {\n <ng-container\n [ngTemplateOutlet]=\"et.template\"\n [ngTemplateOutletContext]=\"getEmptyContext()\"\n ></ng-container>\n } @else {\n <div class=\"px-3 py-8 text-center text-neutral-500\">\n @if (lockedAction()) {\n @if (hasAutocomplete()) {\n Type to search...\n } @else {\n Enter a value and press Tab or Enter\n }\n } @else {\n No results found\n }\n </div>\n }\n } @else {\n @for (item of displayItems(); track item.id; let i = $index) {\n <!-- Custom item template -->\n @if (itemTemplate(); as it) {\n <ng-container\n [ngTemplateOutlet]=\"it.template\"\n [ngTemplateOutletContext]=\"getItemContext(item, i)\"\n ></ng-container>\n } @else {\n <!-- Default item -->\n <button\n type=\"button\"\n (click)=\"onItemClick(item, i)\"\n (mouseenter)=\"selectedIndex.set(i)\"\n [attr.data-index]=\"i\"\n [class]=\"\n 'flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left transition-colors ' +\n (selectedIndex() === i\n ? 'bg-neutral-100 dark:bg-neutral-800'\n : 'hover:bg-neutral-50 dark:hover:bg-neutral-800/50')\n \"\n >\n @if (!lockedAction()) {\n <!-- Action mode: show icon -->\n @if (item.iconClass) {\n <i [class]=\"item.iconClass + ' text-lg text-neutral-600 dark:text-neutral-300'\"></i>\n } @else if (item.icon) {\n <span class=\"text-lg\">{{ item.icon }}</span>\n } @else {\n <span\n class=\"flex h-6 w-6 items-center justify-center rounded bg-neutral-200 text-xs font-medium text-neutral-600 dark:bg-neutral-700 dark:text-neutral-300\"\n >\n {{ item.category === 'page' ? 'P' : 'C' }}\n </span>\n }\n }\n <div class=\"flex-1 min-w-0\">\n <div class=\"truncate font-medium text-neutral-900 dark:text-neutral-100\">\n {{ item.label }}@if (!lockedAction() && item.params) { @for (param of item.params; track $index) {<span class=\"whitespace-pre\"> </span><span [class]=\"getParamColor($index)\"><{{ param }}></span>}@if (item.paramProviders) {<span class=\"ml-2 inline-flex items-center rounded border border-neutral-300 bg-neutral-100 px-1 py-0.5 text-[10px] font-normal text-neutral-500 dark:border-neutral-600 dark:bg-neutral-700 dark:text-neutral-400\">Tab</span>}}\n </div>\n @if (item.description) {\n <div class=\"truncate text-sm text-neutral-500 dark:text-neutral-400\">\n {{ item.description }}\n </div>\n }\n </div>\n @if (!lockedAction()) {\n <span\n class=\"rounded-full px-2 py-0.5 text-xs\"\n [class]=\"\n item.category === 'page'\n ? 'bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400'\n : 'bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400'\n \"\n >\n {{ item.category }}\n </span>\n }\n </button>\n }\n }\n }\n </div>\n\n <!-- Footer -->\n @if (footerTemplate(); as ft) {\n <ng-container\n [ngTemplateOutlet]=\"ft.template\"\n [ngTemplateOutletContext]=\"getFooterContext()\"\n ></ng-container>\n } @else {\n <div\n class=\"flex items-center justify-between border-t border-neutral-200 px-4 py-2 text-xs text-neutral-500 dark:border-neutral-700\"\n >\n <div class=\"flex items-center gap-3\">\n <span class=\"flex items-center gap-1\">\n <kbd class=\"rounded border border-neutral-300 bg-neutral-100 px-1 dark:border-neutral-600 dark:bg-neutral-800\">\u2191</kbd>\n <kbd class=\"rounded border border-neutral-300 bg-neutral-100 px-1 dark:border-neutral-600 dark:bg-neutral-800\">\u2193</kbd>\n navigate\n </span>\n <span class=\"flex items-center gap-1\">\n <kbd class=\"rounded border border-neutral-300 bg-neutral-100 px-1 dark:border-neutral-600 dark:bg-neutral-800\">Tab</kbd>\n @if (lockedAction()) {\n next\n } @else {\n params\n }\n </span>\n <span class=\"flex items-center gap-1\">\n <kbd class=\"rounded border border-neutral-300 bg-neutral-100 px-1 dark:border-neutral-600 dark:bg-neutral-800\">\u21B5</kbd>\n @if (lockedAction()) {\n execute\n } @else {\n select\n }\n </span>\n </div>\n <span>gigamenu</span>\n </div>\n }\n </div>\n }\n</div>\n}\n", styles: [":host{display:contents}\n"] }]
|
|
1644
1687
|
}], ctorParameters: () => [{ type: GigamenuService }, { type: FrecencyService }, { type: undefined, decorators: [{
|
|
1645
1688
|
type: Inject,
|
|
1646
1689
|
args: [PLATFORM_ID]
|