@limetech/lime-elements 37.7.0 → 37.7.1

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.
Files changed (113) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/get-icon-props-50be7440.js.map +1 -1
  3. package/dist/cjs/index.cjs.js.map +1 -1
  4. package/dist/cjs/limel-action-bar-item_2.cjs.entry.js.map +1 -1
  5. package/dist/cjs/limel-chip_2.cjs.entry.js +2 -3
  6. package/dist/cjs/limel-chip_2.cjs.entry.js.map +1 -1
  7. package/dist/cjs/limel-collapsible-section.cjs.entry.js.map +1 -1
  8. package/dist/cjs/limel-file-viewer.cjs.entry.js.map +1 -1
  9. package/dist/cjs/limel-header.cjs.entry.js.map +1 -1
  10. package/dist/cjs/limel-help-content.cjs.entry.js.map +1 -1
  11. package/dist/cjs/limel-help.cjs.entry.js.map +1 -1
  12. package/dist/cjs/limel-icon-button.cjs.entry.js.map +1 -1
  13. package/dist/cjs/limel-input-field_3.cjs.entry.js.map +1 -1
  14. package/dist/cjs/limel-picker.cjs.entry.js.map +1 -1
  15. package/dist/cjs/limel-progress-flow-item.cjs.entry.js.map +1 -1
  16. package/dist/cjs/limel-switch.cjs.entry.js.map +1 -1
  17. package/dist/collection/components/action-bar/action-bar-item/action-bar-item.js +1 -1
  18. package/dist/collection/components/action-bar/action-bar-item/action-bar-item.js.map +1 -1
  19. package/dist/collection/components/action-bar/action-bar-item/action-bar-overflow-menu.js +1 -1
  20. package/dist/collection/components/action-bar/action-bar-item/action-bar-overflow-menu.js.map +1 -1
  21. package/dist/collection/components/action-bar/action-bar.types.js.map +1 -1
  22. package/dist/collection/components/chip/chip.css +0 -8
  23. package/dist/collection/components/chip/chip.js +4 -5
  24. package/dist/collection/components/chip/chip.js.map +1 -1
  25. package/dist/collection/components/chip-set/chip-set.js.map +1 -1
  26. package/dist/collection/components/chip-set/chip.types.js.map +1 -1
  27. package/dist/collection/components/collapsible-section/collapsible-section.js +2 -2
  28. package/dist/collection/components/collapsible-section/collapsible-section.js.map +1 -1
  29. package/dist/collection/components/dialog/dialog.types.js.map +1 -1
  30. package/dist/collection/components/file/file.types.js.map +1 -1
  31. package/dist/collection/components/file-viewer/file-viewer.js.map +1 -1
  32. package/dist/collection/components/form/form.types.js.map +1 -1
  33. package/dist/collection/components/header/header.js +1 -1
  34. package/dist/collection/components/header/header.js.map +1 -1
  35. package/dist/collection/components/help/help-content.js +1 -1
  36. package/dist/collection/components/help/help-content.js.map +1 -1
  37. package/dist/collection/components/help/help.js +1 -1
  38. package/dist/collection/components/help/help.js.map +1 -1
  39. package/dist/collection/components/help/help.types.js.map +1 -1
  40. package/dist/collection/components/icon/get-icon-props.js.map +1 -1
  41. package/dist/collection/components/icon-button/icon-button.js +1 -1
  42. package/dist/collection/components/icon-button/icon-button.js.map +1 -1
  43. package/dist/collection/components/input-field/input-field.js.map +1 -1
  44. package/dist/collection/components/list/list-item.types.js.map +1 -1
  45. package/dist/collection/components/list/list-renderer.js.map +1 -1
  46. package/dist/collection/components/menu/menu.js +2 -2
  47. package/dist/collection/components/menu/menu.types.js.map +1 -1
  48. package/dist/collection/components/menu-list/menu-list.js +1 -1
  49. package/dist/collection/components/menu-list/menu-list.types.js.map +1 -1
  50. package/dist/collection/components/picker/picker.js.map +1 -1
  51. package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.js +1 -1
  52. package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.js.map +1 -1
  53. package/dist/collection/components/select/option.types.js.map +1 -1
  54. package/dist/collection/components/split-button/split-button.js +1 -1
  55. package/dist/collection/components/switch/switch.js +1 -1
  56. package/dist/collection/components/switch/switch.js.map +1 -1
  57. package/dist/collection/global/shared-types/separator.types.js +2 -0
  58. package/dist/collection/global/shared-types/separator.types.js.map +1 -0
  59. package/dist/collection/interface.js +1 -2
  60. package/dist/collection/interface.js.map +1 -1
  61. package/dist/esm/get-icon-props-0b65f85e.js.map +1 -1
  62. package/dist/esm/index.js.map +1 -1
  63. package/dist/esm/limel-action-bar-item_2.entry.js.map +1 -1
  64. package/dist/esm/limel-chip_2.entry.js +2 -3
  65. package/dist/esm/limel-chip_2.entry.js.map +1 -1
  66. package/dist/esm/limel-collapsible-section.entry.js.map +1 -1
  67. package/dist/esm/limel-file-viewer.entry.js.map +1 -1
  68. package/dist/esm/limel-header.entry.js.map +1 -1
  69. package/dist/esm/limel-help-content.entry.js.map +1 -1
  70. package/dist/esm/limel-help.entry.js.map +1 -1
  71. package/dist/esm/limel-icon-button.entry.js.map +1 -1
  72. package/dist/esm/limel-input-field_3.entry.js.map +1 -1
  73. package/dist/esm/limel-picker.entry.js.map +1 -1
  74. package/dist/esm/limel-progress-flow-item.entry.js.map +1 -1
  75. package/dist/esm/limel-switch.entry.js.map +1 -1
  76. package/dist/lime-elements/index.esm.js.map +1 -1
  77. package/dist/lime-elements/lime-elements.esm.js +1 -1
  78. package/dist/lime-elements/p-1ca94bcf.entry.js.map +1 -1
  79. package/dist/lime-elements/p-27d64a5a.entry.js.map +1 -1
  80. package/dist/lime-elements/p-2f777fdb.js.map +1 -1
  81. package/dist/lime-elements/p-386d1c5a.entry.js.map +1 -1
  82. package/dist/lime-elements/p-68cb9574.entry.js.map +1 -1
  83. package/dist/lime-elements/p-71282352.entry.js.map +1 -1
  84. package/dist/lime-elements/p-86550ce4.entry.js.map +1 -1
  85. package/dist/lime-elements/p-8d13a44f.entry.js.map +1 -1
  86. package/dist/lime-elements/p-b03c1b71.entry.js.map +1 -1
  87. package/dist/lime-elements/p-b9922526.entry.js.map +1 -1
  88. package/dist/lime-elements/p-c0543a74.entry.js.map +1 -1
  89. package/dist/lime-elements/p-dfa06174.entry.js.map +1 -1
  90. package/dist/lime-elements/p-fb54539a.entry.js +2 -0
  91. package/dist/lime-elements/p-fb54539a.entry.js.map +1 -0
  92. package/dist/types/components/action-bar/action-bar.types.d.ts +2 -3
  93. package/dist/types/components/chip/chip.d.ts +3 -1
  94. package/dist/types/components/chip-set/chip.types.d.ts +1 -1
  95. package/dist/types/components/dialog/dialog.types.d.ts +1 -1
  96. package/dist/types/components/file/file.types.d.ts +1 -1
  97. package/dist/types/components/form/form.types.d.ts +6 -0
  98. package/dist/types/components/header/header.d.ts +1 -1
  99. package/dist/types/components/help/help-content.d.ts +1 -1
  100. package/dist/types/components/help/help.d.ts +2 -1
  101. package/dist/types/components/help/help.types.d.ts +7 -1
  102. package/dist/types/components/icon/get-icon-props.d.ts +1 -1
  103. package/dist/types/components/list/list-item.types.d.ts +2 -16
  104. package/dist/types/components/list/list-renderer.d.ts +2 -1
  105. package/dist/types/components/menu/menu.types.d.ts +1 -1
  106. package/dist/types/components/menu-list/menu-list.types.d.ts +1 -2
  107. package/dist/types/components/select/option.types.d.ts +1 -1
  108. package/dist/types/components.d.ts +10 -10
  109. package/dist/types/global/shared-types/separator.types.d.ts +18 -0
  110. package/dist/types/interface.d.ts +2 -3
  111. package/package.json +7 -7
  112. package/dist/lime-elements/p-953ce801.entry.js +0 -2
  113. package/dist/lime-elements/p-953ce801.entry.js.map +0 -1
@@ -144,10 +144,9 @@ export class Chip {
144
144
  return;
145
145
  }
146
146
  const currentPercentage = this.progress + '%';
147
- const progress = Math.round(this.progress);
148
147
  return (h("div", { role: "progressbar", "aria-label": "%", "aria-valuemin": "0", "aria-valuemax": "100", "aria-valuenow": this.progress, style: {
149
148
  '--limel-chip-progress-percentage': currentPercentage,
150
- } }, h("span", null, progress, "%")));
149
+ } }));
151
150
  }
152
151
  static get is() { return "limel-chip"; }
153
152
  static get encapsulation() { return "shadow"; }
@@ -172,7 +171,7 @@ export class Chip {
172
171
  "references": {
173
172
  "Languages": {
174
173
  "location": "import",
175
- "path": "../../interface"
174
+ "path": "../date-picker/date.types"
176
175
  }
177
176
  }
178
177
  },
@@ -212,7 +211,7 @@ export class Chip {
212
211
  "references": {
213
212
  "Icon": {
214
213
  "location": "import",
215
- "path": "../../interface"
214
+ "path": "../../global/shared-types/icon.types"
216
215
  }
217
216
  }
218
217
  },
@@ -237,7 +236,7 @@ export class Chip {
237
236
  },
238
237
  "Link": {
239
238
  "location": "import",
240
- "path": "../../interface"
239
+ "path": "../../global/shared-types/link.types"
241
240
  }
242
241
  }
243
242
  },
@@ -1 +1 @@
1
- {"version":3,"file":"chip.js","sourceRoot":"","sources":["../../../src/components/chip/chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,IAAI,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EACH,kBAAkB,EAClB,oBAAoB,GACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,EACH,SAAS,EACT,kBAAkB,EAClB,MAAM,EACN,eAAe,GAClB,MAAM,qBAAqB,CAAC;AAe7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAMH,MAAM,OAAO,IAAI;;IA0HL,mBAAc,GAAG,GAAG,EAAE;MAC1B,OAAO;QACH,cACI,EAAE,EAAE,OAAO,GAAG,IAAI,CAAC,UAAU,EAC7B,KAAK,EAAC,MAAM,EACZ,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EACxC,SAAS,EAAE,IAAI,CAAC,mBAAmB;UAElC,IAAI,CAAC,aAAa,EAAE;UACpB,IAAI,CAAC,UAAU,EAAE;UACjB,IAAI,CAAC,WAAW,EAAE;UAClB,IAAI,CAAC,WAAW,EAAE;UAClB,IAAI,CAAC,iBAAiB,EAAE,CACpB;QACT,IAAI,CAAC,kBAAkB,EAAE;OAC5B,CAAC;IACN,CAAC,CAAC;IAEM,iBAAY,GAAG,GAAG,EAAE;MACxB,OAAO;QACH,SACI,EAAE,EAAE,OAAO,GAAG,IAAI,CAAC,UAAU,EAC7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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n} from '@stencil/core';\nimport { Icon, Languages, Link } from '../../interface';\nimport { getIconName } from '../icon/get-icon-props';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from '../../util/make-enter-clickable';\nimport translate from '../../global/translations';\nimport {\n BACKSPACE,\n BACKSPACE_KEY_CODE,\n DELETE,\n DELETE_KEY_CODE,\n} from '../../util/keycodes';\nimport { ChipType, Chip as OldChipInterface } from '../chip-set/chip.types';\n\ninterface ChipInterface extends Omit<OldChipInterface, 'id' | 'badge'> {\n /**\n * Identifier for the chip. Must be unique.\n */\n identifier?: number | string;\n\n /**\n * The value of the badge.\n */\n badge?: string | number;\n}\n\n/**\n * Chips and buttons are both interactive elements in UI design,\n * but they serve different purposes and are used in different contexts.\n *\n * :::warning\n * Do not use the chip component carelessly, as an alternative for\n * [`limel-button`](#/component/limel-button/) in the UI design!\n *\n * **Buttons:**\n * Buttons are used to trigger actions. They are typically used to\n * submit forms, open dialogs, initiate a process, or perform any action\n * that changes the state of the application.\n * Buttons' labels usually contain action words, in other words, the labels is\n * a _verb in imperative mood_ such as \"Submit\" or \"Delete\".\n * Buttons are placed in areas where it's clear they will initiate\n * an action when clicked.\n *\n * **Chips:**\n * Chips however are elements which may look like buttons, but they are\n * representing choices, filters, or tags, in a small block\n * or clearly bundled into a group. Chips are rarely used alone in the\n * user interface.\n * They are often used in a so called \"chip-set\", or placed together in\n * a section of the UI, where the user can expect more than one chip to be present.\n *\n * For example, a chip may represent a filter in a filter bar, or a tag in a tag list,\n * or an item in a shopping list.\n * Clicking a chip can also trigger an action, for example toggling a filter ON or OFF,\n * or opening a page with all posts tagged with the tag represented by the chip,\n * or navigating to a page with more information about the item in the shopping list.\n * :::\n *\n * @private\n * @exampleComponent limel-example-chip-button\n * @exampleComponent limel-example-chip-link\n * @exampleComponent limel-example-chip-icon-colors\n * @exampleComponent limel-example-chip-badge\n * @exampleComponent limel-example-chip-filter\n * @exampleComponent limel-example-chip-removable\n * @exampleComponent limel-example-chip-loading\n * @exampleComponent limel-example-chip-progress\n * @exampleComponent limel-example-chip-aria-role\n */\n@Component({\n tag: 'limel-chip',\n shadow: true,\n styleUrl: 'chip.scss',\n})\nexport class Chip implements ChipInterface {\n /**\n * Defines the language for translations.\n * Will translate the translatable strings on the components.\n */\n @Prop({ reflect: true })\n public language: Languages = 'en';\n\n /**\n * Label displayed on the chip\n */\n @Prop({ reflect: true })\n public text: string;\n\n /**\n * Icon of the chip.\n */\n @Prop()\n public icon?: string | Icon;\n\n /**\n * If supplied, the chip will become a clickable link.\n */\n @Prop()\n public link?: Omit<Link, 'text'>;\n\n /**\n * The value of the badge, displayed on the chip.\n */\n @Prop({ reflect: true })\n public badge?: string | number;\n\n /**\n * Set to `true` to disable the chip.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Set to `true` to render the chip as a static UI element.\n * Useful when the parent component has a `readonly` state.\n */\n @Prop({ reflect: true })\n public readonly = false;\n\n /**\n * Set to `true` to visualize the chip in a \"selected\" state.\n * This is typically used when the chip is used in a chip-set\n * along with other chips.\n */\n @Prop({ reflect: true })\n public selected = false;\n\n /**\n * Set to `true` to visualize the chip in an \"invalid\" or \"error\" state.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * Set to `true` to render a remove button on the chip.\n */\n @Prop({ reflect: true })\n public removable = false;\n\n /**\n * Set to `filter` to render the chip with a distinct style\n * suitable for visualizing filters.\n *\n * @beta\n */\n @Prop({ reflect: true })\n public type?: ChipType = 'default';\n\n /**\n * Set to `true` to put the component in the `loading` state,\n * and render an indeterminate progress indicator inside the chip.\n * This does _not_ disable the interactivity of the chip!\n */\n @Prop({ reflect: true })\n public loading? = false;\n\n /**\n * Reflects the current value of a progress bar on the chip,\n * visualizing the percentage of an ongoing process.\n * Must be a number between `0` and `100`.\n */\n @Prop({ reflect: true })\n public progress?: number;\n\n /**\n * Identifier for the chip. Must be unique.\n */\n @Prop({ reflect: true })\n public identifier?: number | string = crypto.randomUUID();\n\n /**\n * Fired when clicking on the remove button of a `removable` chip.\n * The value of `identifier` is emitted as the event detail.\n */\n @Event()\n public remove: EventEmitter<number | string>;\n\n @Element()\n private host: HTMLLimelChipElement;\n\n public componentWillLoad() {\n makeEnterClickable(this.host);\n }\n\n public disconnectedCallback() {\n removeEnterClickable(this.host);\n }\n\n public render() {\n return (\n <Host onClick={this.filterClickWhenDisabled}>\n {this.link ? this.renderAsLink() : this.renderAsButton()}\n </Host>\n );\n }\n\n private renderAsButton = () => {\n return [\n <button\n id={'chip-' + this.identifier}\n class=\"chip\"\n role=\"button\"\n disabled={this.disabled || this.readonly}\n onKeyDown={this.handleDeleteKeyDown}\n >\n {this.renderSpinner()}\n {this.renderIcon()}\n {this.renderLabel()}\n {this.renderBadge()}\n {this.renderProgressBar()}\n </button>,\n this.renderRemoveButton(),\n ];\n };\n\n private renderAsLink = () => {\n return [\n <a\n id={'chip-' + this.identifier}\n class=\"chip\"\n href={this.link.href}\n title={this.link.title}\n target={this.link.target}\n aria-disabled={this.disabled || this.readonly}\n tabindex={this.disabled || this.readonly ? -1 : 0}\n onKeyDown={this.handleDeleteKeyDown}\n >\n {this.renderSpinner()}\n {this.renderIcon()}\n {this.renderLabel()}\n {this.renderBadge()}\n {this.renderProgressBar()}\n </a>,\n this.renderRemoveButton(),\n ];\n };\n\n private renderLabel = () => {\n return <span class=\"text\">{this.text}</span>;\n };\n\n private renderIcon() {\n const icon = getIconName(this.icon);\n\n if (!icon) {\n return;\n }\n\n return (\n <limel-icon\n badge={true}\n name={icon}\n style={{\n color: `${(this.icon as Icon)?.color}`,\n 'background-color': `${\n (this.icon as Icon)?.backgroundColor\n }`,\n }}\n />\n );\n }\n\n private renderBadge() {\n if (!this.badge) {\n return;\n }\n\n return <limel-badge label={this.badge} />;\n }\n\n private renderRemoveButton() {\n if (!this.removable || this.readonly || this.disabled) {\n return;\n }\n\n const svgData =\n '<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" d=\"m8 8 16 16M24 8 8 24\"/></svg>';\n\n return (\n <button\n class=\"trailing-button remove-button\"\n tabIndex={-1}\n aria-label={this.removeChipLabel}\n aria-controls={'chip-' + this.identifier}\n innerHTML={svgData}\n onClick={this.handleRemoveClick}\n />\n );\n }\n\n private filterClickWhenDisabled = (e) => {\n if (this.disabled || this.readonly) {\n e.preventDefault();\n }\n };\n\n private handleRemoveClick = (event: MouseEvent | KeyboardEvent) => {\n event.stopPropagation();\n this.remove.emit(this.identifier);\n };\n\n private handleDeleteKeyDown = (event: KeyboardEvent) => {\n if (!this.removable) {\n return;\n }\n\n const keys = [DELETE, BACKSPACE];\n const keycodes = [DELETE_KEY_CODE, BACKSPACE_KEY_CODE];\n\n if (keys.includes(event.key) || keycodes.includes(event.keyCode)) {\n this.handleRemoveClick(event);\n }\n };\n\n private removeChipLabel = (): string => {\n return translate.get('chip-set.remove-chip', this.language);\n };\n\n private renderSpinner() {\n if (!this.loading) {\n return;\n }\n\n return <limel-linear-progress indeterminate={true} />;\n }\n\n private renderProgressBar() {\n if (!this.progress) {\n return;\n }\n\n const currentPercentage = this.progress + '%';\n const progress = Math.round(this.progress);\n\n return (\n <div\n role=\"progressbar\"\n aria-label=\"%\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n aria-valuenow={this.progress}\n style={{\n '--limel-chip-progress-percentage': currentPercentage,\n }}\n >\n <span>{progress}%</span>\n </div>\n );\n }\n}\n"]}
1
+ {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Content":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n} from '@stencil/core';\nimport { Icon } from '../../global/shared-types/icon.types';\nimport { Languages } from '../date-picker/date.types';\nimport { Link } from '../../global/shared-types/link.types';\nimport { getIconName } from '../icon/get-icon-props';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from '../../util/make-enter-clickable';\nimport translate from '../../global/translations';\nimport {\n BACKSPACE,\n BACKSPACE_KEY_CODE,\n DELETE,\n DELETE_KEY_CODE,\n} from '../../util/keycodes';\nimport { ChipType, Chip as OldChipInterface } from '../chip-set/chip.types';\n\ninterface ChipInterface extends Omit<OldChipInterface, 'id' | 'badge'> {\n /**\n * Identifier for the chip. Must be unique.\n */\n identifier?: number | string;\n\n /**\n * The value of the badge.\n */\n badge?: string | number;\n}\n\n/**\n * Chips and buttons are both interactive elements in UI design,\n * but they serve different purposes and are used in different contexts.\n *\n * :::warning\n * Do not use the chip component carelessly, as an alternative for\n * [`limel-button`](#/component/limel-button/) in the UI design!\n *\n * **Buttons:**\n * Buttons are used to trigger actions. They are typically used to\n * submit forms, open dialogs, initiate a process, or perform any action\n * that changes the state of the application.\n * Buttons' labels usually contain action words, in other words, the labels is\n * a _verb in imperative mood_ such as \"Submit\" or \"Delete\".\n * Buttons are placed in areas where it's clear they will initiate\n * an action when clicked.\n *\n * **Chips:**\n * Chips however are elements which may look like buttons, but they are\n * representing choices, filters, or tags, in a small block\n * or clearly bundled into a group. Chips are rarely used alone in the\n * user interface.\n * They are often used in a so called \"chip-set\", or placed together in\n * a section of the UI, where the user can expect more than one chip to be present.\n *\n * For example, a chip may represent a filter in a filter bar, or a tag in a tag list,\n * or an item in a shopping list.\n * Clicking a chip can also trigger an action, for example toggling a filter ON or OFF,\n * or opening a page with all posts tagged with the tag represented by the chip,\n * or navigating to a page with more information about the item in the shopping list.\n * :::\n *\n * @private\n * @exampleComponent limel-example-chip-button\n * @exampleComponent limel-example-chip-link\n * @exampleComponent limel-example-chip-icon-colors\n * @exampleComponent limel-example-chip-badge\n * @exampleComponent limel-example-chip-filter\n * @exampleComponent limel-example-chip-removable\n * @exampleComponent limel-example-chip-loading\n * @exampleComponent limel-example-chip-progress\n * @exampleComponent limel-example-chip-aria-role\n */\n@Component({\n tag: 'limel-chip',\n shadow: true,\n styleUrl: 'chip.scss',\n})\nexport class Chip implements ChipInterface {\n /**\n * Defines the language for translations.\n * Will translate the translatable strings on the components.\n */\n @Prop({ reflect: true })\n public language: Languages = 'en';\n\n /**\n * Label displayed on the chip\n */\n @Prop({ reflect: true })\n public text: string;\n\n /**\n * Icon of the chip.\n */\n @Prop()\n public icon?: string | Icon;\n\n /**\n * If supplied, the chip will become a clickable link.\n */\n @Prop()\n public link?: Omit<Link, 'text'>;\n\n /**\n * The value of the badge, displayed on the chip.\n */\n @Prop({ reflect: true })\n public badge?: string | number;\n\n /**\n * Set to `true` to disable the chip.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Set to `true` to render the chip as a static UI element.\n * Useful when the parent component has a `readonly` state.\n */\n @Prop({ reflect: true })\n public readonly = false;\n\n /**\n * Set to `true` to visualize the chip in a \"selected\" state.\n * This is typically used when the chip is used in a chip-set\n * along with other chips.\n */\n @Prop({ reflect: true })\n public selected = false;\n\n /**\n * Set to `true` to visualize the chip in an \"invalid\" or \"error\" state.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * Set to `true` to render a remove button on the chip.\n */\n @Prop({ reflect: true })\n public removable = false;\n\n /**\n * Set to `filter` to render the chip with a distinct style\n * suitable for visualizing filters.\n *\n * @beta\n */\n @Prop({ reflect: true })\n public type?: ChipType = 'default';\n\n /**\n * Set to `true` to put the component in the `loading` state,\n * and render an indeterminate progress indicator inside the chip.\n * This does _not_ disable the interactivity of the chip!\n */\n @Prop({ reflect: true })\n public loading? = false;\n\n /**\n * Reflects the current value of a progress bar on the chip,\n * visualizing the percentage of an ongoing process.\n * Must be a number between `0` and `100`.\n */\n @Prop({ reflect: true })\n public progress?: number;\n\n /**\n * Identifier for the chip. Must be unique.\n */\n @Prop({ reflect: true })\n public identifier?: number | string = crypto.randomUUID();\n\n /**\n * Fired when clicking on the remove button of a `removable` chip.\n * The value of `identifier` is emitted as the event detail.\n */\n @Event()\n public remove: EventEmitter<number | string>;\n\n @Element()\n private host: HTMLLimelChipElement;\n\n public componentWillLoad() {\n makeEnterClickable(this.host);\n }\n\n public disconnectedCallback() {\n removeEnterClickable(this.host);\n }\n\n public render() {\n return (\n <Host onClick={this.filterClickWhenDisabled}>\n {this.link ? this.renderAsLink() : this.renderAsButton()}\n </Host>\n );\n }\n\n private renderAsButton = () => {\n return [\n <button\n id={'chip-' + this.identifier}\n class=\"chip\"\n role=\"button\"\n disabled={this.disabled || this.readonly}\n onKeyDown={this.handleDeleteKeyDown}\n >\n {this.renderSpinner()}\n {this.renderIcon()}\n {this.renderLabel()}\n {this.renderBadge()}\n {this.renderProgressBar()}\n </button>,\n this.renderRemoveButton(),\n ];\n };\n\n private renderAsLink = () => {\n return [\n <a\n id={'chip-' + this.identifier}\n class=\"chip\"\n href={this.link.href}\n title={this.link.title}\n target={this.link.target}\n aria-disabled={this.disabled || this.readonly}\n tabindex={this.disabled || this.readonly ? -1 : 0}\n onKeyDown={this.handleDeleteKeyDown}\n >\n {this.renderSpinner()}\n {this.renderIcon()}\n {this.renderLabel()}\n {this.renderBadge()}\n {this.renderProgressBar()}\n </a>,\n this.renderRemoveButton(),\n ];\n };\n\n private renderLabel = () => {\n return <span class=\"text\">{this.text}</span>;\n };\n\n private renderIcon() {\n const icon = getIconName(this.icon);\n\n if (!icon) {\n return;\n }\n\n return (\n <limel-icon\n badge={true}\n name={icon}\n style={{\n color: `${(this.icon as Icon)?.color}`,\n 'background-color': `${\n (this.icon as Icon)?.backgroundColor\n }`,\n }}\n />\n );\n }\n\n private renderBadge() {\n if (!this.badge) {\n return;\n }\n\n return <limel-badge label={this.badge} />;\n }\n\n private renderRemoveButton() {\n if (!this.removable || this.readonly || this.disabled) {\n return;\n }\n\n const svgData =\n '<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" d=\"m8 8 16 16M24 8 8 24\"/></svg>';\n\n return (\n <button\n class=\"trailing-button remove-button\"\n tabIndex={-1}\n aria-label={this.removeChipLabel}\n aria-controls={'chip-' + this.identifier}\n innerHTML={svgData}\n onClick={this.handleRemoveClick}\n />\n );\n }\n\n private filterClickWhenDisabled = (e) => {\n if (this.disabled || this.readonly) {\n e.preventDefault();\n }\n };\n\n private handleRemoveClick = (event: MouseEvent | KeyboardEvent) => {\n event.stopPropagation();\n this.remove.emit(this.identifier);\n };\n\n private handleDeleteKeyDown = (event: KeyboardEvent) => {\n if (!this.removable) {\n return;\n }\n\n const keys = [DELETE, BACKSPACE];\n const keycodes = [DELETE_KEY_CODE, BACKSPACE_KEY_CODE];\n\n if (keys.includes(event.key) || keycodes.includes(event.keyCode)) {\n this.handleRemoveClick(event);\n }\n };\n\n private removeChipLabel = (): string => {\n return translate.get('chip-set.remove-chip', this.language);\n };\n\n private renderSpinner() {\n if (!this.loading) {\n return;\n }\n\n return <limel-linear-progress indeterminate={true} />;\n }\n\n private renderProgressBar() {\n if (!this.progress) {\n return;\n }\n\n const currentPercentage = this.progress + '%';\n\n return (\n <div\n role=\"progressbar\"\n aria-label=\"%\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n aria-valuenow={this.progress}\n style={{\n '--limel-chip-progress-percentage': currentPercentage,\n }}\n />\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"chip-set.js","sourceRoot":"","sources":["../../../src/components/chip-set/chip-set.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GACR,MAAM,eAAe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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Chip, ChipType } from '../chip-set/chip.types';\nimport { Languages } from '../date-picker/date.types';\nimport { MDCTextField } from '@material/textfield';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { handleKeyboardEvent } from './chip-set-input-helpers';\nimport translate from '../../global/translations';\nimport { getHref, getTarget } from '../../util/link-helper';\nimport { isEqual } from 'lodash-es';\nimport { LimelChipCustomEvent } from 'src/components';\n\nconst INPUT_FIELD_TABINDEX = 1;\n\n/**\n * :::note\n * **Regarding `click` and `interact` events:**\n *\n * The `interact` event is emitted when a chip is interacted with, and is\n * the recommended way to listen for chip interactions.\n *\n * However, if you need to handle clicks differently depending on which chip\n * was clicked, or whether the click was on a chip or elsewhere, you need to\n * listen to the native `click` event instead.\n *\n * Native `click` events are passed through, and if the click came from\n * a chip, the chip object is available in the event object under\n * `<event object>.Lime.chip`.\n *\n * Example usage:\n * ```ts\n * private handleClick(event: Event) {\n * if (event && 'Lime' in event && (event.Lime as any).chip) {\n * if ((event.Lime as { chip: Chip }).chip.href) {\n * // Chip has href, so let the browser open the link.\n * return;\n * }\n * // handle click on chip without href\n * } else {\n * // handle click elsewhere\n * }\n * }\n * ```\n * :::\n *\n * @exampleComponent limel-example-chip-set\n * @exampleComponent limel-example-chip-set-choice\n * @exampleComponent limel-example-chip-set-filter\n * @exampleComponent limel-example-chip-set-filter-badge\n * @exampleComponent limel-example-chip-set-input\n * @exampleComponent limel-example-chip-set-input-type-text\n * @exampleComponent limel-example-chip-set-input-type-search\n * @exampleComponent limel-example-chip-icon-color\n * @exampleComponent limel-example-chip-set-composite\n */\n@Component({\n tag: 'limel-chip-set',\n shadow: true,\n styleUrl: 'chip-set.scss',\n})\nexport class ChipSet {\n /**\n * List of chips for the set\n */\n @Prop()\n public value: Chip[] = [];\n\n /**\n * Type of chip set\n *\n * - `choice` renders a set of selectable chips where only one is selectable. The `removable` property is ignored\n * - `filter` renders a set of selectable chips where all are selectable.\n * - `input` renders a set of chips that can be used in conjunction with an input field\n *\n * If no type is set, a basic set of chips without additional functionality will be rendered\n */\n @Prop({ reflect: true })\n public type?: 'choice' | 'filter' | 'input';\n\n /**\n * Label for the chip-set\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Optional helper text to display below the chipset.\n * When type is `input`, the helper text is displayed below the\n * input field when it has focus.\n * When type is not `input`, the helper text is always displayed\n * if the device is touch screen; otherwise it is shown when chip-set\n * is hovered or focused using keyboard navigation.\n */\n @Prop({ reflect: true })\n public helperText: string;\n\n /**\n * True if the chip set should be disabled\n */\n @Prop({ reflect: true })\n public disabled: boolean = false;\n\n /**\n * For chip-sets of type `input`, set to `true` to disable adding and\n * removing chips, but allow interaction with existing chips in the set.\n * For any other types, setting either `readonly` or `disabled` disables\n * the chip-set.\n */\n @Prop({ reflect: true })\n public readonly: boolean = false;\n\n /**\n * Set to `true` to indicate that the current value of the input field is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * For chip-sets of type `input`. Value to use for the `type` attribute on the\n * input field inside the chip-set.\n */\n @Prop({ reflect: true })\n public inputType: 'search' | 'text' = 'text';\n\n /**\n * For chip-sets of type `input`. Limits the maximum number of chips.\n * When the value is `0` or not set, no limit is applied.\n */\n @Prop({ reflect: true })\n public maxItems: number;\n\n /**\n * True if the control requires a value\n */\n @Prop({ reflect: true })\n public required: boolean = false;\n\n /**\n * Search label to display when type is `input` and component is in search mode\n */\n @Prop({ reflect: true })\n public searchLabel: string;\n\n /**\n * Whether the input field should be emptied when the chip-set loses focus.\n */\n @Prop({ reflect: true })\n public emptyInputOnBlur: boolean = true;\n\n /**\n * Whether the \"Clear all\" buttons should be shown\n */\n @Prop()\n public clearAllButton: boolean = true;\n\n /**\n * For chip-sets of type `input`. When the value is null, no leading icon is used.\n * Leading icon to show to the far left in the text field\n */\n @Prop({ reflect: true })\n public leadingIcon: string = null;\n\n /**\n * For chip-set of type `input`. Sets delimiters between chips.\n */\n @Prop({ reflect: true })\n public delimiter: string = null;\n\n /**\n * Defines the language for translations.\n * Will translate the translatable strings on the components. For example, the clear all chips label.\n */\n @Prop()\n public language: Languages = 'en';\n\n /**\n * Dispatched when a chip is interacted with\n */\n @Event()\n private interact: EventEmitter<Chip>;\n\n /**\n * Dispatched when a chip is selected/deselected\n */\n @Event()\n private change: EventEmitter<Chip | Chip[]>;\n\n /**\n * Emitted when an input chip set has received focus and editing in the text field has started\n */\n @Event()\n private startEdit: EventEmitter<void>;\n\n /**\n * Emitted when an input chip set has lost focus and editing in the text field has ended\n */\n @Event()\n private stopEdit: EventEmitter<void>;\n\n /**\n * Dispatched when the input is changed for type `input`\n */\n @Event()\n private input: EventEmitter<string>;\n\n @Element()\n private host: HTMLLimelChipSetElement;\n\n @State()\n private editMode: boolean = false;\n\n @State()\n private textValue: string = '';\n\n @State()\n private blurred: boolean = false;\n\n @State()\n private inputChipIndexSelected: number = null;\n\n @State()\n private selectedChipIds: Array<string | number>;\n\n private mdcTextField: MDCTextField;\n private handleKeyDown = handleKeyboardEvent;\n\n constructor() {\n this.renderChip = this.renderChip.bind(this);\n this.renderInputChip = this.renderInputChip.bind(this);\n this.isFull = this.isFull.bind(this);\n this.handleTextFieldFocus = this.handleTextFieldFocus.bind(this);\n this.handleInputBlur = this.handleInputBlur.bind(this);\n this.handleTextInput = this.handleTextInput.bind(this);\n this.inputFieldOnChange = this.inputFieldOnChange.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.inputHidden = this.inputHidden.bind(this);\n this.handleDeleteAllIconClick =\n this.handleDeleteAllIconClick.bind(this);\n this.renderDelimiter = this.renderDelimiter.bind(this);\n }\n\n public connectedCallback() {\n this.initialize();\n }\n\n private initialize() {\n if (this.value.length) {\n this.selectedChipIds = this.value\n .filter((chip) => chip.selected)\n .map((chip) => chip.id);\n }\n }\n\n /**\n * Used to find out whether the chip-set is in edit mode.\n *\n * @returns `true` if the chip-set is in edit mode, `false` otherwise.\n */\n @Method()\n public async getEditMode(): Promise<boolean> {\n return this.editMode;\n }\n\n /**\n * Used to set focus to the chip-set input field.\n *\n * @param emptyInput - if `true`, any text in the input is discarded\n * @returns does not return anything, but methods have to be async\n */\n @Method()\n public async setFocus(emptyInput: boolean = false) {\n if (this.disabled || this.readonly) {\n return;\n }\n\n this.editMode = true;\n if (emptyInput) {\n this.textValue = '';\n }\n\n this.host.shadowRoot.querySelector('input').focus();\n this.startEdit.emit();\n }\n\n /**\n * Used to empty the input field. Used in conjunction with `emptyInputOnBlur` to let the\n * consumer control when the input is emptied.\n *\n * @returns does not return anything, but methods have to be async\n */\n @Method()\n public async emptyInput() {\n this.syncEmptyInput();\n }\n\n public componentDidLoad() {\n this.triggerIconColorWarning(this.value);\n\n if (this.type === 'input') {\n this.mdcTextField = new MDCTextField(\n this.host.shadowRoot.querySelector('.mdc-text-field'),\n );\n }\n }\n\n public componentDidUpdate() {\n const input = this.host.shadowRoot.querySelector('input');\n if (input && this.editMode) {\n input.focus();\n }\n }\n\n public disconnectedCallback() {\n if (this.mdcTextField) {\n this.mdcTextField.destroy();\n }\n }\n\n public render() {\n if (this.type === 'input') {\n return this.renderInputChips();\n }\n\n const classes = {\n 'mdc-chip-set': true,\n disabled: this.disabled || this.readonly,\n 'mdc-text-field--with-trailing-icon': true,\n };\n if (this.type) {\n classes[`mdc-chip-set--${this.type}`] = true;\n }\n\n const chipSetLabel = this.renderChipSetLabel();\n if (chipSetLabel) {\n classes['chip-set--with-label'] = true;\n }\n\n const value = this.getValue();\n\n return (\n <div class={classes} role=\"grid\">\n {chipSetLabel}\n {value.map(this.renderChip)}\n {this.renderHelperLine()}\n </div>\n );\n }\n\n private getValue = () => {\n return this.value.map((chip) => ({\n ...chip,\n ...(this.type && {\n selected: this.selectedChipIds.includes(chip.id),\n }),\n }));\n };\n\n @Watch('value')\n protected handleChangeChips(newValue: Chip[], oldValue: Chip[]) {\n if (isEqual(newValue, oldValue)) {\n return;\n }\n\n this.syncEmptyInput();\n this.initialize();\n }\n\n private renderChipSetLabel() {\n if (!this.label) {\n return;\n }\n\n return (\n <label class=\"chip-set__label mdc-floating-label mdc-floating-label--float-above\">\n {this.label}\n </label>\n );\n }\n\n private renderInputChips() {\n return [\n <div\n class={{\n 'mdc-text-field mdc-text-field--outlined': true,\n 'mdc-chip-set mdc-chip-set--input': true,\n 'force-invalid': this.isInvalid(),\n 'mdc-text-field--disabled': this.readonly || this.disabled,\n 'lime-text-field--readonly': this.readonly,\n 'has-chips mdc-text-field--label-floating':\n this.value.length !== 0,\n 'has-leading-icon': this.leadingIcon !== null,\n 'has-clear-all-button': this.clearAllButton,\n }}\n onClick={this.handleTextFieldFocus}\n >\n {this.value.map(this.renderInputChip)}\n <input\n tabIndex={INPUT_FIELD_TABINDEX}\n type={this.inputType}\n id=\"input-element\"\n disabled={this.readonly || this.disabled}\n class={{\n 'mdc-text-field__input': true,\n hidden: this.inputHidden(),\n }}\n value={this.textValue}\n onBlur={this.handleInputBlur}\n onFocus={this.handleTextFieldFocus}\n onKeyDown={this.handleKeyDown}\n onInput={this.handleTextInput}\n // Some browsers emit a change event on input elements, we need to stop\n // that event from propagating since we are emitting our own change event\n onChange={this.inputFieldOnChange}\n placeholder={this.isFull() ? '' : this.searchLabel}\n readonly={this.isFull()}\n />\n <div\n class={{\n 'mdc-notched-outline': true,\n 'mdc-notched-outline--upgraded': true,\n 'mdc-text-field--required': this.required,\n 'lime-notched-outline--notched': this.floatLabelAbove(),\n }}\n dropzone-tip={this.dropZoneTip()}\n >\n <div class=\"mdc-notched-outline__leading\" />\n {this.renderLabel()}\n <div class=\"mdc-notched-outline__trailing\" />\n </div>\n {this.renderLeadingIcon()}\n {this.renderEmptyValueForReadonly()}\n {this.renderClearAllChipsButton()}\n </div>,\n this.renderHelperLine(),\n ];\n }\n\n private renderEmptyValueForReadonly = () => {\n if (this.readonly && this.value.length === 0) {\n return (\n <span class=\"lime-empty-value-for-readonly lime-looks-like-input-value\">\n –\n </span>\n );\n }\n };\n\n private renderLabel() {\n const labelClassList = {\n 'mdc-floating-label': true,\n 'mdc-text-field--disabled': this.readonly || this.disabled,\n 'mdc-floating-label--required': this.required,\n 'lime-floating-label--float-above': this.floatLabelAbove(),\n };\n\n if (!this.label) {\n return;\n }\n\n return (\n <div class=\"mdc-notched-outline__notch\">\n <label class={labelClassList} htmlFor=\"input-element\">\n {this.label}\n </label>\n </div>\n );\n }\n\n private floatLabelAbove = () => {\n if (!!this.value.length || this.editMode || this.readonly) {\n return true;\n }\n };\n\n private dropZoneTip = (): string => {\n return translate.get('file.drag-and-drop-tips', this.language);\n };\n\n private isFull(): boolean {\n return !!this.maxItems && this.value.length >= this.maxItems;\n }\n\n private isInvalid() {\n if (this.readonly) {\n // A readonly field can never be invalid.\n return false;\n }\n\n if (this.invalid) {\n return true;\n }\n\n if (!this.required) {\n return false;\n }\n\n if (!this.blurred) {\n return false;\n }\n\n return !this.value || !this.value.length;\n }\n\n private inputFieldOnChange(event) {\n event.stopPropagation();\n }\n\n /**\n * Enter edit mode when the text field receives focus. When editMode is true, the input element will be visible\n */\n private handleTextFieldFocus() {\n if (this.disabled || this.readonly) {\n return;\n }\n\n if (this.editMode) {\n return;\n }\n\n this.editMode = true;\n this.startEdit.emit();\n }\n\n /**\n * Exit edit mode when the input element loses focus. This makes sure the input element does not take up any\n * additional space when the user it not typing anything\n */\n private handleInputBlur() {\n if (this.emptyInputOnBlur) {\n this.syncEmptyInput();\n }\n\n this.editMode = false;\n this.blurred = true;\n this.inputChipIndexSelected = null;\n\n // This timeout is needed in order to let a new element receive focus\n setTimeout(() => {\n this.stopEdit.emit();\n }, 0);\n }\n\n private syncEmptyInput() {\n this.textValue = '';\n }\n\n private inputHidden() {\n if (this.editMode) {\n return this.isFull();\n }\n\n // If there are chips in the picker, hide the input to avoid the input\n // being placed on a new line and adding ugly space beneath the chips.\n // If there are no chips, show the input, or the picker will look weird.\n return !!(this.value && this.value.length);\n }\n\n private handleTextInput(event) {\n event.stopPropagation();\n this.inputChipIndexSelected = null;\n this.textValue = event.target.value;\n this.input.emit(event.target.value && event.target.value.trim());\n }\n\n private emitInteraction(chip: Chip) {\n this.interact.emit(chip);\n }\n\n private renderChip(chip: Chip) {\n const chipType: ChipType =\n this.type === 'filter' ? 'filter' : 'default';\n\n const chipProps = this.getChipProps(chip, chipType);\n\n return <limel-chip {...chipProps} />;\n }\n\n private hasHelperText = () => {\n return this.helperText !== null && this.helperText !== undefined;\n };\n\n private renderHelperLine = () => {\n if (!this.maxItems && !this.hasHelperText()) {\n return;\n }\n\n return (\n <limel-helper-line\n length={this.value.length}\n maxLength={this.maxItems}\n helperText={this.helperText}\n invalid={this.isInvalid()}\n />\n );\n };\n\n private renderInputChip(chip: Chip, index: number) {\n const chipProps = this.getChipProps(chip, 'default');\n\n return [\n <limel-chip\n key={chip.id}\n class={{\n 'can-be-removed': this.inputChipIndexSelected === index,\n }}\n {...chipProps}\n />,\n this.renderDelimiter(),\n ];\n }\n\n private getChipProps(chip: Chip, chipType: ChipType) {\n const removable =\n this.type === 'input' && chip.removable && !this.readonly;\n const readonly = this.readonly && this.type !== 'input';\n\n return {\n role: 'row',\n identifier: chip.id,\n text: chip.text,\n icon: chip.icon,\n badge: chip.badge,\n selected: chip.selected,\n disabled: this.disabled,\n readonly: readonly,\n type: chipType,\n removable: removable,\n onClick: this.catchInputChipClicks(chip),\n onRemove: this.handleRemoveChip,\n ...(chip.href && {\n link: {\n href: getHref(chip.href),\n target: getTarget(chip.href),\n },\n }),\n };\n }\n\n private catchInputChipClicks = (chip: Chip) => (event: Event) => {\n /*\n * We need to add the `chip` to the event object so that the consumer\n * can get the chip object when the chip is clicked.\n * This is necessary for the consumer to be able to handle the click\n * event itself, based on which chip was clicked, or whether the click\n * was on a chip or elsewhere. The reason the consumer can't just look\n * at the event target is that that information is hidden by the\n * shadow DOM.\n *\n * See documentation for the `interact` event for more information.\n */\n (event as any).Lime = { chip: chip };\n\n if (this.isSelectableChip(chip)) {\n this.updateSelectedChipIds(chip);\n this.change.emit(chip);\n }\n\n this.emitInteraction(chip);\n };\n\n private isSelectableChip(chip: Chip): boolean {\n return this.type !== 'input' && 'selected' in chip;\n }\n\n private updateSelectedChipIds(chip: Chip): void {\n chip.selected = !chip.selected;\n const id = chip.id;\n if (this.type === 'choice') {\n this.updateChoiceTypeSelectedIds(id);\n } else {\n this.updateFilterTypeSelectedIds(id);\n }\n }\n\n private updateChoiceTypeSelectedIds(id: number | string): void {\n this.selectedChipIds = this.isChipSelected(id) ? [] : [id];\n }\n\n private isChipSelected(id: number | string): boolean {\n return !!this.selectedChipIds.find((chipId) => chipId === id);\n }\n\n private updateFilterTypeSelectedIds(id: number | string): void {\n if (this.isChipSelected(id)) {\n this.removeChipIdFromSelectedChipIds(id);\n } else {\n this.addChipIdToSelectedChipIds(id);\n }\n }\n\n private removeChipIdFromSelectedChipIds(id: number | string): void {\n this.selectedChipIds = this.selectedChipIds.filter(\n (chipId) => chipId !== id,\n );\n }\n\n private addChipIdToSelectedChipIds(id: number | string): void {\n this.selectedChipIds = [...this.selectedChipIds, id];\n }\n\n private handleRemoveChip = (\n event: LimelChipCustomEvent<string | number>,\n ) => {\n this.removeChip(event.detail);\n };\n\n private removeChip = (identifier: string | number) => {\n const newValue = this.value.filter((chip) => {\n return chip.id !== identifier;\n });\n this.change.emit(newValue);\n };\n\n private renderLeadingIcon() {\n if (!this.leadingIcon) {\n return;\n }\n\n return (\n <i class=\"mdc-text-field__icon search-icon\">\n <limel-icon name={this.leadingIcon} />\n </i>\n );\n }\n\n private renderClearAllChipsButton() {\n if (this.disabled || this.readonly || !this.clearAllButton) {\n return;\n }\n\n return (\n <a\n href=\"\"\n onClick={this.handleDeleteAllIconClick}\n class=\"mdc-text-field__icon clear-all-button\"\n tabindex=\"0\"\n role=\"button\"\n title={this.clearAllChipsLabel()}\n aria-label={this.clearAllChipsLabel()}\n />\n );\n }\n\n private clearAllChipsLabel = (): string => {\n return translate.get('chip-set.clear-all', this.language);\n };\n\n private handleDeleteAllIconClick(event: Event) {\n event.preventDefault();\n this.change.emit([]);\n }\n\n private renderDelimiter() {\n if (!this.delimiter) {\n return;\n }\n\n return <div class=\"delimiter\">{this.delimiter}</div>;\n }\n\n private triggerIconColorWarning(value: Chip[]) {\n for (const chip of value) {\n if (\n chip.icon &&\n (chip.iconFillColor ||\n chip.iconBackgroundColor ||\n chip.iconTitle)\n ) {\n /* eslint-disable-next-line no-console */\n console.warn(\n \"The `iconFillColor`, `iconBackgroundColor`, and `iconTitle` props are deprecated now! Use the new `Icon` interface and instead of `iconColor: 'color-name', `iconBackgroundColor: 'color-name', and `iconTitle: 'title'`, write `icon { name: 'icon-name', color: 'color-name', backgroundColor: 'color-name', title: 'title' }`.\",\n );\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"chip-set.js","sourceRoot":"","sources":["../../../src/components/chip-set/chip-set.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAMH,MAAM,OAAO,OAAO;EAuKhB;IAFQ,kBAAa,GAAG,mBAAmB,CAAC;IA4HpC,aAAQ,GAAG,GAAG,EAAE;MACpB,OAAO,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AAK,EAAC,WAAW,IAAE,IAAI,CAAC,SAAS,CAAO,CAAC;EACzD,CAAC;EAEO,uBAAuB,CAAC,KAAa;IACzC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;MACtB,IACI,IAAI,CAAC,IAAI;QACT,CAAC,IAAI,CAAC,aAAa;UACf,IAAI,CAAC,mBAAmB;UACxB,IAAI,CAAC,SAAS,CAAC,EACrB;QACE,yCAAyC;QACzC,OAAO,CAAC,IAAI,CACR,mUAAmU,CACtU,CAAC;OACL;KACJ;EACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Chip, ChipType } from '../chip-set/chip.types';\nimport { Languages } from '../date-picker/date.types';\nimport { MDCTextField } from '@material/textfield';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { handleKeyboardEvent } from './chip-set-input-helpers';\nimport translate from '../../global/translations';\nimport { getHref, getTarget } from '../../util/link-helper';\nimport { isEqual } from 'lodash-es';\nimport { LimelChipCustomEvent } from '../../components';\n\nconst INPUT_FIELD_TABINDEX = 1;\n\n/**\n * :::note\n * **Regarding `click` and `interact` events:**\n *\n * The `interact` event is emitted when a chip is interacted with, and is\n * the recommended way to listen for chip interactions.\n *\n * However, if you need to handle clicks differently depending on which chip\n * was clicked, or whether the click was on a chip or elsewhere, you need to\n * listen to the native `click` event instead.\n *\n * Native `click` events are passed through, and if the click came from\n * a chip, the chip object is available in the event object under\n * `<event object>.Lime.chip`.\n *\n * Example usage:\n * ```ts\n * private handleClick(event: Event) {\n * if (event && 'Lime' in event && (event.Lime as any).chip) {\n * if ((event.Lime as { chip: Chip }).chip.href) {\n * // Chip has href, so let the browser open the link.\n * return;\n * }\n * // handle click on chip without href\n * } else {\n * // handle click elsewhere\n * }\n * }\n * ```\n * :::\n *\n * @exampleComponent limel-example-chip-set\n * @exampleComponent limel-example-chip-set-choice\n * @exampleComponent limel-example-chip-set-filter\n * @exampleComponent limel-example-chip-set-filter-badge\n * @exampleComponent limel-example-chip-set-input\n * @exampleComponent limel-example-chip-set-input-type-text\n * @exampleComponent limel-example-chip-set-input-type-search\n * @exampleComponent limel-example-chip-icon-color\n * @exampleComponent limel-example-chip-set-composite\n */\n@Component({\n tag: 'limel-chip-set',\n shadow: true,\n styleUrl: 'chip-set.scss',\n})\nexport class ChipSet {\n /**\n * List of chips for the set\n */\n @Prop()\n public value: Chip[] = [];\n\n /**\n * Type of chip set\n *\n * - `choice` renders a set of selectable chips where only one is selectable. The `removable` property is ignored\n * - `filter` renders a set of selectable chips where all are selectable.\n * - `input` renders a set of chips that can be used in conjunction with an input field\n *\n * If no type is set, a basic set of chips without additional functionality will be rendered\n */\n @Prop({ reflect: true })\n public type?: 'choice' | 'filter' | 'input';\n\n /**\n * Label for the chip-set\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Optional helper text to display below the chipset.\n * When type is `input`, the helper text is displayed below the\n * input field when it has focus.\n * When type is not `input`, the helper text is always displayed\n * if the device is touch screen; otherwise it is shown when chip-set\n * is hovered or focused using keyboard navigation.\n */\n @Prop({ reflect: true })\n public helperText: string;\n\n /**\n * True if the chip set should be disabled\n */\n @Prop({ reflect: true })\n public disabled: boolean = false;\n\n /**\n * For chip-sets of type `input`, set to `true` to disable adding and\n * removing chips, but allow interaction with existing chips in the set.\n * For any other types, setting either `readonly` or `disabled` disables\n * the chip-set.\n */\n @Prop({ reflect: true })\n public readonly: boolean = false;\n\n /**\n * Set to `true` to indicate that the current value of the input field is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * For chip-sets of type `input`. Value to use for the `type` attribute on the\n * input field inside the chip-set.\n */\n @Prop({ reflect: true })\n public inputType: 'search' | 'text' = 'text';\n\n /**\n * For chip-sets of type `input`. Limits the maximum number of chips.\n * When the value is `0` or not set, no limit is applied.\n */\n @Prop({ reflect: true })\n public maxItems: number;\n\n /**\n * True if the control requires a value\n */\n @Prop({ reflect: true })\n public required: boolean = false;\n\n /**\n * Search label to display when type is `input` and component is in search mode\n */\n @Prop({ reflect: true })\n public searchLabel: string;\n\n /**\n * Whether the input field should be emptied when the chip-set loses focus.\n */\n @Prop({ reflect: true })\n public emptyInputOnBlur: boolean = true;\n\n /**\n * Whether the \"Clear all\" buttons should be shown\n */\n @Prop()\n public clearAllButton: boolean = true;\n\n /**\n * For chip-sets of type `input`. When the value is null, no leading icon is used.\n * Leading icon to show to the far left in the text field\n */\n @Prop({ reflect: true })\n public leadingIcon: string = null;\n\n /**\n * For chip-set of type `input`. Sets delimiters between chips.\n */\n @Prop({ reflect: true })\n public delimiter: string = null;\n\n /**\n * Defines the language for translations.\n * Will translate the translatable strings on the components. For example, the clear all chips label.\n */\n @Prop()\n public language: Languages = 'en';\n\n /**\n * Dispatched when a chip is interacted with\n */\n @Event()\n private interact: EventEmitter<Chip>;\n\n /**\n * Dispatched when a chip is selected/deselected\n */\n @Event()\n private change: EventEmitter<Chip | Chip[]>;\n\n /**\n * Emitted when an input chip set has received focus and editing in the text field has started\n */\n @Event()\n private startEdit: EventEmitter<void>;\n\n /**\n * Emitted when an input chip set has lost focus and editing in the text field has ended\n */\n @Event()\n private stopEdit: EventEmitter<void>;\n\n /**\n * Dispatched when the input is changed for type `input`\n */\n @Event()\n private input: EventEmitter<string>;\n\n @Element()\n private host: HTMLLimelChipSetElement;\n\n @State()\n private editMode: boolean = false;\n\n @State()\n private textValue: string = '';\n\n @State()\n private blurred: boolean = false;\n\n @State()\n private inputChipIndexSelected: number = null;\n\n @State()\n private selectedChipIds: Array<string | number>;\n\n private mdcTextField: MDCTextField;\n private handleKeyDown = handleKeyboardEvent;\n\n constructor() {\n this.renderChip = this.renderChip.bind(this);\n this.renderInputChip = this.renderInputChip.bind(this);\n this.isFull = this.isFull.bind(this);\n this.handleTextFieldFocus = this.handleTextFieldFocus.bind(this);\n this.handleInputBlur = this.handleInputBlur.bind(this);\n this.handleTextInput = this.handleTextInput.bind(this);\n this.inputFieldOnChange = this.inputFieldOnChange.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.inputHidden = this.inputHidden.bind(this);\n this.handleDeleteAllIconClick =\n this.handleDeleteAllIconClick.bind(this);\n this.renderDelimiter = this.renderDelimiter.bind(this);\n }\n\n public connectedCallback() {\n this.initialize();\n }\n\n private initialize() {\n if (this.value.length) {\n this.selectedChipIds = this.value\n .filter((chip) => chip.selected)\n .map((chip) => chip.id);\n }\n }\n\n /**\n * Used to find out whether the chip-set is in edit mode.\n *\n * @returns `true` if the chip-set is in edit mode, `false` otherwise.\n */\n @Method()\n public async getEditMode(): Promise<boolean> {\n return this.editMode;\n }\n\n /**\n * Used to set focus to the chip-set input field.\n *\n * @param emptyInput - if `true`, any text in the input is discarded\n * @returns does not return anything, but methods have to be async\n */\n @Method()\n public async setFocus(emptyInput: boolean = false) {\n if (this.disabled || this.readonly) {\n return;\n }\n\n this.editMode = true;\n if (emptyInput) {\n this.textValue = '';\n }\n\n this.host.shadowRoot.querySelector('input').focus();\n this.startEdit.emit();\n }\n\n /**\n * Used to empty the input field. Used in conjunction with `emptyInputOnBlur` to let the\n * consumer control when the input is emptied.\n *\n * @returns does not return anything, but methods have to be async\n */\n @Method()\n public async emptyInput() {\n this.syncEmptyInput();\n }\n\n public componentDidLoad() {\n this.triggerIconColorWarning(this.value);\n\n if (this.type === 'input') {\n this.mdcTextField = new MDCTextField(\n this.host.shadowRoot.querySelector('.mdc-text-field'),\n );\n }\n }\n\n public componentDidUpdate() {\n const input = this.host.shadowRoot.querySelector('input');\n if (input && this.editMode) {\n input.focus();\n }\n }\n\n public disconnectedCallback() {\n if (this.mdcTextField) {\n this.mdcTextField.destroy();\n }\n }\n\n public render() {\n if (this.type === 'input') {\n return this.renderInputChips();\n }\n\n const classes = {\n 'mdc-chip-set': true,\n disabled: this.disabled || this.readonly,\n 'mdc-text-field--with-trailing-icon': true,\n };\n if (this.type) {\n classes[`mdc-chip-set--${this.type}`] = true;\n }\n\n const chipSetLabel = this.renderChipSetLabel();\n if (chipSetLabel) {\n classes['chip-set--with-label'] = true;\n }\n\n const value = this.getValue();\n\n return (\n <div class={classes} role=\"grid\">\n {chipSetLabel}\n {value.map(this.renderChip)}\n {this.renderHelperLine()}\n </div>\n );\n }\n\n private getValue = () => {\n return this.value.map((chip) => ({\n ...chip,\n ...(this.type && {\n selected: this.selectedChipIds.includes(chip.id),\n }),\n }));\n };\n\n @Watch('value')\n protected handleChangeChips(newValue: Chip[], oldValue: Chip[]) {\n if (isEqual(newValue, oldValue)) {\n return;\n }\n\n this.syncEmptyInput();\n this.initialize();\n }\n\n private renderChipSetLabel() {\n if (!this.label) {\n return;\n }\n\n return (\n <label class=\"chip-set__label mdc-floating-label mdc-floating-label--float-above\">\n {this.label}\n </label>\n );\n }\n\n private renderInputChips() {\n return [\n <div\n class={{\n 'mdc-text-field mdc-text-field--outlined': true,\n 'mdc-chip-set mdc-chip-set--input': true,\n 'force-invalid': this.isInvalid(),\n 'mdc-text-field--disabled': this.readonly || this.disabled,\n 'lime-text-field--readonly': this.readonly,\n 'has-chips mdc-text-field--label-floating':\n this.value.length !== 0,\n 'has-leading-icon': this.leadingIcon !== null,\n 'has-clear-all-button': this.clearAllButton,\n }}\n onClick={this.handleTextFieldFocus}\n >\n {this.value.map(this.renderInputChip)}\n <input\n tabIndex={INPUT_FIELD_TABINDEX}\n type={this.inputType}\n id=\"input-element\"\n disabled={this.readonly || this.disabled}\n class={{\n 'mdc-text-field__input': true,\n hidden: this.inputHidden(),\n }}\n value={this.textValue}\n onBlur={this.handleInputBlur}\n onFocus={this.handleTextFieldFocus}\n onKeyDown={this.handleKeyDown}\n onInput={this.handleTextInput}\n // Some browsers emit a change event on input elements, we need to stop\n // that event from propagating since we are emitting our own change event\n onChange={this.inputFieldOnChange}\n placeholder={this.isFull() ? '' : this.searchLabel}\n readonly={this.isFull()}\n />\n <div\n class={{\n 'mdc-notched-outline': true,\n 'mdc-notched-outline--upgraded': true,\n 'mdc-text-field--required': this.required,\n 'lime-notched-outline--notched': this.floatLabelAbove(),\n }}\n dropzone-tip={this.dropZoneTip()}\n >\n <div class=\"mdc-notched-outline__leading\" />\n {this.renderLabel()}\n <div class=\"mdc-notched-outline__trailing\" />\n </div>\n {this.renderLeadingIcon()}\n {this.renderEmptyValueForReadonly()}\n {this.renderClearAllChipsButton()}\n </div>,\n this.renderHelperLine(),\n ];\n }\n\n private renderEmptyValueForReadonly = () => {\n if (this.readonly && this.value.length === 0) {\n return (\n <span class=\"lime-empty-value-for-readonly lime-looks-like-input-value\">\n –\n </span>\n );\n }\n };\n\n private renderLabel() {\n const labelClassList = {\n 'mdc-floating-label': true,\n 'mdc-text-field--disabled': this.readonly || this.disabled,\n 'mdc-floating-label--required': this.required,\n 'lime-floating-label--float-above': this.floatLabelAbove(),\n };\n\n if (!this.label) {\n return;\n }\n\n return (\n <div class=\"mdc-notched-outline__notch\">\n <label class={labelClassList} htmlFor=\"input-element\">\n {this.label}\n </label>\n </div>\n );\n }\n\n private floatLabelAbove = () => {\n if (!!this.value.length || this.editMode || this.readonly) {\n return true;\n }\n };\n\n private dropZoneTip = (): string => {\n return translate.get('file.drag-and-drop-tips', this.language);\n };\n\n private isFull(): boolean {\n return !!this.maxItems && this.value.length >= this.maxItems;\n }\n\n private isInvalid() {\n if (this.readonly) {\n // A readonly field can never be invalid.\n return false;\n }\n\n if (this.invalid) {\n return true;\n }\n\n if (!this.required) {\n return false;\n }\n\n if (!this.blurred) {\n return false;\n }\n\n return !this.value || !this.value.length;\n }\n\n private inputFieldOnChange(event) {\n event.stopPropagation();\n }\n\n /**\n * Enter edit mode when the text field receives focus. When editMode is true, the input element will be visible\n */\n private handleTextFieldFocus() {\n if (this.disabled || this.readonly) {\n return;\n }\n\n if (this.editMode) {\n return;\n }\n\n this.editMode = true;\n this.startEdit.emit();\n }\n\n /**\n * Exit edit mode when the input element loses focus. This makes sure the input element does not take up any\n * additional space when the user it not typing anything\n */\n private handleInputBlur() {\n if (this.emptyInputOnBlur) {\n this.syncEmptyInput();\n }\n\n this.editMode = false;\n this.blurred = true;\n this.inputChipIndexSelected = null;\n\n // This timeout is needed in order to let a new element receive focus\n setTimeout(() => {\n this.stopEdit.emit();\n }, 0);\n }\n\n private syncEmptyInput() {\n this.textValue = '';\n }\n\n private inputHidden() {\n if (this.editMode) {\n return this.isFull();\n }\n\n // If there are chips in the picker, hide the input to avoid the input\n // being placed on a new line and adding ugly space beneath the chips.\n // If there are no chips, show the input, or the picker will look weird.\n return !!(this.value && this.value.length);\n }\n\n private handleTextInput(event) {\n event.stopPropagation();\n this.inputChipIndexSelected = null;\n this.textValue = event.target.value;\n this.input.emit(event.target.value && event.target.value.trim());\n }\n\n private emitInteraction(chip: Chip) {\n this.interact.emit(chip);\n }\n\n private renderChip(chip: Chip) {\n const chipType: ChipType =\n this.type === 'filter' ? 'filter' : 'default';\n\n const chipProps = this.getChipProps(chip, chipType);\n\n return <limel-chip {...chipProps} />;\n }\n\n private hasHelperText = () => {\n return this.helperText !== null && this.helperText !== undefined;\n };\n\n private renderHelperLine = () => {\n if (!this.maxItems && !this.hasHelperText()) {\n return;\n }\n\n return (\n <limel-helper-line\n length={this.value.length}\n maxLength={this.maxItems}\n helperText={this.helperText}\n invalid={this.isInvalid()}\n />\n );\n };\n\n private renderInputChip(chip: Chip, index: number) {\n const chipProps = this.getChipProps(chip, 'default');\n\n return [\n <limel-chip\n key={chip.id}\n class={{\n 'can-be-removed': this.inputChipIndexSelected === index,\n }}\n {...chipProps}\n />,\n this.renderDelimiter(),\n ];\n }\n\n private getChipProps(chip: Chip, chipType: ChipType) {\n const removable =\n this.type === 'input' && chip.removable && !this.readonly;\n const readonly = this.readonly && this.type !== 'input';\n\n return {\n role: 'row',\n identifier: chip.id,\n text: chip.text,\n icon: chip.icon,\n badge: chip.badge,\n selected: chip.selected,\n disabled: this.disabled,\n readonly: readonly,\n type: chipType,\n removable: removable,\n onClick: this.catchInputChipClicks(chip),\n onRemove: this.handleRemoveChip,\n ...(chip.href && {\n link: {\n href: getHref(chip.href),\n target: getTarget(chip.href),\n },\n }),\n };\n }\n\n private catchInputChipClicks = (chip: Chip) => (event: Event) => {\n /*\n * We need to add the `chip` to the event object so that the consumer\n * can get the chip object when the chip is clicked.\n * This is necessary for the consumer to be able to handle the click\n * event itself, based on which chip was clicked, or whether the click\n * was on a chip or elsewhere. The reason the consumer can't just look\n * at the event target is that that information is hidden by the\n * shadow DOM.\n *\n * See documentation for the `interact` event for more information.\n */\n (event as any).Lime = { chip: chip };\n\n if (this.isSelectableChip(chip)) {\n this.updateSelectedChipIds(chip);\n this.change.emit(chip);\n }\n\n this.emitInteraction(chip);\n };\n\n private isSelectableChip(chip: Chip): boolean {\n return this.type !== 'input' && 'selected' in chip;\n }\n\n private updateSelectedChipIds(chip: Chip): void {\n chip.selected = !chip.selected;\n const id = chip.id;\n if (this.type === 'choice') {\n this.updateChoiceTypeSelectedIds(id);\n } else {\n this.updateFilterTypeSelectedIds(id);\n }\n }\n\n private updateChoiceTypeSelectedIds(id: number | string): void {\n this.selectedChipIds = this.isChipSelected(id) ? [] : [id];\n }\n\n private isChipSelected(id: number | string): boolean {\n return !!this.selectedChipIds.find((chipId) => chipId === id);\n }\n\n private updateFilterTypeSelectedIds(id: number | string): void {\n if (this.isChipSelected(id)) {\n this.removeChipIdFromSelectedChipIds(id);\n } else {\n this.addChipIdToSelectedChipIds(id);\n }\n }\n\n private removeChipIdFromSelectedChipIds(id: number | string): void {\n this.selectedChipIds = this.selectedChipIds.filter(\n (chipId) => chipId !== id,\n );\n }\n\n private addChipIdToSelectedChipIds(id: number | string): void {\n this.selectedChipIds = [...this.selectedChipIds, id];\n }\n\n private handleRemoveChip = (\n event: LimelChipCustomEvent<string | number>,\n ) => {\n this.removeChip(event.detail);\n };\n\n private removeChip = (identifier: string | number) => {\n const newValue = this.value.filter((chip) => {\n return chip.id !== identifier;\n });\n this.change.emit(newValue);\n };\n\n private renderLeadingIcon() {\n if (!this.leadingIcon) {\n return;\n }\n\n return (\n <i class=\"mdc-text-field__icon search-icon\">\n <limel-icon name={this.leadingIcon} />\n </i>\n );\n }\n\n private renderClearAllChipsButton() {\n if (this.disabled || this.readonly || !this.clearAllButton) {\n return;\n }\n\n return (\n <a\n href=\"\"\n onClick={this.handleDeleteAllIconClick}\n class=\"mdc-text-field__icon clear-all-button\"\n tabindex=\"0\"\n role=\"button\"\n title={this.clearAllChipsLabel()}\n aria-label={this.clearAllChipsLabel()}\n />\n );\n }\n\n private clearAllChipsLabel = (): string => {\n return translate.get('chip-set.clear-all', this.language);\n };\n\n private handleDeleteAllIconClick(event: Event) {\n event.preventDefault();\n this.change.emit([]);\n }\n\n private renderDelimiter() {\n if (!this.delimiter) {\n return;\n }\n\n return <div class=\"delimiter\">{this.delimiter}</div>;\n }\n\n private triggerIconColorWarning(value: Chip[]) {\n for (const chip of value) {\n if (\n chip.icon &&\n (chip.iconFillColor ||\n chip.iconBackgroundColor ||\n chip.iconTitle)\n ) {\n /* eslint-disable-next-line no-console */\n console.warn(\n \"The `iconFillColor`, `iconBackgroundColor`, and `iconTitle` props are deprecated now! Use the new `Icon` interface and instead of `iconColor: 'color-name', `iconBackgroundColor: 'color-name', and `iconTitle: 'title'`, write `icon { name: 'icon-name', color: 'color-name', backgroundColor: 'color-name', title: 'title' }`.\",\n );\n }\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"chip.types.js","sourceRoot":"","sources":["../../../src/components/chip-set/chip.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Icon } from '../../interface';\n\n/**\n * @public\n */\nexport interface Chip<T = any> {\n /**\n * ID of the chip. Must be unique.\n */\n id: number | string;\n\n /**\n * Text to display inside the chip.\n */\n text: string;\n\n /**\n * Name of the icon to use. Not valid for `filter`.\n */\n icon?: string | Icon;\n\n /**\n * Color of the icon. Overrides `--icon-color`.\n *\n * @deprecated This property is deprecated and will be removed soon!\n *\n * Use the new `Icon` interface instead and write:\n * ```\n * icon {\n * name: string,\n * color: string,\n * },\n * ```\n */\n iconFillColor?: string;\n\n /**\n * `title` attribute of the icon\n *\n * @deprecated This property is deprecated and will be removed soon!\n *\n * Use the new `Icon` interface instead and write:\n * ```\n * icon {\n * name: string,\n * title: string,\n * },\n * ```\n */\n iconTitle?: string;\n\n /**\n * Background color of the icon. Overrides `--icon-background-color`.\n *\n * @deprecated This property is deprecated and will be removed soon!\n *\n * Use the new `Icon` interface instead and write:\n * ```\n * icon {\n * name: string,\n * backgroundColor: string,\n * },\n * ```\n */\n iconBackgroundColor?: string;\n\n /**\n * Whether the chip should be removable. Not valid for `choice`.\n */\n removable?: boolean;\n\n /**\n * Whether the chip is selected. Only valid for `choice` and `filter`.\n */\n selected?: boolean;\n\n /**\n * Value of the chip.\n */\n value?: T;\n\n /**\n * The value of the badge.\n */\n badge?: number;\n\n /**\n * If supplied, the chip will render a link, using the supplied href.\n */\n href?: string;\n}\n\n/**\n * This type is used to determine the visual style and behavior of a Chip component.\n *\n * @beta\n */\nexport type ChipType = 'default' | 'filter';\n"]}
1
+ {"version":3,"file":"chip.types.js","sourceRoot":"","sources":["../../../src/components/chip-set/chip.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Icon } from '../../global/shared-types/icon.types';\n\n/**\n * @public\n */\nexport interface Chip<T = any> {\n /**\n * ID of the chip. Must be unique.\n */\n id: number | string;\n\n /**\n * Text to display inside the chip.\n */\n text: string;\n\n /**\n * Name of the icon to use. Not valid for `filter`.\n */\n icon?: string | Icon;\n\n /**\n * Color of the icon. Overrides `--icon-color`.\n *\n * @deprecated This property is deprecated and will be removed soon!\n *\n * Use the new `Icon` interface instead and write:\n * ```\n * icon {\n * name: string,\n * color: string,\n * },\n * ```\n */\n iconFillColor?: string;\n\n /**\n * `title` attribute of the icon\n *\n * @deprecated This property is deprecated and will be removed soon!\n *\n * Use the new `Icon` interface instead and write:\n * ```\n * icon {\n * name: string,\n * title: string,\n * },\n * ```\n */\n iconTitle?: string;\n\n /**\n * Background color of the icon. Overrides `--icon-background-color`.\n *\n * @deprecated This property is deprecated and will be removed soon!\n *\n * Use the new `Icon` interface instead and write:\n * ```\n * icon {\n * name: string,\n * backgroundColor: string,\n * },\n * ```\n */\n iconBackgroundColor?: string;\n\n /**\n * Whether the chip should be removable. Not valid for `choice`.\n */\n removable?: boolean;\n\n /**\n * Whether the chip is selected. Only valid for `choice` and `filter`.\n */\n selected?: boolean;\n\n /**\n * Value of the chip.\n */\n value?: T;\n\n /**\n * The value of the badge.\n */\n badge?: number;\n\n /**\n * If supplied, the chip will render a link, using the supplied href.\n */\n href?: string;\n}\n\n/**\n * This type is used to determine the visual style and behavior of a Chip component.\n *\n * @beta\n */\nexport type ChipType = 'default' | 'filter';\n"]}
@@ -1,7 +1,7 @@
1
1
  import { h, } from '@stencil/core';
2
2
  import { dispatchResizeEvent } from '../../util/dispatch-resize-event';
3
- import { makeEnterClickable, removeEnterClickable, } from 'src/util/make-enter-clickable';
4
- import { createRandomString } from 'src/util/random-string';
3
+ import { makeEnterClickable, removeEnterClickable, } from '../../util/make-enter-clickable';
4
+ import { createRandomString } from '../../util/random-string';
5
5
  /**
6
6
  * @slot - Content to put inside the collapsible section
7
7
  * @exampleComponent limel-example-collapsible-section
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible-section.js","sourceRoot":"","sources":["../../../src/components/collapsible-section/collapsible-section.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,KAAK,EACL,OAAO,EAEP,CAAC,EACD,IAAI,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EACH,kBAAkB,EAClB,oBAAoB,GACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;;;;;;GAOG;AAMH,MAAM,OAAO,kBAAkB;;IAwCnB,WAAM,GAAG,kBAAkB,EAAE,CAAC;IAkD9B,YAAO,GAAG,GAAG,EAAE;MACnB,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC7B,CAAC,CAAC;IAEM,sBAAiB,GAAG,GAAG,EAAE;MAC7B,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;MAE3B,IAAI,IAAI,CAAC,MAAM,EAAE;QACb,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,iBAAiB,GAAG,GAAG,CAAC;QAC9B,UAAU,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC;OACtD;WAAM;QACH,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;OACrB;IACL,CAAC,CAAC;IAEM,kBAAa,GAAG,GAAG,EAAE;MACzB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;QACf,OAAO;OACV;MAED,OAAO,CACH,WAAK,KAAK,EAAC,SAAS,IACf,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CACxC,CACT,CAAC;IACN,CAAC,CAAC;IAEM,uBAAkB,GAAG,CAAC,MAAc,EAAE,EAAE;MAC5C,OAAO,CACH,yB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;QAC3B,IAAI,CAAC,aAAa,EAAE,CAChB;MACT,WACI,KAAK,EAAC,MAAM,iBACC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EACjC,EAAE,EAAE,IAAI,CAAC,MAAM;QAEf,eAAQ,CACN,CACA,CACb,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CJ","sourcesContent":["import {\n Component,\n Event,\n Element,\n EventEmitter,\n h,\n Prop,\n} from '@stencil/core';\nimport { dispatchResizeEvent } from '../../util/dispatch-resize-event';\nimport { Action } from './action';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from 'src/util/make-enter-clickable';\nimport { createRandomString } from 'src/util/random-string';\n\n/**\n * @slot - Content to put inside the collapsible section\n * @exampleComponent limel-example-collapsible-section\n * @exampleComponent limel-example-collapsible-section-actions\n * @exampleComponent limel-example-collapsible-section-css-props\n * @exampleComponent limel-example-collapsible-section-external-control\n * @exampleComponent limel-example-collapsible-section-with-slider\n */\n@Component({\n tag: 'limel-collapsible-section',\n shadow: true,\n styleUrl: 'collapsible-section.scss',\n})\nexport class CollapsibleSection {\n /**\n * `true` if the section is expanded, `false` if collapsed.\n */\n @Prop({ mutable: true, reflect: true })\n public isOpen: boolean = false;\n\n /**\n * Text to display in the header of the section\n */\n @Prop({ reflect: true })\n public header: string;\n\n /**\n * Actions to place to the far right inside the header\n */\n @Prop()\n public actions: Action[];\n\n /**\n * Emitted when the section is expanded\n */\n @Event()\n private open: EventEmitter<void>;\n\n /**\n * Emitted when the section is collapsed\n */\n @Event()\n private close: EventEmitter<void>;\n\n /**\n * Emitted when an action is clicked inside the header\n */\n @Event()\n private action: EventEmitter<Action>;\n\n @Element()\n private host: HTMLElement;\n\n private bodyId = createRandomString();\n\n public componentDidRender() {\n const button = this.host.shadowRoot.querySelector(\n '.open-close-toggle',\n ) as HTMLElement;\n\n makeEnterClickable(button);\n }\n\n public disconnectedCallback() {\n const button = this.host.shadowRoot.querySelector(\n '.open-close-toggle',\n ) as HTMLElement;\n\n removeEnterClickable(button);\n }\n\n public render() {\n return (\n <section class={`${this.isOpen ? 'open' : ''}`}>\n <header>\n <button\n class=\"open-close-toggle\"\n onClick={this.onClick}\n aria-controls={this.bodyId}\n />\n <div class=\"expand-icon\">\n <div class=\"line\" />\n <div class=\"line\" />\n <div class=\"line\" />\n <div class=\"line\" />\n </div>\n <h2 class=\"title mdc-typography mdc-typography--headline2\">\n {this.header}\n </h2>\n <div class=\"divider-line\" />\n {this.renderActions()}\n </header>\n <div\n class=\"body\"\n aria-hidden={String(!this.isOpen)}\n id={this.bodyId}\n >\n <slot />\n </div>\n </section>\n );\n }\n\n private onClick = () => {\n this.handleInteraction();\n };\n\n private handleInteraction = () => {\n this.isOpen = !this.isOpen;\n\n if (this.isOpen) {\n this.open.emit();\n const waitForUiToRender = 100;\n setTimeout(dispatchResizeEvent, waitForUiToRender);\n } else {\n this.close.emit();\n }\n };\n\n private renderActions = () => {\n if (!this.actions) {\n return;\n }\n\n return (\n <div class=\"actions\">\n {this.actions.map(this.renderActionButton)}\n </div>\n );\n };\n\n private renderActionButton = (action: Action) => {\n return (\n <limel-icon-button\n icon={action.icon}\n label={action.label}\n disabled={action.disabled}\n onClick={this.handleActionClick(action)}\n />\n );\n };\n\n private handleActionClick = (action: Action) => (event: MouseEvent) => {\n event.stopPropagation();\n this.action.emit(action);\n };\n}\n"]}
1
+ {"version":3,"file":"collapsible-section.js","sourceRoot":"","sources":["../../../src/components/collapsible-section/collapsible-section.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,KAAK,EACL,OAAO,EAEP,CAAC,EACD,IAAI,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EACH,kBAAkB,EACl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;;;;;;;;;;;;;;;;;CA6CJ","sourcesContent":["import {\n Component,\n Event,\n Element,\n EventEmitter,\n h,\n Prop,\n} from '@stencil/core';\nimport { dispatchResizeEvent } from '../../util/dispatch-resize-event';\nimport { Action } from './action';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from '../../util/make-enter-clickable';\nimport { createRandomString } from '../../util/random-string';\n\n/**\n * @slot - Content to put inside the collapsible section\n * @exampleComponent limel-example-collapsible-section\n * @exampleComponent limel-example-collapsible-section-actions\n * @exampleComponent limel-example-collapsible-section-css-props\n * @exampleComponent limel-example-collapsible-section-external-control\n * @exampleComponent limel-example-collapsible-section-with-slider\n */\n@Component({\n tag: 'limel-collapsible-section',\n shadow: true,\n styleUrl: 'collapsible-section.scss',\n})\nexport class CollapsibleSection {\n /**\n * `true` if the section is expanded, `false` if collapsed.\n */\n @Prop({ mutable: true, reflect: true })\n public isOpen: boolean = false;\n\n /**\n * Text to display in the header of the section\n */\n @Prop({ reflect: true })\n public header: string;\n\n /**\n * Actions to place to the far right inside the header\n */\n @Prop()\n public actions: Action[];\n\n /**\n * Emitted when the section is expanded\n */\n @Event()\n private open: EventEmitter<void>;\n\n /**\n * Emitted when the section is collapsed\n */\n @Event()\n private close: EventEmitter<void>;\n\n /**\n * Emitted when an action is clicked inside the header\n */\n @Event()\n private action: EventEmitter<Action>;\n\n @Element()\n private host: HTMLElement;\n\n private bodyId = createRandomString();\n\n public componentDidRender() {\n const button = this.host.shadowRoot.querySelector(\n '.open-close-toggle',\n ) as HTMLElement;\n\n makeEnterClickable(button);\n }\n\n public disconnectedCallback() {\n const button = this.host.shadowRoot.querySelector(\n '.open-close-toggle',\n ) as HTMLElement;\n\n removeEnterClickable(button);\n }\n\n public render() {\n return (\n <section class={`${this.isOpen ? 'open' : ''}`}>\n <header>\n <button\n class=\"open-close-toggle\"\n onClick={this.onClick}\n aria-controls={this.bodyId}\n />\n <div class=\"expand-icon\">\n <div class=\"line\" />\n <div class=\"line\" />\n <div class=\"line\" />\n <div class=\"line\" />\n </div>\n <h2 class=\"title mdc-typography mdc-typography--headline2\">\n {this.header}\n </h2>\n <div class=\"divider-line\" />\n {this.renderActions()}\n </header>\n <div\n class=\"body\"\n aria-hidden={String(!this.isOpen)}\n id={this.bodyId}\n >\n <slot />\n </div>\n </section>\n );\n }\n\n private onClick = () => {\n this.handleInteraction();\n };\n\n private handleInteraction = () => {\n this.isOpen = !this.isOpen;\n\n if (this.isOpen) {\n this.open.emit();\n const waitForUiToRender = 100;\n setTimeout(dispatchResizeEvent, waitForUiToRender);\n } else {\n this.close.emit();\n }\n };\n\n private renderActions = () => {\n if (!this.actions) {\n return;\n }\n\n return (\n <div class=\"actions\">\n {this.actions.map(this.renderActionButton)}\n </div>\n );\n };\n\n private renderActionButton = (action: Action) => {\n return (\n <limel-icon-button\n icon={action.icon}\n label={action.label}\n disabled={action.disabled}\n onClick={this.handleActionClick(action)}\n />\n );\n };\n\n private handleActionClick = (action: Action) => (event: MouseEvent) => {\n event.stopPropagation();\n this.action.emit(action);\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.types.js","sourceRoot":"","sources":["../../../src/components/dialog/dialog.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Icon } from '../../interface';\n\n/**\n * @public\n */\nexport interface DialogHeading {\n title: string;\n subtitle?: string;\n supportingText?: string;\n icon: string | Icon;\n}\n\n/**\n * @public\n */\nexport interface ClosingActions {\n escapeKey: boolean;\n scrimClick: boolean;\n}\n"]}
1
+ {"version":3,"file":"dialog.types.js","sourceRoot":"","sources":["../../../src/components/dialog/dialog.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Icon } from '../../global/shared-types/icon.types';\n\n/**\n * @public\n */\nexport interface DialogHeading {\n title: string;\n subtitle?: string;\n supportingText?: string;\n icon: string | Icon;\n}\n\n/**\n * @public\n */\nexport interface ClosingActions {\n escapeKey: boolean;\n scrimClick: boolean;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"file.types.js","sourceRoot":"","sources":["../../../src/components/file/file.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Icon } from '../../interface';\n\n/**\n * @public\n */\nexport interface FileInfo {\n /**\n * ID of the file. Must be unique.\n */\n id: number | string;\n\n /**\n * Name of file.\n */\n filename: string;\n\n /**\n * Extension of file.\n */\n extension?: string;\n\n /**\n * Content type of file.\n */\n contentType?: string;\n\n /**\n * Date of last modification.\n */\n lastModified?: Date;\n\n /**\n * Size of file.\n */\n size?: number;\n\n /**\n * the file content\n */\n fileContent?: File;\n\n /**\n * Name of the icon to use.\n */\n icon?: string | Icon;\n\n /**\n * Icon color. Overrides `--icon-color`.\n *\n * @deprecated This property is deprecated and will be removed soon!\n *\n * Use the new `Icon` interface instead and write:\n * ```ts\n * icon: {\n * name: string,\n * color: string,\n * },\n * ```\n */\n iconColor?: string;\n\n /**\n * Background color of the icon. Overrides `--icon-background-color`.\n *\n * @deprecated This property is deprecated and will be removed soon!\n *\n * Use the new `Icon` interface instead and write:\n * ```ts\n * icon: {\n * name: string,\n * backgroundColor: string,\n * },\n * ```\n */\n iconBackgroundColor?: string;\n\n /**\n * URL where the file can be downloaded. Note that this is optional. If the\n * file cannot be directly accessed via a unique url, this property should\n * be left undefined or set to `null`.\n */\n href?: string;\n}\n"]}
1
+ {"version":3,"file":"file.types.js","sourceRoot":"","sources":["../../../src/components/file/file.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Icon } from '../../global/shared-types/icon.types';\n\n/**\n * @public\n */\nexport interface FileInfo {\n /**\n * ID of the file. Must be unique.\n */\n id: number | string;\n\n /**\n * Name of file.\n */\n filename: string;\n\n /**\n * Extension of file.\n */\n extension?: string;\n\n /**\n * Content type of file.\n */\n contentType?: string;\n\n /**\n * Date of last modification.\n */\n lastModified?: Date;\n\n /**\n * Size of file.\n */\n size?: number;\n\n /**\n * the file content\n */\n fileContent?: File;\n\n /**\n * Name of the icon to use.\n */\n icon?: string | Icon;\n\n /**\n * Icon color. Overrides `--icon-color`.\n *\n * @deprecated This property is deprecated and will be removed soon!\n *\n * Use the new `Icon` interface instead and write:\n * ```ts\n * icon: {\n * name: string,\n * color: string,\n * },\n * ```\n */\n iconColor?: string;\n\n /**\n * Background color of the icon. Overrides `--icon-background-color`.\n *\n * @deprecated This property is deprecated and will be removed soon!\n *\n * Use the new `Icon` interface instead and write:\n * ```ts\n * icon: {\n * name: string,\n * backgroundColor: string,\n * },\n * ```\n */\n iconBackgroundColor?: string;\n\n /**\n * URL where the file can be downloaded. Note that this is optional. If the\n * file cannot be directly accessed via a unique url, this property should\n * be left undefined or set to `null`.\n */\n href?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"file-viewer.js","sourceRoot":"","sources":["../../../src/components/file-viewer/file-viewer.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,CAAC,EACD,IAAI,EACJ,KAAK,EACL,KAAK,EAEL,KAAK,GACR,MAAM,eAAe,CAAC;AAGvB,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAOH,MAAM,OAAO,UAAU;EAmGnB;IAgDQ,cAAS,GAAG,GAAG,EAAE;MACrB,OAAO;QACH,WAAK,KAAK,EAAC,2BAA2B,IACjC,IAAI,CAAC,gBAAgB,EAAE,CACtB;QACN,cAAQ,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAC,MAAM,GAAG;OAC/C,CAAC;IACN,CAAC,CAAC;IAEM,gBAAW,GAAG,GAAG,EAAE;MACvB,OAAO;QACH,IAAI,CAAC,aAAa,EAAE;QACpB,WAAK,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,OAAO,EAAC,MAAM,GAAG;OAC3D,CAAC;IACN,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BAAkB,GACpB,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC;MAClC,IAAI,CAAC,0BAA0B,CAAC;IAEpC,OAAO,kBAAkB,EAAE,CAAC;EAChC,CAAC;EAwOO,cAAc,CAAC,GAAW;IAC9B,OAAO,SAAS,CAAC,GAAG,CAAC,eAAe,GAAG,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;EAC9D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n Element,\n h,\n Prop,\n State,\n Event,\n EventEmitter,\n Watch,\n} from '@stencil/core';\nimport { Languages } from '../date-picker/date.types';\nimport { ListItem } from '../list/list-item.types';\nimport translate from '../../global/translations';\nimport { detectExtension } from './extension-mapping';\nimport { Fullscreen } from './fullscreen';\nimport { FileType, OfficeViewer } from './file-viewer.types';\nimport { LimelMenuCustomEvent } from 'src/components';\n\n/**\n * This is a smart component that automatically detects\n * the most common file types such as image, audio, video, and text,\n * and properly displays them in the browser.\n * The component is also capable to render the most common office files.\n *\n * :::note\n * Image files will always be contained in their containers, which means\n * they automatically increase or decrease in size to fill their containing box\n * whilst preserving their aspect-ratio.\n *\n * Text and PDF files will also always respect the width and height of the\n * container in which the `limel-file-viewer` is loaded.\n * :::\n *\n * For some file types such as text and images, the component will display a\n * download button and a button to open the file in a new browser tab.\n * This will allow users to preview the file in a fullscreen mode with the\n * browser and take advantage of for example native zooming and panning\n * functionalities.\n *\n * @exampleComponent limel-example-file-viewer\n * @exampleComponent limel-example-file-viewer-office\n * @exampleComponent limel-example-file-viewer-filename\n * @exampleComponent limel-example-file-viewer-inbuilt-actions\n * @exampleComponent limel-example-file-viewer-custom-actions\n * @exampleComponent limel-example-file-viewer-with-picker\n * @private\n */\n\n@Component({\n tag: 'limel-file-viewer',\n shadow: true,\n styleUrl: 'file-viewer.scss',\n})\nexport class FileViewer {\n /**\n * Link to the file\n */\n @Prop({ reflect: true })\n public url: string;\n\n /**\n * The name of the file that must also contains its extension.\n * This overrides the filename that the `url` ends with.\n * Useful when the `url` does not contain the filename.\n * When specified, the `filename` will be used as filename of\n * the downloaded file.\n */\n @Prop({ reflect: true })\n public filename?: string;\n\n /**\n * An optional alternative text, mainly for assistive technologies and screen readers.\n * It is used for only image files, as an `alt` attribute.\n * Should optimally hold a description of the image,\n * which is also displayed on the page if the image can't be loaded for some reason.\n */\n @Prop({ reflect: true })\n public alt?: string;\n\n /**\n * Displays a button that allows the user to view the file\n * in fullscreen mode.\n * Not displayed for office files!\n */\n @Prop({ reflect: true })\n public allowFullscreen?: boolean = false;\n\n /**\n * Displays a button that allows the user to open the file\n * in a new browser tab.\n * Not displayed for office files!\n */\n @Prop({ reflect: true })\n public allowOpenInNewTab?: boolean = false;\n\n /**\n * Displays a button that allows the user to download the file.\n * Note that due to the browser's security policies,\n * the file should be hosted on the same domain\n * for the download button to work properly.\n * Not displayed for office files!\n */\n @Prop({ reflect: true })\n public allowDownload?: boolean = false;\n\n /**\n * Defines the localization for translations.\n */\n @Prop()\n public language: Languages = 'en';\n\n /**\n * Defines the third-party viewer that should be used to render\n * the content of office files, such as word processing documents,\n * presentations, or spreadsheets.\n */\n @Prop({ reflect: true })\n public officeViewer: OfficeViewer = 'microsoft-office';\n\n /**\n * An array of custom actions that can be displayed\n * as an action menu on the file which is being displayed.\n */\n @Prop()\n public actions: ListItem[];\n\n /**\n * Emitted when a custom action is selected from the action menu.\n */\n @Event()\n public action: EventEmitter<ListItem>;\n\n @Element()\n public HostElement: HTMLLimelFileViewerElement;\n\n private fullscreen: Fullscreen;\n\n @State()\n private isFullscreen: boolean = false;\n\n @State()\n private fileType: FileType;\n\n /**\n * True while the file is being loaded.\n */\n @State()\n private loading: boolean = true;\n\n @State()\n private fileUrl: string = '';\n\n constructor() {\n this.fullscreen = new Fullscreen(this.HostElement);\n }\n\n public async componentWillLoad() {\n this.fileType = detectExtension(this.filename, this.url);\n await this.createURL(this.fileType);\n }\n\n public render() {\n if (!this.isOfficeFileAccessibleViaURL) {\n return this.renderNoFileSupportMessage();\n }\n\n if (this.loading) {\n return <limel-spinner size=\"x-small\" limeBranded={false} />;\n }\n\n return this.renderFileViewer();\n }\n\n @Watch('url')\n protected async watchUrl(newUrl: string, oldUrl: string) {\n if (newUrl === oldUrl) {\n return;\n }\n\n this.loading = true;\n this.fileType = detectExtension(this.filename, this.fileUrl);\n await this.createURL(this.fileType);\n }\n\n private renderFileViewer() {\n const fileViewerFunctions = {\n pdf: this.renderPdf,\n image: this.renderImage,\n video: this.renderVideo,\n audio: this.renderAudio,\n text: this.renderText,\n office: this.renderOffice,\n };\n const fileViewerFunction =\n fileViewerFunctions[this.fileType] ||\n this.renderNoFileSupportMessage;\n\n return fileViewerFunction();\n }\n\n private renderPdf = () => {\n return [\n <div class=\"action-menu-for-pdf-files\">\n {this.renderActionMenu()}\n </div>,\n <iframe src={this.fileUrl} loading=\"lazy\" />,\n ];\n };\n\n private renderImage = () => {\n return [\n this.renderButtons(),\n <img src={this.fileUrl} alt={this.alt} loading=\"lazy\" />,\n ];\n };\n\n private renderVideo = () => {\n return (\n <video controls>\n <source src={this.fileUrl} />\n </video>\n );\n };\n\n private renderAudio = () => {\n return (\n <audio controls>\n <source src={this.fileUrl} />\n </audio>\n );\n };\n\n private renderText = () => {\n return [\n this.renderButtons(),\n <object data={this.fileUrl} type=\"text/plain\" />,\n ];\n };\n\n private renderOffice = () => {\n return [\n <div class=\"action-menu-for-office-files\">\n {this.renderActionMenu()}\n </div>,\n <iframe\n src={\n this.getOfficeViewerUrl() + this.fileUrl + '&embedded=true'\n }\n loading=\"lazy\"\n />,\n ];\n };\n\n private isOfficeFileAccessibleViaURL = () => {\n return (\n this.fileType === 'office' &&\n !(\n this.fileUrl.startsWith('http://') ||\n this.fileUrl.startsWith('https://')\n )\n );\n };\n\n private getOfficeViewerUrl = () => {\n const officeViewers = {\n 'microsoft-office':\n 'https://view.officeapps.live.com/op/embed.aspx?src=',\n 'google-drive': 'https://docs.google.com/gview?url=',\n };\n\n return officeViewers[this.officeViewer];\n };\n\n private renderNoFileSupportMessage = () => {\n return (\n <div class=\"no-support\">\n <limel-icon\n class=\"icon--warning\"\n name=\"brake_warning\"\n size=\"large\"\n role=\"presentation\"\n />\n <p>{this.getTranslation('message.unsupported-filetype')}</p>\n {this.renderDownloadButton()}\n </div>\n );\n };\n\n private renderButtons = () => {\n return (\n <div class=\"buttons\">\n {this.renderActionMenu()}\n {this.renderToggleFullscreenButton()}\n {this.renderDownloadButton()}\n {this.renderOpenInNewTabButton()}\n </div>\n );\n };\n\n private renderToggleFullscreenButton = () => {\n if (!this.allowFullscreen || !this.fullscreen.isSupported()) {\n return;\n }\n\n const icon = this.isFullscreen ? 'multiply' : 'fit_to_width';\n // eslint-disable-next-line multiline-ternary\n const label = this.isFullscreen\n ? // eslint-disable-next-line multiline-ternary\n this.getTranslation('exit-fullscreen')\n : this.getTranslation('open-in-fullscreen');\n\n return [\n <button\n class=\"button--toggle-fullscreen\"\n id=\"tooltip-toggle-fullscreen\"\n role=\"button\"\n onClick={this.handleToggleFullscreen}\n >\n <limel-icon name={icon} />\n <limel-tooltip\n label={label}\n elementId=\"tooltip-toggle-fullscreen\"\n openDirection=\"left\"\n />\n </button>,\n ];\n };\n\n private renderDownloadButton = () => {\n if (!this.allowDownload || this.isFullscreen) {\n return;\n }\n\n return (\n <a\n class=\"button--download\"\n id=\"tooltip-download\"\n role=\"button\"\n download={this.filename ? this.filename : ''}\n href={this.fileUrl}\n target=\"_blank\"\n >\n <limel-icon name=\"download_2\" />\n <limel-tooltip\n label={this.getTranslation('download')}\n elementId=\"tooltip-download\"\n openDirection=\"left\"\n />\n </a>\n );\n };\n\n private renderOpenInNewTabButton = () => {\n if (!this.allowOpenInNewTab || this.isFullscreen) {\n return;\n }\n\n return (\n <a\n class=\"button--new-tab\"\n id=\"tooltip-new-tab\"\n role=\"button\"\n href={this.fileUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <limel-icon name=\"external_link\" />\n <limel-tooltip\n label={this.getTranslation('open-in-new-tab')}\n elementId=\"tooltip-new-tab\"\n openDirection=\"left\"\n />\n </a>\n );\n };\n\n private renderActionMenu = () => {\n if (!this.actions || this.isFullscreen) {\n return;\n }\n\n return (\n <limel-menu\n class=\"action-menu\"\n items={this.actions}\n onSelect={this.emitOnAction}\n open-direction=\"left\"\n >\n <button\n class=\"button--action\"\n id=\"tooltip-more\"\n role=\"button\"\n slot=\"trigger\"\n >\n <limel-icon name=\"menu_2\" />\n <limel-tooltip\n label={this.getTranslation('more-actions')}\n elementId=\"tooltip-more\"\n openDirection=\"left\"\n />\n </button>\n </limel-menu>\n );\n };\n\n private createURL = async (fileType: string) => {\n if (['pdf'].includes(fileType)) {\n const response = await fetch(this.url);\n const blob = await response.blob();\n\n this.fileUrl = URL.createObjectURL(blob);\n } else {\n this.fileUrl = this.url;\n }\n\n this.loading = false;\n };\n\n private handleToggleFullscreen = () => {\n if (this.fullscreen.isSupported()) {\n this.fullscreen.toggle();\n this.isFullscreen = !this.isFullscreen;\n }\n };\n\n private emitOnAction = (event: LimelMenuCustomEvent<ListItem>) => {\n event.stopPropagation();\n this.action.emit(event.detail);\n };\n\n private getTranslation(key: string) {\n return translate.get(`file-viewer.${key}`, this.language);\n }\n}\n"]}
1
+ {"version":3,"file":"file-viewer.js","sourceRoot":"","sources":["../../../src/components/file-viewer/file-viewer.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,CAAC,EACD,IAAI,EACJ,KAAK,EACL,KAAK,EAEL,KAAK,GACR,MAAM,eAAe,CAAC;AAGvB,OAAO,SAAS,MAAM,2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;EAGS,KAAK,CAAC,QAAQ,CAAC,MAAc,EAAE,MAAc;IACnD,IAAI,MAAM,KAAK,MAAM,EAAE;MACnB,OAAO;KACV;IAED,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7D,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;EACxC,CAAC;EAEO,gBAAgB;IACpB,MAAM,mBAAmB,GAAG;MACxB,GAAG,EAAE,IAAI,CAAC,SAAS;MACnB,KAAK,EAAE,IAAI,CAAC,WAAW;MACvB,KAAK,EAAE,IAAI,CAAC,WAAW;MACvB,KAAK,EAAE,IAAI,CAAC,WAAW;MACvB,IAAI,EAAE,IAAI,CAAC,UAAU;MACrB,MAAM,EAAE,IAAI,CAAC,YAAY;KAC5B,CAAC;IACF,MAAM,kBAAkB,GACpB,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC;MAClC,IAAI,CAAC,0BAA0B,CAAC;IAEpC,OAAO,kBAAkB,EAAE,CAAC;EAChC,CAAC;EAwOO,cAAc,CAAC,GAAW;IAC9B,OAAO,SAAS,CAAC,GAAG,CAAC,eAAe,GAAG,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;EAC9D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n Element,\n h,\n Prop,\n State,\n Event,\n EventEmitter,\n Watch,\n} from '@stencil/core';\nimport { Languages } from '../date-picker/date.types';\nimport { ListItem } from '../list/list-item.types';\nimport translate from '../../global/translations';\nimport { detectExtension } from './extension-mapping';\nimport { Fullscreen } from './fullscreen';\nimport { FileType, OfficeViewer } from './file-viewer.types';\nimport { LimelMenuCustomEvent } from '../../components';\n\n/**\n * This is a smart component that automatically detects\n * the most common file types such as image, audio, video, and text,\n * and properly displays them in the browser.\n * The component is also capable to render the most common office files.\n *\n * :::note\n * Image files will always be contained in their containers, which means\n * they automatically increase or decrease in size to fill their containing box\n * whilst preserving their aspect-ratio.\n *\n * Text and PDF files will also always respect the width and height of the\n * container in which the `limel-file-viewer` is loaded.\n * :::\n *\n * For some file types such as text and images, the component will display a\n * download button and a button to open the file in a new browser tab.\n * This will allow users to preview the file in a fullscreen mode with the\n * browser and take advantage of for example native zooming and panning\n * functionalities.\n *\n * @exampleComponent limel-example-file-viewer\n * @exampleComponent limel-example-file-viewer-office\n * @exampleComponent limel-example-file-viewer-filename\n * @exampleComponent limel-example-file-viewer-inbuilt-actions\n * @exampleComponent limel-example-file-viewer-custom-actions\n * @exampleComponent limel-example-file-viewer-with-picker\n * @private\n */\n\n@Component({\n tag: 'limel-file-viewer',\n shadow: true,\n styleUrl: 'file-viewer.scss',\n})\nexport class FileViewer {\n /**\n * Link to the file\n */\n @Prop({ reflect: true })\n public url: string;\n\n /**\n * The name of the file that must also contains its extension.\n * This overrides the filename that the `url` ends with.\n * Useful when the `url` does not contain the filename.\n * When specified, the `filename` will be used as filename of\n * the downloaded file.\n */\n @Prop({ reflect: true })\n public filename?: string;\n\n /**\n * An optional alternative text, mainly for assistive technologies and screen readers.\n * It is used for only image files, as an `alt` attribute.\n * Should optimally hold a description of the image,\n * which is also displayed on the page if the image can't be loaded for some reason.\n */\n @Prop({ reflect: true })\n public alt?: string;\n\n /**\n * Displays a button that allows the user to view the file\n * in fullscreen mode.\n * Not displayed for office files!\n */\n @Prop({ reflect: true })\n public allowFullscreen?: boolean = false;\n\n /**\n * Displays a button that allows the user to open the file\n * in a new browser tab.\n * Not displayed for office files!\n */\n @Prop({ reflect: true })\n public allowOpenInNewTab?: boolean = false;\n\n /**\n * Displays a button that allows the user to download the file.\n * Note that due to the browser's security policies,\n * the file should be hosted on the same domain\n * for the download button to work properly.\n * Not displayed for office files!\n */\n @Prop({ reflect: true })\n public allowDownload?: boolean = false;\n\n /**\n * Defines the localization for translations.\n */\n @Prop()\n public language: Languages = 'en';\n\n /**\n * Defines the third-party viewer that should be used to render\n * the content of office files, such as word processing documents,\n * presentations, or spreadsheets.\n */\n @Prop({ reflect: true })\n public officeViewer: OfficeViewer = 'microsoft-office';\n\n /**\n * An array of custom actions that can be displayed\n * as an action menu on the file which is being displayed.\n */\n @Prop()\n public actions: ListItem[];\n\n /**\n * Emitted when a custom action is selected from the action menu.\n */\n @Event()\n public action: EventEmitter<ListItem>;\n\n @Element()\n public HostElement: HTMLLimelFileViewerElement;\n\n private fullscreen: Fullscreen;\n\n @State()\n private isFullscreen: boolean = false;\n\n @State()\n private fileType: FileType;\n\n /**\n * True while the file is being loaded.\n */\n @State()\n private loading: boolean = true;\n\n @State()\n private fileUrl: string = '';\n\n constructor() {\n this.fullscreen = new Fullscreen(this.HostElement);\n }\n\n public async componentWillLoad() {\n this.fileType = detectExtension(this.filename, this.url);\n await this.createURL(this.fileType);\n }\n\n public render() {\n if (!this.isOfficeFileAccessibleViaURL) {\n return this.renderNoFileSupportMessage();\n }\n\n if (this.loading) {\n return <limel-spinner size=\"x-small\" limeBranded={false} />;\n }\n\n return this.renderFileViewer();\n }\n\n @Watch('url')\n protected async watchUrl(newUrl: string, oldUrl: string) {\n if (newUrl === oldUrl) {\n return;\n }\n\n this.loading = true;\n this.fileType = detectExtension(this.filename, this.fileUrl);\n await this.createURL(this.fileType);\n }\n\n private renderFileViewer() {\n const fileViewerFunctions = {\n pdf: this.renderPdf,\n image: this.renderImage,\n video: this.renderVideo,\n audio: this.renderAudio,\n text: this.renderText,\n office: this.renderOffice,\n };\n const fileViewerFunction =\n fileViewerFunctions[this.fileType] ||\n this.renderNoFileSupportMessage;\n\n return fileViewerFunction();\n }\n\n private renderPdf = () => {\n return [\n <div class=\"action-menu-for-pdf-files\">\n {this.renderActionMenu()}\n </div>,\n <iframe src={this.fileUrl} loading=\"lazy\" />,\n ];\n };\n\n private renderImage = () => {\n return [\n this.renderButtons(),\n <img src={this.fileUrl} alt={this.alt} loading=\"lazy\" />,\n ];\n };\n\n private renderVideo = () => {\n return (\n <video controls>\n <source src={this.fileUrl} />\n </video>\n );\n };\n\n private renderAudio = () => {\n return (\n <audio controls>\n <source src={this.fileUrl} />\n </audio>\n );\n };\n\n private renderText = () => {\n return [\n this.renderButtons(),\n <object data={this.fileUrl} type=\"text/plain\" />,\n ];\n };\n\n private renderOffice = () => {\n return [\n <div class=\"action-menu-for-office-files\">\n {this.renderActionMenu()}\n </div>,\n <iframe\n src={\n this.getOfficeViewerUrl() + this.fileUrl + '&embedded=true'\n }\n loading=\"lazy\"\n />,\n ];\n };\n\n private isOfficeFileAccessibleViaURL = () => {\n return (\n this.fileType === 'office' &&\n !(\n this.fileUrl.startsWith('http://') ||\n this.fileUrl.startsWith('https://')\n )\n );\n };\n\n private getOfficeViewerUrl = () => {\n const officeViewers = {\n 'microsoft-office':\n 'https://view.officeapps.live.com/op/embed.aspx?src=',\n 'google-drive': 'https://docs.google.com/gview?url=',\n };\n\n return officeViewers[this.officeViewer];\n };\n\n private renderNoFileSupportMessage = () => {\n return (\n <div class=\"no-support\">\n <limel-icon\n class=\"icon--warning\"\n name=\"brake_warning\"\n size=\"large\"\n role=\"presentation\"\n />\n <p>{this.getTranslation('message.unsupported-filetype')}</p>\n {this.renderDownloadButton()}\n </div>\n );\n };\n\n private renderButtons = () => {\n return (\n <div class=\"buttons\">\n {this.renderActionMenu()}\n {this.renderToggleFullscreenButton()}\n {this.renderDownloadButton()}\n {this.renderOpenInNewTabButton()}\n </div>\n );\n };\n\n private renderToggleFullscreenButton = () => {\n if (!this.allowFullscreen || !this.fullscreen.isSupported()) {\n return;\n }\n\n const icon = this.isFullscreen ? 'multiply' : 'fit_to_width';\n // eslint-disable-next-line multiline-ternary\n const label = this.isFullscreen\n ? // eslint-disable-next-line multiline-ternary\n this.getTranslation('exit-fullscreen')\n : this.getTranslation('open-in-fullscreen');\n\n return [\n <button\n class=\"button--toggle-fullscreen\"\n id=\"tooltip-toggle-fullscreen\"\n role=\"button\"\n onClick={this.handleToggleFullscreen}\n >\n <limel-icon name={icon} />\n <limel-tooltip\n label={label}\n elementId=\"tooltip-toggle-fullscreen\"\n openDirection=\"left\"\n />\n </button>,\n ];\n };\n\n private renderDownloadButton = () => {\n if (!this.allowDownload || this.isFullscreen) {\n return;\n }\n\n return (\n <a\n class=\"button--download\"\n id=\"tooltip-download\"\n role=\"button\"\n download={this.filename ? this.filename : ''}\n href={this.fileUrl}\n target=\"_blank\"\n >\n <limel-icon name=\"download_2\" />\n <limel-tooltip\n label={this.getTranslation('download')}\n elementId=\"tooltip-download\"\n openDirection=\"left\"\n />\n </a>\n );\n };\n\n private renderOpenInNewTabButton = () => {\n if (!this.allowOpenInNewTab || this.isFullscreen) {\n return;\n }\n\n return (\n <a\n class=\"button--new-tab\"\n id=\"tooltip-new-tab\"\n role=\"button\"\n href={this.fileUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <limel-icon name=\"external_link\" />\n <limel-tooltip\n label={this.getTranslation('open-in-new-tab')}\n elementId=\"tooltip-new-tab\"\n openDirection=\"left\"\n />\n </a>\n );\n };\n\n private renderActionMenu = () => {\n if (!this.actions || this.isFullscreen) {\n return;\n }\n\n return (\n <limel-menu\n class=\"action-menu\"\n items={this.actions}\n onSelect={this.emitOnAction}\n open-direction=\"left\"\n >\n <button\n class=\"button--action\"\n id=\"tooltip-more\"\n role=\"button\"\n slot=\"trigger\"\n >\n <limel-icon name=\"menu_2\" />\n <limel-tooltip\n label={this.getTranslation('more-actions')}\n elementId=\"tooltip-more\"\n openDirection=\"left\"\n />\n </button>\n </limel-menu>\n );\n };\n\n private createURL = async (fileType: string) => {\n if (['pdf'].includes(fileType)) {\n const response = await fetch(this.url);\n const blob = await response.blob();\n\n this.fileUrl = URL.createObjectURL(blob);\n } else {\n this.fileUrl = this.url;\n }\n\n this.loading = false;\n };\n\n private handleToggleFullscreen = () => {\n if (this.fullscreen.isSupported()) {\n this.fullscreen.toggle();\n this.isFullscreen = !this.isFullscreen;\n }\n };\n\n private emitOnAction = (event: LimelMenuCustomEvent<ListItem>) => {\n event.stopPropagation();\n this.action.emit(event.detail);\n };\n\n private getTranslation(key: string) {\n return translate.get(`file-viewer.${key}`, this.language);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"form.types.js","sourceRoot":"","sources":["../../../src/components/form/form.types.ts"],"names":[],"mappings":"AAiSA;;;GAGG;AACH,MAAM,CAAN,IAAY,cAmBX;AAnBD,WAAY,cAAc;EACtB;;KAEG;EACH,qCAAmB,CAAA;EAEnB;;KAEG;EACH,+BAAa,CAAA;EAEb;;;;;;KAMG;EACH,6BAAW,CAAA;AACf,CAAC,EAnBW,cAAc,KAAd,cAAc,QAmBzB","sourcesContent":["import { JSONSchema7 } from 'json-schema';\nimport { Help } from '../help/help.types';\nimport { EventEmitter } from '@stencil/core';\n\ndeclare module 'json-schema' {\n interface JSONSchema7 {\n /**\n * @internal\n * Unique identifier for the schema\n */\n id?: string;\n\n /**\n * Lime elements specific options that can be specified in a schema\n */\n lime?: Omit<LimeSchemaOptions, 'layout'> & {\n layout?: Partial<LimeLayoutOptions>;\n };\n }\n}\n\n/**\n * @public\n */\nexport interface ValidationStatus {\n /**\n * True if the form is valid, false otherwise\n *\n * If the form is invalid, any errors can be found on the `errors` property\n */\n valid: boolean;\n\n /**\n * List of validation errors\n */\n errors?: FormError[];\n}\n\n/**\n * @public\n */\nexport interface FormError {\n /**\n * Name of the error\n */\n name: string;\n\n /**\n * Params of the error\n */\n params?: unknown;\n\n /**\n * Name of the invalid property\n */\n property: string;\n\n /**\n * Path to the property within the schema\n */\n schemaPath: string;\n\n /**\n * String describing the error\n */\n message: string;\n}\n\n/**\n * @public\n */\nexport type ValidationError = {\n /**\n * Name of the field the error belongs to\n */\n [key: string]: string[] | ValidationError;\n};\n\n/**\n * @public\n */\nexport interface FormComponent<T = any> {\n /**\n * The value of the current property\n */\n value: T;\n\n /**\n * Whether or not the current property is required\n */\n required?: boolean;\n\n /**\n * Whether or not the current property is readonly\n */\n readonly?: boolean;\n\n /**\n * Whether or not the current property is disabled\n */\n disabled?: boolean;\n\n /**\n * The label of the current property\n */\n label?: string;\n\n /**\n * The helper text for the current property\n */\n helperText?: string;\n\n /**\n * Additional contextual information about the form\n */\n formInfo?: FormInfo;\n\n /**\n * The event to emit when the value of the current property has changed\n */\n change: EventEmitter<T>;\n}\n\n/**\n * @public\n */\nexport interface FormInfo {\n /**\n * The schema of the current property\n */\n schema?: FormSchema;\n\n /**\n * The schema of the whole form\n */\n rootSchema?: FormSchema;\n\n /**\n * A tree of errors for this property and its children\n */\n errorSchema?: object;\n\n /**\n * The value of the whole form\n */\n rootValue?: any;\n\n /**\n * The name of the current property\n */\n name?: string;\n\n /**\n * Path to the property within the schema\n */\n schemaPath?: string[];\n}\n\n/**\n * Lime elements specific options that can be specified under the `lime` key in\n * a schema, e.g.\n *\n * ```ts\n * const schema = {\n * type: 'object',\n * lime: {\n * collapsible: true,\n * },\n * };\n * ```\n *\n * @public\n */\nexport interface LimeSchemaOptions {\n /**\n * When specified on an object it will render all sub components inside a\n * collapsible section\n */\n collapsible?: boolean;\n\n /**\n * When `collapsible` is `true`, set this to `false` to make the\n * collapsible section load in the open state.\n * Defaults to `true`.\n */\n collapsed?: boolean;\n\n /**\n * Will render the field using the specified component. The component\n * should implement the `FormComponent` interface\n */\n component?: FormComponentOptions;\n\n /**\n * When specified on an object it will render the sub components with the\n * specified layout\n */\n layout?: LimeLayoutOptions;\n\n /**\n * Mark the field as disabled\n */\n disabled?: boolean;\n\n help?: string | Partial<Help>;\n}\n\n/**\n * @public\n * Options for a layout to be used in a form\n */\nexport type LimeLayoutOptions = GridLayoutOptions & RowLayoutOptions;\n\n/**\n * Options for a component to be rendered inside a form\n *\n * @public\n */\nexport interface FormComponentOptions {\n /**\n * Name of the component\n */\n name?: string;\n\n /**\n * Extra properties to give the component in addition to the properties\n * specified on the `FormComponent` interface\n */\n props?: Record<string, any>;\n}\n\n/**\n * @public\n */\nexport interface FormLayoutOptions<\n T extends FormLayoutType | `${FormLayoutType}` = FormLayoutType.Default,\n> {\n /**\n * The type of layout to use\n */\n type: T;\n}\n\n/**\n * @public\n * Layout options for a grid layout\n */\nexport interface GridLayoutOptions\n extends FormLayoutOptions<FormLayoutType | `${FormLayoutType}`> {\n /**\n * When specified on a component within the grid, the component will take\n * up the the specified number of columns in the form\n */\n // eslint-disable-next-line no-magic-numbers\n colSpan?: 1 | 2 | 3 | 4 | 5 | 'all';\n\n /**\n * When specified on a component within the grid, the component will take\n * up the the specified number of rows in the form\n */\n rowSpan?: number;\n\n /**\n * Number of columns to use in the layout\n */\n // eslint-disable-next-line no-magic-numbers\n columns?: 1 | 2 | 3 | 4 | 5;\n\n /**\n * Attempts to fill in holes earlier in the grid, if smaller items come up\n * later. This may cause items to appear out-of-order, when doing so would\n * fill holes left by larger items. Defaults to `true`.\n */\n dense?: boolean;\n}\n\n/**\n * @public\n * Layout options for a row layout\n */\nexport interface RowLayoutOptions\n extends FormLayoutOptions<FormLayoutType | `${FormLayoutType}`> {\n /**\n * When specified on a field, the chosen icon will be displayed\n * on the left side of the row, beside the title.\n */\n icon?: string;\n}\n\n/**\n * @public\n * Represents the layout types for a form.\n */\nexport enum FormLayoutType {\n /**\n * The default layout\n */\n Default = 'default',\n\n /**\n * Render the form fields using a responsive grid layout\n */\n Grid = 'grid',\n\n /**\n * Render the form fields in full-width rows.\n * Each row can have a leading `icon`, and a field.\n * `title` and `description` provided by the schema will be placed\n * on the row itself, and not on the field.\n * This layout is good for creating UIs for user settings pages.\n */\n Row = 'row',\n}\n\n/**\n * @public\n * Represents the JSON schema with Lime specific options\n */\nexport interface FormSchema extends JSONSchema7 {}\n"]}
1
+ {"version":3,"file":"form.types.js","sourceRoot":"","sources":["../../../src/components/form/form.types.ts"],"names":[],"mappings":"AAwSA;;;GAGG;AACH,MAAM,CAAN,IAAY,cAmBX;AAnBD,WAAY,cAAc;EACtB;;KAEG;EACH,qCAAmB,CAAA;EAEnB;;KAEG;EACH,+BAAa,CAAA;EAEb;;;;;;KAMG;EACH,6BAAW,CAAA;AACf,CAAC,EAnBW,cAAc,KAAd,cAAc,QAmBzB","sourcesContent":["import { JSONSchema7 } from 'json-schema';\nimport { Help } from '../help/help.types';\nimport { EventEmitter } from '@stencil/core';\n\n/**\n * EventEmitter from `@stencil/core`.\n *\n * @public\n */\nexport { EventEmitter } from '@stencil/core';\n\ndeclare module 'json-schema' {\n interface JSONSchema7 {\n /**\n * @internal\n * Unique identifier for the schema\n */\n id?: string;\n\n /**\n * Lime elements specific options that can be specified in a schema\n */\n lime?: Omit<LimeSchemaOptions, 'layout'> & {\n layout?: Partial<LimeLayoutOptions>;\n };\n }\n}\n\n/**\n * @public\n */\nexport interface ValidationStatus {\n /**\n * True if the form is valid, false otherwise\n *\n * If the form is invalid, any errors can be found on the `errors` property\n */\n valid: boolean;\n\n /**\n * List of validation errors\n */\n errors?: FormError[];\n}\n\n/**\n * @public\n */\nexport interface FormError {\n /**\n * Name of the error\n */\n name: string;\n\n /**\n * Params of the error\n */\n params?: unknown;\n\n /**\n * Name of the invalid property\n */\n property: string;\n\n /**\n * Path to the property within the schema\n */\n schemaPath: string;\n\n /**\n * String describing the error\n */\n message: string;\n}\n\n/**\n * @public\n */\nexport type ValidationError = {\n /**\n * Name of the field the error belongs to\n */\n [key: string]: string[] | ValidationError;\n};\n\n/**\n * @public\n */\nexport interface FormComponent<T = any> {\n /**\n * The value of the current property\n */\n value: T;\n\n /**\n * Whether or not the current property is required\n */\n required?: boolean;\n\n /**\n * Whether or not the current property is readonly\n */\n readonly?: boolean;\n\n /**\n * Whether or not the current property is disabled\n */\n disabled?: boolean;\n\n /**\n * The label of the current property\n */\n label?: string;\n\n /**\n * The helper text for the current property\n */\n helperText?: string;\n\n /**\n * Additional contextual information about the form\n */\n formInfo?: FormInfo;\n\n /**\n * The event to emit when the value of the current property has changed\n */\n change: EventEmitter<T>;\n}\n\n/**\n * @public\n */\nexport interface FormInfo {\n /**\n * The schema of the current property\n */\n schema?: FormSchema;\n\n /**\n * The schema of the whole form\n */\n rootSchema?: FormSchema;\n\n /**\n * A tree of errors for this property and its children\n */\n errorSchema?: object;\n\n /**\n * The value of the whole form\n */\n rootValue?: any;\n\n /**\n * The name of the current property\n */\n name?: string;\n\n /**\n * Path to the property within the schema\n */\n schemaPath?: string[];\n}\n\n/**\n * Lime elements specific options that can be specified under the `lime` key in\n * a schema, e.g.\n *\n * ```ts\n * const schema = {\n * type: 'object',\n * lime: {\n * collapsible: true,\n * },\n * };\n * ```\n *\n * @public\n */\nexport interface LimeSchemaOptions {\n /**\n * When specified on an object it will render all sub components inside a\n * collapsible section\n */\n collapsible?: boolean;\n\n /**\n * When `collapsible` is `true`, set this to `false` to make the\n * collapsible section load in the open state.\n * Defaults to `true`.\n */\n collapsed?: boolean;\n\n /**\n * Will render the field using the specified component. The component\n * should implement the `FormComponent` interface\n */\n component?: FormComponentOptions;\n\n /**\n * When specified on an object it will render the sub components with the\n * specified layout\n */\n layout?: LimeLayoutOptions;\n\n /**\n * Mark the field as disabled\n */\n disabled?: boolean;\n\n help?: string | Partial<Help>;\n}\n\n/**\n * @public\n * Options for a layout to be used in a form\n */\nexport type LimeLayoutOptions = GridLayoutOptions & RowLayoutOptions;\n\n/**\n * Options for a component to be rendered inside a form\n *\n * @public\n */\nexport interface FormComponentOptions {\n /**\n * Name of the component\n */\n name?: string;\n\n /**\n * Extra properties to give the component in addition to the properties\n * specified on the `FormComponent` interface\n */\n props?: Record<string, any>;\n}\n\n/**\n * @public\n */\nexport interface FormLayoutOptions<\n T extends FormLayoutType | `${FormLayoutType}` = FormLayoutType.Default,\n> {\n /**\n * The type of layout to use\n */\n type: T;\n}\n\n/**\n * @public\n * Layout options for a grid layout\n */\nexport interface GridLayoutOptions\n extends FormLayoutOptions<FormLayoutType | `${FormLayoutType}`> {\n /**\n * When specified on a component within the grid, the component will take\n * up the the specified number of columns in the form\n */\n // eslint-disable-next-line no-magic-numbers\n colSpan?: 1 | 2 | 3 | 4 | 5 | 'all';\n\n /**\n * When specified on a component within the grid, the component will take\n * up the the specified number of rows in the form\n */\n rowSpan?: number;\n\n /**\n * Number of columns to use in the layout\n */\n // eslint-disable-next-line no-magic-numbers\n columns?: 1 | 2 | 3 | 4 | 5;\n\n /**\n * Attempts to fill in holes earlier in the grid, if smaller items come up\n * later. This may cause items to appear out-of-order, when doing so would\n * fill holes left by larger items. Defaults to `true`.\n */\n dense?: boolean;\n}\n\n/**\n * @public\n * Layout options for a row layout\n */\nexport interface RowLayoutOptions\n extends FormLayoutOptions<FormLayoutType | `${FormLayoutType}`> {\n /**\n * When specified on a field, the chosen icon will be displayed\n * on the left side of the row, beside the title.\n */\n icon?: string;\n}\n\n/**\n * @public\n * Represents the layout types for a form.\n */\nexport enum FormLayoutType {\n /**\n * The default layout\n */\n Default = 'default',\n\n /**\n * Render the form fields using a responsive grid layout\n */\n Grid = 'grid',\n\n /**\n * Render the form fields in full-width rows.\n * Each row can have a leading `icon`, and a field.\n * `title` and `description` provided by the schema will be placed\n * on the row itself, and not on the field.\n * This layout is good for creating UIs for user settings pages.\n */\n Row = 'row',\n}\n\n/**\n * @public\n * Represents the JSON schema with Lime specific options\n */\nexport interface FormSchema extends JSONSchema7 {}\n"]}
@@ -108,7 +108,7 @@ export class Header {
108
108
  "references": {
109
109
  "Icon": {
110
110
  "location": "import",
111
- "path": "../../interface"
111
+ "path": "../../global/shared-types/icon.types"
112
112
  }
113
113
  }
114
114
  },
@@ -1 +1 @@
1
- {"version":3,"file":"header.js","sourceRoot":"","sources":["../../../src/components/header/header.tsx"],"names":[],"mappings":"AAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\nimport { Icon } from '../../interface';\nimport { getIconName } from '../icon/get-icon-props';\n\n/**\n * A header is the top most visual element in a component, page, card, or a view.\n *\n * ## Usage\n * A header is the first thing that clarifies a context for users.\n * Due to their positions in the UI hierarchy, headers are the most\n * prominent elements of a user interface; and because of that, they carry both\n * vital information and fundamental controls for the area of the interface\n * they represent.\n *\n * For example, when a header is placed on top of a card, it should quickly\n * explain the card to the user. When placed on top of a modal, it should easily\n * clarify what the modal is about. When displayed on top of a fullscreen view,\n * it should indicate where in the system users are, and what part of the app\n * they are looking at.\n *\n *\n * ## Layout\n * The vital information in a header is usually manifested in form of an icon,\n * and a heading. A subheading also could be added to provide supplementary\n * information. There is also a third place for displaying supplementary information\n * or \"supporting text\", which will be rendered as a part of the subheading.\n * Along with this information, headers can also include actions, controls, or\n * menus.\n *\n * :::important\n * Such actions or menus must affect the entire section of the interface\n * which the header is representing. For example, a _Delete_ button on a card\n * header must delete that entire card and its respective contents all together,\n * not for example a selected item which is visible in the content of that card.\n * :::\n *\n *\n * :::warning\n * Do not user background color on icons in the headers. It is much better and\n * much easier for the eye if your icon itself has a color.\n * Background colors behind icons make them look like \"call to action\" buttons\n * and take a lot of attention from users.\n * :::\n *\n * @exampleComponent limel-example-header\n * @exampleComponent limel-example-header-slot-actions\n * @exampleComponent limel-example-header-colors\n * @exampleComponent limel-example-header-responsive\n * @exampleComponent limel-example-header-narrow\n * @slot actions - Content (actions) to be put inside the far right surface of\n * the header\n * @slot [no name] - DEPRECATED. The `actions` slot used to be unnamed. This\n * behavior has been deprecated, and support will be dropped in a future\n * version. Please add `slot=\"actions\"` to your elements to ensure your code\n * will continue to work with future versions of Lime Elements.\n */\n@Component({\n tag: 'limel-header',\n shadow: true,\n styleUrl: 'header.scss',\n})\nexport class Header {\n /**\n * Icon to display\n */\n @Prop()\n public icon?: string | Icon;\n\n /**\n * Title to display\n */\n @Prop()\n public heading?: string;\n\n /**\n * Subheading to display\n */\n @Prop()\n public subheading?: string;\n\n /**\n * An extra string of text to display along with with the Subheading\n */\n @Prop()\n public supportingText?: string;\n\n /**\n * The visual divider that separates the `subheading` and the `supportingText`.\n * It must be a single character such as `-` or `,`.\n */\n @Prop()\n public subheadingDivider?: string = '·';\n\n public render() {\n return [\n <div class=\"information\">\n {this.renderIcon()}\n <div class=\"headings\">\n <h1 class=\"heading\" title={this.heading}>\n {this.heading}\n </h1>\n <h2 class=\"subheading\" title={this.subheading}>\n {this.subheading}\n {this.renderSupportingText()}\n </h2>\n </div>\n </div>,\n <slot name=\"actions\">\n <slot />\n </slot>,\n ];\n }\n\n private renderIcon() {\n const icon = getIconName(this.icon);\n\n if (!icon) {\n return;\n }\n\n return <limel-icon class=\"icon\" badge={true} name={icon} />;\n }\n\n private renderSupportingText() {\n if (!this.supportingText) {\n return;\n }\n\n return (\n <span class=\"subheading__supporting-text\">\n {this.renderSubheadingDivider()}\n {this.supportingText}\n </span>\n );\n }\n\n private renderSubheadingDivider() {\n if (!this.subheadingDivider) {\n return;\n }\n\n return <span>{this.subheadingDivider}</span>;\n }\n}\n"]}
1
+ {"version":3,"file":"header.js","sourceRoot":"","sources":["../../../src/components/header/header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAMH,MAAM,OAAO,MAAM;;;;;;6BA8BqB,GAAG;;EAEhC,MAAM;IACT,OAAO;MACH,WAAK,KAAK,EAAC,aAAa;QACnB,IAAI,CAAC,UAAU,EAAE;QAClB,WAAK,KAAK,EAAC,UAAU;UACjB,UAAI,KAAK,EAAC,SAAS,EAAC,KAAK,EAAE,IAAI,CAAC,OAAO,IAClC,IAAI,CAAC,OAAO,CACZ;UACL,UAAI,KAAK,EAAC,YAAY,EAAC,KAAK,EAAE,IAAI,CAAC,UAAU;YACxC,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,oBAAoB,EAAE,CAC3B,CACH,CACJ;MACN,YAAM,IAAI,EAAC,SAAS;QAChB,eAAQ,CACL;KACV,CAAC;EACN,CAAC;EAEO,UAAU;IACd,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEpC,IAAI,CAAC,IAAI,EAAE;MACP,OAAO;KACV;IAED,OAAO,kBAAY,KAAK,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAI,CAAC;EAChE,CAAC;EAEO,oBAAoB;IACxB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;MACtB,OAAO;KACV;IAED,OAAO,CACH,YAAM,KAAK,EAAC,6BAA6B;MACpC,IAAI,CAAC,uBAAuB,EAAE;MAC9B,IAAI,CAAC,cAAc,CACjB,CACV,CAAC;EACN,CAAC;EAEO,uBAAuB;IAC3B,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;MACzB,OAAO;KACV;IAED,OAAO,gBAAO,IAAI,CAAC,iBAAiB,CAAQ,CAAC;EACjD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\nimport { Icon } from '../../global/shared-types/icon.types';\nimport { getIconName } from '../icon/get-icon-props';\n\n/**\n * A header is the top most visual element in a component, page, card, or a view.\n *\n * ## Usage\n * A header is the first thing that clarifies a context for users.\n * Due to their positions in the UI hierarchy, headers are the most\n * prominent elements of a user interface; and because of that, they carry both\n * vital information and fundamental controls for the area of the interface\n * they represent.\n *\n * For example, when a header is placed on top of a card, it should quickly\n * explain the card to the user. When placed on top of a modal, it should easily\n * clarify what the modal is about. When displayed on top of a fullscreen view,\n * it should indicate where in the system users are, and what part of the app\n * they are looking at.\n *\n *\n * ## Layout\n * The vital information in a header is usually manifested in form of an icon,\n * and a heading. A subheading also could be added to provide supplementary\n * information. There is also a third place for displaying supplementary information\n * or \"supporting text\", which will be rendered as a part of the subheading.\n * Along with this information, headers can also include actions, controls, or\n * menus.\n *\n * :::important\n * Such actions or menus must affect the entire section of the interface\n * which the header is representing. For example, a _Delete_ button on a card\n * header must delete that entire card and its respective contents all together,\n * not for example a selected item which is visible in the content of that card.\n * :::\n *\n *\n * :::warning\n * Do not user background color on icons in the headers. It is much better and\n * much easier for the eye if your icon itself has a color.\n * Background colors behind icons make them look like \"call to action\" buttons\n * and take a lot of attention from users.\n * :::\n *\n * @exampleComponent limel-example-header\n * @exampleComponent limel-example-header-slot-actions\n * @exampleComponent limel-example-header-colors\n * @exampleComponent limel-example-header-responsive\n * @exampleComponent limel-example-header-narrow\n * @slot actions - Content (actions) to be put inside the far right surface of\n * the header\n * @slot [no name] - DEPRECATED. The `actions` slot used to be unnamed. This\n * behavior has been deprecated, and support will be dropped in a future\n * version. Please add `slot=\"actions\"` to your elements to ensure your code\n * will continue to work with future versions of Lime Elements.\n */\n@Component({\n tag: 'limel-header',\n shadow: true,\n styleUrl: 'header.scss',\n})\nexport class Header {\n /**\n * Icon to display\n */\n @Prop()\n public icon?: string | Icon;\n\n /**\n * Title to display\n */\n @Prop()\n public heading?: string;\n\n /**\n * Subheading to display\n */\n @Prop()\n public subheading?: string;\n\n /**\n * An extra string of text to display along with with the Subheading\n */\n @Prop()\n public supportingText?: string;\n\n /**\n * The visual divider that separates the `subheading` and the `supportingText`.\n * It must be a single character such as `-` or `,`.\n */\n @Prop()\n public subheadingDivider?: string = '·';\n\n public render() {\n return [\n <div class=\"information\">\n {this.renderIcon()}\n <div class=\"headings\">\n <h1 class=\"heading\" title={this.heading}>\n {this.heading}\n </h1>\n <h2 class=\"subheading\" title={this.subheading}>\n {this.subheading}\n {this.renderSupportingText()}\n </h2>\n </div>\n </div>,\n <slot name=\"actions\">\n <slot />\n </slot>,\n ];\n }\n\n private renderIcon() {\n const icon = getIconName(this.icon);\n\n if (!icon) {\n return;\n }\n\n return <limel-icon class=\"icon\" badge={true} name={icon} />;\n }\n\n private renderSupportingText() {\n if (!this.supportingText) {\n return;\n }\n\n return (\n <span class=\"subheading__supporting-text\">\n {this.renderSubheadingDivider()}\n {this.supportingText}\n </span>\n );\n }\n\n private renderSubheadingDivider() {\n if (!this.subheadingDivider) {\n return;\n }\n\n return <span>{this.subheadingDivider}</span>;\n }\n}\n"]}
@@ -66,7 +66,7 @@ export class HelpContent {
66
66
  "references": {
67
67
  "Link": {
68
68
  "location": "import",
69
- "path": "../../interface"
69
+ "path": "../../global/shared-types/link.types"
70
70
  }
71
71
  }
72
72
  },
@@ -1 +1 @@
1
- {"version":3,"file":"help-content.js","sourceRoot":"","sources":["../../../src/components/help/help-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGnD;;;;;;;;GAQG;AAMH,MAAM,OAAO,WAAW;;IAcZ,uBAAkB,GAAG,GAAG,EAAE;;MAC9B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;QACpB,OAAO;OACV;MAED,OAAO,CACH;QACI,SACI,IAAI,EAAE,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,EAC7B,MAAM,EAAE,MAAA,IAAI,CAAC,YAAY,0CAAE,MAAM,EACjC,KAAK,EAAE,MAAA,IAAI,CAAC,YAAY,0CAAE,KAAK,EAC/B,QAAQ,EAAC,GAAG,IAEX,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CACxB,CACD,CACV,CAAC;IACN,CAAC,CAAC;;;;EAxBK,MAAM;IACT,OAAO;MACH,sBAAgB,KAAK,EAAE,IAAI,CAAC,KAAK,GAAI;MACrC,IAAI,CAAC,kBAAkB,EAAE;KAC5B,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBJ","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { Link } from '../../interface';\n\n/**\n * Help content\n * This is scrollable content that is placed in the popover of the Help component.\n * Moved here mostly to avoid having inlined styles in the parent component.\n * Since you cannot send styles to the Portal component, we need to have this\n * child component.\n *\n * @private\n */\n@Component({\n tag: 'limel-help-content',\n shadow: true,\n styleUrl: 'limel-help-content.scss',\n})\nexport class HelpContent {\n @Prop()\n public value: string;\n\n @Prop()\n public readMoreLink?: Link;\n\n public render() {\n return [\n <limel-markdown value={this.value} />,\n this.renderReadMoreLink(),\n ];\n }\n\n private renderReadMoreLink = () => {\n if (!this.readMoreLink) {\n return;\n }\n\n return (\n <span>\n <a\n href={this.readMoreLink?.href}\n target={this.readMoreLink?.target}\n title={this.readMoreLink?.title}\n tabindex=\"0\"\n >\n {this.readMoreLink?.text}\n </a>\n </span>\n );\n };\n}\n"]}
1
+ {"version":3,"file":"help-content.js","sourceRoot":"","sources":["../../../src/components/help/help-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGnD;;;;;;;;GAQG;AAMH,MAAM,OAAO,WAAW;;IAcZ,uBAAkB,GAAG,GAAG,EAAE;;MAC9B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;QACpB,OAAO;OACV;MAED,OAAO,CACH;QACI,SACI,IAAI,EAAE,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,EAC7B,MAAM,EAAE,MAAA,IAAI,CAAC,YAAY,0CAAE,MAAM,EACjC,KAAK,EAAE,MAAA,IAAI,CAAC,YAAY,0CAAE,KAAK,EAC/B,QAAQ,EAAC,GAAG,IAEX,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CACxB,CACD,CACV,CAAC;IACN,CAAC,CAAC;;;;EAxBK,MAAM;IACT,OAAO;MACH,sBAAgB,KAAK,EAAE,IAAI,CAAC,KAAK,GAAI;MACrC,IAAI,CAAC,kBAAkB,EAAE;KAC5B,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBJ","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { Link } from '../../global/shared-types/link.types';\n\n/**\n * Help content\n * This is scrollable content that is placed in the popover of the Help component.\n * Moved here mostly to avoid having inlined styles in the parent component.\n * Since you cannot send styles to the Portal component, we need to have this\n * child component.\n *\n * @private\n */\n@Component({\n tag: 'limel-help-content',\n shadow: true,\n styleUrl: 'limel-help-content.scss',\n})\nexport class HelpContent {\n @Prop()\n public value: string;\n\n @Prop()\n public readMoreLink?: Link;\n\n public render() {\n return [\n <limel-markdown value={this.value} />,\n this.renderReadMoreLink(),\n ];\n }\n\n private renderReadMoreLink = () => {\n if (!this.readMoreLink) {\n return;\n }\n\n return (\n <span>\n <a\n href={this.readMoreLink?.href}\n target={this.readMoreLink?.target}\n title={this.readMoreLink?.title}\n tabindex=\"0\"\n >\n {this.readMoreLink?.text}\n </a>\n </span>\n );\n };\n}\n"]}