@momentum-design/components 0.28.4 → 0.28.6

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.
@@ -9518,6 +9518,124 @@
9518
9518
  }
9519
9519
  ]
9520
9520
  },
9521
+ {
9522
+ "kind": "javascript-module",
9523
+ "path": "components/themeprovider/themeprovider.component.js",
9524
+ "declarations": [
9525
+ {
9526
+ "kind": "class",
9527
+ "description": "ThemeProvider component, which sets the passed in themeclass as class.\nIf the themeclass switches, the existing themeclass will be removed as a class\nand the new themeclass will be added.\n\nCSS variables defined in the themeclass will be used for the styling of child dom nodes.\n\nThemeclass context can be be consumed from Lit child components\n(see providerUtils.consume for how to consume)\n\nThemeProvider also includes basic font defaults for text.",
9528
+ "name": "ThemeProvider",
9529
+ "cssProperties": [
9530
+ {
9531
+ "description": "Option to override the default color, default: color-theme-text-primary-normal",
9532
+ "name": "--mdc-themeprovider-color-default"
9533
+ },
9534
+ {
9535
+ "description": "Option to override the font family, default: `Momentum` (from momentum-design/fonts)",
9536
+ "name": "--mdc-themeprovider-font-family"
9537
+ },
9538
+ {
9539
+ "description": "Option to override the font weight, default: `400`",
9540
+ "name": "--mdc-themeprovider-font-weight"
9541
+ },
9542
+ {
9543
+ "description": "Option to override the default letter-spacing, default: `-0.25px` (this is to match the old CiscoSans)",
9544
+ "name": "--mdc-themeprovider-letter-spacing-adjustment"
9545
+ },
9546
+ {
9547
+ "description": "Option to override the font feature settings, default: `\"ss02\" on`",
9548
+ "name": "--mdc-themeprovider-font-feature-settings"
9549
+ },
9550
+ {
9551
+ "description": "Option to override the color of the scrollbar track.",
9552
+ "name": "--mdc-themeprovider-scrollbar-track-color"
9553
+ },
9554
+ {
9555
+ "description": "Option to override the color of the scrollbar thumb.",
9556
+ "name": "--mdc-themeprovider-scrollbar-thumb-color"
9557
+ },
9558
+ {
9559
+ "description": "Option to override the color of the scrollbar thumb on hover. Applicable only on webkit browsers.",
9560
+ "name": "--mdc-themeprovider-scrollbar-thumb-hover-color"
9561
+ },
9562
+ {
9563
+ "description": "Option to override the color of the scrollbar thumb on press. Applicable only on webkit browsers.",
9564
+ "name": "--mdc-themeprovider-scrollbar-thumb-active-color"
9565
+ }
9566
+ ],
9567
+ "slots": [
9568
+ {
9569
+ "description": "children",
9570
+ "name": ""
9571
+ }
9572
+ ],
9573
+ "members": [
9574
+ {
9575
+ "kind": "field",
9576
+ "name": "Context",
9577
+ "privacy": "public",
9578
+ "static": true,
9579
+ "description": "Context object of the ThemeProvider, to be consumed by child components",
9580
+ "readonly": true
9581
+ },
9582
+ {
9583
+ "kind": "field",
9584
+ "name": "themeclass",
9585
+ "type": {
9586
+ "text": "string"
9587
+ },
9588
+ "description": "Current theme class\n\nHas to be fully qualified, such that\nthe theme class matches the class of the respective\ntheme stylesheet\n\nDefault: 'mds-theme-stable-darkWebex'",
9589
+ "attribute": "themeclass"
9590
+ },
9591
+ {
9592
+ "kind": "method",
9593
+ "name": "updateContext",
9594
+ "privacy": "protected",
9595
+ "return": {
9596
+ "type": {
9597
+ "text": "void"
9598
+ }
9599
+ },
9600
+ "description": "Update all observing components of this\nprovider to update the themeclass\n\nIs called on every re-render, see Provider class"
9601
+ },
9602
+ {
9603
+ "kind": "method",
9604
+ "name": "setThemeInClassList",
9605
+ "privacy": "private",
9606
+ "description": "Function to update the active theme classnames to update the theme tokens\nas CSS variables on the web component."
9607
+ }
9608
+ ],
9609
+ "attributes": [
9610
+ {
9611
+ "name": "themeclass",
9612
+ "type": {
9613
+ "text": "string"
9614
+ },
9615
+ "description": "Current theme class\n\nHas to be fully qualified, such that\nthe theme class matches the class of the respective\ntheme stylesheet\n\nDefault: 'mds-theme-stable-darkWebex'",
9616
+ "fieldName": "themeclass"
9617
+ }
9618
+ ],
9619
+ "superclass": {
9620
+ "name": "Provider",
9621
+ "module": "/src/models"
9622
+ },
9623
+ "tagName": "mdc-themeprovider",
9624
+ "jsDoc": "/**\n * ThemeProvider component, which sets the passed in themeclass as class.\n * If the themeclass switches, the existing themeclass will be removed as a class\n * and the new themeclass will be added.\n *\n * CSS variables defined in the themeclass will be used for the styling of child dom nodes.\n *\n * Themeclass context can be be consumed from Lit child components\n * (see providerUtils.consume for how to consume)\n *\n * ThemeProvider also includes basic font defaults for text.\n *\n * @tagname mdc-themeprovider\n *\n * @slot - children\n *\n * @cssproperty --mdc-themeprovider-color-default - Option to override the default color,\n * default: color-theme-text-primary-normal\n * @cssproperty --mdc-themeprovider-font-family - Option to override the font family,\n * default: `Momentum` (from momentum-design/fonts)\n * @cssproperty --mdc-themeprovider-font-weight - Option to override the font weight, default: `400`\n * @cssproperty --mdc-themeprovider-letter-spacing-adjustment - Option to override the default letter-spacing,\n * default: `-0.25px` (this is to match the old CiscoSans)\n * @cssproperty --mdc-themeprovider-font-feature-settings - Option to override the font feature settings,\n * default: `\"ss02\" on`\n * @cssproperty --mdc-themeprovider-scrollbar-track-color - Option to override the color of the scrollbar track.\n * @cssproperty --mdc-themeprovider-scrollbar-thumb-color - Option to override the color of the scrollbar thumb.\n * @cssproperty --mdc-themeprovider-scrollbar-thumb-hover-color - Option to override the color of the\n * scrollbar thumb on hover. Applicable only on webkit browsers.\n * @cssproperty --mdc-themeprovider-scrollbar-thumb-active-color - Option to override the color of the\n * scrollbar thumb on press. Applicable only on webkit browsers.\n */",
9625
+ "customElement": true
9626
+ }
9627
+ ],
9628
+ "exports": [
9629
+ {
9630
+ "kind": "js",
9631
+ "name": "default",
9632
+ "declaration": {
9633
+ "name": "ThemeProvider",
9634
+ "module": "components/themeprovider/themeprovider.component.js"
9635
+ }
9636
+ }
9637
+ ]
9638
+ },
9521
9639
  {
9522
9640
  "kind": "javascript-module",
9523
9641
  "path": "components/toggle/toggle.component.js",
@@ -10201,124 +10319,6 @@
10201
10319
  }
10202
10320
  ]
10203
10321
  },
10204
- {
10205
- "kind": "javascript-module",
10206
- "path": "components/themeprovider/themeprovider.component.js",
10207
- "declarations": [
10208
- {
10209
- "kind": "class",
10210
- "description": "ThemeProvider component, which sets the passed in themeclass as class.\nIf the themeclass switches, the existing themeclass will be removed as a class\nand the new themeclass will be added.\n\nCSS variables defined in the themeclass will be used for the styling of child dom nodes.\n\nThemeclass context can be be consumed from Lit child components\n(see providerUtils.consume for how to consume)\n\nThemeProvider also includes basic font defaults for text.",
10211
- "name": "ThemeProvider",
10212
- "cssProperties": [
10213
- {
10214
- "description": "Option to override the default color, default: color-theme-text-primary-normal",
10215
- "name": "--mdc-themeprovider-color-default"
10216
- },
10217
- {
10218
- "description": "Option to override the font family, default: `Momentum` (from momentum-design/fonts)",
10219
- "name": "--mdc-themeprovider-font-family"
10220
- },
10221
- {
10222
- "description": "Option to override the font weight, default: `400`",
10223
- "name": "--mdc-themeprovider-font-weight"
10224
- },
10225
- {
10226
- "description": "Option to override the default letter-spacing, default: `-0.25px` (this is to match the old CiscoSans)",
10227
- "name": "--mdc-themeprovider-letter-spacing-adjustment"
10228
- },
10229
- {
10230
- "description": "Option to override the font feature settings, default: `\"ss02\" on`",
10231
- "name": "--mdc-themeprovider-font-feature-settings"
10232
- },
10233
- {
10234
- "description": "Option to override the color of the scrollbar track.",
10235
- "name": "--mdc-themeprovider-scrollbar-track-color"
10236
- },
10237
- {
10238
- "description": "Option to override the color of the scrollbar thumb.",
10239
- "name": "--mdc-themeprovider-scrollbar-thumb-color"
10240
- },
10241
- {
10242
- "description": "Option to override the color of the scrollbar thumb on hover. Applicable only on webkit browsers.",
10243
- "name": "--mdc-themeprovider-scrollbar-thumb-hover-color"
10244
- },
10245
- {
10246
- "description": "Option to override the color of the scrollbar thumb on press. Applicable only on webkit browsers.",
10247
- "name": "--mdc-themeprovider-scrollbar-thumb-active-color"
10248
- }
10249
- ],
10250
- "slots": [
10251
- {
10252
- "description": "children",
10253
- "name": ""
10254
- }
10255
- ],
10256
- "members": [
10257
- {
10258
- "kind": "field",
10259
- "name": "Context",
10260
- "privacy": "public",
10261
- "static": true,
10262
- "description": "Context object of the ThemeProvider, to be consumed by child components",
10263
- "readonly": true
10264
- },
10265
- {
10266
- "kind": "field",
10267
- "name": "themeclass",
10268
- "type": {
10269
- "text": "string"
10270
- },
10271
- "description": "Current theme class\n\nHas to be fully qualified, such that\nthe theme class matches the class of the respective\ntheme stylesheet\n\nDefault: 'mds-theme-stable-darkWebex'",
10272
- "attribute": "themeclass"
10273
- },
10274
- {
10275
- "kind": "method",
10276
- "name": "updateContext",
10277
- "privacy": "protected",
10278
- "return": {
10279
- "type": {
10280
- "text": "void"
10281
- }
10282
- },
10283
- "description": "Update all observing components of this\nprovider to update the themeclass\n\nIs called on every re-render, see Provider class"
10284
- },
10285
- {
10286
- "kind": "method",
10287
- "name": "setThemeInClassList",
10288
- "privacy": "private",
10289
- "description": "Function to update the active theme classnames to update the theme tokens\nas CSS variables on the web component."
10290
- }
10291
- ],
10292
- "attributes": [
10293
- {
10294
- "name": "themeclass",
10295
- "type": {
10296
- "text": "string"
10297
- },
10298
- "description": "Current theme class\n\nHas to be fully qualified, such that\nthe theme class matches the class of the respective\ntheme stylesheet\n\nDefault: 'mds-theme-stable-darkWebex'",
10299
- "fieldName": "themeclass"
10300
- }
10301
- ],
10302
- "superclass": {
10303
- "name": "Provider",
10304
- "module": "/src/models"
10305
- },
10306
- "tagName": "mdc-themeprovider",
10307
- "jsDoc": "/**\n * ThemeProvider component, which sets the passed in themeclass as class.\n * If the themeclass switches, the existing themeclass will be removed as a class\n * and the new themeclass will be added.\n *\n * CSS variables defined in the themeclass will be used for the styling of child dom nodes.\n *\n * Themeclass context can be be consumed from Lit child components\n * (see providerUtils.consume for how to consume)\n *\n * ThemeProvider also includes basic font defaults for text.\n *\n * @tagname mdc-themeprovider\n *\n * @slot - children\n *\n * @cssproperty --mdc-themeprovider-color-default - Option to override the default color,\n * default: color-theme-text-primary-normal\n * @cssproperty --mdc-themeprovider-font-family - Option to override the font family,\n * default: `Momentum` (from momentum-design/fonts)\n * @cssproperty --mdc-themeprovider-font-weight - Option to override the font weight, default: `400`\n * @cssproperty --mdc-themeprovider-letter-spacing-adjustment - Option to override the default letter-spacing,\n * default: `-0.25px` (this is to match the old CiscoSans)\n * @cssproperty --mdc-themeprovider-font-feature-settings - Option to override the font feature settings,\n * default: `\"ss02\" on`\n * @cssproperty --mdc-themeprovider-scrollbar-track-color - Option to override the color of the scrollbar track.\n * @cssproperty --mdc-themeprovider-scrollbar-thumb-color - Option to override the color of the scrollbar thumb.\n * @cssproperty --mdc-themeprovider-scrollbar-thumb-hover-color - Option to override the color of the\n * scrollbar thumb on hover. Applicable only on webkit browsers.\n * @cssproperty --mdc-themeprovider-scrollbar-thumb-active-color - Option to override the color of the\n * scrollbar thumb on press. Applicable only on webkit browsers.\n */",
10308
- "customElement": true
10309
- }
10310
- ],
10311
- "exports": [
10312
- {
10313
- "kind": "js",
10314
- "name": "default",
10315
- "declaration": {
10316
- "name": "ThemeProvider",
10317
- "module": "components/themeprovider/themeprovider.component.js"
10318
- }
10319
- }
10320
- ]
10321
- },
10322
10322
  {
10323
10323
  "kind": "javascript-module",
10324
10324
  "path": "components/virtualizedlist/virtualizedlist.component.js",
@@ -10338,7 +10338,7 @@
10338
10338
  "kind": "field",
10339
10339
  "name": "onscroll",
10340
10340
  "type": {
10341
- "text": "((this: GlobalEventHandlers, ev: Event) => any) | null"
10341
+ "text": "((this: GlobalEventHandlers, ev: Event) => void) | null"
10342
10342
  },
10343
10343
  "description": "Callback that gets called when user scrolls inside of list. This gives access to the scroll container element\nas well via the event. Particularly useful for\nhandling logic related when the user scrolls to the top or bottom of a list.",
10344
10344
  "default": "null",
@@ -10346,7 +10346,7 @@
10346
10346
  },
10347
10347
  {
10348
10348
  "kind": "field",
10349
- "name": "virtualizerprops",
10349
+ "name": "virtualizerProps",
10350
10350
  "type": {
10351
10351
  "text": "VirtualizerProps"
10352
10352
  },
@@ -10380,6 +10380,15 @@
10380
10380
  "privacy": "public",
10381
10381
  "default": "null"
10382
10382
  },
10383
+ {
10384
+ "kind": "field",
10385
+ "name": "virtualItems",
10386
+ "type": {
10387
+ "text": "Array<VirtualItem>"
10388
+ },
10389
+ "privacy": "public",
10390
+ "default": "[]"
10391
+ },
10383
10392
  {
10384
10393
  "kind": "field",
10385
10394
  "name": "virtualizerController",
@@ -10401,7 +10410,7 @@
10401
10410
  {
10402
10411
  "name": "onscroll",
10403
10412
  "type": {
10404
- "text": "((this: GlobalEventHandlers, ev: Event) => any) | null"
10413
+ "text": "((this: GlobalEventHandlers, ev: Event) => void) | null"
10405
10414
  },
10406
10415
  "description": "Callback that gets called when user scrolls inside of list. This gives access to the scroll container element\nas well via the event. Particularly useful for\nhandling logic related when the user scrolls to the top or bottom of a list.",
10407
10416
  "default": "null",
@@ -10413,7 +10422,7 @@
10413
10422
  "text": "VirtualizerProps"
10414
10423
  },
10415
10424
  "description": "Object that sets and updates the virtualizer with any relevant props.\nThere are two required object props in order to get virtualization to work properly.\ncount - The length of your list that you are virtualizing.\nAs your list grows/shrinks, this component must be updated with the appropriate value\n(Same with any other updated prop).\nestimateSize - A function that returns the estimated size of your items.\nIf your list is fixed, this will just be the size of your items.\nIf your list is dynamic, try to return approximate the size of each item.\n\nA full list of possible props can be in\n[Tanstack Virtualizer API Docs](https://tanstack.com/virtual/latest/docs/api/virtualizer)",
10416
- "fieldName": "virtualizerprops"
10425
+ "fieldName": "virtualizerProps"
10417
10426
  },
10418
10427
  {
10419
10428
  "name": "setlistdata",
@@ -10445,99 +10454,6 @@
10445
10454
  }
10446
10455
  ]
10447
10456
  },
10448
- {
10449
- "kind": "javascript-module",
10450
- "path": "components/virtualizedlist/virtualizedlist.test.component.js",
10451
- "declarations": [
10452
- {
10453
- "kind": "class",
10454
- "description": "",
10455
- "name": "VirtualizedWrapper",
10456
- "members": [
10457
- {
10458
- "kind": "field",
10459
- "name": "onscroll",
10460
- "type": {
10461
- "text": "((this: GlobalEventHandlers, ev: Event) => any) | null"
10462
- },
10463
- "default": "null",
10464
- "attribute": "onscroll"
10465
- },
10466
- {
10467
- "kind": "field",
10468
- "name": "virtualizerprops",
10469
- "type": {
10470
- "text": "VirtualizerProps"
10471
- },
10472
- "default": "{ count: 100, estimateSize: () => 100 }",
10473
- "attribute": "virtualizerprops"
10474
- },
10475
- {
10476
- "kind": "field",
10477
- "name": "list",
10478
- "type": {
10479
- "text": "TemplateResult<1>"
10480
- },
10481
- "default": "html``"
10482
- },
10483
- {
10484
- "kind": "field",
10485
- "name": "listItemTexts"
10486
- },
10487
- {
10488
- "kind": "method",
10489
- "name": "updateListItemTextArray",
10490
- "privacy": "private"
10491
- },
10492
- {
10493
- "kind": "method",
10494
- "name": "setListData",
10495
- "privacy": "private",
10496
- "parameters": [
10497
- {
10498
- "name": "{ virtualItems, measureElement, listStyle }",
10499
- "type": {
10500
- "text": "SetListDataProps"
10501
- }
10502
- }
10503
- ]
10504
- }
10505
- ],
10506
- "attributes": [
10507
- {
10508
- "name": "onscroll",
10509
- "type": {
10510
- "text": "((this: GlobalEventHandlers, ev: Event) => any) | null"
10511
- },
10512
- "default": "null",
10513
- "fieldName": "onscroll"
10514
- },
10515
- {
10516
- "name": "virtualizerprops",
10517
- "type": {
10518
- "text": "VirtualizerProps"
10519
- },
10520
- "default": "{ count: 100, estimateSize: () => 100 }",
10521
- "fieldName": "virtualizerprops"
10522
- }
10523
- ],
10524
- "superclass": {
10525
- "name": "Component",
10526
- "module": "/src/models"
10527
- }
10528
- }
10529
- ],
10530
- "exports": [
10531
- {
10532
- "kind": "js",
10533
- "name": "default",
10534
- "declaration": {
10535
- "name": "VirtualizedWrapper",
10536
- "module": "components/virtualizedlist/virtualizedlist.test.component.js"
10537
- }
10538
- }
10539
- ]
10540
- },
10541
10457
  {
10542
10458
  "kind": "javascript-module",
10543
10459
  "path": "utils/mixins/AvatarComponentMixin.js",
@@ -21,6 +21,6 @@ export { default as RadioGroup } from './radiogroup';
21
21
  export { default as Spinner } from './spinner';
22
22
  export { default as Tab } from './tab';
23
23
  export { default as Text } from './text';
24
- export { default as Toggle } from './toggle';
25
24
  export { default as ThemeProvider } from './themeprovider';
25
+ export { default as Toggle } from './toggle';
26
26
  export { default as VirtualizedList } from './virtualizedlist';
@@ -21,6 +21,6 @@ export { default as RadioGroup } from './radiogroup';
21
21
  export { default as Spinner } from './spinner';
22
22
  export { default as Tab } from './tab';
23
23
  export { default as Text } from './text';
24
- export { default as Toggle } from './toggle';
25
24
  export { default as ThemeProvider } from './themeprovider';
25
+ export { default as Toggle } from './toggle';
26
26
  export { default as VirtualizedList } from './virtualizedlist';
@@ -37,10 +37,17 @@ const hostFocusRingStyles = (applyFocusRingOnClass = false) => {
37
37
  :host([disabled]) .mdc-focus-ring:focus {
38
38
  box-shadow: none;
39
39
  }
40
+ /* Add focus ring to parent when child is focused. The parent element must have class name mdc-focus-ring */
40
41
  .mdc-focus-ring:focus-within {
41
42
  position: relative;
42
43
  box-shadow: ${boxShadow};
43
44
  }
45
+ /* Remove focus ring from parent when children has its own focus ring.
46
+ The child element must have class name own-focus-ring */
47
+ .mdc-focus-ring:has(.own-focus-ring:focus-visible){
48
+ box-shadow: none;
49
+ }
50
+
44
51
  /* High Contrast Mode */
45
52
  @media (forced-colors: active) {
46
53
  .mdc-focus-ring:focus-within {
@@ -59,13 +66,13 @@ const hostFocusRingStyles = (applyFocusRingOnClass = false) => {
59
66
  :host([disabled]:focus) {
60
67
  box-shadow: none;
61
68
  }
62
- :host(:focus), :host(:focus-within) {
69
+ :host(:focus) {
63
70
  position: relative;
64
71
  box-shadow: ${boxShadow};
65
72
  }
66
73
  /* High Contrast Mode */
67
74
  @media (forced-colors: active) {
68
- :host(:focus), :host(:focus-within) {
75
+ :host(:focus) {
69
76
  outline: 0.125rem solid var(--mds-color-theme-focus-default-0);
70
77
  }
71
78
  }
package/package.json CHANGED
@@ -38,5 +38,5 @@
38
38
  "lit": "^3.2.0",
39
39
  "uuid": "^11.0.5"
40
40
  },
41
- "version": "0.28.4"
41
+ "version": "0.28.6"
42
42
  }
@@ -1,17 +0,0 @@
1
- import { CSSResult, PropertyValues, TemplateResult } from 'lit';
2
- import { VirtualizerProps } from './virtualizedlist.types';
3
- import { Component } from '../../models';
4
- declare class VirtualizedWrapper extends Component {
5
- onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
6
- virtualizerprops: VirtualizerProps;
7
- list: TemplateResult<1>;
8
- listItemTexts: string[];
9
- constructor();
10
- update(changedProperties: PropertyValues): void;
11
- connectedCallback(): void;
12
- private updateListItemTextArray;
13
- private setListData;
14
- render(): TemplateResult<1>;
15
- static styles: Array<CSSResult>;
16
- }
17
- export default VirtualizedWrapper;
@@ -1,79 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { html } from 'lit';
11
- import { property, state } from 'lit/decorators.js';
12
- import { ref } from 'lit/directives/ref.js';
13
- import { styleMap } from 'lit/directives/style-map.js';
14
- import { Component } from '../../models';
15
- class VirtualizedWrapper extends Component {
16
- constructor() {
17
- super();
18
- this.virtualizerprops = { count: 100, estimateSize: () => 100 };
19
- this.list = html ``;
20
- this.listItemTexts = new Array(this.virtualizerprops.count)
21
- .fill(true)
22
- .map((_, index) => `list item number ${index}`);
23
- this.onscroll = null;
24
- this.setListData = this.setListData.bind(this);
25
- }
26
- update(changedProperties) {
27
- super.update(changedProperties);
28
- if (changedProperties.get('virtualizerprops')) {
29
- this.updateListItemTextArray();
30
- }
31
- }
32
- connectedCallback() {
33
- var _a;
34
- super.connectedCallback();
35
- if ((_a = this.virtualizerprops) === null || _a === void 0 ? void 0 : _a.count) {
36
- this.updateListItemTextArray();
37
- }
38
- }
39
- updateListItemTextArray() {
40
- var _a;
41
- this.listItemTexts = new Array((_a = this.virtualizerprops) === null || _a === void 0 ? void 0 : _a.count)
42
- .fill(true)
43
- .map((_, index) => `list item number ${index}`);
44
- }
45
- setListData({ virtualItems, measureElement, listStyle }) {
46
- if (virtualItems) {
47
- this.list = html `<ul style="margin: 0;${styleMap(listStyle)}">${virtualItems.map((virtualItem) => html `<li role="listitem" key=${virtualItem.key} data-index=${virtualItem.index} ref=${ref(measureElement)}>
48
- ${this.listItemTexts[virtualItem.index]}</li>`)}</ul>`;
49
- }
50
- }
51
- render() {
52
- return html `
53
- <div style="height: 500px; width: 500px;">
54
- <mdc-virtualizedlist
55
- .onscroll=${this.onscroll}
56
- .virtualizerprops=${this.virtualizerprops}
57
- .setlistdata=${this.setListData}
58
- >${this.list}</mdc-virtualizedlist></div>
59
- `;
60
- }
61
- }
62
- VirtualizedWrapper.styles = Component.styles;
63
- __decorate([
64
- property({ type: Function, attribute: 'onscroll' }),
65
- __metadata("design:type", Object)
66
- ], VirtualizedWrapper.prototype, "onscroll", void 0);
67
- __decorate([
68
- property({ type: Object, attribute: 'virtualizerprops' }),
69
- __metadata("design:type", Object)
70
- ], VirtualizedWrapper.prototype, "virtualizerprops", void 0);
71
- __decorate([
72
- state(),
73
- __metadata("design:type", Object)
74
- ], VirtualizedWrapper.prototype, "list", void 0);
75
- __decorate([
76
- state(),
77
- __metadata("design:type", Object)
78
- ], VirtualizedWrapper.prototype, "listItemTexts", void 0);
79
- export default VirtualizedWrapper;