tool-shack 0.0.3 → 0.0.4
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/dom/createElement.js +6 -1
- package/dist/dom/createElement.js.map +1 -1
- package/dist/dom/interfaces/createElement.d.ts +2 -0
- package/dist/var/www/imeteo.local/public_html/resources/assets/ts/components/regioweather.d.ts +14 -0
- package/dist/var/www/imeteo.local/public_html/resources/assets/ts/pages/forecast.d.ts +1 -0
- package/dist/var/www/imeteo.local/public_html/resources/assets/ts/pages/homepage.d.ts +1 -0
- package/dist/var/www/imeteo.local/public_html/resources/assets/ts/pages/regioweather.d.ts +1 -0
- package/package.json +1 -1
- package/src/dom/createElement.ts +6 -3
- package/src/dom/interfaces/createElement.ts +5 -0
|
@@ -4,7 +4,12 @@ export const createElement = (tagName, props) => {
|
|
|
4
4
|
for (let key in props) {
|
|
5
5
|
const value = props[key];
|
|
6
6
|
if (key === 'role') {
|
|
7
|
-
element.setAttribute(
|
|
7
|
+
element.setAttribute(key, value);
|
|
8
|
+
}
|
|
9
|
+
else if (key === 'aria') {
|
|
10
|
+
for (let ariaKey in props.aria) {
|
|
11
|
+
element.setAttribute(`aria-${ariaKey}`, value[ariaKey]);
|
|
12
|
+
}
|
|
8
13
|
}
|
|
9
14
|
else if (key === 'children') {
|
|
10
15
|
props.children.forEach((child) => element.appendChild(child));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createElement.js","sourceRoot":"","sources":["../../src/dom/createElement.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAmB,OAAe,EAAE,KAA6D,EAAK,EAAE;IACnI,MAAM,OAAO,GAAgB,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAE7D,IAAI,KAAK,EAAE;QACT,KAAK,IAAI,GAAG,IAAI,KAAK,EAAE;YACrB,MAAM,KAAK,GAAI,KAAa,CAAC,GAAG,CAAC,CAAC;YAElC,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AAO,CAAC,CAAC,EAAsC,EAAE,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;iBAC3G;aACF;iBAAM;gBACJ,OAAe,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;aAC/B;SACF;KACF;IAED,OAAO,OAAuB,CAAC;AACjC,CAAC,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export declare type TAriaLabelKey = 'atomic' | 'busy' | 'controls' | 'current' | 'describedby' | 'details' | 'disables' | 'dropeffect' | 'errormessage' | 'expanded' | 'flowto' | 'grabbed' | 'haspopup' | 'hidden' | 'invalid' | 'keyshortcuts' | 'label' | 'labelledby' | 'live' | 'modal' | 'owns' | 'relevant' | 'roledescription';
|
|
1
2
|
export interface IExtendingElementProps {
|
|
2
3
|
children?: HTMLElement[];
|
|
3
4
|
listeners?: Record<string, EventListenerOrEventListenerObject | EventListenerOrEventListenerObject[]>;
|
|
4
5
|
role?: string;
|
|
6
|
+
aria?: Partial<Record<TAriaLabelKey, string>>;
|
|
5
7
|
}
|
package/dist/var/www/imeteo.local/public_html/resources/assets/ts/components/regioweather.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class regioweatherClass {
|
|
2
|
+
private readonly input;
|
|
3
|
+
private readonly container;
|
|
4
|
+
private readonly trigger;
|
|
5
|
+
private places;
|
|
6
|
+
private geoSearchObject;
|
|
7
|
+
private customListFetched;
|
|
8
|
+
constructor();
|
|
9
|
+
private setUpListeners;
|
|
10
|
+
private renderPlaces;
|
|
11
|
+
private setUpSearch;
|
|
12
|
+
private fetchCustomList;
|
|
13
|
+
private setPreferences;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
package/src/dom/createElement.ts
CHANGED
|
@@ -8,9 +8,12 @@ export const createElement = <T = HTMLElement> (tagName: string, props?: Partial
|
|
|
8
8
|
const value = (props as any)[key];
|
|
9
9
|
|
|
10
10
|
if (key === 'role') {
|
|
11
|
-
element.setAttribute(
|
|
12
|
-
}
|
|
13
|
-
|
|
11
|
+
element.setAttribute(key, value);
|
|
12
|
+
} else if (key === 'aria') {
|
|
13
|
+
for (let ariaKey in props.aria!) {
|
|
14
|
+
element.setAttribute(`aria-${ariaKey}`, value[ariaKey]);
|
|
15
|
+
}
|
|
16
|
+
} else if (key === 'children') {
|
|
14
17
|
props.children!.forEach((child: HTMLElement) => element.appendChild(child));
|
|
15
18
|
} else if (key === 'listeners') {
|
|
16
19
|
for (let eventName in props.listeners!) {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
export type TAriaLabelKey = 'atomic' | 'busy' | 'controls' | 'current' | 'describedby' | 'details' | 'disables' |
|
|
2
|
+
'dropeffect' | 'errormessage' | 'expanded' | 'flowto' | 'grabbed' | 'haspopup' | 'hidden' | 'invalid' |
|
|
3
|
+
'keyshortcuts' | 'label' | 'labelledby' | 'live' | 'modal' | 'owns' | 'relevant' | 'roledescription';
|
|
4
|
+
|
|
1
5
|
export interface IExtendingElementProps {
|
|
2
6
|
children?: HTMLElement[];
|
|
3
7
|
listeners?: Record<string, EventListenerOrEventListenerObject | EventListenerOrEventListenerObject[]>;
|
|
4
8
|
role?: string;
|
|
9
|
+
aria?: Partial<Record<TAriaLabelKey, string>>;
|
|
5
10
|
}
|