@prismicio/client 7.21.2 → 7.21.3-pr.431.23cc5c6
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/iac/customType.cjs +54 -0
- package/dist/iac/customType.cjs.map +1 -0
- package/dist/iac/customType.d.cts +43 -0
- package/dist/iac/customType.d.cts.map +1 -0
- package/dist/iac/customType.d.ts +43 -0
- package/dist/iac/customType.d.ts.map +1 -0
- package/dist/iac/customType.js +53 -0
- package/dist/iac/customType.js.map +1 -0
- package/dist/iac/fields/boolean.cjs +38 -0
- package/dist/iac/fields/boolean.cjs.map +1 -0
- package/dist/iac/fields/boolean.d.cts +22 -0
- package/dist/iac/fields/boolean.d.cts.map +1 -0
- package/dist/iac/fields/boolean.d.ts +22 -0
- package/dist/iac/fields/boolean.d.ts.map +1 -0
- package/dist/iac/fields/boolean.js +38 -0
- package/dist/iac/fields/boolean.js.map +1 -0
- package/dist/iac/fields/color.cjs +29 -0
- package/dist/iac/fields/color.cjs.map +1 -0
- package/dist/iac/fields/color.d.cts +11 -0
- package/dist/iac/fields/color.d.cts.map +1 -0
- package/dist/iac/fields/color.d.ts +11 -0
- package/dist/iac/fields/color.d.ts.map +1 -0
- package/dist/iac/fields/color.js +29 -0
- package/dist/iac/fields/color.js.map +1 -0
- package/dist/iac/fields/contentRelationship.cjs +50 -0
- package/dist/iac/fields/contentRelationship.cjs.map +1 -0
- package/dist/iac/fields/contentRelationship.d.cts +23 -0
- package/dist/iac/fields/contentRelationship.d.cts.map +1 -0
- package/dist/iac/fields/contentRelationship.d.ts +23 -0
- package/dist/iac/fields/contentRelationship.d.ts.map +1 -0
- package/dist/iac/fields/contentRelationship.js +50 -0
- package/dist/iac/fields/contentRelationship.js.map +1 -0
- package/dist/iac/fields/date.cjs +29 -0
- package/dist/iac/fields/date.cjs.map +1 -0
- package/dist/iac/fields/date.d.cts +11 -0
- package/dist/iac/fields/date.d.cts.map +1 -0
- package/dist/iac/fields/date.d.ts +11 -0
- package/dist/iac/fields/date.d.ts.map +1 -0
- package/dist/iac/fields/date.js +29 -0
- package/dist/iac/fields/date.js.map +1 -0
- package/dist/iac/fields/embed.cjs +29 -0
- package/dist/iac/fields/embed.cjs.map +1 -0
- package/dist/iac/fields/embed.d.cts +11 -0
- package/dist/iac/fields/embed.d.cts.map +1 -0
- package/dist/iac/fields/embed.d.ts +11 -0
- package/dist/iac/fields/embed.d.ts.map +1 -0
- package/dist/iac/fields/embed.js +29 -0
- package/dist/iac/fields/embed.js.map +1 -0
- package/dist/iac/fields/geoPoint.cjs +26 -0
- package/dist/iac/fields/geoPoint.cjs.map +1 -0
- package/dist/iac/fields/geoPoint.d.cts +10 -0
- package/dist/iac/fields/geoPoint.d.cts.map +1 -0
- package/dist/iac/fields/geoPoint.d.ts +10 -0
- package/dist/iac/fields/geoPoint.d.ts.map +1 -0
- package/dist/iac/fields/geoPoint.js +26 -0
- package/dist/iac/fields/geoPoint.js.map +1 -0
- package/dist/iac/fields/group.cjs +38 -0
- package/dist/iac/fields/group.cjs.map +1 -0
- package/dist/iac/fields/group.d.cts +17 -0
- package/dist/iac/fields/group.d.cts.map +1 -0
- package/dist/iac/fields/group.d.ts +17 -0
- package/dist/iac/fields/group.d.ts.map +1 -0
- package/dist/iac/fields/group.js +38 -0
- package/dist/iac/fields/group.js.map +1 -0
- package/dist/iac/fields/image.cjs +48 -0
- package/dist/iac/fields/image.cjs.map +1 -0
- package/dist/iac/fields/image.d.cts +21 -0
- package/dist/iac/fields/image.d.cts.map +1 -0
- package/dist/iac/fields/image.d.ts +21 -0
- package/dist/iac/fields/image.d.ts.map +1 -0
- package/dist/iac/fields/image.js +48 -0
- package/dist/iac/fields/image.js.map +1 -0
- package/dist/iac/fields/integration.cjs +33 -0
- package/dist/iac/fields/integration.cjs.map +1 -0
- package/dist/iac/fields/integration.d.cts +15 -0
- package/dist/iac/fields/integration.d.cts.map +1 -0
- package/dist/iac/fields/integration.d.ts +15 -0
- package/dist/iac/fields/integration.d.ts.map +1 -0
- package/dist/iac/fields/integration.js +33 -0
- package/dist/iac/fields/integration.js.map +1 -0
- package/dist/iac/fields/link.cjs +45 -0
- package/dist/iac/fields/link.cjs.map +1 -0
- package/dist/iac/fields/link.d.cts +39 -0
- package/dist/iac/fields/link.d.cts.map +1 -0
- package/dist/iac/fields/link.d.ts +39 -0
- package/dist/iac/fields/link.d.ts.map +1 -0
- package/dist/iac/fields/link.js +45 -0
- package/dist/iac/fields/link.js.map +1 -0
- package/dist/iac/fields/linkToMedia.cjs +31 -0
- package/dist/iac/fields/linkToMedia.cjs.map +1 -0
- package/dist/iac/fields/linkToMedia.d.cts +11 -0
- package/dist/iac/fields/linkToMedia.d.cts.map +1 -0
- package/dist/iac/fields/linkToMedia.d.ts +11 -0
- package/dist/iac/fields/linkToMedia.d.ts.map +1 -0
- package/dist/iac/fields/linkToMedia.js +31 -0
- package/dist/iac/fields/linkToMedia.js.map +1 -0
- package/dist/iac/fields/number.cjs +29 -0
- package/dist/iac/fields/number.cjs.map +1 -0
- package/dist/iac/fields/number.d.cts +11 -0
- package/dist/iac/fields/number.d.cts.map +1 -0
- package/dist/iac/fields/number.d.ts +11 -0
- package/dist/iac/fields/number.d.ts.map +1 -0
- package/dist/iac/fields/number.js +29 -0
- package/dist/iac/fields/number.js.map +1 -0
- package/dist/iac/fields/richText.cjs +49 -0
- package/dist/iac/fields/richText.cjs.map +1 -0
- package/dist/iac/fields/richText.d.cts +33 -0
- package/dist/iac/fields/richText.d.cts.map +1 -0
- package/dist/iac/fields/richText.d.ts +33 -0
- package/dist/iac/fields/richText.d.ts.map +1 -0
- package/dist/iac/fields/richText.js +49 -0
- package/dist/iac/fields/richText.js.map +1 -0
- package/dist/iac/fields/select.cjs +46 -0
- package/dist/iac/fields/select.cjs.map +1 -0
- package/dist/iac/fields/select.d.cts +15 -0
- package/dist/iac/fields/select.d.cts.map +1 -0
- package/dist/iac/fields/select.d.ts +15 -0
- package/dist/iac/fields/select.d.ts.map +1 -0
- package/dist/iac/fields/select.js +46 -0
- package/dist/iac/fields/select.js.map +1 -0
- package/dist/iac/fields/sliceZone.cjs +37 -0
- package/dist/iac/fields/sliceZone.cjs.map +1 -0
- package/dist/iac/fields/sliceZone.d.cts +30 -0
- package/dist/iac/fields/sliceZone.d.cts.map +1 -0
- package/dist/iac/fields/sliceZone.d.ts +30 -0
- package/dist/iac/fields/sliceZone.d.ts.map +1 -0
- package/dist/iac/fields/sliceZone.js +37 -0
- package/dist/iac/fields/sliceZone.js.map +1 -0
- package/dist/iac/fields/table.cjs +26 -0
- package/dist/iac/fields/table.cjs.map +1 -0
- package/dist/iac/fields/table.d.cts +10 -0
- package/dist/iac/fields/table.d.cts.map +1 -0
- package/dist/iac/fields/table.d.ts +10 -0
- package/dist/iac/fields/table.d.ts.map +1 -0
- package/dist/iac/fields/table.js +26 -0
- package/dist/iac/fields/table.js.map +1 -0
- package/dist/iac/fields/text.cjs +29 -0
- package/dist/iac/fields/text.cjs.map +1 -0
- package/dist/iac/fields/text.d.cts +11 -0
- package/dist/iac/fields/text.d.cts.map +1 -0
- package/dist/iac/fields/text.d.ts +11 -0
- package/dist/iac/fields/text.d.ts.map +1 -0
- package/dist/iac/fields/text.js +29 -0
- package/dist/iac/fields/text.js.map +1 -0
- package/dist/iac/fields/timestamp.cjs +29 -0
- package/dist/iac/fields/timestamp.cjs.map +1 -0
- package/dist/iac/fields/timestamp.d.cts +11 -0
- package/dist/iac/fields/timestamp.d.cts.map +1 -0
- package/dist/iac/fields/timestamp.d.ts +11 -0
- package/dist/iac/fields/timestamp.d.ts.map +1 -0
- package/dist/iac/fields/timestamp.js +29 -0
- package/dist/iac/fields/timestamp.js.map +1 -0
- package/dist/iac/fields/uid.cjs +29 -0
- package/dist/iac/fields/uid.cjs.map +1 -0
- package/dist/iac/fields/uid.d.cts +11 -0
- package/dist/iac/fields/uid.d.cts.map +1 -0
- package/dist/iac/fields/uid.d.ts +11 -0
- package/dist/iac/fields/uid.d.ts.map +1 -0
- package/dist/iac/fields/uid.js +29 -0
- package/dist/iac/fields/uid.js.map +1 -0
- package/dist/iac/sharedSlice.cjs +54 -0
- package/dist/iac/sharedSlice.cjs.map +1 -0
- package/dist/iac/sharedSlice.d.cts +28 -0
- package/dist/iac/sharedSlice.d.cts.map +1 -0
- package/dist/iac/sharedSlice.d.ts +28 -0
- package/dist/iac/sharedSlice.d.ts.map +1 -0
- package/dist/iac/sharedSlice.js +54 -0
- package/dist/iac/sharedSlice.js.map +1 -0
- package/dist/iac/variation.cjs +45 -0
- package/dist/iac/variation.cjs.map +1 -0
- package/dist/iac/variation.d.cts +46 -0
- package/dist/iac/variation.d.cts.map +1 -0
- package/dist/iac/variation.d.ts +46 -0
- package/dist/iac/variation.d.ts.map +1 -0
- package/dist/iac/variation.js +44 -0
- package/dist/iac/variation.js.map +1 -0
- package/dist/iac.cjs +86 -0
- package/dist/iac.cjs.map +1 -0
- package/dist/iac.d.cts +109 -0
- package/dist/iac.d.cts.map +1 -0
- package/dist/iac.d.ts +110 -0
- package/dist/iac.d.ts.map +1 -0
- package/dist/iac.js +86 -0
- package/dist/iac.js.map +1 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/types/model/types.d.cts +2 -2
- package/dist/types/model/types.d.ts +2 -2
- package/package.json +9 -2
- package/src/iac/customType.ts +98 -0
- package/src/iac/fields/boolean.ts +55 -0
- package/src/iac/fields/color.ts +33 -0
- package/src/iac/fields/contentRelationship.ts +74 -0
- package/src/iac/fields/date.ts +33 -0
- package/src/iac/fields/embed.ts +33 -0
- package/src/iac/fields/geoPoint.ts +33 -0
- package/src/iac/fields/group.ts +58 -0
- package/src/iac/fields/image.ts +65 -0
- package/src/iac/fields/index.ts +62 -0
- package/src/iac/fields/integration.ts +43 -0
- package/src/iac/fields/link.ts +79 -0
- package/src/iac/fields/linkToMedia.ts +37 -0
- package/src/iac/fields/number.ts +35 -0
- package/src/iac/fields/richText.ts +84 -0
- package/src/iac/fields/select.ts +63 -0
- package/src/iac/fields/sliceZone.ts +82 -0
- package/src/iac/fields/table.ts +31 -0
- package/src/iac/fields/text.ts +33 -0
- package/src/iac/fields/timestamp.ts +35 -0
- package/src/iac/fields/uid.ts +33 -0
- package/src/iac/index.ts +122 -0
- package/src/iac/sharedSlice.ts +81 -0
- package/src/iac/variation.ts +107 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CustomTypeModelFieldType } from "../../types/model/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/richText.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a rich text field model.
|
|
6
|
+
*
|
|
7
|
+
* Use the `single` config option for title-style fields (single block).
|
|
8
|
+
* Use the `multi` config option for multi-block rich text content.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* // Multi-block rich text (default)
|
|
14
|
+
* model.richText({ label: "Description", multi: "paragraph,strong,em" })
|
|
15
|
+
*
|
|
16
|
+
* // Single-block title-style
|
|
17
|
+
* model.richText({ label: "Heading", single: "heading1" })
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param config - Configuration for the field.
|
|
21
|
+
*
|
|
22
|
+
* @returns A rich text field model.
|
|
23
|
+
*/
|
|
24
|
+
const richText = (config) => {
|
|
25
|
+
if ((config === null || config === void 0 ? void 0 : config.single) !== void 0) return {
|
|
26
|
+
type: CustomTypeModelFieldType.StructuredText,
|
|
27
|
+
config: {
|
|
28
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
29
|
+
placeholder: config === null || config === void 0 ? void 0 : config.placeholder,
|
|
30
|
+
allowTargetBlank: config === null || config === void 0 ? void 0 : config.allowTargetBlank,
|
|
31
|
+
single: config.single,
|
|
32
|
+
labels: config === null || config === void 0 ? void 0 : config.labels
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
type: CustomTypeModelFieldType.StructuredText,
|
|
37
|
+
config: {
|
|
38
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
39
|
+
placeholder: config === null || config === void 0 ? void 0 : config.placeholder,
|
|
40
|
+
allowTargetBlank: config === null || config === void 0 ? void 0 : config.allowTargetBlank,
|
|
41
|
+
multi: config === null || config === void 0 ? void 0 : config.multi,
|
|
42
|
+
labels: config === null || config === void 0 ? void 0 : config.labels
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { richText };
|
|
49
|
+
//# sourceMappingURL=richText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"richText.js","names":[],"sources":["../../../src/iac/fields/richText.ts"],"sourcesContent":["import type {\n\tCustomTypeModelRichTextField,\n\tCustomTypeModelRichTextMultiField,\n\tCustomTypeModelRichTextSingleField,\n} from \"../../types/model/richText\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a rich text field.\n *\n * Use `single` for title-style fields (single block).\n * Use `multi` for multi-block rich text content.\n */\nexport interface RichTextFieldConfig {\n\tlabel?: string | null\n\tplaceholder?: string\n\tallowTargetBlank?: boolean\n\t/**\n\t * Allowed block types for single-block mode (title-style).\n\t *\n\t * @example \"heading1\"\n\t * @example \"heading1,heading2,heading3\"\n\t */\n\tsingle?: string\n\t/**\n\t * Allowed block types for multi-block mode.\n\t *\n\t * @example \"paragraph,strong,em,hyperlink\"\n\t * @example \"paragraph,heading1,heading2,strong,em,hyperlink,list-item,o-list-item\"\n\t */\n\tmulti?: string\n\t/**\n\t * Custom labels for text styling.\n\t */\n\tlabels?: readonly string[]\n}\n\n/**\n * Creates a rich text field model.\n *\n * Use the `single` config option for title-style fields (single block).\n * Use the `multi` config option for multi-block rich text content.\n *\n * @example\n *\n * ```ts\n * // Multi-block rich text (default)\n * model.richText({ label: \"Description\", multi: \"paragraph,strong,em\" })\n *\n * // Single-block title-style\n * model.richText({ label: \"Heading\", single: \"heading1\" })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns A rich text field model.\n */\nexport const richText = (\n\tconfig?: RichTextFieldConfig,\n): CustomTypeModelRichTextField => {\n\tif (config?.single !== undefined) {\n\t\treturn {\n\t\t\ttype: CustomTypeModelFieldType.StructuredText,\n\t\t\tconfig: {\n\t\t\t\tlabel: config?.label ?? null,\n\t\t\t\tplaceholder: config?.placeholder,\n\t\t\t\tallowTargetBlank: config?.allowTargetBlank,\n\t\t\t\tsingle: config.single,\n\t\t\t\tlabels: config?.labels,\n\t\t\t},\n\t\t} satisfies CustomTypeModelRichTextSingleField\n\t}\n\n\treturn {\n\t\ttype: CustomTypeModelFieldType.StructuredText,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tplaceholder: config?.placeholder,\n\t\t\tallowTargetBlank: config?.allowTargetBlank,\n\t\t\tmulti: config?.multi,\n\t\t\tlabels: config?.labels,\n\t\t},\n\t} satisfies CustomTypeModelRichTextMultiField\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyDA,MAAa,YACZ,WACkC;AAClC,sDAAI,OAAQ,YAAW,OACtB,QAAO;EACN,MAAM,yBAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,6DAAa,OAAQ;GACrB,kEAAkB,OAAQ;GAC1B,QAAQ,OAAO;GACf,wDAAQ,OAAQ;GAChB;EACD;AAGF,QAAO;EACN,MAAM,yBAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,6DAAa,OAAQ;GACrB,kEAAkB,OAAQ;GAC1B,uDAAO,OAAQ;GACf,wDAAQ,OAAQ;GAChB;EACD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const require_types = require('../../types/model/types.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/select.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a select field model.
|
|
6
|
+
*
|
|
7
|
+
* Options are passed as the first argument for better type inference.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* // Basic select
|
|
13
|
+
* model.select(["draft", "published", "archived"] as const, {
|
|
14
|
+
* label: "Status"
|
|
15
|
+
* })
|
|
16
|
+
*
|
|
17
|
+
* // With default value (type-safe)
|
|
18
|
+
* model.select(["small", "medium", "large"] as const, {
|
|
19
|
+
* label: "Size",
|
|
20
|
+
* default_value: "medium"
|
|
21
|
+
* })
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @typeParam Option - Option value literals for type inference.
|
|
25
|
+
* @typeParam DefaultValue - Default value literal for type inference.
|
|
26
|
+
*
|
|
27
|
+
* @param options - Array of select options.
|
|
28
|
+
* @param config - Configuration for the field.
|
|
29
|
+
*
|
|
30
|
+
* @returns A select field model.
|
|
31
|
+
*/
|
|
32
|
+
const select = (options, config) => {
|
|
33
|
+
return {
|
|
34
|
+
type: require_types.CustomTypeModelFieldType.Select,
|
|
35
|
+
config: {
|
|
36
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
37
|
+
placeholder: config === null || config === void 0 ? void 0 : config.placeholder,
|
|
38
|
+
options,
|
|
39
|
+
default_value: config === null || config === void 0 ? void 0 : config.default_value
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
exports.select = select;
|
|
46
|
+
//# sourceMappingURL=select.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.cjs","names":["CustomTypeModelFieldType"],"sources":["../../../src/iac/fields/select.ts"],"sourcesContent":["import type { CustomTypeModelSelectField } from \"../../types/model/select\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a select field.\n */\nexport interface SelectFieldConfig<\n\tOption extends string,\n\tDefaultValue extends Option = Option,\n> {\n\tlabel?: string | null\n\tplaceholder?: string\n\t/**\n\t * Default selected option.\n\t */\n\tdefault_value?: DefaultValue\n}\n\n/**\n * Creates a select field model.\n *\n * Options are passed as the first argument for better type inference.\n *\n * @example\n *\n * ```ts\n * // Basic select\n * model.select([\"draft\", \"published\", \"archived\"] as const, {\n * label: \"Status\"\n * })\n *\n * // With default value (type-safe)\n * model.select([\"small\", \"medium\", \"large\"] as const, {\n * label: \"Size\",\n * default_value: \"medium\"\n * })\n * ```\n *\n * @typeParam Option - Option value literals for type inference.\n * @typeParam DefaultValue - Default value literal for type inference.\n *\n * @param options - Array of select options.\n * @param config - Configuration for the field.\n *\n * @returns A select field model.\n */\nexport const select = <\n\tOption extends string,\n\tDefaultValue extends Option = Option,\n>(\n\toptions: readonly Option[],\n\tconfig?: SelectFieldConfig<Option, DefaultValue>,\n): CustomTypeModelSelectField<Option, DefaultValue> => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Select,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tplaceholder: config?.placeholder,\n\t\t\toptions,\n\t\t\tdefault_value: config?.default_value,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAa,UAIZ,SACA,WACsD;AACtD,QAAO;EACN,MAAMA,uCAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,6DAAa,OAAQ;GACrB;GACA,+DAAe,OAAQ;GACvB;EACD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/iac/fields/select.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for a select field.
|
|
4
|
+
*/
|
|
5
|
+
interface SelectFieldConfig<Option extends string, DefaultValue extends Option = Option> {
|
|
6
|
+
label?: string | null;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Default selected option.
|
|
10
|
+
*/
|
|
11
|
+
default_value?: DefaultValue;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SelectFieldConfig };
|
|
15
|
+
//# sourceMappingURL=select.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.cts","names":[],"sources":["../../../src/iac/fields/select.ts"],"sourcesContent":[],"mappings":";AAMA;;;AASiB,UATA,iBASA,CAAA,eAAA,MAAA,EAAA,qBAPK,MAOL,GAPc,MAOd,CAAA,CAAA;EAAY,KAAA,CAAA,EAAA,MAAA,GAAA,IAAA;;;;;kBAAZ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/iac/fields/select.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for a select field.
|
|
4
|
+
*/
|
|
5
|
+
interface SelectFieldConfig<Option extends string, DefaultValue extends Option = Option> {
|
|
6
|
+
label?: string | null;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Default selected option.
|
|
10
|
+
*/
|
|
11
|
+
default_value?: DefaultValue;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SelectFieldConfig };
|
|
15
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","names":[],"sources":["../../../src/iac/fields/select.ts"],"sourcesContent":[],"mappings":";AAMA;;;AASiB,UATA,iBASA,CAAA,eAAA,MAAA,EAAA,qBAPK,MAOL,GAPc,MAOd,CAAA,CAAA;EAAY,KAAA,CAAA,EAAA,MAAA,GAAA,IAAA;;;;;kBAAZ"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { CustomTypeModelFieldType } from "../../types/model/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/select.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a select field model.
|
|
6
|
+
*
|
|
7
|
+
* Options are passed as the first argument for better type inference.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* // Basic select
|
|
13
|
+
* model.select(["draft", "published", "archived"] as const, {
|
|
14
|
+
* label: "Status"
|
|
15
|
+
* })
|
|
16
|
+
*
|
|
17
|
+
* // With default value (type-safe)
|
|
18
|
+
* model.select(["small", "medium", "large"] as const, {
|
|
19
|
+
* label: "Size",
|
|
20
|
+
* default_value: "medium"
|
|
21
|
+
* })
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @typeParam Option - Option value literals for type inference.
|
|
25
|
+
* @typeParam DefaultValue - Default value literal for type inference.
|
|
26
|
+
*
|
|
27
|
+
* @param options - Array of select options.
|
|
28
|
+
* @param config - Configuration for the field.
|
|
29
|
+
*
|
|
30
|
+
* @returns A select field model.
|
|
31
|
+
*/
|
|
32
|
+
const select = (options, config) => {
|
|
33
|
+
return {
|
|
34
|
+
type: CustomTypeModelFieldType.Select,
|
|
35
|
+
config: {
|
|
36
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
37
|
+
placeholder: config === null || config === void 0 ? void 0 : config.placeholder,
|
|
38
|
+
options,
|
|
39
|
+
default_value: config === null || config === void 0 ? void 0 : config.default_value
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { select };
|
|
46
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","names":[],"sources":["../../../src/iac/fields/select.ts"],"sourcesContent":["import type { CustomTypeModelSelectField } from \"../../types/model/select\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a select field.\n */\nexport interface SelectFieldConfig<\n\tOption extends string,\n\tDefaultValue extends Option = Option,\n> {\n\tlabel?: string | null\n\tplaceholder?: string\n\t/**\n\t * Default selected option.\n\t */\n\tdefault_value?: DefaultValue\n}\n\n/**\n * Creates a select field model.\n *\n * Options are passed as the first argument for better type inference.\n *\n * @example\n *\n * ```ts\n * // Basic select\n * model.select([\"draft\", \"published\", \"archived\"] as const, {\n * label: \"Status\"\n * })\n *\n * // With default value (type-safe)\n * model.select([\"small\", \"medium\", \"large\"] as const, {\n * label: \"Size\",\n * default_value: \"medium\"\n * })\n * ```\n *\n * @typeParam Option - Option value literals for type inference.\n * @typeParam DefaultValue - Default value literal for type inference.\n *\n * @param options - Array of select options.\n * @param config - Configuration for the field.\n *\n * @returns A select field model.\n */\nexport const select = <\n\tOption extends string,\n\tDefaultValue extends Option = Option,\n>(\n\toptions: readonly Option[],\n\tconfig?: SelectFieldConfig<Option, DefaultValue>,\n): CustomTypeModelSelectField<Option, DefaultValue> => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Select,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tplaceholder: config?.placeholder,\n\t\t\toptions,\n\t\t\tdefault_value: config?.default_value,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAa,UAIZ,SACA,WACsD;AACtD,QAAO;EACN,MAAM,yBAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,6DAAa,OAAQ;GACrB;GACA,+DAAe,OAAQ;GACvB;EACD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const require_types = require('../../types/model/types.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/sliceZone.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a slice zone field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.sliceZone({
|
|
11
|
+
* choices: {
|
|
12
|
+
* hero: { type: "SharedSlice" },
|
|
13
|
+
* text_block: { type: "SharedSlice" },
|
|
14
|
+
* image_gallery: { type: "SharedSlice" }
|
|
15
|
+
* }
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @typeParam Slices - Slice definitions for type inference.
|
|
20
|
+
*
|
|
21
|
+
* @param config - Configuration for the field.
|
|
22
|
+
*
|
|
23
|
+
* @returns A slice zone field model.
|
|
24
|
+
*/
|
|
25
|
+
const sliceZone = (config) => {
|
|
26
|
+
return {
|
|
27
|
+
type: require_types.CustomTypeModelFieldType.Slices,
|
|
28
|
+
config: {
|
|
29
|
+
choices: config === null || config === void 0 ? void 0 : config.choices,
|
|
30
|
+
labels: config === null || config === void 0 ? void 0 : config.labels
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
exports.sliceZone = sliceZone;
|
|
37
|
+
//# sourceMappingURL=sliceZone.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliceZone.cjs","names":["CustomTypeModelFieldType"],"sources":["../../../src/iac/fields/sliceZone.ts"],"sourcesContent":["import type {\n\tCustomTypeModelSliceZoneField,\n\tCustomTypeModelSliceLabel,\n\tCustomTypeModelSharedSlice,\n} from \"../../types/model/sliceZone\"\nimport type {\n\tCustomTypeModelSlice,\n\tCustomTypeModelLegacySlice,\n} from \"../../types/model/slice\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a slice zone field.\n */\nexport interface SliceZoneFieldConfig<\n\tSlices extends Record<\n\t\tstring,\n\t\tCustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice\n\t> = Record<\n\t\tstring,\n\t\tCustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice\n\t>,\n> {\n\t/**\n\t * Slice choices available in this slice zone.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * choices: {\n\t * hero: { type: \"SharedSlice\" },\n\t * text_block: { type: \"SharedSlice\" }\n\t * }\n\t * ```\n\t */\n\tchoices?: Slices\n\t/**\n\t * Labels for slices.\n\t */\n\tlabels?: Record<string, readonly CustomTypeModelSliceLabel[]> | null\n}\n\n/**\n * Creates a slice zone field model.\n *\n * @example\n *\n * ```ts\n * model.sliceZone({\n * choices: {\n * hero: { type: \"SharedSlice\" },\n * text_block: { type: \"SharedSlice\" },\n * image_gallery: { type: \"SharedSlice\" }\n * }\n * })\n * ```\n *\n * @typeParam Slices - Slice definitions for type inference.\n *\n * @param config - Configuration for the field.\n *\n * @returns A slice zone field model.\n */\nexport const sliceZone = <\n\tSlices extends Record<\n\t\tstring,\n\t\tCustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice\n\t> = Record<\n\t\tstring,\n\t\tCustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice\n\t>,\n>(\n\tconfig?: SliceZoneFieldConfig<Slices>,\n): CustomTypeModelSliceZoneField<Slices> => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Slices,\n\t\tconfig: {\n\t\t\tchoices: config?.choices,\n\t\t\tlabels: config?.labels,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAa,aASZ,WAC2C;AAC3C,QAAO;EACN,MAAMA,uCAAyB;EAC/B,QAAQ;GACP,yDAAS,OAAQ;GACjB,wDAAQ,OAAQ;GAChB;EACD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CustomTypeModelLegacySlice, CustomTypeModelSlice } from "../../types/model/slice.cjs";
|
|
2
|
+
import { CustomTypeModelSharedSlice, CustomTypeModelSliceLabel } from "../../types/model/sliceZone.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/iac/fields/sliceZone.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for a slice zone field.
|
|
8
|
+
*/
|
|
9
|
+
interface SliceZoneFieldConfig<Slices extends Record<string, CustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice> = Record<string, CustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice>> {
|
|
10
|
+
/**
|
|
11
|
+
* Slice choices available in this slice zone.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* choices: {
|
|
17
|
+
* hero: { type: "SharedSlice" },
|
|
18
|
+
* text_block: { type: "SharedSlice" }
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
choices?: Slices;
|
|
23
|
+
/**
|
|
24
|
+
* Labels for slices.
|
|
25
|
+
*/
|
|
26
|
+
labels?: Record<string, readonly CustomTypeModelSliceLabel[]> | null;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { SliceZoneFieldConfig };
|
|
30
|
+
//# sourceMappingURL=sliceZone.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliceZone.d.cts","names":[],"sources":["../../../src/iac/fields/sliceZone.ts"],"sourcesContent":[],"mappings":";;;;;;;AAcA;AAGE,UAHe,oBAGf,CAAA,eAFc,MAEd,CAAA,MAAA,EAAA,oBAAA,GAAuB,0BAAvB,GAAoD,0BAApD,CAAA,GACG,MADH,CAAA,MAAA,EAGA,oBAHA,GAGuB,0BAHvB,GAGoD,0BAHpD,CAAA,CAAA,CAAA;EAAuB;;;;;;;;;;;;YAkBd;;;;WAID,wBAAwB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CustomTypeModelLegacySlice, CustomTypeModelSlice } from "../../types/model/slice.js";
|
|
2
|
+
import { CustomTypeModelSharedSlice, CustomTypeModelSliceLabel } from "../../types/model/sliceZone.js";
|
|
3
|
+
|
|
4
|
+
//#region src/iac/fields/sliceZone.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for a slice zone field.
|
|
8
|
+
*/
|
|
9
|
+
interface SliceZoneFieldConfig<Slices extends Record<string, CustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice> = Record<string, CustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice>> {
|
|
10
|
+
/**
|
|
11
|
+
* Slice choices available in this slice zone.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* choices: {
|
|
17
|
+
* hero: { type: "SharedSlice" },
|
|
18
|
+
* text_block: { type: "SharedSlice" }
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
choices?: Slices;
|
|
23
|
+
/**
|
|
24
|
+
* Labels for slices.
|
|
25
|
+
*/
|
|
26
|
+
labels?: Record<string, readonly CustomTypeModelSliceLabel[]> | null;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { SliceZoneFieldConfig };
|
|
30
|
+
//# sourceMappingURL=sliceZone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliceZone.d.ts","names":[],"sources":["../../../src/iac/fields/sliceZone.ts"],"sourcesContent":[],"mappings":";;;;;;;AAcA;AAGE,UAHe,oBAGf,CAAA,eAFc,MAEd,CAAA,MAAA,EAAA,oBAAA,GAAuB,0BAAvB,GAAoD,0BAApD,CAAA,GACG,MADH,CAAA,MAAA,EAGA,oBAHA,GAGuB,0BAHvB,GAGoD,0BAHpD,CAAA,CAAA,CAAA;EAAuB;;;;;;;;;;;;YAkBd;;;;WAID,wBAAwB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CustomTypeModelFieldType } from "../../types/model/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/sliceZone.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a slice zone field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.sliceZone({
|
|
11
|
+
* choices: {
|
|
12
|
+
* hero: { type: "SharedSlice" },
|
|
13
|
+
* text_block: { type: "SharedSlice" },
|
|
14
|
+
* image_gallery: { type: "SharedSlice" }
|
|
15
|
+
* }
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @typeParam Slices - Slice definitions for type inference.
|
|
20
|
+
*
|
|
21
|
+
* @param config - Configuration for the field.
|
|
22
|
+
*
|
|
23
|
+
* @returns A slice zone field model.
|
|
24
|
+
*/
|
|
25
|
+
const sliceZone = (config) => {
|
|
26
|
+
return {
|
|
27
|
+
type: CustomTypeModelFieldType.Slices,
|
|
28
|
+
config: {
|
|
29
|
+
choices: config === null || config === void 0 ? void 0 : config.choices,
|
|
30
|
+
labels: config === null || config === void 0 ? void 0 : config.labels
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { sliceZone };
|
|
37
|
+
//# sourceMappingURL=sliceZone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliceZone.js","names":[],"sources":["../../../src/iac/fields/sliceZone.ts"],"sourcesContent":["import type {\n\tCustomTypeModelSliceZoneField,\n\tCustomTypeModelSliceLabel,\n\tCustomTypeModelSharedSlice,\n} from \"../../types/model/sliceZone\"\nimport type {\n\tCustomTypeModelSlice,\n\tCustomTypeModelLegacySlice,\n} from \"../../types/model/slice\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a slice zone field.\n */\nexport interface SliceZoneFieldConfig<\n\tSlices extends Record<\n\t\tstring,\n\t\tCustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice\n\t> = Record<\n\t\tstring,\n\t\tCustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice\n\t>,\n> {\n\t/**\n\t * Slice choices available in this slice zone.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * choices: {\n\t * hero: { type: \"SharedSlice\" },\n\t * text_block: { type: \"SharedSlice\" }\n\t * }\n\t * ```\n\t */\n\tchoices?: Slices\n\t/**\n\t * Labels for slices.\n\t */\n\tlabels?: Record<string, readonly CustomTypeModelSliceLabel[]> | null\n}\n\n/**\n * Creates a slice zone field model.\n *\n * @example\n *\n * ```ts\n * model.sliceZone({\n * choices: {\n * hero: { type: \"SharedSlice\" },\n * text_block: { type: \"SharedSlice\" },\n * image_gallery: { type: \"SharedSlice\" }\n * }\n * })\n * ```\n *\n * @typeParam Slices - Slice definitions for type inference.\n *\n * @param config - Configuration for the field.\n *\n * @returns A slice zone field model.\n */\nexport const sliceZone = <\n\tSlices extends Record<\n\t\tstring,\n\t\tCustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice\n\t> = Record<\n\t\tstring,\n\t\tCustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice\n\t>,\n>(\n\tconfig?: SliceZoneFieldConfig<Slices>,\n): CustomTypeModelSliceZoneField<Slices> => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Slices,\n\t\tconfig: {\n\t\t\tchoices: config?.choices,\n\t\t\tlabels: config?.labels,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAa,aASZ,WAC2C;AAC3C,QAAO;EACN,MAAM,yBAAyB;EAC/B,QAAQ;GACP,yDAAS,OAAQ;GACjB,wDAAQ,OAAQ;GAChB;EACD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const require_types = require('../../types/model/types.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/table.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a table field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.table({ label: "Data Table" })
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param config - Configuration for the field.
|
|
14
|
+
*
|
|
15
|
+
* @returns A table field model.
|
|
16
|
+
*/
|
|
17
|
+
const table = (config) => {
|
|
18
|
+
return {
|
|
19
|
+
type: require_types.CustomTypeModelFieldType.Table,
|
|
20
|
+
config: { label: (config === null || config === void 0 ? void 0 : config.label) ?? null }
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.table = table;
|
|
26
|
+
//# sourceMappingURL=table.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.cjs","names":["CustomTypeModelFieldType"],"sources":["../../../src/iac/fields/table.ts"],"sourcesContent":["import type { CustomTypeModelTableField } from \"../../types/model/table\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a table field.\n */\nexport interface TableFieldConfig {\n\tlabel?: string | null\n}\n\n/**\n * Creates a table field model.\n *\n * @example\n *\n * ```ts\n * model.table({ label: \"Data Table\" })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns A table field model.\n */\nexport const table = (config?: TableFieldConfig): CustomTypeModelTableField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Table,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuBA,MAAa,SAAS,WAAyD;AAC9E,QAAO;EACN,MAAMA,uCAAyB;EAC/B,QAAQ,EACP,wDAAO,OAAQ,UAAS,MACxB;EACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.cts","names":[],"sources":["../../../src/iac/fields/table.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,gBAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","names":[],"sources":["../../../src/iac/fields/table.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,gBAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CustomTypeModelFieldType } from "../../types/model/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/table.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a table field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.table({ label: "Data Table" })
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param config - Configuration for the field.
|
|
14
|
+
*
|
|
15
|
+
* @returns A table field model.
|
|
16
|
+
*/
|
|
17
|
+
const table = (config) => {
|
|
18
|
+
return {
|
|
19
|
+
type: CustomTypeModelFieldType.Table,
|
|
20
|
+
config: { label: (config === null || config === void 0 ? void 0 : config.label) ?? null }
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { table };
|
|
26
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","names":[],"sources":["../../../src/iac/fields/table.ts"],"sourcesContent":["import type { CustomTypeModelTableField } from \"../../types/model/table\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a table field.\n */\nexport interface TableFieldConfig {\n\tlabel?: string | null\n}\n\n/**\n * Creates a table field model.\n *\n * @example\n *\n * ```ts\n * model.table({ label: \"Data Table\" })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns A table field model.\n */\nexport const table = (config?: TableFieldConfig): CustomTypeModelTableField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Table,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuBA,MAAa,SAAS,WAAyD;AAC9E,QAAO;EACN,MAAM,yBAAyB;EAC/B,QAAQ,EACP,wDAAO,OAAQ,UAAS,MACxB;EACD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const require_types = require('../../types/model/types.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/text.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a text field model (key text).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.text({ label: "Title" })
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param config - Configuration for the field.
|
|
14
|
+
*
|
|
15
|
+
* @returns A text field model.
|
|
16
|
+
*/
|
|
17
|
+
const text = (config) => {
|
|
18
|
+
return {
|
|
19
|
+
type: require_types.CustomTypeModelFieldType.Text,
|
|
20
|
+
config: {
|
|
21
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
22
|
+
placeholder: config === null || config === void 0 ? void 0 : config.placeholder
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.text = text;
|
|
29
|
+
//# sourceMappingURL=text.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.cjs","names":["CustomTypeModelFieldType"],"sources":["../../../src/iac/fields/text.ts"],"sourcesContent":["import type { CustomTypeModelKeyTextField } from \"../../types/model/keyText\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a text field.\n */\nexport interface TextFieldConfig {\n\tlabel?: string | null\n\tplaceholder?: string\n}\n\n/**\n * Creates a text field model (key text).\n *\n * @example\n *\n * ```ts\n * model.text({ label: \"Title\" })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns A text field model.\n */\nexport const text = (config?: TextFieldConfig): CustomTypeModelKeyTextField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Text,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tplaceholder: config?.placeholder,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,MAAa,QAAQ,WAA0D;AAC9E,QAAO;EACN,MAAMA,uCAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,6DAAa,OAAQ;GACrB;EACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.cts","names":[],"sources":["../../../src/iac/fields/text.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,eAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","names":[],"sources":["../../../src/iac/fields/text.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,eAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CustomTypeModelFieldType } from "../../types/model/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/text.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a text field model (key text).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.text({ label: "Title" })
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param config - Configuration for the field.
|
|
14
|
+
*
|
|
15
|
+
* @returns A text field model.
|
|
16
|
+
*/
|
|
17
|
+
const text = (config) => {
|
|
18
|
+
return {
|
|
19
|
+
type: CustomTypeModelFieldType.Text,
|
|
20
|
+
config: {
|
|
21
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
22
|
+
placeholder: config === null || config === void 0 ? void 0 : config.placeholder
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { text };
|
|
29
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","names":[],"sources":["../../../src/iac/fields/text.ts"],"sourcesContent":["import type { CustomTypeModelKeyTextField } from \"../../types/model/keyText\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a text field.\n */\nexport interface TextFieldConfig {\n\tlabel?: string | null\n\tplaceholder?: string\n}\n\n/**\n * Creates a text field model (key text).\n *\n * @example\n *\n * ```ts\n * model.text({ label: \"Title\" })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns A text field model.\n */\nexport const text = (config?: TextFieldConfig): CustomTypeModelKeyTextField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Text,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tplaceholder: config?.placeholder,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,MAAa,QAAQ,WAA0D;AAC9E,QAAO;EACN,MAAM,yBAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,6DAAa,OAAQ;GACrB;EACD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const require_types = require('../../types/model/types.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/iac/fields/timestamp.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a timestamp field model.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* model.timestamp({ label: "Event Time" })
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param config - Configuration for the field.
|
|
14
|
+
*
|
|
15
|
+
* @returns A timestamp field model.
|
|
16
|
+
*/
|
|
17
|
+
const timestamp = (config) => {
|
|
18
|
+
return {
|
|
19
|
+
type: require_types.CustomTypeModelFieldType.Timestamp,
|
|
20
|
+
config: {
|
|
21
|
+
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
22
|
+
placeholder: config === null || config === void 0 ? void 0 : config.placeholder
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.timestamp = timestamp;
|
|
29
|
+
//# sourceMappingURL=timestamp.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp.cjs","names":["CustomTypeModelFieldType"],"sources":["../../../src/iac/fields/timestamp.ts"],"sourcesContent":["import type { CustomTypeModelTimestampField } from \"../../types/model/timestamp\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a timestamp field.\n */\nexport interface TimestampFieldConfig {\n\tlabel?: string | null\n\tplaceholder?: string\n}\n\n/**\n * Creates a timestamp field model.\n *\n * @example\n *\n * ```ts\n * model.timestamp({ label: \"Event Time\" })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns A timestamp field model.\n */\nexport const timestamp = (\n\tconfig?: TimestampFieldConfig,\n): CustomTypeModelTimestampField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Timestamp,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tplaceholder: config?.placeholder,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,MAAa,aACZ,WACmC;AACnC,QAAO;EACN,MAAMA,uCAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,6DAAa,OAAQ;GACrB;EACD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/iac/fields/timestamp.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for a timestamp field.
|
|
4
|
+
*/
|
|
5
|
+
interface TimestampFieldConfig {
|
|
6
|
+
label?: string | null;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { TimestampFieldConfig };
|
|
11
|
+
//# sourceMappingURL=timestamp.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp.d.cts","names":[],"sources":["../../../src/iac/fields/timestamp.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,oBAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/iac/fields/timestamp.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for a timestamp field.
|
|
4
|
+
*/
|
|
5
|
+
interface TimestampFieldConfig {
|
|
6
|
+
label?: string | null;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { TimestampFieldConfig };
|
|
11
|
+
//# sourceMappingURL=timestamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp.d.ts","names":[],"sources":["../../../src/iac/fields/timestamp.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,oBAAA"}
|