godown 3.10.1 → 3.11.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/README.md +2 -63
- package/alert.d.ts.map +1 -1
- package/avatar.d.ts.map +1 -1
- package/badge.d.ts.map +1 -1
- package/breath.d.ts.map +1 -1
- package/build/godown+lit.iife.js +14 -14
- package/build/godown+lit.iife.js.map +1 -1
- package/build/godown+lit.js +14 -14
- package/build/godown+lit.js.map +1 -1
- package/build/godown+lit.umd.js +14 -14
- package/build/godown+lit.umd.js.map +1 -1
- package/build/godown.iife.js +9 -9
- package/build/godown.js +7 -7
- package/build/godown.js.map +1 -1
- package/build/godown.umd.js +10 -10
- package/build/godown.umd.js.map +1 -1
- package/button.d.ts.map +1 -1
- package/card.d.ts.map +1 -1
- package/carousel.d.ts.map +1 -1
- package/chip.d.ts +2 -0
- package/chip.d.ts.map +1 -0
- package/chip.js +2 -0
- package/chip.js.map +1 -0
- package/custom-elements.json +1 -1
- package/details.d.ts.map +1 -1
- package/dialog.d.ts.map +1 -1
- package/divider.d.ts.map +1 -1
- package/dragbox.d.ts.map +1 -1
- package/flex.d.ts.map +1 -1
- package/form.d.ts.map +1 -1
- package/grid.d.ts.map +1 -1
- package/heading.d.ts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/input.d.ts.map +1 -1
- package/internal/direction.d.ts.map +1 -1
- package/internal/direction.js.map +1 -1
- package/internal/global-style.d.ts +8 -9
- 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/icons/caret-down.d.ts +4 -0
- package/internal/icons/caret-down.d.ts.map +1 -0
- package/internal/icons/caret-down.js +2 -0
- package/internal/icons/caret-down.js.map +1 -0
- package/internal/icons/caret-left.d.ts +4 -0
- package/internal/icons/caret-left.d.ts.map +1 -0
- package/internal/icons/caret-left.js +2 -0
- package/internal/icons/caret-left.js.map +1 -0
- package/internal/icons/caret-right.d.ts +4 -0
- package/internal/icons/caret-right.d.ts.map +1 -0
- package/internal/icons/caret-right.js +2 -0
- package/internal/icons/caret-right.js.map +1 -0
- package/internal/icons/eye-slash.d.ts +4 -0
- package/internal/icons/eye-slash.d.ts.map +1 -0
- package/internal/icons/eye-slash.js +2 -0
- package/internal/icons/eye-slash.js.map +1 -0
- package/internal/ring.d.ts +19 -0
- package/internal/ring.d.ts.map +1 -0
- package/internal/ring.js +2 -0
- package/internal/ring.js.map +1 -0
- package/internal/super-input.d.ts +2 -2
- 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/super-openable.d.ts.map +1 -1
- package/internal/super-openable.js.map +1 -1
- package/layout.d.ts.map +1 -1
- package/link.d.ts.map +1 -1
- package/package.json +3 -5
- package/progress.d.ts.map +1 -1
- package/range.d.ts.map +1 -1
- package/rotate.d.ts.map +1 -1
- package/router.d.ts.map +1 -1
- package/select.d.ts.map +1 -1
- package/skeleton.d.ts.map +1 -1
- package/split.d.ts.map +1 -1
- package/src/chip.ts +1 -0
- package/src/index.ts +1 -0
- package/src/internal/global-style.ts +40 -37
- package/src/internal/icons/caret-down.ts +7 -0
- package/src/internal/icons/caret-left.ts +7 -0
- package/src/internal/icons/caret-right.ts +7 -0
- package/src/internal/icons/eye-slash.ts +7 -0
- package/src/internal/ring.ts +57 -0
- package/src/internal/super-input.ts +9 -70
- package/src/web-components/alert/component.ts +16 -195
- package/src/web-components/badge/component.ts +7 -96
- package/src/web-components/breath/component.ts +8 -8
- package/src/web-components/button/component.ts +9 -139
- package/src/web-components/card/component.ts +11 -6
- package/src/web-components/carousel/component.ts +6 -6
- package/src/web-components/chip/component.ts +115 -0
- package/src/web-components/chip/definition.ts +11 -0
- package/src/web-components/details/component.ts +1 -1
- package/src/web-components/divider/component.ts +2 -17
- package/src/web-components/heading/component.ts +12 -16
- package/src/web-components/input/component.ts +87 -39
- package/src/web-components/link/component.ts +53 -3
- package/src/web-components/progress/component.ts +2 -1
- package/src/web-components/range/component.ts +19 -25
- package/src/web-components/rotate/component.ts +2 -2
- package/src/web-components/select/component.ts +14 -18
- package/src/web-components/select/definition.ts +1 -1
- package/src/web-components/skeleton/component.ts +13 -57
- package/src/web-components/split/component.ts +16 -14
- package/src/web-components/switch/component.ts +4 -7
- package/src/web-components/tabs/component.ts +11 -8
- package/src/web-components/text/component.ts +2 -2
- package/switch.d.ts.map +1 -1
- package/tabs.d.ts.map +1 -1
- package/text.d.ts.map +1 -1
- package/time.d.ts.map +1 -1
- package/tooltip.d.ts.map +1 -1
- package/typewriter.d.ts.map +1 -1
- package/vscode.html-custom-data.json +1 -1
- package/web-components/alert/component.d.ts +5 -32
- 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/alert/definition.d.ts.map +1 -1
- package/web-components/alert/definition.js.map +1 -1
- package/web-components/avatar/component.d.ts.map +1 -1
- package/web-components/avatar/component.js.map +1 -1
- package/web-components/avatar/definition.d.ts.map +1 -1
- package/web-components/avatar/definition.js.map +1 -1
- package/web-components/badge/component.d.ts +4 -21
- package/web-components/badge/component.d.ts.map +1 -1
- package/web-components/badge/component.js +1 -1
- package/web-components/badge/component.js.map +1 -1
- package/web-components/badge/definition.d.ts.map +1 -1
- package/web-components/badge/definition.js.map +1 -1
- package/web-components/breath/component.d.ts.map +1 -1
- package/web-components/breath/component.js +1 -1
- package/web-components/breath/component.js.map +1 -1
- package/web-components/breath/definition.d.ts.map +1 -1
- package/web-components/breath/definition.js.map +1 -1
- package/web-components/button/component.d.ts +0 -18
- 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/button/definition.d.ts.map +1 -1
- package/web-components/button/definition.js.map +1 -1
- package/web-components/card/component.d.ts +3 -0
- 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/card/definition.d.ts.map +1 -1
- package/web-components/card/definition.js.map +1 -1
- package/web-components/carousel/component.d.ts.map +1 -1
- package/web-components/carousel/component.js +1 -1
- package/web-components/carousel/component.js.map +1 -1
- package/web-components/carousel/definition.d.ts.map +1 -1
- package/web-components/carousel/definition.js.map +1 -1
- package/web-components/chip/component.d.ts +31 -0
- package/web-components/chip/component.d.ts.map +1 -0
- package/web-components/chip/component.js +2 -0
- package/web-components/chip/component.js.map +1 -0
- package/web-components/chip/definition.d.ts +8 -0
- package/web-components/chip/definition.d.ts.map +1 -0
- package/web-components/chip/definition.js +2 -0
- package/web-components/chip/definition.js.map +1 -0
- 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/details/definition.d.ts.map +1 -1
- package/web-components/details/definition.js.map +1 -1
- package/web-components/dialog/component.d.ts.map +1 -1
- package/web-components/dialog/component.js.map +1 -1
- package/web-components/dialog/definition.d.ts.map +1 -1
- package/web-components/dialog/definition.js.map +1 -1
- package/web-components/divider/component.d.ts.map +1 -1
- package/web-components/divider/component.js +1 -1
- package/web-components/divider/component.js.map +1 -1
- package/web-components/divider/definition.d.ts.map +1 -1
- package/web-components/divider/definition.js.map +1 -1
- package/web-components/dragbox/component.d.ts.map +1 -1
- package/web-components/dragbox/component.js.map +1 -1
- package/web-components/dragbox/definition.d.ts.map +1 -1
- package/web-components/dragbox/definition.js.map +1 -1
- package/web-components/flex/component.d.ts.map +1 -1
- package/web-components/flex/component.js.map +1 -1
- package/web-components/flex/definition.d.ts.map +1 -1
- package/web-components/flex/definition.js.map +1 -1
- package/web-components/form/component.d.ts.map +1 -1
- package/web-components/form/component.js.map +1 -1
- package/web-components/form/definition.d.ts.map +1 -1
- package/web-components/form/definition.js.map +1 -1
- package/web-components/grid/component.d.ts.map +1 -1
- package/web-components/grid/component.js.map +1 -1
- package/web-components/grid/definition.d.ts.map +1 -1
- package/web-components/grid/definition.js.map +1 -1
- package/web-components/heading/component.d.ts +2 -2
- 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/heading/definition.d.ts.map +1 -1
- package/web-components/heading/definition.js.map +1 -1
- package/web-components/input/component.d.ts +3 -3
- 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/input/definition.d.ts.map +1 -1
- package/web-components/input/definition.js.map +1 -1
- package/web-components/layout/component.d.ts.map +1 -1
- package/web-components/layout/component.js.map +1 -1
- package/web-components/layout/definition.d.ts.map +1 -1
- package/web-components/layout/definition.js.map +1 -1
- package/web-components/link/component.d.ts +13 -2
- 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/link/definition.d.ts.map +1 -1
- package/web-components/link/definition.js.map +1 -1
- package/web-components/progress/component.d.ts.map +1 -1
- package/web-components/progress/component.js +1 -1
- package/web-components/progress/component.js.map +1 -1
- package/web-components/progress/definition.d.ts.map +1 -1
- package/web-components/progress/definition.js.map +1 -1
- 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/range/definition.d.ts.map +1 -1
- package/web-components/range/definition.js.map +1 -1
- package/web-components/rotate/component.d.ts.map +1 -1
- package/web-components/rotate/component.js +1 -1
- package/web-components/rotate/component.js.map +1 -1
- package/web-components/rotate/definition.d.ts.map +1 -1
- package/web-components/rotate/definition.js.map +1 -1
- package/web-components/router/component.d.ts.map +1 -1
- package/web-components/router/component.js.map +1 -1
- package/web-components/router/definition.d.ts.map +1 -1
- package/web-components/router/definition.js.map +1 -1
- package/web-components/select/component.d.ts +2 -1
- 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/select/definition.d.ts +1 -1
- package/web-components/select/definition.d.ts.map +1 -1
- package/web-components/select/definition.js.map +1 -1
- package/web-components/skeleton/component.d.ts +0 -9
- package/web-components/skeleton/component.d.ts.map +1 -1
- package/web-components/skeleton/component.js +1 -1
- package/web-components/skeleton/component.js.map +1 -1
- package/web-components/skeleton/definition.d.ts.map +1 -1
- package/web-components/skeleton/definition.js.map +1 -1
- package/web-components/split/component.d.ts +1 -1
- package/web-components/split/component.d.ts.map +1 -1
- package/web-components/split/component.js +1 -1
- package/web-components/split/component.js.map +1 -1
- package/web-components/split/definition.d.ts.map +1 -1
- package/web-components/split/definition.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/switch/definition.d.ts.map +1 -1
- package/web-components/switch/definition.js.map +1 -1
- package/web-components/tabs/component.d.ts +3 -3
- 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/tabs/definition.d.ts.map +1 -1
- package/web-components/tabs/definition.js.map +1 -1
- package/web-components/text/component.d.ts +1 -1
- package/web-components/text/component.d.ts.map +1 -1
- package/web-components/text/component.js +1 -1
- package/web-components/text/component.js.map +1 -1
- package/web-components/text/definition.d.ts.map +1 -1
- package/web-components/text/definition.js.map +1 -1
- package/web-components/time/component.d.ts.map +1 -1
- package/web-components/time/component.js.map +1 -1
- package/web-components/time/definition.d.ts.map +1 -1
- package/web-components/time/definition.js.map +1 -1
- package/web-components/tooltip/component.d.ts.map +1 -1
- package/web-components/tooltip/component.js.map +1 -1
- package/web-components/tooltip/definition.d.ts.map +1 -1
- package/web-components/tooltip/definition.js.map +1 -1
- package/web-components/typewriter/component.d.ts.map +1 -1
- package/web-components/typewriter/component.js.map +1 -1
- package/web-components/typewriter/definition.d.ts.map +1 -1
- package/web-components/typewriter/definition.js.map +1 -1
- package/web-types.json +1 -1
- package/internal/outline.d.ts +0 -19
- package/internal/outline.d.ts.map +0 -1
- package/internal/outline.js +0 -2
- package/internal/outline.js.map +0 -1
- package/internal/super-anchor.d.ts +0 -18
- package/internal/super-anchor.d.ts.map +0 -1
- package/internal/super-anchor.js +0 -2
- package/internal/super-anchor.js.map +0 -1
- package/src/internal/outline.ts +0 -58
- package/src/internal/super-anchor.ts +0 -60
@@ -1,5 +1,5 @@
|
|
1
1
|
import { type TemplateResult } from "lit";
|
2
|
-
import
|
2
|
+
import Link from "../link/component.js";
|
3
3
|
/**
|
4
4
|
* {@linkcode Heading} renders a heading.
|
5
5
|
*
|
@@ -8,7 +8,7 @@ import { GlobalStyle } from "../../internal/global-style.js";
|
|
8
8
|
* @slot - Heading content.
|
9
9
|
* @category layout
|
10
10
|
*/
|
11
|
-
declare class Heading extends
|
11
|
+
declare class Heading extends Link {
|
12
12
|
/**
|
13
13
|
* The heading level.
|
14
14
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/heading/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,KAAK,CAAC;AAG9D,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAIxC;;;;;;;GAOG;AACH,cAiCM,OAAQ,SAAQ,IAAI;IACxB;;OAEG;IAEH,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAEnD;;;;OAIG;IAEH,MAAM,SAAO;IAEb;;OAEG;IAEH,IAAI,EAAE,MAAM,GAAG,OAAO,CAAU;IAEhC,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAmBrC,SAAS,CAAC,WAAW,CAAC,GAAG,QAAQ,EAAE,GAAG,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC;CA4B7D;AAED,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{godown as r,styles as e,
|
1
|
+
import{__decorate as t}from"tslib";import{godown as r,styles as e,htmlSlot as i,tokenList as h}from"@godown/element";import{css as o,nothing as a,html as s}from"lit";import{property as n}from"lit/decorators.js";import p from"../link/component.js";let c=class Heading extends p{constructor(){super(...arguments),this.as="h1",this.anchor="#",this.side="left"}render(){const t=this.href||(this.id?"#"+this.id:void 0);return s`<a part="root" href="${t||a}"> ${this.wrapHeading(i(),t?s`<i part="${h("anchor",this.side)}">${this.anchor}</i>`:"")} </a>`}wrapHeading(...t){switch(this.as){case"h2":return s`<h2>${t}</h2>`;case"h3":return s`<h3>${t}</h3>`;case"h4":return s`<h4>${t}</h4>`;case"h5":return s`<h5>${t}</h5>`;case"h6":return s`<h6>${t}</h6>`;default:return s`<h1>${t}</h1>`}}};t([n()],c.prototype,"as",void 0),t([n()],c.prototype,"anchor",void 0),t([n()],c.prototype,"side",void 0),c=t([r("heading"),e(o`:host{display:block;text-align:start}[part~=anchor]{min-width:1.25em;position:absolute;right:100%;text-align:center}[part~=left][part~=anchor]{right:100%}[part~=right][part~=anchor]{left:100%}h1,h2,h3,h4,h5,h6{font-size:revert;position:relative;width:-moz-fit-content;width:fit-content}`)],c);var d=c;export{c as Heading,d as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/heading/component.ts"],"sourcesContent":null,"names":["Heading","Link","constructor","this","as","anchor","side","render","hrefValue","href","id","undefined","html","nothing","wrapHeading","htmlSlot","children","prototype","__decorate","property","godown","styles","css"],"mappings":"uPAiDA,IAAMA,EAAN,MAAMA,gBAAgBC,EAAtB,WAAAC,uBAKEC,KAAEC,GAA4C,KAQ9CD,KAAME,OAAG,IAMTF,KAAIG,KAAqB,OAEf,MAAAC,GACR,MAAMC,EAAYL,KAAKM,OAASN,KAAKO,GAAK,IAAMP,KAAKO,QAAKC,GAC1D,OAAOC,CAAI,wBAAAJ,GAAAK,OAAAV,KAAAW,YAAAC,IAAAP,qEAGC,mBAEN,OAAgBL,KAAAC,IAGd,iBACwB,OAAAY,SACrB,IAAA,KACC,OACPJ,CAAA,OAAAI,kBAEJ,OAAAJ,CAAA,OAAAI,SACH,IAAA,KAEsB,OAAkBJ,CAAA,OAAAI,SACtC,IAAY,KACV,OAASJ,CAAA,OAAAI,SACP,QACQ,OAAQJ,CAAA,OAAAI,SAElB,WAIAhB,EAAAiB,UAAS,UAAA,GACPC,EAAA,QAECD,UAAA,cAAA,GACHC,EAAA,CACEC,iBACgB,YAAA,KACfD,EAAA,CACHE,EArGY,WAsGVC,EAAAC,CAAA,4SAECtB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"__source__/","sources":["web-components/heading/definition.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAIrC,eAAe,OAAO,CAAC;AAEvB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,OAAO,CAAC;KAC3B;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/heading/definition.ts"],"sourcesContent":null,"names":["Heading","define"],"mappings":"8BAEAA,EAAQC"}
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import { type TemplateResult } from "lit";
|
2
2
|
import { SuperInput } from "../../internal/super-input.js";
|
3
3
|
/**
|
4
|
-
* {@linkcode Input} renders a
|
4
|
+
* {@linkcode Input} renders a input.
|
5
5
|
*
|
6
6
|
* @fires input - Fires when the input value changes.
|
7
7
|
* @fires change - Fires when the input value changes.
|
8
8
|
* @category input
|
9
9
|
*/
|
10
10
|
declare class Input extends SuperInput {
|
11
|
-
type: "text" | "search" | "tel" | "url" | "email" | "password";
|
11
|
+
type: "text" | "search" | "tel" | "url" | "email" | "password" | "number" | "date" | "time" | "datetime-local" | "month" | "week";
|
12
12
|
value: string;
|
13
13
|
/**
|
14
14
|
* If outline, the outline is always present.
|
15
15
|
*/
|
16
16
|
variant: "default" | "outline";
|
17
17
|
protected _input: HTMLInputElement;
|
18
|
-
|
18
|
+
constructor();
|
19
19
|
protected render(): TemplateResult<1>;
|
20
20
|
protected _renderSuffix(): TemplateResult<1>;
|
21
21
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/input/component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,KAAK,CAAC;AAI9D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAK3D;;;;;;GAMG;AACH,cAqDM,KAAM,SAAQ,UAAU;IAC5B,IAAI,EACA,MAAM,GACN,QAAQ,GACR,KAAK,GACL,KAAK,GACL,OAAO,GACP,UAAU,GACV,QAAQ,GACR,MAAM,GACN,MAAM,GACN,gBAAgB,GAChB,OAAO,GACP,MAAM,CAAU;IAEpB,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IAEH,OAAO,EAAE,SAAS,GAAG,SAAS,CAAa;IAG3C,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAC;;IAYnC,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IA4BrC,SAAS,CAAC,aAAa,IAAI,cAAc,CAAC,CAAC,CAAC;CAgB7C;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{
|
1
|
+
import{__decorate as t}from"tslib";import{queryPart as e,godown as i,styles as r,StyleController as o,attr as n}from"@godown/element";import a from"../../internal/icons/eye-slash.js";import{css as p,nothing as s,html as l}from"lit";import{property as u}from"lit/decorators.js";import{cssGlobalVars as c}from"../../internal/global-style.js";import{SuperInput as h}from"../../internal/super-input.js";import{RingBuilder as d}from"../../internal/ring.js";let f=class Input extends h{constructor(){super(),this.type="text",this.variant="default",new o(this,(()=>new d({type:this.ringType}).css+("outline"===this.variant?`:host{${c.ringColor}:currentColor}`:"")))}render(){return l`<label part="root" ${n(this.observedRecord)}> ${[this._renderPrefix(),l`<input part="input" type="${this.type}" .value="${this.value}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||s}" autocomplete="${this.autocomplete||s}" placeholder="${this.placeholder||s}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,this._renderSuffix()]} </label>`}_renderSuffix(){const t="password";return this.type===t?l`<i part="suffix icon" @mousedown="${()=>this._changeInputType("text")}" @mouseup="${()=>this._changeInputType(t)}" @mouseleave="${()=>this._changeInputType(t)}"> ${a()} </i>`:super._renderSuffix()}};t([u()],f.prototype,"variant",void 0),t([e("input")],f.prototype,"_input",void 0),f=t([i("input"),r(p`:host{display:block;${c.input}-space:0.2em;${c.input}-control:currentColor;${c.input}-icon-color:grey}:host(:active),:host(:focus-within){${c.ringColor}:var(${c.active});${c.input}-icon-color:currentColor}[part~=root]{align-items:center;border-radius:inherit;display:flex;height:inherit;padding:.4em .5em;position:relative}[part=input]{background:none;color:currentColor;flex-grow:1;height:100%;min-height:1.5em}[part~=icon]{align-items:center;color:var(${c.input}-icon-color);display:flex;justify-content:center}[part~=prefix],[part~=suffix]{display:flex;height:100%}[part~=suffix][part~=icon]{padding-inline-start:var(${c.input}-space)}[part~=prefix][part~=icon]{padding-inline-end:var(${c.input}-space)}`)],f);var m=f;export{f as Input,m as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/input/component.ts"],"sourcesContent":null,"names":["Input","SuperInput","constructor","super","this","type","variant","StyleController","RingBuilder","ringType","css","cssGlobalVars","ringColor","render","html","attr","observedRecord","_renderSuffix","PASSWORD","__decorate","queryPart","styles","input","active"],"mappings":"ocAuEA,IAAMA,EAAN,MAAMA,cAAcC,EA0BlB,WAAAC,GACEC,QA1BFC,KAAIC,KAYS,OAQbD,KAAOE,QAA0B,UAO/B,IAAIC,EACFH,MACA,IACE,IAAII,EAAY,CAAEH,KAAMD,KAAKK,WAAYC,KACvB,YAAjBN,KAAKE,QAAwB,SAASK,EAAcC,0BAA4B,MAI7E,MAAAC,GACR,OAAOC,CAAI,sBAAAC,EAAAX,KAAAY,oBAAA,2UAGLZ,KAAKa,2BAEL,iBAEA,MAAAC,EAAI,iNAIUf,MAAAc,eACI,sCAIK,GACTE,EAAA,CACCC,EAAA,uCAEdpB,EAAAmB,EAAA,GAvHO,SAyHTE,EAAAX,CAAA,uBAAAC,EAAAW,qBAAAX,EAAAW,8BAAAX,EAAAW,6DAAAX,EAAAC,iBAAAD,EAAAY,WAAAZ,EAAAW,0RAAAX,EAAAW,oKAAAX,EAAAW,kEAAAX,EAAAW,2BAEJtB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"__source__/","sources":["web-components/input/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,gBAAgB,CAAC;AAInC,eAAe,KAAK,CAAC;AAErB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,KAAK,CAAC;KACvB;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/input/definition.ts"],"sourcesContent":null,"names":["Input","define"],"mappings":"8BAEAA,EAAMC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/layout/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAI7D;;;;;;;;;;;;;GAaG;AACH,cAkCM,MAAO,SAAQ,WAAW;IAC9B;;OAEG;IAEH,MAAM,UAAS;IAEf,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CAYtC;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/layout/component.ts"],"sourcesContent":null,"names":["Layout","GlobalStyle","constructor","this","sticky","render","html","attr","observedRecord","htmlSlot","__decorate"],"mappings":"8PAwDA,IAAMA,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAKEC,KAAMC,QAAG,EAEC,MAAAC,GACR,OAAOC,CAAI,oBAAAC,EAAAJ,KAAAK,0CAAAC,EAAA,wCAAAA,oCAAAA,EAAA,8BAGLC,EAAA,iDAGkBV,EAAAU,EAAA,GAhEV,0TAoEhBV"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"__source__/","sources":["web-components/layout/definition.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAIpC,eAAe,MAAM,CAAC;AAEtB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,MAAM,CAAC;KACzB;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/layout/definition.ts"],"sourcesContent":null,"names":["Layout","define"],"mappings":"8BAEAA,EAAOC"}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import { type TemplateResult } from "lit";
|
2
|
+
import GlobalStyle from "../../internal/global-style.js";
|
2
3
|
declare const linkTypes: {
|
3
4
|
readonly push: "push";
|
4
5
|
readonly replace: "replace";
|
@@ -25,7 +26,7 @@ type LinkType = keyof typeof linkTypes;
|
|
25
26
|
* @fires navigate - Fires when the link is clicked.
|
26
27
|
* @category navigation
|
27
28
|
*/
|
28
|
-
declare class Link extends
|
29
|
+
declare class Link extends GlobalStyle {
|
29
30
|
/**
|
30
31
|
* If `"normal"`, behave like a normal anchor.
|
31
32
|
*
|
@@ -42,12 +43,22 @@ declare class Link extends SuperAnchor {
|
|
42
43
|
* Use `replaceState` instead of `pushState`.
|
43
44
|
*/
|
44
45
|
replace: boolean;
|
46
|
+
/**
|
47
|
+
* A element href.
|
48
|
+
*/
|
49
|
+
href: string;
|
50
|
+
/**
|
51
|
+
* A element target.
|
52
|
+
*/
|
53
|
+
target: "_blank" | "_self" | "_parent" | "_top";
|
45
54
|
/**
|
46
55
|
* Location state object.
|
47
56
|
*/
|
48
57
|
state: {};
|
58
|
+
get pathname(): string;
|
49
59
|
protected _handleClick(e: MouseEvent): void;
|
50
60
|
handleState: () => void;
|
61
|
+
protected render(): TemplateResult<1>;
|
51
62
|
}
|
52
63
|
export default Link;
|
53
64
|
export { Link };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/link/component.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAC9D,OAAO,WAAW,MAAM,gCAAgC,CAAC;AAIzD,QAAA,MAAM,SAAS;;;;;CAKL,CAAC;AAEX,KAAK,QAAQ,GAAG,MAAM,OAAO,SAAS,CAAC;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AACH,cAiBM,IAAK,SAAQ,WAAW;IAC5B;;;;;;OAMG;IAEH,IAAI,EAAE,QAAQ,CAAkB;IAEhC;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,OAAO,UAAS;IAEhB;;OAEG;IAEH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IAEH,MAAM,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAW;IAE1D;;OAEG;IACH,KAAK,KAAM;IAEX,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IA6B3C,WAAW,EAAE,MAAM,IAAI,CAcrB;IAEF,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CAatC;AAED,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{godown as e}from"@godown/element";import{property as
|
1
|
+
import{__decorate as t}from"tslib";import{godown as e,styles as r,attr as o,htmlSlot as s}from"@godown/element";import{property as a}from"lit/decorators.js";import i from"../router/component.js";import{css as h,nothing as p,html as n}from"lit";import{GlobalStyle as l}from"../../internal/global-style.js";const c="push",d="replace",f="normal",u="auto";let m=class Link extends l{constructor(){super(...arguments),this.type=u,this.suppress=!1,this.replace=!1,this.target="_self",this.state={},this.handleState=()=>{switch(this.type){case u:case c:if(!this.replace){history.pushState(this.state,"",this.href);break}case d:history.replaceState(this.state,"",this.href)}}}get pathname(){return new URL(this.href,location.href).pathname}_handleClick(t){const{state:e,type:r,href:o,pathname:s,suppress:a}=this;if(!o)return;if(this.dispatchCustomEvent("navigate",{...this.observedRecord,pathname:s,state:e}),o.startsWith("#")||r===f)return;this.handleState();const h=[...i.routerInstances];a||r===u&&!h.some((t=>t.search(location.pathname)))||(t.preventDefault(),i.routerInstances.forEach((t=>{t.handlePopstate()})))}render(){return n`<a part="root" ${o(this.observedRecord)} href="${this.href||p}" target="${this.target}" @click=${this._handleClick}> ${s()} </a>`}};t([a()],m.prototype,"type",void 0),t([a({type:Boolean})],m.prototype,"suppress",void 0),t([a({type:Boolean})],m.prototype,"replace",void 0),t([a()],m.prototype,"href",void 0),t([a()],m.prototype,"target",void 0),m=t([e("link"),r(h`:host{color:currentColor;cursor:default;display:inline-block}:host([href]){cursor:pointer}a{color:currentColor;display:contents}`)],m);var y=m;export{m as Link,y as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/link/component.ts"],"sourcesContent":null,"names":["linkTypes","Link","GlobalStyle","constructor","this","type","suppress","replace","target","state","handleState","history","pushState","href","replaceState","pathname","URL","location","_handleClick","e","dispatchCustomEvent","observedRecord","startsWith","routers","Router","routerInstances","some","i","search","preventDefault","forEach","handlePopstate","render","html","attr","nothing","htmlSlot","__decorate","prototype","Boolean","property","godown","styles","css","Link$1"],"mappings":"iTAOA,MAEMA,EACE,OADFA,EAEK,UAFLA,EAGI,SAHJA,EAIE,OAyCR,IAAMC,EAAN,MAAMA,aAAaC,EAAnB,WAAAC,uBASEC,KAAAC,KAAiBL,EAMjBI,KAAQE,UAAG,EAMXF,KAAOG,SAAG,EAYVH,KAAMI,OAA4C,QAKlDJ,KAAKK,MAAG,CAAE,EAmCVL,KAAWM,YAAe,KACxB,OAAQN,KAAKC,MACX,KAAKL,EACL,KAAKA,EACH,IAAKI,KAAKG,QAAS,CAEjBI,QAAQC,UAAUR,KAAKK,MAAO,GAAIL,KAAKS,MACvC,MAGJ,KAAKb,EACHW,QAAQG,aAAaV,KAAKK,MAAO,GAAIL,KAAKS,QA5ChD,YAAIE,GACF,OAAO,IAAIC,IAAIZ,KAAKS,KAAMI,SAASJ,MAAME,SAGjC,YAAAG,CAAaC,GACrB,MAAMV,MAAEA,EAAKJ,KAAEA,EAAIQ,KAAEA,EAAIE,SAAEA,EAAQT,SAAEA,GAAaF,KAClD,IAAKS,EACH,OAOF,GALAT,KAAKgB,oBAAoB,WAAY,IAChChB,KAAKiB,eACRN,WACAN,UAEEI,EAAKS,WAAW,MAAQjB,IAASL,EACnC,OAEFI,KAAKM,cACL,MAAMa,EAAU,IAAIC,EAAOC,iBAGxBnB,GACAD,IAASL,IAERuB,EAAQG,MAAMC,GAAMA,EAAEC,OAAOX,SAASF,cAExCI,EAAEU,iBACFL,EAAOC,gBAAgBK,SAASH,IAC9BA,EAAEI,gBAAgB,KAqBd,MAAAC,GACR,OAAOC,CAAI,kBAAAC,EAAA9B,KAAAiB,yBAAAjB,KAAAS,MAAAsB,cAAA/B,KAAAI,kBAAAJ,KAAAc,iBAAAkB,aAGLC,EAAA,MAEQpC,EAAAqC,UAAA,YAAW,GACZD,EAAA,oBAEPpC,EAAAqC,UAAU,gBAAA,QAEf,CAAAjC,KAAAkC,aACHD,UAAA,eAAA,KACD,CA7FCE,KADCvC,EAAAqC,UAAU,YAAA,GACqBD,EAAA,CAMhCG,KADCvC,EAAAqC,UAAe,iBACCrC,EAAAoC,EAAA,CAMjBI,EApEgB,QAmEfC,EAAAC,CAAW,qIACI1C,GAMhB,IAAA2C,EAAA3C"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"__source__/","sources":["web-components/link/definition.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAIlC,eAAe,IAAI,CAAC;AAEpB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,IAAI,CAAC;KACrB;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/link/definition.ts"],"sourcesContent":null,"names":["Link","define"],"mappings":"8BAEAA,EAAKC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/progress/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAiB,MAAM,gCAAgC,CAAC;AAI5E;;;;GAIG;AACH,cA+CM,QAAS,SAAQ,WAAW;IAEhC,GAAG,SAAK;IAGR,GAAG,SAAK;IAGR,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CAsBtC;AAED,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{godown as r,styles as e,isNullable 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"../../internal/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=
|
1
|
+
import{__decorate as t}from"tslib";import{godown as r,styles as e,isNullable 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"../../internal/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=(+this.value-this.min)/e.diff*100,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;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 u=m;export{m as Progress,u as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/progress/component.ts"],"sourcesContent":null,"names":["Progress","GlobalStyle","constructor","this","max","min","render","className","width","isNullable","value","ranger","Ranger","diff","html","attr","observedRecord","__decorate","Number","prototype","godown","styles","css","cssGlobalVars","passive","active","Progress$1"],"mappings":"+RA4DA,IAAMA,EAAN,MAAMA,iBAAiBC,EAAvB,WAAAC,uBAEEC,KAAGC,IAAG,EAGND,KAAGE,IAAG,EAKI,MAAAC,GACR,IACIC,EADAC,EAAQ,GAEZ,IAAKC,EAAWN,KAAKO,OAAQ,CAC3B,MAAMC,EAAS,IAAIC,EAAOT,KAAKE,IAAKF,KAAKC,KAEzCI,IADeL,KAAKO,MAAQP,KAAKE,KAChBM,EAAOE,KAAQ,IAChCN,EAAY,SAEd,OAAOO,CAAI,oBAAAC,EAAAZ,KAAAa,0BAAAT,oCAAAC,qBAGLS,EAAA,SACgBC,gFAII,0BAGzBC,UAAA,aAAA,KACHF,EAAA,CACDG,EAtFiB,YAwDhBC,EAAAC,CAAA,wBAAAC,EAAAC,0CAAAD,EAAAE,2ZADCzB,GACO,IAAA0B,EAAA1B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"__source__/","sources":["web-components/progress/definition.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAItC,eAAe,QAAQ,CAAC;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,QAAQ,CAAC;KAC7B;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/progress/definition.ts"],"sourcesContent":null,"names":["Progress","define"],"mappings":"8BAEAA,EAASC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/range/component.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,MAAM,EAEP,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAIrD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAK3D,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAEpC;;;;;;;;;GASG;AACH,cA0FM,KAAK,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,CAAE,SAAQ,UAAU,CAAC,UAAU,CAAC;IAC3E;;OAEG;IAEH,GAAG,SAAK;IAER;;OAEG;IAEH,GAAG,SAAO;IAEV;;OAEG;IAEH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;;;OAIG;IAEH,KAAK,EAAE,CAAC,CAAC;IAET;;OAEG;IAEH,OAAO,EAAE,CAAC,CAAC;IAGX,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC;IAG7B,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAG5C,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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;IAchC,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,CAAC;IAIT,QAAQ,IAAI,CAAC;CAMd;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{
|
1
|
+
import{__decorate as t}from"tslib";import{queryPart as e,godown as r,styles as a,Ranger as o,omit as s,attr as i,joinDeclarations as n,loop as h,tokenList as l,isNullable 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 g,cssGlobalVars as f}from"../../internal/global-style.js";import{SuperInput as w}from"../../internal/super-input.js";const y="range",_=g(y);let k=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 o(this.min,this.max,this.step))}get observedRecord(){return s(super.observedRecord,"ring-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,o=!r||r&&t===a.length-1&&1===a.length;return c`<i tabindex="0" part="${l("handle",`handle-${t}`)}" @mousedown="${e?null:this.createMouseDown(t)}" style="${n({"z-index":this.__focusStack.indexOf(t)+1,"--handle":`var(--${o?"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)))}blurHandle(){this.lastFocus=void 0,this.__keydownEvent=this.events.remove(document,"keydown",this.__keydownEvent)}createKeydownEvent(t){return e=>{const{rangeValue:r,step:a}=this;r.length<2&&(t=0);const o=r[t];"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),this.createSetValue(t)(o-a)):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),this.createSetValue(t)(o+a))}}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.dispatchCustomEvent("change",this.value)}}_computeValue({clientX:t,clientY:e}){const{top:r,left:a,height:o,width:s}=this._root.getBoundingClientRect();return this._ranger.present(this.vertical?(e-r)/o:(t-a)/s)}_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(){this._ranger=new o(this.min,this.max,this.step);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})],k.prototype,"min",void 0),t([v({type:Number})],k.prototype,"max",void 0),t([v({type:Number})],k.prototype,"step",void 0),t([v({type:Boolean,reflect:!0})],k.prototype,"vertical",void 0),t([v({type:Array})],k.prototype,"value",void 0),t([v({type:Array})],k.prototype,"default",void 0),t([e("root")],k.prototype,"_root",void 0),t([p("[part=handle]")],k.prototype,"_handles",void 0),t([m()],k.prototype,"lastFocus",void 0),k=t([r(y),a(u`:host{${_}--track-width:.5em;${_}--handle-scale:1;${_}--track-background:var(${f.active});background:var(${f.passive});display:block;height:var(${_}--track-width);width:100%}:host([contents]) [part=root]{width:inherit}:host([vertical]){height:100%;width:-moz-fit-content;width:fit-content}[part=root]{position:relative;--from:0%;--to:50%}[part=root],[part=track]{border-radius:inherit;min-height:inherit}[part=track]{background:var(${_}--track-background);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=track],[part~=handle]{display:flex;position:absolute}[part~=handle]{align-items:center;background:var(${f.background});border:.1em solid;border-radius:50%;height:1em;justify-content:center;outline:0;transform:scale(var(${_}--handle-scale)) 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)}`)],k);var b=k;export{k as Range,b as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/
|
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":"2bAkBA,MAAMA,EAAY,QACZC,EAAWC,EAAYF,GAwG7B,IAAMG,EAAN,MAAMA,cAAiDC,EAAvD,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,GAA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EAAAlH"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"__source__/","sources":["web-components/range/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,gBAAgB,CAAC;AAInC,eAAe,KAAK,CAAC;AAErB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,KAAK,CAAC;KACvB;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/range/definition.ts"],"sourcesContent":null,"names":["Range","define"],"mappings":"8BAEAA,EAAMC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["
|
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,cA+BM,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,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{
|
1
|
+
import{__decorate as t}from"tslib";import{queryPart as o,godown as e,styles as r,htmlSlot as i}from"@godown/element";import{css as s,html as n}from"lit";import{scopePrefix as a,GlobalStyle as l}from"../../internal/global-style.js";const d="rotate",p=a(d);let m=class Rotate extends l{render(){return n`<div part="root"> <div part="slot" @mousemove="${this._handleRotate}"> ${i()} </div> <i @mouseleave="${this.reset}"></i> </div>`}reset(){this._root.style.removeProperty("transform"),this._root.style.removeProperty("transition")}_handleRotate(t){const{rotateX:o,rotateY:e}=this._computeOffset(t);this._root.style.setProperty("transform",`rotateX(${o}rad) rotateY(${e}rad)`),this._root.style.setProperty("transition","0s")}_computeOffset(t){const{left:o,top:e,width:r,height:i}=this._root.getBoundingClientRect(),{clientX:s,clientY:n}=t;return{rotateX:-(n-e-i/2)/i/2,rotateY:(s-o-r/2)/r/2}}};t([o("root")],m.prototype,"_root",void 0),m=t([e(d),r(s`:host{display:block;transition:all .5s ease-in-out;width:-moz-fit-content;width:fit-content;${p}--padding:.75em;${p}--offset:.5em}div{position:relative;transition:inherit;transition-property:transform}i{box-sizing:content-box;height:100%;margin:calc(var(${p}--offset)*-1);padding:var(${p}--offset);position:absolute;top:0;width:100%}[part=slot]{z-index:2}`)],m);var f=m;export{m as Rotate,f as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/
|
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,GAsC7B,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,oBAAAA,8IAAAA,8BAAAA,yEACpDE,GACA,IAAAsB,EAAOtB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"__source__/","sources":["web-components/rotate/definition.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAIpC,eAAe,MAAM,CAAC;AAEtB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,MAAM,CAAC;KACzB;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/rotate/definition.ts"],"sourcesContent":null,"names":["Rotate","define"],"mappings":"8BAEAA,EAAOC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/router/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkC,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAO,MAAM,KAAK,CAAC;AAGtE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,UAAU,UAAU;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,IAAI,EAA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I,WAAW;IASxB,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAWlE;;OAEG;IACH,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO;IAoBvC;;OAEG;IACH,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC;IAiBnD;;OAEG;IACH,oBAAoB,IAAI,IAAI;IAQ5B;;OAEG;IACH,kBAAkB,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC,MAAM,GAAG,IAAI;IAQnD,MAAM,CAAC,SAAS,IAAI,IAAI;IAMxB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;IAInC,cAAc,EAAE,MAAM,IAAI,CAEvB;CACJ;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/router/component.ts"],"sourcesContent":null,"names":["routerTypes","Router","Router_1","GlobalStyle","constructor","this","__fieldRouteTree","RouteTree","__slottedRouteTree","__cacheRecord","Map","component","pathname","location","default","htmlSlot","type","cache","handlePopstate","events","add","window","params","path","parseParams","routes","value","__routes","collectFieldRoutes","clear","render","cached","get","fieldComponent","slottedComponent","connectedCallback","super","routerInstances","observers","MutationObserver","collectSlottedRoutes","attributes","attributeFilter","subtree","disconnectedCallback","delete","useRouter","updated","changedProperties","has","ur","set","dispatchCustomEvent","query","search","pattern","route","find","r","omit","slottedPaths","_slottedNames","s","forEach","slotName","insert","updateAll","i","Set","__decorate","state","prototype","property","Boolean","godown","styles","css"],"mappings":"oRAuBA,MAAMA,EACG,QADHA,EAEK,UAFLA,EAGI,SAmCV,IAAMC,EAAMC,EAAZ,MAAMD,eAAeE,EAArB,WAAAC,uBAGUC,KAAAC,iBAA8B,IAAIC,EAClCF,K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AItB,MAAAoC,CAAO1C,GACL,OAAOP,KAAKC,iBAAiBgD,OAAO1C,IAAaP,KAAKG,mBAAmB8C,OAAO1C,KA9M3EX,EAAAoC,gBAA+B,IAAI+B,IAW1CC,EAAA,CADCC,KAC0CrE,EAAAsE,UAAA,iBAAA,GAgB3CF,EAAA,CADCC,KACarE,EAAAsE,UAAA,YAAA,GAMdF,EAAA,CADCG,KACoCvE,EAAAsE,UAAA,gBAAA,GAMrCF,EAAA,CADCC,KACoCrE,EAAAsE,UAAA,eAAA,GAUrCF,EAAA,CADCG,KACqCvE,EAAAsE,UAAA,YAAA,GAQtCF,EAAA,CADCG,EAAS,CAAExD,KAAMyD,WACJxE,EAAAsE,UAAA,aAAA,GAGdF,EAAA,CADCC,KAIArE,EAAAsE,UAAA,SAAA,MAhEGtE,EAAMC,EAAAmE,EAAA,CANXK,EAxBiB,UAyBjBC,EAAOC,CAAG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"__source__/","sources":["web-components/router/definition.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAIpC,eAAe,MAAM,CAAC;AAEtB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,MAAM,CAAC;KACzB;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/router/definition.ts"],"sourcesContent":null,"names":["Router","define"],"mappings":"8BAEAA,EAAOC"}
|
@@ -11,7 +11,7 @@ import { type DirectionCardinalY } from "../../internal/direction.js";
|
|
11
11
|
*
|
12
12
|
* Multi-selected state looks the same as single-selected.
|
13
13
|
*
|
14
|
-
* Input will filter the
|
14
|
+
* Input will filter the options.
|
15
15
|
*
|
16
16
|
* @fires input - Fires when the input value changes.
|
17
17
|
* @fires change - Fires when the input value changes.
|
@@ -36,6 +36,7 @@ declare class Select extends Input {
|
|
36
36
|
private __store;
|
37
37
|
get observedRecord(): Record<string, any>;
|
38
38
|
protected render(): TemplateResult<1>;
|
39
|
+
protected _renderSuffix(): TemplateResult<1>;
|
39
40
|
protected _handleFocus(): void;
|
40
41
|
protected firstUpdated(): void;
|
41
42
|
protected _connectedInit(): void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/select/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAA6C,MAAM,iBAAiB,CAAC;AAE/F,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,KAAK,CAAC;AAG9D,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAE1C,OAAO,EAAE,KAAK,kBAAkB,EAAwB,MAAM,6BAA6B,CAAC;AAyB5F;;;;;;;;;;;;;;;;GAgBG;AACH,cAwBM,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;IAqCrC,SAAS,CAAC,aAAa,IAAI,cAAc,CAAC,CAAC,CAAC;IAM5C,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;IA6B3C,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;IAU/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"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{
|
1
|
+
import{__decorate as t}from"tslib";import{queryPart as e,godown as i,styles as o,attr as s,htmlSlot as n}from"@godown/element";import l from"../../internal/icons/caret-down.js";import{css as r,nothing as h,html as a}from"lit";import{property as c,state as u}from"lit/decorators.js";import p from"../input/component.js";import{cssGlobalVars as d}from"../../internal/global-style.js";import{directionOutsetPlace as f}from"../../internal/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 a`<label part="root" ${s(this.observedRecord)}> ${[this._renderPrefix(),a`<input part="input" type="${this.type}" .value="${this.text}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||h}" autocomplete="${this.autocomplete||h}" placeholder="${this.placeholder||h}" @focus="${this._handleFocus}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,this._renderSuffix(),a`<label part="content" direction-outset-place> ${n()} </label>`]} </label>`}_renderSuffix(){return a`<i part="suffix icon">${l()}</i>`}_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,e=e.trim();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.dispatchCustomEvent("select",this.value),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.dispatchCustomEvent("input",this.value,{bubbles:!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:currentColor}[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=component.js.map
|