aptechka 0.8.4 → 0.10.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.
Files changed (143) hide show
  1. package/lib/ElementConstructor-OK-6OPjh.cjs +1 -0
  2. package/lib/ElementConstructor-rValMo8f.js +372 -0
  3. package/lib/_createStore-C75y9luu.cjs +1 -0
  4. package/lib/_createStore-D3qHYaSz.js +12 -0
  5. package/lib/accordion/AccordionElement.d.ts +1 -2
  6. package/lib/accordion/index.cjs +1 -1
  7. package/lib/accordion/index.js +110 -122
  8. package/lib/canvas/index.cjs +1 -1
  9. package/lib/canvas/index.d.ts +4 -5
  10. package/lib/canvas/index.js +69 -75
  11. package/lib/checkbox/index.cjs +1 -1
  12. package/lib/checkbox/index.d.ts +1 -3
  13. package/lib/checkbox/index.js +42 -45
  14. package/lib/connector/index.cjs +1 -1
  15. package/lib/connector/index.d.ts +2 -2
  16. package/lib/connector/index.js +39 -34
  17. package/lib/counter/index.d.ts +1 -3
  18. package/lib/{createStylesheet-BsMSWX0q.cjs → createStylesheet-9nksoWW0.cjs} +1 -1
  19. package/lib/{createStylesheet-BxKITIVV.js → createStylesheet-BrFGJ8Q7.js} +1 -1
  20. package/lib/element-constructor/ElementConstructor.d.ts +6 -5
  21. package/lib/element-constructor/index.cjs +1 -1
  22. package/lib/element-constructor/index.js +114 -113
  23. package/lib/en3/objects/fluid/En3FluidElement.d.ts +1 -2
  24. package/lib/globals-DMjysUXI.js +8 -0
  25. package/lib/globals-bYKki-b9.cjs +1 -0
  26. package/lib/image/index.cjs +1 -1
  27. package/lib/image/index.js +7 -15
  28. package/lib/index-3R8YL-P3.js +266 -0
  29. package/lib/index-CyQAdqFu.cjs +9 -0
  30. package/lib/instantiate-BuVJ8pIJ.cjs +1 -0
  31. package/lib/instantiate-TYteKsII.js +134 -0
  32. package/lib/jsx/ComponentElement.d.ts +18 -0
  33. package/lib/jsx/globals.d.ts +13 -0
  34. package/lib/jsx/h.d.ts +6 -0
  35. package/lib/jsx/hooks/animation/createDamped.d.ts +3 -0
  36. package/lib/jsx/hooks/animation/createTweened.d.ts +3 -0
  37. package/lib/jsx/hooks/animation/index.cjs +1 -0
  38. package/lib/jsx/hooks/animation/index.d.ts +2 -0
  39. package/lib/jsx/hooks/animation/index.js +15 -0
  40. package/lib/jsx/hooks/basic/_createStore.d.ts +4 -0
  41. package/lib/jsx/hooks/basic/attachInternals.d.ts +1 -0
  42. package/lib/jsx/hooks/basic/attachShadow.d.ts +1 -0
  43. package/lib/jsx/hooks/basic/attachStylesheet.d.ts +3 -0
  44. package/lib/jsx/hooks/basic/createContext.d.ts +2 -0
  45. package/lib/jsx/hooks/basic/createRef.d.ts +3 -0
  46. package/lib/jsx/hooks/basic/onConnect.d.ts +3 -0
  47. package/lib/jsx/hooks/basic/onDisconnect.d.ts +3 -0
  48. package/lib/jsx/hooks/basic/onStoreChange.d.ts +3 -0
  49. package/lib/jsx/hooks/onAnimationFrame.cjs +1 -0
  50. package/lib/jsx/hooks/onAnimationFrame.d.ts +6 -0
  51. package/lib/jsx/hooks/onAnimationFrame.js +22 -0
  52. package/lib/jsx/hooks/onElementResize.cjs +1 -0
  53. package/lib/jsx/hooks/onElementResize.d.ts +5 -0
  54. package/lib/jsx/hooks/onElementResize.js +11 -0
  55. package/lib/jsx/hooks/onIntersection.cjs +1 -0
  56. package/lib/jsx/hooks/onIntersection.d.ts +5 -0
  57. package/lib/jsx/hooks/onIntersection.js +11 -0
  58. package/lib/jsx/hooks/onWindowResize.cjs +1 -0
  59. package/lib/jsx/hooks/onWindowResize.d.ts +3 -0
  60. package/lib/jsx/hooks/onWindowResize.js +8 -0
  61. package/lib/jsx/hooks/store/createCached.d.ts +3 -0
  62. package/lib/jsx/hooks/store/createComposed.d.ts +3 -0
  63. package/lib/jsx/hooks/store/createDerived.d.ts +3 -0
  64. package/lib/jsx/hooks/store/createDerivedArray.d.ts +3 -0
  65. package/lib/jsx/hooks/store/createResource.d.ts +3 -0
  66. package/lib/jsx/hooks/store/createStore.d.ts +3 -0
  67. package/lib/jsx/hooks/store/index.cjs +1 -0
  68. package/lib/jsx/hooks/store/index.d.ts +6 -0
  69. package/lib/jsx/hooks/store/index.js +31 -0
  70. package/lib/jsx/hooks/watchAttribute.cjs +1 -0
  71. package/lib/jsx/hooks/watchAttribute.d.ts +6 -0
  72. package/lib/jsx/hooks/watchAttribute.js +17 -0
  73. package/lib/jsx/hooks/watchCSSProperty.cjs +1 -0
  74. package/lib/jsx/hooks/watchCSSProperty.d.ts +7 -0
  75. package/lib/jsx/hooks/watchCSSProperty.js +17 -0
  76. package/lib/jsx/index.cjs +1 -0
  77. package/lib/jsx/index.d.ts +15 -0
  78. package/lib/jsx/index.js +106 -0
  79. package/lib/jsx/instantiate.d.ts +5 -0
  80. package/lib/jsx/register.d.ts +1 -0
  81. package/lib/jsx/render.d.ts +6 -0
  82. package/lib/jsx/type.d.ts +198 -0
  83. package/lib/modal/index.cjs +1 -1
  84. package/lib/modal/index.js +34 -36
  85. package/lib/onConnect-DGP866cj.cjs +1 -0
  86. package/lib/onConnect-y5DrxJ9P.js +7 -0
  87. package/lib/order/index.cjs +1 -1
  88. package/lib/order/index.d.ts +5 -4
  89. package/lib/order/index.js +1 -1
  90. package/lib/pointer/PointerElement.d.ts +1 -2
  91. package/lib/pointer/index.cjs +1 -1
  92. package/lib/pointer/index.js +105 -117
  93. package/lib/popover/PopoverButtonElement.d.ts +1 -2
  94. package/lib/popover/PopoverElement.d.ts +1 -2
  95. package/lib/popover/index.cjs +1 -1
  96. package/lib/popover/index.js +109 -124
  97. package/lib/router/index.cjs +1 -1
  98. package/lib/router/index.js +76 -73
  99. package/lib/scroll/ScrollElement.d.ts +1 -2
  100. package/lib/scroll/ScrollUserElement.d.ts +1 -2
  101. package/lib/scroll/index.cjs +1 -1
  102. package/lib/scroll/index.js +674 -753
  103. package/lib/select/SelectElement.d.ts +1 -3
  104. package/lib/select/SelectUserElement.d.ts +1 -2
  105. package/lib/select/index.cjs +1 -1
  106. package/lib/select/index.js +1 -1
  107. package/lib/sequence/index.cjs +1 -1
  108. package/lib/sequence/index.js +104 -107
  109. package/lib/slicer/SlicerElement.d.ts +1 -2
  110. package/lib/slicer/index.cjs +5 -5
  111. package/lib/slicer/index.js +88 -106
  112. package/lib/source/SourceElement.d.ts +1 -2
  113. package/lib/source/index.cjs +2 -2
  114. package/lib/source/index.js +19 -20
  115. package/lib/store/Cached.d.ts +13 -0
  116. package/lib/store/Derived.d.ts +3 -3
  117. package/lib/store/DerivedArray.d.ts +8 -0
  118. package/lib/store/index.cjs +1 -1
  119. package/lib/store/index.d.ts +2 -0
  120. package/lib/store/index.js +65 -31
  121. package/lib/tags-BosXYPYv.cjs +1 -0
  122. package/lib/tags-D0kLlFdQ.js +485 -0
  123. package/lib/theme/index.cjs +1 -1
  124. package/lib/theme/index.js +2 -1
  125. package/lib/tweaker/TweakerFieldElement.d.ts +1 -2
  126. package/lib/tweaker/TweakerFolderElement.d.ts +1 -2
  127. package/lib/tweaker/TweakerStoreManagerElement.d.ts +1 -2
  128. package/lib/tweaker/index.cjs +3 -3
  129. package/lib/tweaker/index.js +393 -472
  130. package/lib/utils/bytes.d.ts +1 -0
  131. package/lib/utils/index.cjs +1 -1
  132. package/lib/utils/index.d.ts +1 -0
  133. package/lib/utils/index.js +122 -105
  134. package/lib/video/index.cjs +1 -1
  135. package/lib/video/index.js +25 -29
  136. package/package.json +73 -9
  137. package/lib/custom-element/index.cjs +0 -1
  138. package/lib/custom-element/index.d.ts +0 -8
  139. package/lib/custom-element/index.js +0 -30
  140. package/lib/index-CzpP1Tg6.cjs +0 -9
  141. package/lib/index-Dwd_62sm.js +0 -301
  142. package/lib/tags-CAfasCGV.cjs +0 -1
  143. package/lib/tags-D9lNDPX8.js +0 -848
@@ -0,0 +1 @@
1
+ export declare function formatBytes(bytes: number, decimals?: number): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),S=require("../browser-CpzFX2xg.cjs"),l=require("../canvas-CU5Xjahf.cjs"),m=require("../coordinates-D8Np3cPD.cjs"),p=require("../dom-JBOkFLTh.cjs"),n=require("../easings-DsS5-Kqc.cjs"),h=require("../events-BGwqaxVW.cjs"),I=require("../file-EevnUtRj.cjs"),C=require("../function-MthRj-GJ.cjs"),v=require("../gestures-DHLrn6Q8.cjs"),f=require("../layout-8ryRAMGJ.cjs"),i=require("../math-GDWEqu7y.cjs"),d=require("../polyfills-CM4SCDTt.cjs"),o=require("../object-CCiXnER2.cjs"),r=require("../string-DhgS_iFl.cjs"),O=require("../style-At6aDoqG.cjs"),g=require("../url-C3dWnJQg.cjs");function y(t,e,...a){return[...t.slice(0,e),...a,...t.slice(e)]}function P(t,e){const a=t.length;e=e%a;const s=new Array(a);for(let u=0;u<a;u++){const c=(u+e)%a;s[c]=t[u]}return s}function T(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function q(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function E(t,e){const a=t.styleMap.get(e);if(a){const s=a.toString();return s.startsWith("var")?E(t,s.slice(4,-1)):s}}function x(...t){const e={};return Array.from(document.styleSheets).forEach(a=>{Array.from(a.cssRules).forEach(s=>{s instanceof CSSStyleRule&&s.selectorText===":root"&&t.forEach(u=>{const c=E(s,u);c&&(e[u]=c)})})}),t.forEach(a=>{e[a]||console.warn(`variable named ${a} not found`)}),e}function Q(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function D(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}exports.parseAttribute=b.parseAttribute;exports.parseAttributeValue=b.parseAttributeValue;exports.isBrowser=S.isBrowser;exports.contain=l.contain;exports.cover=l.cover;exports.fixPosition=l.fixPosition;exports.measureText=l.measureText;exports.getPointerPosition=m.getPointerPosition;exports.normalize=m.normalize;exports.screenToCartesian=m.screenToCartesian;exports.findParentElement=p.findParentElement;exports.findScrollParentElement=p.findScrollParentElement;exports.getAllParentElements=p.getAllParentElements;exports.getElement=p.getElement;exports.easeInCubic=n.easeInCubic;exports.easeInExpo=n.easeInExpo;exports.easeInOutCubic=n.easeInOutCubic;exports.easeInOutExpo=n.easeInOutExpo;exports.easeInOutQuad=n.easeInOutQuad;exports.easeInOutQuart=n.easeInOutQuart;exports.easeInOutQuint=n.easeInOutQuint;exports.easeInQuad=n.easeInQuad;exports.easeInQuart=n.easeInQuart;exports.easeInQuint=n.easeInQuint;exports.easeOutCubic=n.easeOutCubic;exports.easeOutExpo=n.easeOutExpo;exports.easeOutQuad=n.easeOutQuad;exports.easeOutQuart=n.easeOutQuart;exports.easeOutQuint=n.easeOutQuint;exports.linear=n.linear;exports.dispatchBeforeSizeChangeEvent=h.dispatchBeforeSizeChangeEvent;exports.dispatchSizeChangeEvent=h.dispatchSizeChangeEvent;exports.createJSONAndSave=I.createJSONAndSave;exports.debounce=C.debounce;exports.throttle=C.throttle;exports.setupDrag=v.setupDrag;exports.getCumulativeOffsetLeft=f.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=f.getCumulativeOffsetTop;exports.getCumulativePosition=f.getCumulativePosition;exports.calculateDistance=i.calculateDistance;exports.calculateDistanceWithRadius=i.calculateDistanceWithRadius;exports.clamp=i.clamp;exports.damp=i.damp;exports.lerp=i.lerp;exports.mapRange=i.mapRange;exports.round=i.round;exports.smootherstep=i.smootherstep;exports.smoothstep=i.smoothstep;exports.step=i.step;exports.nullishCoalescing=d.nullishCoalescing;exports.preciseNumber=d.preciseNumber;exports.roundNumberTo=d.roundNumberTo;exports.toStep=d.toStep;exports.cloneDeep=o.cloneDeep;exports.compareObjects=o.compareObjects;exports.isESClass=o.isESClass;exports.isNullish=o.isNullish;exports.isObject=o.isObject;exports.mergeDeep=o.mergeDeep;exports.mixin=o.mixin;exports.omit=o.omit;exports.pick=o.pick;exports.camelToKebab=r.camelToKebab;exports.capitalize=r.capitalize;exports.generateId=r.generateId;exports.isUppercase=r.isUppercase;exports.kebabToCamel=r.kebabToCamel;exports.snakeToDotted=r.snakeToDotted;exports.toPascalCase=r.toPascalCase;exports.uncapitalize=r.uncapitalize;exports.getElementTransitionDurationMS=O.getElementTransitionDurationMS;exports.getElementTransitionDurationS=O.getElementTransitionDurationS;exports.changeHistory=g.changeHistory;exports.normalizeBase=g.normalizeBase;exports.splitPath=g.splitPath;exports.decode=D;exports.dotCircleCollision=q;exports.dotRectCollision=T;exports.encode=Q;exports.getRootVariables=x;exports.insert=y;exports.shiftArray=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../attributes-Bf2svn4j.cjs"),S=require("../browser-CpzFX2xg.cjs"),l=require("../canvas-CU5Xjahf.cjs"),m=require("../coordinates-D8Np3cPD.cjs"),p=require("../dom-JBOkFLTh.cjs"),a=require("../easings-DsS5-Kqc.cjs"),b=require("../events-BGwqaxVW.cjs"),I=require("../file-EevnUtRj.cjs"),C=require("../function-MthRj-GJ.cjs"),y=require("../gestures-DHLrn6Q8.cjs"),f=require("../layout-8ryRAMGJ.cjs"),s=require("../math-GDWEqu7y.cjs"),d=require("../polyfills-CM4SCDTt.cjs"),r=require("../object-CCiXnER2.cjs"),u=require("../string-DhgS_iFl.cjs"),O=require("../style-At6aDoqG.cjs"),g=require("../url-C3dWnJQg.cjs");function v(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function P(t,e){const n=t.length;e=e%n;const i=new Array(n);for(let o=0;o<n;o++){const c=(o+e)%n;i[c]=t[o]}return i}function T(t,e=2){if(!+t)return"0 Bytes";const n=1024,i=e<0?0:e,o=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],c=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,c)).toFixed(i))} ${o[c]}`}function x(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function q(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function E(t,e){const n=t.styleMap.get(e);if(n){const i=n.toString();return i.startsWith("var")?E(t,i.slice(4,-1)):i}}function B(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(i=>{i instanceof CSSStyleRule&&i.selectorText===":root"&&t.forEach(o=>{const c=E(i,o);c&&(e[o]=c)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function Q(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function w(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}exports.parseAttribute=h.parseAttribute;exports.parseAttributeValue=h.parseAttributeValue;exports.isBrowser=S.isBrowser;exports.contain=l.contain;exports.cover=l.cover;exports.fixPosition=l.fixPosition;exports.measureText=l.measureText;exports.getPointerPosition=m.getPointerPosition;exports.normalize=m.normalize;exports.screenToCartesian=m.screenToCartesian;exports.findParentElement=p.findParentElement;exports.findScrollParentElement=p.findScrollParentElement;exports.getAllParentElements=p.getAllParentElements;exports.getElement=p.getElement;exports.easeInCubic=a.easeInCubic;exports.easeInExpo=a.easeInExpo;exports.easeInOutCubic=a.easeInOutCubic;exports.easeInOutExpo=a.easeInOutExpo;exports.easeInOutQuad=a.easeInOutQuad;exports.easeInOutQuart=a.easeInOutQuart;exports.easeInOutQuint=a.easeInOutQuint;exports.easeInQuad=a.easeInQuad;exports.easeInQuart=a.easeInQuart;exports.easeInQuint=a.easeInQuint;exports.easeOutCubic=a.easeOutCubic;exports.easeOutExpo=a.easeOutExpo;exports.easeOutQuad=a.easeOutQuad;exports.easeOutQuart=a.easeOutQuart;exports.easeOutQuint=a.easeOutQuint;exports.linear=a.linear;exports.dispatchBeforeSizeChangeEvent=b.dispatchBeforeSizeChangeEvent;exports.dispatchSizeChangeEvent=b.dispatchSizeChangeEvent;exports.createJSONAndSave=I.createJSONAndSave;exports.debounce=C.debounce;exports.throttle=C.throttle;exports.setupDrag=y.setupDrag;exports.getCumulativeOffsetLeft=f.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=f.getCumulativeOffsetTop;exports.getCumulativePosition=f.getCumulativePosition;exports.calculateDistance=s.calculateDistance;exports.calculateDistanceWithRadius=s.calculateDistanceWithRadius;exports.clamp=s.clamp;exports.damp=s.damp;exports.lerp=s.lerp;exports.mapRange=s.mapRange;exports.round=s.round;exports.smootherstep=s.smootherstep;exports.smoothstep=s.smoothstep;exports.step=s.step;exports.nullishCoalescing=d.nullishCoalescing;exports.preciseNumber=d.preciseNumber;exports.roundNumberTo=d.roundNumberTo;exports.toStep=d.toStep;exports.cloneDeep=r.cloneDeep;exports.compareObjects=r.compareObjects;exports.isESClass=r.isESClass;exports.isNullish=r.isNullish;exports.isObject=r.isObject;exports.mergeDeep=r.mergeDeep;exports.mixin=r.mixin;exports.omit=r.omit;exports.pick=r.pick;exports.camelToKebab=u.camelToKebab;exports.capitalize=u.capitalize;exports.generateId=u.generateId;exports.isUppercase=u.isUppercase;exports.kebabToCamel=u.kebabToCamel;exports.snakeToDotted=u.snakeToDotted;exports.toPascalCase=u.toPascalCase;exports.uncapitalize=u.uncapitalize;exports.getElementTransitionDurationMS=O.getElementTransitionDurationMS;exports.getElementTransitionDurationS=O.getElementTransitionDurationS;exports.changeHistory=g.changeHistory;exports.normalizeBase=g.normalizeBase;exports.splitPath=g.splitPath;exports.decode=w;exports.dotCircleCollision=q;exports.dotRectCollision=x;exports.encode=Q;exports.formatBytes=T;exports.getRootVariables=B;exports.insert=v;exports.shiftArray=P;
@@ -1,6 +1,7 @@
1
1
  export * from './array';
2
2
  export * from './attributes';
3
3
  export * from './browser';
4
+ export * from './bytes';
4
5
  export * from './canvas';
5
6
  export * from './collisions';
6
7
  export * from './coordinates';
@@ -1,148 +1,165 @@
1
- import { a as g, p as b } from "../attributes-69we3byR.js";
2
- import { i as C } from "../browser-0zX67oeU.js";
3
- import { a as S, c as O, f as y, m as w } from "../canvas-DeZ0SLUJ.js";
1
+ import { a as h, p as b } from "../attributes-69we3byR.js";
2
+ import { i as E } from "../browser-0zX67oeU.js";
3
+ import { a as y, c as O, f as w, m as B } from "../canvas-DeZ0SLUJ.js";
4
4
  import { g as v, n as P, s as T } from "../coordinates-CgdGoSYs.js";
5
- import { f as Q, b as D, g as R, a as z } from "../dom-P5QbAASX.js";
6
- import { c as j, n as N, f as V, p as B, b as M, i as U, m as W, e as q, g as H, j as J, d as K, o as L, a as $, h as F, k as G, l as X } from "../easings-BKi40vHz.js";
7
- import { d as Z, a as _ } from "../events-CJTUMSLU.js";
8
- import { c as ae } from "../file-lxi_oXJf.js";
9
- import { d as te, t as oe } from "../function-C10DGppn.js";
10
- import { s as re } from "../gestures-D2Fdra_G.js";
11
- import { g as ce, a as ue, b as le } from "../layout-HoBT_Da2.js";
12
- import { e as pe, f as me, c as de, d as xe, l as ge, m as be, r as he, b as Ce, a as Ee, s as Se } from "../math-BOBiC4TN.js";
13
- import { n as ye, p as we, r as Ie, t as ve } from "../polyfills-X6KXuHg-.js";
14
- import { c as Te, d as Ae, i as Qe, b as De, a as Re, m as ze, e as ke, o as je, p as Ne } from "../object-D6MVWB4l.js";
15
- import { c as Be, a as Me, g as Ue, i as We, k as qe, s as He, t as Je, u as Ke } from "../string-f0Dnk0L1.js";
16
- import { g as $e, a as Fe } from "../style-j2TwriJ_.js";
17
- import { c as Xe, n as Ye, s as Ze } from "../url-DMNfW7uN.js";
18
- function i(a, e, ...s) {
19
- return [...a.slice(0, e), ...s, ...a.slice(e)];
5
+ import { f as Q, b as D, g as M, a as R } from "../dom-P5QbAASX.js";
6
+ import { c as k, n as j, f as N, p as V, b as U, i as $, m as F, e as K, g as W, j as q, d as G, o as H, a as J, h as L, k as Y, l as Z } from "../easings-BKi40vHz.js";
7
+ import { d as _, a as ee } from "../events-CJTUMSLU.js";
8
+ import { c as te } from "../file-lxi_oXJf.js";
9
+ import { d as oe, t as ne } from "../function-C10DGppn.js";
10
+ import { s as ie } from "../gestures-D2Fdra_G.js";
11
+ import { g as ue, a as le, b as fe } from "../layout-HoBT_Da2.js";
12
+ import { e as me, f as de, c as ge, d as xe, l as he, m as be, r as Ce, b as Ee, a as Se, s as ye } from "../math-BOBiC4TN.js";
13
+ import { n as we, p as Be, r as Ie, t as ve } from "../polyfills-X6KXuHg-.js";
14
+ import { c as Te, d as Ae, i as Qe, b as De, a as Me, m as Re, e as ze, o as ke, p as je } from "../object-D6MVWB4l.js";
15
+ import { c as Ve, a as Ue, g as $e, i as Fe, k as Ke, s as We, t as qe, u as Ge } from "../string-f0Dnk0L1.js";
16
+ import { g as Je, a as Le } from "../style-j2TwriJ_.js";
17
+ import { c as Ze, n as Xe, s as _e } from "../url-DMNfW7uN.js";
18
+ function i(a, e, ...t) {
19
+ return [...a.slice(0, e), ...t, ...a.slice(e)];
20
20
  }
21
21
  function c(a, e) {
22
- const s = a.length;
23
- e = e % s;
24
- const t = new Array(s);
25
- for (let o = 0; o < s; o++) {
26
- const n = (o + e) % s;
27
- t[n] = a[o];
22
+ const t = a.length;
23
+ e = e % t;
24
+ const s = new Array(t);
25
+ for (let o = 0; o < t; o++) {
26
+ const n = (o + e) % t;
27
+ s[n] = a[o];
28
28
  }
29
- return t;
29
+ return s;
30
30
  }
31
- function u(a, e) {
32
- return a.x < e.x + e.width && a.x > e.x && a.y < e.y + e.height && a.y > e.y;
31
+ function u(a, e = 2) {
32
+ if (!+a)
33
+ return "0 Bytes";
34
+ const t = 1024, s = e < 0 ? 0 : e, o = [
35
+ "Bytes",
36
+ "KiB",
37
+ "MiB",
38
+ "GiB",
39
+ "TiB",
40
+ "PiB",
41
+ "EiB",
42
+ "ZiB",
43
+ "YiB"
44
+ ], n = Math.floor(Math.log(a) / Math.log(t));
45
+ return `${parseFloat((a / Math.pow(t, n)).toFixed(s))} ${o[n]}`;
33
46
  }
34
47
  function l(a, e) {
48
+ return a.x < e.x + e.width && a.x > e.x && a.y < e.y + e.height && a.y > e.y;
49
+ }
50
+ function f(a, e) {
35
51
  return Math.sqrt((a.x - e.x) ** 2 + (a.y - e.y) ** 2) < e.radius;
36
52
  }
37
53
  function r(a, e) {
38
- const s = a.styleMap.get(e);
39
- if (s) {
40
- const t = s.toString();
41
- return t.startsWith("var") ? r(a, t.slice(4, -1)) : t;
54
+ const t = a.styleMap.get(e);
55
+ if (t) {
56
+ const s = t.toString();
57
+ return s.startsWith("var") ? r(a, s.slice(4, -1)) : s;
42
58
  }
43
59
  }
44
- function f(...a) {
60
+ function p(...a) {
45
61
  const e = {};
46
- return Array.from(document.styleSheets).forEach((s) => {
47
- Array.from(s.cssRules).forEach((t) => {
48
- t instanceof CSSStyleRule && t.selectorText === ":root" && a.forEach((o) => {
49
- const n = r(t, o);
62
+ return Array.from(document.styleSheets).forEach((t) => {
63
+ Array.from(t.cssRules).forEach((s) => {
64
+ s instanceof CSSStyleRule && s.selectorText === ":root" && a.forEach((o) => {
65
+ const n = r(s, o);
50
66
  n && (e[o] = n);
51
67
  });
52
68
  });
53
- }), a.forEach((s) => {
54
- e[s] || console.warn(`variable named ${s} not found`);
69
+ }), a.forEach((t) => {
70
+ e[t] || console.warn(`variable named ${t} not found`);
55
71
  }), e;
56
72
  }
57
- function p(a) {
73
+ function m(a) {
58
74
  const e = window.atob(a);
59
75
  return decodeURIComponent(window.escape(e));
60
76
  }
61
- function m(a) {
77
+ function d(a) {
62
78
  const e = window.unescape(encodeURIComponent(a));
63
79
  return window.btoa(e);
64
80
  }
65
81
  export {
66
- pe as calculateDistance,
67
- me as calculateDistanceWithRadius,
68
- Be as camelToKebab,
69
- Me as capitalize,
70
- Xe as changeHistory,
71
- de as clamp,
82
+ me as calculateDistance,
83
+ de as calculateDistanceWithRadius,
84
+ Ve as camelToKebab,
85
+ Ue as capitalize,
86
+ Ze as changeHistory,
87
+ ge as clamp,
72
88
  Te as cloneDeep,
73
89
  Ae as compareObjects,
74
- S as contain,
90
+ y as contain,
75
91
  O as cover,
76
- ae as createJSONAndSave,
92
+ te as createJSONAndSave,
77
93
  xe as damp,
78
- te as debounce,
79
- m as decode,
80
- Z as dispatchBeforeSizeChangeEvent,
81
- _ as dispatchSizeChangeEvent,
82
- l as dotCircleCollision,
83
- u as dotRectCollision,
84
- j as easeInCubic,
85
- N as easeInExpo,
86
- V as easeInOutCubic,
87
- B as easeInOutExpo,
88
- M as easeInOutQuad,
89
- U as easeInOutQuart,
90
- W as easeInOutQuint,
91
- q as easeInQuad,
92
- H as easeInQuart,
93
- J as easeInQuint,
94
- K as easeOutCubic,
95
- L as easeOutExpo,
96
- $ as easeOutQuad,
97
- F as easeOutQuart,
98
- G as easeOutQuint,
99
- p as encode,
94
+ oe as debounce,
95
+ d as decode,
96
+ _ as dispatchBeforeSizeChangeEvent,
97
+ ee as dispatchSizeChangeEvent,
98
+ f as dotCircleCollision,
99
+ l as dotRectCollision,
100
+ k as easeInCubic,
101
+ j as easeInExpo,
102
+ N as easeInOutCubic,
103
+ V as easeInOutExpo,
104
+ U as easeInOutQuad,
105
+ $ as easeInOutQuart,
106
+ F as easeInOutQuint,
107
+ K as easeInQuad,
108
+ W as easeInQuart,
109
+ q as easeInQuint,
110
+ G as easeOutCubic,
111
+ H as easeOutExpo,
112
+ J as easeOutQuad,
113
+ L as easeOutQuart,
114
+ Y as easeOutQuint,
115
+ m as encode,
100
116
  Q as findParentElement,
101
117
  D as findScrollParentElement,
102
- y as fixPosition,
103
- Ue as generateId,
104
- R as getAllParentElements,
105
- ce as getCumulativeOffsetLeft,
106
- ue as getCumulativeOffsetTop,
107
- le as getCumulativePosition,
108
- z as getElement,
109
- $e as getElementTransitionDurationMS,
110
- Fe as getElementTransitionDurationS,
118
+ w as fixPosition,
119
+ u as formatBytes,
120
+ $e as generateId,
121
+ M as getAllParentElements,
122
+ ue as getCumulativeOffsetLeft,
123
+ le as getCumulativeOffsetTop,
124
+ fe as getCumulativePosition,
125
+ R as getElement,
126
+ Je as getElementTransitionDurationMS,
127
+ Le as getElementTransitionDurationS,
111
128
  v as getPointerPosition,
112
- f as getRootVariables,
129
+ p as getRootVariables,
113
130
  i as insert,
114
- C as isBrowser,
131
+ E as isBrowser,
115
132
  Qe as isESClass,
116
133
  De as isNullish,
117
- Re as isObject,
118
- We as isUppercase,
119
- qe as kebabToCamel,
120
- ge as lerp,
121
- X as linear,
134
+ Me as isObject,
135
+ Fe as isUppercase,
136
+ Ke as kebabToCamel,
137
+ he as lerp,
138
+ Z as linear,
122
139
  be as mapRange,
123
- w as measureText,
124
- ze as mergeDeep,
125
- ke as mixin,
140
+ B as measureText,
141
+ Re as mergeDeep,
142
+ ze as mixin,
126
143
  P as normalize,
127
- Ye as normalizeBase,
128
- ye as nullishCoalescing,
129
- je as omit,
130
- g as parseAttribute,
144
+ Xe as normalizeBase,
145
+ we as nullishCoalescing,
146
+ ke as omit,
147
+ h as parseAttribute,
131
148
  b as parseAttributeValue,
132
- Ne as pick,
133
- we as preciseNumber,
134
- he as round,
149
+ je as pick,
150
+ Be as preciseNumber,
151
+ Ce as round,
135
152
  Ie as roundNumberTo,
136
153
  T as screenToCartesian,
137
- re as setupDrag,
154
+ ie as setupDrag,
138
155
  c as shiftArray,
139
- Ce as smootherstep,
140
- Ee as smoothstep,
141
- He as snakeToDotted,
142
- Ze as splitPath,
143
- Se as step,
144
- oe as throttle,
145
- Je as toPascalCase,
156
+ Ee as smootherstep,
157
+ Se as smoothstep,
158
+ We as snakeToDotted,
159
+ _e as splitPath,
160
+ ye as step,
161
+ ne as throttle,
162
+ qe as toPascalCase,
146
163
  ve as toStep,
147
- Ke as uncapitalize
164
+ Ge as uncapitalize
148
165
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../custom-element/index.cjs");require("../window-resizer/index.cjs");require("../Store-Cr3VaD9G.cjs");const v=require("../source/index.cjs"),d=require("../ticker/index.cjs");var E=Object.defineProperty,f=Object.getOwnPropertyDescriptor,_=(t,e,r,i)=>{for(var s=i>1?void 0:i?f(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(s=(i?u(e,r,s):u(s))||s);return i&&s&&E(e,r,s),s},p=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},n=(t,e,r)=>(p(t,e,"read from private field"),r?r.call(t):e.get(t)),l=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},h=(t,e,r,i)=>(p(t,e,"write to private field"),e.set(t,r),r),a,c;exports.VideoElement=class extends v.SourceElement{constructor(){super(...arguments),l(this,a,0),l(this,c,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const e=this.consumerElement.readyState/4;e>n(this,a)&&h(this,a,e),this.dispatchEvent(new CustomEvent("readyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:n(this,a)}})),this.consumerElement.readyState===4&&d.ticker.unsubscribe(n(this,c))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{d.ticker.subscribe(n(this,c)),this.hasAttribute("capture-autoplay")&&this.consumerElement.play()}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0)),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")})}disconnectedCallback(){super.disconnectedCallback(),d.ticker.unsubscribe(n(this,c)),h(this,a,0)}createConsumer(){return document.createElement("video")}consumeSource(e){this.consumerElement.src=e||""}};a=new WeakMap;c=new WeakMap;exports.VideoElement=_([m.define("e-video")],exports.VideoElement);
1
+ "use strict";var l=(t,s,e)=>{if(!s.has(t))throw TypeError("Cannot "+e)};var i=(t,s,e)=>(l(t,s,"read from private field"),e?e.call(t):s.get(t)),n=(t,s,e)=>{if(s.has(t))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(t):s.set(t,e)},c=(t,s,e,o)=>(l(t,s,"write to private field"),o?o.call(t,e):s.set(t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../window-resizer/index.cjs");require("../Store-Cr3VaD9G.cjs");const h=require("../source/index.cjs"),u=require("../ticker/index.cjs");var r,a;class d extends h.SourceElement{constructor(){super(...arguments);n(this,r,0);n(this,a,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const e=this.consumerElement.readyState/4;e>i(this,r)&&c(this,r,e),this.dispatchEvent(new CustomEvent("readyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:i(this,r)}})),this.consumerElement.readyState===4&&u.ticker.unsubscribe(i(this,a))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{u.ticker.subscribe(i(this,a)),this.hasAttribute("capture-autoplay")&&this.consumerElement.play()}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0)),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")})}disconnectedCallback(){super.disconnectedCallback(),u.ticker.unsubscribe(i(this,a)),c(this,r,0)}createConsumer(){return document.createElement("video")}consumeSource(e){this.consumerElement.src=e||""}}r=new WeakMap,a=new WeakMap;customElements.get("e-video")||customElements.define("e-video",d);exports.VideoElement=d;
@@ -1,38 +1,37 @@
1
- import { define as v } from "../custom-element/index.js";
1
+ var m = (t, s, e) => {
2
+ if (!s.has(t))
3
+ throw TypeError("Cannot " + e);
4
+ };
5
+ var i = (t, s, e) => (m(t, s, "read from private field"), e ? e.call(t) : s.get(t)), n = (t, s, e) => {
6
+ if (s.has(t))
7
+ throw TypeError("Cannot add the same private member more than once");
8
+ s instanceof WeakSet ? s.add(t) : s.set(t, e);
9
+ }, c = (t, s, e, u) => (m(t, s, "write to private field"), u ? u.call(t, e) : s.set(t, e), e);
2
10
  import "../window-resizer/index.js";
3
11
  import "../Store-Qr3SNOSf.js";
4
- import { SourceElement as f } from "../source/index.js";
5
- import { ticker as h } from "../ticker/index.js";
6
- var E = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, y = (e, t, s, i) => {
7
- for (var r = i > 1 ? void 0 : i ? _(t, s) : t, o = e.length - 1, u; o >= 0; o--)
8
- (u = e[o]) && (r = (i ? u(t, s, r) : u(r)) || r);
9
- return i && r && E(t, s, r), r;
10
- }, m = (e, t, s) => {
11
- if (!t.has(e))
12
- throw TypeError("Cannot " + s);
13
- }, n = (e, t, s) => (m(e, t, "read from private field"), s ? s.call(e) : t.get(e)), l = (e, t, s) => {
14
- if (t.has(e))
15
- throw TypeError("Cannot add the same private member more than once");
16
- t instanceof WeakSet ? t.add(e) : t.set(e, s);
17
- }, d = (e, t, s, i) => (m(e, t, "write to private field"), t.set(e, s), s), a, c;
18
- let p = class extends f {
12
+ import { SourceElement as h } from "../source/index.js";
13
+ import { ticker as o } from "../ticker/index.js";
14
+ var r, a;
15
+ class l extends h {
19
16
  constructor() {
20
- super(...arguments), l(this, a, 0), l(this, c, () => {
17
+ super(...arguments);
18
+ n(this, r, 0);
19
+ n(this, a, () => {
21
20
  this.classList.add(`state-${this.consumerElement.readyState}`);
22
21
  const e = this.consumerElement.readyState / 4;
23
- e > n(this, a) && d(this, a, e), this.dispatchEvent(
22
+ e > i(this, r) && c(this, r, e), this.dispatchEvent(
24
23
  new CustomEvent("readyStateChange", {
25
24
  detail: {
26
25
  readyState: this.consumerElement.readyState,
27
- progress: n(this, a)
26
+ progress: i(this, r)
28
27
  }
29
28
  })
30
- ), this.consumerElement.readyState === 4 && h.unsubscribe(n(this, c));
29
+ ), this.consumerElement.readyState === 4 && o.unsubscribe(i(this, a));
31
30
  });
32
31
  }
33
32
  connectedCallback() {
34
33
  super.connectedCallback(), this.addEventListener("sourceCapture", () => {
35
- h.subscribe(n(this, c)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
34
+ o.subscribe(i(this, a)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
36
35
  }), this.addEventListener("sourceRelease", () => {
37
36
  this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0)), this.hasAttribute("reload-source") && this.classList.remove(
38
37
  "state-0",
@@ -44,7 +43,7 @@ let p = class extends f {
44
43
  });
45
44
  }
46
45
  disconnectedCallback() {
47
- super.disconnectedCallback(), h.unsubscribe(n(this, c)), d(this, a, 0);
46
+ super.disconnectedCallback(), o.unsubscribe(i(this, a)), c(this, r, 0);
48
47
  }
49
48
  createConsumer() {
50
49
  return document.createElement("video");
@@ -52,12 +51,9 @@ let p = class extends f {
52
51
  consumeSource(e) {
53
52
  this.consumerElement.src = e || "";
54
53
  }
55
- };
56
- a = /* @__PURE__ */ new WeakMap();
57
- c = /* @__PURE__ */ new WeakMap();
58
- p = y([
59
- v("e-video")
60
- ], p);
54
+ }
55
+ r = new WeakMap(), a = new WeakMap();
56
+ customElements.get("e-video") || customElements.define("e-video", l);
61
57
  export {
62
- p as VideoElement
58
+ l as VideoElement
63
59
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.8.4",
3
+ "version": "0.10.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -73,11 +73,6 @@
73
73
  "default": "./lib/css-value-parser/index.js",
74
74
  "types": "./lib/css-value-parser/index.d.ts"
75
75
  },
76
- "./custom-element": {
77
- "require": "./lib/custom-element/index.cjs",
78
- "default": "./lib/custom-element/index.js",
79
- "types": "./lib/custom-element/index.d.ts"
80
- },
81
76
  "./dev": {
82
77
  "require": "./lib/dev/index.cjs",
83
78
  "default": "./lib/dev/index.js",
@@ -138,6 +133,51 @@
138
133
  "default": "./lib/intersector/index.js",
139
134
  "types": "./lib/intersector/index.d.ts"
140
135
  },
136
+ "./jsx": {
137
+ "require": "./lib/jsx/index.cjs",
138
+ "default": "./lib/jsx/index.js",
139
+ "types": "./lib/jsx/index.d.ts"
140
+ },
141
+ "./jsx/hooks/animation": {
142
+ "require": "./lib/jsx/hooks/animation/index.cjs",
143
+ "default": "./lib/jsx/hooks/animation/index.js",
144
+ "types": "./lib/jsx/hooks/animation/index.d.ts"
145
+ },
146
+ "./jsx/hooks/store": {
147
+ "require": "./lib/jsx/hooks/store/index.cjs",
148
+ "default": "./lib/jsx/hooks/store/index.js",
149
+ "types": "./lib/jsx/hooks/store/index.d.ts"
150
+ },
151
+ "./jsx/hooks/onAnimationFrame": {
152
+ "require": "./lib/jsx/hooks/onAnimationFrame.cjs",
153
+ "default": "./lib/jsx/hooks/onAnimationFrame.js",
154
+ "types": "./lib/jsx/hooks/onAnimationFrame.d.ts"
155
+ },
156
+ "./jsx/hooks/onElementResize": {
157
+ "require": "./lib/jsx/hooks/onElementResize.cjs",
158
+ "default": "./lib/jsx/hooks/onElementResize.js",
159
+ "types": "./lib/jsx/hooks/onElementResize.d.ts"
160
+ },
161
+ "./jsx/hooks/onIntersection": {
162
+ "require": "./lib/jsx/hooks/onIntersection.cjs",
163
+ "default": "./lib/jsx/hooks/onIntersection.js",
164
+ "types": "./lib/jsx/hooks/onIntersection.d.ts"
165
+ },
166
+ "./jsx/hooks/onWindowResize": {
167
+ "require": "./lib/jsx/hooks/onWindowResize.cjs",
168
+ "default": "./lib/jsx/hooks/onWindowResize.js",
169
+ "types": "./lib/jsx/hooks/onWindowResize.d.ts"
170
+ },
171
+ "./jsx/hooks/watchAttribute": {
172
+ "require": "./lib/jsx/hooks/watchAttribute.cjs",
173
+ "default": "./lib/jsx/hooks/watchAttribute.js",
174
+ "types": "./lib/jsx/hooks/watchAttribute.d.ts"
175
+ },
176
+ "./jsx/hooks/watchCSSProperty": {
177
+ "require": "./lib/jsx/hooks/watchCSSProperty.cjs",
178
+ "default": "./lib/jsx/hooks/watchCSSProperty.js",
179
+ "types": "./lib/jsx/hooks/watchCSSProperty.d.ts"
180
+ },
141
181
  "./ladder": {
142
182
  "require": "./lib/ladder/index.cjs",
143
183
  "default": "./lib/ladder/index.js",
@@ -302,9 +342,6 @@
302
342
  "css-value-parser": [
303
343
  "lib/css-value-parser/index.d.ts"
304
344
  ],
305
- "custom-element": [
306
- "lib/custom-element/index.d.ts"
307
- ],
308
345
  "dev": [
309
346
  "lib/dev/index.d.ts"
310
347
  ],
@@ -341,6 +378,33 @@
341
378
  "intersector": [
342
379
  "lib/intersector/index.d.ts"
343
380
  ],
381
+ "jsx": [
382
+ "lib/jsx/index.d.ts"
383
+ ],
384
+ "jsx/hooks/animation": [
385
+ "lib/jsx/hooks/animation/index.d.ts"
386
+ ],
387
+ "jsx/hooks/store": [
388
+ "lib/jsx/hooks/store/index.d.ts"
389
+ ],
390
+ "jsx/hooks/onAnimationFrame": [
391
+ "lib/jsx/hooks/onAnimationFrame.d.ts"
392
+ ],
393
+ "jsx/hooks/onElementResize": [
394
+ "lib/jsx/hooks/onElementResize.d.ts"
395
+ ],
396
+ "jsx/hooks/onIntersection": [
397
+ "lib/jsx/hooks/onIntersection.d.ts"
398
+ ],
399
+ "jsx/hooks/onWindowResize": [
400
+ "lib/jsx/hooks/onWindowResize.d.ts"
401
+ ],
402
+ "jsx/hooks/watchAttribute": [
403
+ "lib/jsx/hooks/watchAttribute.d.ts"
404
+ ],
405
+ "jsx/hooks/watchCSSProperty": [
406
+ "lib/jsx/hooks/watchCSSProperty.d.ts"
407
+ ],
344
408
  "ladder": [
345
409
  "lib/ladder/index.d.ts"
346
410
  ],
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../browser-CpzFX2xg.cjs");function n(t,e){return function(s){o.isBrowser&&!customElements.get(t)&&customElements.define(t,s,{extends:e})}}function i(t,e,s){o.isBrowser&&!customElements.get(t)&&customElements.define(t,e,{extends:s})}const d=o.isBrowser?window.HTMLElement:class{attachShadow(){}};class r extends d{openShadow(...e){if(!this.shadowRoot&&o.isBrowser){const s=this.attachShadow({mode:"open"});return this.addStylesheet(...e),s}return this.shadowRoot}addStylesheet(...e){this.shadowRoot&&o.isBrowser&&this.shadowRoot.adoptedStyleSheets.push(...e)}}exports.CustomElement=r;exports.define=n;exports.defineElement=i;
@@ -1,8 +0,0 @@
1
- export declare function define(name: string, extend?: keyof HTMLElementTagNameMap): (Constructor: CustomElementConstructor) => void;
2
- export declare function defineElement(name: string, Constructor: CustomElementConstructor, extend?: keyof HTMLElementTagNameMap): void;
3
- declare const HTMLElement: typeof window.HTMLElement;
4
- export declare class CustomElement extends HTMLElement {
5
- openShadow(...stylesheets: Array<CSSStyleSheet>): ShadowRoot;
6
- addStylesheet(...stylesheets: Array<CSSStyleSheet>): void;
7
- }
8
- export {};
@@ -1,30 +0,0 @@
1
- import { i as o } from "../browser-0zX67oeU.js";
2
- function i(e, t) {
3
- return function(s) {
4
- o && !customElements.get(e) && customElements.define(e, s, { extends: t });
5
- };
6
- }
7
- function h(e, t, s) {
8
- o && !customElements.get(e) && customElements.define(e, t, { extends: s });
9
- }
10
- const n = o ? window.HTMLElement : class {
11
- attachShadow() {
12
- }
13
- };
14
- class a extends n {
15
- openShadow(...t) {
16
- if (!this.shadowRoot && o) {
17
- const s = this.attachShadow({ mode: "open" });
18
- return this.addStylesheet(...t), s;
19
- }
20
- return this.shadowRoot;
21
- }
22
- addStylesheet(...t) {
23
- this.shadowRoot && o && this.shadowRoot.adoptedStyleSheets.push(...t);
24
- }
25
- }
26
- export {
27
- a as CustomElement,
28
- i as define,
29
- h as defineElement
30
- };
@@ -1,9 +0,0 @@
1
- "use strict";var z=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)};var D=(t,e,s)=>(z(t,e,"read from private field"),s?s.call(t):e.get(t)),A=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},H=(t,e,s,n)=>(z(t,e,"write to private field"),n?n.call(t,s):e.set(t,s),s);const y=require("./custom-element/index.cjs");require("./Store-Cr3VaD9G.cjs");const M=require("./browser-CpzFX2xg.cjs"),R=require("./events-BGwqaxVW.cjs"),N=require("./style-At6aDoqG.cjs"),a=require("./tags-CAfasCGV.cjs"),W=require("./createStylesheet-BsMSWX0q.cjs"),V=require("./theme/index.cjs");var Y=Object.defineProperty,Z=Object.getOwnPropertyDescriptor,J=(t,e,s,n)=>{for(var i=n>1?void 0:n?Z(e,s):e,l=t.length-1,o;l>=0;l--)(o=t[l])&&(i=(n?o(e,s,i):o(i))||i);return n&&i&&Y(e,s,i),i},P=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},r=(t,e,s)=>(P(t,e,"read from private field"),s?s.call(t):e.get(t)),c=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},d=(t,e,s,n)=>(P(t,e,"write to private field"),e.set(t,s),s),I=(t,e,s)=>(P(t,e,"access private method"),s),u,f,h,v,g,m,$,S,b;const Q=W.createStylesheet({":host":{position:"relative"},".head":{width:"100%",cursor:"default",background:"none",border:"none",color:"inherit",fontFamily:"inherit",fontSize:"inherit",fontWeight:"inherit",textAlign:"start",padding:"0",margin:"0"},".body":{boxSizing:"border-box",position:"var(--position, unset)",top:"100%",left:"0",width:"100%",overflow:"hidden",transitionDuration:"var(--duration, var(--duration-short))",transitionProperty:"height",cursor:"default"},".body-inner":{display:"grid",gap:"var(--gap, 0px)",width:"100%",paddingTop:"var(--gap, 0px)"}});exports.SelectElement=class extends y.CustomElement{constructor(){super(),c(this,S),c(this,u,null),c(this,f,""),c(this,h,null),c(this,v,!1),c(this,g,void 0),c(this,m,null),c(this,$,()=>{R.dispatchSizeChangeEvent(this)}),M.isBrowser&&(this.openShadow(Q),d(this,u,this.attachInternals()),d(this,m,new ResizeObserver(r(this,$))),a.element(this,{children:[a.button({class:"head",children:a.slot({name:"head"}),onClick:()=>{this.opened?this.close():this.open()}}),a.div({class:"body",style:{height:"0px"},children:a.div({class:"body-inner",children:a.slot()}),ref:e=>{d(this,h,e)}})]}))}get value(){return r(this,f)}set value(e){d(this,f,e),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),r(this,u).setFormValue(r(this,f))}get internals(){return r(this,u)}get opened(){return r(this,v)}open(){clearTimeout(r(this,g)),d(this,v,!0),r(this,h).style.display="grid",this.classList.add("triggered"),setTimeout(()=>{this.classList.add("opened"),r(this,h).style.height=r(this,h).scrollHeight+"px",I(this,S,b).call(this)},0)}close(){d(this,v,!1),r(this,h).style.height="0px",this.classList.remove("opened"),I(this,S,b).call(this),d(this,g,setTimeout(()=>{this.classList.remove("triggered"),r(this,h).style.display="none"},N.getElementTransitionDurationMS(r(this,h))))}connectedCallback(){r(this,m).observe(r(this,h))}disconnectedCallback(){clearTimeout(r(this,g)),r(this,m).disconnect()}};u=new WeakMap;f=new WeakMap;h=new WeakMap;v=new WeakMap;g=new WeakMap;m=new WeakMap;$=new WeakMap;S=new WeakSet;b=function(){R.dispatchBeforeSizeChangeEvent(this),this.dispatchEvent(new CustomEvent("selectToggle",{bubbles:!0,composed:!0,detail:{opened:r(this,v)}}))};exports.SelectElement.formAssociated=!0;exports.SelectElement=J([y.define("e-select")],exports.SelectElement);var E;class q extends y.CustomElement{constructor(){super(...arguments);A(this,E,null)}get selectElement(){return D(this,E)}connectedCallback(){var n,i;const s=(i=(n=this.assignedSlot)==null?void 0:n.getRootNode())==null?void 0:i.host;s?H(this,E,s):console.log(this,"e-select not found")}}E=new WeakMap;var X=Object.defineProperty,j=Object.getOwnPropertyDescriptor,ee=(t,e,s,n)=>{for(var i=n>1?void 0:n?j(e,s):e,l=t.length-1,o;l>=0;l--)(o=t[l])&&(i=(n?o(e,s,i):o(i))||i);return n&&i&&X(e,s,i),i},F=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},k=(t,e,s)=>(F(t,e,"read from private field"),s?s.call(t):e.get(t)),B=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},G=(t,e,s)=>(F(t,e,"access private method"),s),w,C,L;const te=W.createStylesheet({":host":{width:"100%",height:"40px",display:"inline-flex",alignItems:"center"}});exports.SelectOptionElement=class extends q{constructor(){super(),B(this,C),B(this,w,()=>{this.selectElement.value===this.value?this.style.display="none":this.style.display=""}),M.isBrowser&&(this.openShadow(te),a.element(this,{tabindex:0,onClick:()=>{G(this,C,L).call(this)},onKeydown:e=>{e.code==="Space"&&G(this,C,L).call(this)},children:a.slot()}))}get value(){return(this.hasAttribute("value")?this.getAttribute("value"):this.innerText)||""}connectedCallback(){super.connectedCallback(),this.hasAttribute("default")&&(this.selectElement.value||(this.selectElement.value=this.value)),this.selectElement.addEventListener("change",k(this,w)),setTimeout(()=>{k(this,w).call(this)})}disconnectedCallback(){this.selectElement.removeEventListener("change",k(this,w))}};w=new WeakMap;C=new WeakSet;L=function(){this.selectElement.value=this.value,this.selectElement.close()};exports.SelectOptionElement=ee([y.define("e-select-option")],exports.SelectOptionElement);const U=`<svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- width="32"
4
- height="32"
5
- viewBox="0 0 24 24"
6
- >
7
- <path d="m12.37 15.835l6.43-6.63C19.201 8.79 18.958 8 18.43 8H5.57c-.528 0-.771.79-.37 1.205l6.43 6.63c.213.22.527.22.74 0Z" />
8
- </svg>
9
- `;var se=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ne=(t,e,s,n)=>{for(var i=n>1?void 0:n?ie(e,s):e,l=t.length-1,o;l>=0;l--)(o=t[l])&&(i=(n?o(e,s,i):o(i))||i);return n&&i&&se(e,s,i),i},K=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},p=(t,e,s)=>(K(t,e,"read from private field"),s?s.call(t):e.get(t)),O=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},re=(t,e,s,n)=>(K(t,e,"write to private field"),e.set(t,s),s),x,_,T;const ae=W.createStylesheet({":host":{width:"100%",height:"40px",display:"inline-flex",alignItems:"center",justifyContent:"space-between"},".default-arrow":{flexShrink:"0",width:"var(--arrow-size, 1em)",height:"var(--arrow-size, 1em)",fill:`var(--arrow-color, ${V.aptechkaTheme.colorMain.var})`,transitionProperty:"transform",transitionDuration:"var(--duration, var(--duration-short))"},":host(.opened) .default-arrow":{transform:"scaleY(-1)"}});exports.SelectHeadElement=class extends q{constructor(){super(),O(this,x,null),O(this,_,()=>{const s=this.selectElement.shadowRoot.querySelector(".body slot").assignedElements().find(n=>n.value===this.selectElement.value);s&&(p(this,x).innerHTML=s.innerHTML)}),O(this,T,()=>{this.classList.toggle("opened",this.selectElement.opened)}),M.isBrowser&&(this.openShadow(ae),a.element(this,{children:[a.slot(),a.slot({name:"arrow",children:a.element(U,{class:"default-arrow"})})]}),this.slot="head")}connectedCallback(){super.connectedCallback(),re(this,x,this.querySelector("[data-value-holder]")||this),this.selectElement.addEventListener("change",p(this,_)),p(this,_).call(this),this.selectElement.addEventListener("selectToggle",p(this,T))}disconnectedCallback(){this.selectElement.removeEventListener("change",p(this,_)),this.selectElement.removeEventListener("selectToggle",p(this,T))}};x=new WeakMap;_=new WeakMap;T=new WeakMap;exports.SelectHeadElement=ne([y.define("e-select-head")],exports.SelectHeadElement);exports.SelectUserElement=q;exports.arrowIcon=U;