@digital-realty/ix-tile-picker 2.1.38 → 2.2.2-alpha-NJEN.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.
@@ -1,37 +1,37 @@
1
- import '@digital-realty/ix-search-bar';
2
- import '@material/web/elevation/elevation.js';
3
- import { LitElement } from 'lit';
4
- import type { DirectiveResult } from 'lit/directive.js';
5
- export interface Item {
6
- id?: string;
7
- disabled?: boolean;
8
- hidden?: boolean;
9
- disabledButtonText?: string;
10
- company?: string;
11
- cloudAccessId?: string;
12
- usedBandwidth?: number;
13
- totalBandwidth?: number;
14
- }
15
- type FilterResultsEvent = CustomEvent<{
16
- items: Item[];
17
- }>;
18
- export declare class IxTilePicker extends LitElement {
19
- static get styles(): import("lit").CSSResult[];
20
- items: Array<Item>;
21
- searchFields: Array<string>;
22
- foundItems: Array<Item>;
23
- onSelectTile: Function | undefined;
24
- onResultsFound: Function | undefined;
25
- disabledText: string;
26
- selectedText: string;
27
- chooseText: string;
28
- value: string;
29
- connectedCallback(): void;
30
- filterTiles(results: FilterResultsEvent): void;
31
- handleClick(e: Event): void;
32
- getRadioButtonLabelText(item: Item): string;
33
- getRadioButtonLabelClass(item: Item): DirectiveResult;
34
- renderRadioButtonLabel(item: Item): import("lit").TemplateResult<1>;
35
- render(): import("lit").TemplateResult<1>;
36
- }
37
- export {};
1
+ import '@digital-realty/ix-search-bar';
2
+ import '@material/web/elevation/elevation.js';
3
+ import { LitElement } from 'lit';
4
+ import type { DirectiveResult } from 'lit/directive.js';
5
+ export interface Item {
6
+ id?: string;
7
+ disabled?: boolean;
8
+ hidden?: boolean;
9
+ disabledButtonText?: string;
10
+ company?: string;
11
+ cloudAccessId?: string;
12
+ usedBandwidth?: number;
13
+ totalBandwidth?: number;
14
+ }
15
+ type FilterResultsEvent = CustomEvent<{
16
+ items: Item[];
17
+ }>;
18
+ export declare class IxTilePicker extends LitElement {
19
+ static get styles(): import("lit").CSSResult[];
20
+ items: Array<Item>;
21
+ searchFields: Array<string>;
22
+ foundItems: Array<Item>;
23
+ onSelectTile: Function | undefined;
24
+ onResultsFound: Function | undefined;
25
+ disabledText: string;
26
+ selectedText: string;
27
+ chooseText: string;
28
+ value: string;
29
+ connectedCallback(): void;
30
+ filterTiles(results: FilterResultsEvent): void;
31
+ handleClick(e: Event): void;
32
+ getRadioButtonLabelText(item: Item): string;
33
+ getRadioButtonLabelClass(item: Item): DirectiveResult;
34
+ renderRadioButtonLabel(item: Item): import("lit").TemplateResult<1>;
35
+ render(): import("lit").TemplateResult<1>;
36
+ }
37
+ export {};
@@ -1,77 +1,77 @@
1
- import { __decorate } from "tslib";
2
- import '@digital-realty/ix-search-bar';
3
- import '@material/web/elevation/elevation.js';
4
- import { html, LitElement, nothing } from 'lit';
5
- import { property } from 'lit/decorators.js';
6
- import { classMap } from 'lit/directives/class-map.js';
7
- import { IxTilePickerStyles } from './ix-tile-picker-styles.js';
8
- export class IxTilePicker extends LitElement {
9
- constructor() {
10
- super(...arguments);
11
- this.items = [];
12
- this.searchFields = [];
13
- this.foundItems = [];
14
- this.onSelectTile = undefined;
15
- this.onResultsFound = undefined;
16
- this.disabledText = 'Disabled';
17
- this.selectedText = 'Selected';
18
- this.chooseText = 'Choose';
19
- this.value = '';
20
- }
21
- static get styles() {
22
- return [IxTilePickerStyles];
23
- }
24
- connectedCallback() {
25
- super.connectedCallback();
26
- this.foundItems = this.items;
27
- }
28
- filterTiles(results) {
29
- this.foundItems = this.items.map((item) => {
30
- var _a;
31
- return ({
32
- ...item,
33
- hidden: !((_a = results === null || results === void 0 ? void 0 : results.detail) === null || _a === void 0 ? void 0 : _a.items.includes(item)),
34
- });
35
- });
36
- if (this.onResultsFound) {
37
- this.onResultsFound(this.foundItems);
38
- }
39
- }
40
- handleClick(e) {
41
- const { target } = e;
42
- this.value = target.value || '';
43
- if (this.onSelectTile) {
44
- this.onSelectTile(this.value);
45
- }
46
- const foundItem = this.foundItems.find((item) => item.id === this.value);
47
- if (foundItem) {
48
- this.renderRadioButtonLabel(foundItem);
49
- }
50
- this.requestUpdate();
51
- }
52
- getRadioButtonLabelText(item) {
53
- if (item.disabled)
54
- return item.disabledButtonText || this.disabledText;
55
- if (item.id === this.value)
56
- return this.selectedText;
57
- return this.chooseText;
58
- }
59
- getRadioButtonLabelClass(item) {
60
- return classMap({
61
- '-disabled': (item === null || item === void 0 ? void 0 : item.disabled) || false,
62
- '-checked': item.id === this.value,
63
- '-unselected': item.id !== this.value,
64
- });
65
- }
66
- renderRadioButtonLabel(item) {
1
+ import { __decorate } from "tslib";
2
+ import '@digital-realty/ix-search-bar';
3
+ import '@material/web/elevation/elevation.js';
4
+ import { html, LitElement, nothing } from 'lit';
5
+ import { property } from 'lit/decorators.js';
6
+ import { classMap } from 'lit/directives/class-map.js';
7
+ import { IxTilePickerStyles } from './ix-tile-picker-styles.js';
8
+ export class IxTilePicker extends LitElement {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.items = [];
12
+ this.searchFields = [];
13
+ this.foundItems = [];
14
+ this.onSelectTile = undefined;
15
+ this.onResultsFound = undefined;
16
+ this.disabledText = 'Disabled';
17
+ this.selectedText = 'Selected';
18
+ this.chooseText = 'Choose';
19
+ this.value = '';
20
+ }
21
+ static get styles() {
22
+ return [IxTilePickerStyles];
23
+ }
24
+ connectedCallback() {
25
+ super.connectedCallback();
26
+ this.foundItems = this.items;
27
+ }
28
+ filterTiles(results) {
29
+ this.foundItems = this.items.map((item) => {
30
+ var _a;
31
+ return ({
32
+ ...item,
33
+ hidden: !((_a = results === null || results === void 0 ? void 0 : results.detail) === null || _a === void 0 ? void 0 : _a.items.includes(item)),
34
+ });
35
+ });
36
+ if (this.onResultsFound) {
37
+ this.onResultsFound(this.foundItems);
38
+ }
39
+ }
40
+ handleClick(e) {
41
+ const { target } = e;
42
+ this.value = target.value || '';
43
+ if (this.onSelectTile) {
44
+ this.onSelectTile(this.value);
45
+ }
46
+ const foundItem = this.foundItems.find((item) => item.id === this.value);
47
+ if (foundItem) {
48
+ this.renderRadioButtonLabel(foundItem);
49
+ }
50
+ this.requestUpdate();
51
+ }
52
+ getRadioButtonLabelText(item) {
53
+ if (item.disabled)
54
+ return item.disabledButtonText || this.disabledText;
55
+ if (item.id === this.value)
56
+ return this.selectedText;
57
+ return this.chooseText;
58
+ }
59
+ getRadioButtonLabelClass(item) {
60
+ return classMap({
61
+ '-disabled': (item === null || item === void 0 ? void 0 : item.disabled) || false,
62
+ '-checked': item.id === this.value,
63
+ '-unselected': item.id !== this.value,
64
+ });
65
+ }
66
+ renderRadioButtonLabel(item) {
67
67
  return html `<label
68
68
  for="tile-${item.id}"
69
69
  class="tile-radio-btn__label ${this.getRadioButtonLabelClass(item)}"
70
70
  aria-hidden="true"
71
71
  >${this.getRadioButtonLabelText(item)}</label
72
- >`;
73
- }
74
- render() {
72
+ >`;
73
+ }
74
+ render() {
75
75
  return html `
76
76
  <ix-search-bar
77
77
  .items="${this.items}"
@@ -80,12 +80,12 @@ export class IxTilePicker extends LitElement {
80
80
  ></ix-search-bar>
81
81
 
82
82
  <div class="tiles">
83
- ${this.foundItems.length
83
+ ${this.foundItems.length
84
84
  ? this.foundItems.map((item, index) => html `
85
85
  <div
86
- class="tile surface ${classMap({
87
- '-disabled': (item === null || item === void 0 ? void 0 : item.disabled) || false,
88
- '-hidden': (item === null || item === void 0 ? void 0 : item.hidden) || false,
86
+ class="tile surface ${classMap({
87
+ '-disabled': (item === null || item === void 0 ? void 0 : item.disabled) || false,
88
+ '-hidden': (item === null || item === void 0 ? void 0 : item.hidden) || false,
89
89
  })}"
90
90
  >
91
91
  <md-elevation></md-elevation>
@@ -123,34 +123,34 @@ export class IxTilePicker extends LitElement {
123
123
  ${this.renderRadioButtonLabel(item)}
124
124
  </span>
125
125
  </div>
126
- `)
126
+ `)
127
127
  : nothing}
128
128
  </div>
129
- `;
130
- }
131
- }
132
- __decorate([
133
- property({ type: Array })
134
- ], IxTilePicker.prototype, "items", void 0);
135
- __decorate([
136
- property({ type: Array })
137
- ], IxTilePicker.prototype, "searchFields", void 0);
138
- __decorate([
139
- property({ type: Array })
140
- ], IxTilePicker.prototype, "foundItems", void 0);
141
- __decorate([
142
- property({ attribute: false })
143
- ], IxTilePicker.prototype, "onSelectTile", void 0);
144
- __decorate([
145
- property({ attribute: false })
146
- ], IxTilePicker.prototype, "onResultsFound", void 0);
147
- __decorate([
148
- property()
149
- ], IxTilePicker.prototype, "disabledText", void 0);
150
- __decorate([
151
- property()
152
- ], IxTilePicker.prototype, "selectedText", void 0);
153
- __decorate([
154
- property()
155
- ], IxTilePicker.prototype, "chooseText", void 0);
129
+ `;
130
+ }
131
+ }
132
+ __decorate([
133
+ property({ type: Array })
134
+ ], IxTilePicker.prototype, "items", void 0);
135
+ __decorate([
136
+ property({ type: Array })
137
+ ], IxTilePicker.prototype, "searchFields", void 0);
138
+ __decorate([
139
+ property({ type: Array })
140
+ ], IxTilePicker.prototype, "foundItems", void 0);
141
+ __decorate([
142
+ property({ attribute: false })
143
+ ], IxTilePicker.prototype, "onSelectTile", void 0);
144
+ __decorate([
145
+ property({ attribute: false })
146
+ ], IxTilePicker.prototype, "onResultsFound", void 0);
147
+ __decorate([
148
+ property()
149
+ ], IxTilePicker.prototype, "disabledText", void 0);
150
+ __decorate([
151
+ property()
152
+ ], IxTilePicker.prototype, "selectedText", void 0);
153
+ __decorate([
154
+ property()
155
+ ], IxTilePicker.prototype, "chooseText", void 0);
156
156
  //# sourceMappingURL=IxTilePicker.js.map
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { IxTilePicker } from './IxTilePicker.js';
1
+ export { IxTilePicker } from './IxTilePicker.js';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { IxTilePicker } from './IxTilePicker.js';
1
+ export { IxTilePicker } from './IxTilePicker.js';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- export declare const IxTilePickerStyles: import("lit").CSSResult;
1
+ export declare const IxTilePickerStyles: import("lit").CSSResult;
@@ -1,4 +1,4 @@
1
- import { css } from 'lit';
1
+ import { css } from 'lit';
2
2
  export const IxTilePickerStyles = css `
3
3
  :host {
4
4
  justify-content: space-between;
@@ -221,5 +221,5 @@ export const IxTilePickerStyles = css `
221
221
  position: relative;
222
222
  --md-elevation-level: 2;
223
223
  }
224
- `;
224
+ `;
225
225
  //# sourceMappingURL=ix-tile-picker-styles.js.map
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,3 +1,3 @@
1
- import { IxTilePicker } from './IxTilePicker.js';
2
- window.customElements.define('ix-tile-picker', IxTilePicker);
1
+ import { IxTilePicker } from './IxTilePicker.js';
2
+ window.customElements.define('ix-tile-picker', IxTilePicker);
3
3
  //# sourceMappingURL=ix-tile-picker.js.map
@@ -1,2 +1,2 @@
1
- import { IxTilePicker as LitComp } from '../IxTilePicker.js';
2
- export declare const IxTilePicker: import("@lit/react").ReactWebComponent<LitComp, {}>;
1
+ import { IxTilePicker as LitComp } from '../IxTilePicker.js';
2
+ export declare const IxTilePicker: import("@lit/react").ReactWebComponent<LitComp, {}>;
@@ -1,10 +1,10 @@
1
- import React from 'react';
2
- import { createComponent } from '@lit/react';
3
- import { IxTilePicker as LitComp } from '../IxTilePicker.js';
4
- customElements.define('ix-tile-picker', LitComp);
5
- export const IxTilePicker = createComponent({
6
- tagName: 'ix-tile-picker-react',
7
- elementClass: LitComp,
8
- react: React,
9
- });
1
+ import React from 'react';
2
+ import { createComponent } from '@lit/react';
3
+ import { IxTilePicker as LitComp } from '../IxTilePicker.js';
4
+ customElements.define('ix-tile-picker', LitComp);
5
+ export const IxTilePicker = createComponent({
6
+ tagName: 'ix-tile-picker-react',
7
+ elementClass: LitComp,
8
+ react: React,
9
+ });
10
10
  //# sourceMappingURL=IxTilePicker.js.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent ix-tile-picker following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "Digital Realty",
6
- "version": "2.1.38",
6
+ "version": "2.2.2-alpha-NJEN.1",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
@@ -27,10 +27,10 @@
27
27
  "test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
28
28
  },
29
29
  "dependencies": {
30
- "@digital-realty/ix-search-bar": "^2.1.38",
30
+ "@digital-realty/ix-search-bar": "^2.2.2-alpha-NJEN.1",
31
31
  "@lit/react": "^1.0.2",
32
32
  "@material/web": "1.2.0",
33
- "lit": "^2.0.2",
33
+ "lit": "^2.8.0 || ^3.0.0",
34
34
  "react": "^18.2.0"
35
35
  },
36
36
  "devDependencies": {
@@ -102,5 +102,5 @@
102
102
  "README.md",
103
103
  "LICENSE"
104
104
  ],
105
- "gitHead": "705b8d4a1375a3ce54b1562c65d8636b98b14466"
105
+ "gitHead": "36ec59c8921745261d39d5865fb4bd1a6b97ae46"
106
106
  }