@limetech/lime-elements 36.4.0-next.2 → 36.4.0-next.4

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 (48) hide show
  1. package/dist/cjs/lime-elements.cjs.js +1 -1
  2. package/dist/cjs/limel-action-bar-item_2.cjs.entry.js +97 -0
  3. package/dist/cjs/limel-action-bar.cjs.entry.js +106 -0
  4. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +5 -1
  5. package/dist/cjs/limel-list_2.cjs.entry.js +1 -1
  6. package/dist/cjs/{limel-menu-list.cjs.entry.js → limel-menu_2.cjs.entry.js} +122 -1
  7. package/dist/cjs/{limel-popover_4.cjs.entry.js → limel-popover_2.cjs.entry.js} +0 -97
  8. package/dist/cjs/limel-tooltip_2.cjs.entry.js +104 -0
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/collection/collection-manifest.json +3 -0
  11. package/dist/collection/components/action-bar/action-bar-item/action-bar-item.css +129 -0
  12. package/dist/collection/components/action-bar/action-bar-item/action-bar-item.js +144 -0
  13. package/dist/collection/components/action-bar/action-bar-item/action-bar-overflow-menu.js +106 -0
  14. package/dist/collection/components/action-bar/action-bar.css +50 -0
  15. package/dist/collection/components/action-bar/action-bar.js +244 -0
  16. package/dist/collection/components/action-bar/action-bar.types.js +1 -0
  17. package/dist/collection/components/action-bar/isItem.js +3 -0
  18. package/dist/collection/components/list/list.css +2 -1
  19. package/dist/collection/components/menu-list/menu-list.css +2 -1
  20. package/dist/esm/lime-elements.js +1 -1
  21. package/dist/esm/limel-action-bar-item_2.entry.js +92 -0
  22. package/dist/esm/limel-action-bar.entry.js +102 -0
  23. package/dist/esm/limel-flatpickr-adapter.entry.js +5 -1
  24. package/dist/esm/limel-list_2.entry.js +1 -1
  25. package/dist/esm/{limel-menu-list.entry.js → limel-menu_2.entry.js} +123 -3
  26. package/dist/esm/{limel-popover_4.entry.js → limel-popover_2.entry.js} +1 -96
  27. package/dist/esm/limel-tooltip_2.entry.js +99 -0
  28. package/dist/esm/loader.js +1 -1
  29. package/dist/lime-elements/lime-elements.esm.js +1 -1
  30. package/dist/lime-elements/p-3cdc210b.entry.js +1 -0
  31. package/dist/lime-elements/p-7112ebf8.entry.js +1 -0
  32. package/dist/lime-elements/{p-20059fcf.entry.js → p-a030e9ab.entry.js} +6 -5
  33. package/dist/lime-elements/p-b526ebd4.entry.js +1 -0
  34. package/dist/lime-elements/p-c823809f.entry.js +1 -0
  35. package/dist/lime-elements/{p-4e5865a7.entry.js → p-da4d1bc1.entry.js} +1 -1
  36. package/dist/lime-elements/{p-d034bbcf.entry.js → p-f1d963ec.entry.js} +1 -1
  37. package/dist/types/components/action-bar/action-bar-item/action-bar-item.d.ts +33 -0
  38. package/dist/types/components/action-bar/action-bar-item/action-bar-overflow-menu.d.ts +25 -0
  39. package/dist/types/components/action-bar/action-bar.d.ts +79 -0
  40. package/dist/types/components/action-bar/action-bar.types.d.ts +8 -0
  41. package/dist/types/components/action-bar/isItem.d.ts +3 -0
  42. package/dist/types/components.d.ts +143 -16
  43. package/dist/types/interface.d.ts +1 -0
  44. package/package.json +13 -14
  45. package/dist/cjs/limel-menu.cjs.entry.js +0 -127
  46. package/dist/esm/limel-menu.entry.js +0 -123
  47. package/dist/lime-elements/p-50dbd665.entry.js +0 -1
  48. package/dist/lime-elements/p-d16b27b9.entry.js +0 -1
@@ -1,123 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cdfd351d.js';
2
- import { c as createRandomString } from './random-string-2246b81e.js';
3
- import { z as zipObject } from './zipObject-2bb1968e.js';
4
- import './_assignValue-fb2bf80a.js';
5
- import './_defineProperty-2105cb48.js';
6
- import './_getNative-93d6bfe9.js';
7
- import './eq-c1c7f528.js';
8
- import './isObject-c74e273c.js';
9
-
10
- const menuCss = ":host(limel-menu){isolation:isolate;position:relative;display:inline-block;--badge-background-color:var(\n --notification-badge-background-color,\n rgb(var(--color-red-default))\n );--badge-text-color:var(\n --notification-badge-text-color,\n rgb(var(--color-white))\n )}:host([hidden]){display:none}.menu__trigger{border-color:transparent;border-width:1px;border-style:solid;background:none;color:rgb(var(--contrast-800));height:2.25rem}.menu__trigger-enabled:hover{border-color:rgb(var(--contrast-800));color:rgb(var(--contrast-1100))}.mdc-menu-surface--anchor{position:relative}limel-badge{position:absolute;top:-0.25rem;right:-0.25rem}";
11
-
12
- const Menu = class {
13
- constructor(hostRef) {
14
- registerInstance(this, hostRef);
15
- this.cancel = createEvent(this, "cancel", 7);
16
- this.select = createEvent(this, "select", 7);
17
- this.setTriggerAttributes = (element) => {
18
- const attributes = {
19
- 'aria-haspopup': true,
20
- 'aria-expanded': this.open,
21
- disabled: this.disabled,
22
- role: 'button',
23
- };
24
- for (const [key, value] of Object.entries(attributes)) {
25
- if (!value) {
26
- element.removeAttribute(key);
27
- }
28
- else {
29
- element.setAttribute(key, String(value));
30
- }
31
- }
32
- };
33
- this.onClose = () => {
34
- this.cancel.emit();
35
- this.open = false;
36
- };
37
- this.onTriggerClick = (event) => {
38
- event.stopPropagation();
39
- if (this.disabled) {
40
- return;
41
- }
42
- this.open = !this.open;
43
- };
44
- this.handleSelect = (event) => {
45
- event.stopPropagation();
46
- this.select.emit(event.detail);
47
- this.open = false;
48
- };
49
- this.setListElement = (element) => {
50
- this.list = element;
51
- };
52
- this.focusMenuItem = () => {
53
- var _a;
54
- const activeElement = this.list.shadowRoot.activeElement;
55
- activeElement === null || activeElement === void 0 ? void 0 : activeElement.blur();
56
- const MenuItems = this.items.filter(this.isMenuItem);
57
- const selectedIndex = Math.max(MenuItems.findIndex((item) => item.selected), 0);
58
- const menuElements = Array.from(this.list.shadowRoot.querySelectorAll('[role="menuitem"]'));
59
- (_a = menuElements[selectedIndex]) === null || _a === void 0 ? void 0 : _a.focus();
60
- };
61
- this.renderNotificationBadge = () => {
62
- if (this.items.some(this.hasNotificationBadge)) {
63
- return h("limel-badge", null);
64
- }
65
- };
66
- this.hasNotificationBadge = (item) => this.isMenuItem(item) && item.badge !== undefined;
67
- this.items = [];
68
- this.disabled = false;
69
- this.openDirection = 'bottom-start';
70
- this.open = false;
71
- this.badgeIcons = false;
72
- this.gridLayout = false;
73
- this.portalId = createRandomString();
74
- }
75
- openWatcher() {
76
- if (!this.open) {
77
- return;
78
- }
79
- const observer = new IntersectionObserver(() => {
80
- observer.unobserve(this.list);
81
- this.focusMenuItem();
82
- });
83
- observer.observe(this.list);
84
- }
85
- render() {
86
- const cssProperties = this.getCssProperties();
87
- const dropdownZIndex = getComputedStyle(this.host).getPropertyValue('--dropdown-z-index');
88
- return (h("div", { class: "mdc-menu-surface--anchor", onClick: this.onTriggerClick }, h("slot", { name: "trigger" }), this.renderNotificationBadge(), h("limel-portal", { visible: this.open, containerId: this.portalId, openDirection: this.openDirection, position: "absolute", containerStyle: { 'z-index': dropdownZIndex } }, h("limel-menu-surface", { open: this.open, onDismiss: this.onClose, style: cssProperties, class: {
89
- 'has-grid-layout': this.gridLayout,
90
- } }, h("limel-menu-list", { class: {
91
- 'has-grid-layout has-interactive-items': this.gridLayout,
92
- }, items: this.items, type: "menu", badgeIcons: this.badgeIcons, onSelect: this.handleSelect, ref: this.setListElement })))));
93
- }
94
- componentDidRender() {
95
- const slotElement = this.host.shadowRoot.querySelector('slot');
96
- slotElement.assignedElements().forEach(this.setTriggerAttributes);
97
- }
98
- getCssProperties() {
99
- const propertyNames = [
100
- '--menu-surface-width',
101
- '--list-grid-item-max-width',
102
- '--list-grid-item-min-width',
103
- '--list-grid-gap',
104
- '--notification-badge-background-color',
105
- '--notification-badge-text-color',
106
- ];
107
- const style = getComputedStyle(this.host);
108
- const values = propertyNames.map((property) => {
109
- return style.getPropertyValue(property);
110
- });
111
- return zipObject(propertyNames, values);
112
- }
113
- isMenuItem(item) {
114
- return !('separator' in item);
115
- }
116
- get host() { return getElement(this); }
117
- static get watchers() { return {
118
- "open": ["openWatcher"]
119
- }; }
120
- };
121
- Menu.style = menuCss;
122
-
123
- export { Menu as limel_menu };
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as o,g as i}from"./p-d4e788e1.js";import{c as s}from"./p-6c094f3f.js";import{E as r}from"./p-d7801e00.js";import{z as l}from"./p-7cda574b.js";import"./p-b28128d2.js";import"./p-5fdb83c9.js";import"./p-4c3358cb.js";import"./p-eda23c05.js";import"./p-c93050d6.js";function a(t,e){var o;if(t.contains(e)||(null===(o=t.shadowRoot)||void 0===o?void 0:o.contains(e)))return!0;const i=function(t){const e=t.closest(".limel-portal--container");return e?e.portalSource:t.getRootNode().host}(e);return!!i&&a(t,i)}const n=class{constructor(o){t(this,o),this.close=e(this,"close",7),this.handleGlobalKeyPress=t=>{t.key===r&&(t.stopPropagation(),t.preventDefault(),this.close.emit())},this.open=!1,this.openDirection=void 0,this.portalId=s(),this.globalClickListener=this.globalClickListener.bind(this)}watchOpen(){this.setupGlobalHandlers()}componentWillLoad(){this.setupGlobalHandlers()}setupGlobalHandlers(){this.open?(document.addEventListener("click",this.globalClickListener,{capture:!0}),document.addEventListener("keyup",this.handleGlobalKeyPress)):(document.removeEventListener("click",this.globalClickListener),document.removeEventListener("keyup",this.handleGlobalKeyPress))}render(){const t=this.getCssProperties(),e=getComputedStyle(this.host).getPropertyValue("--popover-z-index");return o("div",{class:"trigger-anchor"},o("slot",{name:"trigger"}),o("limel-portal",{visible:this.open,containerId:this.portalId,containerStyle:{"z-index":e},openDirection:this.openDirection},o("limel-popover-surface",{contentCollection:this.host.children,style:t})))}globalClickListener(t){const e=a(this.host,t.target);this.open&&!e&&(t.stopPropagation(),t.preventDefault(),this.close.emit())}getCssProperties(){const t=["--popover-surface-width","--popover-body-background-color","--popover-border-radius"],e=getComputedStyle(this.host),o=t.map((t=>e.getPropertyValue(t)));return l(t,o)}get host(){return i(this)}static get watchers(){return{open:["watchOpen"]}}};n.style=".trigger-anchor{display:inline-block;position:relative}";const c=class{constructor(e){t(this,e),this.contentCollection=void 0}componentDidLoad(){this.appendElement()}render(){return o("div",{class:"limel-popover-surface",tabindex:"0"})}appendElement(){const t=this.host.shadowRoot.querySelector(".limel-popover-surface");Array.from(this.contentCollection).forEach((e=>{"trigger"!==e.slot&&t.appendChild(e)}))}get host(){return i(this)}};c.style=':host(limel-popover-surface){isolation:isolate}.limel-popover-surface{position:relative;display:flex;flex-direction:column;width:var(--popover-surface-width, auto);max-height:calc(100vh - 2rem);max-width:calc(100vw - 2rem);margin:0 0.25rem;border-radius:var(--popover-border-radius, 0.75rem);box-shadow:var(--shadow-depth-16);backdrop-filter:blur(0.3125rem);-webkit-backdrop-filter:blur(0.3125rem)}.limel-popover-surface:after{transition:opacity 0.4s ease;pointer-events:none;content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;opacity:0.75;border-radius:var(--popover-border-radius, 0.75rem);background-color:var(--popover-body-background-color, var(--lime-elevated-surface-background-color))}.limel-popover-surface:focus{outline:none}.limel-popover-surface:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.limel-popover-surface:focus:after,.limel-popover-surface:focus-within:after{opacity:1}';const h=class{constructor(e){t(this,e),this.showTooltip=()=>{this.showTooltipTimeoutHandle=window.setTimeout((()=>{this.open=!0}),500)},this.hideTooltip=()=>{clearTimeout(this.showTooltipTimeoutHandle),this.open=!1},this.elementId=void 0,this.label=void 0,this.helperLabel=void 0,this.maxlength=50,this.open=void 0,this.portalId=s(),this.tooltipId=s()}connectedCallback(){this.setOwnerAriaLabel(),this.addListeners()}disconnectedCallback(){this.removeListeners()}render(){const t=getComputedStyle(this.host).getPropertyValue("--tooltip-z-index");return o("div",{class:"trigger-anchor"},o("limel-portal",{openDirection:"bottom-start",visible:this.open,containerId:this.portalId,containerStyle:{"z-index":t,"pointer-events":"none"}},o("limel-tooltip-content",{label:this.label,helperLabel:this.helperLabel,maxlength:this.maxlength,role:"tooltip","aria-hidden":!this.open,id:this.tooltipId})))}setOwnerAriaLabel(){const t=this.getOwnerElement();null==t||t.setAttribute("aria-describedby",this.tooltipId)}addListeners(){const t=this.getOwnerElement();null==t||t.addEventListener("mouseover",this.showTooltip),null==t||t.addEventListener("mouseout",this.hideTooltip),null==t||t.addEventListener("click",this.hideTooltip)}removeListeners(){const t=this.getOwnerElement();null==t||t.removeEventListener("mouseover",this.showTooltip),null==t||t.removeEventListener("mouseout",this.hideTooltip),null==t||t.removeEventListener("click",this.hideTooltip)}getOwnerElement(){let t=this.host;do{t=t.parentNode}while(t&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&t.nodeType!==Node.DOCUMENT_NODE);return null==t?void 0:t.getElementById(this.elementId)}get host(){return i(this)}};h.style=".trigger-anchor{position:relative}";const p=class{constructor(e){t(this,e),this.label=void 0,this.helperLabel=void 0,this.maxlength=void 0}render(){let t=!1;this.helperLabel&&this.maxlength&&(t=this.label.length+this.helperLabel.length>this.maxlength);const e={};return this.maxlength&&(e.style={"--tooltip-max-width-of-text":`${this.maxlength}ch`}),[o("text",Object.assign({class:{"has-column-layout":t}},e),o("div",{class:"label"},this.label),o("div",{class:"helper-label"},this.helperLabel))]}};p.style=":host{animation:display-tooltip 0.2s ease;display:flex;border-radius:0.25rem;padding:0.25rem 0.5rem;background-color:rgb(var(--contrast-1300));box-shadow:var(--shadow-depth-16)}text{font-size:0.875rem;line-height:1.25;display:flex;column-gap:1rem}text.has-column-layout{display:table-cell;width:fit-content;max-width:min(var(--tooltip-max-width-of-text), 80vw)}text.has-column-layout .label{padding-bottom:0.5rem}text.has-column-layout .helper-label{padding-bottom:0.25rem}.label{color:rgb(var(--contrast-200))}.helper-label{color:rgb(var(--contrast-800))}.helper-label:empty{display:none}@keyframes display-tooltip{0%{opacity:0;transform:translate3d(0, 0, 0) scale(0.94)}100%{opacity:1;transform:translate3d(0, 0, 0) scale(1)}}";export{n as limel_popover,c as limel_popover_surface,h as limel_tooltip,p as limel_tooltip_content}
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as s,g as e}from"./p-d4e788e1.js";import{c as o}from"./p-6c094f3f.js";import{z as r}from"./p-7cda574b.js";import"./p-b28128d2.js";import"./p-5fdb83c9.js";import"./p-4c3358cb.js";import"./p-eda23c05.js";import"./p-c93050d6.js";const n=class{constructor(e){t(this,e),this.cancel=i(this,"cancel",7),this.select=i(this,"select",7),this.setTriggerAttributes=t=>{const i={"aria-haspopup":!0,"aria-expanded":this.open,disabled:this.disabled,role:"button"};for(const[s,e]of Object.entries(i))e?t.setAttribute(s,String(e)):t.removeAttribute(s)},this.onClose=()=>{this.cancel.emit(),this.open=!1},this.onTriggerClick=t=>{t.stopPropagation(),this.disabled||(this.open=!this.open)},this.handleSelect=t=>{t.stopPropagation(),this.select.emit(t.detail),this.open=!1},this.setListElement=t=>{this.list=t},this.focusMenuItem=()=>{var t;const i=this.list.shadowRoot.activeElement;null==i||i.blur();const s=this.items.filter(this.isMenuItem),e=Math.max(s.findIndex((t=>t.selected)),0);null===(t=Array.from(this.list.shadowRoot.querySelectorAll('[role="menuitem"]'))[e])||void 0===t||t.focus()},this.renderNotificationBadge=()=>{if(this.items.some(this.hasNotificationBadge))return s("limel-badge",null)},this.hasNotificationBadge=t=>this.isMenuItem(t)&&void 0!==t.badge,this.items=[],this.disabled=!1,this.openDirection="bottom-start",this.open=!1,this.badgeIcons=!1,this.gridLayout=!1,this.portalId=o()}openWatcher(){if(!this.open)return;const t=new IntersectionObserver((()=>{t.unobserve(this.list),this.focusMenuItem()}));t.observe(this.list)}render(){const t=this.getCssProperties(),i=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index");return s("div",{class:"mdc-menu-surface--anchor",onClick:this.onTriggerClick},s("slot",{name:"trigger"}),this.renderNotificationBadge(),s("limel-portal",{visible:this.open,containerId:this.portalId,openDirection:this.openDirection,position:"absolute",containerStyle:{"z-index":i}},s("limel-menu-surface",{open:this.open,onDismiss:this.onClose,style:t,class:{"has-grid-layout":this.gridLayout}},s("limel-menu-list",{class:{"has-grid-layout has-interactive-items":this.gridLayout},items:this.items,type:"menu",badgeIcons:this.badgeIcons,onSelect:this.handleSelect,ref:this.setListElement}))))}componentDidRender(){this.host.shadowRoot.querySelector("slot").assignedElements().forEach(this.setTriggerAttributes)}getCssProperties(){const t=["--menu-surface-width","--list-grid-item-max-width","--list-grid-item-min-width","--list-grid-gap","--notification-badge-background-color","--notification-badge-text-color"],i=getComputedStyle(this.host),s=t.map((t=>i.getPropertyValue(t)));return r(t,s)}isMenuItem(t){return!("separator"in t)}get host(){return e(this)}static get watchers(){return{open:["openWatcher"]}}};n.style=":host(limel-menu){isolation:isolate;position:relative;display:inline-block;--badge-background-color:var(\n --notification-badge-background-color,\n rgb(var(--color-red-default))\n );--badge-text-color:var(\n --notification-badge-text-color,\n rgb(var(--color-white))\n )}:host([hidden]){display:none}.menu__trigger{border-color:transparent;border-width:1px;border-style:solid;background:none;color:rgb(var(--contrast-800));height:2.25rem}.menu__trigger-enabled:hover{border-color:rgb(var(--contrast-800));color:rgb(var(--contrast-1100))}.mdc-menu-surface--anchor{position:relative}limel-badge{position:absolute;top:-0.25rem;right:-0.25rem}";export{n as limel_menu}