@prismicio/vue 5.3.0-canary.5d9ea4c → 5.3.0-canary.87748cc
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/PrismicImage.vue.d.cts +30 -58
- package/dist/PrismicImage.vue.d.cts.map +1 -1
- package/dist/PrismicLink.vue.d.cts +65 -137
- package/dist/PrismicLink.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +25 -53
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/types.d.cts +18 -5
- package/dist/PrismicRichText/types.d.cts.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue.d.cts +10 -10
- package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -1
- package/dist/PrismicTable/types.d.cts +8 -8
- package/dist/PrismicTable/types.d.cts.map +1 -1
- package/dist/PrismicText.vue.d.cts +3 -13
- package/dist/PrismicText.vue.d.cts.map +1 -1
- package/dist/SliceZone/SliceZone.vue.d.cts +5 -24
- package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -1
- package/dist/index.cjs +3 -10
- package/dist/index.d.cts +9 -13
- package/dist/index.d.ts +11 -15
- package/dist/index.js +3 -6
- 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/src/PrismicImage.cjs.map +1 -1
- package/dist/src/PrismicImage.js.map +1 -1
- package/dist/src/PrismicImage.vue.d.ts +26 -54
- package/dist/src/PrismicImage.vue.d.ts.map +1 -1
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs +2 -4
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js +2 -4
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicLink.cjs.map +1 -1
- package/dist/src/PrismicLink.js.map +1 -1
- package/dist/src/PrismicLink.vue.d.ts +61 -133
- package/dist/src/PrismicLink.vue.d.ts.map +1 -1
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +3 -6
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js +3 -6
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts +25 -53
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +41 -57
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js +42 -58
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs +53 -33
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js +54 -34
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs +9 -29
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js +10 -30
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/types.d.ts +18 -5
- package/dist/src/PrismicRichText/types.d.ts.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue.d.ts +13 -13
- package/dist/src/PrismicTable/PrismicTable.vue.d.ts.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +47 -19
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js +48 -20
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs +36 -18
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js +36 -18
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTableRow.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTableRow.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs +13 -10
- package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js +14 -11
- package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicTable/types.d.ts +8 -8
- package/dist/src/PrismicTable/types.d.ts.map +1 -1
- package/dist/src/PrismicText.cjs.map +1 -1
- package/dist/src/PrismicText.js.map +1 -1
- package/dist/src/PrismicText.vue.d.ts +1 -11
- package/dist/src/PrismicText.vue.d.ts.map +1 -1
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs +1 -12
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js +3 -14
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/SliceZone/SliceZone.cjs.map +1 -1
- package/dist/src/SliceZone/SliceZone.js.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue.d.ts +5 -24
- package/dist/src/SliceZone/SliceZone.vue.d.ts.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs +5 -17
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js +6 -18
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/types.cjs +9 -0
- package/dist/src/types.cjs.map +1 -0
- package/dist/src/types.d.ts +3 -352
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +8 -0
- package/dist/src/types.js.map +1 -0
- package/dist/types.d.cts +3 -352
- package/dist/types.d.cts.map +1 -1
- package/package.json +6 -5
- package/src/PrismicImage.vue +10 -27
- package/src/PrismicLink.vue +18 -43
- package/src/PrismicRichText/PrismicRichText.vue +68 -118
- package/src/PrismicRichText/PrismicRichTextDefaultComponent.vue +61 -19
- package/src/PrismicRichText/PrismicRichTextSerialize.vue +5 -30
- package/src/PrismicRichText/types.ts +33 -14
- package/src/PrismicTable/PrismicTable.vue +50 -23
- package/src/PrismicTable/PrismicTableDefaultComponents.ts +45 -20
- package/src/PrismicTable/PrismicTableRow.vue +17 -24
- package/src/PrismicTable/types.ts +28 -15
- package/src/PrismicText.vue +3 -18
- package/src/SliceZone/SliceZone.vue +12 -41
- package/src/index.ts +13 -21
- package/src/types.ts +30 -438
- package/dist/PrismicEmbed.vue.d.cts +0 -25
- package/dist/PrismicEmbed.vue.d.cts.map +0 -1
- package/dist/createPrismic.d.cts +0 -29
- package/dist/createPrismic.d.cts.map +0 -1
- package/dist/src/PrismicEmbed.cjs +0 -8
- package/dist/src/PrismicEmbed.cjs.map +0 -1
- package/dist/src/PrismicEmbed.js +0 -8
- package/dist/src/PrismicEmbed.js.map +0 -1
- package/dist/src/PrismicEmbed.vue.d.ts +0 -25
- package/dist/src/PrismicEmbed.vue.d.ts.map +0 -1
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs +0 -42
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js +0 -42
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs +0 -8
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js +0 -8
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs +0 -92
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js +0 -92
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/createPrismic.cjs +0 -85
- package/dist/src/createPrismic.cjs.map +0 -1
- package/dist/src/createPrismic.d.ts +0 -29
- package/dist/src/createPrismic.d.ts.map +0 -1
- package/dist/src/createPrismic.js +0 -85
- package/dist/src/createPrismic.js.map +0 -1
- package/dist/src/lib/Wrapper.cjs +0 -8
- package/dist/src/lib/Wrapper.cjs.map +0 -1
- package/dist/src/lib/Wrapper.js +0 -8
- package/dist/src/lib/Wrapper.js.map +0 -1
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs +0 -22
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js +0 -22
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/usePrismic.cjs +0 -38
- package/dist/src/usePrismic.cjs.map +0 -1
- package/dist/src/usePrismic.d.ts +0 -36
- package/dist/src/usePrismic.d.ts.map +0 -1
- package/dist/src/usePrismic.js +0 -37
- package/dist/src/usePrismic.js.map +0 -1
- package/dist/usePrismic.d.cts +0 -36
- package/dist/usePrismic.d.cts.map +0 -1
- package/src/PrismicEmbed.vue +0 -42
- package/src/PrismicRichText/DeprecatedPrismicRichText.vue +0 -146
- package/src/createPrismic.ts +0 -154
- package/src/lib/Wrapper.vue +0 -22
- package/src/usePrismic.ts +0 -36
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"PrismicTable.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/** The Prismic table field to render. */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * thead: { class: 'bg-black text-white' },\n\t * th: { as: 'td', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" v-bind=\"$attrs\" />\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.js","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"PrismicTable.js","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/** The Prismic table field to render. */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * thead: { class: 'bg-black text-white' },\n\t * th: { as: 'td', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" v-bind=\"$attrs\" />\n</template>\n"],"mappings":""}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { VueRichTextSerializer } from "../PrismicRichText/types.js";
|
|
2
1
|
import { ComponentOrTagName } from "../types.js";
|
|
3
|
-
import {
|
|
2
|
+
import { VueRichTextSerializer } from "../PrismicRichText/types.js";
|
|
4
3
|
import "../PrismicRichText/index.js";
|
|
5
|
-
import
|
|
4
|
+
import { VueTableComponents } from "./types.js";
|
|
5
|
+
import * as vue6 from "vue";
|
|
6
6
|
import { TableField } from "@prismicio/client";
|
|
7
7
|
|
|
8
8
|
//#region src/PrismicTable/PrismicTable.vue.d.ts
|
|
@@ -10,29 +10,29 @@ import { TableField } from "@prismicio/client";
|
|
|
10
10
|
* Props for `<PrismicTable />`.
|
|
11
11
|
*/
|
|
12
12
|
type PrismicTableProps = {
|
|
13
|
-
/**
|
|
14
|
-
* The Prismic table field to render.
|
|
15
|
-
*/
|
|
13
|
+
/** The Prismic table field to render. */
|
|
16
14
|
field: TableField | undefined;
|
|
17
15
|
/**
|
|
18
|
-
*
|
|
19
|
-
* given, `null` (nothing) will be rendered.
|
|
20
|
-
*/
|
|
21
|
-
fallback?: ComponentOrTagName;
|
|
22
|
-
/**
|
|
23
|
-
* An object that maps a table block type to a Vue component.
|
|
16
|
+
* An object that maps a table block type to a Vue component or a shorthand definition.
|
|
24
17
|
*
|
|
25
18
|
* @example
|
|
26
19
|
*
|
|
27
20
|
* ```javascript
|
|
28
21
|
* {
|
|
29
22
|
* table: Table,
|
|
23
|
+
* thead: { class: 'bg-black text-white' },
|
|
24
|
+
* th: { as: 'td', class: 'font-bold' },
|
|
30
25
|
* }
|
|
31
26
|
* ```
|
|
32
27
|
*/
|
|
33
28
|
components?: VueTableComponents & VueRichTextSerializer;
|
|
29
|
+
/**
|
|
30
|
+
* The value to be rendered when the field is empty. If a fallback is not
|
|
31
|
+
* given, `null` (nothing) will be rendered.
|
|
32
|
+
*/
|
|
33
|
+
fallback?: ComponentOrTagName;
|
|
34
34
|
};
|
|
35
|
-
declare const __VLS_export:
|
|
35
|
+
declare const __VLS_export: vue6.DefineComponent<PrismicTableProps, {}, {}, {}, {}, vue6.ComponentOptionsMixin, vue6.ComponentOptionsMixin, {}, string, vue6.PublicProps, Readonly<PrismicTableProps> & Readonly<{}>, {}, {}, {}, {}, string, vue6.ComponentProvideOptions, false, {}, any>;
|
|
36
36
|
declare const _default: typeof __VLS_export;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { PrismicTableProps, _default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.vue.d.ts","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"PrismicTable.vue.d.ts","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;KA4HY,iBAAA;EAAA;EAEJ,KAAA,EAAA,UAAA,GAAA,SAAA;EAeM;;;;AAOb;;;;;;;;;EAkJiB,UAAA,CAAA,EAzJJ,kBAyJI,GAzJiB,qBAyJjB;EAAA;AAAA;;;aAnJN;;cAmJN,cAAY,IAAA,CAAA,gBAAA,mCAAA,IAAA,CAAA,qBAAA,EAAA,IAAA,CAAA,qBAAA,cAAA,IAAA,CAAA,WAAA,EAAA,SAAA,qBAAA,sCAAA,IAAA,CAAA,uBAAA;cAAA,iBAGU"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const require_types = require('../types.cjs');
|
|
1
2
|
const require_PrismicTableDefaultComponents = require('./PrismicTableDefaultComponents.cjs');
|
|
2
3
|
const require_PrismicTableRow = require('./PrismicTableRow.cjs');
|
|
3
4
|
let vue = require("vue");
|
|
@@ -12,50 +13,77 @@ var PrismicTable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
|
|
|
12
13
|
type: null,
|
|
13
14
|
required: true
|
|
14
15
|
},
|
|
15
|
-
fallback: {
|
|
16
|
-
type: null,
|
|
17
|
-
required: false
|
|
18
|
-
},
|
|
19
16
|
components: {
|
|
20
17
|
type: Object,
|
|
21
18
|
required: false
|
|
19
|
+
},
|
|
20
|
+
fallback: {
|
|
21
|
+
type: null,
|
|
22
|
+
required: false
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
25
|
setup(__props) {
|
|
25
26
|
const props = __props;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
function getInternalComponent(type) {
|
|
28
|
+
const maybeComponentOrShorthand = props.components?.[type];
|
|
29
|
+
if (require_types.isVueComponent(maybeComponentOrShorthand)) return { is: maybeComponentOrShorthand };
|
|
30
|
+
return {
|
|
31
|
+
is: require_PrismicTableDefaultComponents.defaultTableComponents[type],
|
|
32
|
+
shorthand: maybeComponentOrShorthand
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const tableComponents = (0, vue.computed)(() => {
|
|
36
|
+
return {
|
|
37
|
+
table: getInternalComponent("table"),
|
|
38
|
+
thead: getInternalComponent("thead"),
|
|
39
|
+
tbody: getInternalComponent("tbody"),
|
|
40
|
+
tr: getInternalComponent("tr"),
|
|
41
|
+
th: getInternalComponent("th"),
|
|
42
|
+
td: getInternalComponent("td")
|
|
43
|
+
};
|
|
44
|
+
});
|
|
30
45
|
return (_ctx, _cache) => {
|
|
31
|
-
return (0, vue.unref)(__prismicio_client.isFilled).table(__props.field) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(
|
|
46
|
+
return (0, vue.unref)(__prismicio_client.isFilled).table(__props.field) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tableComponents.value.table.is), (0, vue.mergeProps)({
|
|
32
47
|
key: 0,
|
|
33
48
|
table: __props.field
|
|
34
|
-
},
|
|
35
|
-
|
|
49
|
+
}, {
|
|
50
|
+
..._ctx.$attrs,
|
|
51
|
+
...tableComponents.value.table.shorthand
|
|
52
|
+
}), {
|
|
53
|
+
default: (0, vue.withCtx)(() => [__props.field.head ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tableComponents.value.thead.is), (0, vue.mergeProps)({
|
|
36
54
|
key: 0,
|
|
37
55
|
head: __props.field.head
|
|
38
|
-
}, {
|
|
56
|
+
}, tableComponents.value.thead.shorthand), {
|
|
39
57
|
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.field.head.rows, (row) => {
|
|
40
58
|
return (0, vue.openBlock)(), (0, vue.createBlock)(require_PrismicTableRow.default, {
|
|
41
59
|
key: row.key,
|
|
42
60
|
row,
|
|
43
|
-
|
|
44
|
-
|
|
61
|
+
internalTableComponents: tableComponents.value,
|
|
62
|
+
components: __props.components
|
|
63
|
+
}, null, 8, [
|
|
64
|
+
"row",
|
|
65
|
+
"internalTableComponents",
|
|
66
|
+
"components"
|
|
67
|
+
]);
|
|
45
68
|
}), 128))]),
|
|
46
69
|
_: 1
|
|
47
|
-
},
|
|
70
|
+
}, 16, ["head"])) : (0, vue.createCommentVNode)("v-if", true), ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tableComponents.value.tbody.is), (0, vue.mergeProps)({ body: __props.field.body }, tableComponents.value.tbody.shorthand), {
|
|
48
71
|
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.field.body.rows, (row) => {
|
|
49
72
|
return (0, vue.openBlock)(), (0, vue.createBlock)(require_PrismicTableRow.default, {
|
|
50
73
|
key: row.key,
|
|
51
74
|
row,
|
|
52
|
-
|
|
53
|
-
|
|
75
|
+
internalTableComponents: tableComponents.value,
|
|
76
|
+
components: __props.components
|
|
77
|
+
}, null, 8, [
|
|
78
|
+
"row",
|
|
79
|
+
"internalTableComponents",
|
|
80
|
+
"components"
|
|
81
|
+
]);
|
|
54
82
|
}), 128))]),
|
|
55
83
|
_: 1
|
|
56
|
-
},
|
|
84
|
+
}, 16, ["body"]))]),
|
|
57
85
|
_: 1
|
|
58
|
-
}, 16, ["table"])) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.fallback), { key: 1 }));
|
|
86
|
+
}, 16, ["table"])) : __props.fallback ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.fallback), (0, vue.normalizeProps)((0, vue.mergeProps)({ key: 1 }, _ctx.$attrs)), null, 16)) : (0, vue.createCommentVNode)("v-if", true);
|
|
59
87
|
};
|
|
60
88
|
}
|
|
61
89
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.cjs","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.cjs","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/** The Prismic table field to render. */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * thead: { class: 'bg-black text-white' },\n\t * th: { as: 'td', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" v-bind=\"$attrs\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,QAAQ;EAGd,SAAS,qBAAqB,MAAgC;GAC7D,MAAM,4BAA4B,MAAM,aAAa;AAErD,OAAI,6BAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI,6DAAuB;IAC3B,WAAW;IACZ;;EAGD,MAAM,0CAA6D;AAClE,UAAO;IACN,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC/B;IACA;;yBAKO,4BAAQ,CAAC,MAAM,QAAA,MAAK,gFACrB,gBAAA,MAAgB,MAAM,GAAE,sBA+BlB;;IA9BV,OAAO,QAAA;;OACKA,KAAAA;IAAM,GAAK,gBAAA,MAAgB,MAAM;IAAS,CAAA,EAAA;oCAe3C,CAZL,QAAA,MAAM,oFACP,gBAAA,MAAgB,MAAM,GAAE,sBAWlB;;KAVV,MAAM,QAAA,MAAM;OACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;qCAGR,wDAK7B,cAAA,0BALa,QAAA,MAAM,KAAK,OAAlB,QAAG;wDAKT,iCAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;gJAIT,gBAAA,MAAgB,MAAM,GAAE,sBAWlB,EAVV,MAAM,QAAA,MAAM,QACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;qCAGR,wDAK7B,cAAA,0BALa,QAAA,MAAM,KAAK,OAAlB,QAAG;wDAKT,iCAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;;;wBAIM,QAAA,wFAAe,QAAA,SAAQ,8CAAA,EAAA,KAAA,GAAA,EAAUA,KAAAA,OAAM,CAAA,EAAA,MAAA,GAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { isVueComponent } from "../types.js";
|
|
1
2
|
import { defaultTableComponents } from "./PrismicTableDefaultComponents.js";
|
|
2
3
|
import PrismicTableRow_default from "./PrismicTableRow.js";
|
|
3
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, renderList, resolveDynamicComponent, unref, withCtx } from "vue";
|
|
4
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, normalizeProps, openBlock, renderList, resolveDynamicComponent, unref, withCtx } from "vue";
|
|
4
5
|
import { isFilled } from "@prismicio/client";
|
|
5
6
|
|
|
6
7
|
//#region src/PrismicTable/PrismicTable.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -12,50 +13,77 @@ var PrismicTable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
12
13
|
type: null,
|
|
13
14
|
required: true
|
|
14
15
|
},
|
|
15
|
-
fallback: {
|
|
16
|
-
type: null,
|
|
17
|
-
required: false
|
|
18
|
-
},
|
|
19
16
|
components: {
|
|
20
17
|
type: Object,
|
|
21
18
|
required: false
|
|
19
|
+
},
|
|
20
|
+
fallback: {
|
|
21
|
+
type: null,
|
|
22
|
+
required: false
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
25
|
setup(__props) {
|
|
25
26
|
const props = __props;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
function getInternalComponent(type) {
|
|
28
|
+
const maybeComponentOrShorthand = props.components?.[type];
|
|
29
|
+
if (isVueComponent(maybeComponentOrShorthand)) return { is: maybeComponentOrShorthand };
|
|
30
|
+
return {
|
|
31
|
+
is: defaultTableComponents[type],
|
|
32
|
+
shorthand: maybeComponentOrShorthand
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const tableComponents = computed(() => {
|
|
36
|
+
return {
|
|
37
|
+
table: getInternalComponent("table"),
|
|
38
|
+
thead: getInternalComponent("thead"),
|
|
39
|
+
tbody: getInternalComponent("tbody"),
|
|
40
|
+
tr: getInternalComponent("tr"),
|
|
41
|
+
th: getInternalComponent("th"),
|
|
42
|
+
td: getInternalComponent("td")
|
|
43
|
+
};
|
|
44
|
+
});
|
|
30
45
|
return (_ctx, _cache) => {
|
|
31
|
-
return unref(isFilled).table(__props.field) ? (openBlock(), createBlock(resolveDynamicComponent(
|
|
46
|
+
return unref(isFilled).table(__props.field) ? (openBlock(), createBlock(resolveDynamicComponent(tableComponents.value.table.is), mergeProps({
|
|
32
47
|
key: 0,
|
|
33
48
|
table: __props.field
|
|
34
|
-
},
|
|
35
|
-
|
|
49
|
+
}, {
|
|
50
|
+
..._ctx.$attrs,
|
|
51
|
+
...tableComponents.value.table.shorthand
|
|
52
|
+
}), {
|
|
53
|
+
default: withCtx(() => [__props.field.head ? (openBlock(), createBlock(resolveDynamicComponent(tableComponents.value.thead.is), mergeProps({
|
|
36
54
|
key: 0,
|
|
37
55
|
head: __props.field.head
|
|
38
|
-
}, {
|
|
56
|
+
}, tableComponents.value.thead.shorthand), {
|
|
39
57
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.field.head.rows, (row) => {
|
|
40
58
|
return openBlock(), createBlock(PrismicTableRow_default, {
|
|
41
59
|
key: row.key,
|
|
42
60
|
row,
|
|
43
|
-
|
|
44
|
-
|
|
61
|
+
internalTableComponents: tableComponents.value,
|
|
62
|
+
components: __props.components
|
|
63
|
+
}, null, 8, [
|
|
64
|
+
"row",
|
|
65
|
+
"internalTableComponents",
|
|
66
|
+
"components"
|
|
67
|
+
]);
|
|
45
68
|
}), 128))]),
|
|
46
69
|
_: 1
|
|
47
|
-
},
|
|
70
|
+
}, 16, ["head"])) : createCommentVNode("v-if", true), (openBlock(), createBlock(resolveDynamicComponent(tableComponents.value.tbody.is), mergeProps({ body: __props.field.body }, tableComponents.value.tbody.shorthand), {
|
|
48
71
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.field.body.rows, (row) => {
|
|
49
72
|
return openBlock(), createBlock(PrismicTableRow_default, {
|
|
50
73
|
key: row.key,
|
|
51
74
|
row,
|
|
52
|
-
|
|
53
|
-
|
|
75
|
+
internalTableComponents: tableComponents.value,
|
|
76
|
+
components: __props.components
|
|
77
|
+
}, null, 8, [
|
|
78
|
+
"row",
|
|
79
|
+
"internalTableComponents",
|
|
80
|
+
"components"
|
|
81
|
+
]);
|
|
54
82
|
}), 128))]),
|
|
55
83
|
_: 1
|
|
56
|
-
},
|
|
84
|
+
}, 16, ["body"]))]),
|
|
57
85
|
_: 1
|
|
58
|
-
}, 16, ["table"])) : (openBlock(), createBlock(resolveDynamicComponent(__props.fallback), { key: 1 }));
|
|
86
|
+
}, 16, ["table"])) : __props.fallback ? (openBlock(), createBlock(resolveDynamicComponent(__props.fallback), normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs)), null, 16)) : createCommentVNode("v-if", true);
|
|
59
87
|
};
|
|
60
88
|
}
|
|
61
89
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/** The Prismic table field to render. */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * thead: { class: 'bg-black text-white' },\n\t * th: { as: 'td', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" v-bind=\"$attrs\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,QAAQ;EAGd,SAAS,qBAAqB,MAAgC;GAC7D,MAAM,4BAA4B,MAAM,aAAa;AAErD,OAAI,eAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI,uBAAuB;IAC3B,WAAW;IACZ;;EAGD,MAAM,kBAAkB,eAA2C;AAClE,UAAO;IACN,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC/B;IACA;;UAKO,MAAA,SAAQ,CAAC,MAAM,QAAA,MAAK,iBAD3B,YAiCY,wBA/BN,gBAAA,MAAgB,MAAM,GAAE,EAF9B,WAiCY;;IA9BV,OAAO,QAAA;;OACKA,KAAAA;IAAM,GAAK,gBAAA,MAAgB,MAAM;IAAS,CAAA,EAAA;2BAe3C,CAZL,QAAA,MAAM,qBADb,YAaY,wBAXN,gBAAA,MAAgB,MAAM,GAAE,EAF9B,WAaY;;KAVV,MAAM,QAAA,MAAM;OACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;4BAGR,mBAD/B,mBAME,UAAA,MAAA,WALa,QAAA,MAAM,KAAK,OAAlB,QAAG;0BADX,YAME,yBAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;wEAGf,YAYY,wBAXN,gBAAA,MAAgB,MAAM,GAAE,EAD9B,WAYY,EAVV,MAAM,QAAA,MAAM,QACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;4BAGR,mBAD/B,mBAME,UAAA,MAAA,WALa,QAAA,MAAM,KAAK,OAAlB,QAAG;0BADX,YAME,yBAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;;;wBAIM,QAAA,yBAAtB,YAAiE,wBAA5B,QAAA,SAAQ,EAAA,eAAA,WAAA,EAAA,KAAA,GAAA,EAAUA,KAAAA,OAAM,CAAA,EAAA,MAAA,GAAA"}
|
|
@@ -4,39 +4,57 @@ let vue = require("vue");
|
|
|
4
4
|
//#region src/PrismicTable/PrismicTableDefaultComponents.ts
|
|
5
5
|
const defaultTableComponents = {
|
|
6
6
|
table: (0, vue.defineComponent)({
|
|
7
|
-
props:
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
props: {
|
|
8
|
+
...require_getTableComponentProps.table(),
|
|
9
|
+
as: { type: String }
|
|
10
|
+
},
|
|
11
|
+
setup(props, { attrs, slots }) {
|
|
12
|
+
return () => (0, vue.h)(props.as ?? "table", attrs, slots.default ? slots.default() : []);
|
|
10
13
|
}
|
|
11
14
|
}),
|
|
12
15
|
thead: (0, vue.defineComponent)({
|
|
13
|
-
props:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
props: {
|
|
17
|
+
...require_getTableComponentProps.thead(),
|
|
18
|
+
as: { type: String }
|
|
19
|
+
},
|
|
20
|
+
setup(props, { attrs, slots }) {
|
|
21
|
+
return () => (0, vue.h)(props.as ?? "thead", attrs, slots.default ? slots.default() : []);
|
|
16
22
|
}
|
|
17
23
|
}),
|
|
18
24
|
tbody: (0, vue.defineComponent)({
|
|
19
|
-
props:
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
props: {
|
|
26
|
+
...require_getTableComponentProps.tbody(),
|
|
27
|
+
as: { type: String }
|
|
28
|
+
},
|
|
29
|
+
setup(props, { attrs, slots }) {
|
|
30
|
+
return () => (0, vue.h)(props.as ?? "tbody", attrs, slots.default ? slots.default() : []);
|
|
22
31
|
}
|
|
23
32
|
}),
|
|
24
33
|
tr: (0, vue.defineComponent)({
|
|
25
|
-
props:
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
props: {
|
|
35
|
+
...require_getTableComponentProps.tr(),
|
|
36
|
+
as: { type: String }
|
|
37
|
+
},
|
|
38
|
+
setup(props, { attrs, slots }) {
|
|
39
|
+
return () => (0, vue.h)(props.as ?? "tr", attrs, slots.default ? slots.default() : []);
|
|
28
40
|
}
|
|
29
41
|
}),
|
|
30
42
|
th: (0, vue.defineComponent)({
|
|
31
|
-
props:
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
props: {
|
|
44
|
+
...require_getTableComponentProps.th(),
|
|
45
|
+
as: { type: String }
|
|
46
|
+
},
|
|
47
|
+
setup(props, { attrs, slots }) {
|
|
48
|
+
return () => (0, vue.h)(props.as ?? "th", attrs, slots.default ? slots.default() : []);
|
|
34
49
|
}
|
|
35
50
|
}),
|
|
36
51
|
td: (0, vue.defineComponent)({
|
|
37
|
-
props:
|
|
38
|
-
|
|
39
|
-
|
|
52
|
+
props: {
|
|
53
|
+
...require_getTableComponentProps.td(),
|
|
54
|
+
as: { type: String }
|
|
55
|
+
},
|
|
56
|
+
setup(props, { attrs, slots }) {
|
|
57
|
+
return () => (0, vue.h)(props.as ?? "td", attrs, slots.default ? slots.default() : []);
|
|
40
58
|
}
|
|
41
59
|
})
|
|
42
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTableDefaultComponents.cjs","names":["defaultTableComponents:
|
|
1
|
+
{"version":3,"file":"PrismicTableDefaultComponents.cjs","names":["defaultTableComponents: DefaultVueTableComponents"],"sources":["../../../src/PrismicTable/PrismicTableDefaultComponents.ts"],"sourcesContent":["import { defineComponent, h } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport type { DefaultVueTableComponents } from \"./types\"\n\nimport * as getTableComponentProps from \"./getTableComponentProps\"\n\nexport const defaultTableComponents: DefaultVueTableComponents = {\n\ttable: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.table(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () =>\n\t\t\t\th(props.as ?? \"table\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\tthead: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.thead(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () =>\n\t\t\t\th(props.as ?? \"thead\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\ttbody: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.tbody(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () =>\n\t\t\t\th(props.as ?? \"tbody\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\ttr: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.tr(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () =>\n\t\t\t\th(props.as ?? \"tr\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\tth: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.th(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () =>\n\t\t\t\th(props.as ?? \"th\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\ttd: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.td(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () =>\n\t\t\t\th(props.as ?? \"td\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n}\n"],"mappings":";;;;AAOA,MAAaA,yBAAoD;CAChE,gCAAuB;EACtB,OAAO;GACN,yCAAiC;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BACG,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAErE,CAAC;CACF,gCAAuB;EACtB,OAAO;GACN,yCAAiC;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BACG,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAErE,CAAC;CACF,gCAAuB;EACtB,OAAO;GACN,yCAAiC;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BACG,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAErE,CAAC;CACF,6BAAoB;EACnB,OAAO;GACN,sCAA8B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BACG,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAElE,CAAC;CACF,6BAAoB;EACnB,OAAO;GACN,sCAA8B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BACG,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAElE,CAAC;CACF,6BAAoB;EACnB,OAAO;GACN,sCAA8B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,2BACG,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAElE,CAAC;CACF"}
|
|
@@ -4,39 +4,57 @@ import { defineComponent, h } from "vue";
|
|
|
4
4
|
//#region src/PrismicTable/PrismicTableDefaultComponents.ts
|
|
5
5
|
const defaultTableComponents = {
|
|
6
6
|
table: defineComponent({
|
|
7
|
-
props:
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
props: {
|
|
8
|
+
...table(),
|
|
9
|
+
as: { type: String }
|
|
10
|
+
},
|
|
11
|
+
setup(props, { attrs, slots }) {
|
|
12
|
+
return () => h(props.as ?? "table", attrs, slots.default ? slots.default() : []);
|
|
10
13
|
}
|
|
11
14
|
}),
|
|
12
15
|
thead: defineComponent({
|
|
13
|
-
props:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
props: {
|
|
17
|
+
...thead(),
|
|
18
|
+
as: { type: String }
|
|
19
|
+
},
|
|
20
|
+
setup(props, { attrs, slots }) {
|
|
21
|
+
return () => h(props.as ?? "thead", attrs, slots.default ? slots.default() : []);
|
|
16
22
|
}
|
|
17
23
|
}),
|
|
18
24
|
tbody: defineComponent({
|
|
19
|
-
props:
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
props: {
|
|
26
|
+
...tbody(),
|
|
27
|
+
as: { type: String }
|
|
28
|
+
},
|
|
29
|
+
setup(props, { attrs, slots }) {
|
|
30
|
+
return () => h(props.as ?? "tbody", attrs, slots.default ? slots.default() : []);
|
|
22
31
|
}
|
|
23
32
|
}),
|
|
24
33
|
tr: defineComponent({
|
|
25
|
-
props:
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
props: {
|
|
35
|
+
...tr(),
|
|
36
|
+
as: { type: String }
|
|
37
|
+
},
|
|
38
|
+
setup(props, { attrs, slots }) {
|
|
39
|
+
return () => h(props.as ?? "tr", attrs, slots.default ? slots.default() : []);
|
|
28
40
|
}
|
|
29
41
|
}),
|
|
30
42
|
th: defineComponent({
|
|
31
|
-
props:
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
props: {
|
|
44
|
+
...th(),
|
|
45
|
+
as: { type: String }
|
|
46
|
+
},
|
|
47
|
+
setup(props, { attrs, slots }) {
|
|
48
|
+
return () => h(props.as ?? "th", attrs, slots.default ? slots.default() : []);
|
|
34
49
|
}
|
|
35
50
|
}),
|
|
36
51
|
td: defineComponent({
|
|
37
|
-
props:
|
|
38
|
-
|
|
39
|
-
|
|
52
|
+
props: {
|
|
53
|
+
...td(),
|
|
54
|
+
as: { type: String }
|
|
55
|
+
},
|
|
56
|
+
setup(props, { attrs, slots }) {
|
|
57
|
+
return () => h(props.as ?? "td", attrs, slots.default ? slots.default() : []);
|
|
40
58
|
}
|
|
41
59
|
})
|
|
42
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTableDefaultComponents.js","names":["defaultTableComponents:
|
|
1
|
+
{"version":3,"file":"PrismicTableDefaultComponents.js","names":["defaultTableComponents: DefaultVueTableComponents","getTableComponentProps.table","getTableComponentProps.thead","getTableComponentProps.tbody","getTableComponentProps.tr","getTableComponentProps.th","getTableComponentProps.td"],"sources":["../../../src/PrismicTable/PrismicTableDefaultComponents.ts"],"sourcesContent":["import { defineComponent, h } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport type { DefaultVueTableComponents } from \"./types\"\n\nimport * as getTableComponentProps from \"./getTableComponentProps\"\n\nexport const defaultTableComponents: DefaultVueTableComponents = {\n\ttable: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.table(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () =>\n\t\t\t\th(props.as ?? \"table\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\tthead: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.thead(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () =>\n\t\t\t\th(props.as ?? \"thead\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\ttbody: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.tbody(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () =>\n\t\t\t\th(props.as ?? \"tbody\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\ttr: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.tr(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () =>\n\t\t\t\th(props.as ?? \"tr\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\tth: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.th(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () =>\n\t\t\t\th(props.as ?? \"th\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n\ttd: defineComponent({\n\t\tprops: {\n\t\t\t...getTableComponentProps.td(),\n\t\t\tas: { type: String as PropType<string | undefined> },\n\t\t},\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () =>\n\t\t\t\th(props.as ?? \"td\", attrs, slots.default ? slots.default() : [])\n\t\t},\n\t}),\n}\n"],"mappings":";;;;AAOA,MAAaA,yBAAoD;CAChE,OAAO,gBAAgB;EACtB,OAAO;GACN,GAAGC,OAA8B;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBACC,EAAE,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAErE,CAAC;CACF,OAAO,gBAAgB;EACtB,OAAO;GACN,GAAGC,OAA8B;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBACC,EAAE,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAErE,CAAC;CACF,OAAO,gBAAgB;EACtB,OAAO;GACN,GAAGC,OAA8B;GACjC,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBACC,EAAE,MAAM,MAAM,SAAS,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAErE,CAAC;CACF,IAAI,gBAAgB;EACnB,OAAO;GACN,GAAGC,IAA2B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBACC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAElE,CAAC;CACF,IAAI,gBAAgB;EACnB,OAAO;GACN,GAAGC,IAA2B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBACC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAElE,CAAC;CACF,IAAI,gBAAgB;EACnB,OAAO;GACN,GAAGC,IAA2B;GAC9B,IAAI,EAAE,MAAM,QAAwC;GACpD;EACD,MAAM,OAAO,EAAE,OAAO,SAAS;AAC9B,gBACC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,UAAU,MAAM,SAAS,GAAG,EAAE,CAAC;;EAElE,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTableRow.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type {
|
|
1
|
+
{"version":3,"file":"PrismicTableRow.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type { InternalVueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\nimport PrismicRichText from \"../PrismicRichText/PrismicRichText.vue\"\n\nexport type PrismicTableRowProps = {\n\trow: TableFieldHeadRow | TableFieldBodyRow\n\tinternalTableComponents: InternalVueTableComponents\n\tcomponents?: VueRichTextSerializer\n}\n\nconst props = defineProps<PrismicTableRowProps>()\ndefineOptions({ name: \"PrismicTableRow\" })\n</script>\n\n<template>\n\t<component\n\t\t:is=\"internalTableComponents.tr.is\"\n\t\t:row=\"row\"\n\t\tv-bind=\"internalTableComponents.tr.shorthand\"\n\t>\n\t\t<template v-for=\"cell in row.cells\" :key=\"cell.key\">\n\t\t\t<component\n\t\t\t\tv-if=\"cell.type === 'header'\"\n\t\t\t\t:is=\"internalTableComponents.th.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.th.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t\t<component\n\t\t\t\tv-else\n\t\t\t\t:is=\"internalTableComponents.td.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.td.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t</template>\n\t</component>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTableRow.js","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type {
|
|
1
|
+
{"version":3,"file":"PrismicTableRow.js","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type { InternalVueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\nimport PrismicRichText from \"../PrismicRichText/PrismicRichText.vue\"\n\nexport type PrismicTableRowProps = {\n\trow: TableFieldHeadRow | TableFieldBodyRow\n\tinternalTableComponents: InternalVueTableComponents\n\tcomponents?: VueRichTextSerializer\n}\n\nconst props = defineProps<PrismicTableRowProps>()\ndefineOptions({ name: \"PrismicTableRow\" })\n</script>\n\n<template>\n\t<component\n\t\t:is=\"internalTableComponents.tr.is\"\n\t\t:row=\"row\"\n\t\tv-bind=\"internalTableComponents.tr.shorthand\"\n\t>\n\t\t<template v-for=\"cell in row.cells\" :key=\"cell.key\">\n\t\t\t<component\n\t\t\t\tv-if=\"cell.type === 'header'\"\n\t\t\t\t:is=\"internalTableComponents.th.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.th.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t\t<component\n\t\t\t\tv-else\n\t\t\t\t:is=\"internalTableComponents.td.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.td.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t</template>\n\t</component>\n</template>\n"],"mappings":""}
|