@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.
@@ -127,6 +127,222 @@
127
127
  return parent;
128
128
  };
129
129
 
130
+ const IS_SERVER$2 = typeof window === "undefined";
131
+
132
+ const hasClass = (el, cls) => {
133
+ if (IS_SERVER$2 || !cls) return false;
134
+ if (cls.includes(" ")) {
135
+ throw new Error("[@deot/helper-dom]: 类名不应该包含空格");
136
+ }
137
+ if (el.classList) {
138
+ return el.classList.contains(cls);
139
+ } else {
140
+ return (" " + el.className + " ").indexOf(" " + cls + " ") > -1;
141
+ }
142
+ };
143
+
144
+ const addClass = (el, cls) => {
145
+ if (IS_SERVER$2 || !cls) return;
146
+ let curClass = el.className;
147
+ const classes = cls.split(" ");
148
+ for (let i = 0, j = classes.length; i < j; i++) {
149
+ const clsName = classes[i];
150
+ if (clsName) {
151
+ if (el.classList) {
152
+ el.classList.add(clsName);
153
+ } else if (!hasClass(el, clsName)) {
154
+ curClass += " " + clsName;
155
+ }
156
+ }
157
+ }
158
+ if (!el.classList) {
159
+ el.className = curClass;
160
+ }
161
+ };
162
+
163
+ const composedPath = (e) => {
164
+ const path = e.composedPath && e.composedPath() || [];
165
+ if (path.length) return path;
166
+ let parent = e.target?.parentNode;
167
+ /* istanbul ignore next -- @preserve */
168
+ while (parent) {
169
+ path.push(parent);
170
+ parent = parent.parentNode;
171
+ }
172
+ return path;
173
+ };
174
+
175
+ const contains$1 = (el, child) => {
176
+ if (IS_SERVER$2 || !child) return false;
177
+ const childRect = child.getBoundingClientRect();
178
+ let elRect;
179
+ if (!el || [window, document, document.documentElement].includes(el)) {
180
+ elRect = {
181
+ top: 0,
182
+ right: window.innerWidth,
183
+ bottom: window.innerHeight,
184
+ left: 0
185
+ };
186
+ } else {
187
+ elRect = el.getBoundingClientRect();
188
+ }
189
+ return childRect.top < elRect.bottom && childRect.bottom > elRect.top && childRect.right > elRect.left && childRect.left < elRect.right;
190
+ };
191
+
192
+ const el$1 = (v) => {
193
+ if (IS_SERVER$2) return null;
194
+ let target;
195
+ if (typeof v === "object") {
196
+ target = v;
197
+ } else {
198
+ target = document.querySelector(v);
199
+ }
200
+ if (!target) {
201
+ throw new Error("[@deot/helper-dom]: el缺失");
202
+ }
203
+ return target;
204
+ };
205
+
206
+ const getStyle$1 = (el, name) => {
207
+ if (IS_SERVER$2 || !name) return "";
208
+ if (name === "float") {
209
+ name = "cssFloat";
210
+ }
211
+ try {
212
+ const computed = document.defaultView.getComputedStyle(el, "");
213
+ return el.style[name] || (computed?.[name] || "");
214
+ } catch (e) {
215
+ return el.style[name] || "";
216
+ }
217
+ };
218
+
219
+ const isScroller = (el, options) => {
220
+ if (IS_SERVER$2 || !el) return false;
221
+ const { className, direction } = options || {};
222
+ let overflow = getStyle$1(el, `overflow-${direction ? "y" : "x"}`);
223
+ overflow = overflow || getStyle$1(el, "overflow");
224
+ return !!(overflow.match(/(scroll|auto)/) || className?.test(el.className));
225
+ };
226
+
227
+ const getScroller = (el, options) => {
228
+ if (IS_SERVER$2 || !el) return null;
229
+ let parent = el;
230
+ while (parent) {
231
+ if ([window, document, document.documentElement].includes(parent)) {
232
+ return window;
233
+ }
234
+ if (isScroller(parent, options)) {
235
+ return parent;
236
+ }
237
+ parent = parent?.parentNode;
238
+ }
239
+ return parent;
240
+ };
241
+
242
+ const off = (el, event, handler, options) => {
243
+ if (IS_SERVER$2) return;
244
+ el.removeEventListener(event, handler, false);
245
+ };
246
+
247
+ const on = (el, event, handler, options) => {
248
+ if (IS_SERVER$2) return () => {
249
+ };
250
+ el.addEventListener(event, handler, false);
251
+ return () => {
252
+ el.removeEventListener(event, handler, false);
253
+ };
254
+ };
255
+
256
+ const $target = IS_SERVER$2 ? {} : document.createElement("div").style;
257
+ const prefix$1 = (() => {
258
+ const keys = {
259
+ webkit: "webkitTransform",
260
+ Moz: "MozTransform",
261
+ O: "OTransform",
262
+ ms: "msTransform",
263
+ standard: "transform"
264
+ };
265
+ const values = {
266
+ webkit: "-webkit-",
267
+ Moz: "-moz-",
268
+ O: "-o-",
269
+ ms: "-ms-",
270
+ standard: ""
271
+ };
272
+ for (const key in keys) {
273
+ if ($target[keys[key]] !== void 0) {
274
+ return {
275
+ camel: key,
276
+ kebab: values[key]
277
+ };
278
+ }
279
+ }
280
+ return false;
281
+ })();
282
+ const prefixStyle = (v) => {
283
+ if (IS_SERVER$2 || prefix$1 === false) {
284
+ return {
285
+ camel: v,
286
+ kebab: v
287
+ };
288
+ }
289
+ return {
290
+ camel: prefix$1.camel + v.charAt(0).toUpperCase() + v.substr(1),
291
+ kebab: prefix$1.kebab + v
292
+ };
293
+ };
294
+
295
+ const removeClass = (el, cls) => {
296
+ if (IS_SERVER$2 || !cls) return;
297
+ const classes = cls.split(" ");
298
+ let curClass = " " + el.className + " ";
299
+ for (let i = 0, j = classes.length; i < j; i++) {
300
+ const clsName = classes[i];
301
+ if (clsName) {
302
+ if (el.classList) {
303
+ el.classList.remove(clsName);
304
+ continue;
305
+ }
306
+ /* istanbul ignore next -- @preserve */
307
+ if (hasClass(el, clsName)) {
308
+ curClass = curClass.replace(" " + clsName + " ", " ");
309
+ }
310
+ }
311
+ }
312
+ if (!el.classList) {
313
+ el.className = curClass.trim();
314
+ }
315
+ };
316
+
317
+ const scrollIntoView = async (el, options) => {
318
+ if (IS_SERVER$2) return;
319
+ const { from = 0, to = 0, duration = 300 } = options || {};
320
+ const difference = Math.abs(from - to);
321
+ const step = Math.ceil(difference / duration * 50);
322
+ let onResolve;
323
+ const target = new Promise((resolve) => {
324
+ onResolve = resolve;
325
+ });
326
+ const scroll = (start, end) => {
327
+ if (start === end) {
328
+ onResolve();
329
+ return;
330
+ }
331
+ let d = start + step > end ? end : start + step;
332
+ if (start > end) {
333
+ d = start - step < end ? end : start - step;
334
+ }
335
+ if (el === window) {
336
+ window.scrollTo(d, d);
337
+ } else {
338
+ el.scrollTop = d;
339
+ }
340
+ window.requestAnimationFrame(() => scroll(d, end));
341
+ };
342
+ scroll(from, to);
343
+ return target;
344
+ };
345
+
130
346
  const debounce$1 = (original, wait, options) => {
131
347
  const { leading, trailing = true, throttle } = options || {};
132
348
  let timer;
@@ -222,7 +438,7 @@
222
438
  );
223
439
  };
224
440
 
225
- const flatten$1 = (value, parser) => {
441
+ const flatten$1 = (value, parser, exit) => {
226
442
  let need = true;
227
443
  let safeCount = 1;
228
444
  let parseValue = value;
@@ -232,7 +448,7 @@
232
448
  }
233
449
  try {
234
450
  const next = (parser || decodeURIComponent)(parseValue);
235
- if (parseValue === next) {
451
+ if (parseValue === next || typeof exit === "function" && exit(next)) {
236
452
  need = false;
237
453
  }
238
454
  parseValue = next;
@@ -245,8 +461,7 @@
245
461
  };
246
462
 
247
463
  const flattenJSONParse = (value) => {
248
- if (value === null)
249
- return null;
464
+ if (value === null) return null;
250
465
  const regex = /^\d+$/;
251
466
  if (regex.test(value) && value.length >= 16 && +value > Number.MAX_SAFE_INTEGER) {
252
467
  return value;
@@ -2591,7 +2806,7 @@
2591
2806
  function castSlice(array, start, end) {
2592
2807
  var length = array.length;
2593
2808
  end = end === undefined ? length : end;
2594
- return (false && end >= length) ? array : baseSlice(array, start, end);
2809
+ return (!start && end >= length) ? array : baseSlice(array, start, end);
2595
2810
  }
2596
2811
 
2597
2812
  /** Used to compose unicode character classes. */
@@ -5292,233 +5507,6 @@
5292
5507
  });
5293
5508
  }
5294
5509
 
5295
- const IS_SERVER$2 = typeof window === "undefined";
5296
-
5297
- const hasClass = (el, cls) => {
5298
- if (IS_SERVER$2 || !cls)
5299
- return false;
5300
- if (cls.includes(" ")) {
5301
- throw new Error("[@deot/helper-dom]: 类名不应该包含空格");
5302
- }
5303
- if (el.classList) {
5304
- return el.classList.contains(cls);
5305
- } else {
5306
- return (" " + el.className + " ").indexOf(" " + cls + " ") > -1;
5307
- }
5308
- };
5309
-
5310
- const addClass = (el, cls) => {
5311
- if (IS_SERVER$2 || !cls)
5312
- return;
5313
- let curClass = el.className;
5314
- let classes = cls.split(" ");
5315
- for (let i = 0, j = classes.length; i < j; i++) {
5316
- let clsName = classes[i];
5317
- if (clsName) {
5318
- if (el.classList) {
5319
- el.classList.add(clsName);
5320
- } else if (!hasClass(el, clsName)) {
5321
- curClass += " " + clsName;
5322
- }
5323
- }
5324
- }
5325
- if (!el.classList) {
5326
- el.className = curClass;
5327
- }
5328
- };
5329
-
5330
- const composedPath = (e) => {
5331
- let path = e.composedPath && e.composedPath() || [];
5332
- if (path.length)
5333
- return path;
5334
- let parent = e.target?.parentNode;
5335
- /* istanbul ignore next -- @preserve */
5336
- while (parent) {
5337
- path.push(parent);
5338
- parent = parent.parentNode;
5339
- }
5340
- return path;
5341
- };
5342
-
5343
- const contains$1 = (el, child) => {
5344
- if (IS_SERVER$2 || !child)
5345
- return false;
5346
- let childRect = child.getBoundingClientRect();
5347
- let elRect;
5348
- if (!el || [window, document, document.documentElement].includes(el)) {
5349
- elRect = {
5350
- top: 0,
5351
- right: window.innerWidth,
5352
- bottom: window.innerHeight,
5353
- left: 0
5354
- };
5355
- } else {
5356
- elRect = el.getBoundingClientRect();
5357
- }
5358
- return childRect.top < elRect.bottom && childRect.bottom > elRect.top && childRect.right > elRect.left && childRect.left < elRect.right;
5359
- };
5360
-
5361
- const el$1 = (v) => {
5362
- if (IS_SERVER$2)
5363
- return null;
5364
- let target;
5365
- if (typeof v === "object") {
5366
- target = v;
5367
- } else {
5368
- target = document.querySelector(v);
5369
- }
5370
- if (!target) {
5371
- throw new Error("[@deot/helper-dom]: el缺失");
5372
- }
5373
- return target;
5374
- };
5375
-
5376
- const getStyle$1 = (el, name) => {
5377
- if (IS_SERVER$2 || !name)
5378
- return "";
5379
- if (name === "float") {
5380
- name = "cssFloat";
5381
- }
5382
- try {
5383
- let computed = document.defaultView.getComputedStyle(el, "");
5384
- return el.style[name] || (computed?.[name] || "");
5385
- } catch (e) {
5386
- return el.style[name] || "";
5387
- }
5388
- };
5389
-
5390
- const isScroll = (el, direction) => {
5391
- if (IS_SERVER$2 || !el)
5392
- return false;
5393
- let overflow = getStyle$1(el, `overflow-${"x"}`);
5394
- overflow = overflow || getStyle$1(el, "overflow");
5395
- return !!overflow.match(/(scroll|auto)/);
5396
- };
5397
-
5398
- const getScroller = (el, direction) => {
5399
- if (IS_SERVER$2 || !el)
5400
- return null;
5401
- let parent = el;
5402
- while (parent) {
5403
- if ([window, document, document.documentElement].includes(parent)) {
5404
- return window;
5405
- }
5406
- if (isScroll(parent)) {
5407
- return parent;
5408
- }
5409
- parent = parent?.parentNode;
5410
- }
5411
- return parent;
5412
- };
5413
-
5414
- const off = (el, event, handler, options) => {
5415
- if (IS_SERVER$2)
5416
- return;
5417
- el.removeEventListener(event, handler, false);
5418
- };
5419
-
5420
- const on = (el, event, handler, options) => {
5421
- if (IS_SERVER$2)
5422
- return () => {
5423
- };
5424
- el.addEventListener(event, handler, false);
5425
- return () => {
5426
- el.removeEventListener(event, handler, false);
5427
- };
5428
- };
5429
-
5430
- const $target = IS_SERVER$2 ? {} : document.createElement("div").style;
5431
- const prefix$1 = (() => {
5432
- let keys = {
5433
- webkit: "webkitTransform",
5434
- Moz: "MozTransform",
5435
- O: "OTransform",
5436
- ms: "msTransform",
5437
- standard: "transform"
5438
- };
5439
- let values = {
5440
- webkit: "-webkit-",
5441
- Moz: "-moz-",
5442
- O: "-o-",
5443
- ms: "-ms-",
5444
- standard: ""
5445
- };
5446
- for (let key in keys) {
5447
- if ($target[keys[key]] !== void 0) {
5448
- return {
5449
- camel: key,
5450
- kebab: values[key]
5451
- };
5452
- }
5453
- }
5454
- return false;
5455
- })();
5456
- const prefixStyle = (v) => {
5457
- if (IS_SERVER$2 || prefix$1 === false) {
5458
- return {
5459
- camel: v,
5460
- kebab: v
5461
- };
5462
- }
5463
- return {
5464
- camel: prefix$1.camel + v.charAt(0).toUpperCase() + v.substr(1),
5465
- kebab: prefix$1.kebab + v
5466
- };
5467
- };
5468
-
5469
- const removeClass = (el, cls) => {
5470
- if (IS_SERVER$2 || !cls)
5471
- return;
5472
- let classes = cls.split(" ");
5473
- let curClass = " " + el.className + " ";
5474
- for (let i = 0, j = classes.length; i < j; i++) {
5475
- let clsName = classes[i];
5476
- if (clsName) {
5477
- if (el.classList) {
5478
- el.classList.remove(clsName);
5479
- continue;
5480
- }
5481
- /* istanbul ignore next -- @preserve */
5482
- if (hasClass(el, clsName)) {
5483
- curClass = curClass.replace(" " + clsName + " ", " ");
5484
- }
5485
- }
5486
- }
5487
- if (!el.classList) {
5488
- el.className = curClass.trim();
5489
- }
5490
- };
5491
-
5492
- const scrollIntoView = async (el, options) => {
5493
- if (IS_SERVER$2)
5494
- return;
5495
- let { from = 0, to = 0, duration = 300 } = options || {};
5496
- let difference = Math.abs(from - to);
5497
- let step = Math.ceil(difference / duration * 50);
5498
- let onResolve;
5499
- let target = new Promise((resolve) => {
5500
- onResolve = resolve;
5501
- });
5502
- const scroll = (start, end) => {
5503
- if (start === end) {
5504
- onResolve();
5505
- return;
5506
- }
5507
- let d = start + step > end ? end : start + step;
5508
- if (start > end) {
5509
- d = start - step < end ? end : start - step;
5510
- }
5511
- if (el === window) {
5512
- window.scrollTo(d, d);
5513
- } else {
5514
- el.scrollTop = d;
5515
- }
5516
- window.requestAnimationFrame(() => scroll(d, end));
5517
- };
5518
- scroll(from, to);
5519
- return target;
5520
- };
5521
-
5522
5510
  class Resize {
5523
5511
  el;
5524
5512
  static of(el) {
@@ -9143,16 +9131,16 @@
9143
9131
  }
9144
9132
  }
9145
9133
  const VcInstance = new Instance();
9146
- const props$1s = {
9134
+ const props$1t = {
9147
9135
  tag: {
9148
9136
  type: String,
9149
9137
  default: "div"
9150
9138
  }
9151
9139
  };
9152
- const COMPONENT_NAME$27 = "vc-action-sheet";
9140
+ const COMPONENT_NAME$28 = "vc-action-sheet";
9153
9141
  const ActionSheet = /* @__PURE__ */ vue.defineComponent({
9154
- name: COMPONENT_NAME$27,
9155
- props: props$1s,
9142
+ name: COMPONENT_NAME$28,
9143
+ props: props$1t,
9156
9144
  setup(props2, {
9157
9145
  slots
9158
9146
  }) {
@@ -9164,6 +9152,174 @@
9164
9152
  }
9165
9153
  });
9166
9154
  const MActionSheet = ActionSheet;
9155
+ const props$1s = {
9156
+ zIndex: {
9157
+ type: [Number, String],
9158
+ default: 1
9159
+ },
9160
+ // TODO: left/right
9161
+ placement: {
9162
+ type: String,
9163
+ default: "top"
9164
+ },
9165
+ disabled: {
9166
+ type: Boolean,
9167
+ default: false
9168
+ },
9169
+ fixed: {
9170
+ type: Boolean,
9171
+ default: true
9172
+ },
9173
+ offset: {
9174
+ type: Number,
9175
+ default: 0
9176
+ },
9177
+ // -> 固钉始终保持在容器内, 超过范围则隐藏(请注意容器避免出现滚动条) 仅fixed为true有效
9178
+ target: {
9179
+ type: String
9180
+ }
9181
+ };
9182
+ const COMPONENT_NAME$27 = "vc-affix";
9183
+ const SCROLLER_WHEEL_REG = /vc-scroller-wheel/;
9184
+ const Affix = /* @__PURE__ */ vue.defineComponent({
9185
+ name: COMPONENT_NAME$27,
9186
+ props: props$1s,
9187
+ setup(props2, {
9188
+ slots,
9189
+ expose
9190
+ }) {
9191
+ const scrollerInstance = vue.inject("vc-scroller", null);
9192
+ const scroller = vue.shallowRef();
9193
+ const base = vue.shallowRef();
9194
+ const current = vue.shallowRef();
9195
+ const currentRect = vue.reactive({
9196
+ top: 0,
9197
+ bottom: 0,
9198
+ width: 0,
9199
+ height: 0
9200
+ });
9201
+ const isActive = vue.ref(false);
9202
+ const transformY = vue.ref(0);
9203
+ const windowHeight = vue.ref(window.innerHeight);
9204
+ const isVcScrollerWheel = vue.computed(() => {
9205
+ return SCROLLER_WHEEL_REG.test(scroller.value?.className || "");
9206
+ });
9207
+ const currentStyle = vue.computed(() => {
9208
+ if (!isActive.value) return {};
9209
+ return {
9210
+ height: `${currentRect.height}px`,
9211
+ width: `${currentRect.width}px`
9212
+ };
9213
+ });
9214
+ const contentStyle = vue.computed(() => {
9215
+ if (!isActive.value) return {};
9216
+ const offset = `${props2.offset}px`;
9217
+ return {
9218
+ height: `${currentRect.height}px`,
9219
+ width: `${currentRect.width}px`,
9220
+ top: props2.placement === "top" ? offset : "",
9221
+ bottom: props2.placement === "bottom" ? offset : "",
9222
+ zIndex: props2.zIndex,
9223
+ transform: transformY.value ? `translateY(${transformY.value}px)` : ""
9224
+ };
9225
+ });
9226
+ const setCurrentRect = () => {
9227
+ const rect = current.value.getBoundingClientRect();
9228
+ Object.assign(currentRect, {
9229
+ top: rect.top,
9230
+ bottom: rect.bottom,
9231
+ width: rect.width,
9232
+ height: rect.height
9233
+ });
9234
+ };
9235
+ const setAbsoluteStatus = () => {
9236
+ const {
9237
+ placement,
9238
+ offset
9239
+ } = props2;
9240
+ const currentHeightOffset = offset + currentRect.height;
9241
+ const containerRect = scroller.value.getBoundingClientRect();
9242
+ let transformOffsetY = 0;
9243
+ if (scrollerInstance && isVcScrollerWheel.value) {
9244
+ const maxMoveY = scrollerInstance.scrollHeight - scrollerInstance.clientHeight;
9245
+ transformOffsetY = scrollerInstance.scrollTop >= maxMoveY ? maxMoveY : scrollerInstance.scrollTop;
9246
+ }
9247
+ if (placement === "top") {
9248
+ isActive.value = currentRect.top - containerRect.top <= props2.offset;
9249
+ transformY.value = Math.min(containerRect.bottom - currentHeightOffset, 0) + transformOffsetY;
9250
+ } else {
9251
+ isActive.value = currentRect.bottom - containerRect.top >= containerRect.height - props2.offset;
9252
+ transformY.value = Math.max(containerRect.height - containerRect.top - currentHeightOffset, 0) + transformOffsetY;
9253
+ }
9254
+ };
9255
+ const setFixedStatus = () => {
9256
+ const {
9257
+ placement,
9258
+ target,
9259
+ offset
9260
+ } = props2;
9261
+ const currentHeightOffset = offset + currentRect.height;
9262
+ const containerRect = target && base.value.getBoundingClientRect();
9263
+ if (placement === "top") {
9264
+ if (target) {
9265
+ isActive.value = offset > currentRect.top && containerRect.bottom > 0;
9266
+ transformY.value = Math.min(containerRect.bottom - currentHeightOffset, 0);
9267
+ } else {
9268
+ isActive.value = offset > currentRect.top;
9269
+ }
9270
+ } else {
9271
+ if (target) {
9272
+ isActive.value = windowHeight.value - offset < currentRect.bottom && windowHeight.value > containerRect.top;
9273
+ transformY.value = -Math.min(windowHeight.value - containerRect.top - currentHeightOffset, 0);
9274
+ } else {
9275
+ isActive.value = windowHeight.value - offset < currentRect.bottom;
9276
+ }
9277
+ }
9278
+ };
9279
+ const refresh = () => {
9280
+ setCurrentRect();
9281
+ scroller.value instanceof Window || props2.fixed ? setFixedStatus() : setAbsoluteStatus();
9282
+ };
9283
+ vue.onMounted(() => {
9284
+ if (typeof props2.target === "string") {
9285
+ base.value = document.querySelector(props2.target) ?? void 0;
9286
+ }
9287
+ !base.value && (base.value = document.documentElement);
9288
+ scroller.value = getScroller(current.value, {
9289
+ className: SCROLLER_WHEEL_REG
9290
+ });
9291
+ if (isVcScrollerWheel.value) {
9292
+ scrollerInstance?.on(refresh);
9293
+ } else {
9294
+ scroller.value?.addEventListener("scroll", refresh);
9295
+ }
9296
+ refresh();
9297
+ });
9298
+ vue.onBeforeUnmount(() => {
9299
+ if (isVcScrollerWheel.value) {
9300
+ scrollerInstance?.off(refresh);
9301
+ } else {
9302
+ scroller.value?.removeEventListener("scroll", refresh);
9303
+ }
9304
+ });
9305
+ expose({
9306
+ refresh
9307
+ });
9308
+ return () => {
9309
+ return vue.createVNode("div", {
9310
+ "ref": current,
9311
+ "class": "vc-affix",
9312
+ "style": currentStyle.value
9313
+ }, [vue.createVNode("div", {
9314
+ "class": {
9315
+ [`vc-affix__${props2.fixed ? "fixed" : "absolute"}`]: isActive.value
9316
+ },
9317
+ "style": contentStyle.value
9318
+ }, [slots?.default?.()])]);
9319
+ };
9320
+ }
9321
+ });
9322
+ const MAffix = Affix;
9167
9323
  const props$1r = {
9168
9324
  modelValue: {
9169
9325
  type: Boolean,
@@ -9832,7 +9988,7 @@
9832
9988
  });
9833
9989
  const COMPONENT_NAME$1$ = "vc-alert";
9834
9990
  const THEME_MAP = {
9835
- info: ["#2B72FD", "#91d5ff", "#e6f7ff"],
9991
+ info: ["#456CF6", "#91d5ff", "#e6f7ff"],
9836
9992
  success: ["#52c41a", "#b7eb8f", "#f6ffed"],
9837
9993
  error: ["#ed4014", "#ffb08f", "#fbe9e9"],
9838
9994
  warning: ["#ffbf00", "#ffe58f", "#fffbe6"]
@@ -17729,6 +17885,7 @@
17729
17885
  refreshSize();
17730
17886
  refreshPosition(options);
17731
17887
  };
17888
+ const listeners = [];
17732
17889
  const triggerScrollDelegate = (options) => {
17733
17890
  const delegates = {
17734
17891
  scrollLeft: (options && options.x) ?? scrollX.value,
@@ -17736,12 +17893,15 @@
17736
17893
  clientWidth: wrapperW.value,
17737
17894
  clientHeight: wrapperH.value,
17738
17895
  scrollWidth: contentW.value,
17739
- scrollHeight: contentH.value
17896
+ scrollHeight: contentH.value,
17897
+ getBoundingClientRect: () => wrapper.value?.getBoundingClientRect()
17740
17898
  };
17741
- instance.emit("scroll", {
17899
+ const e = {
17742
17900
  target: delegates,
17743
17901
  currentTarget: delegates
17744
- });
17902
+ };
17903
+ instance.emit("scroll", e);
17904
+ listeners.forEach((listener) => listener(e));
17745
17905
  };
17746
17906
  const scrollTo = (options) => {
17747
17907
  refreshPosition(options);
@@ -17768,8 +17928,9 @@
17768
17928
  Resize.off(wrapper.value, refresh);
17769
17929
  Resize.off(content.value, refresh);
17770
17930
  }
17931
+ listeners.splice(0, listeners.length);
17771
17932
  });
17772
- expose({
17933
+ const exposed = {
17773
17934
  wrapper,
17774
17935
  content,
17775
17936
  scrollTo,
@@ -17785,8 +17946,16 @@
17785
17946
  },
17786
17947
  setScrollLeft: (value) => {
17787
17948
  scrollTo({ x: value });
17949
+ },
17950
+ on: (listener) => {
17951
+ listeners.push(listener);
17952
+ },
17953
+ off: (listener) => {
17954
+ listeners.splice(listeners.indexOf(listener), 1);
17788
17955
  }
17789
- });
17956
+ };
17957
+ expose(exposed);
17958
+ vue.provide("vc-scroller", vue.reactive(exposed));
17790
17959
  return {
17791
17960
  bar,
17792
17961
  wrapper,
@@ -23099,7 +23268,7 @@
23099
23268
  color: {
23100
23269
  type: [Object, String],
23101
23270
  default: () => ({
23102
- normal: "#2B72FD",
23271
+ normal: "#456CF6",
23103
23272
  success: "#52c41a",
23104
23273
  error: "#f5222d"
23105
23274
  })
@@ -26328,7 +26497,35 @@
26328
26497
  };
26329
26498
  }
26330
26499
  });
26331
- const TableSort = "div";
26500
+ const TableSort = /* @__PURE__ */ vue.defineComponent({
26501
+ name: "vc-table-sort",
26502
+ props: {
26503
+ order: String
26504
+ },
26505
+ emits: ["click"],
26506
+ setup(props2, {
26507
+ emit
26508
+ }) {
26509
+ const handleClick = (v) => {
26510
+ emit("click", props2.order !== v ? v : "");
26511
+ };
26512
+ return () => {
26513
+ return vue.createVNode("span", {
26514
+ "class": "vc-table-sort"
26515
+ }, [vue.createVNode("span", {
26516
+ "class": [{
26517
+ "is-ascending": props2.order === "ascending"
26518
+ }, "vc-table-sort__icon vc-table-sort__icon--ascending"],
26519
+ "onClick": vue.withModifiers(() => handleClick("ascending"), ["stop"])
26520
+ }, null), vue.createVNode("span", {
26521
+ "class": [{
26522
+ "is-descending": props2.order === "descending"
26523
+ }, "vc-table-sort__icon vc-table-sort__icon--descending"],
26524
+ "onClick": vue.withModifiers(() => handleClick("descending"), ["stop"])
26525
+ }, null)]);
26526
+ };
26527
+ }
26528
+ });
26332
26529
  const TableFilter = "div";
26333
26530
  const TableHeader = /* @__PURE__ */ vue.defineComponent({
26334
26531
  name: "vc-table-header",
@@ -26336,7 +26533,7 @@
26336
26533
  fixed: [Boolean, String],
26337
26534
  border: Boolean,
26338
26535
  // 排序全部交给外部处理,内部不处理数据,只做交互
26339
- defaultSort: {
26536
+ sort: {
26340
26537
  type: Object,
26341
26538
  default: () => ({})
26342
26539
  }
@@ -26533,10 +26730,12 @@
26533
26730
  document.body.style.cursor = "";
26534
26731
  };
26535
26732
  const handleSort = (prop, order) => {
26536
- table.emit("sort-change", {
26733
+ const v = {
26537
26734
  prop,
26538
26735
  order
26539
- });
26736
+ };
26737
+ table.emit("update:sort", v);
26738
+ table.emit("sort-change", v);
26540
26739
  };
26541
26740
  const handleFilter = (column, value) => {
26542
26741
  const {
@@ -26594,9 +26793,10 @@
26594
26793
  store: table.store
26595
26794
  }) : column.label, column.tooltip ? vue.createVNode(Icon, {
26596
26795
  "type": "o-info",
26796
+ "class": "vc-table__tooltip",
26597
26797
  "onMouseenter": (e) => handleCellMouseEnter(e, column)
26598
26798
  }, null) : null, column.sortable ? vue.createVNode(TableSort, {
26599
- "order": column.prop === props2.defaultSort.prop ? props2.defaultSort.order : "",
26799
+ "order": column.prop === props2.sort.prop ? props2.sort.order : "",
26600
26800
  "onClick": (order) => handleSort(column.prop, order)
26601
26801
  }, null) : null, column.filters ? vue.createVNode(TableFilter, {
26602
26802
  "data": column.filters,
@@ -26810,7 +27010,7 @@
26810
27010
  * 排序全部交给外部处理,内部不处理数据,只做交互
26811
27011
  * 列与列之间互斥
26812
27012
  */
26813
- defaultSort: {
27013
+ sort: {
26814
27014
  type: Object,
26815
27015
  default: () => ({})
26816
27016
  },
@@ -26821,7 +27021,7 @@
26821
27021
  const Table$1 = /* @__PURE__ */ vue.defineComponent({
26822
27022
  name: COMPONENT_NAME$j,
26823
27023
  props: props$d,
26824
- 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"],
27024
+ 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"],
26825
27025
  setup(props2, {
26826
27026
  slots,
26827
27027
  expose,
@@ -27204,7 +27404,7 @@
27204
27404
  }, [vue.createVNode(TableHeader, {
27205
27405
  "ref": tableHeader,
27206
27406
  "border": props2.border,
27207
- "default-sort": props2.defaultSort,
27407
+ "sort": props2.sort,
27208
27408
  "style": bodyWidthStyle.value
27209
27409
  }, null)]), states.columns.length > 0 && vue.createVNode(ScrollerWheel, {
27210
27410
  "ref": scroller,
@@ -27253,7 +27453,7 @@
27253
27453
  }, [vue.createVNode(TableHeader, {
27254
27454
  "ref": leftFixedTableHeader,
27255
27455
  "border": props2.border,
27256
- "default-sort": props2.defaultSort,
27456
+ "sort": props2.sort,
27257
27457
  "style": bodyWidthStyle.value,
27258
27458
  "fixed": "left"
27259
27459
  }, null)]), vue.createVNode("div", {
@@ -27292,7 +27492,7 @@
27292
27492
  }, [vue.createVNode(TableHeader, {
27293
27493
  "ref": rightFixedTableHeader,
27294
27494
  "border": props2.border,
27295
- "default-sort": props2.defaultSort,
27495
+ "sort": props2.sort,
27296
27496
  "style": bodyWidthStyle.value,
27297
27497
  "fixed": "right"
27298
27498
  }, null)]), vue.createVNode("div", {
@@ -28022,7 +28222,8 @@
28022
28222
  });
28023
28223
  const props$b = {
28024
28224
  value: {
28025
- type: [String, Number, Boolean]
28225
+ type: [String, Number, Boolean],
28226
+ default: void 0
28026
28227
  },
28027
28228
  label: {
28028
28229
  type: [String, Function],
@@ -28328,7 +28529,7 @@
28328
28529
  "class": [{
28329
28530
  "is-fixed": isFixed
28330
28531
  }, "vcm-tabs__bar"]
28331
- }, [vue.createVNode("slot", {
28532
+ }, [vue.createVNode(vue.resolveComponent("slot"), {
28332
28533
  "name": "prepend"
28333
28534
  }, null), slots.prepend?.(), props2.showStep && tabs.scrollable.value && vue.createVNode("div", {
28334
28535
  "class": "vcm-tabs__step is-left",
@@ -31373,6 +31574,8 @@
31373
31574
  const Components = {
31374
31575
  ActionSheet,
31375
31576
  MActionSheet,
31577
+ Affix,
31578
+ MAffix,
31376
31579
  Alert,
31377
31580
  MAlert,
31378
31581
  Artboard,
@@ -34698,10 +34901,10 @@
34698
34901
  var _v1 = create$2();
34699
34902
  var _v2 = create$2();
34700
34903
  function isAroundZero$1(val) {
34701
- return val > -1e-8 && val < EPSILON$4;
34904
+ return val > -EPSILON$4 && val < EPSILON$4;
34702
34905
  }
34703
34906
  function isNotAroundZero$1(val) {
34704
- return val > EPSILON$4 || val < -1e-8;
34907
+ return val > EPSILON$4 || val < -EPSILON$4;
34705
34908
  }
34706
34909
  function cubicAt(p0, p1, p2, p3, t) {
34707
34910
  var onet = 1 - t;
@@ -35688,7 +35891,7 @@
35688
35891
  }
35689
35892
  var EPSILON$3 = 1e-4;
35690
35893
  function isAroundZero(transform) {
35691
- return transform < EPSILON$3 && transform > -1e-4;
35894
+ return transform < EPSILON$3 && transform > -EPSILON$3;
35692
35895
  }
35693
35896
  function round3(transform) {
35694
35897
  return mathRound$1(transform * 1e3) / 1e3;
@@ -36969,7 +37172,7 @@
36969
37172
  var mIdentity = identity;
36970
37173
  var EPSILON$2 = 5e-5;
36971
37174
  function isNotAroundZero(val) {
36972
- return val > EPSILON$2 || val < -5e-5;
37175
+ return val > EPSILON$2 || val < -EPSILON$2;
36973
37176
  }
36974
37177
  var scaleTmp = [];
36975
37178
  var tmpTransform = [];
@@ -37687,7 +37890,7 @@
37687
37890
  this.markRedraw();
37688
37891
  if (!useHoverLayer && this.__inHover) {
37689
37892
  this._toggleHoverLayerFlag(false);
37690
- this.__dirty &= -2;
37893
+ this.__dirty &= ~REDRAW_BIT;
37691
37894
  }
37692
37895
  return state;
37693
37896
  };
@@ -37745,7 +37948,7 @@
37745
37948
  this.markRedraw();
37746
37949
  if (!useHoverLayer && this.__inHover) {
37747
37950
  this._toggleHoverLayerFlag(false);
37748
- this.__dirty &= -2;
37951
+ this.__dirty &= ~REDRAW_BIT;
37749
37952
  }
37750
37953
  }
37751
37954
  };
@@ -39068,7 +39271,7 @@
39068
39271
  * @return {boolean}
39069
39272
  */
39070
39273
  function isRadianAroundZero(val) {
39071
- return val > -1e-4 && val < RADIAN_EPSILON;
39274
+ return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;
39072
39275
  }
39073
39276
  // eslint-disable-next-line
39074
39277
  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
@@ -40662,7 +40865,7 @@
40662
40865
  return !!(this.__dirty & STYLE_CHANGED_BIT);
40663
40866
  };
40664
40867
  Displayable.prototype.styleUpdated = function () {
40665
- this.__dirty &= -3;
40868
+ this.__dirty &= ~STYLE_CHANGED_BIT;
40666
40869
  };
40667
40870
  Displayable.prototype.createStyle = function (obj) {
40668
40871
  return createObject(DEFAULT_COMMON_STYLE, obj);
@@ -42171,7 +42374,7 @@
42171
42374
  };
42172
42375
  Path.prototype.buildPath = function (ctx, shapeCfg, inBatch) { };
42173
42376
  Path.prototype.pathUpdated = function () {
42174
- this.__dirty &= -5;
42377
+ this.__dirty &= ~SHAPE_CHANGED_BIT;
42175
42378
  };
42176
42379
  Path.prototype.getUpdatedPathProxy = function (inBatch) {
42177
42380
  !this.path && this.createPathProxy();
@@ -54757,7 +54960,7 @@
54757
54960
  function brush$1(ctx, el, scope, isLast) {
54758
54961
  var m = el.transform;
54759
54962
  if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {
54760
- el.__dirty &= -2;
54963
+ el.__dirty &= ~REDRAW_BIT;
54761
54964
  el.__isRendered = false;
54762
54965
  return;
54763
54966
  }
@@ -113026,7 +113229,7 @@
113026
113229
  // and velocity is close to 0
113027
113230
  //
113028
113231
 
113029
- if (velocity.x < -0.5 && currentSlideVisibilityRatio < 0 || velocity.x < 0.1 && currentSlideVisibilityRatio < -0.5) {
113232
+ if (velocity.x < -MIN_NEXT_SLIDE_SPEED && currentSlideVisibilityRatio < 0 || velocity.x < 0.1 && currentSlideVisibilityRatio < -0.5) {
113030
113233
  // Go to next slide
113031
113234
  indexDiff = 1;
113032
113235
  velocity.x = Math.min(velocity.x, 0);
@@ -113090,7 +113293,7 @@
113090
113293
  // or if we are below and moving downwards
113091
113294
 
113092
113295
 
113093
- if (vDragRatio < 0 && projectedVDragRatio < -0.4 || vDragRatio > 0 && projectedVDragRatio > MIN_RATIO_TO_CLOSE) {
113296
+ if (vDragRatio < 0 && projectedVDragRatio < -MIN_RATIO_TO_CLOSE || vDragRatio > 0 && projectedVDragRatio > MIN_RATIO_TO_CLOSE) {
113094
113297
  this.pswp.close();
113095
113298
  return;
113096
113299
  }
@@ -131808,6 +132011,7 @@
131808
132011
  }, Symbol.toStringTag, { value: 'Module' }));
131809
132012
 
131810
132013
  exports.ActionSheet = ActionSheet;
132014
+ exports.Affix = Affix;
131811
132015
  exports.Alert = Alert;
131812
132016
  exports.Artboard = Artboard;
131813
132017
  exports.Button = Button;
@@ -131853,6 +132057,7 @@
131853
132057
  exports.List = MList;
131854
132058
  exports.ListItem = MListItem;
131855
132059
  exports.MActionSheet = MActionSheet;
132060
+ exports.MAffix = MAffix;
131856
132061
  exports.MAlert = MAlert;
131857
132062
  exports.MArtboard = MArtboard;
131858
132063
  exports.MButton = MButton;