scb-wc-test 0.1.207 → 0.1.209

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.
@@ -20,6 +20,30 @@ namespace ScbBlazorDemo
20
20
  // Håller en .NET-referens som JS kan använda för att ropa tillbaka på OnScbEvent
21
21
  private DotNetObjectReference<ScbBlazorInteropBase>? _dotNetRef;
22
22
 
23
+ // Subscription-id som används för att kunna avregistrera globala listeners vid Dispose
24
+ private string? _subscriptionId;
25
+
26
+ // Flagga som anger om JS-interop är initierad (kan misslyckas vid prerender och behöver då försöka igen)
27
+ private bool _interopInitialized;
28
+ private bool _interopInitInProgress;
29
+
30
+ // Root-selektor som kan användas för att scopa getState och eventhantering till en del av DOM:en
31
+ protected virtual string? ScbRootSelector => null;
32
+
33
+ // Senast mottagna normaliserade eventnamn från JS-bryggan
34
+ protected string LastScbEventName { get; private set; } = string.Empty;
35
+
36
+ // Om true så samlas flera events ihop och ger en state-refresh per animation frame
37
+ protected virtual bool CoalesceScbEvents => true;
38
+
39
+ // Om true så observeras ändringar i viktiga attribut via MutationObserver
40
+ protected virtual bool ObserveScbAttributes => true;
41
+
42
+ private bool _refreshQueued;
43
+ private bool _refreshRunning;
44
+ private Task? _refreshLoopTask;
45
+
46
+
23
47
  // Header (scb-header): aktiv flik, drawerstatus och eventuell söktext
24
48
  protected HeaderState Header { get; private set; } = new();
25
49
 
@@ -29,6 +53,27 @@ namespace ScbBlazorDemo
29
53
  // Meny (scb-options-menu): övergripande öppet/stängt-läge
30
54
  protected MenuState Menu { get; private set; } = new();
31
55
 
56
+ // Alla options-menyer (scb-options-menu) på sidan
57
+ protected OptionsMenuState[] OptionsMenus { get; private set; } = Array.Empty<OptionsMenuState>();
58
+
59
+ // Uppslag med alla options-menyer (scb-options-menu) nycklade på id-attributet
60
+ protected Dictionary<string, OptionsMenuState> OptionsMenusById { get; private set; } = new Dictionary<string, OptionsMenuState>(StringComparer.Ordinal);
61
+
62
+ // Alla progress indicators (scb-progress-indicator) på sidan
63
+ protected ProgressIndicatorState[] ProgressIndicators { get; private set; } = Array.Empty<ProgressIndicatorState>();
64
+
65
+ // Alla progress steppers (scb-progress-stepper) på sidan
66
+ protected ProgressStepperState[] ProgressSteppers { get; private set; } = Array.Empty<ProgressStepperState>();
67
+
68
+ // Alla progress steps (scb-progress-step) på sidan
69
+ protected ProgressStepState[] ProgressSteps { get; private set; } = Array.Empty<ProgressStepState>();
70
+
71
+ // Alla skeletons (scb-skeleton) på sidan
72
+ protected SkeletonState[] Skeletons { get; private set; } = Array.Empty<SkeletonState>();
73
+
74
+ // Alla avancerade tabeller (scb-table-advanced) på sidan
75
+ protected TableAdvancedState[] TablesAdvanced { get; private set; } = Array.Empty<TableAdvancedState>();
76
+
32
77
  // Alla submenyer (scb-options-sub-menu) på sidan
33
78
  protected SubMenuState[] SubMenus { get; private set; } = Array.Empty<SubMenuState>();
34
79
 
@@ -62,6 +107,15 @@ namespace ScbBlazorDemo
62
107
  // Cards (scb-card) om man vill läsa av state
63
108
  protected CardState[] Cards { get; private set; } = Array.Empty<CardState>();
64
109
 
110
+ // Fact cards (scb-fact-card)
111
+ protected FactCardState[] FactCards { get; private set; } = Array.Empty<FactCardState>();
112
+
113
+ // Footer (scb-footer)
114
+ protected FooterState[] Footers { get; private set; } = Array.Empty<FooterState>();
115
+
116
+ // Horizontal scroller (scb-horizontal-scroller)
117
+ protected HorizontalScrollerState[] HorizontalScrollers { get; private set; } = Array.Empty<HorizontalScrollerState>();
118
+
65
119
  // Nyckeltalskort (scb-keyfigure-card)
66
120
  protected KeyfigureState[] Keyfigures { get; private set; } = Array.Empty<KeyfigureState>();
67
121
 
@@ -104,6 +158,24 @@ namespace ScbBlazorDemo
104
158
  // Alla sökfält (fristående scb-search) på sidan
105
159
  protected SearchState[] Searches { get; private set; } = Array.Empty<SearchState>();
106
160
 
161
+ // Alla dropdowns (scb-dropdown) på sidan
162
+ protected DropdownState[] Dropdowns { get; private set; } = Array.Empty<DropdownState>();
163
+
164
+ // Alla select-komponenter (scb-select) på sidan
165
+ protected SelectState[] Selects { get; private set; } = Array.Empty<SelectState>();
166
+
167
+ // Alla sliders (scb-slider) på sidan
168
+ protected SliderState[] Sliders { get; private set; } = Array.Empty<SliderState>();
169
+
170
+ // Alla datepickers (scb-datepicker) på sidan
171
+ protected DatepickerState[] Datepickers { get; private set; } = Array.Empty<DatepickerState>();
172
+
173
+ // Alla collapse (scb-collapse) på sidan
174
+ protected CollapseState[] Collapses { get; private set; } = Array.Empty<CollapseState>();
175
+
176
+ // Alla cookies-consent (scb-cookies-consent) på sidan
177
+ protected CookiesConsentState[] CookiesConsents { get; private set; } = Array.Empty<CookiesConsentState>();
178
+
107
179
  // Alla listor (scb-list) med sina list-items (scb-list-item)
108
180
  protected ListState[] Lists { get; private set; } = Array.Empty<ListState>();
109
181
 
@@ -111,6 +183,27 @@ namespace ScbBlazorDemo
111
183
  protected LinkState[] Links { get; private set; } = Array.Empty<LinkState>();
112
184
 
113
185
 
186
+ // Alla avatars (scb-avatar) på sidan
187
+ protected AvatarState[] Avatars { get; private set; } = Array.Empty<AvatarState>();
188
+
189
+ // Alla badges (scb-badge) på sidan
190
+ protected BadgeState[] Badges { get; private set; } = Array.Empty<BadgeState>();
191
+
192
+
193
+ // Alla icon-buttons (scb-icon-button) på sidan
194
+ protected IconButtonState[] IconButtons { get; private set; } = Array.Empty<IconButtonState>();
195
+
196
+ // Uppslag med alla icon-buttons (scb-icon-button) nycklade på id-attributet
197
+ protected Dictionary<string, IconButtonState> IconButtonsById { get; private set; } = new Dictionary<string, IconButtonState>(StringComparer.Ordinal);
198
+
199
+ // Alla menyer (scb-menu) på sidan
200
+ protected MenuInstanceState[] Menus { get; private set; } = Array.Empty<MenuInstanceState>();
201
+
202
+ // Uppslag med alla menyer (scb-menu) nycklade på id-attributet
203
+ protected Dictionary<string, MenuInstanceState> MenusById { get; private set; } = new Dictionary<string, MenuInstanceState>(StringComparer.Ordinal);
204
+
205
+
206
+
114
207
  // Alla nav (scb-nav) på sidan
115
208
  protected NavState[] Navs { get; private set; } = Array.Empty<NavState>();
116
209
 
@@ -130,28 +223,87 @@ namespace ScbBlazorDemo
130
223
 
131
224
  // Alla viz-komponenter (scb-viz) på sidan
132
225
  protected VizState[] Viz { get; private set; } = Array.Empty<VizState>();
133
-
134
- // Registrerar JS-interop vid första render och hämtar initialt state
226
+ // Registrerar JS-interop när Blazor kan köra JS och hämtar initialt state
135
227
  protected override async Task OnAfterRenderAsync(bool firstRender)
136
228
  {
137
- if (firstRender)
229
+ await EnsureScbInteropInitializedAsync();
230
+ }
231
+
232
+ private async Task EnsureScbInteropInitializedAsync()
233
+ {
234
+ if (_interopInitialized || _interopInitInProgress) return;
235
+
236
+ _interopInitInProgress = true;
237
+ try
138
238
  {
139
239
  // Skapar en .NET-referens så att JS kan anropa OnScbEvent på rätt instans
140
- _dotNetRef = DotNetObjectReference.Create(this);
240
+ _dotNetRef ??= DotNetObjectReference.Create(this);
141
241
 
142
242
  // Registrerar eventhanterare i JS (i scb-blazor-bridge.js)
143
- await JS.InvokeVoidAsync("SCBBlazor.registerScbEventHandlers", _dotNetRef);
243
+ if (!string.IsNullOrWhiteSpace(_subscriptionId))
244
+ {
245
+ try
246
+ {
247
+ await JS.InvokeVoidAsync("SCBBlazor.unregisterScbEventHandlers", _subscriptionId);
248
+ }
249
+ catch (InvalidOperationException)
250
+ {
251
+ }
252
+ catch (JSDisconnectedException)
253
+ {
254
+ }
255
+ catch (TaskCanceledException)
256
+ {
257
+ }
258
+
259
+ _subscriptionId = null;
260
+ }
261
+
262
+ var options = new
263
+ {
264
+ root = GetScbRootArg(),
265
+ coalesce = CoalesceScbEvents,
266
+ observeAttributes = ObserveScbAttributes
267
+ };
268
+
269
+ _subscriptionId = await JS.InvokeAsync<string?>(
270
+ "SCBBlazor.registerScbEventHandlers",
271
+ _dotNetRef,
272
+ options);
144
273
 
145
274
  // Hämtar första snapshoten av state
146
275
  await RefreshScbStateAsync();
276
+
277
+ _interopInitialized = true;
278
+ }
279
+ catch (InvalidOperationException)
280
+ {
281
+ // Kan inträffa vid prerendering när JS-interop inte är tillgängligt ännu
282
+ }
283
+ catch (JSDisconnectedException)
284
+ {
285
+ // Kan inträffa vid navigation/omkoppling när JS inte längre är tillgängligt
286
+ }
287
+ catch (TaskCanceledException)
288
+ {
289
+ }
290
+ finally
291
+ {
292
+ _interopInitInProgress = false;
147
293
  }
148
294
  }
149
295
 
296
+ private object? GetScbRootArg()
297
+ {
298
+ var s = ScbRootSelector;
299
+ return string.IsNullOrWhiteSpace(s) ? null : s;
300
+ }
301
+
150
302
  // Läser in hela state-strukturen från JS och mappar till C#-klasserna ovan
151
303
  public async Task RefreshScbStateAsync()
152
304
  {
153
305
  // Hämtar DTO från globala SCBBlazor.getState
154
- var state = await JS.InvokeAsync<ScbStateDto>("SCBBlazor.getState");
306
+ var state = await JS.InvokeAsync<ScbStateDto>("SCBBlazor.getState", GetScbRootArg());
155
307
 
156
308
  // Header
157
309
  Header.ActiveTab = state.Header.ActiveTab;
@@ -182,6 +334,195 @@ namespace ScbBlazorDemo
182
334
  Menu.Open = false;
183
335
  }
184
336
 
337
+ // Options-menyer (scb-options-menu)
338
+ if (state.OptionsMenus is not null && state.OptionsMenus.Length > 0)
339
+ {
340
+ var menus = new OptionsMenuState[state.OptionsMenus.Length];
341
+ for (var i = 0; i < state.OptionsMenus.Length; i++)
342
+ {
343
+ var dto = state.OptionsMenus[i];
344
+ menus[i] = new OptionsMenuState
345
+ {
346
+ Id = dto.Id ?? string.Empty,
347
+ Open = dto.Open,
348
+ Spacing = dto.Spacing ?? string.Empty,
349
+ SpacingTop = dto.SpacingTop ?? string.Empty,
350
+ SpacingBottom = dto.SpacingBottom ?? string.Empty,
351
+ SpacingLeft = dto.SpacingLeft ?? string.Empty,
352
+ SpacingRight = dto.SpacingRight ?? string.Empty,
353
+ };
354
+ }
355
+
356
+ OptionsMenus = menus;
357
+
358
+ var byId = new Dictionary<string, OptionsMenuState>(StringComparer.Ordinal);
359
+ for (var i = 0; i < menus.Length; i++)
360
+ {
361
+ var m = menus[i];
362
+ if (string.IsNullOrWhiteSpace(m.Id)) continue;
363
+ byId[m.Id] = m;
364
+ }
365
+ OptionsMenusById = byId;
366
+ }
367
+ else
368
+ {
369
+ OptionsMenus = Array.Empty<OptionsMenuState>();
370
+ OptionsMenusById = new Dictionary<string, OptionsMenuState>(StringComparer.Ordinal);
371
+ }
372
+
373
+ // Progress indicator (scb-progress-indicator)
374
+ if (state.ProgressIndicators is not null && state.ProgressIndicators.Length > 0)
375
+ {
376
+ var indicators = new ProgressIndicatorState[state.ProgressIndicators.Length];
377
+ for (var i = 0; i < state.ProgressIndicators.Length; i++)
378
+ {
379
+ var dto = state.ProgressIndicators[i];
380
+ indicators[i] = new ProgressIndicatorState
381
+ {
382
+ Id = dto.Id ?? string.Empty,
383
+ Type = dto.Type ?? string.Empty,
384
+ Progress = dto.Progress,
385
+ IsStatic = dto.IsStatic,
386
+ Spacing = dto.Spacing ?? string.Empty,
387
+ SpacingTop = dto.SpacingTop ?? string.Empty,
388
+ SpacingBottom = dto.SpacingBottom ?? string.Empty,
389
+ SpacingLeft = dto.SpacingLeft ?? string.Empty,
390
+ SpacingRight = dto.SpacingRight ?? string.Empty,
391
+ };
392
+ }
393
+ ProgressIndicators = indicators;
394
+ }
395
+ else
396
+ {
397
+ ProgressIndicators = Array.Empty<ProgressIndicatorState>();
398
+ }
399
+
400
+ // Progress steps (scb-progress-step)
401
+ if (state.ProgressSteps is not null && state.ProgressSteps.Length > 0)
402
+ {
403
+ var steps = new ProgressStepState[state.ProgressSteps.Length];
404
+ for (var i = 0; i < state.ProgressSteps.Length; i++)
405
+ {
406
+ var dto = state.ProgressSteps[i];
407
+ steps[i] = new ProgressStepState
408
+ {
409
+ Id = dto.Id ?? string.Empty,
410
+ Width = dto.Width ?? string.Empty,
411
+ Active = dto.Active,
412
+ Disabled = dto.Disabled,
413
+ Href = dto.Href ?? string.Empty,
414
+ Label = dto.Label ?? string.Empty,
415
+ Position = dto.Position ?? string.Empty,
416
+ };
417
+ }
418
+ ProgressSteps = steps;
419
+ }
420
+ else
421
+ {
422
+ ProgressSteps = Array.Empty<ProgressStepState>();
423
+ }
424
+
425
+ // Progress steppers (scb-progress-stepper)
426
+ if (state.ProgressSteppers is not null && state.ProgressSteppers.Length > 0)
427
+ {
428
+ var steppers = new ProgressStepperState[state.ProgressSteppers.Length];
429
+ for (var i = 0; i < state.ProgressSteppers.Length; i++)
430
+ {
431
+ var dto = state.ProgressSteppers[i];
432
+
433
+ var stepsDto = dto.Steps ?? Array.Empty<ProgressStepDto>();
434
+ var steps = new ProgressStepState[stepsDto.Length];
435
+ for (var s = 0; s < stepsDto.Length; s++)
436
+ {
437
+ var sdto = stepsDto[s];
438
+ steps[s] = new ProgressStepState
439
+ {
440
+ Id = sdto.Id ?? string.Empty,
441
+ Width = sdto.Width ?? string.Empty,
442
+ Active = sdto.Active,
443
+ Disabled = sdto.Disabled,
444
+ Href = sdto.Href ?? string.Empty,
445
+ Label = sdto.Label ?? string.Empty,
446
+ Position = sdto.Position ?? string.Empty,
447
+ };
448
+ }
449
+
450
+ steppers[i] = new ProgressStepperState
451
+ {
452
+ Id = dto.Id ?? string.Empty,
453
+ ProgressWidth = dto.ProgressWidth,
454
+ Height = dto.Height ?? string.Empty,
455
+ Position = dto.Position ?? string.Empty,
456
+ Spacing = dto.Spacing ?? string.Empty,
457
+ SpacingTop = dto.SpacingTop ?? string.Empty,
458
+ SpacingBottom = dto.SpacingBottom ?? string.Empty,
459
+ SpacingLeft = dto.SpacingLeft ?? string.Empty,
460
+ SpacingRight = dto.SpacingRight ?? string.Empty,
461
+ Steps = steps,
462
+ };
463
+ }
464
+
465
+ ProgressSteppers = steppers;
466
+ }
467
+ else
468
+ {
469
+ ProgressSteppers = Array.Empty<ProgressStepperState>();
470
+ }
471
+
472
+ // Skeletons (scb-skeleton)
473
+ if (state.Skeletons is not null && state.Skeletons.Length > 0)
474
+ {
475
+ var items = new SkeletonState[state.Skeletons.Length];
476
+ for (var i = 0; i < state.Skeletons.Length; i++)
477
+ {
478
+ var dto = state.Skeletons[i];
479
+ items[i] = new SkeletonState
480
+ {
481
+ Id = dto.Id ?? string.Empty,
482
+ Variant = dto.Variant ?? string.Empty,
483
+ Width = dto.Width ?? string.Empty,
484
+ Height = dto.Height ?? string.Empty,
485
+ BorderSize = dto.BorderSize ?? string.Empty,
486
+ Spacing = dto.Spacing ?? string.Empty,
487
+ SpacingTop = dto.SpacingTop ?? string.Empty,
488
+ SpacingBottom = dto.SpacingBottom ?? string.Empty,
489
+ SpacingLeft = dto.SpacingLeft ?? string.Empty,
490
+ SpacingRight = dto.SpacingRight ?? string.Empty,
491
+ };
492
+ }
493
+ Skeletons = items;
494
+ }
495
+ else
496
+ {
497
+ Skeletons = Array.Empty<SkeletonState>();
498
+ }
499
+
500
+ // Table advanced (scb-table-advanced)
501
+ if (state.TablesAdvanced is not null && state.TablesAdvanced.Length > 0)
502
+ {
503
+ var items = new TableAdvancedState[state.TablesAdvanced.Length];
504
+ for (var i = 0; i < state.TablesAdvanced.Length; i++)
505
+ {
506
+ var dto = state.TablesAdvanced[i];
507
+ items[i] = new TableAdvancedState
508
+ {
509
+ Id = dto.Id ?? string.Empty,
510
+ SearchTerm = dto.SearchTerm ?? string.Empty,
511
+ Pagination = dto.Pagination,
512
+ FilteringSearch = dto.FilteringSearch,
513
+ NoScroll = dto.NoScroll,
514
+ PageSize = dto.PageSize,
515
+ CurrentPage = dto.CurrentPage,
516
+ TotalRows = dto.TotalRows,
517
+ };
518
+ }
519
+ TablesAdvanced = items;
520
+ }
521
+ else
522
+ {
523
+ TablesAdvanced = Array.Empty<TableAdvancedState>();
524
+ }
525
+
185
526
  // Sub-menyer
186
527
  if (state.SubMenus is not null && state.SubMenus.Length > 0)
187
528
  {
@@ -259,7 +600,7 @@ namespace ScbBlazorDemo
259
600
 
260
601
  accordions[i] = new AccordionListState
261
602
  {
262
- Detached = dto.Detached,
603
+ SingleOpen = dto.SingleOpen,
263
604
  Items = itemStates
264
605
  };
265
606
  }
@@ -356,7 +697,49 @@ namespace ScbBlazorDemo
356
697
  Title = dto.Title ?? string.Empty,
357
698
  Subtitle = dto.Subtitle ?? string.Empty,
358
699
  SupportingText = dto.SupportingText ?? string.Empty,
359
- CardHref = dto.CardHref ?? string.Empty
700
+ CardHref = dto.CardHref ?? string.Empty,
701
+
702
+ MediaType = dto.MediaType ?? string.Empty,
703
+ MediaHref = dto.MediaHref ?? string.Empty,
704
+ MediaAlt = dto.MediaAlt ?? string.Empty,
705
+ MediaSrcset = dto.MediaSrcset ?? string.Empty,
706
+ MediaSizes = dto.MediaSizes ?? string.Empty,
707
+ MediaLoading = dto.MediaLoading ?? string.Empty,
708
+ MediaDecoding = dto.MediaDecoding ?? string.Empty,
709
+ MediaFetchPriority = dto.MediaFetchPriority ?? string.Empty,
710
+ MediaFit = dto.MediaFit ?? string.Empty,
711
+ MediaPosition = dto.MediaPosition ?? string.Empty,
712
+ MediaWidth = dto.MediaWidth ?? string.Empty,
713
+ MediaHeight = dto.MediaHeight ?? string.Empty,
714
+ MediaAspect = dto.MediaAspect ?? string.Empty,
715
+ MediaPlaceholder = dto.MediaPlaceholder,
716
+
717
+ Date = dto.Date ?? string.Empty,
718
+
719
+ CommentsText = dto.CommentsText ?? string.Empty,
720
+ Comments = dto.Comments,
721
+ CommentsHref = dto.CommentsHref ?? string.Empty,
722
+
723
+ LikesText = dto.LikesText ?? string.Empty,
724
+ Likes = dto.Likes,
725
+ HasLiked = dto.HasLiked,
726
+ LikesInteractive = dto.LikesInteractive,
727
+
728
+ Author = dto.Author,
729
+ AuthorText = dto.AuthorText ?? string.Empty,
730
+ AuthorHref = dto.AuthorHref ?? string.Empty,
731
+
732
+ Sizing = dto.Sizing ?? string.Empty,
733
+ Width = dto.Width ?? string.Empty,
734
+ MaxWidth = dto.MaxWidth ?? string.Empty,
735
+ Height = dto.Height ?? string.Empty,
736
+ MaxHeight = dto.MaxHeight ?? string.Empty,
737
+
738
+ Spacing = dto.Spacing ?? string.Empty,
739
+ SpacingTop = dto.SpacingTop ?? string.Empty,
740
+ SpacingBottom = dto.SpacingBottom ?? string.Empty,
741
+ SpacingLeft = dto.SpacingLeft ?? string.Empty,
742
+ SpacingRight = dto.SpacingRight ?? string.Empty,
360
743
  };
361
744
  }
362
745
  Cards = cards;
@@ -366,6 +749,132 @@ namespace ScbBlazorDemo
366
749
  Cards = Array.Empty<CardState>();
367
750
  }
368
751
 
752
+ // Fact cards
753
+ if (state.FactCards is not null && state.FactCards.Length > 0)
754
+ {
755
+ var factCards = new FactCardState[state.FactCards.Length];
756
+ for (var i = 0; i < state.FactCards.Length; i++)
757
+ {
758
+ var dto = state.FactCards[i];
759
+ factCards[i] = new FactCardState
760
+ {
761
+ Id = dto.Id ?? string.Empty,
762
+ Variant = dto.Variant ?? string.Empty,
763
+ Title = dto.Title ?? string.Empty,
764
+ Subtitle = dto.Subtitle ?? string.Empty,
765
+ SupportingText = dto.SupportingText ?? string.Empty,
766
+ Icon = dto.Icon ?? string.Empty,
767
+ ShowCloseButton = dto.ShowCloseButton,
768
+ Open = dto.Open,
769
+ Sizing = dto.Sizing ?? string.Empty,
770
+ Width = dto.Width ?? string.Empty,
771
+ MaxWidth = dto.MaxWidth ?? string.Empty,
772
+ Height = dto.Height ?? string.Empty,
773
+ MaxHeight = dto.MaxHeight ?? string.Empty,
774
+ Spacing = dto.Spacing ?? string.Empty,
775
+ SpacingTop = dto.SpacingTop ?? string.Empty,
776
+ SpacingBottom = dto.SpacingBottom ?? string.Empty,
777
+ SpacingLeft = dto.SpacingLeft ?? string.Empty,
778
+ SpacingRight = dto.SpacingRight ?? string.Empty,
779
+ };
780
+ }
781
+ FactCards = factCards;
782
+ }
783
+ else
784
+ {
785
+ FactCards = Array.Empty<FactCardState>();
786
+ }
787
+
788
+ // Footers
789
+ if (state.Footers is not null && state.Footers.Length > 0)
790
+ {
791
+ var footers = new FooterState[state.Footers.Length];
792
+ for (var i = 0; i < state.Footers.Length; i++)
793
+ {
794
+ var dto = state.Footers[i];
795
+
796
+ var sectionsDto = dto.Sections ?? Array.Empty<FooterSectionDto>();
797
+ var sections = new FooterSectionState[sectionsDto.Length];
798
+ for (var s = 0; s < sectionsDto.Length; s++)
799
+ {
800
+ var secDto = sectionsDto[s];
801
+
802
+ var linksDto = secDto.Links ?? Array.Empty<FooterLinkDto>();
803
+ var links = new FooterLinkState[linksDto.Length];
804
+ for (var l = 0; l < linksDto.Length; l++)
805
+ {
806
+ var lnk = linksDto[l];
807
+ links[l] = new FooterLinkState
808
+ {
809
+ Label = lnk.Label ?? string.Empty,
810
+ Href = lnk.Href ?? string.Empty,
811
+ Target = lnk.Target ?? string.Empty,
812
+ };
813
+ }
814
+
815
+ sections[s] = new FooterSectionState
816
+ {
817
+ Title = secDto.Title ?? string.Empty,
818
+ Links = links
819
+ };
820
+ }
821
+
822
+ footers[i] = new FooterState
823
+ {
824
+ Id = dto.Id ?? string.Empty,
825
+ MaxWidth = dto.MaxWidth ?? string.Empty,
826
+ DeferPaint = dto.DeferPaint,
827
+ Spacing = dto.Spacing ?? string.Empty,
828
+ SpacingTop = dto.SpacingTop ?? string.Empty,
829
+ SpacingBottom = dto.SpacingBottom ?? string.Empty,
830
+ Description = dto.Description ?? string.Empty,
831
+ Sections = sections
832
+ };
833
+ }
834
+
835
+ Footers = footers;
836
+ }
837
+ else
838
+ {
839
+ Footers = Array.Empty<FooterState>();
840
+ }
841
+
842
+ // Horizontal scrollers
843
+ if (state.HorizontalScrollers is not null && state.HorizontalScrollers.Length > 0)
844
+ {
845
+ var scrollers = new HorizontalScrollerState[state.HorizontalScrollers.Length];
846
+ for (var i = 0; i < state.HorizontalScrollers.Length; i++)
847
+ {
848
+ var dto = state.HorizontalScrollers[i];
849
+ scrollers[i] = new HorizontalScrollerState
850
+ {
851
+ Id = dto.Id ?? string.Empty,
852
+ Variant = dto.Variant ?? string.Empty,
853
+ Width = dto.Width ?? string.Empty,
854
+ ShowScrollbar = dto.ShowScrollbar,
855
+ RightScrollButtonLabel = dto.RightScrollButtonLabel ?? string.Empty,
856
+ LeftScrollButtonLabel = dto.LeftScrollButtonLabel ?? string.Empty,
857
+ ContentFlex = dto.ContentFlex,
858
+ InternalGap = dto.InternalGap ?? string.Empty,
859
+ Spacing = dto.Spacing ?? string.Empty,
860
+ SpacingTop = dto.SpacingTop ?? string.Empty,
861
+ SpacingBottom = dto.SpacingBottom ?? string.Empty,
862
+ SpacingLeft = dto.SpacingLeft ?? string.Empty,
863
+ SpacingRight = dto.SpacingRight ?? string.Empty,
864
+ ScrollLeft = dto.ScrollLeft,
865
+ CanScrollLeft = dto.CanScrollLeft,
866
+ CanScrollRight = dto.CanScrollRight,
867
+ };
868
+ }
869
+
870
+ HorizontalScrollers = scrollers;
871
+ }
872
+ else
873
+ {
874
+ HorizontalScrollers = Array.Empty<HorizontalScrollerState>();
875
+ }
876
+
877
+
369
878
  // Keyfigure cards
370
879
  if (state.Keyfigures is not null && state.Keyfigures.Length > 0)
371
880
  {
@@ -708,6 +1217,151 @@ namespace ScbBlazorDemo
708
1217
  Searches = Array.Empty<SearchState>();
709
1218
  }
710
1219
 
1220
+ // Dropdown
1221
+ if (state.Dropdowns is not null && state.Dropdowns.Length > 0)
1222
+ {
1223
+ var dropdowns = new DropdownState[state.Dropdowns.Length];
1224
+ for (var i = 0; i < state.Dropdowns.Length; i++)
1225
+ {
1226
+ var dto = state.Dropdowns[i];
1227
+ dropdowns[i] = new DropdownState
1228
+ {
1229
+ Id = dto.Id ?? string.Empty,
1230
+ Label = dto.Label ?? string.Empty,
1231
+ Variant = dto.Variant ?? string.Empty,
1232
+ Size = dto.Size ?? string.Empty,
1233
+ Open = dto.Open,
1234
+ Disabled = dto.Disabled,
1235
+ };
1236
+ }
1237
+ Dropdowns = dropdowns;
1238
+ }
1239
+ else
1240
+ {
1241
+ Dropdowns = Array.Empty<DropdownState>();
1242
+ }
1243
+
1244
+ // Select
1245
+ if (state.Selects is not null && state.Selects.Length > 0)
1246
+ {
1247
+ var selects = new SelectState[state.Selects.Length];
1248
+ for (var i = 0; i < state.Selects.Length; i++)
1249
+ {
1250
+ var dto = state.Selects[i];
1251
+ selects[i] = new SelectState
1252
+ {
1253
+ Id = dto.Id ?? string.Empty,
1254
+ Variant = dto.Variant ?? string.Empty,
1255
+ Open = dto.Open,
1256
+ Value = dto.Value ?? string.Empty,
1257
+ Values = dto.Values ?? Array.Empty<string>(),
1258
+ Disabled = dto.Disabled,
1259
+ };
1260
+ }
1261
+ Selects = selects;
1262
+ }
1263
+ else
1264
+ {
1265
+ Selects = Array.Empty<SelectState>();
1266
+ }
1267
+
1268
+ // Slider
1269
+ if (state.Sliders is not null && state.Sliders.Length > 0)
1270
+ {
1271
+ var sliders = new SliderState[state.Sliders.Length];
1272
+ for (var i = 0; i < state.Sliders.Length; i++)
1273
+ {
1274
+ var dto = state.Sliders[i];
1275
+ sliders[i] = new SliderState
1276
+ {
1277
+ Id = dto.Id ?? string.Empty,
1278
+ Range = dto.Range,
1279
+ Value = dto.Value,
1280
+ ValueStart = dto.ValueStart,
1281
+ ValueEnd = dto.ValueEnd,
1282
+ Min = dto.Min,
1283
+ Max = dto.Max,
1284
+ Step = dto.Step,
1285
+ Disabled = dto.Disabled,
1286
+ };
1287
+ }
1288
+ Sliders = sliders;
1289
+ }
1290
+ else
1291
+ {
1292
+ Sliders = Array.Empty<SliderState>();
1293
+ }
1294
+
1295
+ // Datepicker
1296
+ if (state.Datepickers is not null && state.Datepickers.Length > 0)
1297
+ {
1298
+ var datepickers = new DatepickerState[state.Datepickers.Length];
1299
+ for (var i = 0; i < state.Datepickers.Length; i++)
1300
+ {
1301
+ var dto = state.Datepickers[i];
1302
+ datepickers[i] = new DatepickerState
1303
+ {
1304
+ Id = dto.Id ?? string.Empty,
1305
+ Open = dto.Open,
1306
+ SelectedValue = dto.SelectedValue ?? string.Empty,
1307
+ Variant = dto.Variant ?? string.Empty,
1308
+ Lang = dto.Lang ?? string.Empty,
1309
+ };
1310
+ }
1311
+ Datepickers = datepickers;
1312
+ }
1313
+ else
1314
+ {
1315
+ Datepickers = Array.Empty<DatepickerState>();
1316
+ }
1317
+
1318
+ // Collapse
1319
+ if (state.Collapses is not null && state.Collapses.Length > 0)
1320
+ {
1321
+ var collapses = new CollapseState[state.Collapses.Length];
1322
+ for (var i = 0; i < state.Collapses.Length; i++)
1323
+ {
1324
+ var dto = state.Collapses[i];
1325
+ collapses[i] = new CollapseState
1326
+ {
1327
+ Id = dto.Id ?? string.Empty,
1328
+ Variant = dto.Variant ?? string.Empty,
1329
+ Expanded = dto.Expanded,
1330
+ CollapsedHeight = dto.CollapsedHeight,
1331
+ VisibleElements = dto.VisibleElements,
1332
+ ExpandButtonLabel = dto.ExpandButtonLabel ?? string.Empty,
1333
+ CollapseButtonLabel = dto.CollapseButtonLabel ?? string.Empty,
1334
+ };
1335
+ }
1336
+ Collapses = collapses;
1337
+ }
1338
+ else
1339
+ {
1340
+ Collapses = Array.Empty<CollapseState>();
1341
+ }
1342
+
1343
+ // Cookies-consent
1344
+ if (state.CookiesConsents is not null && state.CookiesConsents.Length > 0)
1345
+ {
1346
+ var cookies = new CookiesConsentState[state.CookiesConsents.Length];
1347
+ for (var i = 0; i < state.CookiesConsents.Length; i++)
1348
+ {
1349
+ var dto = state.CookiesConsents[i];
1350
+ cookies[i] = new CookiesConsentState
1351
+ {
1352
+ Id = dto.Id ?? string.Empty,
1353
+ Open = dto.Open,
1354
+ Title = dto.Title ?? string.Empty,
1355
+ SupportingText = dto.SupportingText ?? string.Empty,
1356
+ };
1357
+ }
1358
+ CookiesConsents = cookies;
1359
+ }
1360
+ else
1361
+ {
1362
+ CookiesConsents = Array.Empty<CookiesConsentState>();
1363
+ }
1364
+
711
1365
  // Listor
712
1366
  if (state.Lists is not null && state.Lists.Length > 0)
713
1367
  {
@@ -787,13 +1441,287 @@ namespace ScbBlazorDemo
787
1441
  Links = Array.Empty<LinkState>();
788
1442
  }
789
1443
 
790
- // Nav
791
- if (state.Navs is not null && state.Navs.Length > 0)
1444
+ // Avatars
1445
+ if (state.Avatars is not null && state.Avatars.Length > 0)
792
1446
  {
793
- var navs = new NavState[state.Navs.Length];
794
- for (var i = 0; i < state.Navs.Length; i++)
1447
+ var avatars = new AvatarState[state.Avatars.Length];
1448
+ for (var i = 0; i < state.Avatars.Length; i++)
795
1449
  {
796
- var dto = state.Navs[i];
1450
+ var dto = state.Avatars[i];
1451
+ avatars[i] = new AvatarState
1452
+ {
1453
+ Src = dto.Src ?? string.Empty,
1454
+ Alt = dto.Alt ?? string.Empty,
1455
+ Label = dto.Label ?? string.Empty,
1456
+ Size = dto.Size ?? string.Empty,
1457
+ Shape = dto.Shape ?? string.Empty,
1458
+ IconName = dto.IconName ?? string.Empty,
1459
+ Variant = dto.Variant ?? string.Empty,
1460
+ Spacing = dto.Spacing ?? string.Empty,
1461
+ SpacingTop = dto.SpacingTop ?? string.Empty,
1462
+ SpacingBottom = dto.SpacingBottom ?? string.Empty,
1463
+ SpacingLeft = dto.SpacingLeft ?? string.Empty,
1464
+ SpacingRight = dto.SpacingRight ?? string.Empty
1465
+ };
1466
+ }
1467
+
1468
+ Avatars = avatars;
1469
+ }
1470
+ else
1471
+ {
1472
+ Avatars = Array.Empty<AvatarState>();
1473
+ }
1474
+
1475
+ // Badges
1476
+ if (state.Badges is not null && state.Badges.Length > 0)
1477
+ {
1478
+ var badges = new BadgeState[state.Badges.Length];
1479
+ for (var i = 0; i < state.Badges.Length; i++)
1480
+ {
1481
+ var dto = state.Badges[i];
1482
+ badges[i] = new BadgeState
1483
+ {
1484
+ AutoHide = dto.AutoHide,
1485
+ Hidden = dto.Hidden,
1486
+ Sizing = dto.Sizing ?? string.Empty,
1487
+ Position = dto.Position ?? string.Empty,
1488
+ PositionSide = dto.PositionSide ?? string.Empty,
1489
+ PositionTop = dto.PositionTop ?? string.Empty,
1490
+ PositionRight = dto.PositionRight ?? string.Empty,
1491
+ PositionLeft = dto.PositionLeft ?? string.Empty,
1492
+ Value = dto.Value ?? string.Empty,
1493
+ Label = dto.Label ?? string.Empty,
1494
+ Variant = dto.Variant ?? string.Empty
1495
+ };
1496
+ }
1497
+
1498
+ Badges = badges;
1499
+ }
1500
+ else
1501
+ {
1502
+ Badges = Array.Empty<BadgeState>();
1503
+ }
1504
+
1505
+
1506
+
1507
+ // Icon buttons
1508
+ if (state.IconButtons is not null && state.IconButtons.Length > 0)
1509
+ {
1510
+ var iconButtons = new IconButtonState[state.IconButtons.Length];
1511
+ for (var i = 0; i < state.IconButtons.Length; i++)
1512
+ {
1513
+ var dto = state.IconButtons[i];
1514
+ iconButtons[i] = new IconButtonState
1515
+ {
1516
+ Id = dto.Id ?? string.Empty,
1517
+ Icon = dto.Icon ?? string.Empty,
1518
+ Toggle = dto.Toggle,
1519
+ Selected = dto.Selected,
1520
+ Disabled = dto.Disabled,
1521
+ AriaLabel = dto.AriaLabel ?? string.Empty,
1522
+ Href = dto.Href ?? string.Empty,
1523
+ Target = dto.Target ?? string.Empty,
1524
+ Rel = dto.Rel ?? string.Empty
1525
+ };
1526
+ }
1527
+
1528
+ IconButtons = iconButtons;
1529
+ }
1530
+ else
1531
+ {
1532
+ IconButtons = Array.Empty<IconButtonState>();
1533
+ }
1534
+
1535
+ if (state.IconButtonsById is not null && state.IconButtonsById.Count > 0)
1536
+ {
1537
+ var byId = new Dictionary<string, IconButtonState>(state.IconButtonsById.Count, StringComparer.Ordinal);
1538
+ foreach (var kvp in state.IconButtonsById)
1539
+ {
1540
+ var id = kvp.Key;
1541
+ var dto = kvp.Value;
1542
+
1543
+ if (string.IsNullOrWhiteSpace(id) || dto is null)
1544
+ {
1545
+ continue;
1546
+ }
1547
+
1548
+ byId[id] = new IconButtonState
1549
+ {
1550
+ Id = id,
1551
+ Icon = dto.Icon ?? string.Empty,
1552
+ Toggle = dto.Toggle,
1553
+ Selected = dto.Selected,
1554
+ Disabled = dto.Disabled,
1555
+ AriaLabel = dto.AriaLabel ?? string.Empty,
1556
+ Href = dto.Href ?? string.Empty,
1557
+ Target = dto.Target ?? string.Empty,
1558
+ Rel = dto.Rel ?? string.Empty
1559
+ };
1560
+ }
1561
+
1562
+ IconButtonsById = byId;
1563
+ }
1564
+ else if (IconButtons.Length > 0)
1565
+ {
1566
+ var byId = new Dictionary<string, IconButtonState>(IconButtons.Length, StringComparer.Ordinal);
1567
+ for (var i = 0; i < IconButtons.Length; i++)
1568
+ {
1569
+ var b = IconButtons[i];
1570
+ var id = b.Id;
1571
+
1572
+ if (string.IsNullOrWhiteSpace(id))
1573
+ {
1574
+ continue;
1575
+ }
1576
+
1577
+ byId[id] = b;
1578
+ }
1579
+
1580
+ IconButtonsById = byId;
1581
+ }
1582
+ else
1583
+ {
1584
+ IconButtonsById = new Dictionary<string, IconButtonState>(StringComparer.Ordinal);
1585
+ }
1586
+
1587
+ // Menyer
1588
+ if (state.Menus is not null && state.Menus.Length > 0)
1589
+ {
1590
+ var menus = new MenuInstanceState[state.Menus.Length];
1591
+ for (var i = 0; i < state.Menus.Length; i++)
1592
+ {
1593
+ var dto = state.Menus[i];
1594
+
1595
+ MenuSelectedItemState? selected = null;
1596
+ if (dto.Selected is not null)
1597
+ {
1598
+ selected = new MenuSelectedItemState
1599
+ {
1600
+ Label = dto.Selected.Label ?? string.Empty,
1601
+ ItemHref = dto.Selected.ItemHref ?? string.Empty,
1602
+ LeadingIcon = dto.Selected.LeadingIcon ?? string.Empty,
1603
+ Path = dto.Selected.Path ?? string.Empty
1604
+ };
1605
+ }
1606
+
1607
+ var expanded = Array.Empty<MenuExpandedItemState>();
1608
+ if (dto.Expanded is not null && dto.Expanded.Length > 0)
1609
+ {
1610
+ expanded = new MenuExpandedItemState[dto.Expanded.Length];
1611
+ for (var j = 0; j < dto.Expanded.Length; j++)
1612
+ {
1613
+ var ex = dto.Expanded[j];
1614
+ expanded[j] = new MenuExpandedItemState
1615
+ {
1616
+ Label = ex.Label ?? string.Empty,
1617
+ ItemHref = ex.ItemHref ?? string.Empty,
1618
+ Path = ex.Path ?? string.Empty
1619
+ };
1620
+ }
1621
+ }
1622
+
1623
+ menus[i] = new MenuInstanceState
1624
+ {
1625
+ Id = dto.Id ?? string.Empty,
1626
+ Label = dto.Label ?? string.Empty,
1627
+ SubLabel = dto.SubLabel ?? string.Empty,
1628
+ NoHighlightSelected = dto.NoHighlightSelected,
1629
+ Selected = selected,
1630
+ Expanded = expanded
1631
+ };
1632
+ }
1633
+
1634
+ Menus = menus;
1635
+ }
1636
+ else
1637
+ {
1638
+ Menus = Array.Empty<MenuInstanceState>();
1639
+ }
1640
+
1641
+ if (state.MenusById is not null && state.MenusById.Count > 0)
1642
+ {
1643
+ var byId = new Dictionary<string, MenuInstanceState>(state.MenusById.Count, StringComparer.Ordinal);
1644
+ foreach (var kvp in state.MenusById)
1645
+ {
1646
+ var id = kvp.Key;
1647
+ var dto = kvp.Value;
1648
+
1649
+ if (string.IsNullOrWhiteSpace(id) || dto is null)
1650
+ {
1651
+ continue;
1652
+ }
1653
+
1654
+ MenuSelectedItemState? selected = null;
1655
+ if (dto.Selected is not null)
1656
+ {
1657
+ selected = new MenuSelectedItemState
1658
+ {
1659
+ Label = dto.Selected.Label ?? string.Empty,
1660
+ ItemHref = dto.Selected.ItemHref ?? string.Empty,
1661
+ LeadingIcon = dto.Selected.LeadingIcon ?? string.Empty,
1662
+ Path = dto.Selected.Path ?? string.Empty
1663
+ };
1664
+ }
1665
+
1666
+ var expanded = Array.Empty<MenuExpandedItemState>();
1667
+ if (dto.Expanded is not null && dto.Expanded.Length > 0)
1668
+ {
1669
+ expanded = new MenuExpandedItemState[dto.Expanded.Length];
1670
+ for (var j = 0; j < dto.Expanded.Length; j++)
1671
+ {
1672
+ var ex = dto.Expanded[j];
1673
+ expanded[j] = new MenuExpandedItemState
1674
+ {
1675
+ Label = ex.Label ?? string.Empty,
1676
+ ItemHref = ex.ItemHref ?? string.Empty,
1677
+ Path = ex.Path ?? string.Empty
1678
+ };
1679
+ }
1680
+ }
1681
+
1682
+ byId[id] = new MenuInstanceState
1683
+ {
1684
+ Id = id,
1685
+ Label = dto.Label ?? string.Empty,
1686
+ SubLabel = dto.SubLabel ?? string.Empty,
1687
+ NoHighlightSelected = dto.NoHighlightSelected,
1688
+ Selected = selected,
1689
+ Expanded = expanded
1690
+ };
1691
+ }
1692
+
1693
+ MenusById = byId;
1694
+ }
1695
+ else if (Menus.Length > 0)
1696
+ {
1697
+ var byId = new Dictionary<string, MenuInstanceState>(Menus.Length, StringComparer.Ordinal);
1698
+ for (var i = 0; i < Menus.Length; i++)
1699
+ {
1700
+ var m2 = Menus[i];
1701
+ var id = m2.Id;
1702
+
1703
+ if (string.IsNullOrWhiteSpace(id))
1704
+ {
1705
+ continue;
1706
+ }
1707
+
1708
+ byId[id] = m2;
1709
+ }
1710
+
1711
+ MenusById = byId;
1712
+ }
1713
+ else
1714
+ {
1715
+ MenusById = new Dictionary<string, MenuInstanceState>(StringComparer.Ordinal);
1716
+ }
1717
+
1718
+ // Nav
1719
+ if (state.Navs is not null && state.Navs.Length > 0)
1720
+ {
1721
+ var navs = new NavState[state.Navs.Length];
1722
+ for (var i = 0; i < state.Navs.Length; i++)
1723
+ {
1724
+ var dto = state.Navs[i];
797
1725
  navs[i] = new NavState
798
1726
  {
799
1727
  Id = dto.Id ?? string.Empty,
@@ -1061,25 +1989,79 @@ namespace ScbBlazorDemo
1061
1989
  // Talar om för Blazor att state har ändrats
1062
1990
  StateHasChanged();
1063
1991
  }
1064
-
1065
1992
  // JS anropar denna metod när något normaliserat event inträffar
1066
1993
  [JSInvokable]
1067
- public Task OnScbEvent(string eventName)
1994
+ public Task OnScbEvent(string? eventName)
1995
+ {
1996
+ var safeEventName = eventName ?? string.Empty;
1997
+ LastScbEventName = safeEventName;
1998
+
1999
+ var eventTask = InvokeAsync(() => OnScbEventAsync(safeEventName));
2000
+
2001
+ if (ShouldRefreshOnScbEvent(safeEventName))
2002
+ {
2003
+ _refreshQueued = true;
2004
+
2005
+ if (_refreshLoopTask == null || _refreshLoopTask.IsCompleted)
2006
+ {
2007
+ _refreshLoopTask = InvokeAsync(RefreshLoopAsync);
2008
+ }
2009
+
2010
+ return Task.WhenAll(_refreshLoopTask, eventTask);
2011
+ }
2012
+
2013
+ return eventTask;
2014
+ }
2015
+
2016
+ private async Task RefreshLoopAsync()
1068
2017
  {
1069
- return RefreshScbStateAsync();
2018
+ if (_refreshRunning) return;
2019
+
2020
+ _refreshRunning = true;
2021
+ try
2022
+ {
2023
+ while (_refreshQueued)
2024
+ {
2025
+ _refreshQueued = false;
2026
+ await RefreshScbStateAsync();
2027
+ }
2028
+ }
2029
+ finally
2030
+ {
2031
+ _refreshRunning = false;
2032
+ }
1070
2033
  }
1071
2034
 
1072
2035
  // Kan overridas i arvklasser för att reagera på stateändringar
1073
2036
  protected virtual Task OnScbStateChangedAsync() => Task.CompletedTask;
1074
2037
 
1075
- public ValueTask DisposeAsync()
2038
+ // Kan overridas i arvklasser för att reagera på normaliserade events från JS-bryggan
2039
+ protected virtual Task OnScbEventAsync(string eventName) => Task.CompletedTask;
2040
+
2041
+ // Kan overridas i arvklasser för att avgöra om ett event ska trigga en state-refresh
2042
+ protected virtual bool ShouldRefreshOnScbEvent(string eventName) => true;
2043
+ public async ValueTask DisposeAsync()
1076
2044
  {
2045
+ if (!string.IsNullOrWhiteSpace(_subscriptionId))
2046
+ {
2047
+ try
2048
+ {
2049
+ await JS.InvokeVoidAsync("SCBBlazor.unregisterScbEventHandlers", _subscriptionId);
2050
+ }
2051
+ catch (InvalidOperationException)
2052
+ {
2053
+ }
2054
+ catch (JSDisconnectedException)
2055
+ {
2056
+ }
2057
+ catch (TaskCanceledException)
2058
+ {
2059
+ }
2060
+ }
2061
+
1077
2062
  _dotNetRef?.Dispose();
1078
- return ValueTask.CompletedTask;
1079
2063
  }
1080
2064
 
1081
-
1082
-
1083
2065
  // Styrkommandon som skickar anrop från Blazor till SCB web components via SCBBlazor-objektet i JS.
1084
2066
  // Dessa metoder uppdaterar DOM:ens state och triggar samma normaliserade events som vid användarinteraktion.
1085
2067
  // Id- och name-baserade varianter rekommenderas för mer robust adressering än ren index-baserad styrning.
@@ -1087,231 +2069,233 @@ namespace ScbBlazorDemo
1087
2069
  // Header (scb-header)
1088
2070
  protected Task SetHeaderActiveTabAsync(int activeTab)
1089
2071
  {
1090
- return JS.InvokeVoidAsync("SCBBlazor.setHeaderActiveTab", activeTab).AsTask();
2072
+ return JS.InvokeVoidAsync("SCBBlazor.setHeaderActiveTab", GetScbRootArg(), activeTab).AsTask();
1091
2073
  }
1092
2074
 
1093
2075
  protected Task SetHeaderDrawerOpenAsync(bool open)
1094
2076
  {
1095
- return JS.InvokeVoidAsync("SCBBlazor.setHeaderDrawerOpen", open).AsTask();
2077
+ return JS.InvokeVoidAsync("SCBBlazor.setHeaderDrawerOpen", GetScbRootArg(), open).AsTask();
1096
2078
  }
1097
2079
 
1098
2080
  protected Task SetHeaderSearchTextAsync(string searchText)
1099
2081
  {
1100
- return JS.InvokeVoidAsync("SCBBlazor.setHeaderSearchText", searchText ?? string.Empty).AsTask();
2082
+ return JS.InvokeVoidAsync("SCBBlazor.setHeaderSearchText", GetScbRootArg(), searchText ?? string.Empty).AsTask();
1101
2083
  }
1102
2084
 
1103
2085
  // Drawer och meny
1104
2086
  protected Task SetDrawerOpenAsync(bool open)
1105
2087
  {
1106
- return JS.InvokeVoidAsync("SCBBlazor.setDrawerOpen", open).AsTask();
2088
+ return JS.InvokeVoidAsync("SCBBlazor.setDrawerOpen", GetScbRootArg(), open).AsTask();
1107
2089
  }
1108
2090
 
1109
2091
  protected Task SetDrawerTextAsync(string label, string subLabel)
1110
2092
  {
1111
2093
  return JS.InvokeVoidAsync(
1112
2094
  "SCBBlazor.setDrawerText",
2095
+ GetScbRootArg(),
1113
2096
  label ?? string.Empty,
1114
2097
  subLabel ?? string.Empty).AsTask();
1115
2098
  }
1116
2099
 
1117
2100
  protected Task SetMenuOpenAsync(bool open)
1118
2101
  {
1119
- return JS.InvokeVoidAsync("SCBBlazor.setMenuOpen", open).AsTask();
2102
+ return JS.InvokeVoidAsync("SCBBlazor.setMenuOpen", GetScbRootArg(), open).AsTask();
1120
2103
  }
1121
2104
 
1122
2105
  // Sub-menyer: index-baserad och id-baserad variant
1123
2106
  protected Task SetSubMenuOpenAsync(int index, bool open)
1124
2107
  {
1125
- return JS.InvokeVoidAsync("SCBBlazor.setSubMenuOpen", index, open).AsTask();
2108
+ return JS.InvokeVoidAsync("SCBBlazor.setSubMenuOpen", GetScbRootArg(), index, open).AsTask();
1126
2109
  }
1127
2110
 
1128
2111
  protected Task SetSubMenuOpenByIdAsync(string id, bool open)
1129
2112
  {
1130
- return JS.InvokeVoidAsync("SCBBlazor.setSubMenuOpenById", id ?? string.Empty, open).AsTask();
2113
+ return JS.InvokeVoidAsync("SCBBlazor.setSubMenuOpenById", GetScbRootArg(), id ?? string.Empty, open).AsTask();
1131
2114
  }
1132
2115
 
1133
2116
  // Breadcrumb
1134
2117
  protected Task SetBreadcrumbShowAllAsync(bool showAll)
1135
2118
  {
1136
- return JS.InvokeVoidAsync("SCBBlazor.setBreadcrumbShowAll", showAll).AsTask();
2119
+ return JS.InvokeVoidAsync("SCBBlazor.setBreadcrumbShowAll", GetScbRootArg(), showAll).AsTask();
1137
2120
  }
1138
2121
 
1139
2122
  // Accordions: index-baserad och id-baserad variant för items
1140
2123
  protected Task SetAccordionItemOpenAsync(int accordionIndex, int itemIndex, bool open)
1141
2124
  {
1142
- return JS.InvokeVoidAsync("SCBBlazor.setAccordionItemOpen", accordionIndex, itemIndex, open).AsTask();
2125
+ return JS.InvokeVoidAsync("SCBBlazor.setAccordionItemOpen", GetScbRootArg(), accordionIndex, itemIndex, open).AsTask();
1143
2126
  }
1144
2127
 
1145
2128
  protected Task SetAccordionItemOpenByIdAsync(string itemId, bool open)
1146
2129
  {
1147
- return JS.InvokeVoidAsync("SCBBlazor.setAccordionItemOpenById", itemId ?? string.Empty, open).AsTask();
2130
+ return JS.InvokeVoidAsync("SCBBlazor.setAccordionItemOpenById", GetScbRootArg(), itemId ?? string.Empty, open).AsTask();
1148
2131
  }
1149
2132
 
1150
2133
  // Checkboxar: index-baserad och id-baserad variant
1151
2134
  protected Task SetCheckboxCheckedAsync(int index, bool isChecked)
1152
2135
  {
1153
- return JS.InvokeVoidAsync("SCBBlazor.setCheckboxChecked", index, isChecked).AsTask();
2136
+ return JS.InvokeVoidAsync("SCBBlazor.setCheckboxChecked", GetScbRootArg(), index, isChecked).AsTask();
1154
2137
  }
1155
2138
 
1156
2139
  protected Task SetCheckboxCheckedByIdAsync(string id, bool isChecked)
1157
2140
  {
1158
- return JS.InvokeVoidAsync("SCBBlazor.setCheckboxCheckedById", id ?? string.Empty, isChecked).AsTask();
2141
+ return JS.InvokeVoidAsync("SCBBlazor.setCheckboxCheckedById", GetScbRootArg(), id ?? string.Empty, isChecked).AsTask();
1159
2142
  }
1160
2143
 
1161
2144
  // Switchar: index-baserad och id-baserad variant
1162
2145
  protected Task SetSwitchSelectedAsync(int index, bool selected)
1163
2146
  {
1164
- return JS.InvokeVoidAsync("SCBBlazor.setSwitchSelected", index, selected).AsTask();
2147
+ return JS.InvokeVoidAsync("SCBBlazor.setSwitchSelected", GetScbRootArg(), index, selected).AsTask();
1165
2148
  }
1166
2149
 
1167
2150
  protected Task SetSwitchSelectedByIdAsync(string id, bool selected)
1168
2151
  {
1169
- return JS.InvokeVoidAsync("SCBBlazor.setSwitchSelectedById", id ?? string.Empty, selected).AsTask();
2152
+ return JS.InvokeVoidAsync("SCBBlazor.setSwitchSelectedById", GetScbRootArg(), id ?? string.Empty, selected).AsTask();
1170
2153
  }
1171
2154
 
1172
2155
  // Segmented button: global och id-baserad variant
1173
2156
  protected Task SetSegmentedValueAsync(string value)
1174
2157
  {
1175
- return JS.InvokeVoidAsync("SCBBlazor.setSegmentedValue", value ?? string.Empty).AsTask();
2158
+ return JS.InvokeVoidAsync("SCBBlazor.setSegmentedValue", GetScbRootArg(), value ?? string.Empty).AsTask();
1176
2159
  }
1177
2160
 
1178
2161
  protected Task SetSegmentedValuesAsync(string[] values)
1179
2162
  {
1180
- return JS.InvokeVoidAsync("SCBBlazor.setSegmentedValues", values ?? Array.Empty<string>()).AsTask();
2163
+ return JS.InvokeVoidAsync("SCBBlazor.setSegmentedValues", GetScbRootArg(), values ?? Array.Empty<string>()).AsTask();
1181
2164
  }
1182
2165
 
1183
2166
  protected Task SetSegmentedValueByIdAsync(string id, string value)
1184
2167
  {
1185
- return JS.InvokeVoidAsync("SCBBlazor.setSegmentedValueById", id ?? string.Empty, value ?? string.Empty).AsTask();
2168
+ return JS.InvokeVoidAsync("SCBBlazor.setSegmentedValueById", GetScbRootArg(), id ?? string.Empty, value ?? string.Empty).AsTask();
1186
2169
  }
1187
2170
 
1188
2171
  protected Task SetSegmentedValuesByIdAsync(string id, string[] values)
1189
2172
  {
1190
- return JS.InvokeVoidAsync("SCBBlazor.setSegmentedValuesById", id ?? string.Empty, values ?? Array.Empty<string>()).AsTask();
2173
+ return JS.InvokeVoidAsync("SCBBlazor.setSegmentedValuesById", GetScbRootArg(), id ?? string.Empty, values ?? Array.Empty<string>()).AsTask();
1191
2174
  }
1192
2175
 
1193
2176
  // Tabs: index-baserad och id-baserad variant
1194
2177
  protected Task SetTabsActiveIndexAsync(int tabsIndex, int activeIndex)
1195
2178
  {
1196
- return JS.InvokeVoidAsync("SCBBlazor.setTabsActiveIndex", tabsIndex, activeIndex).AsTask();
2179
+ return JS.InvokeVoidAsync("SCBBlazor.setTabsActiveIndex", GetScbRootArg(), tabsIndex, activeIndex).AsTask();
1197
2180
  }
1198
2181
 
1199
2182
  protected Task SetTabsActiveIndexByIdAsync(string id, int activeIndex)
1200
2183
  {
1201
- return JS.InvokeVoidAsync("SCBBlazor.setTabsActiveIndexById", id ?? string.Empty, activeIndex).AsTask();
2184
+ return JS.InvokeVoidAsync("SCBBlazor.setTabsActiveIndexById", GetScbRootArg(), id ?? string.Empty, activeIndex).AsTask();
1202
2185
  }
1203
2186
 
1204
2187
  // Dialog
1205
2188
  protected Task SetDialogOpenAsync(bool open)
1206
2189
  {
1207
- return JS.InvokeVoidAsync("SCBBlazor.setDialogOpen", open).AsTask();
2190
+ return JS.InvokeVoidAsync("SCBBlazor.setDialogOpen", GetScbRootArg(), open).AsTask();
1208
2191
  }
1209
2192
 
1210
2193
  // Notification: index-baserad och id-baserad variant
1211
2194
  protected Task SetNotificationOpenAsync(int index, bool open)
1212
2195
  {
1213
- return JS.InvokeVoidAsync("SCBBlazor.setNotificationOpen", index, open).AsTask();
2196
+ return JS.InvokeVoidAsync("SCBBlazor.setNotificationOpen", GetScbRootArg(), index, open).AsTask();
1214
2197
  }
1215
2198
 
1216
2199
  protected Task SetNotificationOpenByIdAsync(string id, bool open)
1217
2200
  {
1218
- return JS.InvokeVoidAsync("SCBBlazor.setNotificationOpenById", id ?? string.Empty, open).AsTask();
2201
+ return JS.InvokeVoidAsync("SCBBlazor.setNotificationOpenById", GetScbRootArg(), id ?? string.Empty, open).AsTask();
1219
2202
  }
1220
2203
 
1221
2204
  // Snackbar: index-baserad och id-baserad variant
1222
2205
  protected Task SetSnackbarOpenAsync(int index, bool open)
1223
2206
  {
1224
- return JS.InvokeVoidAsync("SCBBlazor.setSnackbarOpen", index, open).AsTask();
2207
+ return JS.InvokeVoidAsync("SCBBlazor.setSnackbarOpen", GetScbRootArg(), index, open).AsTask();
1225
2208
  }
1226
2209
 
1227
2210
  protected Task SetSnackbarOpenByIdAsync(string id, bool open)
1228
2211
  {
1229
- return JS.InvokeVoidAsync("SCBBlazor.setSnackbarOpenById", id ?? string.Empty, open).AsTask();
2212
+ return JS.InvokeVoidAsync("SCBBlazor.setSnackbarOpenById", GetScbRootArg(), id ?? string.Empty, open).AsTask();
1230
2213
  }
1231
2214
 
1232
2215
  // Stepper: global och id-baserad variant
1233
2216
  protected Task SetStepperActiveIndexAsync(int activeIndex)
1234
2217
  {
1235
- return JS.InvokeVoidAsync("SCBBlazor.setStepperActiveIndex", activeIndex).AsTask();
2218
+ return JS.InvokeVoidAsync("SCBBlazor.setStepperActiveIndex", GetScbRootArg(), activeIndex).AsTask();
1236
2219
  }
1237
2220
 
1238
2221
  protected Task SetStepperActiveIndexByIdAsync(string id, int activeIndex)
1239
2222
  {
1240
- return JS.InvokeVoidAsync("SCBBlazor.setStepperActiveIndexById", id ?? string.Empty, activeIndex).AsTask();
2223
+ return JS.InvokeVoidAsync("SCBBlazor.setStepperActiveIndexById", GetScbRootArg(), id ?? string.Empty, activeIndex).AsTask();
1241
2224
  }
1242
2225
 
1243
2226
  // Calendar (scb-calendar): global och id-baserad variant
1244
2227
  protected Task SetCalendarDisplayMonthYearAsync(int year, int month)
1245
2228
  {
1246
- return JS.InvokeVoidAsync("SCBBlazor.setCalendarDisplayMonthYear", year, month).AsTask();
2229
+ return JS.InvokeVoidAsync("SCBBlazor.setCalendarDisplayMonthYear", GetScbRootArg(), year, month).AsTask();
1247
2230
  }
1248
2231
 
1249
2232
  protected Task SetCalendarSelectedDateAsync(string date)
1250
2233
  {
1251
- return JS.InvokeVoidAsync("SCBBlazor.setCalendarSelectedDate", date ?? string.Empty).AsTask();
2234
+ return JS.InvokeVoidAsync("SCBBlazor.setCalendarSelectedDate", GetScbRootArg(), date ?? string.Empty).AsTask();
1252
2235
  }
1253
2236
 
1254
2237
  protected Task SetCalendarDisableWeekendAsync(bool disableWeekend)
1255
2238
  {
1256
- return JS.InvokeVoidAsync("SCBBlazor.setCalendarDisableWeekend", disableWeekend).AsTask();
2239
+ return JS.InvokeVoidAsync("SCBBlazor.setCalendarDisableWeekend", GetScbRootArg(), disableWeekend).AsTask();
1257
2240
  }
1258
2241
 
1259
2242
  protected Task SetCalendarPublicHolidaysAsync(bool publicHolidays)
1260
2243
  {
1261
- return JS.InvokeVoidAsync("SCBBlazor.setCalendarPublicHolidays", publicHolidays).AsTask();
2244
+ return JS.InvokeVoidAsync("SCBBlazor.setCalendarPublicHolidays", GetScbRootArg(), publicHolidays).AsTask();
1262
2245
  }
1263
2246
 
1264
2247
  protected Task SetCalendarLangAsync(string lang)
1265
2248
  {
1266
- return JS.InvokeVoidAsync("SCBBlazor.setCalendarLang", lang ?? string.Empty).AsTask();
2249
+ return JS.InvokeVoidAsync("SCBBlazor.setCalendarLang", GetScbRootArg(), lang ?? string.Empty).AsTask();
1267
2250
  }
1268
2251
 
1269
2252
  protected Task SetCalendarDisplayMonthYearByIdAsync(string id, int year, int month)
1270
2253
  {
1271
- return JS.InvokeVoidAsync("SCBBlazor.setCalendarDisplayMonthYearById", id ?? string.Empty, year, month).AsTask();
2254
+ return JS.InvokeVoidAsync("SCBBlazor.setCalendarDisplayMonthYearById", GetScbRootArg(), id ?? string.Empty, year, month).AsTask();
1272
2255
  }
1273
2256
 
1274
2257
  protected Task SetCalendarSelectedDateByIdAsync(string id, string date)
1275
2258
  {
1276
- return JS.InvokeVoidAsync("SCBBlazor.setCalendarSelectedDateById", id ?? string.Empty, date ?? string.Empty).AsTask();
2259
+ return JS.InvokeVoidAsync("SCBBlazor.setCalendarSelectedDateById", GetScbRootArg(), id ?? string.Empty, date ?? string.Empty).AsTask();
1277
2260
  }
1278
2261
 
1279
2262
  protected Task SetCalendarDisableWeekendByIdAsync(string id, bool disableWeekend)
1280
2263
  {
1281
- return JS.InvokeVoidAsync("SCBBlazor.setCalendarDisableWeekendById", id ?? string.Empty, disableWeekend).AsTask();
2264
+ return JS.InvokeVoidAsync("SCBBlazor.setCalendarDisableWeekendById", GetScbRootArg(), id ?? string.Empty, disableWeekend).AsTask();
1282
2265
  }
1283
2266
 
1284
2267
  protected Task SetCalendarPublicHolidaysByIdAsync(string id, bool publicHolidays)
1285
2268
  {
1286
- return JS.InvokeVoidAsync("SCBBlazor.setCalendarPublicHolidaysById", id ?? string.Empty, publicHolidays).AsTask();
2269
+ return JS.InvokeVoidAsync("SCBBlazor.setCalendarPublicHolidaysById", GetScbRootArg(), id ?? string.Empty, publicHolidays).AsTask();
1287
2270
  }
1288
2271
 
1289
2272
  protected Task SetCalendarLangByIdAsync(string id, string lang)
1290
2273
  {
1291
- return JS.InvokeVoidAsync("SCBBlazor.setCalendarLangById", id ?? string.Empty, lang ?? string.Empty).AsTask();
2274
+ return JS.InvokeVoidAsync("SCBBlazor.setCalendarLangById", GetScbRootArg(), id ?? string.Empty, lang ?? string.Empty).AsTask();
1292
2275
  }
1293
2276
 
1294
2277
  // Pagination: index-baserad och id-baserad variant
1295
2278
  protected Task SetPaginationPageAsync(int paginationIndex, int page)
1296
2279
  {
1297
- return JS.InvokeVoidAsync("SCBBlazor.setPaginationPage", paginationIndex, page).AsTask();
2280
+ return JS.InvokeVoidAsync("SCBBlazor.setPaginationPage", GetScbRootArg(), paginationIndex, page).AsTask();
1298
2281
  }
1299
2282
 
1300
2283
  protected Task SetPaginationPageByIdAsync(string id, int page)
1301
2284
  {
1302
- return JS.InvokeVoidAsync("SCBBlazor.setPaginationPageById", id ?? string.Empty, page).AsTask();
2285
+ return JS.InvokeVoidAsync("SCBBlazor.setPaginationPageById", GetScbRootArg(), id ?? string.Empty, page).AsTask();
1303
2286
  }
1304
2287
 
1305
2288
  // Radio-group: index-, name- och id-baserad variant
1306
2289
  protected Task SetRadioGroupValueByIndexAsync(int index, string value)
1307
2290
  {
1308
- return JS.InvokeVoidAsync("SCBBlazor.setRadioGroupValueByIndex", index, value ?? string.Empty).AsTask();
2291
+ return JS.InvokeVoidAsync("SCBBlazor.setRadioGroupValueByIndex", GetScbRootArg(), index, value ?? string.Empty).AsTask();
1309
2292
  }
1310
2293
 
1311
2294
  protected Task SetRadioGroupValueByNameAsync(string name, string value)
1312
2295
  {
1313
2296
  return JS.InvokeVoidAsync(
1314
2297
  "SCBBlazor.setRadioGroupValueByName",
2298
+ GetScbRootArg(),
1315
2299
  name ?? string.Empty,
1316
2300
  value ?? string.Empty).AsTask();
1317
2301
  }
@@ -1320,6 +2304,7 @@ namespace ScbBlazorDemo
1320
2304
  {
1321
2305
  return JS.InvokeVoidAsync(
1322
2306
  "SCBBlazor.setRadioGroupValueById",
2307
+ GetScbRootArg(),
1323
2308
  id ?? string.Empty,
1324
2309
  value ?? string.Empty).AsTask();
1325
2310
  }
@@ -1327,62 +2312,158 @@ namespace ScbBlazorDemo
1327
2312
  // Textfield: index- och id-baserad variant
1328
2313
  protected Task SetTextfieldValueAsync(int index, string value)
1329
2314
  {
1330
- return JS.InvokeVoidAsync("SCBBlazor.setTextfieldValue", index, value ?? string.Empty).AsTask();
2315
+ return JS.InvokeVoidAsync("SCBBlazor.setTextfieldValue", GetScbRootArg(), index, value ?? string.Empty).AsTask();
1331
2316
  }
1332
2317
 
1333
2318
  protected Task SetTextfieldValueByIdAsync(string id, string value)
1334
2319
  {
1335
- return JS.InvokeVoidAsync("SCBBlazor.setTextfieldValueById", id ?? string.Empty, value ?? string.Empty).AsTask();
2320
+ return JS.InvokeVoidAsync("SCBBlazor.setTextfieldValueById", GetScbRootArg(), id ?? string.Empty, value ?? string.Empty).AsTask();
1336
2321
  }
1337
2322
 
1338
2323
  // Search: index- och id-baserad variant
1339
2324
  protected Task SetSearchValueAsync(int index, string value)
1340
2325
  {
1341
- return JS.InvokeVoidAsync("SCBBlazor.setSearchValue", index, value ?? string.Empty).AsTask();
2326
+ return JS.InvokeVoidAsync("SCBBlazor.setSearchValue", GetScbRootArg(), index, value ?? string.Empty).AsTask();
1342
2327
  }
1343
2328
 
1344
2329
  protected Task SetSearchValueByIdAsync(string id, string value)
1345
2330
  {
1346
- return JS.InvokeVoidAsync("SCBBlazor.setSearchValueById", id ?? string.Empty, value ?? string.Empty).AsTask();
2331
+ return JS.InvokeVoidAsync("SCBBlazor.setSearchValueById", GetScbRootArg(), id ?? string.Empty, value ?? string.Empty).AsTask();
2332
+ }
2333
+
2334
+
2335
+ // Dropdown
2336
+ protected Task SetDropdownOpenAsync(int index, bool open)
2337
+ {
2338
+ return JS.InvokeVoidAsync("SCBBlazor.setDropdownOpen", GetScbRootArg(), index, open).AsTask();
2339
+ }
2340
+
2341
+ protected Task SetDropdownOpenByIdAsync(string id, bool open)
2342
+ {
2343
+ return JS.InvokeVoidAsync("SCBBlazor.setDropdownOpenById", GetScbRootArg(), id ?? string.Empty, open).AsTask();
2344
+ }
2345
+
2346
+
2347
+ // Select, slider och datepicker
2348
+ protected Task SetSelectValueAsync(int index, string value)
2349
+ {
2350
+ return JS.InvokeVoidAsync("SCBBlazor.setSelectValue", GetScbRootArg(), index, value ?? string.Empty).AsTask();
2351
+ }
2352
+
2353
+ protected Task SetSelectValueByIdAsync(string id, string value)
2354
+ {
2355
+ return JS.InvokeVoidAsync("SCBBlazor.setSelectValueById", GetScbRootArg(), id ?? string.Empty, value ?? string.Empty).AsTask();
2356
+ }
2357
+
2358
+ protected Task SetSelectValuesAsync(int index, string[] values)
2359
+ {
2360
+ return JS.InvokeVoidAsync("SCBBlazor.setSelectValues", GetScbRootArg(), index, values ?? Array.Empty<string>()).AsTask();
2361
+ }
2362
+
2363
+ protected Task SetSelectValuesByIdAsync(string id, string[] values)
2364
+ {
2365
+ return JS.InvokeVoidAsync("SCBBlazor.setSelectValuesById", GetScbRootArg(), id ?? string.Empty, values ?? Array.Empty<string>()).AsTask();
2366
+ }
2367
+
2368
+ protected Task SetSelectOpenAsync(int index, bool open)
2369
+ {
2370
+ return JS.InvokeVoidAsync("SCBBlazor.setSelectOpen", GetScbRootArg(), index, open).AsTask();
2371
+ }
2372
+
2373
+ protected Task SetSelectOpenByIdAsync(string id, bool open)
2374
+ {
2375
+ return JS.InvokeVoidAsync("SCBBlazor.setSelectOpenById", GetScbRootArg(), id ?? string.Empty, open).AsTask();
2376
+ }
2377
+
2378
+ protected Task SetSliderValueAsync(int index, double value)
2379
+ {
2380
+ return JS.InvokeVoidAsync("SCBBlazor.setSliderValue", GetScbRootArg(), index, value).AsTask();
2381
+ }
2382
+
2383
+ protected Task SetSliderValueByIdAsync(string id, double value)
2384
+ {
2385
+ return JS.InvokeVoidAsync("SCBBlazor.setSliderValueById", GetScbRootArg(), id ?? string.Empty, value).AsTask();
2386
+ }
2387
+
2388
+ protected Task SetSliderRangeAsync(int index, double valueStart, double valueEnd)
2389
+ {
2390
+ return JS.InvokeVoidAsync("SCBBlazor.setSliderRange", GetScbRootArg(), index, valueStart, valueEnd).AsTask();
2391
+ }
2392
+
2393
+ protected Task SetSliderRangeByIdAsync(string id, double valueStart, double valueEnd)
2394
+ {
2395
+ return JS.InvokeVoidAsync("SCBBlazor.setSliderRangeById", GetScbRootArg(), id ?? string.Empty, valueStart, valueEnd).AsTask();
2396
+ }
2397
+
2398
+ protected Task SetDatepickerOpenAsync(int index, bool open)
2399
+ {
2400
+ return JS.InvokeVoidAsync("SCBBlazor.setDatepickerOpen", GetScbRootArg(), index, open).AsTask();
2401
+ }
2402
+
2403
+ protected Task SetDatepickerOpenByIdAsync(string id, bool open)
2404
+ {
2405
+ return JS.InvokeVoidAsync("SCBBlazor.setDatepickerOpenById", GetScbRootArg(), id ?? string.Empty, open).AsTask();
2406
+ }
2407
+
2408
+ protected Task SetDatepickerSelectedValueAsync(int index, string selectedValue)
2409
+ {
2410
+ return JS.InvokeVoidAsync("SCBBlazor.setDatepickerSelectedValue", GetScbRootArg(), index, selectedValue ?? string.Empty).AsTask();
2411
+ }
2412
+
2413
+ protected Task SetDatepickerSelectedValueByIdAsync(string id, string selectedValue)
2414
+ {
2415
+ return JS.InvokeVoidAsync("SCBBlazor.setDatepickerSelectedValueById", GetScbRootArg(), id ?? string.Empty, selectedValue ?? string.Empty).AsTask();
2416
+ }
2417
+
2418
+
2419
+ // Collapse
2420
+ protected Task SetCollapseExpandedAsync(int index, bool expanded)
2421
+ {
2422
+ return JS.InvokeVoidAsync("SCBBlazor.setCollapseExpanded", GetScbRootArg(), index, expanded).AsTask();
2423
+ }
2424
+
2425
+ protected Task SetCollapseExpandedByIdAsync(string id, bool expanded)
2426
+ {
2427
+ return JS.InvokeVoidAsync("SCBBlazor.setCollapseExpandedById", GetScbRootArg(), id ?? string.Empty, expanded).AsTask();
1347
2428
  }
1348
2429
 
1349
2430
 
1350
2431
  protected Task SetNavActiveHrefByIdAsync(string id, string activeHref)
1351
2432
  {
1352
- return JS.InvokeVoidAsync("SCBBlazor.setNavActiveHrefById", id ?? string.Empty, activeHref ?? string.Empty).AsTask();
2433
+ return JS.InvokeVoidAsync("SCBBlazor.setNavActiveHrefById", GetScbRootArg(), id ?? string.Empty, activeHref ?? string.Empty).AsTask();
1353
2434
  }
1354
2435
 
1355
2436
  // TOC: index-baserad och id-baserad variant för items
1356
2437
  protected Task SetTocItemExpandedAsync(int tocIndex, int itemIndex, bool expanded)
1357
2438
  {
1358
- return JS.InvokeVoidAsync("SCBBlazor.setTocItemExpanded", tocIndex, itemIndex, expanded).AsTask();
2439
+ return JS.InvokeVoidAsync("SCBBlazor.setTocItemExpanded", GetScbRootArg(), tocIndex, itemIndex, expanded).AsTask();
1359
2440
  }
1360
2441
 
1361
2442
  protected Task SetTocItemExpandedByIdAsync(string itemId, bool expanded)
1362
2443
  {
1363
- return JS.InvokeVoidAsync("SCBBlazor.setTocItemExpandedById", itemId ?? string.Empty, expanded).AsTask();
2444
+ return JS.InvokeVoidAsync("SCBBlazor.setTocItemExpandedById", GetScbRootArg(), itemId ?? string.Empty, expanded).AsTask();
1364
2445
  }
1365
2446
 
1366
2447
  // Viz: index- och id-baserad variant
1367
2448
  protected Task SetVizSelectedChipAsync(int index, string selectedChip)
1368
2449
  {
1369
- return JS.InvokeVoidAsync("SCBBlazor.setVizSelectedChip", index, selectedChip ?? string.Empty).AsTask();
2450
+ return JS.InvokeVoidAsync("SCBBlazor.setVizSelectedChip", GetScbRootArg(), index, selectedChip ?? string.Empty).AsTask();
1370
2451
  }
1371
2452
 
1372
2453
  protected Task SetVizSelectedChipByIdAsync(string id, string selectedChip)
1373
2454
  {
1374
- return JS.InvokeVoidAsync("SCBBlazor.setVizSelectedChipById", id ?? string.Empty, selectedChip ?? string.Empty).AsTask();
2455
+ return JS.InvokeVoidAsync("SCBBlazor.setVizSelectedChipById", GetScbRootArg(), id ?? string.Empty, selectedChip ?? string.Empty).AsTask();
1375
2456
  }
1376
2457
 
1377
2458
 
1378
2459
  protected Task SetVizViewAsync(int index, string view)
1379
2460
  {
1380
- return JS.InvokeVoidAsync("SCBBlazor.setVizView", index, view ?? string.Empty).AsTask();
2461
+ return JS.InvokeVoidAsync("SCBBlazor.setVizView", GetScbRootArg(), index, view ?? string.Empty).AsTask();
1381
2462
  }
1382
2463
 
1383
2464
  protected Task SetVizViewByIdAsync(string id, string view)
1384
2465
  {
1385
- return JS.InvokeVoidAsync("SCBBlazor.setVizViewById", id ?? string.Empty, view ?? string.Empty).AsTask();
2466
+ return JS.InvokeVoidAsync("SCBBlazor.setVizViewById", GetScbRootArg(), id ?? string.Empty, view ?? string.Empty).AsTask();
1386
2467
  }
1387
2468
 
1388
2469
  // Nedan följer alla state-klasser som används i Razor views
@@ -1412,6 +2493,81 @@ namespace ScbBlazorDemo
1412
2493
  public bool OpenLeft { get; set; }
1413
2494
  }
1414
2495
 
2496
+ protected sealed class OptionsMenuState
2497
+ {
2498
+ public string Id { get; set; } = string.Empty;
2499
+ public bool Open { get; set; }
2500
+ public string Spacing { get; set; } = string.Empty;
2501
+ public string SpacingTop { get; set; } = string.Empty;
2502
+ public string SpacingBottom { get; set; } = string.Empty;
2503
+ public string SpacingLeft { get; set; } = string.Empty;
2504
+ public string SpacingRight { get; set; } = string.Empty;
2505
+ }
2506
+
2507
+ protected sealed class ProgressIndicatorState
2508
+ {
2509
+ public string Id { get; set; } = string.Empty;
2510
+ public string Type { get; set; } = string.Empty;
2511
+ public double Progress { get; set; }
2512
+ public bool IsStatic { get; set; }
2513
+ public string Spacing { get; set; } = string.Empty;
2514
+ public string SpacingTop { get; set; } = string.Empty;
2515
+ public string SpacingBottom { get; set; } = string.Empty;
2516
+ public string SpacingLeft { get; set; } = string.Empty;
2517
+ public string SpacingRight { get; set; } = string.Empty;
2518
+ }
2519
+
2520
+ protected sealed class ProgressStepState
2521
+ {
2522
+ public string Id { get; set; } = string.Empty;
2523
+ public string Width { get; set; } = string.Empty;
2524
+ public bool Active { get; set; }
2525
+ public bool Disabled { get; set; }
2526
+ public string Href { get; set; } = string.Empty;
2527
+ public string Label { get; set; } = string.Empty;
2528
+ public string Position { get; set; } = string.Empty;
2529
+ }
2530
+
2531
+ protected sealed class ProgressStepperState
2532
+ {
2533
+ public string Id { get; set; } = string.Empty;
2534
+ public double ProgressWidth { get; set; }
2535
+ public string Height { get; set; } = string.Empty;
2536
+ public string Position { get; set; } = string.Empty;
2537
+ public string Spacing { get; set; } = string.Empty;
2538
+ public string SpacingTop { get; set; } = string.Empty;
2539
+ public string SpacingBottom { get; set; } = string.Empty;
2540
+ public string SpacingLeft { get; set; } = string.Empty;
2541
+ public string SpacingRight { get; set; } = string.Empty;
2542
+ public ProgressStepState[] Steps { get; set; } = Array.Empty<ProgressStepState>();
2543
+ }
2544
+
2545
+ protected sealed class SkeletonState
2546
+ {
2547
+ public string Id { get; set; } = string.Empty;
2548
+ public string Variant { get; set; } = string.Empty;
2549
+ public string Width { get; set; } = string.Empty;
2550
+ public string Height { get; set; } = string.Empty;
2551
+ public string BorderSize { get; set; } = string.Empty;
2552
+ public string Spacing { get; set; } = string.Empty;
2553
+ public string SpacingTop { get; set; } = string.Empty;
2554
+ public string SpacingBottom { get; set; } = string.Empty;
2555
+ public string SpacingLeft { get; set; } = string.Empty;
2556
+ public string SpacingRight { get; set; } = string.Empty;
2557
+ }
2558
+
2559
+ protected sealed class TableAdvancedState
2560
+ {
2561
+ public string Id { get; set; } = string.Empty;
2562
+ public string SearchTerm { get; set; } = string.Empty;
2563
+ public bool Pagination { get; set; }
2564
+ public bool FilteringSearch { get; set; }
2565
+ public bool NoScroll { get; set; }
2566
+ public int PageSize { get; set; }
2567
+ public int CurrentPage { get; set; }
2568
+ public int TotalRows { get; set; }
2569
+ }
2570
+
1415
2571
  protected sealed class BreadcrumbState
1416
2572
  {
1417
2573
  public bool ShowAll { get; set; }
@@ -1426,7 +2582,7 @@ namespace ScbBlazorDemo
1426
2582
 
1427
2583
  protected sealed class AccordionListState
1428
2584
  {
1429
- public bool Detached { get; set; }
2585
+ public bool SingleOpen { get; set; }
1430
2586
  public AccordionItemState[] Items { get; set; } = Array.Empty<AccordionItemState>();
1431
2587
  }
1432
2588
 
@@ -1488,7 +2644,125 @@ namespace ScbBlazorDemo
1488
2644
  public string Subtitle { get; set; } = string.Empty;
1489
2645
  public string SupportingText { get; set; } = string.Empty;
1490
2646
  public string CardHref { get; set; } = string.Empty;
1491
- }
2647
+
2648
+ public string MediaType { get; set; } = string.Empty;
2649
+ public string MediaHref { get; set; } = string.Empty;
2650
+ public string MediaAlt { get; set; } = string.Empty;
2651
+ public string MediaSrcset { get; set; } = string.Empty;
2652
+ public string MediaSizes { get; set; } = string.Empty;
2653
+ public string MediaLoading { get; set; } = string.Empty;
2654
+ public string MediaDecoding { get; set; } = string.Empty;
2655
+ public string MediaFetchPriority { get; set; } = string.Empty;
2656
+ public string MediaFit { get; set; } = string.Empty;
2657
+ public string MediaPosition { get; set; } = string.Empty;
2658
+ public string MediaWidth { get; set; } = string.Empty;
2659
+ public string MediaHeight { get; set; } = string.Empty;
2660
+ public string MediaAspect { get; set; } = string.Empty;
2661
+ public bool MediaPlaceholder { get; set; }
2662
+
2663
+ public string Date { get; set; } = string.Empty;
2664
+
2665
+ public string CommentsText { get; set; } = string.Empty;
2666
+ public int Comments { get; set; }
2667
+ public string CommentsHref { get; set; } = string.Empty;
2668
+
2669
+ public string LikesText { get; set; } = string.Empty;
2670
+ public int Likes { get; set; }
2671
+ public bool HasLiked { get; set; }
2672
+ public bool LikesInteractive { get; set; }
2673
+
2674
+ public bool Author { get; set; }
2675
+ public string AuthorText { get; set; } = string.Empty;
2676
+ public string AuthorHref { get; set; } = string.Empty;
2677
+
2678
+ public string Sizing { get; set; } = string.Empty;
2679
+ public string Width { get; set; } = string.Empty;
2680
+ public string MaxWidth { get; set; } = string.Empty;
2681
+ public string Height { get; set; } = string.Empty;
2682
+ public string MaxHeight { get; set; } = string.Empty;
2683
+
2684
+ public string Spacing { get; set; } = string.Empty;
2685
+ public string SpacingTop { get; set; } = string.Empty;
2686
+ public string SpacingBottom { get; set; } = string.Empty;
2687
+ public string SpacingLeft { get; set; } = string.Empty;
2688
+ public string SpacingRight { get; set; } = string.Empty;
2689
+ }
2690
+
2691
+
2692
+ protected sealed class FactCardState
2693
+ {
2694
+ public string Id { get; set; } = string.Empty;
2695
+ public string Variant { get; set; } = string.Empty;
2696
+ public string Title { get; set; } = string.Empty;
2697
+ public string Subtitle { get; set; } = string.Empty;
2698
+ public string SupportingText { get; set; } = string.Empty;
2699
+ public string Icon { get; set; } = string.Empty;
2700
+ public bool ShowCloseButton { get; set; }
2701
+ public bool Open { get; set; }
2702
+ public string Sizing { get; set; } = string.Empty;
2703
+
2704
+ public string Width { get; set; } = string.Empty;
2705
+ public string MaxWidth { get; set; } = string.Empty;
2706
+ public string Height { get; set; } = string.Empty;
2707
+ public string MaxHeight { get; set; } = string.Empty;
2708
+
2709
+ public string Spacing { get; set; } = string.Empty;
2710
+ public string SpacingTop { get; set; } = string.Empty;
2711
+ public string SpacingBottom { get; set; } = string.Empty;
2712
+ public string SpacingLeft { get; set; } = string.Empty;
2713
+ public string SpacingRight { get; set; } = string.Empty;
2714
+ }
2715
+
2716
+ protected sealed class FooterState
2717
+ {
2718
+ public string Id { get; set; } = string.Empty;
2719
+ public string MaxWidth { get; set; } = string.Empty;
2720
+ public bool DeferPaint { get; set; }
2721
+
2722
+ public string Spacing { get; set; } = string.Empty;
2723
+ public string SpacingTop { get; set; } = string.Empty;
2724
+ public string SpacingBottom { get; set; } = string.Empty;
2725
+
2726
+ public string Description { get; set; } = string.Empty;
2727
+ public FooterSectionState[] Sections { get; set; } = Array.Empty<FooterSectionState>();
2728
+ }
2729
+
2730
+ protected sealed class FooterSectionState
2731
+ {
2732
+ public string Title { get; set; } = string.Empty;
2733
+ public FooterLinkState[] Links { get; set; } = Array.Empty<FooterLinkState>();
2734
+ }
2735
+
2736
+ protected sealed class FooterLinkState
2737
+ {
2738
+ public string Label { get; set; } = string.Empty;
2739
+ public string Href { get; set; } = string.Empty;
2740
+ public string Target { get; set; } = string.Empty;
2741
+ }
2742
+
2743
+ protected sealed class HorizontalScrollerState
2744
+ {
2745
+ public string Id { get; set; } = string.Empty;
2746
+ public string Variant { get; set; } = string.Empty;
2747
+ public string Width { get; set; } = string.Empty;
2748
+
2749
+ public bool ShowScrollbar { get; set; }
2750
+ public string RightScrollButtonLabel { get; set; } = string.Empty;
2751
+ public string LeftScrollButtonLabel { get; set; } = string.Empty;
2752
+
2753
+ public bool ContentFlex { get; set; }
2754
+ public string InternalGap { get; set; } = string.Empty;
2755
+
2756
+ public string Spacing { get; set; } = string.Empty;
2757
+ public string SpacingTop { get; set; } = string.Empty;
2758
+ public string SpacingBottom { get; set; } = string.Empty;
2759
+ public string SpacingLeft { get; set; } = string.Empty;
2760
+ public string SpacingRight { get; set; } = string.Empty;
2761
+
2762
+ public double ScrollLeft { get; set; }
2763
+ public bool CanScrollLeft { get; set; }
2764
+ public bool CanScrollRight { get; set; }
2765
+ }
1492
2766
 
1493
2767
  protected sealed class KeyfigureState
1494
2768
  {
@@ -1605,6 +2879,67 @@ namespace ScbBlazorDemo
1605
2879
  public string Id { get; set; } = string.Empty;
1606
2880
  }
1607
2881
 
2882
+ protected sealed class DropdownState
2883
+ {
2884
+ public string Id { get; set; } = string.Empty;
2885
+ public string Label { get; set; } = string.Empty;
2886
+ public string Variant { get; set; } = string.Empty;
2887
+ public string Size { get; set; } = string.Empty;
2888
+ public bool Open { get; set; }
2889
+ public bool Disabled { get; set; }
2890
+ }
2891
+
2892
+ protected sealed class SelectState
2893
+ {
2894
+ public string Id { get; set; } = string.Empty;
2895
+ public string Variant { get; set; } = string.Empty;
2896
+ public bool Open { get; set; }
2897
+ public string Value { get; set; } = string.Empty;
2898
+ public string[] Values { get; set; } = Array.Empty<string>();
2899
+ public bool Disabled { get; set; }
2900
+ }
2901
+
2902
+ protected sealed class SliderState
2903
+ {
2904
+ public string Id { get; set; } = string.Empty;
2905
+ public bool Range { get; set; }
2906
+ public double Value { get; set; }
2907
+ public double ValueStart { get; set; }
2908
+ public double ValueEnd { get; set; }
2909
+ public double Min { get; set; }
2910
+ public double Max { get; set; }
2911
+ public double Step { get; set; }
2912
+ public bool Disabled { get; set; }
2913
+ }
2914
+
2915
+ protected sealed class DatepickerState
2916
+ {
2917
+ public string Id { get; set; } = string.Empty;
2918
+ public bool Open { get; set; }
2919
+ public string SelectedValue { get; set; } = string.Empty;
2920
+ public string Variant { get; set; } = string.Empty;
2921
+ public string Lang { get; set; } = string.Empty;
2922
+ }
2923
+
2924
+ protected sealed class CollapseState
2925
+ {
2926
+ public string Id { get; set; } = string.Empty;
2927
+ public string Variant { get; set; } = string.Empty;
2928
+ public bool Expanded { get; set; }
2929
+ public int CollapsedHeight { get; set; }
2930
+ public int VisibleElements { get; set; }
2931
+ public string ExpandButtonLabel { get; set; } = string.Empty;
2932
+ public string CollapseButtonLabel { get; set; } = string.Empty;
2933
+ }
2934
+
2935
+ protected sealed class CookiesConsentState
2936
+ {
2937
+ public string Id { get; set; } = string.Empty;
2938
+ public bool Open { get; set; }
2939
+ public string Title { get; set; } = string.Empty;
2940
+ public string SupportingText { get; set; } = string.Empty;
2941
+ }
2942
+
1608
2943
  protected sealed class ListState
1609
2944
  {
1610
2945
  public bool NoDivider { get; set; }
@@ -1647,6 +2982,86 @@ namespace ScbBlazorDemo
1647
2982
  public string Text { get; set; } = string.Empty;
1648
2983
  }
1649
2984
 
2985
+
2986
+ protected sealed class AvatarState
2987
+ {
2988
+ public string Src { get; set; } = string.Empty;
2989
+ public string Alt { get; set; } = string.Empty;
2990
+ public string Label { get; set; } = string.Empty;
2991
+ public string Size { get; set; } = string.Empty;
2992
+ public string Shape { get; set; } = string.Empty;
2993
+ public string IconName { get; set; } = string.Empty;
2994
+ public string Variant { get; set; } = string.Empty;
2995
+
2996
+ public string Spacing { get; set; } = string.Empty;
2997
+ public string SpacingTop { get; set; } = string.Empty;
2998
+ public string SpacingBottom { get; set; } = string.Empty;
2999
+ public string SpacingLeft { get; set; } = string.Empty;
3000
+ public string SpacingRight { get; set; } = string.Empty;
3001
+ }
3002
+
3003
+ protected sealed class BadgeState
3004
+ {
3005
+ public bool AutoHide { get; set; }
3006
+ public bool Hidden { get; set; }
3007
+
3008
+ public string Sizing { get; set; } = string.Empty;
3009
+ public string Position { get; set; } = string.Empty;
3010
+ public string PositionSide { get; set; } = string.Empty;
3011
+ public string PositionTop { get; set; } = string.Empty;
3012
+ public string PositionRight { get; set; } = string.Empty;
3013
+ public string PositionLeft { get; set; } = string.Empty;
3014
+
3015
+ public string Value { get; set; } = string.Empty;
3016
+ public string Label { get; set; } = string.Empty;
3017
+ public string Variant { get; set; } = string.Empty;
3018
+ }
3019
+
3020
+ protected sealed class IconButtonState
3021
+ {
3022
+ public string Id { get; set; } = string.Empty;
3023
+ public string Icon { get; set; } = string.Empty;
3024
+
3025
+ public bool Toggle { get; set; }
3026
+ public bool Selected { get; set; }
3027
+ public bool Disabled { get; set; }
3028
+
3029
+ public string AriaLabel { get; set; } = string.Empty;
3030
+
3031
+ public string Href { get; set; } = string.Empty;
3032
+ public string Target { get; set; } = string.Empty;
3033
+ public string Rel { get; set; } = string.Empty;
3034
+ }
3035
+
3036
+ protected sealed class MenuInstanceState
3037
+ {
3038
+ public string Id { get; set; } = string.Empty;
3039
+ public string Label { get; set; } = string.Empty;
3040
+ public string SubLabel { get; set; } = string.Empty;
3041
+ public bool NoHighlightSelected { get; set; }
3042
+
3043
+ public MenuSelectedItemState? Selected { get; set; }
3044
+
3045
+ public MenuExpandedItemState[] Expanded { get; set; } = Array.Empty<MenuExpandedItemState>();
3046
+ }
3047
+
3048
+ protected sealed class MenuSelectedItemState
3049
+ {
3050
+ public string Label { get; set; } = string.Empty;
3051
+ public string ItemHref { get; set; } = string.Empty;
3052
+ public string LeadingIcon { get; set; } = string.Empty;
3053
+ public string Path { get; set; } = string.Empty;
3054
+ }
3055
+
3056
+ protected sealed class MenuExpandedItemState
3057
+ {
3058
+ public string Label { get; set; } = string.Empty;
3059
+ public string ItemHref { get; set; } = string.Empty;
3060
+ public string Path { get; set; } = string.Empty;
3061
+ }
3062
+
3063
+
3064
+
1650
3065
  protected sealed class NavState
1651
3066
  {
1652
3067
  public string Id { get; set; } = string.Empty;
@@ -1715,6 +3130,20 @@ namespace ScbBlazorDemo
1715
3130
 
1716
3131
  public MenuDto Menu { get; set; } = new();
1717
3132
 
3133
+ public OptionsMenuDto[] OptionsMenus { get; set; } = Array.Empty<OptionsMenuDto>();
3134
+
3135
+ public Dictionary<string, OptionsMenuDto> OptionsMenusById { get; set; } = new();
3136
+
3137
+ public ProgressIndicatorDto[] ProgressIndicators { get; set; } = Array.Empty<ProgressIndicatorDto>();
3138
+
3139
+ public ProgressStepperDto[] ProgressSteppers { get; set; } = Array.Empty<ProgressStepperDto>();
3140
+
3141
+ public ProgressStepDto[] ProgressSteps { get; set; } = Array.Empty<ProgressStepDto>();
3142
+
3143
+ public SkeletonDto[] Skeletons { get; set; } = Array.Empty<SkeletonDto>();
3144
+
3145
+ public TableAdvancedDto[] TablesAdvanced { get; set; } = Array.Empty<TableAdvancedDto>();
3146
+
1718
3147
  public SubMenuDto[] SubMenus { get; set; } = Array.Empty<SubMenuDto>();
1719
3148
 
1720
3149
  public BreadcrumbDto Breadcrumb { get; set; } = new();
@@ -1734,6 +3163,12 @@ namespace ScbBlazorDemo
1734
3163
 
1735
3164
  public CardDto[] Cards { get; set; } = Array.Empty<CardDto>();
1736
3165
 
3166
+ public FactCardDto[] FactCards { get; set; } = Array.Empty<FactCardDto>();
3167
+
3168
+ public FooterDto[] Footers { get; set; } = Array.Empty<FooterDto>();
3169
+
3170
+ public HorizontalScrollerDto[] HorizontalScrollers { get; set; } = Array.Empty<HorizontalScrollerDto>();
3171
+
1737
3172
  public KeyfigureDto[] Keyfigures { get; set; } = Array.Empty<KeyfigureDto>();
1738
3173
 
1739
3174
  public CalendarDto Calendar { get; set; } = new();
@@ -1762,10 +3197,34 @@ namespace ScbBlazorDemo
1762
3197
 
1763
3198
  public SearchDto[] Searches { get; set; } = Array.Empty<SearchDto>();
1764
3199
 
3200
+ public DropdownDto[] Dropdowns { get; set; } = Array.Empty<DropdownDto>();
3201
+
3202
+ public SelectDto[] Selects { get; set; } = Array.Empty<SelectDto>();
3203
+
3204
+ public SliderDto[] Sliders { get; set; } = Array.Empty<SliderDto>();
3205
+
3206
+ public DatepickerDto[] Datepickers { get; set; } = Array.Empty<DatepickerDto>();
3207
+
3208
+ public CollapseDto[] Collapses { get; set; } = Array.Empty<CollapseDto>();
3209
+
3210
+ public CookiesConsentDto[] CookiesConsents { get; set; } = Array.Empty<CookiesConsentDto>();
3211
+
1765
3212
  public ListDto[] Lists { get; set; } = Array.Empty<ListDto>();
1766
3213
 
1767
3214
  public LinkDto[] Links { get; set; } = Array.Empty<LinkDto>();
1768
3215
 
3216
+ public AvatarDto[] Avatars { get; set; } = Array.Empty<AvatarDto>();
3217
+
3218
+ public BadgeDto[] Badges { get; set; } = Array.Empty<BadgeDto>();
3219
+
3220
+ public IconButtonDto[] IconButtons { get; set; } = Array.Empty<IconButtonDto>();
3221
+
3222
+ public Dictionary<string, IconButtonDto> IconButtonsById { get; set; } = new();
3223
+
3224
+ public MenuInstanceDto[] Menus { get; set; } = Array.Empty<MenuInstanceDto>();
3225
+
3226
+ public Dictionary<string, MenuInstanceDto> MenusById { get; set; } = new();
3227
+
1769
3228
 
1770
3229
  public NavDto[] Navs { get; set; } = Array.Empty<NavDto>();
1771
3230
 
@@ -1806,6 +3265,81 @@ namespace ScbBlazorDemo
1806
3265
  public bool OpenLeft { get; set; }
1807
3266
  }
1808
3267
 
3268
+ private sealed class OptionsMenuDto
3269
+ {
3270
+ public string? Id { get; set; }
3271
+ public bool Open { get; set; }
3272
+ public string? Spacing { get; set; }
3273
+ public string? SpacingTop { get; set; }
3274
+ public string? SpacingBottom { get; set; }
3275
+ public string? SpacingLeft { get; set; }
3276
+ public string? SpacingRight { get; set; }
3277
+ }
3278
+
3279
+ private sealed class ProgressIndicatorDto
3280
+ {
3281
+ public string? Id { get; set; }
3282
+ public string? Type { get; set; }
3283
+ public double Progress { get; set; }
3284
+ public bool IsStatic { get; set; }
3285
+ public string? Spacing { get; set; }
3286
+ public string? SpacingTop { get; set; }
3287
+ public string? SpacingBottom { get; set; }
3288
+ public string? SpacingLeft { get; set; }
3289
+ public string? SpacingRight { get; set; }
3290
+ }
3291
+
3292
+ private sealed class ProgressStepDto
3293
+ {
3294
+ public string? Id { get; set; }
3295
+ public string? Width { get; set; }
3296
+ public bool Active { get; set; }
3297
+ public bool Disabled { get; set; }
3298
+ public string? Href { get; set; }
3299
+ public string? Label { get; set; }
3300
+ public string? Position { get; set; }
3301
+ }
3302
+
3303
+ private sealed class ProgressStepperDto
3304
+ {
3305
+ public string? Id { get; set; }
3306
+ public double ProgressWidth { get; set; }
3307
+ public string? Height { get; set; }
3308
+ public string? Position { get; set; }
3309
+ public string? Spacing { get; set; }
3310
+ public string? SpacingTop { get; set; }
3311
+ public string? SpacingBottom { get; set; }
3312
+ public string? SpacingLeft { get; set; }
3313
+ public string? SpacingRight { get; set; }
3314
+ public ProgressStepDto[] Steps { get; set; } = Array.Empty<ProgressStepDto>();
3315
+ }
3316
+
3317
+ private sealed class SkeletonDto
3318
+ {
3319
+ public string? Id { get; set; }
3320
+ public string? Variant { get; set; }
3321
+ public string? Width { get; set; }
3322
+ public string? Height { get; set; }
3323
+ public string? BorderSize { get; set; }
3324
+ public string? Spacing { get; set; }
3325
+ public string? SpacingTop { get; set; }
3326
+ public string? SpacingBottom { get; set; }
3327
+ public string? SpacingLeft { get; set; }
3328
+ public string? SpacingRight { get; set; }
3329
+ }
3330
+
3331
+ private sealed class TableAdvancedDto
3332
+ {
3333
+ public string? Id { get; set; }
3334
+ public string? SearchTerm { get; set; }
3335
+ public bool Pagination { get; set; }
3336
+ public bool FilteringSearch { get; set; }
3337
+ public bool NoScroll { get; set; }
3338
+ public int PageSize { get; set; }
3339
+ public int CurrentPage { get; set; }
3340
+ public int TotalRows { get; set; }
3341
+ }
3342
+
1809
3343
  private sealed class BreadcrumbDto
1810
3344
  {
1811
3345
  public bool ShowAll { get; set; }
@@ -1820,7 +3354,7 @@ namespace ScbBlazorDemo
1820
3354
 
1821
3355
  private sealed class AccordionListDto
1822
3356
  {
1823
- public bool Detached { get; set; }
3357
+ public bool SingleOpen { get; set; }
1824
3358
  public AccordionItemDto[] Items { get; set; } = Array.Empty<AccordionItemDto>();
1825
3359
  }
1826
3360
 
@@ -1882,6 +3416,124 @@ namespace ScbBlazorDemo
1882
3416
  public string? Subtitle { get; set; }
1883
3417
  public string? SupportingText { get; set; }
1884
3418
  public string? CardHref { get; set; }
3419
+
3420
+ public string? MediaType { get; set; }
3421
+ public string? MediaHref { get; set; }
3422
+ public string? MediaAlt { get; set; }
3423
+ public string? MediaSrcset { get; set; }
3424
+ public string? MediaSizes { get; set; }
3425
+ public string? MediaLoading { get; set; }
3426
+ public string? MediaDecoding { get; set; }
3427
+ public string? MediaFetchPriority { get; set; }
3428
+ public string? MediaFit { get; set; }
3429
+ public string? MediaPosition { get; set; }
3430
+ public string? MediaWidth { get; set; }
3431
+ public string? MediaHeight { get; set; }
3432
+ public string? MediaAspect { get; set; }
3433
+ public bool MediaPlaceholder { get; set; }
3434
+
3435
+ public string? Date { get; set; }
3436
+
3437
+ public string? CommentsText { get; set; }
3438
+ public int Comments { get; set; }
3439
+ public string? CommentsHref { get; set; }
3440
+
3441
+ public string? LikesText { get; set; }
3442
+ public int Likes { get; set; }
3443
+ public bool HasLiked { get; set; }
3444
+ public bool LikesInteractive { get; set; }
3445
+
3446
+ public bool Author { get; set; }
3447
+ public string? AuthorText { get; set; }
3448
+ public string? AuthorHref { get; set; }
3449
+
3450
+ public string? Sizing { get; set; }
3451
+ public string? Width { get; set; }
3452
+ public string? MaxWidth { get; set; }
3453
+ public string? Height { get; set; }
3454
+ public string? MaxHeight { get; set; }
3455
+
3456
+ public string? Spacing { get; set; }
3457
+ public string? SpacingTop { get; set; }
3458
+ public string? SpacingBottom { get; set; }
3459
+ public string? SpacingLeft { get; set; }
3460
+ public string? SpacingRight { get; set; }
3461
+ }
3462
+
3463
+
3464
+ private sealed class FactCardDto
3465
+ {
3466
+ public string? Id { get; set; }
3467
+ public string? Variant { get; set; }
3468
+ public string? Title { get; set; }
3469
+ public string? Subtitle { get; set; }
3470
+ public string? SupportingText { get; set; }
3471
+ public string? Icon { get; set; }
3472
+ public bool ShowCloseButton { get; set; }
3473
+ public bool Open { get; set; }
3474
+ public string? Sizing { get; set; }
3475
+
3476
+ public string? Width { get; set; }
3477
+ public string? MaxWidth { get; set; }
3478
+ public string? Height { get; set; }
3479
+ public string? MaxHeight { get; set; }
3480
+
3481
+ public string? Spacing { get; set; }
3482
+ public string? SpacingTop { get; set; }
3483
+ public string? SpacingBottom { get; set; }
3484
+ public string? SpacingLeft { get; set; }
3485
+ public string? SpacingRight { get; set; }
3486
+ }
3487
+
3488
+ private sealed class FooterDto
3489
+ {
3490
+ public string? Id { get; set; }
3491
+ public string? MaxWidth { get; set; }
3492
+ public bool DeferPaint { get; set; }
3493
+
3494
+ public string? Spacing { get; set; }
3495
+ public string? SpacingTop { get; set; }
3496
+ public string? SpacingBottom { get; set; }
3497
+
3498
+ public string? Description { get; set; }
3499
+ public FooterSectionDto[]? Sections { get; set; }
3500
+ }
3501
+
3502
+ private sealed class FooterSectionDto
3503
+ {
3504
+ public string? Title { get; set; }
3505
+ public FooterLinkDto[]? Links { get; set; }
3506
+ }
3507
+
3508
+ private sealed class FooterLinkDto
3509
+ {
3510
+ public string? Label { get; set; }
3511
+ public string? Href { get; set; }
3512
+ public string? Target { get; set; }
3513
+ }
3514
+
3515
+ private sealed class HorizontalScrollerDto
3516
+ {
3517
+ public string? Id { get; set; }
3518
+ public string? Variant { get; set; }
3519
+ public string? Width { get; set; }
3520
+
3521
+ public bool ShowScrollbar { get; set; }
3522
+ public string? RightScrollButtonLabel { get; set; }
3523
+ public string? LeftScrollButtonLabel { get; set; }
3524
+
3525
+ public bool ContentFlex { get; set; }
3526
+ public string? InternalGap { get; set; }
3527
+
3528
+ public string? Spacing { get; set; }
3529
+ public string? SpacingTop { get; set; }
3530
+ public string? SpacingBottom { get; set; }
3531
+ public string? SpacingLeft { get; set; }
3532
+ public string? SpacingRight { get; set; }
3533
+
3534
+ public double ScrollLeft { get; set; }
3535
+ public bool CanScrollLeft { get; set; }
3536
+ public bool CanScrollRight { get; set; }
1885
3537
  }
1886
3538
 
1887
3539
  private sealed class KeyfigureDto
@@ -2000,6 +3652,67 @@ namespace ScbBlazorDemo
2000
3652
  public string? Id { get; set; }
2001
3653
  }
2002
3654
 
3655
+ private sealed class DropdownDto
3656
+ {
3657
+ public string? Id { get; set; }
3658
+ public string? Label { get; set; }
3659
+ public string? Variant { get; set; }
3660
+ public string? Size { get; set; }
3661
+ public bool Open { get; set; }
3662
+ public bool Disabled { get; set; }
3663
+ }
3664
+
3665
+ private sealed class SelectDto
3666
+ {
3667
+ public string? Id { get; set; }
3668
+ public string? Variant { get; set; }
3669
+ public bool Open { get; set; }
3670
+ public string? Value { get; set; }
3671
+ public string[]? Values { get; set; }
3672
+ public bool Disabled { get; set; }
3673
+ }
3674
+
3675
+ private sealed class SliderDto
3676
+ {
3677
+ public string? Id { get; set; }
3678
+ public bool Range { get; set; }
3679
+ public double Value { get; set; }
3680
+ public double ValueStart { get; set; }
3681
+ public double ValueEnd { get; set; }
3682
+ public double Min { get; set; }
3683
+ public double Max { get; set; }
3684
+ public double Step { get; set; }
3685
+ public bool Disabled { get; set; }
3686
+ }
3687
+
3688
+ private sealed class DatepickerDto
3689
+ {
3690
+ public string? Id { get; set; }
3691
+ public bool Open { get; set; }
3692
+ public string? SelectedValue { get; set; }
3693
+ public string? Variant { get; set; }
3694
+ public string? Lang { get; set; }
3695
+ }
3696
+
3697
+ private sealed class CollapseDto
3698
+ {
3699
+ public string? Id { get; set; }
3700
+ public string? Variant { get; set; }
3701
+ public bool Expanded { get; set; }
3702
+ public int CollapsedHeight { get; set; }
3703
+ public int VisibleElements { get; set; }
3704
+ public string? ExpandButtonLabel { get; set; }
3705
+ public string? CollapseButtonLabel { get; set; }
3706
+ }
3707
+
3708
+ private sealed class CookiesConsentDto
3709
+ {
3710
+ public string? Id { get; set; }
3711
+ public bool Open { get; set; }
3712
+ public string? Title { get; set; }
3713
+ public string? SupportingText { get; set; }
3714
+ }
3715
+
2003
3716
  private sealed class ListDto
2004
3717
  {
2005
3718
  public bool NoDivider { get; set; }
@@ -2058,6 +3771,87 @@ namespace ScbBlazorDemo
2058
3771
  public string? ContentPadding { get; set; }
2059
3772
  }
2060
3773
 
3774
+
3775
+ private sealed class AvatarDto
3776
+ {
3777
+ public string? Src { get; set; }
3778
+ public string? Alt { get; set; }
3779
+ public string? Label { get; set; }
3780
+ public string? Size { get; set; }
3781
+ public string? Shape { get; set; }
3782
+ public string? IconName { get; set; }
3783
+ public string? Variant { get; set; }
3784
+
3785
+ public string? Spacing { get; set; }
3786
+ public string? SpacingTop { get; set; }
3787
+ public string? SpacingBottom { get; set; }
3788
+ public string? SpacingLeft { get; set; }
3789
+ public string? SpacingRight { get; set; }
3790
+ }
3791
+
3792
+ private sealed class BadgeDto
3793
+ {
3794
+ public bool AutoHide { get; set; }
3795
+ public bool Hidden { get; set; }
3796
+
3797
+ public string? Sizing { get; set; }
3798
+ public string? Position { get; set; }
3799
+ public string? PositionSide { get; set; }
3800
+ public string? PositionTop { get; set; }
3801
+ public string? PositionRight { get; set; }
3802
+ public string? PositionLeft { get; set; }
3803
+
3804
+ public string? Value { get; set; }
3805
+ public string? Label { get; set; }
3806
+ public string? Variant { get; set; }
3807
+ }
3808
+
3809
+ private sealed class IconButtonDto
3810
+ {
3811
+ public string? Id { get; set; }
3812
+ public string? Icon { get; set; }
3813
+
3814
+ public bool Toggle { get; set; }
3815
+ public bool Selected { get; set; }
3816
+ public bool Disabled { get; set; }
3817
+
3818
+ public string? AriaLabel { get; set; }
3819
+
3820
+ public string? Href { get; set; }
3821
+ public string? Target { get; set; }
3822
+ public string? Rel { get; set; }
3823
+ }
3824
+
3825
+ private sealed class MenuInstanceDto
3826
+ {
3827
+ public string? Id { get; set; }
3828
+ public string? Label { get; set; }
3829
+ public string? SubLabel { get; set; }
3830
+
3831
+ public bool NoHighlightSelected { get; set; }
3832
+
3833
+ public MenuSelectedItemDto? Selected { get; set; }
3834
+
3835
+ public MenuExpandedItemDto[] Expanded { get; set; } = Array.Empty<MenuExpandedItemDto>();
3836
+ }
3837
+
3838
+ private sealed class MenuSelectedItemDto
3839
+ {
3840
+ public string? Label { get; set; }
3841
+ public string? ItemHref { get; set; }
3842
+ public string? LeadingIcon { get; set; }
3843
+ public string? Path { get; set; }
3844
+ }
3845
+
3846
+ private sealed class MenuExpandedItemDto
3847
+ {
3848
+ public string? Label { get; set; }
3849
+ public string? ItemHref { get; set; }
3850
+ public string? Path { get; set; }
3851
+ }
3852
+
3853
+
3854
+
2061
3855
  private sealed class NavDto
2062
3856
  {
2063
3857
  public string? Id { get; set; }
@@ -2100,4 +3894,4 @@ namespace ScbBlazorDemo
2100
3894
  public string? SelectedChip { get; set; }
2101
3895
  }
2102
3896
  }
2103
- }
3897
+ }