@deot/vc-components 1.0.43 → 1.0.44

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.
@@ -66,7 +66,7 @@
66
66
  }
67
67
  const VcInstance = new Instance();
68
68
 
69
- const props$1s = {
69
+ const props$1t = {
70
70
  tag: {
71
71
  type: String,
72
72
  default: "div"
@@ -75,10 +75,10 @@
75
75
 
76
76
  /** @jsxImportSource vue */
77
77
 
78
- const COMPONENT_NAME$27 = 'vc-action-sheet';
78
+ const COMPONENT_NAME$28 = 'vc-action-sheet';
79
79
  const ActionSheet = /* @__PURE__ */ vue.defineComponent({
80
- name: COMPONENT_NAME$27,
81
- props: props$1s,
80
+ name: COMPONENT_NAME$28,
81
+ props: props$1t,
82
82
  setup(props, {
83
83
  slots
84
84
  }) {
@@ -92,6 +92,398 @@
92
92
 
93
93
  const MActionSheet = ActionSheet;
94
94
 
95
+ const IS_SERVER$3 = typeof window === "undefined";
96
+
97
+ const hasClass = (el, cls) => {
98
+ if (IS_SERVER$3 || !cls) return false;
99
+ if (cls.includes(" ")) {
100
+ throw new Error("[@deot/helper-dom]: 类名不应该包含空格");
101
+ }
102
+ if (el.classList) {
103
+ return el.classList.contains(cls);
104
+ } else {
105
+ return (" " + el.className + " ").indexOf(" " + cls + " ") > -1;
106
+ }
107
+ };
108
+
109
+ const addClass = (el, cls) => {
110
+ if (IS_SERVER$3 || !cls) return;
111
+ let curClass = el.className;
112
+ const classes = cls.split(" ");
113
+ for (let i = 0, j = classes.length; i < j; i++) {
114
+ const clsName = classes[i];
115
+ if (clsName) {
116
+ if (el.classList) {
117
+ el.classList.add(clsName);
118
+ } else if (!hasClass(el, clsName)) {
119
+ curClass += " " + clsName;
120
+ }
121
+ }
122
+ }
123
+ if (!el.classList) {
124
+ el.className = curClass;
125
+ }
126
+ };
127
+
128
+ const composedPath = (e) => {
129
+ const path = e.composedPath && e.composedPath() || [];
130
+ if (path.length) return path;
131
+ let parent = e.target?.parentNode;
132
+ /* istanbul ignore next -- @preserve */
133
+ while (parent) {
134
+ path.push(parent);
135
+ parent = parent.parentNode;
136
+ }
137
+ return path;
138
+ };
139
+
140
+ const contains$1 = (el, child) => {
141
+ if (IS_SERVER$3 || !child) return false;
142
+ const childRect = child.getBoundingClientRect();
143
+ let elRect;
144
+ if (!el || [window, document, document.documentElement].includes(el)) {
145
+ elRect = {
146
+ top: 0,
147
+ right: window.innerWidth,
148
+ bottom: window.innerHeight,
149
+ left: 0
150
+ };
151
+ } else {
152
+ elRect = el.getBoundingClientRect();
153
+ }
154
+ return childRect.top < elRect.bottom && childRect.bottom > elRect.top && childRect.right > elRect.left && childRect.left < elRect.right;
155
+ };
156
+
157
+ const el$1 = (v) => {
158
+ if (IS_SERVER$3) return null;
159
+ let target;
160
+ if (typeof v === "object") {
161
+ target = v;
162
+ } else {
163
+ target = document.querySelector(v);
164
+ }
165
+ if (!target) {
166
+ throw new Error("[@deot/helper-dom]: el缺失");
167
+ }
168
+ return target;
169
+ };
170
+
171
+ const getStyle$1 = (el, name) => {
172
+ if (IS_SERVER$3 || !name) return "";
173
+ if (name === "float") {
174
+ name = "cssFloat";
175
+ }
176
+ try {
177
+ const computed = document.defaultView.getComputedStyle(el, "");
178
+ return el.style[name] || (computed?.[name] || "");
179
+ } catch (e) {
180
+ return el.style[name] || "";
181
+ }
182
+ };
183
+
184
+ const isScroller = (el, options) => {
185
+ if (IS_SERVER$3 || !el) return false;
186
+ const { className, direction } = options || {};
187
+ let overflow = getStyle$1(el, `overflow-${direction ? "y" : "x"}`);
188
+ overflow = overflow || getStyle$1(el, "overflow");
189
+ return !!(overflow.match(/(scroll|auto)/) || className?.test(el.className));
190
+ };
191
+
192
+ const getScroller = (el, options) => {
193
+ if (IS_SERVER$3 || !el) return null;
194
+ let parent = el;
195
+ while (parent) {
196
+ if ([window, document, document.documentElement].includes(parent)) {
197
+ return window;
198
+ }
199
+ if (isScroller(parent, options)) {
200
+ return parent;
201
+ }
202
+ parent = parent?.parentNode;
203
+ }
204
+ return parent;
205
+ };
206
+
207
+ const off = (el, event, handler, options) => {
208
+ if (IS_SERVER$3) return;
209
+ el.removeEventListener(event, handler, false);
210
+ };
211
+
212
+ const on = (el, event, handler, options) => {
213
+ if (IS_SERVER$3) return () => {
214
+ };
215
+ el.addEventListener(event, handler, false);
216
+ return () => {
217
+ el.removeEventListener(event, handler, false);
218
+ };
219
+ };
220
+
221
+ const $target = IS_SERVER$3 ? {} : document.createElement("div").style;
222
+ const prefix$1 = (() => {
223
+ const keys = {
224
+ webkit: "webkitTransform",
225
+ Moz: "MozTransform",
226
+ O: "OTransform",
227
+ ms: "msTransform",
228
+ standard: "transform"
229
+ };
230
+ const values = {
231
+ webkit: "-webkit-",
232
+ Moz: "-moz-",
233
+ O: "-o-",
234
+ ms: "-ms-",
235
+ standard: ""
236
+ };
237
+ for (const key in keys) {
238
+ if ($target[keys[key]] !== void 0) {
239
+ return {
240
+ camel: key,
241
+ kebab: values[key]
242
+ };
243
+ }
244
+ }
245
+ return false;
246
+ })();
247
+ const prefixStyle = (v) => {
248
+ if (IS_SERVER$3 || prefix$1 === false) {
249
+ return {
250
+ camel: v,
251
+ kebab: v
252
+ };
253
+ }
254
+ return {
255
+ camel: prefix$1.camel + v.charAt(0).toUpperCase() + v.substr(1),
256
+ kebab: prefix$1.kebab + v
257
+ };
258
+ };
259
+
260
+ const removeClass = (el, cls) => {
261
+ if (IS_SERVER$3 || !cls) return;
262
+ const classes = cls.split(" ");
263
+ let curClass = " " + el.className + " ";
264
+ for (let i = 0, j = classes.length; i < j; i++) {
265
+ const clsName = classes[i];
266
+ if (clsName) {
267
+ if (el.classList) {
268
+ el.classList.remove(clsName);
269
+ continue;
270
+ }
271
+ /* istanbul ignore next -- @preserve */
272
+ if (hasClass(el, clsName)) {
273
+ curClass = curClass.replace(" " + clsName + " ", " ");
274
+ }
275
+ }
276
+ }
277
+ if (!el.classList) {
278
+ el.className = curClass.trim();
279
+ }
280
+ };
281
+
282
+ const scrollIntoView = async (el, options) => {
283
+ if (IS_SERVER$3) return;
284
+ const { from = 0, to = 0, duration = 300 } = options || {};
285
+ const difference = Math.abs(from - to);
286
+ const step = Math.ceil(difference / duration * 50);
287
+ let onResolve;
288
+ const target = new Promise((resolve) => {
289
+ onResolve = resolve;
290
+ });
291
+ const scroll = (start, end) => {
292
+ if (start === end) {
293
+ onResolve();
294
+ return;
295
+ }
296
+ let d = start + step > end ? end : start + step;
297
+ if (start > end) {
298
+ d = start - step < end ? end : start - step;
299
+ }
300
+ if (el === window) {
301
+ window.scrollTo(d, d);
302
+ } else {
303
+ el.scrollTop = d;
304
+ }
305
+ window.requestAnimationFrame(() => scroll(d, end));
306
+ };
307
+ scroll(from, to);
308
+ return target;
309
+ };
310
+
311
+ const props$1s = {
312
+ zIndex: {
313
+ type: [Number, String],
314
+ default: 1
315
+ },
316
+ // TODO: left/right
317
+ placement: {
318
+ type: String,
319
+ default: "top"
320
+ },
321
+ disabled: {
322
+ type: Boolean,
323
+ default: false
324
+ },
325
+ fixed: {
326
+ type: Boolean,
327
+ default: true
328
+ },
329
+ offset: {
330
+ type: Number,
331
+ default: 0
332
+ },
333
+ // -> 固钉始终保持在容器内, 超过范围则隐藏(请注意容器避免出现滚动条) 仅fixed为true有效
334
+ target: {
335
+ type: String
336
+ }
337
+ };
338
+
339
+ /** @jsxImportSource vue */
340
+
341
+ const COMPONENT_NAME$27 = 'vc-affix';
342
+ const SCROLLER_WHEEL_REG = /vc-scroller-wheel/;
343
+ const Affix = /* @__PURE__ */ vue.defineComponent({
344
+ name: COMPONENT_NAME$27,
345
+ props: props$1s,
346
+ setup(props, {
347
+ slots,
348
+ expose
349
+ }) {
350
+ const scrollerInstance = vue.inject('vc-scroller', null);
351
+ const scroller = vue.shallowRef(); // 当前元素所在的滚动容器
352
+ const base = vue.shallowRef(); // 当前元素(props.tagret)的参考容器
353
+ const current = vue.shallowRef(); // 当前元素
354
+
355
+ const currentRect = vue.reactive({
356
+ top: 0,
357
+ bottom: 0,
358
+ width: 0,
359
+ height: 0
360
+ });
361
+ const isActive = vue.ref(false);
362
+ const transformY = vue.ref(0);
363
+ const windowHeight = vue.ref(window.innerHeight);
364
+ const isVcScrollerWheel = vue.computed(() => {
365
+ return SCROLLER_WHEEL_REG.test(scroller.value?.className || '');
366
+ });
367
+ const currentStyle = vue.computed(() => {
368
+ if (!isActive.value) return {};
369
+ return {
370
+ height: `${currentRect.height}px`,
371
+ width: `${currentRect.width}px`
372
+ };
373
+ });
374
+ const contentStyle = vue.computed(() => {
375
+ if (!isActive.value) return {};
376
+ const offset = `${props.offset}px`;
377
+ return {
378
+ height: `${currentRect.height}px`,
379
+ width: `${currentRect.width}px`,
380
+ top: props.placement === 'top' ? offset : '',
381
+ bottom: props.placement === 'bottom' ? offset : '',
382
+ zIndex: props.zIndex,
383
+ transform: transformY.value ? `translateY(${transformY.value}px)` : ''
384
+ };
385
+ });
386
+ const setCurrentRect = () => {
387
+ const rect = current.value.getBoundingClientRect();
388
+ Object.assign(currentRect, {
389
+ top: rect.top,
390
+ bottom: rect.bottom,
391
+ width: rect.width,
392
+ height: rect.height
393
+ });
394
+ };
395
+ const setAbsoluteStatus = () => {
396
+ const {
397
+ placement,
398
+ offset
399
+ } = props;
400
+ const currentHeightOffset = offset + currentRect.height;
401
+ const containerRect = scroller.value.getBoundingClientRect();
402
+ let transformOffsetY = 0;
403
+
404
+ // scroller-wheel滚动条偏移
405
+ if (scrollerInstance && isVcScrollerWheel.value) {
406
+ const maxMoveY = scrollerInstance.scrollHeight - scrollerInstance.clientHeight;
407
+ transformOffsetY = scrollerInstance.scrollTop >= maxMoveY ? maxMoveY : scrollerInstance.scrollTop;
408
+ }
409
+ if (placement === 'top') {
410
+ isActive.value = currentRect.top - containerRect.top <= props.offset;
411
+ transformY.value = Math.min(containerRect.bottom - currentHeightOffset, 0) + transformOffsetY;
412
+ } else {
413
+ isActive.value = currentRect.bottom - containerRect.top >= containerRect.height - props.offset;
414
+ transformY.value = Math.max(containerRect.height - containerRect.top - currentHeightOffset, 0) + transformOffsetY;
415
+ }
416
+ };
417
+ const setFixedStatus = () => {
418
+ const {
419
+ placement,
420
+ target,
421
+ offset
422
+ } = props;
423
+ const currentHeightOffset = offset + currentRect.height;
424
+ const containerRect = target && base.value.getBoundingClientRect();
425
+ if (placement === 'top') {
426
+ if (target) {
427
+ isActive.value = offset > currentRect.top && containerRect.bottom > 0;
428
+ transformY.value = Math.min(containerRect.bottom - currentHeightOffset, 0);
429
+ } else {
430
+ isActive.value = offset > currentRect.top;
431
+ }
432
+ } else {
433
+ if (target) {
434
+ isActive.value = windowHeight.value - offset < currentRect.bottom && windowHeight.value > containerRect.top;
435
+ transformY.value = -Math.min(windowHeight.value - containerRect.top - currentHeightOffset, 0);
436
+ } else {
437
+ isActive.value = windowHeight.value - offset < currentRect.bottom;
438
+ }
439
+ }
440
+ };
441
+ const refresh = () => {
442
+ setCurrentRect();
443
+ scroller.value instanceof Window || props.fixed ? setFixedStatus() : setAbsoluteStatus();
444
+ };
445
+ vue.onMounted(() => {
446
+ if (typeof props.target === 'string') {
447
+ base.value = document.querySelector(props.target) ?? void 0;
448
+ }
449
+ !base.value && (base.value = document.documentElement);
450
+ scroller.value = getScroller(current.value, {
451
+ className: SCROLLER_WHEEL_REG
452
+ });
453
+ if (isVcScrollerWheel.value) {
454
+ scrollerInstance?.on(refresh);
455
+ } else {
456
+ scroller.value?.addEventListener('scroll', refresh);
457
+ }
458
+ refresh();
459
+ });
460
+ vue.onBeforeUnmount(() => {
461
+ if (isVcScrollerWheel.value) {
462
+ scrollerInstance?.off(refresh);
463
+ } else {
464
+ scroller.value?.removeEventListener('scroll', refresh);
465
+ }
466
+ });
467
+ expose({
468
+ refresh
469
+ });
470
+ return () => {
471
+ return vue.createVNode("div", {
472
+ "ref": current,
473
+ "class": "vc-affix",
474
+ "style": currentStyle.value
475
+ }, [vue.createVNode("div", {
476
+ "class": {
477
+ [`vc-affix__${props.fixed ? 'fixed' : 'absolute'}`]: isActive.value
478
+ },
479
+ "style": contentStyle.value
480
+ }, [slots?.default?.()])]);
481
+ };
482
+ }
483
+ });
484
+
485
+ const MAffix = Affix;
486
+
95
487
  const props$1r = {
96
488
  modelValue: {
97
489
  type: Boolean,
@@ -134,9 +526,9 @@
134
526
  const dReg = /.*d="([^"]+).*/g;
135
527
  const fillReg = /.*fill="([^"]+).*/g;
136
528
  const basicUrl = "//at.alicdn.com/t/font_1119857_u0f4525o6sd.js";
137
- const prefix$1 = "@deot/vc-icon:";
529
+ const prefix = "@deot/vc-icon:";
138
530
  const IS_DEV = false;
139
- const IS_SERVER$3 = typeof document === "undefined";
531
+ const IS_SERVER$2 = typeof document === "undefined";
140
532
  class Manager {
141
533
  icons = {};
142
534
  events = {};
@@ -151,10 +543,10 @@
151
543
  this.sourceStatus[url] = this.sourceStatus[url] || new Promise((resolve, reject) => {
152
544
  (async () => {
153
545
  try {
154
- if (IS_SERVER$3 || !/.js$/.test(url)) {
546
+ if (IS_SERVER$2 || !/.js$/.test(url)) {
155
547
  return reject(new VcError("icon", "invaild url"));
156
548
  }
157
- const key = `${prefix$1}${url}`;
549
+ const key = `${prefix}${url}`;
158
550
  const cache = window.localStorage.getItem(key);
159
551
  let icons = JSON.parse(cache || '""');
160
552
  /* istanbul ignore next -- @preserve */
@@ -236,7 +628,7 @@
236
628
  if (this.events[type].length >= 100) {
237
629
  delete this.events[type];
238
630
  /* istanbul ignore else -- @preserve */
239
- if (!IS_SERVER$3) {
631
+ if (!IS_SERVER$2) {
240
632
  throw new VcError("icon", `${type} nonexistent`);
241
633
  }
242
634
  }
@@ -253,8 +645,8 @@
253
645
  clearResource() {
254
646
  const needs = Object.keys(this.sourceStatus);
255
647
  Object.keys(window.localStorage).forEach((item) => {
256
- if (item.includes(prefix$1)) {
257
- const key = item.split(prefix$1).pop();
648
+ if (item.includes(prefix)) {
649
+ const key = item.split(prefix).pop();
258
650
  key && !needs.includes(key) && window.localStorage.removeItem(item);
259
651
  }
260
652
  });
@@ -778,7 +1170,7 @@
778
1170
 
779
1171
  // [color, borderColor, backgroundColor], -> CSS
780
1172
  const THEME_MAP = {
781
- info: ['#2B72FD', '#91d5ff', '#e6f7ff'],
1173
+ info: ['#456CF6', '#91d5ff', '#e6f7ff'],
782
1174
  success: ['#52c41a', '#b7eb8f', '#f6ffed'],
783
1175
  error: ['#ed4014', '#ffb08f', '#fbe9e9'],
784
1176
  warning: ['#ffbf00', '#ffe58f', '#fffbe6']
@@ -969,7 +1361,7 @@
969
1361
  );
970
1362
  };
971
1363
 
972
- const flatten$1 = (value, parser) => {
1364
+ const flatten$1 = (value, parser, exit) => {
973
1365
  let need = true;
974
1366
  let safeCount = 1;
975
1367
  let parseValue = value;
@@ -979,7 +1371,7 @@
979
1371
  }
980
1372
  try {
981
1373
  const next = (parser || decodeURIComponent)(parseValue);
982
- if (parseValue === next) {
1374
+ if (parseValue === next || typeof exit === "function" && exit(next)) {
983
1375
  need = false;
984
1376
  }
985
1377
  parseValue = next;
@@ -992,8 +1384,7 @@
992
1384
  };
993
1385
 
994
1386
  const flattenJSONParse = (value) => {
995
- if (value === null)
996
- return null;
1387
+ if (value === null) return null;
997
1388
  const regex = /^\d+$/;
998
1389
  if (regex.test(value) && value.length >= 16 && +value > Number.MAX_SAFE_INTEGER) {
999
1390
  return value;
@@ -3621,7 +4012,7 @@
3621
4012
  function castSlice(array, start, end) {
3622
4013
  var length = array.length;
3623
4014
  end = end === undefined ? length : end;
3624
- return (false && end >= length) ? array : baseSlice(array, start, end);
4015
+ return (!start && end >= length) ? array : baseSlice(array, start, end);
3625
4016
  }
3626
4017
 
3627
4018
  /** Used to compose unicode character classes. */
@@ -6695,233 +7086,6 @@
6695
7086
  return parent;
6696
7087
  };
6697
7088
 
6698
- const IS_SERVER$2 = typeof window === "undefined";
6699
-
6700
- const hasClass = (el, cls) => {
6701
- if (IS_SERVER$2 || !cls)
6702
- return false;
6703
- if (cls.includes(" ")) {
6704
- throw new Error("[@deot/helper-dom]: 类名不应该包含空格");
6705
- }
6706
- if (el.classList) {
6707
- return el.classList.contains(cls);
6708
- } else {
6709
- return (" " + el.className + " ").indexOf(" " + cls + " ") > -1;
6710
- }
6711
- };
6712
-
6713
- const addClass = (el, cls) => {
6714
- if (IS_SERVER$2 || !cls)
6715
- return;
6716
- let curClass = el.className;
6717
- let classes = cls.split(" ");
6718
- for (let i = 0, j = classes.length; i < j; i++) {
6719
- let clsName = classes[i];
6720
- if (clsName) {
6721
- if (el.classList) {
6722
- el.classList.add(clsName);
6723
- } else if (!hasClass(el, clsName)) {
6724
- curClass += " " + clsName;
6725
- }
6726
- }
6727
- }
6728
- if (!el.classList) {
6729
- el.className = curClass;
6730
- }
6731
- };
6732
-
6733
- const composedPath = (e) => {
6734
- let path = e.composedPath && e.composedPath() || [];
6735
- if (path.length)
6736
- return path;
6737
- let parent = e.target?.parentNode;
6738
- /* istanbul ignore next -- @preserve */
6739
- while (parent) {
6740
- path.push(parent);
6741
- parent = parent.parentNode;
6742
- }
6743
- return path;
6744
- };
6745
-
6746
- const contains$1 = (el, child) => {
6747
- if (IS_SERVER$2 || !child)
6748
- return false;
6749
- let childRect = child.getBoundingClientRect();
6750
- let elRect;
6751
- if (!el || [window, document, document.documentElement].includes(el)) {
6752
- elRect = {
6753
- top: 0,
6754
- right: window.innerWidth,
6755
- bottom: window.innerHeight,
6756
- left: 0
6757
- };
6758
- } else {
6759
- elRect = el.getBoundingClientRect();
6760
- }
6761
- return childRect.top < elRect.bottom && childRect.bottom > elRect.top && childRect.right > elRect.left && childRect.left < elRect.right;
6762
- };
6763
-
6764
- const el$1 = (v) => {
6765
- if (IS_SERVER$2)
6766
- return null;
6767
- let target;
6768
- if (typeof v === "object") {
6769
- target = v;
6770
- } else {
6771
- target = document.querySelector(v);
6772
- }
6773
- if (!target) {
6774
- throw new Error("[@deot/helper-dom]: el缺失");
6775
- }
6776
- return target;
6777
- };
6778
-
6779
- const getStyle$1 = (el, name) => {
6780
- if (IS_SERVER$2 || !name)
6781
- return "";
6782
- if (name === "float") {
6783
- name = "cssFloat";
6784
- }
6785
- try {
6786
- let computed = document.defaultView.getComputedStyle(el, "");
6787
- return el.style[name] || (computed?.[name] || "");
6788
- } catch (e) {
6789
- return el.style[name] || "";
6790
- }
6791
- };
6792
-
6793
- const isScroll = (el, direction) => {
6794
- if (IS_SERVER$2 || !el)
6795
- return false;
6796
- let overflow = getStyle$1(el, `overflow-${"x"}`);
6797
- overflow = overflow || getStyle$1(el, "overflow");
6798
- return !!overflow.match(/(scroll|auto)/);
6799
- };
6800
-
6801
- const getScroller = (el, direction) => {
6802
- if (IS_SERVER$2 || !el)
6803
- return null;
6804
- let parent = el;
6805
- while (parent) {
6806
- if ([window, document, document.documentElement].includes(parent)) {
6807
- return window;
6808
- }
6809
- if (isScroll(parent)) {
6810
- return parent;
6811
- }
6812
- parent = parent?.parentNode;
6813
- }
6814
- return parent;
6815
- };
6816
-
6817
- const off = (el, event, handler, options) => {
6818
- if (IS_SERVER$2)
6819
- return;
6820
- el.removeEventListener(event, handler, false);
6821
- };
6822
-
6823
- const on = (el, event, handler, options) => {
6824
- if (IS_SERVER$2)
6825
- return () => {
6826
- };
6827
- el.addEventListener(event, handler, false);
6828
- return () => {
6829
- el.removeEventListener(event, handler, false);
6830
- };
6831
- };
6832
-
6833
- const $target = IS_SERVER$2 ? {} : document.createElement("div").style;
6834
- const prefix = (() => {
6835
- let keys = {
6836
- webkit: "webkitTransform",
6837
- Moz: "MozTransform",
6838
- O: "OTransform",
6839
- ms: "msTransform",
6840
- standard: "transform"
6841
- };
6842
- let values = {
6843
- webkit: "-webkit-",
6844
- Moz: "-moz-",
6845
- O: "-o-",
6846
- ms: "-ms-",
6847
- standard: ""
6848
- };
6849
- for (let key in keys) {
6850
- if ($target[keys[key]] !== void 0) {
6851
- return {
6852
- camel: key,
6853
- kebab: values[key]
6854
- };
6855
- }
6856
- }
6857
- return false;
6858
- })();
6859
- const prefixStyle = (v) => {
6860
- if (IS_SERVER$2 || prefix === false) {
6861
- return {
6862
- camel: v,
6863
- kebab: v
6864
- };
6865
- }
6866
- return {
6867
- camel: prefix.camel + v.charAt(0).toUpperCase() + v.substr(1),
6868
- kebab: prefix.kebab + v
6869
- };
6870
- };
6871
-
6872
- const removeClass = (el, cls) => {
6873
- if (IS_SERVER$2 || !cls)
6874
- return;
6875
- let classes = cls.split(" ");
6876
- let curClass = " " + el.className + " ";
6877
- for (let i = 0, j = classes.length; i < j; i++) {
6878
- let clsName = classes[i];
6879
- if (clsName) {
6880
- if (el.classList) {
6881
- el.classList.remove(clsName);
6882
- continue;
6883
- }
6884
- /* istanbul ignore next -- @preserve */
6885
- if (hasClass(el, clsName)) {
6886
- curClass = curClass.replace(" " + clsName + " ", " ");
6887
- }
6888
- }
6889
- }
6890
- if (!el.classList) {
6891
- el.className = curClass.trim();
6892
- }
6893
- };
6894
-
6895
- const scrollIntoView = async (el, options) => {
6896
- if (IS_SERVER$2)
6897
- return;
6898
- let { from = 0, to = 0, duration = 300 } = options || {};
6899
- let difference = Math.abs(from - to);
6900
- let step = Math.ceil(difference / duration * 50);
6901
- let onResolve;
6902
- let target = new Promise((resolve) => {
6903
- onResolve = resolve;
6904
- });
6905
- const scroll = (start, end) => {
6906
- if (start === end) {
6907
- onResolve();
6908
- return;
6909
- }
6910
- let d = start + step > end ? end : start + step;
6911
- if (start > end) {
6912
- d = start - step < end ? end : start - step;
6913
- }
6914
- if (el === window) {
6915
- window.scrollTo(d, d);
6916
- } else {
6917
- el.scrollTop = d;
6918
- }
6919
- window.requestAnimationFrame(() => scroll(d, end));
6920
- };
6921
- scroll(from, to);
6922
- return target;
6923
- };
6924
-
6925
7089
  const getSelectedData = (value = [], source = []) => {
6926
7090
  const label = [];
6927
7091
  const data = [];
@@ -14693,6 +14857,7 @@
14693
14857
  refreshSize();
14694
14858
  refreshPosition(options);
14695
14859
  };
14860
+ const listeners = [];
14696
14861
  const triggerScrollDelegate = (options) => {
14697
14862
  const delegates = {
14698
14863
  scrollLeft: (options && options.x) ?? scrollX.value,
@@ -14700,12 +14865,15 @@
14700
14865
  clientWidth: wrapperW.value,
14701
14866
  clientHeight: wrapperH.value,
14702
14867
  scrollWidth: contentW.value,
14703
- scrollHeight: contentH.value
14868
+ scrollHeight: contentH.value,
14869
+ getBoundingClientRect: () => wrapper.value?.getBoundingClientRect()
14704
14870
  };
14705
- instance.emit("scroll", {
14871
+ const e = {
14706
14872
  target: delegates,
14707
14873
  currentTarget: delegates
14708
- });
14874
+ };
14875
+ instance.emit("scroll", e);
14876
+ listeners.forEach((listener) => listener(e));
14709
14877
  };
14710
14878
  const scrollTo = (options) => {
14711
14879
  refreshPosition(options);
@@ -14732,8 +14900,9 @@
14732
14900
  Resize.off(wrapper.value, refresh);
14733
14901
  Resize.off(content.value, refresh);
14734
14902
  }
14903
+ listeners.splice(0, listeners.length);
14735
14904
  });
14736
- expose({
14905
+ const exposed = {
14737
14906
  wrapper,
14738
14907
  content,
14739
14908
  scrollTo,
@@ -14749,8 +14918,16 @@
14749
14918
  },
14750
14919
  setScrollLeft: (value) => {
14751
14920
  scrollTo({ x: value });
14921
+ },
14922
+ on: (listener) => {
14923
+ listeners.push(listener);
14924
+ },
14925
+ off: (listener) => {
14926
+ listeners.splice(listeners.indexOf(listener), 1);
14752
14927
  }
14753
- });
14928
+ };
14929
+ expose(exposed);
14930
+ vue.provide("vc-scroller", vue.reactive(exposed));
14754
14931
  return {
14755
14932
  bar,
14756
14933
  wrapper,
@@ -23796,7 +23973,7 @@
23796
23973
  color: {
23797
23974
  type: [Object, String],
23798
23975
  default: () => ({
23799
- normal: "#2B72FD",
23976
+ normal: "#456CF6",
23800
23977
  success: "#52c41a",
23801
23978
  error: "#f5222d"
23802
23979
  })
@@ -29110,7 +29287,8 @@
29110
29287
 
29111
29288
  const props$b = {
29112
29289
  value: {
29113
- type: [String, Number, Boolean]
29290
+ type: [String, Number, Boolean],
29291
+ default: void 0
29114
29292
  },
29115
29293
  label: {
29116
29294
  type: [String, Function],
@@ -29458,7 +29636,7 @@
29458
29636
  "class": [{
29459
29637
  'is-fixed': isFixed
29460
29638
  }, 'vcm-tabs__bar']
29461
- }, [vue.createVNode("slot", {
29639
+ }, [vue.createVNode(vue.resolveComponent("slot"), {
29462
29640
  "name": "prepend"
29463
29641
  }, null), slots.prepend?.(), props.showStep && tabs.scrollable.value && vue.createVNode("div", {
29464
29642
  "class": "vcm-tabs__step is-left",
@@ -35708,10 +35886,10 @@
35708
35886
  var _v1 = create$2();
35709
35887
  var _v2 = create$2();
35710
35888
  function isAroundZero$1(val) {
35711
- return val > -1e-8 && val < EPSILON$4;
35889
+ return val > -EPSILON$4 && val < EPSILON$4;
35712
35890
  }
35713
35891
  function isNotAroundZero$1(val) {
35714
- return val > EPSILON$4 || val < -1e-8;
35892
+ return val > EPSILON$4 || val < -EPSILON$4;
35715
35893
  }
35716
35894
  function cubicAt(p0, p1, p2, p3, t) {
35717
35895
  var onet = 1 - t;
@@ -36698,7 +36876,7 @@
36698
36876
  }
36699
36877
  var EPSILON$3 = 1e-4;
36700
36878
  function isAroundZero(transform) {
36701
- return transform < EPSILON$3 && transform > -1e-4;
36879
+ return transform < EPSILON$3 && transform > -EPSILON$3;
36702
36880
  }
36703
36881
  function round3(transform) {
36704
36882
  return mathRound$1(transform * 1e3) / 1e3;
@@ -37979,7 +38157,7 @@
37979
38157
  var mIdentity = identity;
37980
38158
  var EPSILON$2 = 5e-5;
37981
38159
  function isNotAroundZero(val) {
37982
- return val > EPSILON$2 || val < -5e-5;
38160
+ return val > EPSILON$2 || val < -EPSILON$2;
37983
38161
  }
37984
38162
  var scaleTmp = [];
37985
38163
  var tmpTransform = [];
@@ -38697,7 +38875,7 @@
38697
38875
  this.markRedraw();
38698
38876
  if (!useHoverLayer && this.__inHover) {
38699
38877
  this._toggleHoverLayerFlag(false);
38700
- this.__dirty &= -2;
38878
+ this.__dirty &= ~REDRAW_BIT;
38701
38879
  }
38702
38880
  return state;
38703
38881
  };
@@ -38755,7 +38933,7 @@
38755
38933
  this.markRedraw();
38756
38934
  if (!useHoverLayer && this.__inHover) {
38757
38935
  this._toggleHoverLayerFlag(false);
38758
- this.__dirty &= -2;
38936
+ this.__dirty &= ~REDRAW_BIT;
38759
38937
  }
38760
38938
  }
38761
38939
  };
@@ -40078,7 +40256,7 @@
40078
40256
  * @return {boolean}
40079
40257
  */
40080
40258
  function isRadianAroundZero(val) {
40081
- return val > -1e-4 && val < RADIAN_EPSILON;
40259
+ return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;
40082
40260
  }
40083
40261
  // eslint-disable-next-line
40084
40262
  var TIME_REG = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/; // jshint ignore:line
@@ -41672,7 +41850,7 @@
41672
41850
  return !!(this.__dirty & STYLE_CHANGED_BIT);
41673
41851
  };
41674
41852
  Displayable.prototype.styleUpdated = function () {
41675
- this.__dirty &= -3;
41853
+ this.__dirty &= ~STYLE_CHANGED_BIT;
41676
41854
  };
41677
41855
  Displayable.prototype.createStyle = function (obj) {
41678
41856
  return createObject(DEFAULT_COMMON_STYLE, obj);
@@ -43181,7 +43359,7 @@
43181
43359
  };
43182
43360
  Path.prototype.buildPath = function (ctx, shapeCfg, inBatch) { };
43183
43361
  Path.prototype.pathUpdated = function () {
43184
- this.__dirty &= -5;
43362
+ this.__dirty &= ~SHAPE_CHANGED_BIT;
43185
43363
  };
43186
43364
  Path.prototype.getUpdatedPathProxy = function (inBatch) {
43187
43365
  !this.path && this.createPathProxy();
@@ -55767,7 +55945,7 @@
55767
55945
  function brush$1(ctx, el, scope, isLast) {
55768
55946
  var m = el.transform;
55769
55947
  if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {
55770
- el.__dirty &= -2;
55948
+ el.__dirty &= ~REDRAW_BIT;
55771
55949
  el.__isRendered = false;
55772
55950
  return;
55773
55951
  }
@@ -114036,7 +114214,7 @@
114036
114214
  // and velocity is close to 0
114037
114215
  //
114038
114216
 
114039
- if (velocity.x < -0.5 && currentSlideVisibilityRatio < 0 || velocity.x < 0.1 && currentSlideVisibilityRatio < -0.5) {
114217
+ if (velocity.x < -MIN_NEXT_SLIDE_SPEED && currentSlideVisibilityRatio < 0 || velocity.x < 0.1 && currentSlideVisibilityRatio < -0.5) {
114040
114218
  // Go to next slide
114041
114219
  indexDiff = 1;
114042
114220
  velocity.x = Math.min(velocity.x, 0);
@@ -114100,7 +114278,7 @@
114100
114278
  // or if we are below and moving downwards
114101
114279
 
114102
114280
 
114103
- if (vDragRatio < 0 && projectedVDragRatio < -0.4 || vDragRatio > 0 && projectedVDragRatio > MIN_RATIO_TO_CLOSE) {
114281
+ if (vDragRatio < 0 && projectedVDragRatio < -MIN_RATIO_TO_CLOSE || vDragRatio > 0 && projectedVDragRatio > MIN_RATIO_TO_CLOSE) {
114104
114282
  this.pswp.close();
114105
114283
  return;
114106
114284
  }
@@ -132818,6 +132996,7 @@
132818
132996
  }, Symbol.toStringTag, { value: 'Module' }));
132819
132997
 
132820
132998
  exports.ActionSheet = ActionSheet;
132999
+ exports.Affix = Affix;
132821
133000
  exports.Alert = Alert;
132822
133001
  exports.Artboard = Artboard;
132823
133002
  exports.Button = Button;
@@ -132862,6 +133041,7 @@
132862
133041
  exports.List = MList;
132863
133042
  exports.ListItem = MListItem;
132864
133043
  exports.MActionSheet = MActionSheet;
133044
+ exports.MAffix = MAffix;
132865
133045
  exports.MAlert = MAlert;
132866
133046
  exports.MArtboard = MArtboard;
132867
133047
  exports.MButton = MButton;