naive-ui 2.30.2 → 2.30.3
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/dist/index.js +96788 -0
- package/dist/index.prod.js +9 -0
- package/es/_internal/clear/src/Clear.js +1 -1
- package/es/_internal/close/index.d.ts +1 -1
- package/es/_internal/close/index.js +1 -1
- package/es/_internal/close/src/Close.js +1 -1
- package/es/_internal/icon/index.d.ts +1 -1
- package/es/_internal/icon/index.js +1 -1
- package/es/_internal/index.d.ts +2 -2
- package/es/_internal/index.js +2 -2
- package/es/_internal/select-menu/src/SelectOption.js +1 -1
- package/es/_internal/selection/src/Selection.js +12 -23
- package/es/_internal/suffix/src/Suffix.js +1 -1
- package/es/_utils/composable/use-browser-location.js +2 -2
- package/es/_utils/composable/use-houdini.js +2 -1
- package/es/_utils/composable/use-is-composing.js +2 -1
- package/es/_utils/env/is-browser.d.ts +1 -0
- package/es/_utils/env/is-browser.js +1 -0
- package/es/_utils/index.d.ts +1 -0
- package/es/_utils/index.js +1 -0
- package/es/_utils/naive/index.d.ts +0 -1
- package/es/_utils/naive/index.js +0 -1
- package/es/button/src/styles/index.cssr.js +3 -2
- package/es/calendar/src/Calendar.js +14 -5
- package/es/cascader/src/Cascader.js +31 -1
- package/es/drawer/src/Drawer.js +1 -1
- package/es/empty/src/Empty.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/jest-setup.d.ts +1 -0
- package/es/jest-setup.js +2 -2
- package/es/mention/src/utils.js +1 -1
- package/es/preset.d.ts +3 -2
- package/es/preset.js +3 -1
- package/es/space/src/Space.d.ts +1 -0
- package/es/space/src/Space.js +43 -38
- package/es/space/src/utils.d.ts +1 -0
- package/es/space/src/utils.js +22 -0
- package/es/tag/src/Tag.js +1 -1
- package/es/tree/src/utils.js +2 -1
- package/es/upload/src/utils.js +2 -4
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/clear/src/Clear.js +2 -2
- package/lib/_internal/close/index.d.ts +1 -1
- package/lib/_internal/close/index.js +2 -2
- package/lib/_internal/close/src/Close.js +2 -2
- package/lib/_internal/icon/index.d.ts +1 -1
- package/lib/_internal/icon/index.js +2 -2
- package/lib/_internal/index.d.ts +2 -2
- package/lib/_internal/index.js +2 -2
- package/lib/_internal/select-menu/src/SelectOption.js +2 -5
- package/lib/_internal/selection/src/Selection.js +12 -23
- package/lib/_internal/suffix/src/Suffix.js +2 -2
- package/lib/_utils/composable/use-browser-location.js +2 -2
- package/lib/_utils/composable/use-houdini.js +2 -1
- package/lib/_utils/composable/use-is-composing.js +2 -1
- package/lib/_utils/env/is-browser.d.ts +1 -0
- package/lib/_utils/env/is-browser.js +4 -0
- package/lib/_utils/index.d.ts +1 -0
- package/lib/_utils/index.js +3 -1
- package/lib/_utils/naive/index.d.ts +0 -1
- package/lib/_utils/naive/index.js +0 -15
- package/lib/button/src/styles/index.cssr.js +4 -2
- package/lib/calendar/src/Calendar.js +14 -5
- package/lib/cascader/src/Cascader.js +30 -0
- package/lib/drawer/src/Drawer.js +1 -1
- package/lib/empty/src/Empty.js +2 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/jest-setup.d.ts +1 -0
- package/lib/jest-setup.js +3 -1
- package/lib/mention/src/utils.js +2 -2
- package/lib/preset.d.ts +3 -2
- package/lib/preset.js +4 -1
- package/lib/space/src/Space.d.ts +1 -0
- package/lib/space/src/Space.js +43 -38
- package/lib/space/src/utils.d.ts +1 -0
- package/lib/space/src/utils.js +26 -0
- package/lib/tag/src/Tag.js +2 -2
- package/lib/tree/src/utils.js +2 -1
- package/lib/upload/src/utils.js +2 -4
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +14 -4
- package/web-types.json +2 -2
- package/es/_utils/naive/window.d.ts +0 -1
- package/es/_utils/naive/window.js +0 -1
- package/lib/_utils/naive/window.d.ts +0 -1
- package/lib/_utils/naive/window.js +0 -4
|
@@ -3,6 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.NBaseClose = void 0;
|
|
7
7
|
var Close_1 = require("./src/Close");
|
|
8
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "NBaseClose", { enumerable: true, get: function () { return __importDefault(Close_1).default; } });
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const vue_1 = require("vue");
|
|
7
7
|
const _mixins_1 = require("../../../_mixins");
|
|
8
|
-
const icon_1 =
|
|
8
|
+
const icon_1 = require("../../icon");
|
|
9
9
|
const icons_1 = require("../../icons");
|
|
10
10
|
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
11
11
|
exports.default = (0, vue_1.defineComponent)({
|
|
@@ -41,7 +41,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
41
41
|
e.preventDefault();
|
|
42
42
|
}
|
|
43
43
|
}, onClick: props.onClick },
|
|
44
|
-
(0, vue_1.h)(icon_1.
|
|
44
|
+
(0, vue_1.h)(icon_1.NBaseIcon, { clsPrefix: clsPrefix }, {
|
|
45
45
|
default: () => (0, vue_1.h)(icons_1.CloseIcon, null)
|
|
46
46
|
})));
|
|
47
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './src/Icon';
|
|
1
|
+
export { default as NBaseIcon } from './src/Icon';
|
|
@@ -3,6 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.NBaseIcon = void 0;
|
|
7
7
|
var Icon_1 = require("./src/Icon");
|
|
8
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "NBaseIcon", { enumerable: true, get: function () { return __importDefault(Icon_1).default; } });
|
package/lib/_internal/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as NIconSwitchTransition } from './icon-switch-transition';
|
|
2
2
|
export { default as NFadeInExpandTransition } from './fade-in-expand-transition';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
3
|
+
export { NBaseClose } from './close';
|
|
4
|
+
export { NBaseIcon } from './icon';
|
|
5
5
|
export { default as NBaseFocusDetector } from './focus-detector';
|
|
6
6
|
export { default as NBaseLoading } from './loading';
|
|
7
7
|
export { default as NInternalSelectMenu } from './select-menu';
|
package/lib/_internal/index.js
CHANGED
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "NIconSwitchTransition", { enumerable: true, get:
|
|
|
9
9
|
var fade_in_expand_transition_1 = require("./fade-in-expand-transition");
|
|
10
10
|
Object.defineProperty(exports, "NFadeInExpandTransition", { enumerable: true, get: function () { return __importDefault(fade_in_expand_transition_1).default; } });
|
|
11
11
|
var close_1 = require("./close");
|
|
12
|
-
Object.defineProperty(exports, "NBaseClose", { enumerable: true, get: function () { return
|
|
12
|
+
Object.defineProperty(exports, "NBaseClose", { enumerable: true, get: function () { return close_1.NBaseClose; } });
|
|
13
13
|
var icon_1 = require("./icon");
|
|
14
|
-
Object.defineProperty(exports, "NBaseIcon", { enumerable: true, get: function () { return
|
|
14
|
+
Object.defineProperty(exports, "NBaseIcon", { enumerable: true, get: function () { return icon_1.NBaseIcon; } });
|
|
15
15
|
var focus_detector_1 = require("./focus-detector");
|
|
16
16
|
Object.defineProperty(exports, "NBaseFocusDetector", { enumerable: true, get: function () { return __importDefault(focus_detector_1).default; } });
|
|
17
17
|
var loading_1 = require("./loading");
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
const vue_1 = require("vue");
|
|
7
4
|
const vooks_1 = require("vooks");
|
|
8
5
|
const _utils_1 = require("../../../_utils");
|
|
9
6
|
const icons_1 = require("../../icons");
|
|
10
|
-
const icon_1 =
|
|
7
|
+
const icon_1 = require("../../icon");
|
|
11
8
|
const interface_1 = require("./interface");
|
|
12
9
|
const checkMarkIcon = (0, vue_1.h)(icons_1.CheckmarkIcon);
|
|
13
10
|
function renderCheckMark(show, clsPrefix) {
|
|
14
11
|
return ((0, vue_1.h)(vue_1.Transition, { name: "fade-in-scale-up-transition" }, {
|
|
15
|
-
default: () => show ? ((0, vue_1.h)(icon_1.
|
|
12
|
+
default: () => show ? ((0, vue_1.h)(icon_1.NBaseIcon, { clsPrefix: clsPrefix, class: `${clsPrefix}-base-select-option__check` }, {
|
|
16
13
|
default: () => checkMarkIcon
|
|
17
14
|
})) : null
|
|
18
15
|
}));
|
|
@@ -505,29 +505,18 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
505
505
|
? !this.pattern && !this.isCompositing
|
|
506
506
|
: true;
|
|
507
507
|
const placeholder = showPlaceholder ? ((0, vue_1.h)("div", { class: `${clsPrefix}-base-selection-placeholder ${clsPrefix}-base-selection-overlay` }, this.placeholder)) : null;
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
else {
|
|
521
|
-
const popoverTrigger = ((0, vue_1.h)("div", { ref: "multipleElRef", class: `${clsPrefix}-base-selection-tags`, tabindex: disabled ? undefined : 0 },
|
|
522
|
-
tags,
|
|
523
|
-
suffix));
|
|
524
|
-
body = ((0, vue_1.h)(vue_1.Fragment, null,
|
|
525
|
-
useMaxTagCount ? ((0, vue_1.h)(popover_1.NPopover, Object.assign({}, popoverProps, { scrollable: true, style: "max-height: calc(var(--v-target-height) * 6.6);" }), {
|
|
526
|
-
trigger: () => popoverTrigger,
|
|
527
|
-
default: renderPopover
|
|
528
|
-
})) : (popoverTrigger),
|
|
529
|
-
placeholder));
|
|
530
|
-
}
|
|
508
|
+
const popoverTrigger = filterable ? ((0, vue_1.h)("div", { ref: "patternInputWrapperRef", class: `${clsPrefix}-base-selection-tags` },
|
|
509
|
+
tags,
|
|
510
|
+
maxTagCountResponsive ? null : input,
|
|
511
|
+
suffix)) : ((0, vue_1.h)("div", { ref: "multipleElRef", class: `${clsPrefix}-base-selection-tags`, tabindex: disabled ? undefined : 0 },
|
|
512
|
+
tags,
|
|
513
|
+
suffix));
|
|
514
|
+
body = ((0, vue_1.h)(vue_1.Fragment, null,
|
|
515
|
+
useMaxTagCount ? ((0, vue_1.h)(popover_1.NPopover, Object.assign({}, popoverProps, { scrollable: true, style: "max-height: calc(var(--v-target-height) * 6.6);" }), {
|
|
516
|
+
trigger: () => popoverTrigger,
|
|
517
|
+
default: renderPopover
|
|
518
|
+
})) : (popoverTrigger),
|
|
519
|
+
placeholder));
|
|
531
520
|
}
|
|
532
521
|
else {
|
|
533
522
|
if (filterable) {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const vue_1 = require("vue");
|
|
7
7
|
const clear_1 = __importDefault(require("../../clear"));
|
|
8
8
|
const loading_1 = __importDefault(require("../../loading"));
|
|
9
|
-
const icon_1 =
|
|
9
|
+
const icon_1 = require("../../icon");
|
|
10
10
|
const icons_1 = require("../../icons");
|
|
11
11
|
const vue_2 = require("../../../_utils/vue");
|
|
12
12
|
exports.default = (0, vue_1.defineComponent)({
|
|
@@ -35,7 +35,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
35
35
|
const { clsPrefix } = props;
|
|
36
36
|
return ((0, vue_1.h)(loading_1.default, { clsPrefix: clsPrefix, class: `${clsPrefix}-base-suffix`, strokeWidth: 24, scale: 0.85, show: props.loading }, {
|
|
37
37
|
default: () => props.showArrow ? ((0, vue_1.h)(clear_1.default, { clsPrefix: clsPrefix, show: props.showClear, onClear: props.onClear }, {
|
|
38
|
-
placeholder: () => ((0, vue_1.h)(icon_1.
|
|
38
|
+
placeholder: () => ((0, vue_1.h)(icon_1.NBaseIcon, { clsPrefix: clsPrefix, class: `${clsPrefix}-base-suffix__arrow` }, {
|
|
39
39
|
default: () => (0, vue_2.resolveSlot)(slots.default, () => [
|
|
40
40
|
(0, vue_1.h)(icons_1.ChevronDownIcon, null)
|
|
41
41
|
])
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useBrowserLocation = void 0;
|
|
4
4
|
const vue_1 = require("vue");
|
|
5
|
-
const
|
|
6
|
-
const defaultWindow =
|
|
5
|
+
const is_browser_1 = require("../env/is-browser");
|
|
6
|
+
const defaultWindow = is_browser_1.isBrowser ? window : null;
|
|
7
7
|
const useBrowserLocation = (customWindow = defaultWindow) => {
|
|
8
8
|
const getWindowLocation = () => {
|
|
9
9
|
const { hash, host, hostname, href, origin, pathname, port, protocol, search } = (customWindow === null || customWindow === void 0 ? void 0 : customWindow.location) || {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useHoudini = void 0;
|
|
4
|
+
const is_browser_1 = require("../env/is-browser");
|
|
4
5
|
let houdiniRegistered = false;
|
|
5
6
|
function useHoudini() {
|
|
6
|
-
if (
|
|
7
|
+
if (!is_browser_1.isBrowser)
|
|
7
8
|
return;
|
|
8
9
|
if (!window.CSS)
|
|
9
10
|
return;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useIsComposing = void 0;
|
|
4
4
|
const vue_1 = require("vue");
|
|
5
|
+
const is_browser_1 = require("../env/is-browser");
|
|
5
6
|
const isComposingRef = (0, vue_1.ref)(false);
|
|
6
7
|
const compositionStartHandler = () => {
|
|
7
8
|
isComposingRef.value = true;
|
|
@@ -11,7 +12,7 @@ const compositionEndHandler = () => {
|
|
|
11
12
|
};
|
|
12
13
|
let mountedCount = 0;
|
|
13
14
|
const useIsComposing = () => {
|
|
14
|
-
if (
|
|
15
|
+
if (is_browser_1.isBrowser) {
|
|
15
16
|
(0, vue_1.onBeforeMount)(() => {
|
|
16
17
|
if (!mountedCount) {
|
|
17
18
|
window.addEventListener('compositionstart', compositionStartHandler);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isBrowser: boolean;
|
package/lib/_utils/index.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export type { ExtractPublicPropTypes, ExtractInternalPropTypes, Mutable } from '
|
|
|
5
5
|
export { formatLength, color2Class } from './css';
|
|
6
6
|
export { createKey } from './cssr';
|
|
7
7
|
export { isJsdom } from './env/is-jsdom';
|
|
8
|
+
export { isBrowser } from './env/is-browser';
|
|
8
9
|
export * from './composable';
|
package/lib/_utils/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.isJsdom = exports.createKey = exports.color2Class = exports.formatLength = exports.getTitleAttribute = exports.largerSize = exports.smallerSize = exports.throwError = exports.warnOnce = exports.warn = exports.isSlotEmpty = exports.resolveWrappedSlot = exports.resolveSlotWithProps = exports.resolveSlot = exports.createInjectionKey = exports.createRefSetter = exports.createDataKey = exports.getFirstSlotVNode = exports.render = exports.keysOf = exports.getVNodeChildren = exports.getSlot = exports.flatten = exports.omit = exports.keep = exports.call = void 0;
|
|
17
|
+
exports.isBrowser = exports.isJsdom = exports.createKey = exports.color2Class = exports.formatLength = exports.getTitleAttribute = exports.largerSize = exports.smallerSize = exports.throwError = exports.warnOnce = exports.warn = exports.isSlotEmpty = exports.resolveWrappedSlot = exports.resolveSlotWithProps = exports.resolveSlot = exports.createInjectionKey = exports.createRefSetter = exports.createDataKey = exports.getFirstSlotVNode = exports.render = exports.keysOf = exports.getVNodeChildren = exports.getSlot = exports.flatten = exports.omit = exports.keep = exports.call = void 0;
|
|
18
18
|
var vue_1 = require("./vue");
|
|
19
19
|
Object.defineProperty(exports, "call", { enumerable: true, get: function () { return vue_1.call; } });
|
|
20
20
|
Object.defineProperty(exports, "keep", { enumerable: true, get: function () { return vue_1.keep; } });
|
|
@@ -46,4 +46,6 @@ var cssr_1 = require("./cssr");
|
|
|
46
46
|
Object.defineProperty(exports, "createKey", { enumerable: true, get: function () { return cssr_1.createKey; } });
|
|
47
47
|
var is_jsdom_1 = require("./env/is-jsdom");
|
|
48
48
|
Object.defineProperty(exports, "isJsdom", { enumerable: true, get: function () { return is_jsdom_1.isJsdom; } });
|
|
49
|
+
var is_browser_1 = require("./env/is-browser");
|
|
50
|
+
Object.defineProperty(exports, "isBrowser", { enumerable: true, get: function () { return is_browser_1.isBrowser; } });
|
|
49
51
|
__exportStar(require("./composable"), exports);
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.getTitleAttribute = exports.largerSize = exports.smallerSize = exports.throwError = exports.warnOnce = exports.warn = void 0;
|
|
18
4
|
var warn_1 = require("./warn");
|
|
@@ -24,4 +10,3 @@ Object.defineProperty(exports, "smallerSize", { enumerable: true, get: function
|
|
|
24
10
|
Object.defineProperty(exports, "largerSize", { enumerable: true, get: function () { return prop_1.largerSize; } });
|
|
25
11
|
var attribute_1 = require("./attribute");
|
|
26
12
|
Object.defineProperty(exports, "getTitleAttribute", { enumerable: true, get: function () { return attribute_1.getTitleAttribute; } });
|
|
27
|
-
__exportStar(require("./window"), exports);
|
|
@@ -8,7 +8,9 @@ const cssr_1 = require("../../../_utils/cssr");
|
|
|
8
8
|
|
|
9
9
|
const fade_in_width_expand_cssr_1 = require("../../../_styles/transitions/fade-in-width-expand.cssr");
|
|
10
10
|
|
|
11
|
-
const icon_switch_cssr_1 = require("../../../_styles/transitions/icon-switch.cssr");
|
|
11
|
+
const icon_switch_cssr_1 = require("../../../_styles/transitions/icon-switch.cssr");
|
|
12
|
+
|
|
13
|
+
const _utils_1 = require("../../../_utils"); // vars:
|
|
12
14
|
// --n-bezier
|
|
13
15
|
// --n-bezier-ease-out
|
|
14
16
|
// --n-ripple-duration
|
|
@@ -123,7 +125,7 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('button', `
|
|
|
123
125
|
`, [(0, cssr_1.cM)('active', {
|
|
124
126
|
zIndex: 1,
|
|
125
127
|
animationName: 'button-wave-spread, button-wave-opacity'
|
|
126
|
-
})]),
|
|
128
|
+
})]), _utils_1.isBrowser && 'MozBoxSizing' in document.createElement('div').style ? (0, cssr_1.c)('&::moz-focus-inner', {
|
|
127
129
|
border: 0
|
|
128
130
|
}) : null, (0, cssr_1.cE)('border, state-border', `
|
|
129
131
|
position: absolute;
|
|
@@ -129,9 +129,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
129
129
|
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
130
130
|
const normalizedValue = mergedValue && (0, date_fns_1.startOfDay)(mergedValue).valueOf();
|
|
131
131
|
const year = (0, date_fns_1.getYear)(monthTs);
|
|
132
|
+
const calendarMonth = (0, date_fns_1.getMonth)(monthTs) + 1;
|
|
132
133
|
return ((0, vue_1.h)("div", { class: [`${mergedClsPrefix}-calendar`, this.themeClass], style: cssVars },
|
|
133
134
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-calendar-header` },
|
|
134
|
-
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-calendar-header__title` }, (0, _utils_1.resolveSlotWithProps)($slots.header, { year, month:
|
|
135
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-calendar-header__title` }, (0, _utils_1.resolveSlotWithProps)($slots.header, { year, month: calendarMonth }, () => {
|
|
135
136
|
const localeMonth = (0, date_fns_1.format)(monthTs, 'MMMM', { locale });
|
|
136
137
|
return [
|
|
137
138
|
monthBeforeYear
|
|
@@ -158,7 +159,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
158
159
|
const notInCurrentMonth = !inCurrentMonth;
|
|
159
160
|
const disabled = (isDateDisabled === null || isDateDisabled === void 0 ? void 0 : isDateDisabled(ts)) === true;
|
|
160
161
|
const selected = normalizedValue === (0, date_fns_1.startOfDay)(ts).valueOf();
|
|
161
|
-
return ((0, vue_1.h)("div", { key:
|
|
162
|
+
return ((0, vue_1.h)("div", { key: `${calendarMonth}-${index}`, class: [
|
|
162
163
|
`${mergedClsPrefix}-calendar-cell`,
|
|
163
164
|
disabled && `${mergedClsPrefix}-calendar-cell--disabled`,
|
|
164
165
|
notInCurrentMonth &&
|
|
@@ -168,17 +169,25 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
168
169
|
`${mergedClsPrefix}-calendar-cell--current`,
|
|
169
170
|
selected && `${mergedClsPrefix}-calendar-cell--selected`
|
|
170
171
|
], onClick: () => {
|
|
172
|
+
var _a;
|
|
171
173
|
if (disabled)
|
|
172
174
|
return;
|
|
175
|
+
const monthTs = (0, date_fns_1.startOfMonth)(ts).valueOf();
|
|
176
|
+
this.monthTs = monthTs;
|
|
177
|
+
if (notInCurrentMonth) {
|
|
178
|
+
(_a = this.onPanelChange) === null || _a === void 0 ? void 0 : _a.call(this, {
|
|
179
|
+
year: (0, date_fns_1.getYear)(monthTs),
|
|
180
|
+
month: (0, date_fns_1.getMonth)(monthTs) + 1
|
|
181
|
+
});
|
|
182
|
+
}
|
|
173
183
|
this.doUpdateValue(ts, {
|
|
174
184
|
year,
|
|
175
185
|
month: month + 1,
|
|
176
186
|
date
|
|
177
187
|
});
|
|
178
|
-
this.monthTs = (0, date_fns_1.startOfMonth)(ts).valueOf();
|
|
179
188
|
} },
|
|
180
189
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-calendar-date` },
|
|
181
|
-
|
|
190
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-calendar-date__date`, title: fullDate }, date),
|
|
182
191
|
index < 7 && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-calendar-date__day`, title: fullDate }, (0, date_fns_1.format)(ts, 'EEE', {
|
|
183
192
|
locale
|
|
184
193
|
})))), (_a = $slots.default) === null || _a === void 0 ? void 0 :
|
|
@@ -187,7 +196,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
187
196
|
month: month + 1,
|
|
188
197
|
date
|
|
189
198
|
}),
|
|
190
|
-
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-calendar-cell__bar
|
|
199
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-calendar-cell__bar` })));
|
|
191
200
|
}))));
|
|
192
201
|
}
|
|
193
202
|
});
|
|
@@ -329,6 +329,36 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
329
329
|
const showSelectMenuRef = (0, vue_1.computed)(() => {
|
|
330
330
|
return !!(props.filterable && patternRef.value);
|
|
331
331
|
});
|
|
332
|
+
// init hover key
|
|
333
|
+
(0, vue_1.watch)(mergedShowRef, (show) => {
|
|
334
|
+
if (!show)
|
|
335
|
+
return;
|
|
336
|
+
if (props.multiple)
|
|
337
|
+
return;
|
|
338
|
+
const { value } = mergedValueRef;
|
|
339
|
+
if (!Array.isArray(value) && value !== null) {
|
|
340
|
+
keyboardKeyRef.value = value;
|
|
341
|
+
hoverKeyRef.value = value;
|
|
342
|
+
void (0, vue_1.nextTick)(() => {
|
|
343
|
+
var _a;
|
|
344
|
+
if (!mergedShowRef.value)
|
|
345
|
+
return;
|
|
346
|
+
const { value: hoverKey } = hoverKeyRef;
|
|
347
|
+
if (mergedValueRef.value !== null) {
|
|
348
|
+
const node = treeMateRef.value.getNode(hoverKey);
|
|
349
|
+
if (node) {
|
|
350
|
+
(_a = cascaderMenuInstRef.value) === null || _a === void 0 ? void 0 : _a.scroll(node.level, node.index, (0, seemly_1.depx)(optionHeightRef.value));
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
keyboardKeyRef.value = null;
|
|
357
|
+
hoverKeyRef.value = null;
|
|
358
|
+
}
|
|
359
|
+
}, {
|
|
360
|
+
immediate: true
|
|
361
|
+
});
|
|
332
362
|
// --- methods
|
|
333
363
|
function doBlur(e) {
|
|
334
364
|
const { onBlur } = props;
|
package/lib/drawer/src/Drawer.js
CHANGED
|
@@ -26,7 +26,7 @@ const drawerProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), {
|
|
|
26
26
|
type: Boolean,
|
|
27
27
|
default: true
|
|
28
28
|
}, showMask: {
|
|
29
|
-
type: Boolean,
|
|
29
|
+
type: [Boolean, String],
|
|
30
30
|
default: true
|
|
31
31
|
}, to: [String, Object], displayDirective: {
|
|
32
32
|
type: String,
|
package/lib/empty/src/Empty.js
CHANGED
|
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const vue_1 = require("vue");
|
|
7
7
|
const context_1 = require("../../config-provider/src/context");
|
|
8
|
+
const icon_1 = require("../../_internal/icon");
|
|
8
9
|
const icons_1 = require("../../_internal/icons");
|
|
9
10
|
const _mixins_1 = require("../../_mixins");
|
|
10
11
|
const _utils_1 = require("../../_utils");
|
|
11
|
-
const _internal_1 = require("../../_internal");
|
|
12
12
|
const styles_1 = require("../styles");
|
|
13
13
|
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
14
14
|
const emptyProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { description: String, showDescription: {
|
|
@@ -73,7 +73,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
73
73
|
const { $slots, mergedClsPrefix, onRender } = this;
|
|
74
74
|
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
75
75
|
return ((0, vue_1.h)("div", { class: [`${mergedClsPrefix}-empty`, this.themeClass], style: this.cssVars },
|
|
76
|
-
this.showIcon ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-empty__icon` }, $slots.icon ? ($slots.icon()) : ((0, vue_1.h)(
|
|
76
|
+
this.showIcon ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-empty__icon` }, $slots.icon ? ($slots.icon()) : ((0, vue_1.h)(icon_1.NBaseIcon, { clsPrefix: mergedClsPrefix }, { default: this.mergedRenderIcon })))) : null,
|
|
77
77
|
this.showDescription ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-empty__description` }, $slots.default ? $slots.default() : this.localizedDescription)) : null,
|
|
78
78
|
$slots.extra ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-empty__extra` }, $slots.extra())) : null));
|
|
79
79
|
}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -17,9 +17,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.NThemeEditor = exports.version = exports.cNotM = exports.cB = exports.cM = exports.cE = exports.c = exports.createTheme = exports.lightTheme = exports.darkTheme = exports.create = exports.useOsTheme = exports.default = void 0;
|
|
20
|
+
exports.NThemeEditor = exports.version = exports.cNotM = exports.cB = exports.cM = exports.cE = exports.c = exports.createTheme = exports.lightTheme = exports.darkTheme = exports.create = exports.useOsTheme = exports.install = exports.default = void 0;
|
|
21
21
|
var preset_1 = require("./preset");
|
|
22
22
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(preset_1).default; } });
|
|
23
|
+
Object.defineProperty(exports, "install", { enumerable: true, get: function () { return preset_1.install; } });
|
|
23
24
|
var vooks_1 = require("vooks");
|
|
24
25
|
Object.defineProperty(exports, "useOsTheme", { enumerable: true, get: function () { return vooks_1.useOsTheme; } });
|
|
25
26
|
var create_1 = require("./create");
|
package/lib/jest-setup.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/jest-setup.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _utils_1 = require("./_utils");
|
|
2
4
|
// https://github.com/jsdom/jsdom/issues/1422
|
|
3
|
-
if (
|
|
5
|
+
if (_utils_1.isBrowser) {
|
|
4
6
|
HTMLDivElement.prototype.scrollTo = () => { };
|
|
5
7
|
}
|
package/lib/mention/src/utils.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.setElementPositionBasedOnCaret = exports.getRelativePosition = exports.getAbsolutePosition = void 0;
|
|
10
|
+
const _utils_1 = require("../../_utils");
|
|
10
11
|
/**
|
|
11
12
|
* Returns the Absolute (relative to the inner window size) position of the caret in the given element.
|
|
12
13
|
* @param element Input (has to be type='text') or Text Area.
|
|
@@ -73,8 +74,7 @@ function getRelativePosition(element, options = {
|
|
|
73
74
|
];
|
|
74
75
|
// Firefox 1.0+
|
|
75
76
|
const isFirefox = navigator.userAgent.toLowerCase().includes('firefox');
|
|
76
|
-
|
|
77
|
-
if (!isBrowser) {
|
|
77
|
+
if (!_utils_1.isBrowser) {
|
|
78
78
|
throw new Error('textarea-caret-position#getCaretPosition should only be called in a browser');
|
|
79
79
|
}
|
|
80
80
|
const debug = options === null || options === void 0 ? void 0 : options.debug;
|
package/lib/preset.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export default
|
|
1
|
+
declare const naive: import("./create").NUiInstance;
|
|
2
|
+
export default naive;
|
|
3
|
+
export declare const install: (app: import("vue").App<any>) => void;
|
package/lib/preset.js
CHANGED
|
@@ -26,8 +26,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.install = void 0;
|
|
29
30
|
const components = __importStar(require("./components"));
|
|
30
31
|
const create_1 = __importDefault(require("./create"));
|
|
31
|
-
|
|
32
|
+
const naive = (0, create_1.default)({
|
|
32
33
|
components: Object.keys(components).map((key) => components[key])
|
|
33
34
|
});
|
|
35
|
+
exports.default = naive;
|
|
36
|
+
exports.install = naive.install;
|
package/lib/space/src/Space.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
69
69
|
gapLarge: string;
|
|
70
70
|
}, any>>>;
|
|
71
71
|
}, {
|
|
72
|
+
useGap: boolean;
|
|
72
73
|
rtlEnabled: import("vue").Ref<import("../../config-provider/src/internal-interface").RtlItem | undefined> | undefined;
|
|
73
74
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
74
75
|
margin: import("vue").ComputedRef<{
|
package/lib/space/src/Space.js
CHANGED
|
@@ -9,6 +9,7 @@ const _utils_1 = require("../../_utils");
|
|
|
9
9
|
const _mixins_1 = require("../../_mixins");
|
|
10
10
|
const styles_1 = require("../styles");
|
|
11
11
|
const use_rtl_1 = __importDefault(require("../../_mixins/use-rtl"));
|
|
12
|
+
const utils_1 = require("./utils");
|
|
12
13
|
const spaceProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { align: String, justify: {
|
|
13
14
|
type: String,
|
|
14
15
|
default: 'start'
|
|
@@ -27,6 +28,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
27
28
|
const themeRef = (0, _mixins_1.useTheme)('Space', '-space', undefined, styles_1.spaceLight, props, mergedClsPrefixRef);
|
|
28
29
|
const rtlEnabledRef = (0, use_rtl_1.default)('Space', mergedRtlRef, mergedClsPrefixRef);
|
|
29
30
|
return {
|
|
31
|
+
useGap: (0, utils_1.ensureSupportFlexGap)(),
|
|
30
32
|
rtlEnabled: rtlEnabledRef,
|
|
31
33
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
32
34
|
margin: (0, vue_1.computed)(() => {
|
|
@@ -53,7 +55,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
53
55
|
};
|
|
54
56
|
},
|
|
55
57
|
render() {
|
|
56
|
-
const { vertical, align, inline, justify, itemStyle, margin, wrap, mergedClsPrefix, rtlEnabled } = this;
|
|
58
|
+
const { vertical, align, inline, justify, itemStyle, margin, wrap, mergedClsPrefix, rtlEnabled, useGap } = this;
|
|
57
59
|
const children = (0, _utils_1.flatten)((0, _utils_1.getSlot)(this));
|
|
58
60
|
if (!children.length)
|
|
59
61
|
return null;
|
|
@@ -73,51 +75,54 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
73
75
|
? 'flex-' + justify
|
|
74
76
|
: justify,
|
|
75
77
|
flexWrap: !wrap || vertical ? 'nowrap' : 'wrap',
|
|
76
|
-
marginTop: vertical ? '' : `-${semiVerticalMargin}`,
|
|
77
|
-
marginBottom: vertical ? '' : `-${semiVerticalMargin}`,
|
|
78
|
-
alignItems: align
|
|
78
|
+
marginTop: useGap || vertical ? '' : `-${semiVerticalMargin}`,
|
|
79
|
+
marginBottom: useGap || vertical ? '' : `-${semiVerticalMargin}`,
|
|
80
|
+
alignItems: align,
|
|
81
|
+
gap: useGap ? `${margin.vertical}px ${margin.horizontal}px` : ''
|
|
79
82
|
} }, children.map((child, index) => ((0, vue_1.h)("div", { role: "none", style: [
|
|
80
83
|
itemStyle,
|
|
81
84
|
{
|
|
82
85
|
maxWidth: '100%'
|
|
83
86
|
},
|
|
84
|
-
|
|
85
|
-
?
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
: rtlEnabled
|
|
87
|
+
useGap
|
|
88
|
+
? ''
|
|
89
|
+
: vertical
|
|
89
90
|
? {
|
|
90
|
-
|
|
91
|
-
? justify === 'space-between' && index === lastIndex
|
|
92
|
-
? ''
|
|
93
|
-
: semiHorizontalMargin
|
|
94
|
-
: index !== lastIndex
|
|
95
|
-
? horizontalMargin
|
|
96
|
-
: '',
|
|
97
|
-
marginRight: isJustifySpace
|
|
98
|
-
? justify === 'space-between' && index === 0
|
|
99
|
-
? ''
|
|
100
|
-
: semiHorizontalMargin
|
|
101
|
-
: '',
|
|
102
|
-
paddingTop: semiVerticalMargin,
|
|
103
|
-
paddingBottom: semiVerticalMargin
|
|
91
|
+
marginBottom: index !== lastIndex ? verticalMargin : ''
|
|
104
92
|
}
|
|
105
|
-
:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
? ''
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
93
|
+
: rtlEnabled
|
|
94
|
+
? {
|
|
95
|
+
marginLeft: isJustifySpace
|
|
96
|
+
? justify === 'space-between' && index === lastIndex
|
|
97
|
+
? ''
|
|
98
|
+
: semiHorizontalMargin
|
|
99
|
+
: index !== lastIndex
|
|
100
|
+
? horizontalMargin
|
|
101
|
+
: '',
|
|
102
|
+
marginRight: isJustifySpace
|
|
103
|
+
? justify === 'space-between' && index === 0
|
|
104
|
+
? ''
|
|
105
|
+
: semiHorizontalMargin
|
|
112
106
|
: '',
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
107
|
+
paddingTop: semiVerticalMargin,
|
|
108
|
+
paddingBottom: semiVerticalMargin
|
|
109
|
+
}
|
|
110
|
+
: {
|
|
111
|
+
marginRight: isJustifySpace
|
|
112
|
+
? justify === 'space-between' && index === lastIndex
|
|
113
|
+
? ''
|
|
114
|
+
: semiHorizontalMargin
|
|
115
|
+
: index !== lastIndex
|
|
116
|
+
? horizontalMargin
|
|
117
|
+
: '',
|
|
118
|
+
marginLeft: isJustifySpace
|
|
119
|
+
? justify === 'space-between' && index === 0
|
|
120
|
+
? ''
|
|
121
|
+
: semiHorizontalMargin
|
|
122
|
+
: '',
|
|
123
|
+
paddingTop: semiVerticalMargin,
|
|
124
|
+
paddingBottom: semiVerticalMargin
|
|
125
|
+
}
|
|
121
126
|
] }, child)))));
|
|
122
127
|
}
|
|
123
128
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ensureSupportFlexGap: () => boolean;
|