godown 3.12.0 → 3.13.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 +12 -13
- package/build/godown+lit.iife.js.map +1 -1
- package/build/godown+lit.js +11 -12
- package/build/godown+lit.js.map +1 -1
- package/build/godown+lit.umd.js +12 -13
- package/build/godown+lit.umd.js.map +1 -1
- package/build/godown.iife.js +7 -7
- package/build/godown.iife.js.map +1 -1
- package/build/godown.js +5 -5
- package/build/godown.js.map +1 -1
- package/build/godown.umd.js +7 -7
- package/build/godown.umd.js.map +1 -1
- package/custom-elements.json +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/internal/global-style.d.ts.map +1 -1
- package/internal/global-style.js +1 -1
- package/internal/global-style.js.map +1 -1
- package/internal/popover.d.ts +3 -0
- package/internal/popover.d.ts.map +1 -0
- package/internal/popover.js +2 -0
- package/internal/popover.js.map +1 -0
- package/internal/reset-style.d.ts +3 -0
- package/internal/reset-style.d.ts.map +1 -0
- package/internal/reset-style.js +2 -0
- package/internal/reset-style.js.map +1 -0
- package/internal/ring.d.ts +1 -0
- package/internal/ring.d.ts.map +1 -1
- package/internal/ring.js +1 -1
- package/internal/ring.js.map +1 -1
- package/internal/super-input.d.ts +1 -1
- package/internal/super-input.d.ts.map +1 -1
- package/internal/super-input.js +1 -1
- package/internal/super-input.js.map +1 -1
- package/internal/utils.d.ts +2 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +2 -0
- package/internal/utils.js.map +1 -0
- package/package.json +2 -3
- package/popover.d.ts +2 -0
- package/popover.d.ts.map +1 -0
- package/popover.js +2 -0
- package/popover.js.map +1 -0
- package/src/index.ts +1 -0
- package/src/internal/global-style.ts +5 -33
- package/src/internal/popover.ts +64 -0
- package/src/internal/reset-style.ts +63 -0
- package/src/internal/ring.ts +3 -2
- package/src/internal/super-input.ts +2 -2
- package/src/internal/utils.ts +10 -0
- package/src/popover.ts +1 -0
- package/src/web-components/alert/component.ts +3 -2
- package/src/web-components/avatar/component.ts +1 -0
- package/src/web-components/button/component.ts +2 -0
- package/src/web-components/card/component.ts +3 -2
- package/src/web-components/chip/component.ts +1 -3
- package/src/web-components/details/component.ts +27 -16
- package/src/web-components/dialog/component.ts +50 -67
- package/src/web-components/heading/component.ts +0 -1
- package/src/web-components/input/component.ts +1 -3
- package/src/web-components/link/component.ts +0 -2
- package/src/web-components/popover/component.ts +172 -0
- package/src/web-components/popover/definition.ts +11 -0
- package/src/web-components/range/component.ts +2 -1
- package/src/web-components/rotate/component.ts +0 -1
- package/src/web-components/select/component.ts +109 -173
- package/src/web-components/split/component.ts +2 -2
- package/src/web-components/switch/component.ts +2 -1
- package/src/web-components/tabs/component.ts +99 -100
- package/src/web-components/tooltip/component.ts +44 -112
- package/vscode.css-custom-data.json +1 -1
- package/vscode.html-custom-data.json +1 -1
- package/web-components/alert/component.d.ts.map +1 -1
- package/web-components/alert/component.js +1 -1
- package/web-components/alert/component.js.map +1 -1
- package/web-components/avatar/component.d.ts.map +1 -1
- package/web-components/avatar/component.js +1 -1
- package/web-components/avatar/component.js.map +1 -1
- package/web-components/button/component.d.ts.map +1 -1
- package/web-components/button/component.js +1 -1
- package/web-components/button/component.js.map +1 -1
- package/web-components/card/component.d.ts.map +1 -1
- package/web-components/card/component.js +1 -1
- package/web-components/card/component.js.map +1 -1
- package/web-components/chip/component.d.ts +1 -3
- package/web-components/chip/component.d.ts.map +1 -1
- package/web-components/chip/component.js.map +1 -1
- package/web-components/details/component.d.ts +9 -13
- package/web-components/details/component.d.ts.map +1 -1
- package/web-components/details/component.js +1 -1
- package/web-components/details/component.js.map +1 -1
- package/web-components/dialog/component.d.ts +12 -14
- package/web-components/dialog/component.d.ts.map +1 -1
- package/web-components/dialog/component.js +1 -1
- package/web-components/dialog/component.js.map +1 -1
- package/web-components/heading/component.d.ts.map +1 -1
- package/web-components/heading/component.js +1 -1
- package/web-components/heading/component.js.map +1 -1
- package/web-components/input/component.d.ts.map +1 -1
- package/web-components/input/component.js +1 -1
- package/web-components/input/component.js.map +1 -1
- package/web-components/link/component.d.ts.map +1 -1
- package/web-components/link/component.js +1 -1
- package/web-components/link/component.js.map +1 -1
- package/web-components/popover/component.d.ts +35 -0
- package/web-components/popover/component.d.ts.map +1 -0
- package/web-components/popover/component.js +2 -0
- package/web-components/popover/component.js.map +1 -0
- package/web-components/popover/definition.d.ts +8 -0
- package/web-components/popover/definition.d.ts.map +1 -0
- package/web-components/popover/definition.js +2 -0
- package/web-components/popover/definition.js.map +1 -0
- package/web-components/range/component.d.ts.map +1 -1
- package/web-components/range/component.js +1 -1
- package/web-components/range/component.js.map +1 -1
- package/web-components/rotate/component.d.ts.map +1 -1
- package/web-components/rotate/component.js.map +1 -1
- package/web-components/select/component.d.ts +11 -27
- package/web-components/select/component.d.ts.map +1 -1
- package/web-components/select/component.js +1 -1
- package/web-components/select/component.js.map +1 -1
- package/web-components/split/component.js +1 -1
- package/web-components/split/component.js.map +1 -1
- package/web-components/switch/component.d.ts.map +1 -1
- package/web-components/switch/component.js +1 -1
- package/web-components/switch/component.js.map +1 -1
- package/web-components/tabs/component.d.ts +18 -25
- package/web-components/tabs/component.d.ts.map +1 -1
- package/web-components/tabs/component.js +1 -1
- package/web-components/tabs/component.js.map +1 -1
- package/web-components/tooltip/component.d.ts +15 -39
- package/web-components/tooltip/component.d.ts.map +1 -1
- package/web-components/tooltip/component.js +1 -1
- package/web-components/tooltip/component.js.map +1 -1
- package/web-types.json +1 -1
- package/internal/direction.d.ts +0 -27
- package/internal/direction.d.ts.map +0 -1
- package/internal/direction.js +0 -2
- package/internal/direction.js.map +0 -1
- package/internal/super-openable.d.ts +0 -15
- package/internal/super-openable.d.ts.map +0 -1
- package/internal/super-openable.js +0 -2
- package/internal/super-openable.js.map +0 -1
- package/src/internal/direction.ts +0 -65
- package/src/internal/super-openable.ts +0 -34
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/range/component.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","joinDeclarations","map","index","loop","_renderHandle","end","lastFocus","splice","indexOfFocusStack","push","handleItem","_handles","item","focus","__keydownEvent","blurHandle","undefined","events","remove","document","e","key","preventDefault","createSetValue","old","focusHandle","createMousedownListener","newValue","normalizeValue","dispatchCustomEvent","_computeValue","clientX","clientY","top","left","height","width","_root","getBoundingClientRect","present","reduce","acc","abs","set","mouseMoveCallback","stopPropagation","move","createMousemoveListener","add","stop","callback","call","round","reset","default","sort","toSorted","a","b","type","Number","prototype","property","Boolean","reflect","__decorate","queryPart","queryAll","state","godown","styles","css","cssGlobalVars","active","passive","background","Range$1"],"mappings":"
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/range/component.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","ringTypeAttribute","render","from","Math","to","gap","diff","html","attr","disabled","_handleMousedownRoot","joinDeclarations","map","index","loop","_renderHandle","end","lastFocus","splice","indexOfFocusStack","push","handleItem","_handles","item","focus","__keydownEvent","blurHandle","undefined","events","remove","document","e","key","preventDefault","createSetValue","old","focusHandle","createMousedownListener","newValue","normalizeValue","dispatchCustomEvent","_computeValue","clientX","clientY","top","left","height","width","_root","getBoundingClientRect","present","reduce","acc","abs","set","mouseMoveCallback","stopPropagation","move","createMousemoveListener","add","stop","callback","call","round","reset","default","sort","toSorted","a","b","type","Number","prototype","property","Boolean","reflect","__decorate","queryPart","queryAll","state","godown","styles","css","cssGlobalV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EhB,CAAAF,KAAAzF,WACO2F,UAAK,aAAK,KACnB,CACDC,EAAA,CAAAH,KAAAzF,SAtSCT,EAAAoG,UAAA,eAAA,GADCI,EAAA,CACOC,EAAA,SAMRzG,EAAAoG,UAAA,aAAA,GADCI,EAAA,CACSE,EAAA,kBAMV1G,EAAAoG,UAAA,gBAAA,GADCI,EAAA,CACYG,KAMb3G,EAAAoG,UAAA,iBAAA,KADSI,EAAO,CACCI,EAAA/G,GAQjBgH,EAAAC,CAAA,SAAAhH,uBAAAA,qBAAAA,2BAAAiH,EAAAC,0BAAAD,EAAAE,qCAAAnH,gSAAAA,ySAAAiH,EAAAG,mHAAApH,qHAAAgH,CAAA,uCAAAhH,gNAAAgH,CAAA,gGADC9G,GACQ,IAAAmH,EAAAnH"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/rotate/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAErD,OAAO,EAAE,WAAW,EAAe,MAAM,gCAAgC,CAAC;AAK1E;;;;GAIG;AACH,
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/rotate/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAErD,OAAO,EAAE,WAAW,EAAe,MAAM,gCAAgC,CAAC;AAK1E;;;;GAIG;AACH,cA6BM,MAAO,SAAQ,WAAW;IAE9B,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC;IAE7B,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAcrC,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"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/rotate/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Rotate","GlobalStyle","render","html","this","_handleRotate","htmlSlot","reset","_root","style","removeProperty","e","setProperty","rotateX","rotateY","_computeOffset","__decorate","queryPart","prototype","godown","styles","css","Rotate$1"],"mappings":"uOAKA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/rotate/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Rotate","GlobalStyle","render","html","this","_handleRotate","htmlSlot","reset","_root","style","removeProperty","e","setProperty","rotateX","rotateY","_computeOffset","__decorate","queryPart","prototype","godown","styles","css","Rotate$1"],"mappings":"uOAKA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAoC7B,IAAMG,EAAN,MAAMA,eAAeC,EAIT,MAAAC,GACR,OAAOC,CAAI,kDAAAC,KAAAC,mBAAAC,8BAAAF,KAAAG,0EAISH,KAAAI,MAAAC,MAAAC,eAAkB,cAE9B,aAAAL,CAAAM,qDAEcP,KAAAI,MAAAC,MAAAG,YAAU,YAAA,WAAAC,iBAAAC,yDAgBlC,cAAAC,CAAAJ,0JAUUK,EAAA,CAIRC,EAAM,SACNjB,EAAAkB,UAAe,gBACflB,EAAAgB,EAAa,CACbG,EAAAtB,GAEAuB,EAAAC,CAAa,+FAAuCvB,8IAAAA,8BAAAA,yEACpDE,GACA,IAAAsB,EAAOtB"}
|
@@ -1,18 +1,8 @@
|
|
1
|
-
import { type HandlerEvent } from "@godown/element";
|
2
1
|
import { type TemplateResult } from "lit";
|
3
2
|
import Input from "../input/component.js";
|
4
|
-
import { type DirectionCardinalY } from "../../internal/direction.js";
|
5
3
|
/**
|
6
4
|
* {@linkcode Select} is similar to `<select>`.
|
7
5
|
*
|
8
|
-
* Elements with the value attribute/property can be used as options.
|
9
|
-
*
|
10
|
-
* The checked attribute will be added to the selected element.
|
11
|
-
*
|
12
|
-
* Multi-selected state looks the same as single-selected.
|
13
|
-
*
|
14
|
-
* Input will filter the options.
|
15
|
-
*
|
16
6
|
* @fires input - Fires when the input value changes.
|
17
7
|
* @fires change - Fires when the input value changes.
|
18
8
|
* @fires select - Fires when select an option.
|
@@ -20,34 +10,28 @@ import { type DirectionCardinalY } from "../../internal/direction.js";
|
|
20
10
|
* @category input
|
21
11
|
*/
|
22
12
|
declare class Select extends Input {
|
23
|
-
value: string | string[];
|
24
|
-
/**
|
25
|
-
* Selected texts.
|
26
|
-
*/
|
27
13
|
text: string;
|
28
|
-
protected _content: HTMLElement;
|
29
|
-
direction: DirectionCardinalY;
|
30
14
|
multiple: boolean;
|
31
|
-
|
32
|
-
|
15
|
+
noEdit: boolean;
|
16
|
+
values: {
|
17
|
+
value: string;
|
18
|
+
label?: string;
|
19
|
+
}[];
|
20
|
+
_popover: HTMLElement;
|
33
21
|
protected lastChecked: HTMLElement;
|
34
22
|
protected defaultText: string;
|
35
|
-
protected
|
36
|
-
private __store;
|
37
|
-
get observedRecord(): Record<string, any>;
|
23
|
+
protected optionsVisible: boolean;
|
38
24
|
protected render(): TemplateResult<1>;
|
39
25
|
protected _renderSuffix(): TemplateResult<1>;
|
40
|
-
protected _handleFocus(): void;
|
41
26
|
protected firstUpdated(): void;
|
42
27
|
protected _connectedInit(): void;
|
43
28
|
reset(): void;
|
44
|
-
select(value: string,
|
45
|
-
|
46
|
-
|
47
|
-
|
29
|
+
select(value: string, label: string): 0 | 1;
|
30
|
+
checkValues(): void;
|
31
|
+
showOptions(): void;
|
32
|
+
hideOptions(): void;
|
48
33
|
focus(options?: FocusOptions): void;
|
49
34
|
blur(): void;
|
50
|
-
optionValue(option: HTMLElement): string;
|
51
35
|
}
|
52
36
|
export default Select;
|
53
37
|
export { Select };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/select/component.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/select/component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,KAAK,CAAC;AAG9D,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAmB1C;;;;;;;;GAQG;AACH,cAiCM,MAAO,SAAQ,KAAK;IAExB,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,UAAS;IAGjB,MAAM,UAAS;IAGf,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,EAAE,CAAM;IAGT,QAAQ,EAAE,WAAW,CAAC;IAEtB,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IACnC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,cAAc,UAAS;IAEjC,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAuCrC,SAAS,CAAC,aAAa,IAAI,cAAc,CAAC,CAAC,CAAC;IAM5C,SAAS,CAAC,YAAY,IAAI,IAAI;IAiB9B,SAAS,CAAC,cAAc,IAAI,IAAI;IAMhC,KAAK,IAAI,IAAI;IAKb,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC;IAiB3C,WAAW,IAAI,IAAI;IAOnB,WAAW,IAAI,IAAI;IAenB,WAAW,IAAI,IAAI;IAQnB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAMnC,IAAI,IAAI,IAAI;CAKb;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{queryPart as e,godown as i,styles as
|
1
|
+
import{__decorate as t}from"tslib";import{queryPart as e,godown as i,styles as s,attr as o,htmlSlot as l}from"@godown/element";import p from"../../internal/icons/caret-down.js";import{css as r,nothing as a,html as n}from"lit";import{property as h}from"lit/decorators.js";import u from"../input/component.js";import{showPopover as c,hidePopover as d}from"../../internal/popover.js";import{memoize as v}from"../../internal/utils.js";const f=v((()=>CSS.supports("position-area:top")));function m(t,e){if(t){const i="selected";e?t.setAttribute(i,""):t.removeAttribute(i)}}let b=class Select extends u{constructor(){super(...arguments),this.multiple=!1,this.noEdit=!1,this.values=[],this.optionsVisible=!1}render(){const t=this.noEdit||this.disabled;return n`<label part="root" ${o(this.observedRecord)}> ${[this._renderPrefix(),this.noEdit?n`<input style="position: absolute;inset: 0;opacity: 0;"/>`:"",n`<input part="input" .value="${this.text}" ?autofocus="${this.autofocus}" ?disabled="${t}" autocapitalize="${this.autocapitalize||a}" autocomplete="${this.autocomplete||a}" placeholder="${this.placeholder||a}" @input="${t?null:this._handleInput}" @change="${t?null:this._handleChange}"/>`,this._renderSuffix()]} <div part="popover" popover="${f()?"manual":a}"> ${l()} </div> </label>`}_renderSuffix(){return n`<i part="suffix">${l("suffix",p())}</i>`}firstUpdated(){this.events.add(this._slot,"click",(t=>{const{target:e}=t;if("OPTION"!==e.tagName)return;const{label:i,value:s}=e,o=this.select(s,i);this.multiple||(m(this.lastChecked,0),this.hideOptions()),m(e,o),this.lastChecked=e}))}_connectedInit(){this.default=this.value??="",this.defaultText=this.text??="",this.events.add(this,"focus",this.showOptions)}reset(){this.value=this.default,this.text=this.defaultText}select(t,e){e||=t;let i=0;const s=this.values.findIndex((e=>e.value===t));return s>-1?this.values.splice(s,1):(this.values.push({value:t,label:e}),i=1),this.checkValues(),this.value=this.values.map((t=>t.value)).join(","),this.text=this.values.map((t=>t.label)).join(", "),this.dispatchCustomEvent("select",this.value),i}checkValues(){!this.multiple&&this.values.length>1&&(this.values.splice(0,this.values.length-1),this.requestUpdate())}showOptions(){if(this.optionsVisible)return;c(this._popover);const t=e=>{this.contains(e.target)||(this.hideOptions(),this.events.remove(document,"click",t))};this.events.add(document,"click",t),this.optionsVisible=!0}hideOptions(){this.optionsVisible&&(d(this._popover),this.optionsVisible=!1)}focus(t){super.focus(),this._input.focus(t),this.showOptions()}blur(){super.blur(),this._input.blur(),d(this._popover)}};t([h()],b.prototype,"text",void 0),t([h({type:Boolean})],b.prototype,"multiple",void 0),t([h({type:Boolean})],b.prototype,"noEdit",void 0),t([h({type:Array})],b.prototype,"values",void 0),t([e("popover")],b.prototype,"_popover",void 0),b=t([i("select"),s(r`[part=root]{position:relative;anchor-name:--select}label{display:contents}[part=popover]{background:none;border:0;width:100%;position-anchor:--select;position-area:bottom center;position-try-fallbacks:flip-block}[part=input]{text-overflow:ellipsis}@supports not (position-area:top){[part=popover]{display:none;left:0;position:absolute;top:100%}}`)],b);var x=b;export{b as Select,x as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/select/component.ts"],"sourcesContent":null,"names":["
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/select/component.ts"],"sourcesContent":null,"names":["supportsPositionArea","memoize","CSS","supports","updateSelected","element","operation","name","setAttribute","removeAttribute","Select","Input","constructor","this","multiple","noEdit","values","optionsVisible","render","inputNoEdit","disabled","html","attr","observedRecord","text","autofocus","autocapitalize","nothing","autocomplete","placeholder","_handleInput","_handleChange","_renderSuffix","htmlSlot","svgCaretDown","firstUpdated","target","tagName","select","value","label","lastChecked","events","add","showOptions","default","defaultText","i","findIndex","s","splice","push","checkValues","map","join","length","requestUpdate","showPopover","_popover","listener","e","contains","remove","document","hidePopover","focus","options","super","_input","blur","property","prototype","Boolean","type","__decorate","Array","godown","styles","css"],"mappings":"+aASA,MAAMA,EAAuBC,GAAQ,IAAMC,IAAIC,SAAS,uBAExD,SAASC,EAAeC,EAA6BC,GACnD,GAAID,EAAS,CACX,MAAME,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KAAAX,KAAAG,OAAmBqC,kBAAgBC,KAAA,+BACnB,SAAEzC,KAAA0B,OACpBjC,CACA,CACA,WAAA8C,IACAvC,KAAAC,UAAAD,KAAAG,OAAAuC,OAAA,IACJ1C,KAAAG,OAAAkC,OAAA,EAAArC,KAAAG,OAAAuC,OAAA,GAEwB1C,KAAA2C,iBAGtB,WAAAZ,GACF,GAAA/B,KAAAI,eAEK,OAEHwC,EAAY5C,KAAK6C,UACnB,MAAAC,EAAAC,IAEoB/C,KAAegD,SAAAD,EAAAxB,UAC5BvB,mBACDA,KAAS6B,OAAWoB,OAAAC,SAAA,QAAAJ,GACxB,OAEMjB,WAAQqB,SAAU,QAAEJ,GAC1B9C,KAAAI,gBAAA,gBAEWJ,KAAAI,iBAGX+C,EAAanD,KAAI6C,UACjB7C,KAAKI,gBAAkB,GAEvB,KAAAgD,CAAAC,GACFC,MAAAF,QAEWpD,KAAAuD,OAAAH,MAAAC,GACTrD,KAAK+B,aACH,QAEFuB,MAAAE,OACFxD,KAAAuD,OAAAC,OAEWL,EAAAnD,KAAA6C,SACT,KAEA,CACAY,KACA5D,EAAA6D,UAAc,YAAO,cAEZC,uBACA,gBAAa,MAEtBF,EAAC,CAAAG,KAAAD,aACGD,UAAW,cAAS,GACxBG,EAAA,CACFJ,EAAA,CAAAG,KAAAE,WAEWJ,UAAA,cAAA,GACTG,EAAA,GACS,cACTH,UAAA,gBAAA,GACA7D,EAAAgE,EAAY,CACZE,EAxLc,UAyLhBC,EAAAC,CAAA,8VAEApE,SACaA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{godown as e,styles as i,StyleController as r,omit as n,attr as s,loop as u,tokenList as l}from"@godown/element";import{css as o,html as a}from"lit";import{property as c,state as h}from"lit/decorators.js";import{scopePrefix as p,cssGlobalVars as d}from"../../internal/global-style.js";import{SuperInput as f}from"../../internal/super-input.js";import{RingBuilder as b}from"../../internal/ring.js";const
|
1
|
+
import{__decorate as t}from"tslib";import{godown as e,styles as i,StyleController as r,omit as n,attr as s,loop as u,tokenList as l}from"@godown/element";import{css as o,html as a}from"lit";import{property as c,state as h}from"lit/decorators.js";import{scopePrefix as p,cssGlobalVars as d}from"../../internal/global-style.js";import{SuperInput as f}from"../../internal/super-input.js";import{RingBuilder as b,ringTypeAttribute as v}from"../../internal/ring.js";const m="split",g=p(m);let y=class Split extends f{constructor(){super(),this.len=6,this.index=-1,this.current=-1,this.currentValue=[],new r(this,(()=>new b({selector:"[part=input-box]",type:this.ringType}).css))}get observedRecord(){return n(super.observedRecord,v)}render(){return a`<div part="root" ${s(this.observedRecord)}> ${u(this.len,(t=>a`<span part="input-box" ring-type="${this.ringType}" class="${l({focus:this.current===t})}" @click="${this.disabled?null:()=>this.focusAt(t)}"> ${this.currentValue[t]} </span>`))} <input part="input" @blur=${this.blur} @input="${this._handleInput}" @change="${this._handleChange}" .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.dispatchCustomEvent("input",this.value,{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()}blur(){this._input.blur(),this.current=-1,super.blur()}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})],y.prototype,"len",void 0),t([c({type:Number})],y.prototype,"index",void 0),t([h()],y.prototype,"current",void 0),t([h()],y.prototype,"currentValue",void 0),y=t([e(m),i(o`:host{border-radius:.1em;display:block;width:-moz-fit-content;width:fit-content;${g}--size:2em;${g}--gap:.25em}[part=root]{display:flex;gap:var(${g}--gap);justify-content:space-between;position:relative}[part=input-box],[part=root]{border-radius:inherit;vertical-align:top}[part=input-box]{align-items:center;display:inline-flex;height:var(${g}--size);justify-content:center;width:var(${g}--size)}[part=input]{background:none;height:100%;opacity:0;position:absolute;width:100%;z-index:-1}.focus,[part=input-box]:active{${d.ringColor}:var(${d.active})}`)],y);var $=y;export{y as Split,$ as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/split/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Split","SuperInput","constructor","super","this","len","index","current","currentValue","StyleController","RingBuilder","selector","type","ringType","css","observedRecord","omit","render","html","attr","loop","tokenList","focus","disabled","focusAt","blur","_handleInput","_handleChange","value","padStart","connectedCallback","compositing","join","fillInput","data","after","i","_input","default","split","concat","Array","length","fill","Number","prototype","property","state","__decorate","godown","cssGlobalVars","ringColor","active"],"mappings":"
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/split/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Split","SuperInput","constructor","super","this","len","index","current","currentValue","StyleController","RingBuilder","selector","type","ringType","css","observedRecord","omit","ringTypeAttribute","render","html","attr","loop","tokenList","focus","disabled","focusAt","blur","_handleInput","_handleChange","value","padStart","connectedCallback","compositing","join","fillInput","data","after","i","_input","default","split","concat","Array","length","fill","Number","prototype","property","state","__decorate","godown","cssGlobalVars","ringColor","active"],"mappings":"6cAQA,MAAMA,EAAY,QACZC,EAAWC,EAAYF,GA0D7B,IAAMG,EAAN,MAAMA,cAAcC,EAmBlB,WAAAC,GACEC,QAfFC,KAAGC,IAAG,EAMND,KAAKE,OAAK,EAGVF,KAAOG,SAAK,EAGZH,KAAYI,aAAsB,GAIhC,IAAIC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EhD,EAAA8C,UAAY,eAAI,GAChBG,EAAA,CACFD,OAEIF,UAAA,oBAAA,GACF9C,EAAAiD,EAAW,CACXC,EAAArD,KACKiB,CAAK,mFAAEhB,eAAAA,iDAAAA,oMAAAA,6CAAAA,sIAAAqD,EAAAC,iBAAAD,EAAAE,sBAGTrD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/switch/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAIrD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/switch/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAIrD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAM3D;;;;;GAKG;AACH,cA0DM,MAAO,SAAQ,UAAU,CAAC,OAAO,CAAC;IACtC,IAAI,OAAO,CAAC,CAAC,EAAE,OAAO,EAErB;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;OAEG;IAEH,OAAO,UAAS;IAEhB;;OAEG;IAEH,KAAK,UAAS;IAEd,IAAI,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAExC;IAED,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAmBrC,KAAK,IAAI,IAAI;IAKb,SAAS,CAAC,cAAc,IAAI,IAAI;IAWhC,SAAS,CAAC,aAAa,IAAI,IAAI;CAKhC;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{godown as e,styles as a,omit as
|
1
|
+
import{__decorate as t}from"tslib";import{godown as e,styles as a,omit as r,attr as i}from"@godown/element";import{css as o,html as s}from"lit";import{property as n}from"lit/decorators.js";import{scopePrefix as h,cssGlobalVars as l}from"../../internal/global-style.js";import{SuperInput as d}from"../../internal/super-input.js";import{ringTypeAttribute as c}from"../../internal/ring.js";const p="switch",u=h(p);let v=class Switch extends d{constructor(){super(...arguments),this.default=!1,this.value=!1}set checked(t){this.value=t}get checked(){return this.value}get observedRecord(){return r(super.observedRecord,c)}render(){return s`<div part="root" ${i(this.observedRecord)} class="round"> <input part="input" type="checkbox" ?disabled="${this.disabled}" ?checked="${this.value}" @change="${this._handleChange}"/> <span part="handle"></span> </div>`}reset(){this.value=this.default,this._input.checked=this.value}_connectedInit(){this.default?this.value=!0:this.value&&(this.value=!0,this.default=!0)}_handleChange(){const{checked:t}=this._input;this.value=t,this.dispatchCustomEvent("change",this.value)}};t([n({type:Boolean})],v.prototype,"default",void 0),t([n({type:Boolean,attribute:"checked",reflect:!0})],v.prototype,"value",void 0),v=t([e(p),a(o`:host,:host([contents]) [part=root]{display:inline-block}:host{${u}-width:3em;${u}-height:calc(var(${u}-width)/2);${u}-handle-size:1.25em;${u}-handle-space:calc(var(${u}-width)/4 - var(${u}-handle-size)/2);background:var(${l.passive});border-radius:calc(var(${u}-height)/2);height:var(${u}-height);transition:.2s ease-in-out;transition-property:background,left;vertical-align:bottom;width:var(${u}-width)}:host([checked]){background:var(${l.active})}[part=root]{position:relative}[part=handle],[part=root]{align-items:center;display:flex;transition:inherit}[part=handle]{background:var(${l.background});border-radius:100%;height:var(${u}-handle-size);justify-content:center;left:0;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%) translateX(var(${u}-handle-space));width:var(${u}-handle-size)}:host([checked]) [part=handle]{left:50%}[part=input]{height:100%;opacity:0;width:100%}`)],v);var g=v;export{v as Switch,g as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/switch/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Switch","SuperInput","constructor","this","default","value","checked","v","observedRecord","omit","super","render","html","attr","disabled","_handleChange","_input","dispatchCustomEvent","__decorate","type","Boolean","property","attribute","reflect","prototype","styles","css","cssGlobalVars","passive","active","background","Switch$1"],"mappings":"
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/switch/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Switch","SuperInput","constructor","this","default","value","checked","v","observedRecord","omit","super","ringTypeAttribute","render","html","attr","disabled","_handleChange","_input","dispatchCustomEvent","__decorate","type","Boolean","property","attribute","reflect","prototype","styles","css","cssGlobalVars","passive","active","background","Switch$1"],"mappings":"mYAQA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAkE7B,IAAMG,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAaEC,KAAOC,SAAG,EAMVD,KAAKE,OAAG,EAlBR,WAAIC,CAAQC,GACVJ,KAAKE,MAAQE,EAGf,WAAID,GACF,OAAOH,KAAKE,MAed,kBAAIG,GACF,OAAOC,EAAKC,MAAMF,eAAgBG,GAG1B,MAAAC,GACR,OAAOC,CAAI,oBAAAC,EAAAX,KAAAK,iFAAAL,KAAAY,uBAAAZ,KAAAE,mBAAAF,KAAAa,8DAGLb,KAAAE,MAAUF,KAAAC,mFAQCD,KAAAE,uCAOnB,aAAAW,GACE,MAAUV,QAAAA,QAAeW,OACzBd,KAAKE,MAAOC,EACdH,KAAAe,oBAAA,SAAAf,KAAAE,SAIIc,EAAA,GACF,CAAAC,KAAAC,uBAAO,eAAA,GACLF,EAAA,CACEG,EAAA,CAAAF,KAAKC,QAAQE,UAAI,UAAAC,SAAA,KACjBxB,EAAAyB,UAAK,aAAU,OACjB,GACF5B,GACF6B,EAAAC,CAAA,kEAAA7B,eAAAA,qBAAAA,eAAAA,wBAAAA,2BAAAA,oBAAAA,oCAAA8B,EAAAC,mCAAA/B,2BAAAA,4GAAAA,4CAAA8B,EAAAE,mJAAAF,EAAAG,6CAAAjC,wIAAAA,8BAAAA,6GAGE,IAAAkC"}
|
@@ -4,50 +4,43 @@ import { type RingType } from "../../internal/ring.js";
|
|
4
4
|
/**
|
5
5
|
* {@linkcode Tabs} used to render a set of tabs.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
* When "useSlot" is enabled, each item in "tabs" becomes a named slot with the same name as itself,
|
10
|
-
* while for non-slot tabs, the content is rendered as a horizontally padded string.
|
11
|
-
*
|
12
|
-
* When "mouseenter" and "mouseleave" are triggered on an individual tab, the indicator will move.
|
13
|
-
*
|
14
|
-
* The moving indicator will start from the position of the item that was last entered.
|
15
|
-
*
|
16
|
-
* If the pointer moves out of the root element or the element is connected to the document,
|
17
|
-
* the starting position of the indicator will be regarded as the current selection.
|
18
|
-
*
|
19
|
-
* Apply "flex-direction: column" to the tabs to arrange them vertically.
|
20
|
-
*
|
21
|
-
* @csspart root - The root element.
|
22
|
-
* @csspart item - The tab items.
|
23
|
-
* @csspart indicator - The indicator.
|
24
|
-
* @csspart selected - The selected tab item.
|
25
|
-
* @csspart hover - The hovered tab item.
|
26
|
-
* @fires select - Fires when the tab is selected.
|
7
|
+
* @fires select - Fires when the tab index is changed.
|
27
8
|
* @category display
|
28
9
|
*/
|
29
10
|
declare class Tabs extends GlobalStyle {
|
30
11
|
ringType: RingType;
|
31
12
|
/**
|
32
|
-
*
|
13
|
+
* If it is "select", the indicator moves from the selected content to the hover position.
|
14
|
+
*
|
15
|
+
* If it is "previous", the indicator moves from the last moved position to the hover position.
|
16
|
+
*
|
17
|
+
* If "none", the indicator will not move.
|
18
|
+
*/
|
19
|
+
beginning: "selected" | "previous" | "none";
|
20
|
+
/**
|
21
|
+
* The behavior of the indicator:
|
22
|
+
*
|
23
|
+
* If "background", its size will be consistent with that of a single tab.
|
24
|
+
*
|
25
|
+
* If "underline", an underline will be displayed at the bottom of the tab.
|
33
26
|
*/
|
34
|
-
|
27
|
+
indicator: "background" | "underline";
|
35
28
|
/**
|
36
|
-
*
|
29
|
+
* Tab list or slot list.
|
37
30
|
*/
|
38
31
|
tabs: string[];
|
39
32
|
/**
|
40
33
|
* The index of the currently selected tab.
|
41
34
|
*/
|
42
35
|
index: number;
|
43
|
-
protected
|
36
|
+
protected previousIndex: number;
|
44
37
|
protected _items: HTMLCollectionOf<HTMLLIElement>;
|
45
38
|
protected _indicators: HTMLCollectionOf<HTMLDivElement>;
|
46
39
|
constructor();
|
47
40
|
render(): TemplateResult<1>;
|
48
41
|
connectedCallback(): void;
|
49
42
|
protected _handleMouseLeave(): void;
|
50
|
-
move(
|
43
|
+
move(sourceIndex: number, targetIndex: number): void;
|
51
44
|
select(selected: number): void;
|
52
45
|
}
|
53
46
|
export default Tabs;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/tabs/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,WAAW,EAAe,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAErD,OAAO,
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/tabs/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,WAAW,EAAe,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAErD,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAOvF;;;;;GAKG;AACH,cAyEM,IAAK,SAAQ,WAAW;IAE5B,QAAQ,EAAE,QAAQ,CAAY;IAE9B;;;;;;OAMG;IAEH,SAAS,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAc;IAEzD;;;;;;OAMG;IAEH,SAAS,EAAE,YAAY,GAAG,WAAW,CAAgB;IAErD;;OAEG;IAEH,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf;;OAEG;IAEH,KAAK,SAAK;IAEV,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC;IAGhC,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAGlD,SAAS,CAAC,WAAW,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;;IAOxD,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IA0B3B,iBAAiB,IAAI,IAAI;IAKzB,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAQnC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAsCpD,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAS/B;AAED,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{godown as i,styles as e,StyleController as r,attr as
|
1
|
+
import{__decorate as t}from"tslib";import{godown as i,styles as e,StyleController as r,attr as n,tokenList as o,htmlSlot as s}from"@godown/element";import{scopePrefix as a,cssGlobalVars as d,GlobalStyle as p}from"../../internal/global-style.js";import{css as c,html as l}from"lit";import{property as h,queryAll as u}from"lit/decorators.js";import{ringTypeAttribute as m,RingBuilder as v}from"../../internal/ring.js";const g="tabs",b=a(g),x="hover";let y=class Tabs extends p{constructor(){super(),this.ringType="border",this.beginning="selected",this.indicator="background",this.index=0,new r(this,(()=>new v({type:this.ringType}).css))}render(){return l`<ul part="root" ${n(this.observedRecord)} @mouseleave="${this._handleMouseLeave}"> ${this.tabs?.map(((t,i)=>l`<li part="${o("item",this.index===i&&"selected")}" @mouseenter=${()=>{this.move(this.previousIndex,i),this.previousIndex=i}} @click=${()=>this.select(i)}> ${s(t,t)} <div part="indicator"></div> </li>`))} </ul>`}connectedCallback(){super.connectedCallback(),this.previousIndex="selected"===this.beginning?this.index:-1}_handleMouseLeave(){const t=this._items[this.previousIndex];t&&t.part.remove(x),this.previousIndex="selected"===this.beginning?this.index:-1}move(t,i){if(t===i)return;const{_items:e,_indicators:r}=this,n=e[i];if(!n)return;n.part.add(x);const o=e[t];if(!o)return;if(o.part.remove(x),"none"===this.beginning)return;const s=r[i],a=r[t];if(!s||!a)return;const{x:d,y:p,width:c}=a.getBoundingClientRect(),{x:l,y:h}=s.getBoundingClientRect(),u=d-l,m=p-h,{style:v}=s,{style:g}=a;v.transform=`translate3d(${u}px,${m}px,0)`,v.width=`${c}px`,v.transition=g.transition="none",s.getBoundingClientRect(),v.width=v.transform=v.transition=g.transition=""}select(t){const{index:i,previousIndex:e}=this;this.move(e,t),t!==i&&(this.previousIndex=t,this.index=t,this.dispatchCustomEvent("select",t))}};t([h({attribute:m})],y.prototype,"ringType",void 0),t([h()],y.prototype,"beginning",void 0),t([h()],y.prototype,"indicator",void 0),t([h({type:Array})],y.prototype,"tabs",void 0),t([h({type:Number})],y.prototype,"index",void 0),t([u("[part~=item]")],y.prototype,"_items",void 0),t([u("[part=indicator]")],y.prototype,"_indicators",void 0),y=t([i(g),e(c`:host{${b}--indicator-background:var(${d.passive});${b}--selected-background:var(${d.passive});cursor:default;display:flex;transition:.2s ease-in-out}[part=root]{border-radius:inherit;display:flex;flex-direction:inherit;gap:.25em;overflow-x:clip;padding:.25em;position:relative;transition:inherit;transition-property:width,transform,opacity;z-index:1}[part~=item]{display:block;padding:0 .25em;position:relative;white-space:nowrap}[part=indicator],[part~=item],[part~=item]:after{border-radius:inherit;transition:inherit;transition-property:inherit;width:100%}[part=indicator],[part~=item]:after{background:var(${b}--indicator-background);height:100%;inset:0;position:absolute}[part=indicator]{opacity:0;z-index:-1}[part~=item]:after{z-index:-2}[indicator=underline] [part=indicator],[indicator=underline] [part~=item]:after{border-radius:.075em;height:.15em;margin-top:.15em;top:100%}[part~=selected]:after{background:var(${b}--selected-background);content:""}[part~=hover] [part=indicator]{opacity:1}`)],y);var f=y;export{y as Tabs,f as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/tabs/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/tabs/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","hoverToken","Tabs","GlobalStyle","constructor","super","this","ringType","beginning","indicator","index","StyleController","RingBuilder","type","css","render","html","attr","observedRecord","_handleMouseLeave","tabs","map","tab","tokenList","select","htmlSlot","connectedCallback","lastItem","_items","previousIndex","part","remove","_indicators","targetElement","targetIndex","add","fromItem","sourceIndex","targetIndicator","sourceIndicator","x","sourceX","y","sourceY","width","sourceWidth","getBoundingClientRect","transformX","transformY","targetStyle","style","sourceStyle","transform","transition","selected","move","dispatchCustomEvent","__decorate","attribute","prototype","property","Array","Number","queryAll","godown","styles","cssGlobalVars","passive","Tabs$1"],"mappings":"gaAMA,MAAMA,EAAY,OACZC,EAAWC,EAAYF,GAEvBG,EAAa,QAiFnB,IAAMC,EAAN,MAAMA,aAAaC,EA4CjB,WAAAC,GACEC,QA3CFC,KAAQC,SAAa,SAUrBD,KAASE,UAAqC,WAU9CF,KAASG,UAA+B,aAYxCH,KAAKI,MAAG,EAYN,IAAIC,EAAgBL,MAAM,IAAM,IAAIM,EAAY,CAAEC,KAAMP,KAAKC,WAAYO,MAG3E,MAAAC,GACE,OAAOC,CAAI,mBAAAC,EAAAX,KAAAY,gCAAAZ,KAAAa,uBAAAb,KAAAc,MAAAC,KAAA,CAAAC,EAAAZ,IAAAM,CAAA,aAAAO,EAAA,OAAAjB,KAAAI,QAAAA,GAAA,4BAAA,qEAGK,IAAAJ,KAAAkB,OAAed,OAAAe,EAAAH,EAAAA,iDACZ,qBAEbjB,MAAIqB,iFAIc,iBAAAP,SACRQ,EAAMrB,KAAkBsB,OAAAtB,KAAEuB,eAC9BF,GACDA,EAAAG,KAAAC,OAAA9B,+DAGC,oBAIP,OAEJ,MAAA2B,OAAAA,EAAAI,YAAAA,GAAA1B,KACH2B,EAAAL,EAAAM,GAEiB,IAAAD,EACV,OAEPA,EAAA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AAAlE"}
|
@@ -1,50 +1,26 @@
|
|
1
1
|
import { type TemplateResult } from "lit";
|
2
|
-
import
|
3
|
-
import { type DirectionCardinal, type DirectionCorner } from "../../internal/direction.js";
|
2
|
+
import Popover from "../popover/component.js";
|
4
3
|
/**
|
5
|
-
* {@linkcode Tooltip}
|
4
|
+
* {@linkcode Tooltip} is similar to {@linkcode Popover}.
|
6
5
|
*
|
7
|
-
*
|
6
|
+
* It listens for the mouseenter event and displays the tip or popover after a specified delay.
|
8
7
|
*
|
9
|
-
*
|
10
|
-
*
|
8
|
+
* When it is clicked or the mouseleave event occurs followed by another delay, closes the tip.
|
9
|
+
*
|
10
|
+
* @fires toggle - Fired when the popover is toggled.
|
11
|
+
* @slot tip - Tip content.
|
12
|
+
* @slot - Tip trigger.
|
11
13
|
* @category feedback
|
12
14
|
*/
|
13
|
-
declare class Tooltip extends
|
14
|
-
|
15
|
-
|
16
|
-
*/
|
15
|
+
declare class Tooltip extends Popover {
|
16
|
+
action: "hide";
|
17
|
+
span: "span" | "isolated";
|
17
18
|
tip: string;
|
18
|
-
|
19
|
-
* Direction of opening the tip.
|
20
|
-
*/
|
21
|
-
direction: DirectionCardinal | DirectionCorner;
|
22
|
-
/**
|
23
|
-
* Content alignment.
|
24
|
-
*/
|
25
|
-
align: "center" | "flex-start" | "flex-end" | "start" | "end";
|
26
|
-
/**
|
27
|
-
* If true, allow penetration of the tip.
|
28
|
-
*/
|
29
|
-
propagation: boolean;
|
30
|
-
/**
|
31
|
-
* How can tips be triggered.
|
32
|
-
*
|
33
|
-
* If `focus`, element will be focusable, open tip when focused.
|
34
|
-
*
|
35
|
-
* If `hover`, element will open tip when hovered.
|
36
|
-
*
|
37
|
-
* @default "hover"
|
38
|
-
*/
|
39
|
-
type: "hover" | "focus";
|
40
|
-
static aligns: {
|
41
|
-
start: string;
|
42
|
-
end: string;
|
43
|
-
center: string;
|
44
|
-
"flex-start": string;
|
45
|
-
"flex-end": string;
|
46
|
-
};
|
19
|
+
delay: number;
|
47
20
|
protected render(): TemplateResult<1>;
|
21
|
+
_hoverTimeout: number;
|
22
|
+
_leaveTimeout: number;
|
23
|
+
connectedCallback(): void;
|
48
24
|
}
|
49
25
|
export default Tooltip;
|
50
26
|
export { Tooltip };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/tooltip/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/tooltip/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,KAAK,CAAC;AAGhD,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAI9C;;;;;;;;;;;GAWG;AACH,cACM,OAAQ,SAAQ,OAAO;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAG1B,GAAG,EAAE,MAAM,CAAC;IAGZ,KAAK,SAAO;IAEZ,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAmBrC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IAEtB,iBAAiB,IAAI,IAAI;CAe1B;AAED,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{godown as
|
1
|
+
import{__decorate as t}from"tslib";import{godown as e,htmlSlot as o}from"@godown/element";import{html as i}from"lit";import{property as r}from"lit/decorators.js";import{Popover as s}from"../popover/component.js";let p=class Tooltip extends s{constructor(){super(...arguments),this.delay=300}render(){return i`<div part="root"> <div part="trigger" @click=${this.hide}> ${o()} </div> <div part="popover" popover="manual"> ${o("tip",this.tip)} </div> </div>`}connectedCallback(){super.connectedCallback(),this.events.add(this,"mouseenter",(()=>{clearTimeout(this._leaveTimeout),this._hoverTimeout=setTimeout((()=>{this.show()}),this.delay)})),this.events.add(this,"mouseleave",(()=>{clearTimeout(this._hoverTimeout),this._leaveTimeout=setTimeout((()=>{this.hide()}),this.delay)}))}};t([r()],p.prototype,"tip",void 0),t([r({type:Number})],p.prototype,"delay",void 0),p=t([e("tooltip")],p);var a=p;export{p as Tooltip,a as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/tooltip/component.ts"],"sourcesContent":null,"names":["
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/tooltip/component.ts"],"sourcesContent":null,"names":["Tooltip","Popover","constructor","this","delay","render","html","hide","htmlSlot","tip","events","add","_hoverTimeout","setTimeout","_leaveTimeout","prototype","__decorate","Number","Tooltip$1"],"mappings":"oNAqBA,IAAMA,EAAN,MAAMA,gBAAgBC,EAAtB,WAAAC,uBAQEC,KAAKC,MAAG,IAEE,MAAAC,GACR,OAAOC,CAAI,gDAAAH,KAAAI,SAAAC,oDAAAA,EAAA,MAAAL,KAAAM,mEAIIN,KAAAO,OAAAC,IAAKR,KAAI,cAAA,sCAEhBA,KAAAS,cAAUC,YAAA,2GAMVV,KAAAW,cAAqBD,YAAI,sCAU5B,MAEHb,EAAAe,UAAA,WAAiB,GACjBC,EAAA,SACOC,UACPjB,EAAAe,UAAQ,aAAM,GAChBf,EAAEgB,EAAA,GAtDY,YAwDZhB,GACA,IAAAkB,EAAAlB"}
|