@duke333/builder-ui 0.1.4 → 0.1.5
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 +7 -0
- package/dist/{BuilderAdminPages-Buy2nvjs.d.ts → BuilderAdminPages-C-jaMLOa.d.ts} +6 -0
- package/dist/{RuntimeEntryDialog-DAO74GFp.d.ts → RuntimeEntryDialog-Bw741XbS.d.ts} +12 -5
- package/dist/admin/index.d.ts +2 -2
- package/dist/admin/index.js +30 -3
- package/dist/admin/index.js.map +1 -1
- package/dist/components/index.d.ts +5 -3
- package/dist/components/index.js +53 -25
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +76 -8
- package/dist/index.js.map +1 -1
- package/dist/integration/index.d.ts +1 -1
- package/dist/integration/index.js +30 -3
- package/dist/integration/index.js.map +1 -1
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.js.map +1 -1
- package/package.json +1 -1
package/dist/runtime/index.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ type BuilderRuntimeFieldLike = {
|
|
|
2
2
|
key: string;
|
|
3
3
|
type: string;
|
|
4
4
|
};
|
|
5
|
+
type BuilderRuntimePresentation = "dialog" | "drawer";
|
|
5
6
|
type BuilderRuntimeFormSchemaLike = {
|
|
7
|
+
presentation?: BuilderRuntimePresentation;
|
|
6
8
|
fields: readonly BuilderRuntimeFieldLike[];
|
|
7
9
|
};
|
|
8
10
|
type BuilderRuntimeViewLike = {
|
|
@@ -25,4 +27,4 @@ declare function createBuilderFormDefaultValues(schema?: BuilderRuntimeFormSchem
|
|
|
25
27
|
declare function createBuilderEntryDefaultValues(view: BuilderRuntimeViewLike, editing: BuilderRuntimeEntryLike | null): BuilderRuntimeEntryValues;
|
|
26
28
|
declare function formatBuilderRuntimeValue(value: unknown, locale?: string): string;
|
|
27
29
|
|
|
28
|
-
export { type BuilderRuntimeEntryLike, type BuilderRuntimeEntryValues, type BuilderRuntimeFieldLike, type BuilderRuntimeFormSchemaLike, type BuilderRuntimeFormValues, type BuilderRuntimeViewLike, createBuilderEntryDefaultValues, createBuilderFormDefaultValues, formatBuilderRuntimeValue };
|
|
30
|
+
export { type BuilderRuntimeEntryLike, type BuilderRuntimeEntryValues, type BuilderRuntimeFieldLike, type BuilderRuntimeFormSchemaLike, type BuilderRuntimeFormValues, type BuilderRuntimePresentation, type BuilderRuntimeViewLike, createBuilderEntryDefaultValues, createBuilderFormDefaultValues, formatBuilderRuntimeValue };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/runtime/runtimeUtils.ts"],"sourcesContent":["export type BuilderRuntimeFieldLike = {\n key: string;\n type: string;\n};\n\nexport type BuilderRuntimeFormSchemaLike = {\n fields: readonly BuilderRuntimeFieldLike[];\n};\n\nexport type BuilderRuntimeViewLike = {\n form?: {\n schema: BuilderRuntimeFormSchemaLike;\n } | null;\n};\n\nexport type BuilderRuntimeEntryLike = {\n id: string;\n values: Record<string, unknown>;\n version: number;\n};\n\nexport type BuilderRuntimeFormValues = {\n values: Record<string, unknown>;\n};\n\nexport type BuilderRuntimeEntryValues = BuilderRuntimeFormValues & {\n version: number;\n};\n\nfunction emptyFieldValue(field: BuilderRuntimeFieldLike) {\n return field.type === \"checkbox\" ? false : \"\";\n}\n\nexport function createBuilderFormDefaultValues(\n schema?: BuilderRuntimeFormSchemaLike,\n): BuilderRuntimeFormValues {\n const values: Record<string, unknown> = {};\n for (const field of schema?.fields ?? []) {\n values[field.key] = emptyFieldValue(field);\n }\n return { values };\n}\n\nexport function createBuilderEntryDefaultValues(\n view: BuilderRuntimeViewLike,\n editing: BuilderRuntimeEntryLike | null,\n): BuilderRuntimeEntryValues {\n const values: Record<string, unknown> = {};\n for (const field of view.form?.schema.fields ?? []) {\n const existing = editing?.values[field.key];\n values[field.key] = existing === undefined ? emptyFieldValue(field) : existing;\n }\n return { values, version: editing?.version ?? 0 };\n}\n\nexport function formatBuilderRuntimeValue(value: unknown, locale = \"mn-MN\") {\n if (value === null || value === undefined || value === \"\") return \"—\";\n if (typeof value === \"boolean\") return value ? \"Тийм\" : \"Үгүй\";\n if (typeof value === \"number\") return new Intl.NumberFormat(locale).format(value);\n return String(value);\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/runtimeUtils.ts"],"sourcesContent":["export type BuilderRuntimeFieldLike = {\n key: string;\n type: string;\n};\n\nexport type BuilderRuntimePresentation = \"dialog\" | \"drawer\";\n\nexport type BuilderRuntimeFormSchemaLike = {\n presentation?: BuilderRuntimePresentation;\n fields: readonly BuilderRuntimeFieldLike[];\n};\n\nexport type BuilderRuntimeViewLike = {\n form?: {\n schema: BuilderRuntimeFormSchemaLike;\n } | null;\n};\n\nexport type BuilderRuntimeEntryLike = {\n id: string;\n values: Record<string, unknown>;\n version: number;\n};\n\nexport type BuilderRuntimeFormValues = {\n values: Record<string, unknown>;\n};\n\nexport type BuilderRuntimeEntryValues = BuilderRuntimeFormValues & {\n version: number;\n};\n\nfunction emptyFieldValue(field: BuilderRuntimeFieldLike) {\n return field.type === \"checkbox\" ? false : \"\";\n}\n\nexport function createBuilderFormDefaultValues(\n schema?: BuilderRuntimeFormSchemaLike,\n): BuilderRuntimeFormValues {\n const values: Record<string, unknown> = {};\n for (const field of schema?.fields ?? []) {\n values[field.key] = emptyFieldValue(field);\n }\n return { values };\n}\n\nexport function createBuilderEntryDefaultValues(\n view: BuilderRuntimeViewLike,\n editing: BuilderRuntimeEntryLike | null,\n): BuilderRuntimeEntryValues {\n const values: Record<string, unknown> = {};\n for (const field of view.form?.schema.fields ?? []) {\n const existing = editing?.values[field.key];\n values[field.key] = existing === undefined ? emptyFieldValue(field) : existing;\n }\n return { values, version: editing?.version ?? 0 };\n}\n\nexport function formatBuilderRuntimeValue(value: unknown, locale = \"mn-MN\") {\n if (value === null || value === undefined || value === \"\") return \"—\";\n if (typeof value === \"boolean\") return value ? \"Тийм\" : \"Үгүй\";\n if (typeof value === \"number\") return new Intl.NumberFormat(locale).format(value);\n return String(value);\n}\n"],"mappings":";AAgCA,SAAS,gBAAgB,OAAgC;AACvD,SAAO,MAAM,SAAS,aAAa,QAAQ;AAC7C;AAEO,SAAS,+BACd,QAC0B;AAC1B,QAAM,SAAkC,CAAC;AACzC,aAAW,SAAS,QAAQ,UAAU,CAAC,GAAG;AACxC,WAAO,MAAM,GAAG,IAAI,gBAAgB,KAAK;AAAA,EAC3C;AACA,SAAO,EAAE,OAAO;AAClB;AAEO,SAAS,gCACd,MACA,SAC2B;AAC3B,QAAM,SAAkC,CAAC;AACzC,aAAW,SAAS,KAAK,MAAM,OAAO,UAAU,CAAC,GAAG;AAClD,UAAM,WAAW,SAAS,OAAO,MAAM,GAAG;AAC1C,WAAO,MAAM,GAAG,IAAI,aAAa,SAAY,gBAAgB,KAAK,IAAI;AAAA,EACxE;AACA,SAAO,EAAE,QAAQ,SAAS,SAAS,WAAW,EAAE;AAClD;AAEO,SAAS,0BAA0B,OAAgB,SAAS,SAAS;AAC1E,MAAI,UAAU,QAAQ,UAAU,UAAa,UAAU,GAAI,QAAO;AAClE,MAAI,OAAO,UAAU,UAAW,QAAO,QAAQ,6BAAS;AACxD,MAAI,OAAO,UAAU,SAAU,QAAO,IAAI,KAAK,aAAa,MAAM,EAAE,OAAO,KAAK;AAChF,SAAO,OAAO,KAAK;AACrB;","names":[]}
|