@unoff/ui 1.21.1 → 1.21.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 (131) hide show
  1. package/README.md +2 -2
  2. package/dist/assets/Bar.css +1 -1
  3. package/dist/assets/FormItem.css +1 -1
  4. package/dist/assets/MultipleSlider.css +1 -1
  5. package/dist/assets/SimpleSlider.css +1 -1
  6. package/dist/assets/styles/icons/icons.css +1 -1
  7. package/dist/assets/styles/icons/styles/figma.css +1 -1
  8. package/dist/assets/styles/icons/styles/framer.css +1 -1
  9. package/dist/assets/styles/icons/styles/penpot.css +1 -1
  10. package/dist/assets/styles/icons/styles/sketch.css +1 -1
  11. package/dist/components/actions/accordion/Accordion.d.ts +0 -1
  12. package/dist/components/actions/accordion/Accordion.d.ts.map +1 -1
  13. package/dist/components/actions/button/Button.d.ts +2 -3
  14. package/dist/components/actions/button/Button.d.ts.map +1 -1
  15. package/dist/components/actions/button/Button.js.map +1 -1
  16. package/dist/components/actions/card/Card.d.ts +0 -1
  17. package/dist/components/actions/card/Card.d.ts.map +1 -1
  18. package/dist/components/actions/knob/Knob.d.ts +2 -3
  19. package/dist/components/actions/knob/Knob.d.ts.map +1 -1
  20. package/dist/components/actions/knob/Knob.js.map +1 -1
  21. package/dist/components/actions/menu/Menu.d.ts +2 -3
  22. package/dist/components/actions/menu/Menu.d.ts.map +1 -1
  23. package/dist/components/actions/menu/Menu.js.map +1 -1
  24. package/dist/components/assets/avatar/Avatar.d.ts +0 -1
  25. package/dist/components/assets/avatar/Avatar.d.ts.map +1 -1
  26. package/dist/components/assets/icon/Icon.d.ts +0 -1
  27. package/dist/components/assets/icon/Icon.d.ts.map +1 -1
  28. package/dist/components/assets/section-title/SectionTitle.d.ts +0 -1
  29. package/dist/components/assets/section-title/SectionTitle.d.ts.map +1 -1
  30. package/dist/components/assets/text/Text.d.ts +0 -1
  31. package/dist/components/assets/text/Text.d.ts.map +1 -1
  32. package/dist/components/assets/thumbnail/Thumbnail.d.ts +0 -1
  33. package/dist/components/assets/thumbnail/Thumbnail.d.ts.map +1 -1
  34. package/dist/components/dialogs/consent/Consent.d.ts +2 -3
  35. package/dist/components/dialogs/consent/Consent.d.ts.map +1 -1
  36. package/dist/components/dialogs/consent/Consent.js.map +1 -1
  37. package/dist/components/dialogs/dialog/Dialog.d.ts +0 -1
  38. package/dist/components/dialogs/dialog/Dialog.d.ts.map +1 -1
  39. package/dist/components/dialogs/message/Message.d.ts +0 -1
  40. package/dist/components/dialogs/notification/Notification.d.ts +0 -1
  41. package/dist/components/dialogs/notification/Notification.d.ts.map +1 -1
  42. package/dist/components/dialogs/semantic-message/SemanticMessage.d.ts +2 -3
  43. package/dist/components/dialogs/semantic-message/SemanticMessage.d.ts.map +1 -1
  44. package/dist/components/dialogs/semantic-message/SemanticMessage.js.map +1 -1
  45. package/dist/components/inputs/dropdown/Dropdown.d.ts +2 -3
  46. package/dist/components/inputs/dropdown/Dropdown.d.ts.map +1 -1
  47. package/dist/components/inputs/dropdown/Dropdown.js.map +1 -1
  48. package/dist/components/inputs/dropzone/Dropzone.d.ts +2 -3
  49. package/dist/components/inputs/dropzone/Dropzone.d.ts.map +1 -1
  50. package/dist/components/inputs/dropzone/Dropzone.js.map +1 -1
  51. package/dist/components/inputs/input/Input.d.ts +2 -3
  52. package/dist/components/inputs/input/Input.d.ts.map +1 -1
  53. package/dist/components/inputs/input/Input.js.map +1 -1
  54. package/dist/components/inputs/inputs-bar/InputsBar.d.ts +0 -1
  55. package/dist/components/inputs/inputs-bar/InputsBar.d.ts.map +1 -1
  56. package/dist/components/inputs/multiple-slider/MultipleSlider.d.ts +15 -8
  57. package/dist/components/inputs/multiple-slider/MultipleSlider.d.ts.map +1 -1
  58. package/dist/components/inputs/multiple-slider/MultipleSlider.js +270 -241
  59. package/dist/components/inputs/multiple-slider/MultipleSlider.js.map +1 -1
  60. package/dist/components/inputs/multiple-slider/actions/addStop.d.ts.map +1 -1
  61. package/dist/components/inputs/multiple-slider/actions/deleteStop.d.ts.map +1 -1
  62. package/dist/components/inputs/multiple-slider/actions/shiftLeftStop.d.ts.map +1 -1
  63. package/dist/components/inputs/multiple-slider/actions/shiftRightStop.d.ts.map +1 -1
  64. package/dist/components/inputs/select/Select.d.ts +3 -4
  65. package/dist/components/inputs/select/Select.d.ts.map +1 -1
  66. package/dist/components/inputs/select/Select.js.map +1 -1
  67. package/dist/components/inputs/simple-slider/SimpleSlider.d.ts +14 -4
  68. package/dist/components/inputs/simple-slider/SimpleSlider.d.ts.map +1 -1
  69. package/dist/components/inputs/simple-slider/SimpleSlider.js +94 -74
  70. package/dist/components/inputs/simple-slider/SimpleSlider.js.map +1 -1
  71. package/dist/components/lists/actions-item/ActionsItem.d.ts +0 -1
  72. package/dist/components/lists/actions-list/ActionsList.d.ts +4 -5
  73. package/dist/components/lists/actions-list/ActionsList.d.ts.map +1 -1
  74. package/dist/components/lists/actions-list/ActionsList.js.map +1 -1
  75. package/dist/components/lists/color-item/ColorItem.d.ts +0 -1
  76. package/dist/components/lists/color-item/ColorItem.d.ts.map +1 -1
  77. package/dist/components/lists/draggable-item/DraggableItem.d.ts +2 -3
  78. package/dist/components/lists/draggable-item/DraggableItem.d.ts.map +1 -1
  79. package/dist/components/lists/draggable-item/DraggableItem.js.map +1 -1
  80. package/dist/components/lists/keyboard-shortcut-item/KeyboardShortcutItem.d.ts +0 -1
  81. package/dist/components/lists/keyboard-shortcut-item/KeyboardShortcutItem.d.ts.map +1 -1
  82. package/dist/components/lists/members-list/MembersList.d.ts +0 -1
  83. package/dist/components/lists/sortable-list/SortableList.d.ts +2 -3
  84. package/dist/components/lists/sortable-list/SortableList.d.ts.map +1 -1
  85. package/dist/components/lists/sortable-list/SortableList.js.map +1 -1
  86. package/dist/components/lists/tabs/Tabs.d.ts +0 -1
  87. package/dist/components/lists/tabs/Tabs.d.ts.map +1 -1
  88. package/dist/components/slots/bar/Bar.d.ts +6 -2
  89. package/dist/components/slots/bar/Bar.d.ts.map +1 -1
  90. package/dist/components/slots/bar/Bar.js +21 -18
  91. package/dist/components/slots/bar/Bar.js.map +1 -1
  92. package/dist/components/slots/draggable-window/DraggableWindow.d.ts +0 -1
  93. package/dist/components/slots/draggable-window/DraggableWindow.d.ts.map +1 -1
  94. package/dist/components/slots/drawer/Drawer.d.ts +1 -2
  95. package/dist/components/slots/drawer/Drawer.d.ts.map +1 -1
  96. package/dist/components/slots/form-item/FormItem.d.ts +0 -1
  97. package/dist/components/slots/form-item/FormItem.d.ts.map +1 -1
  98. package/dist/components/slots/layout/Layout.d.ts +0 -1
  99. package/dist/components/slots/layout/Layout.d.ts.map +1 -1
  100. package/dist/components/slots/list/List.d.ts +0 -1
  101. package/dist/components/slots/list/List.d.ts.map +1 -1
  102. package/dist/components/slots/popin/Popin.d.ts +0 -1
  103. package/dist/components/slots/popin/Popin.d.ts.map +1 -1
  104. package/dist/components/slots/section/Section.d.ts +1 -2
  105. package/dist/components/slots/section/Section.d.ts.map +1 -1
  106. package/dist/components/slots/simple-item/SimpleItem.d.ts +0 -1
  107. package/dist/components/tags/chip/Chip.d.ts +0 -1
  108. package/dist/components/tags/chip/Chip.d.ts.map +1 -1
  109. package/dist/components/tags/color-chip/ColorChip.d.ts +2 -3
  110. package/dist/components/tags/color-chip/ColorChip.d.ts.map +1 -1
  111. package/dist/components/tags/color-chip/ColorChip.js.map +1 -1
  112. package/dist/components/tags/icon-chip/IconChip.d.ts +2 -3
  113. package/dist/components/tags/icon-chip/IconChip.d.ts.map +1 -1
  114. package/dist/components/tags/icon-chip/IconChip.js.map +1 -1
  115. package/dist/components/tags/tooltip/Tooltip.d.ts +0 -1
  116. package/dist/components/tags/tooltip/Tooltip.d.ts.map +1 -1
  117. package/dist/index.d.ts +1 -1
  118. package/dist/index.d.ts.map +1 -1
  119. package/dist/index.js +2 -0
  120. package/dist/index.js.map +1 -1
  121. package/dist/styles/icons/icons.module.js +114 -110
  122. package/dist/styles/icons/icons.module.js.map +1 -1
  123. package/dist/tests/setup.d.ts +0 -1
  124. package/dist/types/consent.types.d.ts +0 -1
  125. package/dist/types/consent.types.d.ts.map +1 -1
  126. package/dist/types/icon.types.d.ts +2 -1
  127. package/dist/types/icon.types.d.ts.map +1 -1
  128. package/dist/types/icon.types.js +114 -1
  129. package/dist/types/icon.types.js.map +1 -1
  130. package/dist/types/list.types.d.ts +0 -1
  131. package/package.json +18 -15
@@ -1,20 +1,20 @@
1
1
  import '../../../assets/MultipleSlider.css';
2
- import { jsxs as I, jsx as g } from "react/jsx-runtime";
2
+ import { jsx as m, jsxs as y } from "react/jsx-runtime";
3
3
  import T from "react";
4
4
  import { r as f } from "../../../do-map-2nhWP1KI.js";
5
- import { t as E } from "../../../do-classnames-DSDFCvzy.js";
5
+ import { t as I } from "../../../do-classnames-DSDFCvzy.js";
6
6
  import w from "../../tags/icon-chip/IconChip.js";
7
- import D from "../../tags/chip/Chip.js";
8
- import F from "../../actions/knob/Knob.js";
9
- const M = (h, e, i, l = "LINEAR") => {
7
+ import A from "../../tags/chip/Chip.js";
8
+ import E from "../../actions/knob/Knob.js";
9
+ const F = (h, e, a, o = "LINEAR") => {
10
10
  let t = 1;
11
- const p = {};
11
+ const c = {};
12
12
  return h.map((r) => {
13
- p[r] = l !== "NONE" ? parseFloat(f(A(l, t), 0, 1, e, i).toFixed(1)) : r, t -= 1 / (h.length - 1), t < 0.01 && (t = 0);
14
- }), p;
15
- }, A = (h, e) => {
16
- var i;
17
- const l = {
13
+ c[r] = o !== "NONE" ? parseFloat(f(D(o, t), 0, 1, e, a).toFixed(1)) : r, t -= 1 / (h.length - 1), t < 0.01 && (t = 0);
14
+ }), c;
15
+ }, D = (h, e) => {
16
+ var a;
17
+ const o = {
18
18
  LINEAR: (t) => t,
19
19
  EASEIN_SINE: (t) => Math.pow(t, 1.2),
20
20
  EASEOUT_SINE: (t) => 1 - Math.pow(1 - t, 1.2),
@@ -26,74 +26,74 @@ const M = (h, e, i, l = "LINEAR") => {
26
26
  EASEOUT_CUBIC: (t) => Math.sin(t * Math.PI / 2),
27
27
  EASEINOUT_CUBIC: (t) => -(Math.cos(Math.PI * t) - 1) / 2
28
28
  };
29
- return (i = l[h ?? "LINEAR"]) == null ? void 0 : i.call(l, e);
30
- }, _ = (h, e, i, l, t, p = 1) => {
31
- const r = [], a = i ? p * 10 : p;
32
- Object.entries(h).sort((c, u) => c[1] - u[1]).forEach((c) => {
33
- r.push(c[0]);
29
+ return (a = o[h ?? "LINEAR"]) == null ? void 0 : a.call(o, e);
30
+ }, _ = (h, e, a, o, t, c = 1) => {
31
+ const r = [], n = a ? c * 10 : c;
32
+ Object.entries(h).sort((d, u) => d[1] - u[1]).forEach((d) => {
33
+ r.push(d[0]);
34
34
  });
35
- const n = r.indexOf(
35
+ const i = r.indexOf(
36
36
  e.dataset.id
37
- ), o = h, s = o[r[n]];
38
- return s + a <= l ? o[r[n]] = l : s + a >= t ? o[r[n]] = t : o[r[n]] = o[r[n]] + a, {
39
- scale: o
37
+ ), l = h, s = l[r[i]];
38
+ return s + n <= o ? l[r[i]] = o : s + n >= t ? l[r[i]] = t : l[r[i]] = l[r[i]] + n, {
39
+ scale: l
40
40
  };
41
- }, N = (h, e, i, l, t, p = 1) => {
42
- const r = [], a = i ? p * 10 : p;
43
- Object.entries(h).sort((c, u) => c[1] - u[1]).forEach((c) => {
44
- r.push(c[0]);
41
+ }, N = (h, e, a, o, t, c = 1) => {
42
+ const r = [], n = a ? c * 10 : c;
43
+ Object.entries(h).sort((d, u) => d[1] - u[1]).forEach((d) => {
44
+ r.push(d[0]);
45
45
  });
46
- const n = r.indexOf(
46
+ const i = r.indexOf(
47
47
  e.dataset.id
48
- ), o = h, s = o[r[n]];
49
- return s - a <= l ? o[r[n]] = l : s - a >= t ? o[r[n]] = t : o[r[n]] = o[r[n]] - a, {
50
- scale: o
48
+ ), l = h, s = l[r[i]];
49
+ return s - n <= o ? l[r[i]] = o : s - n >= t ? l[r[i]] = t : l[r[i]] = l[r[i]] - n, {
50
+ scale: l
51
51
  };
52
52
  }, O = (h) => {
53
53
  const e = Math.floor(Math.abs(h)).toString().length;
54
54
  return Math.pow(10, e - 1);
55
55
  }, L = (h, e) => {
56
- const i = Object.entries(h).map(([a, n]) => ({
57
- index: parseFloat(a),
58
- value: n
59
- })).filter((a) => a.index > 0), l = Math.min(...i.map((a) => a.index)), t = O(l), p = i.filter(
60
- (a) => a.index !== parseFloat(e.dataset.id)
61
- ), r = p.reduce(
62
- (a, n, o) => {
63
- const s = Math.max(1, o + 1) * t;
64
- return a[s] = p[o].value, a;
56
+ const a = Object.entries(h).map(([n, i]) => ({
57
+ index: parseFloat(n),
58
+ value: i
59
+ })).filter((n) => n.index > 0), o = Math.min(...a.map((n) => n.index)), t = O(o), c = a.filter(
60
+ (n) => n.index !== parseFloat(e.dataset.id)
61
+ ), r = c.reduce(
62
+ (n, i, l) => {
63
+ const s = Math.max(1, l + 1) * t;
64
+ return n[s] = c[l].value, n;
65
65
  },
66
66
  {}
67
67
  );
68
68
  return {
69
69
  scale: r,
70
- stops: Object.keys(r).map((a) => parseFloat(a)),
70
+ stops: Object.keys(r).map((n) => parseFloat(n)),
71
71
  min: Math.min(...Object.values(r)),
72
72
  max: Math.max(...Object.values(r))
73
73
  };
74
74
  }, C = (h) => {
75
75
  const e = Math.floor(Math.abs(h)).toString().length;
76
76
  return Math.pow(10, e - 1);
77
- }, K = (h, e, i, l) => {
78
- const t = Object.entries(e).map(([s, c]) => ({
77
+ }, K = (h, e, a, o) => {
78
+ const t = Object.entries(e).map(([s, d]) => ({
79
79
  index: Math.max(1, parseFloat(s)),
80
- value: c
81
- })).filter((s) => s.index > 0), p = C(Math.min(...t.map((s) => s.index))), r = t[0].value > t[t.length - 1].value, a = h.target, n = parseFloat(
82
- f(h.layerX, 0, a.offsetWidth, i, l).toFixed(1)
80
+ value: d
81
+ })).filter((s) => s.index > 0), c = C(Math.min(...t.map((s) => s.index))), r = t[0].value > t[t.length - 1].value, n = h.target, i = parseFloat(
82
+ f(h.layerX, 0, n.offsetWidth, a, o).toFixed(1)
83
83
  );
84
84
  t.push({
85
- index: Math.max(...t.map((s) => s.index)) + p,
86
- value: n
87
- }), t.sort((s, c) => r ? c.value - s.value : s.value - c.value);
88
- const o = t.reduce(
89
- (s, c, u) => (s[(u + 1) * p] = c.value, s),
85
+ index: Math.max(...t.map((s) => s.index)) + c,
86
+ value: i
87
+ }), t.sort((s, d) => r ? d.value - s.value : s.value - d.value);
88
+ const l = t.reduce(
89
+ (s, d, u) => (s[(u + 1) * c] = d.value, s),
90
90
  {}
91
91
  );
92
92
  return {
93
- scale: o,
94
- stops: Object.keys(o).map((s) => parseFloat(s)),
95
- min: Math.min(...Object.values(o)),
96
- max: Math.max(...Object.values(o))
93
+ scale: l,
94
+ stops: Object.keys(l).map((s) => parseFloat(s)),
95
+ min: Math.min(...Object.values(l)),
96
+ max: Math.max(...Object.values(l))
97
97
  };
98
98
  };
99
99
  class H extends T.Component {
@@ -104,10 +104,8 @@ class H extends T.Component {
104
104
  min: 0,
105
105
  max: 100
106
106
  },
107
- colors: {
108
- min: "white",
109
- max: "white"
110
- },
107
+ hasProgressBar: !1,
108
+ hasPadding: !0,
111
109
  isBlocked: !1,
112
110
  isNew: !1
113
111
  };
@@ -118,186 +116,202 @@ class H extends T.Component {
118
116
  };
119
117
  }
120
118
  // Handlers
121
- validHandler = (e, i) => {
122
- const { scale: l, onChange: t, range: p } = this.props, r = p.step || 0.1, a = l ?? {}, n = i.target;
123
- if (n.value !== "") {
124
- let o = parseFloat(n.value);
125
- o = Math.round(o / r) * r, o > parseFloat(n.max) ? o = parseFloat(n.max) : o < parseFloat(n.min) && (o = parseFloat(n.min));
119
+ validHandler = (e, a) => {
120
+ const { scale: o, onChange: t, range: c } = this.props, r = c.step || 0.1, n = o ?? {}, i = a.target;
121
+ if (i.value !== "") {
122
+ let l = parseFloat(i.value);
123
+ l = Math.round(l / r) * r, l > parseFloat(i.max) ? l = parseFloat(i.max) : l < parseFloat(i.min) && (l = parseFloat(i.min));
126
124
  const s = r.toString().split(".")[1]?.length || 0;
127
- a[e] = parseFloat(o.toFixed(s)), t("TYPED", {
128
- scale: a
125
+ n[e] = parseFloat(l.toFixed(s)), t("TYPED", {
126
+ scale: n
129
127
  });
130
128
  }
131
129
  };
132
130
  // Direct Actions
133
131
  onGrab = (e) => {
134
132
  e.stopPropagation();
135
- const i = e.currentTarget, l = i.parentElement, t = e.clientX - e.currentTarget.getBoundingClientRect().left - e.currentTarget.getBoundingClientRect().width / 2, p = l.getBoundingClientRect(), r = p.width, a = l.parentElement, n = Array.from(l.children);
133
+ const a = e.currentTarget, o = a.parentElement, t = e.clientX - e.currentTarget.getBoundingClientRect().left - e.currentTarget.getBoundingClientRect().width / 2, c = o.getBoundingClientRect(), r = c.width, n = o.parentElement, i = Array.from(
134
+ o.children
135
+ ).filter((s) => s.dataset.id !== void 0);
136
136
  this.setState({
137
- activeKnobId: i.dataset.id || null
137
+ activeKnobId: a.dataset.id || null
138
138
  });
139
- const o = (s) => {
140
- const { range: c, onChange: u } = this.props, d = {};
141
- n.forEach(
142
- (m) => d[m.dataset.id] = parseFloat(
139
+ const l = (s) => {
140
+ const { range: d, onChange: u } = this.props, p = {};
141
+ i.forEach(
142
+ (g) => p[g.dataset.id] = parseFloat(
143
143
  f(
144
- parseFloat(m.style.left.replace("%", "")),
144
+ parseFloat(g.style.left.replace("%", "")),
145
145
  0,
146
146
  100,
147
- c.min,
148
- c.max
147
+ d.min,
148
+ d.max
149
149
  ).toFixed(1)
150
150
  )
151
151
  ), u(s, {
152
- scale: d
152
+ scale: p
153
153
  });
154
154
  };
155
- i.style.zIndex = "2", document.onmousemove = (s) => this.onSlide(
155
+ a.style.zIndex = "2", document.onmousemove = (s) => this.onSlide(
156
156
  s,
157
- a,
158
- l,
159
157
  n,
158
+ o,
160
159
  i,
160
+ a,
161
161
  t,
162
162
  r,
163
- p,
164
- (c) => o(c)
165
- ), document.onmouseup = () => this.onRelease(n, i, (s) => o(s));
163
+ c,
164
+ (d) => l(d)
165
+ ), document.onmouseup = () => this.onRelease(i, a, (s) => l(s));
166
166
  };
167
- onSlide = (e, i, l, t, p, r, a, n, o) => {
168
- const { min: s, max: c, step: u = 0.1 } = this.props.range;
169
- let d = e.clientX - n.left - r;
170
- if (d <= 0 ? d = 0 : d >= a && (d = a), p === l.firstChild && e.shiftKey)
167
+ onSlide = (e, a, o, t, c, r, n, i, l) => {
168
+ const { min: s, max: d, step: u = 0.1 } = this.props.range;
169
+ let p = e.clientX - i.left - r;
170
+ if (p <= 0 ? p = 0 : p >= n && (p = n), c === o.firstChild && e.shiftKey)
171
171
  return this.distributeStops(
172
172
  "MIN",
173
- parseFloat(f(d, 0, a, s, c).toFixed(1)),
173
+ parseFloat(f(p, 0, n, s, d).toFixed(1)),
174
174
  t
175
175
  );
176
- if (p === l.lastChild && e.shiftKey)
176
+ if (c === o.lastChild && e.shiftKey)
177
177
  return this.distributeStops(
178
178
  "MAX",
179
- parseFloat(f(d, 0, a, s, c).toFixed(1)),
179
+ parseFloat(f(p, 0, n, s, d).toFixed(1)),
180
180
  t
181
181
  );
182
182
  if (e.ctrlKey || e.metaKey)
183
- if (d < p.offsetLeft - l.firstChild.offsetLeft || d > a - l.lastChild.offsetLeft + p.offsetLeft)
184
- d = p.offsetLeft;
183
+ if (p < c.offsetLeft - o.firstChild.offsetLeft || p > n - o.lastChild.offsetLeft + c.offsetLeft)
184
+ p = c.offsetLeft;
185
185
  else
186
186
  return this.linkStops(
187
- parseFloat(f(d, 0, a, s, c).toFixed(1)),
188
- p,
187
+ parseFloat(f(p, 0, n, s, d).toFixed(1)),
188
+ c,
189
189
  t
190
190
  );
191
191
  e.ctrlKey === !1 && e.metaKey === !1 && e.shiftKey === !1 && this.setState({
192
192
  isTooltipDisplay: Array(t.length).fill(!1)
193
193
  });
194
- const m = f(d, 0, a, s, c), y = Math.round(m / u) * u, S = u.toString().split(".")[1]?.length || 0;
194
+ const g = f(p, 0, n, s, d), x = Math.round(g / u) * u, S = u.toString().split(".")[1]?.length || 0;
195
195
  if (u >= 1) {
196
- const x = parseFloat(
196
+ const v = parseFloat(
197
197
  f(
198
- parseFloat(p.style.left.replace("%", "")),
198
+ parseFloat(c.style.left.replace("%", "")),
199
199
  0,
200
200
  100,
201
201
  s,
202
- c
202
+ d
203
203
  ).toFixed(S)
204
- ), b = parseFloat(y.toFixed(S));
205
- if (x !== b) {
206
- const v = f(y, s, c, 0, 100);
207
- p.style.left = v.toFixed(S) + "%", requestAnimationFrame(() => {
208
- p.focus();
209
- }), o("UPDATING");
204
+ ), b = parseFloat(x.toFixed(S));
205
+ if (v !== b) {
206
+ const M = f(x, s, d, 0, 100);
207
+ c.style.left = M.toFixed(S) + "%", requestAnimationFrame(() => {
208
+ c.focus();
209
+ }), l("UPDATING");
210
210
  }
211
211
  } else {
212
- const x = f(y, s, c, 0, 100);
213
- p.style.left = x.toFixed(S) + "%", requestAnimationFrame(() => {
214
- p.focus();
215
- }), o("UPDATING");
212
+ const v = f(x, s, d, 0, 100);
213
+ c.style.left = v.toFixed(S) + "%", requestAnimationFrame(() => {
214
+ c.focus();
215
+ }), l("UPDATING");
216
216
  }
217
217
  document.body.style.cursor = "ew-resize";
218
218
  };
219
- onRelease = (e, i, l) => {
220
- document.onmousemove = null, document.onmouseup = null, i.onmouseup = null, i.style.zIndex = "1", this.setState({
219
+ onRelease = (e, a, o) => {
220
+ document.onmousemove = null, document.onmouseup = null, a.onmouseup = null, a.style.zIndex = "1", this.setState({
221
221
  activeKnobId: null
222
222
  }), requestAnimationFrame(() => {
223
- i.focus();
223
+ a.focus();
224
224
  }), this.setState({
225
225
  isTooltipDisplay: Array(e.length).fill(!1)
226
- }), l("RELEASED"), document.body.style.cursor = "";
226
+ }), o("RELEASED"), document.body.style.cursor = "";
227
227
  };
228
228
  onAdd = (e) => {
229
- const { scale: i, onChange: l } = this.props, { min: t, max: p } = this.props.range, r = K(e.nativeEvent, i, t, p);
230
- l("SHIFTED", r, "ADD_STOP");
229
+ const { scale: a, onChange: o } = this.props, { min: t, max: c } = this.props.range, r = K(e.nativeEvent, a, t, c);
230
+ o("SHIFTED", r, "ADD_STOP");
231
231
  };
232
232
  onDelete = (e) => {
233
- const { scale: i, onChange: l } = this.props, t = L(i, e);
234
- l("SHIFTED", t, "DELETE_STOP");
233
+ const { scale: a, onChange: o } = this.props, t = L(a, e);
234
+ o("SHIFTED", t, "DELETE_STOP");
235
235
  };
236
- onShiftRight = (e, i) => {
237
- const { scale: l, onChange: t } = this.props, { min: p, max: r, step: a = 1 } = this.props.range, n = _(l, e, i, p, r, a);
238
- t("SHIFTED", n), requestAnimationFrame(() => {
239
- const o = e.closest(".multiple-slider__range");
240
- if (o) {
241
- const s = o.querySelector(
236
+ onShiftRight = (e, a) => {
237
+ const { scale: o, onChange: t } = this.props, { min: c, max: r, step: n = 1 } = this.props.range, i = _(o, e, a, c, r, n);
238
+ t("SHIFTED", i), requestAnimationFrame(() => {
239
+ const l = e.closest(".multiple-slider__range");
240
+ if (l) {
241
+ const s = l.querySelector(
242
242
  `[data-id="${e.dataset.id}"]`
243
243
  );
244
244
  s instanceof HTMLElement && s.focus();
245
245
  }
246
246
  });
247
247
  };
248
- onShiftLeft = (e, i) => {
249
- const { scale: l, onChange: t } = this.props, { min: p, max: r, step: a = 1 } = this.props.range, n = N(l, e, i, p, r, a);
250
- t("SHIFTED", n), requestAnimationFrame(() => {
251
- const o = e.closest(".multiple-slider__range");
252
- if (o) {
253
- const s = o.querySelector(
248
+ onShiftLeft = (e, a) => {
249
+ const { scale: o, onChange: t } = this.props, { min: c, max: r, step: n = 1 } = this.props.range, i = N(o, e, a, c, r, n);
250
+ t("SHIFTED", i), requestAnimationFrame(() => {
251
+ const l = e.closest(".multiple-slider__range");
252
+ if (l) {
253
+ const s = l.querySelector(
254
254
  `[data-id="${e.dataset.id}"]`
255
255
  );
256
256
  s instanceof HTMLElement && s.focus();
257
257
  }
258
258
  });
259
259
  };
260
- distributeStops = (e, i, l) => {
261
- const { scale: t, distributionEasing: p, onChange: r, range: a } = this.props, { min: n, max: o, step: s = 0.1 } = a, c = Math.round(i / s) * s, u = s.toString().split(".")[1]?.length || 0;
260
+ distributeStops = (e, a, o) => {
261
+ const { scale: t, distributionEasing: c, onChange: r, range: n } = this.props, { min: i, max: l, step: s = 0.1 } = n, d = Math.round(a / s) * s, u = s.toString().split(".")[1]?.length || 0;
262
262
  e === "MIN" ? r("UPDATING", {
263
- scale: M(
264
- Object.entries(t).sort((d, m) => m[1] - d[1]).map((d) => parseFloat(d[0])),
265
- parseFloat(c.toFixed(u)),
266
- Math.max(...Object.values(t)) ?? o,
267
- p
263
+ scale: F(
264
+ Object.entries(t).sort((p, g) => g[1] - p[1]).map((p) => parseFloat(p[0])),
265
+ parseFloat(d.toFixed(u)),
266
+ Math.max(...Object.values(t)) ?? l,
267
+ c
268
268
  )
269
269
  }) : e === "MAX" && r("UPDATING", {
270
- scale: M(
271
- Object.entries(t).sort((d, m) => m[1] - d[1]).map((d) => parseFloat(d[0])),
272
- Math.min(...Object.values(t)) ?? n,
273
- parseFloat(c.toFixed(u)),
274
- p
270
+ scale: F(
271
+ Object.entries(t).sort((p, g) => g[1] - p[1]).map((p) => parseFloat(p[0])),
272
+ Math.min(...Object.values(t)) ?? i,
273
+ parseFloat(d.toFixed(u)),
274
+ c
275
275
  )
276
276
  }), this.setState({
277
- isTooltipDisplay: Array(l.length).fill(!0)
277
+ isTooltipDisplay: Array(o.length).fill(!0)
278
278
  }), document.body.style.cursor = "ew-resize";
279
279
  };
280
- linkStops = (e, i, l) => {
281
- const { scale: t, onChange: p, range: r } = this.props, { step: a = 0.1 } = r, n = t, o = Math.round(e / a) * a, s = a.toString().split(".")[1]?.length || 0;
282
- l.filter((c) => c !== i).forEach((c) => {
283
- const u = n[c.dataset.id] - n[i.dataset.id] + o, d = Math.round(u / a) * a;
284
- n[c.dataset.id] = parseFloat(
285
- d.toFixed(s)
280
+ linkStops = (e, a, o) => {
281
+ const { scale: t, onChange: c, range: r } = this.props, { step: n = 0.1 } = r, i = t, l = Math.round(e / n) * n, s = n.toString().split(".")[1]?.length || 0;
282
+ o.filter((d) => d !== a).forEach((d) => {
283
+ const u = i[d.dataset.id] - i[a.dataset.id] + l, p = Math.round(u / n) * n;
284
+ i[d.dataset.id] = parseFloat(
285
+ p.toFixed(s)
286
286
  );
287
- }), n[i.dataset.id] = parseFloat(
288
- o.toFixed(s)
287
+ }), i[a.dataset.id] = parseFloat(
288
+ l.toFixed(s)
289
289
  ), this.setState({
290
- isTooltipDisplay: this.state.isTooltipDisplay.fill(!0)
291
- }), p("UPDATING", {
292
- scale: n
290
+ isTooltipDisplay: Array(o.length).fill(!0)
291
+ }), c("UPDATING", {
292
+ scale: i
293
293
  }), document.body.style.cursor = "ew-resize";
294
294
  };
295
295
  // Templates
296
+ Progress = () => {
297
+ const { scale: e, range: a, hasProgressBar: o } = this.props;
298
+ if (!o) return null;
299
+ const t = Object.values(e).sort((n, i) => n - i);
300
+ if (t.length < 2) return null;
301
+ const c = f(t[0], a.min, a.max, 0, 100), r = f(t[t.length - 1], a.min, a.max, 0, 100);
302
+ return /* @__PURE__ */ m(
303
+ "div",
304
+ {
305
+ className: "multiple-slider__progress",
306
+ style: { left: `${c}%`, width: `${r - c}%` }
307
+ }
308
+ );
309
+ };
296
310
  Status = () => {
297
- const { warning: e, isBlocked: i, isNew: l } = this.props;
298
- if (e || i || l)
299
- return /* @__PURE__ */ I("div", { className: "multiple-slider__status", children: [
300
- e !== void 0 && /* @__PURE__ */ g(
311
+ const { warning: e, isBlocked: a, isNew: o } = this.props;
312
+ if (e || a || o)
313
+ return /* @__PURE__ */ y("div", { className: "multiple-slider__status", children: [
314
+ e !== void 0 && /* @__PURE__ */ m(
301
315
  w,
302
316
  {
303
317
  iconType: "PICTO",
@@ -307,127 +321,142 @@ class H extends T.Component {
307
321
  type: e.type
308
322
  }
309
323
  ),
310
- (i || l) && /* @__PURE__ */ g(
311
- D,
324
+ (a || o) && /* @__PURE__ */ m(
325
+ A,
312
326
  {
313
327
  isSolo: !0,
314
- action: i ? this.props.onUnblock : void 0,
315
- children: l ? "New" : "Pro"
328
+ action: a ? this.props.onUnblock : void 0,
329
+ children: o ? "New" : "Pro"
316
330
  }
317
331
  )
318
332
  ] });
319
333
  };
320
334
  Edit = () => {
321
- const { scale: e, range: i, colors: l, tips: t, isBlocked: p } = this.props, { isTooltipDisplay: r } = this.state;
322
- return /* @__PURE__ */ g(
335
+ const { scale: e, range: a, colors: o, tips: t, isBlocked: c } = this.props, { isTooltipDisplay: r } = this.state;
336
+ return /* @__PURE__ */ y(
323
337
  "div",
324
338
  {
325
- className: E([
339
+ className: I([
326
340
  "multiple-slider__range",
327
- p && "multiple-slider__range--blocked"
341
+ c && "multiple-slider__range--blocked"
328
342
  ]),
329
343
  style: {
330
- background: `linear-gradient(90deg, ${l.min}, ${l.max})`
344
+ background: o !== void 0 ? `linear-gradient(90deg, ${o.min}, ${o.max})` : void 0
331
345
  },
332
346
  role: "presentation",
333
- children: Object.entries(e).sort((a, n) => a[1] - n[1]).map((a, n, o) => /* @__PURE__ */ g(
334
- F,
335
- {
336
- id: a[0],
337
- shortId: a[0],
338
- value: a[1],
339
- offset: f(a[1], i.min, i.max, 0, 100),
340
- min: i.min.toString(),
341
- max: i.max.toString(),
342
- helper: n === 0 || n === o.length - 1 ? {
343
- label: t.minMax,
344
- type: "MULTI_LINE"
345
- } : void 0,
346
- canBeTyped: !0,
347
- isDisplayed: r[n],
348
- isBlocked: p,
349
- style: {
350
- pointerEvents: this.state.activeKnobId && this.state.activeKnobId !== a[0] || p ? "none" : "auto"
351
- },
352
- onShiftRight: (s) => {
353
- this.onShiftRight(s.target, s.shiftKey);
354
- },
355
- onShiftLeft: (s) => {
356
- this.onShiftLeft(s.target, s.shiftKey);
347
+ children: [
348
+ /* @__PURE__ */ m(this.Progress, {}),
349
+ Object.entries(e).sort((n, i) => n[1] - i[1]).map((n, i, l) => /* @__PURE__ */ m(
350
+ E,
351
+ {
352
+ id: n[0],
353
+ shortId: n[0],
354
+ value: n[1],
355
+ offset: f(n[1], a.min, a.max, 0, 100),
356
+ min: a.min.toString(),
357
+ max: a.max.toString(),
358
+ helper: i === 0 || i === l.length - 1 ? {
359
+ label: t.minMax,
360
+ type: "MULTI_LINE"
361
+ } : void 0,
362
+ canBeTyped: !0,
363
+ isDisplayed: r[i],
364
+ isBlocked: c,
365
+ style: {
366
+ pointerEvents: this.state.activeKnobId && this.state.activeKnobId !== n[0] || c ? "none" : "auto"
367
+ },
368
+ onShiftRight: (s) => {
369
+ this.onShiftRight(s.target, s.shiftKey);
370
+ },
371
+ onShiftLeft: (s) => {
372
+ this.onShiftLeft(s.target, s.shiftKey);
373
+ },
374
+ onMouseDown: (s) => {
375
+ this.onGrab(s), s.target.focus();
376
+ },
377
+ onValidStopValue: (s, d) => this.validHandler(s, d),
378
+ "aria-valuenow": n[1]
357
379
  },
358
- onMouseDown: (s) => {
359
- this.onGrab(s), s.target.focus();
360
- },
361
- onValidStopValue: (s, c) => this.validHandler(s, c),
362
- "aria-valuenow": a[1]
363
- },
364
- a[0]
365
- ))
380
+ n[0]
381
+ ))
382
+ ]
366
383
  }
367
384
  );
368
385
  };
369
386
  FullyEdit = () => {
370
- const { scale: e, stops: i, range: l, colors: t, tips: p, isBlocked: r } = this.props, { isTooltipDisplay: a } = this.state;
371
- return /* @__PURE__ */ g(
387
+ const { scale: e, stops: a, range: o, colors: t, tips: c, isBlocked: r } = this.props, { isTooltipDisplay: n } = this.state;
388
+ return /* @__PURE__ */ y(
372
389
  "div",
373
390
  {
374
- className: E([
391
+ className: I([
375
392
  "multiple-slider__range",
376
- i.list.length < (i.max ?? 1 / 0) && !r && "multiple-slider__range--add",
377
- i.list.length === (i.max ?? 1 / 0) && "multiple-slider__range--not-allowed",
393
+ a.list.length < (a.max ?? 1 / 0) && !r && "multiple-slider__range--add",
394
+ a.list.length === (a.max ?? 1 / 0) && "multiple-slider__range--not-allowed",
378
395
  r && "multiple-slider__range--blocked"
379
396
  ]),
380
397
  style: {
381
- background: `linear-gradient(90deg, ${t.min}, ${t.max})`
398
+ background: t !== void 0 ? `linear-gradient(90deg, ${t.min}, ${t.max})` : void 0
382
399
  },
383
- onMouseDown: (n) => i.list.length < (i.max ?? 1 / 0) && this.onAdd(n),
384
- children: Object.entries(e).sort((n, o) => n[1] - o[1]).map((n, o, s) => /* @__PURE__ */ g(
385
- F,
386
- {
387
- id: n[0],
388
- shortId: n[0],
389
- value: n[1],
390
- offset: f(n[1], l.min, l.max, 0, 100),
391
- min: l.min.toString(),
392
- max: l.max.toString(),
393
- helper: o === 0 || o === s.length - 1 ? {
394
- label: p.minMax,
395
- type: "MULTI_LINE"
396
- } : void 0,
397
- canBeTyped: !0,
398
- isDisplayed: a[o],
399
- isBlocked: r,
400
- style: {
401
- pointerEvents: this.state.activeKnobId && this.state.activeKnobId !== n[0] || r ? "none" : "auto"
402
- },
403
- onShiftRight: (c) => {
404
- this.onShiftRight(c.target, c.shiftKey);
405
- },
406
- onShiftLeft: (c) => {
407
- this.onShiftLeft(c.target, c.shiftKey);
408
- },
409
- onDelete: (c) => {
410
- i.list.length > (i.min ?? 1 / 0) && this.onDelete(c.target);
411
- },
412
- onMouseDown: (c) => {
413
- this.onGrab(c), c.target.focus();
400
+ onMouseDown: (i) => a.list.length < (a.max ?? 1 / 0) && this.onAdd(i),
401
+ children: [
402
+ /* @__PURE__ */ m(this.Progress, {}),
403
+ Object.entries(e).sort((i, l) => i[1] - l[1]).map((i, l, s) => /* @__PURE__ */ m(
404
+ E,
405
+ {
406
+ id: i[0],
407
+ shortId: i[0],
408
+ value: i[1],
409
+ offset: f(i[1], o.min, o.max, 0, 100),
410
+ min: o.min.toString(),
411
+ max: o.max.toString(),
412
+ helper: l === 0 || l === s.length - 1 ? {
413
+ label: c.minMax,
414
+ type: "MULTI_LINE"
415
+ } : void 0,
416
+ canBeTyped: !0,
417
+ isDisplayed: n[l],
418
+ isBlocked: r,
419
+ style: {
420
+ pointerEvents: this.state.activeKnobId && this.state.activeKnobId !== i[0] || r ? "none" : "auto"
421
+ },
422
+ onShiftRight: (d) => {
423
+ this.onShiftRight(d.target, d.shiftKey);
424
+ },
425
+ onShiftLeft: (d) => {
426
+ this.onShiftLeft(d.target, d.shiftKey);
427
+ },
428
+ onDelete: (d) => {
429
+ a.list.length > (a.min ?? 1 / 0) && this.onDelete(d.target);
430
+ },
431
+ onMouseDown: (d) => {
432
+ this.onGrab(d), d.target.focus();
433
+ },
434
+ onValidStopValue: (d, u) => this.validHandler(d, u),
435
+ "aria-valuenow": i[1]
414
436
  },
415
- onValidStopValue: (c, u) => this.validHandler(c, u),
416
- "aria-valuenow": n[1]
417
- },
418
- n[0]
419
- ))
437
+ i[0]
438
+ ))
439
+ ]
420
440
  }
421
441
  );
422
442
  };
423
443
  // Render
424
444
  render() {
425
- const { type: e } = this.props;
426
- return /* @__PURE__ */ I("div", { className: "multiple-slider", children: [
427
- e === "EDIT" && /* @__PURE__ */ g(this.Edit, {}),
428
- e === "FULLY_EDIT" && /* @__PURE__ */ g(this.FullyEdit, {}),
429
- this.Status()
430
- ] });
445
+ const { type: e, hasPadding: a } = this.props;
446
+ return /* @__PURE__ */ y(
447
+ "div",
448
+ {
449
+ className: I([
450
+ "multiple-slider",
451
+ !a && "multiple-slider--no-padding"
452
+ ]),
453
+ children: [
454
+ e === "EDIT" && /* @__PURE__ */ m(this.Edit, {}),
455
+ e === "FULLY_EDIT" && /* @__PURE__ */ m(this.FullyEdit, {}),
456
+ this.Status()
457
+ ]
458
+ }
459
+ );
431
460
  }
432
461
  }
433
462
  export {