@varlet/ui 3.5.0 → 3.5.1-alpha.1726764162524
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.
- package/es/action-sheet/style/index.mjs +1 -1
- package/es/auto-complete/AutoComplete.mjs +1 -2
- package/es/avatar/Avatar.mjs +1 -2
- package/es/badge/Badge.mjs +1 -2
- package/es/button/Button.mjs +1 -2
- package/es/card/Card.mjs +2 -4
- package/es/checkbox/Checkbox.mjs +1 -2
- package/es/collapse/Collapse.mjs +1 -2
- package/es/collapse-item/CollapseItem.mjs +1 -2
- package/es/counter/Counter.mjs +1 -2
- package/es/date-picker/DatePicker.mjs +30 -60
- package/es/date-picker/src/day-picker-panel.mjs +18 -33
- package/es/date-picker/src/month-picker-panel.mjs +21 -39
- package/es/date-picker/src/panel-header.mjs +3 -6
- package/es/date-picker/src/year-picker-panel.mjs +19 -35
- package/es/ellipsis/Ellipsis.mjs +1 -2
- package/es/fab/Fab.mjs +1 -1
- package/es/field-decorator/FieldDecorator.mjs +1 -2
- package/es/form-details/FormDetails.mjs +1 -2
- package/es/hover/index.mjs +1 -2
- package/es/image/Image.mjs +1 -2
- package/es/image-preview/ImagePreview.mjs +1 -2
- package/es/index-bar/IndexBar.mjs +3 -6
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/input/Input.mjs +1 -2
- package/es/loading/Loading.mjs +17 -20
- package/es/menu-option/MenuOption.mjs +1 -2
- package/es/option/Option.mjs +1 -2
- package/es/overlay/Overlay.mjs +1 -2
- package/es/pagination/Pagination.mjs +5 -10
- package/es/picker/Picker.mjs +1 -2
- package/es/popup/Popup.mjs +1 -2
- package/es/progress/Progress.mjs +1 -2
- package/es/radio/Radio.mjs +1 -2
- package/es/rate/Rate.mjs +1 -2
- package/es/result/Empty.mjs +13 -16
- package/es/result/Error.mjs +10 -13
- package/es/result/Info.mjs +10 -13
- package/es/result/Question.mjs +10 -13
- package/es/result/Warning.mjs +10 -13
- package/es/select/Select.mjs +1 -2
- package/es/slider/Slider.mjs +1 -2
- package/es/snackbar/index.mjs +4 -5
- package/es/space/Space.mjs +1 -2
- package/es/step/Step.mjs +1 -2
- package/es/style.css +1 -1
- package/es/swipe/Swipe.mjs +1 -2
- package/es/swipe-item/SwipeItem.mjs +1 -2
- package/es/switch/Switch.mjs +17 -20
- package/es/tabs/Tabs.mjs +1 -2
- package/es/time-picker/TimePicker.mjs +13 -26
- package/es/time-picker/clock.mjs +11 -22
- package/es/time-picker/utils.mjs +4 -8
- package/es/uploader/Uploader.mjs +1 -2
- package/es/utils/elements.mjs +1 -2
- package/es/utils/test.mjs +1 -4
- package/es/varlet.esm.js +5120 -5252
- package/es/watermark/Watermark.mjs +1 -2
- package/highlight/web-types.en-US.json +1 -1
- package/highlight/web-types.zh-CN.json +1 -1
- package/lib/varlet.cjs.js +501 -842
- package/package.json +7 -7
- package/umd/varlet.js +8 -8
package/lib/varlet.cjs.js
CHANGED
|
@@ -1385,8 +1385,7 @@ function getTarget(target, componentName) {
|
|
|
1385
1385
|
}
|
|
1386
1386
|
return el;
|
|
1387
1387
|
}
|
|
1388
|
-
if (isObject(target))
|
|
1389
|
-
return target;
|
|
1388
|
+
if (isObject(target)) return target;
|
|
1390
1389
|
error$1(componentName, 'type of prop "target" should be a selector or an element object');
|
|
1391
1390
|
}
|
|
1392
1391
|
function getViewportSize() {
|
|
@@ -1654,8 +1653,7 @@ function shouldDisabled(arg) {
|
|
|
1654
1653
|
}
|
|
1655
1654
|
function getStyle(element) {
|
|
1656
1655
|
const style = element.getAttribute("style");
|
|
1657
|
-
if (!style)
|
|
1658
|
-
return {};
|
|
1656
|
+
if (!style) return {};
|
|
1659
1657
|
return style.split(";").filter(Boolean).reduce((style2, item) => {
|
|
1660
1658
|
const [key, value] = item.split(":").map((item2) => item2.trim());
|
|
1661
1659
|
style2[camelize(key)] = value;
|
|
@@ -2799,8 +2797,8 @@ const props$1c = {
|
|
|
2799
2797
|
}
|
|
2800
2798
|
};
|
|
2801
2799
|
const { name: name$1d, n: n$1k } = createNamespace("form-details");
|
|
2802
|
-
const _hoisted_1$
|
|
2803
|
-
const _hoisted_2$
|
|
2800
|
+
const _hoisted_1$y = { key: 0 };
|
|
2801
|
+
const _hoisted_2$9 = { key: 0 };
|
|
2804
2802
|
function __render__$1j(_ctx, _cache) {
|
|
2805
2803
|
return vue.openBlock(), vue.createBlock(vue.Transition, {
|
|
2806
2804
|
name: _ctx.n()
|
|
@@ -2825,7 +2823,7 @@ function __render__$1j(_ctx, _cache) {
|
|
|
2825
2823
|
default: vue.withCtx(() => [
|
|
2826
2824
|
_ctx.errorMessage ? (vue.openBlock(), vue.createElementBlock(
|
|
2827
2825
|
"div",
|
|
2828
|
-
_hoisted_1$
|
|
2826
|
+
_hoisted_1$y,
|
|
2829
2827
|
vue.toDisplayString(_ctx.errorMessage),
|
|
2830
2828
|
1
|
|
2831
2829
|
/* TEXT */
|
|
@@ -2851,7 +2849,7 @@ function __render__$1j(_ctx, _cache) {
|
|
|
2851
2849
|
vue.renderSlot(_ctx.$slots, "extra-message", {}, () => [
|
|
2852
2850
|
_ctx.extraMessage ? (vue.openBlock(), vue.createElementBlock(
|
|
2853
2851
|
"div",
|
|
2854
|
-
_hoisted_2$
|
|
2852
|
+
_hoisted_2$9,
|
|
2855
2853
|
vue.toDisplayString(_ctx.extraMessage),
|
|
2856
2854
|
1
|
|
2857
2855
|
/* TEXT */
|
|
@@ -2981,7 +2979,7 @@ var __async$h = (__this, __arguments, generator) => {
|
|
|
2981
2979
|
});
|
|
2982
2980
|
};
|
|
2983
2981
|
const { name: name$1c, n: n$1j, classes: classes$14 } = createNamespace("field-decorator");
|
|
2984
|
-
const _hoisted_1$
|
|
2982
|
+
const _hoisted_1$x = ["for"];
|
|
2985
2983
|
function __render__$1i(_ctx, _cache) {
|
|
2986
2984
|
const _component_var_icon = vue.resolveComponent("var-icon");
|
|
2987
2985
|
return vue.openBlock(), vue.createElementBlock(
|
|
@@ -3061,7 +3059,7 @@ function __render__$1i(_ctx, _cache) {
|
|
|
3061
3059
|
1
|
|
3062
3060
|
/* TEXT */
|
|
3063
3061
|
)
|
|
3064
|
-
], 14, _hoisted_1$
|
|
3062
|
+
], 14, _hoisted_1$x)) : vue.createCommentVNode("v-if", true),
|
|
3065
3063
|
vue.createElementVNode(
|
|
3066
3064
|
"div",
|
|
3067
3065
|
{
|
|
@@ -3390,9 +3388,9 @@ function useFormItems() {
|
|
|
3390
3388
|
};
|
|
3391
3389
|
}
|
|
3392
3390
|
const { name: name$1b, n: n$1i, classes: classes$13 } = createNamespace("input");
|
|
3393
|
-
const _hoisted_1$
|
|
3394
|
-
const _hoisted_2$
|
|
3395
|
-
const _hoisted_3$
|
|
3391
|
+
const _hoisted_1$w = ["placeholder", "enterkeyhint"];
|
|
3392
|
+
const _hoisted_2$8 = ["autocomplete", "id", "disabled", "readonly", "type", "value", "placeholder", "maxlength", "rows", "enterkeyhint", "inputmode"];
|
|
3393
|
+
const _hoisted_3$4 = ["autocomplete", "id", "disabled", "readonly", "type", "value", "placeholder", "maxlength", "enterkeyhint", "inputmode"];
|
|
3396
3394
|
function __render__$1h(_ctx, _cache) {
|
|
3397
3395
|
const _component_var_field_decorator = vue.resolveComponent("var-field-decorator");
|
|
3398
3396
|
const _component_var_form_details = vue.resolveComponent("var-form-details");
|
|
@@ -3444,7 +3442,7 @@ function __render__$1h(_ctx, _cache) {
|
|
|
3444
3442
|
"--input-placeholder-color": _ctx.placeholderColor
|
|
3445
3443
|
}),
|
|
3446
3444
|
enterkeyhint: _ctx.enterkeyhint
|
|
3447
|
-
}, null, 14, _hoisted_1$
|
|
3445
|
+
}, null, 14, _hoisted_1$w)) : vue.createCommentVNode("v-if", true),
|
|
3448
3446
|
_ctx.textarea ? (vue.openBlock(), vue.createElementBlock("textarea", {
|
|
3449
3447
|
key: 1,
|
|
3450
3448
|
class: vue.normalizeClass(
|
|
@@ -3480,7 +3478,7 @@ function __render__$1h(_ctx, _cache) {
|
|
|
3480
3478
|
onChange: _cache[3] || (_cache[3] = (...args) => _ctx.handleChange && _ctx.handleChange(...args)),
|
|
3481
3479
|
onCompositionstart: _cache[4] || (_cache[4] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)),
|
|
3482
3480
|
onCompositionend: _cache[5] || (_cache[5] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args))
|
|
3483
|
-
}, null, 46, _hoisted_2$
|
|
3481
|
+
}, null, 46, _hoisted_2$8)) : (vue.openBlock(), vue.createElementBlock("input", {
|
|
3484
3482
|
key: 2,
|
|
3485
3483
|
class: vue.normalizeClass(
|
|
3486
3484
|
_ctx.classes(
|
|
@@ -3512,7 +3510,7 @@ function __render__$1h(_ctx, _cache) {
|
|
|
3512
3510
|
onChange: _cache[9] || (_cache[9] = (...args) => _ctx.handleChange && _ctx.handleChange(...args)),
|
|
3513
3511
|
onCompositionstart: _cache[10] || (_cache[10] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)),
|
|
3514
3512
|
onCompositionend: _cache[11] || (_cache[11] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args))
|
|
3515
|
-
}, null, 46, _hoisted_3$
|
|
3513
|
+
}, null, 46, _hoisted_3$4))
|
|
3516
3514
|
]),
|
|
3517
3515
|
_: 2
|
|
3518
3516
|
/* DYNAMIC */
|
|
@@ -4378,8 +4376,7 @@ function flip(_ref) {
|
|
|
4378
4376
|
};
|
|
4379
4377
|
for (var _i = numberOfChecks; _i > 0; _i--) {
|
|
4380
4378
|
var _ret = _loop(_i);
|
|
4381
|
-
if (_ret === "break")
|
|
4382
|
-
break;
|
|
4379
|
+
if (_ret === "break") break;
|
|
4383
4380
|
}
|
|
4384
4381
|
}
|
|
4385
4382
|
if (state.placement !== firstFittingPlacement) {
|
|
@@ -5598,7 +5595,7 @@ function useCheckboxGroup() {
|
|
|
5598
5595
|
};
|
|
5599
5596
|
}
|
|
5600
5597
|
const { name: name$19, n: n$1g, classes: classes$11 } = createNamespace("checkbox");
|
|
5601
|
-
const _hoisted_1$
|
|
5598
|
+
const _hoisted_1$v = ["tabindex"];
|
|
5602
5599
|
function __render__$1f(_ctx, _cache) {
|
|
5603
5600
|
const _component_var_icon = vue.resolveComponent("var-icon");
|
|
5604
5601
|
const _component_var_hover_overlay = vue.resolveComponent("var-hover-overlay");
|
|
@@ -5661,7 +5658,7 @@ function __render__$1f(_ctx, _cache) {
|
|
|
5661
5658
|
hovering: !_ctx.disabled && !_ctx.formDisabled && _ctx.hovering,
|
|
5662
5659
|
focusing: !_ctx.disabled && !_ctx.formDisabled && _ctx.isFocusing
|
|
5663
5660
|
}, null, 8, ["hovering", "focusing"])
|
|
5664
|
-
], 46, _hoisted_1$
|
|
5661
|
+
], 46, _hoisted_1$v)), [
|
|
5665
5662
|
[_directive_hover, _ctx.handleHovering, "desktop"],
|
|
5666
5663
|
[_directive_ripple, { disabled: _ctx.formReadonly || _ctx.readonly || _ctx.formDisabled || _ctx.disabled || !_ctx.ripple }]
|
|
5667
5664
|
]),
|
|
@@ -5875,7 +5872,7 @@ const props$17 = {
|
|
|
5875
5872
|
option: Object
|
|
5876
5873
|
};
|
|
5877
5874
|
const { name: name$18, n: n$1f, classes: classes$10 } = createNamespace("menu-option");
|
|
5878
|
-
const _hoisted_1$
|
|
5875
|
+
const _hoisted_1$u = ["tabindex"];
|
|
5879
5876
|
function __render__$1e(_ctx, _cache) {
|
|
5880
5877
|
const _component_var_checkbox = vue.resolveComponent("var-checkbox");
|
|
5881
5878
|
const _component_maybe_v_node = vue.resolveComponent("maybe-v-node");
|
|
@@ -5931,7 +5928,7 @@ function __render__$1e(_ctx, _cache) {
|
|
|
5931
5928
|
hovering: _ctx.hovering && !_ctx.disabled,
|
|
5932
5929
|
focusing: _ctx.isFocusing && !_ctx.disabled
|
|
5933
5930
|
}, null, 8, ["hovering", "focusing"])
|
|
5934
|
-
], 42, _hoisted_1$
|
|
5931
|
+
], 42, _hoisted_1$u)), [
|
|
5935
5932
|
[_directive_ripple, { disabled: _ctx.disabled || !_ctx.ripple }],
|
|
5936
5933
|
[_directive_hover, _ctx.handleHovering, "desktop"]
|
|
5937
5934
|
]);
|
|
@@ -6393,7 +6390,7 @@ var __async$f = (__this, __arguments, generator) => {
|
|
|
6393
6390
|
});
|
|
6394
6391
|
};
|
|
6395
6392
|
const { name: name$16, n: n$1d } = createNamespace("auto-complete");
|
|
6396
|
-
const _hoisted_1$
|
|
6393
|
+
const _hoisted_1$t = ["tabindex"];
|
|
6397
6394
|
function __render__$1c(_ctx, _cache) {
|
|
6398
6395
|
const _component_var_input = vue.resolveComponent("var-input");
|
|
6399
6396
|
const _component_var_menu_option = vue.resolveComponent("var-menu-option");
|
|
@@ -6514,7 +6511,7 @@ function __render__$1c(_ctx, _cache) {
|
|
|
6514
6511
|
"error-message": _ctx.errorMessage,
|
|
6515
6512
|
"extra-message": _ctx.maxlengthText
|
|
6516
6513
|
}, null, 8, ["error-message", "extra-message"])
|
|
6517
|
-
], 42, _hoisted_1$
|
|
6514
|
+
], 42, _hoisted_1$t);
|
|
6518
6515
|
}
|
|
6519
6516
|
const __sfc__$1e = vue.defineComponent({
|
|
6520
6517
|
name: name$16,
|
|
@@ -7001,8 +6998,8 @@ const props$14 = {
|
|
|
7001
6998
|
};
|
|
7002
6999
|
const isInternalSize$1 = (size) => ["mini", "small", "normal", "large"].includes(size);
|
|
7003
7000
|
const { name: name$15, n: n$1c, classes: classes$_ } = createNamespace("avatar");
|
|
7004
|
-
const _hoisted_1$
|
|
7005
|
-
const _hoisted_2$
|
|
7001
|
+
const _hoisted_1$s = ["src", "alt", "lazy-loading", "lazy-error"];
|
|
7002
|
+
const _hoisted_2$7 = ["src", "alt"];
|
|
7006
7003
|
function __render__$1b(_ctx, _cache) {
|
|
7007
7004
|
const _directive_lazy = vue.resolveDirective("lazy");
|
|
7008
7005
|
return vue.openBlock(), vue.createElementBlock(
|
|
@@ -7042,7 +7039,7 @@ function __render__$1b(_ctx, _cache) {
|
|
|
7042
7039
|
"lazy-loading": _ctx.loading,
|
|
7043
7040
|
"lazy-error": _ctx.error,
|
|
7044
7041
|
onLoad: _cache[0] || (_cache[0] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args))
|
|
7045
|
-
}, null, 46, _hoisted_1$
|
|
7042
|
+
}, null, 46, _hoisted_1$s)), [
|
|
7046
7043
|
[_directive_lazy, _ctx.src]
|
|
7047
7044
|
]) : (vue.openBlock(), vue.createElementBlock("img", {
|
|
7048
7045
|
key: 1,
|
|
@@ -7053,7 +7050,7 @@ function __render__$1b(_ctx, _cache) {
|
|
|
7053
7050
|
style: vue.normalizeStyle({ objectFit: _ctx.fit }),
|
|
7054
7051
|
onLoad: _cache[1] || (_cache[1] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
|
|
7055
7052
|
onError: _cache[2] || (_cache[2] = (...args) => _ctx.handleError && _ctx.handleError(...args))
|
|
7056
|
-
}, null, 46, _hoisted_2$
|
|
7053
|
+
}, null, 46, _hoisted_2$7))
|
|
7057
7054
|
],
|
|
7058
7055
|
64
|
|
7059
7056
|
/* STABLE_FRAGMENT */
|
|
@@ -7194,24 +7191,6 @@ const props$12 = {
|
|
|
7194
7191
|
loading: Boolean
|
|
7195
7192
|
};
|
|
7196
7193
|
const { name: name$13, n: n$1a, classes: classes$Y } = createNamespace("loading");
|
|
7197
|
-
const _withScopeId$6 = (n2) => (vue.pushScopeId(""), n2 = n2(), vue.popScopeId(), n2);
|
|
7198
|
-
const _hoisted_1$s = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode(
|
|
7199
|
-
"svg",
|
|
7200
|
-
{ viewBox: "25 25 50 50" },
|
|
7201
|
-
[
|
|
7202
|
-
/* @__PURE__ */ vue.createElementVNode("circle", {
|
|
7203
|
-
cx: "50",
|
|
7204
|
-
cy: "50",
|
|
7205
|
-
r: "20",
|
|
7206
|
-
fill: "none"
|
|
7207
|
-
})
|
|
7208
|
-
],
|
|
7209
|
-
-1
|
|
7210
|
-
/* HOISTED */
|
|
7211
|
-
));
|
|
7212
|
-
const _hoisted_2$c = [
|
|
7213
|
-
_hoisted_1$s
|
|
7214
|
-
];
|
|
7215
7194
|
function __render__$19(_ctx, _cache) {
|
|
7216
7195
|
return vue.openBlock(), vue.createElementBlock(
|
|
7217
7196
|
"div",
|
|
@@ -7265,7 +7244,22 @@ function __render__$19(_ctx, _cache) {
|
|
|
7265
7244
|
color: _ctx.color
|
|
7266
7245
|
})
|
|
7267
7246
|
},
|
|
7268
|
-
[
|
|
7247
|
+
_cache[0] || (_cache[0] = [
|
|
7248
|
+
vue.createElementVNode(
|
|
7249
|
+
"svg",
|
|
7250
|
+
{ viewBox: "25 25 50 50" },
|
|
7251
|
+
[
|
|
7252
|
+
vue.createElementVNode("circle", {
|
|
7253
|
+
cx: "50",
|
|
7254
|
+
cy: "50",
|
|
7255
|
+
r: "20",
|
|
7256
|
+
fill: "none"
|
|
7257
|
+
})
|
|
7258
|
+
],
|
|
7259
|
+
-1
|
|
7260
|
+
/* HOISTED */
|
|
7261
|
+
)
|
|
7262
|
+
]),
|
|
7269
7263
|
6
|
|
7270
7264
|
/* CLASS, STYLE */
|
|
7271
7265
|
)
|
|
@@ -8768,8 +8762,7 @@ const __sfc__$12 = vue.defineComponent({
|
|
|
8768
8762
|
vue.watch(
|
|
8769
8763
|
() => props2.floating,
|
|
8770
8764
|
(value) => {
|
|
8771
|
-
if (isRow.value)
|
|
8772
|
-
return;
|
|
8765
|
+
if (isRow.value) return;
|
|
8773
8766
|
vue.nextTick(() => {
|
|
8774
8767
|
value ? floating() : dropdown();
|
|
8775
8768
|
});
|
|
@@ -9544,8 +9537,7 @@ const __sfc__$Z = vue.defineComponent({
|
|
|
9544
9537
|
});
|
|
9545
9538
|
}
|
|
9546
9539
|
const toggleAll = (options) => {
|
|
9547
|
-
if (props2.accordion)
|
|
9548
|
-
return;
|
|
9540
|
+
if (props2.accordion) return;
|
|
9549
9541
|
const matchedItems = collapseItems.filter((item) => {
|
|
9550
9542
|
var _a;
|
|
9551
9543
|
const itemValue = (_a = item.name.value) != null ? _a : item.index.value;
|
|
@@ -10136,8 +10128,7 @@ var EXP_LIMIT = 9e15, MAX_DIGITS = 1e9, NUMERALS = "0123456789abcdef", LN10 = "2
|
|
|
10136
10128
|
}, inexact, quadrant, external = true, decimalError = "[DecimalError] ", invalidArgument = decimalError + "Invalid argument: ", precisionLimitExceeded = decimalError + "Precision limit exceeded", cryptoUnavailable = decimalError + "crypto unavailable", tag = "[object Decimal]", mathfloor = Math.floor, mathpow = Math.pow, isBinary = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, isHex = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, isOctal = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, BASE = 1e7, LOG_BASE = 7, MAX_SAFE_INTEGER = 9007199254740991, LN10_PRECISION = LN10.length - 1, PI_PRECISION = PI.length - 1, P = { toStringTag: tag };
|
|
10137
10129
|
P.absoluteValue = P.abs = function() {
|
|
10138
10130
|
var x = new this.constructor(this);
|
|
10139
|
-
if (x.s < 0)
|
|
10140
|
-
x.s = 1;
|
|
10131
|
+
if (x.s < 0) x.s = 1;
|
|
10141
10132
|
return finalise(x);
|
|
10142
10133
|
};
|
|
10143
10134
|
P.ceil = function() {
|
|
@@ -10147,10 +10138,8 @@ P.clampedTo = P.clamp = function(min2, max2) {
|
|
|
10147
10138
|
var k, x = this, Ctor = x.constructor;
|
|
10148
10139
|
min2 = new Ctor(min2);
|
|
10149
10140
|
max2 = new Ctor(max2);
|
|
10150
|
-
if (!min2.s || !max2.s)
|
|
10151
|
-
|
|
10152
|
-
if (min2.gt(max2))
|
|
10153
|
-
throw Error(invalidArgument + max2);
|
|
10141
|
+
if (!min2.s || !max2.s) return new Ctor(NaN);
|
|
10142
|
+
if (min2.gt(max2)) throw Error(invalidArgument + max2);
|
|
10154
10143
|
k = x.cmp(min2);
|
|
10155
10144
|
return k < 0 ? min2 : x.cmp(max2) > 0 ? max2 : new Ctor(x);
|
|
10156
10145
|
};
|
|
@@ -10159,26 +10148,20 @@ P.comparedTo = P.cmp = function(y) {
|
|
|
10159
10148
|
if (!xd || !yd) {
|
|
10160
10149
|
return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;
|
|
10161
10150
|
}
|
|
10162
|
-
if (!xd[0] || !yd[0])
|
|
10163
|
-
|
|
10164
|
-
if (
|
|
10165
|
-
return xs;
|
|
10166
|
-
if (x.e !== y.e)
|
|
10167
|
-
return x.e > y.e ^ xs < 0 ? 1 : -1;
|
|
10151
|
+
if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;
|
|
10152
|
+
if (xs !== ys) return xs;
|
|
10153
|
+
if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;
|
|
10168
10154
|
xdL = xd.length;
|
|
10169
10155
|
ydL = yd.length;
|
|
10170
10156
|
for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {
|
|
10171
|
-
if (xd[i] !== yd[i])
|
|
10172
|
-
return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;
|
|
10157
|
+
if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;
|
|
10173
10158
|
}
|
|
10174
10159
|
return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;
|
|
10175
10160
|
};
|
|
10176
10161
|
P.cosine = P.cos = function() {
|
|
10177
10162
|
var pr, rm, x = this, Ctor = x.constructor;
|
|
10178
|
-
if (!x.d)
|
|
10179
|
-
|
|
10180
|
-
if (!x.d[0])
|
|
10181
|
-
return new Ctor(1);
|
|
10163
|
+
if (!x.d) return new Ctor(NaN);
|
|
10164
|
+
if (!x.d[0]) return new Ctor(1);
|
|
10182
10165
|
pr = Ctor.precision;
|
|
10183
10166
|
rm = Ctor.rounding;
|
|
10184
10167
|
Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;
|
|
@@ -10190,15 +10173,13 @@ P.cosine = P.cos = function() {
|
|
|
10190
10173
|
};
|
|
10191
10174
|
P.cubeRoot = P.cbrt = function() {
|
|
10192
10175
|
var e, m, n2, r, rep, s, sd, t2, t3, t3plusx, x = this, Ctor = x.constructor;
|
|
10193
|
-
if (!x.isFinite() || x.isZero())
|
|
10194
|
-
return new Ctor(x);
|
|
10176
|
+
if (!x.isFinite() || x.isZero()) return new Ctor(x);
|
|
10195
10177
|
external = false;
|
|
10196
10178
|
s = x.s * mathpow(x.s * x, 1 / 3);
|
|
10197
10179
|
if (!s || Math.abs(s) == 1 / 0) {
|
|
10198
10180
|
n2 = digitsToString(x.d);
|
|
10199
10181
|
e = x.e;
|
|
10200
|
-
if (s = (e - n2.length + 1) % 3)
|
|
10201
|
-
n2 += s == 1 || s == -2 ? "0" : "00";
|
|
10182
|
+
if (s = (e - n2.length + 1) % 3) n2 += s == 1 || s == -2 ? "0" : "00";
|
|
10202
10183
|
s = mathpow(n2, 1 / 3);
|
|
10203
10184
|
e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));
|
|
10204
10185
|
if (s == 1 / 0) {
|
|
@@ -10248,11 +10229,8 @@ P.decimalPlaces = P.dp = function() {
|
|
|
10248
10229
|
w = d.length - 1;
|
|
10249
10230
|
n2 = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
10250
10231
|
w = d[w];
|
|
10251
|
-
if (w)
|
|
10252
|
-
|
|
10253
|
-
n2--;
|
|
10254
|
-
if (n2 < 0)
|
|
10255
|
-
n2 = 0;
|
|
10232
|
+
if (w) for (; w % 10 == 0; w /= 10) n2--;
|
|
10233
|
+
if (n2 < 0) n2 = 0;
|
|
10256
10234
|
}
|
|
10257
10235
|
return n2;
|
|
10258
10236
|
};
|
|
@@ -10278,10 +10256,8 @@ P.greaterThanOrEqualTo = P.gte = function(y) {
|
|
|
10278
10256
|
};
|
|
10279
10257
|
P.hyperbolicCosine = P.cosh = function() {
|
|
10280
10258
|
var k, n2, pr, rm, len, x = this, Ctor = x.constructor, one = new Ctor(1);
|
|
10281
|
-
if (!x.isFinite())
|
|
10282
|
-
|
|
10283
|
-
if (x.isZero())
|
|
10284
|
-
return one;
|
|
10259
|
+
if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);
|
|
10260
|
+
if (x.isZero()) return one;
|
|
10285
10261
|
pr = Ctor.precision;
|
|
10286
10262
|
rm = Ctor.rounding;
|
|
10287
10263
|
Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;
|
|
@@ -10304,8 +10280,7 @@ P.hyperbolicCosine = P.cosh = function() {
|
|
|
10304
10280
|
};
|
|
10305
10281
|
P.hyperbolicSine = P.sinh = function() {
|
|
10306
10282
|
var k, pr, rm, len, x = this, Ctor = x.constructor;
|
|
10307
|
-
if (!x.isFinite() || x.isZero())
|
|
10308
|
-
return new Ctor(x);
|
|
10283
|
+
if (!x.isFinite() || x.isZero()) return new Ctor(x);
|
|
10309
10284
|
pr = Ctor.precision;
|
|
10310
10285
|
rm = Ctor.rounding;
|
|
10311
10286
|
Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;
|
|
@@ -10330,10 +10305,8 @@ P.hyperbolicSine = P.sinh = function() {
|
|
|
10330
10305
|
};
|
|
10331
10306
|
P.hyperbolicTangent = P.tanh = function() {
|
|
10332
10307
|
var pr, rm, x = this, Ctor = x.constructor;
|
|
10333
|
-
if (!x.isFinite())
|
|
10334
|
-
|
|
10335
|
-
if (x.isZero())
|
|
10336
|
-
return new Ctor(x);
|
|
10308
|
+
if (!x.isFinite()) return new Ctor(x.s);
|
|
10309
|
+
if (x.isZero()) return new Ctor(x);
|
|
10337
10310
|
pr = Ctor.precision;
|
|
10338
10311
|
rm = Ctor.rounding;
|
|
10339
10312
|
Ctor.precision = pr + 7;
|
|
@@ -10345,8 +10318,7 @@ P.inverseCosine = P.acos = function() {
|
|
|
10345
10318
|
if (k !== -1) {
|
|
10346
10319
|
return k === 0 ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0) : new Ctor(NaN);
|
|
10347
10320
|
}
|
|
10348
|
-
if (x.isZero())
|
|
10349
|
-
return getPi(Ctor, pr + 4, rm).times(0.5);
|
|
10321
|
+
if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);
|
|
10350
10322
|
Ctor.precision = pr + 6;
|
|
10351
10323
|
Ctor.rounding = 1;
|
|
10352
10324
|
x = x.asin();
|
|
@@ -10357,10 +10329,8 @@ P.inverseCosine = P.acos = function() {
|
|
|
10357
10329
|
};
|
|
10358
10330
|
P.inverseHyperbolicCosine = P.acosh = function() {
|
|
10359
10331
|
var pr, rm, x = this, Ctor = x.constructor;
|
|
10360
|
-
if (x.lte(1))
|
|
10361
|
-
|
|
10362
|
-
if (!x.isFinite())
|
|
10363
|
-
return new Ctor(x);
|
|
10332
|
+
if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);
|
|
10333
|
+
if (!x.isFinite()) return new Ctor(x);
|
|
10364
10334
|
pr = Ctor.precision;
|
|
10365
10335
|
rm = Ctor.rounding;
|
|
10366
10336
|
Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;
|
|
@@ -10374,8 +10344,7 @@ P.inverseHyperbolicCosine = P.acosh = function() {
|
|
|
10374
10344
|
};
|
|
10375
10345
|
P.inverseHyperbolicSine = P.asinh = function() {
|
|
10376
10346
|
var pr, rm, x = this, Ctor = x.constructor;
|
|
10377
|
-
if (!x.isFinite() || x.isZero())
|
|
10378
|
-
return new Ctor(x);
|
|
10347
|
+
if (!x.isFinite() || x.isZero()) return new Ctor(x);
|
|
10379
10348
|
pr = Ctor.precision;
|
|
10380
10349
|
rm = Ctor.rounding;
|
|
10381
10350
|
Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;
|
|
@@ -10389,15 +10358,12 @@ P.inverseHyperbolicSine = P.asinh = function() {
|
|
|
10389
10358
|
};
|
|
10390
10359
|
P.inverseHyperbolicTangent = P.atanh = function() {
|
|
10391
10360
|
var pr, rm, wpr, xsd, x = this, Ctor = x.constructor;
|
|
10392
|
-
if (!x.isFinite())
|
|
10393
|
-
|
|
10394
|
-
if (x.e >= 0)
|
|
10395
|
-
return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);
|
|
10361
|
+
if (!x.isFinite()) return new Ctor(NaN);
|
|
10362
|
+
if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);
|
|
10396
10363
|
pr = Ctor.precision;
|
|
10397
10364
|
rm = Ctor.rounding;
|
|
10398
10365
|
xsd = x.sd();
|
|
10399
|
-
if (Math.max(xsd, pr) < 2 * -x.e - 1)
|
|
10400
|
-
return finalise(new Ctor(x), pr, rm, true);
|
|
10366
|
+
if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);
|
|
10401
10367
|
Ctor.precision = wpr = xsd - x.e;
|
|
10402
10368
|
x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);
|
|
10403
10369
|
Ctor.precision = pr + 4;
|
|
@@ -10409,8 +10375,7 @@ P.inverseHyperbolicTangent = P.atanh = function() {
|
|
|
10409
10375
|
};
|
|
10410
10376
|
P.inverseSine = P.asin = function() {
|
|
10411
10377
|
var halfPi, k, pr, rm, x = this, Ctor = x.constructor;
|
|
10412
|
-
if (x.isZero())
|
|
10413
|
-
return new Ctor(x);
|
|
10378
|
+
if (x.isZero()) return new Ctor(x);
|
|
10414
10379
|
k = x.abs().cmp(1);
|
|
10415
10380
|
pr = Ctor.precision;
|
|
10416
10381
|
rm = Ctor.rounding;
|
|
@@ -10432,8 +10397,7 @@ P.inverseSine = P.asin = function() {
|
|
|
10432
10397
|
P.inverseTangent = P.atan = function() {
|
|
10433
10398
|
var i, j, k, n2, px, t2, r, wpr, x2, x = this, Ctor = x.constructor, pr = Ctor.precision, rm = Ctor.rounding;
|
|
10434
10399
|
if (!x.isFinite()) {
|
|
10435
|
-
if (!x.s)
|
|
10436
|
-
return new Ctor(NaN);
|
|
10400
|
+
if (!x.s) return new Ctor(NaN);
|
|
10437
10401
|
if (pr + 4 <= PI_PRECISION) {
|
|
10438
10402
|
r = getPi(Ctor, pr + 4, rm).times(0.5);
|
|
10439
10403
|
r.s = x.s;
|
|
@@ -10449,8 +10413,7 @@ P.inverseTangent = P.atan = function() {
|
|
|
10449
10413
|
Ctor.precision = wpr = pr + 10;
|
|
10450
10414
|
Ctor.rounding = 1;
|
|
10451
10415
|
k = Math.min(28, wpr / LOG_BASE + 2 | 0);
|
|
10452
|
-
for (i = k; i; --i)
|
|
10453
|
-
x = x.div(x.times(x).plus(1).sqrt().plus(1));
|
|
10416
|
+
for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1));
|
|
10454
10417
|
external = false;
|
|
10455
10418
|
j = Math.ceil(wpr / LOG_BASE);
|
|
10456
10419
|
n2 = 1;
|
|
@@ -10462,12 +10425,9 @@ P.inverseTangent = P.atan = function() {
|
|
|
10462
10425
|
t2 = r.minus(px.div(n2 += 2));
|
|
10463
10426
|
px = px.times(x2);
|
|
10464
10427
|
r = t2.plus(px.div(n2 += 2));
|
|
10465
|
-
if (r.d[j] !== void 0)
|
|
10466
|
-
for (i = j; r.d[i] === t2.d[i] && i--; )
|
|
10467
|
-
;
|
|
10428
|
+
if (r.d[j] !== void 0) for (i = j; r.d[i] === t2.d[i] && i--; ) ;
|
|
10468
10429
|
}
|
|
10469
|
-
if (k)
|
|
10470
|
-
r = r.times(2 << k - 1);
|
|
10430
|
+
if (k) r = r.times(2 << k - 1);
|
|
10471
10431
|
external = true;
|
|
10472
10432
|
return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);
|
|
10473
10433
|
};
|
|
@@ -10503,8 +10463,7 @@ P.logarithm = P.log = function(base) {
|
|
|
10503
10463
|
} else {
|
|
10504
10464
|
base = new Ctor(base);
|
|
10505
10465
|
d = base.d;
|
|
10506
|
-
if (base.s < 0 || !d || !d[0] || base.eq(1))
|
|
10507
|
-
return new Ctor(NaN);
|
|
10466
|
+
if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);
|
|
10508
10467
|
isBase10 = base.eq(10);
|
|
10509
10468
|
}
|
|
10510
10469
|
d = arg.d;
|
|
@@ -10515,8 +10474,7 @@ P.logarithm = P.log = function(base) {
|
|
|
10515
10474
|
if (d.length > 1) {
|
|
10516
10475
|
inf = true;
|
|
10517
10476
|
} else {
|
|
10518
|
-
for (k = d[0]; k % 10 === 0; )
|
|
10519
|
-
k /= 10;
|
|
10477
|
+
for (k = d[0]; k % 10 === 0; ) k /= 10;
|
|
10520
10478
|
inf = k !== 1;
|
|
10521
10479
|
}
|
|
10522
10480
|
}
|
|
@@ -10546,12 +10504,9 @@ P.minus = P.sub = function(y) {
|
|
|
10546
10504
|
var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd, x = this, Ctor = x.constructor;
|
|
10547
10505
|
y = new Ctor(y);
|
|
10548
10506
|
if (!x.d || !y.d) {
|
|
10549
|
-
if (!x.s || !y.s)
|
|
10550
|
-
|
|
10551
|
-
else
|
|
10552
|
-
y.s = -y.s;
|
|
10553
|
-
else
|
|
10554
|
-
y = new Ctor(y.d || x.s !== y.s ? x : NaN);
|
|
10507
|
+
if (!x.s || !y.s) y = new Ctor(NaN);
|
|
10508
|
+
else if (x.d) y.s = -y.s;
|
|
10509
|
+
else y = new Ctor(y.d || x.s !== y.s ? x : NaN);
|
|
10555
10510
|
return y;
|
|
10556
10511
|
}
|
|
10557
10512
|
if (x.s != y.s) {
|
|
@@ -10563,12 +10518,9 @@ P.minus = P.sub = function(y) {
|
|
|
10563
10518
|
pr = Ctor.precision;
|
|
10564
10519
|
rm = Ctor.rounding;
|
|
10565
10520
|
if (!xd[0] || !yd[0]) {
|
|
10566
|
-
if (yd[0])
|
|
10567
|
-
|
|
10568
|
-
else
|
|
10569
|
-
y = new Ctor(x);
|
|
10570
|
-
else
|
|
10571
|
-
return new Ctor(rm === 3 ? -0 : 0);
|
|
10521
|
+
if (yd[0]) y.s = -y.s;
|
|
10522
|
+
else if (xd[0]) y = new Ctor(x);
|
|
10523
|
+
else return new Ctor(rm === 3 ? -0 : 0);
|
|
10572
10524
|
return external ? finalise(y, pr, rm) : y;
|
|
10573
10525
|
}
|
|
10574
10526
|
e = mathfloor(y.e / LOG_BASE);
|
|
@@ -10592,15 +10544,13 @@ P.minus = P.sub = function(y) {
|
|
|
10592
10544
|
d.length = 1;
|
|
10593
10545
|
}
|
|
10594
10546
|
d.reverse();
|
|
10595
|
-
for (i = k; i--; )
|
|
10596
|
-
d.push(0);
|
|
10547
|
+
for (i = k; i--; ) d.push(0);
|
|
10597
10548
|
d.reverse();
|
|
10598
10549
|
} else {
|
|
10599
10550
|
i = xd.length;
|
|
10600
10551
|
len = yd.length;
|
|
10601
10552
|
xLTy = i < len;
|
|
10602
|
-
if (xLTy)
|
|
10603
|
-
len = i;
|
|
10553
|
+
if (xLTy) len = i;
|
|
10604
10554
|
for (i = 0; i < len; i++) {
|
|
10605
10555
|
if (xd[i] != yd[i]) {
|
|
10606
10556
|
xLTy = xd[i] < yd[i];
|
|
@@ -10616,23 +10566,18 @@ P.minus = P.sub = function(y) {
|
|
|
10616
10566
|
y.s = -y.s;
|
|
10617
10567
|
}
|
|
10618
10568
|
len = xd.length;
|
|
10619
|
-
for (i = yd.length - len; i > 0; --i)
|
|
10620
|
-
xd[len++] = 0;
|
|
10569
|
+
for (i = yd.length - len; i > 0; --i) xd[len++] = 0;
|
|
10621
10570
|
for (i = yd.length; i > k; ) {
|
|
10622
10571
|
if (xd[--i] < yd[i]) {
|
|
10623
|
-
for (j = i; j && xd[--j] === 0; )
|
|
10624
|
-
xd[j] = BASE - 1;
|
|
10572
|
+
for (j = i; j && xd[--j] === 0; ) xd[j] = BASE - 1;
|
|
10625
10573
|
--xd[j];
|
|
10626
10574
|
xd[i] += BASE;
|
|
10627
10575
|
}
|
|
10628
10576
|
xd[i] -= yd[i];
|
|
10629
10577
|
}
|
|
10630
|
-
for (; xd[--len] === 0; )
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
--e;
|
|
10634
|
-
if (!xd[0])
|
|
10635
|
-
return new Ctor(rm === 3 ? -0 : 0);
|
|
10578
|
+
for (; xd[--len] === 0; ) xd.pop();
|
|
10579
|
+
for (; xd[0] === 0; xd.shift()) --e;
|
|
10580
|
+
if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);
|
|
10636
10581
|
y.d = xd;
|
|
10637
10582
|
y.e = getBase10Exponent(xd, e);
|
|
10638
10583
|
return external ? finalise(y, pr, rm) : y;
|
|
@@ -10640,8 +10585,7 @@ P.minus = P.sub = function(y) {
|
|
|
10640
10585
|
P.modulo = P.mod = function(y) {
|
|
10641
10586
|
var q, x = this, Ctor = x.constructor;
|
|
10642
10587
|
y = new Ctor(y);
|
|
10643
|
-
if (!x.d || !y.s || y.d && !y.d[0])
|
|
10644
|
-
return new Ctor(NaN);
|
|
10588
|
+
if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);
|
|
10645
10589
|
if (!y.d || x.d && !x.d[0]) {
|
|
10646
10590
|
return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);
|
|
10647
10591
|
}
|
|
@@ -10671,10 +10615,8 @@ P.plus = P.add = function(y) {
|
|
|
10671
10615
|
var carry, d, e, i, k, len, pr, rm, xd, yd, x = this, Ctor = x.constructor;
|
|
10672
10616
|
y = new Ctor(y);
|
|
10673
10617
|
if (!x.d || !y.d) {
|
|
10674
|
-
if (!x.s || !y.s)
|
|
10675
|
-
|
|
10676
|
-
else if (!x.d)
|
|
10677
|
-
y = new Ctor(y.d || x.s === y.s ? x : NaN);
|
|
10618
|
+
if (!x.s || !y.s) y = new Ctor(NaN);
|
|
10619
|
+
else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);
|
|
10678
10620
|
return y;
|
|
10679
10621
|
}
|
|
10680
10622
|
if (x.s != y.s) {
|
|
@@ -10686,8 +10628,7 @@ P.plus = P.add = function(y) {
|
|
|
10686
10628
|
pr = Ctor.precision;
|
|
10687
10629
|
rm = Ctor.rounding;
|
|
10688
10630
|
if (!xd[0] || !yd[0]) {
|
|
10689
|
-
if (!yd[0])
|
|
10690
|
-
y = new Ctor(x);
|
|
10631
|
+
if (!yd[0]) y = new Ctor(x);
|
|
10691
10632
|
return external ? finalise(y, pr, rm) : y;
|
|
10692
10633
|
}
|
|
10693
10634
|
k = mathfloor(x.e / LOG_BASE);
|
|
@@ -10711,8 +10652,7 @@ P.plus = P.add = function(y) {
|
|
|
10711
10652
|
d.length = 1;
|
|
10712
10653
|
}
|
|
10713
10654
|
d.reverse();
|
|
10714
|
-
for (; i--; )
|
|
10715
|
-
d.push(0);
|
|
10655
|
+
for (; i--; ) d.push(0);
|
|
10716
10656
|
d.reverse();
|
|
10717
10657
|
}
|
|
10718
10658
|
len = xd.length;
|
|
@@ -10731,20 +10671,17 @@ P.plus = P.add = function(y) {
|
|
|
10731
10671
|
xd.unshift(carry);
|
|
10732
10672
|
++e;
|
|
10733
10673
|
}
|
|
10734
|
-
for (len = xd.length; xd[--len] == 0; )
|
|
10735
|
-
xd.pop();
|
|
10674
|
+
for (len = xd.length; xd[--len] == 0; ) xd.pop();
|
|
10736
10675
|
y.d = xd;
|
|
10737
10676
|
y.e = getBase10Exponent(xd, e);
|
|
10738
10677
|
return external ? finalise(y, pr, rm) : y;
|
|
10739
10678
|
};
|
|
10740
10679
|
P.precision = P.sd = function(z) {
|
|
10741
10680
|
var k, x = this;
|
|
10742
|
-
if (z !== void 0 && z !== !!z && z !== 1 && z !== 0)
|
|
10743
|
-
throw Error(invalidArgument + z);
|
|
10681
|
+
if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);
|
|
10744
10682
|
if (x.d) {
|
|
10745
10683
|
k = getPrecision(x.d);
|
|
10746
|
-
if (z && x.e + 1 > k)
|
|
10747
|
-
k = x.e + 1;
|
|
10684
|
+
if (z && x.e + 1 > k) k = x.e + 1;
|
|
10748
10685
|
} else {
|
|
10749
10686
|
k = NaN;
|
|
10750
10687
|
}
|
|
@@ -10756,10 +10693,8 @@ P.round = function() {
|
|
|
10756
10693
|
};
|
|
10757
10694
|
P.sine = P.sin = function() {
|
|
10758
10695
|
var pr, rm, x = this, Ctor = x.constructor;
|
|
10759
|
-
if (!x.isFinite())
|
|
10760
|
-
|
|
10761
|
-
if (x.isZero())
|
|
10762
|
-
return new Ctor(x);
|
|
10696
|
+
if (!x.isFinite()) return new Ctor(NaN);
|
|
10697
|
+
if (x.isZero()) return new Ctor(x);
|
|
10763
10698
|
pr = Ctor.precision;
|
|
10764
10699
|
rm = Ctor.rounding;
|
|
10765
10700
|
Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;
|
|
@@ -10778,8 +10713,7 @@ P.squareRoot = P.sqrt = function() {
|
|
|
10778
10713
|
s = Math.sqrt(+x);
|
|
10779
10714
|
if (s == 0 || s == 1 / 0) {
|
|
10780
10715
|
n2 = digitsToString(d);
|
|
10781
|
-
if ((n2.length + e) % 2 == 0)
|
|
10782
|
-
n2 += "0";
|
|
10716
|
+
if ((n2.length + e) % 2 == 0) n2 += "0";
|
|
10783
10717
|
s = Math.sqrt(n2);
|
|
10784
10718
|
e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);
|
|
10785
10719
|
if (s == 1 / 0) {
|
|
@@ -10822,10 +10756,8 @@ P.squareRoot = P.sqrt = function() {
|
|
|
10822
10756
|
};
|
|
10823
10757
|
P.tangent = P.tan = function() {
|
|
10824
10758
|
var pr, rm, x = this, Ctor = x.constructor;
|
|
10825
|
-
if (!x.isFinite())
|
|
10826
|
-
|
|
10827
|
-
if (x.isZero())
|
|
10828
|
-
return new Ctor(x);
|
|
10759
|
+
if (!x.isFinite()) return new Ctor(NaN);
|
|
10760
|
+
if (x.isZero()) return new Ctor(x);
|
|
10829
10761
|
pr = Ctor.precision;
|
|
10830
10762
|
rm = Ctor.rounding;
|
|
10831
10763
|
Ctor.precision = pr + 10;
|
|
@@ -10856,8 +10788,7 @@ P.times = P.mul = function(y) {
|
|
|
10856
10788
|
}
|
|
10857
10789
|
r = [];
|
|
10858
10790
|
rL = xdL + ydL;
|
|
10859
|
-
for (i = rL; i--; )
|
|
10860
|
-
r.push(0);
|
|
10791
|
+
for (i = rL; i--; ) r.push(0);
|
|
10861
10792
|
for (i = ydL; --i >= 0; ) {
|
|
10862
10793
|
carry = 0;
|
|
10863
10794
|
for (k = xdL + i; k > i; ) {
|
|
@@ -10867,12 +10798,9 @@ P.times = P.mul = function(y) {
|
|
|
10867
10798
|
}
|
|
10868
10799
|
r[k] = (r[k] + carry) % BASE | 0;
|
|
10869
10800
|
}
|
|
10870
|
-
for (; !r[--rL]; )
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
++e;
|
|
10874
|
-
else
|
|
10875
|
-
r.shift();
|
|
10801
|
+
for (; !r[--rL]; ) r.pop();
|
|
10802
|
+
if (carry) ++e;
|
|
10803
|
+
else r.shift();
|
|
10876
10804
|
y.d = r;
|
|
10877
10805
|
y.e = getBase10Exponent(r, e);
|
|
10878
10806
|
return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;
|
|
@@ -10883,13 +10811,10 @@ P.toBinary = function(sd, rm) {
|
|
|
10883
10811
|
P.toDecimalPlaces = P.toDP = function(dp, rm) {
|
|
10884
10812
|
var x = this, Ctor = x.constructor;
|
|
10885
10813
|
x = new Ctor(x);
|
|
10886
|
-
if (dp === void 0)
|
|
10887
|
-
return x;
|
|
10814
|
+
if (dp === void 0) return x;
|
|
10888
10815
|
checkInt32(dp, 0, MAX_DIGITS);
|
|
10889
|
-
if (rm === void 0)
|
|
10890
|
-
|
|
10891
|
-
else
|
|
10892
|
-
checkInt32(rm, 0, 8);
|
|
10816
|
+
if (rm === void 0) rm = Ctor.rounding;
|
|
10817
|
+
else checkInt32(rm, 0, 8);
|
|
10893
10818
|
return finalise(x, dp + x.e + 1, rm);
|
|
10894
10819
|
};
|
|
10895
10820
|
P.toExponential = function(dp, rm) {
|
|
@@ -10898,10 +10823,8 @@ P.toExponential = function(dp, rm) {
|
|
|
10898
10823
|
str = finiteToString(x, true);
|
|
10899
10824
|
} else {
|
|
10900
10825
|
checkInt32(dp, 0, MAX_DIGITS);
|
|
10901
|
-
if (rm === void 0)
|
|
10902
|
-
|
|
10903
|
-
else
|
|
10904
|
-
checkInt32(rm, 0, 8);
|
|
10826
|
+
if (rm === void 0) rm = Ctor.rounding;
|
|
10827
|
+
else checkInt32(rm, 0, 8);
|
|
10905
10828
|
x = finalise(new Ctor(x), dp + 1, rm);
|
|
10906
10829
|
str = finiteToString(x, true, dp + 1);
|
|
10907
10830
|
}
|
|
@@ -10913,10 +10836,8 @@ P.toFixed = function(dp, rm) {
|
|
|
10913
10836
|
str = finiteToString(x);
|
|
10914
10837
|
} else {
|
|
10915
10838
|
checkInt32(dp, 0, MAX_DIGITS);
|
|
10916
|
-
if (rm === void 0)
|
|
10917
|
-
|
|
10918
|
-
else
|
|
10919
|
-
checkInt32(rm, 0, 8);
|
|
10839
|
+
if (rm === void 0) rm = Ctor.rounding;
|
|
10840
|
+
else checkInt32(rm, 0, 8);
|
|
10920
10841
|
y = finalise(new Ctor(x), dp + x.e + 1, rm);
|
|
10921
10842
|
str = finiteToString(y, false, dp + y.e + 1);
|
|
10922
10843
|
}
|
|
@@ -10924,8 +10845,7 @@ P.toFixed = function(dp, rm) {
|
|
|
10924
10845
|
};
|
|
10925
10846
|
P.toFraction = function(maxD) {
|
|
10926
10847
|
var d, d0, d1, d2, e, k, n2, n0, n1, pr, q, r, x = this, xd = x.d, Ctor = x.constructor;
|
|
10927
|
-
if (!xd)
|
|
10928
|
-
return new Ctor(x);
|
|
10848
|
+
if (!xd) return new Ctor(x);
|
|
10929
10849
|
n1 = d0 = new Ctor(1);
|
|
10930
10850
|
d1 = n0 = new Ctor(0);
|
|
10931
10851
|
d = new Ctor(d1);
|
|
@@ -10936,8 +10856,7 @@ P.toFraction = function(maxD) {
|
|
|
10936
10856
|
maxD = e > 0 ? d : n1;
|
|
10937
10857
|
} else {
|
|
10938
10858
|
n2 = new Ctor(maxD);
|
|
10939
|
-
if (!n2.isInt() || n2.lt(n1))
|
|
10940
|
-
throw Error(invalidArgument + n2);
|
|
10859
|
+
if (!n2.isInt() || n2.lt(n1)) throw Error(invalidArgument + n2);
|
|
10941
10860
|
maxD = n2.gt(d) ? e > 0 ? d : n1 : n2;
|
|
10942
10861
|
}
|
|
10943
10862
|
external = false;
|
|
@@ -10947,8 +10866,7 @@ P.toFraction = function(maxD) {
|
|
|
10947
10866
|
for (; ; ) {
|
|
10948
10867
|
q = divide(n2, d, 0, 1, 1);
|
|
10949
10868
|
d2 = d0.plus(q.times(d1));
|
|
10950
|
-
if (d2.cmp(maxD) == 1)
|
|
10951
|
-
break;
|
|
10869
|
+
if (d2.cmp(maxD) == 1) break;
|
|
10952
10870
|
d0 = d1;
|
|
10953
10871
|
d1 = d2;
|
|
10954
10872
|
d2 = n1;
|
|
@@ -10974,8 +10892,7 @@ P.toNearest = function(y, rm) {
|
|
|
10974
10892
|
var x = this, Ctor = x.constructor;
|
|
10975
10893
|
x = new Ctor(x);
|
|
10976
10894
|
if (y == null) {
|
|
10977
|
-
if (!x.d)
|
|
10978
|
-
return x;
|
|
10895
|
+
if (!x.d) return x;
|
|
10979
10896
|
y = new Ctor(1);
|
|
10980
10897
|
rm = Ctor.rounding;
|
|
10981
10898
|
} else {
|
|
@@ -10985,11 +10902,9 @@ P.toNearest = function(y, rm) {
|
|
|
10985
10902
|
} else {
|
|
10986
10903
|
checkInt32(rm, 0, 8);
|
|
10987
10904
|
}
|
|
10988
|
-
if (!x.d)
|
|
10989
|
-
return y.s ? x : y;
|
|
10905
|
+
if (!x.d) return y.s ? x : y;
|
|
10990
10906
|
if (!y.d) {
|
|
10991
|
-
if (y.s)
|
|
10992
|
-
y.s = x.s;
|
|
10907
|
+
if (y.s) y.s = x.s;
|
|
10993
10908
|
return y;
|
|
10994
10909
|
}
|
|
10995
10910
|
}
|
|
@@ -11012,15 +10927,12 @@ P.toOctal = function(sd, rm) {
|
|
|
11012
10927
|
};
|
|
11013
10928
|
P.toPower = P.pow = function(y) {
|
|
11014
10929
|
var e, k, pr, r, rm, s, x = this, Ctor = x.constructor, yn = +(y = new Ctor(y));
|
|
11015
|
-
if (!x.d || !y.d || !x.d[0] || !y.d[0])
|
|
11016
|
-
return new Ctor(mathpow(+x, yn));
|
|
10930
|
+
if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));
|
|
11017
10931
|
x = new Ctor(x);
|
|
11018
|
-
if (x.eq(1))
|
|
11019
|
-
return x;
|
|
10932
|
+
if (x.eq(1)) return x;
|
|
11020
10933
|
pr = Ctor.precision;
|
|
11021
10934
|
rm = Ctor.rounding;
|
|
11022
|
-
if (y.eq(1))
|
|
11023
|
-
return finalise(x, pr, rm);
|
|
10935
|
+
if (y.eq(1)) return finalise(x, pr, rm);
|
|
11024
10936
|
e = mathfloor(y.e / LOG_BASE);
|
|
11025
10937
|
if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {
|
|
11026
10938
|
r = intPow(Ctor, x, k, pr);
|
|
@@ -11028,10 +10940,8 @@ P.toPower = P.pow = function(y) {
|
|
|
11028
10940
|
}
|
|
11029
10941
|
s = x.s;
|
|
11030
10942
|
if (s < 0) {
|
|
11031
|
-
if (e < y.d.length - 1)
|
|
11032
|
-
|
|
11033
|
-
if ((y.d[e] & 1) == 0)
|
|
11034
|
-
s = 1;
|
|
10943
|
+
if (e < y.d.length - 1) return new Ctor(NaN);
|
|
10944
|
+
if ((y.d[e] & 1) == 0) s = 1;
|
|
11035
10945
|
if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {
|
|
11036
10946
|
x.s = s;
|
|
11037
10947
|
return x;
|
|
@@ -11039,8 +10949,7 @@ P.toPower = P.pow = function(y) {
|
|
|
11039
10949
|
}
|
|
11040
10950
|
k = mathpow(+x, yn);
|
|
11041
10951
|
e = k == 0 || !isFinite(k) ? mathfloor(yn * (Math.log("0." + digitsToString(x.d)) / Math.LN10 + x.e + 1)) : new Ctor(k + "").e;
|
|
11042
|
-
if (e > Ctor.maxE + 1 || e < Ctor.minE - 1)
|
|
11043
|
-
return new Ctor(e > 0 ? s / 0 : 0);
|
|
10952
|
+
if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);
|
|
11044
10953
|
external = false;
|
|
11045
10954
|
Ctor.rounding = x.s = 1;
|
|
11046
10955
|
k = Math.min(12, (e + "").length);
|
|
@@ -11066,10 +10975,8 @@ P.toPrecision = function(sd, rm) {
|
|
|
11066
10975
|
str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);
|
|
11067
10976
|
} else {
|
|
11068
10977
|
checkInt32(sd, 1, MAX_DIGITS);
|
|
11069
|
-
if (rm === void 0)
|
|
11070
|
-
|
|
11071
|
-
else
|
|
11072
|
-
checkInt32(rm, 0, 8);
|
|
10978
|
+
if (rm === void 0) rm = Ctor.rounding;
|
|
10979
|
+
else checkInt32(rm, 0, 8);
|
|
11073
10980
|
x = finalise(new Ctor(x), sd, rm);
|
|
11074
10981
|
str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);
|
|
11075
10982
|
}
|
|
@@ -11082,10 +10989,8 @@ P.toSignificantDigits = P.toSD = function(sd, rm) {
|
|
|
11082
10989
|
rm = Ctor.rounding;
|
|
11083
10990
|
} else {
|
|
11084
10991
|
checkInt32(sd, 1, MAX_DIGITS);
|
|
11085
|
-
if (rm === void 0)
|
|
11086
|
-
|
|
11087
|
-
else
|
|
11088
|
-
checkInt32(rm, 0, 8);
|
|
10992
|
+
if (rm === void 0) rm = Ctor.rounding;
|
|
10993
|
+
else checkInt32(rm, 0, 8);
|
|
11089
10994
|
}
|
|
11090
10995
|
return finalise(new Ctor(x), sd, rm);
|
|
11091
10996
|
};
|
|
@@ -11107,20 +11012,17 @@ function digitsToString(d) {
|
|
|
11107
11012
|
for (i = 1; i < indexOfLastWord; i++) {
|
|
11108
11013
|
ws = d[i] + "";
|
|
11109
11014
|
k = LOG_BASE - ws.length;
|
|
11110
|
-
if (k)
|
|
11111
|
-
str += getZeroString(k);
|
|
11015
|
+
if (k) str += getZeroString(k);
|
|
11112
11016
|
str += ws;
|
|
11113
11017
|
}
|
|
11114
11018
|
w = d[i];
|
|
11115
11019
|
ws = w + "";
|
|
11116
11020
|
k = LOG_BASE - ws.length;
|
|
11117
|
-
if (k)
|
|
11118
|
-
str += getZeroString(k);
|
|
11021
|
+
if (k) str += getZeroString(k);
|
|
11119
11022
|
} else if (w === 0) {
|
|
11120
11023
|
return "0";
|
|
11121
11024
|
}
|
|
11122
|
-
for (; w % 10 === 0; )
|
|
11123
|
-
w /= 10;
|
|
11025
|
+
for (; w % 10 === 0; ) w /= 10;
|
|
11124
11026
|
return str + w;
|
|
11125
11027
|
}
|
|
11126
11028
|
function checkInt32(i, min2, max2) {
|
|
@@ -11130,8 +11032,7 @@ function checkInt32(i, min2, max2) {
|
|
|
11130
11032
|
}
|
|
11131
11033
|
function checkRoundingDigits(d, i, rm, repeating) {
|
|
11132
11034
|
var di, k, r, rd;
|
|
11133
|
-
for (k = d[0]; k >= 10; k /= 10)
|
|
11134
|
-
--i;
|
|
11035
|
+
for (k = d[0]; k >= 10; k /= 10) --i;
|
|
11135
11036
|
if (--i < 0) {
|
|
11136
11037
|
i += LOG_BASE;
|
|
11137
11038
|
di = 0;
|
|
@@ -11143,22 +11044,17 @@ function checkRoundingDigits(d, i, rm, repeating) {
|
|
|
11143
11044
|
rd = d[di] % k | 0;
|
|
11144
11045
|
if (repeating == null) {
|
|
11145
11046
|
if (i < 3) {
|
|
11146
|
-
if (i == 0)
|
|
11147
|
-
|
|
11148
|
-
else if (i == 1)
|
|
11149
|
-
rd = rd / 10 | 0;
|
|
11047
|
+
if (i == 0) rd = rd / 100 | 0;
|
|
11048
|
+
else if (i == 1) rd = rd / 10 | 0;
|
|
11150
11049
|
r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 5e4 || rd == 0;
|
|
11151
11050
|
} else {
|
|
11152
11051
|
r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 || (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;
|
|
11153
11052
|
}
|
|
11154
11053
|
} else {
|
|
11155
11054
|
if (i < 4) {
|
|
11156
|
-
if (i == 0)
|
|
11157
|
-
|
|
11158
|
-
else if (i ==
|
|
11159
|
-
rd = rd / 100 | 0;
|
|
11160
|
-
else if (i == 2)
|
|
11161
|
-
rd = rd / 10 | 0;
|
|
11055
|
+
if (i == 0) rd = rd / 1e3 | 0;
|
|
11056
|
+
else if (i == 1) rd = rd / 100 | 0;
|
|
11057
|
+
else if (i == 2) rd = rd / 10 | 0;
|
|
11162
11058
|
r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;
|
|
11163
11059
|
} else {
|
|
11164
11060
|
r = ((repeating || rm < 4) && rd + 1 == k || !repeating && rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 1e3 | 0) == mathpow(10, i - 3) - 1;
|
|
@@ -11169,13 +11065,11 @@ function checkRoundingDigits(d, i, rm, repeating) {
|
|
|
11169
11065
|
function convertBase(str, baseIn, baseOut) {
|
|
11170
11066
|
var j, arr = [0], arrL, i = 0, strL = str.length;
|
|
11171
11067
|
for (; i < strL; ) {
|
|
11172
|
-
for (arrL = arr.length; arrL--; )
|
|
11173
|
-
arr[arrL] *= baseIn;
|
|
11068
|
+
for (arrL = arr.length; arrL--; ) arr[arrL] *= baseIn;
|
|
11174
11069
|
arr[0] += NUMERALS.indexOf(str.charAt(i++));
|
|
11175
11070
|
for (j = 0; j < arr.length; j++) {
|
|
11176
11071
|
if (arr[j] > baseOut - 1) {
|
|
11177
|
-
if (arr[j + 1] === void 0)
|
|
11178
|
-
arr[j + 1] = 0;
|
|
11072
|
+
if (arr[j + 1] === void 0) arr[j + 1] = 0;
|
|
11179
11073
|
arr[j + 1] += arr[j] / baseOut | 0;
|
|
11180
11074
|
arr[j] %= baseOut;
|
|
11181
11075
|
}
|
|
@@ -11185,8 +11079,7 @@ function convertBase(str, baseIn, baseOut) {
|
|
|
11185
11079
|
}
|
|
11186
11080
|
function cosine(Ctor, x) {
|
|
11187
11081
|
var k, len, y;
|
|
11188
|
-
if (x.isZero())
|
|
11189
|
-
return x;
|
|
11082
|
+
if (x.isZero()) return x;
|
|
11190
11083
|
len = x.d.length;
|
|
11191
11084
|
if (len < 32) {
|
|
11192
11085
|
k = Math.ceil(len / 3);
|
|
@@ -11204,7 +11097,7 @@ function cosine(Ctor, x) {
|
|
|
11204
11097
|
Ctor.precision -= k;
|
|
11205
11098
|
return x;
|
|
11206
11099
|
}
|
|
11207
|
-
var divide = function() {
|
|
11100
|
+
var divide = /* @__PURE__ */ function() {
|
|
11208
11101
|
function multiplyInteger(x, k, base) {
|
|
11209
11102
|
var temp, carry = 0, i = x.length;
|
|
11210
11103
|
for (x = x.slice(); i--; ) {
|
|
@@ -11212,8 +11105,7 @@ var divide = function() {
|
|
|
11212
11105
|
x[i] = temp % base | 0;
|
|
11213
11106
|
carry = temp / base | 0;
|
|
11214
11107
|
}
|
|
11215
|
-
if (carry)
|
|
11216
|
-
x.unshift(carry);
|
|
11108
|
+
if (carry) x.unshift(carry);
|
|
11217
11109
|
return x;
|
|
11218
11110
|
}
|
|
11219
11111
|
function compare(a, b, aL, bL) {
|
|
@@ -11237,8 +11129,7 @@ var divide = function() {
|
|
|
11237
11129
|
i = a[aL] < b[aL] ? 1 : 0;
|
|
11238
11130
|
a[aL] = i * base + a[aL] - b[aL];
|
|
11239
11131
|
}
|
|
11240
|
-
for (; !a[0] && a.length > 1; )
|
|
11241
|
-
a.shift();
|
|
11132
|
+
for (; !a[0] && a.length > 1; ) a.shift();
|
|
11242
11133
|
}
|
|
11243
11134
|
return function(x, y, pr, rm, dp, base) {
|
|
11244
11135
|
var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t2, xi, xL, yd0, yL, yz, Ctor = x.constructor, sign2 = x.s == y.s ? 1 : -1, xd = x.d, yd = y.d;
|
|
@@ -11263,10 +11154,8 @@ var divide = function() {
|
|
|
11263
11154
|
xL = xd.length;
|
|
11264
11155
|
q = new Ctor(sign2);
|
|
11265
11156
|
qd = q.d = [];
|
|
11266
|
-
for (i = 0; yd[i] == (xd[i] || 0); i++)
|
|
11267
|
-
|
|
11268
|
-
if (yd[i] > (xd[i] || 0))
|
|
11269
|
-
e--;
|
|
11157
|
+
for (i = 0; yd[i] == (xd[i] || 0); i++) ;
|
|
11158
|
+
if (yd[i] > (xd[i] || 0)) e--;
|
|
11270
11159
|
if (pr == null) {
|
|
11271
11160
|
sd = pr = Ctor.precision;
|
|
11272
11161
|
rm = Ctor.rounding;
|
|
@@ -11302,24 +11191,20 @@ var divide = function() {
|
|
|
11302
11191
|
xi = yL;
|
|
11303
11192
|
rem = xd.slice(0, yL);
|
|
11304
11193
|
remL = rem.length;
|
|
11305
|
-
for (; remL < yL; )
|
|
11306
|
-
rem[remL++] = 0;
|
|
11194
|
+
for (; remL < yL; ) rem[remL++] = 0;
|
|
11307
11195
|
yz = yd.slice();
|
|
11308
11196
|
yz.unshift(0);
|
|
11309
11197
|
yd0 = yd[0];
|
|
11310
|
-
if (yd[1] >= base / 2)
|
|
11311
|
-
++yd0;
|
|
11198
|
+
if (yd[1] >= base / 2) ++yd0;
|
|
11312
11199
|
do {
|
|
11313
11200
|
k = 0;
|
|
11314
11201
|
cmp = compare(yd, rem, yL, remL);
|
|
11315
11202
|
if (cmp < 0) {
|
|
11316
11203
|
rem0 = rem[0];
|
|
11317
|
-
if (yL != remL)
|
|
11318
|
-
rem0 = rem0 * base + (rem[1] || 0);
|
|
11204
|
+
if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
|
|
11319
11205
|
k = rem0 / yd0 | 0;
|
|
11320
11206
|
if (k > 1) {
|
|
11321
|
-
if (k >= base)
|
|
11322
|
-
k = base - 1;
|
|
11207
|
+
if (k >= base) k = base - 1;
|
|
11323
11208
|
prod = multiplyInteger(yd, k, base);
|
|
11324
11209
|
prodL = prod.length;
|
|
11325
11210
|
remL = rem.length;
|
|
@@ -11329,13 +11214,11 @@ var divide = function() {
|
|
|
11329
11214
|
subtract(prod, yL < prodL ? yz : yd, prodL, base);
|
|
11330
11215
|
}
|
|
11331
11216
|
} else {
|
|
11332
|
-
if (k == 0)
|
|
11333
|
-
cmp = k = 1;
|
|
11217
|
+
if (k == 0) cmp = k = 1;
|
|
11334
11218
|
prod = yd.slice();
|
|
11335
11219
|
}
|
|
11336
11220
|
prodL = prod.length;
|
|
11337
|
-
if (prodL < remL)
|
|
11338
|
-
prod.unshift(0);
|
|
11221
|
+
if (prodL < remL) prod.unshift(0);
|
|
11339
11222
|
subtract(rem, prod, remL, base);
|
|
11340
11223
|
if (cmp == -1) {
|
|
11341
11224
|
remL = rem.length;
|
|
@@ -11360,15 +11243,13 @@ var divide = function() {
|
|
|
11360
11243
|
} while ((xi++ < xL || rem[0] !== void 0) && sd--);
|
|
11361
11244
|
more = rem[0] !== void 0;
|
|
11362
11245
|
}
|
|
11363
|
-
if (!qd[0])
|
|
11364
|
-
qd.shift();
|
|
11246
|
+
if (!qd[0]) qd.shift();
|
|
11365
11247
|
}
|
|
11366
11248
|
if (logBase == 1) {
|
|
11367
11249
|
q.e = e;
|
|
11368
11250
|
inexact = more;
|
|
11369
11251
|
} else {
|
|
11370
|
-
for (i = 1, k = qd[0]; k >= 10; k /= 10)
|
|
11371
|
-
i++;
|
|
11252
|
+
for (i = 1, k = qd[0]; k >= 10; k /= 10) i++;
|
|
11372
11253
|
q.e = i + e * logBase - 1;
|
|
11373
11254
|
finalise(q, dp ? pr + q.e + 1 : pr, rm, more);
|
|
11374
11255
|
}
|
|
@@ -11377,91 +11258,81 @@ var divide = function() {
|
|
|
11377
11258
|
}();
|
|
11378
11259
|
function finalise(x, sd, rm, isTruncated) {
|
|
11379
11260
|
var digits, i, j, k, rd, roundUp, w, xd, xdi, Ctor = x.constructor;
|
|
11380
|
-
out:
|
|
11381
|
-
|
|
11382
|
-
|
|
11383
|
-
|
|
11384
|
-
|
|
11385
|
-
|
|
11386
|
-
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
for (; k++ <= xdi; )
|
|
11399
|
-
xd.push(0);
|
|
11400
|
-
w = rd = 0;
|
|
11401
|
-
digits = 1;
|
|
11402
|
-
i %= LOG_BASE;
|
|
11403
|
-
j = i - LOG_BASE + 1;
|
|
11404
|
-
} else {
|
|
11405
|
-
break out;
|
|
11406
|
-
}
|
|
11407
|
-
} else {
|
|
11408
|
-
w = k = xd[xdi];
|
|
11409
|
-
for (digits = 1; k >= 10; k /= 10)
|
|
11410
|
-
digits++;
|
|
11261
|
+
out: if (sd != null) {
|
|
11262
|
+
xd = x.d;
|
|
11263
|
+
if (!xd) return x;
|
|
11264
|
+
for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;
|
|
11265
|
+
i = sd - digits;
|
|
11266
|
+
if (i < 0) {
|
|
11267
|
+
i += LOG_BASE;
|
|
11268
|
+
j = sd;
|
|
11269
|
+
w = xd[xdi = 0];
|
|
11270
|
+
rd = w / mathpow(10, digits - j - 1) % 10 | 0;
|
|
11271
|
+
} else {
|
|
11272
|
+
xdi = Math.ceil((i + 1) / LOG_BASE);
|
|
11273
|
+
k = xd.length;
|
|
11274
|
+
if (xdi >= k) {
|
|
11275
|
+
if (isTruncated) {
|
|
11276
|
+
for (; k++ <= xdi; ) xd.push(0);
|
|
11277
|
+
w = rd = 0;
|
|
11278
|
+
digits = 1;
|
|
11411
11279
|
i %= LOG_BASE;
|
|
11412
|
-
j = i - LOG_BASE +
|
|
11413
|
-
rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;
|
|
11414
|
-
}
|
|
11415
|
-
}
|
|
11416
|
-
isTruncated = isTruncated || sd < 0 || xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));
|
|
11417
|
-
roundUp = rm < 4 ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
11418
|
-
(i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
11419
|
-
if (sd < 1 || !xd[0]) {
|
|
11420
|
-
xd.length = 0;
|
|
11421
|
-
if (roundUp) {
|
|
11422
|
-
sd -= x.e + 1;
|
|
11423
|
-
xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);
|
|
11424
|
-
x.e = -sd || 0;
|
|
11280
|
+
j = i - LOG_BASE + 1;
|
|
11425
11281
|
} else {
|
|
11426
|
-
|
|
11282
|
+
break out;
|
|
11427
11283
|
}
|
|
11428
|
-
return x;
|
|
11429
|
-
}
|
|
11430
|
-
if (i == 0) {
|
|
11431
|
-
xd.length = xdi;
|
|
11432
|
-
k = 1;
|
|
11433
|
-
xdi--;
|
|
11434
11284
|
} else {
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
|
|
11438
|
-
|
|
11285
|
+
w = k = xd[xdi];
|
|
11286
|
+
for (digits = 1; k >= 10; k /= 10) digits++;
|
|
11287
|
+
i %= LOG_BASE;
|
|
11288
|
+
j = i - LOG_BASE + digits;
|
|
11289
|
+
rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;
|
|
11290
|
+
}
|
|
11291
|
+
}
|
|
11292
|
+
isTruncated = isTruncated || sd < 0 || xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));
|
|
11293
|
+
roundUp = rm < 4 ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
11294
|
+
(i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
11295
|
+
if (sd < 1 || !xd[0]) {
|
|
11296
|
+
xd.length = 0;
|
|
11439
11297
|
if (roundUp) {
|
|
11440
|
-
|
|
11441
|
-
|
|
11442
|
-
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11447
|
-
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11298
|
+
sd -= x.e + 1;
|
|
11299
|
+
xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);
|
|
11300
|
+
x.e = -sd || 0;
|
|
11301
|
+
} else {
|
|
11302
|
+
xd[0] = x.e = 0;
|
|
11303
|
+
}
|
|
11304
|
+
return x;
|
|
11305
|
+
}
|
|
11306
|
+
if (i == 0) {
|
|
11307
|
+
xd.length = xdi;
|
|
11308
|
+
k = 1;
|
|
11309
|
+
xdi--;
|
|
11310
|
+
} else {
|
|
11311
|
+
xd.length = xdi + 1;
|
|
11312
|
+
k = mathpow(10, LOG_BASE - i);
|
|
11313
|
+
xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;
|
|
11314
|
+
}
|
|
11315
|
+
if (roundUp) {
|
|
11316
|
+
for (; ; ) {
|
|
11317
|
+
if (xdi == 0) {
|
|
11318
|
+
for (i = 1, j = xd[0]; j >= 10; j /= 10) i++;
|
|
11319
|
+
j = xd[0] += k;
|
|
11320
|
+
for (k = 1; j >= 10; j /= 10) k++;
|
|
11321
|
+
if (i != k) {
|
|
11322
|
+
x.e++;
|
|
11323
|
+
if (xd[0] == BASE) xd[0] = 1;
|
|
11459
11324
|
}
|
|
11325
|
+
break;
|
|
11326
|
+
} else {
|
|
11327
|
+
xd[xdi] += k;
|
|
11328
|
+
if (xd[xdi] != BASE) break;
|
|
11329
|
+
xd[xdi--] = 0;
|
|
11330
|
+
k = 1;
|
|
11460
11331
|
}
|
|
11461
11332
|
}
|
|
11462
|
-
for (i = xd.length; xd[--i] === 0; )
|
|
11463
|
-
xd.pop();
|
|
11464
11333
|
}
|
|
11334
|
+
for (i = xd.length; xd[--i] === 0; ) xd.pop();
|
|
11335
|
+
}
|
|
11465
11336
|
if (external) {
|
|
11466
11337
|
if (x.e > Ctor.maxE) {
|
|
11467
11338
|
x.d = null;
|
|
@@ -11474,8 +11345,7 @@ function finalise(x, sd, rm, isTruncated) {
|
|
|
11474
11345
|
return x;
|
|
11475
11346
|
}
|
|
11476
11347
|
function finiteToString(x, isExp, sd) {
|
|
11477
|
-
if (!x.isFinite())
|
|
11478
|
-
return nonFiniteToString(x);
|
|
11348
|
+
if (!x.isFinite()) return nonFiniteToString(x);
|
|
11479
11349
|
var k, e = x.e, str = digitsToString(x.d), len = str.length;
|
|
11480
11350
|
if (isExp) {
|
|
11481
11351
|
if (sd && (k = sd - len) > 0) {
|
|
@@ -11486,18 +11356,14 @@ function finiteToString(x, isExp, sd) {
|
|
|
11486
11356
|
str = str + (x.e < 0 ? "e" : "e+") + x.e;
|
|
11487
11357
|
} else if (e < 0) {
|
|
11488
11358
|
str = "0." + getZeroString(-e - 1) + str;
|
|
11489
|
-
if (sd && (k = sd - len) > 0)
|
|
11490
|
-
str += getZeroString(k);
|
|
11359
|
+
if (sd && (k = sd - len) > 0) str += getZeroString(k);
|
|
11491
11360
|
} else if (e >= len) {
|
|
11492
11361
|
str += getZeroString(e + 1 - len);
|
|
11493
|
-
if (sd && (k = sd - e - 1) > 0)
|
|
11494
|
-
str = str + "." + getZeroString(k);
|
|
11362
|
+
if (sd && (k = sd - e - 1) > 0) str = str + "." + getZeroString(k);
|
|
11495
11363
|
} else {
|
|
11496
|
-
if ((k = e + 1) < len)
|
|
11497
|
-
str = str.slice(0, k) + "." + str.slice(k);
|
|
11364
|
+
if ((k = e + 1) < len) str = str.slice(0, k) + "." + str.slice(k);
|
|
11498
11365
|
if (sd && (k = sd - len) > 0) {
|
|
11499
|
-
if (e + 1 === len)
|
|
11500
|
-
str += ".";
|
|
11366
|
+
if (e + 1 === len) str += ".";
|
|
11501
11367
|
str += getZeroString(k);
|
|
11502
11368
|
}
|
|
11503
11369
|
}
|
|
@@ -11505,39 +11371,33 @@ function finiteToString(x, isExp, sd) {
|
|
|
11505
11371
|
}
|
|
11506
11372
|
function getBase10Exponent(digits, e) {
|
|
11507
11373
|
var w = digits[0];
|
|
11508
|
-
for (e *= LOG_BASE; w >= 10; w /= 10)
|
|
11509
|
-
e++;
|
|
11374
|
+
for (e *= LOG_BASE; w >= 10; w /= 10) e++;
|
|
11510
11375
|
return e;
|
|
11511
11376
|
}
|
|
11512
11377
|
function getLn10(Ctor, sd, pr) {
|
|
11513
11378
|
if (sd > LN10_PRECISION) {
|
|
11514
11379
|
external = true;
|
|
11515
|
-
if (pr)
|
|
11516
|
-
Ctor.precision = pr;
|
|
11380
|
+
if (pr) Ctor.precision = pr;
|
|
11517
11381
|
throw Error(precisionLimitExceeded);
|
|
11518
11382
|
}
|
|
11519
11383
|
return finalise(new Ctor(LN10), sd, 1, true);
|
|
11520
11384
|
}
|
|
11521
11385
|
function getPi(Ctor, sd, rm) {
|
|
11522
|
-
if (sd > PI_PRECISION)
|
|
11523
|
-
throw Error(precisionLimitExceeded);
|
|
11386
|
+
if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);
|
|
11524
11387
|
return finalise(new Ctor(PI), sd, rm, true);
|
|
11525
11388
|
}
|
|
11526
11389
|
function getPrecision(digits) {
|
|
11527
11390
|
var w = digits.length - 1, len = w * LOG_BASE + 1;
|
|
11528
11391
|
w = digits[w];
|
|
11529
11392
|
if (w) {
|
|
11530
|
-
for (; w % 10 == 0; w /= 10)
|
|
11531
|
-
|
|
11532
|
-
for (w = digits[0]; w >= 10; w /= 10)
|
|
11533
|
-
len++;
|
|
11393
|
+
for (; w % 10 == 0; w /= 10) len--;
|
|
11394
|
+
for (w = digits[0]; w >= 10; w /= 10) len++;
|
|
11534
11395
|
}
|
|
11535
11396
|
return len;
|
|
11536
11397
|
}
|
|
11537
11398
|
function getZeroString(k) {
|
|
11538
11399
|
var zs = "";
|
|
11539
|
-
for (; k--; )
|
|
11540
|
-
zs += "0";
|
|
11400
|
+
for (; k--; ) zs += "0";
|
|
11541
11401
|
return zs;
|
|
11542
11402
|
}
|
|
11543
11403
|
function intPow(Ctor, x, n2, pr) {
|
|
@@ -11546,14 +11406,12 @@ function intPow(Ctor, x, n2, pr) {
|
|
|
11546
11406
|
for (; ; ) {
|
|
11547
11407
|
if (n2 % 2) {
|
|
11548
11408
|
r = r.times(x);
|
|
11549
|
-
if (truncate(r.d, k))
|
|
11550
|
-
isTruncated = true;
|
|
11409
|
+
if (truncate(r.d, k)) isTruncated = true;
|
|
11551
11410
|
}
|
|
11552
11411
|
n2 = mathfloor(n2 / 2);
|
|
11553
11412
|
if (n2 === 0) {
|
|
11554
11413
|
n2 = r.d.length - 1;
|
|
11555
|
-
if (isTruncated && r.d[n2] === 0)
|
|
11556
|
-
++r.d[n2];
|
|
11414
|
+
if (isTruncated && r.d[n2] === 0) ++r.d[n2];
|
|
11557
11415
|
break;
|
|
11558
11416
|
}
|
|
11559
11417
|
x = x.times(x);
|
|
@@ -11604,8 +11462,7 @@ function naturalExponential(x, sd) {
|
|
|
11604
11462
|
t2 = sum2.plus(divide(pow2, denominator, wpr, 1));
|
|
11605
11463
|
if (digitsToString(t2.d).slice(0, wpr) === digitsToString(sum2.d).slice(0, wpr)) {
|
|
11606
11464
|
j = k;
|
|
11607
|
-
while (j--)
|
|
11608
|
-
sum2 = finalise(sum2.times(sum2), wpr, 1);
|
|
11465
|
+
while (j--) sum2 = finalise(sum2.times(sum2), wpr, 1);
|
|
11609
11466
|
if (sd == null) {
|
|
11610
11467
|
if (rep < 3 && checkRoundingDigits(sum2.d, wpr - guard, rm, rep)) {
|
|
11611
11468
|
Ctor.precision = wpr += 10;
|
|
@@ -11666,8 +11523,7 @@ function naturalLogarithm(y, sd) {
|
|
|
11666
11523
|
t2 = sum2.plus(divide(numerator, new Ctor(denominator), wpr, 1));
|
|
11667
11524
|
if (digitsToString(t2.d).slice(0, wpr) === digitsToString(sum2.d).slice(0, wpr)) {
|
|
11668
11525
|
sum2 = sum2.times(2);
|
|
11669
|
-
if (e !== 0)
|
|
11670
|
-
sum2 = sum2.plus(getLn10(Ctor, wpr + 2, pr).times(e + ""));
|
|
11526
|
+
if (e !== 0) sum2 = sum2.plus(getLn10(Ctor, wpr + 2, pr).times(e + ""));
|
|
11671
11527
|
sum2 = divide(sum2, new Ctor(n2), wpr, 1);
|
|
11672
11528
|
if (sd == null) {
|
|
11673
11529
|
if (checkRoundingDigits(sum2.d, wpr - guard, rm, rep)) {
|
|
@@ -11692,40 +11548,32 @@ function nonFiniteToString(x) {
|
|
|
11692
11548
|
}
|
|
11693
11549
|
function parseDecimal(x, str) {
|
|
11694
11550
|
var e, i, len;
|
|
11695
|
-
if ((e = str.indexOf(".")) > -1)
|
|
11696
|
-
str = str.replace(".", "");
|
|
11551
|
+
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
11697
11552
|
if ((i = str.search(/e/i)) > 0) {
|
|
11698
|
-
if (e < 0)
|
|
11699
|
-
e = i;
|
|
11553
|
+
if (e < 0) e = i;
|
|
11700
11554
|
e += +str.slice(i + 1);
|
|
11701
11555
|
str = str.substring(0, i);
|
|
11702
11556
|
} else if (e < 0) {
|
|
11703
11557
|
e = str.length;
|
|
11704
11558
|
}
|
|
11705
|
-
for (i = 0; str.charCodeAt(i) === 48; i++)
|
|
11706
|
-
|
|
11707
|
-
for (len = str.length; str.charCodeAt(len - 1) === 48; --len)
|
|
11708
|
-
;
|
|
11559
|
+
for (i = 0; str.charCodeAt(i) === 48; i++) ;
|
|
11560
|
+
for (len = str.length; str.charCodeAt(len - 1) === 48; --len) ;
|
|
11709
11561
|
str = str.slice(i, len);
|
|
11710
11562
|
if (str) {
|
|
11711
11563
|
len -= i;
|
|
11712
11564
|
x.e = e = e - i - 1;
|
|
11713
11565
|
x.d = [];
|
|
11714
11566
|
i = (e + 1) % LOG_BASE;
|
|
11715
|
-
if (e < 0)
|
|
11716
|
-
i += LOG_BASE;
|
|
11567
|
+
if (e < 0) i += LOG_BASE;
|
|
11717
11568
|
if (i < len) {
|
|
11718
|
-
if (i)
|
|
11719
|
-
|
|
11720
|
-
for (len -= LOG_BASE; i < len; )
|
|
11721
|
-
x.d.push(+str.slice(i, i += LOG_BASE));
|
|
11569
|
+
if (i) x.d.push(+str.slice(0, i));
|
|
11570
|
+
for (len -= LOG_BASE; i < len; ) x.d.push(+str.slice(i, i += LOG_BASE));
|
|
11722
11571
|
str = str.slice(i);
|
|
11723
11572
|
i = LOG_BASE - str.length;
|
|
11724
11573
|
} else {
|
|
11725
11574
|
i -= len;
|
|
11726
11575
|
}
|
|
11727
|
-
for (; i--; )
|
|
11728
|
-
str += "0";
|
|
11576
|
+
for (; i--; ) str += "0";
|
|
11729
11577
|
x.d.push(+str);
|
|
11730
11578
|
if (external) {
|
|
11731
11579
|
if (x.e > x.constructor.maxE) {
|
|
@@ -11746,11 +11594,9 @@ function parseOther(x, str) {
|
|
|
11746
11594
|
var base, Ctor, divisor, i, isFloat, len, p, xd, xe;
|
|
11747
11595
|
if (str.indexOf("_") > -1) {
|
|
11748
11596
|
str = str.replace(/(\d)_(?=\d)/g, "$1");
|
|
11749
|
-
if (isDecimal.test(str))
|
|
11750
|
-
return parseDecimal(x, str);
|
|
11597
|
+
if (isDecimal.test(str)) return parseDecimal(x, str);
|
|
11751
11598
|
} else if (str === "Infinity" || str === "NaN") {
|
|
11752
|
-
if (!+str)
|
|
11753
|
-
x.s = NaN;
|
|
11599
|
+
if (!+str) x.s = NaN;
|
|
11754
11600
|
x.e = NaN;
|
|
11755
11601
|
x.d = null;
|
|
11756
11602
|
return x;
|
|
@@ -11783,17 +11629,13 @@ function parseOther(x, str) {
|
|
|
11783
11629
|
}
|
|
11784
11630
|
xd = convertBase(str, base, BASE);
|
|
11785
11631
|
xe = xd.length - 1;
|
|
11786
|
-
for (i = xe; xd[i] === 0; --i)
|
|
11787
|
-
|
|
11788
|
-
if (i < 0)
|
|
11789
|
-
return new Ctor(x.s * 0);
|
|
11632
|
+
for (i = xe; xd[i] === 0; --i) xd.pop();
|
|
11633
|
+
if (i < 0) return new Ctor(x.s * 0);
|
|
11790
11634
|
x.e = getBase10Exponent(xd, xe);
|
|
11791
11635
|
x.d = xd;
|
|
11792
11636
|
external = false;
|
|
11793
|
-
if (isFloat)
|
|
11794
|
-
|
|
11795
|
-
if (p)
|
|
11796
|
-
x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));
|
|
11637
|
+
if (isFloat) x = divide(x, divisor, len * 4);
|
|
11638
|
+
if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));
|
|
11797
11639
|
external = true;
|
|
11798
11640
|
return x;
|
|
11799
11641
|
}
|
|
@@ -11824,10 +11666,8 @@ function taylorSeries(Ctor, n2, x, y, isHyperbolic) {
|
|
|
11824
11666
|
y = divide(t2.times(x2), new Ctor(n2++ * n2++), pr, 1);
|
|
11825
11667
|
t2 = u.plus(y);
|
|
11826
11668
|
if (t2.d[k] !== void 0) {
|
|
11827
|
-
for (j = k; t2.d[j] === u.d[j] && j--; )
|
|
11828
|
-
|
|
11829
|
-
if (j == -1)
|
|
11830
|
-
break;
|
|
11669
|
+
for (j = k; t2.d[j] === u.d[j] && j--; ) ;
|
|
11670
|
+
if (j == -1) break;
|
|
11831
11671
|
}
|
|
11832
11672
|
j = u;
|
|
11833
11673
|
u = y;
|
|
@@ -11840,8 +11680,7 @@ function taylorSeries(Ctor, n2, x, y, isHyperbolic) {
|
|
|
11840
11680
|
}
|
|
11841
11681
|
function tinyPow(b, e) {
|
|
11842
11682
|
var n2 = b;
|
|
11843
|
-
while (--e)
|
|
11844
|
-
n2 *= b;
|
|
11683
|
+
while (--e) n2 *= b;
|
|
11845
11684
|
return n2;
|
|
11846
11685
|
}
|
|
11847
11686
|
function toLessThanHalfPi(Ctor, x) {
|
|
@@ -11868,10 +11707,8 @@ function toStringBinary(x, baseOut, sd, rm) {
|
|
|
11868
11707
|
var base, e, i, k, len, roundUp, str, xd, y, Ctor = x.constructor, isExp = sd !== void 0;
|
|
11869
11708
|
if (isExp) {
|
|
11870
11709
|
checkInt32(sd, 1, MAX_DIGITS);
|
|
11871
|
-
if (rm === void 0)
|
|
11872
|
-
|
|
11873
|
-
else
|
|
11874
|
-
checkInt32(rm, 0, 8);
|
|
11710
|
+
if (rm === void 0) rm = Ctor.rounding;
|
|
11711
|
+
else checkInt32(rm, 0, 8);
|
|
11875
11712
|
} else {
|
|
11876
11713
|
sd = Ctor.precision;
|
|
11877
11714
|
rm = Ctor.rounding;
|
|
@@ -11900,8 +11737,7 @@ function toStringBinary(x, baseOut, sd, rm) {
|
|
|
11900
11737
|
}
|
|
11901
11738
|
xd = convertBase(str, 10, base);
|
|
11902
11739
|
e = len = xd.length;
|
|
11903
|
-
for (; xd[--len] == 0; )
|
|
11904
|
-
xd.pop();
|
|
11740
|
+
for (; xd[--len] == 0; ) xd.pop();
|
|
11905
11741
|
if (!xd[0]) {
|
|
11906
11742
|
str = isExp ? "0p+0" : "0";
|
|
11907
11743
|
} else {
|
|
@@ -11930,36 +11766,27 @@ function toStringBinary(x, baseOut, sd, rm) {
|
|
|
11930
11766
|
}
|
|
11931
11767
|
}
|
|
11932
11768
|
}
|
|
11933
|
-
for (len = xd.length; !xd[len - 1]; --len)
|
|
11934
|
-
|
|
11935
|
-
for (i = 0, str = ""; i < len; i++)
|
|
11936
|
-
str += NUMERALS.charAt(xd[i]);
|
|
11769
|
+
for (len = xd.length; !xd[len - 1]; --len) ;
|
|
11770
|
+
for (i = 0, str = ""; i < len; i++) str += NUMERALS.charAt(xd[i]);
|
|
11937
11771
|
if (isExp) {
|
|
11938
11772
|
if (len > 1) {
|
|
11939
11773
|
if (baseOut == 16 || baseOut == 8) {
|
|
11940
11774
|
i = baseOut == 16 ? 4 : 3;
|
|
11941
|
-
for (--len; len % i; len++)
|
|
11942
|
-
str += "0";
|
|
11775
|
+
for (--len; len % i; len++) str += "0";
|
|
11943
11776
|
xd = convertBase(str, base, baseOut);
|
|
11944
|
-
for (len = xd.length; !xd[len - 1]; --len)
|
|
11945
|
-
|
|
11946
|
-
for (i = 1, str = "1."; i < len; i++)
|
|
11947
|
-
str += NUMERALS.charAt(xd[i]);
|
|
11777
|
+
for (len = xd.length; !xd[len - 1]; --len) ;
|
|
11778
|
+
for (i = 1, str = "1."; i < len; i++) str += NUMERALS.charAt(xd[i]);
|
|
11948
11779
|
} else {
|
|
11949
11780
|
str = str.charAt(0) + "." + str.slice(1);
|
|
11950
11781
|
}
|
|
11951
11782
|
}
|
|
11952
11783
|
str = str + (e < 0 ? "p" : "p+") + e;
|
|
11953
11784
|
} else if (e < 0) {
|
|
11954
|
-
for (; ++e; )
|
|
11955
|
-
str = "0" + str;
|
|
11785
|
+
for (; ++e; ) str = "0" + str;
|
|
11956
11786
|
str = "0." + str;
|
|
11957
11787
|
} else {
|
|
11958
|
-
if (++e > len)
|
|
11959
|
-
|
|
11960
|
-
str += "0";
|
|
11961
|
-
else if (e < len)
|
|
11962
|
-
str = str.slice(0, e) + "." + str.slice(e);
|
|
11788
|
+
if (++e > len) for (e -= len; e--; ) str += "0";
|
|
11789
|
+
else if (e < len) str = str.slice(0, e) + "." + str.slice(e);
|
|
11963
11790
|
}
|
|
11964
11791
|
}
|
|
11965
11792
|
str = (baseOut == 16 ? "0x" : baseOut == 2 ? "0b" : baseOut == 8 ? "0o" : "") + str;
|
|
@@ -12034,8 +11861,7 @@ function clamp(x, min2, max2) {
|
|
|
12034
11861
|
return new this(x).clamp(min2, max2);
|
|
12035
11862
|
}
|
|
12036
11863
|
function config(obj) {
|
|
12037
|
-
if (!obj || typeof obj !== "object")
|
|
12038
|
-
throw Error(decimalError + "Object expected");
|
|
11864
|
+
if (!obj || typeof obj !== "object") throw Error(decimalError + "Object expected");
|
|
12039
11865
|
var i, p, v, useDefaults = obj.defaults === true, ps = [
|
|
12040
11866
|
"precision",
|
|
12041
11867
|
1,
|
|
@@ -12060,17 +11886,13 @@ function config(obj) {
|
|
|
12060
11886
|
9
|
|
12061
11887
|
];
|
|
12062
11888
|
for (i = 0; i < ps.length; i += 3) {
|
|
12063
|
-
if (p = ps[i], useDefaults)
|
|
12064
|
-
this[p] = DEFAULTS[p];
|
|
11889
|
+
if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];
|
|
12065
11890
|
if ((v = obj[p]) !== void 0) {
|
|
12066
|
-
if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2])
|
|
12067
|
-
|
|
12068
|
-
else
|
|
12069
|
-
throw Error(invalidArgument + p + ": " + v);
|
|
11891
|
+
if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;
|
|
11892
|
+
else throw Error(invalidArgument + p + ": " + v);
|
|
12070
11893
|
}
|
|
12071
11894
|
}
|
|
12072
|
-
if (p = "crypto", useDefaults)
|
|
12073
|
-
this[p] = DEFAULTS[p];
|
|
11895
|
+
if (p = "crypto", useDefaults) this[p] = DEFAULTS[p];
|
|
12074
11896
|
if ((v = obj[p]) !== void 0) {
|
|
12075
11897
|
if (v === true || v === false || v === 0 || v === 1) {
|
|
12076
11898
|
if (v) {
|
|
@@ -12098,8 +11920,7 @@ function clone(obj) {
|
|
|
12098
11920
|
var i, p, ps;
|
|
12099
11921
|
function Decimal2(v) {
|
|
12100
11922
|
var e, i2, t2, x = this;
|
|
12101
|
-
if (!(x instanceof Decimal2))
|
|
12102
|
-
return new Decimal2(v);
|
|
11923
|
+
if (!(x instanceof Decimal2)) return new Decimal2(v);
|
|
12103
11924
|
x.constructor = Decimal2;
|
|
12104
11925
|
if (isDecimalInstance(v)) {
|
|
12105
11926
|
x.s = v.s;
|
|
@@ -12135,8 +11956,7 @@ function clone(obj) {
|
|
|
12135
11956
|
x.s = 1;
|
|
12136
11957
|
}
|
|
12137
11958
|
if (v === ~~v && v < 1e7) {
|
|
12138
|
-
for (e = 0, i2 = v; i2 >= 10; i2 /= 10)
|
|
12139
|
-
e++;
|
|
11959
|
+
for (e = 0, i2 = v; i2 >= 10; i2 /= 10) e++;
|
|
12140
11960
|
if (external) {
|
|
12141
11961
|
if (e > Decimal2.maxE) {
|
|
12142
11962
|
x.e = NaN;
|
|
@@ -12154,8 +11974,7 @@ function clone(obj) {
|
|
|
12154
11974
|
}
|
|
12155
11975
|
return;
|
|
12156
11976
|
} else if (v * 0 !== 0) {
|
|
12157
|
-
if (!v)
|
|
12158
|
-
x.s = NaN;
|
|
11977
|
+
if (!v) x.s = NaN;
|
|
12159
11978
|
x.e = NaN;
|
|
12160
11979
|
x.d = null;
|
|
12161
11980
|
return;
|
|
@@ -12168,8 +11987,7 @@ function clone(obj) {
|
|
|
12168
11987
|
v = v.slice(1);
|
|
12169
11988
|
x.s = -1;
|
|
12170
11989
|
} else {
|
|
12171
|
-
if (i2 === 43)
|
|
12172
|
-
v = v.slice(1);
|
|
11990
|
+
if (i2 === 43) v = v.slice(1);
|
|
12173
11991
|
x.s = 1;
|
|
12174
11992
|
}
|
|
12175
11993
|
return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);
|
|
@@ -12226,14 +12044,11 @@ function clone(obj) {
|
|
|
12226
12044
|
Decimal2.tan = tan;
|
|
12227
12045
|
Decimal2.tanh = tanh;
|
|
12228
12046
|
Decimal2.trunc = trunc;
|
|
12229
|
-
if (obj === void 0)
|
|
12230
|
-
obj = {};
|
|
12047
|
+
if (obj === void 0) obj = {};
|
|
12231
12048
|
if (obj) {
|
|
12232
12049
|
if (obj.defaults !== true) {
|
|
12233
12050
|
ps = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"];
|
|
12234
|
-
for (i = 0; i < ps.length; )
|
|
12235
|
-
if (!obj.hasOwnProperty(p = ps[i++]))
|
|
12236
|
-
obj[p] = this[p];
|
|
12051
|
+
for (i = 0; i < ps.length; ) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];
|
|
12237
12052
|
}
|
|
12238
12053
|
}
|
|
12239
12054
|
Decimal2.config(obj);
|
|
@@ -12298,14 +12113,11 @@ function pow(x, y) {
|
|
|
12298
12113
|
}
|
|
12299
12114
|
function random(sd) {
|
|
12300
12115
|
var d, e, k, n2, i = 0, r = new this(1), rd = [];
|
|
12301
|
-
if (sd === void 0)
|
|
12302
|
-
|
|
12303
|
-
else
|
|
12304
|
-
checkInt32(sd, 1, MAX_DIGITS);
|
|
12116
|
+
if (sd === void 0) sd = this.precision;
|
|
12117
|
+
else checkInt32(sd, 1, MAX_DIGITS);
|
|
12305
12118
|
k = Math.ceil(sd / LOG_BASE);
|
|
12306
12119
|
if (!this.crypto) {
|
|
12307
|
-
for (; i < k; )
|
|
12308
|
-
rd[i++] = Math.random() * 1e7 | 0;
|
|
12120
|
+
for (; i < k; ) rd[i++] = Math.random() * 1e7 | 0;
|
|
12309
12121
|
} else if (crypto.getRandomValues) {
|
|
12310
12122
|
d = crypto.getRandomValues(new Uint32Array(k));
|
|
12311
12123
|
for (; i < k; ) {
|
|
@@ -12337,19 +12149,15 @@ function random(sd) {
|
|
|
12337
12149
|
n2 = mathpow(10, LOG_BASE - sd);
|
|
12338
12150
|
rd[i] = (k / n2 | 0) * n2;
|
|
12339
12151
|
}
|
|
12340
|
-
for (; rd[i] === 0; i--)
|
|
12341
|
-
rd.pop();
|
|
12152
|
+
for (; rd[i] === 0; i--) rd.pop();
|
|
12342
12153
|
if (i < 0) {
|
|
12343
12154
|
e = 0;
|
|
12344
12155
|
rd = [0];
|
|
12345
12156
|
} else {
|
|
12346
12157
|
e = -1;
|
|
12347
|
-
for (; rd[0] === 0; e -= LOG_BASE)
|
|
12348
|
-
|
|
12349
|
-
|
|
12350
|
-
k++;
|
|
12351
|
-
if (k < LOG_BASE)
|
|
12352
|
-
e -= LOG_BASE - k;
|
|
12158
|
+
for (; rd[0] === 0; e -= LOG_BASE) rd.shift();
|
|
12159
|
+
for (k = 1, n2 = rd[0]; n2 >= 10; n2 /= 10) k++;
|
|
12160
|
+
if (k < LOG_BASE) e -= LOG_BASE - k;
|
|
12353
12161
|
}
|
|
12354
12162
|
r.e = e;
|
|
12355
12163
|
r.d = rd;
|
|
@@ -12377,8 +12185,7 @@ function sub(x, y) {
|
|
|
12377
12185
|
function sum() {
|
|
12378
12186
|
var i = 0, args = arguments, x = new this(args[i]);
|
|
12379
12187
|
external = false;
|
|
12380
|
-
for (; x.s && ++i < args.length; )
|
|
12381
|
-
x = x.plus(args[i]);
|
|
12188
|
+
for (; x.s && ++i < args.length; ) x = x.plus(args[i]);
|
|
12382
12189
|
external = true;
|
|
12383
12190
|
return finalise(x, this.precision, this.rounding);
|
|
12384
12191
|
}
|
|
@@ -12800,8 +12607,7 @@ const en = {
|
|
|
12800
12607
|
};
|
|
12801
12608
|
var padStart = function padStart2(string, length, pad) {
|
|
12802
12609
|
var s = String(string);
|
|
12803
|
-
if (!s || s.length >= length)
|
|
12804
|
-
return string;
|
|
12610
|
+
if (!s || s.length >= length) return string;
|
|
12805
12611
|
return "" + Array(length + 1 - s.length).join(pad) + string;
|
|
12806
12612
|
};
|
|
12807
12613
|
var padZoneStr = function padZoneStr2(instance) {
|
|
@@ -12812,8 +12618,7 @@ var padZoneStr = function padZoneStr2(instance) {
|
|
|
12812
12618
|
return (negMinutes <= 0 ? "+" : "-") + padStart(hourOffset, 2, "0") + ":" + padStart(minuteOffset, 2, "0");
|
|
12813
12619
|
};
|
|
12814
12620
|
var monthDiff = function monthDiff2(a, b) {
|
|
12815
|
-
if (a.date() < b.date())
|
|
12816
|
-
return -monthDiff2(b, a);
|
|
12621
|
+
if (a.date() < b.date()) return -monthDiff2(b, a);
|
|
12817
12622
|
var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month());
|
|
12818
12623
|
var anchor = a.clone().add(wholeMonthDiff, M);
|
|
12819
12624
|
var c = b - anchor < 0;
|
|
@@ -12857,8 +12662,7 @@ var isDayjs = function isDayjs2(d) {
|
|
|
12857
12662
|
};
|
|
12858
12663
|
var parseLocale = function parseLocale2(preset, object, isLocal) {
|
|
12859
12664
|
var l;
|
|
12860
|
-
if (!preset)
|
|
12861
|
-
return L;
|
|
12665
|
+
if (!preset) return L;
|
|
12862
12666
|
if (typeof preset === "string") {
|
|
12863
12667
|
var presetLower = preset.toLowerCase();
|
|
12864
12668
|
if (Ls[presetLower]) {
|
|
@@ -12877,8 +12681,7 @@ var parseLocale = function parseLocale2(preset, object, isLocal) {
|
|
|
12877
12681
|
Ls[name2] = preset;
|
|
12878
12682
|
l = name2;
|
|
12879
12683
|
}
|
|
12880
|
-
if (!isLocal && l)
|
|
12881
|
-
L = l;
|
|
12684
|
+
if (!isLocal && l) L = l;
|
|
12882
12685
|
return l || !isLocal && L;
|
|
12883
12686
|
};
|
|
12884
12687
|
var dayjs = function dayjs2(date, c) {
|
|
@@ -12905,12 +12708,9 @@ Utils.i = isDayjs;
|
|
|
12905
12708
|
Utils.w = wrapper;
|
|
12906
12709
|
var parseDate = function parseDate2(cfg) {
|
|
12907
12710
|
var date = cfg.date, utc = cfg.utc;
|
|
12908
|
-
if (date === null)
|
|
12909
|
-
|
|
12910
|
-
if (
|
|
12911
|
-
return /* @__PURE__ */ new Date();
|
|
12912
|
-
if (date instanceof Date)
|
|
12913
|
-
return new Date(date);
|
|
12711
|
+
if (date === null) return /* @__PURE__ */ new Date(NaN);
|
|
12712
|
+
if (Utils.u(date)) return /* @__PURE__ */ new Date();
|
|
12713
|
+
if (date instanceof Date) return new Date(date);
|
|
12914
12714
|
if (typeof date === "string" && !/Z$/i.test(date)) {
|
|
12915
12715
|
var d = date.match(REGEX_PARSE);
|
|
12916
12716
|
if (d) {
|
|
@@ -12963,8 +12763,7 @@ var Dayjs = /* @__PURE__ */ function() {
|
|
|
12963
12763
|
return this.endOf(units) < dayjs(that);
|
|
12964
12764
|
};
|
|
12965
12765
|
_proto.$g = function $g(input, get, set) {
|
|
12966
|
-
if (Utils.u(input))
|
|
12967
|
-
return this[get];
|
|
12766
|
+
if (Utils.u(input)) return this[get];
|
|
12968
12767
|
return this.set(set, input);
|
|
12969
12768
|
};
|
|
12970
12769
|
_proto.unix = function unix() {
|
|
@@ -13029,8 +12828,7 @@ var Dayjs = /* @__PURE__ */ function() {
|
|
|
13029
12828
|
date.$d[name2](arg);
|
|
13030
12829
|
date.init();
|
|
13031
12830
|
this.$d = date.set(DATE, Math.min(this.$D, date.daysInMonth())).$d;
|
|
13032
|
-
} else if (name2)
|
|
13033
|
-
this.$d[name2](arg);
|
|
12831
|
+
} else if (name2) this.$d[name2](arg);
|
|
13034
12832
|
this.init();
|
|
13035
12833
|
return this;
|
|
13036
12834
|
};
|
|
@@ -13070,8 +12868,7 @@ var Dayjs = /* @__PURE__ */ function() {
|
|
|
13070
12868
|
_proto.format = function format2(formatStr) {
|
|
13071
12869
|
var _this3 = this;
|
|
13072
12870
|
var locale = this.$locale();
|
|
13073
|
-
if (!this.isValid())
|
|
13074
|
-
return locale.invalidDate || INVALID_DATE_STRING;
|
|
12871
|
+
if (!this.isValid()) return locale.invalidDate || INVALID_DATE_STRING;
|
|
13075
12872
|
var str = formatStr || FORMAT_DEFAULT;
|
|
13076
12873
|
var zoneStr = Utils.z(this);
|
|
13077
12874
|
var $H = this.$H, $m = this.$m, $M = this.$M;
|
|
@@ -13137,12 +12934,10 @@ var Dayjs = /* @__PURE__ */ function() {
|
|
|
13137
12934
|
return Ls[this.$L];
|
|
13138
12935
|
};
|
|
13139
12936
|
_proto.locale = function locale(preset, object) {
|
|
13140
|
-
if (!preset)
|
|
13141
|
-
return this.$L;
|
|
12937
|
+
if (!preset) return this.$L;
|
|
13142
12938
|
var that = this.clone();
|
|
13143
12939
|
var nextLocaleName = parseLocale(preset, object, true);
|
|
13144
|
-
if (nextLocaleName)
|
|
13145
|
-
that.$L = nextLocaleName;
|
|
12940
|
+
if (nextLocaleName) that.$L = nextLocaleName;
|
|
13146
12941
|
return that;
|
|
13147
12942
|
};
|
|
13148
12943
|
_proto.clone = function clone2() {
|
|
@@ -13333,16 +13128,13 @@ const __sfc__$U = vue.defineComponent({
|
|
|
13333
13128
|
var _a;
|
|
13334
13129
|
const { date, type } = props2;
|
|
13335
13130
|
const { previewMonth, previewYear } = date;
|
|
13336
|
-
if (type === "year")
|
|
13337
|
-
|
|
13338
|
-
if (type === "month")
|
|
13339
|
-
return toNumber(previewYear) + forwardOrBackNum.value;
|
|
13131
|
+
if (type === "year") return previewYear;
|
|
13132
|
+
if (type === "month") return toNumber(previewYear) + forwardOrBackNum.value;
|
|
13340
13133
|
const monthName = (_a = (pt || t)("datePickerMonthDict")) == null ? void 0 : _a[previewMonth].name;
|
|
13341
13134
|
return (pt || t)("lang") === "zh-CN" ? `${previewYear} ${monthName}` : `${monthName} ${previewYear}`;
|
|
13342
13135
|
});
|
|
13343
13136
|
const checkDate = (checkType) => {
|
|
13344
|
-
if (checkType === "prev" && props2.disabled.left || checkType === "next" && props2.disabled.right)
|
|
13345
|
-
return;
|
|
13137
|
+
if (checkType === "prev" && props2.disabled.left || checkType === "next" && props2.disabled.right) return;
|
|
13346
13138
|
emit("check-date", checkType);
|
|
13347
13139
|
reverse.value = checkType === "prev";
|
|
13348
13140
|
forwardOrBackNum.value += checkType === "prev" ? -1 : 1;
|
|
@@ -13420,7 +13212,8 @@ function __render__$R(_ctx, _cache) {
|
|
|
13420
13212
|
type: "primary",
|
|
13421
13213
|
"var-month-picker-cover": "",
|
|
13422
13214
|
ripple: false,
|
|
13423
|
-
elevation: _ctx.componentProps.buttonElevation
|
|
13215
|
+
elevation: _ctx.componentProps.buttonElevation,
|
|
13216
|
+
ref_for: true
|
|
13424
13217
|
}, __spreadValues$i({}, _ctx.buttonProps(month)), {
|
|
13425
13218
|
onClick: (event) => _ctx.chooseMonth(month, event)
|
|
13426
13219
|
}), {
|
|
@@ -13506,10 +13299,8 @@ const __sfc__$T = vue.defineComponent({
|
|
|
13506
13299
|
let isBeforeMax = true;
|
|
13507
13300
|
let isAfterMin = true;
|
|
13508
13301
|
const previewDate = `${previewYear}-${key}`;
|
|
13509
|
-
if (max2)
|
|
13510
|
-
|
|
13511
|
-
if (min2)
|
|
13512
|
-
isAfterMin = dayjs(previewDate).isSameOrAfter(dayjs(min2), "month");
|
|
13302
|
+
if (max2) isBeforeMax = dayjs(previewDate).isSameOrBefore(dayjs(max2), "month");
|
|
13303
|
+
if (min2) isAfterMin = dayjs(previewDate).isSameOrAfter(dayjs(min2), "month");
|
|
13513
13304
|
return isBeforeMax && isAfterMin;
|
|
13514
13305
|
};
|
|
13515
13306
|
const shouldChoose = (val) => {
|
|
@@ -13518,14 +13309,12 @@ const __sfc__$T = vue.defineComponent({
|
|
|
13518
13309
|
componentProps: { type, range }
|
|
13519
13310
|
} = props2;
|
|
13520
13311
|
if (range) {
|
|
13521
|
-
if (!chooseRangeMonth.length)
|
|
13522
|
-
return false;
|
|
13312
|
+
if (!chooseRangeMonth.length) return false;
|
|
13523
13313
|
const isBeforeMax = dayjs(val).isSameOrBefore(dayjs(chooseRangeMonth[1]), "month");
|
|
13524
13314
|
const isAfterMin = dayjs(val).isSameOrAfter(dayjs(chooseRangeMonth[0]), "month");
|
|
13525
13315
|
return isBeforeMax && isAfterMin;
|
|
13526
13316
|
}
|
|
13527
|
-
if (type === "month")
|
|
13528
|
-
return chooseMonths.includes(val);
|
|
13317
|
+
if (type === "month") return chooseMonths.includes(val);
|
|
13529
13318
|
return chooseDays.some((value) => value.includes(val));
|
|
13530
13319
|
};
|
|
13531
13320
|
const buttonProps = (key) => {
|
|
@@ -13536,43 +13325,31 @@ const __sfc__$T = vue.defineComponent({
|
|
|
13536
13325
|
} = props2;
|
|
13537
13326
|
const val = `${previewYear}-${key}`;
|
|
13538
13327
|
const monthExist = () => {
|
|
13539
|
-
if (range || multiple)
|
|
13540
|
-
return shouldChoose(val);
|
|
13328
|
+
if (range || multiple) return shouldChoose(val);
|
|
13541
13329
|
return chooseMonth2 === key && isSameYear.value;
|
|
13542
13330
|
};
|
|
13543
13331
|
const computeDisabled = () => {
|
|
13544
|
-
if (!inRange(key))
|
|
13545
|
-
|
|
13546
|
-
if (!allowedDates)
|
|
13547
|
-
return false;
|
|
13332
|
+
if (!inRange(key)) return true;
|
|
13333
|
+
if (!allowedDates) return false;
|
|
13548
13334
|
return !allowedDates(val);
|
|
13549
13335
|
};
|
|
13550
13336
|
const disabled = computeDisabled();
|
|
13551
13337
|
const computeText = () => {
|
|
13552
|
-
if (disabled)
|
|
13553
|
-
|
|
13554
|
-
if (range || multiple)
|
|
13555
|
-
return !shouldChoose(val);
|
|
13338
|
+
if (disabled) return true;
|
|
13339
|
+
if (range || multiple) return !shouldChoose(val);
|
|
13556
13340
|
return !isSameYear.value || chooseMonth2 !== key;
|
|
13557
13341
|
};
|
|
13558
13342
|
const computeOutline = () => {
|
|
13559
|
-
if (!(isCurrentYear.value && currentMonth === key && props2.componentProps.showCurrent))
|
|
13560
|
-
|
|
13561
|
-
if (
|
|
13562
|
-
|
|
13563
|
-
if (range || multiple)
|
|
13564
|
-
return !shouldChoose(val);
|
|
13565
|
-
if (isSameYear.value)
|
|
13566
|
-
return chooseMonth2 !== currentMonth;
|
|
13343
|
+
if (!(isCurrentYear.value && currentMonth === key && props2.componentProps.showCurrent)) return false;
|
|
13344
|
+
if ((range || multiple || isSameYear.value) && disabled) return true;
|
|
13345
|
+
if (range || multiple) return !shouldChoose(val);
|
|
13346
|
+
if (isSameYear.value) return chooseMonth2 !== currentMonth;
|
|
13567
13347
|
return true;
|
|
13568
13348
|
};
|
|
13569
13349
|
const textColorOrCover = () => {
|
|
13570
|
-
if (disabled)
|
|
13571
|
-
|
|
13572
|
-
if (
|
|
13573
|
-
return color != null ? color : "";
|
|
13574
|
-
if (monthExist())
|
|
13575
|
-
return "";
|
|
13350
|
+
if (disabled) return "";
|
|
13351
|
+
if (computeOutline()) return color != null ? color : "";
|
|
13352
|
+
if (monthExist()) return "";
|
|
13576
13353
|
return `${nDate$2()}-color-cover`;
|
|
13577
13354
|
};
|
|
13578
13355
|
const isCover = textColorOrCover().startsWith(nDate$2());
|
|
@@ -13588,8 +13365,7 @@ const __sfc__$T = vue.defineComponent({
|
|
|
13588
13365
|
};
|
|
13589
13366
|
const chooseMonth = (month, event) => {
|
|
13590
13367
|
const buttonEl = event.currentTarget;
|
|
13591
|
-
if (buttonEl.classList.contains(n$S("button--disabled")))
|
|
13592
|
-
return;
|
|
13368
|
+
if (buttonEl.classList.contains(n$S("button--disabled"))) return;
|
|
13593
13369
|
emit("choose-month", month);
|
|
13594
13370
|
};
|
|
13595
13371
|
const checkDate = (checkType) => {
|
|
@@ -13606,10 +13382,8 @@ const __sfc__$T = vue.defineComponent({
|
|
|
13606
13382
|
const {
|
|
13607
13383
|
componentProps: { min: min2, max: max2 }
|
|
13608
13384
|
} = props2;
|
|
13609
|
-
if (max2)
|
|
13610
|
-
|
|
13611
|
-
if (min2)
|
|
13612
|
-
panelBtnDisabled.left = !dayjs(`${toNumber(year) - 1}`).isSameOrAfter(dayjs(min2), "year");
|
|
13385
|
+
if (max2) panelBtnDisabled.right = !dayjs(`${toNumber(year) + 1}`).isSameOrBefore(dayjs(max2), "year");
|
|
13386
|
+
if (min2) panelBtnDisabled.left = !dayjs(`${toNumber(year) - 1}`).isSameOrAfter(dayjs(min2), "year");
|
|
13613
13387
|
},
|
|
13614
13388
|
{ immediate: true }
|
|
13615
13389
|
);
|
|
@@ -13876,7 +13650,8 @@ function __render__$P(_ctx, _cache) {
|
|
|
13876
13650
|
type: "primary",
|
|
13877
13651
|
"var-year-picker-cover": "",
|
|
13878
13652
|
ripple: false,
|
|
13879
|
-
elevation: _ctx.componentProps.buttonElevation
|
|
13653
|
+
elevation: _ctx.componentProps.buttonElevation,
|
|
13654
|
+
ref_for: true
|
|
13880
13655
|
}, __spreadValues$h({}, _ctx.buttonProps(`${year}`)), {
|
|
13881
13656
|
onClick: (event) => _ctx.chooseYear(year, event)
|
|
13882
13657
|
}), {
|
|
@@ -13954,16 +13729,13 @@ const __sfc__$R = vue.defineComponent({
|
|
|
13954
13729
|
componentProps: { type, range }
|
|
13955
13730
|
} = props2;
|
|
13956
13731
|
if (range) {
|
|
13957
|
-
if (!chooseRangeYear.length)
|
|
13958
|
-
return false;
|
|
13732
|
+
if (!chooseRangeYear.length) return false;
|
|
13959
13733
|
const isBeforeMax = dayjs(val).isSameOrBefore(dayjs(chooseRangeYear[1]), "year");
|
|
13960
13734
|
const isAfterMin = dayjs(val).isSameOrAfter(dayjs(chooseRangeYear[0]), "year");
|
|
13961
13735
|
return isBeforeMax && isAfterMin;
|
|
13962
13736
|
}
|
|
13963
|
-
if (type === "year")
|
|
13964
|
-
|
|
13965
|
-
if (type === "month")
|
|
13966
|
-
return chooseMonths.some((value) => value.includes(val));
|
|
13737
|
+
if (type === "year") return chooseYears.includes(val);
|
|
13738
|
+
if (type === "month") return chooseMonths.some((value) => value.includes(val));
|
|
13967
13739
|
return chooseDays.some((value) => value.includes(val));
|
|
13968
13740
|
};
|
|
13969
13741
|
const inRange = (year) => {
|
|
@@ -13980,41 +13752,30 @@ const __sfc__$R = vue.defineComponent({
|
|
|
13980
13752
|
componentProps: { allowedDates, color, multiple, range }
|
|
13981
13753
|
} = props2;
|
|
13982
13754
|
const yearExist = () => {
|
|
13983
|
-
if (range || multiple)
|
|
13984
|
-
return shouldChoose(year);
|
|
13755
|
+
if (range || multiple) return shouldChoose(year);
|
|
13985
13756
|
return chooseYear2 === year;
|
|
13986
13757
|
};
|
|
13987
13758
|
const computeDisabled = () => {
|
|
13988
|
-
if (!inRange(year))
|
|
13989
|
-
|
|
13990
|
-
if (!allowedDates)
|
|
13991
|
-
return false;
|
|
13759
|
+
if (!inRange(year)) return true;
|
|
13760
|
+
if (!allowedDates) return false;
|
|
13992
13761
|
return !allowedDates(year);
|
|
13993
13762
|
};
|
|
13994
13763
|
const disabled = computeDisabled();
|
|
13995
13764
|
const computeText = () => {
|
|
13996
|
-
if (disabled)
|
|
13997
|
-
|
|
13998
|
-
if (range || multiple)
|
|
13999
|
-
return !shouldChoose(year);
|
|
13765
|
+
if (disabled) return true;
|
|
13766
|
+
if (range || multiple) return !shouldChoose(year);
|
|
14000
13767
|
return chooseYear2 !== year;
|
|
14001
13768
|
};
|
|
14002
13769
|
const computeOutline = () => {
|
|
14003
|
-
if (!(currentYear === year && props2.componentProps.showCurrent))
|
|
14004
|
-
|
|
14005
|
-
if (
|
|
14006
|
-
return true;
|
|
14007
|
-
if (range || multiple)
|
|
14008
|
-
return !shouldChoose(year);
|
|
13770
|
+
if (!(currentYear === year && props2.componentProps.showCurrent)) return false;
|
|
13771
|
+
if ((range || multiple) && disabled) return true;
|
|
13772
|
+
if (range || multiple) return !shouldChoose(year);
|
|
14009
13773
|
return chooseYear2 !== currentYear;
|
|
14010
13774
|
};
|
|
14011
13775
|
const textColorOrCover = () => {
|
|
14012
|
-
if (disabled)
|
|
14013
|
-
|
|
14014
|
-
if (
|
|
14015
|
-
return color != null ? color : "";
|
|
14016
|
-
if (yearExist())
|
|
14017
|
-
return "";
|
|
13776
|
+
if (disabled) return "";
|
|
13777
|
+
if (computeOutline()) return color != null ? color : "";
|
|
13778
|
+
if (yearExist()) return "";
|
|
14018
13779
|
return `${nDate$1()}-color-cover`;
|
|
14019
13780
|
};
|
|
14020
13781
|
const isCover = textColorOrCover().startsWith(nDate$1());
|
|
@@ -14030,8 +13791,7 @@ const __sfc__$R = vue.defineComponent({
|
|
|
14030
13791
|
};
|
|
14031
13792
|
const chooseYear = (year, event) => {
|
|
14032
13793
|
const buttonEl = event.currentTarget;
|
|
14033
|
-
if (buttonEl.classList.contains(n$Q("button--disabled")))
|
|
14034
|
-
return;
|
|
13794
|
+
if (buttonEl.classList.contains(n$Q("button--disabled"))) return;
|
|
14035
13795
|
emit("choose-year", year);
|
|
14036
13796
|
};
|
|
14037
13797
|
const scrollToView = () => {
|
|
@@ -14065,10 +13825,8 @@ const __sfc__$R = vue.defineComponent({
|
|
|
14065
13825
|
} = props2;
|
|
14066
13826
|
if (max2)
|
|
14067
13827
|
panelBtnDisabled.right = !dayjs(`${toNumber(list[list.length - 1])}`).isSameOrBefore(dayjs(max2), "year");
|
|
14068
|
-
if (min2)
|
|
14069
|
-
|
|
14070
|
-
if (toNumber(list[0] <= 0))
|
|
14071
|
-
panelBtnDisabled.left = false;
|
|
13828
|
+
if (min2) panelBtnDisabled.left = !dayjs(`${toNumber(list[0])}`).isSameOrAfter(dayjs(min2), "year");
|
|
13829
|
+
if (toNumber(list[0] <= 0)) panelBtnDisabled.left = false;
|
|
14072
13830
|
},
|
|
14073
13831
|
{
|
|
14074
13832
|
immediate: true
|
|
@@ -14183,7 +13941,8 @@ function __render__$O(_ctx, _cache) {
|
|
|
14183
13941
|
"var-day-picker-cover": "",
|
|
14184
13942
|
round: "",
|
|
14185
13943
|
ripple: false,
|
|
14186
|
-
elevation: _ctx.componentProps.buttonElevation
|
|
13944
|
+
elevation: _ctx.componentProps.buttonElevation,
|
|
13945
|
+
ref_for: true
|
|
14187
13946
|
}, __spreadValues$g({}, _ctx.buttonProps(day)), {
|
|
14188
13947
|
onClick: (event) => _ctx.chooseDay(day, event)
|
|
14189
13948
|
}), {
|
|
@@ -14309,10 +14068,8 @@ const __sfc__$Q = vue.defineComponent({
|
|
|
14309
14068
|
let isBeforeMax = true;
|
|
14310
14069
|
let isAfterMin = true;
|
|
14311
14070
|
const previewDate = `${previewYear}-${previewMonth}-${day}`;
|
|
14312
|
-
if (max2)
|
|
14313
|
-
|
|
14314
|
-
if (min2)
|
|
14315
|
-
isAfterMin = dayjs(previewDate).isSameOrAfter(dayjs(min2), "day");
|
|
14071
|
+
if (max2) isBeforeMax = dayjs(previewDate).isSameOrBefore(dayjs(max2), "day");
|
|
14072
|
+
if (min2) isAfterMin = dayjs(previewDate).isSameOrAfter(dayjs(min2), "day");
|
|
14316
14073
|
return isBeforeMax && isAfterMin;
|
|
14317
14074
|
};
|
|
14318
14075
|
const shouldChoose = (val) => {
|
|
@@ -14321,8 +14078,7 @@ const __sfc__$Q = vue.defineComponent({
|
|
|
14321
14078
|
componentProps: { range }
|
|
14322
14079
|
} = props2;
|
|
14323
14080
|
if (range) {
|
|
14324
|
-
if (!chooseRangeDay.length)
|
|
14325
|
-
return false;
|
|
14081
|
+
if (!chooseRangeDay.length) return false;
|
|
14326
14082
|
const isBeforeMax = dayjs(val).isSameOrBefore(dayjs(chooseRangeDay[1]), "day");
|
|
14327
14083
|
const isAfterMin = dayjs(val).isSameOrAfter(dayjs(chooseRangeDay[0]), "day");
|
|
14328
14084
|
return isBeforeMax && isAfterMin;
|
|
@@ -14346,43 +14102,31 @@ const __sfc__$Q = vue.defineComponent({
|
|
|
14346
14102
|
} = props2;
|
|
14347
14103
|
const val = `${previewYear}-${previewMonth}-${day}`;
|
|
14348
14104
|
const dayExist = () => {
|
|
14349
|
-
if (range || multiple)
|
|
14350
|
-
return shouldChoose(val);
|
|
14105
|
+
if (range || multiple) return shouldChoose(val);
|
|
14351
14106
|
return toNumber(chooseDay2) === day && isSame.value;
|
|
14352
14107
|
};
|
|
14353
14108
|
const computeDisabled = () => {
|
|
14354
|
-
if (!inRange(day))
|
|
14355
|
-
|
|
14356
|
-
if (!allowedDates)
|
|
14357
|
-
return false;
|
|
14109
|
+
if (!inRange(day)) return true;
|
|
14110
|
+
if (!allowedDates) return false;
|
|
14358
14111
|
return !allowedDates(val);
|
|
14359
14112
|
};
|
|
14360
14113
|
const disabled = computeDisabled();
|
|
14361
14114
|
const computeText = () => {
|
|
14362
|
-
if (disabled)
|
|
14363
|
-
|
|
14364
|
-
if (range || multiple)
|
|
14365
|
-
return !shouldChoose(val);
|
|
14115
|
+
if (disabled) return true;
|
|
14116
|
+
if (range || multiple) return !shouldChoose(val);
|
|
14366
14117
|
return !isSame.value || toNumber(chooseDay2) !== day;
|
|
14367
14118
|
};
|
|
14368
14119
|
const computeOutline = () => {
|
|
14369
|
-
if (!(isCurrent.value && toNumber(currentDay) === day && props2.componentProps.showCurrent))
|
|
14370
|
-
|
|
14371
|
-
if (
|
|
14372
|
-
|
|
14373
|
-
if (range || multiple)
|
|
14374
|
-
return !shouldChoose(val);
|
|
14375
|
-
if (isSame.value)
|
|
14376
|
-
return chooseDay2 !== currentDay;
|
|
14120
|
+
if (!(isCurrent.value && toNumber(currentDay) === day && props2.componentProps.showCurrent)) return false;
|
|
14121
|
+
if ((range || multiple || isSame.value) && disabled) return true;
|
|
14122
|
+
if (range || multiple) return !shouldChoose(val);
|
|
14123
|
+
if (isSame.value) return chooseDay2 !== currentDay;
|
|
14377
14124
|
return true;
|
|
14378
14125
|
};
|
|
14379
14126
|
const textColorOrCover = () => {
|
|
14380
|
-
if (disabled)
|
|
14381
|
-
|
|
14382
|
-
if (
|
|
14383
|
-
return color != null ? color : "";
|
|
14384
|
-
if (dayExist())
|
|
14385
|
-
return "";
|
|
14127
|
+
if (disabled) return "";
|
|
14128
|
+
if (computeOutline()) return color != null ? color : "";
|
|
14129
|
+
if (dayExist()) return "";
|
|
14386
14130
|
return `${nDate()}-color-cover`;
|
|
14387
14131
|
};
|
|
14388
14132
|
const isCover = textColorOrCover().startsWith(nDate());
|
|
@@ -14402,8 +14146,7 @@ const __sfc__$Q = vue.defineComponent({
|
|
|
14402
14146
|
};
|
|
14403
14147
|
const chooseDay = (day, event) => {
|
|
14404
14148
|
const buttonEl = event.currentTarget;
|
|
14405
|
-
if (buttonEl.classList.contains(n$P("button--disabled")))
|
|
14406
|
-
return;
|
|
14149
|
+
if (buttonEl.classList.contains(n$P("button--disabled"))) return;
|
|
14407
14150
|
emit("choose-day", day);
|
|
14408
14151
|
};
|
|
14409
14152
|
const forwardRef = (checkType) => {
|
|
@@ -14790,26 +14533,20 @@ const __sfc__$P = vue.defineComponent({
|
|
|
14790
14533
|
const formatRangeDays = chooseRangeDay.value.map((date) => dayjs(date).format("YYYY-MM-DD"));
|
|
14791
14534
|
return formatRangeDays.length ? `${formatRangeDays[0]} ~ ${formatRangeDays[1]}` : "";
|
|
14792
14535
|
}
|
|
14793
|
-
if (multiple)
|
|
14794
|
-
|
|
14795
|
-
if (!chooseYear.value || !chooseMonth.value || !chooseDay.value)
|
|
14796
|
-
return "";
|
|
14536
|
+
if (multiple) return `${chooseDays.value.length}${(pt || t)("datePickerSelected")}`;
|
|
14537
|
+
if (!chooseYear.value || !chooseMonth.value || !chooseDay.value) return "";
|
|
14797
14538
|
const weekIndex = dayjs(`${chooseYear.value}-${chooseMonth.value}-${chooseDay.value}`).day();
|
|
14798
14539
|
const week = WEEK_HEADER.find((value) => value === `${weekIndex}`);
|
|
14799
14540
|
const weekName = (_b = (_a = (pt || t)("datePickerWeekDict")) == null ? void 0 : _a[week].name) != null ? _b : "";
|
|
14800
14541
|
const monthName = (_d = (_c = (pt || t)("datePickerMonthDict")) == null ? void 0 : _c[chooseMonth.value].name) != null ? _d : "";
|
|
14801
14542
|
const showDay = padStart$1(chooseDay.value, 2, "0");
|
|
14802
|
-
if ((pt || t)("lang") === "zh-CN")
|
|
14803
|
-
return `${chooseMonth.value}-${showDay} ${weekName.slice(0, 3)}`;
|
|
14543
|
+
if ((pt || t)("lang") === "zh-CN") return `${chooseMonth.value}-${showDay} ${weekName.slice(0, 3)}`;
|
|
14804
14544
|
return `${weekName.slice(0, 3)}, ${monthName.slice(0, 3)} ${chooseDay.value}`;
|
|
14805
14545
|
});
|
|
14806
14546
|
const getPanelType = vue.computed(() => {
|
|
14807
|
-
if (props2.type === "year" || isYearPanel.value)
|
|
14808
|
-
|
|
14809
|
-
if (props2.type === "
|
|
14810
|
-
return "month";
|
|
14811
|
-
if (props2.type === "date")
|
|
14812
|
-
return "date";
|
|
14547
|
+
if (props2.type === "year" || isYearPanel.value) return "year";
|
|
14548
|
+
if (props2.type === "month" || isMonthPanel.value) return "month";
|
|
14549
|
+
if (props2.type === "date") return "date";
|
|
14813
14550
|
return "";
|
|
14814
14551
|
});
|
|
14815
14552
|
const isUntouchable = vue.computed(() => !props2.touchable || !getPanelType.value);
|
|
@@ -14836,16 +14573,13 @@ const __sfc__$P = vue.defineComponent({
|
|
|
14836
14573
|
vue.watch(
|
|
14837
14574
|
() => props2.modelValue,
|
|
14838
14575
|
(value) => {
|
|
14839
|
-
if (!checkValue() || invalidFormatDate(value) || !value)
|
|
14840
|
-
return;
|
|
14576
|
+
if (!checkValue() || invalidFormatDate(value) || !value) return;
|
|
14841
14577
|
if (props2.range) {
|
|
14842
|
-
if (!isArray(value))
|
|
14843
|
-
return;
|
|
14578
|
+
if (!isArray(value)) return;
|
|
14844
14579
|
rangeDone.value = value.length !== 1;
|
|
14845
14580
|
rangeInit(value, props2.type);
|
|
14846
14581
|
} else if (props2.multiple) {
|
|
14847
|
-
if (!isArray(value))
|
|
14848
|
-
return;
|
|
14582
|
+
if (!isArray(value)) return;
|
|
14849
14583
|
multipleInit(value, props2.type);
|
|
14850
14584
|
} else {
|
|
14851
14585
|
dateInit(value);
|
|
@@ -14855,18 +14589,15 @@ const __sfc__$P = vue.defineComponent({
|
|
|
14855
14589
|
);
|
|
14856
14590
|
vue.watch(getPanelType, resetState);
|
|
14857
14591
|
function clickEl(type) {
|
|
14858
|
-
if (type === "year")
|
|
14859
|
-
|
|
14860
|
-
else if (type === "month")
|
|
14861
|
-
isMonthPanel.value = true;
|
|
14592
|
+
if (type === "year") isYearPanel.value = true;
|
|
14593
|
+
else if (type === "month") isMonthPanel.value = true;
|
|
14862
14594
|
else {
|
|
14863
14595
|
isYearPanel.value = false;
|
|
14864
14596
|
isMonthPanel.value = false;
|
|
14865
14597
|
}
|
|
14866
14598
|
}
|
|
14867
14599
|
function handleTouchstart(event) {
|
|
14868
|
-
if (isUntouchable.value)
|
|
14869
|
-
return;
|
|
14600
|
+
if (isUntouchable.value) return;
|
|
14870
14601
|
const { clientX, clientY } = event.touches[0];
|
|
14871
14602
|
startX = clientX;
|
|
14872
14603
|
startY = clientY;
|
|
@@ -14875,8 +14606,7 @@ const __sfc__$P = vue.defineComponent({
|
|
|
14875
14606
|
return x >= y && x > 20 ? "x" : "y";
|
|
14876
14607
|
}
|
|
14877
14608
|
function handleTouchmove(event) {
|
|
14878
|
-
if (isUntouchable.value)
|
|
14879
|
-
return;
|
|
14609
|
+
if (isUntouchable.value) return;
|
|
14880
14610
|
const { clientX, clientY } = event.touches[0];
|
|
14881
14611
|
const x = clientX - startX;
|
|
14882
14612
|
const y = clientY - startY;
|
|
@@ -14885,8 +14615,7 @@ const __sfc__$P = vue.defineComponent({
|
|
|
14885
14615
|
}
|
|
14886
14616
|
function handleTouchend() {
|
|
14887
14617
|
return __async$a(this, null, function* () {
|
|
14888
|
-
if (isUntouchable.value || touchDirection !== "x")
|
|
14889
|
-
return;
|
|
14618
|
+
if (isUntouchable.value || touchDirection !== "x") return;
|
|
14890
14619
|
const componentRef = getPanelType.value === "year" ? yearPanelEl : getPanelType.value === "month" ? monthPanelEl : dayPanelEl;
|
|
14891
14620
|
yield doubleRaf();
|
|
14892
14621
|
componentRef.value.forwardRef(checkType);
|
|
@@ -14909,35 +14638,26 @@ const __sfc__$P = vue.defineComponent({
|
|
|
14909
14638
|
const formatType = type === "year" ? "YYYY" : type === "month" ? "YYYY-MM" : "YYYY-MM-DD";
|
|
14910
14639
|
const formatDates = multipleDates.value.map((date2) => dayjs(date2).format(formatType));
|
|
14911
14640
|
const index = formatDates.findIndex((choose) => choose === date);
|
|
14912
|
-
if (index === -1)
|
|
14913
|
-
|
|
14914
|
-
else
|
|
14915
|
-
formatDates.splice(index, 1);
|
|
14641
|
+
if (index === -1) formatDates.push(date);
|
|
14642
|
+
else formatDates.splice(index, 1);
|
|
14916
14643
|
call(props2["onUpdate:modelValue"], formatDates);
|
|
14917
14644
|
call(props2.onChange, formatDates);
|
|
14918
14645
|
}
|
|
14919
14646
|
function getReverse(dateType, date) {
|
|
14920
|
-
if (!chooseYear.value || !chooseMonth.value)
|
|
14921
|
-
|
|
14922
|
-
if (
|
|
14923
|
-
|
|
14924
|
-
if (dateType === "year")
|
|
14925
|
-
return date < toNumber(chooseYear.value);
|
|
14926
|
-
if (dateType === "month")
|
|
14927
|
-
return date < chooseMonth.value;
|
|
14647
|
+
if (!chooseYear.value || !chooseMonth.value) return false;
|
|
14648
|
+
if (!isSameYear.value) return chooseYear.value > previewYear.value;
|
|
14649
|
+
if (dateType === "year") return date < toNumber(chooseYear.value);
|
|
14650
|
+
if (dateType === "month") return date < chooseMonth.value;
|
|
14928
14651
|
return isSameMonth.value ? date < toNumber(chooseDay.value) : chooseMonth.value > previewMonth.value;
|
|
14929
14652
|
}
|
|
14930
14653
|
function getChooseDay(day) {
|
|
14931
14654
|
const { readonly, range, multiple, onChange, "onUpdate:modelValue": updateModelValue } = props2;
|
|
14932
|
-
if (day < 0 || readonly)
|
|
14933
|
-
return;
|
|
14655
|
+
if (day < 0 || readonly) return;
|
|
14934
14656
|
reverse.value = getReverse("day", day);
|
|
14935
14657
|
const date = `${previewYear.value}-${previewMonth.value}-${day}`;
|
|
14936
14658
|
const formatDate = dayjs(date).format("YYYY-MM-DD");
|
|
14937
|
-
if (range)
|
|
14938
|
-
|
|
14939
|
-
else if (multiple)
|
|
14940
|
-
updateMultiple(formatDate, "day");
|
|
14659
|
+
if (range) updateRange(formatDate, "day");
|
|
14660
|
+
else if (multiple) updateMultiple(formatDate, "day");
|
|
14941
14661
|
else {
|
|
14942
14662
|
call(updateModelValue, formatDate);
|
|
14943
14663
|
call(onChange, formatDate);
|
|
@@ -14948,10 +14668,8 @@ const __sfc__$P = vue.defineComponent({
|
|
|
14948
14668
|
reverse.value = getReverse("month", month);
|
|
14949
14669
|
if (type === "month" && !readonly) {
|
|
14950
14670
|
const date = `${previewYear.value}-${month}`;
|
|
14951
|
-
if (range)
|
|
14952
|
-
|
|
14953
|
-
else if (multiple)
|
|
14954
|
-
updateMultiple(date, "month");
|
|
14671
|
+
if (range) updateRange(date, "month");
|
|
14672
|
+
else if (multiple) updateMultiple(date, "month");
|
|
14955
14673
|
else {
|
|
14956
14674
|
call(updateModelValue, date);
|
|
14957
14675
|
call(onChange, date);
|
|
@@ -14971,10 +14689,8 @@ const __sfc__$P = vue.defineComponent({
|
|
|
14971
14689
|
const { type, readonly, range, multiple, onChange, onPreview, "onUpdate:modelValue": updateModelValue } = props2;
|
|
14972
14690
|
reverse.value = getReverse("year", year);
|
|
14973
14691
|
if (type === "year" && !readonly) {
|
|
14974
|
-
if (range)
|
|
14975
|
-
|
|
14976
|
-
else if (multiple)
|
|
14977
|
-
updateMultiple(`${year}`, "year");
|
|
14692
|
+
if (range) updateRange(`${year}`, "year");
|
|
14693
|
+
else if (multiple) updateMultiple(`${year}`, "year");
|
|
14978
14694
|
else {
|
|
14979
14695
|
call(updateModelValue, `${year}`);
|
|
14980
14696
|
call(onChange, `${year}`);
|
|
@@ -15025,8 +14741,7 @@ const __sfc__$P = vue.defineComponent({
|
|
|
15025
14741
|
return true;
|
|
15026
14742
|
}
|
|
15027
14743
|
function invalidFormatDate(date) {
|
|
15028
|
-
if (isArray(date))
|
|
15029
|
-
return false;
|
|
14744
|
+
if (isArray(date)) return false;
|
|
15030
14745
|
if (date === "Invalid Date") {
|
|
15031
14746
|
console.error('[Varlet] DatePicker: "modelValue" is an Invalid Date');
|
|
15032
14747
|
return true;
|
|
@@ -15038,8 +14753,7 @@ const __sfc__$P = vue.defineComponent({
|
|
|
15038
14753
|
const formatType = type === "year" ? "YYYY" : type === "month" ? "YYYY-MM" : "YYYY-MM-D";
|
|
15039
14754
|
const formatDateList = value.map((choose) => dayjs(choose).format(formatType)).slice(0, 2);
|
|
15040
14755
|
const isValid = rangeDate.value.some((date) => invalidFormatDate(date));
|
|
15041
|
-
if (isValid)
|
|
15042
|
-
return;
|
|
14756
|
+
if (isValid) return;
|
|
15043
14757
|
rangeDate.value = formatDateList;
|
|
15044
14758
|
const isChangeOrder = dayjs(rangeDate.value[0]).isAfter(rangeDate.value[1]);
|
|
15045
14759
|
if (rangeDate.value.length === 2 && isChangeOrder) {
|
|
@@ -15054,8 +14768,7 @@ const __sfc__$P = vue.defineComponent({
|
|
|
15054
14768
|
}
|
|
15055
14769
|
function dateInit(value) {
|
|
15056
14770
|
const formatDate = dayjs(value).format("YYYY-MM-D");
|
|
15057
|
-
if (invalidFormatDate(formatDate))
|
|
15058
|
-
return;
|
|
14771
|
+
if (invalidFormatDate(formatDate)) return;
|
|
15059
14772
|
const [yearValue, monthValue, dayValue] = formatDate.split("-");
|
|
15060
14773
|
const monthDes2 = MONTH_LIST.find((month) => month === monthValue);
|
|
15061
14774
|
chooseMonth.value = monthDes2;
|
|
@@ -16727,7 +16440,7 @@ const props$B = {
|
|
|
16727
16440
|
};
|
|
16728
16441
|
const { name: name$C, n: n$F, classes: classes$x } = createNamespace("image");
|
|
16729
16442
|
const _hoisted_1$l = ["alt", "title", "referrerpolicy", "lazy-loading", "lazy-error"];
|
|
16730
|
-
const _hoisted_2$
|
|
16443
|
+
const _hoisted_2$6 = ["alt", "title", "referrerpolicy", "src"];
|
|
16731
16444
|
function __render__$F(_ctx, _cache) {
|
|
16732
16445
|
var _a;
|
|
16733
16446
|
const _directive_lazy = vue.resolveDirective("lazy");
|
|
@@ -16770,7 +16483,7 @@ function __render__$F(_ctx, _cache) {
|
|
|
16770
16483
|
onLoad: _cache[2] || (_cache[2] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
|
|
16771
16484
|
onError: _cache[3] || (_cache[3] = (...args) => _ctx.handleError && _ctx.handleError(...args)),
|
|
16772
16485
|
onClick: _cache[4] || (_cache[4] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
16773
|
-
}, null, 46, _hoisted_2$
|
|
16486
|
+
}, null, 46, _hoisted_2$6)) : vue.createCommentVNode("v-if", true),
|
|
16774
16487
|
_ctx.showErrorSlot ? vue.renderSlot(_ctx.$slots, "error", { key: 2 }) : vue.createCommentVNode("v-if", true)
|
|
16775
16488
|
],
|
|
16776
16489
|
6
|
|
@@ -17501,7 +17214,7 @@ const ANIMATION_DURATION = 200;
|
|
|
17501
17214
|
const LONG_PRESS_DELAY = 500;
|
|
17502
17215
|
const BASE_RATIO = 1;
|
|
17503
17216
|
const _hoisted_1$i = ["onTouchstart"];
|
|
17504
|
-
const _hoisted_2$
|
|
17217
|
+
const _hoisted_2$5 = ["src", "alt"];
|
|
17505
17218
|
function __render__$C(_ctx, _cache) {
|
|
17506
17219
|
const _component_var_swipe_item = vue.resolveComponent("var-swipe-item");
|
|
17507
17220
|
const _component_var_swipe = vue.resolveComponent("var-swipe");
|
|
@@ -17564,7 +17277,7 @@ function __render__$C(_ctx, _cache) {
|
|
|
17564
17277
|
class: vue.normalizeClass(_ctx.classes(_ctx.n("image"), [_ctx.isPreventDefault, _ctx.n("--prevent")])),
|
|
17565
17278
|
src: image,
|
|
17566
17279
|
alt: image
|
|
17567
|
-
}, null, 10, _hoisted_2$
|
|
17280
|
+
}, null, 10, _hoisted_2$5)
|
|
17568
17281
|
], 46, _hoisted_1$i)
|
|
17569
17282
|
]),
|
|
17570
17283
|
_: 2
|
|
@@ -18129,8 +17842,7 @@ const __sfc__$C = vue.defineComponent({
|
|
|
18129
17842
|
removeScrollerListener();
|
|
18130
17843
|
});
|
|
18131
17844
|
vue.onActivated(() => {
|
|
18132
|
-
if (!isDeactivated || active.value === void 0)
|
|
18133
|
-
return;
|
|
17845
|
+
if (!isDeactivated || active.value === void 0) return;
|
|
18134
17846
|
anchorClick({
|
|
18135
17847
|
anchorName: active.value,
|
|
18136
17848
|
options: { event: false }
|
|
@@ -18140,8 +17852,7 @@ const __sfc__$C = vue.defineComponent({
|
|
|
18140
17852
|
bindIndexAnchors(indexBarProvider);
|
|
18141
17853
|
function emitEvent(anchor, options) {
|
|
18142
17854
|
const anchorName = isPlainObject(anchor) ? anchor.name.value : anchor;
|
|
18143
|
-
if (anchorName === active.value || anchorName === void 0)
|
|
18144
|
-
return;
|
|
17855
|
+
if (anchorName === active.value || anchorName === void 0) return;
|
|
18145
17856
|
active.value = anchorName;
|
|
18146
17857
|
if ((options == null ? void 0 : options.event) !== false) {
|
|
18147
17858
|
call(props2.onChange, anchorName);
|
|
@@ -19371,8 +19082,7 @@ const __sfc__$x = vue.defineComponent({
|
|
|
19371
19082
|
simpleCurrentValue.value = `${newCurrent}`;
|
|
19372
19083
|
if (newCount - 2 > maxPagerCount) {
|
|
19373
19084
|
if (oldCurrent === void 0 || newCount !== oldCount) {
|
|
19374
|
-
for (let i = 2; i < maxPagerCount + 2; i++)
|
|
19375
|
-
list.push(i);
|
|
19085
|
+
for (let i = 2; i < maxPagerCount + 2; i++) list.push(i);
|
|
19376
19086
|
}
|
|
19377
19087
|
if (newCurrent <= maxPagerCount && newCurrent < rEllipseSign) {
|
|
19378
19088
|
list = [];
|
|
@@ -19400,8 +19110,7 @@ const __sfc__$x = vue.defineComponent({
|
|
|
19400
19110
|
}
|
|
19401
19111
|
list = [1, "...", ...list, "...", newCount];
|
|
19402
19112
|
} else {
|
|
19403
|
-
for (let i = 1; i <= newCount; i++)
|
|
19404
|
-
list.push(i);
|
|
19113
|
+
for (let i = 1; i <= newCount; i++) list.push(i);
|
|
19405
19114
|
}
|
|
19406
19115
|
pageList.value = list;
|
|
19407
19116
|
if (oldCurrent != null && newCount > 0) {
|
|
@@ -19415,13 +19124,11 @@ const __sfc__$x = vue.defineComponent({
|
|
|
19415
19124
|
}
|
|
19416
19125
|
);
|
|
19417
19126
|
function isHideEllipsis(item, index) {
|
|
19418
|
-
if (isNumber(item))
|
|
19419
|
-
return false;
|
|
19127
|
+
if (isNumber(item)) return false;
|
|
19420
19128
|
return index === 1 ? isHideEllipsisHead.value : isHideEllipsisTail.value;
|
|
19421
19129
|
}
|
|
19422
19130
|
function getMode(item, index) {
|
|
19423
|
-
if (isNumber(item))
|
|
19424
|
-
return "basic";
|
|
19131
|
+
if (isNumber(item)) return "basic";
|
|
19425
19132
|
return index === 1 ? "head" : "tail";
|
|
19426
19133
|
}
|
|
19427
19134
|
function clickItem(item, index) {
|
|
@@ -19647,8 +19354,8 @@ const TRANSITION_DURATION = 200;
|
|
|
19647
19354
|
const MOMENTUM_TRANSITION_DURATION = 1e3;
|
|
19648
19355
|
let sid$1 = 0;
|
|
19649
19356
|
const _hoisted_1$e = ["onTouchstartPassive", "onTouchmove", "onTouchend"];
|
|
19650
|
-
const _hoisted_2$
|
|
19651
|
-
const _hoisted_3$
|
|
19357
|
+
const _hoisted_2$4 = ["onTransitionend"];
|
|
19358
|
+
const _hoisted_3$3 = ["onClick"];
|
|
19652
19359
|
function __render__$u(_ctx, _cache) {
|
|
19653
19360
|
const _component_var_button = vue.resolveComponent("var-button");
|
|
19654
19361
|
return vue.openBlock(), vue.createBlock(
|
|
@@ -19798,12 +19505,12 @@ function __render__$u(_ctx, _cache) {
|
|
|
19798
19505
|
3
|
|
19799
19506
|
/* TEXT, CLASS */
|
|
19800
19507
|
)
|
|
19801
|
-
], 14, _hoisted_3$
|
|
19508
|
+
], 14, _hoisted_3$3);
|
|
19802
19509
|
}),
|
|
19803
19510
|
128
|
|
19804
19511
|
/* KEYED_FRAGMENT */
|
|
19805
19512
|
))
|
|
19806
|
-
], 46, _hoisted_2$
|
|
19513
|
+
], 46, _hoisted_2$4)
|
|
19807
19514
|
], 42, _hoisted_1$e);
|
|
19808
19515
|
}),
|
|
19809
19516
|
128
|
|
@@ -20243,9 +19950,9 @@ const RADIUS = 20;
|
|
|
20243
19950
|
const CIRCUMFERENCE = 2 * Math.PI * RADIUS;
|
|
20244
19951
|
const { name: name$n, n: n$q, classes: classes$l } = createNamespace("progress");
|
|
20245
19952
|
const _hoisted_1$d = ["aria-valuenow"];
|
|
20246
|
-
const _hoisted_2$
|
|
20247
|
-
const _hoisted_3$
|
|
20248
|
-
const _hoisted_4$
|
|
19953
|
+
const _hoisted_2$3 = ["viewBox"];
|
|
19954
|
+
const _hoisted_3$2 = { key: 0 };
|
|
19955
|
+
const _hoisted_4$2 = ["id"];
|
|
20249
19956
|
const _hoisted_5$1 = ["offset", "stop-color"];
|
|
20250
19957
|
const _hoisted_6$1 = ["d", "stroke-width", "stroke-dasharray"];
|
|
20251
19958
|
const _hoisted_7 = ["d", "stroke-width", "stroke-dasharray", "stroke-dashoffset"];
|
|
@@ -20350,7 +20057,7 @@ function __render__$t(_ctx, _cache) {
|
|
|
20350
20057
|
class: vue.normalizeClass(_ctx.n("circle-svg")),
|
|
20351
20058
|
viewBox: _ctx.circleProps.viewBox
|
|
20352
20059
|
}, [
|
|
20353
|
-
_ctx.isPlainObject(_ctx.color) ? (vue.openBlock(), vue.createElementBlock("defs", _hoisted_3$
|
|
20060
|
+
_ctx.isPlainObject(_ctx.color) ? (vue.openBlock(), vue.createElementBlock("defs", _hoisted_3$2, [
|
|
20354
20061
|
vue.createElementVNode("linearGradient", {
|
|
20355
20062
|
id: _ctx.id,
|
|
20356
20063
|
x1: "100%",
|
|
@@ -20371,7 +20078,7 @@ function __render__$t(_ctx, _cache) {
|
|
|
20371
20078
|
128
|
|
20372
20079
|
/* KEYED_FRAGMENT */
|
|
20373
20080
|
))
|
|
20374
|
-
], 8, _hoisted_4$
|
|
20081
|
+
], 8, _hoisted_4$2)
|
|
20375
20082
|
])) : vue.createCommentVNode("v-if", true),
|
|
20376
20083
|
_ctx.track ? (vue.openBlock(), vue.createElementBlock("path", {
|
|
20377
20084
|
key: 1,
|
|
@@ -20397,7 +20104,7 @@ function __render__$t(_ctx, _cache) {
|
|
|
20397
20104
|
transformOrigin: "50% 50%"
|
|
20398
20105
|
})
|
|
20399
20106
|
}, null, 14, _hoisted_7)
|
|
20400
|
-
], 10, _hoisted_2$
|
|
20107
|
+
], 10, _hoisted_2$3)),
|
|
20401
20108
|
_ctx.label ? (vue.openBlock(), vue.createElementBlock(
|
|
20402
20109
|
"div",
|
|
20403
20110
|
{
|
|
@@ -21416,65 +21123,56 @@ withInstall(stdin_default$3M);
|
|
|
21416
21123
|
withPropsDefaultsSetter(stdin_default$3M, props$j);
|
|
21417
21124
|
const _RateComponent = stdin_default$3M;
|
|
21418
21125
|
var stdin_default$3L = stdin_default$3M;
|
|
21419
|
-
const _withScopeId$5 = (n2) => (vue.pushScopeId(""), n2 = n2(), vue.popScopeId(), n2);
|
|
21420
21126
|
const _hoisted_1$a = {
|
|
21421
21127
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21422
21128
|
viewBox: "2 3.6 20 20"
|
|
21423
21129
|
};
|
|
21424
|
-
const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode(
|
|
21425
|
-
"path",
|
|
21426
|
-
{ d: "M11,9H13V7H11M11,20H13V11H11V20Z" },
|
|
21427
|
-
null,
|
|
21428
|
-
-1
|
|
21429
|
-
/* HOISTED */
|
|
21430
|
-
));
|
|
21431
|
-
const _hoisted_3$7 = [
|
|
21432
|
-
_hoisted_2$7
|
|
21433
|
-
];
|
|
21434
21130
|
function __render__$o(_ctx, _cache) {
|
|
21435
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$a, [
|
|
21131
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$a, _cache[0] || (_cache[0] = [
|
|
21132
|
+
vue.createElementVNode(
|
|
21133
|
+
"path",
|
|
21134
|
+
{ d: "M11,9H13V7H11M11,20H13V11H11V20Z" },
|
|
21135
|
+
null,
|
|
21136
|
+
-1
|
|
21137
|
+
/* HOISTED */
|
|
21138
|
+
)
|
|
21139
|
+
]));
|
|
21436
21140
|
}
|
|
21437
21141
|
const __sfc__$p = vue.defineComponent({});
|
|
21438
21142
|
__sfc__$p.render = __render__$o;
|
|
21439
21143
|
var stdin_default$3K = __sfc__$p;
|
|
21440
|
-
const _withScopeId$4 = (n2) => (vue.pushScopeId(""), n2 = n2(), vue.popScopeId(), n2);
|
|
21441
21144
|
const _hoisted_1$9 = {
|
|
21442
21145
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21443
21146
|
viewBox: "2 2 20 20"
|
|
21444
21147
|
};
|
|
21445
|
-
const _hoisted_2$6 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode(
|
|
21446
|
-
"path",
|
|
21447
|
-
{ d: "M19,3V5H19V19M17,8.4L13.4,12L17,15.6L15.6,17L12,13.4L8.4,17L7,15.6L10.6,12L7,8.4L8.4,7L12,10.6L15.6,7L17,8.4Z" },
|
|
21448
|
-
null,
|
|
21449
|
-
-1
|
|
21450
|
-
/* HOISTED */
|
|
21451
|
-
));
|
|
21452
|
-
const _hoisted_3$6 = [
|
|
21453
|
-
_hoisted_2$6
|
|
21454
|
-
];
|
|
21455
21148
|
function __render__$n(_ctx, _cache) {
|
|
21456
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$9, [
|
|
21149
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$9, _cache[0] || (_cache[0] = [
|
|
21150
|
+
vue.createElementVNode(
|
|
21151
|
+
"path",
|
|
21152
|
+
{ d: "M19,3V5H19V19M17,8.4L13.4,12L17,15.6L15.6,17L12,13.4L8.4,17L7,15.6L10.6,12L7,8.4L8.4,7L12,10.6L15.6,7L17,8.4Z" },
|
|
21153
|
+
null,
|
|
21154
|
+
-1
|
|
21155
|
+
/* HOISTED */
|
|
21156
|
+
)
|
|
21157
|
+
]));
|
|
21457
21158
|
}
|
|
21458
21159
|
const __sfc__$o = vue.defineComponent({});
|
|
21459
21160
|
__sfc__$o.render = __render__$n;
|
|
21460
21161
|
var stdin_default$3J = __sfc__$o;
|
|
21461
|
-
const _withScopeId$3 = (n2) => (vue.pushScopeId(""), n2 = n2(), vue.popScopeId(), n2);
|
|
21462
21162
|
const _hoisted_1$8 = {
|
|
21463
21163
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21464
21164
|
viewBox: "-6 -4 35 35"
|
|
21465
21165
|
};
|
|
21466
|
-
const _hoisted_2$5 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode(
|
|
21467
|
-
"path",
|
|
21468
|
-
{ d: "M10,21H14A2,2 0 0,1 12,23A2,2 0 0,1 10,21M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M17,11A5,5 0 0,0 12,6A5,5 0 0,0 7,11V18H17V11M19.75,3.19L18.33,4.61M1,11" },
|
|
21469
|
-
null,
|
|
21470
|
-
-1
|
|
21471
|
-
/* HOISTED */
|
|
21472
|
-
));
|
|
21473
|
-
const _hoisted_3$5 = [
|
|
21474
|
-
_hoisted_2$5
|
|
21475
|
-
];
|
|
21476
21166
|
function __render__$m(_ctx, _cache) {
|
|
21477
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$8, [
|
|
21167
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$8, _cache[0] || (_cache[0] = [
|
|
21168
|
+
vue.createElementVNode(
|
|
21169
|
+
"path",
|
|
21170
|
+
{ d: "M10,21H14A2,2 0 0,1 12,23A2,2 0 0,1 10,21M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M17,11A5,5 0 0,0 12,6A5,5 0 0,0 7,11V18H17V11M19.75,3.19L18.33,4.61M1,11" },
|
|
21171
|
+
null,
|
|
21172
|
+
-1
|
|
21173
|
+
/* HOISTED */
|
|
21174
|
+
)
|
|
21175
|
+
]));
|
|
21478
21176
|
}
|
|
21479
21177
|
const __sfc__$n = vue.defineComponent({});
|
|
21480
21178
|
__sfc__$n.render = __render__$m;
|
|
@@ -21575,44 +21273,38 @@ const __sfc__$m = vue.defineComponent({
|
|
|
21575
21273
|
});
|
|
21576
21274
|
__sfc__$m.render = __render__$l;
|
|
21577
21275
|
var stdin_default$3H = __sfc__$m;
|
|
21578
|
-
const _withScopeId$2 = (n2) => (vue.pushScopeId(""), n2 = n2(), vue.popScopeId(), n2);
|
|
21579
21276
|
const _hoisted_1$7 = {
|
|
21580
21277
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21581
21278
|
viewBox: "-3 -3 30 30"
|
|
21582
21279
|
};
|
|
21583
|
-
const _hoisted_2$4 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode(
|
|
21584
|
-
"path",
|
|
21585
|
-
{ d: "M10,19H13V22H10V19M12,2C17.35,2.22 19.68,7.62 16.5,11.67C15.67,12.67 14.33,13.33 13.67,14.17C13,15 13,16 13,17H10C10,15.33 10,13.92 10.67,12.92C11.33,11.92 12.67,11.33 13.5,10.67C15.92,8.43 15.32,5.26 12,5A3,3 0 0,0 9,8H6A6,6 0 0,1 12,2Z" },
|
|
21586
|
-
null,
|
|
21587
|
-
-1
|
|
21588
|
-
/* HOISTED */
|
|
21589
|
-
));
|
|
21590
|
-
const _hoisted_3$4 = [
|
|
21591
|
-
_hoisted_2$4
|
|
21592
|
-
];
|
|
21593
21280
|
function __render__$k(_ctx, _cache) {
|
|
21594
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$7, [
|
|
21281
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$7, _cache[0] || (_cache[0] = [
|
|
21282
|
+
vue.createElementVNode(
|
|
21283
|
+
"path",
|
|
21284
|
+
{ d: "M10,19H13V22H10V19M12,2C17.35,2.22 19.68,7.62 16.5,11.67C15.67,12.67 14.33,13.33 13.67,14.17C13,15 13,16 13,17H10C10,15.33 10,13.92 10.67,12.92C11.33,11.92 12.67,11.33 13.5,10.67C15.92,8.43 15.32,5.26 12,5A3,3 0 0,0 9,8H6A6,6 0 0,1 12,2Z" },
|
|
21285
|
+
null,
|
|
21286
|
+
-1
|
|
21287
|
+
/* HOISTED */
|
|
21288
|
+
)
|
|
21289
|
+
]));
|
|
21595
21290
|
}
|
|
21596
21291
|
const __sfc__$l = vue.defineComponent({});
|
|
21597
21292
|
__sfc__$l.render = __render__$k;
|
|
21598
21293
|
var stdin_default$3G = __sfc__$l;
|
|
21599
|
-
const _withScopeId$1 = (n2) => (vue.pushScopeId(""), n2 = n2(), vue.popScopeId(), n2);
|
|
21600
21294
|
const _hoisted_1$6 = { viewBox: "-4 -4 32 32" };
|
|
21601
|
-
const _hoisted_2$3 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode(
|
|
21602
|
-
"path",
|
|
21603
|
-
{
|
|
21604
|
-
fill: "currentColor",
|
|
21605
|
-
d: "M2,10.96C1.5,10.68 1.35,10.07 1.63,9.59L3.13,7C3.24,6.8 3.41,6.66 3.6,6.58L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.66,6.72 20.82,6.88 20.91,7.08L22.36,9.6C22.64,10.08 22.47,10.69 22,10.96L21,11.54V16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V10.96C2.7,11.13 2.32,11.14 2,10.96M12,4.15V4.15L12,10.85V10.85L17.96,7.5L12,4.15M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V12.69L14,15.59C13.67,15.77 13.3,15.76 13,15.6V19.29L19,15.91M13.85,13.36L20.13,9.73L19.55,8.72L13.27,12.35L13.85,13.36Z"
|
|
21606
|
-
},
|
|
21607
|
-
null,
|
|
21608
|
-
-1
|
|
21609
|
-
/* HOISTED */
|
|
21610
|
-
));
|
|
21611
|
-
const _hoisted_3$3 = [
|
|
21612
|
-
_hoisted_2$3
|
|
21613
|
-
];
|
|
21614
21295
|
function __render__$j(_ctx, _cache) {
|
|
21615
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$6, [
|
|
21296
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$6, _cache[0] || (_cache[0] = [
|
|
21297
|
+
vue.createElementVNode(
|
|
21298
|
+
"path",
|
|
21299
|
+
{
|
|
21300
|
+
fill: "currentColor",
|
|
21301
|
+
d: "M2,10.96C1.5,10.68 1.35,10.07 1.63,9.59L3.13,7C3.24,6.8 3.41,6.66 3.6,6.58L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.66,6.72 20.82,6.88 20.91,7.08L22.36,9.6C22.64,10.08 22.47,10.69 22,10.96L21,11.54V16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V10.96C2.7,11.13 2.32,11.14 2,10.96M12,4.15V4.15L12,10.85V10.85L17.96,7.5L12,4.15M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V12.69L14,15.59C13.67,15.77 13.3,15.76 13,15.6V19.29L19,15.91M13.85,13.36L20.13,9.73L19.55,8.72L13.27,12.35L13.85,13.36Z"
|
|
21302
|
+
},
|
|
21303
|
+
null,
|
|
21304
|
+
-1
|
|
21305
|
+
/* HOISTED */
|
|
21306
|
+
)
|
|
21307
|
+
]));
|
|
21616
21308
|
}
|
|
21617
21309
|
const __sfc__$k = vue.defineComponent({});
|
|
21618
21310
|
__sfc__$k.render = __render__$j;
|
|
@@ -23680,10 +23372,9 @@ function updateUniqOption(reactiveSnackOptions, _update) {
|
|
|
23680
23372
|
firstOption._update = _update;
|
|
23681
23373
|
}
|
|
23682
23374
|
function getTop(position = "top") {
|
|
23683
|
-
if (position === "bottom")
|
|
23684
|
-
|
|
23685
|
-
|
|
23686
|
-
};
|
|
23375
|
+
if (position === "bottom") return {
|
|
23376
|
+
top: "85%"
|
|
23377
|
+
};
|
|
23687
23378
|
return {
|
|
23688
23379
|
top: position === "top" ? "5%" : "45%"
|
|
23689
23380
|
};
|
|
@@ -24108,26 +23799,8 @@ const props$8 = {
|
|
|
24108
23799
|
"onUpdate:modelValue": defineListenerProp()
|
|
24109
23800
|
};
|
|
24110
23801
|
const { name: name$8, n: n$9, classes: classes$8 } = createNamespace("switch");
|
|
24111
|
-
const _withScopeId = (n2) => (vue.pushScopeId(""), n2 = n2(), vue.popScopeId(), n2);
|
|
24112
23802
|
const _hoisted_1$2 = ["aria-checked"];
|
|
24113
23803
|
const _hoisted_2$2 = ["tabindex"];
|
|
24114
|
-
const _hoisted_3$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode(
|
|
24115
|
-
"svg",
|
|
24116
|
-
{ viewBox: "25 25 50 50" },
|
|
24117
|
-
[
|
|
24118
|
-
/* @__PURE__ */ vue.createElementVNode("circle", {
|
|
24119
|
-
cx: "50",
|
|
24120
|
-
cy: "50",
|
|
24121
|
-
r: "20",
|
|
24122
|
-
fill: "none"
|
|
24123
|
-
})
|
|
24124
|
-
],
|
|
24125
|
-
-1
|
|
24126
|
-
/* HOISTED */
|
|
24127
|
-
));
|
|
24128
|
-
const _hoisted_4$2 = [
|
|
24129
|
-
_hoisted_3$2
|
|
24130
|
-
];
|
|
24131
23804
|
function __render__$9(_ctx, _cache) {
|
|
24132
23805
|
const _component_var_hover_overlay = vue.resolveComponent("var-hover-overlay");
|
|
24133
23806
|
const _component_var_form_details = vue.resolveComponent("var-form-details");
|
|
@@ -24189,7 +23862,22 @@ function __render__$9(_ctx, _cache) {
|
|
|
24189
23862
|
height: _ctx.radius
|
|
24190
23863
|
})
|
|
24191
23864
|
},
|
|
24192
|
-
[
|
|
23865
|
+
_cache[3] || (_cache[3] = [
|
|
23866
|
+
vue.createElementVNode(
|
|
23867
|
+
"svg",
|
|
23868
|
+
{ viewBox: "25 25 50 50" },
|
|
23869
|
+
[
|
|
23870
|
+
vue.createElementVNode("circle", {
|
|
23871
|
+
cx: "50",
|
|
23872
|
+
cy: "50",
|
|
23873
|
+
r: "20",
|
|
23874
|
+
fill: "none"
|
|
23875
|
+
})
|
|
23876
|
+
],
|
|
23877
|
+
-1
|
|
23878
|
+
/* HOISTED */
|
|
23879
|
+
)
|
|
23880
|
+
]),
|
|
24193
23881
|
6
|
|
24194
23882
|
/* CLASS, STYLE */
|
|
24195
23883
|
)) : vue.createCommentVNode("v-if", true)
|
|
@@ -24806,8 +24494,7 @@ const __sfc__$5 = vue.defineComponent({
|
|
|
24806
24494
|
}
|
|
24807
24495
|
function moveIndicator({ element }) {
|
|
24808
24496
|
const el = element.value;
|
|
24809
|
-
if (!el)
|
|
24810
|
-
return;
|
|
24497
|
+
if (!el) return;
|
|
24811
24498
|
if (props2.layoutDirection === "horizontal") {
|
|
24812
24499
|
indicatorWidth.value = `${el.offsetWidth}px`;
|
|
24813
24500
|
indicatorX.value = `${el.offsetLeft}px`;
|
|
@@ -27984,8 +27671,7 @@ const getIsDisableMinute = (values) => {
|
|
|
27984
27671
|
const { hourStr, hourNum } = convertHour(format2, ampm, hour);
|
|
27985
27672
|
let isBetweenMinMax = false;
|
|
27986
27673
|
let isAllow = false;
|
|
27987
|
-
if (disableHour.includes(hourStr))
|
|
27988
|
-
return true;
|
|
27674
|
+
if (disableHour.includes(hourStr)) return true;
|
|
27989
27675
|
if (max2 && !min2) {
|
|
27990
27676
|
const { hour: maxHour, minute: maxMinute } = getNumberTime(max2);
|
|
27991
27677
|
isBetweenMinMax = maxHour === hourNum && time > maxMinute;
|
|
@@ -27999,8 +27685,7 @@ const getIsDisableMinute = (values) => {
|
|
|
27999
27685
|
const { hour: minHour, minute: minMinute } = getNumberTime(min2);
|
|
28000
27686
|
isBetweenMinMax = minHour === hourNum && time < minMinute || maxHour === hourNum && time > maxMinute;
|
|
28001
27687
|
}
|
|
28002
|
-
if ((_a = values.allowedTime) == null ? void 0 : _a.minutes)
|
|
28003
|
-
isAllow = (_b = values.allowedTime) == null ? void 0 : _b.minutes(time);
|
|
27688
|
+
if ((_a = values.allowedTime) == null ? void 0 : _a.minutes) isAllow = (_b = values.allowedTime) == null ? void 0 : _b.minutes(time);
|
|
28004
27689
|
return isBetweenMinMax || isAllow;
|
|
28005
27690
|
};
|
|
28006
27691
|
const getIsDisableSecond = (values) => {
|
|
@@ -28009,8 +27694,7 @@ const getIsDisableSecond = (values) => {
|
|
|
28009
27694
|
const { hourStr, hourNum } = convertHour(format2, ampm, hour);
|
|
28010
27695
|
let isBetweenMinMax = false;
|
|
28011
27696
|
let isAllow = false;
|
|
28012
|
-
if (disableHour.includes(hourStr))
|
|
28013
|
-
return true;
|
|
27697
|
+
if (disableHour.includes(hourStr)) return true;
|
|
28014
27698
|
if (max2 && !min2) {
|
|
28015
27699
|
const { hour: maxHour, minute: maxMinute, second: maxSecond } = getNumberTime(max2);
|
|
28016
27700
|
isBetweenMinMax = maxHour === hourNum && maxMinute < minute || maxMinute === minute && time > maxSecond;
|
|
@@ -28024,8 +27708,7 @@ const getIsDisableSecond = (values) => {
|
|
|
28024
27708
|
const { hour: minHour, minute: minMinute, second: minSecond } = getNumberTime(min2);
|
|
28025
27709
|
isBetweenMinMax = maxHour === hourNum && maxMinute < minute || minHour === hourNum && minMinute > minute || maxHour === hourNum && maxMinute === minute && time > maxSecond || minHour === hourNum && minMinute === minute && time < minSecond;
|
|
28026
27710
|
}
|
|
28027
|
-
if ((_a = values.allowedTime) == null ? void 0 : _a.seconds)
|
|
28028
|
-
isAllow = (_b = values.allowedTime) == null ? void 0 : _b.seconds(time);
|
|
27711
|
+
if ((_a = values.allowedTime) == null ? void 0 : _a.seconds) isAllow = (_b = values.allowedTime) == null ? void 0 : _b.seconds(time);
|
|
28029
27712
|
return isBetweenMinMax || isAllow;
|
|
28030
27713
|
};
|
|
28031
27714
|
const { n: n$3, classes: classes$3 } = createNamespace("time-picker");
|
|
@@ -28170,14 +27853,12 @@ const __sfc__$3 = vue.defineComponent({
|
|
|
28170
27853
|
borderColor: getHandleColor()
|
|
28171
27854
|
}));
|
|
28172
27855
|
const activeItemIndex = vue.computed(() => {
|
|
28173
|
-
if (props2.rad === void 0)
|
|
28174
|
-
return;
|
|
27856
|
+
if (props2.rad === void 0) return;
|
|
28175
27857
|
const value = props2.rad / 30;
|
|
28176
27858
|
return value >= 0 ? value : value + 12;
|
|
28177
27859
|
});
|
|
28178
27860
|
const timeScales = vue.computed(() => {
|
|
28179
|
-
if (props2.type === "hour")
|
|
28180
|
-
return hoursAmpm;
|
|
27861
|
+
if (props2.type === "hour") return hoursAmpm;
|
|
28181
27862
|
return minSec;
|
|
28182
27863
|
});
|
|
28183
27864
|
const isDisableMinSec = (time, isDisable2) => {
|
|
@@ -28194,13 +27875,11 @@ const __sfc__$3 = vue.defineComponent({
|
|
|
28194
27875
|
allowedTime: props2.allowedTime,
|
|
28195
27876
|
disableHour: disableHour.value
|
|
28196
27877
|
};
|
|
28197
|
-
if (isDisable2 && props2.type === "minute")
|
|
28198
|
-
Reflect.deleteProperty(values, "minute");
|
|
27878
|
+
if (isDisable2 && props2.type === "minute") Reflect.deleteProperty(values, "minute");
|
|
28199
27879
|
return disableMethod(values);
|
|
28200
27880
|
};
|
|
28201
27881
|
const getHandleColor = () => {
|
|
28202
|
-
if (activeItemIndex.value === void 0)
|
|
28203
|
-
return props2.color;
|
|
27882
|
+
if (activeItemIndex.value === void 0) return props2.color;
|
|
28204
27883
|
const hour = props2.isInner ? hours24[activeItemIndex.value] : timeScales.value[activeItemIndex.value];
|
|
28205
27884
|
if (timeScales.value === minSec) {
|
|
28206
27885
|
return isDisableMinSec() ? "var(--time-picker-clock-item-disable-background)" : props2.color;
|
|
@@ -28208,14 +27887,12 @@ const __sfc__$3 = vue.defineComponent({
|
|
|
28208
27887
|
return isDisable(hour) ? "var(--time-picker-clock-item-disable-background)" : props2.color;
|
|
28209
27888
|
};
|
|
28210
27889
|
const isActive = (index, inner2) => {
|
|
28211
|
-
if (inner2)
|
|
28212
|
-
return activeItemIndex.value === index && props2.isInner;
|
|
27890
|
+
if (inner2) return activeItemIndex.value === index && props2.isInner;
|
|
28213
27891
|
return activeItemIndex.value === index && (!props2.isInner || props2.type !== "hour");
|
|
28214
27892
|
};
|
|
28215
27893
|
const isDisable = (time) => {
|
|
28216
27894
|
if (props2.type === "hour") {
|
|
28217
|
-
if (notConvert(props2.format, props2.ampm))
|
|
28218
|
-
return disableHour.value.includes(time);
|
|
27895
|
+
if (notConvert(props2.format, props2.ampm)) return disableHour.value.includes(time);
|
|
28219
27896
|
const timeIndex = hoursAmpm.findIndex((hour) => hour === time);
|
|
28220
27897
|
return disable24HourIndex.value.includes(timeIndex);
|
|
28221
27898
|
}
|
|
@@ -28259,31 +27936,26 @@ const __sfc__$3 = vue.defineComponent({
|
|
|
28259
27936
|
};
|
|
28260
27937
|
};
|
|
28261
27938
|
const getHour = () => {
|
|
28262
|
-
if (activeItemIndex.value === void 0)
|
|
28263
|
-
return void 0;
|
|
27939
|
+
if (activeItemIndex.value === void 0) return void 0;
|
|
28264
27940
|
const hours = props2.ampm === "am" ? hoursAmpm : hours24;
|
|
28265
27941
|
return padStart$1(hours[activeItemIndex.value], 2, "0");
|
|
28266
27942
|
};
|
|
28267
27943
|
vue.watch([activeItemIndex, () => props2.isInner], ([index, inner2], [oldIndex, oldInner]) => {
|
|
28268
27944
|
const isSame = index === oldIndex && inner2 === oldInner;
|
|
28269
|
-
if (isSame || props2.type !== "hour" || activeItemIndex.value === void 0)
|
|
28270
|
-
return;
|
|
27945
|
+
if (isSame || props2.type !== "hour" || activeItemIndex.value === void 0) return;
|
|
28271
27946
|
const newHour = inner2 ? hours24[activeItemIndex.value] : getHour();
|
|
28272
27947
|
const second = props2.useSeconds ? `:${props2.time.second}` : "";
|
|
28273
27948
|
const newTime = `${newHour}:${props2.time.minute}${second}`;
|
|
28274
|
-
if (!props2.preventNextUpdate)
|
|
28275
|
-
emit("update", newTime);
|
|
27949
|
+
if (!props2.preventNextUpdate) emit("update", newTime);
|
|
28276
27950
|
emit("change-prevent-update");
|
|
28277
27951
|
});
|
|
28278
27952
|
vue.watch(
|
|
28279
27953
|
() => props2.rad,
|
|
28280
27954
|
(rad, oldRad) => {
|
|
28281
|
-
if (props2.type === "hour" || rad === void 0 || oldRad === void 0)
|
|
28282
|
-
return;
|
|
27955
|
+
if (props2.type === "hour" || rad === void 0 || oldRad === void 0) return;
|
|
28283
27956
|
const radToMinSec = rad / 6 >= 0 ? rad / 6 : rad / 6 + 60;
|
|
28284
27957
|
const oldRadToMinSec = oldRad / 6 >= 0 ? oldRad / 6 : oldRad / 6 + 60;
|
|
28285
|
-
if (radToMinSec === oldRadToMinSec)
|
|
28286
|
-
return;
|
|
27958
|
+
if (radToMinSec === oldRadToMinSec) return;
|
|
28287
27959
|
let newTime;
|
|
28288
27960
|
const { hourStr } = convertHour(props2.format, props2.ampm, props2.time.hour);
|
|
28289
27961
|
if (props2.type === "minute") {
|
|
@@ -28583,10 +28255,8 @@ const __sfc__$2 = vue.defineComponent({
|
|
|
28583
28255
|
y: []
|
|
28584
28256
|
});
|
|
28585
28257
|
const getRad = vue.computed(() => {
|
|
28586
|
-
if (type.value === "hour")
|
|
28587
|
-
|
|
28588
|
-
if (type.value === "minute")
|
|
28589
|
-
return minuteRad.value;
|
|
28258
|
+
if (type.value === "hour") return hourRad.value;
|
|
28259
|
+
if (type.value === "minute") return minuteRad.value;
|
|
28590
28260
|
return secondRad.value;
|
|
28591
28261
|
});
|
|
28592
28262
|
const { t: pt } = injectLocaleProvider();
|
|
@@ -28634,12 +28304,10 @@ const __sfc__$2 = vue.defineComponent({
|
|
|
28634
28304
|
});
|
|
28635
28305
|
}
|
|
28636
28306
|
function checkAmpm(ampmType) {
|
|
28637
|
-
if (props2.readonly)
|
|
28638
|
-
return;
|
|
28307
|
+
if (props2.readonly) return;
|
|
28639
28308
|
ampm.value = ampmType;
|
|
28640
28309
|
const newHour = findAvailableHour(ampmType);
|
|
28641
|
-
if (!newHour)
|
|
28642
|
-
return;
|
|
28310
|
+
if (!newHour) return;
|
|
28643
28311
|
const second = props2.useSeconds ? `:${time.value.second}` : "";
|
|
28644
28312
|
const newTime = `${padStart$1(newHour, 2, "0")}:${time.value.minute}${second}`;
|
|
28645
28313
|
update(newTime);
|
|
@@ -28684,12 +28352,10 @@ const __sfc__$2 = vue.defineComponent({
|
|
|
28684
28352
|
if (!disableHour.includes(anotherHour)) {
|
|
28685
28353
|
isInner.value = props2.format === "24hr" ? getInner(clientX, clientY) : false;
|
|
28686
28354
|
}
|
|
28687
|
-
if (isInner.value !== isActualInner.value)
|
|
28688
|
-
return;
|
|
28355
|
+
if (isInner.value !== isActualInner.value) return;
|
|
28689
28356
|
const newHour = isInner.value || ampm.value === "pm" ? hours24[index] : hoursAmpm[index];
|
|
28690
28357
|
isDisableHour.value = disableHour.includes(newHour);
|
|
28691
|
-
if (isDisableHour.value)
|
|
28692
|
-
return;
|
|
28358
|
+
if (isDisableHour.value) return;
|
|
28693
28359
|
hourRad.value = rad;
|
|
28694
28360
|
isChosenUsableHour.value = true;
|
|
28695
28361
|
}
|
|
@@ -28708,8 +28374,7 @@ const __sfc__$2 = vue.defineComponent({
|
|
|
28708
28374
|
allowedTime: props2.allowedTime
|
|
28709
28375
|
};
|
|
28710
28376
|
isDisableMinute.value = getIsDisableMinute(values);
|
|
28711
|
-
if (isDisableMinute.value)
|
|
28712
|
-
return;
|
|
28377
|
+
if (isDisableMinute.value) return;
|
|
28713
28378
|
minuteRad.value = rad;
|
|
28714
28379
|
isChosenUsableMinute.value = true;
|
|
28715
28380
|
}
|
|
@@ -28728,8 +28393,7 @@ const __sfc__$2 = vue.defineComponent({
|
|
|
28728
28393
|
disableHour,
|
|
28729
28394
|
allowedTime: props2.allowedTime
|
|
28730
28395
|
};
|
|
28731
|
-
if (!getIsDisableSecond(values))
|
|
28732
|
-
secondRad.value = rad;
|
|
28396
|
+
if (!getIsDisableSecond(values)) secondRad.value = rad;
|
|
28733
28397
|
}
|
|
28734
28398
|
function setCenterAndRange() {
|
|
28735
28399
|
const { left: left2, top: top2, width, height } = getRect(container.value);
|
|
@@ -28743,23 +28407,18 @@ const __sfc__$2 = vue.defineComponent({
|
|
|
28743
28407
|
}
|
|
28744
28408
|
function moveHand(event) {
|
|
28745
28409
|
preventDefault(event);
|
|
28746
|
-
if (props2.readonly)
|
|
28747
|
-
return;
|
|
28410
|
+
if (props2.readonly) return;
|
|
28748
28411
|
setCenterAndRange();
|
|
28749
28412
|
const { clientX, clientY } = event.touches[0];
|
|
28750
28413
|
const x = clientX - center.x;
|
|
28751
28414
|
const y = clientY - center.y;
|
|
28752
28415
|
const roundDeg = Math.round(rad2deg(Math.atan2(y, x)));
|
|
28753
|
-
if (type.value === "hour")
|
|
28754
|
-
|
|
28755
|
-
else
|
|
28756
|
-
setMinuteRad(roundDeg);
|
|
28757
|
-
else
|
|
28758
|
-
setSecondRad(roundDeg);
|
|
28416
|
+
if (type.value === "hour") setHourRad(clientX, clientY, roundDeg);
|
|
28417
|
+
else if (type.value === "minute") setMinuteRad(roundDeg);
|
|
28418
|
+
else setSecondRad(roundDeg);
|
|
28759
28419
|
}
|
|
28760
28420
|
function end2() {
|
|
28761
|
-
if (props2.readonly)
|
|
28762
|
-
return;
|
|
28421
|
+
if (props2.readonly) return;
|
|
28763
28422
|
if (type.value === "hour" && isChosenUsableHour.value) {
|
|
28764
28423
|
type.value = "minute";
|
|
28765
28424
|
return;
|
|
@@ -29645,7 +29304,7 @@ withInstall(stdin_default$1);
|
|
|
29645
29304
|
withPropsDefaultsSetter(stdin_default$1, props);
|
|
29646
29305
|
const _WatermarkComponent = stdin_default$1;
|
|
29647
29306
|
var stdin_default = stdin_default$1;
|
|
29648
|
-
const version = "3.5.
|
|
29307
|
+
const version = "3.5.1-alpha.1726764162524";
|
|
29649
29308
|
function install(app) {
|
|
29650
29309
|
stdin_default$5I.install && app.use(stdin_default$5I);
|
|
29651
29310
|
stdin_default$5G.install && app.use(stdin_default$5G);
|