vue-devui 1.0.0-rc.4 → 1.0.0-rc.7

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.
Files changed (151) hide show
  1. package/README.md +21 -7
  2. package/auto-complete/index.es.js +26 -4
  3. package/auto-complete/index.umd.js +3 -3
  4. package/auto-complete/style.css +1 -1
  5. package/badge/index.es.js +2 -1
  6. package/badge/index.umd.js +1 -1
  7. package/button/index.es.js +4 -3
  8. package/button/index.umd.js +1 -1
  9. package/button/style.css +1 -1
  10. package/card/index.es.js +35 -29
  11. package/card/index.umd.js +1 -1
  12. package/card/style.css +1 -1
  13. package/checkbox/index.es.js +1 -1
  14. package/checkbox/index.umd.js +1 -1
  15. package/{comment → date-picker}/index.d.ts +0 -0
  16. package/date-picker/index.es.js +1145 -0
  17. package/date-picker/index.umd.js +1 -0
  18. package/date-picker/package.json +7 -0
  19. package/date-picker/style.css +1 -0
  20. package/{read-tip → drawer}/index.d.ts +0 -0
  21. package/drawer/index.es.js +236 -0
  22. package/drawer/index.umd.js +1 -0
  23. package/{comment → drawer}/package.json +1 -1
  24. package/drawer/style.css +1 -0
  25. package/{tag-input → dropdown}/index.d.ts +0 -0
  26. package/dropdown/index.es.js +718 -0
  27. package/dropdown/index.umd.js +1 -0
  28. package/{read-tip → dropdown}/package.json +1 -1
  29. package/dropdown/style.css +1 -0
  30. package/editable-select/index.es.js +14 -14
  31. package/editable-select/index.umd.js +1 -1
  32. package/editable-select/style.css +1 -1
  33. package/form/index.d.ts +7 -0
  34. package/form/index.es.js +7511 -0
  35. package/form/index.umd.js +27 -0
  36. package/{tag-input → form}/package.json +1 -1
  37. package/form/style.css +1 -0
  38. package/fullscreen/index.es.js +1 -1
  39. package/fullscreen/index.umd.js +1 -1
  40. package/image-preview/style.css +1 -1
  41. package/input/index.es.js +13 -19
  42. package/input/index.umd.js +1 -1
  43. package/input/style.css +1 -1
  44. package/input-number/index.d.ts +7 -0
  45. package/input-number/index.es.js +251 -0
  46. package/input-number/index.umd.js +1 -0
  47. package/input-number/package.json +7 -0
  48. package/input-number/style.css +1 -0
  49. package/loading/style.css +1 -1
  50. package/modal/index.es.js +15 -3
  51. package/modal/index.umd.js +1 -1
  52. package/modal/style.css +1 -1
  53. package/notification/style.css +1 -1
  54. package/nuxt/components/CheckboxGroup.js +3 -0
  55. package/nuxt/components/Column.js +3 -0
  56. package/nuxt/components/DatePicker.js +3 -0
  57. package/nuxt/components/Drawer.js +3 -0
  58. package/nuxt/components/DrawerService.js +3 -0
  59. package/nuxt/components/Dropdown.js +3 -0
  60. package/nuxt/components/DropdownMenu.js +3 -0
  61. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  62. package/nuxt/components/FORM_TOKEN.js +3 -0
  63. package/nuxt/components/Form.js +3 -0
  64. package/nuxt/components/FormControl.js +3 -0
  65. package/nuxt/components/FormItem.js +3 -0
  66. package/nuxt/components/FormLabel.js +3 -0
  67. package/nuxt/components/FormOperation.js +3 -0
  68. package/nuxt/components/InputNumber.js +3 -0
  69. package/nuxt/components/Select.js +3 -0
  70. package/nuxt/components/StickSlider.js +3 -0
  71. package/nuxt/components/Tab.js +3 -0
  72. package/nuxt/components/Table.js +3 -0
  73. package/nuxt/components/Tabs.js +3 -0
  74. package/nuxt/components/Tooltip.js +3 -0
  75. package/nuxt/components/Tree.js +3 -0
  76. package/nuxt/components/dropdownMenuProps.js +3 -0
  77. package/nuxt/components/formControlProps.js +3 -0
  78. package/nuxt/components/formItemProps.js +3 -0
  79. package/nuxt/components/formProps.js +3 -0
  80. package/nuxt/components/tabsProps.js +3 -0
  81. package/nuxt/components/tooltipProps.js +3 -0
  82. package/nuxt/components/treeProps.js +3 -0
  83. package/overlay/index.es.js +15 -3
  84. package/overlay/index.umd.js +1 -1
  85. package/overlay/style.css +1 -1
  86. package/package.json +2 -2
  87. package/pagination/index.es.js +80 -96
  88. package/pagination/index.umd.js +1 -1
  89. package/pagination/style.css +1 -1
  90. package/popover/index.es.js +15 -3
  91. package/popover/index.umd.js +9 -9
  92. package/popover/style.css +1 -1
  93. package/progress/index.es.js +48 -14
  94. package/progress/index.umd.js +3 -3
  95. package/progress/style.css +1 -1
  96. package/rate/index.es.js +29 -36
  97. package/rate/index.umd.js +1 -1
  98. package/rate/style.css +1 -1
  99. package/search/index.es.js +15 -19
  100. package/search/index.umd.js +12 -12
  101. package/search/style.css +1 -1
  102. package/select/index.d.ts +7 -0
  103. package/select/index.es.js +696 -0
  104. package/select/index.umd.js +1 -0
  105. package/select/package.json +7 -0
  106. package/select/style.css +1 -0
  107. package/slider/index.es.js +18 -6
  108. package/slider/index.umd.js +1 -1
  109. package/splitter/index.es.js +15 -3
  110. package/splitter/index.umd.js +11 -11
  111. package/splitter/style.css +1 -1
  112. package/style.css +1 -1
  113. package/table/index.d.ts +7 -0
  114. package/table/index.es.js +2662 -0
  115. package/table/index.umd.js +1 -0
  116. package/table/package.json +7 -0
  117. package/table/style.css +1 -0
  118. package/tabs/index.d.ts +7 -0
  119. package/tabs/index.es.js +194 -0
  120. package/tabs/index.umd.js +1 -0
  121. package/tabs/package.json +7 -0
  122. package/tabs/style.css +1 -0
  123. package/textarea/style.css +1 -1
  124. package/tooltip/index.d.ts +7 -0
  125. package/tooltip/index.es.js +5847 -0
  126. package/tooltip/index.umd.js +27 -0
  127. package/tooltip/package.json +7 -0
  128. package/tooltip/style.css +1 -0
  129. package/tree/index.d.ts +7 -0
  130. package/tree/index.es.js +1021 -0
  131. package/tree/index.umd.js +1 -0
  132. package/tree/package.json +7 -0
  133. package/tree/style.css +1 -0
  134. package/upload/style.css +1 -1
  135. package/vue-devui.es.js +11482 -6434
  136. package/vue-devui.umd.js +24 -24
  137. package/comment/index.es.js +0 -84
  138. package/comment/index.umd.js +0 -1
  139. package/comment/style.css +0 -1
  140. package/nuxt/components/Comment.js +0 -3
  141. package/nuxt/components/ReadTip.js +0 -3
  142. package/nuxt/components/TagInput.js +0 -3
  143. package/nuxt/components/commentProps.js +0 -3
  144. package/nuxt/components/readTipProps.js +0 -3
  145. package/nuxt/components/tagInputProps.js +0 -3
  146. package/read-tip/index.es.js +0 -261
  147. package/read-tip/index.umd.js +0 -1
  148. package/read-tip/style.css +0 -1
  149. package/tag-input/index.es.js +0 -328
  150. package/tag-input/index.umd.js +0 -1
  151. package/tag-input/style.css +0 -1
@@ -1,84 +0,0 @@
1
- import { defineComponent, createVNode } from "vue";
2
- const commentProps = {
3
- actions: {
4
- type: Object,
5
- default: null
6
- },
7
- author: {
8
- type: Object,
9
- default: null
10
- },
11
- avatar: {
12
- type: Object,
13
- default: null
14
- },
15
- content: {
16
- type: Object,
17
- default: null
18
- },
19
- datetime: {
20
- type: Object,
21
- default: null
22
- }
23
- };
24
- var comment = "";
25
- var Comment = defineComponent({
26
- name: "DComment",
27
- props: commentProps,
28
- emits: [],
29
- slots: ["actions", "author", "avatar", "content", "datetime"],
30
- setup(props, {
31
- slots
32
- }) {
33
- return () => {
34
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
35
- const getAction = (actions2) => {
36
- if (!actions2 || !actions2.length) {
37
- return null;
38
- }
39
- const actionList = actions2.map((action, index2) => createVNode("li", {
40
- "key": `devui-comment-action-${index2}`,
41
- "class": `devui-comment-action-${index2}`
42
- }, [action]));
43
- return actionList;
44
- };
45
- const actions = (_b = props.actions) != null ? _b : (_a = slots.actions) == null ? void 0 : _a.call(slots);
46
- const author = (_d = props.author) != null ? _d : (_c = slots.author) == null ? void 0 : _c.call(slots);
47
- const avatar = (_f = props.avatar) != null ? _f : (_e = slots.avatar) == null ? void 0 : _e.call(slots);
48
- const content = (_h = props.content) != null ? _h : (_g = slots.content) == null ? void 0 : _g.call(slots);
49
- const datetime = (_j = props.datetime) != null ? _j : (_i = slots.datetime) == null ? void 0 : _i.call(slots);
50
- const avatarDom = createVNode("div", {
51
- "class": `devui-comment-avatar`
52
- }, [typeof avatar === "string" ? createVNode("img", {
53
- "src": avatar,
54
- "alt": "comment-avatar"
55
- }, null) : avatar]);
56
- const actionsList = Array.isArray(actions) ? actions : [actions];
57
- const actionDom = actions ? createVNode("ul", {
58
- "class": `devui-comment-actions`
59
- }, [getAction(actionsList)]) : null;
60
- return createVNode("div", {
61
- "class": "devui-comment"
62
- }, [avatarDom, createVNode("div", {
63
- "class": "devui-comment-right"
64
- }, [createVNode("div", {
65
- "class": "devui-comment-head"
66
- }, [createVNode("div", {
67
- "class": "devui-comment-author"
68
- }, [author]), createVNode("div", {
69
- "class": "devui-comment-datetime"
70
- }, [datetime])]), createVNode("div", {
71
- "class": "devui-comment-content"
72
- }, [content]), actionDom])]);
73
- };
74
- }
75
- });
76
- var index = {
77
- title: "Comment \u8BC4\u8BBA",
78
- category: "\u6570\u636E\u5C55\u793A",
79
- status: "100%",
80
- install(app) {
81
- app.component(Comment.name, Comment);
82
- }
83
- };
84
- export { Comment, commentProps, index as default };
@@ -1 +0,0 @@
1
- (function(n,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis!="undefined"?globalThis:n||self,e(n.index={},n.Vue))})(this,function(n,e){"use strict";const m={actions:{type:Object,default:null},author:{type:Object,default:null},avatar:{type:Object,default:null},content:{type:Object,default:null},datetime:{type:Object,default:null}};var P="",i=e.defineComponent({name:"DComment",props:m,emits:[],slots:["actions","author","avatar","content","datetime"],setup(a,{slots:t}){return()=>{var u,r,f,v,l,y,h,V,p,N;const j=d=>!d||!d.length?null:d.map((L,b)=>e.createVNode("li",{key:`devui-comment-action-${b}`,class:`devui-comment-action-${b}`},[L])),c=(r=a.actions)!=null?r:(u=t.actions)==null?void 0:u.call(t),C=(v=a.author)!=null?v:(f=t.author)==null?void 0:f.call(t),o=(y=a.avatar)!=null?y:(l=t.avatar)==null?void 0:l.call(t),O=(V=a.content)!=null?V:(h=t.content)==null?void 0:h.call(t),A=(N=a.datetime)!=null?N:(p=t.datetime)==null?void 0:p.call(t),s=e.createVNode("div",{class:"devui-comment-avatar"},[typeof o=="string"?e.createVNode("img",{src:o,alt:"comment-avatar"},null):o]),B=Array.isArray(c)?c:[c],D=c?e.createVNode("ul",{class:"devui-comment-actions"},[j(B)]):null;return e.createVNode("div",{class:"devui-comment"},[s,e.createVNode("div",{class:"devui-comment-right"},[e.createVNode("div",{class:"devui-comment-head"},[e.createVNode("div",{class:"devui-comment-author"},[C]),e.createVNode("div",{class:"devui-comment-datetime"},[A])]),e.createVNode("div",{class:"devui-comment-content"},[O]),D])])}}}),g={title:"Comment \u8BC4\u8BBA",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(a){a.component(i.name,i)}};n.Comment=i,n.commentProps=m,n.default=g,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
package/comment/style.css DELETED
@@ -1 +0,0 @@
1
- .devui-comment{display:flex;align-items:flex-start}.devui-comment-avatar{margin:0 16px 0 0}.devui-comment-head{display:flex;align-items:center}.devui-comment-author{padding:0 8px 0 0;font-size:var(--devui-font-size, 12px);color:var(--devui-text-weak, #575d6c)}.devui-comment-datetime{font-size:var(--devui-font-size, 12px);color:var(--devui-aide-text, #8a8e99)}.devui-comment-content{font-size:var(--devui-text, #252b3a)}.devui-comment-actions{padding:0;list-style-type:none;margin:12px 0 0}
@@ -1,3 +0,0 @@
1
- import '../../comment/style.css'
2
-
3
- export { Comment as default } from '../../comment/index.es.js'
@@ -1,3 +0,0 @@
1
- import '../../read-tip/style.css'
2
-
3
- export { ReadTip as default } from '../../read-tip/index.es.js'
@@ -1,3 +0,0 @@
1
- import '../../tag-input/style.css'
2
-
3
- export { TagInput as default } from '../../tag-input/index.es.js'
@@ -1,3 +0,0 @@
1
- import '../../comment/style.css'
2
-
3
- export { commentProps as default } from '../../comment/index.es.js'
@@ -1,3 +0,0 @@
1
- import '../../read-tip/style.css'
2
-
3
- export { readTipProps as default } from '../../read-tip/index.es.js'
@@ -1,3 +0,0 @@
1
- import '../../tag-input/style.css'
2
-
3
- export { tagInputProps as default } from '../../tag-input/index.es.js'
@@ -1,261 +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 { defineComponent, toRefs, reactive, ref, onMounted, createVNode, Teleport, Fragment, onUnmounted } from "vue";
18
- const readTipProps = {
19
- readTipOptions: {
20
- type: Object
21
- },
22
- defaultTemplateProps: {
23
- type: Object
24
- }
25
- };
26
- var readTip = "";
27
- var TipsTemplate = defineComponent({
28
- name: "DReadTipTemplate",
29
- props: readTipProps,
30
- emits: [],
31
- setup(props, ctx) {
32
- const {
33
- defaultTemplateProps
34
- } = toRefs(props);
35
- let rule = defaultTemplateProps.value;
36
- const query = (rule == null ? void 0 : rule.id) ? `#${rule.id}` : rule.selector;
37
- const styles = reactive({});
38
- if (typeof rule.dataFn === "function") {
39
- const dataFn = rule.dataFn({
40
- element: document.querySelector(query),
41
- rule
42
- });
43
- rule = __spreadValues(__spreadValues({}, rule), dataFn);
44
- }
45
- const temp = ref(null);
46
- const deviation = (x) => {
47
- let deviationConstant = x > 24 ? 0 : -(x / 2) + 2;
48
- if (x <= 10) {
49
- deviationConstant = -10;
50
- }
51
- return deviationConstant;
52
- };
53
- onMounted(() => {
54
- var _a, _b;
55
- const domBounding = (_a = document.querySelector(query)) == null ? void 0 : _a.getBoundingClientRect();
56
- const {
57
- width,
58
- height
59
- } = domBounding;
60
- const distance = 10;
61
- let positionTop = 0;
62
- const heightDeviation = deviation(height);
63
- const widthDeviation = deviation(width);
64
- let positionLeft = 0;
65
- const targetDom = (_b = document.querySelector(".read-tip-container")) == null ? void 0 : _b.getBoundingClientRect();
66
- if (rule.appendToBody) {
67
- positionTop = domBounding.y + document.documentElement.scrollTop;
68
- positionLeft = domBounding.x;
69
- }
70
- switch (rule.position) {
71
- case "top":
72
- styles.top = positionTop - targetDom.height - distance + "px";
73
- styles.left = positionLeft + widthDeviation + "px";
74
- break;
75
- case "left":
76
- styles.top = positionTop + heightDeviation + "px";
77
- styles.left = positionLeft - targetDom.width - distance + "px";
78
- break;
79
- case "bottom":
80
- styles.top = positionTop + domBounding.height + distance + "px";
81
- styles.left = positionLeft + widthDeviation + "px";
82
- break;
83
- case "right":
84
- styles.top = positionTop + heightDeviation + "px";
85
- styles.left = positionLeft + domBounding.width + distance + "px";
86
- break;
87
- }
88
- });
89
- return () => {
90
- return createVNode(Teleport, {
91
- "to": rule.appendToBody ? "body" : query
92
- }, {
93
- default: () => {
94
- var _a, _b;
95
- return [createVNode("div", {
96
- "ref": temp,
97
- "class": ["read-tip-container", rule.position, rule.overlayClassName],
98
- "style": styles
99
- }, [createVNode("span", {
100
- "class": "after"
101
- }, null), rule.contentTemplate ? (_b = (_a = ctx.slots) == null ? void 0 : _a.default) == null ? void 0 : _b.call(_a) : createVNode(Fragment, null, [createVNode("div", {
102
- "class": "title"
103
- }, [rule.title]), createVNode("div", {
104
- "class": "content"
105
- }, [rule.content])])])];
106
- }
107
- });
108
- };
109
- }
110
- });
111
- const rules = (ruleList) => {
112
- if (ruleList === null) {
113
- return [];
114
- }
115
- if (typeof ruleList === "object" && !Array.isArray(ruleList)) {
116
- ruleList = [ruleList];
117
- }
118
- ruleList = [...ruleList];
119
- Array.isArray(ruleList) && ruleList.map((rule) => {
120
- rule.status = false;
121
- });
122
- return ruleList;
123
- };
124
- var ReadTip = defineComponent({
125
- name: "DReadTip",
126
- props: readTipProps,
127
- emits: [],
128
- setup(props, ctx) {
129
- const defaultOptions = {
130
- trigger: "hover",
131
- showAnimate: false,
132
- mouseenterTime: 100,
133
- mouseleaveTime: 100,
134
- position: "top",
135
- overlayClassName: "",
136
- appendToBody: true,
137
- rules: {
138
- selector: null
139
- }
140
- };
141
- const options = __spreadValues(__spreadValues({}, defaultOptions), props.readTipOptions);
142
- const defaultSlot = ref(null);
143
- const refRules = reactive(rules(options.rules));
144
- const onMouseenter = (rule) => () => {
145
- setTimeout(() => {
146
- if (rule.id) {
147
- const a = refRules.find((u) => u.id === rule.id);
148
- a.status = true;
149
- }
150
- rule.status = true;
151
- }, rule.mouseenterTime || options.mouseenterTime);
152
- };
153
- const onMouseleave = (rule) => () => {
154
- setTimeout(() => {
155
- if (rule.id) {
156
- const a = refRules.find((u) => u.id === rule.id);
157
- a.status = false;
158
- }
159
- rule.status = false;
160
- }, rule.mouseleaveTime || options.mouseleaveTime);
161
- };
162
- const init = (ruleList, trigger = "hover") => {
163
- ruleList.map((rule) => {
164
- var _a;
165
- rule.status = false;
166
- trigger = rule.trigger || trigger;
167
- rule.overlayClassName = rule.overlayClassName || options.overlayClassName;
168
- rule.position = rule.position || options.position;
169
- rule.contentTemplate = !!ctx.slots.contentTemplate;
170
- if (!("appendToBody" in rule)) {
171
- rule.appendToBody = options.appendToBody;
172
- }
173
- const doms = (_a = defaultSlot.value) == null ? void 0 : _a.querySelectorAll(rule.selector);
174
- [...doms].map((dom, index2) => {
175
- if (rule.appendToBody === false) {
176
- dom.style.position = "relative";
177
- }
178
- let newRule = reactive({
179
- id: null
180
- });
181
- const id = rule.selector.slice(rule.selector[0] === "." ? 1 : 0) + index2;
182
- if (index2 > 0) {
183
- newRule = __spreadValues({}, rule);
184
- dom.id = id;
185
- newRule.id = id;
186
- ruleList.push(newRule);
187
- }
188
- if (trigger === "hover") {
189
- dom.addEventListener("mouseenter", onMouseenter(newRule.id ? newRule : rule));
190
- dom.addEventListener("mouseleave", onMouseleave(newRule.id ? newRule : rule));
191
- }
192
- });
193
- });
194
- return ruleList;
195
- };
196
- function show(_, rule) {
197
- rule.status = true;
198
- }
199
- const clickFn = () => {
200
- refRules.forEach((element) => {
201
- element.status = false;
202
- });
203
- };
204
- onMounted(() => {
205
- init(refRules, options.trigger);
206
- document.addEventListener("click", clickFn, true);
207
- });
208
- onUnmounted(() => {
209
- document.removeEventListener("click", clickFn);
210
- });
211
- const onClick = (e) => {
212
- var _a;
213
- for (const rule of refRules) {
214
- const doms = (_a = defaultSlot.value) == null ? void 0 : _a.querySelectorAll(rule.selector);
215
- for (const dom of doms) {
216
- if (doms.length > 1) {
217
- if (dom === e.target && rule.id) {
218
- show(dom, rule);
219
- return;
220
- } else if (dom === e.target && !rule.id && !dom.id) {
221
- show(dom, rule);
222
- return;
223
- }
224
- } else if (dom === e.target) {
225
- show(dom, rule);
226
- return;
227
- } else {
228
- rule.status = false;
229
- }
230
- }
231
- }
232
- };
233
- return () => {
234
- var _a, _b;
235
- return createVNode("div", {
236
- "class": "devui-read-tip"
237
- }, [createVNode("div", {
238
- "ref": defaultSlot,
239
- "onClick": onClick
240
- }, [(_b = (_a = ctx.slots) == null ? void 0 : _a.default) == null ? void 0 : _b.call(_a)]), refRules.map((rule) => createVNode("div", {
241
- "data-test": "todo"
242
- }, [rule.status && createVNode(TipsTemplate, {
243
- "defaultTemplateProps": __spreadValues({}, rule)
244
- }, {
245
- default: () => {
246
- var _a2, _b2;
247
- return [rule.contentTemplate && ((_b2 = (_a2 = ctx.slots) == null ? void 0 : _a2.contentTemplate) == null ? void 0 : _b2.call(_a2))];
248
- }
249
- })]))]);
250
- };
251
- }
252
- });
253
- var index = {
254
- title: "ReadTip \u9605\u8BFB\u63D0\u793A",
255
- category: "\u53CD\u9988",
256
- status: "100%",
257
- install(app) {
258
- app.component(ReadTip.name, ReadTip);
259
- }
260
- };
261
- export { ReadTip, index as default, readTipProps };
@@ -1 +0,0 @@
1
- var D=Object.defineProperty;var k=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var w=(s,e,p)=>e in s?D(s,e,{enumerable:!0,configurable:!0,writable:!0,value:p}):s[e]=p,h=(s,e)=>{for(var p in e||(e={}))O.call(e,p)&&w(s,p,e[p]);if(k)for(var p of k(e))E.call(e,p)&&w(s,p,e[p]);return s};(function(s,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,e(s.index={},s.Vue))})(this,function(s,e){"use strict";const p={readTipOptions:{type:Object},defaultTemplateProps:{type:Object}};var F="",A=e.defineComponent({name:"DReadTipTemplate",props:p,emits:[],setup(d,m){const{defaultTemplateProps:V}=e.toRefs(d);let n=V.value;const u=(n==null?void 0:n.id)?`#${n.id}`:n.selector,c=e.reactive({});if(typeof n.dataFn=="function"){const a=n.dataFn({element:document.querySelector(u),rule:n});n=h(h({},n),a)}const b=e.ref(null),N=a=>{let f=a>24?0:-(a/2)+2;return a<=10&&(f=-10),f};return e.onMounted(()=>{var T,g;const a=(T=document.querySelector(u))==null?void 0:T.getBoundingClientRect(),{width:f,height:C}=a,v=10;let o=0;const i=N(C),t=N(f);let l=0;const r=(g=document.querySelector(".read-tip-container"))==null?void 0:g.getBoundingClientRect();switch(n.appendToBody&&(o=a.y+document.documentElement.scrollTop,l=a.x),n.position){case"top":c.top=o-r.height-v+"px",c.left=l+t+"px";break;case"left":c.top=o+i+"px",c.left=l-r.width-v+"px";break;case"bottom":c.top=o+a.height+v+"px",c.left=l+t+"px";break;case"right":c.top=o+i+"px",c.left=l+a.width+v+"px";break}}),()=>e.createVNode(e.Teleport,{to:n.appendToBody?"body":u},{default:()=>{var a,f;return[e.createVNode("div",{ref:b,class:["read-tip-container",n.position,n.overlayClassName],style:c},[e.createVNode("span",{class:"after"},null),n.contentTemplate?(f=(a=m.slots)==null?void 0:a.default)==null?void 0:f.call(a):e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"title"},[n.title]),e.createVNode("div",{class:"content"},[n.content])])])]}})}});const S=d=>d===null?[]:(typeof d=="object"&&!Array.isArray(d)&&(d=[d]),d=[...d],Array.isArray(d)&&d.map(m=>{m.status=!1}),d);var B=e.defineComponent({name:"DReadTip",props:p,emits:[],setup(d,m){const n=h(h({},{trigger:"hover",showAnimate:!1,mouseenterTime:100,mouseleaveTime:100,position:"top",overlayClassName:"",appendToBody:!0,rules:{selector:null}}),d.readTipOptions),u=e.ref(null),c=e.reactive(S(n.rules)),b=o=>()=>{setTimeout(()=>{if(o.id){const i=c.find(t=>t.id===o.id);i.status=!0}o.status=!0},o.mouseenterTime||n.mouseenterTime)},N=o=>()=>{setTimeout(()=>{if(o.id){const i=c.find(t=>t.id===o.id);i.status=!1}o.status=!1},o.mouseleaveTime||n.mouseleaveTime)},a=(o,i="hover")=>(o.map(t=>{var r;t.status=!1,i=t.trigger||i,t.overlayClassName=t.overlayClassName||n.overlayClassName,t.position=t.position||n.position,t.contentTemplate=!!m.slots.contentTemplate,"appendToBody"in t||(t.appendToBody=n.appendToBody),[...(r=u.value)==null?void 0:r.querySelectorAll(t.selector)].map((T,g)=>{t.appendToBody===!1&&(T.style.position="relative");let y=e.reactive({id:null});const R=t.selector.slice(t.selector[0]==="."?1:0)+g;g>0&&(y=h({},t),T.id=R,y.id=R,o.push(y)),i==="hover"&&(T.addEventListener("mouseenter",b(y.id?y:t)),T.addEventListener("mouseleave",N(y.id?y:t)))})}),o);function f(o,i){i.status=!0}const C=()=>{c.forEach(o=>{o.status=!1})};e.onMounted(()=>{a(c,n.trigger),document.addEventListener("click",C,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",C)});const v=o=>{var i;for(const t of c){const l=(i=u.value)==null?void 0:i.querySelectorAll(t.selector);for(const r of l)if(l.length>1){if(r===o.target&&t.id){f(r,t);return}else if(r===o.target&&!t.id&&!r.id){f(r,t);return}}else if(r===o.target){f(r,t);return}else t.status=!1}};return()=>{var o,i;return e.createVNode("div",{class:"devui-read-tip"},[e.createVNode("div",{ref:u,onClick:v},[(i=(o=m.slots)==null?void 0:o.default)==null?void 0:i.call(o)]),c.map(t=>e.createVNode("div",{"data-test":"todo"},[t.status&&e.createVNode(A,{defaultTemplateProps:h({},t)},{default:()=>{var l,r;return[t.contentTemplate&&((r=(l=m.slots)==null?void 0:l.contentTemplate)==null?void 0:r.call(l))]}})]))])}}}),q={title:"ReadTip \u9605\u8BFB\u63D0\u793A",category:"\u53CD\u9988",status:"100%",install(d){d.component(B.name,B)}};s.ReadTip=B,s.default=q,s.readTipProps=p,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
@@ -1 +0,0 @@
1
- .devui-read-tip{position:relative}.devui-read-tip .title{font-size:16px}.source{overflow:initial}.read-tip-container{font-size:var(--devui-font-size, 12px);position:absolute;width:max-content;height:max-content;line-height:1.5;border:none;border-radius:var(--devui-border-radius-feedback, 4px);background-color:var(--devui-feedback-overlay-bg, #464d6e);color:var(--devui-feedback-overlay-text, #dfe1e6);overflow-wrap:break-word;padding:10px;z-index:50}.read-tip-container .after{content:"";width:12px;height:12px;transform:rotate(45deg);position:absolute;background-color:var(--devui-feedback-overlay-bg, #464d6e)}.read-tip-container.top .after{bottom:-4px}.read-tip-container.left .after{right:-4px}.read-tip-container.right .after{left:-4px}.read-tip-container.bottom .after{top:-4px}