Skip to content

Commit 190c45c

Browse files
committed
new AdvSearch
1 parent b1acefa commit 190c45c

File tree

56 files changed

+727
-189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+727
-189
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.idea
2+
node_modules
3+
*.lck
4+
bin/
5+
obj/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"id":"quer-oj6llw0kkng25","modelId":"nwind","name":"Empolyee of the year copy 1","cols":[{"id":"col-6bg4sbcofdzi","cptn":"First name","srt":0,"expr":{"tag":2,"dtype":1,"kind":2,"val":"Employee.FirstName"}},{"id":"col-q2g4sbcofjcz","cptn":"Last name","srt":0,"expr":{"tag":2,"dtype":1,"kind":2,"val":"Employee.LastName"}},{"id":"col-erg4sbcofok4","cptn":"Title","srt":0,"expr":{"tag":2,"dtype":1,"kind":2,"val":"Employee.Title"}},{"id":"col-jcg4sbcofrca","cptn":"Home phone","srt":0,"expr":{"tag":2,"dtype":1,"kind":2,"val":"Employee.HomePhone"}},{"id":"col-05g4sbcofu6s","cptn":"Unit price Sum","srt":2,"srtidx":0,"expr":{"tag":4,"dtype":8,"kind":0,"func":"SUM","distinct":false,"args":[{"tag":2,"dtype":8,"kind":2,"val":"OrderDetail.UnitPrice"}]}}],"justsortcols":[],"root":{"linking":3,"conds":[{"tag":1,"op":"DateWithinThisYear","exprs":[{"tag":2,"dtype":12,"kind":2,"val":"Order.OrderDate"}]},{"tag":1,"op":"Equal","exprs":[{"tag":2,"dtype":1,"kind":2,"val":"Customer.Country"},{"tag":1,"dtype":1,"kind":0,"val":"USA","txt":"USA"}]}]},"extraData":{},"innerData":{"aggr":{"groups":[],"ugt":false,"urc":false,"csg":false,"aggregates":[],"enabled":false}}}

AspNetCore/Razor-Mvc/Razor.AdvancedSearch/EqDemo.AspNetCoreRazor.AdvancedSearch.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
<PackageReference Include="Korzh.DbUtils.SqlServer" Version="1.4.1" />
2020
</ItemGroup>
2121
<ItemGroup>
22-
<PackageReference Include="EasyData.Exporters.ClosedXML" Version="1.5.9" />
23-
<PackageReference Include="EasyData.Exporters.PdfSharp" Version="1.5.9" />
22+
<PackageReference Include="EasyData.Exporters.ClosedXML" Version="1.5.8" />
23+
<PackageReference Include="EasyData.Exporters.PdfSharp" Version="1.5.8" />
2424
</ItemGroup>
2525
<ItemGroup>
26-
<PackageReference Include="Korzh.EasyQuery.AspNetCore" Version="7.4.0" />
27-
<PackageReference Include="Korzh.EasyQuery.DataExport" Version="7.4.0" />
28-
<PackageReference Include="Korzh.EasyQuery.EntityFrameworkCore.Relational" Version="7.4.0" />
29-
<PackageReference Include="Korzh.EasyQuery.RazorUI" Version="7.4.0" />
30-
<PackageReference Include="Korzh.EasyQuery.SqLiteGate" Version="7.4.0" />
31-
<PackageReference Include="Korzh.EasyQuery.SqlServerGate" Version="7.4.0" />
26+
<PackageReference Include="Korzh.EasyQuery.AspNetCore" Version="7.4.0-rc04" />
27+
<PackageReference Include="Korzh.EasyQuery.DataExport" Version="7.4.0-rc04" />
28+
<PackageReference Include="Korzh.EasyQuery.EntityFrameworkCore.Relational" Version="7.4.0-rc04" />
29+
<PackageReference Include="Korzh.EasyQuery.RazorUI" Version="7.4.0-rc04" />
30+
<PackageReference Include="Korzh.EasyQuery.SqLiteGate" Version="7.4.0-rc04" />
31+
<PackageReference Include="Korzh.EasyQuery.SqlServerGate" Version="7.4.0-rc04" />
3232
</ItemGroup>
3333
<ItemGroup>
3434
<Content Update="wwwroot\css\site.css">
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
4+
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
5+
</PropertyGroup>
6+
<PropertyGroup>
7+
<ActiveDebugProfile>EqDemo.AspNetCoreRazor.AdvancedSearch</ActiveDebugProfile>
8+
</PropertyGroup>
9+
</Project>

AspNetCore/Razor-Mvc/Razor.AdvancedSearch/Pages/Index.cshtml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@
1717
<div class="easyquery-container">
1818
<div class="entities-panel">
1919
<div class="widget">
20-
<div class="widget-title">Entities</div>
20+
<div class="widget-title">
21+
Entities
22+
<div class="toolbar" style="margin-left: auto;">
23+
<button class="tool-button thin-button" onclick="document.body.classList.add('no-entities')">
24+
<img class="icon close-panel" src="~/images/close.svg" alt=""/>
25+
</button>
26+
</div>
27+
</div>
2128
<div class="widget-content">
2229
<div id="EntitiesPanel"></div>
2330
</div>
@@ -49,7 +56,7 @@
4956
</span>
5057
</div>
5158
Result
52-
<div class="toolbar eqv-export-buttons">
59+
<div class="toolbar export-toolbar eqv-export-buttons">
5360
Export:
5461
<a class="eqjs-export tool-button" href="javascript:void(0)" data-format="pdf">
5562
<img class="icon" src="~/images/pdf.svg" alt=""/>
@@ -73,9 +80,14 @@
7380
<!-- EasyQuery scripts -->
7481
<script src="https://cdn.korzh.com/eq/7.4.0/eq.enterprise.min.js"></script>
7582
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
83+
<script>
84+
Chart.defaults.animation = false;
85+
</script>
7686

7787
<script>
7888
window.addEventListener('DOMContentLoaded', function () {
89+
const showPanelButtons = false
90+
7991
// Initialize the EasyQuery application
8092
const viewOptions = {
8193
//Load model on start
@@ -104,6 +116,20 @@
104116
console.log('Inside list request handler')
105117
},
106118
},
119+
120+
widgets: {
121+
columnsPanel: {
122+
alwaysShowButtons: showPanelButtons,
123+
},
124+
entitiesPanel: {
125+
126+
},
127+
queryPanel: {
128+
alwaysShowButtonsInGroups: showPanelButtons,
129+
alwaysShowButtonsInConditions: showPanelButtons,
130+
}
131+
},
132+
107133
result: {
108134
//Show EasyChart
109135
showChart: true,
@@ -119,6 +145,15 @@
119145
view.init(viewOptions)
120146
})
121147
148+
context.addEventListener('ready', () => {
149+
console.log('EasyQuery is ready')
150+
})
151+
152+
context.addEventListener('syncQuery', ()=> {
153+
const qn = document.getElementById('query-name')
154+
qn.innerHTML = context.query.getName()
155+
})
156+
122157
document['AdvancedSearchView'] = view
123158
124159
const execButton = document.getElementById('ExecQueryButton')

AspNetCore/Razor-Mvc/Razor.AdvancedSearch/Pages/Shared/_Layout.cshtml

Lines changed: 83 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,29 @@
88
<title>@(ViewData["IsIndexPage"] == null ? @ViewData["Title"] + " - " : "")EasyQuery library samples</title>
99

1010
<link rel="stylesheet" href="~/css/index.css"/>
11+
<link rel="stylesheet" href="~/css/layout.css"/>
1112

1213
@RenderSection("Styles", required: false)
1314
</head>
1415
<body>
1516

1617
<header id="app-bar">
17-
<div class="app-title">Advanced Search v2.0</div>
18+
<div class="app-title">
19+
<button id="showSidebarButton" class="transform-button" onclick="toggleSidebar()"><span></span></button>
20+
Advanced Search Demo
21+
</div>
1822
<div class="toolbar main-toolbar">
23+
<div class="toolbar-group">
24+
<button id="ShowEntitiesButton" class="tool-button" title="Show Entities Panel" aria-label="Show Entities Panel" onclick="document.body.classList.remove('no-entities')">
25+
<img class="icon" src="~/images/tree-view.svg" alt="Show Entities Panel"/>
26+
</button>
27+
</div>
1928
<div class="toolbar-group">
2029
<button class="tool-button" id="NewQueryButton" title="New Query" aria-label="New Query">
2130
<img class="icon" src="~/images/new.svg" alt="New Query"/>
2231
</button>
23-
<button class="tool-button" id="LoadQueryButton" title="Load Query From Storage" aria-label="Load Query From Storage">
24-
<img class="icon" src="~/images/load.svg" alt="Load Query"/>
32+
<button class="tool-button" id="LoadQueryButton" title="Open Query From Storage" aria-label="Open Query From Storage">
33+
<img class="icon" src="~/images/open.svg" alt="Open Query"/>
2534
</button>
2635
<button class="tool-button" id="ClearQueryButton" title="Clear Query" aria-label="Clear Query">
2736
<img class="icon" src="~/images/clear.svg" alt="Clear Query"/>
@@ -39,50 +48,106 @@
3948
</button>
4049
</div>
4150
<div class="toolbar-group">
42-
<button class="tool-button" id="ExecQueryButton" title="Execute Query" aria-label="Execute Query">
43-
<img class="icon" src="~/images/run.svg" alt="Execute Query"/>
51+
<button class="tool-button" id="ExecQueryButton" title="Fetch Data" aria-label="Fetch Data">
52+
<img class="icon" src="~/images/run.svg" alt="Fetch Data"/>
4453
</button>
4554
</div>
4655
</div>
4756
<div class="query-name">
48-
[ <div id="query-name">New Query</div> ]
57+
<div id="query-name">New Query</div>
4958
</div>
5059
</header>
5160

5261
<aside id="sidebar">
5362
<div class="logo">
63+
<button class="close-sidebar-btn" onclick="toggleSidebar()">&times;</button>
5464
<img src="~/images/search-list.svg" alt="logo"/>
5565
</div>
5666
<button type="button" class="btn-toggle-sidebar" onclick="document.body.classList.toggle('sb-expand');">
57-
<span class="icon">&#9776;</span>
67+
<span class="icon"></span>
5868
</button>
5969

6070
<ul class="sidebar-menu">
61-
<li title="Dashboard"><a href="/">
71+
<li title="New Query" id="new-query-menu-item" class="command-item">
72+
<a href="#" onclick="clickButton('NewQueryButton')" class="no-wrap">
73+
<span class="icon"><img src="~/images/new-light.svg" alt="new image"/></span>
74+
<span class="caption">New Query</span>
75+
</a>
76+
</li>
77+
<li title="Load Query" id="load-query-menu-item" class="command-item">
78+
<a href="#" onclick="clickButton('LoadQueryButton')" class="no-wrap">
79+
<span class="icon"><img src="~/images/open-light.svg" alt="load image"/></span>
80+
<span class="caption">Load Query</span>
81+
</a>
82+
</li>
83+
<li title="Clear Query" id="clear-query-menu-item" class="command-item">
84+
<a href="#" onclick="clickButton('ClearQueryButton')" class="no-wrap">
85+
<span class="icon"><img src="~/images/clear-light.svg" alt="clear image"/></span>
86+
<span class="caption">Clear Query</span>
87+
</a>
88+
</li>
89+
<li title="Save Query" id="save-query-menu-item" class="command-item">
90+
<a href="#" onclick="clickButton('SaveQueryButton')" class="no-wrap">
91+
<span class="icon"><img src="~/images/save-light.svg" alt="save image"/></span>
92+
<span class="caption">Save Query</span>
93+
</a>
94+
</li>
95+
<li title="Save Query As..." id="save-as-query-menu-item" class="command-item">
96+
<a href="#" onclick="clickButton('CopyQueryButton')" class="no-wrap">
97+
<span class="icon"><img src="~/images/save-as-light.svg" alt="save as image"/></span>
98+
<span class="caption">Save Query As...</span>
99+
</a>
100+
</li>
101+
<li title="Remove Query From Storage" id="delete-query-menu-item" class="command-item">
102+
<a href="#" onclick="clickButton('RemoveQueryButton')" class="no-wrap">
103+
<span class="icon"><img src="~/images/remove-light.svg" alt="remove image"/></span>
104+
<span class="caption">Remove Query</span>
105+
</a>
106+
</li>
107+
<li title="Fetch Data" id="fetch-query-menu-item" class="command-item">
108+
<a href="#" onclick="clickButton('ExecQueryButton')" class="no-wrap">
109+
<span class="icon"><img src="~/images/run-light.svg" alt="run image"/></span>
110+
<span class="caption">Fetch Data</span>
111+
</a>
112+
</li>
113+
<li class="separator"></li>
114+
<li title="Dashboard">
115+
<a href="/">
62116
<span class="icon"><img src="~/images/dashboard.svg" alt="dashboard"/></span>
63117
<span class="caption">Dashboard</span>
64-
</a></li>
65-
<li title="Privacy"><a href="/privacy">
118+
</a>
119+
</li>
120+
<li title="Privacy">
121+
<a href="/privacy">
66122
<span class="icon"><img src="~/images/privacy.svg" alt="dashboard"/></span>
67123
<span class="caption">Privacy</span>
68-
</a></li>
69-
<li title="About"><a href="/about">
124+
</a>
125+
</li>
126+
<li title="About">
127+
<a href="/about">
70128
<span class="icon"><img src="~/images/about.svg" alt="dashboard"/></span>
71129
<span class="caption">About</span>
72-
</a></li>
130+
</a>
131+
</li>
73132
</ul>
74133
</aside>
75134

76135
<main>
77136
@RenderBody()
78137
</main>
79138

80-
<footer id="app-footer">
81-
<div>Powered by <a href="https://korzh.com/easyquery">EasyQuery</a></div>
82-
<div>Copyright 2019-@DateTime.Now.Year © <a href="https://korzh.com">Korzh.com</a></div>
83-
</footer>
84-
85139
<script src="~/js/index.js"></script>
140+
<script>
141+
function toggleSidebar() {
142+
document.querySelector("#showSidebarButton").classList.toggle('transform');
143+
document.body.classList.toggle('sb-expand');
144+
}
145+
146+
function clickButton(id) {
147+
const btn = document.querySelector(`#${id}`)
148+
btn.click()
149+
}
150+
</script>
86151

87152
@RenderSection("Scripts", required: false)
88153

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Advanced Search
2+
3+
This project demonstrates the work of EasyQuery and implements an advanced search interface with a responsive layout. It includes features such as entity filtering, column customization, and responsive design for various screen sizes.

AspNetCore/Razor-Mvc/Razor.AdvancedSearch/wwwroot/css/easyquery.css

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
.eqjs-column-buttonsBlock,
2+
.eqjs-qp-condition-buttonsBlock {
3+
display: none;
4+
}
5+
16
.eqjs-ep-panel, .eqjs-qc-panel, .eqjs-qp-panel {
2-
background-color: var(--widget-background);
3-
color: var();
7+
/*background-color: var(--widget-background);*/
8+
/*color: var();*/
9+
border-bottom-left-radius: 6px;
10+
border-bottom-right-radius: 6px;
411
}
512

613
.eqjs-qp-grelement {
@@ -13,4 +20,81 @@
1320

1421
#EntitiesPanel {
1522
user-select: none;
23+
}
24+
25+
.eqjs-column-buttonsBlock, .eqjs-qp-condition-buttonsBlock {
26+
background: hsla(0, 0%, 100%, .85);
27+
}
28+
29+
.eqv-export-buttons {
30+
margin-left: auto;
31+
gap: 4px;
32+
}
33+
34+
.eqjs-export {
35+
width: 24px;
36+
height: 24px;
37+
display: inline-flex;
38+
align-items: center;
39+
justify-content: center;
40+
41+
img {
42+
width: 100%;
43+
height: 100%;
44+
inset: 4px;
45+
}
46+
}
47+
48+
.eqjs-mobile.eqjs-menu-rootLevel {
49+
inset: 0!important;
50+
}
51+
52+
.eqjs-menu-scrollDiv.eqjs-mobile {
53+
height: calc(100vh - 50px)!important;
54+
max-height: calc(100vh - 50px)!important;
55+
}
56+
57+
.eqjs-column-buttonsBlock {
58+
right: 10px!important;
59+
}
60+
61+
.eqjs-buttons-in-block-3.eqjs-qc-row[data-show-buttons] {
62+
padding-right: 0;
63+
}
64+
65+
.eqjs-chart-content {
66+
canvas {
67+
width: 100%!important;
68+
}
69+
}
70+
71+
.eqjs-qp-row.eqjs-mobile {
72+
padding: 0 10px;
73+
margin: 4px 4px 0 4px;
74+
}
75+
76+
.eqjs-qp-row-group.eqjs-mobile {
77+
padding: 4px 10px!important;
78+
}
79+
80+
.eqjs-qc-row.eqjs-mobile {
81+
border-style: solid;
82+
}
83+
84+
.eqjs-qp-row.eqjs-mobile {
85+
padding: 6px 10px!important;
86+
}
87+
88+
.eqjs-qc-row.eqjs-mobile {
89+
padding: 10px 10px!important;
90+
}
91+
92+
.eqjs-qp-condition-buttonsBlock.eqjs-mobile, .eqjs-qc-buttonsBlock.eqjs-mobile {
93+
top: 50%!important;
94+
translate: 0 -50%;
95+
right: 10px!important;
96+
}
97+
98+
.eqjs-qp-condition-buttonsBlock.eqjs-mobile {
99+
right: 0!important;
16100
}

0 commit comments

Comments
 (0)