@woodylab/payload 0.0.2 → 0.0.3

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.
@@ -0,0 +1 @@
1
+ export { default as textField } from './textField';
@@ -0,0 +1,4 @@
1
+ import { FieldOverride } from './types/FieldOverride';
2
+ import { Field } from 'payload';
3
+ declare const textField: (override?: FieldOverride<"text">) => Field;
4
+ export default textField;
@@ -0,0 +1,32 @@
1
+ import { ArrayField, BlocksField, CheckboxField, CodeField, DateField, EmailField, GroupField, JoinField, JSONField, NumberField, PointField, RadioField, RelationshipField, RichTextField, RowField, SelectField, TabsField, TextareaField, TextField, UploadField } from 'payload';
2
+ type FieldTypeMap = {
3
+ array: ArrayField;
4
+ blocks: BlocksField;
5
+ checkbox: CheckboxField;
6
+ code: CodeField;
7
+ date: DateField;
8
+ email: EmailField;
9
+ group: GroupField;
10
+ json: JSONField;
11
+ number: NumberField;
12
+ point: PointField;
13
+ radio: RadioField;
14
+ join: JoinField;
15
+ relationship: RelationshipField;
16
+ richText: RichTextField;
17
+ row: RowField;
18
+ select: SelectField;
19
+ tabs: TabsField;
20
+ textarea: TextareaField;
21
+ text: TextField;
22
+ upload: UploadField;
23
+ };
24
+ export type AllFieldTypes = keyof FieldTypeMap;
25
+ type BaseOverride<T extends AllFieldTypes> = Partial<Omit<FieldTypeMap[T], 'type'>> & {
26
+ type?: T;
27
+ };
28
+ export type FieldOverride<T extends AllFieldTypes> = BaseOverride<T>;
29
+ export type AnyFieldOverride = {
30
+ [K in AllFieldTypes]: FieldOverride<K>;
31
+ }[AllFieldTypes];
32
+ export {};
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ const textField = (override) => ({
4
+ name: 'text',
5
+ label: 'Text',
6
+ type: 'text',
7
+ required: true,
8
+ ...override,
9
+ });
10
+
11
+ var index = /*#__PURE__*/Object.freeze({
12
+ __proto__: null,
13
+ textField: textField
14
+ });
15
+
16
+ exports.Fields = index;
@@ -0,0 +1 @@
1
+ export * as Fields from './fields';
@@ -0,0 +1,14 @@
1
+ const textField = (override) => ({
2
+ name: 'text',
3
+ label: 'Text',
4
+ type: 'text',
5
+ required: true,
6
+ ...override,
7
+ });
8
+
9
+ var index = /*#__PURE__*/Object.freeze({
10
+ __proto__: null,
11
+ textField: textField
12
+ });
13
+
14
+ export { index as Fields };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@woodylab/payload",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",
@@ -26,7 +26,7 @@
26
26
  "release": "npm run clean && npm run build && npm version patch && npm publish"
27
27
  },
28
28
  "files": [
29
- "../dist"
29
+ "dist"
30
30
  ],
31
31
  "peerDependencies": {
32
32
  "payload": "^3.54.0"