@fluid-topics/ft-wc-utils 1.1.84 → 1.1.86
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/build/FtdsBase.d.ts +14 -0
- package/build/FtdsBase.js +33 -0
- package/build/globals.min.js +11 -11
- package/build/index.d.ts +1 -0
- package/build/index.js +3 -0
- package/package.json +3 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FtLitElement } from "./FtLitElement";
|
|
2
|
+
import { Constructor } from "./generic-types";
|
|
3
|
+
import { DesignSystemFamily, DesignSystemSize } from "@fluid-topics/design-system-variables";
|
|
4
|
+
export type FtdsBaseInterface = {
|
|
5
|
+
size: DesignSystemSize;
|
|
6
|
+
family: DesignSystemFamily;
|
|
7
|
+
getDesignSystemBaseClasses(): Record<string, boolean>;
|
|
8
|
+
};
|
|
9
|
+
export type FtdsBaseType<T extends Constructor<FtLitElement>> = T & Constructor<FtdsBaseInterface>;
|
|
10
|
+
export declare function toFtdsBase<T extends Constructor<FtLitElement>>(ElementClass: T): FtdsBaseType<T>;
|
|
11
|
+
declare const FtdsBase_base: FtdsBaseType<typeof FtLitElement>;
|
|
12
|
+
export declare class FtdsBase extends FtdsBase_base {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { FtLitElement } from "./FtLitElement";
|
|
8
|
+
import { property } from "lit/decorators.js";
|
|
9
|
+
import { DesignSystemFamily, DesignSystemSize, resolveFamilyClass, resolveSizeClass } from "@fluid-topics/design-system-variables";
|
|
10
|
+
export function toFtdsBase(ElementClass) {
|
|
11
|
+
class FtdsBase extends ElementClass {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.size = DesignSystemSize.medium;
|
|
15
|
+
this.family = DesignSystemFamily.neutral;
|
|
16
|
+
}
|
|
17
|
+
getDesignSystemBaseClasses() {
|
|
18
|
+
return {
|
|
19
|
+
[resolveFamilyClass(this.family)]: true,
|
|
20
|
+
[resolveSizeClass(this.size)]: true
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
__decorate([
|
|
25
|
+
property()
|
|
26
|
+
], FtdsBase.prototype, "size", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
property()
|
|
29
|
+
], FtdsBase.prototype, "family", void 0);
|
|
30
|
+
return FtdsBase;
|
|
31
|
+
}
|
|
32
|
+
export class FtdsBase extends toFtdsBase(FtLitElement) {
|
|
33
|
+
}
|