@ni/nimble-components 35.3.3 → 35.4.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.
- package/dist/all-components-bundle.js +1266 -487
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +5835 -5229
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/custom-elements.json +407 -37
- package/dist/custom-elements.md +55 -13
- package/dist/esm/anchor/styles.js +1 -1
- package/dist/esm/anchor/styles.js.map +1 -1
- package/dist/esm/anchor-step/index.d.ts +50 -2
- package/dist/esm/anchor-step/index.js +58 -3
- package/dist/esm/anchor-step/index.js.map +1 -1
- package/dist/esm/anchor-step/styles.js +8 -2
- package/dist/esm/anchor-step/styles.js.map +1 -1
- package/dist/esm/anchor-step/template.d.ts +3 -1
- package/dist/esm/anchor-step/template.js +71 -3
- package/dist/esm/anchor-step/template.js.map +1 -1
- package/dist/esm/anchor-step/types.d.ts +7 -0
- package/dist/esm/anchor-step/types.js +3 -0
- package/dist/esm/anchor-step/types.js.map +1 -0
- package/dist/esm/breadcrumb-item/styles.js +1 -1
- package/dist/esm/breadcrumb-item/styles.js.map +1 -1
- package/dist/esm/patterns/severity/styles.d.ts +1 -0
- package/dist/esm/patterns/severity/styles.js +33 -0
- package/dist/esm/patterns/severity/styles.js.map +1 -0
- package/dist/esm/patterns/severity/template.d.ts +2 -0
- package/dist/esm/patterns/severity/template.js +10 -0
- package/dist/esm/patterns/severity/template.js.map +1 -0
- package/dist/esm/patterns/severity/testing/severity-pattern.pageobject.d.ts +12 -0
- package/dist/esm/patterns/severity/testing/severity-pattern.pageobject.js +36 -0
- package/dist/esm/patterns/severity/testing/severity-pattern.pageobject.js.map +1 -0
- package/dist/esm/patterns/severity/types.d.ts +31 -0
- package/dist/esm/patterns/severity/types.js +28 -0
- package/dist/esm/patterns/severity/types.js.map +1 -0
- package/dist/esm/patterns/step/models/step-internals.d.ts +8 -0
- package/dist/esm/patterns/step/models/step-internals.js +19 -0
- package/dist/esm/patterns/step/models/step-internals.js.map +1 -0
- package/dist/esm/patterns/step/styles.d.ts +1 -0
- package/dist/esm/patterns/step/styles.js +429 -0
- package/dist/esm/patterns/step/styles.js.map +1 -0
- package/dist/esm/patterns/step/types.d.ts +20 -0
- package/dist/esm/patterns/step/types.js +2 -0
- package/dist/esm/patterns/step/types.js.map +1 -0
- package/dist/esm/step/index.d.ts +44 -2
- package/dist/esm/step/index.js +48 -3
- package/dist/esm/step/index.js.map +1 -1
- package/dist/esm/step/styles.js +10 -2
- package/dist/esm/step/styles.js.map +1 -1
- package/dist/esm/step/template.d.ts +3 -1
- package/dist/esm/step/template.js +75 -3
- package/dist/esm/step/template.js.map +1 -1
- package/dist/esm/step/types.d.ts +7 -0
- package/dist/esm/step/types.js +3 -0
- package/dist/esm/step/types.js.map +1 -0
- package/dist/esm/stepper/styles.js +6 -1
- package/dist/esm/stepper/styles.js.map +1 -1
- package/dist/esm/stepper/template.js +3 -1
- package/dist/esm/stepper/template.js.map +1 -1
- package/dist/esm/stepper/types.d.ts +5 -0
- package/dist/esm/stepper/types.js +7 -0
- package/dist/esm/stepper/types.js.map +1 -0
- package/dist/esm/theme-provider/design-token-comments.js +10 -8
- package/dist/esm/theme-provider/design-token-comments.js.map +1 -1
- package/dist/esm/theme-provider/design-token-names.js +2 -0
- package/dist/esm/theme-provider/design-token-names.js.map +1 -1
- package/dist/esm/theme-provider/design-token-values.d.ts +2 -0
- package/dist/esm/theme-provider/design-token-values.js +3 -1
- package/dist/esm/theme-provider/design-token-values.js.map +1 -1
- package/dist/esm/theme-provider/design-tokens.d.ts +2 -0
- package/dist/esm/theme-provider/design-tokens.js +2 -0
- package/dist/esm/theme-provider/design-tokens.js.map +1 -1
- package/dist/esm/utilities/models/device-pixel-ratio.d.ts +10 -0
- package/dist/esm/utilities/models/device-pixel-ratio.js +22 -0
- package/dist/esm/utilities/models/device-pixel-ratio.js.map +1 -0
- package/dist/tokens-internal.scss +12 -0
- package/dist/tokens.scss +14 -8
- package/package.json +2 -2
|
@@ -1,12 +1,60 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnchorBase } from '../anchor-base';
|
|
2
|
+
import type { StepPattern } from '../patterns/step/types';
|
|
3
|
+
import { StepInternals } from '../patterns/step/models/step-internals';
|
|
4
|
+
import { AnchorStepSeverity } from './types';
|
|
2
5
|
declare global {
|
|
3
6
|
interface HTMLElementTagNameMap {
|
|
4
7
|
'nimble-anchor-step': AnchorStep;
|
|
5
8
|
}
|
|
6
9
|
}
|
|
10
|
+
declare const AnchorStep_base: (abstract new (...args: any[]) => {
|
|
11
|
+
severity: import("../patterns/severity/types").Severity;
|
|
12
|
+
severityText?: string;
|
|
13
|
+
severityHasOverflow: boolean;
|
|
14
|
+
readonly $fastController: import("@ni/fast-element").Controller;
|
|
15
|
+
$emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): boolean | void;
|
|
16
|
+
connectedCallback(): void;
|
|
17
|
+
disconnectedCallback(): void;
|
|
18
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
19
|
+
}) & typeof AnchorBase;
|
|
7
20
|
/**
|
|
8
21
|
* A nimble-styled anchor step for a stepper
|
|
9
22
|
*/
|
|
10
|
-
export declare class AnchorStep extends
|
|
23
|
+
export declare class AnchorStep extends AnchorStep_base implements StepPattern {
|
|
24
|
+
/**
|
|
25
|
+
* @public
|
|
26
|
+
* @remarks
|
|
27
|
+
* HTML Attribute: disabled
|
|
28
|
+
*/
|
|
29
|
+
severity: AnchorStepSeverity;
|
|
30
|
+
/**
|
|
31
|
+
* @public
|
|
32
|
+
* @remarks
|
|
33
|
+
* HTML Attribute: disabled
|
|
34
|
+
*/
|
|
35
|
+
disabled: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @public
|
|
38
|
+
* @remarks
|
|
39
|
+
* HTML Attribute: readonly
|
|
40
|
+
*/
|
|
41
|
+
readOnly: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @public
|
|
44
|
+
* @remarks
|
|
45
|
+
* HTML Attribute: selected
|
|
46
|
+
*/
|
|
47
|
+
selected: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* @public
|
|
50
|
+
* @remarks
|
|
51
|
+
* HTML Attribute: tabindex
|
|
52
|
+
*/
|
|
53
|
+
tabIndex: number;
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
readonly stepInternals: StepInternals;
|
|
11
58
|
}
|
|
12
59
|
export declare const anchorStepTag = "nimble-anchor-step";
|
|
60
|
+
export {};
|
|
@@ -1,15 +1,70 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { DesignSystem } from '@ni/fast-foundation';
|
|
3
|
+
import { attr, nullableNumberConverter } from '@ni/fast-element';
|
|
2
4
|
import { styles } from './styles';
|
|
3
5
|
import { template } from './template';
|
|
6
|
+
import { AnchorBase } from '../anchor-base';
|
|
7
|
+
import { mixinSeverityPattern } from '../patterns/severity/types';
|
|
8
|
+
import { StepInternals } from '../patterns/step/models/step-internals';
|
|
9
|
+
import { AnchorStepSeverity } from './types';
|
|
4
10
|
/**
|
|
5
11
|
* A nimble-styled anchor step for a stepper
|
|
6
12
|
*/
|
|
7
|
-
export class AnchorStep extends
|
|
13
|
+
export class AnchorStep extends mixinSeverityPattern(AnchorBase) {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
/**
|
|
17
|
+
* @public
|
|
18
|
+
* @remarks
|
|
19
|
+
* HTML Attribute: disabled
|
|
20
|
+
*/
|
|
21
|
+
this.severity = AnchorStepSeverity.default;
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
* @remarks
|
|
25
|
+
* HTML Attribute: disabled
|
|
26
|
+
*/
|
|
27
|
+
this.disabled = false;
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
* @remarks
|
|
31
|
+
* HTML Attribute: readonly
|
|
32
|
+
*/
|
|
33
|
+
this.readOnly = false;
|
|
34
|
+
/**
|
|
35
|
+
* @public
|
|
36
|
+
* @remarks
|
|
37
|
+
* HTML Attribute: selected
|
|
38
|
+
*/
|
|
39
|
+
this.selected = false;
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
this.stepInternals = new StepInternals();
|
|
44
|
+
}
|
|
8
45
|
}
|
|
46
|
+
__decorate([
|
|
47
|
+
attr()
|
|
48
|
+
], AnchorStep.prototype, "severity", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
attr({ mode: 'boolean' })
|
|
51
|
+
], AnchorStep.prototype, "disabled", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
attr({ attribute: 'readonly', mode: 'boolean' })
|
|
54
|
+
], AnchorStep.prototype, "readOnly", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
attr({ mode: 'boolean' })
|
|
57
|
+
], AnchorStep.prototype, "selected", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
attr({ attribute: 'tabindex', converter: nullableNumberConverter })
|
|
60
|
+
], AnchorStep.prototype, "tabIndex", void 0);
|
|
9
61
|
const nimbleAnchorStep = AnchorStep.compose({
|
|
10
62
|
baseName: 'anchor-step',
|
|
11
63
|
template,
|
|
12
|
-
styles
|
|
64
|
+
styles,
|
|
65
|
+
shadowOptions: {
|
|
66
|
+
delegatesFocus: true
|
|
67
|
+
}
|
|
13
68
|
});
|
|
14
69
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorStep());
|
|
15
70
|
export const anchorStepTag = 'nimble-anchor-step';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/anchor-step/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/anchor-step/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAQ7C;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,oBAAoB,CAAC,UAAU,CAAC;IAAhE;;QACI;;;;WAIG;QAEI,aAAQ,GAAuB,kBAAkB,CAAC,OAAO,CAAC;QAEjE;;;;WAIG;QAEI,aAAQ,GAAG,KAAK,CAAC;QAExB;;;;WAIG;QAEI,aAAQ,GAAG,KAAK,CAAC;QAExB;;;;WAIG;QAEI,aAAQ,GAAG,KAAK,CAAC;QAUxB;;WAEG;QACa,kBAAa,GAAG,IAAI,aAAa,EAAE,CAAC;IACxD,CAAC;CAAA;AAtCU;IADN,IAAI,EAAE;4CAC0D;AAQ1D;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;4CACF;AAQjB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;4CACzB;AAQjB;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;4CACF;AAQR;IADf,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;4CAClC;AAQtC,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,CAAgB;IACvD,QAAQ,EAAE,aAAa;IACvB,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,aAAa,GAAG,oBAAoB,CAAC","sourcesContent":["import { DesignSystem, type AnchorOptions } from '@ni/fast-foundation';\nimport { attr, nullableNumberConverter } from '@ni/fast-element';\nimport { styles } from './styles';\nimport { template } from './template';\nimport { AnchorBase } from '../anchor-base';\nimport { mixinSeverityPattern } from '../patterns/severity/types';\nimport type { StepPattern } from '../patterns/step/types';\nimport { StepInternals } from '../patterns/step/models/step-internals';\nimport { AnchorStepSeverity } from './types';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-anchor-step': AnchorStep;\n }\n}\n\n/**\n * A nimble-styled anchor step for a stepper\n */\nexport class AnchorStep extends mixinSeverityPattern(AnchorBase) implements StepPattern {\n /**\n * @public\n * @remarks\n * HTML Attribute: disabled\n */\n @attr()\n public severity: AnchorStepSeverity = AnchorStepSeverity.default;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: disabled\n */\n @attr({ mode: 'boolean' })\n public disabled = false;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: readonly\n */\n @attr({ attribute: 'readonly', mode: 'boolean' })\n public readOnly = false;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: selected\n */\n @attr({ mode: 'boolean' })\n public selected = false;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: tabindex\n */\n @attr({ attribute: 'tabindex', converter: nullableNumberConverter })\n public override tabIndex!: number;\n\n /**\n * @internal\n */\n public readonly stepInternals = new StepInternals();\n}\n\nconst nimbleAnchorStep = AnchorStep.compose<AnchorOptions>({\n baseName: 'anchor-step',\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorStep());\nexport const anchorStepTag = 'nimble-anchor-step';\n"]}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { css } from '@ni/fast-element';
|
|
2
|
-
import {
|
|
2
|
+
import { styles as stepStyles } from '../patterns/step/styles';
|
|
3
3
|
export const styles = css `
|
|
4
|
-
${
|
|
4
|
+
${stepStyles}
|
|
5
|
+
${'' /* Anchor specific styles */}
|
|
6
|
+
@layer base {
|
|
7
|
+
.control {
|
|
8
|
+
text-decoration: none;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
5
11
|
`;
|
|
6
12
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/anchor-step/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/anchor-step/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,UAAU;MACV,EAAE,CAAC,4BAA4B;;;;;;CAMpC,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport { styles as stepStyles } from '../patterns/step/styles';\n\nexport const styles = css`\n ${stepStyles}\n ${'' /* Anchor specific styles */}\n @layer base {\n .control {\n text-decoration: none;\n }\n }\n`;\n"]}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { ViewTemplate } from '@ni/fast-element';
|
|
2
|
+
import { type FoundationElementTemplate, type AnchorOptions } from '@ni/fast-foundation';
|
|
1
3
|
import type { AnchorStep } from '.';
|
|
2
|
-
export declare const template:
|
|
4
|
+
export declare const template: FoundationElementTemplate<ViewTemplate<AnchorStep>, AnchorOptions>;
|
|
@@ -1,5 +1,73 @@
|
|
|
1
|
-
import { html } from '@ni/fast-element';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { html, ref, slotted, ViewTemplate, when } from '@ni/fast-element';
|
|
2
|
+
import { startSlotTemplate, endSlotTemplate } from '@ni/fast-foundation';
|
|
3
|
+
import { severityTextTemplate } from '../patterns/severity/template';
|
|
4
|
+
import { Severity } from '../patterns/severity/types';
|
|
5
|
+
import { iconExclamationMarkTag } from '../icons/exclamation-mark';
|
|
6
|
+
import { iconTriangleFilledTag } from '../icons/triangle-filled';
|
|
7
|
+
import { iconCheckTag } from '../icons/check';
|
|
8
|
+
export const template = (context, definition) => html `
|
|
9
|
+
<template slot="step">
|
|
10
|
+
<div class="
|
|
11
|
+
container
|
|
12
|
+
${x => (x.stepInternals.orientation === 'vertical' ? 'vertical' : '')}
|
|
13
|
+
${x => (x.stepInternals.last ? 'last' : '')}
|
|
14
|
+
">
|
|
15
|
+
<a
|
|
16
|
+
class="control"
|
|
17
|
+
part="control"
|
|
18
|
+
download="${x => x.download}"
|
|
19
|
+
href=${x => (x.disabled ? null : x.href)}
|
|
20
|
+
hreflang="${x => x.hreflang}"
|
|
21
|
+
ping="${x => x.ping}"
|
|
22
|
+
referrerpolicy="${x => x.referrerpolicy}"
|
|
23
|
+
rel="${x => x.rel}"
|
|
24
|
+
target="${x => x.target}"
|
|
25
|
+
type="${x => x.type}"
|
|
26
|
+
tabindex="${x => x.tabIndex}"
|
|
27
|
+
aria-atomic="${x => x.ariaAtomic}"
|
|
28
|
+
aria-busy="${x => x.ariaBusy}"
|
|
29
|
+
aria-controls="${x => x.ariaControls}"
|
|
30
|
+
aria-current="${x => x.ariaCurrent}"
|
|
31
|
+
aria-describedby="${x => x.ariaDescribedby}"
|
|
32
|
+
aria-details="${x => x.ariaDetails}"
|
|
33
|
+
aria-disabled="${x => x.ariaDisabled}"
|
|
34
|
+
aria-errormessage="${x => x.ariaErrormessage}"
|
|
35
|
+
aria-expanded="${x => x.ariaExpanded}"
|
|
36
|
+
aria-flowto="${x => x.ariaFlowto}"
|
|
37
|
+
aria-haspopup="${x => x.ariaHaspopup}"
|
|
38
|
+
aria-hidden="${x => x.ariaHidden}"
|
|
39
|
+
aria-invalid="${x => x.ariaInvalid}"
|
|
40
|
+
aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
|
|
41
|
+
aria-label="${x => x.ariaLabel}"
|
|
42
|
+
aria-labelledby="${x => x.ariaLabelledby}"
|
|
43
|
+
aria-live="${x => x.ariaLive}"
|
|
44
|
+
aria-owns="${x => x.ariaOwns}"
|
|
45
|
+
aria-relevant="${x => x.ariaRelevant}"
|
|
46
|
+
aria-roledescription="${x => x.ariaRoledescription}"
|
|
47
|
+
${ref('control')}
|
|
48
|
+
>
|
|
49
|
+
<div class="icon">
|
|
50
|
+
<div class="icon-slot"><slot ${slotted('defaultSlottedContent')}></slot></div>
|
|
51
|
+
<div class="icon-severity">
|
|
52
|
+
${when(x => x.severity === Severity.error, html `<${iconExclamationMarkTag}></${iconExclamationMarkTag}>`)}
|
|
53
|
+
${when(x => x.severity === Severity.warning, html `<${iconTriangleFilledTag}></${iconTriangleFilledTag}>`)}
|
|
54
|
+
${when(x => x.severity === Severity.success, html `<${iconCheckTag}></${iconCheckTag}>`)}
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="content">
|
|
58
|
+
<div class="title-wrapper">
|
|
59
|
+
${startSlotTemplate(context, definition)}
|
|
60
|
+
<div class="title"><slot name="title"></slot></div>
|
|
61
|
+
${endSlotTemplate(context, definition)}
|
|
62
|
+
<div class="line"></div>
|
|
63
|
+
</div>
|
|
64
|
+
<div class="subtitle">
|
|
65
|
+
<slot name="subtitle"></slot>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</a>
|
|
69
|
+
${severityTextTemplate}
|
|
70
|
+
</div>
|
|
71
|
+
</template>
|
|
4
72
|
`;
|
|
5
73
|
//# sourceMappingURL=template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/anchor-step/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/anchor-step/template.ts"],"names":[],"mappings":"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","sourcesContent":["import { html, ref, slotted, ViewTemplate, when } from '@ni/fast-element';\nimport { type FoundationElementTemplate, type AnchorOptions, startSlotTemplate, endSlotTemplate } from '@ni/fast-foundation';\nimport type { AnchorStep } from '.';\nimport { severityTextTemplate } from '../patterns/severity/template';\nimport { Severity } from '../patterns/severity/types';\nimport { iconExclamationMarkTag } from '../icons/exclamation-mark';\nimport { iconTriangleFilledTag } from '../icons/triangle-filled';\nimport { iconCheckTag } from '../icons/check';\n\nexport const template: FoundationElementTemplate<\nViewTemplate<AnchorStep>,\nAnchorOptions\n> = (context, definition) => html<AnchorStep>`\n <template slot=\"step\">\n <div class=\"\n container\n ${x => (x.stepInternals.orientation === 'vertical' ? 'vertical' : '')}\n ${x => (x.stepInternals.last ? 'last' : '')}\n \">\n <a\n class=\"control\"\n part=\"control\"\n download=\"${x => x.download}\"\n href=${x => (x.disabled ? null : x.href)}\n hreflang=\"${x => x.hreflang}\"\n ping=\"${x => x.ping}\"\n referrerpolicy=\"${x => x.referrerpolicy}\"\n rel=\"${x => x.rel}\"\n target=\"${x => x.target}\"\n type=\"${x => x.type}\"\n tabindex=\"${x => x.tabIndex}\"\n aria-atomic=\"${x => x.ariaAtomic}\"\n aria-busy=\"${x => x.ariaBusy}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-current=\"${x => x.ariaCurrent}\"\n aria-describedby=\"${x => x.ariaDescribedby}\"\n aria-details=\"${x => x.ariaDetails}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-errormessage=\"${x => x.ariaErrormessage}\"\n aria-expanded=\"${x => x.ariaExpanded}\"\n aria-flowto=\"${x => x.ariaFlowto}\"\n aria-haspopup=\"${x => x.ariaHaspopup}\"\n aria-hidden=\"${x => x.ariaHidden}\"\n aria-invalid=\"${x => x.ariaInvalid}\"\n aria-keyshortcuts=\"${x => x.ariaKeyshortcuts}\"\n aria-label=\"${x => x.ariaLabel}\"\n aria-labelledby=\"${x => x.ariaLabelledby}\"\n aria-live=\"${x => x.ariaLive}\"\n aria-owns=\"${x => x.ariaOwns}\"\n aria-relevant=\"${x => x.ariaRelevant}\"\n aria-roledescription=\"${x => x.ariaRoledescription}\"\n ${ref('control')}\n >\n <div class=\"icon\"> \n <div class=\"icon-slot\"><slot ${slotted('defaultSlottedContent')}></slot></div>\n <div class=\"icon-severity\">\n ${when(x => x.severity === Severity.error, html`<${iconExclamationMarkTag}></${iconExclamationMarkTag}>`)}\n ${when(x => x.severity === Severity.warning, html`<${iconTriangleFilledTag}></${iconTriangleFilledTag}>`)}\n ${when(x => x.severity === Severity.success, html`<${iconCheckTag}></${iconCheckTag}>`)}\n </div>\n </div>\n <div class=\"content\">\n <div class=\"title-wrapper\">\n ${startSlotTemplate(context, definition)}\n <div class=\"title\"><slot name=\"title\"></slot></div>\n ${endSlotTemplate(context, definition)}\n <div class=\"line\"></div>\n </div>\n <div class=\"subtitle\">\n <slot name=\"subtitle\"></slot>\n </div>\n </div>\n </a>\n ${severityTextTemplate}\n </div>\n </template>\n`;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/anchor-step/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC","sourcesContent":["import { Severity } from '../patterns/severity/types';\n\nexport const AnchorStepSeverity = Severity;\nexport type AnchorStepSeverity = (typeof AnchorStepSeverity)[keyof typeof AnchorStepSeverity];\n"]}
|
|
@@ -3,7 +3,7 @@ import { display } from '../utilities/style/display';
|
|
|
3
3
|
import { borderHoverColor, controlHeight, iconSize, linkActiveFontColor, linkDisabledFontColor, linkFont, linkFontColor, mediumPadding, placeholderFontColor } from '../theme-provider/design-tokens';
|
|
4
4
|
import { focusVisible } from '../utilities/style/focus';
|
|
5
5
|
export const styles = css `
|
|
6
|
-
@layer base, hover, focusVisible, active, disabled;
|
|
6
|
+
@layer base, hover, focusVisible, active, disabled, top;
|
|
7
7
|
|
|
8
8
|
@layer base {
|
|
9
9
|
${display('inline-flex')}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/breadcrumb-item/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,mBAAmB,EACnB,qBAAqB,EACrB,QAAQ,EACR,aAAa,EACb,aAAa,EACb,oBAAoB,EACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;UAIf,OAAO,CAAC,aAAa,CAAC;;;sBAGV,aAAa;;cAErB;AACE;kDACkD,CAAC,EACvD;qBACS,qBAAqB;oBACtB,QAAQ;;;;;;;;;qBASP,aAAa;;;;;;;;;;;;;;;;;;;;4BAoBN,aAAa;6BACZ,aAAa;;;;;;;;;qBASrB,QAAQ;sBACP,QAAQ;oBACV,oBAAoB;;;;;;;;;;;kBAWtB,YAAY;;;;qBAIT,gBAAgB;;;;;;qBAMhB,mBAAmB;;;;;;;;qBAQnB,qBAAqB;;;CAGzC,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport { display } from '../utilities/style/display';\nimport {\n borderHoverColor,\n controlHeight,\n iconSize,\n linkActiveFontColor,\n linkDisabledFontColor,\n linkFont,\n linkFontColor,\n mediumPadding,\n placeholderFontColor\n} from '../theme-provider/design-tokens';\nimport { focusVisible } from '../utilities/style/focus';\n\nexport const styles = css`\n @layer base, hover, focusVisible, active, disabled;\n\n @layer base {\n ${display('inline-flex')}\n\n :host {\n height: ${controlHeight};\n\n ${\n /* When href removed the .control element is also removed\n so this becomes the fallback color for the slot */ ''\n }\n color: ${linkDisabledFontColor};\n font: ${linkFont};\n }\n\n .listitem {\n display: flex;\n align-items: center;\n }\n\n .control {\n color: ${linkFontColor};\n display: flex;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n\n [part='start'] {\n display: none;\n }\n\n .content {\n pointer-events: none;\n }\n\n [part='end'] {\n display: none;\n }\n\n .separator {\n padding-left: ${mediumPadding};\n padding-right: ${mediumPadding};\n }\n\n slot[name='separator'] {\n display: flex;\n align-items: center;\n }\n\n slot[name='separator'] svg {\n width: ${iconSize};\n height: ${iconSize};\n fill: ${placeholderFontColor};\n }\n }\n\n @layer hover {\n .control:any-link:hover {\n text-decoration: underline;\n }\n }\n\n @layer focusVisible {\n .control${focusVisible} {\n outline: none;\n box-shadow: inset 0px -1px;\n text-decoration: underline;\n color: ${borderHoverColor};\n }\n }\n\n @layer active {\n .control:active {\n color: ${linkActiveFontColor};\n text-decoration: underline;\n box-shadow: none;\n }\n }\n\n @layer disabled {\n .control:not(:any-link) {\n color: ${linkDisabledFontColor};\n }\n }\n`;\n"]}
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/breadcrumb-item/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,mBAAmB,EACnB,qBAAqB,EACrB,QAAQ,EACR,aAAa,EACb,aAAa,EACb,oBAAoB,EACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;UAIf,OAAO,CAAC,aAAa,CAAC;;;sBAGV,aAAa;;cAErB;AACE;kDACkD,CAAC,EACvD;qBACS,qBAAqB;oBACtB,QAAQ;;;;;;;;;qBASP,aAAa;;;;;;;;;;;;;;;;;;;;4BAoBN,aAAa;6BACZ,aAAa;;;;;;;;;qBASrB,QAAQ;sBACP,QAAQ;oBACV,oBAAoB;;;;;;;;;;;kBAWtB,YAAY;;;;qBAIT,gBAAgB;;;;;;qBAMhB,mBAAmB;;;;;;;;qBAQnB,qBAAqB;;;CAGzC,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport { display } from '../utilities/style/display';\nimport {\n borderHoverColor,\n controlHeight,\n iconSize,\n linkActiveFontColor,\n linkDisabledFontColor,\n linkFont,\n linkFontColor,\n mediumPadding,\n placeholderFontColor\n} from '../theme-provider/design-tokens';\nimport { focusVisible } from '../utilities/style/focus';\n\nexport const styles = css`\n @layer base, hover, focusVisible, active, disabled, top;\n\n @layer base {\n ${display('inline-flex')}\n\n :host {\n height: ${controlHeight};\n\n ${\n /* When href removed the .control element is also removed\n so this becomes the fallback color for the slot */ ''\n }\n color: ${linkDisabledFontColor};\n font: ${linkFont};\n }\n\n .listitem {\n display: flex;\n align-items: center;\n }\n\n .control {\n color: ${linkFontColor};\n display: flex;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n }\n\n [part='start'] {\n display: none;\n }\n\n .content {\n pointer-events: none;\n }\n\n [part='end'] {\n display: none;\n }\n\n .separator {\n padding-left: ${mediumPadding};\n padding-right: ${mediumPadding};\n }\n\n slot[name='separator'] {\n display: flex;\n align-items: center;\n }\n\n slot[name='separator'] svg {\n width: ${iconSize};\n height: ${iconSize};\n fill: ${placeholderFontColor};\n }\n }\n\n @layer hover {\n .control:any-link:hover {\n text-decoration: underline;\n }\n }\n\n @layer focusVisible {\n .control${focusVisible} {\n outline: none;\n box-shadow: inset 0px -1px;\n text-decoration: underline;\n color: ${borderHoverColor};\n }\n }\n\n @layer active {\n .control:active {\n color: ${linkActiveFontColor};\n text-decoration: underline;\n box-shadow: none;\n }\n }\n\n @layer disabled {\n .control:not(:any-link) {\n color: ${linkDisabledFontColor};\n }\n }\n`;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@ni/fast-element").CSSDirective;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cssPartial } from '@ni/fast-element';
|
|
2
|
+
import { failColor, errorTextFontLineHeight, errorTextFont, buttonLabelFontColor, warningFontColor } from '../../theme-provider/design-tokens';
|
|
3
|
+
// These styles end up inside a @layer block so must use the
|
|
4
|
+
// cssPartial tag instead of the css tag
|
|
5
|
+
export const styles = cssPartial `
|
|
6
|
+
.severity-text {
|
|
7
|
+
display: none;
|
|
8
|
+
font: ${errorTextFont};
|
|
9
|
+
color: ${buttonLabelFontColor};
|
|
10
|
+
width: 100%;
|
|
11
|
+
position: absolute;
|
|
12
|
+
${'' /* The -2px modifier of the bottom position is to intentionally have the severity text slightly overlap the control by 2px */}
|
|
13
|
+
bottom: calc(-1 * (${errorTextFontLineHeight} - 2px));
|
|
14
|
+
left: 0px;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
text-overflow: ellipsis;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([severity="error"]) .severity-text {
|
|
21
|
+
display: block;
|
|
22
|
+
color: ${failColor};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host([severity="warning"]) .severity-text {
|
|
26
|
+
display: block;
|
|
27
|
+
color: ${warningFontColor};
|
|
28
|
+
}
|
|
29
|
+
.severity-text:empty {
|
|
30
|
+
display: none;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/patterns/severity/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACH,SAAS,EACT,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EACnB,MAAM,oCAAoC,CAAC;AAE5C,4DAA4D;AAC5D,wCAAwC;AACxC,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAA;;;gBAGhB,aAAa;iBACZ,oBAAoB;;;UAG3B,EAAE,CAAC,6HAA6H;6BAC7G,uBAAuB;;;;;;;;;iBASnC,SAAS;;;;;iBAKT,gBAAgB;;;;;CAKhC,CAAC","sourcesContent":["import { cssPartial } from '@ni/fast-element';\nimport {\n failColor,\n errorTextFontLineHeight,\n errorTextFont,\n buttonLabelFontColor,\n warningFontColor\n} from '../../theme-provider/design-tokens';\n\n// These styles end up inside a @layer block so must use the\n// cssPartial tag instead of the css tag\nexport const styles = cssPartial`\n .severity-text {\n display: none;\n font: ${errorTextFont};\n color: ${buttonLabelFontColor};\n width: 100%;\n position: absolute;\n ${'' /* The -2px modifier of the bottom position is to intentionally have the severity text slightly overlap the control by 2px */}\n bottom: calc(-1 * (${errorTextFontLineHeight} - 2px));\n left: 0px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n \n :host([severity=\"error\"]) .severity-text {\n display: block;\n color: ${failColor};\n }\n\n :host([severity=\"warning\"]) .severity-text {\n display: block;\n color: ${warningFontColor};\n }\n .severity-text:empty {\n display: none;\n }\n`;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { html } from '@ni/fast-element';
|
|
2
|
+
import { overflow } from '../../utilities/directive/overflow';
|
|
3
|
+
export const severityTextTemplate = html `
|
|
4
|
+
<div
|
|
5
|
+
class="severity-text"
|
|
6
|
+
${overflow('severityHasOverflow')}
|
|
7
|
+
title="${x => (x.severityHasOverflow && x.severityText ? x.severityText : undefined)}"
|
|
8
|
+
aria-live="polite"
|
|
9
|
+
>${x => x.severityText}</div>`;
|
|
10
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/patterns/severity/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAE9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAiB;;;UAG/C,QAAQ,CAAC,qBAAqB,CAAC;iBACxB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,mBAAmB,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;;OAErF,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,QAAQ,CAAC","sourcesContent":["import { html } from '@ni/fast-element';\nimport type { SeverityPattern } from './types';\nimport { overflow } from '../../utilities/directive/overflow';\n\nexport const severityTextTemplate = html<SeverityPattern>`\n <div\n class=\"severity-text\"\n ${overflow('severityHasOverflow')}\n title=\"${x => (x.severityHasOverflow && x.severityText ? x.severityText : undefined)}\"\n aria-live=\"polite\"\n >${x => x.severityText}</div>`;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FoundationElement } from '@ni/fast-foundation';
|
|
2
|
+
/**
|
|
3
|
+
* A page object for the elements that use the error pattern mixin.
|
|
4
|
+
*/
|
|
5
|
+
export declare class SeverityPatternPageObject {
|
|
6
|
+
private readonly element;
|
|
7
|
+
constructor(element: FoundationElement);
|
|
8
|
+
getDisplayedSeverityText(): string;
|
|
9
|
+
getSeverityTextTitle(): string;
|
|
10
|
+
dispatchEventToSeverityText(event: MouseEvent): void;
|
|
11
|
+
private getSeverityTextElement;
|
|
12
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { processUpdates } from '../../../testing/async-helpers';
|
|
2
|
+
/**
|
|
3
|
+
* A page object for the elements that use the error pattern mixin.
|
|
4
|
+
*/
|
|
5
|
+
export class SeverityPatternPageObject {
|
|
6
|
+
constructor(element) {
|
|
7
|
+
this.element = element;
|
|
8
|
+
}
|
|
9
|
+
getDisplayedSeverityText() {
|
|
10
|
+
const severityTextDiv = this.getSeverityTextElement();
|
|
11
|
+
if (!severityTextDiv
|
|
12
|
+
|| getComputedStyle(severityTextDiv).display === 'none') {
|
|
13
|
+
return '';
|
|
14
|
+
}
|
|
15
|
+
return severityTextDiv.textContent?.trim() ?? '';
|
|
16
|
+
}
|
|
17
|
+
getSeverityTextTitle() {
|
|
18
|
+
const severityTextDiv = this.getSeverityTextElement();
|
|
19
|
+
if (!severityTextDiv) {
|
|
20
|
+
throw new Error('Severity text element not found');
|
|
21
|
+
}
|
|
22
|
+
return severityTextDiv.title;
|
|
23
|
+
}
|
|
24
|
+
dispatchEventToSeverityText(event) {
|
|
25
|
+
const severityTextDiv = this.getSeverityTextElement();
|
|
26
|
+
if (!severityTextDiv) {
|
|
27
|
+
throw new Error('Severity text element not found');
|
|
28
|
+
}
|
|
29
|
+
severityTextDiv.dispatchEvent(event);
|
|
30
|
+
processUpdates();
|
|
31
|
+
}
|
|
32
|
+
getSeverityTextElement() {
|
|
33
|
+
return this.element.shadowRoot.querySelector('.severity-text');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=severity-pattern.pageobject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"severity-pattern.pageobject.js","sourceRoot":"","sources":["../../../../../src/patterns/severity/testing/severity-pattern.pageobject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAClC,YAAoC,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;IAAG,CAAC;IAE3D,wBAAwB;QAC3B,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACtD,IACI,CAAC,eAAe;eACb,gBAAgB,CAAC,eAAe,CAAC,CAAC,OAAO,KAAK,MAAM,EACzD,CAAC;YACC,OAAO,EAAE,CAAC;QACd,CAAC;QACD,OAAO,eAAe,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACrD,CAAC;IAEM,oBAAoB;QACvB,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACtD,IAAI,CAAC,eAAe,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,eAAe,CAAC,KAAK,CAAC;IACjC,CAAC;IAEM,2BAA2B,CAAC,KAAiB;QAChD,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACtD,IAAI,CAAC,eAAe,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvD,CAAC;QACD,eAAe,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACrC,cAAc,EAAE,CAAC;IACrB,CAAC;IAEO,sBAAsB;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAW,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACpE,CAAC;CACJ","sourcesContent":["import type { FoundationElement } from '@ni/fast-foundation';\nimport { processUpdates } from '../../../testing/async-helpers';\n\n/**\n * A page object for the elements that use the error pattern mixin.\n */\nexport class SeverityPatternPageObject {\n public constructor(private readonly element: FoundationElement) {}\n\n public getDisplayedSeverityText(): string {\n const severityTextDiv = this.getSeverityTextElement();\n if (\n !severityTextDiv\n || getComputedStyle(severityTextDiv).display === 'none'\n ) {\n return '';\n }\n return severityTextDiv.textContent?.trim() ?? '';\n }\n\n public getSeverityTextTitle(): string {\n const severityTextDiv = this.getSeverityTextElement();\n if (!severityTextDiv) {\n throw new Error('Severity text element not found');\n }\n return severityTextDiv.title;\n }\n\n public dispatchEventToSeverityText(event: MouseEvent): void {\n const severityTextDiv = this.getSeverityTextElement();\n if (!severityTextDiv) {\n throw new Error('Severity text element not found');\n }\n severityTextDiv.dispatchEvent(event);\n processUpdates();\n }\n\n private getSeverityTextElement(): HTMLDivElement | null {\n return this.element.shadowRoot!.querySelector('.severity-text');\n }\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FASTElement } from '@ni/fast-element';
|
|
2
|
+
export declare const Severity: {
|
|
3
|
+
readonly default: undefined;
|
|
4
|
+
readonly error: "error";
|
|
5
|
+
readonly warning: "warning";
|
|
6
|
+
readonly success: "success";
|
|
7
|
+
};
|
|
8
|
+
export type Severity = (typeof Severity)[keyof typeof Severity];
|
|
9
|
+
export interface SeverityPattern {
|
|
10
|
+
severityText?: string;
|
|
11
|
+
severity: Severity;
|
|
12
|
+
severityHasOverflow: boolean;
|
|
13
|
+
}
|
|
14
|
+
type FASTElementConstructor = abstract new (...args: any[]) => FASTElement;
|
|
15
|
+
export declare function mixinSeverityPattern<TBase extends FASTElementConstructor>(base: TBase): (abstract new (...args: any[]) => {
|
|
16
|
+
/**
|
|
17
|
+
* The severity state of the element
|
|
18
|
+
*/
|
|
19
|
+
severity: Severity;
|
|
20
|
+
/**
|
|
21
|
+
* The severity text that will be displayed when a component is not in the default severity state
|
|
22
|
+
*/
|
|
23
|
+
severityText?: string;
|
|
24
|
+
severityHasOverflow: boolean;
|
|
25
|
+
readonly $fastController: import("@ni/fast-element").Controller;
|
|
26
|
+
$emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): boolean | void;
|
|
27
|
+
connectedCallback(): void;
|
|
28
|
+
disconnectedCallback(): void;
|
|
29
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
30
|
+
}) & TBase;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { attr, FASTElement, observable } from '@ni/fast-element';
|
|
2
|
+
export const Severity = {
|
|
3
|
+
default: undefined,
|
|
4
|
+
error: 'error',
|
|
5
|
+
warning: 'warning',
|
|
6
|
+
success: 'success',
|
|
7
|
+
};
|
|
8
|
+
// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
|
|
10
|
+
export function mixinSeverityPattern(base) {
|
|
11
|
+
/**
|
|
12
|
+
* Mixin to provide severity text related properties to an element
|
|
13
|
+
*/
|
|
14
|
+
class SeverityPatternElement extends base {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
/* @internal
|
|
18
|
+
* Indicates if the severity text has overflowed its container. The value should not be
|
|
19
|
+
* set directly. Instead, it is used with the `overflow` directive.
|
|
20
|
+
*/
|
|
21
|
+
this.severityHasOverflow = false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
attr({ attribute: 'severity-text' })(SeverityPatternElement.prototype, 'severityText');
|
|
25
|
+
observable(SeverityPatternElement.prototype, 'severityHasOverflow');
|
|
26
|
+
return SeverityPatternElement;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/patterns/severity/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEjE,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;CACZ,CAAC;AAYX,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,oBAAoB,CAChC,IAAW;IAEX;;OAEG;IACH,MAAe,sBAAuB,SAAQ,IAAI;QAAlD;;YAWI;;;eAGG;YACI,wBAAmB,GAAG,KAAK,CAAC;QACvC,CAAC;KAAA;IACD,IAAI,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAChC,sBAAsB,CAAC,SAAS,EAChC,cAAc,CACjB,CAAC;IACF,UAAU,CAAC,sBAAsB,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;IACpE,OAAO,sBAAsB,CAAC;AAClC,CAAC","sourcesContent":["import { attr, FASTElement, observable } from '@ni/fast-element';\n\nexport const Severity = {\n default: undefined,\n error: 'error',\n warning: 'warning',\n success: 'success',\n} as const;\nexport type Severity = (typeof Severity)[keyof typeof Severity];\n\nexport interface SeverityPattern {\n severityText?: string;\n severity: Severity;\n severityHasOverflow: boolean;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype FASTElementConstructor = abstract new (...args: any[]) => FASTElement;\n\n// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function mixinSeverityPattern<TBase extends FASTElementConstructor>(\n base: TBase\n) {\n /**\n * Mixin to provide severity text related properties to an element\n */\n abstract class SeverityPatternElement extends base implements SeverityPattern {\n /**\n * The severity state of the element\n */\n public abstract severity: Severity;\n\n /**\n * The severity text that will be displayed when a component is not in the default severity state\n */\n public severityText?: string;\n\n /* @internal\n * Indicates if the severity text has overflowed its container. The value should not be\n * set directly. Instead, it is used with the `overflow` directive.\n */\n public severityHasOverflow = false;\n }\n attr({ attribute: 'severity-text' })(\n SeverityPatternElement.prototype,\n 'severityText'\n );\n observable(SeverityPatternElement.prototype, 'severityHasOverflow');\n return SeverityPatternElement;\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { observable } from '@ni/fast-element';
|
|
3
|
+
import { StepperOrientation } from '../../../stepper/types';
|
|
4
|
+
/**
|
|
5
|
+
* Internal properties configurable for a step
|
|
6
|
+
*/
|
|
7
|
+
export class StepInternals {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.orientation = StepperOrientation.horizontal;
|
|
10
|
+
this.last = false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
__decorate([
|
|
14
|
+
observable
|
|
15
|
+
], StepInternals.prototype, "orientation", void 0);
|
|
16
|
+
__decorate([
|
|
17
|
+
observable
|
|
18
|
+
], StepInternals.prototype, "last", void 0);
|
|
19
|
+
//# sourceMappingURL=step-internals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-internals.js","sourceRoot":"","sources":["../../../../../src/patterns/step/models/step-internals.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;GAEG;AACH,MAAM,OAAO,aAAa;IAA1B;QAEW,gBAAW,GAAuB,kBAAkB,CAAC,UAAU,CAAC;QAGhE,SAAI,GAAG,KAAK,CAAC;IACxB,CAAC;CAAA;AAJU;IADN,UAAU;kDAC4D;AAGhE;IADN,UAAU;2CACS","sourcesContent":["import { observable } from '@ni/fast-element';\nimport { StepperOrientation } from '../../../stepper/types';\n\n/**\n * Internal properties configurable for a step\n */\nexport class StepInternals {\n @observable\n public orientation: StepperOrientation = StepperOrientation.horizontal;\n\n @observable\n public last = false;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@ni/fast-element").ElementStyles;
|