@ni/nimble-components 35.12.5 → 35.12.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.
- package/dist/all-components-bundle.js +1885 -794
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +3518 -3391
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/custom-elements.json +88 -4
- package/dist/custom-elements.md +12 -12
- package/dist/esm/label-provider/base/index.d.ts +6 -4
- package/dist/esm/label-provider/base/index.js +12 -7
- package/dist/esm/label-provider/base/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -8475,7 +8475,25 @@
|
|
|
8475
8475
|
{
|
|
8476
8476
|
"name": "property",
|
|
8477
8477
|
"type": {
|
|
8478
|
-
"text": "keyof
|
|
8478
|
+
"text": "keyof SupportedLabels & string"
|
|
8479
|
+
}
|
|
8480
|
+
}
|
|
8481
|
+
]
|
|
8482
|
+
},
|
|
8483
|
+
{
|
|
8484
|
+
"kind": "method",
|
|
8485
|
+
"name": "isSupportedLabel",
|
|
8486
|
+
"privacy": "private",
|
|
8487
|
+
"return": {
|
|
8488
|
+
"type": {
|
|
8489
|
+
"text": "this is this\n & DesignTokensFor<SupportedLabels>\n & { supportedLabels: Pick<SupportedLabelTokens, Property> }"
|
|
8490
|
+
}
|
|
8491
|
+
},
|
|
8492
|
+
"parameters": [
|
|
8493
|
+
{
|
|
8494
|
+
"name": "property",
|
|
8495
|
+
"type": {
|
|
8496
|
+
"text": "Property"
|
|
8479
8497
|
}
|
|
8480
8498
|
}
|
|
8481
8499
|
]
|
|
@@ -8687,7 +8705,29 @@
|
|
|
8687
8705
|
{
|
|
8688
8706
|
"name": "property",
|
|
8689
8707
|
"type": {
|
|
8690
|
-
"text": "keyof
|
|
8708
|
+
"text": "keyof SupportedLabels & string"
|
|
8709
|
+
}
|
|
8710
|
+
}
|
|
8711
|
+
],
|
|
8712
|
+
"inheritedFrom": {
|
|
8713
|
+
"name": "LabelProviderBase",
|
|
8714
|
+
"module": "src/label-provider/base/index.ts"
|
|
8715
|
+
}
|
|
8716
|
+
},
|
|
8717
|
+
{
|
|
8718
|
+
"kind": "method",
|
|
8719
|
+
"name": "isSupportedLabel",
|
|
8720
|
+
"privacy": "private",
|
|
8721
|
+
"return": {
|
|
8722
|
+
"type": {
|
|
8723
|
+
"text": "this is this\n & DesignTokensFor<SupportedLabels>\n & { supportedLabels: Pick<SupportedLabelTokens, Property> }"
|
|
8724
|
+
}
|
|
8725
|
+
},
|
|
8726
|
+
"parameters": [
|
|
8727
|
+
{
|
|
8728
|
+
"name": "property",
|
|
8729
|
+
"type": {
|
|
8730
|
+
"text": "Property"
|
|
8691
8731
|
}
|
|
8692
8732
|
}
|
|
8693
8733
|
],
|
|
@@ -9143,7 +9183,29 @@
|
|
|
9143
9183
|
{
|
|
9144
9184
|
"name": "property",
|
|
9145
9185
|
"type": {
|
|
9146
|
-
"text": "keyof
|
|
9186
|
+
"text": "keyof SupportedLabels & string"
|
|
9187
|
+
}
|
|
9188
|
+
}
|
|
9189
|
+
],
|
|
9190
|
+
"inheritedFrom": {
|
|
9191
|
+
"name": "LabelProviderBase",
|
|
9192
|
+
"module": "src/label-provider/base/index.ts"
|
|
9193
|
+
}
|
|
9194
|
+
},
|
|
9195
|
+
{
|
|
9196
|
+
"kind": "method",
|
|
9197
|
+
"name": "isSupportedLabel",
|
|
9198
|
+
"privacy": "private",
|
|
9199
|
+
"return": {
|
|
9200
|
+
"type": {
|
|
9201
|
+
"text": "this is this\n & DesignTokensFor<SupportedLabels>\n & { supportedLabels: Pick<SupportedLabelTokens, Property> }"
|
|
9202
|
+
}
|
|
9203
|
+
},
|
|
9204
|
+
"parameters": [
|
|
9205
|
+
{
|
|
9206
|
+
"name": "property",
|
|
9207
|
+
"type": {
|
|
9208
|
+
"text": "Property"
|
|
9147
9209
|
}
|
|
9148
9210
|
}
|
|
9149
9211
|
],
|
|
@@ -9505,7 +9567,29 @@
|
|
|
9505
9567
|
{
|
|
9506
9568
|
"name": "property",
|
|
9507
9569
|
"type": {
|
|
9508
|
-
"text": "keyof
|
|
9570
|
+
"text": "keyof SupportedLabels & string"
|
|
9571
|
+
}
|
|
9572
|
+
}
|
|
9573
|
+
],
|
|
9574
|
+
"inheritedFrom": {
|
|
9575
|
+
"name": "LabelProviderBase",
|
|
9576
|
+
"module": "src/label-provider/base/index.ts"
|
|
9577
|
+
}
|
|
9578
|
+
},
|
|
9579
|
+
{
|
|
9580
|
+
"kind": "method",
|
|
9581
|
+
"name": "isSupportedLabel",
|
|
9582
|
+
"privacy": "private",
|
|
9583
|
+
"return": {
|
|
9584
|
+
"type": {
|
|
9585
|
+
"text": "this is this\n & DesignTokensFor<SupportedLabels>\n & { supportedLabels: Pick<SupportedLabelTokens, Property> }"
|
|
9586
|
+
}
|
|
9587
|
+
},
|
|
9588
|
+
"parameters": [
|
|
9589
|
+
{
|
|
9590
|
+
"name": "property",
|
|
9591
|
+
"type": {
|
|
9592
|
+
"text": "Property"
|
|
9509
9593
|
}
|
|
9510
9594
|
}
|
|
9511
9595
|
],
|
package/dist/custom-elements.md
CHANGED
|
@@ -1235,9 +1235,9 @@
|
|
|
1235
1235
|
|
|
1236
1236
|
### Methods
|
|
1237
1237
|
|
|
1238
|
-
| Name | Privacy | Description | Parameters
|
|
1239
|
-
| -------------- | ------- | ----------- |
|
|
1240
|
-
| `handleChange` | public | | `_element: LabelProviderBase<SupportedLabels>, property: keyof
|
|
1238
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
1239
|
+
| -------------- | ------- | ----------- | ---------------------------------------------------------------------------------------- | ------ | -------------- |
|
|
1240
|
+
| `handleChange` | public | | `_element: LabelProviderBase<SupportedLabels>, property: keyof SupportedLabels & string` | `void` | |
|
|
1241
1241
|
|
|
1242
1242
|
<hr/>
|
|
1243
1243
|
|
|
@@ -1271,9 +1271,9 @@
|
|
|
1271
1271
|
|
|
1272
1272
|
### Methods
|
|
1273
1273
|
|
|
1274
|
-
| Name | Privacy | Description | Parameters
|
|
1275
|
-
| -------------- | ------- | ----------- |
|
|
1276
|
-
| `handleChange` | public | | `_element: LabelProviderBase<SupportedLabels>, property: keyof
|
|
1274
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
1275
|
+
| -------------- | ------- | ----------- | ---------------------------------------------------------------------------------------- | ------ | ----------------- |
|
|
1276
|
+
| `handleChange` | public | | `_element: LabelProviderBase<SupportedLabels>, property: keyof SupportedLabels & string` | `void` | LabelProviderBase |
|
|
1277
1277
|
|
|
1278
1278
|
### Attributes
|
|
1279
1279
|
|
|
@@ -1316,9 +1316,9 @@
|
|
|
1316
1316
|
|
|
1317
1317
|
### Methods
|
|
1318
1318
|
|
|
1319
|
-
| Name | Privacy | Description | Parameters
|
|
1320
|
-
| -------------- | ------- | ----------- |
|
|
1321
|
-
| `handleChange` | public | | `_element: LabelProviderBase<SupportedLabels>, property: keyof
|
|
1319
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
1320
|
+
| -------------- | ------- | ----------- | ---------------------------------------------------------------------------------------- | ------ | ----------------- |
|
|
1321
|
+
| `handleChange` | public | | `_element: LabelProviderBase<SupportedLabels>, property: keyof SupportedLabels & string` | `void` | LabelProviderBase |
|
|
1322
1322
|
|
|
1323
1323
|
### Attributes
|
|
1324
1324
|
|
|
@@ -1363,9 +1363,9 @@
|
|
|
1363
1363
|
|
|
1364
1364
|
### Methods
|
|
1365
1365
|
|
|
1366
|
-
| Name | Privacy | Description | Parameters
|
|
1367
|
-
| -------------- | ------- | ----------- |
|
|
1368
|
-
| `handleChange` | public | | `_element: LabelProviderBase<SupportedLabels>, property: keyof
|
|
1366
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
1367
|
+
| -------------- | ------- | ----------- | ---------------------------------------------------------------------------------------- | ------ | ----------------- |
|
|
1368
|
+
| `handleChange` | public | | `_element: LabelProviderBase<SupportedLabels>, property: keyof SupportedLabels & string` | `void` | LabelProviderBase |
|
|
1369
1369
|
|
|
1370
1370
|
### Attributes
|
|
1371
1371
|
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { DesignToken, FoundationElement } from '@ni/fast-foundation';
|
|
2
2
|
import { type Subscriber } from '@ni/fast-element';
|
|
3
|
+
export interface SupportedLabelTokens {
|
|
4
|
+
[key: string]: DesignToken<string>;
|
|
5
|
+
}
|
|
3
6
|
export type DesignTokensFor<ObjectT> = {
|
|
4
7
|
[key in keyof ObjectT]: string | undefined;
|
|
5
8
|
};
|
|
6
9
|
/**
|
|
7
10
|
* Base class for label providers
|
|
8
11
|
*/
|
|
9
|
-
export declare abstract class LabelProviderBase<SupportedLabels extends {
|
|
10
|
-
[key: string]: DesignToken<string>;
|
|
11
|
-
}> extends FoundationElement implements Subscriber {
|
|
12
|
+
export declare abstract class LabelProviderBase<SupportedLabels extends SupportedLabelTokens> extends FoundationElement implements Subscriber {
|
|
12
13
|
protected abstract supportedLabels: SupportedLabels;
|
|
13
14
|
private readonly propertyNotifier;
|
|
14
15
|
private themeProvider?;
|
|
15
16
|
connectedCallback(): void;
|
|
16
17
|
disconnectedCallback(): void;
|
|
17
|
-
handleChange(_element: LabelProviderBase<SupportedLabels>, property: keyof
|
|
18
|
+
handleChange(_element: LabelProviderBase<SupportedLabels>, property: keyof SupportedLabels & string): void;
|
|
19
|
+
private isSupportedLabel;
|
|
18
20
|
private initializeThemeProvider;
|
|
19
21
|
}
|
|
@@ -25,7 +25,7 @@ export class LabelProviderBase extends FoundationElement {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
handleChange(_element, property) {
|
|
28
|
-
if (this.
|
|
28
|
+
if (this.isSupportedLabel(property)) {
|
|
29
29
|
const token = this.supportedLabels[property];
|
|
30
30
|
const value = this[property];
|
|
31
31
|
if (this.themeProvider) {
|
|
@@ -38,16 +38,21 @@ export class LabelProviderBase extends FoundationElement {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
+
isSupportedLabel(property) {
|
|
42
|
+
return this.supportedLabels[property] !== undefined;
|
|
43
|
+
}
|
|
41
44
|
initializeThemeProvider() {
|
|
42
45
|
this.themeProvider = this.closest(themeProviderTag) ?? undefined;
|
|
43
46
|
if (this.themeProvider) {
|
|
44
47
|
for (const [property, token] of Object.entries(this.supportedLabels)) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
if (this.isSupportedLabel(property)) {
|
|
49
|
+
const value = this[property];
|
|
50
|
+
if (value === null || value === undefined) {
|
|
51
|
+
token.deleteValueFor(this.themeProvider);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
token.setValueFor(this.themeProvider, value);
|
|
55
|
+
}
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/label-provider/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAiB,UAAU,EAAmB,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/label-provider/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAiB,UAAU,EAAmB,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAUxD;;GAEG;AACH,MAAM,OAAgB,iBAGlB,SAAQ,iBAAiB;IAH7B;;QAOqB,qBAAgB,GAAa,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IA8D/E,CAAC;IA3DmB,iBAAiB;QAC7B,KAAK,CAAC,iBAAiB,EAA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AC,gBAAgB,CAAC,IAAI,SAAS,CAAC;QACjE,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAC1C,IAAI,CAAC,eAAe,CACvB,EAAE,CAAC;gBACA,IAAI,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAClC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;oBAC7B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;wBACxC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;oBAC7C,CAAC;yBAAM,CAAC;wBACJ,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;oBACjD,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;CACJ","sourcesContent":["import { DesignToken, FoundationElement } from '@ni/fast-foundation';\nimport { type Notifier, Observable, type Subscriber } from '@ni/fast-element';\nimport { themeProviderTag } from '../../theme-provider';\n\nexport interface SupportedLabelTokens {\n [key: string]: DesignToken<string>;\n}\n\nexport type DesignTokensFor<ObjectT> = {\n [key in keyof ObjectT]: string | undefined;\n};\n\n/**\n * Base class for label providers\n */\nexport abstract class LabelProviderBase<\n SupportedLabels extends SupportedLabelTokens\n>\n extends FoundationElement\n implements Subscriber {\n protected abstract supportedLabels: SupportedLabels;\n\n private readonly propertyNotifier: Notifier = Observable.getNotifier(this);\n private themeProvider?: HTMLElement;\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.initializeThemeProvider();\n this.propertyNotifier.subscribe(this);\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.propertyNotifier.unsubscribe(this);\n if (this.themeProvider) {\n for (const token of Object.values(this.supportedLabels)) {\n token.deleteValueFor(this.themeProvider);\n }\n this.themeProvider = undefined;\n }\n }\n\n public handleChange(\n _element: LabelProviderBase<SupportedLabels>,\n property: keyof SupportedLabels & string\n ): void {\n if (this.isSupportedLabel(property)) {\n const token = this.supportedLabels[property];\n const value = this[property];\n if (this.themeProvider) {\n if (value === null || value === undefined) {\n token.deleteValueFor(this.themeProvider);\n } else {\n token.setValueFor(this.themeProvider, value);\n }\n }\n }\n }\n\n private isSupportedLabel<Property extends keyof SupportedLabels & string>(\n property: Property\n ): this is this\n & DesignTokensFor<SupportedLabels>\n & { supportedLabels: Pick<SupportedLabelTokens, Property> } {\n return this.supportedLabels[property] !== undefined;\n }\n\n private initializeThemeProvider(): void {\n this.themeProvider = this.closest(themeProviderTag) ?? undefined;\n if (this.themeProvider) {\n for (const [property, token] of Object.entries(\n this.supportedLabels\n )) {\n if (this.isSupportedLabel(property)) {\n const value = this[property];\n if (value === null || value === undefined) {\n token.deleteValueFor(this.themeProvider);\n } else {\n token.setValueFor(this.themeProvider, value);\n }\n }\n }\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ni/nimble-components",
|
|
3
|
-
"version": "35.12.
|
|
3
|
+
"version": "35.12.6",
|
|
4
4
|
"description": "Styled web components for the NI Nimble Design System",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run build:icons && npm run build:workers && npm run build:components && npm run build:scss && npm run build:cem",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"tslib": "^2.2.0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"apache-arrow": "21.
|
|
87
|
+
"apache-arrow": "21.2.0"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|