@visns-studio/visns-components 1.0.0 → 1.0.1

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.
@@ -3,7 +3,7 @@ import DatePicker from "react-datepicker";
3
3
  import _ from "lodash";
4
4
  import ReactQuill from "react-quill";
5
5
  import Toggle from "react-toggle";
6
- import NumberFormat from "react-number-format";
6
+ import { NumericFormat, PatternFormat } from "react-number-format";
7
7
 
8
8
  import CustomFetch from "./visns-fetch";
9
9
  import Select from "./visns-select";
@@ -304,7 +304,7 @@ function Field(props) {
304
304
  break;
305
305
  case "phone":
306
306
  htmlContainer = (
307
- <NumberFormat
307
+ <PatternFormat
308
308
  data-name={settings.id}
309
309
  className={inputClass[settings.id]}
310
310
  onValueChange={(values) => {
@@ -314,6 +314,8 @@ function Field(props) {
314
314
  );
315
315
  }}
316
316
  format="## #### ####"
317
+ allowEmptyFormatting
318
+ mask="_"
317
319
  value={
318
320
  inputValue && inputValue !== "null"
319
321
  ? inputValue
@@ -324,7 +326,7 @@ function Field(props) {
324
326
  break;
325
327
  case "mobile":
326
328
  htmlContainer = (
327
- <NumberFormat
329
+ <PatternFormat
328
330
  className={inputClass[settings.id]}
329
331
  onValueChange={(values) => {
330
332
  onChangeNumberFormat(
@@ -333,6 +335,8 @@ function Field(props) {
333
335
  );
334
336
  }}
335
337
  format="#### ### ###"
338
+ allowEmptyFormatting
339
+ mask="_"
336
340
  value={
337
341
  inputValue && inputValue !== "null"
338
342
  ? inputValue
@@ -343,7 +347,7 @@ function Field(props) {
343
347
  break;
344
348
  case "currency":
345
349
  htmlContainer = (
346
- <NumberFormat
350
+ <NumericFormat
347
351
  data-name={settings.id}
348
352
  className={inputClass[settings.id]}
349
353
  onValueChange={(values) => {
@@ -362,6 +366,60 @@ function Field(props) {
362
366
  />
363
367
  );
364
368
  break;
369
+ case "number":
370
+ htmlContainer = (
371
+ <NumericFormat
372
+ data-name={settings.id}
373
+ className={inputClass[settings.id]}
374
+ onValueChange={(values) => {
375
+ onChangeNumberFormat(
376
+ values,
377
+ settings.id
378
+ );
379
+ }}
380
+ thousandSeparator={
381
+ settings.hasOwnProperty(
382
+ "thousandSeperator"
383
+ )
384
+ ? settings.thousandSeperator
385
+ : true
386
+ }
387
+ value={
388
+ inputValue && inputValue !== "null"
389
+ ? inputValue
390
+ : ""
391
+ }
392
+ />
393
+ );
394
+ break;
395
+ case "decimal":
396
+ htmlContainer = (
397
+ <NumericFormat
398
+ data-name={settings.id}
399
+ className={inputClass[settings.id]}
400
+ onValueChange={(values) => {
401
+ onChangeNumberFormat(
402
+ values,
403
+ settings.id
404
+ );
405
+ }}
406
+ thousandSeparator={
407
+ settings.hasOwnProperty(
408
+ "thousandSeperator"
409
+ )
410
+ ? settings.thousandSeperator
411
+ : true
412
+ }
413
+ decimalSeparator="."
414
+ decimalScale={2}
415
+ value={
416
+ inputValue && inputValue !== "null"
417
+ ? inputValue
418
+ : ""
419
+ }
420
+ />
421
+ );
422
+ break;
365
423
  case "textarea":
366
424
  htmlContainer = (
367
425
  <textarea
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "reactjs-popup": "^2.0.5"
25
25
  },
26
26
  "name": "@visns-studio/visns-components",
27
- "version": "1.0.0",
27
+ "version": "1.0.1",
28
28
  "description": "Various packages to assist in the development of our Custom Applications.",
29
29
  "main": "index.js",
30
30
  "devDependencies": {},