@visns-studio/visns-components 5.0.6 → 5.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
76
76
|
},
|
|
77
77
|
"name": "@visns-studio/visns-components",
|
|
78
|
-
"version": "5.0.
|
|
78
|
+
"version": "5.0.8",
|
|
79
79
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
80
80
|
"main": "src/index.js",
|
|
81
81
|
"files": [
|
|
@@ -1739,12 +1739,13 @@ function Field({
|
|
|
1739
1739
|
'media',
|
|
1740
1740
|
'table',
|
|
1741
1741
|
'code',
|
|
1742
|
+
'hr',
|
|
1742
1743
|
],
|
|
1743
1744
|
toolbar:
|
|
1744
1745
|
'insertTextDropdown | undo redo | blocks | ' +
|
|
1745
1746
|
'bold italic forecolor | alignleft aligncenter ' +
|
|
1746
1747
|
'alignright alignjustify | bullist numlist outdent indent | ' +
|
|
1747
|
-
'removeformat | table',
|
|
1748
|
+
'hr | removeformat | table | code',
|
|
1748
1749
|
content_style:
|
|
1749
1750
|
'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }',
|
|
1750
1751
|
setup: (editor) => {
|
|
@@ -295,48 +295,6 @@ function Navigation({
|
|
|
295
295
|
};
|
|
296
296
|
|
|
297
297
|
const renderNav = (n) => {
|
|
298
|
-
const iconComponents = {
|
|
299
|
-
arrowCycle: ArrowCycle,
|
|
300
|
-
bookClose: BookClose,
|
|
301
|
-
bookOpen: BookOpen,
|
|
302
|
-
briefcase: Briefcase,
|
|
303
|
-
calendar: Calendar,
|
|
304
|
-
chatDots: ChatDots,
|
|
305
|
-
clipboard: Clipboard,
|
|
306
|
-
cloudUpload: CloudUpload,
|
|
307
|
-
doubleSword: DoubleSword,
|
|
308
|
-
draft: Draft,
|
|
309
|
-
envelope: Envelope,
|
|
310
|
-
file: File,
|
|
311
|
-
folder: Folder,
|
|
312
|
-
folderAdd: FolderAdd,
|
|
313
|
-
gear: Gear,
|
|
314
|
-
grid: Grid,
|
|
315
|
-
home: Home,
|
|
316
|
-
homeAlt1: HomeAlt1,
|
|
317
|
-
inbox: Inbox,
|
|
318
|
-
info: Info,
|
|
319
|
-
lightBulb: LightBulb,
|
|
320
|
-
microphone: Microphone,
|
|
321
|
-
money: Money,
|
|
322
|
-
newspaper: Newspaper,
|
|
323
|
-
paper: Paper,
|
|
324
|
-
peopleGroup: PeopleGroup,
|
|
325
|
-
peopleMultiple: PeopleMultiple,
|
|
326
|
-
question: Question,
|
|
327
|
-
questionFill: QuestionFill,
|
|
328
|
-
search: Search,
|
|
329
|
-
settingsVertical: SettingsVertical,
|
|
330
|
-
signOut: SignOut,
|
|
331
|
-
shippingBoxV1: ShippingBoxV1,
|
|
332
|
-
statisticUp: StatisticUp,
|
|
333
|
-
textAlignLeft: TextAlignLeft,
|
|
334
|
-
ticket: Ticket,
|
|
335
|
-
utensils: Utensils,
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
const IconComponent = iconComponents[n.icon];
|
|
339
|
-
|
|
340
298
|
let navItemClasses;
|
|
341
299
|
|
|
342
300
|
if (n.class.includes('active')) {
|
|
@@ -377,15 +335,9 @@ function Navigation({
|
|
|
377
335
|
return (
|
|
378
336
|
<li className={navItemClasses}>
|
|
379
337
|
{n.url ? (
|
|
380
|
-
<Link to={n.url}>
|
|
381
|
-
<IconComponent strokeWidth={2} size={18} />
|
|
382
|
-
{n.label}
|
|
383
|
-
</Link>
|
|
338
|
+
<Link to={n.url}>{n.label}</Link>
|
|
384
339
|
) : (
|
|
385
|
-
<span title={n.label}>
|
|
386
|
-
<IconComponent strokeWidth={2} size={18} />
|
|
387
|
-
{n.label}
|
|
388
|
-
</span>
|
|
340
|
+
<span title={n.label}>{n.label}</span>
|
|
389
341
|
)}
|
|
390
342
|
{renderChildren()}
|
|
391
343
|
</li>
|
|
@@ -135,6 +135,14 @@ function GenericDetail({
|
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
137
|
|
|
138
|
+
const handleExport = (config) => {
|
|
139
|
+
if (config.url && config.key) {
|
|
140
|
+
window.open(`${config.url}/${data[config.key]}`);
|
|
141
|
+
} else {
|
|
142
|
+
toast.error('Export URL not found');
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
138
146
|
const handleCheckboxUpdate = async () => {
|
|
139
147
|
try {
|
|
140
148
|
if (currentConfigRef.current.functions.checkboxUpdate) {
|
|
@@ -328,6 +336,19 @@ function GenericDetail({
|
|
|
328
336
|
return formattedKeys.join(', ');
|
|
329
337
|
};
|
|
330
338
|
|
|
339
|
+
const renderCurrency = () => {
|
|
340
|
+
// Check if the value is a valid number
|
|
341
|
+
const parsedValue = parseFloat(value);
|
|
342
|
+
if (isNaN(parsedValue)) return ''; // Return empty string if invalid
|
|
343
|
+
|
|
344
|
+
const formatter = new Intl.NumberFormat('en-AU', {
|
|
345
|
+
style: 'currency',
|
|
346
|
+
currency: 'AUD',
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
return formatter.format(parsedValue);
|
|
350
|
+
};
|
|
351
|
+
|
|
331
352
|
const renderDate = () => formatDateValue(value);
|
|
332
353
|
|
|
333
354
|
const renderDateTime = () => formatDateTimeValue(value);
|
|
@@ -423,6 +444,8 @@ function GenericDetail({
|
|
|
423
444
|
return renderCheckbox();
|
|
424
445
|
case 'copyToClipboard':
|
|
425
446
|
return renderCopyToClipboard();
|
|
447
|
+
case 'currency':
|
|
448
|
+
return renderCurrency();
|
|
426
449
|
case 'date':
|
|
427
450
|
return renderDate();
|
|
428
451
|
case 'datetime':
|
|
@@ -1053,6 +1076,21 @@ function GenericDetail({
|
|
|
1053
1076
|
</button>
|
|
1054
1077
|
</div>
|
|
1055
1078
|
)}
|
|
1079
|
+
|
|
1080
|
+
{activeTabConfig.export && (
|
|
1081
|
+
<div className={styles.polActions}>
|
|
1082
|
+
<button
|
|
1083
|
+
className={styles.btn}
|
|
1084
|
+
onClick={() =>
|
|
1085
|
+
handleExport(
|
|
1086
|
+
activeTabConfig.export
|
|
1087
|
+
)
|
|
1088
|
+
}
|
|
1089
|
+
>
|
|
1090
|
+
Export
|
|
1091
|
+
</button>
|
|
1092
|
+
</div>
|
|
1093
|
+
)}
|
|
1056
1094
|
</>
|
|
1057
1095
|
);
|
|
1058
1096
|
case 'qrCode':
|