@limetech/lime-elements 38.16.2 → 38.17.0

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 (57) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/limel-breadcrumbs_8.cjs.entry.js +2 -1
  3. package/dist/cjs/limel-breadcrumbs_8.cjs.entry.js.map +1 -1
  4. package/dist/cjs/limel-chip_2.cjs.entry.js +4 -2
  5. package/dist/cjs/limel-chip_2.cjs.entry.js.map +1 -1
  6. package/dist/cjs/limel-info-tile.cjs.entry.js +5 -3
  7. package/dist/cjs/limel-info-tile.cjs.entry.js.map +1 -1
  8. package/dist/cjs/limel-shortcut.cjs.entry.js +4 -2
  9. package/dist/cjs/limel-shortcut.cjs.entry.js.map +1 -1
  10. package/dist/cjs/{link-helper-14629490.js → link-helper-9486031c.js} +22 -1
  11. package/dist/cjs/link-helper-9486031c.js.map +1 -0
  12. package/dist/collection/components/chip/chip.js +5 -2
  13. package/dist/collection/components/chip/chip.js.map +1 -1
  14. package/dist/collection/components/info-tile/info-tile.js +5 -3
  15. package/dist/collection/components/info-tile/info-tile.js.map +1 -1
  16. package/dist/collection/components/input-field/input-field.js +2 -1
  17. package/dist/collection/components/input-field/input-field.js.map +1 -1
  18. package/dist/collection/components/shortcut/shortcut.js +4 -2
  19. package/dist/collection/components/shortcut/shortcut.js.map +1 -1
  20. package/dist/collection/global/shared-types/link.types.js.map +1 -1
  21. package/dist/collection/util/link-helper.js +20 -0
  22. package/dist/collection/util/link-helper.js.map +1 -1
  23. package/dist/esm/limel-breadcrumbs_8.entry.js +2 -1
  24. package/dist/esm/limel-breadcrumbs_8.entry.js.map +1 -1
  25. package/dist/esm/limel-chip_2.entry.js +4 -2
  26. package/dist/esm/limel-chip_2.entry.js.map +1 -1
  27. package/dist/esm/limel-info-tile.entry.js +5 -3
  28. package/dist/esm/limel-info-tile.entry.js.map +1 -1
  29. package/dist/esm/limel-shortcut.entry.js +4 -2
  30. package/dist/esm/limel-shortcut.entry.js.map +1 -1
  31. package/dist/esm/{link-helper-0c4a5c2e.js → link-helper-1522032e.js} +22 -2
  32. package/dist/esm/link-helper-1522032e.js.map +1 -0
  33. package/dist/lime-elements/lime-elements.esm.js +1 -1
  34. package/dist/lime-elements/p-0adbd58c.entry.js +2 -0
  35. package/dist/lime-elements/p-0adbd58c.entry.js.map +1 -0
  36. package/dist/lime-elements/{p-fbc07821.entry.js → p-a0186098.entry.js} +14 -14
  37. package/dist/lime-elements/p-a0186098.entry.js.map +1 -0
  38. package/dist/lime-elements/p-b9101ec8.entry.js +2 -0
  39. package/dist/lime-elements/p-b9101ec8.entry.js.map +1 -0
  40. package/dist/lime-elements/p-cfe06c44.js +2 -0
  41. package/dist/lime-elements/p-cfe06c44.js.map +1 -0
  42. package/dist/lime-elements/p-e50680a4.entry.js +2 -0
  43. package/dist/lime-elements/p-e50680a4.entry.js.map +1 -0
  44. package/dist/types/global/shared-types/link.types.d.ts +8 -0
  45. package/dist/types/util/link-helper.d.ts +12 -0
  46. package/package.json +1 -1
  47. package/dist/cjs/link-helper-14629490.js.map +0 -1
  48. package/dist/esm/link-helper-0c4a5c2e.js.map +0 -1
  49. package/dist/lime-elements/p-19c509c3.js +0 -2
  50. package/dist/lime-elements/p-19c509c3.js.map +0 -1
  51. package/dist/lime-elements/p-19e93fb0.entry.js +0 -2
  52. package/dist/lime-elements/p-19e93fb0.entry.js.map +0 -1
  53. package/dist/lime-elements/p-237f85c1.entry.js +0 -2
  54. package/dist/lime-elements/p-237f85c1.entry.js.map +0 -1
  55. package/dist/lime-elements/p-c30e11ce.entry.js +0 -2
  56. package/dist/lime-elements/p-c30e11ce.entry.js.map +0 -1
  57. package/dist/lime-elements/p-fbc07821.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"shortcut.js","sourceRoot":"","sources":["../../../src/components/shortcut/shortcut.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EA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gBAAgB,EACnC,YAAY,EAAE,IAAI,CAAC,gBAAgB;MAEnC,0BACmB,IAAI,CAAC,QAAQ,EAC5B,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,EACrB,MAAM,EAAE,MAAA,IAAI,CAAC,IAAI,0CAAE,MAAM,EACzB,QAAQ,EAAC,GAAG,gBACA,IAAI,CAAC,YAAY,EAAE,EAC/B,KAAK,EAAE,MAAA,IAAI,CAAC,IAAI,0CAAE,KAAK;QAEvB,kBAAY,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI;QAC/B,qCAA8B,CAC9B;MACH,IAAI,CAAC,WAAW,EAAE;MAClB,IAAI,CAAC,kBAAkB,EAAE,CACvB,CACV,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BJ","sourcesContent":["import { Component, Prop, h, Element, Host } from '@stencil/core';\nimport { Link } from '../../global/shared-types/link.types';\nimport { getMouseEventHandlers } from '../../util/3d-tilt-hover-effect';\n\n/**\n * This component can be used on places such as a start page or a dashboard.\n * Clicking on the component should navigate the user to a new screen,\n * to which you need to provide a URL, by specifying an `href` for the `link` property.\n *\n * By default, this navigation will happen within the same browser tab.\n * However, it is possible to override that behavior, by specifying a `target`\n * for the `link` property\n *\n * @exampleComponent limel-example-shortcut\n * @exampleComponent limel-example-shortcut-notification\n * @exampleComponent limel-example-shortcut-styling\n * @exampleComponent limel-example-shortcut-with-click-handler\n */\n\n@Component({\n tag: 'limel-shortcut',\n shadow: true,\n styleUrl: 'shortcut.scss',\n})\nexport class Shortcut {\n /**\n * Name of icon for the shortcut.\n */\n @Prop({ reflect: true })\n public icon: string;\n\n /**\n * The text to show below the shortcut. Long label will be truncated.\n */\n @Prop({ reflect: true })\n public label?: string = null;\n\n /**\n * Set to `true` if shortcut is disabled.\n */\n @Prop({ reflect: true })\n public disabled?: boolean = false;\n\n /**\n * If specified, will display a notification badge\n * on the shortcut.\n */\n @Prop({ reflect: true })\n public badge?: number | string;\n\n /**\n * If supplied, the shortcut will be a clickable link.\n */\n @Prop()\n public link?: Link;\n\n @Element()\n private host: HTMLElement;\n\n private handleMouseEnter: () => void;\n private handleMouseLeave: () => void;\n\n public componentWillLoad() {\n const { handleMouseEnter, handleMouseLeave } = getMouseEventHandlers(\n this.host,\n );\n this.handleMouseEnter = handleMouseEnter;\n this.handleMouseLeave = handleMouseLeave;\n }\n\n public render() {\n return (\n <Host\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n >\n <a\n aria-disabled={this.disabled}\n href={this.link?.href}\n target={this.link?.target}\n tabindex=\"0\"\n aria-label={this.getAriaLabel()}\n title={this.link?.title}\n >\n <limel-icon name={this.icon} />\n <limel-3d-hover-effect-glow />\n </a>\n {this.renderLabel()}\n {this.renderNotification()}\n </Host>\n );\n }\n\n private renderLabel = () => {\n if (this.label) {\n return <span aria-hidden=\"true\">{this.label}</span>;\n }\n };\n\n private getAriaLabel = () => {\n if (this.label && this.link?.title) {\n return this.label + '. ' + this.link.title;\n }\n\n if (this.label) {\n return this.label;\n }\n\n if (this.link?.title) {\n return this.link.title;\n }\n\n return undefined;\n };\n\n private renderNotification = () => {\n if (this.badge) {\n return <limel-badge label={this.badge} />;\n }\n };\n}\n"]}
1
+ {"version":3,"file":"shortcut.js","sourceRoot":"","sources":["../../../src/components/shortcut/shortcut.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAElE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE;;;;;;;;;;;;;GAaG;AAOH,MAAM,OAAO,QAAQ;;IAwET,gBAAW,GAAG,GAAG,EAAE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AAI,CAAC,QAAQ,EAC5B,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,EACrB,MAAM,EAAE,MAAA,IAAI,CAAC,IAAI,0CAAE,MAAM,EACzB,GAAG,EAAE,GAAG,EACR,QAAQ,EAAC,GAAG,gBACA,IAAI,CAAC,YAAY,EAAE,EAC/B,KAAK,EAAE,MAAA,IAAI,CAAC,IAAI,0CAAE,KAAK;QAEvB,kBAAY,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI;QAC/B,qCAA8B,CAC9B;MACH,IAAI,CAAC,WAAW,EAAE;MAClB,IAAI,CAAC,kBAAkB,EAAE,CACvB,CACV,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BJ","sourcesContent":["import { Component, Prop, h, Element, Host } from '@stencil/core';\nimport { Link } from '../../global/shared-types/link.types';\nimport { getRel } from '../../util/link-helper';\nimport { getMouseEventHandlers } from '../../util/3d-tilt-hover-effect';\n\n/**\n * This component can be used on places such as a start page or a dashboard.\n * Clicking on the component should navigate the user to a new screen,\n * to which you need to provide a URL, by specifying an `href` for the `link` property.\n *\n * By default, this navigation will happen within the same browser tab.\n * However, it is possible to override that behavior, by specifying a `target`\n * for the `link` property\n *\n * @exampleComponent limel-example-shortcut\n * @exampleComponent limel-example-shortcut-notification\n * @exampleComponent limel-example-shortcut-styling\n * @exampleComponent limel-example-shortcut-with-click-handler\n */\n\n@Component({\n tag: 'limel-shortcut',\n shadow: true,\n styleUrl: 'shortcut.scss',\n})\nexport class Shortcut {\n /**\n * Name of icon for the shortcut.\n */\n @Prop({ reflect: true })\n public icon: string;\n\n /**\n * The text to show below the shortcut. Long label will be truncated.\n */\n @Prop({ reflect: true })\n public label?: string = null;\n\n /**\n * Set to `true` if shortcut is disabled.\n */\n @Prop({ reflect: true })\n public disabled?: boolean = false;\n\n /**\n * If specified, will display a notification badge\n * on the shortcut.\n */\n @Prop({ reflect: true })\n public badge?: number | string;\n\n /**\n * If supplied, the shortcut will be a clickable link.\n */\n @Prop()\n public link?: Link;\n\n @Element()\n private host: HTMLElement;\n\n private handleMouseEnter: () => void;\n private handleMouseLeave: () => void;\n\n public componentWillLoad() {\n const { handleMouseEnter, handleMouseLeave } = getMouseEventHandlers(\n this.host,\n );\n this.handleMouseEnter = handleMouseEnter;\n this.handleMouseLeave = handleMouseLeave;\n }\n\n public render() {\n const rel = getRel(this.link?.target, this.link?.rel);\n\n return (\n <Host\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n >\n <a\n aria-disabled={this.disabled}\n href={this.link?.href}\n target={this.link?.target}\n rel={rel}\n tabindex=\"0\"\n aria-label={this.getAriaLabel()}\n title={this.link?.title}\n >\n <limel-icon name={this.icon} />\n <limel-3d-hover-effect-glow />\n </a>\n {this.renderLabel()}\n {this.renderNotification()}\n </Host>\n );\n }\n\n private renderLabel = () => {\n if (this.label) {\n return <span aria-hidden=\"true\">{this.label}</span>;\n }\n };\n\n private getAriaLabel = () => {\n if (this.label && this.link?.title) {\n return this.label + '. ' + this.link.title;\n }\n\n if (this.label) {\n return this.label;\n }\n\n if (this.link?.title) {\n return this.link.title;\n }\n\n return undefined;\n };\n\n private renderNotification = () => {\n if (this.badge) {\n return <limel-badge label={this.badge} />;\n }\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"link.types.js","sourceRoot":"","sources":["../../../src/global/shared-types/link.types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for a link.\n * @public\n */\nexport interface Link {\n /**\n * The url the link should point to.\n */\n href: string;\n\n /**\n * The text value to use for the link.\n * Note that this might not be used by all components that use the\n * Link interface.\n */\n text?: string;\n\n /**\n * Title for the link. Read by assistive tech and shown when the\n * link is hovered. Can be used to provide additional information\n * about the link. It improves accessibility both for sighted users\n * and users of assistive technologies.\n */\n title?: string;\n\n /**\n * Target for the link. See\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n * for more info.\n */\n target?: string;\n}\n"]}
1
+ {"version":3,"file":"link.types.js","sourceRoot":"","sources":["../../../src/global/shared-types/link.types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for a link.\n * @public\n */\nexport interface Link {\n /**\n * The url the link should point to.\n */\n href: string;\n\n /**\n * The text value to use for the link.\n * Note that this might not be used by all components that use the\n * Link interface.\n */\n text?: string;\n\n /**\n * Title for the link. Read by assistive tech and shown when the\n * link is hovered. Can be used to provide additional information\n * about the link. It improves accessibility both for sighted users\n * and users of assistive technologies.\n */\n title?: string;\n\n /**\n * Target for the link. See\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n * for more info.\n */\n target?: string;\n\n /**\n * The `rel` attribute for the link.\n * Unless explicitly provided, in our components, this is\n * automatically set to `\"noopener noreferrer\"`\n * when `target=\"_blank\"` is used, for improved security.\n * Providing an empty string will override the default.\n */\n rel?: string;\n}\n"]}
@@ -48,4 +48,24 @@ function isRelativeLink(input) {
48
48
  function hasRelativeProtocol(input) {
49
49
  return input.startsWith('//');
50
50
  }
51
+ /**
52
+ * Returns the appropriate `rel` attribute value for a link.
53
+ *
54
+ * If an explicit `rel` value is provided, it will be used.
55
+ * Otherwise, when `target` is `_blank`, automatically returns
56
+ * `"noopener noreferrer"` for improved security.
57
+ *
58
+ * @param target - The target attribute value (e.g., "_blank", "_self")
59
+ * @param explicitRel - An explicitly provided rel attribute value
60
+ * @returns The rel attribute value to use, or undefined if none needed
61
+ */
62
+ export function getRel(target, explicitRel) {
63
+ if (explicitRel !== undefined) {
64
+ return explicitRel.trim() || undefined;
65
+ }
66
+ if ((target === null || target === void 0 ? void 0 : target.trim().toLowerCase()) === '_blank') {
67
+ return 'noopener noreferrer';
68
+ }
69
+ return undefined;
70
+ }
51
71
  //# sourceMappingURL=link-helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"link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CAAC,KAAK,CAAC,EAAE;IAC5B,OAAO,KAAK,CAAC;GAChB;EAED,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAa;EACtC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC","sourcesContent":["export function getHref(value: string) {\n const href = value ? String(value.trim()) : '';\n if (isValid(href)) {\n return href;\n }\n\n return prependProtocol(href);\n}\n\nexport function getTarget(value: string) {\n const url = getHref(value);\n if (isRelativeLink(url)) {\n return '_self';\n }\n\n return '_blank';\n}\n\nexport function prependProtocol(input: string) {\n if (!input) {\n return input;\n }\n\n return 'https://' + input;\n}\n\nfunction isValid(href: string) {\n return (\n hasKnownProtocol(href) ||\n isRelativeLink(href) ||\n hasRelativeProtocol(href)\n );\n}\n\nexport function hasKnownProtocol(input: string) {\n const knownProtocols = [\n 'ftp',\n 'ftps',\n 'https',\n 'http',\n\n // `file` may or may not work, due to cross-origin restrictions and browser settings.\n 'file',\n\n // m-files is a protocol used by the M-Files desktop app or something.\n // It's not a web protocol, but it allows open M-Files links in their app.\n 'm-files',\n ];\n\n return knownProtocols.some((knownProtocol) => {\n return input.startsWith(knownProtocol + '://');\n });\n}\n\nfunction isRelativeLink(input: string) {\n if (hasRelativeProtocol(input)) {\n return false;\n }\n\n return input.startsWith('/') || input.startsWith('#');\n}\n\nfunction hasRelativeProtocol(input: string) {\n return input.startsWith('//');\n}\n"]}
1
+ {"version":3,"file":"link-helper.js","sourceRoot":"","sources":["../../src/util/link-helper.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO,CAAC,KAAa;EACjC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;EAC/C,IAAI,OAAO,CAAC,IA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AAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,MAAM,CAAC,MAAsB,EAAE,WAA2B;EACtE,IAAI,WAAW,KAAK,SAAS,EAAE;IAC3B,OAAO,WAAW,CAAC,IAAI,EAAE,IAAI,SAAS,CAAC;GAC1C;EAED,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,GAAG,WAAW,EAAE,MAAK,QAAQ,EAAE;IAC3C,OAAO,qBAAqB,CAAC;GAChC;EAED,OAAO,SAAS,CAAC;AACrB,CAAC","sourcesContent":["export function getHref(value: string) {\n const href = value ? String(value.trim()) : '';\n if (isValid(href)) {\n return href;\n }\n\n return prependProtocol(href);\n}\n\nexport function getTarget(value: string) {\n const url = getHref(value);\n if (isRelativeLink(url)) {\n return '_self';\n }\n\n return '_blank';\n}\n\nexport function prependProtocol(input: string) {\n if (!input) {\n return input;\n }\n\n return 'https://' + input;\n}\n\nfunction isValid(href: string) {\n return (\n hasKnownProtocol(href) ||\n isRelativeLink(href) ||\n hasRelativeProtocol(href)\n );\n}\n\nexport function hasKnownProtocol(input: string) {\n const knownProtocols = [\n 'ftp',\n 'ftps',\n 'https',\n 'http',\n\n // `file` may or may not work, due to cross-origin restrictions and browser settings.\n 'file',\n\n // m-files is a protocol used by the M-Files desktop app or something.\n // It's not a web protocol, but it allows open M-Files links in their app.\n 'm-files',\n ];\n\n return knownProtocols.some((knownProtocol) => {\n return input.startsWith(knownProtocol + '://');\n });\n}\n\nfunction isRelativeLink(input: string) {\n if (hasRelativeProtocol(input)) {\n return false;\n }\n\n return input.startsWith('/') || input.startsWith('#');\n}\n\nfunction hasRelativeProtocol(input: string) {\n return input.startsWith('//');\n}\n\n/**\n * Returns the appropriate `rel` attribute value for a link.\n *\n * If an explicit `rel` value is provided, it will be used.\n * Otherwise, when `target` is `_blank`, automatically returns\n * `\"noopener noreferrer\"` for improved security.\n *\n * @param target - The target attribute value (e.g., \"_blank\", \"_self\")\n * @param explicitRel - An explicitly provided rel attribute value\n * @returns The rel attribute value to use, or undefined if none needed\n */\nexport function getRel(target?: string | null, explicitRel?: string | null) {\n if (explicitRel !== undefined) {\n return explicitRel.trim() || undefined;\n }\n\n if (target?.trim().toLowerCase() === '_blank') {\n return 'noopener noreferrer';\n }\n\n return undefined;\n}\n"]}
@@ -3,7 +3,7 @@ import { m as makeEnterClickable, r as removeEnterClickable } from './make-enter
3
3
  import { c as createRandomString } from './random-string-e74dc48d.js';
4
4
  import { g as getIconName, a as getIconColor, b as getIconTitle } from './get-icon-props-37514418.js';
5
5
  import { T as TAB, A as ARROW_UP, b as ARROW_DOWN, E as ESCAPE, a as ENTER, S as SPACE, c as ARROW_LEFT, d as ARROW_RIGHT } from './keycodes-e2e44b7e.js';
6
- import { g as getHref, a as getTarget } from './link-helper-0c4a5c2e.js';
6
+ import { a as getHref, b as getTarget, g as getRel } from './link-helper-1522032e.js';
7
7
  import { g as globalConfig } from './config-656a588f.js';
8
8
  import { M as MDCTextField } from './component-e6eb55fa.js';
9
9
  import { d as debounce } from './debounce-9a05c91c.js';
@@ -332,6 +332,7 @@ const InputField = class {
332
332
  default:
333
333
  props.href = getHref(this.value);
334
334
  props.target = getTarget(this.value);
335
+ props.rel = getRel(props.target);
335
336
  }
336
337
  return props;
337
338
  };