vue-devui 1.0.0-rc.1 → 1.0.0-rc.12
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 +70 -121
- package/alert/index.es.js +46 -15
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8204 -296
- package/auto-complete/index.umd.js +29 -1
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +153 -146
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.es.js +36 -5
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5727 -111
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +63 -35
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8068 -255
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{accordion → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +213 -0
- package/collapse/index.umd.js +1 -0
- package/{anchor → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +59 -19
- package/countdown/index.umd.js +1 -1
- package/{anchor → date-picker-pro}/index.d.ts +0 -0
- package/date-picker-pro/index.es.js +10856 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/{breadcrumb → date-picker-pro}/package.json +1 -1
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.es.js +31 -4
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +210 -149
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +569 -159
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1048 -1187
- package/form/index.umd.js +15 -15
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +29 -5
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +101 -86
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +183 -23
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +53 -30
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8101 -144
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +274 -177
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +40 -25
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.es.js +74 -35
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/modal/index.es.js +375 -171
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +293 -40
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/OptionGroup.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/iconProps.js +1 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/overlay/index.es.js +104 -133
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +4 -2
- package/pagination/index.es.js +171 -141
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +294 -230
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +110 -56
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +7967 -146
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +77 -55
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +170 -27
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/ripple/index.es.js +43 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +3660 -1097
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +8998 -487
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +46 -24
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +144 -138
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +468 -340
- package/splitter/index.umd.js +16 -16
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +41 -34
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +26 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/{back-top → steps}/index.d.ts +0 -0
- package/steps/index.es.js +385 -0
- package/steps/index.umd.js +1 -0
- package/{gantt → steps}/package.json +1 -1
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +7802 -64
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +10315 -1147
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +345 -142
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +47 -23
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7921 -83
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/time-picker/index.es.js +8704 -559
- package/time-picker/index.umd.js +27 -1
- package/time-picker/style.css +1 -1
- package/{breadcrumb → time-select}/index.d.ts +0 -0
- package/{color-picker → time-select}/index.es.js +4116 -2914
- package/time-select/index.umd.js +27 -0
- package/{back-top → time-select}/package.json +1 -1
- package/time-select/style.css +1 -0
- package/timeline/index.es.js +177 -37
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +286 -221
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +5325 -1855
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +456 -133
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +14986 -16343
- package/vue-devui.umd.js +30 -20
- package/accordion/index.es.js +0 -723
- package/accordion/index.umd.js +0 -1
- package/accordion/package.json +0 -7
- package/accordion/style.css +0 -1
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.es.js +0 -130
- package/back-top/index.umd.js +0 -1
- package/back-top/style.css +0 -1
- package/breadcrumb/index.es.js +0 -128
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -314
- package/carousel/index.umd.js +0 -1
- package/carousel/package.json +0 -7
- package/carousel/style.css +0 -1
- package/cascader/index.d.ts +0 -7
- package/cascader/index.es.js +0 -5971
- package/cascader/index.umd.js +0 -27
- package/cascader/package.json +0 -7
- package/cascader/style.css +0 -1
- package/color-picker/index.d.ts +0 -7
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/comment/index.d.ts +0 -7
- package/comment/index.es.js +0 -86
- package/comment/index.umd.js +0 -1
- package/comment/package.json +0 -7
- package/comment/style.css +0 -1
- package/date-picker/index.d.ts +0 -7
- package/date-picker/index.es.js +0 -1154
- package/date-picker/index.umd.js +0 -1
- package/date-picker/package.json +0 -7
- package/date-picker/style.css +0 -1
- package/dragdrop/index.d.ts +0 -7
- package/dragdrop/index.es.js +0 -157
- package/dragdrop/index.umd.js +0 -1
- package/dragdrop/package.json +0 -7
- package/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -332
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/list/index.d.ts +0 -7
- package/list/index.es.js +0 -39
- package/list/index.umd.js +0 -1
- package/list/package.json +0 -7
- package/list/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Comment.js +0 -3
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/List.js +0 -3
- package/nuxt/components/ListItem.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/ReadTip.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/TagInput.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
- package/quadrant-diagram/index.d.ts +0 -7
- package/quadrant-diagram/index.es.js +0 -5728
- package/quadrant-diagram/index.umd.js +0 -27
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/read-tip/index.d.ts +0 -7
- package/read-tip/index.es.js +0 -261
- package/read-tip/index.umd.js +0 -1
- package/read-tip/package.json +0 -7
- package/read-tip/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -242
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.d.ts +0 -7
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/sticky/package.json +0 -7
- package/tag-input/index.d.ts +0 -7
- package/tag-input/index.es.js +0 -331
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7615
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -627
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/tag-input/index.es.js
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
import { createVNode, mergeProps, defineComponent, ref, computed, watch, nextTick } from "vue";
|
|
18
|
-
var removeBtnSvg = createVNode("svg", mergeProps({
|
|
19
|
-
"width": "12px",
|
|
20
|
-
"height": "12px",
|
|
21
|
-
"viewBox": "0 0 12 12",
|
|
22
|
-
"version": "1.1",
|
|
23
|
-
"xmlns": "http://www.w3.org/2000/svg"
|
|
24
|
-
}, {
|
|
25
|
-
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
26
|
-
}), [createVNode("g", {
|
|
27
|
-
"stroke": "none",
|
|
28
|
-
"stroke-width": "1",
|
|
29
|
-
"fill": "none",
|
|
30
|
-
"fill-rule": "evenodd"
|
|
31
|
-
}, [createVNode("path", {
|
|
32
|
-
"d": "M8.86785321,3.13214679 C9.02624037,3.29053395 9.02624037,3.54733027 8.86785321,3.70571743 L6.573,6 L8.86785321,8.29428257 C9.02624037,8.45266973 9.02624037,8.70946605 8.86785321,8.86785321 C8.70946605,9.02624037 8.45266973,9.02624037 8.29428257,8.86785321 L6,6.573 L3.70571743,8.86785321 C3.54733027,9.02624037 3.29053395,9.02624037 3.13214679,8.86785321 C2.97375963,8.70946605 2.97375963,8.45266973 3.13214679,8.29428257 L5.427,6 L3.13214679,3.70571743 C2.97375963,3.54733027 2.97375963,3.29053395 3.13214679,3.13214679 C3.29053395,2.97375963 3.54733027,2.97375963 3.70571743,3.13214679 L6,5.427 L8.29428257,3.13214679 C8.45266973,2.97375963 8.70946605,2.97375963 8.86785321,3.13214679 Z",
|
|
33
|
-
"fill-rule": "nonzero"
|
|
34
|
-
}, null)])]);
|
|
35
|
-
var tagInput = "";
|
|
36
|
-
const tagInputProps = {
|
|
37
|
-
tags: {
|
|
38
|
-
type: Array,
|
|
39
|
-
default: () => []
|
|
40
|
-
},
|
|
41
|
-
displayProperty: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: "name"
|
|
44
|
-
},
|
|
45
|
-
placeholder: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: ""
|
|
48
|
-
},
|
|
49
|
-
minLength: {
|
|
50
|
-
type: Number,
|
|
51
|
-
default: 3
|
|
52
|
-
},
|
|
53
|
-
maxLength: {
|
|
54
|
-
type: Number,
|
|
55
|
-
default: Number.MAX_SAFE_INTEGER
|
|
56
|
-
},
|
|
57
|
-
maxTags: {
|
|
58
|
-
type: Number,
|
|
59
|
-
default: Number.MAX_SAFE_INTEGER
|
|
60
|
-
},
|
|
61
|
-
maxTagsText: {
|
|
62
|
-
type: String,
|
|
63
|
-
default: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
|
|
64
|
-
},
|
|
65
|
-
spellcheck: {
|
|
66
|
-
type: Boolean,
|
|
67
|
-
default: true
|
|
68
|
-
},
|
|
69
|
-
suggestionList: {
|
|
70
|
-
type: Array,
|
|
71
|
-
default: () => []
|
|
72
|
-
},
|
|
73
|
-
disabled: {
|
|
74
|
-
type: Boolean,
|
|
75
|
-
default: false
|
|
76
|
-
},
|
|
77
|
-
isAddBySpace: {
|
|
78
|
-
type: Boolean,
|
|
79
|
-
default: true
|
|
80
|
-
},
|
|
81
|
-
disabledText: {
|
|
82
|
-
type: String,
|
|
83
|
-
default: ""
|
|
84
|
-
},
|
|
85
|
-
noData: {
|
|
86
|
-
type: String,
|
|
87
|
-
default: ""
|
|
88
|
-
},
|
|
89
|
-
caseSensitivity: {
|
|
90
|
-
type: Boolean,
|
|
91
|
-
default: false
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
const KEYS_MAP = {
|
|
95
|
-
tab: "Tab",
|
|
96
|
-
down: "ArrowDown",
|
|
97
|
-
up: "ArrowUp",
|
|
98
|
-
enter: "Enter",
|
|
99
|
-
space: " "
|
|
100
|
-
};
|
|
101
|
-
var TagInput = defineComponent({
|
|
102
|
-
name: "DTagInput",
|
|
103
|
-
props: tagInputProps,
|
|
104
|
-
emits: ["update:tags", "update:suggestionList", "valueChange"],
|
|
105
|
-
setup(props, ctx) {
|
|
106
|
-
const add = (arr, target) => {
|
|
107
|
-
const res = Object.assign({}, target);
|
|
108
|
-
delete res.__index;
|
|
109
|
-
return arr.concat(res);
|
|
110
|
-
};
|
|
111
|
-
const remove = (arr, targetIdx) => {
|
|
112
|
-
const newArr = arr.slice();
|
|
113
|
-
newArr.splice(targetIdx, 1);
|
|
114
|
-
return newArr;
|
|
115
|
-
};
|
|
116
|
-
const tagInputVal = ref("");
|
|
117
|
-
const onInput = ($event) => {
|
|
118
|
-
const v = $event.target.value || "";
|
|
119
|
-
tagInputVal.value = v.trim();
|
|
120
|
-
};
|
|
121
|
-
const mergedSuggestions = computed(() => {
|
|
122
|
-
let suggestions = props.suggestionList.map((item, index2) => {
|
|
123
|
-
return __spreadValues({
|
|
124
|
-
__index: index2
|
|
125
|
-
}, item);
|
|
126
|
-
});
|
|
127
|
-
if (tagInputVal.value === "") {
|
|
128
|
-
return suggestions;
|
|
129
|
-
}
|
|
130
|
-
return suggestions = props.caseSensitivity ? suggestions.filter((item) => item[props.displayProperty].indexOf(tagInputVal.value) !== -1) : suggestions.filter((item) => item[props.displayProperty].toLowerCase().indexOf(tagInputVal.value.toLowerCase()) !== -1);
|
|
131
|
-
});
|
|
132
|
-
const selectIndex = ref(0);
|
|
133
|
-
watch(mergedSuggestions, () => {
|
|
134
|
-
selectIndex.value = 0;
|
|
135
|
-
});
|
|
136
|
-
const onSelectIndexChange = (isUp = false) => {
|
|
137
|
-
if (isUp) {
|
|
138
|
-
selectIndex.value < mergedSuggestions.value.length - 1 ? selectIndex.value++ : selectIndex.value = 0;
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
selectIndex.value > 0 ? selectIndex.value-- : selectIndex.value = mergedSuggestions.value.length - 1;
|
|
142
|
-
};
|
|
143
|
-
const tagInputRef = ref(null);
|
|
144
|
-
const isInputBoxFocus = ref(false);
|
|
145
|
-
const onInputFocus = () => {
|
|
146
|
-
isInputBoxFocus.value = true;
|
|
147
|
-
};
|
|
148
|
-
const onInputBlur = () => {
|
|
149
|
-
isInputBoxFocus.value = false;
|
|
150
|
-
};
|
|
151
|
-
const handleEnter = () => {
|
|
152
|
-
let res = {
|
|
153
|
-
[props.displayProperty]: tagInputVal.value
|
|
154
|
-
};
|
|
155
|
-
if (tagInputVal.value === "" && mergedSuggestions.value.length === 0) {
|
|
156
|
-
return false;
|
|
157
|
-
}
|
|
158
|
-
if (props.tags.findIndex((item) => item[props.displayProperty] === tagInputVal.value) > -1) {
|
|
159
|
-
tagInputVal.value = "";
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
if (mergedSuggestions.value.length === 0 && (tagInputVal.value.length < props.minLength || tagInputVal.value.length > props.maxLength)) {
|
|
163
|
-
tagInputVal.value = "";
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
if (mergedSuggestions.value.length) {
|
|
167
|
-
const target = mergedSuggestions.value[selectIndex.value];
|
|
168
|
-
res = target;
|
|
169
|
-
ctx.emit("update:suggestionList", remove(props.suggestionList, target.__index));
|
|
170
|
-
}
|
|
171
|
-
const newTags = add(props.tags, res);
|
|
172
|
-
ctx.emit("valueChange", props.tags, newTags);
|
|
173
|
-
ctx.emit("update:tags", newTags);
|
|
174
|
-
mergedSuggestions.value.length === 0 && (tagInputVal.value = "");
|
|
175
|
-
};
|
|
176
|
-
const onInputKeydown = ($event) => {
|
|
177
|
-
switch ($event.key) {
|
|
178
|
-
case KEYS_MAP.tab:
|
|
179
|
-
case KEYS_MAP.enter:
|
|
180
|
-
case KEYS_MAP.space:
|
|
181
|
-
if (!props.isAddBySpace && KEYS_MAP.space) {
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
handleEnter();
|
|
185
|
-
break;
|
|
186
|
-
case KEYS_MAP.down:
|
|
187
|
-
onSelectIndexChange(true);
|
|
188
|
-
break;
|
|
189
|
-
case KEYS_MAP.up:
|
|
190
|
-
onSelectIndexChange();
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
const removeTag = ($event, tagIdx) => {
|
|
195
|
-
$event.preventDefault();
|
|
196
|
-
ctx.emit("update:suggestionList", add(props.suggestionList, props.tags[tagIdx]));
|
|
197
|
-
const newTags = remove(props.tags, tagIdx);
|
|
198
|
-
ctx.emit("valueChange", props.tags, newTags);
|
|
199
|
-
ctx.emit("update:tags", newTags);
|
|
200
|
-
nextTick(() => {
|
|
201
|
-
var _a;
|
|
202
|
-
(_a = tagInputRef.value) == null ? void 0 : _a.focus();
|
|
203
|
-
});
|
|
204
|
-
};
|
|
205
|
-
const onSuggestionItemClick = ($event, itemIndex) => {
|
|
206
|
-
$event.preventDefault();
|
|
207
|
-
const target = mergedSuggestions.value[itemIndex];
|
|
208
|
-
const newTags = add(props.tags, target);
|
|
209
|
-
const newSuggestions = remove(props.suggestionList, target.__index);
|
|
210
|
-
ctx.emit("valueChange", props.tags, newTags);
|
|
211
|
-
ctx.emit("update:tags", newTags);
|
|
212
|
-
ctx.emit("update:suggestionList", newSuggestions);
|
|
213
|
-
};
|
|
214
|
-
const isTagsLimit = computed(() => props.maxTags <= props.tags.length);
|
|
215
|
-
const isShowSuggestion = computed(() => {
|
|
216
|
-
return !props.disabled && !isTagsLimit.value && isInputBoxFocus.value;
|
|
217
|
-
});
|
|
218
|
-
return {
|
|
219
|
-
tagInputRef,
|
|
220
|
-
tagInputVal,
|
|
221
|
-
isInputBoxFocus,
|
|
222
|
-
onInput,
|
|
223
|
-
onInputFocus,
|
|
224
|
-
onInputBlur,
|
|
225
|
-
removeTag,
|
|
226
|
-
onSuggestionItemClick,
|
|
227
|
-
onInputKeydown,
|
|
228
|
-
isShowSuggestion,
|
|
229
|
-
mergedSuggestions,
|
|
230
|
-
selectIndex,
|
|
231
|
-
isTagsLimit
|
|
232
|
-
};
|
|
233
|
-
},
|
|
234
|
-
render() {
|
|
235
|
-
const {
|
|
236
|
-
tagInputVal,
|
|
237
|
-
isInputBoxFocus,
|
|
238
|
-
disabled,
|
|
239
|
-
disabledText,
|
|
240
|
-
isTagsLimit,
|
|
241
|
-
maxTagsText,
|
|
242
|
-
displayProperty,
|
|
243
|
-
tags,
|
|
244
|
-
onInputKeydown,
|
|
245
|
-
onInputFocus,
|
|
246
|
-
onInputBlur,
|
|
247
|
-
onInput,
|
|
248
|
-
onSuggestionItemClick,
|
|
249
|
-
removeTag,
|
|
250
|
-
placeholder,
|
|
251
|
-
spellcheck,
|
|
252
|
-
isShowSuggestion,
|
|
253
|
-
noData,
|
|
254
|
-
mergedSuggestions,
|
|
255
|
-
selectIndex,
|
|
256
|
-
maxTags
|
|
257
|
-
} = this;
|
|
258
|
-
const inputBoxCls = {
|
|
259
|
-
"devui-tags": true,
|
|
260
|
-
"devui-form-control": true,
|
|
261
|
-
"devui-dropdown-origin": true,
|
|
262
|
-
"devui-dropdown-origin-open": isInputBoxFocus,
|
|
263
|
-
"devui-disabled": disabled
|
|
264
|
-
};
|
|
265
|
-
const tagInputCls = {
|
|
266
|
-
input: true,
|
|
267
|
-
"devui-input": true,
|
|
268
|
-
"invalid-tag": false
|
|
269
|
-
};
|
|
270
|
-
const tagInputStyle = [`display:${disabled ? "none" : "block"};`];
|
|
271
|
-
const noDataTpl = createVNode("li", {
|
|
272
|
-
"class": "devui-suggestion-item devui-disabled"
|
|
273
|
-
}, [noData]);
|
|
274
|
-
return createVNode("div", {
|
|
275
|
-
"class": "devui-tags-host",
|
|
276
|
-
"tabindex": "-1"
|
|
277
|
-
}, [createVNode("div", {
|
|
278
|
-
"class": inputBoxCls,
|
|
279
|
-
"style": ["box-shadow: none;"]
|
|
280
|
-
}, [createVNode("ul", {
|
|
281
|
-
"class": "devui-tag-list",
|
|
282
|
-
"title": disabled ? disabledText : ""
|
|
283
|
-
}, [tags.map((tag, tagIdx) => {
|
|
284
|
-
return createVNode("li", {
|
|
285
|
-
"class": "devui-tag-item"
|
|
286
|
-
}, [createVNode("span", null, [tag[displayProperty]]), !disabled && createVNode("a", {
|
|
287
|
-
"class": "remove-button",
|
|
288
|
-
"onMousedown": ($event) => removeTag($event, tagIdx)
|
|
289
|
-
}, [removeBtnSvg])]);
|
|
290
|
-
})]), createVNode("input", {
|
|
291
|
-
"type": "text",
|
|
292
|
-
"ref": "tagInputRef",
|
|
293
|
-
"value": tagInputVal,
|
|
294
|
-
"class": tagInputCls,
|
|
295
|
-
"style": tagInputStyle,
|
|
296
|
-
"onKeydown": onInputKeydown,
|
|
297
|
-
"onFocus": onInputFocus,
|
|
298
|
-
"onBlur": onInputBlur,
|
|
299
|
-
"onInput": ($event) => onInput($event),
|
|
300
|
-
"placeholder": isTagsLimit ? `${maxTagsText} ${maxTags}` : placeholder,
|
|
301
|
-
"spellcheck": spellcheck,
|
|
302
|
-
"disabled": isTagsLimit
|
|
303
|
-
}, null)]), !isShowSuggestion ? "" : createVNode("div", {
|
|
304
|
-
"class": "devui-tags-autocomplete devui-dropdown-menu"
|
|
305
|
-
}, [createVNode("ul", {
|
|
306
|
-
"class": "devui-suggestion-list"
|
|
307
|
-
}, [mergedSuggestions.length === 0 ? noDataTpl : mergedSuggestions.map((item, index2) => {
|
|
308
|
-
return createVNode("li", {
|
|
309
|
-
"class": {
|
|
310
|
-
"devui-suggestion-item": true,
|
|
311
|
-
selected: index2 === selectIndex
|
|
312
|
-
},
|
|
313
|
-
"onMousedown": ($event) => {
|
|
314
|
-
onSuggestionItemClick($event, index2);
|
|
315
|
-
}
|
|
316
|
-
}, [item[displayProperty]]);
|
|
317
|
-
})])])]);
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
TagInput.install = function(app) {
|
|
321
|
-
app.component(TagInput.name, TagInput);
|
|
322
|
-
};
|
|
323
|
-
var index = {
|
|
324
|
-
title: "TagInput \u6807\u7B7E\u8F93\u5165\u6846",
|
|
325
|
-
category: "\u6570\u636E\u5F55\u5165",
|
|
326
|
-
status: "100%",
|
|
327
|
-
install(app) {
|
|
328
|
-
app.use(TagInput);
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
export { TagInput, index as default };
|
package/tag-input/index.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var K=Object.defineProperty;var A=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var E=(u,e,o)=>e in u?K(u,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):u[e]=o,P=(u,e)=>{for(var o in e||(e={}))O.call(e,o)&&E(u,o,e[o]);if(A)for(var o of A(e))R.call(e,o)&&E(u,o,e[o]);return u};(function(u,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(u=typeof globalThis!="undefined"?globalThis:u||self,e(u.index={},u.Vue))})(this,function(u,e){"use strict";var o=e.createVNode("svg",e.mergeProps({width:"12px",height:"12px",viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},{"xmlns:xlink":"http://www.w3.org/1999/xlink"}),[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{d:"M8.86785321,3.13214679 C9.02624037,3.29053395 9.02624037,3.54733027 8.86785321,3.70571743 L6.573,6 L8.86785321,8.29428257 C9.02624037,8.45266973 9.02624037,8.70946605 8.86785321,8.86785321 C8.70946605,9.02624037 8.45266973,9.02624037 8.29428257,8.86785321 L6,6.573 L3.70571743,8.86785321 C3.54733027,9.02624037 3.29053395,9.02624037 3.13214679,8.86785321 C2.97375963,8.70946605 2.97375963,8.45266973 3.13214679,8.29428257 L5.427,6 L3.13214679,3.70571743 C2.97375963,3.54733027 2.97375963,3.29053395 3.13214679,3.13214679 C3.29053395,2.97375963 3.54733027,2.97375963 3.70571743,3.13214679 L6,5.427 L8.29428257,3.13214679 C8.45266973,2.97375963 8.70946605,2.97375963 8.86785321,3.13214679 Z","fill-rule":"nonzero"},null)])]),j="";const F={tags:{type:Array,default:()=>[]},displayProperty:{type:String,default:"name"},placeholder:{type:String,default:""},minLength:{type:Number,default:3},maxLength:{type:Number,default:Number.MAX_SAFE_INTEGER},maxTags:{type:Number,default:Number.MAX_SAFE_INTEGER},maxTagsText:{type:String,default:"\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"},spellcheck:{type:Boolean,default:!0},suggestionList:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},isAddBySpace:{type:Boolean,default:!0},disabledText:{type:String,default:""},noData:{type:String,default:""},caseSensitivity:{type:Boolean,default:!1}},p={tab:"Tab",down:"ArrowDown",up:"ArrowUp",enter:"Enter",space:" "};var m=e.defineComponent({name:"DTagInput",props:F,emits:["update:tags","update:suggestionList","valueChange"],setup(t,d){const g=(n,a)=>{const s=Object.assign({},a);return delete s.__index,n.concat(s)},v=(n,a)=>{const s=n.slice();return s.splice(a,1),s},l=e.ref(""),b=n=>{const a=n.target.value||"";l.value=a.trim()},i=e.computed(()=>{let n=t.suggestionList.map((a,s)=>P({__index:s},a));return l.value===""?n:n=t.caseSensitivity?n.filter(a=>a[t.displayProperty].indexOf(l.value)!==-1):n.filter(a=>a[t.displayProperty].toLowerCase().indexOf(l.value.toLowerCase())!==-1)}),r=e.ref(0);e.watch(i,()=>{r.value=0});const h=(n=!1)=>{if(n){r.value<i.value.length-1?r.value++:r.value=0;return}r.value>0?r.value--:r.value=i.value.length-1},w=e.ref(null),f=e.ref(!1),S=()=>{f.value=!0},L=()=>{f.value=!1},N=()=>{let n={[t.displayProperty]:l.value};if(l.value===""&&i.value.length===0)return!1;if(t.tags.findIndex(s=>s[t.displayProperty]===l.value)>-1||i.value.length===0&&(l.value.length<t.minLength||l.value.length>t.maxLength))return l.value="",!1;if(i.value.length){const s=i.value[r.value];n=s,d.emit("update:suggestionList",v(t.suggestionList,s.__index))}const a=g(t.tags,n);d.emit("valueChange",t.tags,a),d.emit("update:tags",a),i.value.length===0&&(l.value="")},C=n=>{switch(n.key){case p.tab:case p.enter:case p.space:if(!t.isAddBySpace&&p.space)return;N();break;case p.down:h(!0);break;case p.up:h();break}},V=(n,a)=>{n.preventDefault(),d.emit("update:suggestionList",g(t.suggestionList,t.tags[a]));const s=v(t.tags,a);d.emit("valueChange",t.tags,s),d.emit("update:tags",s),e.nextTick(()=>{var c;(c=w.value)==null||c.focus()})},k=(n,a)=>{n.preventDefault();const s=i.value[a],c=g(t.tags,s),B=v(t.suggestionList,s.__index);d.emit("valueChange",t.tags,c),d.emit("update:tags",c),d.emit("update:suggestionList",B)},I=e.computed(()=>t.maxTags<=t.tags.length),T=e.computed(()=>!t.disabled&&!I.value&&f.value);return{tagInputRef:w,tagInputVal:l,isInputBoxFocus:f,onInput:b,onInputFocus:S,onInputBlur:L,removeTag:V,onSuggestionItemClick:k,onInputKeydown:C,isShowSuggestion:T,mergedSuggestions:i,selectIndex:r,isTagsLimit:I}},render(){const{tagInputVal:t,isInputBoxFocus:d,disabled:g,disabledText:v,isTagsLimit:l,maxTagsText:b,displayProperty:i,tags:r,onInputKeydown:h,onInputFocus:w,onInputBlur:f,onInput:S,onSuggestionItemClick:L,removeTag:N,placeholder:C,spellcheck:V,isShowSuggestion:k,noData:I,mergedSuggestions:T,selectIndex:n,maxTags:a}=this,s={"devui-tags":!0,"devui-form-control":!0,"devui-dropdown-origin":!0,"devui-dropdown-origin-open":d,"devui-disabled":g},c={input:!0,"devui-input":!0,"invalid-tag":!1},B=[`display:${g?"none":"block"};`],D=e.createVNode("li",{class:"devui-suggestion-item devui-disabled"},[I]);return e.createVNode("div",{class:"devui-tags-host",tabindex:"-1"},[e.createVNode("div",{class:s,style:["box-shadow: none;"]},[e.createVNode("ul",{class:"devui-tag-list",title:g?v:""},[r.map((y,x)=>e.createVNode("li",{class:"devui-tag-item"},[e.createVNode("span",null,[y[i]]),!g&&e.createVNode("a",{class:"remove-button",onMousedown:_=>N(_,x)},[o])]))]),e.createVNode("input",{type:"text",ref:"tagInputRef",value:t,class:c,style:B,onKeydown:h,onFocus:w,onBlur:f,onInput:y=>S(y),placeholder:l?`${b} ${a}`:C,spellcheck:V,disabled:l},null)]),k?e.createVNode("div",{class:"devui-tags-autocomplete devui-dropdown-menu"},[e.createVNode("ul",{class:"devui-suggestion-list"},[T.length===0?D:T.map((y,x)=>e.createVNode("li",{class:{"devui-suggestion-item":!0,selected:x===n},onMousedown:_=>{L(_,x)}},[y[i]]))])]):""])}});m.install=function(t){t.component(m.name,m)};var M={title:"TagInput \u6807\u7B7E\u8F93\u5165\u6846",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(t){t.use(m)}};u.TagInput=m,u.default=M,Object.defineProperty(u,"__esModule",{value:!0}),u[Symbol.toStringTag]="Module"});
|
package/tag-input/package.json
DELETED
package/tag-input/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:host{display:block;outline:none}.devui-tags-host{position:relative;height:100%;outline:none}.devui-tags-host:active{outline:0}.devui-form-control.devui-tags{-moz-appearance:textfield;-webkit-appearance:textfield;padding:2px 4px;overflow:hidden;word-wrap:break-word;cursor:text;background-color:var(--devui-base-bg, #ffffff);border:1px solid var(--devui-line, #adb0b8);border-radius:var(--devui-border-radius, 2px);height:100%;transition:border-color .3s cubic-bezier(.645,.045,.355,1)}.devui-form-control.devui-tags:hover{border-color:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-form-control.devui-tags.focused{outline:0}.devui-form-control.devui-tags.devui-dropdown-origin:focus-within{border-color:var(--devui-brand, #5e7ce0)}.devui-form-control.devui-tags .devui-tag-list{margin:0;padding:0;list-style-type:none}.devui-form-control.devui-tags .devui-tag-item{margin:1px;padding:0 10px;display:inline-block;min-height:18px;line-height:18px;border-radius:var(--devui-border-radius, 2px);color:var(--devui-text, #252b3a);background-color:var(--devui-label-bg, #eef0f5);position:relative;border:1px solid var(--devui-label-bg, #eef0f5)}.devui-form-control.devui-tags .devui-tag-item span{line-height:1.5;margin-right:25px}.devui-form-control.devui-tags .devui-tag-item .remove-button{margin:0 0 0 12px;padding:0;border:none;vertical-align:top;font-size:var(--devui-font-size-page-title, 16px);border-radius:50%;background-color:var(--devui-line, #adb0b8);width:12px;height:12px;display:inline-block;line-height:12px;text-align:center;transform:translateY(-50%);position:absolute;top:50%;right:10px}.devui-form-control.devui-tags .devui-tag-item .remove-button svg path{fill:var(--devui-light-text, #ffffff)}.devui-form-control.devui-tags .devui-tag-item .remove-button:hover{text-decoration:none}.devui-form-control.devui-tags:not(.devui-disabled) .devui-tag-item{cursor:pointer}.devui-form-control.devui-tags:not(.devui-disabled) .devui-tag-item span:hover{color:var(--devui-list-item-hover-text, #526ecc)}.devui-form-control.devui-tags:not(.devui-disabled) .devui-tag-item .remove-button:hover{background-color:var(--devui-list-item-hover-text, #526ecc)}.devui-form-control.devui-tags.devui-disabled{border-color:var(--devui-disabled-line, #dfe1e6);background-color:var(--devui-disabled-bg, #f5f5f6);cursor:not-allowed}.devui-form-control.devui-tags.devui-disabled .devui-tag-item{color:var(--devui-disabled-text, #adb0b8);background-color:var(--devui-disabled-bg, #f5f5f6);border-color:var(--devui-disabled-line, #dfe1e6)}.devui-form-control.devui-tags.devui-disabled .devui-tag-item span{margin-right:0}.devui-form-control.devui-tags.devui-disabled .devui-tag-item .remove-button{background-color:var(--devui-disabled-line, #dfe1e6)}.devui-form-control.devui-tags.devui-disabled .devui-tag-item .remove-button svg path{fill:var(--devui-light-text, #ffffff)}.devui-form-control.devui-tags.devui-disabled .devui-tag-list{min-height:22px}.devui-form-control.devui-tags input.devui-input{border:0;outline:0;float:left;width:100%;height:22px;font-size:var(--devui-font-size, 12px);padding-left:5px}.devui-form-control.devui-tags input.devui-input::-ms-clear{display:none}.devui-tags-autocomplete{position:absolute;padding-bottom:5px;z-index:var(--devui-z-index-dropdown, 1052);width:100%;background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-connected-overlay, 0 2px 8px 0) var(--devui-shadow, rgba(0, 0, 0, .2))}.devui-tags-autocomplete.devui-dropdown-menu{display:block;margin:4px 0}.devui-tags-autocomplete .devui-suggestion-list{margin:0;padding:0;list-style-type:none;max-height:280px;overflow-y:auto;position:relative}.devui-tags-autocomplete .devui-suggestion-list .devui-suggestion-item{padding:5px 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--devui-font-size, 12px);line-height:20px}.devui-tags-autocomplete .devui-suggestion-list .devui-suggestion-item:not(.devui-disabled){cursor:pointer;color:var(--devui-text, #252b3a)}.devui-tags-autocomplete .devui-suggestion-list .devui-suggestion-item:not(.devui-disabled):hover{background-color:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-tags-autocomplete .devui-suggestion-list .devui-suggestion-item:not(.devui-disabled).selected{color:var(--devui-brand, #5e7ce0);background-color:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-tags-autocomplete .devui-suggestion-list .devui-suggestion-item{transition:color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1)),background-color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1))}
|