foorm 0.0.2-alpha.5 → 0.0.2-alpha.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/dist/index.cjs CHANGED
@@ -47,7 +47,7 @@ class Foorm {
47
47
  title: (_a = this.title) !== null && _a !== void 0 ? _a : '',
48
48
  submit: (_b = this.submit) !== null && _b !== void 0 ? _b : { text: 'Submit' },
49
49
  context: replaceContext || this.context,
50
- entries: this.entries.map((e) => (Object.assign(Object.assign({}, this.normalizeEntry(e)), { validators: (e.validators || []).filter((v) => isFtring(v)) }))),
50
+ entries: this.entries.map((e) => (Object.assign(Object.assign({}, e), { validators: (e.validators || []).filter((v) => isFtring(v)) }))),
51
51
  };
52
52
  }
53
53
  normalizeEntry(e) {
@@ -121,14 +121,23 @@ class Foorm {
121
121
  scope.entry.disabled = evalEntry.disabled =
122
122
  evalEntry.disabled(scope);
123
123
  }
124
+ else {
125
+ scope.entry.disabled = evalEntry.disabled;
126
+ }
124
127
  if (typeof evalEntry.optional === 'function') {
125
128
  scope.entry.optional = evalEntry.optional =
126
129
  evalEntry.optional(scope);
127
130
  }
131
+ else {
132
+ scope.entry.optional = evalEntry.optional;
133
+ }
128
134
  if (typeof evalEntry.hidden === 'function') {
129
135
  scope.entry.hidden = evalEntry.hidden =
130
136
  evalEntry.hidden(scope);
131
137
  }
138
+ else {
139
+ scope.entry.hidden = evalEntry.hidden;
140
+ }
132
141
  }
133
142
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
134
143
  const result = validate({
package/dist/index.d.ts CHANGED
@@ -21,6 +21,7 @@ type TFoormFn<T = string, R = string | boolean> = (ctx: TFoormFnScope<T>) => R;
21
21
  type TRelevantFields = 'field' | 'type' | 'component' | 'name' | 'attrs' | 'length';
22
22
  interface TFoormEntry<T = string, O = string, SFTR = TFtring, BFTR = TFtring, FNFTR = TFtring> {
23
23
  field: string;
24
+ altAction?: string;
24
25
  label?: string | SFTR;
25
26
  description?: string | SFTR;
26
27
  hint?: string | SFTR;
package/dist/index.mjs CHANGED
@@ -45,7 +45,7 @@ class Foorm {
45
45
  title: (_a = this.title) !== null && _a !== void 0 ? _a : '',
46
46
  submit: (_b = this.submit) !== null && _b !== void 0 ? _b : { text: 'Submit' },
47
47
  context: replaceContext || this.context,
48
- entries: this.entries.map((e) => (Object.assign(Object.assign({}, this.normalizeEntry(e)), { validators: (e.validators || []).filter((v) => isFtring(v)) }))),
48
+ entries: this.entries.map((e) => (Object.assign(Object.assign({}, e), { validators: (e.validators || []).filter((v) => isFtring(v)) }))),
49
49
  };
50
50
  }
51
51
  normalizeEntry(e) {
@@ -119,14 +119,23 @@ class Foorm {
119
119
  scope.entry.disabled = evalEntry.disabled =
120
120
  evalEntry.disabled(scope);
121
121
  }
122
+ else {
123
+ scope.entry.disabled = evalEntry.disabled;
124
+ }
122
125
  if (typeof evalEntry.optional === 'function') {
123
126
  scope.entry.optional = evalEntry.optional =
124
127
  evalEntry.optional(scope);
125
128
  }
129
+ else {
130
+ scope.entry.optional = evalEntry.optional;
131
+ }
126
132
  if (typeof evalEntry.hidden === 'function') {
127
133
  scope.entry.hidden = evalEntry.hidden =
128
134
  evalEntry.hidden(scope);
129
135
  }
136
+ else {
137
+ scope.entry.hidden = evalEntry.hidden;
138
+ }
130
139
  }
131
140
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
132
141
  const result = validate({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foorm",
3
- "version": "0.0.2-alpha.5",
3
+ "version": "0.0.2-alpha.7",
4
4
  "description": "foorm",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",