@deot/vc 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.
@@ -124,6 +124,222 @@ var Vc = (function (exports, vue) {
124
124
  return parent;
125
125
  };
126
126
 
127
+ const IS_SERVER$2 = typeof window === "undefined";
128
+
129
+ const hasClass = (el, cls) => {
130
+ if (IS_SERVER$2 || !cls) return false;
131
+ if (cls.includes(" ")) {
132
+ throw new Error("[@deot/helper-dom]: 类名不应该包含空格");
133
+ }
134
+ if (el.classList) {
135
+ return el.classList.contains(cls);
136
+ } else {
137
+ return (" " + el.className + " ").indexOf(" " + cls + " ") > -1;
138
+ }
139
+ };
140
+
141
+ const addClass = (el, cls) => {
142
+ if (IS_SERVER$2 || !cls) return;
143
+ let curClass = el.className;
144
+ const classes = cls.split(" ");
145
+ for (let i = 0, j = classes.length; i < j; i++) {
146
+ const clsName = classes[i];
147
+ if (clsName) {
148
+ if (el.classList) {
149
+ el.classList.add(clsName);
150
+ } else if (!hasClass(el, clsName)) {
151
+ curClass += " " + clsName;
152
+ }
153
+ }
154
+ }
155
+ if (!el.classList) {
156
+ el.className = curClass;
157
+ }
158
+ };
159
+
160
+ const composedPath = (e) => {
161
+ const path = e.composedPath && e.composedPath() || [];
162
+ if (path.length) return path;
163
+ let parent = e.target?.parentNode;
164
+ /* istanbul ignore next -- @preserve */
165
+ while (parent) {
166
+ path.push(parent);
167
+ parent = parent.parentNode;
168
+ }
169
+ return path;
170
+ };
171
+
172
+ const contains$1 = (el, child) => {
173
+ if (IS_SERVER$2 || !child) return false;
174
+ const childRect = child.getBoundingClientRect();
175
+ let elRect;
176
+ if (!el || [window, document, document.documentElement].includes(el)) {
177
+ elRect = {
178
+ top: 0,
179
+ right: window.innerWidth,
180
+ bottom: window.innerHeight,
181
+ left: 0
182
+ };
183
+ } else {
184
+ elRect = el.getBoundingClientRect();
185
+ }
186
+ return childRect.top < elRect.bottom && childRect.bottom > elRect.top && childRect.right > elRect.left && childRect.left < elRect.right;
187
+ };
188
+
189
+ const el$1 = (v) => {
190
+ if (IS_SERVER$2) return null;
191
+ let target;
192
+ if (typeof v === "object") {
193
+ target = v;
194
+ } else {
195
+ target = document.querySelector(v);
196
+ }
197
+ if (!target) {
198
+ throw new Error("[@deot/helper-dom]: el缺失");
199
+ }
200
+ return target;
201
+ };
202
+
203
+ const getStyle$1 = (el, name) => {
204
+ if (IS_SERVER$2 || !name) return "";
205
+ if (name === "float") {
206
+ name = "cssFloat";
207
+ }
208
+ try {
209
+ const computed = document.defaultView.getComputedStyle(el, "");
210
+ return el.style[name] || (computed?.[name] || "");
211
+ } catch (e) {
212
+ return el.style[name] || "";
213
+ }
214
+ };
215
+
216
+ const isScroller = (el, options) => {
217
+ if (IS_SERVER$2 || !el) return false;
218
+ const { className, direction } = options || {};
219
+ let overflow = getStyle$1(el, `overflow-${direction ? "y" : "x"}`);
220
+ overflow = overflow || getStyle$1(el, "overflow");
221
+ return !!(overflow.match(/(scroll|auto)/) || className?.test(el.className));
222
+ };
223
+
224
+ const getScroller = (el, options) => {
225
+ if (IS_SERVER$2 || !el) return null;
226
+ let parent = el;
227
+ while (parent) {
228
+ if ([window, document, document.documentElement].includes(parent)) {
229
+ return window;
230
+ }
231
+ if (isScroller(parent, options)) {
232
+ return parent;
233
+ }
234
+ parent = parent?.parentNode;
235
+ }
236
+ return parent;
237
+ };
238
+
239
+ const off = (el, event, handler, options) => {
240
+ if (IS_SERVER$2) return;
241
+ el.removeEventListener(event, handler, false);
242
+ };
243
+
244
+ const on = (el, event, handler, options) => {
245
+ if (IS_SERVER$2) return () => {
246
+ };
247
+ el.addEventListener(event, handler, false);
248
+ return () => {
249
+ el.removeEventListener(event, handler, false);
250
+ };
251
+ };
252
+
253
+ const $target = IS_SERVER$2 ? {} : document.createElement("div").style;
254
+ const prefix$1 = (() => {
255
+ const keys = {
256
+ webkit: "webkitTransform",
257
+ Moz: "MozTransform",
258
+ O: "OTransform",
259
+ ms: "msTransform",
260
+ standard: "transform"
261
+ };
262
+ const values = {
263
+ webkit: "-webkit-",
264
+ Moz: "-moz-",
265
+ O: "-o-",
266
+ ms: "-ms-",
267
+ standard: ""
268
+ };
269
+ for (const key in keys) {
270
+ if ($target[keys[key]] !== void 0) {
271
+ return {
272
+ camel: key,
273
+ kebab: values[key]
274
+ };
275
+ }
276
+ }
277
+ return false;
278
+ })();
279
+ const prefixStyle = (v) => {
280
+ if (IS_SERVER$2 || prefix$1 === false) {
281
+ return {
282
+ camel: v,
283
+ kebab: v
284
+ };
285
+ }
286
+ return {
287
+ camel: prefix$1.camel + v.charAt(0).toUpperCase() + v.substr(1),
288
+ kebab: prefix$1.kebab + v
289
+ };
290
+ };
291
+
292
+ const removeClass = (el, cls) => {
293
+ if (IS_SERVER$2 || !cls) return;
294
+ const classes = cls.split(" ");
295
+ let curClass = " " + el.className + " ";
296
+ for (let i = 0, j = classes.length; i < j; i++) {
297
+ const clsName = classes[i];
298
+ if (clsName) {
299
+ if (el.classList) {
300
+ el.classList.remove(clsName);
301
+ continue;
302
+ }
303
+ /* istanbul ignore next -- @preserve */
304
+ if (hasClass(el, clsName)) {
305
+ curClass = curClass.replace(" " + clsName + " ", " ");
306
+ }
307
+ }
308
+ }
309
+ if (!el.classList) {
310
+ el.className = curClass.trim();
311
+ }
312
+ };
313
+
314
+ const scrollIntoView = async (el, options) => {
315
+ if (IS_SERVER$2) return;
316
+ const { from = 0, to = 0, duration = 300 } = options || {};
317
+ const difference = Math.abs(from - to);
318
+ const step = Math.ceil(difference / duration * 50);
319
+ let onResolve;
320
+ const target = new Promise((resolve) => {
321
+ onResolve = resolve;
322
+ });
323
+ const scroll = (start, end) => {
324
+ if (start === end) {
325
+ onResolve();
326
+ return;
327
+ }
328
+ let d = start + step > end ? end : start + step;
329
+ if (start > end) {
330
+ d = start - step < end ? end : start - step;
331
+ }
332
+ if (el === window) {
333
+ window.scrollTo(d, d);
334
+ } else {
335
+ el.scrollTop = d;
336
+ }
337
+ window.requestAnimationFrame(() => scroll(d, end));
338
+ };
339
+ scroll(from, to);
340
+ return target;
341
+ };
342
+
127
343
  const debounce$1 = (original, wait, options) => {
128
344
  const { leading, trailing = true, throttle } = options || {};
129
345
  let timer;
@@ -219,7 +435,7 @@ var Vc = (function (exports, vue) {
219
435
  );
220
436
  };
221
437
 
222
- const flatten$1 = (value, parser) => {
438
+ const flatten$1 = (value, parser, exit) => {
223
439
  let need = true;
224
440
  let safeCount = 1;
225
441
  let parseValue = value;
@@ -229,7 +445,7 @@ var Vc = (function (exports, vue) {
229
445
  }
230
446
  try {
231
447
  const next = (parser || decodeURIComponent)(parseValue);
232
- if (parseValue === next) {
448
+ if (parseValue === next || typeof exit === "function" && exit(next)) {
233
449
  need = false;
234
450
  }
235
451
  parseValue = next;
@@ -242,8 +458,7 @@ var Vc = (function (exports, vue) {
242
458
  };
243
459
 
244
460
  const flattenJSONParse = (value) => {
245
- if (value === null)
246
- return null;
461
+ if (value === null) return null;
247
462
  const regex = /^\d+$/;
248
463
  if (regex.test(value) && value.length >= 16 && +value > Number.MAX_SAFE_INTEGER) {
249
464
  return value;
@@ -2588,7 +2803,7 @@ var Vc = (function (exports, vue) {
2588
2803
  function castSlice(array, start, end) {
2589
2804
  var length = array.length;
2590
2805
  end = end === undefined ? length : end;
2591
- return (false && end >= length) ? array : baseSlice(array, start, end);
2806
+ return (!start && end >= length) ? array : baseSlice(array, start, end);
2592
2807
  }
2593
2808
 
2594
2809
  /** Used to compose unicode character classes. */
@@ -5289,233 +5504,6 @@ var Vc = (function (exports, vue) {
5289
5504
  });
5290
5505
  }
5291
5506
 
5292
- const IS_SERVER$2 = typeof window === "undefined";
5293
-
5294
- const hasClass = (el, cls) => {
5295
- if (IS_SERVER$2 || !cls)
5296
- return false;
5297
- if (cls.includes(" ")) {
5298
- throw new Error("[@deot/helper-dom]: 类名不应该包含空格");
5299
- }
5300
- if (el.classList) {
5301
- return el.classList.contains(cls);
5302
- } else {
5303
- return (" " + el.className + " ").indexOf(" " + cls + " ") > -1;
5304
- }
5305
- };
5306
-
5307
- const addClass = (el, cls) => {
5308
- if (IS_SERVER$2 || !cls)
5309
- return;
5310
- let curClass = el.className;
5311
- let classes = cls.split(" ");
5312
- for (let i = 0, j = classes.length; i < j; i++) {
5313
- let clsName = classes[i];
5314
- if (clsName) {
5315
- if (el.classList) {
5316
- el.classList.add(clsName);
5317
- } else if (!hasClass(el, clsName)) {
5318
- curClass += " " + clsName;
5319
- }
5320
- }
5321
- }
5322
- if (!el.classList) {
5323
- el.className = curClass;
5324
- }
5325
- };
5326
-
5327
- const composedPath = (e) => {
5328
- let path = e.composedPath && e.composedPath() || [];
5329
- if (path.length)
5330
- return path;
5331
- let parent = e.target?.parentNode;
5332
- /* istanbul ignore next -- @preserve */
5333
- while (parent) {
5334
- path.push(parent);
5335
- parent = parent.parentNode;
5336
- }
5337
- return path;
5338
- };
5339
-
5340
- const contains$1 = (el, child) => {
5341
- if (IS_SERVER$2 || !child)
5342
- return false;
5343
- let childRect = child.getBoundingClientRect();
5344
- let elRect;
5345
- if (!el || [window, document, document.documentElement].includes(el)) {
5346
- elRect = {
5347
- top: 0,
5348
- right: window.innerWidth,
5349
- bottom: window.innerHeight,
5350
- left: 0
5351
- };
5352
- } else {
5353
- elRect = el.getBoundingClientRect();
5354
- }
5355
- return childRect.top < elRect.bottom && childRect.bottom > elRect.top && childRect.right > elRect.left && childRect.left < elRect.right;
5356
- };
5357
-
5358
- const el$1 = (v) => {
5359
- if (IS_SERVER$2)
5360
- return null;
5361
- let target;
5362
- if (typeof v === "object") {
5363
- target = v;
5364
- } else {
5365
- target = document.querySelector(v);
5366
- }
5367
- if (!target) {
5368
- throw new Error("[@deot/helper-dom]: el缺失");
5369
- }
5370
- return target;
5371
- };
5372
-
5373
- const getStyle$1 = (el, name) => {
5374
- if (IS_SERVER$2 || !name)
5375
- return "";
5376
- if (name === "float") {
5377
- name = "cssFloat";
5378
- }
5379
- try {
5380
- let computed = document.defaultView.getComputedStyle(el, "");
5381
- return el.style[name] || (computed?.[name] || "");
5382
- } catch (e) {
5383
- return el.style[name] || "";
5384
- }
5385
- };
5386
-
5387
- const isScroll = (el, direction) => {
5388
- if (IS_SERVER$2 || !el)
5389
- return false;
5390
- let overflow = getStyle$1(el, `overflow-${"x"}`);
5391
- overflow = overflow || getStyle$1(el, "overflow");
5392
- return !!overflow.match(/(scroll|auto)/);
5393
- };
5394
-
5395
- const getScroller = (el, direction) => {
5396
- if (IS_SERVER$2 || !el)
5397
- return null;
5398
- let parent = el;
5399
- while (parent) {
5400
- if ([window, document, document.documentElement].includes(parent)) {
5401
- return window;
5402
- }
5403
- if (isScroll(parent)) {
5404
- return parent;
5405
- }
5406
- parent = parent?.parentNode;
5407
- }
5408
- return parent;
5409
- };
5410
-
5411
- const off = (el, event, handler, options) => {
5412
- if (IS_SERVER$2)
5413
- return;
5414
- el.removeEventListener(event, handler, false);
5415
- };
5416
-
5417
- const on = (el, event, handler, options) => {
5418
- if (IS_SERVER$2)
5419
- return () => {
5420
- };
5421
- el.addEventListener(event, handler, false);
5422
- return () => {
5423
- el.removeEventListener(event, handler, false);
5424
- };
5425
- };
5426
-
5427
- const $target = IS_SERVER$2 ? {} : document.createElement("div").style;
5428
- const prefix$1 = (() => {
5429
- let keys = {
5430
- webkit: "webkitTransform",
5431
- Moz: "MozTransform",
5432
- O: "OTransform",
5433
- ms: "msTransform",
5434
- standard: "transform"
5435
- };
5436
- let values = {
5437
- webkit: "-webkit-",
5438
- Moz: "-moz-",
5439
- O: "-o-",
5440
- ms: "-ms-",
5441
- standard: ""
5442
- };
5443
- for (let key in keys) {
5444
- if ($target[keys[key]] !== void 0) {
5445
- return {
5446
- camel: key,
5447
- kebab: values[key]
5448
- };
5449
- }
5450
- }
5451
- return false;
5452
- })();
5453
- const prefixStyle = (v) => {
5454
- if (IS_SERVER$2 || prefix$1 === false) {
5455
- return {
5456
- camel: v,
5457
- kebab: v
5458
- };
5459
- }
5460
- return {
5461
- camel: prefix$1.camel + v.charAt(0).toUpperCase() + v.substr(1),
5462
- kebab: prefix$1.kebab + v
5463
- };
5464
- };
5465
-
5466
- const removeClass = (el, cls) => {
5467
- if (IS_SERVER$2 || !cls)
5468
- return;
5469
- let classes = cls.split(" ");
5470
- let curClass = " " + el.className + " ";
5471
- for (let i = 0, j = classes.length; i < j; i++) {
5472
- let clsName = classes[i];
5473
- if (clsName) {
5474
- if (el.classList) {
5475
- el.classList.remove(clsName);
5476
- continue;
5477
- }
5478
- /* istanbul ignore next -- @preserve */
5479
- if (hasClass(el, clsName)) {
5480
- curClass = curClass.replace(" " + clsName + " ", " ");
5481
- }
5482
- }
5483
- }
5484
- if (!el.classList) {
5485
- el.className = curClass.trim();
5486
- }
5487
- };
5488
-
5489
- const scrollIntoView = async (el, options) => {
5490
- if (IS_SERVER$2)
5491
- return;
5492
- let { from = 0, to = 0, duration = 300 } = options || {};
5493
- let difference = Math.abs(from - to);
5494
- let step = Math.ceil(difference / duration * 50);
5495
- let onResolve;
5496
- let target = new Promise((resolve) => {
5497
- onResolve = resolve;
5498
- });
5499
- const scroll = (start, end) => {
5500
- if (start === end) {
5501
- onResolve();
5502
- return;
5503
- }
5504
- let d = start + step > end ? end : start + step;
5505
- if (start > end) {
5506
- d = start - step < end ? end : start - step;
5507
- }
5508
- if (el === window) {
5509
- window.scrollTo(d, d);
5510
- } else {
5511
- el.scrollTop = d;
5512
- }
5513
- window.requestAnimationFrame(() => scroll(d, end));
5514
- };
5515
- scroll(from, to);
5516
- return target;
5517
- };
5518
-
5519
5507
  class Resize {
5520
5508
  el;
5521
5509
  static of(el) {
@@ -9140,16 +9128,16 @@ var Vc = (function (exports, vue) {
9140
9128
  }
9141
9129
  }
9142
9130
  const VcInstance = new Instance();
9143
- const props$1s = {
9131
+ const props$1t = {
9144
9132
  tag: {
9145
9133
  type: String,
9146
9134
  default: "div"
9147
9135
  }
9148
9136
  };
9149
- const COMPONENT_NAME$27 = "vc-action-sheet";
9137
+ const COMPONENT_NAME$28 = "vc-action-sheet";
9150
9138
  const ActionSheet = /* @__PURE__ */ vue.defineComponent({
9151
- name: COMPONENT_NAME$27,
9152
- props: props$1s,
9139
+ name: COMPONENT_NAME$28,
9140
+ props: props$1t,
9153
9141
  setup(props2, {
9154
9142
  slots
9155
9143
  }) {
@@ -9161,6 +9149,174 @@ var Vc = (function (exports, vue) {
9161
9149
  }
9162
9150
  });
9163
9151
  const MActionSheet = ActionSheet;
9152
+ const props$1s = {
9153
+ zIndex: {
9154
+ type: [Number, String],
9155
+ default: 1
9156
+ },
9157
+ // TODO: left/right
9158
+ placement: {
9159
+ type: String,
9160
+ default: "top"
9161
+ },
9162
+ disabled: {
9163
+ type: Boolean,
9164
+ default: false
9165
+ },
9166
+ fixed: {
9167
+ type: Boolean,
9168
+ default: true
9169
+ },
9170
+ offset: {
9171
+ type: Number,
9172
+ default: 0
9173
+ },
9174
+ // -> 固钉始终保持在容器内, 超过范围则隐藏(请注意容器避免出现滚动条) 仅fixed为true有效
9175
+ target: {
9176
+ type: String
9177
+ }
9178
+ };
9179
+ const COMPONENT_NAME$27 = "vc-affix";
9180
+ const SCROLLER_WHEEL_REG = /vc-scroller-wheel/;
9181
+ const Affix = /* @__PURE__ */ vue.defineComponent({
9182
+ name: COMPONENT_NAME$27,
9183
+ props: props$1s,
9184
+ setup(props2, {
9185
+ slots,
9186
+ expose
9187
+ }) {
9188
+ const scrollerInstance = vue.inject("vc-scroller", null);
9189
+ const scroller = vue.shallowRef();
9190
+ const base = vue.shallowRef();
9191
+ const current = vue.shallowRef();
9192
+ const currentRect = vue.reactive({
9193
+ top: 0,
9194
+ bottom: 0,
9195
+ width: 0,
9196
+ height: 0
9197
+ });
9198
+ const isActive = vue.ref(false);
9199
+ const transformY = vue.ref(0);
9200
+ const windowHeight = vue.ref(window.innerHeight);
9201
+ const isVcScrollerWheel = vue.computed(() => {
9202
+ return SCROLLER_WHEEL_REG.test(scroller.value?.className || "");
9203
+ });
9204
+ const currentStyle = vue.computed(() => {
9205
+ if (!isActive.value) return {};
9206
+ return {
9207
+ height: `${currentRect.height}px`,
9208
+ width: `${currentRect.width}px`
9209
+ };
9210
+ });
9211
+ const contentStyle = vue.computed(() => {
9212
+ if (!isActive.value) return {};
9213
+ const offset = `${props2.offset}px`;
9214
+ return {
9215
+ height: `${currentRect.height}px`,
9216
+ width: `${currentRect.width}px`,
9217
+ top: props2.placement === "top" ? offset : "",
9218
+ bottom: props2.placement === "bottom" ? offset : "",
9219
+ zIndex: props2.zIndex,
9220
+ transform: transformY.value ? `translateY(${transformY.value}px)` : ""
9221
+ };
9222
+ });
9223
+ const setCurrentRect = () => {
9224
+ const rect = current.value.getBoundingClientRect();
9225
+ Object.assign(currentRect, {
9226
+ top: rect.top,
9227
+ bottom: rect.bottom,
9228
+ width: rect.width,
9229
+ height: rect.height
9230
+ });
9231
+ };
9232
+ const setAbsoluteStatus = () => {
9233
+ const {
9234
+ placement,
9235
+ offset
9236
+ } = props2;
9237
+ const currentHeightOffset = offset + currentRect.height;
9238
+ const containerRect = scroller.value.getBoundingClientRect();
9239
+ let transformOffsetY = 0;
9240
+ if (scrollerInstance && isVcScrollerWheel.value) {
9241
+ const maxMoveY = scrollerInstance.scrollHeight - scrollerInstance.clientHeight;
9242
+ transformOffsetY = scrollerInstance.scrollTop >= maxMoveY ? maxMoveY : scrollerInstance.scrollTop;
9243
+ }
9244
+ if (placement === "top") {
9245
+ isActive.value = currentRect.top - containerRect.top <= props2.offset;
9246
+ transformY.value = Math.min(containerRect.bottom - currentHeightOffset, 0) + transformOffsetY;
9247
+ } else {
9248
+ isActive.value = currentRect.bottom - containerRect.top >= containerRect.height - props2.offset;
9249
+ transformY.value = Math.max(containerRect.height - containerRect.top - currentHeightOffset, 0) + transformOffsetY;
9250
+ }
9251
+ };
9252
+ const setFixedStatus = () => {
9253
+ const {
9254
+ placement,
9255
+ target,
9256
+ offset
9257
+ } = props2;
9258
+ const currentHeightOffset = offset + currentRect.height;
9259
+ const containerRect = target && base.value.getBoundingClientRect();
9260
+ if (placement === "top") {
9261
+ if (target) {
9262
+ isActive.value = offset > currentRect.top && containerRect.bottom > 0;
9263
+ transformY.value = Math.min(containerRect.bottom - currentHeightOffset, 0);
9264
+ } else {
9265
+ isActive.value = offset > currentRect.top;
9266
+ }
9267
+ } else {
9268
+ if (target) {
9269
+ isActive.value = windowHeight.value - offset < currentRect.bottom && windowHeight.value > containerRect.top;
9270
+ transformY.value = -Math.min(windowHeight.value - containerRect.top - currentHeightOffset, 0);
9271
+ } else {
9272
+ isActive.value = windowHeight.value - offset < currentRect.bottom;
9273
+ }
9274
+ }
9275
+ };
9276
+ const refresh = () => {
9277
+ setCurrentRect();
9278
+ scroller.value instanceof Window || props2.fixed ? setFixedStatus() : setAbsoluteStatus();
9279
+ };
9280
+ vue.onMounted(() => {
9281
+ if (typeof props2.target === "string") {
9282
+ base.value = document.querySelector(props2.target) ?? void 0;
9283
+ }
9284
+ !base.value && (base.value = document.documentElement);
9285
+ scroller.value = getScroller(current.value, {
9286
+ className: SCROLLER_WHEEL_REG
9287
+ });
9288
+ if (isVcScrollerWheel.value) {
9289
+ scrollerInstance?.on(refresh);
9290
+ } else {
9291
+ scroller.value?.addEventListener("scroll", refresh);
9292
+ }
9293
+ refresh();
9294
+ });
9295
+ vue.onBeforeUnmount(() => {
9296
+ if (isVcScrollerWheel.value) {
9297
+ scrollerInstance?.off(refresh);
9298
+ } else {
9299
+ scroller.value?.removeEventListener("scroll", refresh);
9300
+ }
9301
+ });
9302
+ expose({
9303
+ refresh
9304
+ });
9305
+ return () => {
9306
+ return vue.createVNode("div", {
9307
+ "ref": current,
9308
+ "class": "vc-affix",
9309
+ "style": currentStyle.value
9310
+ }, [vue.createVNode("div", {
9311
+ "class": {
9312
+ [`vc-affix__${props2.fixed ? "fixed" : "absolute"}`]: isActive.value
9313
+ },
9314
+ "style": contentStyle.value
9315
+ }, [slots?.default?.()])]);
9316
+ };
9317
+ }
9318
+ });
9319
+ const MAffix = Affix;
9164
9320
  const props$1r = {
9165
9321
  modelValue: {
9166
9322
  type: Boolean,
@@ -9829,7 +9985,7 @@ var Vc = (function (exports, vue) {
9829
9985
  });
9830
9986
  const COMPONENT_NAME$1$ = "vc-alert";
9831
9987
  const THEME_MAP = {
9832
- info: ["#2B72FD", "#91d5ff", "#e6f7ff"],
9988
+ info: ["#456CF6", "#91d5ff", "#e6f7ff"],
9833
9989
  success: ["#52c41a", "#b7eb8f", "#f6ffed"],
9834
9990
  error: ["#ed4014", "#ffb08f", "#fbe9e9"],
9835
9991
  warning: ["#ffbf00", "#ffe58f", "#fffbe6"]
@@ -17726,6 +17882,7 @@ var Vc = (function (exports, vue) {
17726
17882
  refreshSize();
17727
17883
  refreshPosition(options);
17728
17884
  };
17885
+ const listeners = [];
17729
17886
  const triggerScrollDelegate = (options) => {
17730
17887
  const delegates = {
17731
17888
  scrollLeft: (options && options.x) ?? scrollX.value,
@@ -17733,12 +17890,15 @@ var Vc = (function (exports, vue) {
17733
17890
  clientWidth: wrapperW.value,
17734
17891
  clientHeight: wrapperH.value,
17735
17892
  scrollWidth: contentW.value,
17736
- scrollHeight: contentH.value
17893
+ scrollHeight: contentH.value,
17894
+ getBoundingClientRect: () => wrapper.value?.getBoundingClientRect()
17737
17895
  };
17738
- instance.emit("scroll", {
17896
+ const e = {
17739
17897
  target: delegates,
17740
17898
  currentTarget: delegates
17741
- });
17899
+ };
17900
+ instance.emit("scroll", e);
17901
+ listeners.forEach((listener) => listener(e));
17742
17902
  };
17743
17903
  const scrollTo = (options) => {
17744
17904
  refreshPosition(options);
@@ -17765,8 +17925,9 @@ var Vc = (function (exports, vue) {
17765
17925
  Resize.off(wrapper.value, refresh);
17766
17926
  Resize.off(content.value, refresh);
17767
17927
  }
17928
+ listeners.splice(0, listeners.length);
17768
17929
  });
17769
- expose({
17930
+ const exposed = {
17770
17931
  wrapper,
17771
17932
  content,
17772
17933
  scrollTo,
@@ -17782,8 +17943,16 @@ var Vc = (function (exports, vue) {
17782
17943
  },
17783
17944
  setScrollLeft: (value) => {
17784
17945
  scrollTo({ x: value });
17946
+ },
17947
+ on: (listener) => {
17948
+ listeners.push(listener);
17949
+ },
17950
+ off: (listener) => {
17951
+ listeners.splice(listeners.indexOf(listener), 1);
17785
17952
  }
17786
- });
17953
+ };
17954
+ expose(exposed);
17955
+ vue.provide("vc-scroller", vue.reactive(exposed));
17787
17956
  return {
17788
17957
  bar,
17789
17958
  wrapper,
@@ -23096,7 +23265,7 @@ var Vc = (function (exports, vue) {
23096
23265
  color: {
23097
23266
  type: [Object, String],
23098
23267
  default: () => ({
23099
- normal: "#2B72FD",
23268
+ normal: "#456CF6",
23100
23269
  success: "#52c41a",
23101
23270
  error: "#f5222d"
23102
23271
  })
@@ -26325,7 +26494,35 @@ var Vc = (function (exports, vue) {
26325
26494
  };
26326
26495
  }
26327
26496
  });
26328
- const TableSort = "div";
26497
+ const TableSort = /* @__PURE__ */ vue.defineComponent({
26498
+ name: "vc-table-sort",
26499
+ props: {
26500
+ order: String
26501
+ },
26502
+ emits: ["click"],
26503
+ setup(props2, {
26504
+ emit
26505
+ }) {
26506
+ const handleClick = (v) => {
26507
+ emit("click", props2.order !== v ? v : "");
26508
+ };
26509
+ return () => {
26510
+ return vue.createVNode("span", {
26511
+ "class": "vc-table-sort"
26512
+ }, [vue.createVNode("span", {
26513
+ "class": [{
26514
+ "is-ascending": props2.order === "ascending"
26515
+ }, "vc-table-sort__icon vc-table-sort__icon--ascending"],
26516
+ "onClick": vue.withModifiers(() => handleClick("ascending"), ["stop"])
26517
+ }, null), vue.createVNode("span", {
26518
+ "class": [{
26519
+ "is-descending": props2.order === "descending"
26520
+ }, "vc-table-sort__icon vc-table-sort__icon--descending"],
26521
+ "onClick": vue.withModifiers(() => handleClick("descending"), ["stop"])
26522
+ }, null)]);
26523
+ };
26524
+ }
26525
+ });
26329
26526
  const TableFilter = "div";
26330
26527
  const TableHeader = /* @__PURE__ */ vue.defineComponent({
26331
26528
  name: "vc-table-header",
@@ -26333,7 +26530,7 @@ var Vc = (function (exports, vue) {
26333
26530
  fixed: [Boolean, String],
26334
26531
  border: Boolean,
26335
26532
  // 排序全部交给外部处理,内部不处理数据,只做交互
26336
- defaultSort: {
26533
+ sort: {
26337
26534
  type: Object,
26338
26535
  default: () => ({})
26339
26536
  }
@@ -26530,10 +26727,12 @@ var Vc = (function (exports, vue) {
26530
26727
  document.body.style.cursor = "";
26531
26728
  };
26532
26729
  const handleSort = (prop, order) => {
26533
- table.emit("sort-change", {
26730
+ const v = {
26534
26731
  prop,
26535
26732
  order
26536
- });
26733
+ };
26734
+ table.emit("update:sort", v);
26735
+ table.emit("sort-change", v);
26537
26736
  };
26538
26737
  const handleFilter = (column, value) => {
26539
26738
  const {
@@ -26591,9 +26790,10 @@ var Vc = (function (exports, vue) {
26591
26790
  store: table.store
26592
26791
  }) : column.label, column.tooltip ? vue.createVNode(Icon, {
26593
26792
  "type": "o-info",
26793
+ "class": "vc-table__tooltip",
26594
26794
  "onMouseenter": (e) => handleCellMouseEnter(e, column)
26595
26795
  }, null) : null, column.sortable ? vue.createVNode(TableSort, {
26596
- "order": column.prop === props2.defaultSort.prop ? props2.defaultSort.order : "",
26796
+ "order": column.prop === props2.sort.prop ? props2.sort.order : "",
26597
26797
  "onClick": (order) => handleSort(column.prop, order)
26598
26798
  }, null) : null, column.filters ? vue.createVNode(TableFilter, {
26599
26799
  "data": column.filters,
@@ -26807,7 +27007,7 @@ var Vc = (function (exports, vue) {
26807
27007
  * 排序全部交给外部处理,内部不处理数据,只做交互
26808
27008
  * 列与列之间互斥
26809
27009
  */
26810
- defaultSort: {
27010
+ sort: {
26811
27011
  type: Object,
26812
27012
  default: () => ({})
26813
27013
  },
@@ -26818,7 +27018,7 @@ var Vc = (function (exports, vue) {
26818
27018
  const Table$1 = /* @__PURE__ */ vue.defineComponent({
26819
27019
  name: COMPONENT_NAME$j,
26820
27020
  props: props$d,
26821
- 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"],
27021
+ 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"],
26822
27022
  setup(props2, {
26823
27023
  slots,
26824
27024
  expose,
@@ -27201,7 +27401,7 @@ var Vc = (function (exports, vue) {
27201
27401
  }, [vue.createVNode(TableHeader, {
27202
27402
  "ref": tableHeader,
27203
27403
  "border": props2.border,
27204
- "default-sort": props2.defaultSort,
27404
+ "sort": props2.sort,
27205
27405
  "style": bodyWidthStyle.value
27206
27406
  }, null)]), states.columns.length > 0 && vue.createVNode(ScrollerWheel, {
27207
27407
  "ref": scroller,
@@ -27250,7 +27450,7 @@ var Vc = (function (exports, vue) {
27250
27450
  }, [vue.createVNode(TableHeader, {
27251
27451
  "ref": leftFixedTableHeader,
27252
27452
  "border": props2.border,
27253
- "default-sort": props2.defaultSort,
27453
+ "sort": props2.sort,
27254
27454
  "style": bodyWidthStyle.value,
27255
27455
  "fixed": "left"
27256
27456
  }, null)]), vue.createVNode("div", {
@@ -27289,7 +27489,7 @@ var Vc = (function (exports, vue) {
27289
27489
  }, [vue.createVNode(TableHeader, {
27290
27490
  "ref": rightFixedTableHeader,
27291
27491
  "border": props2.border,
27292
- "default-sort": props2.defaultSort,
27492
+ "sort": props2.sort,
27293
27493
  "style": bodyWidthStyle.value,
27294
27494
  "fixed": "right"
27295
27495
  }, null)]), vue.createVNode("div", {
@@ -28019,7 +28219,8 @@ var Vc = (function (exports, vue) {
28019
28219
  });
28020
28220
  const props$b = {
28021
28221
  value: {
28022
- type: [String, Number, Boolean]
28222
+ type: [String, Number, Boolean],
28223
+ default: void 0
28023
28224
  },
28024
28225
  label: {
28025
28226
  type: [String, Function],
@@ -28325,7 +28526,7 @@ var Vc = (function (exports, vue) {
28325
28526
  "class": [{
28326
28527
  "is-fixed": isFixed
28327
28528
  }, "vcm-tabs__bar"]
28328
- }, [vue.createVNode("slot", {
28529
+ }, [vue.createVNode(vue.resolveComponent("slot"), {
28329
28530
  "name": "prepend"
28330
28531
  }, null), slots.prepend?.(), props2.showStep && tabs.scrollable.value && vue.createVNode("div", {
28331
28532
  "class": "vcm-tabs__step is-left",
@@ -31370,6 +31571,8 @@ var Vc = (function (exports, vue) {
31370
31571
  const Components = {
31371
31572
  ActionSheet,
31372
31573
  MActionSheet,
31574
+ Affix,
31575
+ MAffix,
31373
31576
  Alert,
31374
31577
  MAlert,
31375
31578
  Artboard,
@@ -34695,10 +34898,10 @@ var Vc = (function (exports, vue) {
34695
34898
  var _v1 = create$2();
34696
34899
  var _v2 = create$2();
34697
34900
  function isAroundZero$1(val) {
34698
- return val > -1e-8 && val < EPSILON$4;
34901
+ return val > -EPSILON$4 && val < EPSILON$4;
34699
34902
  }
34700
34903
  function isNotAroundZero$1(val) {
34701
- return val > EPSILON$4 || val < -1e-8;
34904
+ return val > EPSILON$4 || val < -EPSILON$4;
34702
34905
  }
34703
34906
  function cubicAt(p0, p1, p2, p3, t) {
34704
34907
  var onet = 1 - t;
@@ -35685,7 +35888,7 @@ var Vc = (function (exports, vue) {
35685
35888
  }
35686
35889
  var EPSILON$3 = 1e-4;
35687
35890
  function isAroundZero(transform) {
35688
- return transform < EPSILON$3 && transform > -1e-4;
35891
+ return transform < EPSILON$3 && transform > -EPSILON$3;
35689
35892
  }
35690
35893
  function round3(transform) {
35691
35894
  return mathRound$1(transform * 1e3) / 1e3;
@@ -36966,7 +37169,7 @@ var Vc = (function (exports, vue) {
36966
37169
  var mIdentity = identity;
36967
37170
  var EPSILON$2 = 5e-5;
36968
37171
  function isNotAroundZero(val) {
36969
- return val > EPSILON$2 || val < -5e-5;
37172
+ return val > EPSILON$2 || val < -EPSILON$2;
36970
37173
  }
36971
37174
  var scaleTmp = [];
36972
37175
  var tmpTransform = [];
@@ -37684,7 +37887,7 @@ var Vc = (function (exports, vue) {
37684
37887
  this.markRedraw();
37685
37888
  if (!useHoverLayer && this.__inHover) {
37686
37889
  this._toggleHoverLayerFlag(false);
37687
- this.__dirty &= -2;
37890
+ this.__dirty &= ~REDRAW_BIT;
37688
37891
  }
37689
37892
  return state;
37690
37893
  };
@@ -37742,7 +37945,7 @@ var Vc = (function (exports, vue) {
37742
37945
  this.markRedraw();
37743
37946
  if (!useHoverLayer && this.__inHover) {
37744
37947
  this._toggleHoverLayerFlag(false);
37745
- this.__dirty &= -2;
37948
+ this.__dirty &= ~REDRAW_BIT;
37746
37949
  }
37747
37950
  }
37748
37951
  };
@@ -39065,7 +39268,7 @@ var Vc = (function (exports, vue) {
39065
39268
  * @return {boolean}
39066
39269
  */
39067
39270
  function isRadianAroundZero(val) {
39068
- return val > -1e-4 && val < RADIAN_EPSILON;
39271
+ return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;
39069
39272
  }
39070
39273
  // eslint-disable-next-line
39071
39274
  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
@@ -40659,7 +40862,7 @@ var Vc = (function (exports, vue) {
40659
40862
  return !!(this.__dirty & STYLE_CHANGED_BIT);
40660
40863
  };
40661
40864
  Displayable.prototype.styleUpdated = function () {
40662
- this.__dirty &= -3;
40865
+ this.__dirty &= ~STYLE_CHANGED_BIT;
40663
40866
  };
40664
40867
  Displayable.prototype.createStyle = function (obj) {
40665
40868
  return createObject(DEFAULT_COMMON_STYLE, obj);
@@ -42168,7 +42371,7 @@ var Vc = (function (exports, vue) {
42168
42371
  };
42169
42372
  Path.prototype.buildPath = function (ctx, shapeCfg, inBatch) { };
42170
42373
  Path.prototype.pathUpdated = function () {
42171
- this.__dirty &= -5;
42374
+ this.__dirty &= ~SHAPE_CHANGED_BIT;
42172
42375
  };
42173
42376
  Path.prototype.getUpdatedPathProxy = function (inBatch) {
42174
42377
  !this.path && this.createPathProxy();
@@ -54754,7 +54957,7 @@ var Vc = (function (exports, vue) {
54754
54957
  function brush$1(ctx, el, scope, isLast) {
54755
54958
  var m = el.transform;
54756
54959
  if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {
54757
- el.__dirty &= -2;
54960
+ el.__dirty &= ~REDRAW_BIT;
54758
54961
  el.__isRendered = false;
54759
54962
  return;
54760
54963
  }
@@ -113023,7 +113226,7 @@ var Vc = (function (exports, vue) {
113023
113226
  // and velocity is close to 0
113024
113227
  //
113025
113228
 
113026
- if (velocity.x < -0.5 && currentSlideVisibilityRatio < 0 || velocity.x < 0.1 && currentSlideVisibilityRatio < -0.5) {
113229
+ if (velocity.x < -MIN_NEXT_SLIDE_SPEED && currentSlideVisibilityRatio < 0 || velocity.x < 0.1 && currentSlideVisibilityRatio < -0.5) {
113027
113230
  // Go to next slide
113028
113231
  indexDiff = 1;
113029
113232
  velocity.x = Math.min(velocity.x, 0);
@@ -113087,7 +113290,7 @@ var Vc = (function (exports, vue) {
113087
113290
  // or if we are below and moving downwards
113088
113291
 
113089
113292
 
113090
- if (vDragRatio < 0 && projectedVDragRatio < -0.4 || vDragRatio > 0 && projectedVDragRatio > MIN_RATIO_TO_CLOSE) {
113293
+ if (vDragRatio < 0 && projectedVDragRatio < -MIN_RATIO_TO_CLOSE || vDragRatio > 0 && projectedVDragRatio > MIN_RATIO_TO_CLOSE) {
113091
113294
  this.pswp.close();
113092
113295
  return;
113093
113296
  }
@@ -131805,6 +132008,7 @@ var Vc = (function (exports, vue) {
131805
132008
  }, Symbol.toStringTag, { value: 'Module' }));
131806
132009
 
131807
132010
  exports.ActionSheet = ActionSheet;
132011
+ exports.Affix = Affix;
131808
132012
  exports.Alert = Alert;
131809
132013
  exports.Artboard = Artboard;
131810
132014
  exports.Button = Button;
@@ -131850,6 +132054,7 @@ var Vc = (function (exports, vue) {
131850
132054
  exports.List = MList;
131851
132055
  exports.ListItem = MListItem;
131852
132056
  exports.MActionSheet = MActionSheet;
132057
+ exports.MAffix = MAffix;
131853
132058
  exports.MAlert = MAlert;
131854
132059
  exports.MArtboard = MArtboard;
131855
132060
  exports.MButton = MButton;