{"version":3,"file":"SolutionContentsCard-e834bf30.js","sources":["../../../app/frontend/components/_parials/contentsCard.ts","../../../app/frontend/components/solutions/SolutionContentsCard.vue"],"sourcesContent":["import { PropType, computed } from 'vue'\nimport { pathWithQueryParams } from '@/utilities/path'\nimport htmlUtil from '@/utilities/html'\n\nexport const DEFAULT_IMAGE_OPTIONS = {\n WIDTH: {\n PC: 200,\n SP: 140,\n },\n HEIGHT: {\n PC: 100,\n SP: 70,\n },\n} as const\n\nexport const DEFAULT_HEADING_OPTIONS = {\n TAG_NAME: 'p',\n LINE_HEIGHT: 1.4,\n FONT_SIZE: {\n PC: '1.6rem',\n SP: '1.6rem',\n },\n FONT_WEIGHT: 'normal',\n MAX_LINE: 0,\n} as const\n\nexport const cardCommonProps = {\n /**\n * 画像を表示するかどうか\n */\n hasHero: {\n type: Boolean,\n default: true,\n },\n\n /**\n * ハイライト表示するワード\n */\n highlightWord: {\n type: String,\n default: '',\n },\n\n size: {\n type: String as PropType<'full' | 'large' | 'normal' | 'small' | 'mini'>,\n default: 'normal',\n validator: (value: string) => {\n return ['full', 'large', 'normal', 'small', 'mini'].includes(value)\n },\n },\n\n /**\n * PC でも横向きタイプ表示にするフラグ\n * @description 重複定義の場合は full の設定が優先される\n */\n horizontal: {\n type: Object as PropType<{ pc: boolean, sp: boolean }>,\n default: () => ({\n pc: false,\n sp: false,\n }),\n },\n\n /**\n * 見出しのオプション\n */\n headingOptions: {\n type: Object as PropType<{\n // HTML 要素名\n tagName?: keyof HTMLElementTagNameMap,\n\n // CSS の line-height 値\n lineHeight?: number,\n\n // CSS の font-size\n fontSize?: {\n pc: string,\n sp: string,\n },\n\n // 文字の太さ\n fontWeight?: 'normal' | 'bold',\n\n // 表示最大行数\n maxLine?: number,\n }>,\n default: () => ({\n tagName: DEFAULT_HEADING_OPTIONS.TAG_NAME,\n lineHeight: DEFAULT_HEADING_OPTIONS.LINE_HEIGHT,\n fontSize: {\n pc: DEFAULT_HEADING_OPTIONS.FONT_SIZE.PC,\n sp: DEFAULT_HEADING_OPTIONS.FONT_SIZE.SP,\n },\n fontWeight: DEFAULT_HEADING_OPTIONS.FONT_WEIGHT,\n maxLine: DEFAULT_HEADING_OPTIONS.MAX_LINE,\n }),\n },\n\n /**\n * 画像の表示オプション\n * @description horizontal が有効のときのみ評価される\n */\n imageOptions: {\n type: Object as PropType<{\n // 幅\n width?: {\n pc: number,\n sp: number,\n },\n\n // 高さ\n height?: {\n pc: number,\n sp: number,\n },\n }>,\n default: () => ({\n width: {\n pc: DEFAULT_IMAGE_OPTIONS.WIDTH.PC,\n sp: DEFAULT_IMAGE_OPTIONS.WIDTH.SP,\n },\n height: {\n pc: DEFAULT_IMAGE_OPTIONS.HEIGHT.PC,\n sp: DEFAULT_IMAGE_OPTIONS.HEIGHT.SP,\n },\n }),\n },\n}\n\nexport const defaultProps = {\n item: {\n type: Object as PropType,\n required: true,\n },\n\n ...cardCommonProps,\n}\n\nexport interface Props {\n item: ContentItem,\n hasHero: boolean,\n highlightWord: string,\n size: 'full' | 'large' | 'normal' | 'small' | 'mini',\n horizontal: {\n pc: boolean,\n sp: boolean,\n },\n headingOptions: {\n tagName?: keyof HTMLElementTagNameMap,\n lineHeight?: number,\n fontSize?: {\n pc: string,\n sp: string,\n },\n fontWeight?: 'normal' | 'bold',\n maxLine?: number,\n },\n imageOptions: {\n width?: {\n pc: number,\n sp: number,\n },\n height?: {\n pc: number,\n sp: number,\n },\n },\n}\nexport function defaultFunction(props: any & Props) {\n const sizeStateClass = computed(() => {\n return `is-${props.size}`\n })\n\n const linkTo = computed(() => {\n return props.item.to\n ? pathWithQueryParams(props.item.to, props.item.parameters)\n : undefined\n })\n\n /**\n * 見出しの中で、指定のワードをハイライト表示する\n */\n const highlightHeading = computed(() => {\n if (!props.item.title) return ''\n\n const title = htmlUtil.removeHtmlElement(props.item.title)\n return props.highlightWord\n ? title.replace(new RegExp(`(${props.highlightWord})`, 'g'), '$1')\n : title\n })\n\n /**\n * 説明文の中で、指定のワードをハイライト表示する\n */\n const highlightDescription = computed(() => {\n if (!props.item.description) return ''\n\n const description = htmlUtil.removeHtmlElement(props.item.description)\n return props.highlightWord\n ? description.replace(new RegExp(`(${props.highlightWord})`, 'g'), '$1')\n : description\n })\n\n const wrapperTagName = computed(() => {\n return props.item.to ? 'a' : 'div'\n })\n\n /**\n * 見出し部分の html とスタイルに関連する値\n */\n const computedHeadingOptions = computed<{\n tagName: keyof HTMLElementTagNameMap,\n maxHeight: string,\n lineHeight: number,\n fontSize: {\n pc: string,\n sp: string,\n },\n fontWeight: 'normal' | 'bold',\n }>(() => {\n // デフォルト値をベースに分割代入で props で渡された値をオーバーライド\n const _options = {\n ...{\n tagName: DEFAULT_HEADING_OPTIONS.TAG_NAME,\n lineHeight: DEFAULT_HEADING_OPTIONS.LINE_HEIGHT,\n fontSize: {\n pc: DEFAULT_HEADING_OPTIONS.FONT_SIZE.PC,\n sp: DEFAULT_HEADING_OPTIONS.FONT_SIZE.SP,\n },\n fontWeight: DEFAULT_HEADING_OPTIONS.FONT_WEIGHT,\n maxLine: DEFAULT_HEADING_OPTIONS.MAX_LINE,\n },\n ...props.headingOptions,\n }\n\n const _maxLine = _options.maxLine > 0\n ? _options.maxLine\n : DEFAULT_HEADING_OPTIONS.MAX_LINE\n const _lineHeight = _options.lineHeight > 0\n ? _options.lineHeight\n : DEFAULT_HEADING_OPTIONS.LINE_HEIGHT\n const _maxHeight = _maxLine * _lineHeight\n const _fontSize = {\n pc: _options.fontSize.pc || DEFAULT_HEADING_OPTIONS.FONT_SIZE.PC,\n sp: _options.fontSize.sp || DEFAULT_HEADING_OPTIONS.FONT_SIZE.SP,\n }\n const _fontWeight = _options.fontWeight || 'normal'\n\n return {\n tagName: _options.tagName || DEFAULT_HEADING_OPTIONS.TAG_NAME,\n maxHeight: _maxHeight ? `${_maxHeight}em` : 'none',\n lineHeight: _lineHeight,\n fontSize: _fontSize,\n fontWeight: _fontWeight,\n }\n })\n\n /**\n * 画像部分のスタイルに関連する値\n */\n const computedImageOptions = computed<{\n width: { pc: string, sp: string },\n height: { pc: string, sp: string }\n }>(() => {\n // デフォルト値をベースに分割代入で props で渡された値をオーバーライド\n const _options = {\n ...{\n width: {\n pc: DEFAULT_IMAGE_OPTIONS.WIDTH.PC,\n sp: DEFAULT_IMAGE_OPTIONS.WIDTH.SP,\n },\n height: {\n pc: DEFAULT_IMAGE_OPTIONS.HEIGHT.PC,\n sp: DEFAULT_IMAGE_OPTIONS.HEIGHT.SP,\n },\n },\n ...props.imageOptions,\n }\n\n const _width = {\n pc: _options.width.pc >= 0\n ? `${_options.width.pc}px`\n : `${DEFAULT_IMAGE_OPTIONS.WIDTH.PC}px`,\n sp: _options.width.sp >= 0\n ? `${_options.width.sp}px`\n : `${DEFAULT_IMAGE_OPTIONS.WIDTH.SP}px`,\n }\n\n const _height = {\n pc: _options.height.pc >= 0\n ? props.horizontal.pc\n ? `${_options.height.pc}px`\n : `${_options.height.pc / _options.width.pc * 100}%`\n : `${DEFAULT_IMAGE_OPTIONS.HEIGHT.PC}px`,\n sp: _options.height.sp >= 0\n ? props.horizontal.sp\n ? `${_options.height.sp}px`\n : `${_options.height.sp / _options.width.sp * 100}%`\n : `${DEFAULT_IMAGE_OPTIONS.HEIGHT.SP}px`,\n }\n\n return {\n width: _width,\n height: _height,\n }\n })\n\n /**\n * 画像のサイズを外から渡すために CSS 変数として style 属性でバインドするためのオブジェクト\n */\n const cssVariables = computed(() => {\n return {\n '--image-width-pc': computedImageOptions.value.width.pc,\n '--image-width-sp': computedImageOptions.value.width.sp,\n '--image-height-pc': computedImageOptions.value.height.pc,\n '--image-height-sp': computedImageOptions.value.height.sp,\n }\n })\n\n return {\n // computed\n sizeStateClass,\n linkTo,\n highlightHeading,\n highlightDescription,\n wrapperTagName,\n computedHeadingOptions,\n computedImageOptions,\n cssVariables,\n }\n}\n","\n\n\n\n\n"],"names":["DEFAULT_IMAGE_OPTIONS","DEFAULT_HEADING_OPTIONS","cardCommonProps","value","defaultProps","defaultFunction","props","sizeStateClass","computed","linkTo","pathWithQueryParams","highlightHeading","title","htmlUtil","highlightDescription","description","wrapperTagName","computedHeadingOptions","_options","_maxLine","_lineHeight","_maxHeight","_fontSize","_fontWeight","computedImageOptions","_width","_height","cssVariables","_sfc_main","defineComponent","SolutionName","ExternalHtmlWrapper","getSolutionCategoryLabel","solutionCategory","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_8","_hoisted_10","_resolveDirective","_normalizeClass","_ctx","_normalizeStyle","_withCtx","_createElementVNode","_hoisted_1","_hoisted_2","_openBlock","_createBlock","_resolveDynamicComponent","_createElementBlock","_withDirectives","_createCommentVNode","_hoisted_6","_component_ExternalHtmlWrapper","_b","_a","_hoisted_9","_Fragment","_renderList","id","_component_SolutionName"],"mappings":"+RAIO,MAAMA,EAAwB,CACnC,MAAO,CACL,GAAI,IACJ,GAAI,GACN,EACA,OAAQ,CACN,GAAI,IACJ,GAAI,EACN,CACF,EAEaC,EAA0B,CACrC,SAAU,IACV,YAAa,IACb,UAAW,CACT,GAAI,SACJ,GAAI,QACN,EACA,YAAa,SACb,SAAU,CACZ,EAEaC,EAAkB,CAI7B,QAAS,CACP,KAAM,QACN,QAAS,EACX,EAKA,cAAe,CACb,KAAM,OACN,QAAS,EACX,EAEA,KAAM,CACJ,KAAM,OACN,QAAS,SACT,UAAYC,GACH,CAAC,OAAQ,QAAS,SAAU,QAAS,MAAM,EAAE,SAASA,CAAK,CAEtE,EAMA,WAAY,CACV,KAAM,OACN,QAAS,KAAO,CACd,GAAI,GACJ,GAAI,EAAA,EAER,EAKA,eAAgB,CACd,KAAM,OAmBN,QAAS,KAAO,CACd,QAASF,EAAwB,SACjC,WAAYA,EAAwB,YACpC,SAAU,CACR,GAAIA,EAAwB,UAAU,GACtC,GAAIA,EAAwB,UAAU,EACxC,EACA,WAAYA,EAAwB,YACpC,QAASA,EAAwB,QAAA,EAErC,EAMA,aAAc,CACZ,KAAM,OAaN,QAAS,KAAO,CACd,MAAO,CACL,GAAID,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