@genesislcap/foundation-inbox 14.195.0 → 14.195.1-alpha-e5f27cb.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.
@@ -3,8 +3,11 @@ import { FoundationInboxService as FoundationInboxServiceInterface } from '../..
3
3
  export declare class FoundationInboxCounter extends FASTElement {
4
4
  value: number;
5
5
  foundationInboxService: FoundationInboxServiceInterface;
6
+ /** Tells whether to hide the component when there are no active items */
7
+ hideWhenNoItems: boolean;
6
8
  private subscriptionHandler;
7
9
  connectedCallback(): Promise<void>;
8
10
  disconnectedCallback(): void;
11
+ private valueChanged;
9
12
  }
10
13
  //# sourceMappingURL=foundation-inbox-counter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"foundation-inbox-counter.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-inbox-counter/foundation-inbox-counter.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,sBAAsB,IAAI,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAKlG,qBAKa,sBAAuB,SAAQ,WAAW;IACzC,KAAK,EAAE,MAAM,CAAK;IACN,sBAAsB,EAAG,+BAA+B,CAAC;IAEjF,OAAO,CAAC,mBAAmB,CAAgB;IAErC,iBAAiB;IAQvB,oBAAoB;CAIrB"}
1
+ {"version":3,"file":"foundation-inbox-counter.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-inbox-counter/foundation-inbox-counter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,sBAAsB,IAAI,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AASlG,qBAKa,sBAAuB,SAAQ,WAAW;IACzC,KAAK,EAAE,MAAM,CAAK;IACN,sBAAsB,EAAG,+BAA+B,CAAC;IAEjF,yEAAyE;IAElE,eAAe,EAAE,OAAO,CAAS;IAExC,OAAO,CAAC,mBAAmB,CAAgB;IAErC,iBAAiB;IAQvB,oBAAoB;IAMpB,OAAO,CAAC,YAAY;CAIrB"}
@@ -1,2 +1,6 @@
1
+ /** Class to use when there are no items */
2
+ export declare const noItemsClass = "no-items";
3
+ /** Name of the attribute that tells to hide the counter when there are no items */
4
+ export declare const hideWhenNoItemsAttribute = "hide-when-no-items";
1
5
  export declare const FoundationInboxCounterStyles: import("@microsoft/fast-element").ElementStyles;
2
6
  //# sourceMappingURL=foundation-inbox-counter.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"foundation-inbox-counter.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-inbox-counter/foundation-inbox-counter.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,4BAA4B,iDAcxC,CAAC"}
1
+ {"version":3,"file":"foundation-inbox-counter.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-inbox-counter/foundation-inbox-counter.styles.ts"],"names":[],"mappings":"AAIA,2CAA2C;AAC3C,eAAO,MAAM,YAAY,aAAa,CAAC;AAEvC,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D,eAAO,MAAM,4BAA4B,iDAkBxC,CAAC"}
@@ -1,12 +1,14 @@
1
1
  import { __awaiter, __decorate } from "tslib";
2
- import { observable, customElement, FASTElement } from '@microsoft/fast-element';
2
+ import { attr, observable, customElement, FASTElement } from '@microsoft/fast-element';
3
3
  import { FoundationInboxService } from '../../services/foundation-inbox-service';
4
- import { FoundationInboxCounterStyles } from './foundation-inbox-counter.styles';
4
+ import { FoundationInboxCounterStyles, hideWhenNoItemsAttribute, noItemsClass, } from './foundation-inbox-counter.styles';
5
5
  import { FoundationInboxCounterTemplate } from './foundation-inbox-counter.template';
6
6
  let FoundationInboxCounter = class FoundationInboxCounter extends FASTElement {
7
7
  constructor() {
8
8
  super(...arguments);
9
9
  this.value = 0;
10
+ /** Tells whether to hide the component when there are no active items */
11
+ this.hideWhenNoItems = false;
10
12
  }
11
13
  connectedCallback() {
12
14
  const _super = Object.create(null, {
@@ -24,6 +26,13 @@ let FoundationInboxCounter = class FoundationInboxCounter extends FASTElement {
24
26
  super.disconnectedCallback();
25
27
  this.foundationInboxService.unsubscribe(this.subscriptionHandler);
26
28
  }
29
+ // noinspection JSUnusedLocalSymbols Used automagically by FAST
30
+ valueChanged() {
31
+ if (this.value >= 1 && !this.classList.contains(noItemsClass))
32
+ this.classList.add(noItemsClass);
33
+ else if (this.value < 1)
34
+ this.classList.remove(noItemsClass);
35
+ }
27
36
  };
28
37
  __decorate([
29
38
  observable
@@ -31,6 +40,9 @@ __decorate([
31
40
  __decorate([
32
41
  FoundationInboxService
33
42
  ], FoundationInboxCounter.prototype, "foundationInboxService", void 0);
43
+ __decorate([
44
+ attr({ attribute: hideWhenNoItemsAttribute, mode: 'boolean' })
45
+ ], FoundationInboxCounter.prototype, "hideWhenNoItems", void 0);
34
46
  FoundationInboxCounter = __decorate([
35
47
  customElement({
36
48
  name: 'foundation-inbox-counter',
@@ -1,5 +1,9 @@
1
1
  import { css } from '@microsoft/fast-element';
2
2
  const BACKGROUND_COLOR = '#EF5547';
3
+ /** Class to use when there are no items */
4
+ export const noItemsClass = 'no-items';
5
+ /** Name of the attribute that tells to hide the counter when there are no items */
6
+ export const hideWhenNoItemsAttribute = 'hide-when-no-items';
3
7
  export const FoundationInboxCounterStyles = css `
4
8
  :host {
5
9
  display: inline-block;
@@ -14,4 +18,8 @@ export const FoundationInboxCounterStyles = css `
14
18
  background: ${BACKGROUND_COLOR};
15
19
  pointer-events: none;
16
20
  }
21
+
22
+ :host.${noItemsClass}[${hideWhenNoItemsAttribute}='true'] {
23
+ display: none;
24
+ }
17
25
  `;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-inbox",
3
3
  "description": "Genesis Foundation Inbox",
4
- "version": "14.195.0",
4
+ "version": "14.195.1-alpha-e5f27cb.0",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/foundation-inbox.d.ts",
@@ -65,21 +65,21 @@
65
65
  }
66
66
  },
67
67
  "devDependencies": {
68
- "@genesislcap/foundation-testing": "14.195.0",
69
- "@genesislcap/genx": "14.195.0",
70
- "@genesislcap/rollup-builder": "14.195.0",
71
- "@genesislcap/ts-builder": "14.195.0",
72
- "@genesislcap/uvu-playwright-builder": "14.195.0",
73
- "@genesislcap/vite-builder": "14.195.0",
74
- "@genesislcap/webpack-builder": "14.195.0",
68
+ "@genesislcap/foundation-testing": "14.195.1-alpha-e5f27cb.0",
69
+ "@genesislcap/genx": "14.195.1-alpha-e5f27cb.0",
70
+ "@genesislcap/rollup-builder": "14.195.1-alpha-e5f27cb.0",
71
+ "@genesislcap/ts-builder": "14.195.1-alpha-e5f27cb.0",
72
+ "@genesislcap/uvu-playwright-builder": "14.195.1-alpha-e5f27cb.0",
73
+ "@genesislcap/vite-builder": "14.195.1-alpha-e5f27cb.0",
74
+ "@genesislcap/webpack-builder": "14.195.1-alpha-e5f27cb.0",
75
75
  "rimraf": "^5.0.0"
76
76
  },
77
77
  "dependencies": {
78
- "@genesislcap/foundation-comms": "14.195.0",
79
- "@genesislcap/foundation-logger": "14.195.0",
80
- "@genesislcap/foundation-ui": "14.195.0",
81
- "@genesislcap/foundation-utils": "14.195.0",
82
- "@genesislcap/foundation-zero": "14.195.0",
78
+ "@genesislcap/foundation-comms": "14.195.1-alpha-e5f27cb.0",
79
+ "@genesislcap/foundation-logger": "14.195.1-alpha-e5f27cb.0",
80
+ "@genesislcap/foundation-ui": "14.195.1-alpha-e5f27cb.0",
81
+ "@genesislcap/foundation-utils": "14.195.1-alpha-e5f27cb.0",
82
+ "@genesislcap/foundation-zero": "14.195.1-alpha-e5f27cb.0",
83
83
  "@microsoft/fast-element": "^1.12.0",
84
84
  "@microsoft/fast-foundation": "^2.49.4",
85
85
  "@microsoft/fast-router": "^0.4.8",
@@ -94,5 +94,5 @@
94
94
  "access": "public"
95
95
  },
96
96
  "customElements": "dist/custom-elements.json",
97
- "gitHead": "c2f60f537f6443a78be6237f3c4bc0f5f49f0262"
97
+ "gitHead": "4499144e8dc10a1fe52067b4d03e1fad4f5049c8"
98
98
  }