( sectionKey: string, el?: string )
| 6 | * @public |
| 7 | */ |
| 8 | export const stepIcon = ( |
| 9 | sectionKey: string, |
| 10 | el?: string |
| 11 | ): FormKitSchemaExtendableSection => { |
| 12 | return createSection(`${sectionKey}Icon`, () => { |
| 13 | const rawIconProp = `_raw${sectionKey |
| 14 | .charAt(0) |
| 15 | .toUpperCase()}${sectionKey.slice(1)}Icon` |
| 16 | return { |
| 17 | if: `$step.${sectionKey}Icon && $step.${rawIconProp}`, |
| 18 | then: { |
| 19 | $el: `${el ? el : 'span'}`, |
| 20 | attrs: { |
| 21 | class: `$classes.${sectionKey}Icon + " formkit-icon"`, |
| 22 | innerHTML: `$step.${rawIconProp}`, |
| 23 | role: 'presentation', |
| 24 | onClick: `$handlers.iconClick(${sectionKey})`, |
| 25 | }, |
| 26 | }, |
| 27 | else: { |
| 28 | if: `$${sectionKey}Icon && $${rawIconProp}`, |
| 29 | then: { |
| 30 | $el: `${el ? el : 'span'}`, |
| 31 | attrs: { |
| 32 | class: `$classes.${sectionKey}Icon + " formkit-icon"`, |
| 33 | innerHTML: `$${rawIconProp}`, |
| 34 | role: 'presentation', |
| 35 | onClick: `$handlers.iconClick(${sectionKey})`, |
| 36 | }, |
| 37 | }, |
| 38 | }, |
| 39 | } |
| 40 | })() |
| 41 | } |
no test coverage detected