Grille_Inventaire #9

Merged
louis.dufour merged 4 commits from Grille_Inventaire into master 2 years ago

@ -1,7 +0,0 @@
<h3>Card</h3>
@typeparam TItem
<div class="card text-center">
@CardHeader(Item)
@CardBody(Item)
@CardFooter
</div>

@ -1,19 +0,0 @@
using Microsoft.AspNetCore.Components;
namespace ValblazeProject.Components
{
public partial class Card<TItem>
{
[Parameter]
public RenderFragment<TItem> CardBody { get; set; }
[Parameter]
public RenderFragment CardFooter { get; set; }
[Parameter]
public RenderFragment<TItem> CardHeader { get; set; }
[Parameter]
public TItem Item { get; set; }
}
}

@ -1,6 +1,7 @@
using Blazorise; using Blazorise;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using ValblazeProject.Models; using ValblazeProject.Models;
using ValblazeProject.Pages;
namespace ValblazeProject.Components namespace ValblazeProject.Components
{ {
@ -16,7 +17,8 @@ namespace ValblazeProject.Components
public bool NoDrop { get; set; } public bool NoDrop { get; set; }
[CascadingParameter] [CascadingParameter]
public Crafting Parent { get; set; } public Inventaire Parent { get; set; }
//public Crafting Parent { get; set; }
internal void OnDragEnter() internal void OnDragEnter()
{ {
@ -46,15 +48,15 @@ namespace ValblazeProject.Components
} }
this.Item = Parent.CurrentDragItem; this.Item = Parent.CurrentDragItem;
Parent.RecipeItems[this.Index] = this.Item; //Parent.RecipeItems[this.Index] = this.Item;
Parent.Actions.Add(new CraftingAction { Action = "Drop", Item = this.Item, Index = this.Index }); Parent.Actions.Add(new CraftingAction { Action = "Drop", Item = this.Item, Index = this.Index });
// Check recipe // Check recipe
Parent.CheckRecipe(); //Parent.CheckRecipe();
} }
private void OnDragStart() internal void OnDragStart()
{ {
Parent.CurrentDragItem = this.Item; Parent.CurrentDragItem = this.Item;

@ -1,4 +1,6 @@
.item { .item {
display: flex;
justify-content: center;
width: 64px; width: 64px;
height: 64px; height: 64px;
border: 1px solid; border: 1px solid;

@ -1,6 +0,0 @@
namespace ValblazeProject.Components
{
public class InventaireAction
{
}
}

@ -1,13 +0,0 @@
namespace ValblazeProject.Data
{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}
}

@ -1,20 +0,0 @@
namespace ValblazeProject.Data
{
public class WeatherForecastService
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
public Task<WeatherForecast[]> GetForecastAsync(DateTime startDate)
{
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = startDate.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
}).ToArray());
}
}
}

@ -1,9 +0,0 @@
namespace ValblazeProject.Models
{
public class Cake
{
public int Id { get; set; }
public string Name { get; set; }
public decimal Cost { get; set; }
}
}

@ -1,28 +0,0 @@
@page "/example-tab-set"
<TabSet>
<Tab Title="First tab">
<h4>Greetings from the first tab!</h4>
<label>
<input type="checkbox" @bind="showThirdTab" />
Toggle third tab
</label>
</Tab>
<Tab Title="Second tab">
<h4>Hello from the second tab!</h4>
</Tab>
@if (showThirdTab)
{
<Tab Title="Third tab">
<h4>Welcome to the disappearing third tab!</h4>
<p>Toggle this tab from the first tab.</p>
</Tab>
}
</TabSet>
@code {
private bool showThirdTab;
}

@ -15,20 +15,3 @@ Welcome to your new app.
</p> </p>
<SurveyPrompt Title="How is Blazor working for you?" /> <SurveyPrompt Title="How is Blazor working for you?" />
<ShowItems Items="Cakes" >
<ShowTemplate Context="CakeContext">
<div class="card text-center">
<div class="card-header">
Cake Token Id - @CakeContext.Id
</div>
<div class="card-body">
<h5 class="card-title">@CakeContext.Name</h5>
<p class="card-text">Price $@CakeContext.Cost</p>
</div>
<div class="card-footer text-muted">
Click Here
</div>
</div>
</ShowTemplate>
</ShowItems>

@ -7,8 +7,6 @@ namespace ValblazeProject.Pages
{ {
public partial class Index public partial class Index
{ {
public List<Cake> Cakes { get; set; }
[Inject] [Inject]
public IDataService DataService { get; set; } public IDataService DataService { get; set; }

@ -1,4 +1,4 @@
@page "/invetaire" @page "/Inventaire"
@using System.Globalization @using System.Globalization
@using ValblazeProject.Components @using ValblazeProject.Components
@using ValblazeProject.Models @using ValblazeProject.Models
@ -8,49 +8,67 @@
<main class="contentInvent"> <main class="contentInvent">
<div class="inventaire"> <div class="inventaire">
<h3>Inventaire</h3> <h3>@Localizer["Inventaire"]</h3>
<div class="caseInvent"> <div class="caseInvent">
@for(int i=0; i<10; i++){ @for(int i=0; i<10; i++){
<CraftingItem Index="i"/> <CraftingItem Index="i"/>
} }
</div> </div>
<label class="mt-2">Actions</label>
<div class="actions" id="actions"></div>
</div> </div>
<div class="maList"> <div class="maList">
<div class="toolSearch"> <div class="toolSearch">
<label> <label>
Recherche: @Localizer["Recherche"]
<input type="text" @bind-value="search"/> <input type="text" @bind-value="search"/>
</label> </label>
<label class="LabelFiltre"> <label class="LabelFiltre">
Trie: @Localizer["Trie"]
<input class="filtre" @bind-value="trieActive" onclick="@TrieChanged" type="checkbox"> <input class="filtre" @bind-value="trieActive" onclick="@TrieChanged" type="checkbox">
</label> </label>
</div> </div>
<DataGrid TItem="Item" <DataGrid TItem="Item"
Data="@items" Data="@items"
ReadData="@OnReadData" ReadData="@OnReadData"
TotalItems="@totalItem" TotalItems="@totalItem"
PageSize="@totalSizeByPage" PageSize="@totalSizeByPage"
@ref="dataGrid" @ref="dataGrid"
ShowPager ShowPager
Responsive> Responsive>
<DataGridColumn TItem="Item" Field="@nameof(Item.Id)" Caption=""> <DataGridColumn TItem="Item" Field="@nameof(Item.Id)">
<DisplayTemplate> <DisplayTemplate>
@if (!string.IsNullOrWhiteSpace(context.ImageBase64)) @if (!string.IsNullOrWhiteSpace(context.ImageBase64))
{ {
<div
class="item"
ondragover="event.preventDefault();"
draggable="true"
@ondragstart="@OnDragStart"
@ondrop="@OnDrop"
@ondragenter="@OnDragEnter"
@ondragleave="@OnDragLeave">
@if (context != null)
{
//<img src="data:image/png;base64, @(Item.ImageBase64)" class="img-thumbnail" title="@Item.DisplayName" alt="@Item.DisplayName" style="min-width: 50px; max-width: 100px" />
<img src="data:image/png;base64, @(context.ImageBase64)" class="img-thumbnail" title="@context.DisplayName" alt="@context.DisplayName" style="min-width: 50px; max-width: 50px" /> <img src="data:image/png;base64, @(context.ImageBase64)" class="img-thumbnail" title="@context.DisplayName" alt="@context.DisplayName" style="min-width: 50px; max-width: 50px" />
} }
</div>
//<img src="data:image/png;base64, @(context.ImageBase64)" class="img-thumbnail" title="@context.DisplayName" alt="@context.DisplayName" style="min-width: 50px; max-width: 50px" />
//<label>@context.DisplayName</label>
}
else else
{ {
<img src="images/default.png" class="img-thumbnail" title="@context.DisplayName" alt="@context.DisplayName" style="max-width: 50px" /> <img src="images/default.png" class="img-thumbnail" title="@context.DisplayName" alt="@context.DisplayName" style="max-width: 50px" />
} }
</DisplayTemplate> </DisplayTemplate>
</DataGridColumn> </DataGridColumn>
<DataGridColumn TItem="Item" Field="@nameof(Item.DisplayName)" Caption="" /> <DataGridColumn TItem="Item" Field="@nameof(Item.DisplayName)"/>
</DataGrid> </DataGrid>
</div> </div>
</main> </main>

@ -12,6 +12,9 @@ using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
using Microsoft.AspNetCore.Components.Forms; using Microsoft.AspNetCore.Components.Forms;
using System.Linq; using System.Linq;
using Microsoft.JSInterop;
using System.Collections.Specialized;
using Microsoft.AspNetCore.Components.Web;
namespace ValblazeProject.Pages namespace ValblazeProject.Pages
{ {
@ -33,7 +36,11 @@ namespace ValblazeProject.Pages
[Inject] [Inject]
public NavigationManager NavigationManager { get; set; } public NavigationManager NavigationManager { get; set; }
private List<CraftingRecipe> Recipes { get; set; } = new List<CraftingRecipe>(); /// <summary>
/// Gets or sets the java script runtime.
/// </summary>
[Inject]
internal IJSRuntime JavaScriptRuntime { get; set; }
[CascadingParameter] [CascadingParameter]
public IModalService Modal { get; set; } public IModalService Modal { get; set; }
@ -44,6 +51,43 @@ namespace ValblazeProject.Pages
private bool _trie = false; private bool _trie = false;
// Autre
public ObservableCollection<CraftingAction> Actions { get; set; }
public Item CurrentDragItem { get; set; }
public Inventaire()
{
Actions = new ObservableCollection<CraftingAction>();
Actions.CollectionChanged += OnActionsCollectionChanged;
}
private void OnActionsCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
{
JavaScriptRuntime.InvokeVoidAsync("Inventaire.AddActions", e.NewItems);
}
// Drag
private CraftingItem Drag;
public void OnDragEnter()
{
Drag.OnDragEnter();
}
public void OnDragStart()
{
Drag.OnDragStart();
}
public void OnDrop()
{
Drag.OnDrop();
}
public void OnDragLeave()
{
Drag.OnDragLeave();
}
/******************* Attribut modifier *******************/ /******************* Attribut modifier *******************/
private string search private string search
{ {
@ -115,12 +159,10 @@ namespace ValblazeProject.Pages
*/ */
items = await DataService.List(); items = await DataService.List();
//totalItem = items.Count();
// Search // Search
if (!string.IsNullOrEmpty(_searchText)) if (!string.IsNullOrEmpty(_searchText))
{ {
//await OnSearch();
items = items.Where(i => i.DisplayName.Contains(_searchText)).ToList(); items = items.Where(i => i.DisplayName.Contains(_searchText)).ToList();
} }
@ -128,7 +170,6 @@ namespace ValblazeProject.Pages
if (_trie) if (_trie)
{ {
items = items.OrderBy(i => i.DisplayName).ToList(); items = items.OrderBy(i => i.DisplayName).ToList();
//await SortByName();
} }
// Gestion pagination // Gestion pagination
@ -139,7 +180,7 @@ namespace ValblazeProject.Pages
} }
} }
private async void OnDelete(int id) /* private async void OnDelete(int id)
{ {
var parameters = new ModalParameters(); var parameters = new ModalParameters();
parameters.Add(nameof(Item.Id), id); parameters.Add(nameof(Item.Id), id);
@ -156,6 +197,6 @@ namespace ValblazeProject.Pages
// Reload the page // Reload the page
NavigationManager.NavigateTo("list", true); NavigationManager.NavigateTo("list", true);
} }*/
} }
} }

@ -29,3 +29,19 @@
width: 42px; width: 42px;
height: 32px; height: 32px;
} }
.actions {
border: 1px solid black;
height: 250px;
overflow: scroll;
margin-right: 20px;
}
.item {
display: flex;
justify-content: center;
width: 64px;
height: 64px;
border: 1px solid;
overflow: hidden;
}

@ -0,0 +1,16 @@
window.Crafting =
{
AddActions: function (data) {
data.forEach(element => {
var div = document.createElement('div');
div.innerHTML = 'Action: ' + element.action + ' - Index: ' + element.index;
if (element.item) {
div.innerHTML += ' - Item Name: ' + element.item.name;
}
document.getElementById('actions').appendChild(div);
});
}
}

@ -2,7 +2,6 @@
@using System.Globalization @using System.Globalization
@using ValblazeProject.Components @using ValblazeProject.Components
@using ValblazeProject.Models @using ValblazeProject.Models
@using ValblazeProject.Models
<h3>@Localizer["Title"]</h3> <h3>@Localizer["Title"]</h3>

@ -4,7 +4,6 @@ using Blazorise.Bootstrap;
using Blazorise.Icons.FontAwesome; using Blazorise.Icons.FontAwesome;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.Web;
using ValblazeProject.Data;
using ValblazeProject.Services; using ValblazeProject.Services;
using Blazored.Modal; using Blazored.Modal;
using Microsoft.AspNetCore.Localization; using Microsoft.AspNetCore.Localization;
@ -20,9 +19,7 @@ builder.Services.AddScoped<IDataService, DataApiService>(); // API ici
builder.Services.AddRazorPages(); builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor(); builder.Services.AddServerSideBlazor();
builder.Services.AddSingleton<WeatherForecastService>();
builder.Services.AddSingleton<WeatherForecastService>();
builder.Services.AddHttpClient(); builder.Services.AddHttpClient();
builder.Services builder.Services

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Inventaire" xml:space="preserve">
<value>Inventaire</value>
</data>
<data name="Recherche" xml:space="preserve">
<value>Recherche</value>
</data>
<data name="Trie" xml:space="preserve">
<value>Trie</value>
</data>
</root>

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Inventaire" xml:space="preserve">
<value>Inventory</value>
</data>
<data name="Recherche" xml:space="preserve">
<value>Search:</value>
</data>
<data name="Trie" xml:space="preserve">
<value>Sort:</value>
</data>
</root>

@ -23,7 +23,7 @@
</NavLink> </NavLink>
</div> </div>
<div class="nav-item px-3"> <div class="nav-item px-3">
<NavLink class="nav-link" href="invetaire"> <NavLink class="nav-link" href="Inventaire">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-boxes" viewBox="0 0 16 16" style="margin-right: 15px;"> <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-boxes" viewBox="0 0 16 16" style="margin-right: 15px;">
<path d="M7.752.066a.5.5 0 0 1 .496 0l3.75 2.143a.5.5 0 0 1 .252.434v3.995l3.498 2A.5.5 0 0 1 16 9.07v4.286a.5.5 0 0 1-.252.434l-3.75 2.143a.5.5 0 0 1-.496 0l-3.502-2-3.502 2.001a.5.5 0 0 1-.496 0l-3.75-2.143A.5.5 0 0 1 0 13.357V9.071a.5.5 0 0 1 .252-.434L3.75 6.638V2.643a.5.5 0 0 1 .252-.434L7.752.066ZM4.25 7.504 1.508 9.071l2.742 1.567 2.742-1.567L4.25 7.504ZM7.5 9.933l-2.75 1.571v3.134l2.75-1.571V9.933Zm1 3.134 2.75 1.571v-3.134L8.5 9.933v3.134Zm.508-3.996 2.742 1.567 2.742-1.567-2.742-1.567-2.742 1.567Zm2.242-2.433V3.504L8.5 5.076V8.21l2.75-1.572ZM7.5 8.21V5.076L4.75 3.504v3.134L7.5 8.21ZM5.258 2.643 8 4.21l2.742-1.567L8 1.076 5.258 2.643ZM15 9.933l-2.75 1.571v3.134L15 13.067V9.933ZM3.75 14.638v-3.134L1 9.933v3.134l2.75 1.571Z" /> <path d="M7.752.066a.5.5 0 0 1 .496 0l3.75 2.143a.5.5 0 0 1 .252.434v3.995l3.498 2A.5.5 0 0 1 16 9.07v4.286a.5.5 0 0 1-.252.434l-3.75 2.143a.5.5 0 0 1-.496 0l-3.502-2-3.502 2.001a.5.5 0 0 1-.496 0l-3.75-2.143A.5.5 0 0 1 0 13.357V9.071a.5.5 0 0 1 .252-.434L3.75 6.638V2.643a.5.5 0 0 1 .252-.434L7.752.066ZM4.25 7.504 1.508 9.071l2.742 1.567 2.742-1.567L4.25 7.504ZM7.5 9.933l-2.75 1.571v3.134l2.75-1.571V9.933Zm1 3.134 2.75 1.571v-3.134L8.5 9.933v3.134Zm.508-3.996 2.742 1.567 2.742-1.567-2.742-1.567-2.742 1.567Zm2.242-2.433V3.504L8.5 5.076V8.21l2.75-1.572ZM7.5 8.21V5.076L4.75 3.504v3.134L7.5 8.21ZM5.258 2.643 8 4.21l2.742-1.567L8 1.076 5.258 2.643ZM15 9.933l-2.75 1.571v3.134L15 13.067V9.933ZM3.75 14.638v-3.134L1 9.933v3.134l2.75 1.571Z" />
</svg> </svg>

@ -1,16 +0,0 @@
<div class="alert alert-secondary mt-4">
<span class="oi oi-pencil me-2" aria-hidden="true"></span>
<strong>@Title</strong>
<span class="text-nowrap">
Please take our
<a target="_blank" class="font-weight-bold link-dark" href="https://go.microsoft.com/fwlink/?linkid=2149017">brief survey</a>
</span>
and tell us what you think.
</div>
@code {
// Demonstrates how a parent component can supply parameters
[Parameter]
public string? Title { get; set; }
}

@ -1,32 +0,0 @@
@using ValblazeProject.UIInterfaces
@implements ITab
<li>
<a @onclick="ActivateTab" class="nav-link @TitleCssClass" role="button">
@Title
</a>
</li>
@code {
[CascadingParameter]
public TabSet ContainerTabSet { get; set; }
[Parameter]
public string Title { get; set; }
[Parameter]
public RenderFragment ChildContent { get; set; }
private string TitleCssClass =>
ContainerTabSet.ActiveTab == this ? "active" : null;
protected override void OnInitialized()
{
ContainerTabSet.AddTab(this);
}
private void ActivateTab()
{
ContainerTabSet.SetActiveTab(this);
}
}

@ -1,39 +0,0 @@
@using ValblazeProject.UIInterfaces
<!-- Display the tab headers -->
<CascadingValue Value=this>
<ul class="nav nav-tabs">
@ChildContent
</ul>
</CascadingValue>
<!-- Display body for only the active tab -->
<div class="nav-tabs-body p-4">
@ActiveTab?.ChildContent
</div>
@code {
[Parameter]
public RenderFragment ChildContent { get; set; }
public ITab ActiveTab { get; private set; }
public void AddTab(ITab tab)
{
if (ActiveTab == null)
{
SetActiveTab(tab);
}
}
public void SetActiveTab(ITab tab)
{
if (ActiveTab != tab)
{
ActiveTab = tab;
StateHasChanged();
}
}
}

@ -1,28 +0,0 @@
@typeparam TItem
@using System.Diagnostics.CodeAnalysis
<table class="table">
<thead>
<tr>@TableHeader</tr>
</thead>
<tbody>
@foreach (var item in Items)
{
if (RowTemplate is not null)
{
<tr>@RowTemplate(item)</tr>
}
}
</tbody>
</table>
@code {
[Parameter]
public RenderFragment? TableHeader { get; set; }
[Parameter]
public RenderFragment<TItem>? RowTemplate { get; set; }
[Parameter, AllowNull]
public IReadOnlyList<TItem> Items { get; set; }
}

@ -1,9 +0,0 @@
using Microsoft.AspNetCore.Components;
namespace ValblazeProject.UIInterfaces
{
public interface ITab
{
RenderFragment ChildContent { get; }
}
}

@ -9,11 +9,13 @@
<ItemGroup> <ItemGroup>
<None Remove="Components\Crafting.razor.css" /> <None Remove="Components\Crafting.razor.css" />
<None Remove="Components\Crafting.razor.js" /> <None Remove="Components\Crafting.razor.js" />
<None Remove="Pages\Inventaire.razor.js" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Components\Crafting.razor.css" /> <Content Include="Components\Crafting.razor.css" />
<Content Include="Components\Crafting.razor.js" /> <Content Include="Components\Crafting.razor.js" />
<Content Include="Pages\Inventaire.razor.js" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -33,6 +35,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Update="Resources\Pages.Inventaire.fr-FR.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Resources\Pages.Inventaire.resx">
<Generator></Generator>
</EmbeddedResource>
<EmbeddedResource Update="Resources\Pages.List.fr-FR.resx"> <EmbeddedResource Update="Resources\Pages.List.fr-FR.resx">
<Generator>PublicResXFileCodeGenerator</Generator> <Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>

Loading…
Cancel
Save