@bolttech/form-engine-core 1.0.1-beta.1 → 1.0.1-beta.2

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.
Files changed (2) hide show
  1. package/index.esm.js +10 -6
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -735,18 +735,21 @@ const custom = (value, masks) => {
735
735
  let mask = '';
736
736
  let index = 0;
737
737
  const convertedValue = value.replace(/[^\w\s]/gi, '');
738
- for (let i = 0; i < masks.custom.length; i++) {
739
- if (masks.custom[i] === '#') {
738
+ for (const char of masks.custom) {
739
+ if (char === '#') {
740
740
  if (index < convertedValue.length) {
741
741
  mask += convertedValue[index];
742
742
  index++;
743
743
  } else {
744
744
  break;
745
745
  }
746
- } else {
747
- mask += masks.custom[i];
746
+ } else if (index <= convertedValue.length) {
747
+ mask += char;
748
748
  }
749
749
  }
750
+ if (value.length < mask.length) {
751
+ mask = mask.replace(/[^\w]+$/, '');
752
+ }
750
753
  return mask;
751
754
  };
752
755
 
@@ -4350,8 +4353,9 @@ class FormGroup {
4350
4353
  formIndex
4351
4354
  }) => ids.includes(formIndex)), groupBy(({
4352
4355
  event,
4353
- formIndex
4354
- }) => `${event}.${formIndex}`), mergeMap(group$ => group$.pipe(debounceTime(this.config.defaultStateRefreshTimeMS))), map(({
4356
+ formIndex,
4357
+ fieldIndex
4358
+ }) => `${event}.${formIndex}.${fieldIndex}`), mergeMap(group$ => group$.pipe(debounceTime(this.config.defaultStateRefreshTimeMS))), map(({
4355
4359
  fieldIndex,
4356
4360
  formIndex
4357
4361
  }) => ids.reduce((acc, curr) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bolttech/form-engine-core",
3
- "version": "1.0.1-beta.1",
3
+ "version": "1.0.1-beta.2",
4
4
  "module": "./index.esm.js",
5
5
  "type": "module",
6
6
  "main": "./index.esm.js",