zartui 3.1.11 → 3.1.13
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/README.md +23 -23
- package/es/action-sheet/index.css +1 -1
- package/es/avatar/index.css +1 -1
- package/es/badge/index.css +1 -1
- package/es/button/index.css +1 -1
- package/es/calendar/index.css +1 -1
- package/es/calendar/utils.d.ts +2 -2
- package/es/cascader/Cascader.d.ts +1 -1
- package/es/cascader/index.css +1 -1
- package/es/cascader/index.d.ts +1 -1
- package/es/cell/Cell.d.ts +34 -0
- package/es/cell/Cell.mjs +61 -8
- package/es/cell/index.css +1 -1
- package/es/cell/index.d.ts +17 -0
- package/es/cell/style/index.mjs +1 -0
- package/es/cell-group/index.css +1 -1
- package/es/checkbox/Checkbox.d.ts +1 -1
- package/es/checkbox/index.d.ts +1 -1
- package/es/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/es/checkbox-group/index.d.ts +1 -1
- package/es/collapse/Collapse.d.ts +1 -1
- package/es/collapse/index.d.ts +1 -1
- package/es/collapse-item/index.css +1 -1
- package/es/composables/use-touch.d.ts +1 -0
- package/es/composables/use-touch.mjs +8 -1
- package/es/config-provider/types.d.ts +1 -1
- package/es/date-time-picker/DateTimePicker.d.ts +1 -1
- package/es/date-time-picker/DateTimePickerWrapper.d.ts +1 -1
- package/es/date-time-picker/index.d.ts +1 -1
- package/es/dialog/index.css +1 -1
- package/es/divider/index.css +1 -1
- package/es/drawer-select/DrawerSelect.d.ts +68 -0
- package/es/drawer-select/DrawerSelect.mjs +360 -0
- package/es/drawer-select/index.css +1 -0
- package/es/drawer-select/index.d.ts +53 -0
- package/es/drawer-select/index.mjs +8 -0
- package/es/drawer-select/style/index.d.ts +1 -0
- package/es/drawer-select/style/index.mjs +15 -0
- package/es/drawer-select/types.d.ts +26 -0
- package/es/drawer-select/types.mjs +0 -0
- package/es/dropdown-item/DropdownItem.d.ts +1 -1
- package/es/dropdown-item/index.d.ts +1 -1
- package/es/dropdown-item/style/index.mjs +2 -1
- package/es/dropdown-menu/DropdownMenu.mjs +3 -0
- package/es/dropdown-menu/index.css +1 -1
- package/es/field/Field.d.ts +27 -3
- package/es/field/Field.mjs +11 -3
- package/es/field/index.css +1 -1
- package/es/field/index.d.ts +19 -3
- package/es/floating-bubble/FloatingBubble.d.ts +81 -0
- package/es/floating-bubble/FloatingBubble.mjs +181 -0
- package/es/floating-bubble/index.css +1 -0
- package/es/floating-bubble/index.d.ts +63 -0
- package/es/floating-bubble/index.mjs +10 -0
- package/es/floating-bubble/style/index.d.ts +1 -0
- package/es/floating-bubble/style/index.mjs +4 -0
- package/es/floating-bubble/types.d.ts +20 -0
- package/es/floating-bubble/types.mjs +0 -0
- package/es/hierarchy-select/index.css +1 -1
- package/es/image/index.css +1 -1
- package/es/image-preview/index.css +1 -1
- package/es/index.d.ts +3 -1
- package/es/index.mjs +7 -1
- package/es/lazyload/vue-lazyload/index.d.ts +55 -55
- package/es/media-picker/index.css +1 -1
- package/es/media-picker/watermark/image-processor.mjs +2 -2
- package/es/media-player/index.css +1 -1
- package/es/multiple-picker/index.css +1 -1
- package/es/nav-bar/NavBar.d.ts +1 -1
- package/es/nav-bar/index.d.ts +1 -1
- package/es/notice-bar/index.css +1 -1
- package/es/number-keyboard/NumberKeyboard.d.ts +1 -1
- package/es/number-keyboard/index.css +1 -1
- package/es/number-keyboard/index.d.ts +1 -1
- package/es/password-input/index.css +1 -1
- package/es/picker/Picker.d.ts +1 -1
- package/es/picker/index.css +1 -1
- package/es/picker/index.d.ts +1 -1
- package/es/popover/index.css +1 -1
- package/es/popup/index.css +1 -1
- package/es/pull-refresh/PullRefresh.d.ts +1 -1
- package/es/pull-refresh/index.d.ts +1 -1
- package/es/radio-group/RadioGroup.d.ts +1 -1
- package/es/radio-group/index.d.ts +1 -1
- package/es/radio-picker/RadioPicker.d.ts +1 -1
- package/es/radio-picker/index.css +1 -1
- package/es/radio-picker/index.d.ts +1 -1
- package/es/radio-picker/style/index.mjs +3 -3
- package/es/rate/Rate.d.ts +1 -1
- package/es/rate/index.d.ts +1 -1
- package/es/search/Search.d.ts +2 -2
- package/es/search/index.css +1 -1
- package/es/search/index.d.ts +2 -2
- package/es/step/index.css +1 -1
- package/es/stepper/Stepper.d.ts +1 -1
- package/es/stepper/index.css +1 -1
- package/es/stepper/index.d.ts +1 -1
- package/es/steps/index.css +1 -1
- package/es/style/base.css +1 -1
- package/es/style/css-variables.css +1 -1
- package/es/switch/Switch.d.ts +1 -1
- package/es/switch/index.d.ts +1 -1
- package/es/tabbar/Tabbar.d.ts +2 -2
- package/es/tabbar/index.css +1 -1
- package/es/tabbar/index.d.ts +2 -2
- package/es/tabbar-item/index.css +1 -1
- package/es/tabs/Tabs.mjs +4 -2
- package/es/tabs/TabsTitle.mjs +16 -6
- package/es/tabs/index.css +1 -1
- package/es/tag/index.css +1 -1
- package/es/text-ellipsis/TextEllipsis.mjs +2 -0
- package/es/time-picker/TimePicker.d.ts +1 -1
- package/es/time-picker/index.css +1 -1
- package/es/time-picker/index.d.ts +1 -1
- package/es/timeline/index.css +1 -1
- package/es/uploader/index.css +1 -1
- package/es/utils/closest.d.ts +1 -0
- package/es/utils/closest.mjs +8 -0
- package/es/utils/constant.d.ts +1 -1
- package/es/utils/constant.mjs +3 -3
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.mjs +1 -0
- package/es/utils/validate.d.ts +2 -1
- package/es/utils/validate.mjs +9 -0
- package/es/vue-sfc-shim.d.ts +6 -6
- package/es/vue-tsx-shim.d.ts +23 -23
- package/lib/action-sheet/index.css +1 -1
- package/lib/avatar/index.css +1 -1
- package/lib/badge/index.css +1 -1
- package/lib/button/index.css +1 -1
- package/lib/calendar/index.css +1 -1
- package/lib/calendar/utils.d.ts +2 -2
- package/lib/cascader/Cascader.d.ts +1 -1
- package/lib/cascader/index.css +1 -1
- package/lib/cascader/index.d.ts +1 -1
- package/lib/cell/Cell.d.ts +34 -0
- package/lib/cell/Cell.js +61 -8
- package/lib/cell/index.css +1 -1
- package/lib/cell/index.d.ts +17 -0
- package/lib/cell/style/index.js +1 -0
- package/lib/cell-group/index.css +1 -1
- package/lib/checkbox/Checkbox.d.ts +1 -1
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/lib/checkbox-group/index.d.ts +1 -1
- package/lib/collapse/Collapse.d.ts +1 -1
- package/lib/collapse/index.d.ts +1 -1
- package/lib/collapse-item/index.css +1 -1
- package/lib/composables/use-touch.d.ts +1 -0
- package/lib/composables/use-touch.js +8 -1
- package/lib/config-provider/types.d.ts +1 -1
- package/lib/date-time-picker/DateTimePicker.d.ts +1 -1
- package/lib/date-time-picker/DateTimePickerWrapper.d.ts +1 -1
- package/lib/date-time-picker/index.d.ts +1 -1
- package/lib/dialog/index.css +1 -1
- package/lib/divider/index.css +1 -1
- package/lib/drawer-select/DrawerSelect.d.ts +68 -0
- package/lib/drawer-select/DrawerSelect.js +389 -0
- package/lib/drawer-select/index.css +1 -0
- package/lib/drawer-select/index.d.ts +53 -0
- package/lib/drawer-select/index.js +37 -0
- package/lib/drawer-select/style/index.d.ts +1 -0
- package/lib/drawer-select/style/index.js +15 -0
- package/lib/drawer-select/types.d.ts +26 -0
- package/lib/drawer-select/types.js +15 -0
- package/lib/dropdown-item/DropdownItem.d.ts +1 -1
- package/lib/dropdown-item/index.d.ts +1 -1
- package/lib/dropdown-item/style/index.js +2 -1
- package/lib/dropdown-menu/DropdownMenu.js +3 -0
- package/lib/dropdown-menu/index.css +1 -1
- package/lib/field/Field.d.ts +27 -3
- package/lib/field/Field.js +11 -3
- package/lib/field/index.css +1 -1
- package/lib/field/index.d.ts +19 -3
- package/lib/floating-bubble/FloatingBubble.d.ts +81 -0
- package/lib/floating-bubble/FloatingBubble.js +210 -0
- package/lib/floating-bubble/index.css +1 -0
- package/lib/floating-bubble/index.d.ts +63 -0
- package/lib/floating-bubble/index.js +39 -0
- package/lib/floating-bubble/style/index.d.ts +1 -0
- package/lib/floating-bubble/style/index.js +4 -0
- package/lib/floating-bubble/types.d.ts +20 -0
- package/lib/floating-bubble/types.js +15 -0
- package/lib/hierarchy-select/index.css +1 -1
- package/lib/image/index.css +1 -1
- package/lib/image-preview/index.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +7 -1
- package/lib/lazyload/vue-lazyload/index.d.ts +55 -55
- package/lib/media-picker/index.css +1 -1
- package/lib/media-picker/watermark/image-processor.js +1 -1
- package/lib/media-player/index.css +1 -1
- package/lib/multiple-picker/index.css +1 -1
- package/lib/nav-bar/NavBar.d.ts +1 -1
- package/lib/nav-bar/index.d.ts +1 -1
- package/lib/notice-bar/index.css +1 -1
- package/lib/number-keyboard/NumberKeyboard.d.ts +1 -1
- package/lib/number-keyboard/index.css +1 -1
- package/lib/number-keyboard/index.d.ts +1 -1
- package/lib/password-input/index.css +1 -1
- package/lib/picker/Picker.d.ts +1 -1
- package/lib/picker/index.css +1 -1
- package/lib/picker/index.d.ts +1 -1
- package/lib/popover/index.css +1 -1
- package/lib/popup/index.css +1 -1
- package/lib/pull-refresh/PullRefresh.d.ts +1 -1
- package/lib/pull-refresh/index.d.ts +1 -1
- package/lib/radio-group/RadioGroup.d.ts +1 -1
- package/lib/radio-group/index.d.ts +1 -1
- package/lib/radio-picker/RadioPicker.d.ts +1 -1
- package/lib/radio-picker/index.css +1 -1
- package/lib/radio-picker/index.d.ts +1 -1
- package/lib/radio-picker/style/index.js +3 -3
- package/lib/rate/Rate.d.ts +1 -1
- package/lib/rate/index.d.ts +1 -1
- package/lib/search/Search.d.ts +2 -2
- package/lib/search/index.css +1 -1
- package/lib/search/index.d.ts +2 -2
- package/lib/step/index.css +1 -1
- package/lib/stepper/Stepper.d.ts +1 -1
- package/lib/stepper/index.css +1 -1
- package/lib/stepper/index.d.ts +1 -1
- package/lib/steps/index.css +1 -1
- package/lib/style/base.css +1 -1
- package/lib/style/css-variables.css +1 -1
- package/lib/switch/Switch.d.ts +1 -1
- package/lib/switch/index.d.ts +1 -1
- package/lib/tabbar/Tabbar.d.ts +2 -2
- package/lib/tabbar/index.css +1 -1
- package/lib/tabbar/index.d.ts +2 -2
- package/lib/tabbar-item/index.css +1 -1
- package/lib/tabs/Tabs.js +4 -2
- package/lib/tabs/TabsTitle.js +16 -6
- package/lib/tabs/index.css +1 -1
- package/lib/tag/index.css +1 -1
- package/lib/text-ellipsis/TextEllipsis.js +2 -0
- package/lib/time-picker/TimePicker.d.ts +1 -1
- package/lib/time-picker/index.css +1 -1
- package/lib/time-picker/index.d.ts +1 -1
- package/lib/timeline/index.css +1 -1
- package/lib/uploader/index.css +1 -1
- package/lib/utils/closest.d.ts +1 -0
- package/lib/utils/closest.js +27 -0
- package/lib/utils/constant.d.ts +1 -1
- package/lib/utils/constant.js +3 -3
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/validate.d.ts +2 -1
- package/lib/utils/validate.js +9 -0
- package/lib/vue-sfc-shim.d.ts +6 -6
- package/lib/vue-tsx-shim.d.ts +23 -23
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +3897 -3275
- package/lib/zartui.es.js +3898 -3276
- package/lib/zartui.js +3886 -3264
- package/lib/zartui.min.js +1 -1
- package/package.json +9 -8
|
@@ -40,7 +40,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
40
40
|
};
|
|
41
41
|
titleClass: PropType<unknown>;
|
|
42
42
|
multiSelect: BooleanConstructor;
|
|
43
|
-
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("reset" | "open" | "
|
|
43
|
+
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("reset" | "open" | "update:modelValue" | "change" | "close" | "opened" | "closed" | "confirm")[], "reset" | "open" | "update:modelValue" | "change" | "close" | "opened" | "closed" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
44
44
|
title: StringConstructor;
|
|
45
45
|
options: {
|
|
46
46
|
type: PropType<DropdownItemOption[]>;
|
|
@@ -18,7 +18,7 @@ export declare const DropdownItem: import("../utils").WithInstall<import("vue").
|
|
|
18
18
|
};
|
|
19
19
|
titleClass: import("vue").PropType<unknown>;
|
|
20
20
|
multiSelect: BooleanConstructor;
|
|
21
|
-
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("reset" | "open" | "
|
|
21
|
+
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("reset" | "open" | "update:modelValue" | "change" | "close" | "opened" | "closed" | "confirm")[], "reset" | "open" | "update:modelValue" | "change" | "close" | "opened" | "closed" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
22
|
title: StringConstructor;
|
|
23
23
|
options: {
|
|
24
24
|
type: import("vue").PropType<import("./types").DropdownItemOption[]>;
|
|
@@ -2,11 +2,12 @@ require("../../style/base.css");
|
|
|
2
2
|
require("../../badge/index.css");
|
|
3
3
|
require("../../icon/index.css");
|
|
4
4
|
require("../../dropdown-menu/index.css");
|
|
5
|
-
require("../../cell/index.css");
|
|
6
5
|
require("../../overlay/index.css");
|
|
7
6
|
require("../../popup/index.css");
|
|
8
7
|
require("../../loading/index.css");
|
|
9
8
|
require("../../button/index.css");
|
|
9
|
+
require("../../cell/index.css");
|
|
10
|
+
require("../../field/index.css");
|
|
10
11
|
require("../../checkbox-group/index.css");
|
|
11
12
|
require("../../checkbox/index.css");
|
|
12
13
|
require("../index.css");
|
|
@@ -113,6 +113,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
113
113
|
disabled,
|
|
114
114
|
titleClass
|
|
115
115
|
} = item;
|
|
116
|
+
if (item.$slots.header) {
|
|
117
|
+
return item.$slots.header(item);
|
|
118
|
+
}
|
|
116
119
|
return (0, import_vue.createVNode)("div", {
|
|
117
120
|
"id": `${id}-${index}`,
|
|
118
121
|
"role": "button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-dropdown-menu-background: var(--zt-background-
|
|
1
|
+
:root{--zt-dropdown-menu-background: var(--zt-background-popup);--zt-dropdown-menu-bar-padding: 0 12px;--zt-dropdown-menu-item-margin: 12px 4px;--zt-dropdown-menu-item-height: 36px;--zt-dropdown-menu-item-padding: 0 12px;--zt-dropdown-menu-title-text-color: var(--zt-text-color);--zt-dropdown-menu-title-active-text-color: var(--zt-primary-color);--zt-dropdown-menu-title-disabled-text-color: var(--zt-text-color-2);--zt-dropdown-menu-option-active-color: var(--zt-primary-color);--zt-dropdown-menu-content-max-height: 80%}:root[zt-theme-size=large]{--zt-dropdown-menu-item-height: 48px}.zt-dropdown-menu{-webkit-user-select:none;user-select:none}.zt-dropdown-menu__bar{position:relative;display:flex;padding:var(--zt-dropdown-menu-bar-padding);align-items:center}.zt-dropdown-menu__bar--opened{z-index:calc(var(--zt-dropdown-item-z-index) + 1)}.zt-dropdown-menu__item{display:flex;flex:1;align-items:center;justify-content:center;background:var(--zt-dropdown-menu-background);min-width:0;margin:var(--zt-dropdown-menu-item-margin);height:var(--zt-dropdown-menu-item-height);border-radius:calc(var(--zt-dropdown-menu-item-height) / 2);padding:var(--zt-dropdown-menu-item-padding);font-size:var(--zt-font-size-md);line-height:var(--zt-line-height-md);cursor:pointer}.zt-dropdown-menu__item:last-child{margin-right:0}.zt-dropdown-menu__item:active{opacity:.7}.zt-dropdown-menu__item--disabled:active{opacity:1}.zt-dropdown-menu__item--disabled .zt-dropdown-menu__title{color:var(--zt-dropdown-menu-title-disabled-text-color)}.zt-dropdown-menu__title{position:relative;box-sizing:border-box;width:100%;color:var(--zt-dropdown-menu-title-text-color);font-size:var(--zt-font-size-md)}.zt-dropdown-menu__title .zt-icon{position:absolute;right:0;margin-top:1px;color:var(--zt-gray-4)}.zt-dropdown-menu__title--active{color:var(--zt-dropdown-menu-title-active-text-color)}.zt-dropdown-menu__title--active .zt-icon{color:currentColor}.zt-dropdown-menu__title--active .zt-dropdown-menu__icon{transform:rotate(180deg)}.zt-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
|
package/lib/field/Field.d.ts
CHANGED
|
@@ -79,6 +79,14 @@ declare const fieldProps: {
|
|
|
79
79
|
type: PropType<string>;
|
|
80
80
|
default: string;
|
|
81
81
|
};
|
|
82
|
+
placeholder: StringConstructor;
|
|
83
|
+
errorMessage: StringConstructor;
|
|
84
|
+
errorMessageAlign: PropType<FieldTextAlign>;
|
|
85
|
+
descriptionClass: PropType<unknown>;
|
|
86
|
+
description: {
|
|
87
|
+
type: PropType<string>;
|
|
88
|
+
default: string;
|
|
89
|
+
};
|
|
82
90
|
} & {
|
|
83
91
|
id: StringConstructor;
|
|
84
92
|
name: StringConstructor;
|
|
@@ -181,6 +189,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
181
189
|
type: PropType<string>;
|
|
182
190
|
default: string;
|
|
183
191
|
};
|
|
192
|
+
placeholder: StringConstructor;
|
|
193
|
+
errorMessage: StringConstructor;
|
|
194
|
+
errorMessageAlign: PropType<FieldTextAlign>;
|
|
195
|
+
descriptionClass: PropType<unknown>;
|
|
196
|
+
description: {
|
|
197
|
+
type: PropType<string>;
|
|
198
|
+
default: string;
|
|
199
|
+
};
|
|
184
200
|
} & {
|
|
185
201
|
id: StringConstructor;
|
|
186
202
|
name: StringConstructor;
|
|
@@ -246,7 +262,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
246
262
|
type: BooleanConstructor;
|
|
247
263
|
default: null;
|
|
248
264
|
};
|
|
249
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "
|
|
265
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "clickInput" | "endValidate" | "startValidate" | "clickLeftIcon" | "clickRightIcon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "clickInput" | "endValidate" | "startValidate" | "clickLeftIcon" | "clickRightIcon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
250
266
|
leftIcon: StringConstructor;
|
|
251
267
|
titleIcon: StringConstructor;
|
|
252
268
|
title: (NumberConstructor | StringConstructor)[];
|
|
@@ -281,6 +297,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
281
297
|
type: PropType<string>;
|
|
282
298
|
default: string;
|
|
283
299
|
};
|
|
300
|
+
placeholder: StringConstructor;
|
|
301
|
+
errorMessage: StringConstructor;
|
|
302
|
+
errorMessageAlign: PropType<FieldTextAlign>;
|
|
303
|
+
descriptionClass: PropType<unknown>;
|
|
304
|
+
description: {
|
|
305
|
+
type: PropType<string>;
|
|
306
|
+
default: string;
|
|
307
|
+
};
|
|
284
308
|
} & {
|
|
285
309
|
id: StringConstructor;
|
|
286
310
|
name: StringConstructor;
|
|
@@ -370,13 +394,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
370
394
|
clickable: boolean | null;
|
|
371
395
|
clearable: boolean;
|
|
372
396
|
clearIcon: string;
|
|
373
|
-
|
|
397
|
+
description: string;
|
|
374
398
|
modelValue: string | number;
|
|
375
399
|
clearTrigger: FieldClearTrigger;
|
|
376
400
|
formatTrigger: FieldFormatTrigger;
|
|
401
|
+
error: boolean;
|
|
377
402
|
readonly: boolean;
|
|
378
403
|
showWordLimit: boolean;
|
|
379
|
-
description: string;
|
|
380
404
|
colon: boolean;
|
|
381
405
|
}, {}>;
|
|
382
406
|
export default _default;
|
package/lib/field/Field.js
CHANGED
|
@@ -489,7 +489,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
489
489
|
return (_a = clearIconRef.value) == null ? void 0 : _a.$el;
|
|
490
490
|
})
|
|
491
491
|
});
|
|
492
|
-
|
|
492
|
+
const renderField = () => {
|
|
493
493
|
const disabled = getProp("disabled");
|
|
494
494
|
const readonly = getProp("readonly");
|
|
495
495
|
const labelAlign = getProp("labelAlign");
|
|
@@ -505,7 +505,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
505
505
|
disabled,
|
|
506
506
|
readonly,
|
|
507
507
|
[`label-${labelAlign}`]: labelAlign,
|
|
508
|
-
"error-message": props.errorMessage !== "" && typeof props.errorMessage !== "undefined",
|
|
508
|
+
"error-message": props.errorMessage !== "" && typeof props.errorMessage !== "undefined" || state.validateMessage,
|
|
509
509
|
description: props.description !== "" && typeof props.description !== "undefined",
|
|
510
510
|
"is-link": props.isLink
|
|
511
511
|
}),
|
|
@@ -525,8 +525,16 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
525
525
|
title: Label ? () => Label : null,
|
|
526
526
|
value: renderFieldBody,
|
|
527
527
|
extra: slots.extra,
|
|
528
|
-
bottom: renderBottom
|
|
528
|
+
bottom: props.direction === "horizontal" ? null : renderBottom
|
|
529
529
|
});
|
|
530
530
|
};
|
|
531
|
+
return () => {
|
|
532
|
+
const field = renderField();
|
|
533
|
+
return props.direction === "horizontal" && form ? (0, import_vue.createVNode)("div", {
|
|
534
|
+
"class": bem({
|
|
535
|
+
wraper: true
|
|
536
|
+
})
|
|
537
|
+
}, [field, renderBottom()]) : field;
|
|
538
|
+
};
|
|
531
539
|
}
|
|
532
540
|
});
|
package/lib/field/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-field-value-border-radius: var(--zt-radius-md);--zt-field-input-text-color: var(--zt-text-color);--zt-field-input-disabled-text-color: var(--zt-gray-a4);--zt-field-placeholder-text-color: var(--zt-placeholder-color);--zt-field-clear-icon-color: var(--zt-gray-a6);--zt-field-left-icon-color: var(--zt-gray-a4);--zt-field-right-icon-color: var(--zt-gray-a4);--zt-field-password-icon-color: var(--zt-gray-a6);--zt-field-error-message-background-color: rgb(var(--zt-red-r), var(--zt-red-g), var(--zt-red-b), .1);--zt-field-error-message-color: var(--zt-red);--zt-field-description-background-color: var(--zt-gray-a04);--zt-field-description-color: var(--zt-gray-a6);--zt-field-description-border-color: var(--zt-gray-a2);--zt-field-text-area-min-height: 60px;--zt-field-word-limit-color: var(--zt-gray-a4);--zt-field-disabled-text-color: var(--zt-gray-a6);--zt-field-required-mark-color: var(--zt-red);--zt-field-required-mark-margin: 0 0 0 4px;--zt-field-caret-color: var(--zt-primary-color)}.zt-field__label{flex:none;box-sizing:border-box;word-wrap:break-word;overflow:hidden}.zt-field__label--center{text-align:center}.zt-field__label--right{text-align:right}.zt-field__label--required:after{margin:var(--zt-field-required-mark-margin);color:var(--zt-field-required-mark-color);content:"*";font-weight:var(--zt-font-bold);line-height:var(--zt-line-height-md)}.zt-field--disabled .zt-field__label{color:var(--zt-field-disabled-text-color)}.zt-field--disabled .zt-cell__value--vertical,.zt-field--readonly .zt-cell__value--vertical{background:var(--zt-gray-a04)}.zt-field__value{display:block;overflow:visible;border-radius:var(--zt-field-value-border-radius)}.zt-field__body{width:100%;display:flex;align-items:center}.zt-field__body input,.zt-field__body textarea{caret-color:var(--zt-field-caret-color)}.zt-field__control{display:block;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;color:var(--zt-field-input-text-color);line-height:inherit;text-align:left;background-color:transparent;border:0;resize:none;-webkit-user-select:auto;user-select:auto}.zt-field__control::-webkit-input-placeholder{color:var(--zt-field-placeholder-text-color)}.zt-field__control::placeholder{color:var(--zt-field-placeholder-text-color)}.zt-field__control:disabled{color:var(--zt-field-input-disabled-text-color);cursor:not-allowed;opacity:1;-webkit-text-fill-color:var(--zt-field-input-disabled-text-color)}.zt-field__control:read-only{cursor:default}.zt-field__control--center{justify-content:center;text-align:center}.zt-field__control--right{justify-content:flex-end;text-align:right}.zt-field__control--custom{display:flex;align-items:center;min-height:var(--zt-line-height-md)}.zt-field__control--min-height{min-height:var(--zt-field-text-area-min-height)}.zt-field__control[type=date],.zt-field__control[type=time],.zt-field__control[type=datetime-local]{min-height:var(--zt-line-height-md)}.zt-field__control[type=search]{-webkit-appearance:none}.zt-field__clear,.zt-field__icon,.zt-field__button,.zt-field__right-icon{flex-shrink:0}.zt-field__clear,.zt-field__right-icon{margin-right:calc(var(--zt-padding-xs) * -1);padding:0 var(--zt-padding-xs);line-height:inherit}.zt-field__clear{color:var(--zt-field-clear-icon-color);font-size:var(--zt-font-size-xxl);cursor:pointer}.zt-field__left-icon .zt-icon,.zt-field__right-icon .zt-icon{display:block;font-size:var(--zt-font-size-xxl)}.zt-field__left-icon{color:var(--zt-field-left-icon-color);margin-right:var(--zt-padding-base);display:flex;align-items:center}.zt-field__right-icon{color:var(--zt-field-right-icon-color)}.zt-field__button{padding-left:var(--zt-padding-xs)}.zt-field__error-message{
|
|
1
|
+
:root{--zt-field-value-border-radius: var(--zt-radius-md);--zt-field-input-text-color: var(--zt-text-color);--zt-field-input-disabled-text-color: var(--zt-gray-a4);--zt-field-placeholder-text-color: var(--zt-placeholder-color);--zt-field-clear-icon-color: var(--zt-gray-a6);--zt-field-left-icon-color: var(--zt-gray-a4);--zt-field-right-icon-color: var(--zt-gray-a4);--zt-field-password-icon-color: var(--zt-gray-a6);--zt-field-error-message-background-color: rgb(var(--zt-red-r), var(--zt-red-g), var(--zt-red-b), .1);--zt-field-error-message-color: var(--zt-red);--zt-field-description-background-color: var(--zt-gray-a04);--zt-field-description-color: var(--zt-gray-a6);--zt-field-description-border-color: var(--zt-gray-a2);--zt-field-text-area-min-height: 60px;--zt-field-word-limit-color: var(--zt-gray-a4);--zt-field-disabled-text-color: var(--zt-gray-a6);--zt-field-required-mark-color: var(--zt-red);--zt-field-required-mark-margin: 0 0 0 4px;--zt-field-caret-color: var(--zt-primary-color)}.zt-field--wraper{position:relative;background:var(--zt-background)}.zt-field--wraper>.zt-cell:after{display:none}.zt-field--wraper .zt-field__bottom{padding:0 var(--zt-padding-md) var(--zt-padding-xs)}.zt-field--wraper:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:0;bottom:0;left:var(--zt-padding-md);border-bottom:1px solid var(--zt-border-color);transform:scaleY(.5)}.zt-field__label{flex:none;box-sizing:border-box;word-wrap:break-word;overflow:hidden}.zt-field__label--center{text-align:center}.zt-field__label--right{text-align:right}.zt-field__label--required:after{margin:var(--zt-field-required-mark-margin);color:var(--zt-field-required-mark-color);content:"*";font-weight:var(--zt-font-bold);line-height:var(--zt-line-height-md)}.zt-field--disabled .zt-field__label{color:var(--zt-field-disabled-text-color)}.zt-field--disabled .zt-cell__value--vertical,.zt-field--readonly .zt-cell__value--vertical{background:var(--zt-gray-a04)}.zt-field__value{display:block;overflow:visible;border-radius:var(--zt-field-value-border-radius)}.zt-field__body{width:100%;display:flex;align-items:center}.zt-field__body input,.zt-field__body textarea{caret-color:var(--zt-field-caret-color)}.zt-field__control{display:block;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;color:var(--zt-field-input-text-color);line-height:inherit;text-align:left;background-color:transparent;border:0;resize:none;-webkit-user-select:auto;user-select:auto}.zt-field__control::-webkit-input-placeholder{color:var(--zt-field-placeholder-text-color)}.zt-field__control::placeholder{color:var(--zt-field-placeholder-text-color)}.zt-field__control:disabled{color:var(--zt-field-input-disabled-text-color);cursor:not-allowed;opacity:1;-webkit-text-fill-color:var(--zt-field-input-disabled-text-color)}.zt-field__control:read-only{cursor:default}.zt-field__control--center{justify-content:center;text-align:center}.zt-field__control--right{justify-content:flex-end;text-align:right}.zt-field__control--custom{display:flex;align-items:center;min-height:var(--zt-line-height-md)}.zt-field__control--min-height{min-height:var(--zt-field-text-area-min-height)}.zt-field__control[type=date],.zt-field__control[type=time],.zt-field__control[type=datetime-local]{min-height:var(--zt-line-height-md)}.zt-field__control[type=search]{-webkit-appearance:none}.zt-field__clear,.zt-field__icon,.zt-field__button,.zt-field__right-icon{flex-shrink:0}.zt-field__clear,.zt-field__right-icon{margin-right:calc(var(--zt-padding-xs) * -1);padding:0 var(--zt-padding-xs);line-height:inherit}.zt-field__clear{color:var(--zt-field-clear-icon-color);font-size:var(--zt-font-size-xxl);cursor:pointer}.zt-field__left-icon .zt-icon,.zt-field__right-icon .zt-icon{display:block;font-size:var(--zt-font-size-xxl)}.zt-field__left-icon{color:var(--zt-field-left-icon-color);margin-right:var(--zt-padding-base);display:flex;align-items:center}.zt-field__right-icon{color:var(--zt-field-right-icon-color)}.zt-field__button{padding-left:var(--zt-padding-xs)}.zt-field__error-message{background:var(--zt-field-error-message-background-color);border-radius:0 0 var(--zt-radius-md) var(--zt-radius-md);padding:var(--zt-padding-xs);font-size:var(--zt-font-size-sm);color:var(--zt-field-error-message-color);letter-spacing:0;line-height:var(--zt-line-height-sm);position:relative}.zt-field__error-message:before{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:0;right:0;left:0;border-top:1px solid var(--zt-field-error-message-color);transform:scaleY(.5)}.zt-field__error-message--center{text-align:center}.zt-field__error-message--right{text-align:right}.zt-field__word-limit{margin-top:var(--zt-padding-md);color:var(--zt-field-word-limit-color);font-size:var(--zt-font-size-md);line-height:var(--zt-line-height-md)}.zt-field__word-num--exceed{color:var(--zt-field-error-message-color)}.zt-field--error-message .zt-cell__value,.zt-field--error .zt-cell__value,.zt-field--description .zt-cell__value{border-bottom-left-radius:0;border-bottom-right-radius:0}.zt-field__bottom{border-radius:0 0 var(--zt-radius-md) var(--zt-radius-md)}.zt-field--error-message .zt-field__label,.zt-field--error .zt-field__label{color:var(--zt-field-error-message-color)}.zt-field--error-message.zt-field--description .zt-field__error-message,.zt-field--error.zt-field--description .zt-field__error-message{border-radius:0}.zt-field__description{background:var(--zt-field-description-background-color);border-radius:0 0 var(--zt-radius-md) var(--zt-radius-md);padding:var(--zt-padding-xs);font-size:var(--zt-font-size-sm);color:var(--zt-field-description-color);letter-spacing:0;line-height:var(--zt-line-height-sm);position:relative}.zt-field__description:before{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:0;right:0;left:0;border-top:1px solid var(--zt-field-description-border-color);transform:scaleY(.5)}.zt-field__password{width:100%;display:flex;justify-content:space-between;align-items:center}.zt-field__password .zt-icon{color:var(--zt-field-password-icon-color);font-size:var(--zt-font-size-xxl)}.zt-field.zt-cell--horizontal{padding:0 16px}.zt-field.zt-cell--horizontal .zt-cell__title--horizontal{min-height:44px}.zt-field.zt-cell--horizontal .zt-cell__value--horizontal .zt-field__body{height:100%}.zt-field.zt-cell--horizontal .zt-cell__value--horizontal .zt-field__body .zt-field__control{text-align:right}.zt-field.zt-cell--horizontal .zt-cell__value--horizontal .zt-field__control--custom{justify-content:flex-end}.zt-field--is-link .zt-field__value{display:flex}.zt-theme-dark{--zt-field-left-icon-color: var(--zt-gray)}
|
package/lib/field/index.d.ts
CHANGED
|
@@ -34,6 +34,14 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
|
34
34
|
type: import("vue").PropType<string>;
|
|
35
35
|
default: string;
|
|
36
36
|
};
|
|
37
|
+
placeholder: StringConstructor;
|
|
38
|
+
errorMessage: StringConstructor;
|
|
39
|
+
errorMessageAlign: import("vue").PropType<import("./types").FieldTextAlign>;
|
|
40
|
+
descriptionClass: import("vue").PropType<unknown>;
|
|
41
|
+
description: {
|
|
42
|
+
type: import("vue").PropType<string>;
|
|
43
|
+
default: string;
|
|
44
|
+
};
|
|
37
45
|
} & {
|
|
38
46
|
id: StringConstructor;
|
|
39
47
|
name: StringConstructor;
|
|
@@ -99,7 +107,7 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
|
99
107
|
type: BooleanConstructor;
|
|
100
108
|
default: null;
|
|
101
109
|
};
|
|
102
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "
|
|
110
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "clickInput" | "endValidate" | "startValidate" | "clickLeftIcon" | "clickRightIcon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "clickInput" | "endValidate" | "startValidate" | "clickLeftIcon" | "clickRightIcon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
103
111
|
leftIcon: StringConstructor;
|
|
104
112
|
titleIcon: StringConstructor;
|
|
105
113
|
title: (NumberConstructor | StringConstructor)[];
|
|
@@ -134,6 +142,14 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
|
134
142
|
type: import("vue").PropType<string>;
|
|
135
143
|
default: string;
|
|
136
144
|
};
|
|
145
|
+
placeholder: StringConstructor;
|
|
146
|
+
errorMessage: StringConstructor;
|
|
147
|
+
errorMessageAlign: import("vue").PropType<import("./types").FieldTextAlign>;
|
|
148
|
+
descriptionClass: import("vue").PropType<unknown>;
|
|
149
|
+
description: {
|
|
150
|
+
type: import("vue").PropType<string>;
|
|
151
|
+
default: string;
|
|
152
|
+
};
|
|
137
153
|
} & {
|
|
138
154
|
id: StringConstructor;
|
|
139
155
|
name: StringConstructor;
|
|
@@ -223,13 +239,13 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
|
223
239
|
clickable: boolean | null;
|
|
224
240
|
clearable: boolean;
|
|
225
241
|
clearIcon: string;
|
|
226
|
-
|
|
242
|
+
description: string;
|
|
227
243
|
modelValue: string | number;
|
|
228
244
|
clearTrigger: import("./types").FieldClearTrigger;
|
|
229
245
|
formatTrigger: import("./types").FieldFormatTrigger;
|
|
246
|
+
error: boolean;
|
|
230
247
|
readonly: boolean;
|
|
231
248
|
showWordLimit: boolean;
|
|
232
|
-
description: string;
|
|
233
249
|
colon: boolean;
|
|
234
250
|
}, {}>>;
|
|
235
251
|
export default Field;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { PropType, type ExtractPropTypes } from 'vue';
|
|
2
|
+
import { FloatingBubbleAxis, FloatingBubbleMagnetic, FloatingBubbleOffset } from './types';
|
|
3
|
+
export declare const floatingBubbleProps: {
|
|
4
|
+
gap: {
|
|
5
|
+
type: NumberConstructor;
|
|
6
|
+
default: number;
|
|
7
|
+
};
|
|
8
|
+
icon: StringConstructor;
|
|
9
|
+
axis: {
|
|
10
|
+
type: PropType<FloatingBubbleAxis>;
|
|
11
|
+
default: FloatingBubbleAxis;
|
|
12
|
+
};
|
|
13
|
+
magnetic: PropType<FloatingBubbleMagnetic>;
|
|
14
|
+
offset: {
|
|
15
|
+
type: PropType<FloatingBubbleOffset>;
|
|
16
|
+
default: () => {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
teleport: {
|
|
22
|
+
type: PropType<string | import("vue").RendererElement | null | undefined>;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type FloatingBubbleProps = ExtractPropTypes<typeof floatingBubbleProps>;
|
|
27
|
+
declare const _default: import("vue").DefineComponent<{
|
|
28
|
+
gap: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
icon: StringConstructor;
|
|
33
|
+
axis: {
|
|
34
|
+
type: PropType<FloatingBubbleAxis>;
|
|
35
|
+
default: FloatingBubbleAxis;
|
|
36
|
+
};
|
|
37
|
+
magnetic: PropType<FloatingBubbleMagnetic>;
|
|
38
|
+
offset: {
|
|
39
|
+
type: PropType<FloatingBubbleOffset>;
|
|
40
|
+
default: () => {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
teleport: {
|
|
46
|
+
type: PropType<string | import("vue").RendererElement | null | undefined>;
|
|
47
|
+
default: string;
|
|
48
|
+
};
|
|
49
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "update:offset" | "offsetChange")[], "click" | "update:offset" | "offsetChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
50
|
+
gap: {
|
|
51
|
+
type: NumberConstructor;
|
|
52
|
+
default: number;
|
|
53
|
+
};
|
|
54
|
+
icon: StringConstructor;
|
|
55
|
+
axis: {
|
|
56
|
+
type: PropType<FloatingBubbleAxis>;
|
|
57
|
+
default: FloatingBubbleAxis;
|
|
58
|
+
};
|
|
59
|
+
magnetic: PropType<FloatingBubbleMagnetic>;
|
|
60
|
+
offset: {
|
|
61
|
+
type: PropType<FloatingBubbleOffset>;
|
|
62
|
+
default: () => {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
teleport: {
|
|
68
|
+
type: PropType<string | import("vue").RendererElement | null | undefined>;
|
|
69
|
+
default: string;
|
|
70
|
+
};
|
|
71
|
+
}>> & {
|
|
72
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
73
|
+
"onUpdate:offset"?: ((...args: any[]) => any) | undefined;
|
|
74
|
+
onOffsetChange?: ((...args: any[]) => any) | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
offset: FloatingBubbleOffset;
|
|
77
|
+
teleport: string | import("vue").RendererElement | null | undefined;
|
|
78
|
+
gap: number;
|
|
79
|
+
axis: FloatingBubbleAxis;
|
|
80
|
+
}, {}>;
|
|
81
|
+
export default _default;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name2 in all)
|
|
9
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var stdin_exports = {};
|
|
29
|
+
__export(stdin_exports, {
|
|
30
|
+
default: () => stdin_default,
|
|
31
|
+
floatingBubbleProps: () => floatingBubbleProps
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
34
|
+
var import_vue = require("vue");
|
|
35
|
+
var import_vue2 = require("vue");
|
|
36
|
+
var import_utils = require("../utils");
|
|
37
|
+
var import_use = require("@zartui/use");
|
|
38
|
+
var import_use_touch = require("../composables/use-touch");
|
|
39
|
+
var import_icon = __toESM(require("../icon"));
|
|
40
|
+
const floatingBubbleProps = {
|
|
41
|
+
gap: (0, import_utils.makeNumberProp)(24),
|
|
42
|
+
icon: String,
|
|
43
|
+
axis: (0, import_utils.makeStringProp)("y"),
|
|
44
|
+
magnetic: String,
|
|
45
|
+
offset: {
|
|
46
|
+
type: Object,
|
|
47
|
+
default: () => ({
|
|
48
|
+
x: -1,
|
|
49
|
+
y: -1
|
|
50
|
+
})
|
|
51
|
+
},
|
|
52
|
+
teleport: {
|
|
53
|
+
type: [String, Object],
|
|
54
|
+
default: "body"
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const [name, bem] = (0, import_utils.createNamespace)("floating-bubble");
|
|
58
|
+
var stdin_default = (0, import_vue2.defineComponent)({
|
|
59
|
+
name,
|
|
60
|
+
inheritAttrs: false,
|
|
61
|
+
props: floatingBubbleProps,
|
|
62
|
+
emits: ["click", "update:offset", "offsetChange"],
|
|
63
|
+
setup(props, {
|
|
64
|
+
slots,
|
|
65
|
+
emit,
|
|
66
|
+
attrs
|
|
67
|
+
}) {
|
|
68
|
+
const rootRef = (0, import_vue2.ref)();
|
|
69
|
+
const state = (0, import_vue2.ref)({
|
|
70
|
+
x: 0,
|
|
71
|
+
y: 0,
|
|
72
|
+
width: 0,
|
|
73
|
+
height: 0
|
|
74
|
+
});
|
|
75
|
+
const boundary = (0, import_vue2.computed)(() => ({
|
|
76
|
+
top: props.gap,
|
|
77
|
+
right: import_utils.windowWidth.value - state.value.width - props.gap,
|
|
78
|
+
bottom: import_utils.windowHeight.value - state.value.height - props.gap,
|
|
79
|
+
left: props.gap
|
|
80
|
+
}));
|
|
81
|
+
const dragging = (0, import_vue2.ref)(false);
|
|
82
|
+
let initialized = false;
|
|
83
|
+
const rootStyle = (0, import_vue2.computed)(() => {
|
|
84
|
+
const style = {};
|
|
85
|
+
const x = (0, import_utils.addUnit)(state.value.x);
|
|
86
|
+
const y = (0, import_utils.addUnit)(state.value.y);
|
|
87
|
+
style.transform = `translate3d(${x}, ${y}, 0)`;
|
|
88
|
+
if (dragging.value || !initialized) {
|
|
89
|
+
style.transition = "none";
|
|
90
|
+
}
|
|
91
|
+
return style;
|
|
92
|
+
});
|
|
93
|
+
const updateState = () => {
|
|
94
|
+
if (!show.value)
|
|
95
|
+
return;
|
|
96
|
+
const {
|
|
97
|
+
width,
|
|
98
|
+
height
|
|
99
|
+
} = (0, import_use.useRect)(rootRef.value);
|
|
100
|
+
const {
|
|
101
|
+
offset
|
|
102
|
+
} = props;
|
|
103
|
+
state.value = {
|
|
104
|
+
x: offset.x > -1 ? offset.x : import_utils.windowWidth.value - width - props.gap,
|
|
105
|
+
y: offset.y > -1 ? offset.y : import_utils.windowHeight.value - height - props.gap,
|
|
106
|
+
width,
|
|
107
|
+
height
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
const touch = (0, import_use_touch.useTouch)();
|
|
111
|
+
let prevX = 0;
|
|
112
|
+
let prevY = 0;
|
|
113
|
+
const onTouchStart = (e) => {
|
|
114
|
+
touch.start(e);
|
|
115
|
+
dragging.value = true;
|
|
116
|
+
prevX = state.value.x;
|
|
117
|
+
prevY = state.value.y;
|
|
118
|
+
};
|
|
119
|
+
const onTouchMove = (e) => {
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
touch.move(e);
|
|
122
|
+
if (props.axis === "lock")
|
|
123
|
+
return;
|
|
124
|
+
if (!touch.isTap.value) {
|
|
125
|
+
if (props.axis === "x" || props.axis === "xy") {
|
|
126
|
+
let nextX = prevX + touch.deltaX.value;
|
|
127
|
+
if (nextX < boundary.value.left)
|
|
128
|
+
nextX = boundary.value.left;
|
|
129
|
+
if (nextX > boundary.value.right)
|
|
130
|
+
nextX = boundary.value.right;
|
|
131
|
+
state.value.x = nextX;
|
|
132
|
+
}
|
|
133
|
+
if (props.axis === "y" || props.axis === "xy") {
|
|
134
|
+
let nextY = prevY + touch.deltaY.value;
|
|
135
|
+
if (nextY < boundary.value.top)
|
|
136
|
+
nextY = boundary.value.top;
|
|
137
|
+
if (nextY > boundary.value.bottom)
|
|
138
|
+
nextY = boundary.value.bottom;
|
|
139
|
+
state.value.y = nextY;
|
|
140
|
+
}
|
|
141
|
+
const offset = (0, import_utils.pick)(state.value, ["x", "y"]);
|
|
142
|
+
emit("update:offset", offset);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
(0, import_use.useEventListener)("touchmove", onTouchMove, {
|
|
146
|
+
target: rootRef
|
|
147
|
+
});
|
|
148
|
+
const onTouchEnd = () => {
|
|
149
|
+
dragging.value = false;
|
|
150
|
+
(0, import_vue2.nextTick)(() => {
|
|
151
|
+
if (props.magnetic === "x") {
|
|
152
|
+
const nextX = (0, import_utils.closest)([boundary.value.left, boundary.value.right], state.value.x);
|
|
153
|
+
state.value.x = nextX;
|
|
154
|
+
}
|
|
155
|
+
if (props.magnetic === "y") {
|
|
156
|
+
const nextY = (0, import_utils.closest)([boundary.value.top, boundary.value.bottom], state.value.y);
|
|
157
|
+
state.value.y = nextY;
|
|
158
|
+
}
|
|
159
|
+
if (!touch.isTap.value) {
|
|
160
|
+
const offset = (0, import_utils.pick)(state.value, ["x", "y"]);
|
|
161
|
+
emit("update:offset", offset);
|
|
162
|
+
if (prevX !== offset.x || prevY !== offset.y) {
|
|
163
|
+
emit("offsetChange", offset);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
const onClick = (e) => {
|
|
169
|
+
if (touch.isTap.value)
|
|
170
|
+
emit("click", e);
|
|
171
|
+
else
|
|
172
|
+
e.stopPropagation();
|
|
173
|
+
};
|
|
174
|
+
(0, import_vue2.onMounted)(() => {
|
|
175
|
+
updateState();
|
|
176
|
+
(0, import_vue2.nextTick)(() => {
|
|
177
|
+
initialized = true;
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
(0, import_vue2.watch)([import_utils.windowWidth, import_utils.windowHeight, () => props.gap, () => props.offset], updateState);
|
|
181
|
+
const show = (0, import_vue2.ref)(true);
|
|
182
|
+
(0, import_vue2.onActivated)(() => {
|
|
183
|
+
show.value = true;
|
|
184
|
+
});
|
|
185
|
+
(0, import_vue2.onDeactivated)(() => {
|
|
186
|
+
if (props.teleport) {
|
|
187
|
+
show.value = false;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
return () => {
|
|
191
|
+
const Content = (0, import_vue.withDirectives)((0, import_vue.createVNode)("div", (0, import_vue.mergeProps)({
|
|
192
|
+
"class": bem(),
|
|
193
|
+
"ref": rootRef,
|
|
194
|
+
"onTouchstartPassive": onTouchStart,
|
|
195
|
+
"onTouchend": onTouchEnd,
|
|
196
|
+
"onTouchcancel": onTouchEnd,
|
|
197
|
+
"onClick": onClick,
|
|
198
|
+
"style": rootStyle.value
|
|
199
|
+
}, attrs), [slots.default ? slots.default() : (0, import_vue.createVNode)(import_icon.default, {
|
|
200
|
+
"name": props.icon,
|
|
201
|
+
"class": bem("icon")
|
|
202
|
+
}, null)]), [[import_vue.vShow, show.value]]);
|
|
203
|
+
return props.teleport ? (0, import_vue.createVNode)(import_vue2.Teleport, {
|
|
204
|
+
"to": props.teleport
|
|
205
|
+
}, {
|
|
206
|
+
default: () => [Content]
|
|
207
|
+
}) : Content;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--zt-floating-bubble-size: 56px;--zt-floating-bubble-initial-gap: 24px;--zt-floating-bubble-icon-size: 28px;--zt-floating-bubble-background: linear-gradient(136.5deg, #058ce6 0%, #00b4ff 100%);--zt-floating-bubble-color: var(--zt-background-popup);--zt-floating-bubble-z-index: 999;--zt-floating-bubble-border-radius: var(--zt-radius-max);--zt-floating-bubble-box-shadow: 0 4px 12px 0 rgba(5, 140, 230, .4), inset -2px -2px 1px 1px #058ce6, inset 2px 2px 2px 1px #c3ebff}.zt-floating-bubble{position:fixed;left:0;top:0;right:var(--zt-floating-bubble-initial-gap);bottom:var(--zt-floating-bubble-initial-gap);width:var(--zt-floating-bubble-size);height:var(--zt-floating-bubble-size);box-sizing:border-box;display:flex;justify-content:center;align-items:center;overflow:hidden;cursor:pointer;touch-action:none;background:var(--zt-floating-bubble-background);color:var(--zt-floating-bubble-color);border-radius:var(--zt-floating-bubble-border-radius);z-index:var(--zt-floating-bubble-z-index);transition:transform var(--zt-duration-base);-webkit-user-select:none;user-select:none;box-shadow:var(--zt-floating-bubble-box-shadow)}.zt-floating-bubble:active{opacity:.7}.zt-floating-bubble__icon{font-size:var(--zt-floating-bubble-icon-size)}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare const FloatingBubble: import("../utils").WithInstall<import("vue").DefineComponent<{
|
|
2
|
+
gap: {
|
|
3
|
+
type: NumberConstructor;
|
|
4
|
+
default: number;
|
|
5
|
+
};
|
|
6
|
+
icon: StringConstructor;
|
|
7
|
+
axis: {
|
|
8
|
+
type: import("vue").PropType<import("./types").FloatingBubbleAxis>;
|
|
9
|
+
default: import("./types").FloatingBubbleAxis;
|
|
10
|
+
};
|
|
11
|
+
magnetic: import("vue").PropType<import("./types").FloatingBubbleMagnetic>;
|
|
12
|
+
offset: {
|
|
13
|
+
type: import("vue").PropType<import("./types").FloatingBubbleOffset>;
|
|
14
|
+
default: () => {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
teleport: {
|
|
20
|
+
type: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "update:offset" | "offsetChange")[], "click" | "update:offset" | "offsetChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
|
+
gap: {
|
|
25
|
+
type: NumberConstructor;
|
|
26
|
+
default: number;
|
|
27
|
+
};
|
|
28
|
+
icon: StringConstructor;
|
|
29
|
+
axis: {
|
|
30
|
+
type: import("vue").PropType<import("./types").FloatingBubbleAxis>;
|
|
31
|
+
default: import("./types").FloatingBubbleAxis;
|
|
32
|
+
};
|
|
33
|
+
magnetic: import("vue").PropType<import("./types").FloatingBubbleMagnetic>;
|
|
34
|
+
offset: {
|
|
35
|
+
type: import("vue").PropType<import("./types").FloatingBubbleOffset>;
|
|
36
|
+
default: () => {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
teleport: {
|
|
42
|
+
type: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
|
|
43
|
+
default: string;
|
|
44
|
+
};
|
|
45
|
+
}>> & {
|
|
46
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
47
|
+
"onUpdate:offset"?: ((...args: any[]) => any) | undefined;
|
|
48
|
+
onOffsetChange?: ((...args: any[]) => any) | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
offset: import("./types").FloatingBubbleOffset;
|
|
51
|
+
teleport: string | import("vue").RendererElement | null | undefined;
|
|
52
|
+
gap: number;
|
|
53
|
+
axis: import("./types").FloatingBubbleAxis;
|
|
54
|
+
}, {}>>;
|
|
55
|
+
export default FloatingBubble;
|
|
56
|
+
export { floatingBubbleProps } from './FloatingBubble';
|
|
57
|
+
export type { FloatingBubbleProps } from './FloatingBubble';
|
|
58
|
+
export type { FloatingBubbleThemeVars, FloatingBubbleAxis, FloatingBubbleMagnetic, FloatingBubbleOffset, } from './types';
|
|
59
|
+
declare module 'vue' {
|
|
60
|
+
interface GlobalComponents {
|
|
61
|
+
ZtFloatingBubble: typeof FloatingBubble;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var stdin_exports = {};
|
|
29
|
+
__export(stdin_exports, {
|
|
30
|
+
FloatingBubble: () => FloatingBubble,
|
|
31
|
+
default: () => stdin_default,
|
|
32
|
+
floatingBubbleProps: () => import_FloatingBubble2.floatingBubbleProps
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
35
|
+
var import_utils = require("../utils");
|
|
36
|
+
var import_FloatingBubble = __toESM(require("./FloatingBubble"));
|
|
37
|
+
var import_FloatingBubble2 = require("./FloatingBubble");
|
|
38
|
+
const FloatingBubble = (0, import_utils.withInstall)(import_FloatingBubble.default);
|
|
39
|
+
var stdin_default = FloatingBubble;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|