@visns-studio/visns-components 5.0.5 → 5.0.7
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.7",
|
|
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>
|
|
@@ -328,6 +328,19 @@ function GenericDetail({
|
|
|
328
328
|
return formattedKeys.join(', ');
|
|
329
329
|
};
|
|
330
330
|
|
|
331
|
+
const renderCurrency = () => {
|
|
332
|
+
// Check if the value is a valid number
|
|
333
|
+
const parsedValue = parseFloat(value);
|
|
334
|
+
if (isNaN(parsedValue)) return ''; // Return empty string if invalid
|
|
335
|
+
|
|
336
|
+
const formatter = new Intl.NumberFormat('en-AU', {
|
|
337
|
+
style: 'currency',
|
|
338
|
+
currency: 'AUD',
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
return formatter.format(parsedValue);
|
|
342
|
+
};
|
|
343
|
+
|
|
331
344
|
const renderDate = () => formatDateValue(value);
|
|
332
345
|
|
|
333
346
|
const renderDateTime = () => formatDateTimeValue(value);
|
|
@@ -423,6 +436,8 @@ function GenericDetail({
|
|
|
423
436
|
return renderCheckbox();
|
|
424
437
|
case 'copyToClipboard':
|
|
425
438
|
return renderCopyToClipboard();
|
|
439
|
+
case 'currency':
|
|
440
|
+
return renderCurrency();
|
|
426
441
|
case 'date':
|
|
427
442
|
return renderDate();
|
|
428
443
|
case 'datetime':
|