@ni/nimble-components 19.4.2 → 19.4.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 (41) hide show
  1. package/dist/all-components-bundle.js +135 -64
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +518 -525
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/src/table-column/anchor/cell-view/index.d.ts +1 -3
  6. package/dist/esm/src/table-column/base/index.d.ts +1 -3
  7. package/dist/esm/src/table-column/text/cell-view/index.d.ts +2 -3
  8. package/dist/esm/src/table-column/text/group-header-view/index.d.ts +2 -3
  9. package/dist/esm/src/table-column/text-base/cell-view/index.d.ts +7 -15
  10. package/dist/esm/src/table-column/text-base/group-header-view/index.d.ts +6 -18
  11. package/dist/esm/src/utilities/directive/overflow.d.ts +36 -0
  12. package/dist/esm/table-column/anchor/cell-view/index.d.ts +1 -3
  13. package/dist/esm/table-column/anchor/cell-view/index.js +2 -2
  14. package/dist/esm/table-column/anchor/cell-view/index.js.map +1 -1
  15. package/dist/esm/table-column/anchor/cell-view/template.js +5 -15
  16. package/dist/esm/table-column/anchor/cell-view/template.js.map +1 -1
  17. package/dist/esm/table-column/base/index.d.ts +1 -3
  18. package/dist/esm/table-column/base/index.js +2 -2
  19. package/dist/esm/table-column/base/index.js.map +1 -1
  20. package/dist/esm/table-column/base/template.js +3 -9
  21. package/dist/esm/table-column/base/template.js.map +1 -1
  22. package/dist/esm/table-column/text/cell-view/index.d.ts +2 -3
  23. package/dist/esm/table-column/text/cell-view/index.js +11 -7
  24. package/dist/esm/table-column/text/cell-view/index.js.map +1 -1
  25. package/dist/esm/table-column/text/group-header-view/index.d.ts +2 -3
  26. package/dist/esm/table-column/text/group-header-view/index.js +11 -7
  27. package/dist/esm/table-column/text/group-header-view/index.js.map +1 -1
  28. package/dist/esm/table-column/text-base/cell-view/index.d.ts +7 -15
  29. package/dist/esm/table-column/text-base/cell-view/index.js +23 -2
  30. package/dist/esm/table-column/text-base/cell-view/index.js.map +1 -1
  31. package/dist/esm/table-column/text-base/cell-view/template.js +4 -9
  32. package/dist/esm/table-column/text-base/cell-view/template.js.map +1 -1
  33. package/dist/esm/table-column/text-base/group-header-view/index.d.ts +6 -18
  34. package/dist/esm/table-column/text-base/group-header-view/index.js +21 -8
  35. package/dist/esm/table-column/text-base/group-header-view/index.js.map +1 -1
  36. package/dist/esm/table-column/text-base/group-header-view/template.js +3 -4
  37. package/dist/esm/table-column/text-base/group-header-view/template.js.map +1 -1
  38. package/dist/esm/utilities/directive/overflow.d.ts +36 -0
  39. package/dist/esm/utilities/directive/overflow.js +56 -0
  40. package/dist/esm/utilities/directive/overflow.js.map +1 -0
  41. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/group-header-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAIpE;;GAEG;AACH,MAAM,OAAgB,kCAGpB,SAAQ,oBAAgD;IAH1D;;QAOI,gBAAgB;QAET,gBAAW,GAAG,KAAK,CAAC;IAqC/B,CAAC;IAbG,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACpE,CAAC;IAED,gBAAgB;IACT,mBAAmB;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;IAC7E,CAAC;IAED,gBAAgB;IACT,kBAAkB;QACrB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC7B,CAAC;CACJ;AArCG;IADC,UAAU;uEACgB;AAwB3B;IADC,QAAQ;iEAGR"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/group-header-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAIpE;;GAEG;AACH,MAAM,OAAgB,kCAGpB,SAAQ,oBAAgD;IAH1D;;QAII,gBAAgB;QAET,gBAAW,GAAG,KAAK,CAAC;QAE3B;;WAEG;QAEI,SAAI,GAAG,EAAE,CAAC;QAEjB;;WAEG;QAEI,gBAAW,GAAG,EAAE,CAAC;QAExB;;WAEG;QAEI,yBAAoB,GAAG,IAAI,CAAC;IAMvC,CAAC;IAHG,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACpE,CAAC;CACJ;AAxBG;IADC,UAAU;uEACgB;AAM3B;IADC,UAAU;gEACM;AAMjB;IADC,UAAU;uEACa;AAMxB;IADC,UAAU;gFACwB;AAGnC;IADC,QAAQ;iEAGR"}
@@ -1,10 +1,9 @@
1
- import { html, ref } from '@microsoft/fast-element';
1
+ import { html } from '@microsoft/fast-element';
2
+ import { overflow } from '../../../utilities/directive/overflow';
2
3
  export const template = html `
3
4
  <span
4
- ${ref('textSpan')}
5
+ ${overflow('hasOverflow')}
5
6
  class="${x => (x.shouldUsePlaceholder ? 'placeholder' : '')}"
6
- @mouseover="${x => x.updateTitleOverflow()}"
7
- @mouseout="${x => x.clearTitleOverflow()}"
8
7
  title="${x => (x.hasOverflow && x.content ? x.content : undefined)}"
9
8
  >
10
9
  ${x => x.content}
@@ -1 +1 @@
1
- {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/group-header-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAGpD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAoC;;UAEtD,GAAG,CAAC,UAAU,CAAC;iBACR,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;sBAC7C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAmB,EAAE;qBAC7B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE;iBAC/B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;;UAEhE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO;;CAEvB,CAAC"}
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/group-header-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAEjE,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAoC;;UAEtD,QAAQ,CAAC,aAAa,CAAC;iBAChB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;iBAClD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;;UAEhE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO;;CAEvB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { type Behavior, type CaptureType } from '@microsoft/fast-element';
2
+ /**
3
+ * The runtime behavior for template overflow detection.
4
+ * @public
5
+ */
6
+ export declare class OverflowBehavior implements Behavior {
7
+ private readonly target;
8
+ private propertyName;
9
+ private mouseOverHandler;
10
+ private mouseOutHandler;
11
+ private source;
12
+ /**
13
+ * Creates an instance of OverflowBehavior.
14
+ * @param target - The element to check for overflow.
15
+ * @param propertyName - The name of the property to assign the overflow state to.
16
+ */
17
+ constructor(target: HTMLElement, propertyName: string);
18
+ /**
19
+ * Bind this behavior to the source.
20
+ * @param source - The source to bind to.
21
+ * @param context - The execution context that the binding is operating within.
22
+ */
23
+ bind(source: unknown): void;
24
+ /**
25
+ * Unbinds this behavior from the source.
26
+ * @param source - The source to unbind from.
27
+ */
28
+ unbind(): void;
29
+ private setSourceValue;
30
+ }
31
+ /**
32
+ * A directive that observes if an element has overflow and sets a flag.
33
+ * @param propertyName - The name of the property to assign the overflow flag.
34
+ * @public
35
+ */
36
+ export declare function overflow<T = unknown>(propertyName: keyof T & string): CaptureType<T>;
@@ -0,0 +1,56 @@
1
+ import { AttachedBehaviorHTMLDirective } from '@microsoft/fast-element';
2
+ /**
3
+ * The runtime behavior for template overflow detection.
4
+ * @public
5
+ */
6
+ export class OverflowBehavior {
7
+ /**
8
+ * Creates an instance of OverflowBehavior.
9
+ * @param target - The element to check for overflow.
10
+ * @param propertyName - The name of the property to assign the overflow state to.
11
+ */
12
+ constructor(target, propertyName) {
13
+ this.target = target;
14
+ this.propertyName = propertyName;
15
+ }
16
+ /**
17
+ * Bind this behavior to the source.
18
+ * @param source - The source to bind to.
19
+ * @param context - The execution context that the binding is operating within.
20
+ */
21
+ bind(source) {
22
+ this.source = source;
23
+ this.setSourceValue(false);
24
+ this.mouseOverHandler = () => {
25
+ const hasOverflow = this.target.offsetWidth < this.target.scrollWidth;
26
+ this.setSourceValue(hasOverflow);
27
+ };
28
+ this.mouseOutHandler = () => {
29
+ this.setSourceValue(false);
30
+ };
31
+ this.target.addEventListener('mouseover', this.mouseOverHandler);
32
+ this.target.addEventListener('mouseout', this.mouseOutHandler);
33
+ }
34
+ /**
35
+ * Unbinds this behavior from the source.
36
+ * @param source - The source to unbind from.
37
+ */
38
+ unbind() {
39
+ this.source = undefined;
40
+ this.target.removeEventListener('mouseover', this.mouseOverHandler);
41
+ this.target.removeEventListener('mouseout', this.mouseOutHandler);
42
+ }
43
+ setSourceValue(value) {
44
+ // @ts-expect-error set property on source
45
+ this.source[this.propertyName] = value;
46
+ }
47
+ }
48
+ /**
49
+ * A directive that observes if an element has overflow and sets a flag.
50
+ * @param propertyName - The name of the property to assign the overflow flag.
51
+ * @public
52
+ */
53
+ export function overflow(propertyName) {
54
+ return new AttachedBehaviorHTMLDirective('nimble-overflow', OverflowBehavior, propertyName);
55
+ }
56
+ //# sourceMappingURL=overflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overflow.js","sourceRoot":"","sources":["../../../../src/utilities/directive/overflow.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,6BAA6B,EAGhC,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAKzB;;;;OAIG;IACH,YACqB,MAAmB,EAC5B,YAAoB;QADX,WAAM,GAAN,MAAM,CAAa;QAC5B,iBAAY,GAAZ,YAAY,CAAQ;IAC7B,CAAC;IAEJ;;;;OAIG;IACI,IAAI,CAAC,MAAe;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,gBAAgB,GAAG,GAAG,EAAE;YACzB,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;YACtE,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACrC,CAAC,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,GAAG,EAAE;YACxB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACnE,CAAC;IAED;;;OAGG;IACI,MAAM;QACT,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACpE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACtE,CAAC;IAEO,cAAc,CAAC,KAAc;QACjC,0CAA0C;QAC1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC;IAC3C,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CACpB,YAA8B;IAE9B,OAAO,IAAI,6BAA6B,CACpC,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,CACf,CAAC;AACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ni/nimble-components",
3
- "version": "19.4.2",
3
+ "version": "19.4.4",
4
4
  "description": "Styled web components for the NI Nimble Design System",
5
5
  "scripts": {
6
6
  "build": "npm run generate-icons && npm run build-components && npm run bundle-components && npm run generate-scss && npm run build-storybook",