@genesislcap/web-core 14.302.1-alpha-945e484.0 → 14.302.1-alpha-ecc0cfb.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/cjs/FAST/fast-colors.js +7 -0
- package/dist/cjs/FAST/fast-components.js +4 -0
- package/dist/cjs/FAST/fast-element.js +34 -0
- package/dist/cjs/FAST/fast-foundation.js +64 -0
- package/dist/cjs/FAST/fast-router.js +14 -0
- package/dist/cjs/FAST/fast-web-utilities.js +12 -0
- package/dist/cjs/FAST/index.js +9 -0
- package/dist/cjs/decorators/deprecated-attr.js +70 -0
- package/dist/cjs/decorators/index.js +4 -0
- package/dist/cjs/directives/index.js +5 -0
- package/dist/cjs/directives/sync.js +101 -0
- package/dist/cjs/directives/when-else.js +18 -0
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/patterns/define.js +41 -0
- package/dist/cjs/patterns/index.js +5 -0
- package/dist/cjs/patterns/tag-for.js +24 -0
- package/dist/dts/patterns/define.d.ts.map +1 -1
- package/dist/dts/tsdoc-metadata.json +1 -1
- package/dist/web-core.api.json +15 -54
- package/docs/api/index.md +3 -21
- package/docs/api/web-core.definefactory.md +1 -59
- package/docs/api/web-core.deprecatedattr.md +3 -33
- package/docs/api/web-core.deprecatedattr_1.md +4 -49
- package/docs/api/web-core.md +19 -179
- package/docs/api/web-core.sync.md +6 -79
- package/docs/api/web-core.tagfor.md +3 -33
- package/docs/api/web-core.whenelse.md +5 -65
- package/package.json +5 -6
- package/dist/index.html +0 -23
- package/dist/main.31d6cfe0d16ae931b73c.js +0 -0
- package/docs/api-report.md.api.md +0 -502
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseColorHexRGB = exports.ComponentStateColorPalette = exports.ColorRGBA64 = void 0;
|
|
4
|
+
var fast_colors_1 = require("@microsoft/fast-colors");
|
|
5
|
+
Object.defineProperty(exports, "ColorRGBA64", { enumerable: true, get: function () { return fast_colors_1.ColorRGBA64; } });
|
|
6
|
+
Object.defineProperty(exports, "ComponentStateColorPalette", { enumerable: true, get: function () { return fast_colors_1.ComponentStateColorPalette; } });
|
|
7
|
+
Object.defineProperty(exports, "parseColorHexRGB", { enumerable: true, get: function () { return fast_colors_1.parseColorHexRGB; } });
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenesisElementDefinition = exports.GenesisElement = exports.when = exports.volatile = exports.ViewTemplate = exports.slotted = exports.repeat = exports.ref = exports.observable = exports.Observable = exports.nullableNumberConverter = exports.HTMLView = exports.HTMLBindingDirective = exports.html = exports.FASTElementDefinition = exports.FASTElement = exports.ExecutionContext = exports.ElementStyles = exports.elements = exports.DOM = exports.defaultExecutionContext = exports.customElement = exports.cssPartial = exports.CSSDirective = exports.css = exports.children = exports.BindingBehavior = exports.attr = exports.AttachedBehaviorHTMLDirective = void 0;
|
|
4
|
+
const fast_element_1 = require("@microsoft/fast-element");
|
|
5
|
+
Object.defineProperty(exports, "GenesisElement", { enumerable: true, get: function () { return fast_element_1.FASTElement; } });
|
|
6
|
+
Object.defineProperty(exports, "GenesisElementDefinition", { enumerable: true, get: function () { return fast_element_1.FASTElementDefinition; } });
|
|
7
|
+
var fast_element_2 = require("@microsoft/fast-element");
|
|
8
|
+
Object.defineProperty(exports, "AttachedBehaviorHTMLDirective", { enumerable: true, get: function () { return fast_element_2.AttachedBehaviorHTMLDirective; } });
|
|
9
|
+
Object.defineProperty(exports, "attr", { enumerable: true, get: function () { return fast_element_2.attr; } });
|
|
10
|
+
Object.defineProperty(exports, "BindingBehavior", { enumerable: true, get: function () { return fast_element_2.BindingBehavior; } });
|
|
11
|
+
Object.defineProperty(exports, "children", { enumerable: true, get: function () { return fast_element_2.children; } });
|
|
12
|
+
Object.defineProperty(exports, "css", { enumerable: true, get: function () { return fast_element_2.css; } });
|
|
13
|
+
Object.defineProperty(exports, "CSSDirective", { enumerable: true, get: function () { return fast_element_2.CSSDirective; } });
|
|
14
|
+
Object.defineProperty(exports, "cssPartial", { enumerable: true, get: function () { return fast_element_2.cssPartial; } });
|
|
15
|
+
Object.defineProperty(exports, "customElement", { enumerable: true, get: function () { return fast_element_2.customElement; } });
|
|
16
|
+
Object.defineProperty(exports, "defaultExecutionContext", { enumerable: true, get: function () { return fast_element_2.defaultExecutionContext; } });
|
|
17
|
+
Object.defineProperty(exports, "DOM", { enumerable: true, get: function () { return fast_element_2.DOM; } });
|
|
18
|
+
Object.defineProperty(exports, "elements", { enumerable: true, get: function () { return fast_element_2.elements; } });
|
|
19
|
+
Object.defineProperty(exports, "ElementStyles", { enumerable: true, get: function () { return fast_element_2.ElementStyles; } });
|
|
20
|
+
Object.defineProperty(exports, "ExecutionContext", { enumerable: true, get: function () { return fast_element_2.ExecutionContext; } });
|
|
21
|
+
Object.defineProperty(exports, "FASTElement", { enumerable: true, get: function () { return fast_element_2.FASTElement; } });
|
|
22
|
+
Object.defineProperty(exports, "FASTElementDefinition", { enumerable: true, get: function () { return fast_element_2.FASTElementDefinition; } });
|
|
23
|
+
Object.defineProperty(exports, "html", { enumerable: true, get: function () { return fast_element_2.html; } });
|
|
24
|
+
Object.defineProperty(exports, "HTMLBindingDirective", { enumerable: true, get: function () { return fast_element_2.HTMLBindingDirective; } });
|
|
25
|
+
Object.defineProperty(exports, "HTMLView", { enumerable: true, get: function () { return fast_element_2.HTMLView; } });
|
|
26
|
+
Object.defineProperty(exports, "nullableNumberConverter", { enumerable: true, get: function () { return fast_element_2.nullableNumberConverter; } });
|
|
27
|
+
Object.defineProperty(exports, "Observable", { enumerable: true, get: function () { return fast_element_2.Observable; } });
|
|
28
|
+
Object.defineProperty(exports, "observable", { enumerable: true, get: function () { return fast_element_2.observable; } });
|
|
29
|
+
Object.defineProperty(exports, "ref", { enumerable: true, get: function () { return fast_element_2.ref; } });
|
|
30
|
+
Object.defineProperty(exports, "repeat", { enumerable: true, get: function () { return fast_element_2.repeat; } });
|
|
31
|
+
Object.defineProperty(exports, "slotted", { enumerable: true, get: function () { return fast_element_2.slotted; } });
|
|
32
|
+
Object.defineProperty(exports, "ViewTemplate", { enumerable: true, get: function () { return fast_element_2.ViewTemplate; } });
|
|
33
|
+
Object.defineProperty(exports, "volatile", { enumerable: true, get: function () { return fast_element_2.volatile; } });
|
|
34
|
+
Object.defineProperty(exports, "when", { enumerable: true, get: function () { return fast_element_2.when; } });
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tabPanelTemplate = exports.tabTemplate = exports.switchTemplate = exports.startSlotTemplate = exports.sliderLabelTemplate = exports.skeletonTemplate = exports.selectTemplate = exports.radioGroupTemplate = exports.radioTemplate = exports.Registration = exports.PropertyStyleSheetBehavior = exports.progressRingTemplate = exports.progressTemplate = exports.optional = exports.menuItemTemplate = exports.menuTemplate = exports.listboxOptionTemplate = exports.listboxTemplate = exports.inject = exports.horizontalScrollTemplate = exports.FormAssociated = exports.forcedColorsStylesheetBehavior = exports.FoundationElementRegistry = exports.FoundationElement = exports.flipperTemplate = exports.endSlotTemplate = exports.dividerTemplate = exports.display = exports.disclosureTemplate = exports.DI = exports.DesignToken = exports.DesignSystem = exports.dataGridRowTemplate = exports.dataGridCellTemplate = exports.dataGridTemplate = exports.Container = exports.ComboboxAutocomplete = exports.composedParent = exports.checkboxTemplate = exports.cardTemplate = exports.calendarTemplate = exports.buttonTemplate = exports.breadcrumbTemplate = exports.breadcrumbItemTemplate = exports.badgeTemplate = exports.avatarTemplate = exports.anchoredRegionTemplate = exports.anchorTemplate = exports.accordionTemplate = exports.accordionItemTemplate = void 0;
|
|
4
|
+
exports.whitespaceFilter = exports.treeViewTemplate = exports.treeItemTemplate = exports.tooltipTemplate = exports.TooltipPosition = exports.toolbarTemplate = exports.textAreaTemplate = exports.TabsOrientation = exports.tabsTemplate = void 0;
|
|
5
|
+
var fast_foundation_1 = require("@microsoft/fast-foundation");
|
|
6
|
+
Object.defineProperty(exports, "accordionItemTemplate", { enumerable: true, get: function () { return fast_foundation_1.accordionItemTemplate; } });
|
|
7
|
+
Object.defineProperty(exports, "accordionTemplate", { enumerable: true, get: function () { return fast_foundation_1.accordionTemplate; } });
|
|
8
|
+
Object.defineProperty(exports, "anchorTemplate", { enumerable: true, get: function () { return fast_foundation_1.anchorTemplate; } });
|
|
9
|
+
Object.defineProperty(exports, "anchoredRegionTemplate", { enumerable: true, get: function () { return fast_foundation_1.anchoredRegionTemplate; } });
|
|
10
|
+
Object.defineProperty(exports, "avatarTemplate", { enumerable: true, get: function () { return fast_foundation_1.avatarTemplate; } });
|
|
11
|
+
Object.defineProperty(exports, "badgeTemplate", { enumerable: true, get: function () { return fast_foundation_1.badgeTemplate; } });
|
|
12
|
+
Object.defineProperty(exports, "breadcrumbItemTemplate", { enumerable: true, get: function () { return fast_foundation_1.breadcrumbItemTemplate; } });
|
|
13
|
+
Object.defineProperty(exports, "breadcrumbTemplate", { enumerable: true, get: function () { return fast_foundation_1.breadcrumbTemplate; } });
|
|
14
|
+
Object.defineProperty(exports, "buttonTemplate", { enumerable: true, get: function () { return fast_foundation_1.buttonTemplate; } });
|
|
15
|
+
Object.defineProperty(exports, "calendarTemplate", { enumerable: true, get: function () { return fast_foundation_1.calendarTemplate; } });
|
|
16
|
+
Object.defineProperty(exports, "cardTemplate", { enumerable: true, get: function () { return fast_foundation_1.cardTemplate; } });
|
|
17
|
+
Object.defineProperty(exports, "checkboxTemplate", { enumerable: true, get: function () { return fast_foundation_1.checkboxTemplate; } });
|
|
18
|
+
Object.defineProperty(exports, "composedParent", { enumerable: true, get: function () { return fast_foundation_1.composedParent; } });
|
|
19
|
+
Object.defineProperty(exports, "ComboboxAutocomplete", { enumerable: true, get: function () { return fast_foundation_1.ComboboxAutocomplete; } });
|
|
20
|
+
Object.defineProperty(exports, "Container", { enumerable: true, get: function () { return fast_foundation_1.Container; } });
|
|
21
|
+
Object.defineProperty(exports, "dataGridTemplate", { enumerable: true, get: function () { return fast_foundation_1.dataGridTemplate; } });
|
|
22
|
+
Object.defineProperty(exports, "dataGridCellTemplate", { enumerable: true, get: function () { return fast_foundation_1.dataGridCellTemplate; } });
|
|
23
|
+
Object.defineProperty(exports, "dataGridRowTemplate", { enumerable: true, get: function () { return fast_foundation_1.dataGridRowTemplate; } });
|
|
24
|
+
Object.defineProperty(exports, "DesignSystem", { enumerable: true, get: function () { return fast_foundation_1.DesignSystem; } });
|
|
25
|
+
Object.defineProperty(exports, "DesignToken", { enumerable: true, get: function () { return fast_foundation_1.DesignToken; } });
|
|
26
|
+
Object.defineProperty(exports, "DI", { enumerable: true, get: function () { return fast_foundation_1.DI; } });
|
|
27
|
+
Object.defineProperty(exports, "disclosureTemplate", { enumerable: true, get: function () { return fast_foundation_1.disclosureTemplate; } });
|
|
28
|
+
Object.defineProperty(exports, "display", { enumerable: true, get: function () { return fast_foundation_1.display; } });
|
|
29
|
+
Object.defineProperty(exports, "dividerTemplate", { enumerable: true, get: function () { return fast_foundation_1.dividerTemplate; } });
|
|
30
|
+
Object.defineProperty(exports, "endSlotTemplate", { enumerable: true, get: function () { return fast_foundation_1.endSlotTemplate; } });
|
|
31
|
+
Object.defineProperty(exports, "flipperTemplate", { enumerable: true, get: function () { return fast_foundation_1.flipperTemplate; } });
|
|
32
|
+
Object.defineProperty(exports, "FoundationElement", { enumerable: true, get: function () { return fast_foundation_1.FoundationElement; } });
|
|
33
|
+
Object.defineProperty(exports, "FoundationElementRegistry", { enumerable: true, get: function () { return fast_foundation_1.FoundationElementRegistry; } });
|
|
34
|
+
Object.defineProperty(exports, "forcedColorsStylesheetBehavior", { enumerable: true, get: function () { return fast_foundation_1.forcedColorsStylesheetBehavior; } });
|
|
35
|
+
Object.defineProperty(exports, "FormAssociated", { enumerable: true, get: function () { return fast_foundation_1.FormAssociated; } });
|
|
36
|
+
Object.defineProperty(exports, "horizontalScrollTemplate", { enumerable: true, get: function () { return fast_foundation_1.horizontalScrollTemplate; } });
|
|
37
|
+
Object.defineProperty(exports, "inject", { enumerable: true, get: function () { return fast_foundation_1.inject; } });
|
|
38
|
+
Object.defineProperty(exports, "listboxTemplate", { enumerable: true, get: function () { return fast_foundation_1.listboxTemplate; } });
|
|
39
|
+
Object.defineProperty(exports, "listboxOptionTemplate", { enumerable: true, get: function () { return fast_foundation_1.listboxOptionTemplate; } });
|
|
40
|
+
Object.defineProperty(exports, "menuTemplate", { enumerable: true, get: function () { return fast_foundation_1.menuTemplate; } });
|
|
41
|
+
Object.defineProperty(exports, "menuItemTemplate", { enumerable: true, get: function () { return fast_foundation_1.menuItemTemplate; } });
|
|
42
|
+
Object.defineProperty(exports, "optional", { enumerable: true, get: function () { return fast_foundation_1.optional; } });
|
|
43
|
+
Object.defineProperty(exports, "progressTemplate", { enumerable: true, get: function () { return fast_foundation_1.progressTemplate; } });
|
|
44
|
+
Object.defineProperty(exports, "progressRingTemplate", { enumerable: true, get: function () { return fast_foundation_1.progressRingTemplate; } });
|
|
45
|
+
Object.defineProperty(exports, "PropertyStyleSheetBehavior", { enumerable: true, get: function () { return fast_foundation_1.PropertyStyleSheetBehavior; } });
|
|
46
|
+
Object.defineProperty(exports, "Registration", { enumerable: true, get: function () { return fast_foundation_1.Registration; } });
|
|
47
|
+
Object.defineProperty(exports, "radioTemplate", { enumerable: true, get: function () { return fast_foundation_1.radioTemplate; } });
|
|
48
|
+
Object.defineProperty(exports, "radioGroupTemplate", { enumerable: true, get: function () { return fast_foundation_1.radioGroupTemplate; } });
|
|
49
|
+
Object.defineProperty(exports, "selectTemplate", { enumerable: true, get: function () { return fast_foundation_1.selectTemplate; } });
|
|
50
|
+
Object.defineProperty(exports, "skeletonTemplate", { enumerable: true, get: function () { return fast_foundation_1.skeletonTemplate; } });
|
|
51
|
+
Object.defineProperty(exports, "sliderLabelTemplate", { enumerable: true, get: function () { return fast_foundation_1.sliderLabelTemplate; } });
|
|
52
|
+
Object.defineProperty(exports, "startSlotTemplate", { enumerable: true, get: function () { return fast_foundation_1.startSlotTemplate; } });
|
|
53
|
+
Object.defineProperty(exports, "switchTemplate", { enumerable: true, get: function () { return fast_foundation_1.switchTemplate; } });
|
|
54
|
+
Object.defineProperty(exports, "tabTemplate", { enumerable: true, get: function () { return fast_foundation_1.tabTemplate; } });
|
|
55
|
+
Object.defineProperty(exports, "tabPanelTemplate", { enumerable: true, get: function () { return fast_foundation_1.tabPanelTemplate; } });
|
|
56
|
+
Object.defineProperty(exports, "tabsTemplate", { enumerable: true, get: function () { return fast_foundation_1.tabsTemplate; } });
|
|
57
|
+
Object.defineProperty(exports, "TabsOrientation", { enumerable: true, get: function () { return fast_foundation_1.TabsOrientation; } });
|
|
58
|
+
Object.defineProperty(exports, "textAreaTemplate", { enumerable: true, get: function () { return fast_foundation_1.textAreaTemplate; } });
|
|
59
|
+
Object.defineProperty(exports, "toolbarTemplate", { enumerable: true, get: function () { return fast_foundation_1.toolbarTemplate; } });
|
|
60
|
+
Object.defineProperty(exports, "TooltipPosition", { enumerable: true, get: function () { return fast_foundation_1.TooltipPosition; } });
|
|
61
|
+
Object.defineProperty(exports, "tooltipTemplate", { enumerable: true, get: function () { return fast_foundation_1.tooltipTemplate; } });
|
|
62
|
+
Object.defineProperty(exports, "treeItemTemplate", { enumerable: true, get: function () { return fast_foundation_1.treeItemTemplate; } });
|
|
63
|
+
Object.defineProperty(exports, "treeViewTemplate", { enumerable: true, get: function () { return fast_foundation_1.treeViewTemplate; } });
|
|
64
|
+
Object.defineProperty(exports, "whitespaceFilter", { enumerable: true, get: function () { return fast_foundation_1.whitespaceFilter; } });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenesisRouter = exports.GenesisElementLayout = exports.RouterConfiguration = exports.Router = exports.RouteCollection = exports.Route = exports.FASTRouter = exports.FASTElementLayout = exports.DefaultRouteRecognizer = void 0;
|
|
4
|
+
const fast_router_1 = require("@microsoft/fast-router");
|
|
5
|
+
Object.defineProperty(exports, "GenesisElementLayout", { enumerable: true, get: function () { return fast_router_1.FASTElementLayout; } });
|
|
6
|
+
Object.defineProperty(exports, "GenesisRouter", { enumerable: true, get: function () { return fast_router_1.FASTRouter; } });
|
|
7
|
+
var fast_router_2 = require("@microsoft/fast-router");
|
|
8
|
+
Object.defineProperty(exports, "DefaultRouteRecognizer", { enumerable: true, get: function () { return fast_router_2.DefaultRouteRecognizer; } });
|
|
9
|
+
Object.defineProperty(exports, "FASTElementLayout", { enumerable: true, get: function () { return fast_router_2.FASTElementLayout; } });
|
|
10
|
+
Object.defineProperty(exports, "FASTRouter", { enumerable: true, get: function () { return fast_router_2.FASTRouter; } });
|
|
11
|
+
Object.defineProperty(exports, "Route", { enumerable: true, get: function () { return fast_router_2.Route; } });
|
|
12
|
+
Object.defineProperty(exports, "RouteCollection", { enumerable: true, get: function () { return fast_router_2.RouteCollection; } });
|
|
13
|
+
Object.defineProperty(exports, "Router", { enumerable: true, get: function () { return fast_router_2.Router; } });
|
|
14
|
+
Object.defineProperty(exports, "RouterConfiguration", { enumerable: true, get: function () { return fast_router_2.RouterConfiguration; } });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNullOrWhiteSpace = exports.uniqueId = exports.SystemColors = exports.pascalCase = exports.Orientation = exports.limit = exports.Direction = exports.classNames = void 0;
|
|
4
|
+
var fast_web_utilities_1 = require("@microsoft/fast-web-utilities");
|
|
5
|
+
Object.defineProperty(exports, "classNames", { enumerable: true, get: function () { return fast_web_utilities_1.classNames; } });
|
|
6
|
+
Object.defineProperty(exports, "Direction", { enumerable: true, get: function () { return fast_web_utilities_1.Direction; } });
|
|
7
|
+
Object.defineProperty(exports, "limit", { enumerable: true, get: function () { return fast_web_utilities_1.limit; } });
|
|
8
|
+
Object.defineProperty(exports, "Orientation", { enumerable: true, get: function () { return fast_web_utilities_1.Orientation; } });
|
|
9
|
+
Object.defineProperty(exports, "pascalCase", { enumerable: true, get: function () { return fast_web_utilities_1.pascalCase; } });
|
|
10
|
+
Object.defineProperty(exports, "SystemColors", { enumerable: true, get: function () { return fast_web_utilities_1.SystemColors; } });
|
|
11
|
+
Object.defineProperty(exports, "uniqueId", { enumerable: true, get: function () { return fast_web_utilities_1.uniqueId; } });
|
|
12
|
+
Object.defineProperty(exports, "isNullOrWhiteSpace", { enumerable: true, get: function () { return fast_web_utilities_1.isNullOrWhiteSpace; } });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./fast-colors"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./fast-components"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./fast-element"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./fast-foundation"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./fast-router"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./fast-web-utilities"), exports);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deprecatedAttr = void 0;
|
|
4
|
+
const fast_element_1 = require("@microsoft/fast-element");
|
|
5
|
+
const warningQueue = [];
|
|
6
|
+
const logTimeout = 5000;
|
|
7
|
+
setTimeout(() => {
|
|
8
|
+
if (warningQueue.length) {
|
|
9
|
+
console.warn(`${warningQueue.length} attribute deprecation notice(s):\n ${warningQueue.join('\n')}`);
|
|
10
|
+
}
|
|
11
|
+
}, logTimeout);
|
|
12
|
+
/**
|
|
13
|
+
* Value converter is an interface from FAST which lets you convert types. An example
|
|
14
|
+
* of this usage is the number converter when using `mode: number` which converts to and from
|
|
15
|
+
* the string attribute on the DOM, to the number property on the class.
|
|
16
|
+
*
|
|
17
|
+
* Instead of doing a conversion we sit in the middle and if a value is set from the attribute
|
|
18
|
+
* we know that the deprecatedName is used, hence we queue a deprecation warning. We only emit one warning
|
|
19
|
+
* per attribute per class, to stop repeat emits on change.
|
|
20
|
+
*
|
|
21
|
+
* this function needs to take all the variables in separately to capture them in the closure rather
|
|
22
|
+
* than pulling them from the `deprecatedConfig` object, as that is modified which causes issues such
|
|
23
|
+
* as infinite loops
|
|
24
|
+
*/
|
|
25
|
+
const deprecationLogger = (className, deprecatedName, attributeName, converter) => ({
|
|
26
|
+
hasEmitLog: false,
|
|
27
|
+
toView(value) {
|
|
28
|
+
return converter ? converter.toView(value) : value;
|
|
29
|
+
},
|
|
30
|
+
fromView(value) {
|
|
31
|
+
if (value && !this.hasEmitLog) {
|
|
32
|
+
this.hasEmitLog = true;
|
|
33
|
+
warningQueue.push(`Deprecation warning: attribute name "${deprecatedName}" on component "${className}" is deprecated. Please use "${attributeName}" instead.`);
|
|
34
|
+
}
|
|
35
|
+
return converter ? converter.fromView(value) : value;
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
function deprecatedAttr(configOrTarget, prop) {
|
|
39
|
+
let config;
|
|
40
|
+
function decorator($target, $prop) {
|
|
41
|
+
if (arguments.length > 1) {
|
|
42
|
+
// Non invocation:
|
|
43
|
+
// - @attr
|
|
44
|
+
// Invocation with or w/o opts:
|
|
45
|
+
// - @attr()
|
|
46
|
+
// - @attr({...opts})
|
|
47
|
+
config.property = $prop;
|
|
48
|
+
}
|
|
49
|
+
fast_element_1.AttributeConfiguration.locate($target.constructor).push(config);
|
|
50
|
+
if ('deprecatedName' in config) {
|
|
51
|
+
const deprecatedConfig = structuredClone(config);
|
|
52
|
+
deprecatedConfig.converter = deprecationLogger($target.constructor.name, deprecatedConfig.deprecatedName, deprecatedConfig.attribute, deprecatedConfig.converter);
|
|
53
|
+
deprecatedConfig.attribute = config.deprecatedName.toLowerCase();
|
|
54
|
+
fast_element_1.AttributeConfiguration.locate($target.constructor).push(deprecatedConfig);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (arguments.length > 1) {
|
|
58
|
+
// Non invocation:
|
|
59
|
+
// - @attr
|
|
60
|
+
config = {};
|
|
61
|
+
decorator(configOrTarget, prop);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
// Invocation with or w/o opts:
|
|
65
|
+
// - @attr()
|
|
66
|
+
// - @attr({...opts})
|
|
67
|
+
config = configOrTarget === void 0 ? {} : configOrTarget;
|
|
68
|
+
return decorator;
|
|
69
|
+
}
|
|
70
|
+
exports.deprecatedAttr = deprecatedAttr;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sync = exports.defaultEventMap = void 0;
|
|
4
|
+
const fast_element_1 = require("@microsoft/fast-element");
|
|
5
|
+
/**
|
|
6
|
+
* A map that associates specific HTML element tags with their corresponding default event names.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
exports.defaultEventMap = new Map([
|
|
10
|
+
['FAST-TEXT-AREA', 'input'],
|
|
11
|
+
['FAST-TEXT-FIELD', 'input'],
|
|
12
|
+
['FOUNDATION-TEXT-AREA', 'input'],
|
|
13
|
+
['FOUNDATION-TEXT-FIELD', 'input'],
|
|
14
|
+
['INPUT', 'input'],
|
|
15
|
+
['ZERO-TEXT-FIELD', 'input'],
|
|
16
|
+
]);
|
|
17
|
+
function customUpdateTarget(value) {
|
|
18
|
+
if (this['keyAttr']) {
|
|
19
|
+
// FUI-389: set initial state based on keyAttr
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
this.target[this.targetName] = value;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function bind(source, context) {
|
|
26
|
+
if (this['keyAttr']) {
|
|
27
|
+
// overwrite internal update method called by originalBind
|
|
28
|
+
this.updateTarget = customUpdateTarget;
|
|
29
|
+
}
|
|
30
|
+
this.originalBind.call(this, source, context);
|
|
31
|
+
this.target.addEventListener(this.changeEvent, this.changeHandler);
|
|
32
|
+
}
|
|
33
|
+
function unbind() {
|
|
34
|
+
this.originalUnbind.call(this);
|
|
35
|
+
this.target.removeEventListener(this.changeEvent, this.changeHandler);
|
|
36
|
+
}
|
|
37
|
+
function determineChangeEvent(target, eventName) {
|
|
38
|
+
var _a;
|
|
39
|
+
const tag = target.tagName;
|
|
40
|
+
if (eventName === 'default') {
|
|
41
|
+
return (_a = exports.defaultEventMap.get(tag)) !== null && _a !== void 0 ? _a : 'change';
|
|
42
|
+
}
|
|
43
|
+
return eventName;
|
|
44
|
+
}
|
|
45
|
+
class SyncDirective extends fast_element_1.HTMLBindingDirective {
|
|
46
|
+
constructor(binding, convert, eventName, keyAttr) {
|
|
47
|
+
super(binding);
|
|
48
|
+
this.keyAttr = keyAttr;
|
|
49
|
+
this.conversionType = convert;
|
|
50
|
+
this.eventName = eventName;
|
|
51
|
+
}
|
|
52
|
+
createBehavior(target) {
|
|
53
|
+
const behavior = super.createBehavior(target);
|
|
54
|
+
behavior.originalBind = behavior.bind;
|
|
55
|
+
behavior.originalUnbind = behavior.unbind;
|
|
56
|
+
behavior.keyAttr = this.keyAttr;
|
|
57
|
+
behavior.bind = bind;
|
|
58
|
+
behavior.unbind = unbind;
|
|
59
|
+
behavior.changeEvent = determineChangeEvent(target, this.eventName);
|
|
60
|
+
behavior.changeHandler = () => {
|
|
61
|
+
// for checkbox, which is currently the only component converting to boolean, will have to change if boolean conversion is used anywhere else
|
|
62
|
+
const value = this.conversionType === 'boolean' ? behavior.target.checked : behavior.target.value;
|
|
63
|
+
if (this.keyAttr) {
|
|
64
|
+
const last = behavior.bindingObserver.last;
|
|
65
|
+
const key = behavior.target[this.keyAttr];
|
|
66
|
+
last.propertySource[last.propertyName][key] = this.convert(value);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
// Wait for an official setValue API
|
|
70
|
+
const last = behavior.bindingObserver.last;
|
|
71
|
+
last.propertySource[last.propertyName] = this.convert(value);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
return behavior;
|
|
75
|
+
}
|
|
76
|
+
convert(value) {
|
|
77
|
+
if (value === undefined || value === null)
|
|
78
|
+
return value;
|
|
79
|
+
switch (this.conversionType) {
|
|
80
|
+
case 'time':
|
|
81
|
+
const msSinceEpoch = new Date(value).getTime();
|
|
82
|
+
return isNaN(msSinceEpoch) ? undefined : msSinceEpoch;
|
|
83
|
+
case 'number':
|
|
84
|
+
return value.length ? Number(value) : undefined; // Number('') returns 0
|
|
85
|
+
case 'string':
|
|
86
|
+
return String(value);
|
|
87
|
+
case 'boolean':
|
|
88
|
+
return Boolean(value);
|
|
89
|
+
default:
|
|
90
|
+
return value;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Creates a synchronization directive that binds a data source to an HTML element,
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
function sync(binding, conversionType = 'string', eventName = 'default', keyAttr) {
|
|
99
|
+
return new SyncDirective(binding, conversionType, eventName, keyAttr);
|
|
100
|
+
}
|
|
101
|
+
exports.sync = sync;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.whenElse = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Directive that allows supplying an "else" template to the traditional {@link https://www.fast.design/docs/api/fast-element.when/#when-function} directive
|
|
6
|
+
*
|
|
7
|
+
* @param binding - The condition to test for rendering.
|
|
8
|
+
* @param trueTemplateOrTemplateBinding - The template or a binding that gets the template to render when the condition is true.
|
|
9
|
+
* @param falseTemplateOrTemplateBinding - The template or a binding that gets the template to render when the condition is false.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
function whenElse(binding, trueTemplateOrTemplateBinding, falseTemplateOrTemplateBinding) {
|
|
13
|
+
const getTemplate = (template) => typeof template === 'function' ? template : () => template;
|
|
14
|
+
const trueTemplate = getTemplate(trueTemplateOrTemplateBinding);
|
|
15
|
+
const falseTemplate = getTemplate(falseTemplateOrTemplateBinding);
|
|
16
|
+
return (source, context) => binding(source, context) ? trueTemplate(source, context) : falseTemplate(source, context);
|
|
17
|
+
}
|
|
18
|
+
exports.whenElse = whenElse;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./directives"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./FAST"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./patterns"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./decorators"), exports);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineFactory = void 0;
|
|
4
|
+
const FAST_1 = require("../FAST");
|
|
5
|
+
const defaultDefinitionOverrider = (base) => (override) => (Object.assign(Object.assign({}, base), override));
|
|
6
|
+
/**
|
|
7
|
+
* Defines a platform custom element based on the provided type and definition.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* An example using custom definition merge logic, useful if you need to impose hard restrictions.
|
|
11
|
+
* ```ts
|
|
12
|
+
* const definitionOverrider = (definition) => ({
|
|
13
|
+
* ...baseDefinition,
|
|
14
|
+
* ...definition,
|
|
15
|
+
* styles: baseDefinition.styles,
|
|
16
|
+
* shadowOptions: {
|
|
17
|
+
* mode: 'closed,
|
|
18
|
+
* },
|
|
19
|
+
* });
|
|
20
|
+
* export const define = defineFactory(LoginForm, definitionOverrider);
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* You can provide the base definition if you're happy with the default spread operator merge logic.
|
|
25
|
+
* ```ts
|
|
26
|
+
* export const define = defineFactory(LoginForm, baseDefinition);
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @param Type - The custom element Type / Class to define.
|
|
30
|
+
* @param overriderOrBase - A function that merges definitions, or the base definition if custom merging is not needed.
|
|
31
|
+
* @returns The type class.
|
|
32
|
+
* @beta
|
|
33
|
+
*/
|
|
34
|
+
const defineFactory = (Type, overriderOrBase) => (definition) => {
|
|
35
|
+
const overrider = typeof overriderOrBase === 'function'
|
|
36
|
+
? overriderOrBase
|
|
37
|
+
: defaultDefinitionOverrider(overriderOrBase);
|
|
38
|
+
return FAST_1.GenesisElement.define(class extends Type {
|
|
39
|
+
}, overrider(definition));
|
|
40
|
+
};
|
|
41
|
+
exports.defineFactory = defineFactory;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tagFor = void 0;
|
|
4
|
+
const FAST_1 = require("../FAST");
|
|
5
|
+
/**
|
|
6
|
+
* Determines what HTML tag name to use for the dependency.
|
|
7
|
+
* @param dependency - The dependency the template is dependent on.
|
|
8
|
+
* @returns The tag name to use in markup.
|
|
9
|
+
* @beta
|
|
10
|
+
*/
|
|
11
|
+
function tagFor(dependency) {
|
|
12
|
+
if (typeof dependency === 'string') {
|
|
13
|
+
return dependency;
|
|
14
|
+
}
|
|
15
|
+
if (typeof dependency === 'function') {
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
17
|
+
dependency = FAST_1.GenesisElementDefinition.forType(dependency); // < using forType instead of getByType for now...
|
|
18
|
+
if (!dependency) {
|
|
19
|
+
throw new Error('Missing GenesisElement definition.');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return dependency.name;
|
|
23
|
+
}
|
|
24
|
+
exports.tagFor = tagFor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../../src/patterns/define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAEzF;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI,CAAC,UAAU,EAAE,+BAA+B,KAAK,KAAK,CAAC;AAE3F;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,QAAQ,EAAE,+BAA+B,KACtC,+BAA+B,CAAC;AASrC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../../src/patterns/define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAEzF;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI,CAAC,UAAU,EAAE,+BAA+B,KAAK,KAAK,CAAC;AAE3F;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,QAAQ,EAAE,+BAA+B,KACtC,+BAA+B,CAAC;AASrC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,aAAa,8EAGL,mBAAmB,GAAG,+BAA+B,0BAQvE,CAAC"}
|
package/dist/web-core.api.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"metadata": {
|
|
3
3
|
"toolPackage": "@microsoft/api-extractor",
|
|
4
|
-
"toolVersion": "7.
|
|
4
|
+
"toolVersion": "7.34.9",
|
|
5
5
|
"schemaVersion": 1011,
|
|
6
6
|
"oldestForwardsCompatibleVersion": 1001,
|
|
7
7
|
"tsdocConfig": {
|
|
@@ -260,13 +260,17 @@
|
|
|
260
260
|
}
|
|
261
261
|
},
|
|
262
262
|
{
|
|
263
|
-
"kind": "
|
|
264
|
-
"canonicalReference": "@genesislcap/web-core!defineFactory:
|
|
263
|
+
"kind": "Variable",
|
|
264
|
+
"canonicalReference": "@genesislcap/web-core!defineFactory:var",
|
|
265
265
|
"docComment": "/**\n * Defines a platform custom element based on the provided type and definition.\n *\n * @param Type - The custom element Type / Class to define.\n *\n * @param overriderOrBase - A function that merges definitions, or the base definition if custom merging is not needed.\n *\n * @returns The type class.\n *\n * @example\n *\n * An example using custom definition merge logic, useful if you need to impose hard restrictions.\n * ```ts\n * const definitionOverrider = (definition) => ({\n * ...baseDefinition,\n * ...definition,\n * styles: baseDefinition.styles,\n * shadowOptions: {\n * mode: 'closed,\n * },\n * });\n * export const define = defineFactory(LoginForm, definitionOverrider);\n * ```\n *\n * @example\n *\n * You can provide the base definition if you're happy with the default spread operator merge logic.\n * ```ts\n * export const define = defineFactory(LoginForm, baseDefinition);\n * ```\n *\n * @beta\n */\n",
|
|
266
266
|
"excerptTokens": [
|
|
267
267
|
{
|
|
268
268
|
"kind": "Content",
|
|
269
|
-
"text": "defineFactory:
|
|
269
|
+
"text": "defineFactory: "
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"kind": "Content",
|
|
273
|
+
"text": "<TType extends "
|
|
270
274
|
},
|
|
271
275
|
{
|
|
272
276
|
"kind": "Reference",
|
|
@@ -284,19 +288,7 @@
|
|
|
284
288
|
},
|
|
285
289
|
{
|
|
286
290
|
"kind": "Content",
|
|
287
|
-
"text": "
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
"kind": "Content",
|
|
291
|
-
"text": ">(Type: "
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
"kind": "Content",
|
|
295
|
-
"text": "TType"
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
"kind": "Content",
|
|
299
|
-
"text": ", overriderOrBase: "
|
|
291
|
+
"text": ">>(Type: TType, overriderOrBase: "
|
|
300
292
|
},
|
|
301
293
|
{
|
|
302
294
|
"kind": "Reference",
|
|
@@ -327,44 +319,13 @@
|
|
|
327
319
|
}
|
|
328
320
|
],
|
|
329
321
|
"fileUrlPath": "src/patterns/define.ts",
|
|
330
|
-
"
|
|
331
|
-
"startIndex": 12,
|
|
332
|
-
"endIndex": 14
|
|
333
|
-
},
|
|
322
|
+
"isReadonly": true,
|
|
334
323
|
"releaseTag": "Beta",
|
|
335
|
-
"
|
|
336
|
-
"
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
"startIndex": 6,
|
|
341
|
-
"endIndex": 7
|
|
342
|
-
},
|
|
343
|
-
"isOptional": false
|
|
344
|
-
},
|
|
345
|
-
{
|
|
346
|
-
"parameterName": "overriderOrBase",
|
|
347
|
-
"parameterTypeTokenRange": {
|
|
348
|
-
"startIndex": 8,
|
|
349
|
-
"endIndex": 11
|
|
350
|
-
},
|
|
351
|
-
"isOptional": false
|
|
352
|
-
}
|
|
353
|
-
],
|
|
354
|
-
"typeParameters": [
|
|
355
|
-
{
|
|
356
|
-
"typeParameterName": "TType",
|
|
357
|
-
"constraintTokenRange": {
|
|
358
|
-
"startIndex": 1,
|
|
359
|
-
"endIndex": 5
|
|
360
|
-
},
|
|
361
|
-
"defaultTypeTokenRange": {
|
|
362
|
-
"startIndex": 0,
|
|
363
|
-
"endIndex": 0
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
],
|
|
367
|
-
"name": "defineFactory"
|
|
324
|
+
"name": "defineFactory",
|
|
325
|
+
"variableTypeTokenRange": {
|
|
326
|
+
"startIndex": 1,
|
|
327
|
+
"endIndex": 12
|
|
328
|
+
}
|
|
368
329
|
},
|
|
369
330
|
{
|
|
370
331
|
"kind": "TypeAlias",
|
package/docs/api/index.md
CHANGED
|
@@ -6,25 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
## Packages
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</th><th>
|
|
15
|
-
|
|
16
|
-
Description
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</th></tr></thead>
|
|
20
|
-
<tbody><tr><td>
|
|
21
|
-
|
|
22
|
-
[@genesislcap/web-core](./web-core.md)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</td><td>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</td></tr>
|
|
29
|
-
</tbody></table>
|
|
9
|
+
| Package | Description |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [@genesislcap/web-core](./web-core.md) | |
|
|
30
12
|
|