@ni/nimble-components 1.0.0-beta.98 → 1.1.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.
- package/README.md +63 -3
- package/dist/esm/button/index.d.ts +16 -0
- package/dist/esm/button/index.js +23 -1
- package/dist/esm/button/index.js.map +1 -1
- package/dist/esm/button/types.d.ts +4 -5
- package/dist/esm/button/types.js +1 -10
- package/dist/esm/button/types.js.map +1 -1
- package/dist/esm/checkbox/index.d.ts +11 -1
- package/dist/esm/checkbox/index.js +8 -2
- package/dist/esm/checkbox/index.js.map +1 -1
- package/dist/esm/checkbox/styles.js +4 -4
- package/dist/esm/checkbox/styles.js.map +1 -1
- package/dist/esm/drawer/index.d.ts +7 -3
- package/dist/esm/drawer/index.js +8 -9
- package/dist/esm/drawer/index.js.map +1 -1
- package/dist/esm/drawer/styles.js +8 -7
- package/dist/esm/drawer/styles.js.map +1 -1
- package/dist/esm/drawer/types.d.ts +2 -0
- package/dist/esm/drawer/types.js.map +1 -1
- package/dist/esm/icon-base/styles.js +6 -6
- package/dist/esm/icon-base/styles.js.map +1 -1
- package/dist/esm/icon-base/template.js +1 -1
- package/dist/esm/icon-base/types.d.ts +11 -0
- package/dist/esm/icon-base/types.js +12 -0
- package/dist/esm/icon-base/types.js.map +1 -0
- package/dist/esm/icons/access-control.d.ts +5 -0
- package/dist/esm/icons/access-control.js.map +1 -1
- package/dist/esm/icons/admin.d.ts +5 -0
- package/dist/esm/icons/admin.js.map +1 -1
- package/dist/esm/icons/administration.d.ts +5 -0
- package/dist/esm/icons/administration.js.map +1 -1
- package/dist/esm/icons/all-icons.d.ts +11 -0
- package/dist/esm/icons/all-icons.js +11 -0
- package/dist/esm/icons/all-icons.js.map +1 -1
- package/dist/esm/icons/check.d.ts +5 -0
- package/dist/esm/icons/check.js.map +1 -1
- package/dist/esm/icons/custom-applications.d.ts +5 -0
- package/dist/esm/icons/custom-applications.js.map +1 -1
- package/dist/esm/icons/custom-status.d.ts +12 -0
- package/dist/esm/icons/custom-status.js +12 -0
- package/dist/esm/icons/custom-status.js.map +1 -0
- package/dist/esm/icons/delete.d.ts +5 -0
- package/dist/esm/icons/delete.js.map +1 -1
- package/dist/esm/icons/done.d.ts +12 -0
- package/dist/esm/icons/done.js +12 -0
- package/dist/esm/icons/done.js.map +1 -0
- package/dist/esm/icons/fail.d.ts +12 -0
- package/dist/esm/icons/fail.js +12 -0
- package/dist/esm/icons/fail.js.map +1 -0
- package/dist/esm/icons/login.d.ts +5 -0
- package/dist/esm/icons/login.js.map +1 -1
- package/dist/esm/icons/logout.d.ts +5 -0
- package/dist/esm/icons/logout.js.map +1 -1
- package/dist/esm/icons/looping.d.ts +12 -0
- package/dist/esm/icons/looping.js +12 -0
- package/dist/esm/icons/looping.js.map +1 -0
- package/dist/esm/icons/managed-systems.d.ts +5 -0
- package/dist/esm/icons/managed-systems.js.map +1 -1
- package/dist/esm/icons/measurement-data-analysis.d.ts +5 -0
- package/dist/esm/icons/measurement-data-analysis.js.map +1 -1
- package/dist/esm/icons/running.d.ts +12 -0
- package/dist/esm/icons/running.js +12 -0
- package/dist/esm/icons/running.js.map +1 -0
- package/dist/esm/icons/settings.d.ts +5 -0
- package/dist/esm/icons/settings.js.map +1 -1
- package/dist/esm/icons/skipped.d.ts +12 -0
- package/dist/esm/icons/skipped.js +12 -0
- package/dist/esm/icons/skipped.js.map +1 -0
- package/dist/esm/icons/status.d.ts +12 -0
- package/dist/esm/icons/status.js +12 -0
- package/dist/esm/icons/status.js.map +1 -0
- package/dist/esm/icons/succeeded.d.ts +12 -0
- package/dist/esm/icons/succeeded.js +12 -0
- package/dist/esm/icons/succeeded.js.map +1 -0
- package/dist/esm/icons/terminated.d.ts +12 -0
- package/dist/esm/icons/terminated.js +12 -0
- package/dist/esm/icons/terminated.js.map +1 -0
- package/dist/esm/icons/test-insights.d.ts +5 -0
- package/dist/esm/icons/test-insights.js.map +1 -1
- package/dist/esm/icons/timed-out.d.ts +12 -0
- package/dist/esm/icons/timed-out.js +12 -0
- package/dist/esm/icons/timed-out.js.map +1 -0
- package/dist/esm/icons/utilities.d.ts +5 -0
- package/dist/esm/icons/utilities.js.map +1 -1
- package/dist/esm/icons/waiting.d.ts +12 -0
- package/dist/esm/icons/waiting.js +12 -0
- package/dist/esm/icons/waiting.js.map +1 -0
- package/dist/esm/listbox-option/index.d.ts +5 -0
- package/dist/esm/listbox-option/index.js +2 -0
- package/dist/esm/listbox-option/index.js.map +1 -1
- package/dist/esm/menu/index.d.ts +8 -1
- package/dist/esm/menu/index.js +5 -2
- package/dist/esm/menu/index.js.map +1 -1
- package/dist/esm/menu-item/index.d.ts +9 -12
- package/dist/esm/menu-item/index.js +5 -2
- package/dist/esm/menu-item/index.js.map +1 -1
- package/dist/esm/nimble-components/src/button/index.d.ts +33 -0
- package/dist/esm/nimble-components/src/button/types.d.ts +8 -0
- package/dist/esm/nimble-components/src/checkbox/index.d.ts +12 -0
- package/dist/esm/{button → nimble-components/src/checkbox}/styles.d.ts +0 -0
- package/dist/esm/nimble-components/src/drawer/animations.d.ts +14 -0
- package/dist/esm/nimble-components/src/drawer/index.d.ts +43 -0
- package/dist/esm/nimble-components/src/drawer/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/drawer/types.d.ts +12 -0
- package/dist/esm/nimble-components/src/icon-base/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/icon-base/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/icon-base/template.d.ts +2 -0
- package/dist/esm/nimble-components/src/icon-base/types.d.ts +11 -0
- package/dist/esm/nimble-components/src/icons/access-control.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/admin.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/administration.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/all-icons.d.ts +24 -0
- package/dist/esm/nimble-components/src/icons/check.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/custom-applications.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/custom-status.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/delete.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/done.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/fail.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/login.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/logout.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/looping.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/managed-systems.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/measurement-data-analysis.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/running.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/settings.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/skipped.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/status.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/succeeded.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/terminated.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/test-insights.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/timed-out.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/utilities.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/waiting.d.ts +12 -0
- package/dist/esm/nimble-components/src/listbox-option/index.d.ts +15 -0
- package/dist/esm/nimble-components/src/listbox-option/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/menu/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/menu/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/menu-item/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/menu-item/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/number-field/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/number-field/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/patterns/button/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/patterns/button/types.d.ts +10 -0
- package/dist/esm/nimble-components/src/select/index.d.ts +16 -0
- package/dist/esm/nimble-components/src/select/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/tab/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/tab/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/tab-panel/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/tab-panel/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/tabs/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/tabs/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/tabs-toolbar/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/tabs-toolbar/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/tabs-toolbar/template.d.ts +1 -0
- package/dist/esm/nimble-components/src/testing/async-helpers.d.ts +10 -0
- package/dist/esm/nimble-components/src/text-field/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/text-field/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/text-field/types.d.ts +3 -0
- package/dist/esm/nimble-components/src/theme-provider/design-token-comments.d.ts +6 -0
- package/dist/esm/nimble-components/src/theme-provider/design-token-names.d.ts +11 -0
- package/dist/esm/nimble-components/src/theme-provider/design-tokens.d.ts +42 -0
- package/dist/esm/nimble-components/src/theme-provider/index.d.ts +22 -0
- package/dist/esm/nimble-components/src/theme-provider/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/theme-provider/template.d.ts +2 -0
- package/dist/esm/{theme-provider/themes.d.ts → nimble-components/src/theme-provider/types.d.ts} +2 -1
- package/dist/esm/nimble-components/src/toggle-button/index.d.ts +33 -0
- package/dist/esm/nimble-components/src/toggle-button/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/toggle-button/template.d.ts +2 -0
- package/dist/esm/nimble-components/src/toggle-button/types.d.ts +6 -0
- package/dist/esm/nimble-components/src/tree-item/index.d.ts +34 -0
- package/dist/esm/nimble-components/src/tree-item/styles.d.ts +3 -0
- package/dist/esm/nimble-components/src/tree-view/index.d.ts +22 -0
- package/dist/esm/nimble-components/src/tree-view/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/tree-view/types.d.ts +7 -0
- package/dist/esm/{button/behaviors.d.ts → nimble-components/src/utilities/style/appearance.d.ts} +1 -1
- package/dist/esm/nimble-components/src/utilities/style/direction.d.ts +34 -0
- package/dist/esm/nimble-components/src/utilities/style/focus.d.ts +11 -0
- package/dist/esm/nimble-components/src/utilities/style/prefers-reduced-motion.d.ts +4 -0
- package/dist/esm/nimble-components/src/utilities/style/theme.d.ts +44 -0
- package/dist/esm/number-field/index.d.ts +8 -2
- package/dist/esm/number-field/index.js +8 -1
- package/dist/esm/number-field/index.js.map +1 -1
- package/dist/esm/number-field/styles.js +3 -3
- package/dist/esm/number-field/styles.js.map +1 -1
- package/dist/esm/patterns/button/styles.d.ts +1 -0
- package/dist/esm/{button → patterns/button}/styles.js +24 -14
- package/dist/esm/patterns/button/styles.js.map +1 -0
- package/dist/esm/patterns/button/types.d.ts +10 -0
- package/dist/esm/patterns/button/types.js +11 -0
- package/dist/esm/patterns/button/types.js.map +1 -0
- package/dist/esm/select/index.d.ts +6 -2
- package/dist/esm/select/index.js +9 -5
- package/dist/esm/select/index.js.map +1 -1
- package/dist/esm/tab/index.d.ts +11 -1
- package/dist/esm/tab/index.js +8 -1
- package/dist/esm/tab/index.js.map +1 -1
- package/dist/esm/tab-panel/index.d.ts +11 -1
- package/dist/esm/tab-panel/index.js +8 -1
- package/dist/esm/tab-panel/index.js.map +1 -1
- package/dist/esm/tabs/index.d.ts +11 -1
- package/dist/esm/tabs/index.js +8 -1
- package/dist/esm/tabs/index.js.map +1 -1
- package/dist/esm/tabs-toolbar/index.d.ts +7 -1
- package/dist/esm/tabs-toolbar/index.js +1 -1
- package/dist/esm/tabs-toolbar/index.js.map +1 -1
- package/dist/esm/tabs-toolbar/styles.js +3 -2
- package/dist/esm/tabs-toolbar/styles.js.map +1 -1
- package/dist/esm/testing/async-helpers.d.ts +10 -0
- package/dist/esm/testing/async-helpers.js +12 -0
- package/dist/esm/testing/async-helpers.js.map +1 -0
- package/dist/esm/text-field/index.d.ts +8 -2
- package/dist/esm/text-field/index.js +8 -1
- package/dist/esm/text-field/index.js.map +1 -1
- package/dist/esm/text-field/styles.js +20 -8
- package/dist/esm/text-field/styles.js.map +1 -1
- package/dist/esm/text-field/types.d.ts +3 -0
- package/dist/esm/text-field/types.js +3 -0
- package/dist/esm/text-field/types.js.map +1 -0
- package/dist/esm/theme-provider/design-token-comments.d.ts +6 -0
- package/dist/esm/theme-provider/design-token-comments.js +45 -0
- package/dist/esm/theme-provider/design-token-comments.js.map +1 -0
- package/dist/esm/theme-provider/design-token-names.d.ts +11 -0
- package/dist/esm/theme-provider/design-token-names.js +51 -0
- package/dist/esm/theme-provider/design-token-names.js.map +1 -0
- package/dist/esm/theme-provider/design-tokens.d.ts +4 -10
- package/dist/esm/theme-provider/design-tokens.js +94 -109
- package/dist/esm/theme-provider/design-tokens.js.map +1 -1
- package/dist/esm/theme-provider/index.d.ts +18 -6
- package/dist/esm/theme-provider/index.js +51 -26
- package/dist/esm/theme-provider/index.js.map +1 -1
- package/dist/esm/theme-provider/styles.d.ts +1 -0
- package/dist/esm/theme-provider/styles.js +7 -0
- package/dist/esm/theme-provider/styles.js.map +1 -0
- package/dist/esm/theme-provider/template.d.ts +2 -2
- package/dist/esm/theme-provider/template.js.map +1 -1
- package/dist/esm/theme-provider/types.d.ts +7 -0
- package/dist/esm/theme-provider/types.js +8 -0
- package/dist/esm/theme-provider/types.js.map +1 -0
- package/dist/esm/toggle-button/index.d.ts +33 -0
- package/dist/esm/toggle-button/index.js +43 -0
- package/dist/esm/toggle-button/index.js.map +1 -0
- package/dist/esm/toggle-button/styles.d.ts +1 -0
- package/dist/esm/toggle-button/styles.js +31 -0
- package/dist/esm/toggle-button/styles.js.map +1 -0
- package/dist/esm/toggle-button/template.d.ts +2 -0
- package/dist/esm/toggle-button/template.js +25 -0
- package/dist/esm/toggle-button/template.js.map +1 -0
- package/dist/esm/toggle-button/types.d.ts +6 -0
- package/dist/esm/toggle-button/types.js +2 -0
- package/dist/esm/toggle-button/types.js.map +1 -0
- package/dist/esm/tree-item/index.d.ts +7 -1
- package/dist/esm/tree-item/index.js +13 -12
- package/dist/esm/tree-item/index.js.map +1 -1
- package/dist/esm/tree-item/styles.js +9 -7
- package/dist/esm/tree-item/styles.js.map +1 -1
- package/dist/esm/tree-view/index.d.ts +9 -3
- package/dist/esm/tree-view/index.js +4 -3
- package/dist/esm/tree-view/index.js.map +1 -1
- package/dist/esm/tree-view/types.d.ts +2 -1
- package/dist/esm/tree-view/types.js +5 -5
- package/dist/esm/tree-view/types.js.map +1 -1
- package/dist/esm/utilities/style/appearance.d.ts +12 -0
- package/dist/esm/{button/behaviors.js → utilities/style/appearance.js} +1 -1
- package/dist/esm/utilities/style/appearance.js.map +1 -0
- package/dist/esm/utilities/style/direction.d.ts +34 -0
- package/dist/esm/utilities/style/direction.js +78 -0
- package/dist/esm/utilities/style/direction.js.map +1 -0
- package/dist/esm/utilities/style/focus.js +1 -1
- package/dist/esm/utilities/style/focus.js.map +1 -1
- package/dist/esm/utilities/style/prefers-reduced-motion.d.ts +4 -0
- package/dist/esm/utilities/style/prefers-reduced-motion.js +5 -0
- package/dist/esm/utilities/style/prefers-reduced-motion.js.map +1 -0
- package/dist/esm/utilities/style/theme.d.ts +44 -0
- package/dist/esm/utilities/style/theme.js +116 -0
- package/dist/esm/utilities/style/theme.js.map +1 -0
- package/dist/fonts.scss +3 -0
- package/dist/tokens-internal.scss +255 -0
- package/dist/tokens.scss +132 -0
- package/package.json +29 -20
- package/dist/esm/button/behaviors.js.map +0 -1
- package/dist/esm/button/styles.js.map +0 -1
- package/dist/esm/testing/dom-next-update.d.ts +0 -4
- package/dist/esm/testing/dom-next-update.js +0 -6
- package/dist/esm/testing/dom-next-update.js.map +0 -1
- package/dist/esm/theme-provider/themes.js +0 -8
- package/dist/esm/theme-provider/themes.js.map +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr } from '@microsoft/fast-element';
|
|
3
|
+
import { DesignSystem, Switch as FoundationSwitch } from '@microsoft/fast-foundation';
|
|
4
|
+
import { styles } from './styles';
|
|
5
|
+
import { template } from './template';
|
|
6
|
+
import { ButtonAppearance } from '../patterns/button/types';
|
|
7
|
+
/**
|
|
8
|
+
* A nimble-styled toggle button control.
|
|
9
|
+
*/
|
|
10
|
+
class ToggleButton extends FoundationSwitch {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/**
|
|
14
|
+
* Specify as 'true' to hide the text content of the button. The button will
|
|
15
|
+
* become square, and the text content will be used as the label of the button
|
|
16
|
+
* for accessibility purposes.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
* @remarks
|
|
20
|
+
* HTML Attribute: content-hidden
|
|
21
|
+
*/
|
|
22
|
+
this.contentHidden = false;
|
|
23
|
+
}
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
super.connectedCallback();
|
|
26
|
+
if (!this.appearance) {
|
|
27
|
+
this.appearance = ButtonAppearance.Outline;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
__decorate([
|
|
32
|
+
attr
|
|
33
|
+
], ToggleButton.prototype, "appearance", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
attr({ attribute: 'content-hidden', mode: 'boolean' })
|
|
36
|
+
], ToggleButton.prototype, "contentHidden", void 0);
|
|
37
|
+
const nimbleToggleButton = ToggleButton.compose({
|
|
38
|
+
baseName: 'toggle-button',
|
|
39
|
+
template,
|
|
40
|
+
styles
|
|
41
|
+
});
|
|
42
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleToggleButton());
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/toggle-button/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACH,YAAY,EACZ,MAAM,IAAI,gBAAgB,EAE7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAU5D;;GAEG;AACH,MAAM,YAAa,SAAQ,gBAAgB;IAA3C;;QAWI;;;;;;;;WAQG;QAEI,kBAAa,GAAG,KAAK,CAAC;IAUjC,CAAC;IANU,iBAAiB;QACpB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC;SAC9C;IACL,CAAC;CACJ;AAtBG;IADC,IAAI;gDACgC;AAYrC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;mDAC1B;AAYjC,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,CAAgB;IAC3D,QAAQ,EAAE,eAAe;IACzB,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@microsoft/fast-element").ElementStyles;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { focusVisible } from '../utilities/style/focus';
|
|
3
|
+
import { fillColorSelected } from '../theme-provider/design-tokens';
|
|
4
|
+
import { styles as buttonStyles } from '../patterns/button/styles';
|
|
5
|
+
export const styles = css `
|
|
6
|
+
${buttonStyles}
|
|
7
|
+
|
|
8
|
+
.control[aria-pressed='true'] {
|
|
9
|
+
background-color: ${fillColorSelected};
|
|
10
|
+
border-color: ${fillColorSelected};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.control[aria-pressed='true']:hover {
|
|
14
|
+
background-color: ${fillColorSelected};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.control[aria-pressed='true']${focusVisible} {
|
|
18
|
+
background-color: ${fillColorSelected};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.control[aria-pressed='true'][disabled] {
|
|
22
|
+
background-color: ${fillColorSelected};
|
|
23
|
+
border-color: ${fillColorSelected};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.control[aria-pressed='true'][disabled]:hover {
|
|
27
|
+
background-color: ${fillColorSelected};
|
|
28
|
+
border-color: ${fillColorSelected};
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/toggle-button/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,YAAY;;;4BAGU,iBAAiB;wBACrB,iBAAiB;;;;4BAIb,iBAAiB;;;mCAGV,YAAY;4BACnB,iBAAiB;;;;4BAIjB,iBAAiB;wBACrB,iBAAiB;;;;4BAIb,iBAAiB;wBACrB,iBAAiB;;CAExC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { html, ref } from '@microsoft/fast-element';
|
|
2
|
+
export const template = html `
|
|
3
|
+
<div
|
|
4
|
+
role="button"
|
|
5
|
+
part="control"
|
|
6
|
+
aria-pressed="${(x) => x.checked}"
|
|
7
|
+
aria-disabled="${(x) => x.disabled}"
|
|
8
|
+
aria-readonly="${(x) => x.readOnly}"
|
|
9
|
+
aria-labelledby="nimble-toggle-button-content"
|
|
10
|
+
tabindex="${(x) => (x.disabled ? null : 0)}"
|
|
11
|
+
@keypress="${(x, c) => x.keypressHandler(c.event)}"
|
|
12
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
13
|
+
class="control ${(x) => (x.checked ? 'checked' : '')}"
|
|
14
|
+
?disabled="${x => x.disabled}"
|
|
15
|
+
${ref('control')}
|
|
16
|
+
>
|
|
17
|
+
<span part="start" class="start">
|
|
18
|
+
<slot name="start"></slot>
|
|
19
|
+
</span>
|
|
20
|
+
<span class="content" part="content" id="nimble-toggle-button-content">
|
|
21
|
+
<slot></slot>
|
|
22
|
+
</span>
|
|
23
|
+
</div>
|
|
24
|
+
`;
|
|
25
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/toggle-button/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAGpD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAc;;;;wBAIlB,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO;yBAC7B,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ;yBAC/B,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ;;oBAEpC,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;qBAC3C,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,KAAsB,CAAC;kBACxD,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAmB,CAAC;yBACxC,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;qBACrD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;UAC1B,GAAG,CAAC,SAAS,CAAC;;;;;;;;;CASvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/toggle-button/types.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { TreeItem as FoundationTreeItem } from '@microsoft/fast-foundation';
|
|
2
|
+
export type { TreeItem };
|
|
3
|
+
declare global {
|
|
4
|
+
interface HTMLElementTagNameMap {
|
|
5
|
+
'nimble-tree-item': TreeItem;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
2
8
|
/**
|
|
3
9
|
* A function that returns a nimble-tree-item registration for configuring the component with a DesignSystem.
|
|
4
10
|
* Implements {@link @microsoft/fast-foundation#treeItemTemplate}
|
|
@@ -9,7 +15,7 @@ import { TreeItem as FoundationTreeItem } from '@microsoft/fast-foundation';
|
|
|
9
15
|
* Generates HTML Element: \<nimble-tree-item\>
|
|
10
16
|
*
|
|
11
17
|
*/
|
|
12
|
-
|
|
18
|
+
declare class TreeItem extends FoundationTreeItem {
|
|
13
19
|
private treeView;
|
|
14
20
|
constructor();
|
|
15
21
|
connectedCallback(): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { treeItemTemplate as template, TreeItem as FoundationTreeItem, DesignSystem } from '@microsoft/fast-foundation';
|
|
2
2
|
import { controlsArrowExpanderUp16X16 } from '@ni/nimble-tokens/dist-icons-esm/nimble-icons-inline';
|
|
3
|
-
import { groupSelectedAttribute,
|
|
3
|
+
import { groupSelectedAttribute, TreeViewSelectionMode } from '../tree-view/types';
|
|
4
4
|
import { styles } from './styles';
|
|
5
5
|
/**
|
|
6
6
|
* A function that returns a nimble-tree-item registration for configuring the component with a DesignSystem.
|
|
@@ -12,9 +12,10 @@ import { styles } from './styles';
|
|
|
12
12
|
* Generates HTML Element: \<nimble-tree-item\>
|
|
13
13
|
*
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
class TreeItem extends FoundationTreeItem {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
|
+
this.treeView = null;
|
|
18
19
|
this.handleClickOverride = (event) => {
|
|
19
20
|
if (event.composedPath().includes(this.expandCollapseButton)) {
|
|
20
21
|
// just have base class handle click event for glyph
|
|
@@ -26,32 +27,30 @@ export class TreeItem extends FoundationTreeItem {
|
|
|
26
27
|
event.stopImmediatePropagation();
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
|
-
const leavesOnly = this.treeView?.selectionMode ===
|
|
30
|
+
const leavesOnly = this.treeView?.selectionMode === TreeViewSelectionMode.LeavesOnly;
|
|
30
31
|
const hasChildren = this.hasChildTreeItems();
|
|
31
32
|
if ((leavesOnly && !hasChildren) || !leavesOnly) {
|
|
32
33
|
// if either a leaf tree item, or in a mode that supports select on groups,
|
|
33
34
|
// process click as a select
|
|
34
|
-
this.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
event.stopImmediatePropagation();
|
|
35
|
+
if (!this.selected) {
|
|
36
|
+
this.selected = true;
|
|
37
|
+
this.$emit('selected-change', this);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
41
|
// implicit hasChildren && leavesOnly, so only allow expand/collapse, not select
|
|
42
42
|
this.expanded = !this.expanded;
|
|
43
43
|
this.$emit('expanded-change', this);
|
|
44
|
-
// don't allow base class to process click event, as all we want to happen
|
|
45
|
-
// here is toggling 'expanded', and to issue the expanded-change event
|
|
46
|
-
event.stopImmediatePropagation();
|
|
47
44
|
}
|
|
45
|
+
// don't allow base class to process click event
|
|
46
|
+
event.stopImmediatePropagation();
|
|
48
47
|
};
|
|
49
48
|
// This prevents the toggling of selected state when a TreeItem is clicked multiple times,
|
|
50
49
|
// which is what the FAST TreeItem allows
|
|
51
50
|
this.handleSelectedChange = (event) => {
|
|
52
51
|
// only process selection
|
|
53
|
-
if (event.target === this) {
|
|
54
|
-
this.
|
|
52
|
+
if (event.target === this && this.selected) {
|
|
53
|
+
this.setGroupSelectionOnRootParentTreeItem(this);
|
|
55
54
|
}
|
|
56
55
|
};
|
|
57
56
|
this.addEventListener('click', this.handleClickOverride);
|
|
@@ -108,7 +107,9 @@ export class TreeItem extends FoundationTreeItem {
|
|
|
108
107
|
const nimbleTreeItem = TreeItem.compose({
|
|
109
108
|
baseName: 'tree-item',
|
|
110
109
|
baseClass: FoundationTreeItem,
|
|
110
|
+
// @ts-expect-error FAST templates have incorrect type, see: https://github.com/microsoft/fast/issues/5047
|
|
111
111
|
template,
|
|
112
|
+
// @ts-expect-error FAST styles have incorrect type, see: https://github.com/microsoft/fast/issues/5047
|
|
112
113
|
styles,
|
|
113
114
|
expandCollapseGlyph: controlsArrowExpanderUp16X16.data
|
|
114
115
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tree-item/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,IAAI,QAAQ,EAC5B,QAAQ,IAAI,kBAAkB,EAE9B,YAAY,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AAEpG,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tree-item/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DirectionalStyleSheetBehavior } from '@microsoft/fast-components';
|
|
2
1
|
import { css } from '@microsoft/fast-element';
|
|
3
2
|
import { display, TreeItem } from '@microsoft/fast-foundation';
|
|
4
3
|
import { focusVisible } from '../utilities/style/focus';
|
|
5
4
|
import { contentFontColor, fontFamily, borderColorHover, fillColorSelected, contentFontSize, fillColorHover, fillColorSelectedHover, borderWidth, iconSize } from '../theme-provider/design-tokens';
|
|
6
5
|
import { groupSelectedAttribute } from '../tree-view/types';
|
|
6
|
+
import { DirectionalStyleSheetBehavior } from '../utilities/style/direction';
|
|
7
7
|
export const styles = (context) => css `
|
|
8
8
|
${display('block')}
|
|
9
9
|
|
|
@@ -14,7 +14,7 @@ export const styles = (context) => css `
|
|
|
14
14
|
color: ${contentFontColor};
|
|
15
15
|
cursor: pointer;
|
|
16
16
|
font-family: ${fontFamily};
|
|
17
|
-
--tree-item-nested-width: 0;
|
|
17
|
+
--ni-private-tree-item-nested-width: 0;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
${ /* this controls the side border */''}
|
|
@@ -57,7 +57,7 @@ export const styles = (context) => css `
|
|
|
57
57
|
.positioning-region::before {
|
|
58
58
|
content: '';
|
|
59
59
|
display: block;
|
|
60
|
-
width: var(--tree-item-nested-width);
|
|
60
|
+
width: var(--ni-private-tree-item-nested-width);
|
|
61
61
|
flex-shrink: 0;
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -131,8 +131,10 @@ export const styles = (context) => css `
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
::slotted(${context.tagFor(TreeItem)}) {
|
|
134
|
-
--tree-item-nested-width: 1em;
|
|
135
|
-
--expand-collapse-button-nested-width: calc(
|
|
134
|
+
--ni-private-tree-item-nested-width: 1em;
|
|
135
|
+
--ni-private-expand-collapse-button-nested-width: calc(
|
|
136
|
+
${iconSize} * -1
|
|
137
|
+
);
|
|
136
138
|
}
|
|
137
139
|
|
|
138
140
|
${
|
|
@@ -163,7 +165,7 @@ export const styles = (context) => css `
|
|
|
163
165
|
${ /* ltr styles */''}
|
|
164
166
|
:host(.nested) .expand-collapse-button {
|
|
165
167
|
left: var(
|
|
166
|
-
--expand-collapse-button-nested-width,
|
|
168
|
+
--ni-private-expand-collapse-button-nested-width,
|
|
167
169
|
calc(${iconSize} * -1)
|
|
168
170
|
);
|
|
169
171
|
}
|
|
@@ -179,7 +181,7 @@ export const styles = (context) => css `
|
|
|
179
181
|
${ /* rtl styles */''}
|
|
180
182
|
:host(.nested) .expand-collapse-button {
|
|
181
183
|
right: var(
|
|
182
|
-
--expand-collapse-button-nested-width,
|
|
184
|
+
--ni-private-expand-collapse-button-nested-width,
|
|
183
185
|
calc(${iconSize} * -1)
|
|
184
186
|
);
|
|
185
187
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/tree-item/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/tree-item/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAiB,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACH,OAAO,EAEP,QAAQ,EAEX,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EACH,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,WAAW,EACX,QAAQ,EACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAE7E,MAAM,CAAC,MAAM,MAAM,GAGE,CAAC,OAAiC,EAAE,EAAE,CAAC,GAAG,CAAA;UACrD,OAAO,CAAC,OAAO,CAAC;;;;;;qBAML,gBAAgB;;2BAEV,UAAU;;;;UAI3B,CAAA,mCAAoC,EAAE;iBAC/B,sBAAsB;0BACb,gBAAgB;;;;;;0BAMhB,WAAW;2BACV,QAAQ;;;;;;;2BAOR,QAAQ;;;;0BAIT,cAAc;;;gBAGxB,YAAY;sCACU,WAAW,IAAI,gBAAgB;uBAC9C,WAAW,UAAU,gBAAgB;;;;;0BAKlC,iBAAiB;;;;0BAIjB,sBAAsB;;;;;;;;;;;;;;;;yBAgBvB,eAAe;;;;gBAIxB,YAAY;;;;;;mCAMO,QAAQ;;;;;;;;;;;;qBAYtB,QAAQ;sBACP,QAAQ;;;;;;;;;;;;;qBAaT,QAAQ;sBACP,QAAQ;;;;;;UAMpB;AACE,wEAAwE,CAAC,EAC7E;;qBAEa,QAAQ;;;UAGnB;AACE,uEAAuE,CAAC,EAC5E;;;;mCAI2B,QAAQ;iCACV,QAAQ;;;;qBAIpB,QAAQ;sBACP,QAAQ;;;oBAGV,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;;;kBAG1B,QAAQ;;;;UAIhB;AACE,qEAAqE,CAAC,EAC1E;;;;mCAI2B,QAAQ;;;;;cAK7B;AACE;;;;GAIG,CAAC,EACR;qCACyB,QAAQ;;;;;;KAMxC;IACL,kBAAkB;KACb,aAAa,CACV,IAAI,6BAA6B,CAC7B,GAAG,CAAA;sBACO,CAAA,gBAAiB,EAAE;;;;mCAIN,QAAQ;;;;;;;;;;;iBAW1B,EACL,GAAG,CAAA;sBACO,CAAA,gBAAiB,EAAE;;;;mCAIN,QAAQ;;;;;;;;;;;iBAW1B,CACR,CACJ,CAAC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { TreeView as FoundationTreeView } from '@microsoft/fast-foundation';
|
|
2
|
-
import {
|
|
2
|
+
import { TreeViewSelectionMode } from './types';
|
|
3
|
+
export type { TreeView };
|
|
4
|
+
declare global {
|
|
5
|
+
interface HTMLElementTagNameMap {
|
|
6
|
+
'nimble-tree-view': TreeView;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
3
9
|
/**
|
|
4
10
|
* A function that returns a nimble-tree-view registration for configuring the component with a DesignSystem.
|
|
5
11
|
* Implements {@link @microsoft/fast-foundation#treeViewTemplate}
|
|
@@ -10,7 +16,7 @@ import { SelectionMode } from './types';
|
|
|
10
16
|
* Generates HTML Element: \<nimble-tree-view\>
|
|
11
17
|
*
|
|
12
18
|
*/
|
|
13
|
-
|
|
14
|
-
selectionMode:
|
|
19
|
+
declare class TreeView extends FoundationTreeView {
|
|
20
|
+
selectionMode: TreeViewSelectionMode;
|
|
15
21
|
connectedCallback(): void;
|
|
16
22
|
}
|
|
@@ -2,7 +2,7 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { attr } from '@microsoft/fast-element';
|
|
3
3
|
import { treeViewTemplate as template, TreeView as FoundationTreeView, DesignSystem } from '@microsoft/fast-foundation';
|
|
4
4
|
import { styles } from './styles';
|
|
5
|
-
import {
|
|
5
|
+
import { TreeViewSelectionMode } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* A function that returns a nimble-tree-view registration for configuring the component with a DesignSystem.
|
|
8
8
|
* Implements {@link @microsoft/fast-foundation#treeViewTemplate}
|
|
@@ -13,11 +13,11 @@ import { SelectionMode } from './types';
|
|
|
13
13
|
* Generates HTML Element: \<nimble-tree-view\>
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
class TreeView extends FoundationTreeView {
|
|
17
17
|
connectedCallback() {
|
|
18
18
|
super.connectedCallback();
|
|
19
19
|
if (!this.selectionMode) {
|
|
20
|
-
this.selectionMode =
|
|
20
|
+
this.selectionMode = TreeViewSelectionMode.All;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -27,6 +27,7 @@ __decorate([
|
|
|
27
27
|
const nimbleTreeView = TreeView.compose({
|
|
28
28
|
baseName: 'tree-view',
|
|
29
29
|
baseClass: FoundationTreeView,
|
|
30
|
+
// @ts-expect-error FAST templates have incorrect type, see: https://github.com/microsoft/fast/issues/5047
|
|
30
31
|
template,
|
|
31
32
|
styles
|
|
32
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tree-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACH,gBAAgB,IAAI,QAAQ,EAC5B,QAAQ,IAAI,kBAAkB,EAC9B,YAAY,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tree-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACH,gBAAgB,IAAI,QAAQ,EAC5B,QAAQ,IAAI,kBAAkB,EAC9B,YAAY,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAUhD;;;;;;;;;GASG;AACH,MAAM,QAAS,SAAQ,kBAAkB;IAI9B,iBAAiB;QACpB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACrB,IAAI,CAAC,aAAa,GAAG,qBAAqB,CAAC,GAAG,CAAC;SAClD;IACL,CAAC;CACJ;AARG;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;+CACO;AAUjD,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC;IACpC,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,kBAAkB;IAC7B,0GAA0G;IAC1G,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const pinnedSelectedAttribute = "pinned-selected";
|
|
2
2
|
export declare const groupSelectedAttribute = "group-selected";
|
|
3
|
-
export declare enum
|
|
3
|
+
export declare enum TreeViewSelectionMode {
|
|
4
4
|
All = "all",
|
|
5
5
|
LeavesOnly = "leaves-only"
|
|
6
6
|
}
|
|
7
|
+
export declare type TreeViewSelectionModeAttribute = `${TreeViewSelectionMode}`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const pinnedSelectedAttribute = 'pinned-selected';
|
|
2
2
|
export const groupSelectedAttribute = 'group-selected';
|
|
3
|
-
export var
|
|
4
|
-
(function (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
})(
|
|
3
|
+
export var TreeViewSelectionMode;
|
|
4
|
+
(function (TreeViewSelectionMode) {
|
|
5
|
+
TreeViewSelectionMode["All"] = "all";
|
|
6
|
+
TreeViewSelectionMode["LeavesOnly"] = "leaves-only";
|
|
7
|
+
})(TreeViewSelectionMode || (TreeViewSelectionMode = {}));
|
|
8
8
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/tree-view/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AACzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAEvD,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/tree-view/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AACzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAEvD,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC7B,oCAAW,CAAA;IACX,mDAA0B,CAAA;AAC9B,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Behavior, ElementStyles } from '@microsoft/fast-element';
|
|
2
|
+
import type { ButtonAppearance } from '../../patterns/button/types';
|
|
3
|
+
/**
|
|
4
|
+
* Behavior that will conditionally apply a stylesheet based on the element's
|
|
5
|
+
* appearance property
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value of the appearance property
|
|
8
|
+
* @param styles - The styles to be applied when condition matches
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare function appearanceBehavior(value: ButtonAppearance, styles: ElementStyles): Behavior;
|
|
@@ -11,4 +11,4 @@ import { PropertyStyleSheetBehavior } from '@microsoft/fast-foundation';
|
|
|
11
11
|
export function appearanceBehavior(value, styles) {
|
|
12
12
|
return new PropertyStyleSheetBehavior('appearance', value, styles);
|
|
13
13
|
}
|
|
14
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=appearance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appearance.js","sourceRoot":"","sources":["../../../../src/utilities/style/appearance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAIxE;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAC9B,KAAuB,EACvB,MAAqB;IAErB,OAAO,IAAI,0BAA0B,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Behavior, ElementStyles, FASTElement } from '@microsoft/fast-element';
|
|
2
|
+
/**
|
|
3
|
+
* Behavior to conditionally apply LTR and RTL stylesheets. To determine which to apply,
|
|
4
|
+
* the behavior will use the nearest DesignSystemProvider's 'direction' design system value.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { css } from "@microsoft/fast-element";
|
|
10
|
+
* import { DirectionalStyleSheetBehavior } from "@microsoft/fast-foundation";
|
|
11
|
+
*
|
|
12
|
+
* css`
|
|
13
|
+
* // ...
|
|
14
|
+
* `.withBehaviors(new DirectionalStyleSheetBehavior(
|
|
15
|
+
* css`:host { content: "ltr"}`),
|
|
16
|
+
* css`:host { content: "rtl"}`),
|
|
17
|
+
* )
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class DirectionalStyleSheetBehavior implements Behavior {
|
|
21
|
+
private ltr;
|
|
22
|
+
private rtl;
|
|
23
|
+
private cache;
|
|
24
|
+
constructor(ltr: ElementStyles | null, rtl: ElementStyles | null);
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
bind(source: FASTElement & HTMLElement): void;
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
unbind(source: FASTElement & HTMLElement): void;
|
|
33
|
+
private attach;
|
|
34
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Sourced from: https://github.com/microsoft/fast/blob/a150068ee196e73fe7a4f7b538a38752e0e506ba/packages/web-components/fast-components/src/styles/direction.ts
|
|
3
|
+
// Changes: Updated imports to reference nimble design tokens
|
|
4
|
+
import { direction as directionDesignToken } from '../../theme-provider';
|
|
5
|
+
/**
|
|
6
|
+
* Behavior to conditionally apply LTR and RTL stylesheets. To determine which to apply,
|
|
7
|
+
* the behavior will use the nearest DesignSystemProvider's 'direction' design system value.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { css } from "@microsoft/fast-element";
|
|
13
|
+
* import { DirectionalStyleSheetBehavior } from "@microsoft/fast-foundation";
|
|
14
|
+
*
|
|
15
|
+
* css`
|
|
16
|
+
* // ...
|
|
17
|
+
* `.withBehaviors(new DirectionalStyleSheetBehavior(
|
|
18
|
+
* css`:host { content: "ltr"}`),
|
|
19
|
+
* css`:host { content: "rtl"}`),
|
|
20
|
+
* )
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export class DirectionalStyleSheetBehavior {
|
|
24
|
+
constructor(ltr, rtl) {
|
|
25
|
+
this.cache = new WeakMap();
|
|
26
|
+
this.ltr = ltr;
|
|
27
|
+
this.rtl = rtl;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
bind(source) {
|
|
33
|
+
this.attach(source);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
unbind(source) {
|
|
39
|
+
const cache = this.cache.get(source);
|
|
40
|
+
if (cache) {
|
|
41
|
+
directionDesignToken.unsubscribe(cache);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
attach(source) {
|
|
45
|
+
const subscriber = this.cache.get(source) ||
|
|
46
|
+
new DirectionalStyleSheetBehaviorSubscription(this.ltr, this.rtl, source);
|
|
47
|
+
const value = directionDesignToken.getValueFor(source);
|
|
48
|
+
directionDesignToken.subscribe(subscriber);
|
|
49
|
+
subscriber.attach(value);
|
|
50
|
+
this.cache.set(source, subscriber);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Subscription for {@link DirectionalStyleSheetBehavior}
|
|
55
|
+
*/
|
|
56
|
+
class DirectionalStyleSheetBehaviorSubscription {
|
|
57
|
+
constructor(ltr, rtl, source) {
|
|
58
|
+
this.ltr = ltr;
|
|
59
|
+
this.rtl = rtl;
|
|
60
|
+
this.source = source;
|
|
61
|
+
this.attached = null;
|
|
62
|
+
}
|
|
63
|
+
handleChange({ target, token, }) {
|
|
64
|
+
this.attach(token.getValueFor(target));
|
|
65
|
+
}
|
|
66
|
+
attach(direction) {
|
|
67
|
+
if (this.attached !== this[direction]) {
|
|
68
|
+
if (this.attached !== null) {
|
|
69
|
+
this.source.$fastController.removeStyles(this.attached);
|
|
70
|
+
}
|
|
71
|
+
this.attached = this[direction];
|
|
72
|
+
if (this.attached !== null) {
|
|
73
|
+
this.source.$fastController.addStyles(this.attached);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=direction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"direction.js","sourceRoot":"","sources":["../../../../src/utilities/style/direction.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,gKAAgK;AAChK,6DAA6D;AAU7D,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACzE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,6BAA6B;IAQtC,YAAY,GAAyB,EAAE,GAAyB;QALxD,UAAK,GAGT,IAAI,OAAO,EAAE,CAAC;QAGd,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAED;;OAEG;IACI,IAAI,CAAC,MAAiC;QACzC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,MAAiC;QAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAErC,IAAI,KAAK,EAAE;YACP,oBAAoB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SAC3C;IACL,CAAC;IAEO,MAAM,CAAC,MAAiC;QAC5C,MAAM,UAAU,GACZ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;YACtB,IAAI,yCAAyC,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAE9E,MAAM,KAAK,GAAG,oBAAoB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACvD,oBAAoB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAC3C,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEzB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACvC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,yCAAyC;IAG3C,YACY,GAAyB,EACzB,GAAyB,EACzB,MAAiC;QAFjC,QAAG,GAAH,GAAG,CAAsB;QACzB,QAAG,GAAH,GAAG,CAAsB;QACzB,WAAM,GAAN,MAAM,CAA2B;QALrC,aAAQ,GAAyB,IAAI,CAAC;IAM3C,CAAC;IAEG,YAAY,CAAC,EAChB,MAAM,EACN,KAAK,GAC8C;QACnD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,CAAC;IAEM,MAAM,CAAC,SAAoB;QAC9B,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,CAAC,EAAE;YACnC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE;gBACxB,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC3D;YACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;YAChC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE;gBACxB,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aACxD;SACJ;IACL,CAAC;CACJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file is a workaround for: https://github.com/prettier/prettier/issues/11400
|
|
3
3
|
*/
|
|
4
|
-
// eslint-disable-next-line
|
|
4
|
+
// eslint-disable-next-line no-restricted-imports
|
|
5
5
|
import { focusVisible as focusVisibleOriginal } from '@microsoft/fast-foundation';
|
|
6
6
|
/**
|
|
7
7
|
* The string representing the focus selector to be used. Value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.js","sourceRoot":"","sources":["../../../../src/utilities/style/focus.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,
|
|
1
|
+
{"version":3,"file":"focus.js","sourceRoot":"","sources":["../../../../src/utilities/style/focus.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,iDAAiD;AACjD,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefers-reduced-motion.js","sourceRoot":"","sources":["../../../../src/utilities/style/prefers-reduced-motion.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAmB,MAAM,CAAC,UAAU,CAC3E,kCAAkC,CACrC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Behavior, ElementStyles, FASTElement } from '@microsoft/fast-element';
|
|
2
|
+
import type { Theme } from '../../theme-provider/types';
|
|
3
|
+
export declare type LightStyle = ElementStyles | null;
|
|
4
|
+
export declare type DarkStyleOrAlias = ElementStyles | null | Theme.Light;
|
|
5
|
+
export declare type ColorStyleOrAlias = ElementStyles | null | Theme.Light | Theme.Dark;
|
|
6
|
+
export declare type LegacyBlueStyleOrAlias = ElementStyles | null | Theme.Light | Theme.Dark | Theme.Color;
|
|
7
|
+
/**
|
|
8
|
+
* Behavior to conditionally apply theme-based stylesheets.
|
|
9
|
+
*/
|
|
10
|
+
declare class ThemeStyleSheetBehavior implements Behavior {
|
|
11
|
+
private readonly themeStyles;
|
|
12
|
+
private readonly cache;
|
|
13
|
+
constructor(lightStyle: LightStyle, darkStyleOrAlias: DarkStyleOrAlias, colorStyleOrAlias: ColorStyleOrAlias, legacyBlueStyleOrAlias: LegacyBlueStyleOrAlias);
|
|
14
|
+
private static resolveTheme;
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
bind(source: FASTElement & HTMLElement): void;
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
unbind(source: FASTElement & HTMLElement): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Behavior to conditionally apply theme-based stylesheets. To determine which to apply,
|
|
26
|
+
* the behavior will use the nearest ThemeProvider's 'theme' design system value.
|
|
27
|
+
* To re-use the same style for multiple themes you can specify the name of an already
|
|
28
|
+
* defined theme to alias them together.
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* css`
|
|
34
|
+
* // ...
|
|
35
|
+
* `.withBehaviors(new ThemeStyleSheetBehavior(
|
|
36
|
+
* css`:host { ... Theme.Light style... }`),
|
|
37
|
+
* css`:host { ... Theme.Dark style... }`),
|
|
38
|
+
* null, // No style needed for Theme.Color style
|
|
39
|
+
* Theme.Light, // For the Theme.LegacyBlue style, re-use the previously set Theme.Light style
|
|
40
|
+
* )
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const themeBehavior: (lightStyle: LightStyle, darkStyleOrAlias: DarkStyleOrAlias, colorStyleOrAlias: ColorStyleOrAlias, legacyBlueStyleOrAlias: LegacyBlueStyleOrAlias) => ThemeStyleSheetBehavior;
|
|
44
|
+
export {};
|