naive-ui 2.32.2 → 2.33.2
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 +425 -248
- package/dist/index.prod.js +2 -2
- package/es/_internal/select-menu/src/SelectOption.js +1 -2
- package/es/_utils/cssr/index.js +1 -1
- package/es/calendar/src/Calendar.js +2 -1
- package/es/card/src/Card.d.ts +24 -1
- package/es/card/src/Card.js +8 -4
- package/es/card/src/styles/index.cssr.js +17 -8
- package/es/card/styles/dark.js +3 -1
- package/es/card/styles/light.d.ts +2 -0
- package/es/card/styles/light.js +1 -1
- package/es/countdown/src/Countdown.js +0 -5
- package/es/data-table/src/DataTable.d.ts +10 -0
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +1 -0
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +1 -0
- package/es/data-table/src/TableParts/Body.d.ts +1 -0
- package/es/data-table/src/TableParts/Cell.d.ts +2 -0
- package/es/data-table/src/TableParts/Header.d.ts +1 -0
- package/es/data-table/src/use-sorter.js +1 -1
- package/es/data-table/styles/light.d.ts +1 -0
- package/es/dialog/index.d.ts +1 -1
- package/es/dialog/index.js +1 -1
- package/es/dialog/src/DialogEnvironment.d.ts +3 -0
- package/es/dialog/src/DialogEnvironment.js +2 -2
- package/es/dialog/src/DialogProvider.d.ts +4 -0
- package/es/dialog/src/DialogProvider.js +2 -1
- package/es/dialog/src/composables.d.ts +4 -0
- package/es/dialog/src/composables.js +17 -0
- package/es/dialog/src/context.d.ts +2 -1
- package/es/dialog/src/context.js +1 -0
- package/es/form/src/FormItem.d.ts +1 -0
- package/es/form/src/FormItem.js +27 -18
- package/es/form/src/styles/form-item.cssr.js +41 -19
- package/es/form/src/utils.d.ts +1 -0
- package/es/form/src/utils.js +15 -10
- package/es/input/src/utils.js +1 -1
- package/es/locales/common/frFR.js +8 -11
- package/es/menu/src/Menu.d.ts +13 -0
- package/es/menu/src/Menu.js +7 -1
- package/es/modal/src/BodyWrapper.d.ts +2 -0
- package/es/modal/src/Modal.d.ts +18 -0
- package/es/modal/src/presetProps.d.ts +1 -1
- package/es/modal/styles/light.d.ts +2 -0
- package/es/pagination/src/Pagination.js +5 -1
- package/es/radio/src/Radio.d.ts +13 -32
- package/es/radio/src/Radio.js +7 -6
- package/es/radio/src/RadioButton.d.ts +6 -9
- package/es/radio/src/RadioButton.js +7 -11
- package/es/radio/src/RadioGroup.d.ts +17 -8
- package/es/radio/src/RadioGroup.js +2 -2
- package/es/radio/src/interface.d.ts +2 -2
- package/es/radio/src/styles/radio.cssr.js +4 -1
- package/es/radio/src/use-radio.d.ts +4 -32
- package/es/radio/src/use-radio.js +12 -10
- package/es/radio/styles/dark.js +1 -1
- package/es/radio/styles/light.d.ts +1 -0
- package/es/radio/styles/light.js +1 -1
- package/es/rate/src/Rate.d.ts +23 -14
- package/es/rate/src/Rate.js +32 -12
- package/es/rate/src/interface.d.ts +2 -0
- package/es/rate/src/interface.js +1 -0
- package/es/rate/src/styles/index.cssr.js +13 -13
- package/es/slider/src/Slider.d.ts +13 -0
- package/es/slider/src/Slider.js +6 -3
- package/es/theme-editor/src/MaximizeIcon.d.ts +1 -0
- package/es/theme-editor/src/MaximizeIcon.js +8 -0
- package/es/theme-editor/src/MinimizeIcon.d.ts +1 -0
- package/es/theme-editor/src/MinimizeIcon.js +8 -0
- package/es/theme-editor/src/ThemeEditor.d.ts +4 -0
- package/es/theme-editor/src/ThemeEditor.js +42 -18
- package/es/tree/src/styles/index.cssr.js +4 -3
- package/es/upload/src/interface.d.ts +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/select-menu/src/SelectOption.js +1 -2
- package/lib/_utils/cssr/index.js +2 -5
- package/lib/calendar/src/Calendar.js +2 -1
- package/lib/card/src/Card.d.ts +24 -1
- package/lib/card/src/Card.js +8 -4
- package/lib/card/src/styles/index.cssr.js +17 -8
- package/lib/card/styles/dark.js +3 -1
- package/lib/card/styles/light.d.ts +2 -0
- package/lib/card/styles/light.js +1 -1
- package/lib/countdown/src/Countdown.js +0 -5
- package/lib/data-table/src/DataTable.d.ts +10 -0
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +1 -0
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +1 -0
- package/lib/data-table/src/TableParts/Body.d.ts +1 -0
- package/lib/data-table/src/TableParts/Cell.d.ts +2 -0
- package/lib/data-table/src/TableParts/Header.d.ts +1 -0
- package/lib/data-table/src/use-sorter.js +1 -1
- package/lib/data-table/styles/light.d.ts +1 -0
- package/lib/dialog/index.d.ts +1 -1
- package/lib/dialog/index.js +4 -3
- package/lib/dialog/src/DialogEnvironment.d.ts +3 -0
- package/lib/dialog/src/DialogEnvironment.js +2 -2
- package/lib/dialog/src/DialogProvider.d.ts +4 -0
- package/lib/dialog/src/DialogProvider.js +1 -0
- package/lib/dialog/src/composables.d.ts +4 -0
- package/lib/dialog/src/{use-dialog.js → composables.js} +9 -1
- package/lib/dialog/src/context.d.ts +2 -1
- package/lib/dialog/src/context.js +2 -1
- package/lib/form/src/FormItem.d.ts +1 -0
- package/lib/form/src/FormItem.js +27 -18
- package/lib/form/src/styles/form-item.cssr.js +41 -19
- package/lib/form/src/utils.d.ts +1 -0
- package/lib/form/src/utils.js +15 -10
- package/lib/input/src/utils.js +1 -1
- package/lib/locales/common/frFR.js +8 -11
- package/lib/menu/src/Menu.d.ts +13 -0
- package/lib/menu/src/Menu.js +7 -1
- package/lib/modal/src/BodyWrapper.d.ts +2 -0
- package/lib/modal/src/Modal.d.ts +18 -0
- package/lib/modal/src/presetProps.d.ts +1 -1
- package/lib/modal/styles/light.d.ts +2 -0
- package/lib/pagination/src/Pagination.js +5 -1
- package/lib/radio/src/Radio.d.ts +13 -32
- package/lib/radio/src/Radio.js +7 -6
- package/lib/radio/src/RadioButton.d.ts +6 -9
- package/lib/radio/src/RadioButton.js +7 -14
- package/lib/radio/src/RadioGroup.d.ts +17 -8
- package/lib/radio/src/RadioGroup.js +2 -2
- package/lib/radio/src/interface.d.ts +2 -2
- package/lib/radio/src/styles/radio.cssr.js +4 -1
- package/lib/radio/src/use-radio.d.ts +4 -32
- package/lib/radio/src/use-radio.js +11 -9
- package/lib/radio/styles/dark.js +1 -1
- package/lib/radio/styles/light.d.ts +1 -0
- package/lib/radio/styles/light.js +1 -1
- package/lib/rate/src/Rate.d.ts +23 -14
- package/lib/rate/src/Rate.js +32 -12
- package/lib/rate/src/interface.d.ts +2 -0
- package/lib/rate/src/interface.js +2 -0
- package/lib/rate/src/styles/index.cssr.js +13 -13
- package/lib/slider/src/Slider.d.ts +13 -0
- package/lib/slider/src/Slider.js +6 -3
- package/lib/theme-editor/src/MaximizeIcon.d.ts +1 -0
- package/lib/theme-editor/src/MaximizeIcon.js +11 -0
- package/lib/theme-editor/src/MinimizeIcon.d.ts +1 -0
- package/lib/theme-editor/src/MinimizeIcon.js +11 -0
- package/lib/theme-editor/src/ThemeEditor.d.ts +4 -0
- package/lib/theme-editor/src/ThemeEditor.js +42 -18
- package/lib/tree/src/styles/index.cssr.js +4 -3
- package/lib/upload/src/interface.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +8 -7
- package/web-types.json +36 -5
- package/es/countdown/src/utils.d.ts +0 -0
- package/es/countdown/src/utils.js +0 -1
- package/es/dialog/src/use-dialog.d.ts +0 -2
- package/es/dialog/src/use-dialog.js +0 -10
- package/lib/countdown/src/utils.d.ts +0 -0
- package/lib/countdown/src/utils.js +0 -1
- package/lib/dialog/src/use-dialog.d.ts +0 -2
|
@@ -4,11 +4,10 @@ import { render, mergeEventHandlers } from '../../../_utils';
|
|
|
4
4
|
import { CheckmarkIcon } from '../../icons';
|
|
5
5
|
import { NBaseIcon } from '../../icon';
|
|
6
6
|
import { internalSelectionMenuInjectionKey } from './interface';
|
|
7
|
-
const checkMarkIcon = h(CheckmarkIcon);
|
|
8
7
|
function renderCheckMark(show, clsPrefix) {
|
|
9
8
|
return (h(Transition, { name: "fade-in-scale-up-transition" }, {
|
|
10
9
|
default: () => show ? (h(NBaseIcon, { clsPrefix: clsPrefix, class: `${clsPrefix}-base-select-option__check` }, {
|
|
11
|
-
default: () =>
|
|
10
|
+
default: () => h(CheckmarkIcon)
|
|
12
11
|
})) : null
|
|
13
12
|
}));
|
|
14
13
|
}
|
package/es/_utils/cssr/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
2
2
|
import { CssRender } from 'css-render';
|
|
3
|
-
import BemPlugin from '@css-render/plugin-bem';
|
|
3
|
+
import { plugin as BemPlugin } from '@css-render/plugin-bem';
|
|
4
4
|
const namespace = 'n';
|
|
5
5
|
const prefix = `.${namespace}-`;
|
|
6
6
|
const elementPrefix = '__';
|
|
@@ -18,12 +18,13 @@ export default defineComponent({
|
|
|
18
18
|
name: 'Calendar',
|
|
19
19
|
props: calendarProps,
|
|
20
20
|
setup(props) {
|
|
21
|
+
var _a;
|
|
21
22
|
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
22
23
|
const themeRef = useTheme('Calendar', '-calendar', style, calendarLight, props, mergedClsPrefixRef);
|
|
23
24
|
const { localeRef, dateLocaleRef } = useLocale('DatePicker');
|
|
24
25
|
const now = Date.now();
|
|
25
26
|
// ts => timestamp
|
|
26
|
-
const monthTsRef = ref(startOfMonth(now).valueOf());
|
|
27
|
+
const monthTsRef = ref(startOfMonth((_a = props.defaultValue) !== null && _a !== void 0 ? _a : now).valueOf());
|
|
27
28
|
const uncontrolledValueRef = ref(props.defaultValue || null);
|
|
28
29
|
const mergedValueRef = useMergedState(toRef(props, 'value'), uncontrolledValueRef);
|
|
29
30
|
function doUpdateValue(value, time) {
|
package/es/card/src/Card.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare const cardBaseProps: {
|
|
|
32
32
|
readonly role: StringConstructor;
|
|
33
33
|
readonly onClose: PropType<MaybeArray<() => void>>;
|
|
34
34
|
};
|
|
35
|
-
export declare const cardBasePropKeys: ("size" | "title" | "role" | "bordered" | "closable" | "contentStyle" | "onClose" | "headerStyle" | "footerStyle" | "hoverable" | "
|
|
35
|
+
export declare const cardBasePropKeys: ("size" | "title" | "role" | "bordered" | "closable" | "contentStyle" | "onClose" | "headerStyle" | "footerStyle" | "hoverable" | "embedded" | "headerExtraStyle" | "segmented")[];
|
|
36
36
|
export declare const cardProps: {
|
|
37
37
|
title: StringConstructor;
|
|
38
38
|
contentStyle: PropType<string | CSSProperties>;
|
|
@@ -66,6 +66,8 @@ export declare const cardProps: {
|
|
|
66
66
|
colorPopover: string;
|
|
67
67
|
colorTarget: string;
|
|
68
68
|
colorEmbedded: string;
|
|
69
|
+
colorEmbeddedModal: string;
|
|
70
|
+
colorEmbeddedPopover: string;
|
|
69
71
|
textColor: string;
|
|
70
72
|
titleTextColor: string;
|
|
71
73
|
borderColor: string;
|
|
@@ -101,6 +103,8 @@ export declare const cardProps: {
|
|
|
101
103
|
colorPopover: string;
|
|
102
104
|
colorTarget: string;
|
|
103
105
|
colorEmbedded: string;
|
|
106
|
+
colorEmbeddedModal: string;
|
|
107
|
+
colorEmbeddedPopover: string;
|
|
104
108
|
textColor: string;
|
|
105
109
|
titleTextColor: string;
|
|
106
110
|
borderColor: string;
|
|
@@ -136,6 +140,8 @@ export declare const cardProps: {
|
|
|
136
140
|
colorPopover: string;
|
|
137
141
|
colorTarget: string;
|
|
138
142
|
colorEmbedded: string;
|
|
143
|
+
colorEmbeddedModal: string;
|
|
144
|
+
colorEmbeddedPopover: string;
|
|
139
145
|
textColor: string;
|
|
140
146
|
titleTextColor: string;
|
|
141
147
|
borderColor: string;
|
|
@@ -199,6 +205,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
199
205
|
colorPopover: string;
|
|
200
206
|
colorTarget: string;
|
|
201
207
|
colorEmbedded: string;
|
|
208
|
+
colorEmbeddedModal: string;
|
|
209
|
+
colorEmbeddedPopover: string;
|
|
202
210
|
textColor: string;
|
|
203
211
|
titleTextColor: string;
|
|
204
212
|
borderColor: string;
|
|
@@ -234,6 +242,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
234
242
|
colorPopover: string;
|
|
235
243
|
colorTarget: string;
|
|
236
244
|
colorEmbedded: string;
|
|
245
|
+
colorEmbeddedModal: string;
|
|
246
|
+
colorEmbeddedPopover: string;
|
|
237
247
|
textColor: string;
|
|
238
248
|
titleTextColor: string;
|
|
239
249
|
borderColor: string;
|
|
@@ -269,6 +279,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
269
279
|
colorPopover: string;
|
|
270
280
|
colorTarget: string;
|
|
271
281
|
colorEmbedded: string;
|
|
282
|
+
colorEmbeddedModal: string;
|
|
283
|
+
colorEmbeddedPopover: string;
|
|
272
284
|
textColor: string;
|
|
273
285
|
titleTextColor: string;
|
|
274
286
|
borderColor: string;
|
|
@@ -413,6 +425,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
413
425
|
colorPopover: string;
|
|
414
426
|
colorTarget: string;
|
|
415
427
|
colorEmbedded: string;
|
|
428
|
+
colorEmbeddedModal: string;
|
|
429
|
+
colorEmbeddedPopover: string;
|
|
416
430
|
textColor: string;
|
|
417
431
|
titleTextColor: string;
|
|
418
432
|
borderColor: string;
|
|
@@ -453,6 +467,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
453
467
|
'--n-color': string;
|
|
454
468
|
'--n-color-modal': string;
|
|
455
469
|
'--n-color-popover': string;
|
|
470
|
+
'--n-color-embedded': string;
|
|
471
|
+
'--n-color-embedded-modal': string;
|
|
472
|
+
'--n-color-embedded-popover': string;
|
|
456
473
|
'--n-color-target': string;
|
|
457
474
|
'--n-text-color': string;
|
|
458
475
|
'--n-line-height': string;
|
|
@@ -510,6 +527,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
510
527
|
colorPopover: string;
|
|
511
528
|
colorTarget: string;
|
|
512
529
|
colorEmbedded: string;
|
|
530
|
+
colorEmbeddedModal: string;
|
|
531
|
+
colorEmbeddedPopover: string;
|
|
513
532
|
textColor: string;
|
|
514
533
|
titleTextColor: string;
|
|
515
534
|
borderColor: string;
|
|
@@ -545,6 +564,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
545
564
|
colorPopover: string;
|
|
546
565
|
colorTarget: string;
|
|
547
566
|
colorEmbedded: string;
|
|
567
|
+
colorEmbeddedModal: string;
|
|
568
|
+
colorEmbeddedPopover: string;
|
|
548
569
|
textColor: string;
|
|
549
570
|
titleTextColor: string;
|
|
550
571
|
borderColor: string;
|
|
@@ -580,6 +601,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
580
601
|
colorPopover: string;
|
|
581
602
|
colorTarget: string;
|
|
582
603
|
colorEmbedded: string;
|
|
604
|
+
colorEmbeddedModal: string;
|
|
605
|
+
colorEmbeddedPopover: string;
|
|
583
606
|
textColor: string;
|
|
584
607
|
titleTextColor: string;
|
|
585
608
|
borderColor: string;
|
package/es/card/src/Card.js
CHANGED
|
@@ -49,14 +49,17 @@ export default defineComponent({
|
|
|
49
49
|
const rtlEnabledRef = useRtl('Card', mergedRtlRef, mergedClsPrefixRef);
|
|
50
50
|
const cssVarsRef = computed(() => {
|
|
51
51
|
const { size } = props;
|
|
52
|
-
const { self: { color, colorModal, colorTarget, textColor, titleTextColor, titleFontWeight, borderColor, actionColor, borderRadius, lineHeight, closeIconColor, closeIconColorHover, closeIconColorPressed, closeColorHover, closeColorPressed, closeBorderRadius, closeIconSize, closeSize, boxShadow, colorPopover, colorEmbedded, [createKey('padding', size)]: padding, [createKey('fontSize', size)]: fontSize, [createKey('titleFontSize', size)]: titleFontSize }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
52
|
+
const { self: { color, colorModal, colorTarget, textColor, titleTextColor, titleFontWeight, borderColor, actionColor, borderRadius, lineHeight, closeIconColor, closeIconColorHover, closeIconColorPressed, closeColorHover, closeColorPressed, closeBorderRadius, closeIconSize, closeSize, boxShadow, colorPopover, colorEmbedded, colorEmbeddedModal, colorEmbeddedPopover, [createKey('padding', size)]: padding, [createKey('fontSize', size)]: fontSize, [createKey('titleFontSize', size)]: titleFontSize }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
53
53
|
const { top: paddingTop, left: paddingLeft, bottom: paddingBottom } = getPadding(padding);
|
|
54
54
|
return {
|
|
55
55
|
'--n-bezier': cubicBezierEaseInOut,
|
|
56
56
|
'--n-border-radius': borderRadius,
|
|
57
|
-
'--n-color':
|
|
57
|
+
'--n-color': color,
|
|
58
58
|
'--n-color-modal': colorModal,
|
|
59
59
|
'--n-color-popover': colorPopover,
|
|
60
|
+
'--n-color-embedded': colorEmbedded,
|
|
61
|
+
'--n-color-embedded-modal': colorEmbeddedModal,
|
|
62
|
+
'--n-color-embedded-popover': colorEmbeddedPopover,
|
|
60
63
|
'--n-color-target': colorTarget,
|
|
61
64
|
'--n-text-color': textColor,
|
|
62
65
|
'--n-line-height': lineHeight,
|
|
@@ -97,11 +100,12 @@ export default defineComponent({
|
|
|
97
100
|
};
|
|
98
101
|
},
|
|
99
102
|
render() {
|
|
100
|
-
const { segmented, bordered, hoverable, mergedClsPrefix, rtlEnabled, onRender, $slots } = this;
|
|
103
|
+
const { segmented, bordered, hoverable, mergedClsPrefix, rtlEnabled, onRender, embedded, $slots } = this;
|
|
101
104
|
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
102
105
|
return (h("div", { class: [
|
|
103
106
|
`${mergedClsPrefix}-card`,
|
|
104
107
|
this.themeClass,
|
|
108
|
+
embedded && `${mergedClsPrefix}-card--embedded`,
|
|
105
109
|
{
|
|
106
110
|
[`${mergedClsPrefix}-card--rtl`]: rtlEnabled,
|
|
107
111
|
[`${mergedClsPrefix}-card--content${typeof segmented !== 'boolean' && segmented.content === 'soft'
|
|
@@ -118,7 +122,7 @@ export default defineComponent({
|
|
|
118
122
|
resolveWrappedSlot($slots.cover, (children) => children && (h("div", { class: `${mergedClsPrefix}-card-cover`, role: "none" }, children))),
|
|
119
123
|
resolveWrappedSlot($slots.header, (children) => {
|
|
120
124
|
return children || this.title || this.closable ? (h("div", { class: `${mergedClsPrefix}-card-header`, style: this.headerStyle },
|
|
121
|
-
h("div", { class: `${mergedClsPrefix}-card-header__main`, role: "heading" }, children ||
|
|
125
|
+
h("div", { class: `${mergedClsPrefix}-card-header__main`, role: "heading" }, children || this.title),
|
|
122
126
|
resolveWrappedSlot($slots['header-extra'], (children) => children && (h("div", { class: `${mergedClsPrefix}-card-header__extra`, style: this.headerExtraStyle }, children))),
|
|
123
127
|
this.closable ? (h(NBaseClose, { clsPrefix: mergedClsPrefix, class: `${mergedClsPrefix}-card-header__close`, onClick: this.handleCloseClick, absolute: true })) : null)) : null;
|
|
124
128
|
}),
|
|
@@ -23,6 +23,9 @@ import { asModal, c, cB, cE, cM, insideModal, insidePopover } from '../../../_ut
|
|
|
23
23
|
// --n-close-icon-color-pressed
|
|
24
24
|
// --n-border-color
|
|
25
25
|
// --n-box-shadow
|
|
26
|
+
// --n-color-embedded
|
|
27
|
+
// --n-color-embedded-modal
|
|
28
|
+
// --n-color-embedded-popover
|
|
26
29
|
|
|
27
30
|
export default c([cB('card', `
|
|
28
31
|
font-size: var(--n-font-size);
|
|
@@ -41,7 +44,9 @@ export default c([cB('card', `
|
|
|
41
44
|
background-color .3s var(--n-bezier),
|
|
42
45
|
box-shadow .3s var(--n-bezier),
|
|
43
46
|
border-color .3s var(--n-bezier);
|
|
44
|
-
`, [
|
|
47
|
+
`, [asModal({
|
|
48
|
+
background: 'var(--n-color-modal)'
|
|
49
|
+
}), cM('hoverable', [c('&:hover', 'box-shadow: var(--n-box-shadow);')]), cM('content-segmented', [c('>', [cE('content', {
|
|
45
50
|
paddingTop: 'var(--n-padding-bottom)'
|
|
46
51
|
})])]), cM('content-soft-segmented', [c('>', [cE('content', `
|
|
47
52
|
margin: 0 var(--n-padding-left);
|
|
@@ -115,10 +120,14 @@ export default c([cB('card', `
|
|
|
115
120
|
transition: 'border-color 0.3s var(--n-bezier)'
|
|
116
121
|
}, [c('&:not(:first-child)', {
|
|
117
122
|
borderTop: '1px solid var(--n-border-color)'
|
|
118
|
-
})])])])
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
})])])]), cM('embedded', `
|
|
124
|
+
background-color: var(--n-color-embedded);
|
|
125
|
+
`)]), insideModal(cB('card', `
|
|
126
|
+
background: var(--n-color-modal);
|
|
127
|
+
`, [cM('embedded', `
|
|
128
|
+
background-color: var(--n-color-embedded-modal);
|
|
129
|
+
`)])), insidePopover(cB('card', `
|
|
130
|
+
background: var(--n-color-popover);
|
|
131
|
+
`, [cM('embedded', `
|
|
132
|
+
background-color: var(--n-color-embedded-popover);
|
|
133
|
+
`)]))]);
|
package/es/card/styles/dark.js
CHANGED
|
@@ -5,8 +5,10 @@ const cardDark = {
|
|
|
5
5
|
common: commonDark,
|
|
6
6
|
self(vars) {
|
|
7
7
|
const commonSelf = self(vars);
|
|
8
|
-
const { cardColor } = vars;
|
|
8
|
+
const { cardColor, modalColor, popoverColor } = vars;
|
|
9
9
|
commonSelf.colorEmbedded = cardColor;
|
|
10
|
+
commonSelf.colorEmbeddedModal = modalColor;
|
|
11
|
+
commonSelf.colorEmbeddedPopover = popoverColor;
|
|
10
12
|
return commonSelf;
|
|
11
13
|
}
|
|
12
14
|
};
|
package/es/card/styles/light.js
CHANGED
|
@@ -2,7 +2,7 @@ import { commonLight } from '../../_styles/common';
|
|
|
2
2
|
import commonVariables from './_common';
|
|
3
3
|
export const self = (vars) => {
|
|
4
4
|
const { primaryColor, borderRadius, lineHeight, fontSize, cardColor, textColor2, textColor1, dividerColor, fontWeightStrong, closeIconColor, closeIconColorHover, closeIconColorPressed, closeColorHover, closeColorPressed, modalColor, boxShadow1, popoverColor, actionColor } = vars;
|
|
5
|
-
return Object.assign(Object.assign({}, commonVariables), { lineHeight, color: cardColor, colorModal: modalColor, colorPopover: popoverColor, colorTarget: primaryColor, colorEmbedded: actionColor, textColor: textColor2, titleTextColor: textColor1, borderColor: dividerColor, actionColor, titleFontWeight: fontWeightStrong, closeColorHover,
|
|
5
|
+
return Object.assign(Object.assign({}, commonVariables), { lineHeight, color: cardColor, colorModal: modalColor, colorPopover: popoverColor, colorTarget: primaryColor, colorEmbedded: actionColor, colorEmbeddedModal: actionColor, colorEmbeddedPopover: actionColor, textColor: textColor2, titleTextColor: textColor1, borderColor: dividerColor, actionColor, titleFontWeight: fontWeightStrong, closeColorHover,
|
|
6
6
|
closeColorPressed, closeBorderRadius: borderRadius, closeIconColor,
|
|
7
7
|
closeIconColorHover,
|
|
8
8
|
closeIconColorPressed, fontSizeSmall: fontSize, fontSizeMedium: fontSize, fontSizeLarge: fontSize, fontSizeHuge: fontSize, boxShadow: boxShadow1, borderRadius });
|
|
@@ -20,7 +20,6 @@ export default defineComponent({
|
|
|
20
20
|
props: countdownProps,
|
|
21
21
|
setup(props) {
|
|
22
22
|
let timerId = null;
|
|
23
|
-
let rafId = null;
|
|
24
23
|
let elapsed = 0;
|
|
25
24
|
let finished = false;
|
|
26
25
|
// in ms
|
|
@@ -89,10 +88,6 @@ export default defineComponent({
|
|
|
89
88
|
window.clearTimeout(timerId);
|
|
90
89
|
timerId = null;
|
|
91
90
|
}
|
|
92
|
-
if (rafId !== null) {
|
|
93
|
-
window.cancelAnimationFrame(rafId);
|
|
94
|
-
rafId = null;
|
|
95
|
-
}
|
|
96
91
|
};
|
|
97
92
|
onMounted(() => {
|
|
98
93
|
watchEffect(() => {
|
|
@@ -399,6 +399,7 @@ export declare const dataTableProps: {
|
|
|
399
399
|
boxShadowDisabled: string;
|
|
400
400
|
color: string;
|
|
401
401
|
colorDisabled: string;
|
|
402
|
+
colorActive: string;
|
|
402
403
|
textColor: string;
|
|
403
404
|
textColorDisabled: string;
|
|
404
405
|
dotColorActive: string;
|
|
@@ -1105,6 +1106,7 @@ export declare const dataTableProps: {
|
|
|
1105
1106
|
boxShadowDisabled: string;
|
|
1106
1107
|
color: string;
|
|
1107
1108
|
colorDisabled: string;
|
|
1109
|
+
colorActive: string;
|
|
1108
1110
|
textColor: string;
|
|
1109
1111
|
textColorDisabled: string;
|
|
1110
1112
|
dotColorActive: string;
|
|
@@ -1811,6 +1813,7 @@ export declare const dataTableProps: {
|
|
|
1811
1813
|
boxShadowDisabled: string;
|
|
1812
1814
|
color: string;
|
|
1813
1815
|
colorDisabled: string;
|
|
1816
|
+
colorActive: string;
|
|
1814
1817
|
textColor: string;
|
|
1815
1818
|
textColorDisabled: string;
|
|
1816
1819
|
dotColorActive: string;
|
|
@@ -2620,6 +2623,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2620
2623
|
boxShadowDisabled: string;
|
|
2621
2624
|
color: string;
|
|
2622
2625
|
colorDisabled: string;
|
|
2626
|
+
colorActive: string;
|
|
2623
2627
|
textColor: string;
|
|
2624
2628
|
textColorDisabled: string;
|
|
2625
2629
|
dotColorActive: string;
|
|
@@ -3326,6 +3330,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3326
3330
|
boxShadowDisabled: string;
|
|
3327
3331
|
color: string;
|
|
3328
3332
|
colorDisabled: string;
|
|
3333
|
+
colorActive: string;
|
|
3329
3334
|
textColor: string;
|
|
3330
3335
|
textColorDisabled: string;
|
|
3331
3336
|
dotColorActive: string;
|
|
@@ -4032,6 +4037,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4032
4037
|
boxShadowDisabled: string;
|
|
4033
4038
|
color: string;
|
|
4034
4039
|
colorDisabled: string;
|
|
4040
|
+
colorActive: string;
|
|
4035
4041
|
textColor: string;
|
|
4036
4042
|
textColorDisabled: string;
|
|
4037
4043
|
dotColorActive: string;
|
|
@@ -4860,6 +4866,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4860
4866
|
boxShadowDisabled: string;
|
|
4861
4867
|
color: string;
|
|
4862
4868
|
colorDisabled: string;
|
|
4869
|
+
colorActive: string;
|
|
4863
4870
|
textColor: string;
|
|
4864
4871
|
textColorDisabled: string;
|
|
4865
4872
|
dotColorActive: string;
|
|
@@ -6035,6 +6042,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6035
6042
|
boxShadowDisabled: string;
|
|
6036
6043
|
color: string;
|
|
6037
6044
|
colorDisabled: string;
|
|
6045
|
+
colorActive: string;
|
|
6038
6046
|
textColor: string;
|
|
6039
6047
|
textColorDisabled: string;
|
|
6040
6048
|
dotColorActive: string;
|
|
@@ -6741,6 +6749,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6741
6749
|
boxShadowDisabled: string;
|
|
6742
6750
|
color: string;
|
|
6743
6751
|
colorDisabled: string;
|
|
6752
|
+
colorActive: string;
|
|
6744
6753
|
textColor: string;
|
|
6745
6754
|
textColorDisabled: string;
|
|
6746
6755
|
dotColorActive: string;
|
|
@@ -7447,6 +7456,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7447
7456
|
boxShadowDisabled: string;
|
|
7448
7457
|
color: string;
|
|
7449
7458
|
colorDisabled: string;
|
|
7459
|
+
colorActive: string;
|
|
7450
7460
|
textColor: string;
|
|
7451
7461
|
textColorDisabled: string;
|
|
7452
7462
|
dotColorActive: string;
|
|
@@ -423,6 +423,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
423
423
|
boxShadowDisabled: string;
|
|
424
424
|
color: string;
|
|
425
425
|
colorDisabled: string;
|
|
426
|
+
colorActive: string;
|
|
426
427
|
textColor: string;
|
|
427
428
|
textColorDisabled: string;
|
|
428
429
|
dotColorActive: string;
|
|
@@ -1579,6 +1580,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1579
1580
|
boxShadowDisabled: string;
|
|
1580
1581
|
color: string;
|
|
1581
1582
|
colorDisabled: string;
|
|
1583
|
+
colorActive: string;
|
|
1582
1584
|
textColor: string;
|
|
1583
1585
|
textColorDisabled: string;
|
|
1584
1586
|
dotColorActive: string;
|
|
@@ -159,7 +159,7 @@ export function useSorter(props, { dataRelatedColsRef, filteredDataRef }) {
|
|
|
159
159
|
const columnToSort = dataRelatedColsRef.value.find((column) => column.type !== 'selection' &&
|
|
160
160
|
column.type !== 'expand' &&
|
|
161
161
|
column.key === columnKey);
|
|
162
|
-
if (!columnToSort ||
|
|
162
|
+
if (!(columnToSort === null || columnToSort === void 0 ? void 0 : columnToSort.sorter))
|
|
163
163
|
return;
|
|
164
164
|
const sorter = columnToSort.sorter;
|
|
165
165
|
deriveNextSorter({
|
|
@@ -346,6 +346,7 @@ declare const dataTableLight: import("../../_mixins").Theme<"DataTable", {
|
|
|
346
346
|
boxShadowDisabled: string;
|
|
347
347
|
color: string;
|
|
348
348
|
colorDisabled: string;
|
|
349
|
+
colorActive: string;
|
|
349
350
|
textColor: string;
|
|
350
351
|
textColorDisabled: string;
|
|
351
352
|
dotColorActive: string;
|
package/es/dialog/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export { dialogProps } from './src/dialogProps';
|
|
|
3
3
|
export type { DialogProps } from './src/dialogProps';
|
|
4
4
|
export { NDialogProvider, dialogProviderProps } from './src/DialogProvider';
|
|
5
5
|
export type { DialogProviderProps, DialogProviderInst, DialogOptions, DialogReactive, DialogApiInjection as DialogApi } from './src/DialogProvider';
|
|
6
|
-
export { useDialog } from './src/
|
|
6
|
+
export { useDialog, useDialogReactiveList } from './src/composables';
|
package/es/dialog/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { NDialog } from './src/Dialog';
|
|
2
2
|
export { dialogProps } from './src/dialogProps';
|
|
3
3
|
export { NDialogProvider, dialogProviderProps } from './src/DialogProvider';
|
|
4
|
-
export { useDialog } from './src/
|
|
4
|
+
export { useDialog, useDialogReactiveList } from './src/composables';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PropType, CSSProperties } from 'vue';
|
|
2
2
|
export declare const exposedDialogEnvProps: {
|
|
3
|
+
readonly onAfterEnter: PropType<() => void>;
|
|
3
4
|
readonly blockScroll: {
|
|
4
5
|
readonly type: BooleanConstructor;
|
|
5
6
|
readonly default: true;
|
|
@@ -56,6 +57,7 @@ export declare const NDialogEnvironment: import("vue").DefineComponent<{
|
|
|
56
57
|
type: PropType<(key: string) => void>;
|
|
57
58
|
required: true;
|
|
58
59
|
};
|
|
60
|
+
onAfterEnter: PropType<() => void>;
|
|
59
61
|
blockScroll: {
|
|
60
62
|
readonly type: BooleanConstructor;
|
|
61
63
|
readonly default: true;
|
|
@@ -121,6 +123,7 @@ export declare const NDialogEnvironment: import("vue").DefineComponent<{
|
|
|
121
123
|
type: PropType<(key: string) => void>;
|
|
122
124
|
required: true;
|
|
123
125
|
};
|
|
126
|
+
onAfterEnter: PropType<() => void>;
|
|
124
127
|
blockScroll: {
|
|
125
128
|
readonly type: BooleanConstructor;
|
|
126
129
|
readonly default: true;
|
|
@@ -5,7 +5,7 @@ import NModal from '../../modal/src/Modal';
|
|
|
5
5
|
import { keep } from '../../_utils';
|
|
6
6
|
import { NDialog } from './Dialog';
|
|
7
7
|
import { dialogProps, dialogPropKeys } from './dialogProps';
|
|
8
|
-
export const exposedDialogEnvProps = Object.assign(Object.assign({}, dialogProps), { blockScroll: { type: Boolean, default: true }, closeOnEsc: { type: Boolean, default: true }, onEsc: Function, autoFocus: {
|
|
8
|
+
export const exposedDialogEnvProps = Object.assign(Object.assign({}, dialogProps), { onAfterEnter: Function, blockScroll: { type: Boolean, default: true }, closeOnEsc: { type: Boolean, default: true }, onEsc: Function, autoFocus: {
|
|
9
9
|
type: Boolean,
|
|
10
10
|
default: true
|
|
11
11
|
}, internalStyle: [String, Object], maskClosable: {
|
|
@@ -100,7 +100,7 @@ export const NDialogEnvironment = defineComponent({
|
|
|
100
100
|
},
|
|
101
101
|
render() {
|
|
102
102
|
const { handlePositiveClick, handleUpdateShow, handleNegativeClick, handleCloseClick, handleAfterLeave, handleMaskClick, handleEsc, to, maskClosable, show } = this;
|
|
103
|
-
return (h(NModal, { show: show, onUpdateShow: handleUpdateShow, onMaskClick: handleMaskClick, onEsc: handleEsc, to: to, maskClosable: maskClosable, onAfterLeave: handleAfterLeave, closeOnEsc: this.closeOnEsc, blockScroll: this.blockScroll, autoFocus: this.autoFocus, internalAppear: true, internalDialog: true }, {
|
|
103
|
+
return (h(NModal, { show: show, onUpdateShow: handleUpdateShow, onMaskClick: handleMaskClick, onEsc: handleEsc, to: to, maskClosable: maskClosable, onAfterEnter: this.onAfterEnter, onAfterLeave: handleAfterLeave, closeOnEsc: this.closeOnEsc, blockScroll: this.blockScroll, autoFocus: this.autoFocus, internalAppear: true, internalDialog: true }, {
|
|
104
104
|
default: () => (h(NDialog, Object.assign({}, keep(this.$props, dialogPropKeys), { style: this.internalStyle, onClose: handleCloseClick, onNegativeClick: handleNegativeClick, onPositiveClick: handlePositiveClick })))
|
|
105
105
|
}));
|
|
106
106
|
}
|
|
@@ -2,6 +2,7 @@ import { ExtractPropTypes, PropType, Ref, CSSProperties } from 'vue';
|
|
|
2
2
|
import type { ExtractPublicPropTypes, Mutable } from '../../_utils';
|
|
3
3
|
import { exposedDialogEnvProps } from './DialogEnvironment';
|
|
4
4
|
export declare type DialogOptions = Mutable<Omit<Partial<ExtractPropTypes<typeof exposedDialogEnvProps>>, 'internalStyle'> & {
|
|
5
|
+
class?: any;
|
|
5
6
|
style?: string | CSSProperties;
|
|
6
7
|
}>;
|
|
7
8
|
export declare type DialogReactive = {
|
|
@@ -23,6 +24,7 @@ export interface DialogProviderInjection {
|
|
|
23
24
|
y: number;
|
|
24
25
|
} | null>;
|
|
25
26
|
}
|
|
27
|
+
export declare type DialogReactiveListInjection = Ref<DialogReactive[]>;
|
|
26
28
|
interface DialogInst {
|
|
27
29
|
hide: () => void;
|
|
28
30
|
}
|
|
@@ -42,6 +44,7 @@ export declare const NDialogProvider: import("vue").DefineComponent<{
|
|
|
42
44
|
type?: "default" | "error" | "info" | "success" | "warning" | undefined;
|
|
43
45
|
content?: string | (() => import("vue").VNodeChild) | undefined;
|
|
44
46
|
icon?: (() => import("vue").VNodeChild) | undefined;
|
|
47
|
+
onAfterEnter?: (() => void) | undefined;
|
|
45
48
|
title?: string | (() => import("vue").VNodeChild) | undefined;
|
|
46
49
|
action?: (() => import("vue").VNodeChild) | undefined;
|
|
47
50
|
autoFocus?: boolean | undefined;
|
|
@@ -736,6 +739,7 @@ export declare const NDialogProvider: import("vue").DefineComponent<{
|
|
|
736
739
|
onMaskClick?: ((e: MouseEvent) => void) | undefined;
|
|
737
740
|
maskClosable?: boolean | undefined;
|
|
738
741
|
closeOnEsc?: boolean | undefined;
|
|
742
|
+
class?: any;
|
|
739
743
|
style?: any;
|
|
740
744
|
}[]>;
|
|
741
745
|
dialogInstRefs: Record<string, DialogInst>;
|
|
@@ -3,7 +3,7 @@ import { createId } from 'seemly';
|
|
|
3
3
|
import { useClicked, useClickPosition } from 'vooks';
|
|
4
4
|
import { omit } from '../../_utils';
|
|
5
5
|
import { NDialogEnvironment } from './DialogEnvironment';
|
|
6
|
-
import { dialogApiInjectionKey, dialogProviderInjectionKey } from './context';
|
|
6
|
+
import { dialogApiInjectionKey, dialogProviderInjectionKey, dialogReactiveListInjectionKey } from './context';
|
|
7
7
|
export const dialogProviderProps = {
|
|
8
8
|
injectionKey: String,
|
|
9
9
|
to: [String, Object]
|
|
@@ -45,6 +45,7 @@ export const NDialogProvider = defineComponent({
|
|
|
45
45
|
clickedRef: useClicked(64),
|
|
46
46
|
clickPositionRef: useClickPosition()
|
|
47
47
|
});
|
|
48
|
+
provide(dialogReactiveListInjectionKey, dialogListRef);
|
|
48
49
|
return Object.assign(Object.assign({}, api), { dialogList: dialogListRef, dialogInstRefs,
|
|
49
50
|
handleAfterLeave });
|
|
50
51
|
},
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { inject } from 'vue';
|
|
2
|
+
import { dialogApiInjectionKey, dialogReactiveListInjectionKey } from './context';
|
|
3
|
+
import { throwError } from '../../_utils';
|
|
4
|
+
export function useDialog() {
|
|
5
|
+
const dialog = inject(dialogApiInjectionKey, null);
|
|
6
|
+
if (dialog === null) {
|
|
7
|
+
throwError('use-dialog', 'No outer <n-dialog-provider /> founded.');
|
|
8
|
+
}
|
|
9
|
+
return dialog;
|
|
10
|
+
}
|
|
11
|
+
export function useDialogReactiveList() {
|
|
12
|
+
const dialogReactiveList = inject(dialogReactiveListInjectionKey, null);
|
|
13
|
+
if (dialogReactiveList === null) {
|
|
14
|
+
throwError('use-dialog-reactive-list', 'No outer <n-dialog-provider /> founded.');
|
|
15
|
+
}
|
|
16
|
+
return dialogReactiveList;
|
|
17
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { DialogApiInjection, DialogProviderInjection } from './DialogProvider';
|
|
1
|
+
import type { DialogApiInjection, DialogProviderInjection, DialogReactiveListInjection } from './DialogProvider';
|
|
2
2
|
export declare const dialogProviderInjectionKey: import("vue").InjectionKey<DialogProviderInjection>;
|
|
3
3
|
export declare const dialogApiInjectionKey: import("vue").InjectionKey<DialogApiInjection>;
|
|
4
|
+
export declare const dialogReactiveListInjectionKey: import("vue").InjectionKey<DialogReactiveListInjection>;
|
package/es/dialog/src/context.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { createInjectionKey } from '../../_utils';
|
|
2
2
|
export const dialogProviderInjectionKey = createInjectionKey('n-dialog-provider');
|
|
3
3
|
export const dialogApiInjectionKey = createInjectionKey('n-dialog-api');
|
|
4
|
+
export const dialogReactiveListInjectionKey = createInjectionKey('n-dialog-reactive-list');
|
|
@@ -283,6 +283,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
283
283
|
mergedValidationStatus: import("vue").ComputedRef<"error" | "success" | "warning" | undefined>;
|
|
284
284
|
mergedShowFeedback: import("vue").ComputedRef<boolean>;
|
|
285
285
|
mergedShowLabel: import("vue").ComputedRef<boolean>;
|
|
286
|
+
isAutoLabelWidth: import("vue").ComputedRef<boolean>;
|
|
286
287
|
labelElementRef: import("vue").Ref<HTMLLabelElement | null>;
|
|
287
288
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
288
289
|
mergedRequired: import("vue").ComputedRef<boolean>;
|