@sdata/web-vue 4.0.0 → 4.1.0
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/sd.css +71 -0
- package/dist/sd.min.css +2 -2
- package/es/badge/badge.vue.d.ts +2 -0
- package/es/badge/badge.vue_vue_type_script_setup_true_lang.js +19 -4
- package/es/badge/index.d.ts +3 -0
- package/es/components.d.ts +2 -0
- package/es/index.css +71 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +4 -1
- package/es/index.scss +1 -0
- package/es/number-flow/continuous.d.ts +2 -0
- package/es/number-flow/continuous.js +7 -0
- package/es/number-flow/formatter.d.ts +15 -0
- package/es/number-flow/formatter.js +54 -0
- package/es/number-flow/group-key.d.ts +11 -0
- package/es/number-flow/group-key.js +4 -0
- package/es/number-flow/index.d.ts +63 -0
- package/es/number-flow/index.js +15 -0
- package/es/number-flow/number-flow-group.js +5 -0
- package/es/number-flow/number-flow-group.vue.d.ts +12 -0
- package/es/number-flow/number-flow-group.vue_vue_type_script_setup_true_lang.js +58 -0
- package/es/number-flow/number-flow.js +5 -0
- package/es/number-flow/number-flow.vue.d.ts +20 -0
- package/es/number-flow/number-flow.vue_vue_type_script_setup_true_lang.js +284 -0
- package/es/number-flow/style/css.js +2 -0
- package/es/number-flow/style/index.css +85 -0
- package/es/number-flow/style/index.d.ts +2 -0
- package/es/number-flow/style/index.js +2 -0
- package/es/number-flow/style/index.scss +93 -0
- package/es/number-flow/style/token.scss +5 -0
- package/es/number-flow/types.d.ts +46 -0
- package/es/number-flow/use-can-animate.d.ts +4 -0
- package/es/number-flow/use-can-animate.js +30 -0
- package/es/rich-text-editor/index.d.ts +3 -3
- package/es/rich-text-editor/rich-text-editor.vue.d.ts +1 -1
- package/es/sd-vue.js +3 -0
- package/es/statistic/countdown.vue.d.ts +9 -0
- package/es/statistic/countdown.vue_vue_type_script_setup_true_lang.js +29 -2
- package/es/statistic/index.d.ts +15 -0
- package/es/statistic/statistic.vue.d.ts +3 -3
- package/es/statistic/statistic.vue_vue_type_script_setup_true_lang.js +31 -62
- package/es/statistic/style/index.css +3 -0
- package/es/statistic/style/index.scss +5 -0
- package/json/vetur-attributes.json +8 -0
- package/json/vetur-tags.json +9 -1
- package/json/web-types.json +29 -1
- package/package.json +1 -1
package/es/badge/badge.vue.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
14
14
|
color?: ColorType | string;
|
|
15
15
|
status?: BadgeStatus;
|
|
16
16
|
count?: number;
|
|
17
|
+
animation?: boolean;
|
|
17
18
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
18
19
|
text?: string;
|
|
19
20
|
dot?: boolean;
|
|
@@ -23,6 +24,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
23
24
|
color?: ColorType | string;
|
|
24
25
|
status?: BadgeStatus;
|
|
25
26
|
count?: number;
|
|
27
|
+
animation?: boolean;
|
|
26
28
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
27
29
|
default?: () => unknown;
|
|
28
30
|
content?: () => unknown;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { configProviderInjectionKey } from "../config-provider/context.js";
|
|
2
2
|
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectSpread2.js";
|
|
3
3
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
4
|
-
import
|
|
4
|
+
import NumberFlow from "../number-flow/index.js";
|
|
5
|
+
import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, inject, normalizeClass, normalizeStyle, openBlock, renderSlot, toDisplayString, unref, useSlots } from "vue";
|
|
5
6
|
//#region components/badge/badge.vue?vue&type=script&setup=true&lang.ts
|
|
6
7
|
var _hoisted_1 = ["aria-label"];
|
|
7
8
|
var COLORS = [
|
|
@@ -31,7 +32,11 @@ var badge_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
31
32
|
offset: { default: () => [] },
|
|
32
33
|
color: {},
|
|
33
34
|
status: {},
|
|
34
|
-
count: {}
|
|
35
|
+
count: {},
|
|
36
|
+
animation: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: true
|
|
39
|
+
}
|
|
35
40
|
},
|
|
36
41
|
setup(__props) {
|
|
37
42
|
const slots = useSlots();
|
|
@@ -56,7 +61,9 @@ var badge_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
56
61
|
return style;
|
|
57
62
|
});
|
|
58
63
|
const mergedStyle = computed(() => _objectSpread2(_objectSpread2({}, !__props.color || COLORS.includes(__props.color) ? {} : { backgroundColor: __props.color }), computedDotStyle.value));
|
|
59
|
-
const
|
|
64
|
+
const isCountOverflow = computed(() => Boolean(__props.maxCount && countValue.value > __props.maxCount));
|
|
65
|
+
const displayCount = computed(() => isCountOverflow.value ? __props.maxCount : countValue.value);
|
|
66
|
+
const displaySuffix = computed(() => isCountOverflow.value ? "+" : void 0);
|
|
60
67
|
return (_ctx, _cache) => {
|
|
61
68
|
return openBlock(), createElementBlock("span", { class: normalizeClass(wrapperClassName.value) }, [renderSlot(_ctx.$slots, "default"), _ctx.$slots.content ? (openBlock(), createElementBlock("span", {
|
|
62
69
|
key: 0,
|
|
@@ -89,7 +96,15 @@ var badge_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
89
96
|
key: 4,
|
|
90
97
|
class: normalizeClass(`${unref(prefixCls)}-number`),
|
|
91
98
|
style: normalizeStyle(mergedStyle.value)
|
|
92
|
-
}, [
|
|
99
|
+
}, [createVNode(unref(NumberFlow), {
|
|
100
|
+
value: displayCount.value,
|
|
101
|
+
suffix: displaySuffix.value,
|
|
102
|
+
animated: __props.animation
|
|
103
|
+
}, null, 8, [
|
|
104
|
+
"value",
|
|
105
|
+
"suffix",
|
|
106
|
+
"animated"
|
|
107
|
+
])], 6)) : createCommentVNode("", true)], 2);
|
|
93
108
|
};
|
|
94
109
|
}
|
|
95
110
|
}));
|
package/es/badge/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ declare const Badge: {
|
|
|
11
11
|
color?: import("./badge.vue").ColorType | string;
|
|
12
12
|
status?: import("./badge.vue").BadgeStatus;
|
|
13
13
|
count?: number;
|
|
14
|
+
animation?: boolean;
|
|
14
15
|
}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
15
16
|
P: {};
|
|
16
17
|
B: {};
|
|
@@ -27,6 +28,7 @@ declare const Badge: {
|
|
|
27
28
|
color?: import("./badge.vue").ColorType | string;
|
|
28
29
|
status?: import("./badge.vue").BadgeStatus;
|
|
29
30
|
count?: number;
|
|
31
|
+
animation?: boolean;
|
|
30
32
|
}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
31
33
|
__isFragment?: never;
|
|
32
34
|
__isTeleport?: never;
|
|
@@ -40,6 +42,7 @@ declare const Badge: {
|
|
|
40
42
|
color?: import("./badge.vue").ColorType | string;
|
|
41
43
|
status?: import("./badge.vue").BadgeStatus;
|
|
42
44
|
count?: number;
|
|
45
|
+
animation?: boolean;
|
|
43
46
|
}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
44
47
|
$slots: {
|
|
45
48
|
default?: () => unknown;
|
package/es/components.d.ts
CHANGED
|
@@ -104,6 +104,8 @@ declare module 'vue' {
|
|
|
104
104
|
SdModelSelectorSeparator: SDVue['ModelSelectorSeparator'];
|
|
105
105
|
SdModelSelectorShortcut: SDVue['ModelSelectorShortcut'];
|
|
106
106
|
SdModelSelectorTrigger: SDVue['ModelSelectorTrigger'];
|
|
107
|
+
SdNumberFlow: SDVue['NumberFlow'];
|
|
108
|
+
SdNumberFlowGroup: SDVue['NumberFlowGroup'];
|
|
107
109
|
SdPageHeader: SDVue['PageHeader'];
|
|
108
110
|
SdPagination: SDVue['Pagination'];
|
|
109
111
|
SdPopconfirm: SDVue['Popconfirm'];
|
package/es/index.css
CHANGED
|
@@ -7938,6 +7938,9 @@ body.sd-tour-active .sd-tour-popover * {
|
|
|
7938
7938
|
font-size: inherit;
|
|
7939
7939
|
white-space: nowrap;
|
|
7940
7940
|
}
|
|
7941
|
+
.sd-statistic-content .sd-statistic-value .sd-number-flow-fraction {
|
|
7942
|
+
font-size: inherit;
|
|
7943
|
+
}
|
|
7941
7944
|
.sd-statistic-content .sd-statistic-value-decimal {
|
|
7942
7945
|
display: inline-block;
|
|
7943
7946
|
font-size: inherit;
|
|
@@ -10515,6 +10518,74 @@ body.sd-tour-active .sd-tour-popover * {
|
|
|
10515
10518
|
transition: height 0.3s cubic-bezier(0.34, 0.69, 0.1, 1), margin 0.3s cubic-bezier(0.34, 0.69, 0.1, 1), padding 0.3s cubic-bezier(0.34, 0.69, 0.1, 1), opacity 0.3s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
10516
10519
|
}
|
|
10517
10520
|
|
|
10521
|
+
.sd-number-flow {
|
|
10522
|
+
display: inline-flex;
|
|
10523
|
+
align-items: baseline;
|
|
10524
|
+
line-height: 1;
|
|
10525
|
+
direction: ltr;
|
|
10526
|
+
white-space: nowrap;
|
|
10527
|
+
isolation: isolate;
|
|
10528
|
+
}
|
|
10529
|
+
.sd-number-flow-content, .sd-number-flow-part, .sd-number-flow-digit-track, .sd-number-flow-digit-value, .sd-number-flow-symbol {
|
|
10530
|
+
display: inline-block;
|
|
10531
|
+
}
|
|
10532
|
+
.sd-number-flow-content {
|
|
10533
|
+
margin: -0.25em -0.2em;
|
|
10534
|
+
padding: 0.25em 0.2em;
|
|
10535
|
+
overflow: hidden;
|
|
10536
|
+
}
|
|
10537
|
+
.sd-number-flow-part {
|
|
10538
|
+
position: relative;
|
|
10539
|
+
vertical-align: bottom;
|
|
10540
|
+
}
|
|
10541
|
+
.sd-number-flow-digit {
|
|
10542
|
+
height: 1em;
|
|
10543
|
+
overflow: hidden;
|
|
10544
|
+
}
|
|
10545
|
+
.sd-number-flow-digit-track {
|
|
10546
|
+
display: flex;
|
|
10547
|
+
flex-direction: column;
|
|
10548
|
+
height: 1em;
|
|
10549
|
+
transform: translateY(calc(1em * var(--sd-number-flow-start)));
|
|
10550
|
+
}
|
|
10551
|
+
.sd-number-flow-digit-value {
|
|
10552
|
+
flex: 0 0 1em;
|
|
10553
|
+
height: 1em;
|
|
10554
|
+
line-height: 1;
|
|
10555
|
+
text-align: center;
|
|
10556
|
+
font-variant-numeric: tabular-nums;
|
|
10557
|
+
}
|
|
10558
|
+
.sd-number-flow-prepared .sd-number-flow-digit-track {
|
|
10559
|
+
transition: none;
|
|
10560
|
+
}
|
|
10561
|
+
.sd-number-flow-animating .sd-number-flow-digit-track {
|
|
10562
|
+
transform: translateY(calc(1em * var(--sd-number-flow-end)));
|
|
10563
|
+
transition: transform var(--sd-number-flow-spin-duration, var(--sd-number-flow-duration)) var(--sd-number-flow-spin-easing, var(--sd-number-flow-easing)), opacity var(--sd-number-flow-opacity-duration) ease-out;
|
|
10564
|
+
}
|
|
10565
|
+
.sd-number-flow-symbol {
|
|
10566
|
+
white-space: pre;
|
|
10567
|
+
}
|
|
10568
|
+
.sd-number-flow-will-change :is(.sd-number-flow-content, .sd-number-flow-part, .sd-number-flow-digit-track, .sd-number-flow-symbol) {
|
|
10569
|
+
will-change: transform;
|
|
10570
|
+
}
|
|
10571
|
+
.sd-number-flow-custom-prefix {
|
|
10572
|
+
margin-right: 4px;
|
|
10573
|
+
}
|
|
10574
|
+
.sd-number-flow-custom-suffix {
|
|
10575
|
+
margin-left: 4px;
|
|
10576
|
+
}
|
|
10577
|
+
|
|
10578
|
+
.sd-number-flow-group {
|
|
10579
|
+
display: inline-flex;
|
|
10580
|
+
gap: 4px;
|
|
10581
|
+
align-items: baseline;
|
|
10582
|
+
}
|
|
10583
|
+
|
|
10584
|
+
@media (prefers-reduced-motion: reduce) {
|
|
10585
|
+
.sd-number-flow-digit-track {
|
|
10586
|
+
transition: none;
|
|
10587
|
+
}
|
|
10588
|
+
}
|
|
10518
10589
|
.sd-modal-container {
|
|
10519
10590
|
position: fixed;
|
|
10520
10591
|
inset: 0;
|
package/es/index.d.ts
CHANGED
|
@@ -106,6 +106,8 @@ export { default as ModelSelector, ModelSelectorContent, ModelSelectorDialog, Mo
|
|
|
106
106
|
export type { ModelSelectorContentInstance, ModelSelectorDialogInstance, ModelSelectorEmptyInstance, ModelSelectorGroupInstance, ModelSelectorInputInstance, ModelSelectorInstance, ModelSelectorItemData, ModelSelectorItemInstance, ModelSelectorKnownProvider, ModelSelectorListInstance, ModelSelectorLogoGroupInstance, ModelSelectorLogoInstance, ModelSelectorNameInstance, ModelSelectorProvider, ModelSelectorSeparatorInstance, ModelSelectorShortcutInstance, ModelSelectorTriggerInstance, } from './model-selector';
|
|
107
107
|
export { default as Notification } from './notification';
|
|
108
108
|
export type { NotificationMethod, NotificationConfig, NotificationReturn } from './notification';
|
|
109
|
+
export { default as NumberFlow, NumberFlowGroup, continuous, useCanAnimate } from './number-flow';
|
|
110
|
+
export type { NumberFlowDigitContext, NumberFlowDigitOptions, NumberFlowDigits, NumberFlowExposed, NumberFlowFormat, NumberFlowGroupInstance, NumberFlowInstance, NumberFlowPlugin, NumberFlowPluginContext, NumberFlowProps, NumberFlowStyle, NumberFlowTrend, NumberFlowValue, } from './number-flow';
|
|
109
111
|
export { default as PageHeader } from './page-header';
|
|
110
112
|
export type { PageHeaderInstance } from './page-header';
|
|
111
113
|
export { default as Pagination } from './pagination';
|
package/es/index.js
CHANGED
|
@@ -22,6 +22,9 @@ import Popover from "./popover/index.js";
|
|
|
22
22
|
import avatar_group_default from "./avatar/avatar-group.js";
|
|
23
23
|
import Avatar from "./avatar/index.js";
|
|
24
24
|
import BackTop from "./back-top/index.js";
|
|
25
|
+
import { continuous } from "./number-flow/continuous.js";
|
|
26
|
+
import { useCanAnimate } from "./number-flow/use-can-animate.js";
|
|
27
|
+
import NumberFlow, { NumberFlowGroup } from "./number-flow/index.js";
|
|
25
28
|
import Badge from "./badge/index.js";
|
|
26
29
|
import Ellipsis, { PerformantEllipsis } from "./ellipsis/index.js";
|
|
27
30
|
import Link from "./link/index.js";
|
|
@@ -171,4 +174,4 @@ import Typography from "./typography/index.js";
|
|
|
171
174
|
import Upload from "./upload/index.js";
|
|
172
175
|
import Watermark from "./watermark/index.js";
|
|
173
176
|
import SDVue from "./sd-vue.js";
|
|
174
|
-
export { $createInlineComponentNode, $isInlineComponentNode, A2UI_0_9_1, Affix, Alert, Anchor, anchor_link_default as AnchorLink, AutoComplete, Avatar, avatar_group_default as AvatarGroup, BackTop, Badge, BasicCrudTable, BorderBeam, Breadcrumb, breadcrumb_item_default as BreadcrumbItem, Button, button_group_default as ButtonGroup, Calendar, Card, card_grid_default as CardGrid, card_meta_default as CardMeta, Carousel, carousel_item_default as CarouselItem, Cascader, cascader_panel_default as CascaderPanel, Checkbox, checkbox_group_default as CheckboxGroup, grid_col_default as Col, Collapse, collapse_item_default as CollapseItem, ColorPicker, Comment, ConfigProvider, Copy, countdown_default as Countdown, Cropper, DEFAULT_LOCALE, DEFAULT_LOCALE_KEY, DatePicker, Descriptions, descriptions_item_default as DescriptionsItem, dropdown_group_default as Dgroup, Divider, dropdown_option_default as Doption, Drawer, Dropdown, dropdown_button_default as DropdownButton, dropdown_submenu_default as Dsubmenu, Ellipsis, Empty, FilePreviewer, Form, form_item_default as FormItem, Grid, grid_item_default as GridItem, Icon, Image, preview_default as ImagePreview, preview_action_default as ImagePreviewAction, preview_group_default as ImagePreviewGroup, InlineComponentNode, Input, input_group_default as InputGroup, InputMask, InputNumber, input_password_default as InputPassword, input_search_default as InputSearch, InputTag, JsonForm, KvList, Layout, content_default as LayoutContent, footer_default as LayoutFooter, header_default as LayoutHeader, sider_default as LayoutSider, Link, List, list_item_default as ListItem, list_item_meta_default as ListItemMeta, MODEL_SELECTOR_PROVIDERS, Mention, Menu, item_default as MenuItem, item_group_default as MenuItemGroup, Message, Modal, ModelSelector, model_selector_content_default as ModelSelectorContent, model_selector_dialog_default as ModelSelectorDialog, model_selector_empty_default as ModelSelectorEmpty, model_selector_group_default as ModelSelectorGroup, model_selector_input_default as ModelSelectorInput, model_selector_item_default as ModelSelectorItem, model_selector_list_default as ModelSelectorList, model_selector_logo_default as ModelSelectorLogo, model_selector_logo_group_default as ModelSelectorLogoGroup, model_selector_name_default as ModelSelectorName, model_selector_separator_default as ModelSelectorSeparator, model_selector_shortcut_default as ModelSelectorShortcut, model_selector_trigger_default as ModelSelectorTrigger, month_picker_default as MonthPicker, Notification, PageHeader, Pagination, PerformantEllipsis, Popconfirm, Popover, Progress, QrCode, quarter_picker_default as QuarterPicker, RICH_TEXT_EDITOR_BUILT_IN_NODE_NAMES, RICH_TEXT_EDITOR_JSON_FORM_NODE_NAMES, Radio, radio_group_default as RadioGroup, range_picker_default as RangePicker, Rate, recorder_core_default as RecorderCore, ResizeBox, Result, RichTextEditor, grid_row_default as Row, Scrollbar, Secret, Select, SelectableCard, Sender, SenderHeader, SenderSwitch, Skeleton, line_default as SkeletonLine, shape_default as SkeletonShape, Slider, Space, Spin, Split, Statistic, step_default as Step, Steps, sub_menu_default as SubMenu, Switch, tab_pane_default as TabPane, Table, table_column_default as TableColumn, Tabs, Tag, TagGroup, table_tbody_default as Tbody, table_td_default as Td, Textarea, table_th_default as Th, table_thead_default as Thead, ThemeProvider, ThinkingOrb, TimePicker, Timeline, item_default$1 as TimelineItem, Toolbar, Tooltip, Tour, table_tr_default as Tr, Transfer, Tree, TreeSelect, Trigger, Typography, paragraph_default as TypographyParagraph, text_default as TypographyText, title_default as TypographyTitle, Upload, VerificationCode, Watermark, week_picker_default as WeekPicker, year_picker_default as YearPicker, addI18nMessages, SDVue as default, defaultInputMaskFormatChars, defineJsonFormComponents, defineJsonFormSchemas, formatInputMask, getCssVarToken, getLocale, inputMaskPresets, useFormItem, useLocale };
|
|
177
|
+
export { $createInlineComponentNode, $isInlineComponentNode, A2UI_0_9_1, Affix, Alert, Anchor, anchor_link_default as AnchorLink, AutoComplete, Avatar, avatar_group_default as AvatarGroup, BackTop, Badge, BasicCrudTable, BorderBeam, Breadcrumb, breadcrumb_item_default as BreadcrumbItem, Button, button_group_default as ButtonGroup, Calendar, Card, card_grid_default as CardGrid, card_meta_default as CardMeta, Carousel, carousel_item_default as CarouselItem, Cascader, cascader_panel_default as CascaderPanel, Checkbox, checkbox_group_default as CheckboxGroup, grid_col_default as Col, Collapse, collapse_item_default as CollapseItem, ColorPicker, Comment, ConfigProvider, Copy, countdown_default as Countdown, Cropper, DEFAULT_LOCALE, DEFAULT_LOCALE_KEY, DatePicker, Descriptions, descriptions_item_default as DescriptionsItem, dropdown_group_default as Dgroup, Divider, dropdown_option_default as Doption, Drawer, Dropdown, dropdown_button_default as DropdownButton, dropdown_submenu_default as Dsubmenu, Ellipsis, Empty, FilePreviewer, Form, form_item_default as FormItem, Grid, grid_item_default as GridItem, Icon, Image, preview_default as ImagePreview, preview_action_default as ImagePreviewAction, preview_group_default as ImagePreviewGroup, InlineComponentNode, Input, input_group_default as InputGroup, InputMask, InputNumber, input_password_default as InputPassword, input_search_default as InputSearch, InputTag, JsonForm, KvList, Layout, content_default as LayoutContent, footer_default as LayoutFooter, header_default as LayoutHeader, sider_default as LayoutSider, Link, List, list_item_default as ListItem, list_item_meta_default as ListItemMeta, MODEL_SELECTOR_PROVIDERS, Mention, Menu, item_default as MenuItem, item_group_default as MenuItemGroup, Message, Modal, ModelSelector, model_selector_content_default as ModelSelectorContent, model_selector_dialog_default as ModelSelectorDialog, model_selector_empty_default as ModelSelectorEmpty, model_selector_group_default as ModelSelectorGroup, model_selector_input_default as ModelSelectorInput, model_selector_item_default as ModelSelectorItem, model_selector_list_default as ModelSelectorList, model_selector_logo_default as ModelSelectorLogo, model_selector_logo_group_default as ModelSelectorLogoGroup, model_selector_name_default as ModelSelectorName, model_selector_separator_default as ModelSelectorSeparator, model_selector_shortcut_default as ModelSelectorShortcut, model_selector_trigger_default as ModelSelectorTrigger, month_picker_default as MonthPicker, Notification, NumberFlow, NumberFlowGroup, PageHeader, Pagination, PerformantEllipsis, Popconfirm, Popover, Progress, QrCode, quarter_picker_default as QuarterPicker, RICH_TEXT_EDITOR_BUILT_IN_NODE_NAMES, RICH_TEXT_EDITOR_JSON_FORM_NODE_NAMES, Radio, radio_group_default as RadioGroup, range_picker_default as RangePicker, Rate, recorder_core_default as RecorderCore, ResizeBox, Result, RichTextEditor, grid_row_default as Row, Scrollbar, Secret, Select, SelectableCard, Sender, SenderHeader, SenderSwitch, Skeleton, line_default as SkeletonLine, shape_default as SkeletonShape, Slider, Space, Spin, Split, Statistic, step_default as Step, Steps, sub_menu_default as SubMenu, Switch, tab_pane_default as TabPane, Table, table_column_default as TableColumn, Tabs, Tag, TagGroup, table_tbody_default as Tbody, table_td_default as Td, Textarea, table_th_default as Th, table_thead_default as Thead, ThemeProvider, ThinkingOrb, TimePicker, Timeline, item_default$1 as TimelineItem, Toolbar, Tooltip, Tour, table_tr_default as Tr, Transfer, Tree, TreeSelect, Trigger, Typography, paragraph_default as TypographyParagraph, text_default as TypographyText, title_default as TypographyTitle, Upload, VerificationCode, Watermark, week_picker_default as WeekPicker, year_picker_default as YearPicker, addI18nMessages, continuous, SDVue as default, defaultInputMaskFormatChars, defineJsonFormComponents, defineJsonFormSchemas, formatInputMask, getCssVarToken, getLocale, inputMaskPresets, useCanAnimate, useFormItem, useLocale };
|
package/es/index.scss
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
@use '@components/pagination/style/index.scss' as *;
|
|
47
47
|
@use '@components/page-header/style/index.scss' as *;
|
|
48
48
|
@use '@components/notification/style/index.scss' as *;
|
|
49
|
+
@use '@components/number-flow/style/index.scss' as *;
|
|
49
50
|
@use '@components/modal/style/index.scss' as *;
|
|
50
51
|
@use '@components/model-selector/style/index.scss' as *;
|
|
51
52
|
@use '@components/message/style/index.scss' as *;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region components/number-flow/continuous.ts
|
|
2
|
+
/** 让最高变化位以下的未变化数字连续滚动。 */
|
|
3
|
+
var continuous = { getDelta(value, previousValue, context) {
|
|
4
|
+
if (value === previousValue && context.trend !== 0 && context.highestChangedPosition !== void 0 && context.highestChangedPosition >= context.position) return context.length * context.trend;
|
|
5
|
+
} };
|
|
6
|
+
//#endregion
|
|
7
|
+
export { continuous };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NumberFlowValue } from './types';
|
|
2
|
+
export type NumberFlowPartType = Exclude<Intl.NumberFormatPartTypes, 'minusSign' | 'plusSign'> | 'sign' | 'prefix' | 'suffix';
|
|
3
|
+
export interface NumberFlowPart {
|
|
4
|
+
key: string;
|
|
5
|
+
type: NumberFlowPartType;
|
|
6
|
+
value: string;
|
|
7
|
+
digit?: number;
|
|
8
|
+
position?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface NumberFlowData {
|
|
11
|
+
parts: NumberFlowPart[];
|
|
12
|
+
value: number;
|
|
13
|
+
valueAsString: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function formatNumberFlow(value: NumberFlowValue, formatter: Intl.NumberFormat, prefix?: string, suffix?: string): NumberFlowData;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//#region components/number-flow/formatter.ts
|
|
2
|
+
function formatNumberFlow(value, formatter, prefix, suffix) {
|
|
3
|
+
const numericValue = typeof value === "string" ? Number.parseFloat(value) : value;
|
|
4
|
+
const rawParts = formatter.formatToParts(numericValue);
|
|
5
|
+
const integerDigits = rawParts.filter((part) => part.type === "integer").reduce((count, part) => count + part.value.length, 0);
|
|
6
|
+
const counts = /* @__PURE__ */ new Map();
|
|
7
|
+
let integerPosition = integerDigits - 1;
|
|
8
|
+
let fractionPosition = -1;
|
|
9
|
+
const nextKey = (type) => {
|
|
10
|
+
var _counts$get;
|
|
11
|
+
const index = (_counts$get = counts.get(type)) !== null && _counts$get !== void 0 ? _counts$get : 0;
|
|
12
|
+
counts.set(type, index + 1);
|
|
13
|
+
return `${type}:${index}`;
|
|
14
|
+
};
|
|
15
|
+
const parts = [];
|
|
16
|
+
if (prefix) parts.push({
|
|
17
|
+
key: nextKey("prefix"),
|
|
18
|
+
type: "prefix",
|
|
19
|
+
value: prefix
|
|
20
|
+
});
|
|
21
|
+
for (const part of rawParts) {
|
|
22
|
+
const type = part.type === "minusSign" || part.type === "plusSign" ? "sign" : part.type;
|
|
23
|
+
if (type === "integer" || type === "fraction") {
|
|
24
|
+
for (const character of part.value) {
|
|
25
|
+
const position = type === "integer" ? integerPosition-- : fractionPosition--;
|
|
26
|
+
parts.push({
|
|
27
|
+
key: `${type}:${position}`,
|
|
28
|
+
type,
|
|
29
|
+
value: character,
|
|
30
|
+
digit: Number(character),
|
|
31
|
+
position
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
parts.push({
|
|
37
|
+
key: nextKey(type),
|
|
38
|
+
type,
|
|
39
|
+
value: part.value
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (suffix) parts.push({
|
|
43
|
+
key: nextKey("suffix"),
|
|
44
|
+
type: "suffix",
|
|
45
|
+
value: suffix
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
parts,
|
|
49
|
+
value: numericValue,
|
|
50
|
+
valueAsString: `${prefix !== null && prefix !== void 0 ? prefix : ""}${formatter.format(numericValue)}${suffix !== null && suffix !== void 0 ? suffix : ""}`
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { formatNumberFlow };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
import type { NumberFlowValue } from './types';
|
|
3
|
+
export interface GroupChild {
|
|
4
|
+
value: ComputedRef<NumberFlowValue>;
|
|
5
|
+
prepare: () => number | undefined;
|
|
6
|
+
commit: (version: number) => boolean;
|
|
7
|
+
start: (version: number) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const GROUP_KEY: InjectionKey<{
|
|
10
|
+
register: (child: GroupChild) => () => void;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
import type { SDOptions } from '../_utils/types';
|
|
3
|
+
import { continuous } from './continuous';
|
|
4
|
+
import _NumberFlowGroup from './number-flow-group.vue';
|
|
5
|
+
import _NumberFlow from './number-flow.vue';
|
|
6
|
+
export { useCanAnimate } from './use-can-animate';
|
|
7
|
+
declare const NumberFlow: {
|
|
8
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./types").NumberFlowProps> & Readonly<{
|
|
9
|
+
onAnimationsstart?: (() => any) | undefined;
|
|
10
|
+
onAnimationsfinish?: (() => any) | undefined;
|
|
11
|
+
}>, import("./types").NumberFlowExposed, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
animationsstart: () => any;
|
|
13
|
+
animationsfinish: () => any;
|
|
14
|
+
}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
15
|
+
P: {};
|
|
16
|
+
B: {};
|
|
17
|
+
D: {};
|
|
18
|
+
C: {};
|
|
19
|
+
M: {};
|
|
20
|
+
Defaults: {};
|
|
21
|
+
}, Readonly<import("./types").NumberFlowProps> & Readonly<{
|
|
22
|
+
onAnimationsstart?: (() => any) | undefined;
|
|
23
|
+
onAnimationsfinish?: (() => any) | undefined;
|
|
24
|
+
}>, import("./types").NumberFlowExposed, {}, {}, {}, {}>;
|
|
25
|
+
__isFragment?: never;
|
|
26
|
+
__isTeleport?: never;
|
|
27
|
+
__isSuspense?: never;
|
|
28
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./types").NumberFlowProps> & Readonly<{
|
|
29
|
+
onAnimationsstart?: (() => any) | undefined;
|
|
30
|
+
onAnimationsfinish?: (() => any) | undefined;
|
|
31
|
+
}>, import("./types").NumberFlowExposed, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
+
animationsstart: () => any;
|
|
33
|
+
animationsfinish: () => any;
|
|
34
|
+
}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
35
|
+
$slots: {
|
|
36
|
+
prefix(): unknown;
|
|
37
|
+
suffix(): unknown;
|
|
38
|
+
};
|
|
39
|
+
}) & {
|
|
40
|
+
install: (app: App, options?: SDOptions) => void;
|
|
41
|
+
};
|
|
42
|
+
declare const NumberFlowGroup: {
|
|
43
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
44
|
+
P: {};
|
|
45
|
+
B: {};
|
|
46
|
+
D: {};
|
|
47
|
+
C: {};
|
|
48
|
+
M: {};
|
|
49
|
+
Defaults: {};
|
|
50
|
+
}, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
51
|
+
__isFragment?: never;
|
|
52
|
+
__isTeleport?: never;
|
|
53
|
+
__isSuspense?: never;
|
|
54
|
+
} & import("vue").ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
55
|
+
$slots: {
|
|
56
|
+
default(): unknown;
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
export { NumberFlowGroup, continuous };
|
|
60
|
+
export type NumberFlowInstance = InstanceType<typeof _NumberFlow>;
|
|
61
|
+
export type NumberFlowGroupInstance = InstanceType<typeof _NumberFlowGroup>;
|
|
62
|
+
export type { NumberFlowDigitContext, NumberFlowDigitOptions, NumberFlowDigits, NumberFlowExposed, NumberFlowFormat, NumberFlowPlugin, NumberFlowPluginContext, NumberFlowProps, NumberFlowStyle, NumberFlowTrend, NumberFlowValue, } from './types';
|
|
63
|
+
export default NumberFlow;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getComponentPrefix, setGlobalConfig } from "../_utils/global-config.js";
|
|
2
|
+
import { continuous } from "./continuous.js";
|
|
3
|
+
import number_flow_group_default from "./number-flow-group.js";
|
|
4
|
+
import { useCanAnimate } from "./use-can-animate.js";
|
|
5
|
+
import number_flow_default from "./number-flow.js";
|
|
6
|
+
//#region components/number-flow/index.ts
|
|
7
|
+
var NumberFlow = Object.assign(number_flow_default, { install: (app, options) => {
|
|
8
|
+
setGlobalConfig(app, options);
|
|
9
|
+
const componentPrefix = getComponentPrefix(options);
|
|
10
|
+
app.component(componentPrefix + number_flow_default.name, number_flow_default);
|
|
11
|
+
app.component(componentPrefix + number_flow_group_default.name, number_flow_group_default);
|
|
12
|
+
} });
|
|
13
|
+
var NumberFlowGroup = number_flow_group_default;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { NumberFlowGroup, continuous, NumberFlow as default, useCanAnimate };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import number_flow_group_vue_vue_type_script_setup_true_lang_default from "./number-flow-group.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region components/number-flow/number-flow-group.vue
|
|
3
|
+
var number_flow_group_default = number_flow_group_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { number_flow_group_default as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type __VLS_Slots = {
|
|
2
|
+
default(): unknown;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
5
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectSpread2.js";
|
|
2
|
+
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
|
+
import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/asyncToGenerator.js";
|
|
4
|
+
import { GROUP_KEY } from "./group-key.js";
|
|
5
|
+
import { createElementBlock, defineComponent, nextTick, normalizeClass, openBlock, provide, renderSlot, unref, watch } from "vue";
|
|
6
|
+
//#region components/number-flow/number-flow-group.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var number_flow_group_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "NumberFlowGroup" }), {}, {
|
|
8
|
+
__name: "number-flow-group",
|
|
9
|
+
setup(__props) {
|
|
10
|
+
const children = /* @__PURE__ */ new Set();
|
|
11
|
+
let updating = false;
|
|
12
|
+
let pending = false;
|
|
13
|
+
function animateChildren() {
|
|
14
|
+
return _animateChildren.apply(this, arguments);
|
|
15
|
+
}
|
|
16
|
+
function _animateChildren() {
|
|
17
|
+
_animateChildren = _asyncToGenerator(function* () {
|
|
18
|
+
if (updating) {
|
|
19
|
+
pending = true;
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
updating = true;
|
|
23
|
+
try {
|
|
24
|
+
do {
|
|
25
|
+
pending = false;
|
|
26
|
+
const preparedChildren = [...children].flatMap((child) => {
|
|
27
|
+
const version = child.prepare();
|
|
28
|
+
return version === void 0 ? [] : [{
|
|
29
|
+
child,
|
|
30
|
+
version
|
|
31
|
+
}];
|
|
32
|
+
});
|
|
33
|
+
if (preparedChildren.length === 0) continue;
|
|
34
|
+
yield nextTick();
|
|
35
|
+
preparedChildren.filter(({ child, version }) => child.commit(version)).forEach(({ child, version }) => child.start(version));
|
|
36
|
+
} while (pending);
|
|
37
|
+
} finally {
|
|
38
|
+
updating = false;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return _animateChildren.apply(this, arguments);
|
|
42
|
+
}
|
|
43
|
+
provide(GROUP_KEY, { register(child) {
|
|
44
|
+
children.add(child);
|
|
45
|
+
const stopWatch = watch(child.value, animateChildren, { flush: "pre" });
|
|
46
|
+
return () => {
|
|
47
|
+
stopWatch();
|
|
48
|
+
children.delete(child);
|
|
49
|
+
};
|
|
50
|
+
} });
|
|
51
|
+
const prefixCls = getPrefixCls("number-flow-group");
|
|
52
|
+
return (_ctx, _cache) => {
|
|
53
|
+
return openBlock(), createElementBlock("span", { class: normalizeClass(unref(prefixCls)) }, [renderSlot(_ctx.$slots, "default")], 2);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
//#endregion
|
|
58
|
+
export { number_flow_group_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import number_flow_vue_vue_type_script_setup_true_lang_default from "./number-flow.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region components/number-flow/number-flow.vue
|
|
3
|
+
var number_flow_default = number_flow_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { number_flow_default as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { NumberFlowExposed, NumberFlowProps } from './types';
|
|
2
|
+
type __VLS_Slots = {
|
|
3
|
+
prefix(): unknown;
|
|
4
|
+
suffix(): unknown;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import("vue").DefineComponent<NumberFlowProps, NumberFlowExposed, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
animationsstart: () => any;
|
|
8
|
+
animationsfinish: () => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<NumberFlowProps> & Readonly<{
|
|
10
|
+
onAnimationsstart?: (() => any) | undefined;
|
|
11
|
+
onAnimationsfinish?: (() => any) | undefined;
|
|
12
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|