godown 3.3.0 → 3.4.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/build/godown+lit.iife.js +4 -4
- package/build/godown+lit.iife.js.map +1 -1
- package/build/godown+lit.js +4 -4
- package/build/godown+lit.js.map +1 -1
- package/build/godown+lit.umd.js +4 -4
- package/build/godown+lit.umd.js.map +1 -1
- package/build/godown.iife.js +3 -3
- package/build/godown.js +4 -4
- package/build/godown.js.map +1 -1
- package/build/godown.umd.js +3 -3
- package/build/godown.umd.js.map +1 -1
- package/components/alert.js +1 -1
- package/components/alert.js.map +1 -1
- package/components/avatar.d.ts +5 -4
- package/components/avatar.d.ts.map +1 -1
- package/components/avatar.js +1 -1
- package/components/avatar.js.map +1 -1
- package/components/badge.d.ts +10 -2
- package/components/badge.d.ts.map +1 -1
- package/components/badge.js.map +1 -1
- package/components/breath.d.ts +2 -3
- package/components/breath.d.ts.map +1 -1
- package/components/breath.js +1 -1
- package/components/breath.js.map +1 -1
- package/components/button.d.ts +7 -2
- package/components/button.d.ts.map +1 -1
- package/components/button.js +1 -1
- package/components/button.js.map +1 -1
- package/components/card.d.ts +6 -0
- package/components/card.d.ts.map +1 -1
- package/components/card.js +1 -1
- package/components/card.js.map +1 -1
- package/components/carousel.d.ts +2 -2
- package/components/details.d.ts +3 -3
- package/components/details.d.ts.map +1 -1
- package/components/dialog.d.ts +9 -6
- package/components/dialog.d.ts.map +1 -1
- package/components/dialog.js +1 -1
- package/components/dialog.js.map +1 -1
- package/components/divider.d.ts +1 -1
- package/components/heading.d.ts +2 -0
- package/components/heading.d.ts.map +1 -1
- package/components/heading.js.map +1 -1
- package/components/input.d.ts +2 -2
- package/components/input.d.ts.map +1 -1
- package/components/input.js +1 -1
- package/components/input.js.map +1 -1
- package/components/link.d.ts +1 -1
- package/components/link.d.ts.map +1 -1
- package/components/link.js +1 -1
- package/components/link.js.map +1 -1
- package/components/progress.d.ts +0 -7
- package/components/progress.d.ts.map +1 -1
- package/components/progress.js +1 -1
- package/components/progress.js.map +1 -1
- package/components/range.d.ts +43 -9
- package/components/range.d.ts.map +1 -1
- package/components/range.js +1 -1
- package/components/range.js.map +1 -1
- package/components/rotate.d.ts +6 -4
- package/components/rotate.d.ts.map +1 -1
- package/components/rotate.js.map +1 -1
- package/components/select.d.ts +4 -2
- package/components/select.d.ts.map +1 -1
- package/components/select.js +1 -1
- package/components/select.js.map +1 -1
- package/components/split.d.ts +2 -1
- package/components/split.d.ts.map +1 -1
- package/components/split.js +1 -1
- package/components/split.js.map +1 -1
- package/components/switch.d.ts +5 -7
- package/components/switch.d.ts.map +1 -1
- package/components/switch.js +1 -1
- package/components/switch.js.map +1 -1
- package/components/time.d.ts +2 -2
- package/components/time.d.ts.map +1 -1
- package/components/time.js.map +1 -1
- package/components/tooltip.d.ts +3 -2
- package/components/tooltip.d.ts.map +1 -1
- package/components/tooltip.js +1 -1
- package/components/tooltip.js.map +1 -1
- package/core/direction.d.ts +27 -0
- package/core/direction.d.ts.map +1 -0
- package/core/direction.js +2 -0
- package/core/direction.js.map +1 -0
- package/core/global-style.d.ts +0 -2
- package/core/global-style.d.ts.map +1 -1
- package/core/global-style.js +1 -1
- package/core/global-style.js.map +1 -1
- package/core/outline.d.ts +20 -0
- package/core/outline.d.ts.map +1 -0
- package/core/outline.js +2 -0
- package/core/outline.js.map +1 -0
- package/core/super-anchor.d.ts +2 -2
- package/core/super-anchor.d.ts.map +1 -1
- package/core/super-anchor.js +1 -1
- package/core/super-anchor.js.map +1 -1
- package/core/super-input.d.ts +2 -0
- package/core/super-input.d.ts.map +1 -1
- package/core/super-input.js +1 -1
- package/core/super-input.js.map +1 -1
- package/core/super-openable.d.ts +0 -4
- package/core/super-openable.d.ts.map +1 -1
- package/custom-elements.json +1 -1
- package/dev/components/alert.js +1 -1
- package/dev/components/avatar.d.ts +5 -4
- package/dev/components/avatar.d.ts.map +1 -1
- package/dev/components/avatar.js +5 -4
- package/dev/components/avatar.js.map +1 -1
- package/dev/components/badge.d.ts +10 -2
- package/dev/components/badge.d.ts.map +1 -1
- package/dev/components/badge.js +8 -0
- package/dev/components/badge.js.map +1 -1
- package/dev/components/breath.d.ts +2 -3
- package/dev/components/breath.d.ts.map +1 -1
- package/dev/components/breath.js +3 -14
- package/dev/components/breath.js.map +1 -1
- package/dev/components/button.d.ts +7 -2
- package/dev/components/button.d.ts.map +1 -1
- package/dev/components/button.js +19 -5
- package/dev/components/button.js.map +1 -1
- package/dev/components/card.d.ts +6 -0
- package/dev/components/card.d.ts.map +1 -1
- package/dev/components/card.js +11 -11
- package/dev/components/card.js.map +1 -1
- package/dev/components/carousel.d.ts +2 -2
- package/dev/components/carousel.js +2 -2
- package/dev/components/details.d.ts +3 -3
- package/dev/components/details.d.ts.map +1 -1
- package/dev/components/details.js +3 -3
- package/dev/components/details.js.map +1 -1
- package/dev/components/dialog.d.ts +9 -6
- package/dev/components/dialog.d.ts.map +1 -1
- package/dev/components/dialog.js +58 -62
- package/dev/components/dialog.js.map +1 -1
- package/dev/components/divider.d.ts +1 -1
- package/dev/components/divider.js +1 -1
- package/dev/components/heading.d.ts +2 -0
- package/dev/components/heading.d.ts.map +1 -1
- package/dev/components/heading.js +2 -0
- package/dev/components/heading.js.map +1 -1
- package/dev/components/input.d.ts +2 -2
- package/dev/components/input.d.ts.map +1 -1
- package/dev/components/input.js +29 -8
- package/dev/components/input.js.map +1 -1
- package/dev/components/link.d.ts +1 -1
- package/dev/components/link.d.ts.map +1 -1
- package/dev/components/link.js +2 -2
- package/dev/components/link.js.map +1 -1
- package/dev/components/progress.d.ts +0 -7
- package/dev/components/progress.d.ts.map +1 -1
- package/dev/components/progress.js +4 -25
- package/dev/components/progress.js.map +1 -1
- package/dev/components/range.d.ts +43 -9
- package/dev/components/range.d.ts.map +1 -1
- package/dev/components/range.js +50 -14
- package/dev/components/range.js.map +1 -1
- package/dev/components/rotate.d.ts +6 -4
- package/dev/components/rotate.d.ts.map +1 -1
- package/dev/components/rotate.js +6 -4
- package/dev/components/rotate.js.map +1 -1
- package/dev/components/select.d.ts +4 -2
- package/dev/components/select.d.ts.map +1 -1
- package/dev/components/select.js +27 -24
- package/dev/components/select.js.map +1 -1
- package/dev/components/split.d.ts +2 -1
- package/dev/components/split.d.ts.map +1 -1
- package/dev/components/split.js +10 -6
- package/dev/components/split.js.map +1 -1
- package/dev/components/switch.d.ts +5 -7
- package/dev/components/switch.d.ts.map +1 -1
- package/dev/components/switch.js +23 -45
- package/dev/components/switch.js.map +1 -1
- package/dev/components/time.d.ts +2 -2
- package/dev/components/time.d.ts.map +1 -1
- package/dev/components/time.js.map +1 -1
- package/dev/components/tooltip.d.ts +3 -2
- package/dev/components/tooltip.d.ts.map +1 -1
- package/dev/components/tooltip.js +7 -19
- package/dev/components/tooltip.js.map +1 -1
- package/dev/core/direction.d.ts +27 -0
- package/dev/core/direction.d.ts.map +1 -0
- package/dev/core/direction.js +56 -0
- package/dev/core/direction.js.map +1 -0
- package/dev/core/global-style.d.ts +0 -2
- package/dev/core/global-style.d.ts.map +1 -1
- package/dev/core/global-style.js +1 -5
- package/dev/core/global-style.js.map +1 -1
- package/dev/core/outline.d.ts +20 -0
- package/dev/core/outline.d.ts.map +1 -0
- package/dev/core/outline.js +44 -0
- package/dev/core/outline.js.map +1 -0
- package/dev/core/super-anchor.d.ts +2 -2
- package/dev/core/super-anchor.d.ts.map +1 -1
- package/dev/core/super-anchor.js +0 -1
- package/dev/core/super-anchor.js.map +1 -1
- package/dev/core/super-input.d.ts +2 -0
- package/dev/core/super-input.d.ts.map +1 -1
- package/dev/core/super-input.js +19 -30
- package/dev/core/super-input.js.map +1 -1
- package/dev/core/super-openable.d.ts +0 -4
- package/dev/core/super-openable.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/alert.ts +1 -1
- package/src/components/avatar.ts +7 -5
- package/src/components/badge.ts +10 -3
- package/src/components/breath.ts +5 -17
- package/src/components/button.ts +18 -5
- package/src/components/card.ts +11 -11
- package/src/components/carousel.ts +2 -2
- package/src/components/details.ts +3 -3
- package/src/components/dialog.ts +66 -65
- package/src/components/divider.ts +1 -1
- package/src/components/heading.ts +2 -0
- package/src/components/input.ts +29 -8
- package/src/components/link.ts +2 -2
- package/src/components/progress.ts +4 -25
- package/src/components/range.ts +51 -15
- package/src/components/rotate.ts +6 -4
- package/src/components/select.ts +33 -26
- package/src/components/split.ts +11 -6
- package/src/components/switch.ts +26 -41
- package/src/components/time.ts +2 -2
- package/src/components/tooltip.ts +8 -20
- package/src/core/direction.ts +65 -0
- package/src/core/global-style.ts +1 -7
- package/src/core/outline.ts +54 -0
- package/src/core/super-anchor.ts +3 -2
- package/src/core/super-input.ts +22 -30
- package/src/core/super-openable.ts +0 -8
- package/vscode.html-custom-data.json +1 -1
- package/web-types.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../src/components/progress.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAiB,MAAM,yBAAyB,CAAC;AAIrE;;;;GAIG;AACH,cAEM,QAAS,SAAQ,WAAW;IAEhC,GAAG,SAAK;IAGR,GAAG,SAAK;IAGR,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../src/components/progress.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAiB,MAAM,yBAAyB,CAAC;AAIrE;;;;GAIG;AACH,cAEM,QAAS,SAAQ,WAAW;IAEhC,GAAG,SAAK;IAGR,GAAG,SAAK;IAGR,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CAUtC;AAED,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/components/progress.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{godown as r,styles as e,isNil as o,attr as
|
1
|
+
import{__decorate as t}from"tslib";import{godown as r,styles as e,isNil as o,Ranger as i,attr as s}from"@godown/element";import{css as a,html as n}from"lit";import{property as l}from"lit/decorators.js";import{cssGlobalVars as p,GlobalStyle as d}from"../core/global-style.js";let m=class Progress extends d{constructor(){super(...arguments),this.max=1,this.min=0}render(){let t,r=20;if(!o(this.value)){const e=new i(this.min,this.max);r=100*e.restrict(this.value/e.diff),t="static"}return n`<div part="root" ${s(this.observedRecord)} class="${t}"><i part="value" style="width:${r}%;"></i></div>`}};t([l({type:Number})],m.prototype,"max",void 0),t([l({type:Number})],m.prototype,"min",void 0),t([l({type:Number})],m.prototype,"value",void 0),m=t([r("progress"),e(a`:host{background:var(${p.passive});border-radius:.25em;color:var(${p.active});height:.5em;width:100%}:host,[part=root]{display:block}[part=root]{border-radius:inherit;height:inherit;overflow:hidden;position:relative;z-index:1}[part=value]{animation:progress 1.8s ease-in-out infinite alternate;background:currentColor;border-radius:inherit;height:100%;left:0;position:absolute;top:0;transition:all .3s;z-index:2}@keyframes progress{0%{left:0}to{left:80%}}.static [part=value]{animation:none}`)],m);var h=m;export{m as Progress,h as default};
|
2
2
|
//# sourceMappingURL=progress.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"progress.js","sources":["../src/components/progress.ts"],"sourcesContent":null,"names":["Progress","GlobalStyle","constructor","this","max","min","render","className","width","isNil","value","
|
1
|
+
{"version":3,"file":"progress.js","sources":["../src/components/progress.ts"],"sourcesContent":null,"names":["Progress","GlobalStyle","constructor","this","max","min","render","className","width","isNil","value","ranger","Ranger","restrict","diff","html","attr","observedRecord","__decorate","property","type","Number","prototype","undefined","godown","styles","css","cssGlobalVars","passive","active","Progress$1"],"mappings":"mRAeA,IAAMA,EAAN,MAAMA,iBAAiBC,EAAvB,WAAAC,uBAEEC,KAAGC,IAAG,EAGND,KAAGE,IAAG,EAKI,MAAAC,GACR,IACIC,EADAC,EAAQ,GAEZ,IAAKC,EAAMN,KAAKO,OAAQ,CACtB,MAAMC,EAAS,IAAIC,EAAOT,KAAKE,IAAKF,KAAKC,KACzCI,EAAoD,IAA5CG,EAAOE,SAASV,KAAKO,MAAQC,EAAOG,MAC5CP,EAAY,SAEd,OAAOQ,CAAI,oBAGLC,EAAKb,KAAKc,0BACHV,mCAIQC,oBAxBvBU,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACXrB,EAAAsB,UAAA,WAAAC,GAGPL,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACXrB,EAAAsB,UAAA,WAAAC,GAGPL,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACLrB,EAAAsB,UAAA,aAAAC,GARTvB,EAAQkB,EAAA,CAFbM,EAPiB,YAQjBC,EAAOC,CAAG,wBAAwBC,EAAcC,0CAA0CD,EAAcE,0aACnG7B,GAiCN,IAAA8B,EAAe9B"}
|
package/components/range.d.ts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import { Ranger } from "@godown/element";
|
2
2
|
import { type TemplateResult } from "lit";
|
3
|
-
import SuperInput from "../core/super-input.js";
|
3
|
+
import { SuperInput } from "../core/super-input.js";
|
4
4
|
/**
|
5
5
|
* {@linkcode Range} is similar to `<input type="range">`.
|
6
6
|
*
|
7
7
|
* Value accepts number, or array.
|
8
8
|
*
|
9
|
-
* Number has 1 handle, the array has the number of its elements
|
9
|
+
* Number has 1 handle, the array has the number of its elements.
|
10
10
|
*
|
11
11
|
* @fires input - Fires when the input value changes.
|
12
12
|
* @fires change - Fires when the input value changes.
|
@@ -29,7 +29,7 @@ declare class Range extends SuperInput {
|
|
29
29
|
*/
|
30
30
|
step: number;
|
31
31
|
/**
|
32
|
-
*
|
32
|
+
* Whether to display the range vertically.
|
33
33
|
*/
|
34
34
|
vertical: boolean;
|
35
35
|
/**
|
@@ -47,35 +47,69 @@ declare class Range extends SuperInput {
|
|
47
47
|
lastFocus?: number;
|
48
48
|
protected _ranger: Ranger;
|
49
49
|
private __focusStack;
|
50
|
-
/**
|
51
|
-
* If value is array.
|
52
|
-
*/
|
53
50
|
get range(): boolean;
|
54
51
|
/**
|
55
52
|
* Return values in the form of an array.
|
56
53
|
*/
|
57
54
|
get rangeValue(): number[];
|
58
55
|
/**
|
59
|
-
*
|
60
|
-
* @param value Fill value.
|
61
|
-
* @returns Array with length of len.
|
56
|
+
* Pad the value to the specified length.
|
62
57
|
*/
|
63
58
|
padValue(len: number, value?: number): number[];
|
64
59
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
60
|
+
get observedRecord(): Record<string, any>;
|
65
61
|
protected render(): TemplateResult<1>;
|
66
62
|
protected _renderHandle(index: number): TemplateResult<1>;
|
67
63
|
private __keydownEvent;
|
64
|
+
/**
|
65
|
+
* Focuses the handle at the given index, updates the focus stack, and dispatches a "focus" event.
|
66
|
+
* @param index - The index of the handle to focus.
|
67
|
+
*/
|
68
68
|
focusHandle(index: number): void;
|
69
|
+
/**
|
70
|
+
* Removes the focus from the currently focused handle and dispatches a "blur" event.
|
71
|
+
*/
|
69
72
|
blurHandle(): void;
|
73
|
+
/**
|
74
|
+
* Creates a keydown event handler that updates the value of the range based on arrow key presses.
|
75
|
+
* @param index - The index of the handle to update.
|
76
|
+
* @returns A function that handles the keydown event and updates the range value.
|
77
|
+
*/
|
70
78
|
protected createKeydownEvent(index: number): (e: KeyboardEvent) => void;
|
79
|
+
/**
|
80
|
+
* Creates a mouse down event handler that focuses the handle at the given index and sets the value of the range.
|
81
|
+
* @param index - The index of the handle to focus.
|
82
|
+
* @returns A function that handles the mouse down event and updates the range value.
|
83
|
+
*/
|
71
84
|
protected createMouseDown(index: number): (e: MouseEvent) => void;
|
85
|
+
/**
|
86
|
+
* Creates a function that sets the value of the range at the given index.
|
87
|
+
* @param index - The index of the value to set.
|
88
|
+
* @returns A function that sets the value of the range.
|
89
|
+
*/
|
72
90
|
protected createSetValue(index: number): (value: number) => void;
|
73
91
|
/**
|
74
92
|
* Compute value from event.
|
93
|
+
* @returns The value closest to the event client position.
|
75
94
|
*/
|
76
95
|
protected _computeValue({ clientX, clientY }: MouseEvent): number;
|
96
|
+
/**
|
97
|
+
* Handles the mouse down event on the root element of the range component.
|
98
|
+
* Computes the closest value to the mouse position, sets the value, and focuses the corresponding handle.
|
99
|
+
* @param e - The mouse down event object.
|
100
|
+
*/
|
77
101
|
protected _handleMousedownRoot(e: MouseEvent): void;
|
102
|
+
/**
|
103
|
+
* Creates a mouse down event handler that focuses the handle at the given index and sets the value of the range.
|
104
|
+
* @param index - The index of the handle to focus.
|
105
|
+
* @returns A function that handles the mouse down event and updates the range value.
|
106
|
+
*/
|
78
107
|
protected createMousedownListener(mouseMoveCallback: (arg0: number) => void): (e: MouseEvent) => void;
|
108
|
+
/**
|
109
|
+
* Creates a mouse move event handler that updates the range value based on the mouse position.
|
110
|
+
* @param callback - A function to call with the new value when the mouse is moved.
|
111
|
+
* @returns A function that handles the mouse move event and updates the range value.
|
112
|
+
*/
|
79
113
|
protected createMousemoveListener(callback: (newValue: number) => void): (e: MouseEvent) => void;
|
80
114
|
protected _connectedInit(): void;
|
81
115
|
reset(): void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../src/components/range.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsE,MAAM,
|
1
|
+
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../src/components/range.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsE,MAAM,EAAQ,MAAM,iBAAiB,CAAC;AACnH,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAIrD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAKpD;;;;;;;;;;;;;GAaG;AACH,cAMM,KAAM,SAAQ,UAAU;IAC5B;;OAEG;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CAAC,KAAK,EAAE,MAAM,OAC1B,UAAU,KAAG,IAAI;IAM9B;;;;OAIG;IACH,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,WACrB,MAAM,KAAG,IAAI;IAY9B;;;OAGG;IACH,SAAS,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,GAAG,MAAM;IAKjE;;;;OAIG;IACH,SAAS,CAAC,oBAAoB,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAenD;;;;OAIG;IACH,SAAS,CAAC,uBAAuB,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,OAC9D,UAAU,KAAG,IAAI;IAa9B;;;;OAIG;IACH,SAAS,CAAC,uBAAuB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,OACzD,UAAU,KAAG,IAAI;IAS9B,SAAS,CAAC,cAAc,IAAI,IAAI;IAahC,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,MAAM,GAAG,MAAM,EAAE;IAIzB,QAAQ,IAAI,MAAM,GAAG,MAAM,EAAE;CAM9B;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/components/range.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{part as e,godown as r,styles as a,Ranger as o,attr as
|
1
|
+
import{__decorate as t}from"tslib";import{part as e,godown as r,styles as a,Ranger as s,omit as o,attr as i,joinProperties as n,loop as h,tokenList as l,isNil as d}from"@godown/element";import{css as u,html as c}from"lit";import{property as v,queryAll as p,state as m}from"lit/decorators.js";import{scopePrefix as f,cssGlobalVars as g}from"../core/global-style.js";import{SuperInput as w}from"../core/super-input.js";const y="range",_=f(y);let b=class Range extends w{constructor(){super(...arguments),this.min=0,this.max=100,this.vertical=!1,this.__focusStack=[]}get range(){return Array.isArray(this.value)}get rangeValue(){return this.range?this.value:[this.value]}padValue(t,e=0){const{rangeValue:r}=this,a=t-r.length;return a>0?new Array(a).fill(e).concat(r):r}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),"max"!==t&&"min"!==t&&"step"!==t||(this._ranger=new s(this.min,this.max,this.step))}get observedRecord(){return o(super.observedRecord,"outline-type")}render(){const t=this.padValue(2),e=Math.min(...t),r=Math.max(...t),a=this._ranger.diff;return c`<div part="root" ${i(this.observedRecord)} @mousedown="${this.disabled?null:this._handleMousedownRoot}" style="${n([["--from",(e-this.min)/a*100+"%"],["--to",(r-this.min)/a*100+"%"],...t.map(((t,e)=>[`--handle-${e}`,(t-this.min)/a*100+"%"]))])}"><div part="track"></div>${h(this.rangeValue.length,(t=>this._renderHandle(t)))}</div>`}_renderHandle(t){const{disabled:e,range:r,rangeValue:a}=this,s=!r||r&&t===a.length-1&&1===a.length;return c`<i tabindex="0" part="handle" class="${l({"last-focus":this.lastFocus===t})}" @mousedown="${e?null:this.createMouseDown(t)}" @focus="${e?null:()=>this.focusHandle(t)}" @blur="${e?null:this.blurHandle}" style="${n({"z-index":this.__focusStack.indexOf(t)+1,"--handle":`var(--${s?"to":`handle-${t}`})`})}"></i>`}focusHandle(t){this.lastFocus=t;const e=this.__focusStack.indexOf(t);-1!==e&&this.__focusStack.splice(e,1),this.__focusStack.push(t);const r=this._handles.item(t);r?.focus(),this.__keydownEvent||(this.__keydownEvent=this.events.add(document,"keydown",this.createKeydownEvent(t))),this.dispatchEvent(new CustomEvent("focus",{detail:t}))}blurHandle(){this.lastFocus=void 0,this.__keydownEvent=this.events.remove(document,"keydown",this.__keydownEvent),this.dispatchEvent(new CustomEvent("blur"))}createKeydownEvent(t){const{rangeValue:e,step:r}=this;return e.length<2&&(t=0),a=>{const s=e[t];"ArrowLeft"===a.key||"ArrowDown"===a.key?(a.preventDefault(),this.createSetValue(t)(s-r)):"ArrowRight"!==a.key&&"ArrowUp"!==a.key||(a.preventDefault(),this.createSetValue(t)(s+r))}}createMouseDown(t){return e=>{this.focusHandle(t),this.createMousedownListener(this.createSetValue(t))(e)}}createSetValue(t){return e=>{const r=this._ranger.normalize(e);let a=r;this.range&&(a=[...this.value],a[t]=r),this.value=a,this.dispatchEvent(new CustomEvent("range",{detail:this.value}))}}_computeValue({clientX:t,clientY:e}){const{top:r,left:a,height:s,width:o}=this._root.getBoundingClientRect();return this._ranger.present(this.vertical?(e-r)/s:(t-a)/o)}_handleMousedownRoot(t){const e=this._computeValue(t),r=this.range?this.rangeValue.reduce(((t,r,a)=>Math.abs(e-r)<Math.abs(e-this.rangeValue[t])?a:t),0):0,a=this.createSetValue(r);a(e),this.createMousedownListener(a)(t),this.focusHandle(r)}createMousedownListener(t){return e=>{e.preventDefault(),e.stopPropagation();const r=this.createMousemoveListener(t);this.events.add(document,"mousemove",r);const a=()=>{this.events.remove(document,"mousemove",r),this.events.remove(document,"mouseup",a)};this.events.add(document,"mouseup",a)}}createMousemoveListener(t){return e=>{const r=this._computeValue(e);r===this._ranger.restrict(r)&&t?.call(this,r)}}_connectedInit(){const t=this._ranger.diff;this.step||=t/100,d(this.value)&&(d(this.default)?this.value=Math.round(t/2/this.step)*this.step:this.value=this.default),this.default??=this.value}reset(){this.value=this.default}sort(){return this.value=this.toSorted()}toSorted(){return this.range?[...this.value].sort(((t,e)=>t-e)):this.value}};t([v({type:Number})],b.prototype,"min",void 0),t([v({type:Number})],b.prototype,"max",void 0),t([v({type:Number})],b.prototype,"step",void 0),t([v({type:Boolean,reflect:!0})],b.prototype,"vertical",void 0),t([v({type:Array})],b.prototype,"value",void 0),t([v({type:Array})],b.prototype,"default",void 0),t([e("root")],b.prototype,"_root",void 0),t([p("[part=handle]")],b.prototype,"_handles",void 0),t([m()],b.prototype,"lastFocus",void 0),b=t([r(y),a(u`:host{${_}--handle-active:var(${g.active});${_}--track-width:.5em;${_}--length:var(${g.input}-width);background:var(${g.passive});display:block;width:var(${_}--length)}:host([contents]) [part=root]{width:inherit}:host([vertical]){height:var(${_}--length);width:-moz-fit-content;width:fit-content}:host(:not([disabled])) .last-focus{${_}--handle-scale:1.05;background:var(${_}--handle-active)}[part=root]{position:relative;width:100%;--from:0%;--to:50%;height:var(${_}--track-width)}[part=root],[part=track]{border-radius:inherit;min-height:inherit}[part=track]{background:var(${g.active});height:100%;justify-content:space-between;left:min(var(--from),var(--to));pointer-events:none;width:max(calc(var(--to) - var(--from)),calc(var(--from) - var(--to)))}[part=handle],[part=track]{display:flex;position:absolute}[part=handle]{align-items:center;background:var(${g.active});border:.1em solid;border-color:var(${g.input}-control);border-radius:50%;height:1em;justify-content:center;transform:scale(var(${_}--handle-scale,1)) translate(-50%,-25%);transform-origin:0 25%;-webkit-user-select:none;user-select:none;width:1em}`,u`[vertical]{height:inherit;width:var(${_}--track-width)}[vertical] i{transform:translate(-25%,-50%)}[vertical] [part=track]{height:max(calc(var(--to) - var(--from)),calc(var(--from) - var(--to)));left:0;top:min(var(--from),var(--to));width:100%}`,u`[part=handle]{left:var(--handle);top:0}[vertical] [part=handle]{left:0;top:var(--handle)}`)],b);var k=b;export{b as Range,k as default};
|
2
2
|
//# sourceMappingURL=range.js.map
|
package/components/range.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"range.js","sources":["../src/components/range.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Range","SuperInput","constructor","this","min","max","vertical","__focusStack","range","Array","isArray","value","rangeValue","padValue","len","miss","length","fill","concat","attributeChangedCallback","name","_old","super","_ranger","Ranger","step","render","from","Math","to","gap","diff","html","attr","
|
1
|
+
{"version":3,"file":"range.js","sources":["../src/components/range.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Range","SuperInput","constructor","this","min","max","vertical","__focusStack","range","Array","isArray","value","rangeValue","padValue","len","miss","length","fill","concat","attributeChangedCallback","name","_old","super","_ranger","Ranger","step","observedRecord","omit","render","from","Math","to","gap","diff","html","attr","disabled","_handleMousedownRoot","joinProperties","map","index","loop","_renderHandle","end","tokenList","lastFocus","createMouseDown","focusHandle","blurHandle","indexOf","indexOfFocusStack","splice","push","handleItem","_handles","item","focus","__keydownEvent","events","add","document","createKeydownEvent","dispatchEvent","CustomEvent","detail","undefined","remove","e","old","key","preventDefault","createSetValue","createMousedownListener","normalizeValue","normalize","newValue","_computeValue","clientX","clientY","top","left","height","width","_root","getBoundingClientRect","present","reduce","acc","abs","set","mouseMoveCallback","stopPropagation","move","createMousemoveListener","stop","callback","restrict","call","_connectedInit","isNil","default","round","reset","sort","toSorted","a","b","__decorate","property","type","Number","prototype","Boolean","reflect","part","queryAll","state","godown","styles","css","cssGlobalVars","active","input","passive","Range$1"],"mappings":"iaAOA,MAAMA,EAAY,QACZC,EAAWC,EAAYF,GAsB7B,IAAMG,EAAN,MAAMA,cAAcC,EAApB,WAAAC,uBAKEC,KAAGC,IAAG,EAMND,KAAGE,IAAG,IAYNF,KAAQG,UAAG,EA0BHH,KAAYI,aAAa,GAEjC,SAAIC,GACF,OAAOC,MAAMC,QAAQP,KAAKQ,OAM5B,cAAIC,GACF,OAAQT,KAAKK,MAAQL,KAAKQ,MAAQ,CAACR,KAAKQ,OAM1C,QAAAE,CAASC,EAAaH,EAAQ,GAC5B,MAAMC,WAAEA,GAAeT,KACjBY,EAAOD,EAAMF,EAAWI,OAC9B,OAAID,EAAO,EACF,IAAIN,MAAMM,GAAME,KAAKN,GAAOO,OAAON,GAErCA,EAGT,wBAAAO,CAAyBC,EAAcC,EAAqBV,GAC1DW,MAAMH,yBAAyBC,EAAMC,EAAMV,GAC9B,QAATS,GAA2B,QAATA,GAA2B,SAATA,IACtCjB,KAAKoB,QAAU,IAAIC,EAAOrB,KAAKC,IAAKD,KAAKE,IAAKF,KAAKsB,OAIvD,kBAAIC,GACF,OAAOC,EAAKL,MAAMI,eAAgB,gBAG1B,MAAAE,GACR,MAAMhB,EAAaT,KAAKU,SAAS,GAC3BgB,EAAOC,KAAK1B,OAAOQ,GACnBmB,EAAKD,KAAKzB,OAAOO,GACjBoB,EAAM7B,KAAKoB,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IAEnDvG,KAAKQ,QAxSdgG,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACX9G,EAAA+G,UAAA,WAAA9C,GAMP0C,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACT9G,EAAA+G,UAAA,WAAA9C,GAMT0C,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACN9G,EAAA+G,UAAA,YAAA9C,GAMZ0C,EAAA,CADCC,EAAS,CAAEC,KAAMG,QAASC,SAAS,KACpBjH,EAAA+G,UAAA,gBAAA9C,GAQhB0C,EAAA,CADCC,EAAS,CAAEC,KAAMpG,SACMT,EAAA+G,UAAA,aAAA9C,GAMxB0C,EAAA,CADCC,EAAS,CAAEC,KAAMpG,SACQT,EAAA+G,UAAA,eAAA9C,GAGhB0C,EAAA,CADTO,EAAK,SACsBlH,EAAA+G,UAAA,aAAA9C,GAGlB0C,EAAA,CADTQ,EAAS,kBACiCnH,EAAA+G,UAAA,gBAAA9C,GAG3C0C,EAAA,CADCS,KACiBpH,EAAA+G,UAAA,iBAAA9C,GA9CdjE,EAAK2G,EAAA,CANVU,EAAOxH,GACPyH,EACCC,CAAG,SAASzH,wBAA+B0H,EAAcC,WAAW3H,uBAA8BA,iBAAwB0H,EAAcE,+BAA+BF,EAAcG,oCAAoC7H,uFAA8FA,2FAAkGA,uCAA8CA,4FAAmGA,iHAAwH0H,EAAcC,0RAA0RD,EAAcC,8CAA8CD,EAAcE,0FAA0F5H,uHAC9mCyH,CAAG,uCAAuCzH,gNAC1CyH,CAAG,8FAECvH,GAiTN,IAAA4H,EAAe5H"}
|
package/components/rotate.d.ts
CHANGED
@@ -12,11 +12,13 @@ declare class Rotate extends GlobalStyle {
|
|
12
12
|
protected _handleRotate(e: MouseEvent): void;
|
13
13
|
/**
|
14
14
|
* Compute offset.
|
15
|
-
*
|
16
|
-
* `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`
|
17
|
-
* ```
|
18
|
-
* @param e Mouse move event.
|
15
|
+
*
|
19
16
|
* @returns rotateX, rotateY
|
17
|
+
* @example
|
18
|
+
* ```ts
|
19
|
+
* const { rotateX, rotateY } = this._computeOffset(e);
|
20
|
+
* `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`;
|
21
|
+
* ```
|
20
22
|
*/
|
21
23
|
protected _computeOffset(e: MouseEvent): {
|
22
24
|
rotateX: number;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../src/components/rotate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAErD,OAAO,EAAE,WAAW,EAAe,MAAM,yBAAyB,CAAC;AAKnE;;;;GAIG;AACH,cAEM,MAAO,SAAQ,WAAW;IAE9B,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC;IAE7B,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAIrC,KAAK,IAAI,IAAI;IAKb,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAM5C
|
1
|
+
{"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../src/components/rotate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAErD,OAAO,EAAE,WAAW,EAAe,MAAM,yBAAyB,CAAC;AAKnE;;;;GAIG;AACH,cAEM,MAAO,SAAQ,WAAW;IAE9B,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC;IAE7B,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAIrC,KAAK,IAAI,IAAI;IAKb,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAM5C;;;;;;;;;OASG;IACH,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,UAAU,GAAG;QACvC,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB;CAUF;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/components/rotate.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"rotate.js","sources":["../src/components/rotate.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Rotate","GlobalStyle","render","html","this","_handleRotate","htmlSlot","reset","_root","style","removeProperty","e","rotateX","rotateY","_computeOffset","setProperty","left","top","width","height","getBoundingClientRect","clientX","clientY","__decorate","part","prototype","undefined","godown","styles","css","Rotate$1"],"mappings":"2NAKA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAS7B,IAAMG,EAAN,MAAMA,eAAeC,EAIT,MAAAC,GACR,OAAOC,CAAI,iDAISC,KAAKC,kBAEjBC,4BAEcF,KAAKG,oBAK7B,KAAAA,GACEH,KAAKI,MAAMC,MAAMC,eAAe,aAChCN,KAAKI,MAAMC,MAAMC,eAAe,cAGxB,aAAAL,CAAcM,GACtB,MAAMC,QAAEA,EAAOC,QAAEA,GAAYT,KAAKU,eAAeH,GACjDP,KAAKI,MAAMC,MAAMM,YAAY,YAAa,WAAWH,iBAAuBC,SAC5ET,KAAKI,MAAMC,MAAMM,YAAY,aAAc,
|
1
|
+
{"version":3,"file":"rotate.js","sources":["../src/components/rotate.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Rotate","GlobalStyle","render","html","this","_handleRotate","htmlSlot","reset","_root","style","removeProperty","e","rotateX","rotateY","_computeOffset","setProperty","left","top","width","height","getBoundingClientRect","clientX","clientY","__decorate","part","prototype","undefined","godown","styles","css","Rotate$1"],"mappings":"2NAKA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAS7B,IAAMG,EAAN,MAAMA,eAAeC,EAIT,MAAAC,GACR,OAAOC,CAAI,iDAISC,KAAKC,kBAEjBC,4BAEcF,KAAKG,oBAK7B,KAAAA,GACEH,KAAKI,MAAMC,MAAMC,eAAe,aAChCN,KAAKI,MAAMC,MAAMC,eAAe,cAGxB,aAAAL,CAAcM,GACtB,MAAMC,QAAEA,EAAOC,QAAEA,GAAYT,KAAKU,eAAeH,GACjDP,KAAKI,MAAMC,MAAMM,YAAY,YAAa,WAAWH,iBAAuBC,SAC5ET,KAAKI,MAAMC,MAAMM,YAAY,aAAc,MAanC,cAAAD,CAAeH,GAIvB,MAAMK,KAAEA,EAAIC,IAAEA,EAAGC,MAAEA,EAAKC,OAAEA,GAAWf,KAAKI,MAAMY,yBAC1CC,QAAEA,EAAOC,QAAEA,GAAYX,EAM7B,MAAO,CAAEC,UAJOU,EAAUL,EAEEE,EAAS,GAAKA,EAAS,EAEjCN,SALFQ,EAAUL,EAICE,EAAQ,GAAKA,EAAQ,KA/CxCK,EAAA,CADTC,EAAK,SACsBxB,EAAAyB,UAAA,aAAAC,GAFxB1B,EAAMuB,EAAA,CAFXI,EAAO9B,GACP+B,EAAOC,CAAG,+FAA+F/B,oBAA2BA,8IAAqJA,8BAAqCA,yEACzTE,GAsDN,IAAA8B,EAAe9B"}
|
package/components/select.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { type HandlerEvent } from "@godown/element";
|
2
2
|
import { type TemplateResult } from "lit";
|
3
3
|
import Input from "./input.js";
|
4
|
+
import { type DirectionCardinalY } from "../core/direction.js";
|
4
5
|
/**
|
5
6
|
* {@linkcode Select} is similar to `<select>`.
|
6
7
|
*
|
@@ -25,14 +26,15 @@ declare class Select extends Input {
|
|
25
26
|
*/
|
26
27
|
text: string;
|
27
28
|
protected _content: HTMLElement;
|
28
|
-
direction:
|
29
|
+
direction: DirectionCardinalY;
|
29
30
|
multiple: boolean;
|
30
31
|
visible: boolean;
|
31
|
-
protected autoDirection:
|
32
|
+
protected autoDirection: DirectionCardinalY;
|
32
33
|
protected lastChecked: HTMLElement;
|
33
34
|
protected defaultText: string;
|
34
35
|
protected defaultChecked: HTMLElement[];
|
35
36
|
private __store;
|
37
|
+
get observedRecord(): Record<string, any>;
|
36
38
|
protected render(): TemplateResult<1>;
|
37
39
|
protected _handleFocus(): void;
|
38
40
|
protected firstUpdated(): void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../src/components/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAwC,MAAM,iBAAiB,CAAC;AAE1F,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,KAAK,CAAC;AAG9D,OAAO,KAAK,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../src/components/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAwC,MAAM,iBAAiB,CAAC;AAE1F,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,KAAK,CAAC;AAG9D,OAAO,KAAK,MAAM,YAAY,CAAC;AAE/B,OAAO,EAAE,KAAK,kBAAkB,EAAwB,MAAM,sBAAsB,CAAC;AAyBrF;;;;;;;;;;;;;;;;GAgBG;AACH,cAKM,MAAO,SAAQ,KAAK;IAExB,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAEzB;;OAEG;IAEH,IAAI,EAAE,MAAM,CAAC;IAGb,SAAS,CAAC,QAAQ,EAAE,WAAW,CAAC;IAGhC,SAAS,EAAE,kBAAkB,CAAC;IAG9B,QAAQ,UAAS;IAGjB,OAAO,UAAS;IAGhB,SAAS,CAAC,aAAa,EAAE,kBAAkB,CAAY;IAEvD,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IACnC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,cAAc,EAAE,WAAW,EAAE,CAAC;IACxC,OAAO,CAAC,OAAO,CAAyC;IAExD,IAAI,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAKxC;IAED,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IASrC,SAAS,CAAC,YAAY,IAAI,IAAI;IAY9B,SAAS,CAAC,YAAY,IAAI,IAAI;IA0B9B,SAAS,CAAC,cAAc,IAAI,IAAI;IAkBhC,KAAK,IAAI,IAAI;IAOb,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC;IA4B3C,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAW5B,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAW/D,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAKnC,IAAI,IAAI,IAAI;IAMZ,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM;CAGzC;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/components/select.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{part as e,godown as i,styles as o,attr as s,htmlSlot as
|
1
|
+
import{__decorate as t}from"tslib";import{part as e,godown as i,styles as o,attr as s,htmlSlot as l}from"@godown/element";import n from"@godown/f7-icon/icons/chevron-down.js";import{css as r,html as h,nothing as a}from"lit";import{property as c,state as u}from"lit/decorators.js";import p from"./input.js";import{cssGlobalVars as d}from"../core/global-style.js";import{directionOutsetPlace as f}from"../core/direction.js";function v(t,e){return t&&e&&t.toLowerCase().includes(e.toLowerCase())}function m(t,e){if(t){const i="checked";e?t.setAttribute(i,""):t.removeAttribute(i)}}let b=class Select extends p{constructor(){super(...arguments),this.multiple=!1,this.visible=!1,this.autoDirection="bottom",this.__store=[]}get observedRecord(){return{...super.observedRecord,direction:this.direction||this.autoDirection}}render(){return h`<div part="root" ${s(this.observedRecord)} class="input-field">${[this._renderPrefix(),h`<input part="input" type="${this.type}" .value="${this.text}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||a}" autocomplete="${this.autocomplete||a}" placeholder="${this.placeholder||a}" id="${this.makeId}" @focus="${this._handleFocus}" @input="${this._handleInput}">`,h`<label for="${this.makeId}" part="suffix"><i part="icon">${n()}</i></label>`,h`<label for="${this.makeId}" part="content" direction-outset-place>${l()}</label>`]}</div>`}_handleFocus(){if(!this.direction){const{top:t,bottom:e}=this.getBoundingClientRect();window.innerHeight-e<this._content.clientHeight&&t>this._content.clientHeight?this.autoDirection="top":this.autoDirection="bottom"}this.visible=!0}firstUpdated(){this.events.add(this._content,"click",(t=>{t.preventDefault(),t.stopPropagation();const{target:e}=t,i=this.optionValue(e);if(i){const t=this.select(i,e.textContent);this.multiple||m(this.lastChecked,0),m(e,t),this.lastChecked=e}this._input.focus()})),this.events.add(document,"click",(t=>{t.stopPropagation();const e=t.composedPath()[0];e&&!this.shadowRoot.contains(e)&&this.blur()}))}_connectedInit(){if(!this.value){const t=[...this.querySelectorAll("[checked]")];(this.multiple?t:t.length?[this.lastChecked=t[0]]:[]).forEach((t=>{m(t,this.select(this.optionValue(t),t.textContent))})),this.default=this.value,this.defaultText=this.text,this.defaultChecked=t}this.text||(this.text="")}reset(){this.value=this.default,this.text=this.defaultText,this.querySelectorAll("[checked]").forEach((t=>m(t,0))),this.defaultChecked.forEach((t=>m(t,1)))}select(t,e){e||=t;let i=0;if(this.multiple){const o=this.__store.findIndex((e=>e.value===t));o>-1?this.__store.splice(o,1):(this.__store.push({value:t,text:e}),i=1),this.value=this.__store.map((t=>t.value)),this.text=this.__store.map((t=>t.text)).join(", ")}else this.value===t?(this.value="",this.text=""):(this.value=t,this.text=e,i=1);return this.dispatchEvent(new CustomEvent("select",{detail:this.value,composed:!0})),this.filter(),i}filter(t){t=t?.trim(),[...this.children].forEach((e=>{this.filterCallback(e,!t||v(this.optionValue(e),t)||v(e.textContent,t),t)}))}filterCallback(t,e,i){t.style.display=e?"":"none"}_handleInput(t){if(t.stopPropagation(),this.compositing)return;const e=this._input.value;this.filter(this.multiple?function(t,e,i){const o=e.slice(0,t).lastIndexOf(i)+1||0,s=e.indexOf(i,t)||e.length;return e.slice(o,s)}(this._input.selectionStart,e,","):e),this.dispatchEvent(new CustomEvent("input",{detail:this.value,composed:!0,bubbles:!0})),this.dispatchEvent(new CustomEvent("change",{detail:this.value,composed:!0}))}focus(t){this._input.focus(t),this.visible=!0}blur(){this._input.blur(),this.visible=!1,super.blur()}optionValue(t){return t.value||t.getAttribute("value")||""}};t([c()],b.prototype,"text",void 0),t([e("content")],b.prototype,"_content",void 0),t([c()],b.prototype,"direction",void 0),t([c({type:Boolean})],b.prototype,"multiple",void 0),t([c({type:Boolean})],b.prototype,"visible",void 0),t([u()],b.prototype,"autoDirection",void 0),b=t([i("select"),o(f,r`.outline,:host(:focus-within){${d.input}-outline-color:var(${d.active})}[part=input]{text-overflow:ellipsis}[part=content]{position:absolute;visibility:hidden;width:100%}[visible] [part=content]{visibility:visible}`)],b);var _=b;export{b as Select,_ as default};
|
2
2
|
//# sourceMappingURL=select.js.map
|
package/components/select.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"select.js","sources":["../src/components/select.ts"],"sourcesContent":null,"names":["contain","a","b","toLowerCase","includes","updateChecked","element","operation","name","setAttribute","removeAttribute","Select","Input","constructor","this","multiple","visible","autoDirection","__store","
|
1
|
+
{"version":3,"file":"select.js","sources":["../src/components/select.ts"],"sourcesContent":null,"names":["contain","a","b","toLowerCase","includes","updateChecked","element","operation","name","setAttribute","removeAttribute","Select","Input","constructor","this","multiple","visible","autoDirection","__store","observedRecord","super","direction","render","html","attr","_renderPrefix","type","text","autofocus","disabled","autocapitalize","nothing","autocomplete","placeholder","makeId","_handleFocus","_handleInput","svgCaretDown","htmlSlot","top","bottom","getBoundingClientRect","window","innerHeight","_content","clientHeight","firstUpdated","events","add","e","preventDefault","stopPropagation","target","value","optionValue","select","textContent","lastChecked","_input","focus","document","composed1","composedPath","shadowRoot","contains","blur","_connectedInit","checked","querySelectorAll","length","forEach","default","defaultText","defaultChecked","reset","i","findIndex","s","splice","push","map","join","dispatchEvent","CustomEvent","detail","composed","filter","query","trim","children","filterCallback","match","style","display","compositing","c","start","slice","lastIndexOf","end","indexOf","betweenAt","selectionStart","bubbles","options","option","getAttribute","__decorate","property","prototype","undefined","part","Boolean","state","godown","styles","directionOutsetPlace","css","cssGlobalVars","input","active","Select$1"],"mappings":"saASA,SAASA,EAAQC,EAAWC,GAC1B,OAAOD,GAAKC,GAAKD,EAAEE,cAAcC,SAASF,EAAEC,cAC9C,CAQA,SAASE,EAAcC,EAA6BC,GAClD,GAAID,EAAS,CACX,MAAME,EAAO,UACTD,EACFD,EAAQG,aAAaD,EAAM,IAE3BF,EAAQI,gBAAgBF,GAG9B,CA0BA,IAAMG,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAiBEC,KAAQC,UAAG,EAGXD,KAAOE,SAAG,EAGAF,KAAaG,cAAuB,SAKtCH,KAAOI,QAAsC,GAErD,kBAAIC,GACF,MAAO,IACFC,MAAMD,eACTE,UAAWP,KAAKO,WAAaP,KAAKG,eAI5B,MAAAK,GACR,OAAOC,CAAI,oBAGLC,EAAKV,KAAKK,uCAGV,CACAL,KAAKW,gBACLF,CAAI,6BAGQT,KAAKY,iBACHZ,KAAKa,qBACDb,KAAKc,yBACNd,KAAKe,6BACAf,KAAKgB,gBAAkBC,oBACzBjB,KAAKkB,cAAgBD,mBACtBjB,KAAKmB,aAAeF,UAC7BjB,KAAKoB,mBACDpB,KAAKqB,yBACLrB,KAAKsB,iBAGnBb,CAAI,eAEOT,KAAKoB,wCAGKG,kBAGrBd,CAAI,eAEOT,KAAKoB,iDAIVI,uBAQJ,YAAAH,GACR,IAAKrB,KAAKO,UAAW,CACnB,MAAMkB,IAAEA,EAAGC,OAAEA,GAAW1B,KAAK2B,wBACzBC,OAAOC,YAAcH,EAAS1B,KAAK8B,SAASC,cAAgBN,EAAMzB,KAAK8B,SAAS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AG,KAAOA,GAC5E/D,KAAKoE,cAAc,IAAIC,YAAY,QAAS,CAAEC,OAAQtE,KAAKuC,MAAOgC,UAAU,EAAMkB,SAAS,KAC3FzF,KAAKoE,cAAc,IAAIC,YAAY,SAAU,CAAEC,OAAQtE,KAAKuC,MAAOgC,UAAU,KAG/E,KAAA1B,CAAM6C,GACJ1F,KAAK4C,OAAOC,MAAM6C,GAClB1F,KAAKE,SAAU,EAGjB,IAAAiD,GACEnD,KAAK4C,OAAOO,OACZnD,KAAKE,SAAU,EACfI,MAAM6C,OAGR,WAAAX,CAAYmD,GACV,OAAQA,EAAepD,OAASoD,EAAOC,aAAa,UAAY,KA5MlEC,EAAA,CADCC,KACWjG,EAAAkG,UAAA,YAAAC,GAGFH,EAAA,CADTI,EAAK,YACyBpG,EAAAkG,UAAA,gBAAAC,GAG/BH,EAAA,CADCC,KAC4BjG,EAAAkG,UAAA,iBAAAC,GAG7BH,EAAA,CADCC,EAAS,CAAElF,KAAMsF,WACFrG,EAAAkG,UAAA,gBAAAC,GAGhBH,EAAA,CADCC,EAAS,CAAElF,KAAMsF,WACHrG,EAAAkG,UAAA,eAAAC,GAGLH,EAAA,CADTM,KACqDtG,EAAAkG,UAAA,qBAAAC,GAvBlDnG,EAAMgG,EAAA,CALXO,EAnBiB,UAoBjBC,EACCC,EACAC,CAAG,iCAAiCC,EAAcC,2BAA2BD,EAAcE,2JAEvF7G,GAwNN,IAAA8G,EAAe9G"}
|
package/components/split.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type HandlerEvent } from "@godown/element";
|
2
2
|
import { type TemplateResult } from "lit";
|
3
|
-
import SuperInput from "../core/super-input.js";
|
3
|
+
import { SuperInput } from "../core/super-input.js";
|
4
4
|
/**
|
5
5
|
* {@linkcode Split} renders multiple input boxes.
|
6
6
|
*
|
@@ -25,6 +25,7 @@ declare class Split extends SuperInput {
|
|
25
25
|
index: number;
|
26
26
|
current: number;
|
27
27
|
currentValue: (string | void)[];
|
28
|
+
get observedRecord(): Record<string, any>;
|
28
29
|
protected render(): TemplateResult<1>;
|
29
30
|
connectedCallback(): void;
|
30
31
|
protected _handleInput(e: HandlerEvent<HTMLInputElement, InputEvent>): void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../src/components/split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,
|
1
|
+
{"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../src/components/split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAA+C,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAIrD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAKpD;;;;;;;;;;;;GAYG;AACH,cAEM,KAAM,SAAQ,UAAU;IAC5B;;OAEG;IAEH,GAAG,SAAK;IAER;;OAEG;IAEH,KAAK,SAAM;IAGX,OAAO,SAAM;IAGb,YAAY,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAM;IAErC,IAAI,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAExC;IAED,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAUrC,iBAAiB,IAAI,IAAI;IAKzB,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG,IAAI;IAY3E;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IA2C9C,KAAK,IAAI,IAAI;IAKb,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAMxB,IAAI,IAAI,IAAI;IAOZ,KAAK,IAAI,IAAI;CAQd;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/components/split.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{godown as e,styles as i,
|
1
|
+
import{__decorate as t}from"tslib";import{godown as e,styles as i,omit as r,attr as s,loop as n,tokenList as u}from"@godown/element";import{css as o,html as l}from"lit";import{property as c,state as h}from"lit/decorators.js";import{scopePrefix as a,cssGlobalVars as p}from"../core/global-style.js";import{SuperInput as d}from"../core/super-input.js";const b="split",f=a(b);let v=class Split extends d{constructor(){super(...arguments),this.len=6,this.index=-1,this.current=-1,this.currentValue=[]}get observedRecord(){return r(super.observedRecord,"outline-type")}render(){return l`<div part="root" ${s(this.observedRecord)}>${n(this.len,(t=>l`<span part="input-box" outline-type="${this.outlineType}" class="${u({focus:this.current===t})}" @click="${this.disabled?null:()=>this.focusAt(t)}">${this.currentValue[t]}</span>`))} <input part="input" id="${this.makeId}" @blur="${this.blur}" @input="${this._handleInput}" .value="${this.value.padStart(this.len," ")}"></div>`}connectedCallback(){super.connectedCallback(),this.reset()}_handleInput(t){t.stopPropagation(),this.compositing||(this.fillInput(t.data),this.value=this.currentValue.join(""),this.dispatchEvent(new CustomEvent("input",{detail:this.value,composed:!0,bubbles:!0})))}fillInput(t){if(null===t){if(null!==this.currentValue[this.current])this.currentValue[this.current]=null;else{this.currentValue[this.current-1]=null;const t=this.currentValue.findLastIndex((t=>null!==t));this.current=this.current-1<0?t<0?0:t:this.current-1}return}const e=t.length>1;if(this.currentValue[this.current]=t[0],this.current+1>=this.len?(this.current=this.currentValue.indexOf(null),-1===this.current&&this.blur()):this.current+=1,e){const e=t.slice(1);e&&this.fillInput(e)}}focus(){this.focusAt(this.current),super.focus()}focusAt(t){this.current=t,this._input.focus(),this.dispatchEvent(new CustomEvent("focus",{detail:t,bubbles:!0,composed:!0}))}blur(){this._input.blur(),this.current=-1,super.blur(),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}reset(){this.current=-1,this.value=this.default,this.currentValue=this.value.split("").concat(Array(this.len-this.value.length).fill(null)),this.index>-1&&(this.current=this.index)}};t([c({type:Number})],v.prototype,"len",void 0),t([c({type:Number})],v.prototype,"index",void 0),t([h()],v.prototype,"current",void 0),t([h()],v.prototype,"currentValue",void 0),v=t([e(b),i(o`:host{border-radius:1px;display:block;width:-moz-fit-content;width:fit-content;${f}--size:1.45em;${f}--gap:.25em}:host([contents]) [part=root]{width:-moz-fit-content;width:fit-content}[part=root]{display:flex;gap:var(${f}--gap);justify-content:space-between;position:relative;width:100%}[part=input-box],[part=root]{border-radius:inherit;vertical-align:top}[part=input-box]{align-items:center;display:inline-flex;height:var(${f}--size);justify-content:center;width:var(${f}--size)}[part=input]{background:none;height:100%;opacity:0;position:absolute;width:100%;z-index:-1}.focus{${p.input}-outline-color:var(${p.active})}`)],v);var m=v;export{v as Split,m as default};
|
2
2
|
//# sourceMappingURL=split.js.map
|
package/components/split.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"split.js","sources":["../src/components/split.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Split","SuperInput","constructor","this","len","index","current","currentValue","render","html","attr","
|
1
|
+
{"version":3,"file":"split.js","sources":["../src/components/split.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Split","SuperInput","constructor","this","len","index","current","currentValue","observedRecord","omit","super","render","html","attr","loop","outlineType","tokenList","focus","disabled","focusAt","makeId","blur","_handleInput","value","padStart","connectedCallback","reset","e","stopPropagation","compositing","fillInput","data","join","dispatchEvent","CustomEvent","detail","composed","bubbles","lastNotNull","findLastIndex","a","multiple","length","indexOf","after","slice","i","_input","default","split","concat","Array","fill","__decorate","property","type","Number","prototype","undefined","state","godown","styles","css","cssGlobalVars","input","active","Split$1"],"mappings":"8VAOA,MAAMA,EAAY,QACZC,EAAWC,EAAYF,GAiB7B,IAAMG,EAAN,MAAMA,cAAcC,EAApB,WAAAC,uBAKEC,KAAGC,IAAG,EAMND,KAAKE,OAAK,EAGVF,KAAOG,SAAK,EAGZH,K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Z,MAAMG,EAAQb,EAAKc,MAAM,GACrBD,GACFzC,KAAK2B,UAAUc,IAKrB,KAAA3B,GACEd,KAAKgB,QAAQhB,KAAKG,SAClBI,MAAMO,QAGR,OAAAE,CAAQ2B,GACN3C,KAAKG,QAAUwC,EACf3C,KAAK4C,OAAO9B,QACZd,KAAK8B,cAAc,IAAIC,YAAY,QAAS,CAAEC,OAAQW,EAAGT,SAAS,EAAMD,UAAU,KAGpF,IAAAf,GACElB,KAAK4C,OAAO1B,OACZlB,KAAKG,SAAY,EACjBI,MAAMW,OACNlB,KAAK8B,cAAc,IAAIC,YAAY,OAAQ,CAAEG,SAAS,EAAMD,UAAU,KAGxE,KAAAV,GACEvB,KAAKG,SAAY,EACjBH,KAAKoB,MAAQpB,KAAK6C,QAClB7C,KAAKI,aAAeJ,KAAKoB,MAAM0B,MAAM,IAAIC,OAAOC,MAAMhD,KAAKC,IAAMD,KAAKoB,MAAMmB,QAAQU,KAAK,OACrFjD,KAAKE,WACPF,KAAKG,QAAUH,KAAKE,SAtJxBgD,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACXxD,EAAAyD,UAAA,WAAAC,GAMPL,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACRxD,EAAAyD,UAAA,aAAAC,GAGVL,EAAA,CADCM,KACW3D,EAAAyD,UAAA,eAAAC,GAGZL,EAAA,CADCM,KACmC3D,EAAAyD,UAAA,oBAAAC,GAjBhC1D,EAAKqD,EAAA,CAFVO,EAAO/D,GACPgE,EAAOC,CAAG,kFAAkFhE,kBAAyBA,wHAA+HA,+MAAsNA,6CAAoDA,8GAAqHiE,EAAcC,2BAA2BD,EAAcE,aACrqBjE,GAgKN,IAAAkE,EAAelE"}
|
package/components/switch.d.ts
CHANGED
@@ -1,17 +1,14 @@
|
|
1
1
|
import { type TemplateResult } from "lit";
|
2
|
-
import SuperInput from "../core/super-input.js";
|
2
|
+
import { SuperInput } from "../core/super-input.js";
|
3
3
|
/**
|
4
4
|
* {@linkcode Switch} renders a switch.
|
5
5
|
*
|
6
|
-
* The switch is rectangular by default,
|
7
|
-
* set the round property to rounded switch.
|
8
|
-
*
|
9
6
|
* @fires change - Fires when the switch is switched.
|
10
7
|
* @category input
|
11
8
|
*/
|
12
9
|
declare class Switch extends SuperInput {
|
13
10
|
/**
|
14
|
-
*
|
11
|
+
* @deprecated
|
15
12
|
*/
|
16
13
|
round: boolean;
|
17
14
|
/**
|
@@ -25,15 +22,16 @@ declare class Switch extends SuperInput {
|
|
25
22
|
/**
|
26
23
|
* Default checked state.
|
27
24
|
*/
|
28
|
-
default:
|
25
|
+
default: boolean;
|
29
26
|
/**
|
30
27
|
* Input value.
|
31
28
|
*/
|
32
29
|
value: string;
|
33
30
|
protected _input: HTMLInputElement;
|
31
|
+
get observedRecord(): Record<string, any>;
|
34
32
|
protected render(): TemplateResult<1>;
|
35
33
|
reset(): void;
|
36
|
-
|
34
|
+
protected _connectedInit(): void;
|
37
35
|
protected _handleChange(): void;
|
38
36
|
namevalue(): [string, boolean];
|
39
37
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../src/components/switch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAIrD,OAAO,UAAU,MAAM,wBAAwB,CAAC;
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../src/components/switch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAIrD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAKpD;;;;;GAKG;AACH,cAEM,MAAO,SAAQ,UAAU;IAC7B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf;;OAEG;IAEH,OAAO,UAAS;IAEhB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,OAAO,UAAS;IAEhB;;OAEG;IAEH,KAAK,SAAQ;IAGb,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAEnC,IAAI,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAExC;IAED,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAIrC,KAAK,IAAI,IAAI;IAKb,SAAS,CAAC,cAAc,IAAI,IAAI;IAShC,SAAS,CAAC,aAAa,IAAI,IAAI;IAK/B,SAAS,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;CAG/B;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/components/switch.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as e}from"tslib";import{godown as t,styles as i,attr as r}from"@godown/element";import{css as a,html as
|
1
|
+
import{__decorate as e}from"tslib";import{godown as t,styles as i,omit as o,attr as r}from"@godown/element";import{css as a,html as s}from"lit";import{property as h,query as n}from"lit/decorators.js";import{scopePrefix as d,cssGlobalVars as c}from"../core/global-style.js";import{SuperInput as l}from"../core/super-input.js";const p="switch",u=d(p);let v=class Switch extends l{constructor(){super(...arguments),this.checked=!1,this.disabled=!1,this.default=!1,this.value="on"}get observedRecord(){return o(super.observedRecord,"outline-type")}render(){return s`<div part="root" ${r(this.observedRecord)} class="round"><input part="input" type="checkbox" ?disabled="${this.disabled}" ?checked="${this.checked}" name="${this.name}" id="${this.makeId}" @change="${this._handleChange}"> <span part="handle" class="${this.checked}"></span></div>`}reset(){this.checked=this.default,this._input.checked=this.checked}_connectedInit(){this.checked&&(this.default=!0),!0===this.default&&(this.checked=!0)}_handleChange(){this.checked=this._input.checked,this.dispatchEvent(new CustomEvent("change",{detail:this.checked,composed:!0}))}namevalue(){return[this.name,this.checked]}};e([h({type:Boolean,reflect:!0})],v.prototype,"checked",void 0),e([h({type:Boolean,reflect:!0})],v.prototype,"disabled",void 0),e([h({type:Boolean})],v.prototype,"default",void 0),e([h()],v.prototype,"value",void 0),e([n("input")],v.prototype,"_input",void 0),v=e([t(p),i(a`:host,:host([contents]) [part=root]{display:inline-block;height:var(${u}-height);width:var(${u}-width)}:host{${u}-width:3em;${u}-height:calc(var(${u}-width)/2);${u}-handle-size:1.25em;${u}-handle-space:.125em;${u}-transition:.2s ease-in-out;background:var(${c.passive});border-radius:calc(var(${u}-height)/2);transition:.2s ease-in-out;transition-property:background,left;vertical-align:bottom}:host([checked]){background:var(${c.active})}[part=handle],[part=root]{transition:inherit}[part=root]{height:inherit;position:relative}[part=input]{height:100%;opacity:0;width:100%}[part=handle]{align-items:center;display:inline-flex;height:100%;justify-content:center;left:0;pointer-events:none;position:absolute;width:50%}:host([checked]) [part=handle]{left:50%}[part=handle]{--size:var(${u}-handle-size);background:currentColor;border-radius:100%;height:var(--size);margin:var(${u}-handle-space);width:var(--size)}`)],v);var m=v;export{v as Switch,m as default};
|
2
2
|
//# sourceMappingURL=switch.js.map
|
package/components/switch.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"switch.js","sources":["../src/components/switch.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Switch","SuperInput","constructor","this","
|
1
|
+
{"version":3,"file":"switch.js","sources":["../src/components/switch.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Switch","SuperInput","constructor","this","checked","disabled","default","value","observedRecord","omit","super","render","html","attr","name","makeId","_handleChange","reset","_input","_connectedInit","dispatchEvent","CustomEvent","detail","composed","namevalue","__decorate","property","type","Boolean","reflect","prototype","undefined","query","godown","styles","css","cssGlobalVars","passive","active","Switch$1"],"mappings":"qUAOA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAU7B,IAAMG,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAUEC,KAAOC,SAAG,EAMVD,KAAQE,UAAG,EAMXF,KAAOG,SAAG,EAMVH,KAAKI,MAAG,KAKR,kBAAIC,GACF,OAAOC,EAAKC,MAAMF,eAAgB,gBAG1B,MAAAG,GACR,OAAOC,CAAI,oBAGLC,EAAKV,KAAKK,gFAMGL,KAAKE,uBACNF,KAAKC,kBACTD,KAAKW,aACPX,KAAKY,oBACAZ,KAAKa,8CAIPb,KAAKC,yBAMtB,KAAAa,GACEd,KAAKC,QAAUD,KAAKG,QACpBH,KAAKe,OAAOd,QAAUD,KAAKC,QAGnB,cAAAe,GACJhB,KAAKC,UACPD,KAAKG,SAAU,IAEI,IAAjBH,KAAKG,UACPH,KAAKC,SAAU,GAIT,aAAAY,GACRb,KAAKC,QAAUD,KAAKe,OAAOd,QAC3BD,KAAKiB,cAAc,IAAIC,YAAY,SAAU,CAAEC,OAAQnB,KAAKC,QAASmB,UAAU,KAGjF,SAAAC,GACE,MAAO,CAACrB,KAAKW,KAAMX,KAAKC,WAvE1BqB,EAAA,CADCC,EAAS,CAAEC,KAAMC,QAASC,SAAS,KACrB7B,EAAA8B,UAAA,eAAAC,GAMfN,EAAA,CADCC,EAAS,CAAEC,KAAMC,QAASC,SAAS,KACpB7B,EAAA8B,UAAA,gBAAAC,GAMhBN,EAAA,CADCC,EAAS,CAAEC,KAAMC,WACH5B,EAAA8B,UAAA,eAAAC,GAMfN,EAAA,CADCC,KACW1B,EAAA8B,UAAA,aAAAC,GAGFN,EAAA,CADTO,EAAM,UAC2BhC,EAAA8B,UAAA,cAAAC,GA/B9B/B,EAAMyB,EAAA,CAFXQ,EAAOpC,GACPqC,EAAOC,CAAG,uEAAuErC,uBAA8BA,kBAAyBA,eAAsBA,qBAA4BA,eAAsBA,wBAA+BA,yBAAgCA,+CAAsDsC,EAAcC,mCAAmCvC,qIAA4IsC,EAAcE,mWAAmWxC,2FAAkGA,uCACh9BE,GAqFN,IAAAuC,EAAevC"}
|
package/components/time.d.ts
CHANGED
@@ -22,11 +22,11 @@ declare class Time extends GlobalStyle {
|
|
22
22
|
/**
|
23
23
|
* If there is a value, update every gap or timeout.
|
24
24
|
*/
|
25
|
-
timeout:
|
25
|
+
timeout: number;
|
26
26
|
/**
|
27
27
|
* The number of milliseconds that change with each update.
|
28
28
|
*/
|
29
|
-
gap:
|
29
|
+
gap: number;
|
30
30
|
protected timeoutId: number;
|
31
31
|
protected render(): TemplateResult<1>;
|
32
32
|
protected updated(changedProperties: PropertyValues): void;
|
package/components/time.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../src/components/time.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAG1E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;;;GAKG;AACH,cAEM,IAAK,SAAQ,WAAW;IAC5B;;OAEG;IAEH,MAAM,SAAO;IAEb;;OAEG;IAEH,MAAM,SAAyB;IAE/B;;OAEG;IAEH,IAAI,EAAE,IAAI,CAAc;IAExB;;OAEG;IAEH,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../src/components/time.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAG1E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;;;GAKG;AACH,cAEM,IAAK,SAAQ,WAAW;IAC5B;;OAEG;IAEH,MAAM,SAAO;IAEb;;OAEG;IAEH,MAAM,SAAyB;IAE/B;;OAEG;IAEH,IAAI,EAAE,IAAI,CAAc;IAExB;;OAEG;IAEH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IAEH,GAAG,EAAE,MAAM,CAAC;IAEZ,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAE5B,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAIrC,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,cAAc,GAAG,IAAI;CAW3D;AAED,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/components/time.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"time.js","sources":["../src/components/time.ts"],"sourcesContent":null,"names":["Time","GlobalStyle","constructor","this","escape","format","time","Date","render","html","attr","observedRecord","fmtime","updated","changedProperties","has","timeout","timeouts","remove","timeoutId","add","setInterval","dispatchEvent","CustomEvent","detail","composed","getTime","gap","Math","abs","__decorate","property","prototype","undefined","type","Object","Number","godown","styles","css","Time$1"],"mappings":"+PAiBA,IAAMA,EAAN,MAAMA,aAAaC,EAAnB,WAAAC,uBAKEC,KAAMC,OAAG,IAMTD,KAAME,OAAG,sBAMTF,KAAAG,KAAa,IAAIC,KAgBP,MAAAC,GACR,OAAOC,CAAI,qBAGLC,EAAKP,KAAKQ,mBAEVC,EAAOT,KAAKE,OAAQF,KAAKG,KAAMH,KAAKC,iBAKlC,OAAAS,CAAQC,GACZA,EAAkBC,IAAI,YAAcZ,KAAKa,UAC3Cb,KAAKc,SAASC,OAAOf,KAAKgB,WAC1BhB,KAAKgB,UAAYhB,KAAKc,SAASG,IAC7BC,aAAY,KACVlB,KAAKmB,cAAc,IAAIC,YAAY,OAAQ,CAAEC,OAAQrB,KAAKG,KAAMmB,UAAU,KAC1EtB,KAAKG,KAAO,IAAIC,KAAKJ,KAAKG,KAAKoB,WAAavB,KAAKwB,KAAOxB,KAAKa,SAAS,GACrEY,KAAKC,IAAI1B,KAAKa,cA9CvBc,EAAA,CADCC,KACW/B,EAAAgC,UAAA,cAAAC,GAMZH,EAAA,CADCC,KAC6B/B,EAAAgC,UAAA,cAAAC,GAM9BH,EAAA,CADCC,EAAS,CAAEG,KAAMC,UACKnC,EAAAgC,UAAA,YAAAC,GAMvBH,EAAA,CADCC,EAAS,CAAEG,KAAME,
|
1
|
+
{"version":3,"file":"time.js","sources":["../src/components/time.ts"],"sourcesContent":null,"names":["Time","GlobalStyle","constructor","this","escape","format","time","Date","render","html","attr","observedRecord","fmtime","updated","changedProperties","has","timeout","timeouts","remove","timeoutId","add","setInterval","dispatchEvent","CustomEvent","detail","composed","getTime","gap","Math","abs","__decorate","property","prototype","undefined","type","Object","Number","godown","styles","css","Time$1"],"mappings":"+PAiBA,IAAMA,EAAN,MAAMA,aAAaC,EAAnB,WAAAC,uBAKEC,KAAMC,OAAG,IAMTD,KAAME,OAAG,sBAMTF,KAAAG,KAAa,IAAIC,KAgBP,MAAAC,GACR,OAAOC,CAAI,qBAGLC,EAAKP,KAAKQ,mBAEVC,EAAOT,KAAKE,OAAQF,KAAKG,KAAMH,KAAKC,iBAKlC,OAAAS,CAAQC,GACZA,EAAkBC,IAAI,YAAcZ,KAAKa,UAC3Cb,KAAKc,SAASC,OAAOf,KAAKgB,WAC1BhB,KAAKgB,UAAYhB,KAAKc,SAASG,IAC7BC,aAAY,KACVlB,KAAKmB,cAAc,IAAIC,YAAY,OAAQ,CAAEC,OAAQrB,KAAKG,KAAMmB,UAAU,KAC1EtB,KAAKG,KAAO,IAAIC,KAAKJ,KAAKG,KAAKoB,WAAavB,KAAKwB,KAAOxB,KAAKa,SAAS,GACrEY,KAAKC,IAAI1B,KAAKa,cA9CvBc,EAAA,CADCC,KACW/B,EAAAgC,UAAA,cAAAC,GAMZH,EAAA,CADCC,KAC6B/B,EAAAgC,UAAA,cAAAC,GAM9BH,EAAA,CADCC,EAAS,CAAEG,KAAMC,UACKnC,EAAAgC,UAAA,YAAAC,GAMvBH,EAAA,CADCC,EAAS,CAAEG,KAAME,UACHpC,EAAAgC,UAAA,eAAAC,GAMfH,EAAA,CADCC,EAAS,CAAEG,KAAME,UACPpC,EAAAgC,UAAA,WAAAC,GA7BPjC,EAAI8B,EAAA,CAFTO,EARiB,QASjBC,EAAOC,CAAG,6BACLvC,GAyDN,IAAAwC,EAAexC"}
|
package/components/tooltip.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { type TemplateResult } from "lit";
|
2
|
-
import
|
2
|
+
import { SuperOpenable } from "../core/super-openable.js";
|
3
|
+
import { type DirectionCardinal, type DirectionCorner } from "../core/direction.js";
|
3
4
|
/**
|
4
5
|
* {@linkcode Tooltip} provide tooltip for slot elements.
|
5
6
|
*
|
@@ -17,7 +18,7 @@ declare class Tooltip extends SuperOpenable {
|
|
17
18
|
/**
|
18
19
|
* Direction of opening the tip.
|
19
20
|
*/
|
20
|
-
direction:
|
21
|
+
direction: DirectionCardinal | DirectionCorner;
|
21
22
|
/**
|
22
23
|
* Content alignment.
|
23
24
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../src/components/tooltip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAIrD,OAAO,aAAa,EAAE,EAAE,KAAK,
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../src/components/tooltip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAIrD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAwB,MAAM,sBAAsB,CAAC;AAK1G;;;;;;;;GAQG;AACH,cAKM,OAAQ,SAAQ,aAAa;IACjC;;OAEG;IAEH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IAEH,SAAS,EAAE,iBAAiB,GAAG,eAAe,CAAS;IAEvD;;OAEG;IAEH,KAAK,EAAE,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO,GAAG,KAAK,CAAY;IAEzE;;OAEG;IAEH,WAAW,UAAS;IAEpB;;;;;;;;OAQG;IAEH,IAAI,EAAE,OAAO,GAAG,OAAO,CAAW;IAElC,MAAM,CAAC,MAAM;;;;;;MAMX;IAEF,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CAOtC;AAED,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|