@samline/forms 1.0.3 → 2.0.0
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/README.md +87 -199
- package/dist/browser/global.d.ts +152 -0
- package/dist/browser/global.global.js +778 -474
- package/dist/browser/global.global.js.map +1 -1
- package/dist/index.cjs +753 -470
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +141 -3
- package/dist/index.d.ts +141 -3
- package/dist/index.js +960 -13
- package/dist/index.js.map +1 -1
- package/package.json +8 -43
- package/dist/chunk-4NEGCRY2.js +0 -125
- package/dist/chunk-4NEGCRY2.js.map +0 -1
- package/dist/chunk-PCKGH2WA.js +0 -11
- package/dist/chunk-PCKGH2WA.js.map +0 -1
- package/dist/chunk-WM2CL7IO.js +0 -576
- package/dist/chunk-WM2CL7IO.js.map +0 -1
- package/dist/core/index.cjs +0 -154
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.d.cts +0 -11
- package/dist/core/index.d.ts +0 -11
- package/dist/core/index.js +0 -13
- package/dist/core/index.js.map +0 -1
- package/dist/react/index.cjs +0 -734
- package/dist/react/index.cjs.map +0 -1
- package/dist/react/index.d.cts +0 -10
- package/dist/react/index.d.ts +0 -10
- package/dist/react/index.js +0 -43
- package/dist/react/index.js.map +0 -1
- package/dist/svelte/index.cjs +0 -764
- package/dist/svelte/index.cjs.map +0 -1
- package/dist/svelte/index.d.cts +0 -20
- package/dist/svelte/index.d.ts +0 -20
- package/dist/svelte/index.js +0 -72
- package/dist/svelte/index.js.map +0 -1
- package/dist/types-jYB7Wp7C.d.cts +0 -95
- package/dist/types-jYB7Wp7C.d.ts +0 -95
- package/dist/vanilla/index.cjs +0 -705
- package/dist/vanilla/index.cjs.map +0 -1
- package/dist/vanilla/index.d.cts +0 -7
- package/dist/vanilla/index.d.ts +0 -7
- package/dist/vanilla/index.js +0 -12
- package/dist/vanilla/index.js.map +0 -1
- package/dist/vue/index.cjs +0 -741
- package/dist/vue/index.cjs.map +0 -1
- package/dist/vue/index.d.cts +0 -13
- package/dist/vue/index.d.ts +0 -13
- package/dist/vue/index.js +0 -56
- package/dist/vue/index.js.map +0 -1
package/dist/core/index.cjs
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/core/index.ts
|
|
21
|
-
var core_exports = {};
|
|
22
|
-
__export(core_exports, {
|
|
23
|
-
createEmptyFormState: () => createEmptyFormState,
|
|
24
|
-
parseFormData: () => parseFormData,
|
|
25
|
-
validateFieldValue: () => validateFieldValue,
|
|
26
|
-
validateValues: () => validateValues
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(core_exports);
|
|
29
|
-
|
|
30
|
-
// src/core/serialize.ts
|
|
31
|
-
var isEmptyFile = (value) => value instanceof File && value.size === 0 && value.name === "";
|
|
32
|
-
var appendValue = (data, key, value) => {
|
|
33
|
-
const current = data[key];
|
|
34
|
-
if (current === void 0) {
|
|
35
|
-
data[key] = value;
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (Array.isArray(current)) {
|
|
39
|
-
current.push(value);
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
data[key] = [current, value];
|
|
43
|
-
};
|
|
44
|
-
var parseFormData = (formElement) => {
|
|
45
|
-
const rawFormData = new FormData(formElement);
|
|
46
|
-
const formData = new FormData();
|
|
47
|
-
const data = {};
|
|
48
|
-
rawFormData.forEach((value, key) => {
|
|
49
|
-
if (isEmptyFile(value)) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
formData.append(key, value);
|
|
53
|
-
appendValue(data, key, value);
|
|
54
|
-
});
|
|
55
|
-
return { data, formData };
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// src/core/state.ts
|
|
59
|
-
var createEmptyFormState = () => ({
|
|
60
|
-
values: {},
|
|
61
|
-
errors: {},
|
|
62
|
-
filledFields: [],
|
|
63
|
-
isValid: true,
|
|
64
|
-
isValidated: false,
|
|
65
|
-
autoSubmit: false,
|
|
66
|
-
submitCount: 0
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
// src/core/validation.ts
|
|
70
|
-
var resolveRule = (rule) => {
|
|
71
|
-
if (rule === void 0) {
|
|
72
|
-
return { value: void 0, message: void 0 };
|
|
73
|
-
}
|
|
74
|
-
if (typeof rule === "object" && rule !== null && "value" in rule) {
|
|
75
|
-
return { value: rule.value, message: rule.message };
|
|
76
|
-
}
|
|
77
|
-
return { value: rule, message: void 0 };
|
|
78
|
-
};
|
|
79
|
-
var hasValue = (value) => {
|
|
80
|
-
if (Array.isArray(value)) {
|
|
81
|
-
return value.length > 0;
|
|
82
|
-
}
|
|
83
|
-
return typeof value === "string" ? value.trim().length > 0 : value !== void 0;
|
|
84
|
-
};
|
|
85
|
-
var getValueLength = (value) => {
|
|
86
|
-
if (Array.isArray(value)) {
|
|
87
|
-
return value.length;
|
|
88
|
-
}
|
|
89
|
-
if (typeof value === "string") {
|
|
90
|
-
return value.length;
|
|
91
|
-
}
|
|
92
|
-
return 0;
|
|
93
|
-
};
|
|
94
|
-
var toPatternTarget = (value) => {
|
|
95
|
-
if (typeof value === "string") {
|
|
96
|
-
return value;
|
|
97
|
-
}
|
|
98
|
-
if (Array.isArray(value)) {
|
|
99
|
-
return value.map((entry) => typeof entry === "string" ? entry : entry.name).join(",");
|
|
100
|
-
}
|
|
101
|
-
return "";
|
|
102
|
-
};
|
|
103
|
-
var validateFieldValue = (field, value, rules, values) => {
|
|
104
|
-
const errors = [];
|
|
105
|
-
const context = { field, value, values };
|
|
106
|
-
const required = resolveRule(rules.required);
|
|
107
|
-
const minLength = resolveRule(rules.minLength);
|
|
108
|
-
const maxLength = resolveRule(rules.maxLength);
|
|
109
|
-
const pattern = resolveRule(rules.pattern);
|
|
110
|
-
if (required.value && !hasValue(value)) {
|
|
111
|
-
errors.push(required.message ?? "This field is required.");
|
|
112
|
-
}
|
|
113
|
-
if (minLength.value !== void 0 && getValueLength(value) < minLength.value) {
|
|
114
|
-
errors.push(minLength.message ?? `Minimum length is ${minLength.value}.`);
|
|
115
|
-
}
|
|
116
|
-
if (maxLength.value !== void 0 && getValueLength(value) > maxLength.value) {
|
|
117
|
-
errors.push(maxLength.message ?? `Maximum length is ${maxLength.value}.`);
|
|
118
|
-
}
|
|
119
|
-
if (pattern.value && hasValue(value) && !pattern.value.test(toPatternTarget(value))) {
|
|
120
|
-
errors.push(pattern.message ?? "Value does not match the required pattern.");
|
|
121
|
-
}
|
|
122
|
-
const customValidators = rules.validate ? Array.isArray(rules.validate) ? rules.validate : [rules.validate] : [];
|
|
123
|
-
for (const validator of customValidators) {
|
|
124
|
-
const result = validator(context);
|
|
125
|
-
if (typeof result === "string" && result.length > 0) {
|
|
126
|
-
errors.push(result);
|
|
127
|
-
}
|
|
128
|
-
if (result === false) {
|
|
129
|
-
errors.push("Validation failed.");
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return errors;
|
|
133
|
-
};
|
|
134
|
-
var validateValues = (values, schema) => {
|
|
135
|
-
const errors = {};
|
|
136
|
-
for (const [field, rules] of Object.entries(schema)) {
|
|
137
|
-
const messages = validateFieldValue(field, values[field], rules, values);
|
|
138
|
-
if (messages.length > 0) {
|
|
139
|
-
errors[field] = messages;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return {
|
|
143
|
-
isValid: Object.keys(errors).length === 0,
|
|
144
|
-
errors
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
148
|
-
0 && (module.exports = {
|
|
149
|
-
createEmptyFormState,
|
|
150
|
-
parseFormData,
|
|
151
|
-
validateFieldValue,
|
|
152
|
-
validateValues
|
|
153
|
-
});
|
|
154
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/core/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/index.ts","../../src/core/serialize.ts","../../src/core/state.ts","../../src/core/validation.ts"],"sourcesContent":["export * from './serialize'\nexport * from './state'\nexport * from './types'\nexport * from './validation'","import type { SerializedFormResult, SerializedFormValue } from './types'\n\nconst isEmptyFile = (value: FormDataEntryValue): value is File =>\n value instanceof File && value.size === 0 && value.name === ''\n\nconst appendValue = (\n data: Record<string, SerializedFormValue>,\n key: string,\n value: FormDataEntryValue\n) => {\n const current = data[key]\n\n if (current === undefined) {\n data[key] = value\n return\n }\n\n if (Array.isArray(current)) {\n current.push(value)\n return\n }\n\n data[key] = [current, value]\n}\n\nexport const parseFormData = (\n formElement: HTMLFormElement\n): SerializedFormResult => {\n const rawFormData = new FormData(formElement)\n const formData = new FormData()\n const data: Record<string, SerializedFormValue> = {}\n\n rawFormData.forEach((value, key) => {\n if (isEmptyFile(value)) {\n return\n }\n\n formData.append(key, value)\n appendValue(data, key, value)\n })\n\n return { data, formData }\n}","import type { FormStateSnapshot } from './types'\n\nexport const createEmptyFormState = (): FormStateSnapshot => ({\n values: {},\n errors: {},\n filledFields: [],\n isValid: true,\n isValidated: false,\n autoSubmit: false,\n submitCount: 0\n})","import type {\n FieldValidationContext,\n FieldValidationRules,\n FormErrors,\n FormFieldValue,\n FormValues,\n RuleConfig,\n ValidationResult,\n ValidationSchema\n} from './types'\n\nconst resolveRule = <T>(rule: RuleConfig<T> | undefined) => {\n if (rule === undefined) {\n return { value: undefined as T | undefined, message: undefined as string | undefined }\n }\n\n if (typeof rule === 'object' && rule !== null && 'value' in rule) {\n return { value: rule.value, message: rule.message }\n }\n\n return { value: rule, message: undefined as string | undefined }\n}\n\nconst hasValue = (value: FormFieldValue) => {\n if (Array.isArray(value)) {\n return value.length > 0\n }\n\n return typeof value === 'string' ? value.trim().length > 0 : value !== undefined\n}\n\nconst getValueLength = (value: FormFieldValue) => {\n if (Array.isArray(value)) {\n return value.length\n }\n\n if (typeof value === 'string') {\n return value.length\n }\n\n return 0\n}\n\nconst toPatternTarget = (value: FormFieldValue) => {\n if (typeof value === 'string') {\n return value\n }\n\n if (Array.isArray(value)) {\n return value\n .map(entry => (typeof entry === 'string' ? entry : entry.name))\n .join(',')\n }\n\n return ''\n}\n\nexport const validateFieldValue = (\n field: string,\n value: FormFieldValue,\n rules: FieldValidationRules,\n values: FormValues\n) => {\n const errors: string[] = []\n const context: FieldValidationContext = { field, value, values }\n const required = resolveRule(rules.required)\n const minLength = resolveRule(rules.minLength)\n const maxLength = resolveRule(rules.maxLength)\n const pattern = resolveRule(rules.pattern)\n\n if (required.value && !hasValue(value)) {\n errors.push(required.message ?? 'This field is required.')\n }\n\n if (minLength.value !== undefined && getValueLength(value) < minLength.value) {\n errors.push(minLength.message ?? `Minimum length is ${minLength.value}.`)\n }\n\n if (maxLength.value !== undefined && getValueLength(value) > maxLength.value) {\n errors.push(maxLength.message ?? `Maximum length is ${maxLength.value}.`)\n }\n\n if (pattern.value && hasValue(value) && !pattern.value.test(toPatternTarget(value))) {\n errors.push(pattern.message ?? 'Value does not match the required pattern.')\n }\n\n const customValidators = rules.validate\n ? Array.isArray(rules.validate)\n ? rules.validate\n : [rules.validate]\n : []\n\n for (const validator of customValidators) {\n const result = validator(context)\n\n if (typeof result === 'string' && result.length > 0) {\n errors.push(result)\n }\n\n if (result === false) {\n errors.push('Validation failed.')\n }\n }\n\n return errors\n}\n\nexport const validateValues = (\n values: FormValues,\n schema: ValidationSchema\n): ValidationResult => {\n const errors: FormErrors = {}\n\n for (const [field, rules] of Object.entries(schema)) {\n const messages = validateFieldValue(field, values[field], rules, values)\n if (messages.length > 0) {\n errors[field] = messages\n }\n }\n\n return {\n isValid: Object.keys(errors).length === 0,\n errors\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,IAAM,cAAc,CAAC,UACnB,iBAAiB,QAAQ,MAAM,SAAS,KAAK,MAAM,SAAS;AAE9D,IAAM,cAAc,CAClB,MACA,KACA,UACG;AACH,QAAM,UAAU,KAAK,GAAG;AAExB,MAAI,YAAY,QAAW;AACzB,SAAK,GAAG,IAAI;AACZ;AAAA,EACF;AAEA,MAAI,MAAM,QAAQ,OAAO,GAAG;AAC1B,YAAQ,KAAK,KAAK;AAClB;AAAA,EACF;AAEA,OAAK,GAAG,IAAI,CAAC,SAAS,KAAK;AAC7B;AAEO,IAAM,gBAAgB,CAC3B,gBACyB;AACzB,QAAM,cAAc,IAAI,SAAS,WAAW;AAC5C,QAAM,WAAW,IAAI,SAAS;AAC9B,QAAM,OAA4C,CAAC;AAEnD,cAAY,QAAQ,CAAC,OAAO,QAAQ;AAClC,QAAI,YAAY,KAAK,GAAG;AACtB;AAAA,IACF;AAEA,aAAS,OAAO,KAAK,KAAK;AAC1B,gBAAY,MAAM,KAAK,KAAK;AAAA,EAC9B,CAAC;AAED,SAAO,EAAE,MAAM,SAAS;AAC1B;;;ACxCO,IAAM,uBAAuB,OAA0B;AAAA,EAC5D,QAAQ,CAAC;AAAA,EACT,QAAQ,CAAC;AAAA,EACT,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
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { S as SerializedFormResult, l as FormStateSnapshot, i as FormFieldValue, b as FieldValidationRules, o as FormValues, q as ValidationSchema, V as ValidationResult } from '../types-jYB7Wp7C.cjs';
|
|
2
|
-
export { A as AppendContentOptions, a as AutoSubmitOptions, F as FieldValidationContext, c as FieldValidator, d as FormController, e as FormControllerOptions, f as FormDataPrimitive, g as FormErrors, h as FormFieldElement, j as FormFieldWatcher, k as FormStateListener, m as FormSubmitHandler, n as FormTarget, R as RuleConfig, p as SerializedFormValue, r as VisualAttributes } from '../types-jYB7Wp7C.cjs';
|
|
3
|
-
|
|
4
|
-
declare const parseFormData: (formElement: HTMLFormElement) => SerializedFormResult;
|
|
5
|
-
|
|
6
|
-
declare const createEmptyFormState: () => FormStateSnapshot;
|
|
7
|
-
|
|
8
|
-
declare const validateFieldValue: (field: string, value: FormFieldValue, rules: FieldValidationRules, values: FormValues) => string[];
|
|
9
|
-
declare const validateValues: (values: FormValues, schema: ValidationSchema) => ValidationResult;
|
|
10
|
-
|
|
11
|
-
export { FieldValidationRules, FormFieldValue, FormStateSnapshot, FormValues, SerializedFormResult, ValidationResult, ValidationSchema, createEmptyFormState, parseFormData, validateFieldValue, validateValues };
|
package/dist/core/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { S as SerializedFormResult, l as FormStateSnapshot, i as FormFieldValue, b as FieldValidationRules, o as FormValues, q as ValidationSchema, V as ValidationResult } from '../types-jYB7Wp7C.js';
|
|
2
|
-
export { A as AppendContentOptions, a as AutoSubmitOptions, F as FieldValidationContext, c as FieldValidator, d as FormController, e as FormControllerOptions, f as FormDataPrimitive, g as FormErrors, h as FormFieldElement, j as FormFieldWatcher, k as FormStateListener, m as FormSubmitHandler, n as FormTarget, R as RuleConfig, p as SerializedFormValue, r as VisualAttributes } from '../types-jYB7Wp7C.js';
|
|
3
|
-
|
|
4
|
-
declare const parseFormData: (formElement: HTMLFormElement) => SerializedFormResult;
|
|
5
|
-
|
|
6
|
-
declare const createEmptyFormState: () => FormStateSnapshot;
|
|
7
|
-
|
|
8
|
-
declare const validateFieldValue: (field: string, value: FormFieldValue, rules: FieldValidationRules, values: FormValues) => string[];
|
|
9
|
-
declare const validateValues: (values: FormValues, schema: ValidationSchema) => ValidationResult;
|
|
10
|
-
|
|
11
|
-
export { FieldValidationRules, FormFieldValue, FormStateSnapshot, FormValues, SerializedFormResult, ValidationResult, ValidationSchema, createEmptyFormState, parseFormData, validateFieldValue, validateValues };
|
package/dist/core/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createEmptyFormState,
|
|
3
|
-
parseFormData,
|
|
4
|
-
validateFieldValue,
|
|
5
|
-
validateValues
|
|
6
|
-
} from "../chunk-4NEGCRY2.js";
|
|
7
|
-
export {
|
|
8
|
-
createEmptyFormState,
|
|
9
|
-
parseFormData,
|
|
10
|
-
validateFieldValue,
|
|
11
|
-
validateValues
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
package/dist/core/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|