Skip to content

Commit 4a0f0e3

Browse files
Georgealexmerlin
authored andcommitted
package clean v4
Signed-off-by: alexmerlin <alex.merlin.1985@gmail.com>
1 parent 586a732 commit 4a0f0e3

13 files changed

Lines changed: 314 additions & 24 deletions

File tree

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Web starter package suitable for admin applications.",
55
"main": "index.js",
66
"scripts": {
7-
"dev": "cross-env NODE_ENV=development node_modules/.bin/webpack -d --progress --hide-modules",
7+
"dev": "cross-env NODE_ENV=development node_modules/.bin/webpack --mode development --progress",
88
"watch": "cross-env NODE_ENV=development webpack --watch --mode development --progress",
99
"prod": "cross-env NODE_ENV=production node_modules/.bin/webpack --mode=production --progress"
1010
},
@@ -30,7 +30,9 @@
3030
"jquery": "^4.0.0",
3131
"jquery-migrate": "^4.0.2",
3232
"lodash": "^4.18.1",
33-
"moment": "^2.30.1"
33+
"moment": "^2.30.1",
34+
"perfect-scrollbar": "^1.5.6",
35+
"jquery-sparkline": "^2.4.0"
3436
},
3537
"devDependencies": {
3638
"@babel/core": "^7.24.7",

public/js/admin.js

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/js/app.js

Lines changed: 21 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/js/table_settings.js

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/js/user.js

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App/assets/js/_jquery-setup.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import $ from 'jquery';
2+
3+
$.migrateMute = true;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import $ from 'jquery';
2+
import PerfectScrollbar from 'perfect-scrollbar';
3+
4+
export default (function () {
5+
const scrollables = $('.scrollable');
6+
if (scrollables.length > 0) {
7+
scrollables.each((index, el) => {
8+
new PerfectScrollbar(el);
9+
});
10+
}
11+
}());

src/App/assets/js/components/_search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import $ from 'jquery';
33
(function () {
44
$('.search-toggle').on('click', e => {
55
$('.search-box, .search-input').toggleClass('active');
6-
$('.search-input input').focus();
6+
$('.search-input input').trigger('focus');
77
e.preventDefault();
88
});
99
}());

src/App/assets/js/components/_sidebar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ import $ from 'jquery';
6565
* then trigger window resize event to recalculate
6666
* masonry layout widths and gutters.
6767
*/
68-
$('#sidebar-toggle').click(e => {
68+
$('#sidebar-toggle').on('click', e => {
6969
e.preventDefault();
7070
setTimeout(() => {
7171
window.dispatchEvent(window.EVENT);
Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
import $ from 'jquery';
2+
import 'jquery-sparkline';
3+
import { debounce } from 'lodash';
4+
import { COLORS } from './_colors.js';
5+
6+
export default (function () {
7+
// ------------------------------------------------------
8+
// @Dashboard Sparklines
9+
// ------------------------------------------------------
10+
11+
const drawSparklines = () => {
12+
if ($('#sparklinedash').length > 0) {
13+
$('#sparklinedash').sparkline([0, 5, 6, 10, 9, 12, 4, 9], {
14+
type: 'bar',
15+
height: '20',
16+
barWidth: '3',
17+
resize: true,
18+
barSpacing: '3',
19+
barColor: '#4caf50',
20+
});
21+
}
22+
23+
if ($('#sparklinedash2').length > 0) {
24+
$('#sparklinedash2').sparkline([0, 5, 6, 10, 9, 12, 4, 9], {
25+
type: 'bar',
26+
height: '20',
27+
barWidth: '3',
28+
resize: true,
29+
barSpacing: '3',
30+
barColor: '#9675ce',
31+
});
32+
}
33+
34+
if ($('#sparklinedash3').length > 0) {
35+
$('#sparklinedash3').sparkline([0, 5, 6, 10, 9, 12, 4, 9], {
36+
type: 'bar',
37+
height: '20',
38+
barWidth: '3',
39+
resize: true,
40+
barSpacing: '3',
41+
barColor: '#03a9f3',
42+
});
43+
}
44+
45+
if ($('#sparklinedash4').length > 0) {
46+
$('#sparklinedash4').sparkline([0, 5, 6, 10, 9, 12, 4, 9], {
47+
type: 'bar',
48+
height: '20',
49+
barWidth: '3',
50+
resize: true,
51+
barSpacing: '3',
52+
barColor: '#f96262',
53+
});
54+
}
55+
};
56+
57+
drawSparklines();
58+
59+
// Redraw sparklines on resize
60+
$(window).on('resize', debounce(drawSparklines, 150));
61+
62+
// ------------------------------------------------------
63+
// @Other Sparklines
64+
// ------------------------------------------------------
65+
66+
$('#sparkline').sparkline(
67+
[5, 6, 7, 9, 9, 5, 3, 2, 2, 4, 6, 7],
68+
{
69+
type: 'line',
70+
resize: true,
71+
height: '20',
72+
}
73+
);
74+
75+
$('#compositebar').sparkline(
76+
'html',
77+
{
78+
type: 'bar',
79+
resize: true,
80+
barColor: '#aaf',
81+
height: '20',
82+
}
83+
);
84+
85+
$('#compositebar').sparkline(
86+
[4, 1, 5, 7, 9, 9, 8, 7, 6, 6, 4, 7, 8, 4, 3, 2, 2, 5, 6, 7],
87+
{
88+
composite: true,
89+
fillColor: false,
90+
lineColor: 'red',
91+
resize: true,
92+
height: '20',
93+
}
94+
);
95+
96+
$('#normalline').sparkline(
97+
'html',
98+
{
99+
fillColor: false,
100+
normalRangeMin: -1,
101+
resize: true,
102+
normalRangeMax: 8,
103+
height: '20',
104+
}
105+
);
106+
107+
$('.sparktristate').sparkline(
108+
'html',
109+
{
110+
type: 'tristate',
111+
resize: true,
112+
height: '20',
113+
}
114+
);
115+
116+
$('.sparktristatecols').sparkline(
117+
'html',
118+
{
119+
type: 'tristate',
120+
colorMap: {
121+
'-2': '#fa7',
122+
resize: true,
123+
'2': '#44f',
124+
height: '20',
125+
},
126+
}
127+
);
128+
129+
const values = [5, 4, 5, -2, 0, 3, -5, 6, 7, 9, 9, 5, -3, -2, 2, -4];
130+
const valuesAlt = [1, 1, 0, 1, -1, -1, 1, -1, 0, 0, 1, 1];
131+
132+
$('.sparkline').sparkline(values, {
133+
type: 'line',
134+
barWidth: 4,
135+
barSpacing: 5,
136+
fillColor: '',
137+
lineColor: COLORS['red-500'],
138+
lineWidth: 2,
139+
spotRadius: 3,
140+
spotColor: COLORS['red-500'],
141+
maxSpotColor: COLORS['red-500'],
142+
minSpotColor: COLORS['red-500'],
143+
highlightSpotColor: COLORS['red-500'],
144+
highlightLineColor: '',
145+
tooltipSuffix: ' Bzzt',
146+
tooltipPrefix: 'Hello ',
147+
width: 100,
148+
height: undefined,
149+
barColor: '9f0',
150+
negBarColor: 'ff0',
151+
stackedBarColor: ['ff0', '9f0', '999', 'f60'],
152+
sliceColors: ['ff0', '9f0', '000', 'f60'],
153+
offset: '30',
154+
borderWidth: 1,
155+
borderColor: '000',
156+
});
157+
158+
$('.sparkbar').sparkline(values, {
159+
type: 'bar',
160+
barWidth: 4,
161+
barSpacing: 1,
162+
fillColor: '',
163+
lineColor: COLORS['deep-purple-500'],
164+
tooltipSuffix: 'Celsius',
165+
width: 100,
166+
barColor: '39f',
167+
negBarColor: COLORS['deep-purple-500'],
168+
stackedBarColor: ['ff0', '9f0', '999', 'f60'],
169+
sliceColors: ['ff0', '9f0', '000', 'f60'],
170+
offset: '30',
171+
borderWidth: 1,
172+
borderColor: '000',
173+
});
174+
175+
$('.sparktri').sparkline(valuesAlt, {
176+
type: 'tristate',
177+
barWidth: 4,
178+
barSpacing: 1,
179+
fillColor: '',
180+
lineColor: COLORS['light-blue-500'],
181+
tooltipSuffix: 'Celsius',
182+
width: 100,
183+
barColor: COLORS['light-blue-500'],
184+
posBarColor: COLORS['light-blue-500'],
185+
negBarColor: 'f90',
186+
zeroBarColor: '000',
187+
stackedBarColor: ['ff0', '9f0', '999', 'f60'],
188+
sliceColors: ['ff0', '9f0', '000', 'f60'],
189+
offset: '30',
190+
borderWidth: 1,
191+
borderColor: '000',
192+
});
193+
194+
$('.sparkdisc').sparkline(values, {
195+
type: 'discrete',
196+
barWidth: 4,
197+
barSpacing: 5,
198+
fillColor: '',
199+
lineColor: '9f0',
200+
tooltipSuffix: 'Celsius',
201+
width: 100,
202+
barColor: '9f0',
203+
negBarColor: 'f90',
204+
stackedBarColor: ['ff0', '9f0', '999', 'f60'],
205+
sliceColors: ['ff0', '9f0', '000', 'f60'],
206+
offset: '30',
207+
borderWidth: 1,
208+
borderColor: '000',
209+
});
210+
211+
$('.sparkbull').sparkline(values, {
212+
type: 'bullet',
213+
barWidth: 4,
214+
barSpacing: 5,
215+
fillColor: '',
216+
lineColor: COLORS['amber-500'],
217+
tooltipSuffix: 'Celsius',
218+
height: 'auto',
219+
width: 'auto',
220+
targetWidth: 'auto',
221+
barColor: COLORS['amber-500'],
222+
negBarColor: 'ff0',
223+
stackedBarColor: ['ff0', '9f0', '999', 'f60'],
224+
sliceColors: ['ff0', '9f0', '000', 'f60'],
225+
offset: '30',
226+
borderWidth: 1,
227+
borderColor: '000',
228+
});
229+
230+
$('.sparkbox').sparkline(values, {
231+
type: 'box',
232+
barWidth: 4,
233+
barSpacing: 5,
234+
fillColor: '',
235+
lineColor: '9f0',
236+
tooltipSuffix: 'Celsius',
237+
width: 100,
238+
barColor: '9f0',
239+
negBarColor: 'ff0',
240+
stackedBarColor: ['ff0', '9f0', '999', 'f60'],
241+
sliceColors: ['ff0', '9f0', '000', 'f60'],
242+
offset: '30',
243+
borderWidth: 1,
244+
borderColor: '000',
245+
});
246+
}())

0 commit comments

Comments
 (0)