@proximus/lavender-common 2.0.0-alpha.2 → 2.0.0-alpha.200

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.
@@ -1,4 +1,4 @@
1
- export declare function cssTokenBreakpoints(attributeName: string, selector: (attributeName: string, attribute: string, device?: 'mobile' | 'tablet' | 'laptop' | 'desktop') => string, attributeValues: string[], cssPropertyPrefix?: string, generatedCssPropertyName?: string): CSSStyleSheet;
1
+ export declare function cssTokenBreakpoints(attributeName: string, selector: (attributeName: string, attribute: string, device?: 'mobile' | 'tablet' | 'laptop' | 'desktop') => string, attributeValues: string[], cssPropertyPrefix?: string, generatedCssPropertyName?: string, selectorAttributeName?: string): CSSStyleSheet;
2
2
  export declare class AttributeBreakpointHandlerDelegate {
3
3
  private readonly component;
4
4
  private readonly attributeName;
package/dist/common.d.ts CHANGED
@@ -1,5 +1,24 @@
1
1
  export declare function getSupportedPropertyNames(htmlElementName: string): string[];
2
2
  export declare function getSupportedAttributeNames(htmlElementName: string): string[];
3
+ declare global {
4
+ interface Window {
5
+ isComponentDebug?: () => boolean;
6
+ }
7
+ }
8
+ export declare function isComponentDebug(): boolean;
9
+ /**
10
+ * Logs an error message to the console if the global debug flag is set.
11
+ * Usage: log('message')
12
+ */
13
+ export declare function log(message: string): void;
14
+ export declare class WrappedInteractiveStateController {
15
+ #private;
16
+ constructor(host: HTMLElement, interactiveElement: HTMLElement, canSetInteractiveState: () => boolean);
17
+ clearInteractiveState: () => void;
18
+ connect(): void;
19
+ disconnect(): void;
20
+ setInteractiveState(state: 'hover' | null): void;
21
+ }
3
22
  export declare class WithExtraAttributes extends HTMLElement {
4
23
  static get observedAttributes(): string[];
5
24
  constructor(...adoptedStylesheets: CSSStyleSheet[]);
@@ -8,100 +27,105 @@ export declare class WithExtraAttributes extends HTMLElement {
8
27
  updateStyle(cssName: string, breakpoint: string, value: string | null): void;
9
28
  checkName<T extends readonly string[]>(values: T, value: string): boolean;
10
29
  get $el(): Element;
11
- get $parentElementName(): string;
12
- get isGrid(): boolean;
13
- get isStack(): boolean;
14
- get grow(): string;
15
- set grow(value: string);
16
- get growMobile(): string;
17
- set growMobile(value: string);
18
- get growTablet(): string;
19
- set growTablet(value: string);
20
- get growLaptop(): string;
21
- set growLaptop(value: string);
22
- get growDesktop(): string;
23
- set growDesktop(value: string);
24
- get shrink(): string;
25
- set shrink(value: string);
26
- get shrinkMobile(): string;
27
- set shrinkMobile(value: string);
28
- get shrinkTablet(): string;
29
- set shrinkTablet(value: string);
30
- get shrinkLaptop(): string;
31
- set shrinkLaptop(value: string);
32
- get shrinkDesktop(): string;
33
- set shrinkDesktop(value: string);
34
- get basis(): string;
35
- set basis(value: string);
36
- get basisMobile(): string;
37
- set basisMobile(value: string);
38
- get basisTablet(): string;
39
- set basisTablet(value: string);
40
- get basisLaptop(): string;
41
- set basisLaptop(value: string);
42
- get basisDesktop(): string;
43
- set basisDesktop(value: string);
44
- get alignSelf(): string;
45
- set alignSelf(value: string);
46
- get alignSelfMobile(): string;
47
- set alignSelfMobile(value: string);
48
- get alignSelfTablet(): string;
49
- set alignSelfTablet(value: string);
50
- get alignSelfLaptop(): string;
51
- set alignSelfLaptop(value: string);
52
- get alignSelfDesktop(): string;
53
- set alignSelfDesktop(value: string);
54
- get justifySelf(): string;
55
- set justifySelf(value: string);
56
- get justifySelfMobile(): string;
57
- set justifySelfMobile(value: string);
58
- get justifySelfTablet(): string;
59
- set justifySelfTablet(value: string);
60
- get justifySelfLaptop(): string;
61
- set justifySelfLaptop(value: string);
62
- get justifySelfDesktop(): string;
63
- set justifySelfDesktop(value: string);
64
- get hiddenMobile(): string;
65
- set hiddenMobile(value: string);
66
- get hiddenTablet(): string;
67
- set hiddenTablet(value: string);
68
- get hiddenLaptop(): string;
69
- set hiddenLaptop(value: string);
70
- get hiddenDesktop(): string;
71
- set hiddenDesktop(value: string);
72
- get colSpan(): string;
73
- set colSpan(value: string);
74
- get colSpanMobile(): string;
75
- set colSpanMobile(value: string);
76
- get colSpanTablet(): string;
77
- set colSpanTablet(value: string);
78
- get colSpanLaptop(): string;
79
- set colSpanLaptop(value: string);
80
- get colSpanDesktop(): string;
81
- set colSpanDesktop(value: string);
82
- get order(): string;
83
- set order(value: string);
84
- get orderMobile(): string;
85
- set orderMobile(value: string);
86
- get orderTablet(): string;
87
- set orderTablet(value: string);
88
- get orderLaptop(): string;
89
- set orderLaptop(value: string);
90
- get orderDesktop(): string;
91
- set orderDesktop(value: string);
30
+ get $parentElementName(): string | undefined;
31
+ get isInsideGridOrStack(): boolean;
32
+ get grow(): string | null;
33
+ set grow(value: string | null);
34
+ get growMobile(): string | null;
35
+ set growMobile(value: string | null);
36
+ get growTablet(): string | null;
37
+ set growTablet(value: string | null);
38
+ get growLaptop(): string | null;
39
+ set growLaptop(value: string | null);
40
+ get growDesktop(): string | null;
41
+ set growDesktop(value: string | null);
42
+ get shrink(): string | null;
43
+ set shrink(value: string | null);
44
+ get shrinkMobile(): string | null;
45
+ set shrinkMobile(value: string | null);
46
+ get shrinkTablet(): string | null;
47
+ set shrinkTablet(value: string | null);
48
+ get shrinkLaptop(): string | null;
49
+ set shrinkLaptop(value: string | null);
50
+ get shrinkDesktop(): string | null;
51
+ set shrinkDesktop(value: string | null);
52
+ get basis(): string | null;
53
+ set basis(value: string | null);
54
+ get basisMobile(): string | null;
55
+ set basisMobile(value: string | null);
56
+ get basisTablet(): string | null;
57
+ set basisTablet(value: string | null);
58
+ get basisLaptop(): string | null;
59
+ set basisLaptop(value: string | null);
60
+ get basisDesktop(): string | null;
61
+ set basisDesktop(value: string | null);
62
+ get alignSelf(): string | null;
63
+ set alignSelf(value: string | null);
64
+ get alignSelfMobile(): string | null;
65
+ set alignSelfMobile(value: string | null);
66
+ get alignSelfTablet(): string | null;
67
+ set alignSelfTablet(value: string | null);
68
+ get alignSelfLaptop(): string | null;
69
+ set alignSelfLaptop(value: string | null);
70
+ get alignSelfDesktop(): string | null;
71
+ set alignSelfDesktop(value: string | null);
72
+ get justifySelf(): string | null;
73
+ set justifySelf(value: string | null);
74
+ get justifySelfMobile(): string | null;
75
+ set justifySelfMobile(value: string | null);
76
+ get justifySelfTablet(): string | null;
77
+ set justifySelfTablet(value: string | null);
78
+ get justifySelfLaptop(): string | null;
79
+ set justifySelfLaptop(value: string | null);
80
+ get justifySelfDesktop(): string | null;
81
+ set justifySelfDesktop(value: string | null);
82
+ get hiddenMobile(): boolean;
83
+ set hiddenMobile(value: boolean);
84
+ get hiddenTablet(): boolean;
85
+ set hiddenTablet(value: boolean);
86
+ get hiddenLaptop(): boolean;
87
+ set hiddenLaptop(value: boolean);
88
+ get hiddenDesktop(): boolean;
89
+ set hiddenDesktop(value: boolean);
90
+ get colSpan(): string | null;
91
+ set colSpan(value: string | null);
92
+ get colSpanMobile(): string | null;
93
+ set colSpanMobile(value: string | null);
94
+ get colSpanTablet(): string | null;
95
+ set colSpanTablet(value: string | null);
96
+ get colSpanLaptop(): string | null;
97
+ set colSpanLaptop(value: string | null);
98
+ get colSpanDesktop(): string | null;
99
+ set colSpanDesktop(value: string | null);
100
+ get order(): string | null;
101
+ set order(value: string | null);
102
+ get orderMobile(): string | null;
103
+ set orderMobile(value: string | null);
104
+ get orderTablet(): string | null;
105
+ set orderTablet(value: string | null);
106
+ get orderLaptop(): string | null;
107
+ set orderLaptop(value: string | null);
108
+ get orderDesktop(): string | null;
109
+ set orderDesktop(value: string | null);
92
110
  }
93
111
  export declare abstract class PxElement<HTML_TYPE extends Element> extends WithExtraAttributes {
94
112
  static nativeName: string;
95
- nativeName: string;
96
- accessorExclusions: string[];
113
+ static supportedPropertyNames: string[];
114
+ static accessorExclusions: string[];
97
115
  static get observedAttributes(): string[];
98
116
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
117
+ protected get ctor(): any;
99
118
  protected constructor(...adoptedStylesheets: CSSStyleSheet[]);
100
- connectedCallback(): void;
119
+ enhanceWithNativeProperties(): void;
101
120
  get $el(): HTML_TYPE;
121
+ protected _updateAttribute(name: string, value: string | null): void;
122
+ protected _updateBooleanAttribute(name: string, value: boolean | string | null | undefined): void;
123
+ }
124
+ export declare class VerticallyExtendedElement<HTML_TYPE extends Element> extends PxElement<HTML_TYPE> {
125
+ connectedCallback(): void;
102
126
  }
103
127
  export declare const gridGapValues: string[];
104
- export declare const flexboxAlignSelfValues: readonly ["", "default", "auto", "flex-start", "flex-end", "center", "baseline", "stretch"];
128
+ export declare const flexboxAlignSelfValues: readonly ["", "default", "auto", "flex-start", "start", "flex-end", "end", "center", "baseline", "stretch"];
105
129
  export declare const cssGridAlignSelfValues: readonly ["", "default", "start", "end", "center", "stretch"];
106
130
  export declare const cssGridJustifySelfValues: readonly ["", "default", "start", "end", "center", "stretch"];
107
131
  export declare const cssGridColSpanValues: string[];
@@ -130,5 +154,16 @@ export declare const assetContainerImgWidthValues: string[];
130
154
  export declare function addGlobalStylesheet(inlineStyles: string): void;
131
155
  export declare function isFalsy(value: string | boolean): boolean;
132
156
  export declare function getViewportFormat(): "mobile" | "tablet" | "laptop";
133
- export declare function checkName(values: string[], value: string): boolean;
157
+ export declare function checkName(values: string[], value: string | null): boolean;
158
+ export declare const accessibilityAttributes: string[];
134
159
  export declare function transferAccessibilityAttributes(sourceElement: HTMLElement, targetElement: HTMLElement, applyLabelledBy?: boolean): void;
160
+ export declare function propertyToAttributeSetter(element: HTMLElement, attributeName: string, value: string | number | null | undefined): void;
161
+ /**
162
+ * Sets a boolean attribute, matching native HTML semantics: the attribute is
163
+ * present (as `""`) when the value is truthy and removed when it is falsy.
164
+ *
165
+ * As with native IDL boolean properties, the value is coerced with plain JS
166
+ * truthiness — so a non-empty string such as `'false'` counts as `true`, and
167
+ * the empty string counts as `false`.
168
+ */
169
+ export declare function booleanPropertyToAttributeSetter(element: HTMLElement, attributeName: string, value: boolean | string | null | undefined | number): void;