@deot/vc-components 1.0.42 → 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.
@@ -63,7 +63,7 @@ var VcComponents = (function (exports, vue) {
63
63
  }
64
64
  const VcInstance = new Instance();
65
65
 
66
- const props$1s = {
66
+ const props$1t = {
67
67
  tag: {
68
68
  type: String,
69
69
  default: "div"
@@ -72,10 +72,10 @@ var VcComponents = (function (exports, vue) {
72
72
 
73
73
  /** @jsxImportSource vue */
74
74
 
75
- const COMPONENT_NAME$27 = 'vc-action-sheet';
75
+ const COMPONENT_NAME$28 = 'vc-action-sheet';
76
76
  const ActionSheet = /* @__PURE__ */ vue.defineComponent({
77
- name: COMPONENT_NAME$27,
78
- props: props$1s,
77
+ name: COMPONENT_NAME$28,
78
+ props: props$1t,
79
79
  setup(props, {
80
80
  slots
81
81
  }) {
@@ -89,6 +89,398 @@ var VcComponents = (function (exports, vue) {
89
89
 
90
90
  const MActionSheet = ActionSheet;
91
91
 
92
+ const IS_SERVER$3 = typeof window === "undefined";
93
+
94
+ const hasClass = (el, cls) => {
95
+ if (IS_SERVER$3 || !cls) return false;
96
+ if (cls.includes(" ")) {
97
+ throw new Error("[@deot/helper-dom]: 类名不应该包含空格");
98
+ }
99
+ if (el.classList) {
100
+ return el.classList.contains(cls);
101
+ } else {
102
+ return (" " + el.className + " ").indexOf(" " + cls + " ") > -1;
103
+ }
104
+ };
105
+
106
+ const addClass = (el, cls) => {
107
+ if (IS_SERVER$3 || !cls) return;
108
+ let curClass = el.className;
109
+ const classes = cls.split(" ");
110
+ for (let i = 0, j = classes.length; i < j; i++) {
111
+ const clsName = classes[i];
112
+ if (clsName) {
113
+ if (el.classList) {
114
+ el.classList.add(clsName);
115
+ } else if (!hasClass(el, clsName)) {
116
+ curClass += " " + clsName;
117
+ }
118
+ }
119
+ }
120
+ if (!el.classList) {
121
+ el.className = curClass;
122
+ }
123
+ };
124
+
125
+ const composedPath = (e) => {
126
+ const path = e.composedPath && e.composedPath() || [];
127
+ if (path.length) return path;
128
+ let parent = e.target?.parentNode;
129
+ /* istanbul ignore next -- @preserve */
130
+ while (parent) {
131
+ path.push(parent);
132
+ parent = parent.parentNode;
133
+ }
134
+ return path;
135
+ };
136
+
137
+ const contains$1 = (el, child) => {
138
+ if (IS_SERVER$3 || !child) return false;
139
+ const childRect = child.getBoundingClientRect();
140
+ let elRect;
141
+ if (!el || [window, document, document.documentElement].includes(el)) {
142
+ elRect = {
143
+ top: 0,
144
+ right: window.innerWidth,
145
+ bottom: window.innerHeight,
146
+ left: 0
147
+ };
148
+ } else {
149
+ elRect = el.getBoundingClientRect();
150
+ }
151
+ return childRect.top < elRect.bottom && childRect.bottom > elRect.top && childRect.right > elRect.left && childRect.left < elRect.right;
152
+ };
153
+
154
+ const el$1 = (v) => {
155
+ if (IS_SERVER$3) return null;
156
+ let target;
157
+ if (typeof v === "object") {
158
+ target = v;
159
+ } else {
160
+ target = document.querySelector(v);
161
+ }
162
+ if (!target) {
163
+ throw new Error("[@deot/helper-dom]: el缺失");
164
+ }
165
+ return target;
166
+ };
167
+
168
+ const getStyle$1 = (el, name) => {
169
+ if (IS_SERVER$3 || !name) return "";
170
+ if (name === "float") {
171
+ name = "cssFloat";
172
+ }
173
+ try {
174
+ const computed = document.defaultView.getComputedStyle(el, "");
175
+ return el.style[name] || (computed?.[name] || "");
176
+ } catch (e) {
177
+ return el.style[name] || "";
178
+ }
179
+ };
180
+
181
+ const isScroller = (el, options) => {
182
+ if (IS_SERVER$3 || !el) return false;
183
+ const { className, direction } = options || {};
184
+ let overflow = getStyle$1(el, `overflow-${direction ? "y" : "x"}`);
185
+ overflow = overflow || getStyle$1(el, "overflow");
186
+ return !!(overflow.match(/(scroll|auto)/) || className?.test(el.className));
187
+ };
188
+
189
+ const getScroller = (el, options) => {
190
+ if (IS_SERVER$3 || !el) return null;
191
+ let parent = el;
192
+ while (parent) {
193
+ if ([window, document, document.documentElement].includes(parent)) {
194
+ return window;
195
+ }
196
+ if (isScroller(parent, options)) {
197
+ return parent;
198
+ }
199
+ parent = parent?.parentNode;
200
+ }
201
+ return parent;
202
+ };
203
+
204
+ const off = (el, event, handler, options) => {
205
+ if (IS_SERVER$3) return;
206
+ el.removeEventListener(event, handler, false);
207
+ };
208
+
209
+ const on = (el, event, handler, options) => {
210
+ if (IS_SERVER$3) return () => {
211
+ };
212
+ el.addEventListener(event, handler, false);
213
+ return () => {
214
+ el.removeEventListener(event, handler, false);
215
+ };
216
+ };
217
+
218
+ const $target = IS_SERVER$3 ? {} : document.createElement("div").style;
219
+ const prefix$1 = (() => {
220
+ const keys = {
221
+ webkit: "webkitTransform",
222
+ Moz: "MozTransform",
223
+ O: "OTransform",
224
+ ms: "msTransform",
225
+ standard: "transform"
226
+ };
227
+ const values = {
228
+ webkit: "-webkit-",
229
+ Moz: "-moz-",
230
+ O: "-o-",
231
+ ms: "-ms-",
232
+ standard: ""
233
+ };
234
+ for (const key in keys) {
235
+ if ($target[keys[key]] !== void 0) {
236
+ return {
237
+ camel: key,
238
+ kebab: values[key]
239
+ };
240
+ }
241
+ }
242
+ return false;
243
+ })();
244
+ const prefixStyle = (v) => {
245
+ if (IS_SERVER$3 || prefix$1 === false) {
246
+ return {
247
+ camel: v,
248
+ kebab: v
249
+ };
250
+ }
251
+ return {
252
+ camel: prefix$1.camel + v.charAt(0).toUpperCase() + v.substr(1),
253
+ kebab: prefix$1.kebab + v
254
+ };
255
+ };
256
+
257
+ const removeClass = (el, cls) => {
258
+ if (IS_SERVER$3 || !cls) return;
259
+ const classes = cls.split(" ");
260
+ let curClass = " " + el.className + " ";
261
+ for (let i = 0, j = classes.length; i < j; i++) {
262
+ const clsName = classes[i];
263
+ if (clsName) {
264
+ if (el.classList) {
265
+ el.classList.remove(clsName);
266
+ continue;
267
+ }
268
+ /* istanbul ignore next -- @preserve */
269
+ if (hasClass(el, clsName)) {
270
+ curClass = curClass.replace(" " + clsName + " ", " ");
271
+ }
272
+ }
273
+ }
274
+ if (!el.classList) {
275
+ el.className = curClass.trim();
276
+ }
277
+ };
278
+
279
+ const scrollIntoView = async (el, options) => {
280
+ if (IS_SERVER$3) return;
281
+ const { from = 0, to = 0, duration = 300 } = options || {};
282
+ const difference = Math.abs(from - to);
283
+ const step = Math.ceil(difference / duration * 50);
284
+ let onResolve;
285
+ const target = new Promise((resolve) => {
286
+ onResolve = resolve;
287
+ });
288
+ const scroll = (start, end) => {
289
+ if (start === end) {
290
+ onResolve();
291
+ return;
292
+ }
293
+ let d = start + step > end ? end : start + step;
294
+ if (start > end) {
295
+ d = start - step < end ? end : start - step;
296
+ }
297
+ if (el === window) {
298
+ window.scrollTo(d, d);
299
+ } else {
300
+ el.scrollTop = d;
301
+ }
302
+ window.requestAnimationFrame(() => scroll(d, end));
303
+ };
304
+ scroll(from, to);
305
+ return target;
306
+ };
307
+
308
+ const props$1s = {
309
+ zIndex: {
310
+ type: [Number, String],
311
+ default: 1
312
+ },
313
+ // TODO: left/right
314
+ placement: {
315
+ type: String,
316
+ default: "top"
317
+ },
318
+ disabled: {
319
+ type: Boolean,
320
+ default: false
321
+ },
322
+ fixed: {
323
+ type: Boolean,
324
+ default: true
325
+ },
326
+ offset: {
327
+ type: Number,
328
+ default: 0
329
+ },
330
+ // -> 固钉始终保持在容器内, 超过范围则隐藏(请注意容器避免出现滚动条) 仅fixed为true有效
331
+ target: {
332
+ type: String
333
+ }
334
+ };
335
+
336
+ /** @jsxImportSource vue */
337
+
338
+ const COMPONENT_NAME$27 = 'vc-affix';
339
+ const SCROLLER_WHEEL_REG = /vc-scroller-wheel/;
340
+ const Affix = /* @__PURE__ */ vue.defineComponent({
341
+ name: COMPONENT_NAME$27,
342
+ props: props$1s,
343
+ setup(props, {
344
+ slots,
345
+ expose
346
+ }) {
347
+ const scrollerInstance = vue.inject('vc-scroller', null);
348
+ const scroller = vue.shallowRef(); // 当前元素所在的滚动容器
349
+ const base = vue.shallowRef(); // 当前元素(props.tagret)的参考容器
350
+ const current = vue.shallowRef(); // 当前元素
351
+
352
+ const currentRect = vue.reactive({
353
+ top: 0,
354
+ bottom: 0,
355
+ width: 0,
356
+ height: 0
357
+ });
358
+ const isActive = vue.ref(false);
359
+ const transformY = vue.ref(0);
360
+ const windowHeight = vue.ref(window.innerHeight);
361
+ const isVcScrollerWheel = vue.computed(() => {
362
+ return SCROLLER_WHEEL_REG.test(scroller.value?.className || '');
363
+ });
364
+ const currentStyle = vue.computed(() => {
365
+ if (!isActive.value) return {};
366
+ return {
367
+ height: `${currentRect.height}px`,
368
+ width: `${currentRect.width}px`
369
+ };
370
+ });
371
+ const contentStyle = vue.computed(() => {
372
+ if (!isActive.value) return {};
373
+ const offset = `${props.offset}px`;
374
+ return {
375
+ height: `${currentRect.height}px`,
376
+ width: `${currentRect.width}px`,
377
+ top: props.placement === 'top' ? offset : '',
378
+ bottom: props.placement === 'bottom' ? offset : '',
379
+ zIndex: props.zIndex,
380
+ transform: transformY.value ? `translateY(${transformY.value}px)` : ''
381
+ };
382
+ });
383
+ const setCurrentRect = () => {
384
+ const rect = current.value.getBoundingClientRect();
385
+ Object.assign(currentRect, {
386
+ top: rect.top,
387
+ bottom: rect.bottom,
388
+ width: rect.width,
389
+ height: rect.height
390
+ });
391
+ };
392
+ const setAbsoluteStatus = () => {
393
+ const {
394
+ placement,
395
+ offset
396
+ } = props;
397
+ const currentHeightOffset = offset + currentRect.height;
398
+ const containerRect = scroller.value.getBoundingClientRect();
399
+ let transformOffsetY = 0;
400
+
401
+ // scroller-wheel滚动条偏移
402
+ if (scrollerInstance && isVcScrollerWheel.value) {
403
+ const maxMoveY = scrollerInstance.scrollHeight - scrollerInstance.clientHeight;
404
+ transformOffsetY = scrollerInstance.scrollTop >= maxMoveY ? maxMoveY : scrollerInstance.scrollTop;
405
+ }
406
+ if (placement === 'top') {
407
+ isActive.value = currentRect.top - containerRect.top <= props.offset;
408
+ transformY.value = Math.min(containerRect.bottom - currentHeightOffset, 0) + transformOffsetY;
409
+ } else {
410
+ isActive.value = currentRect.bottom - containerRect.top >= containerRect.height - props.offset;
411
+ transformY.value = Math.max(containerRect.height - containerRect.top - currentHeightOffset, 0) + transformOffsetY;
412
+ }
413
+ };
414
+ const setFixedStatus = () => {
415
+ const {
416
+ placement,
417
+ target,
418
+ offset
419
+ } = props;
420
+ const currentHeightOffset = offset + currentRect.height;
421
+ const containerRect = target && base.value.getBoundingClientRect();
422
+ if (placement === 'top') {
423
+ if (target) {
424
+ isActive.value = offset > currentRect.top && containerRect.bottom > 0;
425
+ transformY.value = Math.min(containerRect.bottom - currentHeightOffset, 0);
426
+ } else {
427
+ isActive.value = offset > currentRect.top;
428
+ }
429
+ } else {
430
+ if (target) {
431
+ isActive.value = windowHeight.value - offset < currentRect.bottom && windowHeight.value > containerRect.top;
432
+ transformY.value = -Math.min(windowHeight.value - containerRect.top - currentHeightOffset, 0);
433
+ } else {
434
+ isActive.value = windowHeight.value - offset < currentRect.bottom;
435
+ }
436
+ }
437
+ };
438
+ const refresh = () => {
439
+ setCurrentRect();
440
+ scroller.value instanceof Window || props.fixed ? setFixedStatus() : setAbsoluteStatus();
441
+ };
442
+ vue.onMounted(() => {
443
+ if (typeof props.target === 'string') {
444
+ base.value = document.querySelector(props.target) ?? void 0;
445
+ }
446
+ !base.value && (base.value = document.documentElement);
447
+ scroller.value = getScroller(current.value, {
448
+ className: SCROLLER_WHEEL_REG
449
+ });
450
+ if (isVcScrollerWheel.value) {
451
+ scrollerInstance?.on(refresh);
452
+ } else {
453
+ scroller.value?.addEventListener('scroll', refresh);
454
+ }
455
+ refresh();
456
+ });
457
+ vue.onBeforeUnmount(() => {
458
+ if (isVcScrollerWheel.value) {
459
+ scrollerInstance?.off(refresh);
460
+ } else {
461
+ scroller.value?.removeEventListener('scroll', refresh);
462
+ }
463
+ });
464
+ expose({
465
+ refresh
466
+ });
467
+ return () => {
468
+ return vue.createVNode("div", {
469
+ "ref": current,
470
+ "class": "vc-affix",
471
+ "style": currentStyle.value
472
+ }, [vue.createVNode("div", {
473
+ "class": {
474
+ [`vc-affix__${props.fixed ? 'fixed' : 'absolute'}`]: isActive.value
475
+ },
476
+ "style": contentStyle.value
477
+ }, [slots?.default?.()])]);
478
+ };
479
+ }
480
+ });
481
+
482
+ const MAffix = Affix;
483
+
92
484
  const props$1r = {
93
485
  modelValue: {
94
486
  type: Boolean,
@@ -131,9 +523,9 @@ var VcComponents = (function (exports, vue) {
131
523
  const dReg = /.*d="([^"]+).*/g;
132
524
  const fillReg = /.*fill="([^"]+).*/g;
133
525
  const basicUrl = "//at.alicdn.com/t/font_1119857_u0f4525o6sd.js";
134
- const prefix$1 = "@deot/vc-icon:";
526
+ const prefix = "@deot/vc-icon:";
135
527
  const IS_DEV = false;
136
- const IS_SERVER$3 = typeof document === "undefined";
528
+ const IS_SERVER$2 = typeof document === "undefined";
137
529
  class Manager {
138
530
  icons = {};
139
531
  events = {};
@@ -148,10 +540,10 @@ var VcComponents = (function (exports, vue) {
148
540
  this.sourceStatus[url] = this.sourceStatus[url] || new Promise((resolve, reject) => {
149
541
  (async () => {
150
542
  try {
151
- if (IS_SERVER$3 || !/.js$/.test(url)) {
543
+ if (IS_SERVER$2 || !/.js$/.test(url)) {
152
544
  return reject(new VcError("icon", "invaild url"));
153
545
  }
154
- const key = `${prefix$1}${url}`;
546
+ const key = `${prefix}${url}`;
155
547
  const cache = window.localStorage.getItem(key);
156
548
  let icons = JSON.parse(cache || '""');
157
549
  /* istanbul ignore next -- @preserve */
@@ -233,7 +625,7 @@ var VcComponents = (function (exports, vue) {
233
625
  if (this.events[type].length >= 100) {
234
626
  delete this.events[type];
235
627
  /* istanbul ignore else -- @preserve */
236
- if (!IS_SERVER$3) {
628
+ if (!IS_SERVER$2) {
237
629
  throw new VcError("icon", `${type} nonexistent`);
238
630
  }
239
631
  }
@@ -250,8 +642,8 @@ var VcComponents = (function (exports, vue) {
250
642
  clearResource() {
251
643
  const needs = Object.keys(this.sourceStatus);
252
644
  Object.keys(window.localStorage).forEach((item) => {
253
- if (item.includes(prefix$1)) {
254
- const key = item.split(prefix$1).pop();
645
+ if (item.includes(prefix)) {
646
+ const key = item.split(prefix).pop();
255
647
  key && !needs.includes(key) && window.localStorage.removeItem(item);
256
648
  }
257
649
  });
@@ -775,7 +1167,7 @@ var VcComponents = (function (exports, vue) {
775
1167
 
776
1168
  // [color, borderColor, backgroundColor], -> CSS
777
1169
  const THEME_MAP = {
778
- info: ['#2B72FD', '#91d5ff', '#e6f7ff'],
1170
+ info: ['#456CF6', '#91d5ff', '#e6f7ff'],
779
1171
  success: ['#52c41a', '#b7eb8f', '#f6ffed'],
780
1172
  error: ['#ed4014', '#ffb08f', '#fbe9e9'],
781
1173
  warning: ['#ffbf00', '#ffe58f', '#fffbe6']
@@ -966,7 +1358,7 @@ var VcComponents = (function (exports, vue) {
966
1358
  );
967
1359
  };
968
1360
 
969
- const flatten$1 = (value, parser) => {
1361
+ const flatten$1 = (value, parser, exit) => {
970
1362
  let need = true;
971
1363
  let safeCount = 1;
972
1364
  let parseValue = value;
@@ -976,7 +1368,7 @@ var VcComponents = (function (exports, vue) {
976
1368
  }
977
1369
  try {
978
1370
  const next = (parser || decodeURIComponent)(parseValue);
979
- if (parseValue === next) {
1371
+ if (parseValue === next || typeof exit === "function" && exit(next)) {
980
1372
  need = false;
981
1373
  }
982
1374
  parseValue = next;
@@ -989,8 +1381,7 @@ var VcComponents = (function (exports, vue) {
989
1381
  };
990
1382
 
991
1383
  const flattenJSONParse = (value) => {
992
- if (value === null)
993
- return null;
1384
+ if (value === null) return null;
994
1385
  const regex = /^\d+$/;
995
1386
  if (regex.test(value) && value.length >= 16 && +value > Number.MAX_SAFE_INTEGER) {
996
1387
  return value;
@@ -3618,7 +4009,7 @@ var VcComponents = (function (exports, vue) {
3618
4009
  function castSlice(array, start, end) {
3619
4010
  var length = array.length;
3620
4011
  end = end === undefined ? length : end;
3621
- return (false && end >= length) ? array : baseSlice(array, start, end);
4012
+ return (!start && end >= length) ? array : baseSlice(array, start, end);
3622
4013
  }
3623
4014
 
3624
4015
  /** Used to compose unicode character classes. */
@@ -6692,233 +7083,6 @@ var VcComponents = (function (exports, vue) {
6692
7083
  return parent;
6693
7084
  };
6694
7085
 
6695
- const IS_SERVER$2 = typeof window === "undefined";
6696
-
6697
- const hasClass = (el, cls) => {
6698
- if (IS_SERVER$2 || !cls)
6699
- return false;
6700
- if (cls.includes(" ")) {
6701
- throw new Error("[@deot/helper-dom]: 类名不应该包含空格");
6702
- }
6703
- if (el.classList) {
6704
- return el.classList.contains(cls);
6705
- } else {
6706
- return (" " + el.className + " ").indexOf(" " + cls + " ") > -1;
6707
- }
6708
- };
6709
-
6710
- const addClass = (el, cls) => {
6711
- if (IS_SERVER$2 || !cls)
6712
- return;
6713
- let curClass = el.className;
6714
- let classes = cls.split(" ");
6715
- for (let i = 0, j = classes.length; i < j; i++) {
6716
- let clsName = classes[i];
6717
- if (clsName) {
6718
- if (el.classList) {
6719
- el.classList.add(clsName);
6720
- } else if (!hasClass(el, clsName)) {
6721
- curClass += " " + clsName;
6722
- }
6723
- }
6724
- }
6725
- if (!el.classList) {
6726
- el.className = curClass;
6727
- }
6728
- };
6729
-
6730
- const composedPath = (e) => {
6731
- let path = e.composedPath && e.composedPath() || [];
6732
- if (path.length)
6733
- return path;
6734
- let parent = e.target?.parentNode;
6735
- /* istanbul ignore next -- @preserve */
6736
- while (parent) {
6737
- path.push(parent);
6738
- parent = parent.parentNode;
6739
- }
6740
- return path;
6741
- };
6742
-
6743
- const contains$1 = (el, child) => {
6744
- if (IS_SERVER$2 || !child)
6745
- return false;
6746
- let childRect = child.getBoundingClientRect();
6747
- let elRect;
6748
- if (!el || [window, document, document.documentElement].includes(el)) {
6749
- elRect = {
6750
- top: 0,
6751
- right: window.innerWidth,
6752
- bottom: window.innerHeight,
6753
- left: 0
6754
- };
6755
- } else {
6756
- elRect = el.getBoundingClientRect();
6757
- }
6758
- return childRect.top < elRect.bottom && childRect.bottom > elRect.top && childRect.right > elRect.left && childRect.left < elRect.right;
6759
- };
6760
-
6761
- const el$1 = (v) => {
6762
- if (IS_SERVER$2)
6763
- return null;
6764
- let target;
6765
- if (typeof v === "object") {
6766
- target = v;
6767
- } else {
6768
- target = document.querySelector(v);
6769
- }
6770
- if (!target) {
6771
- throw new Error("[@deot/helper-dom]: el缺失");
6772
- }
6773
- return target;
6774
- };
6775
-
6776
- const getStyle$1 = (el, name) => {
6777
- if (IS_SERVER$2 || !name)
6778
- return "";
6779
- if (name === "float") {
6780
- name = "cssFloat";
6781
- }
6782
- try {
6783
- let computed = document.defaultView.getComputedStyle(el, "");
6784
- return el.style[name] || (computed?.[name] || "");
6785
- } catch (e) {
6786
- return el.style[name] || "";
6787
- }
6788
- };
6789
-
6790
- const isScroll = (el, direction) => {
6791
- if (IS_SERVER$2 || !el)
6792
- return false;
6793
- let overflow = getStyle$1(el, `overflow-${"x"}`);
6794
- overflow = overflow || getStyle$1(el, "overflow");
6795
- return !!overflow.match(/(scroll|auto)/);
6796
- };
6797
-
6798
- const getScroller = (el, direction) => {
6799
- if (IS_SERVER$2 || !el)
6800
- return null;
6801
- let parent = el;
6802
- while (parent) {
6803
- if ([window, document, document.documentElement].includes(parent)) {
6804
- return window;
6805
- }
6806
- if (isScroll(parent)) {
6807
- return parent;
6808
- }
6809
- parent = parent?.parentNode;
6810
- }
6811
- return parent;
6812
- };
6813
-
6814
- const off = (el, event, handler, options) => {
6815
- if (IS_SERVER$2)
6816
- return;
6817
- el.removeEventListener(event, handler, false);
6818
- };
6819
-
6820
- const on = (el, event, handler, options) => {
6821
- if (IS_SERVER$2)
6822
- return () => {
6823
- };
6824
- el.addEventListener(event, handler, false);
6825
- return () => {
6826
- el.removeEventListener(event, handler, false);
6827
- };
6828
- };
6829
-
6830
- const $target = IS_SERVER$2 ? {} : document.createElement("div").style;
6831
- const prefix = (() => {
6832
- let keys = {
6833
- webkit: "webkitTransform",
6834
- Moz: "MozTransform",
6835
- O: "OTransform",
6836
- ms: "msTransform",
6837
- standard: "transform"
6838
- };
6839
- let values = {
6840
- webkit: "-webkit-",
6841
- Moz: "-moz-",
6842
- O: "-o-",
6843
- ms: "-ms-",
6844
- standard: ""
6845
- };
6846
- for (let key in keys) {
6847
- if ($target[keys[key]] !== void 0) {
6848
- return {
6849
- camel: key,
6850
- kebab: values[key]
6851
- };
6852
- }
6853
- }
6854
- return false;
6855
- })();
6856
- const prefixStyle = (v) => {
6857
- if (IS_SERVER$2 || prefix === false) {
6858
- return {
6859
- camel: v,
6860
- kebab: v
6861
- };
6862
- }
6863
- return {
6864
- camel: prefix.camel + v.charAt(0).toUpperCase() + v.substr(1),
6865
- kebab: prefix.kebab + v
6866
- };
6867
- };
6868
-
6869
- const removeClass = (el, cls) => {
6870
- if (IS_SERVER$2 || !cls)
6871
- return;
6872
- let classes = cls.split(" ");
6873
- let curClass = " " + el.className + " ";
6874
- for (let i = 0, j = classes.length; i < j; i++) {
6875
- let clsName = classes[i];
6876
- if (clsName) {
6877
- if (el.classList) {
6878
- el.classList.remove(clsName);
6879
- continue;
6880
- }
6881
- /* istanbul ignore next -- @preserve */
6882
- if (hasClass(el, clsName)) {
6883
- curClass = curClass.replace(" " + clsName + " ", " ");
6884
- }
6885
- }
6886
- }
6887
- if (!el.classList) {
6888
- el.className = curClass.trim();
6889
- }
6890
- };
6891
-
6892
- const scrollIntoView = async (el, options) => {
6893
- if (IS_SERVER$2)
6894
- return;
6895
- let { from = 0, to = 0, duration = 300 } = options || {};
6896
- let difference = Math.abs(from - to);
6897
- let step = Math.ceil(difference / duration * 50);
6898
- let onResolve;
6899
- let target = new Promise((resolve) => {
6900
- onResolve = resolve;
6901
- });
6902
- const scroll = (start, end) => {
6903
- if (start === end) {
6904
- onResolve();
6905
- return;
6906
- }
6907
- let d = start + step > end ? end : start + step;
6908
- if (start > end) {
6909
- d = start - step < end ? end : start - step;
6910
- }
6911
- if (el === window) {
6912
- window.scrollTo(d, d);
6913
- } else {
6914
- el.scrollTop = d;
6915
- }
6916
- window.requestAnimationFrame(() => scroll(d, end));
6917
- };
6918
- scroll(from, to);
6919
- return target;
6920
- };
6921
-
6922
7086
  const getSelectedData = (value = [], source = []) => {
6923
7087
  const label = [];
6924
7088
  const data = [];
@@ -14690,6 +14854,7 @@ var VcComponents = (function (exports, vue) {
14690
14854
  refreshSize();
14691
14855
  refreshPosition(options);
14692
14856
  };
14857
+ const listeners = [];
14693
14858
  const triggerScrollDelegate = (options) => {
14694
14859
  const delegates = {
14695
14860
  scrollLeft: (options && options.x) ?? scrollX.value,
@@ -14697,12 +14862,15 @@ var VcComponents = (function (exports, vue) {
14697
14862
  clientWidth: wrapperW.value,
14698
14863
  clientHeight: wrapperH.value,
14699
14864
  scrollWidth: contentW.value,
14700
- scrollHeight: contentH.value
14865
+ scrollHeight: contentH.value,
14866
+ getBoundingClientRect: () => wrapper.value?.getBoundingClientRect()
14701
14867
  };
14702
- instance.emit("scroll", {
14868
+ const e = {
14703
14869
  target: delegates,
14704
14870
  currentTarget: delegates
14705
- });
14871
+ };
14872
+ instance.emit("scroll", e);
14873
+ listeners.forEach((listener) => listener(e));
14706
14874
  };
14707
14875
  const scrollTo = (options) => {
14708
14876
  refreshPosition(options);
@@ -14729,8 +14897,9 @@ var VcComponents = (function (exports, vue) {
14729
14897
  Resize.off(wrapper.value, refresh);
14730
14898
  Resize.off(content.value, refresh);
14731
14899
  }
14900
+ listeners.splice(0, listeners.length);
14732
14901
  });
14733
- expose({
14902
+ const exposed = {
14734
14903
  wrapper,
14735
14904
  content,
14736
14905
  scrollTo,
@@ -14746,8 +14915,16 @@ var VcComponents = (function (exports, vue) {
14746
14915
  },
14747
14916
  setScrollLeft: (value) => {
14748
14917
  scrollTo({ x: value });
14918
+ },
14919
+ on: (listener) => {
14920
+ listeners.push(listener);
14921
+ },
14922
+ off: (listener) => {
14923
+ listeners.splice(listeners.indexOf(listener), 1);
14749
14924
  }
14750
- });
14925
+ };
14926
+ expose(exposed);
14927
+ vue.provide("vc-scroller", vue.reactive(exposed));
14751
14928
  return {
14752
14929
  bar,
14753
14930
  wrapper,
@@ -23793,7 +23970,7 @@ var VcComponents = (function (exports, vue) {
23793
23970
  color: {
23794
23971
  type: [Object, String],
23795
23972
  default: () => ({
23796
- normal: "#2B72FD",
23973
+ normal: "#456CF6",
23797
23974
  success: "#52c41a",
23798
23975
  error: "#f5222d"
23799
23976
  })
@@ -27268,10 +27445,38 @@ var VcComponents = (function (exports, vue) {
27268
27445
  }
27269
27446
  });
27270
27447
 
27271
- // import TableSort from './table-sort';
27448
+ const TableSort = /* @__PURE__ */ vue.defineComponent({
27449
+ name: 'vc-table-sort',
27450
+ props: {
27451
+ order: String
27452
+ },
27453
+ emits: ['click'],
27454
+ setup(props, {
27455
+ emit
27456
+ }) {
27457
+ const handleClick = v => {
27458
+ emit('click', props.order !== v ? v : '');
27459
+ };
27460
+ return () => {
27461
+ return vue.createVNode("span", {
27462
+ "class": "vc-table-sort"
27463
+ }, [vue.createVNode("span", {
27464
+ "class": [{
27465
+ 'is-ascending': props.order === 'ascending'
27466
+ }, 'vc-table-sort__icon vc-table-sort__icon--ascending'],
27467
+ "onClick": vue.withModifiers(() => handleClick('ascending'), ['stop'])
27468
+ }, null), vue.createVNode("span", {
27469
+ "class": [{
27470
+ 'is-descending': props.order === 'descending'
27471
+ }, 'vc-table-sort__icon vc-table-sort__icon--descending'],
27472
+ "onClick": vue.withModifiers(() => handleClick('descending'), ['stop'])
27473
+ }, null)]);
27474
+ };
27475
+ }
27476
+ });
27477
+
27272
27478
  // import TableFilter from './table-filter';
27273
27479
 
27274
- const TableSort = 'div';
27275
27480
  const TableFilter = 'div';
27276
27481
  const TableHeader = /* @__PURE__ */ vue.defineComponent({
27277
27482
  name: 'vc-table-header',
@@ -27279,7 +27484,7 @@ var VcComponents = (function (exports, vue) {
27279
27484
  fixed: [Boolean, String],
27280
27485
  border: Boolean,
27281
27486
  // 排序全部交给外部处理,内部不处理数据,只做交互
27282
- defaultSort: {
27487
+ sort: {
27283
27488
  type: Object,
27284
27489
  default: () => ({})
27285
27490
  }
@@ -27477,10 +27682,12 @@ var VcComponents = (function (exports, vue) {
27477
27682
  document.body.style.cursor = '';
27478
27683
  };
27479
27684
  const handleSort = (prop, order) => {
27480
- table.emit('sort-change', {
27685
+ const v = {
27481
27686
  prop,
27482
27687
  order
27483
- });
27688
+ };
27689
+ table.emit('update:sort', v);
27690
+ table.emit('sort-change', v);
27484
27691
  };
27485
27692
  const handleFilter = (column, value) => {
27486
27693
  const {
@@ -27536,9 +27743,10 @@ var VcComponents = (function (exports, vue) {
27536
27743
  store: table.store
27537
27744
  }) : column.label, column.tooltip ? vue.createVNode(Icon, {
27538
27745
  "type": "o-info",
27746
+ "class": "vc-table__tooltip",
27539
27747
  "onMouseenter": e => handleCellMouseEnter(e, column)
27540
27748
  }, null) : null, column.sortable ? vue.createVNode(TableSort, {
27541
- "order": column.prop === props.defaultSort.prop ? props.defaultSort.order : '',
27749
+ "order": column.prop === props.sort.prop ? props.sort.order : '',
27542
27750
  "onClick": order => handleSort(column.prop, order)
27543
27751
  }, null) : null, column.filters ? vue.createVNode(TableFilter, {
27544
27752
  "data": column.filters,
@@ -27753,7 +27961,7 @@ var VcComponents = (function (exports, vue) {
27753
27961
  * 排序全部交给外部处理,内部不处理数据,只做交互
27754
27962
  * 列与列之间互斥
27755
27963
  */
27756
- defaultSort: {
27964
+ sort: {
27757
27965
  type: Object,
27758
27966
  default: () => ({})
27759
27967
  },
@@ -27767,7 +27975,7 @@ var VcComponents = (function (exports, vue) {
27767
27975
  const Table$1 = /* @__PURE__ */ vue.defineComponent({
27768
27976
  name: COMPONENT_NAME$j,
27769
27977
  props: props$d,
27770
- emits: ['select', 'select-all', 'selection-change', 'cell-mouse-enter', 'cell-mouse-leave', 'cell-click', 'cell-dblclick', 'row-click', 'row-contextmenu', 'row-dblclick', 'header-click', 'header-contextmenu', 'current-change', 'header-dragend ', 'expand-change', 'sort-change'],
27978
+ emits: ['select', 'select-all', 'selection-change', 'cell-mouse-enter', 'cell-mouse-leave', 'cell-click', 'cell-dblclick', 'row-click', 'row-contextmenu', 'row-dblclick', 'header-click', 'header-contextmenu', 'current-change', 'header-dragend ', 'expand-change', 'sort-change', 'update:sort'],
27771
27979
  setup(props, {
27772
27980
  slots,
27773
27981
  expose,
@@ -28173,7 +28381,7 @@ var VcComponents = (function (exports, vue) {
28173
28381
  }, [vue.createVNode(TableHeader, {
28174
28382
  "ref": tableHeader,
28175
28383
  "border": props.border,
28176
- "default-sort": props.defaultSort,
28384
+ "sort": props.sort,
28177
28385
  "style": bodyWidthStyle.value
28178
28386
  }, null)]), states.columns.length > 0 && vue.createVNode(ScrollerWheel, {
28179
28387
  "ref": scroller,
@@ -28222,7 +28430,7 @@ var VcComponents = (function (exports, vue) {
28222
28430
  }, [vue.createVNode(TableHeader, {
28223
28431
  "ref": leftFixedTableHeader,
28224
28432
  "border": props.border,
28225
- "default-sort": props.defaultSort,
28433
+ "sort": props.sort,
28226
28434
  "style": bodyWidthStyle.value,
28227
28435
  "fixed": "left"
28228
28436
  }, null)]), vue.createVNode("div", {
@@ -28261,7 +28469,7 @@ var VcComponents = (function (exports, vue) {
28261
28469
  }, [vue.createVNode(TableHeader, {
28262
28470
  "ref": rightFixedTableHeader,
28263
28471
  "border": props.border,
28264
- "default-sort": props.defaultSort,
28472
+ "sort": props.sort,
28265
28473
  "style": bodyWidthStyle.value,
28266
28474
  "fixed": "right"
28267
28475
  }, null)]), vue.createVNode("div", {
@@ -29076,7 +29284,8 @@ var VcComponents = (function (exports, vue) {
29076
29284
 
29077
29285
  const props$b = {
29078
29286
  value: {
29079
- type: [String, Number, Boolean]
29287
+ type: [String, Number, Boolean],
29288
+ default: void 0
29080
29289
  },
29081
29290
  label: {
29082
29291
  type: [String, Function],
@@ -29424,7 +29633,7 @@ var VcComponents = (function (exports, vue) {
29424
29633
  "class": [{
29425
29634
  'is-fixed': isFixed
29426
29635
  }, 'vcm-tabs__bar']
29427
- }, [vue.createVNode("slot", {
29636
+ }, [vue.createVNode(vue.resolveComponent("slot"), {
29428
29637
  "name": "prepend"
29429
29638
  }, null), slots.prepend?.(), props.showStep && tabs.scrollable.value && vue.createVNode("div", {
29430
29639
  "class": "vcm-tabs__step is-left",
@@ -35674,10 +35883,10 @@ var VcComponents = (function (exports, vue) {
35674
35883
  var _v1 = create$2();
35675
35884
  var _v2 = create$2();
35676
35885
  function isAroundZero$1(val) {
35677
- return val > -1e-8 && val < EPSILON$4;
35886
+ return val > -EPSILON$4 && val < EPSILON$4;
35678
35887
  }
35679
35888
  function isNotAroundZero$1(val) {
35680
- return val > EPSILON$4 || val < -1e-8;
35889
+ return val > EPSILON$4 || val < -EPSILON$4;
35681
35890
  }
35682
35891
  function cubicAt(p0, p1, p2, p3, t) {
35683
35892
  var onet = 1 - t;
@@ -36664,7 +36873,7 @@ var VcComponents = (function (exports, vue) {
36664
36873
  }
36665
36874
  var EPSILON$3 = 1e-4;
36666
36875
  function isAroundZero(transform) {
36667
- return transform < EPSILON$3 && transform > -1e-4;
36876
+ return transform < EPSILON$3 && transform > -EPSILON$3;
36668
36877
  }
36669
36878
  function round3(transform) {
36670
36879
  return mathRound$1(transform * 1e3) / 1e3;
@@ -37945,7 +38154,7 @@ var VcComponents = (function (exports, vue) {
37945
38154
  var mIdentity = identity;
37946
38155
  var EPSILON$2 = 5e-5;
37947
38156
  function isNotAroundZero(val) {
37948
- return val > EPSILON$2 || val < -5e-5;
38157
+ return val > EPSILON$2 || val < -EPSILON$2;
37949
38158
  }
37950
38159
  var scaleTmp = [];
37951
38160
  var tmpTransform = [];
@@ -38663,7 +38872,7 @@ var VcComponents = (function (exports, vue) {
38663
38872
  this.markRedraw();
38664
38873
  if (!useHoverLayer && this.__inHover) {
38665
38874
  this._toggleHoverLayerFlag(false);
38666
- this.__dirty &= -2;
38875
+ this.__dirty &= ~REDRAW_BIT;
38667
38876
  }
38668
38877
  return state;
38669
38878
  };
@@ -38721,7 +38930,7 @@ var VcComponents = (function (exports, vue) {
38721
38930
  this.markRedraw();
38722
38931
  if (!useHoverLayer && this.__inHover) {
38723
38932
  this._toggleHoverLayerFlag(false);
38724
- this.__dirty &= -2;
38933
+ this.__dirty &= ~REDRAW_BIT;
38725
38934
  }
38726
38935
  }
38727
38936
  };
@@ -40044,7 +40253,7 @@ var VcComponents = (function (exports, vue) {
40044
40253
  * @return {boolean}
40045
40254
  */
40046
40255
  function isRadianAroundZero(val) {
40047
- return val > -1e-4 && val < RADIAN_EPSILON;
40256
+ return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;
40048
40257
  }
40049
40258
  // eslint-disable-next-line
40050
40259
  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
@@ -41638,7 +41847,7 @@ var VcComponents = (function (exports, vue) {
41638
41847
  return !!(this.__dirty & STYLE_CHANGED_BIT);
41639
41848
  };
41640
41849
  Displayable.prototype.styleUpdated = function () {
41641
- this.__dirty &= -3;
41850
+ this.__dirty &= ~STYLE_CHANGED_BIT;
41642
41851
  };
41643
41852
  Displayable.prototype.createStyle = function (obj) {
41644
41853
  return createObject(DEFAULT_COMMON_STYLE, obj);
@@ -43147,7 +43356,7 @@ var VcComponents = (function (exports, vue) {
43147
43356
  };
43148
43357
  Path.prototype.buildPath = function (ctx, shapeCfg, inBatch) { };
43149
43358
  Path.prototype.pathUpdated = function () {
43150
- this.__dirty &= -5;
43359
+ this.__dirty &= ~SHAPE_CHANGED_BIT;
43151
43360
  };
43152
43361
  Path.prototype.getUpdatedPathProxy = function (inBatch) {
43153
43362
  !this.path && this.createPathProxy();
@@ -55733,7 +55942,7 @@ var VcComponents = (function (exports, vue) {
55733
55942
  function brush$1(ctx, el, scope, isLast) {
55734
55943
  var m = el.transform;
55735
55944
  if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {
55736
- el.__dirty &= -2;
55945
+ el.__dirty &= ~REDRAW_BIT;
55737
55946
  el.__isRendered = false;
55738
55947
  return;
55739
55948
  }
@@ -114002,7 +114211,7 @@ var VcComponents = (function (exports, vue) {
114002
114211
  // and velocity is close to 0
114003
114212
  //
114004
114213
 
114005
- if (velocity.x < -0.5 && currentSlideVisibilityRatio < 0 || velocity.x < 0.1 && currentSlideVisibilityRatio < -0.5) {
114214
+ if (velocity.x < -MIN_NEXT_SLIDE_SPEED && currentSlideVisibilityRatio < 0 || velocity.x < 0.1 && currentSlideVisibilityRatio < -0.5) {
114006
114215
  // Go to next slide
114007
114216
  indexDiff = 1;
114008
114217
  velocity.x = Math.min(velocity.x, 0);
@@ -114066,7 +114275,7 @@ var VcComponents = (function (exports, vue) {
114066
114275
  // or if we are below and moving downwards
114067
114276
 
114068
114277
 
114069
- if (vDragRatio < 0 && projectedVDragRatio < -0.4 || vDragRatio > 0 && projectedVDragRatio > MIN_RATIO_TO_CLOSE) {
114278
+ if (vDragRatio < 0 && projectedVDragRatio < -MIN_RATIO_TO_CLOSE || vDragRatio > 0 && projectedVDragRatio > MIN_RATIO_TO_CLOSE) {
114070
114279
  this.pswp.close();
114071
114280
  return;
114072
114281
  }
@@ -132784,6 +132993,7 @@ var VcComponents = (function (exports, vue) {
132784
132993
  }, Symbol.toStringTag, { value: 'Module' }));
132785
132994
 
132786
132995
  exports.ActionSheet = ActionSheet;
132996
+ exports.Affix = Affix;
132787
132997
  exports.Alert = Alert;
132788
132998
  exports.Artboard = Artboard;
132789
132999
  exports.Button = Button;
@@ -132828,6 +133038,7 @@ var VcComponents = (function (exports, vue) {
132828
133038
  exports.List = MList;
132829
133039
  exports.ListItem = MListItem;
132830
133040
  exports.MActionSheet = MActionSheet;
133041
+ exports.MAffix = MAffix;
132831
133042
  exports.MAlert = MAlert;
132832
133043
  exports.MArtboard = MArtboard;
132833
133044
  exports.MButton = MButton;