godown 3.0.0-canary.13 → 3.0.0-canary.14

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.
Files changed (136) hide show
  1. package/README.md +1 -1
  2. package/alert.js +1 -5
  3. package/alert.js.map +1 -1
  4. package/avatar.js +1 -5
  5. package/avatar.js.map +1 -1
  6. package/breath.js +1 -5
  7. package/breath.js.map +1 -1
  8. package/button.js +1 -5
  9. package/button.js.map +1 -1
  10. package/card.js +1 -5
  11. package/card.js.map +1 -1
  12. package/carousel.js +1 -5
  13. package/carousel.js.map +1 -1
  14. package/components/alert.js +1 -174
  15. package/components/alert.js.map +1 -1
  16. package/components/avatar.js +1 -68
  17. package/components/avatar.js.map +1 -1
  18. package/components/breath.js +1 -81
  19. package/components/breath.js.map +1 -1
  20. package/components/button.js +1 -185
  21. package/components/button.js.map +1 -1
  22. package/components/card.js +1 -49
  23. package/components/card.js.map +1 -1
  24. package/components/carousel.js +1 -119
  25. package/components/carousel.js.map +1 -1
  26. package/components/details.js +1 -53
  27. package/components/details.js.map +1 -1
  28. package/components/dialog.js +1 -98
  29. package/components/dialog.js.map +1 -1
  30. package/components/divider.js +1 -35
  31. package/components/divider.js.map +1 -1
  32. package/components/dragbox.js +1 -111
  33. package/components/dragbox.js.map +1 -1
  34. package/components/flex.js +1 -63
  35. package/components/flex.js.map +1 -1
  36. package/components/form.js +1 -75
  37. package/components/form.js.map +1 -1
  38. package/components/grid.js +1 -57
  39. package/components/grid.js.map +1 -1
  40. package/components/input.js +1 -51
  41. package/components/input.js.map +1 -1
  42. package/components/layout.js +1 -58
  43. package/components/layout.js.map +1 -1
  44. package/components/link.js +1 -53
  45. package/components/link.js.map +1 -1
  46. package/components/progress.js +1 -59
  47. package/components/progress.js.map +1 -1
  48. package/components/range.d.ts +1 -0
  49. package/components/range.d.ts.map +1 -1
  50. package/components/range.js +1 -267
  51. package/components/range.js.map +1 -1
  52. package/components/rotate.js +1 -56
  53. package/components/rotate.js.map +1 -1
  54. package/components/router.js +1 -247
  55. package/components/router.js.map +1 -1
  56. package/components/select.js +1 -217
  57. package/components/select.js.map +1 -1
  58. package/components/skeleton.js +1 -55
  59. package/components/skeleton.js.map +1 -1
  60. package/components/split.js +1 -154
  61. package/components/split.js.map +1 -1
  62. package/components/switch.js +1 -93
  63. package/components/switch.js.map +1 -1
  64. package/components/text.js +1 -46
  65. package/components/text.js.map +1 -1
  66. package/components/time.js +1 -78
  67. package/components/time.js.map +1 -1
  68. package/components/tooltip.js +1 -85
  69. package/components/tooltip.js.map +1 -1
  70. package/components/typewriter.js +1 -128
  71. package/components/typewriter.js.map +1 -1
  72. package/core/global-style.js +1 -52
  73. package/core/global-style.js.map +1 -1
  74. package/core/super-anchor.js +1 -39
  75. package/core/super-anchor.js.map +1 -1
  76. package/core/super-input.js +1 -117
  77. package/core/super-input.js.map +1 -1
  78. package/core/super-openable.js +1 -37
  79. package/core/super-openable.js.map +1 -1
  80. package/custom-elements.json +1 -1
  81. package/details.js +1 -5
  82. package/details.js.map +1 -1
  83. package/dev/components/range.d.ts +1 -0
  84. package/dev/components/range.d.ts.map +1 -1
  85. package/dev/components/range.js +8 -3
  86. package/dev/components/range.js.map +1 -1
  87. package/dev/components/router.js +2 -2
  88. package/dev/components/router.js.map +1 -1
  89. package/dialog.js +1 -5
  90. package/dialog.js.map +1 -1
  91. package/divider.js +1 -5
  92. package/divider.js.map +1 -1
  93. package/dragbox.js +1 -5
  94. package/dragbox.js.map +1 -1
  95. package/flex.js +1 -5
  96. package/flex.js.map +1 -1
  97. package/form.js +1 -5
  98. package/form.js.map +1 -1
  99. package/grid.js +1 -5
  100. package/grid.js.map +1 -1
  101. package/index.js +1 -56
  102. package/index.js.map +1 -1
  103. package/input.js +1 -5
  104. package/input.js.map +1 -1
  105. package/layout.js +1 -5
  106. package/layout.js.map +1 -1
  107. package/link.js +1 -5
  108. package/link.js.map +1 -1
  109. package/package.json +1 -1
  110. package/progress.js +1 -5
  111. package/progress.js.map +1 -1
  112. package/range.js +1 -5
  113. package/range.js.map +1 -1
  114. package/rotate.js +1 -5
  115. package/rotate.js.map +1 -1
  116. package/router.js +1 -5
  117. package/router.js.map +1 -1
  118. package/select.js +1 -5
  119. package/select.js.map +1 -1
  120. package/skeleton.js +1 -5
  121. package/skeleton.js.map +1 -1
  122. package/split.js +1 -5
  123. package/split.js.map +1 -1
  124. package/src/components/range.ts +9 -3
  125. package/src/components/router.ts +2 -2
  126. package/switch.js +1 -5
  127. package/switch.js.map +1 -1
  128. package/text.js +1 -5
  129. package/text.js.map +1 -1
  130. package/time.js +1 -5
  131. package/time.js.map +1 -1
  132. package/tooltip.js +1 -5
  133. package/tooltip.js.map +1 -1
  134. package/typewriter.js +1 -5
  135. package/typewriter.js.map +1 -1
  136. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sources":["../src/components/select.ts"],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;;;AAaA,SAAS,OAAO,CAAC,CAAS,EAAE,CAAS,EAAA;AACnC,IAAA,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAC5D;AAEA,SAAS,SAAS,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAA;AAChD,IAAA,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;AACnD,IAAA,MAAM,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM;IACvC,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;AAC5B;AAEA,SAAS,aAAa,CAAC,OAA2B,EAAE,SAAgB,EAAA;IAClE,IAAI,OAAO,EAAE;QACX,MAAM,IAAI,GAAG,SAAS;QAC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e,MAAM;;;;"}
1
+ {"version":3,"file":"select.js","sources":["../src/components/select.ts"],"sourcesContent":null,"names":["contain","a","b","toLowerCase","includes","updateChecked","element","operation","name","setAttribute","removeAttribute","Select","Input","constructor","this","multiple","visible","autoDirection","_store","render","html","attr","observedRecord","direction","_renderPrefix","ifDefined","dir","makeId","text","type","placeholder","nothing","autofocus","autocapitalize","autocomplete","disabled","_handleFocus","_handleInput","svgCaretDown","htmlSlot","top","bottom","getBoundingClientRect","window","innerHeight","_content","clientHeight","firstUpdated","events","add","e","preventDefault","stopPropagation","target","value","optionValue","select","textContent","lastChecked","_input","focus","document","composed1","composedPath","shadowRoot","contains","blur","_connectedInit","checked","querySelectorAll","length","forEach","default","defaultText","defaultChecked","reset","i","findIndex","s","splice","push","map","join","dispatchEvent","CustomEvent","detail","namevalue","filter","query","trim","children","filterCallback","match","style","display","compositing","c","start","slice","lastIndexOf","end","indexOf","betweenAt","selectionStart","options","super","option","getAttribute","__decorate","property","prototype","part","Boolean","state","godown","styles","css","Select$1"],"mappings":"ukBAaA,SAASA,EAAQC,EAAWC,GAC1B,OAAOD,GAAKC,GAAKD,EAAEE,cAAcC,SAASF,EAAEC,cAC9C,CAQA,SAASE,EAAcC,EAA6BC,GAClD,GAAID,EAAS,CACX,MAAME,EAAO,UACTD,EACFD,EAAQG,aAAaD,EAAM,IAE3BF,EAAQI,gBAAgBF,GAG9B,CAsBA,IAAMG,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAiBEC,KAAQC,UAAG,EAGXD,KAAOE,SAAG,EAGAF,KAAaG,cAAqB,SAKpCH,KAAMI,OAAuC,GAE3C,MAAAC,GACR,OAAOC,CAAI,oBACTC,EAAK,IACAP,KAAKQ,eACRC,UAAWT,KAAKS,WAAaT,KAAKG,uCAGpC,CACAH,KAAKU,gBACLJ,CAAI,4BAEKK,EAAUX,KAAKY,aAChBZ,KAAKa,mBACDb,KAAKc,eACPd,KAAKe,sBACEf,KAAKgB,aAAeC,kBACrBjB,KA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AKiF,YACP,OAEF,MAAMjB,EAAIhE,KAAK6C,OAAOL,MACtBxC,KAAKyE,OAAOzE,KAAKC,SA3NrB,SAAmB6D,EAAWE,EAAWkB,GACvC,MAAMC,EAAQnB,EAAEoB,MAAM,EAAGtB,GAAGuB,YAAYH,GAAK,GAAK,EAC5CI,EAAMtB,EAAEuB,QAAQL,EAAGpB,IAAME,EAAER,OACjC,OAAOQ,EAAEoB,MAAMD,EAAOG,EACxB,CAuNgCE,CAAUxF,KAAK6C,OAAO4C,eAAgBzB,EAAG,KAAOA,GAC5EhE,KAAKqE,cAAc,IAAIC,YAAY,QAAS,CAAEC,OAAQvE,KAAKwE,eAG7D,KAAA1B,CAAM4C,GACJ1F,KAAK6C,OAAOC,MAAM4C,GAClB1F,KAAKE,SAAU,EAGjB,IAAAkD,GACEpD,KAAK6C,OAAOO,OACZpD,KAAKE,SAAU,EACfyF,MAAMvC,OAGR,WAAAX,CAAYmD,GACV,OAAQA,EAAepD,OAASoD,EAAOC,aAAa,UAAY,KA9LlEC,EAAA,CADCC,KACWlG,EAAAmG,UAAA,YAAA,GAGFF,EAAA,CADTG,EAAK,YACyBpG,EAAAmG,UAAA,gBAAA,GAG/BF,EAAA,CADCC,KACsClG,EAAAmG,UAAA,iBAAA,GAGvCF,EAAA,CADCC,EAAS,CAAEhF,KAAMmF,WACFrG,EAAAmG,UAAA,gBAAA,GAGhBF,EAAA,CADCC,EAAS,CAAEhF,KAAMmF,WACHrG,EAAAmG,UAAA,eAAA,GAGLF,EAAA,CADTK,KACmDtG,EAAAmG,UAAA,qBAAA,GAvBhDnG,EAAMiG,EAAA,CAJXM,EAhBiB,UAiBjBC,EACCC,CAAG,yOAECzG,GA0MN,IAAA0G,EAAe1G"}
@@ -1,56 +1,2 @@
1
- import { __decorate } from 'tslib';
2
- import { godown } from '@godown/element/decorators/godown.js';
3
- import { styles } from '@godown/element/decorators/styles.js';
4
- import { attr } from '@godown/element/directives/attr.js';
5
- import { htmlSlot } from '@godown/element/directives/html-slot.js';
6
- import iconPhoto from '@godown/f7-icon/icons/photo.js';
7
- import { css, html } from 'lit';
8
- import { property, state } from 'lit/decorators.js';
9
- import { scopePrefix, cssGlobalVars, GlobalStyle } from '../core/global-style.js';
10
-
11
- const protoName = "skeleton";
12
- const cssScope = scopePrefix(protoName);
13
- /**
14
- * {@linkcode Skeleton} renders a skeleton screen.
15
- *
16
- * @slot loading - The content if loading is true.
17
- * @slot - The content if loading is false.
18
- * @category feedback
19
- */
20
- let Skeleton = class Skeleton extends GlobalStyle {
21
- constructor() {
22
- super(...arguments);
23
- /**
24
- * Animation type.
25
- * opacity animation only effect on slotted element and image icon.
26
- */
27
- this.animation = "position";
28
- /**
29
- * If false, render slot only.
30
- */
31
- this.loading = true;
32
- }
33
- render() {
34
- if (!this.loading) {
35
- return htmlSlot();
36
- }
37
- return html `<div part="root" ${attr(this.observedRecord)}>${this.type === "image" ? iconPhoto() : ""} ${htmlSlot("loading")}</div>`;
38
- }
39
- };
40
- __decorate([
41
- property()
42
- ], Skeleton.prototype, "type", void 0);
43
- __decorate([
44
- property()
45
- ], Skeleton.prototype, "animation", void 0);
46
- __decorate([
47
- state()
48
- ], Skeleton.prototype, "loading", void 0);
49
- Skeleton = __decorate([
50
- godown(protoName),
51
- styles(css `:host{${cssScope}--from:var(${cssGlobalVars._colors.darkgray[9]});${cssScope}--to:var(${cssGlobalVars._colors.darkgray[7]});${cssScope}--deg:95deg;${cssScope}--duration:1.5s;${cssScope}--icon-size:5em;${cssScope}--icon-margin:.25em;color:var(${cssGlobalVars._colors.darkgray[5]});background:var(${cssScope}--from);min-height:1.5em;width:100%;flex-shrink:0;display:block;overflow:hidden}[part=root]{height:100%;min-height:inherit;text-align:center;animation:var(${cssScope}--duration) ease-in-out 0s infinite none running}svg{--size:var(${cssScope}--icon-size);font-size:var(--size);margin:calc(var(--size) * .05)}[animation=position]{background-image:linear-gradient(var(${cssScope}--deg),var(${cssScope}--from) 36%,var(${cssScope}--to) 50%,var(${cssScope}--from) 64%);background-color:transparent;background-size:200% 100%;animation-name:po}@keyframes po{from{background-position:150% center}to{background-position:-50% center}}[animation=opacity]{animation-name:op;animation-direction:alternate}@keyframes op{50%{opacity:.25}to{opacity:1}}`)
52
- ], Skeleton);
53
- var Skeleton$1 = Skeleton;
54
-
55
- export { Skeleton$1 as default };
1
+ import{__decorate as o}from"tslib";import{godown as r}from"@godown/element/decorators/godown.js";import{styles as i}from"@godown/element/decorators/styles.js";import{attr as t}from"@godown/element/directives/attr.js";import{htmlSlot as e}from"@godown/element/directives/html-slot.js";import n from"@godown/f7-icon/icons/photo.js";import{css as a,html as s}from"lit";import{property as m,state as d}from"lit/decorators.js";import{scopePrefix as c,cssGlobalVars as l,GlobalStyle as p}from"../core/global-style.js";const g="skeleton",v=c(g);let f=class Skeleton extends p{constructor(){super(...arguments),this.animation="position",this.loading=!0}render(){return this.loading?s`<div part="root" ${t(this.observedRecord)}>${"image"===this.type?n():""} ${e("loading")}</div>`:e()}};o([m()],f.prototype,"type",void 0),o([m()],f.prototype,"animation",void 0),o([d()],f.prototype,"loading",void 0),f=o([r(g),i(a`:host{${v}--from:var(${l._colors.darkgray[9]});${v}--to:var(${l._colors.darkgray[7]});${v}--deg:95deg;${v}--duration:1.5s;${v}--icon-size:5em;${v}--icon-margin:.25em;color:var(${l._colors.darkgray[5]});background:var(${v}--from);min-height:1.5em;width:100%;flex-shrink:0;display:block;overflow:hidden}[part=root]{height:100%;min-height:inherit;text-align:center;animation:var(${v}--duration) ease-in-out 0s infinite none running}svg{--size:var(${v}--icon-size);font-size:var(--size);margin:calc(var(--size) * .05)}[animation=position]{background-image:linear-gradient(var(${v}--deg),var(${v}--from) 36%,var(${v}--to) 50%,var(${v}--from) 64%);background-color:transparent;background-size:200% 100%;animation-name:po}@keyframes po{from{background-position:150% center}to{background-position:-50% center}}[animation=opacity]{animation-name:op;animation-direction:alternate}@keyframes op{50%{opacity:.25}to{opacity:1}}`)],f);var $=f;export{$ as default};
56
2
  //# sourceM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EAAA,EAAA,QAAQ,CAAY,SAAA,EAAA,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA,EAAA,EAAK,QAAQ,CAAA,YAAA,EAAe,QAAQ,CAAmB,gBAAA,EAAA,QAAQ,CAAmB,gBAAA,EAAA,QAAQ,CAAiC,8BAAA,EAAA,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA,iBAAA,EAAoB,QAAQ,CAAA,2JAAA,EAA8J,QAAQ,CAAA,gEAAA,EAAmE,QAAQ,CAAA,4HAAA,EAAgI,QAAQ,CAAA,WAAA,EAAc,QAAQ,CAAA,gBAAA,EAAmB,QAAQ,CAAA,cAAA,EAAiB,QAAQ,CAAA,6RAAA,CAAgS;AAEphC,CAAA,EAAA,QAAQ,CA4Bd;AAEA,iBAAe,QAAQ;;;;"}
1
+ {"version":3,"file":"skeleton.js","sources":["../src/components/skeleton.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Skeleton","GlobalStyle","constructor","this","animation","loading","render","html","attr","observedRecord","type","iconPhoto","htmlSlot","__decorate","property","prototype","state","godown","styles","css","cssGlobalVars","_colors","darkgray","Skeleton$1"],"mappings":"ggBAUA,MAAMA,EAAY,WACZC,EAAWC,EAAYF,GAa7B,IAAMG,EAAN,MAAMA,iBAAiBC,EAAvB,WAAAC,uBAYEC,KAASC,UAA2B,WAMpCD,KAAOE,SAAG,EAEA,MAAAC,GACR,OAAKH,KAAKE,QAGHE,CAAI,oBAAoBC,EAAKL,KAAKM,mBACzB,UAAdN,KAAKO,KAAmBC,IAAc,MACtCC,EAAS,mBAJFA,MAjBXC,EAAA,CADCC,KACqBd,EAAAe,UAAA,YAAA,GAOtBF,EAAA,CADCC,KAC6Cd,EAAAe,UAAA,iBAAA,GAM9CF,EAAA,CADCG,KACahB,EAAAe,UAAA,eAAA,GAlBVf,EAAQa,EAAA,CAJbI,EAAOpB,GACPqB,EACCC,CAAG,SAASrB,eAAsBsB,EAAcC,QAAQC,SAAS,OAAOxB,aAAoBsB,EAAcC,QAAQC,SAAS,OAAOxB,gBAAuBA,oBAA2BA,oBAA2BA,kCAAyCsB,EAAcC,QAAQC,SAAS,sBAAsBxB,+JAAsKA,oEAA2EA,gIAAwIA,eAAsBA,oBAA2BA,kBAAyBA,mSAE5uBE,GA8BN,IAAAuB,EAAevB"}
@@ -1,155 +1,2 @@
1
- import { __decorate } from 'tslib';
2
- import { godown } from '@godown/element/decorators/godown.js';
3
- import { styles } from '@godown/element/decorators/styles.js';
4
- import { attr } from '@godown/element/directives/attr.js';
5
- import { classList } from '@godown/element/directives/class-list.js';
6
- import { css, html, nothing } from 'lit';
7
- import { property, state } from 'lit/decorators.js';
8
- import { scopePrefix, cssGlobalVars } from '../core/global-style.js';
9
- import SuperInput from '../core/super-input.js';
10
-
11
- const protoName = "split";
12
- const cssScope = scopePrefix(protoName);
13
- const loop = (len, fn) => {
14
- const result = new Array(len);
15
- for (let index = 0; index < len; index++) {
16
- result[index] = fn(index);
17
- }
18
- return result;
19
- };
20
- /**
21
- * {@linkcode Split} renders multiple input boxes.
22
- *
23
- * Input: will move the focus box backward until the complete input from start to end.
24
- *
25
- * Delete: will move the focus box forward until the first and no inputs for each.
26
- *
27
- * @category input
28
- */
29
- let Split = class Split extends SuperInput {
30
- constructor() {
31
- super(...arguments);
32
- /**
33
- * The number of input boxes.
34
- */
35
- this.len = 6;
36
- /**
37
- * Focus index.
38
- */
39
- this.index = -1;
40
- this.current = -1;
41
- this.currentValue = [];
42
- }
43
- render() {
44
- return html `<div part="root" ${attr(this.observedRecord)}>${loop(this.len, (index) => html `<span part="input-box" @click="${this.disabled ? null : () => this.focusAt(index)}" class="${classList({ focus: this.current === index }) || nothing}">${this.currentValue[index]}</span>`)} <input part="input" id="${this.makeId}" @blur="${this.blur}" @input="${this._handleInput}" .value="${
45
- /* Ensure that input always has a value of length this.len */
46
- this.value.padStart(this.len, " ")}"></div>`;
47
- }
48
- connectedCallback() {
49
- super.connectedCallback();
50
- this.reset();
51
- }
52
- _handleInput(e) {
53
- e.stopPropagation();
54
- if (this.compositing) {
55
- return;
56
- }
57
- this.fillInput(e.data);
58
- this.value = this.currentValue.join("");
59
- this.dispatchEvent(new CustomEvent("input", { detail: this.value, bubbles: true, composed: true }));
60
- this.dispatchEvent(new CustomEvent("change", { detail: this.value, composed: true }));
61
- }
62
- /**
63
- * Fill input with data.
64
- *
65
- * If data is null
66
- * - If current value is null, move to before.
67
- * - If current value is not null, delete it.
68
- *
69
- * If data is not null
70
- * - If current value is null, input data.
71
- * - If current value is not null, input data and move to after.
72
- *
73
- * If data is multiple characters,
74
- * Fill input with data[0] and call fillInput with data.slice(1).
75
- *
76
- * @param data Input event data.
77
- */
78
- fillInput(data) {
79
- if (data === null) {
80
- // delete
81
- if (this.currentValue[this.current] !== null) {
82
- // delete exist value
83
- this.currentValue[this.current] = null;
84
- }
85
- else {
86
- // go to before
87
- this.currentValue[this.current - 1] = null;
88
- const lastNotNull = this.currentValue.findLastIndex(a => a !== null);
89
- this.current = this.current - 1 < 0 ? lastNotNull < 0 ? 0 : lastNotNull : this.current - 1;
90
- }
91
- return;
92
- }
93
- const multiple = data.length > 1;
94
- // input
95
- this.currentValue[this.current] = data[0];
96
- if (this.current + 1 >= this.len) {
97
- // index overflow
98
- this.current = this.currentValue.indexOf(null);
99
- if (this.current === -1) {
100
- this.blur();
101
- }
102
- }
103
- else {
104
- // go to after
105
- this.current += 1;
106
- }
107
- if (multiple) {
108
- const after = data.slice(1);
109
- if (after) {
110
- this.fillInput(after);
111
- }
112
- }
113
- }
114
- focus() {
115
- this.focusAt(this.current);
116
- super.focus();
117
- }
118
- focusAt(i) {
119
- this.current = i;
120
- this._input.focus();
121
- }
122
- blur() {
123
- this._input.blur();
124
- this.current = -1;
125
- super.blur();
126
- }
127
- reset() {
128
- this.current = -1;
129
- this.value = this.default;
130
- this.currentValue = this.value.split("").concat(Array(this.len - this.value.length).fill(null));
131
- if (this.index > -1) {
132
- this.current = this.index;
133
- }
134
- }
135
- };
136
- __decorate([
137
- property({ type: Number })
138
- ], Split.prototype, "len", void 0);
139
- __decorate([
140
- property({ type: Number })
141
- ], Split.prototype, "index", void 0);
142
- __decorate([
143
- state()
144
- ], Split.prototype, "current", void 0);
145
- __decorate([
146
- state()
147
- ], Split.prototype, "currentValue", void 0);
148
- Split = __decorate([
149
- godown(protoName),
150
- styles(css `:host{color:var(${cssGlobalVars.foreground});display:block;border-radius:1px;width:-moz-fit-content;width:fit-content;${cssScope}--size:1.45em;${cssScope}--gap:.25em}:host([contents]) [part=root]{width:-moz-fit-content;width:fit-content}[part=root]{gap:var(${cssScope}--gap);width:100%;position:relative;vertical-align:top;display:flex;justify-content:space-between;border-radius:inherit}[part=input-box]{width:var(${cssScope}--size);height:var(${cssScope}--size);vertical-align:top;text-align:center;background-color:var(${cssGlobalVars.input}-background);border-radius:inherit}[part=input]{width:100%;height:100%;opacity:0;background:0 0;position:absolute;z-index:-1}.focus{box-shadow:var(${cssGlobalVars.input}-box-shadow)}`)
151
- ], Split);
152
- var Split$1 = Split;
153
-
154
- export { Split$1 as default };
1
+ import{__decorate as t}from"tslib";import{godown as e}from"@godown/element/decorators/godown.js";import{styles as r}from"@godown/element/decorators/styles.js";import{attr as i}from"@godown/element/directives/attr.js";import{classList as s}from"@godown/element/directives/class-list.js";import{css as n,html as o,nothing as u}from"lit";import{property as l,state as a}from"lit/decorators.js";import{scopePrefix as c,cssGlobalVars as h}from"../core/global-style.js";import p from"../core/super-input.js";const d="split",f=c(d);let m=class Split extends p{constructor(){super(...arguments),this.len=6,this.index=-1,this.current=-1,this.currentValue=[]}render(){return o`<div part="root" ${i(this.observedRecord)}>${((t,e)=>{const r=new Array(t);for(let i=0;i<t;i++)r[i]=e(i);return r})(this.len,(t=>o`<span part="input-box" @click="${this.disabled?null:()=>this.focusAt(t)}" class="${s({focus:this.current===t})||u}">${this.currentValue[t]}</span>`))} <input part="input" id="${this.makeId}" @blur="${this.blur}" @input="${this._handleInput}" .value="${this.value.padStart(this.len," ")}"></div>`}connectedCallback(){super.connectedCallback(),this.reset()}_handleInput(t){t.stopPropagation(),this.compositing||(this.fillInput(t.data),this.value=this.currentValue.join(""),this.dispatchEvent(new CustomEvent("input",{detail:this.value,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:this.value,composed:!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([l({type:Number})],m.prototype,"len",void 0),t([l({type:Number})],m.prototype,"index",void 0),t([a()],m.prototype,"current",void 0),t([a()],m.prototype,"currentValue",void 0),m=t([e(d),r(n`:host{color:var(${h.foreground});display:block;border-radius:1px;width:-moz-fit-content;width:fit-content;${f}--size:1.45em;${f}--gap:.25em}:host([contents]) [part=root]{width:-moz-fit-content;width:fit-content}[part=root]{gap:var(${f}--gap);width:100%;position:relative;vertical-align:top;display:flex;justify-content:space-between;border-radius:inherit}[part=input-box]{width:var(${f}--size);height:var(${f}--size);vertical-align:top;text-align:center;background-color:var(${h.input}-background);border-radius:inherit}[part=input]{width:100%;height:100%;opacity:0;background:0 0;position:absolute;z-index:-1}.focus{box-shadow:var(${h.input}-box-shadow)}`)],m);var v=m;export{v as default};
155
2
  //# sourceMappingURL=split.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"split.js","sources":["../src/components/split.ts"],"sourcesContent":null,"names":[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,CAAA,aAAA,CAAe;AAExtB,CAAA,EAAA,KAAK,CA8IX;AAEA,cAAe,KAAK;;;;"}
1
+ {"version":3,"file":"split.js","sources":["../src/components/split.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Split","SuperInput","constructor","this","len","index","current","currentValue","render","html","attr","observedRecord","fn","result","Array","loop","disabled","focusAt","classList","focus","nothing","makeId","blur","_handleInput","value","padStart","connectedCallback","super","reset","e","stopPropagation","compositing","fillInput","data","join","dispatchEvent","CustomEvent","detail","bubbles","composed","lastNotNull","findLastIndex","a","multiple","length","indexOf","after","slice","i","_input","default","split","concat","fill","__decorate","property","type","Number","prototype","state","godown","styles","css","cssGlobalVars","foreground","input","Split$1"],"mappings":"sfAWA,MAAMA,EAAY,QACZC,EAAWC,EAAYF,GAuB7B,IAAMG,EAAN,MAAMA,cAAcC,EAApB,WAAAC,uBAKEC,KAAGC,IAAG,EAMND,KAAKE,OAAI,EAGTF,KAAOG,SAAI,EAGXH,KAAYI,aAAsB,GAExB,MAAAC,GACR,OAAOC,CAAI,oBAAoBC,EAAKP,KAAKQ,mBAzChC,EAAIP,EAAaQ,KAC5B,MAAMC,EAAc,IAAIC,MAAMV,GAC9B,IAAK,IAAIC,EAAQ,EAAGA,EAAQD,EAAKC,IAC/BQ,EAAOR,GAASO,EAAGP,GAErB,OAAOQ,CAAM,EAsCTE,CAAKZ,KAAKC,KAAMC,GACdI,CAAI,kCACQN,KAAKa,SAAW,KAAO,IAAMb,KAAKc,QAAQZ,cAC3Ca,EAAU,CAAEC,MAAOhB,KAAKG,UAAYD,KAAYe,MACxDjB,KAAKI,aAAaF,yCAIfF,KAAKkB,kBACHlB,KAAKmB,iBACHnB,KAAKoB,yBAGjBpB,KAAKqB,MAAMC,SAAStB,KAAKC,IAAK,eAMlC,iBAAAsB,GACEC,MAAMD,oBACNvB,KAAKyB,QAGG,YAAAL,CAAaM,GACrBA,EAAEC,kBACE3B,KAAK4B,cAIT5B,KAAK6B,UAAUH,EAA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oB,QAAQS,KAAK,OACrFlD,KAAKE,OAAS,IAChBF,KAAKG,QAAUH,KAAKE,SAtIxBiD,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACXzD,EAAA0D,UAAA,WAAA,GAMPJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACRzD,EAAA0D,UAAA,aAAA,GAGVJ,EAAA,CADCK,KACW3D,EAAA0D,UAAA,eAAA,GAGZJ,EAAA,CADCK,KACmC3D,EAAA0D,UAAA,oBAAA,GAjBhC1D,EAAKsD,EAAA,CAJVM,EAAO/D,GACPgE,EACCC,CAAG,mBAAmBC,EAAcC,wFAAwFlE,kBAAyBA,2GAAkHA,uJAA8JA,uBAA8BA,sEAA6EiE,EAAcE,2JAA4JF,EAAcE,uBAEpsBjE,GAgJN,IAAAkE,EAAelE"}
@@ -1,94 +1,2 @@
1
- import { __decorate } from 'tslib';
2
- import { godown } from '@godown/element/decorators/godown.js';
3
- import { styles } from '@godown/element/decorators/styles.js';
4
- import { attr } from '@godown/element/directives/attr.js';
5
- import { css, html } from 'lit';
6
- import { property, query } from 'lit/decorators.js';
7
- import { scopePrefix, cssGlobalVars } from '../core/global-style.js';
8
- import SuperInput from '../core/super-input.js';
9
-
10
- const protoName = "switch";
11
- const cssScope = scopePrefix(protoName);
12
- /**
13
- * {@linkcode Switch} renders a switch.
14
- *
15
- * The switch is rectangular by default,
16
- * set the round property to rounded switch.
17
- *
18
- * @category input
19
- */
20
- let Switch = class Switch extends SuperInput {
21
- constructor() {
22
- super(...arguments);
23
- /**
24
- * Display rounded.
25
- */
26
- this.round = false;
27
- /**
28
- * Whether this element is selected or not.
29
- */
30
- this.checked = false;
31
- /**
32
- * Disable this element.
33
- */
34
- this.disabled = false;
35
- /**
36
- * Default checked state.
37
- */
38
- this.default = "false";
39
- /**
40
- * Input value.
41
- */
42
- this.value = "on";
43
- }
44
- render() {
45
- return html `<div part="root" ${attr(this.observedRecord)} class="${this.round ? "round" : "rect"}"><input part="input" @change="${this._handleChange}" ?disabled="${this.disabled}" ?checked="${this.checked}" name="${this.name}" id="${this.makeId}" type="checkbox"> <span part="handle" class="${this.checked}"></span></div>`;
46
- }
47
- reset() {
48
- this.checked = this.default === "true";
49
- this._input.checked = this.checked;
50
- }
51
- connectedCallback() {
52
- super.connectedCallback();
53
- if (this.checked) {
54
- this.default = "true";
55
- }
56
- if (this.default === "true") {
57
- this.checked = true;
58
- }
59
- }
60
- _handleChange() {
61
- this.checked = this._input.checked;
62
- this.dispatchEvent(new CustomEvent("input", { detail: this.checked, bubbles: true, composed: true }));
63
- this.dispatchEvent(new CustomEvent("change", { detail: this.checked, composed: true }));
64
- }
65
- namevalue() {
66
- return [this.name, this.checked];
67
- }
68
- };
69
- __decorate([
70
- property({ type: Boolean, reflect: true })
71
- ], Switch.prototype, "round", void 0);
72
- __decorate([
73
- property({ type: Boolean, reflect: true })
74
- ], Switch.prototype, "checked", void 0);
75
- __decorate([
76
- property({ type: Boolean, reflect: true })
77
- ], Switch.prototype, "disabled", void 0);
78
- __decorate([
79
- property()
80
- ], Switch.prototype, "default", void 0);
81
- __decorate([
82
- property()
83
- ], Switch.prototype, "value", void 0);
84
- __decorate([
85
- query("input")
86
- ], Switch.prototype, "_input", void 0);
87
- Switch = __decorate([
88
- godown(protoName),
89
- styles(css `:host,:host([contents]) [part=root]{width:var(${cssScope}-width);height:var(${cssScope}-height);display:inline-block}:host{${cssScope}-width:3em;${cssScope}-height:calc(var(${cssScope}-width)/ 2);${cssScope}-handle-size:1.25em;${cssScope}-handle-space:.125em;${cssScope}-transition:.2s ease-in-out;background:var(${cssGlobalVars.input}-background);vertical-align:bottom;border-radius:0}[part=root],span{transition:var(${cssScope}-transition)}[part=root]{border-radius:inherit;position:relative;height:inherit}input{opacity:0;width:100%;height:100%;-webkit-appearance:none;appearance:none}span{height:100%;display:inline-flex;align-items:center;justify-content:center;position:absolute;left:0;width:50%;pointer-events:none;border-radius:inherit}:host([round]){border-radius:calc(var(${cssScope}-height)/ 2);background:var(${cssGlobalVars.passive})}:host([checked]) span{left:50%}.rect .true{background:var(${cssGlobalVars.active})}.rect .false{background:var(${cssGlobalVars.passive})}.round span{--size:var(${cssScope}-handle-size);border-radius:100%;background:var(--godown--input-control);width:var(--size);height:var(--size);margin:var(${cssScope}-handle-space)}:host([checked]) .round{background:var(${cssGlobalVars.active})}`)
90
- ], Switch);
91
- var Switch$1 = Switch;
92
-
93
- export { Switch$1 as default };
1
+ import{__decorate as e}from"tslib";import{godown as t}from"@godown/element/decorators/godown.js";import{styles as i}from"@godown/element/decorators/styles.js";import{attr as o}from"@godown/element/directives/attr.js";import{css as r,html as a}from"lit";import{property as s,query as n}from"lit/decorators.js";import{scopePrefix as d,cssGlobalVars as c}from"../core/global-style.js";import h from"../core/super-input.js";const p="switch",l=d(p);let u=class Switch extends h{constructor(){super(...arguments),this.round=!1,this.checked=!1,this.disabled=!1,this.default="false",this.value="on"}render(){return a`<div part="root" ${o(this.observedRecord)} class="${this.round?"round":"rect"}"><input part="input" @change="${this._handleChange}" ?disabled="${this.disabled}" ?checked="${this.checked}" name="${this.name}" id="${this.makeId}" type="checkbox"> <span part="handle" class="${this.checked}"></span></div>`}reset(){this.checked="true"===this.default,this._input.checked=this.checked}connectedCallback(){super.connectedCallback(),this.checked&&(this.default="true"),"true"===this.default&&(this.checked=!0)}_handleChange(){this.checked=this._input.checked,this.dispatchEvent(new CustomEvent("input",{detail:this.checked,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:this.checked,composed:!0}))}namevalue(){return[this.name,this.checked]}};e([s({type:Boolean,reflect:!0})],u.prototype,"round",void 0),e([s({type:Boolean,reflect:!0})],u.prototype,"checked",void 0),e([s({type:Boolean,reflect:!0})],u.prototype,"disabled",void 0),e([s()],u.prototype,"default",void 0),e([s()],u.prototype,"value",void 0),e([n("input")],u.prototype,"_input",void 0),u=e([t(p),i(r`:host,:host([contents]) [part=root]{width:var(${l}-width);height:var(${l}-height);display:inline-block}:host{${l}-width:3em;${l}-height:calc(var(${l}-width)/ 2);${l}-handle-size:1.25em;${l}-handle-space:.125em;${l}-transition:.2s ease-in-out;background:var(${c.input}-background);vertical-align:bottom;border-radius:0}[part=root],span{transition:var(${l}-transition)}[part=root]{border-radius:inherit;position:relative;height:inherit}input{opacity:0;width:100%;height:100%;-webkit-appearance:none;appearance:none}span{height:100%;display:inline-flex;align-items:center;justify-content:center;position:absolute;left:0;width:50%;pointer-events:none;border-radius:inherit}:host([round]){border-radius:calc(var(${l}-height)/ 2);background:var(${c.passive})}:host([checked]) span{left:50%}.rect .true{background:var(${c.active})}.rect .false{background:var(${c.passive})}.round span{--size:var(${l}-handle-size);border-radius:100%;background:var(--godown--input-control);width:var(--size);height:var(--size);margin:var(${l}-handle-space)}:host([checked]) .round{background:var(${c.active})}`)],u);var v=u;export{v as default};
94
2
  //# sourceMappingURL=switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","sources":["../src/components/switch.ts"],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;AASA,MAAM,SAAS,GAAG,QAAQ;AAC1B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC;AAEvC;;;;;;;AAOE;AAKF,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU,CAAA;AAA/B,IAAA,WAAA,GAAA;;AACE;;AAEE;QAEF,IAAK,CAAA,KAAA,GAAG,KAAK;AAEb;;AAEE;QAEF,IAAO,CAAA,OAAA,GAAG,KAAK;AAEf;;AAEE;QAEF,IAAQ,CAAA,QAAA,GAAG,KAAK;AAEhB;;AAEE;QAEF,IAAO,CAAA,OAAA,GAAG,OAAO;AAEjB;;AAEE;QAEF,IAAK,CAAA,KAAA,GAAG,IAAI;;IAKF,MAAM,GAAA;QACd,OAAO,IAAI,CAAA,CACP,iBAAA,EAAA,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA,QAAA,EAClB,IAAI,CAAC,KAAK,GAAG,OAAO,GAAG,MAAM,CAIzB,+BAAA,EAA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CAAA,EAAA,MAAM,CA4EZ;AAEA,eAAe,MAAM;;;;"}
1
+ {"version":3,"file":"switch.js","sources":["../src/components/switch.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Switch","SuperInput","constructor","this","round","checked","disabled","default","value","render","html","attr","observedRecord","_handleChange","name","makeId","reset","_input","connectedCallback","super","dispatchEvent","CustomEvent","detail","bubbles","composed","namevalue","__decorate","property","type","Boolean","reflect","prototype","query","godown","styles","css","cssGlobalVars","input","passive","active","Switch$1"],"mappings":"oaASA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAc7B,IAAMG,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAKEC,KAAKC,OAAG,EAMRD,KAAOE,SAAG,EAMVF,KAAQG,UAAG,EAMXH,KAAOI,QAAG,QAMVJ,KAAKK,MAAG,KAKE,MAAAC,GACR,OAAOC,CAAI,oBACPC,EAAKR,KAAKS,0BACHT,KAAKC,MAAQ,QAAU,wCAInBD,KAAKU,6BACHV,KAAKG,uBACNH,KAAKE,kBACTF,KAAKW,aACPX,KAAKY,uDAGgBZ,KAAKE,yBAItC,KAAAW,GACEb,KAAKE,QAA2B,SAAjBF,KAAKI,QACpBJ,KAAKc,OAAOZ,QAAUF,KAAKE,QAG7B,iBAAAa,GACEC,MAAMD,oBACFf,KAAKE,UACPF,KAAKI,QAAU,QAEI,SAAjBJ,KAAKI,UACPJ,KAAKE,SAAU,GAIT,aAAAQ,GACRV,KAAKE,QAAUF,KAAKc,OAAOZ,QAC3BF,KAAKiB,cAAc,IAAIC,YAAY,QAAS,CAAEC,OAAQnB,KAAKE,QAASkB,SAAS,EAAMC,UAAU,KAC7FrB,KAAKiB,cAAc,IAAIC,YAAY,SAAU,CAAEC,OAAQnB,KAAKE,QAASmB,UAAU,KAGjF,SAAAC,GACE,MAAO,CAACtB,KAAKW,KAAMX,KAAKE,WArE1BqB,EAAA,CADCC,EAAS,CAAEC,KAAMC,QAASC,SAAS,KACvB9B,EAAA+B,UAAA,aAAA,GAMbL,EAAA,CADCC,EAAS,CAAEC,KAAMC,QAASC,SAAS,KACrB9B,EAAA+B,UAAA,eAAA,GAMfL,EAAA,CADCC,EAAS,CAAEC,KAAMC,QAASC,SAAS,KACpB9B,EAAA+B,UAAA,gBAAA,GAMhBL,EAAA,CADCC,KACgB3B,EAAA+B,UAAA,eAAA,GAMjBL,EAAA,CADCC,KACW3B,EAAA+B,UAAA,aAAA,GAGFL,EAAA,CADTM,EAAM,UAC2BhC,EAAA+B,UAAA,cAAA,GAhC9B/B,EAAM0B,EAAA,CAJXO,EAAOpC,GACPqC,EACCC,CAAG,iDAAiDrC,uBAA8BA,wCAA+CA,eAAsBA,qBAA4BA,gBAAwBA,wBAA+BA,yBAAgCA,+CAAsDsC,EAAcC,2FAA2FvC,qWAA4WA,gCAAwCsC,EAAcE,sEAAsEF,EAAcG,uCAAuCH,EAAcE,mCAAmCxC,6HAAoIA,0DAAiEsC,EAAcG,aAEtsCvC,GA8EN,IAAAwC,EAAexC"}
@@ -1,47 +1,2 @@
1
- import { __decorate } from 'tslib';
2
- import { godown } from '@godown/element/decorators/godown.js';
3
- import { styles } from '@godown/element/decorators/styles.js';
4
- import { attr } from '@godown/element/directives/attr.js';
5
- import { classList } from '@godown/element/directives/class-list.js';
6
- import { htmlSlot } from '@godown/element/directives/html-slot.js';
7
- import { css, html } from 'lit';
8
- import { property } from 'lit/decorators.js';
9
- import { scopePrefix, cssGlobalVars, GlobalStyle } from '../core/global-style.js';
10
-
11
- const protoName = "text";
12
- const cssScope = scopePrefix(protoName);
13
- /**
14
- * {@linkcode Text} renders nowrap text.
15
- *
16
- * @category display
17
- */
18
- let Text = class Text extends GlobalStyle {
19
- constructor() {
20
- super(...arguments);
21
- /**
22
- * Underline behavior.
23
- */
24
- this.underline = "none";
25
- /**
26
- * Set background-clip to text.
27
- */
28
- this.clip = false;
29
- }
30
- render() {
31
- return html `<span part="root" ${attr(this.observedRecord)} class="${classList(this.underline)}">${htmlSlot()}</span>`;
32
- }
33
- };
34
- __decorate([
35
- property()
36
- ], Text.prototype, "underline", void 0);
37
- __decorate([
38
- property({ type: Boolean })
39
- ], Text.prototype, "clip", void 0);
40
- Text = __decorate([
41
- godown(protoName),
42
- styles(css `:host{${cssScope}--color:currentColor;${cssScope}--color-hover:currentColor;${cssScope}--color-active:currentColor;display:inline-block;text-overflow:ellipsis;overflow-wrap:break-word}[part=root]{white-space:nowrap;width:100%;vertical-align:bottom;display:inline-block;text-overflow:inherit;overflow-wrap:inherit;overflow:hidden;color:var(${cssScope}--color)}[part=root]:hover{color:var(${cssScope}--color-hover,var(${cssScope}--color))}[part=root]:active{color:var(${cssScope}--color-active,var(${cssScope}--color))}.active:active,.always,.hover:hover{text-decoration:underline}.none{text-decoration:none}[clip]{background:var(${cssGlobalVars.clipBackground});display:inline-block;color:transparent;-webkit-text-fill-color:transparent;background-clip:text;-webkit-background-clip:text}`)
43
- ], Text);
44
- var Text$1 = Text;
45
-
46
- export { Text$1 as default };
1
+ import{__decorate as o}from"tslib";import{godown as r}from"@godown/element/decorators/godown.js";import{styles as e}from"@godown/element/decorators/styles.js";import{attr as t}from"@godown/element/directives/attr.js";import{classList as l}from"@godown/element/directives/class-list.js";import{htmlSlot as i}from"@godown/element/directives/html-slot.js";import{css as n,html as c}from"lit";import{property as a}from"lit/decorators.js";import{scopePrefix as s,cssGlobalVars as p,GlobalStyle as d}from"../core/global-style.js";const v="text",m=s(v);let w=class Text extends d{constructor(){super(...arguments),this.underline="none",this.clip=!1}render(){return c`<span part="root" ${t(this.observedRecord)} class="${l(this.underline)}">${i()}</span>`}};o([a()],w.prototype,"underline",void 0),o([a({type:Boolean})],w.prototype,"clip",void 0),w=o([r(v),e(n`:host{${m}--color:currentColor;${m}--color-hover:currentColor;${m}--color-active:currentColor;display:inline-block;text-overflow:ellipsis;overflow-wrap:break-word}[part=root]{white-space:nowrap;width:100%;vertical-align:bottom;display:inline-block;text-overflow:inherit;overflow-wrap:inherit;overflow:hidden;color:var(${m}--color)}[part=root]:hover{color:var(${m}--color-hover,var(${m}--color))}[part=root]:active{color:var(${m}--color-active,var(${m}--color))}.active:active,.always,.hover:hover{text-decoration:underline}.none{text-decoration:none}[clip]{background:var(${p.clipBackground});display:inline-block;color:transparent;-webkit-text-fill-color:transparent;background-clip:text;-webkit-background-clip:text}`)],w);var f=w;export{f as default};
47
2
  //# sourceMappingURL=text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sources":["../src/components/text.ts"],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;AAUA,MAAM,SAAS,GAAG,MAAM;AAExB,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC;AAEvC;;;;AAIE;AAGF,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,WAAW,CAAA;AAA9B,IAAA,WAAA,GAAA;;AACE;;AAEE;QAEF,IAAS,CAAA,SAAA,GAA2C,MAAM;AAE1D;;AAEE;QAEF,IAAI,CAAA,IAAA,GAAG,KAAK;;IAEF,MAAM,GAAA;QACd,OAAO,IAAI,CAAA,CAEP,kBAAA,EAAA,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA,QAAA,EAClB,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,KAEhC,QAAQ,EAAE,SACN;;CAEZ;AAjBE,UAAA,CAAA;AADC,IAAA,QAAQ;AACiD,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,WAAA,EAAA,KAAA,CAAA,CAAA;AAM1D,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;AACf,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA;AAXR,IAAI,GAAA,UAAA,CAAA;IAFT,MAAM,CAAC,SAAS,CAAA;IAChB,MAAM,CAAC,GAAG,CAAA,CAAS,MAAA,EAAA,QAAQ,wBAAwB,QAAQ,CAAA,2BAAA,EAA8B,QAAQ,CAAA,4PAAA,EAA+P,QAAQ,CAAA,qCAAA,EAAwC,QAAQ,CAAqB,kBAAA,EAAA,QAAQ,CAA0C,uCAAA,EAAA,QAAQ,CAAsB,mBAAA,EAAA,QAAQ,4HAA4H,aAAa,CAAC,cAAc,CAAA,+HAAA,CAAiI;AACzxB,CAAA,EAAA,IAAI,CAsBV;AAEA,aAAe,IAAI;;;;"}
1
+ {"version":3,"file":"text.js","sources":["../src/components/text.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Text","GlobalStyle","constructor","this","underline","clip","render","html","attr","observedRecord","classList","htmlSlot","__decorate","property","prototype","type","Boolean","godown","styles","css","cssGlobalVars","clipBackground","Text$1"],"mappings":"4gBAUA,MAAMA,EAAY,OAEZC,EAAWC,EAAYF,GAS7B,IAAMG,EAAN,MAAMA,aAAaC,EAAnB,WAAAC,uBAKEC,KAASC,UAA2C,OAMpDD,KAAIE,MAAG,EAEG,MAAAC,GACR,OAAOC,CAAI,qBAEPC,EAAKL,KAAKM,0BACHC,EAAUP,KAAKC,eAEtBO,eAdNC,EAAA,CADCC,KACyDb,EAAAc,UAAA,iBAAA,GAM1DF,EAAA,CADCC,EAAS,CAAEE,KAAMC,WACNhB,EAAAc,UAAA,YAAA,GAXRd,EAAIY,EAAA,CAFTK,EAAOpB,GACPqB,EAAOC,CAAG,SAASrB,yBAAgCA,+BAAsCA,gQAAuQA,yCAAgDA,sBAA6BA,2CAAkDA,uBAA8BA,6HAAoIsB,EAAcC,kJAC1oBrB,GAwBN,IAAAsB,EAAetB"}
@@ -1,79 +1,2 @@
1
- import { __decorate } from 'tslib';
2
- import { godown } from '@godown/element/decorators/godown.js';
3
- import { styles } from '@godown/element/decorators/styles.js';
4
- import { attr } from '@godown/element/directives/attr.js';
5
- import fmtime from 'fmtime';
6
- import { css, html } from 'lit';
7
- import { property } from 'lit/decorators.js';
8
- import { GlobalStyle } from '../core/global-style.js';
9
-
10
- const protoName = "time";
11
- /**
12
- * {@linkcode Time} renders a formatting time.
13
- *
14
- * @category display
15
- */
16
- let Time = class Time extends GlobalStyle {
17
- constructor() {
18
- super(...arguments);
19
- /**
20
- * Escape symbol.
21
- */
22
- this.escape = "%";
23
- /**
24
- * Format strings.
25
- */
26
- this.format = "YYYY-MM-DD hh:mm:ss UTFZ";
27
- /**
28
- * Time.
29
- */
30
- this.time = new Date();
31
- }
32
- render() {
33
- return html `<span part="root" ${attr(this.observedRecord)}>${fmtime(this.format, this.time, this.escape)}</span>`;
34
- }
35
- firstUpdated() {
36
- if (this.timeout) {
37
- this.timeoutId = this.startTimeout();
38
- }
39
- }
40
- updated(changedProperties) {
41
- if (changedProperties.has("timeout")) {
42
- clearInterval(this.timeoutId);
43
- if (this.timeout) {
44
- this.timeoutId = this.startTimeout();
45
- }
46
- }
47
- }
48
- disconnectedCallback() {
49
- clearInterval(this.timeoutId);
50
- }
51
- startTimeout() {
52
- return window.setInterval(() => {
53
- this.time = new Date(this.time.getTime() + (this.gap || this.timeout));
54
- }, Math.abs(this.timeout));
55
- }
56
- };
57
- __decorate([
58
- property()
59
- ], Time.prototype, "escape", void 0);
60
- __decorate([
61
- property()
62
- ], Time.prototype, "format", void 0);
63
- __decorate([
64
- property({ type: Object })
65
- ], Time.prototype, "time", void 0);
66
- __decorate([
67
- property({ type: Number })
68
- ], Time.prototype, "timeout", void 0);
69
- __decorate([
70
- property({ type: Number })
71
- ], Time.prototype, "gap", void 0);
72
- Time = __decorate([
73
- godown(protoName),
74
- styles(css `:host{text-align:center}`)
75
- ], Time);
76
- var Time$1 = Time;
77
-
78
- export { Time$1 as default };
1
+ import{__decorate as t}from"tslib";import{godown as e}from"@godown/element/decorators/godown.js";import{styles as o}from"@godown/element/decorators/styles.js";import{attr as i}from"@godown/element/directives/attr.js";import r from"fmtime";import{css as s,html as m}from"lit";import{property as a}from"lit/decorators.js";import{GlobalStyle as p}from"../core/global-style.js";let d=class Time extends p{constructor(){super(...arguments),this.escape="%",this.format="YYYY-MM-DD hh:mm:ss UTFZ",this.time=new Date}render(){return m`<span part="root" ${i(this.observedRecord)}>${r(this.format,this.time,this.escape)}</span>`}firstUpdated(){this.timeout&&(this.timeoutId=this.startTimeout())}updated(t){t.has("timeout")&&(clearInterval(this.timeoutId),this.timeout&&(this.timeoutId=this.startTimeout()))}disconnectedCallback(){clearInterval(this.timeoutId)}startTimeout(){return window.setInterval((()=>{this.time=new Date(this.time.getTime()+(this.gap||this.timeout))}),Math.abs(this.timeout))}};t([a()],d.prototype,"escape",void 0),t([a()],d.prototype,"format",void 0),t([a({type:Object})],d.prototype,"time",void 0),t([a({type:Number})],d.prototype,"timeout",void 0),t([a({type:Number})],d.prototype,"gap",void 0),d=t([e("time"),o(s`:host{text-align:center}`)],d);var h=d;export{h as default};
79
2
  //# sourceMappingURL=time.js.map