@descope/web-components-ui 1.0.348 → 1.0.350

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. package/dist/cjs/index.cjs.js +183 -3
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +831 -610
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/1612.js +116 -4
  6. package/dist/umd/3227.js +17 -0
  7. package/dist/umd/4024.js +116 -4
  8. package/dist/umd/4028.js +121 -9
  9. package/dist/umd/4052.js +116 -4
  10. package/dist/umd/4978.js +1 -1
  11. package/dist/umd/5135.js +2 -2
  12. package/dist/umd/602.js +114 -2
  13. package/dist/umd/9562.js +116 -4
  14. package/dist/umd/DescopeDev.js +1 -1
  15. package/dist/umd/descope-button-index-js.js +116 -4
  16. package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js +3 -3
  17. package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js +90 -0
  18. package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js.LICENSE.txt +17 -0
  19. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +1 -1
  20. package/dist/umd/descope-grid-index-js.js +1 -1
  21. package/dist/umd/index.js +1 -1
  22. package/package.json +1 -1
  23. package/src/components/descope-grid/GridClass.js +115 -6
  24. package/src/components/descope-grid/descope-grid-item-details-column/GridItemDetailsColumnClass.js +37 -0
  25. package/src/components/descope-grid/descope-grid-item-details-column/index.js +8 -0
  26. package/src/components/descope-grid/helpers.js +54 -0
  27. package/src/components/descope-grid/index.js +2 -0
  28. package/src/helpers/index.js +8 -0
  29. package/src/theme/components/grid.js +11 -0
  30. package/dist/umd/2362.js +0 -129
  31. /package/dist/umd/{2362.js.LICENSE.txt → 3227.js.LICENSE.txt} +0 -0
@@ -1,13 +1,13 @@
1
1
  import { compose } from '../../helpers';
2
2
  import { getComponentName } from '../../helpers/componentHelpers';
3
3
  import {
4
+ componentNameValidationMixin,
5
+ createProxy,
4
6
  createStyleMixin,
5
7
  draggableMixin,
6
- createProxy,
7
- componentNameValidationMixin,
8
8
  } from '../../mixins';
9
9
 
10
- import { isValidDataType } from './helpers';
10
+ import { defaultRowDetailsRenderer, isValidDataType } from './helpers';
11
11
 
12
12
  export const componentName = getComponentName('grid');
13
13
 
@@ -22,6 +22,40 @@ const GridMixin = (superclass) =>
22
22
 
23
23
  // disable the grid sort
24
24
  this.baseElement._mapSorters = () => {};
25
+
26
+ this.baseElement.rowDetailsRenderer = this.#rowDetailsRenderer.bind(this);
27
+ }
28
+
29
+ // this renders the details panel content
30
+ // in order to open it, the descope-grid-item-details-column should be used
31
+ #rowDetailsRenderer = async (cell, _col, model) => {
32
+ // prevent details panel from being scrolled into view when clicked
33
+ cell.addEventListener('mousedown', (e) => e.stopImmediatePropagation(), true);
34
+
35
+ const template = this.getRowDetailsTemplate(model.item);
36
+
37
+ // eslint-disable-next-line no-param-reassign
38
+ cell.innerHTML = '';
39
+ cell.append(template.content.cloneNode(true));
40
+ };
41
+
42
+ getRowDetailsTemplate(item) {
43
+ const itemLabelsMapping = this.#columns.reduce(
44
+ (acc, { path, header }) => (!path || !header ? acc : { ...acc, [path]: header }),
45
+ {}
46
+ );
47
+ const template =
48
+ this.rowDetailsRenderer?.(item, itemLabelsMapping) ??
49
+ defaultRowDetailsRenderer(item, itemLabelsMapping);
50
+
51
+ switch (true) {
52
+ case template instanceof HTMLTemplateElement:
53
+ return template;
54
+ case typeof template === 'string':
55
+ return Object.assign(document.createElement('template'), { innerHTML: template });
56
+ default:
57
+ throw new Error('rowDetailsRenderer should return a string or a template');
58
+ }
25
59
  }
26
60
 
27
61
  forwardSelectedItemsChange() {
@@ -115,9 +149,20 @@ const GridMixin = (superclass) =>
115
149
  );
116
150
  }
117
151
 
152
+ // there is an issue in vaadin-grid, when rowDetailsRenderer is set, it renders an empty details panel
153
+ reassignRowDetailsRenderer() {
154
+ this.baseElement.rowDetailsRenderer = null;
155
+ setTimeout(() => {
156
+ this.baseElement.rowDetailsRenderer = this.#rowDetailsRenderer.bind(this);
157
+ }, 0);
158
+ }
159
+
118
160
  renderColumns() {
119
161
  const template = this.getColumnsTemplate();
120
- if (template) this.innerHTML = template;
162
+ if (template) {
163
+ this.reassignRowDetailsRenderer();
164
+ this.innerHTML = template;
165
+ }
121
166
  }
122
167
 
123
168
  get grid() {
@@ -179,17 +224,35 @@ const {
179
224
  selectedRow,
180
225
  rowSeparator,
181
226
  resizeHandle,
227
+ toggleDetailsPanelButton,
228
+ toggleDetailsPanelButtonOpened,
229
+ toggleDetailsPanelButtonClosed,
230
+ detailsPanel,
231
+ detailsPanelLabels,
232
+ selectedRowCell,
233
+ detailsPanelContent,
182
234
  } = {
183
235
  host: { selector: () => 'vaadin-grid' },
184
236
  headerRow: { selector: () => '::part(header-cell)' },
185
237
  headerRowCell: { selector: () => 'vaadin-grid::part(header-cell)' },
186
238
  contentRow: { selector: () => '::part(cell)' },
187
239
  firstRow: { selector: () => '::part(first-header-row-cell)' },
188
- selectedRow: { selector: () => '::part(selected-row-cell)' },
240
+ selectedRow: { selector: () => '::part(selected-row)' },
241
+ selectedRowCell: { selector: () => '::part(selected-row-cell)' },
189
242
  sortIndicators: { selector: () => 'vaadin-grid-sorter::part(indicators)' },
190
243
  activeSortIndicator: { selector: () => 'vaadin-grid-sorter[direction]' },
191
244
  rowSeparator: { selector: () => 'vaadin-grid::part(body-cell)' },
192
245
  resizeHandle: { selector: () => '::part(resize-handle)' },
246
+ toggleDetailsPanelButton: { selector: () => 'vaadin-grid vaadin-icon.toggle-details-button' },
247
+ toggleDetailsPanelButtonOpened: {
248
+ selector: () => 'vaadin-grid vaadin-icon.toggle-details-button.opened',
249
+ },
250
+ toggleDetailsPanelButtonClosed: {
251
+ selector: () => 'vaadin-grid vaadin-icon.toggle-details-button.closed',
252
+ },
253
+ detailsPanel: { selector: () => 'vaadin-grid::part(details-cell)' },
254
+ detailsPanelLabels: { selector: () => 'vaadin-grid .row-details__label' },
255
+ detailsPanelContent: { selector: () => 'vaadin-grid .row-details' },
193
256
  };
194
257
 
195
258
  export const GridClass = compose(
@@ -213,7 +276,10 @@ export const GridClass = compose(
213
276
  borderWidth: { ...host, property: 'border-width' },
214
277
  borderStyle: { ...host, property: 'border-style' },
215
278
  borderRadius: { ...host, property: 'border-radius' },
216
- selectedBackgroundColor: { ...selectedRow, property: 'background-color' },
279
+ selectedBackgroundColor: [
280
+ { ...selectedRow, property: 'background-color' },
281
+ { ...selectedRowCell, property: 'background-color' },
282
+ ],
217
283
  headerRowTextColor: { ...headerRowCell, property: 'color' },
218
284
  separatorColor: [
219
285
  { ...firstRow, property: 'border-bottom-color' },
@@ -221,6 +287,19 @@ export const GridClass = compose(
221
287
  ],
222
288
  resizeHandleColor: { ...resizeHandle, property: 'background-color' },
223
289
  hostDirection: { ...host, property: 'direction', fallback: 'ltr' },
290
+ toggleDetailsPanelButtonSize: [
291
+ { ...toggleDetailsPanelButton, property: 'width' },
292
+ { ...toggleDetailsPanelButton, property: 'height' },
293
+ ],
294
+ toggleDetailsPanelButtonOpenedColor: { ...toggleDetailsPanelButtonOpened, property: 'color' },
295
+ toggleDetailsPanelButtonClosedColor: { ...toggleDetailsPanelButtonClosed, property: 'color' },
296
+ toggleDetailsPanelButtonCursor: { ...toggleDetailsPanelButton, property: 'cursor' },
297
+ detailsPanelBackgroundColor: { ...detailsPanel, property: 'background-color' },
298
+ detailsPanelBorderTopColor: { ...detailsPanel, property: 'border-top-color' },
299
+ detailsPanelLabelsColor: { ...detailsPanelLabels, property: 'color' },
300
+ detailsPanelLabelsFontSize: { ...detailsPanelLabels, property: 'font-size' },
301
+ detailsPanelItemsGap: { ...detailsPanelContent, property: 'grid-gap' },
302
+ detailsPanelPadding: { ...detailsPanelContent, property: 'padding' },
224
303
  },
225
304
  }),
226
305
  draggableMixin,
@@ -232,6 +311,7 @@ export const GridClass = compose(
232
311
  slots: [''],
233
312
  wrappedEleName: 'vaadin-grid',
234
313
  style: () => `
314
+ /*css*/
235
315
  vaadin-grid {
236
316
  overflow: hidden;
237
317
  height: 100%;
@@ -243,7 +323,36 @@ export const GridClass = compose(
243
323
  vaadin-grid::part(selected-row-cell) {
244
324
  background-image: none;
245
325
  box-shadow: none;
326
+ background-color: inherit;
327
+ }
328
+ vaadin-grid::part(details-cell) {
329
+ border-top-style: dashed;
330
+ border-top-width: 1px;
331
+ }
332
+ vaadin-grid .row-details {
333
+ display: grid;
334
+ grid-template-columns: repeat(auto-fit, minmax(max(200px, calc(100%/4 - var(${GridClass.cssVarList.detailsPanelItemsGap}))), 1fr));
335
+ width: 100%;
336
+ }
337
+ vaadin-grid .row-details__item:has(.row-details__value.json) {
338
+ grid-column: 1 / -1;
339
+ order: 2;
340
+ }
341
+ vaadin-grid .row-details__value.text {
342
+ overflow: hidden;
343
+ text-overflow: ellipsis;
344
+ white-space: pre;
345
+ }
346
+ vaadin-grid .row-details__value.json {
347
+ margin-top: 5px;
348
+ max-height: 120px;
349
+ overflow: scroll;
350
+ font-size: 0.85em;
351
+ }
352
+ vaadin-grid vaadin-icon.toggle-details-button {
353
+ margin: auto;
246
354
  }
355
+ /*!css*/
247
356
  `,
248
357
  excludeAttrsSync: ['columns', 'tabindex'],
249
358
  componentName,
@@ -0,0 +1,37 @@
1
+ /* eslint-disable no-param-reassign */
2
+ import { GridSortColumn } from '@vaadin/grid/vaadin-grid-sort-column';
3
+
4
+ export class GridItemDetailsColumnClass extends GridSortColumn {
5
+ get sortable() {
6
+ return this.getAttribute('sortable') === 'true';
7
+ }
8
+
9
+ // eslint-disable-next-line class-methods-use-this
10
+ _defaultRenderer(cell, _col, model) {
11
+ const grid = _col._gridValue;
12
+ const itemIdx = grid.detailsOpenedItems?.indexOf(model.item) ?? -1;
13
+ const isOpened = itemIdx !== -1;
14
+
15
+ const toggleIcon = document.createElement('vaadin-icon');
16
+ toggleIcon.icon = isOpened ? 'vaadin:angle-up' : 'vaadin:angle-down';
17
+ toggleIcon.classList.add('toggle-details-button', isOpened ? 'opened' : 'closed');
18
+ cell.innerHTML = '';
19
+ cell.append(toggleIcon);
20
+
21
+ toggleIcon.onclick = () => {
22
+ grid.detailsOpenedItems = isOpened
23
+ ? grid.detailsOpenedItems.toSpliced(itemIdx, 1)
24
+ : [...grid.detailsOpenedItems, model.item];
25
+ };
26
+ }
27
+
28
+ _defaultHeaderRenderer(root, _column) {
29
+ if (this.sortable) {
30
+ super._defaultHeaderRenderer(root, _column);
31
+
32
+ return;
33
+ }
34
+
35
+ this.__setTextContent(root, this.__getHeader(this.header, this.path));
36
+ }
37
+ }
@@ -0,0 +1,8 @@
1
+ import { getComponentName } from '../../../helpers/componentHelpers';
2
+ import { GridItemDetailsColumnClass } from './GridItemDetailsColumnClass';
3
+ import '@vaadin/icon';
4
+ import '@vaadin/icons';
5
+
6
+ export const componentName = getComponentName('grid-item-details-column');
7
+
8
+ customElements.define(componentName, GridItemDetailsColumnClass);
@@ -1,3 +1,5 @@
1
+ import { toTitle } from '../../helpers';
2
+
1
3
  export const isValidDataType = (data) => {
2
4
  const isValid = Array.isArray(data);
3
5
  if (!isValid) {
@@ -7,3 +9,55 @@ export const isValidDataType = (data) => {
7
9
 
8
10
  return isValid;
9
11
  };
12
+
13
+ export const isPlainObject = (value) => value?.constructor === Object;
14
+
15
+ export const getValueType = (value) => {
16
+ if (isPlainObject(value)) return 'object';
17
+ if (Array.isArray(value)) return 'array';
18
+
19
+ return 'text';
20
+ };
21
+
22
+ export const renderCodeSnippet = (value) =>
23
+ `<descope-code-snippet lang="json" class="row-details__value json">${JSON.stringify(
24
+ value,
25
+ null,
26
+ 2
27
+ )}</descope-code-snippet>`;
28
+
29
+ export const renderText = (text) =>
30
+ `<div class="row-details__value text" title="${text}">${text}</div>`;
31
+
32
+ const defaultRowDetailsValueRenderer = (value) => {
33
+ const valueType = getValueType(value);
34
+
35
+ if (valueType === 'object') {
36
+ return renderCodeSnippet(value);
37
+ }
38
+
39
+ if (valueType === 'array') {
40
+ if (value.some((v) => getValueType(v) === 'object')) {
41
+ return renderCodeSnippet(value);
42
+ }
43
+ return renderText(value.join(',\n'));
44
+ }
45
+
46
+ return renderText(value);
47
+ };
48
+
49
+ export const defaultRowDetailsRenderer = (item, itemLabelsMapping) => {
50
+ return `
51
+ <div class="row-details">
52
+ ${Object.entries(item)
53
+ .map(
54
+ ([key, value]) =>
55
+ `<div class="row-details__item" >
56
+ <div class="row-details__label">${itemLabelsMapping[key] || toTitle(key)}</div>
57
+ ${defaultRowDetailsValueRenderer(value)}
58
+ </div>`
59
+ )
60
+ .join('\n')}
61
+ </div>
62
+ `;
63
+ };
@@ -2,6 +2,8 @@ import '@vaadin/grid';
2
2
  import './descope-grid-text-column';
3
3
  import './descope-grid-custom-column';
4
4
  import './descope-grid-selection-column';
5
+ import './descope-grid-item-details-column';
6
+ import '../descope-code-snippet'; // this is needed for the details panel
5
7
 
6
8
  import { componentName, GridClass } from './GridClass';
7
9
 
@@ -52,3 +52,11 @@ export const compareArraysUnordered = (arr1, arr2) => {
52
52
 
53
53
  return true;
54
54
  };
55
+
56
+ export const toTitle = (str) =>
57
+ str
58
+ .replace(/([A-Z])/g, ' $1')
59
+ .trim()
60
+ .split(' ')
61
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
62
+ .join(' ');
@@ -32,6 +32,17 @@ export const grid = {
32
32
  [vars.selectedBackgroundColor]: globalRefs.colors.surface.highlight,
33
33
  [vars.hostDirection]: globalRefs.direction,
34
34
 
35
+ [vars.toggleDetailsPanelButtonSize]: '1em',
36
+ [vars.toggleDetailsPanelButtonOpenedColor]: globalRefs.colors.surface.contrast,
37
+ [vars.toggleDetailsPanelButtonClosedColor]: globalRefs.colors.surface.light,
38
+ [vars.toggleDetailsPanelButtonCursor]: 'pointer',
39
+ [vars.detailsPanelBackgroundColor]: globalRefs.colors.surface.highlight,
40
+ [vars.detailsPanelBorderTopColor]: globalRefs.colors.surface.light,
41
+ [vars.detailsPanelLabelsColor]: globalRefs.colors.surface.dark,
42
+ [vars.detailsPanelLabelsFontSize]: '0.8em',
43
+ [vars.detailsPanelItemsGap]: '2em',
44
+ [vars.detailsPanelPadding]: '12px 0',
45
+
35
46
  _bordered: {
36
47
  [vars.borderColor]: refs.borderColor,
37
48
  },
package/dist/umd/2362.js DELETED
@@ -1,129 +0,0 @@
1
- /*! For license information please see 2362.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2362],{21360:(t,e,o)=>{o.d(e,{W:()=>n});var s=o(91014),i=o(3550);const n=(0,s.o)((t=>class extends t{get _keyboardActive(){return(0,i.LQ)()}ready(){this.addEventListener("focusin",(t=>{this._shouldSetFocus(t)&&this._setFocused(!0)})),this.addEventListener("focusout",(t=>{this._shouldRemoveFocus(t)&&this._setFocused(!1)})),super.ready()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("focused")&&this._setFocused(!1)}_setFocused(t){this.toggleAttribute("focused",t),this.toggleAttribute("focus-ring",t&&this._keyboardActive)}_shouldSetFocus(t){return!0}_shouldRemoveFocus(t){return!0}}))},3550:(t,e,o)=>{o.d(e,{GF:()=>r,GO:()=>u,Gf:()=>i,LQ:()=>n,Qw:()=>a});let s=!1;function i(){let t=document.activeElement||document.body;for(;t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function n(){return s}function d(t){const e=t.style;if("hidden"===e.visibility||"none"===e.display)return!0;const o=window.getComputedStyle(t);return"hidden"===o.visibility||"none"===o.display}function l(t,e){const o=Math.max(t.tabIndex,0),s=Math.max(e.tabIndex,0);return 0===o||0===s?s>o:o>s}function h(t){const e=t.length;if(e<2)return t;const o=Math.ceil(e/2);return function(t,e){const o=[];for(;t.length>0&&e.length>0;)l(t[0],e[0])?o.push(e.shift()):o.push(t.shift());return o.concat(t,e)}(h(t.slice(0,o)),h(t.slice(o)))}function r(t){return null===t.offsetParent&&0===t.clientWidth&&0===t.clientHeight||d(t)}function a(t){return t.getRootNode().activeElement===t}function c(t,e){if(t.nodeType!==Node.ELEMENT_NODE||d(t))return!1;const o=t,s=function(t){if(!function(t){return!t.matches('[tabindex="-1"]')&&(t.matches("input, select, textarea, button, object")?t.matches(":not([disabled])"):t.matches("a[href], area[href], iframe, [tabindex], [contentEditable]"))}(t))return-1;const e=t.getAttribute("tabindex")||0;return Number(e)}(o);let i=s>0;s>=0&&e.push(o);let n=[];return n="slot"===o.localName?o.assignedNodes({flatten:!0}):(o.shadowRoot||o).children,[...n].forEach((t=>{i=c(t,e)||i})),i}function u(t){const e=[];return c(t,e)?h(e):e}window.addEventListener("keydown",(()=>{s=!0}),{capture:!0}),window.addEventListener("mousedown",(()=>{s=!1}),{capture:!0})},16155:(t,e,o)=>{o.d(e,{k:()=>s});const s=(0,o(91014).o)((t=>"function"==typeof t.prototype.addController?t:class extends t{constructor(){super(),this.__controllers=new Set}connectedCallback(){super.connectedCallback(),this.__controllers.forEach((t=>{t.hostConnected&&t.hostConnected()}))}disconnectedCallback(){super.disconnectedCallback(),this.__controllers.forEach((t=>{t.hostDisconnected&&t.hostDisconnected()}))}addController(t){this.__controllers.add(t),void 0!==this.$&&this.isConnected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers.delete(t)}}))},63726:(t,e,o)=>{function s(t){const e=[];for(;t;){if(t.nodeType===Node.DOCUMENT_NODE){e.push(t);break}t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?t=t.assignedSlot?t.assignedSlot:t.parentNode:(e.push(t),t=t.host)}return e}function i(t){const e=[];let o;return"slot"===t.localName?o=t.assignedElements():(e.push(t),o=[...t.children]),o.forEach((t=>e.push(...i(t)))),e}function n(t,e){return e?e.closest(t)||n(t,e.getRootNode().host):null}function d(t){return t?new Set(t.split(" ")):new Set}function l(t){return t?[...t].join(" "):""}function h(t,e,o){const s=d(t.getAttribute(e));s.add(o),t.setAttribute(e,l(s))}function r(t,e,o){const s=d(t.getAttribute(e));s.delete(o),0!==s.size?t.setAttribute(e,l(s)):t.removeAttribute(e)}function a(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}o.d(e,{$2:()=>h,AD:()=>s,Q4:()=>n,dV:()=>l,eC:()=>a,hK:()=>d,xX:()=>i,x_:()=>r})},12521:(t,e,o)=>{o.d(e,{S:()=>r});var s=o(89387),i=o(87913),n=o(36139),d=o(51914);let l;(0,s.xj)(!1),window.Vaadin||(window.Vaadin={}),window.Vaadin.registrations||(window.Vaadin.registrations=[]),window.Vaadin.developmentModeCallback||(window.Vaadin.developmentModeCallback={}),window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]=function(){};const h=new Set,r=t=>class extends((0,d.U)(t)){static finalize(){super.finalize();const{is:t}=this;t&&!h.has(t)&&(window.Vaadin.registrations.push(this),h.add(t),window.Vaadin.developmentModeCallback&&(l=n.dx.debounce(l,i.t$,(()=>{window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]()})),(0,n.Ex)(l)))}constructor(){super(),null===document.doctype&&console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.')}}},78591:(t,e,o)=>{o.d(e,{n:()=>d});var s=o(63726),i=o(44932),n=o(73971);class d extends EventTarget{static generateId(t,e){return`${e||"default"}-${t.localName}-${(0,n.l)()}`}constructor(t,e,o,s={}){super();const{initializer:i,multiple:n,observe:d,useUniqueId:l}=s;this.host=t,this.slotName=e,this.tagName=o,this.observe="boolean"!=typeof d||d,this.multiple="boolean"==typeof n&&n,this.slotInitializer=i,n&&(this.nodes=[]),l&&(this.defaultId=this.constructor.generateId(t,e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach((t=>{this.initAddedNode(t)}))}attachDefaultNode(){const{host:t,slotName:e,tagName:o}=this;let s=this.defaultNode;return!s&&o&&(s=document.createElement(o),s instanceof Element&&(""!==e&&s.setAttribute("slot",e),this.node=s,this.defaultNode=s)),s&&t.appendChild(s),s}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter((e=>e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t))}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,o=this.host.shadowRoot.querySelector(e);this.__slotObserver=new i.K(o,(({addedNodes:t,removedNodes:e})=>{const o=this.multiple?this.nodes:[this.node],i=t.filter((t=>!(0,s.eC)(t)&&!o.includes(t)));e.length&&(this.nodes=o.filter((t=>!e.includes(t))),e.forEach((t=>{this.teardownNode(t)}))),i&&i.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...o,...i].filter((t=>t!==this.defaultNode)),i.forEach((t=>{this.initAddedNode(t)}))):(this.node&&this.node.remove(),this.node=i[0],this.initAddedNode(this.node)))}))}}},44932:(t,e,o)=>{o.d(e,{K:()=>s});class s{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask((()=>{this.flush()})))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const o=[],s=[];t.length&&(e=t.filter((t=>!this._storedNodes.includes(t)))),this._storedNodes.length&&this._storedNodes.forEach(((e,i)=>{const n=t.indexOf(e);-1===n?o.push(e):n!==i&&s.push(e)})),(e.length||o.length||s.length)&&this.callback({addedNodes:e,movedNodes:s,removedNodes:o}),this._storedNodes=t}}},34463:(t,e,o)=>{o.d(e,{f:()=>i});var s=o(78591);class i extends s.n{constructor(t){super(t,"tooltip"),this.setTarget(t)}initCustomNode(t){t.target=this.target,void 0!==this.ariaTarget&&(t.ariaTarget=this.ariaTarget),void 0!==this.context&&(t.context=this.context),void 0!==this.manual&&(t.manual=this.manual),void 0!==this.opened&&(t.opened=this.opened),void 0!==this.position&&(t._position=this.position),void 0!==this.shouldShow&&(t.shouldShow=this.shouldShow),this.__notifyChange()}teardownNode(){this.__notifyChange()}setAriaTarget(t){this.ariaTarget=t;const e=this.node;e&&(e.ariaTarget=t)}setContext(t){this.context=t;const e=this.node;e&&(e.context=t)}setManual(t){this.manual=t;const e=this.node;e&&(e.manual=t)}setOpened(t){this.opened=t;const e=this.node;e&&(e.opened=t)}setPosition(t){this.position=t;const e=this.node;e&&(e._position=t)}setShouldShow(t){this.shouldShow=t;const e=this.node;e&&(e.shouldShow=t)}setTarget(t){this.target=t;const e=this.node;e&&(e.target=t)}__notifyChange(){this.dispatchEvent(new CustomEvent("tooltip-changed",{detail:{node:this.node}}))}}},73971:(t,e,o)=>{o.d(e,{l:()=>i});let s=0;function i(){return s++}},79098:(t,e,o)=>{o(24407);var s=o(46570),i=o(32463);const n=s.iv`
3
- :host {
4
- --lumo-size-xs: 1.625rem;
5
- --lumo-size-s: 1.875rem;
6
- --lumo-size-m: 2.25rem;
7
- --lumo-size-l: 2.75rem;
8
- --lumo-size-xl: 3.5rem;
9
-
10
- /* Icons */
11
- --lumo-icon-size-s: 1.25em;
12
- --lumo-icon-size-m: 1.5em;
13
- --lumo-icon-size-l: 2.25em;
14
- /* For backwards compatibility */
15
- --lumo-icon-size: var(--lumo-icon-size-m);
16
- }
17
- `;(0,i.K)("sizing-props",n)},34173:(t,e,o)=>{o(24407);var s=o(46570),i=o(32463);const n=s.iv`
18
- :host {
19
- /* prettier-ignore */
20
- --lumo-font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
21
-
22
- /* Font sizes */
23
- --lumo-font-size-xxs: 0.75rem;
24
- --lumo-font-size-xs: 0.8125rem;
25
- --lumo-font-size-s: 0.875rem;
26
- --lumo-font-size-m: 1rem;
27
- --lumo-font-size-l: 1.125rem;
28
- --lumo-font-size-xl: 1.375rem;
29
- --lumo-font-size-xxl: 1.75rem;
30
- --lumo-font-size-xxxl: 2.5rem;
31
-
32
- /* Line heights */
33
- --lumo-line-height-xs: 1.25;
34
- --lumo-line-height-s: 1.375;
35
- --lumo-line-height-m: 1.625;
36
- }
37
- `,d=s.iv`
38
- body,
39
- :host {
40
- font-family: var(--lumo-font-family);
41
- font-size: var(--lumo-font-size-m);
42
- line-height: var(--lumo-line-height-m);
43
- -webkit-text-size-adjust: 100%;
44
- -webkit-font-smoothing: antialiased;
45
- -moz-osx-font-smoothing: grayscale;
46
- }
47
-
48
- small,
49
- [theme~='font-size-s'] {
50
- font-size: var(--lumo-font-size-s);
51
- line-height: var(--lumo-line-height-s);
52
- }
53
-
54
- [theme~='font-size-xs'] {
55
- font-size: var(--lumo-font-size-xs);
56
- line-height: var(--lumo-line-height-xs);
57
- }
58
-
59
- :where(h1, h2, h3, h4, h5, h6) {
60
- font-weight: 600;
61
- line-height: var(--lumo-line-height-xs);
62
- margin-block: 0;
63
- }
64
-
65
- :where(h1) {
66
- font-size: var(--lumo-font-size-xxxl);
67
- }
68
-
69
- :where(h2) {
70
- font-size: var(--lumo-font-size-xxl);
71
- }
72
-
73
- :where(h3) {
74
- font-size: var(--lumo-font-size-xl);
75
- }
76
-
77
- :where(h4) {
78
- font-size: var(--lumo-font-size-l);
79
- }
80
-
81
- :where(h5) {
82
- font-size: var(--lumo-font-size-m);
83
- }
84
-
85
- :where(h6) {
86
- font-size: var(--lumo-font-size-xs);
87
- text-transform: uppercase;
88
- letter-spacing: 0.03em;
89
- }
90
-
91
- p,
92
- blockquote {
93
- margin-top: 0.5em;
94
- margin-bottom: 0.75em;
95
- }
96
-
97
- a {
98
- text-decoration: none;
99
- }
100
-
101
- a:where(:any-link):hover {
102
- text-decoration: underline;
103
- }
104
-
105
- hr {
106
- display: block;
107
- align-self: stretch;
108
- height: 1px;
109
- border: 0;
110
- padding: 0;
111
- margin: var(--lumo-space-s) calc(var(--lumo-border-radius-m) / 2);
112
- background-color: var(--lumo-contrast-10pct);
113
- }
114
-
115
- blockquote {
116
- border-left: 2px solid var(--lumo-contrast-30pct);
117
- }
118
-
119
- b,
120
- strong {
121
- font-weight: 600;
122
- }
123
-
124
- /* RTL specific styles */
125
- blockquote[dir='rtl'] {
126
- border-left: none;
127
- border-right: 2px solid var(--lumo-contrast-30pct);
128
- }
129
- `;(0,s.hC)("",d,{moduleId:"lumo-typography"}),(0,i.K)("typography-props",n)}}]);