@milaboratories/uikit 2.6.1 → 2.6.3

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 (215) hide show
  1. package/.turbo/turbo-build.log +143 -143
  2. package/.turbo/turbo-type-check.log +1 -1
  3. package/CHANGELOG.md +14 -0
  4. package/dist/base/BtnBase.vue.js +18 -18
  5. package/dist/base/BtnBase.vue.js.map +1 -1
  6. package/dist/components/ContextProvider.vue.js.map +1 -1
  7. package/dist/components/DataTable/BaseCellComponent.vue.js +20 -20
  8. package/dist/components/DataTable/BaseCellComponent.vue.js.map +1 -1
  9. package/dist/components/DataTable/ColumnCaret.vue.js +6 -6
  10. package/dist/components/DataTable/ColumnCaret.vue.js.map +1 -1
  11. package/dist/components/DataTable/ColumnsCommandMenu.vue.js.map +1 -1
  12. package/dist/components/DataTable/RowsCommandMenu.vue.js.map +1 -1
  13. package/dist/components/DataTable/TScroll.vue.js +12 -12
  14. package/dist/components/DataTable/TScroll.vue.js.map +1 -1
  15. package/dist/components/DataTable/TableComponent.vue.js +5 -3
  16. package/dist/components/DataTable/TableComponent.vue.js.map +1 -1
  17. package/dist/components/DataTable/TdCell.vue.js +36 -36
  18. package/dist/components/DataTable/TdCell.vue.js.map +1 -1
  19. package/dist/components/DataTable/ThCell.vue.js +27 -27
  20. package/dist/components/DataTable/ThCell.vue.js.map +1 -1
  21. package/dist/components/DataTable/TrBody.vue.js +12 -12
  22. package/dist/components/DataTable/TrBody.vue.js.map +1 -1
  23. package/dist/components/DataTable/TrHead.vue.js.map +1 -1
  24. package/dist/components/DataTable/assets/TableIcon.vue.js +2 -2
  25. package/dist/components/DataTable/assets/TableIcon.vue.js.map +1 -1
  26. package/dist/components/DropdownListItem.vue.js +18 -18
  27. package/dist/components/DropdownListItem.vue.js.map +1 -1
  28. package/dist/components/HScroll.vue.js.map +1 -1
  29. package/dist/components/InputRange.vue.js.map +1 -1
  30. package/dist/components/LongText.vue.js +1 -1
  31. package/dist/components/LongText.vue.js.map +1 -1
  32. package/dist/components/LongText.vue3.js +1 -1
  33. package/dist/components/PlAccordion/ExpandTransition.vue.js.map +1 -1
  34. package/dist/components/PlAccordion/ExpandTransition.vue2.js.map +1 -1
  35. package/dist/components/PlAccordion/ExpandTransition.vue3.js +1 -1
  36. package/dist/components/PlAccordion/PlAccordion.vue.js.map +1 -1
  37. package/dist/components/PlAccordion/PlAccordionSection.vue2.js +21 -21
  38. package/dist/components/PlAccordion/PlAccordionSection.vue2.js.map +1 -1
  39. package/dist/components/PlAlert/PlAlert.vue.js +23 -23
  40. package/dist/components/PlAlert/PlAlert.vue.js.map +1 -1
  41. package/dist/components/PlAutocomplete/PlAutocomplete.vue.d.ts +4 -0
  42. package/dist/components/PlAutocomplete/PlAutocomplete.vue.js +112 -106
  43. package/dist/components/PlAutocomplete/PlAutocomplete.vue.js.map +1 -1
  44. package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.d.ts +4 -0
  45. package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.js +100 -94
  46. package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.js.map +1 -1
  47. package/dist/components/PlBtnAccent/PlBtnAccent.vue.js.map +1 -1
  48. package/dist/components/PlBtnDanger/PlBtnDanger.vue.js.map +1 -1
  49. package/dist/components/PlBtnGhost/PlBtnGhost.vue.js +21 -21
  50. package/dist/components/PlBtnGhost/PlBtnGhost.vue.js.map +1 -1
  51. package/dist/components/PlBtnGroup/PlBtnGroup.vue.js +34 -34
  52. package/dist/components/PlBtnGroup/PlBtnGroup.vue.js.map +1 -1
  53. package/dist/components/PlBtnLink/PlBtnLink.vue.js +12 -12
  54. package/dist/components/PlBtnLink/PlBtnLink.vue.js.map +1 -1
  55. package/dist/components/PlBtnPrimary/PlBtnPrimary.vue.js.map +1 -1
  56. package/dist/components/PlBtnSecondary/PlBtnSecondary.vue.js.map +1 -1
  57. package/dist/components/PlBtnSplit/PlBtnSplit.vue.js +31 -31
  58. package/dist/components/PlBtnSplit/PlBtnSplit.vue.js.map +1 -1
  59. package/dist/components/PlChartHistogram/PlChartHistogram.vue2.js +18 -18
  60. package/dist/components/PlChartHistogram/PlChartHistogram.vue2.js.map +1 -1
  61. package/dist/components/PlChartStackedBar/Legends.vue2.js.map +1 -1
  62. package/dist/components/PlChartStackedBar/PlChartStackedBar.vue2.js +15 -15
  63. package/dist/components/PlChartStackedBar/PlChartStackedBar.vue2.js.map +1 -1
  64. package/dist/components/PlChartStackedBar/PlChartStackedBarCompact.vue2.js.map +1 -1
  65. package/dist/components/PlChartStackedBar/StackedRow.vue2.js.map +1 -1
  66. package/dist/components/PlChartStackedBar/StackedRowCompact.vue2.js.map +1 -1
  67. package/dist/components/PlCheckbox/PlCheckbox.vue.js +13 -13
  68. package/dist/components/PlCheckbox/PlCheckbox.vue.js.map +1 -1
  69. package/dist/components/PlCheckbox/PlCheckboxBase.vue.js +6 -6
  70. package/dist/components/PlCheckbox/PlCheckboxBase.vue.js.map +1 -1
  71. package/dist/components/PlCheckboxGroup/PlCheckboxGroup.vue.js +28 -28
  72. package/dist/components/PlCheckboxGroup/PlCheckboxGroup.vue.js.map +1 -1
  73. package/dist/components/PlChip/PlChip.vue.js +20 -20
  74. package/dist/components/PlChip/PlChip.vue.js.map +1 -1
  75. package/dist/components/PlClipboard/PlClipboard.vue2.js.map +1 -1
  76. package/dist/components/PlConfirmDialog.vue.js +14 -14
  77. package/dist/components/PlConfirmDialog.vue.js.map +1 -1
  78. package/dist/components/PlDialogModal/PlDialogModal.vue.js +30 -30
  79. package/dist/components/PlDialogModal/PlDialogModal.vue.js.map +1 -1
  80. package/dist/components/PlDropdown/OptionList.vue.js +40 -40
  81. package/dist/components/PlDropdown/OptionList.vue.js.map +1 -1
  82. package/dist/components/PlDropdown/PlDropdown.vue.d.ts +8 -0
  83. package/dist/components/PlDropdown/PlDropdown.vue.js +102 -95
  84. package/dist/components/PlDropdown/PlDropdown.vue.js.map +1 -1
  85. package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js +95 -93
  86. package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js.map +1 -1
  87. package/dist/components/PlDropdownLine/PlDropdownLine.vue.d.ts +1 -1
  88. package/dist/components/PlDropdownLine/PlDropdownLine.vue.js +4 -4
  89. package/dist/components/PlDropdownLine/PlDropdownLine.vue.js.map +1 -1
  90. package/dist/components/PlDropdownLine/ResizableInput.vue.js +12 -12
  91. package/dist/components/PlDropdownLine/ResizableInput.vue.js.map +1 -1
  92. package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.d.ts +4 -0
  93. package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js +88 -82
  94. package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js.map +1 -1
  95. package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue.d.ts +1 -1
  96. package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue.js.map +1 -1
  97. package/dist/components/PlDropdownRef/PlDropdownRef.vue.js +11 -11
  98. package/dist/components/PlDropdownRef/PlDropdownRef.vue.js.map +1 -1
  99. package/dist/components/PlEditableTitle/PlEditableTitle.vue.d.ts +1 -1
  100. package/dist/components/PlEditableTitle/PlEditableTitle.vue.js +36 -36
  101. package/dist/components/PlEditableTitle/PlEditableTitle.vue.js.map +1 -1
  102. package/dist/components/PlElementList/PlElementList.vue.d.ts +20 -0
  103. package/dist/components/PlElementList/PlElementList.vue2.js +180 -135
  104. package/dist/components/PlElementList/PlElementList.vue2.js.map +1 -1
  105. package/dist/components/PlElementList/PlElementListItem.vue.d.ts +20 -0
  106. package/dist/components/PlElementList/PlElementListItem.vue2.js +101 -76
  107. package/dist/components/PlElementList/PlElementListItem.vue2.js.map +1 -1
  108. package/dist/components/PlErrorAlert/PlErrorAlert.vue2.js.map +1 -1
  109. package/dist/components/PlErrorBoundary/PlErrorBoundary.vue.js.map +1 -1
  110. package/dist/components/PlFileDialog/Local.vue.js +24 -24
  111. package/dist/components/PlFileDialog/Local.vue.js.map +1 -1
  112. package/dist/components/PlFileDialog/PlFileDialog.vue.js +38 -38
  113. package/dist/components/PlFileDialog/PlFileDialog.vue.js.map +1 -1
  114. package/dist/components/PlFileDialog/Remote.vue.js +2 -2
  115. package/dist/components/PlFileDialog/Remote.vue.js.map +1 -1
  116. package/dist/components/PlFileDialog/Shortcuts.vue2.js +4 -4
  117. package/dist/components/PlFileDialog/Shortcuts.vue2.js.map +1 -1
  118. package/dist/components/PlFileInput/PlFileInput.vue.d.ts +1 -1
  119. package/dist/components/PlFileInput/PlFileInput.vue.js +78 -76
  120. package/dist/components/PlFileInput/PlFileInput.vue.js.map +1 -1
  121. package/dist/components/PlIcon16/PlIcon16.vue2.js.map +1 -1
  122. package/dist/components/PlIcon24/PlIcon24.vue2.js.map +1 -1
  123. package/dist/components/PlLoaderCircular/PlLoaderCircular.vue.js +11 -11
  124. package/dist/components/PlLoaderCircular/PlLoaderCircular.vue.js.map +1 -1
  125. package/dist/components/PlLogView/PlLogView.vue.js +62 -60
  126. package/dist/components/PlLogView/PlLogView.vue.js.map +1 -1
  127. package/dist/components/PlNotificationAlert/PlNotificationAlert.vue.js +22 -22
  128. package/dist/components/PlNotificationAlert/PlNotificationAlert.vue.js.map +1 -1
  129. package/dist/components/PlNumberField/PlNumberField.vue.d.ts +6 -1
  130. package/dist/components/PlNumberField/PlNumberField.vue.js +66 -60
  131. package/dist/components/PlNumberField/PlNumberField.vue.js.map +1 -1
  132. package/dist/components/PlProgressBar/PlProgressBar.vue.js +12 -12
  133. package/dist/components/PlProgressBar/PlProgressBar.vue.js.map +1 -1
  134. package/dist/components/PlProgressCell/PlProgressCell.vue.js +20 -20
  135. package/dist/components/PlProgressCell/PlProgressCell.vue.js.map +1 -1
  136. package/dist/components/PlRadio/PlRadio.vue2.js.map +1 -1
  137. package/dist/components/PlRadio/PlRadioGroup.vue2.js +8 -8
  138. package/dist/components/PlRadio/PlRadioGroup.vue2.js.map +1 -1
  139. package/dist/components/PlSearchField/PlSearchField.vue2.js +19 -19
  140. package/dist/components/PlSearchField/PlSearchField.vue2.js.map +1 -1
  141. package/dist/components/PlSectionSeparator/PlSectionSeparator.vue2.js +8 -8
  142. package/dist/components/PlSectionSeparator/PlSectionSeparator.vue2.js.map +1 -1
  143. package/dist/components/PlSidebar/PlSidebarGroup.vue2.js.map +1 -1
  144. package/dist/components/PlSidebar/PlSidebarItem.vue2.js.map +1 -1
  145. package/dist/components/PlSlideModal/PlPureSlideModal.vue.js +5 -3
  146. package/dist/components/PlSlideModal/PlPureSlideModal.vue.js.map +1 -1
  147. package/dist/components/PlSlideModal/PlSlideModal.vue2.js.map +1 -1
  148. package/dist/components/PlSplash/PlSplash.vue.js +16 -16
  149. package/dist/components/PlSplash/PlSplash.vue.js.map +1 -1
  150. package/dist/components/PlStatusTag/PlStatusTag.vue.js +7 -7
  151. package/dist/components/PlStatusTag/PlStatusTag.vue.js.map +1 -1
  152. package/dist/components/PlSvg/PlSvg.vue2.js.map +1 -1
  153. package/dist/components/PlTabs/PlTabs.vue.js +18 -18
  154. package/dist/components/PlTabs/PlTabs.vue.js.map +1 -1
  155. package/dist/components/PlTabs/Tab.vue.js +9 -9
  156. package/dist/components/PlTabs/Tab.vue.js.map +1 -1
  157. package/dist/components/PlTextArea/PlTextArea.vue.js +55 -53
  158. package/dist/components/PlTextArea/PlTextArea.vue.js.map +1 -1
  159. package/dist/components/PlTextField/PlTextField.vue.d.ts +4 -0
  160. package/dist/components/PlTextField/PlTextField.vue.js +66 -60
  161. package/dist/components/PlTextField/PlTextField.vue.js.map +1 -1
  162. package/dist/components/PlToggleSwitch/PlToggleSwitch.vue.js +14 -14
  163. package/dist/components/PlToggleSwitch/PlToggleSwitch.vue.js.map +1 -1
  164. package/dist/components/PlTooltip/Beak.vue.js +2 -2
  165. package/dist/components/PlTooltip/Beak.vue.js.map +1 -1
  166. package/dist/components/PlTooltip/PlTooltip.vue.js +50 -50
  167. package/dist/components/PlTooltip/PlTooltip.vue.js.map +1 -1
  168. package/dist/components/Scrollable.vue.js.map +1 -1
  169. package/dist/components/Slider.vue.js +35 -35
  170. package/dist/components/Slider.vue.js.map +1 -1
  171. package/dist/components/SliderRange.vue.js +47 -47
  172. package/dist/components/SliderRange.vue.js.map +1 -1
  173. package/dist/components/SliderRangeTriple.vue.js +47 -47
  174. package/dist/components/SliderRangeTriple.vue.js.map +1 -1
  175. package/dist/components/TabItem.vue.js.map +1 -1
  176. package/dist/components/ThemeSwitcher.vue.js +2 -2
  177. package/dist/components/ThemeSwitcher.vue.js.map +1 -1
  178. package/dist/components/TransitionSlidePanel.vue.js.map +1 -1
  179. package/dist/components/VScroll.vue.js.map +1 -1
  180. package/dist/components/contextMenu/Menu.vue2.js +12 -12
  181. package/dist/components/contextMenu/Menu.vue2.js.map +1 -1
  182. package/dist/composition/filters/metadata.d.ts +205 -0
  183. package/dist/composition/filters/metadata.js +129 -19
  184. package/dist/composition/filters/metadata.js.map +1 -1
  185. package/dist/index.js +1 -1
  186. package/dist/layout/PlBlockPage/PlBlockPage.vue.js +27 -27
  187. package/dist/layout/PlBlockPage/PlBlockPage.vue.js.map +1 -1
  188. package/dist/layout/PlContainer/PlContainer.vue.js +10 -10
  189. package/dist/layout/PlContainer/PlContainer.vue.js.map +1 -1
  190. package/dist/layout/PlGrid/PlGrid.vue.js.map +1 -1
  191. package/dist/layout/PlRow/PlRow.vue.js +8 -8
  192. package/dist/layout/PlRow/PlRow.vue.js.map +1 -1
  193. package/dist/layout/PlSpacer/PlSpacer.vue.js.map +1 -1
  194. package/dist/utils/DoubleContour.vue.d.ts +7 -1
  195. package/dist/utils/DoubleContour.vue.js +20 -13
  196. package/dist/utils/DoubleContour.vue.js.map +1 -1
  197. package/dist/utils/DoubleContour.vue3.js +7 -0
  198. package/dist/utils/DoubleContour.vue3.js.map +1 -0
  199. package/dist/utils/DropdownOverlay/DropdownOverlay.vue.js.map +1 -1
  200. package/dist/utils/PlCloseModalBtn.vue.js +2 -2
  201. package/dist/utils/PlCloseModalBtn.vue.js.map +1 -1
  202. package/dist/utils/TextLabel.vue.js.map +1 -1
  203. package/package.json +5 -5
  204. package/src/components/PlAutocomplete/PlAutocomplete.vue +6 -1
  205. package/src/components/PlAutocompleteMulti/PlAutocompleteMulti.vue +6 -1
  206. package/src/components/PlDropdown/PlDropdown.vue +12 -2
  207. package/src/components/PlDropdownMulti/PlDropdownMulti.vue +6 -1
  208. package/src/components/PlElementList/PlElementList.vue +40 -6
  209. package/src/components/PlElementList/PlElementListItem.vue +64 -47
  210. package/src/components/PlNumberField/PlNumberField.vue +4 -1
  211. package/src/components/PlTextField/PlTextField.vue +5 -1
  212. package/src/composition/filters/metadata.ts +105 -0
  213. package/src/utils/DoubleContour.vue +68 -2
  214. package/dist/utils/DoubleContour.vue2.js +0 -7
  215. package/dist/utils/DoubleContour.vue2.js.map +0 -1
@@ -1,11 +1,11 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".pl-tooltip{--pl-tooltip-max-width: 300px;z-index:var(--z-tooltip);position:absolute;display:inline-block;padding:8px 12px 9px;background:var(--tooltip-bg);border-radius:6px;width:max-content;word-break:normal;transform-origin:0 50%;max-width:var(--pl-tooltip-max-width);color:#fff}.pl-tooltip__container{position:absolute;width:0;height:0}.pl-tooltip a{color:var(--tooltip-link-color)}.pl-tooltip p{margin-bottom:8px}.pl-tooltip ul,.pl-tooltip li{margin-left:6px;padding-left:6px}.pl-tooltip li{margin-bottom:4px}.pl-tooltip .beak{position:absolute;top:50%;right:100%}.pl-tooltip.top-left{bottom:0}.pl-tooltip.top-left .beak{position:absolute;top:calc(100% - 2px);transform:translate(-50%) rotate(-90deg);left:20%}.pl-tooltip.left{right:0;transform:translateY(-50%)}.pl-tooltip.left .beak{position:absolute;top:50%;transform:translateY(-50%) rotate(180deg);left:100%}.pl-tooltip.right{left:0;transform:translateY(-50%)}.pl-tooltip.right .beak{position:absolute;top:50%;transform:translateY(-50%);right:100%}.pl-tooltip.top{transform:translate(-50%);bottom:0}.pl-tooltip.top .beak{position:absolute;top:calc(100% - 2px);transform:translate(-50%) rotate(-90deg);left:50%}.pl-tooltip.southwest{transform:translateY(100%);bottom:0;right:-6px}.pl-tooltip.southwest .beak{position:absolute;top:-2px;transform:translateY(-50%) rotate(90deg);right:12px}.tooltip-transition-enter-active,.tooltip-transition-leave-active{transition:all .1s ease-in-out}.tooltip-transition-enter-from,.tooltip-transition-leave-to{opacity:0;transform:translateY(-50%) scale(0)}")),document.head.appendChild(t)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- import { defineComponent as $, reactive as b, watch as c, ref as u, toRef as N, computed as P, onUnmounted as R, createBlock as y, openBlock as a, resolveDynamicComponent as V, mergeProps as g, withCtx as v, renderSlot as k, createCommentVNode as h, Teleport as j, createVNode as w, Transition as z, createElementBlock as A, withModifiers as W, normalizeStyle as C, unref as q, createElementVNode as T, normalizeClass as x } from "vue";
2
+ import { defineComponent as $, reactive as b, watch as u, ref as y, toRef as x, computed as N, onUnmounted as P, createBlock as v, openBlock as p, resolveDynamicComponent as R, mergeProps as V, withCtx as k, renderSlot as h, createCommentVNode as w, Teleport as g, createVNode as C, Transition as j, createElementBlock as z, withModifiers as A, normalizeStyle as T, unref as W, createElementVNode as M, normalizeClass as q } from "vue";
3
3
 
4
4
  import { useTooltipPosition as F } from "./useTooltipPosition.js";
5
5
  import { throttle as K, delay as L, timeout as U } from "../../helpers/utils.js";
6
6
  import { useClickOutside as G } from "../../composition/useClickOutside.js";
7
7
  import H from "./Beak.vue.js";
8
- import { tMap as p } from "./global.js";
8
+ import { tMap as m } from "./global.js";
9
9
  const I = {
10
10
  name: "PlTooltip"
11
11
  }, te = /* @__PURE__ */ $({
@@ -20,89 +20,89 @@ const I = {
20
20
  maxWidth: { default: "300px" }
21
21
  },
22
22
  emits: ["tooltip:close"],
23
- setup(M, { emit: _ }) {
24
- const B = _, i = Symbol(), t = M, o = b({
23
+ setup(i, { emit: B }) {
24
+ const D = B, s = Symbol(), t = i, e = b({
25
25
  open: !1,
26
26
  over: !1,
27
27
  tooltipOpen: !1,
28
28
  key: Symbol()
29
29
  });
30
- p.set(i, () => l()), c(
31
- () => o.open,
32
- (e) => {
30
+ m.set(s, () => l()), u(
31
+ () => e.open,
32
+ (o) => {
33
33
  requestAnimationFrame(() => {
34
- o.tooltipOpen = e;
34
+ e.tooltipOpen = o;
35
35
  });
36
36
  }
37
37
  );
38
- let m = () => {
38
+ let f = () => {
39
39
  };
40
- const D = K(() => window.dispatchEvent(new CustomEvent("adjust")), 1e3), O = () => {
41
- o.open = !0;
42
- for (const [e, n] of p.entries())
43
- e !== i && n();
40
+ const O = K(() => window.dispatchEvent(new CustomEvent("adjust")), 1e3), S = () => {
41
+ e.open = !0;
42
+ for (const [o, n] of m.entries())
43
+ o !== s && n();
44
44
  }, l = () => {
45
- o.open = !1, B("tooltip:close");
46
- }, s = async () => {
47
- t.hide || (D(), o.over = !0, m(), await L(t.openDelay ?? 100), o.over && O());
48
- }, f = () => {
49
- o.over = !1, m = U(() => {
50
- o.over || l();
45
+ e.open = !1, D("tooltip:close");
46
+ }, r = async () => {
47
+ t.hide || (O(), e.over = !0, f(), await L(t.openDelay ?? 100), e.over && S());
48
+ }, c = () => {
49
+ e.over = !1, f = U(() => {
50
+ e.over || l();
51
51
  }, t.closeDelay);
52
52
  };
53
- c(
53
+ u(
54
54
  () => t.hide,
55
- (e) => {
56
- e && l();
55
+ (o) => {
56
+ o && l();
57
57
  }
58
58
  );
59
- const r = u(), d = u(), S = F(r, N(t));
60
- G([r, d], () => l());
61
- const E = P(() => ({
59
+ const a = y(), d = y(), E = F(a, x(t));
60
+ G([a, d], () => l());
61
+ const _ = N(() => ({
62
62
  "--pl-tooltip-max-width": t.maxWidth
63
63
  }));
64
- return R(() => {
65
- p.delete(i);
66
- }), (e, n) => (a(), y(V(e.element), g(e.$attrs, {
64
+ return P(() => {
65
+ m.delete(s);
66
+ }), (o, n) => (p(), v(R(i.element), V(o.$attrs, {
67
67
  ref_key: "rootRef",
68
- ref: r,
69
- onClick: s,
70
- onMouseover: s,
71
- onMouseleave: f
68
+ ref: a,
69
+ onClick: r,
70
+ onMouseover: r,
71
+ onMouseleave: c
72
72
  }), {
73
- default: v(() => [
74
- k(e.$slots, "default"),
75
- e.$slots.tooltip && o.open ? (a(), y(j, {
73
+ default: k(() => [
74
+ h(o.$slots, "default"),
75
+ o.$slots.tooltip && e.open ? (p(), v(g, {
76
76
  key: 0,
77
77
  to: "body"
78
78
  }, [
79
- w(z, { name: "tooltip-transition" }, {
80
- default: v(() => [
81
- o.tooltipOpen ? (a(), A("div", {
79
+ C(j, { name: "tooltip-transition" }, {
80
+ default: k(() => [
81
+ e.tooltipOpen ? (p(), z("div", {
82
82
  key: 0,
83
83
  class: "pl-tooltip__container",
84
- style: C(q(S)),
85
- onClick: n[0] || (n[0] = W(() => {
84
+ style: T(W(E)),
85
+ onClick: n[0] || (n[0] = A(() => {
86
86
  }, ["stop"]))
87
87
  }, [
88
- T("div", {
88
+ M("div", {
89
89
  ref_key: "tooltip",
90
90
  ref: d,
91
- class: x(["pl-tooltip", e.position]),
92
- style: C(E.value),
93
- onMouseover: s,
94
- onMouseleave: f
91
+ class: q(["pl-tooltip", i.position]),
92
+ style: T(_.value),
93
+ onMouseover: r,
94
+ onMouseleave: c
95
95
  }, [
96
- T("div", null, [
97
- k(e.$slots, "tooltip")
96
+ M("div", null, [
97
+ h(o.$slots, "tooltip")
98
98
  ]),
99
- w(H)
99
+ C(H)
100
100
  ], 38)
101
- ], 4)) : h("", !0)
101
+ ], 4)) : w("", !0)
102
102
  ]),
103
103
  _: 3
104
104
  })
105
- ])) : h("", !0)
105
+ ])) : w("", !0)
106
106
  ]),
107
107
  _: 3
108
108
  }, 16));
@@ -1 +1 @@
1
- {"version":3,"file":"PlTooltip.vue.js","sources":["../../../src/components/PlTooltip/PlTooltip.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Simple tooltip on mouseover */\nexport default {\n name: 'PlTooltip',\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport './pl-tooltip.scss';\nimport { computed, onUnmounted, reactive, ref, toRef, watch } from 'vue';\nimport { useTooltipPosition } from './useTooltipPosition';\nimport * as utils from '../../helpers/utils';\nimport { useClickOutside } from '../../composition/useClickOutside';\nimport Beak from './Beak.vue';\nimport { tMap } from './global';\n\nconst emit = defineEmits(['tooltip:close']);\n\nconst tKey = Symbol();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * delay in milliseconds before the tooltip opens\n */\n openDelay?: number;\n /**\n * delay in milliseconds before the tooltip disappears\n */\n closeDelay?: number;\n /**\n * Tooltip position\n */\n position?: 'top-left' | 'left' | 'right' | 'top' | 'southwest';\n /**\n * external prop to hide tooltips\n */\n hide?: boolean;\n /**\n * The gap in pixels between the tooltip and the target element\n */\n gap?: number;\n /**\n * base html element for tooltip\n */\n element?: 'div' | 'span' | 'a' | 'p' | 'h1' | 'h2' | 'h3';\n /**\n * Max width (css value) of the tooltip container (default is 300px)\n */\n maxWidth?: string;\n }>(),\n {\n openDelay: 100,\n closeDelay: 1000,\n gap: 8,\n position: 'top',\n element: 'div',\n maxWidth: '300px',\n },\n);\n\nconst data = reactive({\n open: false,\n over: false,\n tooltipOpen: false,\n key: Symbol(),\n});\n\ntMap.set(tKey, () => closeTooltip());\n\n// Hook to avoid the need to immediately teleport into the body (better performance)\nwatch(\n () => data.open,\n (v) => {\n requestAnimationFrame(() => {\n data.tooltipOpen = v;\n });\n },\n);\n\nlet clearTimeout = () => {};\n\nconst dispatchAdjust = utils.throttle(() => window.dispatchEvent(new CustomEvent('adjust')), 1000);\n\nconst showTooltip = () => {\n data.open = true;\n\n for (const [k, f] of tMap.entries()) {\n if (k !== tKey) {\n f();\n }\n }\n};\n\nconst closeTooltip = () => {\n data.open = false;\n emit('tooltip:close');\n};\n\nconst onOver = async () => {\n if (props.hide) {\n return;\n }\n\n dispatchAdjust();\n\n data.over = true;\n\n clearTimeout();\n\n await utils.delay(props.openDelay ?? 100);\n\n if (data.over) {\n showTooltip();\n }\n};\n\nconst onLeave = () => {\n data.over = false;\n clearTimeout = utils.timeout(() => {\n if (!data.over) {\n closeTooltip();\n }\n }, props.closeDelay);\n};\n\nwatch(\n () => props.hide,\n (hide) => {\n if (hide) {\n closeTooltip();\n }\n },\n);\n\nconst rootRef = ref<HTMLElement | undefined>();\nconst tooltip = ref<HTMLElement | undefined>();\n\nconst style = useTooltipPosition(rootRef, toRef(props));\n\nuseClickOutside([rootRef, tooltip], () => closeTooltip());\n\nconst tooltipStyle = computed(() => ({\n '--pl-tooltip-max-width': props.maxWidth,\n}));\n\nonUnmounted(() => {\n tMap.delete(tKey);\n});\n</script>\n\n<template>\n <component :is=\"element\" v-bind=\"$attrs\" ref=\"rootRef\" @click=\"onOver\" @mouseover=\"onOver\" @mouseleave=\"onLeave\">\n <slot />\n <Teleport v-if=\"$slots['tooltip'] && data.open\" to=\"body\">\n <Transition name=\"tooltip-transition\">\n <div v-if=\"data.tooltipOpen\" class=\"pl-tooltip__container\" :style=\"style\" @click.stop>\n <div ref=\"tooltip\" class=\"pl-tooltip\" :style=\"tooltipStyle\" :class=\"position\" @mouseover=\"onOver\" @mouseleave=\"onLeave\">\n <!-- should be one line -->\n <div><slot name=\"tooltip\" /></div>\n <Beak />\n </div>\n </div>\n </Transition>\n </Teleport>\n </component>\n</template>\n"],"names":["__default__","emit","__emit","tKey","props","__props","data","reactive","tMap","closeTooltip","watch","v","clearTimeout","dispatchAdjust","utils.throttle","showTooltip","k","f","onOver","utils.delay","onLeave","utils.timeout","hide","rootRef","ref","tooltip","style","useTooltipPosition","toRef","useClickOutside","tooltipStyle","computed","onUnmounted"],"mappings":";;;;;;;AAEA,MAAAA,IAAe;AAAA,EACb,MAAM;AACR;;;;;;;;;;;;;AAYA,UAAMC,IAAOC,GAEPC,IAAO,OAAA,GAEPC,IAAQC,GAyCRC,IAAOC,EAAS;AAAA,MACpB,MAAM;AAAA,MACN,MAAM;AAAA,MACN,aA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AEF,WAAA4B,EAAY,MAAM;AAChB,MAAAxB,EAAK,OAAOL,CAAI;AAAA,IAClB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"PlTooltip.vue.js","sources":["../../../src/components/PlTooltip/PlTooltip.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Simple tooltip on mouseover */\nexport default {\n name: 'PlTooltip',\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport './pl-tooltip.scss';\nimport { computed, onUnmounted, reactive, ref, toRef, watch } from 'vue';\nimport { useTooltipPosition } from './useTooltipPosition';\nimport * as utils from '../../helpers/utils';\nimport { useClickOutside } from '../../composition/useClickOutside';\nimport Beak from './Beak.vue';\nimport { tMap } from './global';\n\nconst emit = defineEmits(['tooltip:close']);\n\nconst tKey = Symbol();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * delay in milliseconds before the tooltip opens\n */\n openDelay?: number;\n /**\n * delay in milliseconds before the tooltip disappears\n */\n closeDelay?: number;\n /**\n * Tooltip position\n */\n position?: 'top-left' | 'left' | 'right' | 'top' | 'southwest';\n /**\n * external prop to hide tooltips\n */\n hide?: boolean;\n /**\n * The gap in pixels between the tooltip and the target element\n */\n gap?: number;\n /**\n * base html element for tooltip\n */\n element?: 'div' | 'span' | 'a' | 'p' | 'h1' | 'h2' | 'h3';\n /**\n * Max width (css value) of the tooltip container (default is 300px)\n */\n maxWidth?: string;\n }>(),\n {\n openDelay: 100,\n closeDelay: 1000,\n gap: 8,\n position: 'top',\n element: 'div',\n maxWidth: '300px',\n },\n);\n\nconst data = reactive({\n open: false,\n over: false,\n tooltipOpen: false,\n key: Symbol(),\n});\n\ntMap.set(tKey, () => closeTooltip());\n\n// Hook to avoid the need to immediately teleport into the body (better performance)\nwatch(\n () => data.open,\n (v) => {\n requestAnimationFrame(() => {\n data.tooltipOpen = v;\n });\n },\n);\n\nlet clearTimeout = () => {};\n\nconst dispatchAdjust = utils.throttle(() => window.dispatchEvent(new CustomEvent('adjust')), 1000);\n\nconst showTooltip = () => {\n data.open = true;\n\n for (const [k, f] of tMap.entries()) {\n if (k !== tKey) {\n f();\n }\n }\n};\n\nconst closeTooltip = () => {\n data.open = false;\n emit('tooltip:close');\n};\n\nconst onOver = async () => {\n if (props.hide) {\n return;\n }\n\n dispatchAdjust();\n\n data.over = true;\n\n clearTimeout();\n\n await utils.delay(props.openDelay ?? 100);\n\n if (data.over) {\n showTooltip();\n }\n};\n\nconst onLeave = () => {\n data.over = false;\n clearTimeout = utils.timeout(() => {\n if (!data.over) {\n closeTooltip();\n }\n }, props.closeDelay);\n};\n\nwatch(\n () => props.hide,\n (hide) => {\n if (hide) {\n closeTooltip();\n }\n },\n);\n\nconst rootRef = ref<HTMLElement | undefined>();\nconst tooltip = ref<HTMLElement | undefined>();\n\nconst style = useTooltipPosition(rootRef, toRef(props));\n\nuseClickOutside([rootRef, tooltip], () => closeTooltip());\n\nconst tooltipStyle = computed(() => ({\n '--pl-tooltip-max-width': props.maxWidth,\n}));\n\nonUnmounted(() => {\n tMap.delete(tKey);\n});\n</script>\n\n<template>\n <component :is=\"element\" v-bind=\"$attrs\" ref=\"rootRef\" @click=\"onOver\" @mouseover=\"onOver\" @mouseleave=\"onLeave\">\n <slot />\n <Teleport v-if=\"$slots['tooltip'] && data.open\" to=\"body\">\n <Transition name=\"tooltip-transition\">\n <div v-if=\"data.tooltipOpen\" class=\"pl-tooltip__container\" :style=\"style\" @click.stop>\n <div ref=\"tooltip\" class=\"pl-tooltip\" :style=\"tooltipStyle\" :class=\"position\" @mouseover=\"onOver\" @mouseleave=\"onLeave\">\n <!-- should be one line -->\n <div><slot name=\"tooltip\" /></div>\n <Beak />\n </div>\n </div>\n </Transition>\n </Teleport>\n </component>\n</template>\n"],"names":["__default__","emit","__emit","tKey","props","__props","data","reactive","tMap","closeTooltip","watch","v","clearTimeout","dispatchAdjust","utils.throttle","showTooltip","k","f","onOver","utils.delay","onLeave","utils.timeout","hide","rootRef","ref","tooltip","style","useTooltipPosition","toRef","useClickOutside","tooltipStyle","computed","onUnmounted","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","$attrs","_renderSlot","_ctx","$slots","_Teleport","_createVNode","_Transition","_createElementBlock","_unref","_createElementVNode","_normalizeClass","Beak"],"mappings":";;;;;;;AAEA,MAAAA,IAAe;AAAA,EACb,MAAM;AACR;;;;;;;;;;;;;AAYA,UAAMC,IAAOC,GAEPC,IAAO,OAAA,GAEPC,IAAQC,GAyCRC,IAAOC,EAAS;AAAA,MACpB,MAAM;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,MACb,KAAK,OAAA;AAAA,IAAO,CACb;AAED,IAAAC,EAAK,IAAIL,GAAM,MAAMM,EAAA,CAAc,GAGnCC;AAAA,MACE,MAAMJ,EAAK;AAAA,MACX,CAACK,MAAM;AACL,8BAAsB,MAAM;AAC1B,UAAAL,EAAK,cAAcK;AAAA,QACrB,CAAC;AAAA,MACH;AAAA,IAAA;AAGF,QAAIC,IAAe,MAAM;AAAA,IAAC;AAE1B,UAAMC,IAAiBC,EAAe,MAAM,OAAO,cAAc,IAAI,YAAY,QAAQ,CAAC,GAAG,GAAI,GAE3FC,IAAc,MAAM;AACxB,MAAAT,EAAK,OAAO;AAEZ,iBAAW,CAACU,GAAGC,CAAC,KAAKT,EAAK;AACxB,QAAIQ,MAAMb,KACRc,EAAA;AAAA,IAGN,GAEMR,IAAe,MAAM;AACzB,MAAAH,EAAK,OAAO,IACZL,EAAK,eAAe;AAAA,IACtB,GAEMiB,IAAS,YAAY;AACzB,MAAId,EAAM,SAIVS,EAAA,GAEAP,EAAK,OAAO,IAEZM,EAAA,GAEA,MAAMO,EAAYf,EAAM,aAAa,GAAG,GAEpCE,EAAK,QACPS,EAAA;AAAA,IAEJ,GAEMK,IAAU,MAAM;AACpB,MAAAd,EAAK,OAAO,IACZM,IAAeS,EAAc,MAAM;AACjC,QAAKf,EAAK,QACRG,EAAA;AAAA,MAEJ,GAA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kBAE7G0B,EAAkC,OAAA,MAAA;AAAA,oBAA7BR,EAAuBC,EAAA,QAAA,SAAA;AAAA,kBAAA;kBAC5BG,EAAQM,CAAA;AAAA,gBAAA;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Scrollable.vue.js","sources":["../../src/components/Scrollable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport VScroll from './VScroll.vue';\nimport HScroll from './HScroll.vue';\nimport { onMounted, onUnmounted, reactive, ref, unref } from 'vue';\nimport { tapIf, copyProps } from '../helpers/functions';\nimport { useResizeObserver } from '../composition/useResizeObserver';\n\nconst containerRef = ref<HTMLElement>();\n\nconst data = reactive({\n scrollTop: 0,\n scrollLeft: 0,\n clientHeight: 0,\n clientWidth: 0,\n scrollHeight: 0,\n scrollWidth: 0,\n});\n\nfunction updateState(container: HTMLElement) {\n copyProps(data, container, 'scrollTop', 'scrollLeft', 'clientHeight', 'clientWidth', 'scrollHeight', 'scrollWidth');\n}\n\nconst onWheel = (e: WheelEvent) => {\n e.preventDefault();\n const root = e.currentTarget as HTMLElement;\n root.scrollTop += e.deltaY;\n root.scrollLeft += e.deltaX;\n updateState(root);\n};\n\nfunction updateTop(v: number) {\n tapIf(unref(containerRef), (el) => {\n el.scrollTop = v;\n updateState(el);\n });\n}\n\nfunction updateLeft(v: number) {\n tapIf(unref(containerRef), (el) => {\n el.scrollLeft = v;\n updateState(el);\n });\n}\n\nuseResizeObserver(containerRef, (el) => {\n tapIf(el, (el) => updateState(el));\n});\n\nonMounted(() => {\n tapIf(unref(containerRef), (root) => {\n updateState(root);\n root.addEventListener('wheel', onWheel);\n });\n});\n\nonUnmounted(() => {\n tapIf(unref(containerRef), (root) => root.removeEventListener('wheel', onWheel));\n});\n</script>\n\n<template>\n <div class=\"ui-scrollable\">\n <div ref=\"containerRef\" class=\"ui-scrollable__container\" @wheel=\"onWheel\">\n <slot />\n </div>\n <VScroll\n :scroll-top=\"data.scrollTop\"\n :client-height=\"data.clientHeight\"\n :scroll-height=\"data.scrollHeight\"\n @wheel.stop\n @update:scroll-top=\"updateTop\"\n />\n <HScroll\n :scroll-left=\"data.scrollLeft\"\n :client-width=\"data.clientWidth\"\n :scroll-width=\"data.scrollWidth\"\n @wheel.stop\n @update:scroll-left=\"updateLeft\"\n />\n </div>\n</template>\n"],"names":["containerRef","ref","data","reactive","updateState","container","copyProps","onWheel","root","updateTop","v","tapIf","unref","el","updateLeft","useResizeObserver","onMounted","onUnmounted"],"mappings":";;;;;;;;AAOA,UAAMA,IAAeC,EAAA,GAEfC,IAAOC,EAAS;AAAA,MACpB,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,aAAa;AAAA,MACb,cAAc;AAAA,MACd,aAAa;AAAA,IAAA,CACd;AAED,aAASC,EAAYC,GAAwB;AAC3C,MAAAC,EAAUJ,GAAMG,GAAW,aAAa,cAAc,gBAAgB,eAAe,gBAAgB,aAAa;AAAA,IACpH;AAEA,UAAME,IAAU,CAAC,MAAkB;AACjC,QAAE,eAAA;AACF,YAAMC,IAAO,EAAE;AACf,MAAAA,EAAK,aAAa,EAAE,QACpBA,EAAK,cAAc,EAAE,QACrBJ,EAAYI,CAAI;AAAA,IAClB;AAEA,aAASC,EAAUC,GAAW;AAC5B,MAAAC,EAAMC,EAAMZ,CAAY,GAAG,CAACa,MAAO;AACjC,QAAAA,EAAG,YAAYH,GACfN,EAAYS,CAAE;AAAA,MAChB,CAAC;AAAA,IACH;AAEA,aAASC,EAAWJ,GAAW;AAC7B,MAAAC,EAAMC,EAAMZ,CAAY,GAAG,CAACa,MAAO;AACjC,QAAAA,EAAG,aAAaH,GAChBN,EAAYS,CAAE;AAAA,MAChB,CAAC;AAAA,IACH;AAEA,WAAAE,EAAkBf,GAAc,CAACa,MAAO;AACtC,MAAAF,EAAME,GAAI,CAACA,MAAOT,EAAYS,CAAE,CAAC;AAAA,IACnC,CAAC,GAEDG,EAAU,MAAM;AACd,MAAAL,EAAMC,EAAMZ,CAAY,GAAG,CAACQ,MAAS;AACnC,QAAAJ,EAAYI,CAAI,GAChBA,EAAK,iBAAiB,SAASD,CAAO;AAAA,MACxC,CAAC;AAAA,IACH,CAAC,GAEDU,EAAY,MAAM;AAChB,MAAAN,EAAMC,EAAMZ,CAAY,GAAG,CAACQ,MAASA,EAAK,oBAAoB,SAASD,CAAO,CAAC;AAAA,IACjF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Scrollable.vue.js","sources":["../../src/components/Scrollable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport VScroll from './VScroll.vue';\nimport HScroll from './HScroll.vue';\nimport { onMounted, onUnmounted, reactive, ref, unref } from 'vue';\nimport { tapIf, copyProps } from '../helpers/functions';\nimport { useResizeObserver } from '../composition/useResizeObserver';\n\nconst containerRef = ref<HTMLElement>();\n\nconst data = reactive({\n scrollTop: 0,\n scrollLeft: 0,\n clientHeight: 0,\n clientWidth: 0,\n scrollHeight: 0,\n scrollWidth: 0,\n});\n\nfunction updateState(container: HTMLElement) {\n copyProps(data, container, 'scrollTop', 'scrollLeft', 'clientHeight', 'clientWidth', 'scrollHeight', 'scrollWidth');\n}\n\nconst onWheel = (e: WheelEvent) => {\n e.preventDefault();\n const root = e.currentTarget as HTMLElement;\n root.scrollTop += e.deltaY;\n root.scrollLeft += e.deltaX;\n updateState(root);\n};\n\nfunction updateTop(v: number) {\n tapIf(unref(containerRef), (el) => {\n el.scrollTop = v;\n updateState(el);\n });\n}\n\nfunction updateLeft(v: number) {\n tapIf(unref(containerRef), (el) => {\n el.scrollLeft = v;\n updateState(el);\n });\n}\n\nuseResizeObserver(containerRef, (el) => {\n tapIf(el, (el) => updateState(el));\n});\n\nonMounted(() => {\n tapIf(unref(containerRef), (root) => {\n updateState(root);\n root.addEventListener('wheel', onWheel);\n });\n});\n\nonUnmounted(() => {\n tapIf(unref(containerRef), (root) => root.removeEventListener('wheel', onWheel));\n});\n</script>\n\n<template>\n <div class=\"ui-scrollable\">\n <div ref=\"containerRef\" class=\"ui-scrollable__container\" @wheel=\"onWheel\">\n <slot />\n </div>\n <VScroll\n :scroll-top=\"data.scrollTop\"\n :client-height=\"data.clientHeight\"\n :scroll-height=\"data.scrollHeight\"\n @wheel.stop\n @update:scroll-top=\"updateTop\"\n />\n <HScroll\n :scroll-left=\"data.scrollLeft\"\n :client-width=\"data.clientWidth\"\n :scroll-width=\"data.scrollWidth\"\n @wheel.stop\n @update:scroll-left=\"updateLeft\"\n />\n </div>\n</template>\n"],"names":["containerRef","ref","data","reactive","updateState","container","copyProps","onWheel","root","updateTop","v","tapIf","unref","el","updateLeft","useResizeObserver","onMounted","onUnmounted","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_renderSlot","_ctx","_createVNode","VScroll","HScroll"],"mappings":";;;;;;;;AAOA,UAAMA,IAAeC,EAAA,GAEfC,IAAOC,EAAS;AAAA,MACpB,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,aAAa;AAAA,MACb,cAAc;AAAA,MACd,aAAa;AAAA,IAAA,CACd;AAED,aAASC,EAAYC,GAAwB;AAC3C,MAAAC,EAAUJ,GAAMG,GAAW,aAAa,cAAc,gBAAgB,eAAe,gBAAgB,aAAa;AAAA,IACpH;AAEA,UAAME,IAAU,CAAC,MAAkB;AACjC,QAAE,eAAA;AACF,YAAMC,IAAO,EAAE;AACf,MAAAA,EAAK,aAAa,EAAE,QACpBA,EAAK,cAAc,EAAE,QACrBJ,EAAYI,CAAI;AAAA,IAClB;AAEA,aAASC,EAAUC,GAAW;AAC5B,MAAAC,EAAMC,EAAMZ,CAAY,GAAG,CAACa,MAAO;AACjC,QAAAA,EAAG,YAAYH,GACfN,EAAYS,CAAE;AAAA,MAChB,CAAC;AAAA,IACH;AAEA,aAASC,EAAWJ,GAAW;AAC7B,MAAAC,EAAMC,EAAMZ,CAAY,GAAG,CAACa,MAAO;AACjC,QAAAA,EAAG,aAAaH,GAChBN,EAAYS,CAAE;AAAA,MAChB,CAAC;AAAA,IACH;AAEA,WAAAE,EAAkBf,GAAc,CAACa,MAAO;AACtC,MAAAF,EAAME,GAAI,CAACA,MAAOT,EAAYS,CAAE,CAAC;AAAA,IACnC,CAAC,GAEDG,EAAU,MAAM;AACd,MAAAL,EAAMC,EAAMZ,CAAY,GAAG,CAACQ,MAAS;AACnC,QAAAJ,EAAYI,CAAI,GAChBA,EAAK,iBAAiB,SAASD,CAAO;AAAA,MACxC,CAAC;AAAA,IACH,CAAC,GAEDU,EAAY,MAAM;AAChB,MAAAN,EAAMC,EAAMZ,CAAY,GAAG,CAACQ,MAASA,EAAK,oBAAoB,SAASD,CAAO,CAAC;AAAA,IACjF,CAAC,cAICW,EAAA,GAAAC,EAkBM,OAlBNC,GAkBM;AAAA,MAjBJC,EAEM,OAAA;AAAA,iBAFG;AAAA,QAAJ,KAAIrB;AAAA,QAAe,OAAM;AAAA,QAA4B,SAAAO;AAAA,MAAA;QACxDe,EAAQC,EAAA,QAAA,SAAA;AAAA,MAAA;MAEVC,EAMEC,GAAA;AAAA,QALC,cAAYvB,EAAK;AAAA,QACjB,iBAAeA,EAAK;AAAA,QACpB,iBAAeA,EAAK;AAAA,QACpB,2BAAD,MAAA;AAAA,QAAA,GAAW,CAAA,MAAA,CAAA;AAAA,QACV,sBAAmBO;AAAA,MAAA;MAEtBe,EAMEE,GAAA;AAAA,QALC,eAAaxB,EAAK;AAAA,QAClB,gBAAcA,EAAK;AAAA,QACnB,gBAAcA,EAAK;AAAA,QACnB,2BAAD,MAAA;AAAA,QAAA,GAAW,CAAA,MAAA,CAAA;AAAA,QACV,uBAAoBY;AAAA,MAAA;;;;"}
@@ -1,7 +1,7 @@
1
- import { defineComponent as z, useSlots as F, reactive as I, computed as r, ref as f, watch as K, createElementBlock as i, openBlock as s, normalizeClass as M, createElementVNode as l, createCommentVNode as a, createBlock as P, toDisplayString as c, unref as m, withCtx as U, renderSlot as O, normalizeStyle as v, Fragment as j, renderList as q } from "vue";
1
+ import { defineComponent as z, useSlots as F, reactive as I, computed as r, ref as v, watch as K, createElementBlock as i, openBlock as s, normalizeClass as R, createElementVNode as l, createCommentVNode as a, createBlock as P, toDisplayString as m, unref as _, withCtx as U, renderSlot as O, normalizeStyle as h, Fragment as j, renderList as q } from "vue";
2
2
  import { useMouseCapture as G } from "../composition/useMouseCapture.js";
3
3
  import { tapIf as H } from "../helpers/functions.js";
4
- import { clamp as h } from "../helpers/math.js";
4
+ import { clamp as b } from "../helpers/math.js";
5
5
  import J from "./PlTooltip/PlTooltip.vue.js";
6
6
  import { useSliderBreakpoints as Q } from "../composition/useSliderBreakpoints.js";
7
7
  import { getErrorMessage as T } from "../helpers/error.js";
@@ -14,7 +14,7 @@ const W = { class: "ui-slider__wrapper" }, X = { class: "ui-slider__label-sectio
14
14
  }, ee = { class: "ui-slider__base" }, te = { class: "ui-slider__container" }, le = { class: "ui-slider__container ui-slider__container-thumb" }, oe = { class: "ui-slider__input-wrapper d-flex" }, se = ["value"], re = {
15
15
  key: 0,
16
16
  class: "ui-slider__error"
17
- }, pe = /* @__PURE__ */ z({
17
+ }, _e = /* @__PURE__ */ z({
18
18
  __name: "Slider",
19
19
  props: {
20
20
  modelValue: {},
@@ -30,56 +30,56 @@ const W = { class: "ui-slider__wrapper" }, X = { class: "ui-slider__label-sectio
30
30
  disabled: { type: Boolean, default: !1 }
31
31
  },
32
32
  emits: ["update:modelValue"],
33
- setup(R, { emit: A }) {
34
- const B = F(), b = A, e = R, n = I({
33
+ setup(n, { emit: A }) {
34
+ const B = F(), V = A, e = n, d = I({
35
35
  deltaValue: 0
36
- }), V = r(() => e.max - e.min), y = r(() => h((e.modelValue ?? 0) + n.deltaValue, e.min, e.max)), d = f(e.modelValue), g = r(() => {
36
+ }), y = r(() => e.max - e.min), x = r(() => b((e.modelValue ?? 0) + d.deltaValue, e.min, e.max)), c = v(e.modelValue), g = r(() => {
37
37
  const t = e.modelValue;
38
38
  return Number.isFinite(t) ? t < e.min ? `Min value: ${e.min}` : t > e.max ? `Max value: ${e.max}` : T(e.error) : "Not a number";
39
- }), C = r(() => e), $ = Q(C), k = r(() => (y.value - e.min) / V.value), N = r(() => ({
39
+ }), C = r(() => e), $ = Q(C), k = r(() => (x.value - e.min) / y.value), N = r(() => ({
40
40
  right: Math.ceil((1 - k.value) * 100) + "%"
41
41
  })), E = r(() => ({
42
42
  right: `calc(${Math.ceil((1 - k.value) * 100)}%) `
43
- })), w = f(), x = f();
43
+ })), w = v(), S = v();
44
44
  K(
45
45
  () => e.modelValue,
46
46
  (t) => {
47
- d.value = t;
47
+ c.value = t;
48
48
  }
49
49
  );
50
50
  function p(t) {
51
- const o = h(t, e.min, e.max);
51
+ const o = b(t, e.min, e.max);
52
52
  return Math.round((o + Number.EPSILON) * (1 / e.step)) / (1 / e.step);
53
53
  }
54
- G(x, (t) => {
54
+ G(S, (t) => {
55
55
  var o;
56
- H((o = m(w)) == null ? void 0 : o.getBoundingClientRect(), (u) => {
57
- const { dx: _ } = t;
58
- n.deltaValue = _ / u.width * V.value, d.value = p(h((e.modelValue ?? 0) + n.deltaValue, e.min, e.max)), t.stop && (b("update:modelValue", p(y.value)), n.deltaValue = 0);
56
+ H((o = _(w)) == null ? void 0 : o.getBoundingClientRect(), (u) => {
57
+ const { dx: f } = t;
58
+ d.deltaValue = f / u.width * y.value, c.value = p(b((e.modelValue ?? 0) + d.deltaValue, e.min, e.max)), t.stop && (V("update:modelValue", p(x.value)), d.deltaValue = 0);
59
59
  });
60
60
  });
61
- function S(t) {
62
- b("update:modelValue", p(t));
61
+ function M(t) {
62
+ V("update:modelValue", p(t));
63
63
  }
64
64
  function D(t) {
65
- S(+t.target.value);
65
+ M(+t.target.value);
66
66
  }
67
67
  function L(t) {
68
68
  ["ArrowDown", "ArrowUp", "ArrowRight", "ArrowLeft", "Enter"].includes(t.code) && t.preventDefault();
69
69
  const o = t.code === "ArrowUp" || t.code === "ArrowRight" ? e.step * 1 : t.code === "ArrowDown" || t.code === "ArrowLeft" ? e.step * -1 : 0;
70
- S(e.modelValue + o);
70
+ M(e.modelValue + o);
71
71
  }
72
72
  return (t, o) => (s(), i("div", {
73
- class: M([e.disabled ? "ui-slider__disabled" : void 0, "ui-slider__envelope"])
73
+ class: R([e.disabled ? "ui-slider__disabled" : void 0, "ui-slider__envelope"])
74
74
  }, [
75
75
  l("div", {
76
- class: M([`ui-slider__mode-${e.mode}`, "ui-slider"])
76
+ class: R([`ui-slider__mode-${e.mode}`, "ui-slider"])
77
77
  }, [
78
78
  l("div", W, [
79
79
  l("div", X, [
80
- t.label ? (s(), i("label", Y, [
81
- l("span", null, c(t.label), 1),
82
- m(B).tooltip ? (s(), P(m(J), {
80
+ n.label ? (s(), i("label", Y, [
81
+ l("span", null, m(n.label), 1),
82
+ _(B).tooltip ? (s(), P(_(J), {
83
83
  key: 0,
84
84
  class: "info",
85
85
  position: "top"
@@ -90,7 +90,7 @@ const W = { class: "ui-slider__wrapper" }, X = { class: "ui-slider__label-sectio
90
90
  _: 3
91
91
  })) : a("", !0)
92
92
  ])) : a("", !0),
93
- e.mode === "text" ? (s(), i("div", Z, c(d.value) + c(t.measure), 1)) : a("", !0)
93
+ e.mode === "text" ? (s(), i("div", Z, m(c.value) + m(n.measure), 1)) : a("", !0)
94
94
  ]),
95
95
  l("div", ee, [
96
96
  l("div", te, [
@@ -101,43 +101,43 @@ const W = { class: "ui-slider__wrapper" }, X = { class: "ui-slider__label-sectio
101
101
  }, [
102
102
  l("div", {
103
103
  class: "ui-slider__progress",
104
- style: v(N.value)
104
+ style: h(N.value)
105
105
  }, null, 4)
106
106
  ], 512)
107
107
  ]),
108
108
  l("div", le, [
109
- e.breakpoints ? (s(!0), i(j, { key: 0 }, q(m($), (u, _) => (s(), i("div", {
110
- key: _,
111
- style: v({ right: `${u}%` }),
109
+ e.breakpoints ? (s(!0), i(j, { key: 0 }, q(_($), (u, f) => (s(), i("div", {
110
+ key: f,
111
+ style: h({ right: `${u}%` }),
112
112
  class: "ui-slider__thumb-step"
113
113
  }, null, 4))), 128)) : a("", !0),
114
114
  l("div", {
115
115
  ref_key: "thumbRef",
116
- ref: x,
116
+ ref: S,
117
117
  tabindex: "0",
118
118
  class: "ui-slider__thumb ui-slider__thumb-active",
119
- style: v(E.value),
119
+ style: h(E.value),
120
120
  onKeydown: L
121
- }, o[1] || (o[1] = [
121
+ }, [...o[1] || (o[1] = [
122
122
  l("div", { class: "ui-slider__thumb-focused-contour" }, null, -1)
123
- ]), 36)
123
+ ])], 36)
124
124
  ])
125
125
  ])
126
126
  ]),
127
127
  l("div", oe, [
128
128
  e.mode === "input" ? (s(), i("input", {
129
129
  key: 0,
130
- value: d.value,
130
+ value: c.value,
131
131
  class: "ui-slider__value text-s",
132
132
  onChange: o[0] || (o[0] = (u) => D(u))
133
133
  }, null, 40, se)) : a("", !0)
134
134
  ])
135
135
  ], 2),
136
- g.value ? (s(), i("div", re, c(g.value), 1)) : a("", !0)
136
+ g.value ? (s(), i("div", re, m(g.value), 1)) : a("", !0)
137
137
  ], 2));
138
138
  }
139
139
  });
140
140
  export {
141
- pe as default
141
+ _e as default
142
142
  };
143
143
  //# sourceMappingURL=Slider.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.vue.js","sources":["../../src/components/Slider.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, reactive, ref, unref, useSlots, watch } from 'vue';\nimport { useMouseCapture } from '../composition/useMouseCapture';\nimport { tapIf } from '../helpers/functions';\nimport { clamp } from '../helpers/math';\nimport { PlTooltip } from './PlTooltip';\nimport type { SliderMode } from '../types';\nimport { useSliderBreakpoints } from '../composition/useSliderBreakpoints';\nimport { getErrorMessage } from '../helpers/error.ts';\n\nconst slots = useSlots();\n\nconst emit = defineEmits(['update:modelValue']);\n\nconst props = withDefaults(\n defineProps<{\n modelValue: number;\n min?: number;\n max: number;\n step?: number;\n label?: string;\n helper?: string;\n error?: unknown;\n mode?: SliderMode;\n measure?: string;\n breakpoints?: boolean;\n disabled?: boolean;\n }>(),\n {\n label: undefined,\n helper: undefined,\n error: undefined,\n min: 0,\n step: 1,\n mode: 'text',\n measure: '',\n breakpoints: false,\n disabled: false,\n },\n);\n\nconst data = reactive({\n deltaValue: 0,\n});\n\nconst range = computed(() => props.max - props.min);\n\nconst localValue = computed(() => {\n return clamp((props.modelValue ?? 0) + data.deltaValue, props.min, props.max);\n});\n\nconst realtimeVal = ref(props.modelValue);\n\nconst error = computed(() => {\n const v = props.modelValue;\n\n if (!Number.isFinite(v)) {\n return 'Not a number';\n }\n\n if (v < props.min) {\n return `Min value: ${props.min}`;\n }\n\n if (v > props.max) {\n return `Max value: ${props.max}`;\n }\n\n return getErrorMessage(props.error);\n});\n\nconst propsRef = computed(() => props);\n\nconst breakpointsRef = useSliderBreakpoints(propsRef);\n\nconst position = computed(() => {\n return (localValue.value - props.min) / range.value;\n});\n\nconst progressStyle = computed(() => ({\n right: Math.ceil((1 - position.value) * 100) + '%',\n}));\n\nconst thumbStyle = computed(() => {\n const value = Math.ceil((1 - position.value) * 100);\n return {\n right: `calc(${value}%) `,\n };\n});\n\nconst barRef = ref<HTMLElement>();\nconst thumbRef = ref<HTMLElement>();\n\nwatch(\n () => props.modelValue,\n (val) => {\n realtimeVal.value = val;\n },\n);\n\nfunction round(value: number) {\n const v = clamp(value, props.min, props.max);\n // This is the same as Math.round(v / props.step) * props.step but here we need this magic to avoid numbers like 3.00000000000000000004\n return Math.round((v + Number.EPSILON) * (1 / props.step)) / (1 / props.step);\n}\n\nuseMouseCapture(thumbRef, (ev) => {\n tapIf(unref(barRef)?.getBoundingClientRect(), (rect) => {\n const { dx } = ev;\n\n data.deltaValue = (dx / rect.width) * range.value;\n\n realtimeVal.value = round(clamp((props.modelValue ?? 0) + data.deltaValue, props.min, props.max));\n\n if (ev.stop) {\n emit('update:modelValue', round(localValue.value));\n data.deltaValue = 0;\n }\n });\n});\n\nfunction setModelValue(value: number) {\n emit('update:modelValue', round(value));\n}\n\nfunction updateModelValue(event: Event) {\n setModelValue(+(event.target as HTMLInputElement).value);\n}\n\nfunction handleKeyPress(e: { code: string; preventDefault(): void }) {\n if (['ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft', 'Enter'].includes(e.code)) {\n e.preventDefault();\n }\n\n const nextStep\n = e.code === 'ArrowUp' || e.code === 'ArrowRight' ? props.step * 1 : e.code === 'ArrowDown' || e.code === 'ArrowLeft' ? props.step * -1 : 0;\n\n setModelValue(props.modelValue + nextStep);\n}\n</script>\n\n<template>\n <div :class=\"props.disabled ? 'ui-slider__disabled' : undefined\" class=\"ui-slider__envelope\">\n <div :class=\"`ui-slider__mode-${props.mode}`\" class=\"ui-slider\">\n <div class=\"ui-slider__wrapper\">\n <div class=\"ui-slider__label-section\">\n <label v-if=\"label\" class=\"text-s\">\n <span>{{ label }}</span>\n <PlTooltip v-if=\"slots.tooltip\" class=\"info\" position=\"top\">\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <div v-if=\"props.mode === 'text'\" class=\"ui-slider__value-static text-s\">{{ realtimeVal }}{{ measure }}</div>\n </div>\n <div class=\"ui-slider__base\">\n <div class=\"ui-slider__container\">\n <div ref=\"barRef\" class=\"ui-slider__bar\">\n <div class=\"ui-slider__progress\" :style=\"progressStyle\" />\n </div>\n </div>\n <div class=\"ui-slider__container ui-slider__container-thumb\">\n <template v-if=\"props.breakpoints\">\n <div v-for=\"(item, index) in breakpointsRef\" :key=\"index\" :style=\"{ right: `${item}%` }\" class=\"ui-slider__thumb-step\"/>\n </template>\n <div ref=\"thumbRef\" tabindex=\"0\" class=\"ui-slider__thumb ui-slider__thumb-active\" :style=\"thumbStyle\" @keydown=\"handleKeyPress\">\n <div class=\"ui-slider__thumb-focused-contour\" />\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"ui-slider__input-wrapper d-flex\">\n <input v-if=\"props.mode === 'input'\" :value=\"realtimeVal\" class=\"ui-slider__value text-s\" @change=\"updateModelValue($event)\" />\n </div>\n </div>\n <!-- <div v-if=\"props.helper\" class=\"ui-slider__helper\">\n {{ props.helper }}\n </div> -->\n <div v-if=\"error\" class=\"ui-slider__error\">\n {{ error }}\n </div>\n </div>\n</template>\n"],"names":["slots","useSlots","emit","__emit","props","__props","data","reactive","range","computed","localValue","clamp","realtimeVal","ref","error","v","getErrorMessage","propsRef","breakpointsRef","useSliderBreakpoints","position","progressStyle","thumbStyle","barRef","thumbRef","watch","val","round","value","useMouseCapture","ev","tapIf","_a","unref","rect","dx","setModelValue","updateModelValue","event","handleKeyPress","e","nextStep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,EAAA,GAERC,IAAOC,GAEPC,IAAQC,GA2BRC,IAAOC,EAAS;AAAA,MACpB,YAAY;AAAA,IAAA,CACb,GAEKC,IAAQC,EAAS,MAAML,EAAM,MAAMA,EAAM,GAAG,GAE5CM,IAAaD,EAAS,MACnBE,GAAOP,EAAM,cAAc,KAAKE,EAAK,YAAYF,EAAM,KAAKA,EAAM,GAAG,CAC7E,GAEKQ,IAAcC,EAAIT,EAAM,UAAU,GAElCU,IAAQL,EAAS,MAAM;AAC3B,YAAMM,IAAIX,EAAM;AAEhB,aAAK,OAAO,SAASW,CAAC,IAIlBA,IAAIX,EAAM,MACL,cAAcA,EAAM,GAAG,KAG5BW,IAAIX,EAAM,MACL,cAAcA,EAAM,GAAG,KAGzBY,EAAgBZ,EAAM,KAAK,IAXzB;AAAA,IAYX,CAAC,GAEKa,IAAWR,EAAS,MAAML,CAAK,GAE/Bc,IAAiBC,EAAqBF,CAAQ,GAE9CG,IAAWX,EAAS,OAChBC,EAAW,QAAQN,EAAM,OAAOI,EAAM,KAC/C,GAEKa,IAAgBZ,EAAS,OAAO;AAAA,MACpC,OAAO,KAAK,MAAM,IAAIW,EAAS,SAAS,GAAG,IAAI;AAAA,IAAA,EAC/C,GAEIE,IAAab,EAAS,OAEnB;AAAA,MACL,OAAO,QAFK,KAAK,MAAM,IAAIW,EAA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M,OAAO,KAAK;AAE5I,MAAAgC,EAAchC,EAAM,aAAaqC,CAAQ;AAAA,IAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Slider.vue.js","sources":["../../src/components/Slider.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, reactive, ref, unref, useSlots, watch } from 'vue';\nimport { useMouseCapture } from '../composition/useMouseCapture';\nimport { tapIf } from '../helpers/functions';\nimport { clamp } from '../helpers/math';\nimport { PlTooltip } from './PlTooltip';\nimport type { SliderMode } from '../types';\nimport { useSliderBreakpoints } from '../composition/useSliderBreakpoints';\nimport { getErrorMessage } from '../helpers/error.ts';\n\nconst slots = useSlots();\n\nconst emit = defineEmits(['update:modelValue']);\n\nconst props = withDefaults(\n defineProps<{\n modelValue: number;\n min?: number;\n max: number;\n step?: number;\n label?: string;\n helper?: string;\n error?: unknown;\n mode?: SliderMode;\n measure?: string;\n breakpoints?: boolean;\n disabled?: boolean;\n }>(),\n {\n label: undefined,\n helper: undefined,\n error: undefined,\n min: 0,\n step: 1,\n mode: 'text',\n measure: '',\n breakpoints: false,\n disabled: false,\n },\n);\n\nconst data = reactive({\n deltaValue: 0,\n});\n\nconst range = computed(() => props.max - props.min);\n\nconst localValue = computed(() => {\n return clamp((props.modelValue ?? 0) + data.deltaValue, props.min, props.max);\n});\n\nconst realtimeVal = ref(props.modelValue);\n\nconst error = computed(() => {\n const v = props.modelValue;\n\n if (!Number.isFinite(v)) {\n return 'Not a number';\n }\n\n if (v < props.min) {\n return `Min value: ${props.min}`;\n }\n\n if (v > props.max) {\n return `Max value: ${props.max}`;\n }\n\n return getErrorMessage(props.error);\n});\n\nconst propsRef = computed(() => props);\n\nconst breakpointsRef = useSliderBreakpoints(propsRef);\n\nconst position = computed(() => {\n return (localValue.value - props.min) / range.value;\n});\n\nconst progressStyle = computed(() => ({\n right: Math.ceil((1 - position.value) * 100) + '%',\n}));\n\nconst thumbStyle = computed(() => {\n const value = Math.ceil((1 - position.value) * 100);\n return {\n right: `calc(${value}%) `,\n };\n});\n\nconst barRef = ref<HTMLElement>();\nconst thumbRef = ref<HTMLElement>();\n\nwatch(\n () => props.modelValue,\n (val) => {\n realtimeVal.value = val;\n },\n);\n\nfunction round(value: number) {\n const v = clamp(value, props.min, props.max);\n // This is the same as Math.round(v / props.step) * props.step but here we need this magic to avoid numbers like 3.00000000000000000004\n return Math.round((v + Number.EPSILON) * (1 / props.step)) / (1 / props.step);\n}\n\nuseMouseCapture(thumbRef, (ev) => {\n tapIf(unref(barRef)?.getBoundingClientRect(), (rect) => {\n const { dx } = ev;\n\n data.deltaValue = (dx / rect.width) * range.value;\n\n realtimeVal.value = round(clamp((props.modelValue ?? 0) + data.deltaValue, props.min, props.max));\n\n if (ev.stop) {\n emit('update:modelValue', round(localValue.value));\n data.deltaValue = 0;\n }\n });\n});\n\nfunction setModelValue(value: number) {\n emit('update:modelValue', round(value));\n}\n\nfunction updateModelValue(event: Event) {\n setModelValue(+(event.target as HTMLInputElement).value);\n}\n\nfunction handleKeyPress(e: { code: string; preventDefault(): void }) {\n if (['ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft', 'Enter'].includes(e.code)) {\n e.preventDefault();\n }\n\n const nextStep\n = e.code === 'ArrowUp' || e.code === 'ArrowRight' ? props.step * 1 : e.code === 'ArrowDown' || e.code === 'ArrowLeft' ? props.step * -1 : 0;\n\n setModelValue(props.modelValue + nextStep);\n}\n</script>\n\n<template>\n <div :class=\"props.disabled ? 'ui-slider__disabled' : undefined\" class=\"ui-slider__envelope\">\n <div :class=\"`ui-slider__mode-${props.mode}`\" class=\"ui-slider\">\n <div class=\"ui-slider__wrapper\">\n <div class=\"ui-slider__label-section\">\n <label v-if=\"label\" class=\"text-s\">\n <span>{{ label }}</span>\n <PlTooltip v-if=\"slots.tooltip\" class=\"info\" position=\"top\">\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <div v-if=\"props.mode === 'text'\" class=\"ui-slider__value-static text-s\">{{ realtimeVal }}{{ measure }}</div>\n </div>\n <div class=\"ui-slider__base\">\n <div class=\"ui-slider__container\">\n <div ref=\"barRef\" class=\"ui-slider__bar\">\n <div class=\"ui-slider__progress\" :style=\"progressStyle\" />\n </div>\n </div>\n <div class=\"ui-slider__container ui-slider__container-thumb\">\n <template v-if=\"props.breakpoints\">\n <div v-for=\"(item, index) in breakpointsRef\" :key=\"index\" :style=\"{ right: `${item}%` }\" class=\"ui-slider__thumb-step\"/>\n </template>\n <div ref=\"thumbRef\" tabindex=\"0\" class=\"ui-slider__thumb ui-slider__thumb-active\" :style=\"thumbStyle\" @keydown=\"handleKeyPress\">\n <div class=\"ui-slider__thumb-focused-contour\" />\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"ui-slider__input-wrapper d-flex\">\n <input v-if=\"props.mode === 'input'\" :value=\"realtimeVal\" class=\"ui-slider__value text-s\" @change=\"updateModelValue($event)\" />\n </div>\n </div>\n <!-- <div v-if=\"props.helper\" class=\"ui-slider__helper\">\n {{ props.helper }}\n </div> -->\n <div v-if=\"error\" class=\"ui-slider__error\">\n {{ error }}\n </div>\n </div>\n</template>\n"],"names":["slots","useSlots","emit","__emit","props","__props","data","reactive","range","computed","localValue","clamp","realtimeVal","ref","error","v","getErrorMessage","propsRef","breakpointsRef","useSliderBreakpoints","position","progressStyle","thumbStyle","barRef","thumbRef","watch","val","round","value","useMouseCapture","ev","tapIf","_a","unref","rect","dx","setModelValue","updateModelValue","event","handleKeyPress","e","nextStep","_createElementBlock","_createElementVNode","_normalizeClass","_hoisted_1","_hoisted_2","_openBlock","_hoisted_3","_unref","_createBlock","PlTooltip","_renderSlot","_ctx","_hoisted_4","_toDisplayString","_hoisted_5","_hoisted_6","_hoisted_7","_Fragment","_renderList","item","index","_hoisted_8","_cache","$event","_hoisted_10"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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+H,SAAA;AAAA;YAAzF,OAAO9B,EAAA;AAAA,YAAa,OAAM;AAAA,YAA2B,UAAMoD,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAE5B,EAAiB4B,CAAM;AAAA,UAAA;;;MAMnHnD,EAAA,cAAX4B,EAEM,OAFNwB,IAEMX,EADDzC,EAAA,KAAK,GAAA,CAAA;;;;"}
@@ -1,12 +1,12 @@
1
- import { defineComponent as T, useSlots as W, reactive as X, ref as d, computed as a, watch as Y, createElementBlock as m, openBlock as u, normalizeClass as N, createElementVNode as s, createCommentVNode as c, createBlock as $, toDisplayString as A, unref as b, withCtx as Z, renderSlot as ee, normalizeStyle as y, Fragment as te, renderList as le } from "vue";
2
- import { useMouseCapture as K } from "../composition/useMouseCapture.js";
3
- import { tapIf as U } from "../helpers/functions.js";
1
+ import { defineComponent as T, useSlots as W, reactive as X, ref as d, computed as a, watch as Y, createElementBlock as m, openBlock as u, normalizeClass as $, createElementVNode as s, createCommentVNode as c, createBlock as K, toDisplayString as M, unref as b, withCtx as Z, renderSlot as ee, normalizeStyle as y, Fragment as te, renderList as le } from "vue";
2
+ import { useMouseCapture as U } from "../composition/useMouseCapture.js";
3
+ import { tapIf as z } from "../helpers/functions.js";
4
4
  import { clamp as p } from "../helpers/math.js";
5
5
  import oe from "./PlTooltip/PlTooltip.vue.js";
6
6
  import se from "./InputRange.vue.js";
7
7
  import { useSliderBreakpoints as ae } from "../composition/useSliderBreakpoints.js";
8
- import { getErrorMessage as re } from "../helpers/error.js";
9
- const ie = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-section" }, ne = {
8
+ import { getErrorMessage as ie } from "../helpers/error.js";
9
+ const re = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-section" }, ne = {
10
10
  key: 0,
11
11
  class: "text-s"
12
12
  }, de = {
@@ -31,20 +31,20 @@ const ie = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
31
31
  disabled: { type: Boolean, default: !1 }
32
32
  },
33
33
  emits: ["update:modelValue"],
34
- setup(z, { emit: F }) {
35
- const I = W(), P = F, e = z, i = X({
34
+ setup(g, { emit: F }) {
35
+ const I = W(), P = F, e = g, r = X({
36
36
  deltaValue1: 0,
37
37
  deltaValue2: 0
38
- }), g = d(), M = d(), S = d(), f = d(e.modelValue), v = d(e.modelValue[0]), _ = d(e.modelValue[1]), j = a(() => e), O = ae(j), q = a(() => [v.value, _.value].sort((t, l) => t - l).join("-")), h = a(() => e.max - e.min), x = a(() => p((e.modelValue[0] ?? 0) + i.deltaValue1, e.min, e.max)), w = a(() => p((e.modelValue[1] ?? 0) + i.deltaValue2, e.min, e.max)), B = a(() => {
38
+ }), x = d(), S = d(), B = d(), f = d(e.modelValue), v = d(e.modelValue[0]), _ = d(e.modelValue[1]), j = a(() => e), O = ae(j), q = a(() => [v.value, _.value].sort((t, l) => t - l).join("-")), h = a(() => e.max - e.min), w = a(() => p((e.modelValue[0] ?? 0) + r.deltaValue1, e.min, e.max)), k = a(() => p((e.modelValue[1] ?? 0) + r.deltaValue2, e.min, e.max)), C = a(() => {
39
39
  const t = e.modelValue;
40
- return Array.isArray(t) && t.length === 2 && t.every((o) => Number.isFinite(o)) ? re(e.error) : "Expected model [number, number]";
41
- }), C = a(() => (x.value - e.min) / h.value), D = a(() => (w.value - e.min) / h.value), E = a(() => Q()), G = a(() => ({
42
- right: E.value[0] + "%",
43
- left: 100 - E.value[1] + "%"
40
+ return Array.isArray(t) && t.length === 2 && t.every((o) => Number.isFinite(o)) ? ie(e.error) : "Expected model [number, number]";
41
+ }), D = a(() => (w.value - e.min) / h.value), E = a(() => (k.value - e.min) / h.value), L = a(() => Q()), G = a(() => ({
42
+ right: L.value[0] + "%",
43
+ left: 100 - L.value[1] + "%"
44
44
  })), H = a(() => ({
45
- right: Math.ceil((1 - C.value) * 100) + "%"
46
- })), J = a(() => ({
47
45
  right: Math.ceil((1 - D.value) * 100) + "%"
46
+ })), J = a(() => ({
47
+ right: Math.ceil((1 - E.value) * 100) + "%"
48
48
  }));
49
49
  Y(
50
50
  () => e.modelValue,
@@ -52,22 +52,22 @@ const ie = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
52
52
  f.value = t, v.value = +t[0], _.value = +t[1];
53
53
  },
54
54
  { immediate: !0 }
55
- ), K(M, (t) => {
55
+ ), U(S, (t) => {
56
56
  var l;
57
- U((l = b(g)) == null ? void 0 : l.getBoundingClientRect(), (o) => {
58
- const { dx: r } = t;
59
- i.deltaValue1 = r / o.width * h.value, v.value = n(p((e.modelValue[0] ?? 0) + i.deltaValue1, e.min, e.max)), f.value = [v.value, _.value].sort((k, R) => k - R), t.stop && (V([n(x.value), n(w.value)]), i.deltaValue1 = 0);
57
+ z((l = b(x)) == null ? void 0 : l.getBoundingClientRect(), (o) => {
58
+ const { dx: i } = t;
59
+ r.deltaValue1 = i / o.width * h.value, v.value = n(p((e.modelValue[0] ?? 0) + r.deltaValue1, e.min, e.max)), f.value = [v.value, _.value].sort((R, A) => R - A), t.stop && (V([n(w.value), n(k.value)]), r.deltaValue1 = 0);
60
60
  });
61
- }), K(S, (t) => {
61
+ }), U(B, (t) => {
62
62
  var l;
63
- U((l = b(g)) == null ? void 0 : l.getBoundingClientRect(), (o) => {
64
- const { dx: r } = t;
65
- i.deltaValue2 = r / o.width * h.value, _.value = n(p((e.modelValue[1] ?? 0) + i.deltaValue2, e.min, e.max)), f.value = [v.value, _.value].sort((k, R) => k - R), t.stop && (V([n(x.value), n(w.value)]), i.deltaValue2 = 0);
63
+ z((l = b(x)) == null ? void 0 : l.getBoundingClientRect(), (o) => {
64
+ const { dx: i } = t;
65
+ r.deltaValue2 = i / o.width * h.value, _.value = n(p((e.modelValue[1] ?? 0) + r.deltaValue2, e.min, e.max)), f.value = [v.value, _.value].sort((R, A) => R - A), t.stop && (V([n(w.value), n(k.value)]), r.deltaValue2 = 0);
66
66
  });
67
67
  });
68
68
  function Q() {
69
- const t = Math.ceil((1 - C.value) * 100), l = Math.ceil((1 - D.value) * 100);
70
- return [t, l].sort((o, r) => o - r);
69
+ const t = Math.ceil((1 - D.value) * 100), l = Math.ceil((1 - E.value) * 100);
70
+ return [t, l].sort((o, i) => o - i);
71
71
  }
72
72
  function n(t) {
73
73
  const l = p(t, e.min, e.max);
@@ -76,22 +76,22 @@ const ie = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
76
76
  function V(t) {
77
77
  P("update:modelValue", t);
78
78
  }
79
- function L(t, l) {
79
+ function N(t, l) {
80
80
  ["ArrowDown", "ArrowUp", "ArrowRight", "ArrowLeft", "Enter"].includes(t.code) && t.preventDefault();
81
- const o = t.code === "ArrowUp" || t.code === "ArrowRight" ? e.step * 1 : t.code === "ArrowDown" || t.code === "ArrowLeft" ? e.step * -1 : 0, r = [...e.modelValue];
82
- r[l] = p(r[l] + o, e.min, e.max), V(r);
81
+ const o = t.code === "ArrowUp" || t.code === "ArrowRight" ? e.step * 1 : t.code === "ArrowDown" || t.code === "ArrowLeft" ? e.step * -1 : 0, i = [...e.modelValue];
82
+ i[l] = p(i[l] + o, e.min, e.max), V(i);
83
83
  }
84
84
  return (t, l) => (u(), m("div", {
85
- class: N([e.disabled ? "ui-slider__disabled" : void 0, "ui-slider__envelope"])
85
+ class: $([e.disabled ? "ui-slider__disabled" : void 0, "ui-slider__envelope"])
86
86
  }, [
87
87
  s("div", {
88
- class: N([`ui-slider__mode-${e.mode}`, "ui-slider"])
88
+ class: $([`ui-slider__mode-${e.mode}`, "ui-slider"])
89
89
  }, [
90
- s("div", ie, [
90
+ s("div", re, [
91
91
  s("div", ue, [
92
- t.label ? (u(), m("label", ne, [
93
- s("span", null, A(t.label), 1),
94
- b(I).tooltip ? (u(), $(b(oe), {
92
+ g.label ? (u(), m("label", ne, [
93
+ s("span", null, M(g.label), 1),
94
+ b(I).tooltip ? (u(), K(b(oe), {
95
95
  key: 0,
96
96
  class: "info",
97
97
  position: "top"
@@ -102,13 +102,13 @@ const ie = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
102
102
  _: 3
103
103
  })) : c("", !0)
104
104
  ])) : c("", !0),
105
- e.mode === "text" ? (u(), m("div", de, A(q.value), 1)) : c("", !0)
105
+ e.mode === "text" ? (u(), m("div", de, M(q.value), 1)) : c("", !0)
106
106
  ]),
107
107
  s("div", me, [
108
108
  s("div", ce, [
109
109
  s("div", {
110
110
  ref_key: "barRef",
111
- ref: g,
111
+ ref: x,
112
112
  class: "ui-slider__bar"
113
113
  }, [
114
114
  s("div", {
@@ -118,36 +118,36 @@ const ie = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
118
118
  ], 512)
119
119
  ]),
120
120
  s("div", pe, [
121
- e.breakpoints ? (u(!0), m(te, { key: 0 }, le(b(O), (o, r) => (u(), m("div", {
122
- key: r,
121
+ e.breakpoints ? (u(!0), m(te, { key: 0 }, le(b(O), (o, i) => (u(), m("div", {
122
+ key: i,
123
123
  style: y({ right: `${o}%` }),
124
124
  class: "ui-slider__thumb-step"
125
125
  }, null, 4))), 128)) : c("", !0),
126
126
  s("div", {
127
127
  ref_key: "thumbRef1",
128
- ref: M,
128
+ ref: S,
129
129
  style: y(H.value),
130
130
  class: "ui-slider__thumb",
131
131
  tabindex: "0",
132
- onKeydown: l[0] || (l[0] = (o) => L(o, 0))
133
- }, l[3] || (l[3] = [
132
+ onKeydown: l[0] || (l[0] = (o) => N(o, 0))
133
+ }, [...l[3] || (l[3] = [
134
134
  s("div", { class: "ui-slider__thumb-focused-contour" }, null, -1)
135
- ]), 36),
135
+ ])], 36),
136
136
  s("div", {
137
137
  ref_key: "thumbRef2",
138
- ref: S,
138
+ ref: B,
139
139
  style: y(J.value),
140
140
  class: "ui-slider__thumb",
141
141
  tabindex: "0",
142
- onKeydown: l[1] || (l[1] = (o) => L(o, 1))
143
- }, l[4] || (l[4] = [
142
+ onKeydown: l[1] || (l[1] = (o) => N(o, 1))
143
+ }, [...l[4] || (l[4] = [
144
144
  s("div", { class: "ui-slider__thumb-focused-contour" }, null, -1)
145
- ]), 36)
145
+ ])], 36)
146
146
  ])
147
147
  ])
148
148
  ]),
149
149
  s("div", fe, [
150
- e.mode === "input" ? (u(), $(se, {
150
+ e.mode === "input" ? (u(), K(se, {
151
151
  key: 0,
152
152
  modelValue: f.value,
153
153
  "onUpdate:modelValue": l[2] || (l[2] = (o) => f.value = o),
@@ -156,7 +156,7 @@ const ie = { class: "ui-slider__wrapper" }, ue = { class: "ui-slider__label-sect
156
156
  }, null, 8, ["modelValue"])) : c("", !0)
157
157
  ])
158
158
  ], 2),
159
- B.value ? (u(), m("div", ve, A(B.value), 1)) : c("", !0)
159
+ C.value ? (u(), m("div", ve, M(C.value), 1)) : c("", !0)
160
160
  ], 2));
161
161
  }
162
162
  });