cbvirtua 1.0.6 → 1.0.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 (74) hide show
  1. package/menu/wzc-option.vue +74 -0
  2. package/menu/wzc-select.vue +209 -0
  3. package/package.json +1 -1
  4. package/v2/App.vue +0 -56
  5. package/v2/components/Dropdown.vue +0 -28
  6. package/v2/components/Menu.vue +0 -9
  7. package/v2/components/Popper.js +0 -1011
  8. package/v2/components/PopperContent.vue +0 -270
  9. package/v2/components/PopperMethods.js +0 -17
  10. package/v2/components/PopperWrapper.vue +0 -101
  11. package/v2/components/ResizeObserver.vue +0 -151
  12. package/v2/components/ThemeClass.js +0 -9
  13. package/v2/components/Tooltip.vue +0 -22
  14. package/v2/components/TooltipDirective.vue +0 -171
  15. package/v2/config.js +0 -133
  16. package/v2/directives/v-close-popper.js +0 -67
  17. package/v2/directives/v-tooltip.js +0 -116
  18. package/v2/floating-ui/core/computeCoordsFromPlacement.js +0 -39
  19. package/v2/floating-ui/core/computePosition.js +0 -52
  20. package/v2/floating-ui/core/detectOverflow.js +0 -36
  21. package/v2/floating-ui/core/enums.js +0 -7
  22. package/v2/floating-ui/core/index.js +0 -11
  23. package/v2/floating-ui/core/middleware/arrow.js +0 -52
  24. package/v2/floating-ui/core/middleware/autoPlacement.js +0 -84
  25. package/v2/floating-ui/core/middleware/flip.js +0 -82
  26. package/v2/floating-ui/core/middleware/hide.js +0 -36
  27. package/v2/floating-ui/core/middleware/inline.js +0 -100
  28. package/v2/floating-ui/core/middleware/offset.js +0 -26
  29. package/v2/floating-ui/core/middleware/shift.js +0 -99
  30. package/v2/floating-ui/core/middleware/size.js +0 -58
  31. package/v2/floating-ui/core/types.js +0 -11
  32. package/v2/floating-ui/core/utils/expandPaddingObject.js +0 -3
  33. package/v2/floating-ui/core/utils/getAlignment.js +0 -3
  34. package/v2/floating-ui/core/utils/getAlignmentSides.js +0 -23
  35. package/v2/floating-ui/core/utils/getBasePlacement.js +0 -3
  36. package/v2/floating-ui/core/utils/getCrossAxis.js +0 -3
  37. package/v2/floating-ui/core/utils/getExpandedPlacements.js +0 -10
  38. package/v2/floating-ui/core/utils/getLengthFromAxis.js +0 -3
  39. package/v2/floating-ui/core/utils/getMainAxisFromPlacement.js +0 -4
  40. package/v2/floating-ui/core/utils/getOppositeAlignmentPlacement.js +0 -4
  41. package/v2/floating-ui/core/utils/getOppositePlacement.js +0 -4
  42. package/v2/floating-ui/core/utils/getPaddingObject.js +0 -6
  43. package/v2/floating-ui/core/utils/math.js +0 -2
  44. package/v2/floating-ui/core/utils/rectToClientRect.js +0 -9
  45. package/v2/floating-ui/core/utils/within.js +0 -4
  46. package/v2/floating-ui/dom/index.js +0 -5
  47. package/v2/floating-ui/dom/platform.js +0 -20
  48. package/v2/floating-ui/dom/utils/contains.js +0 -22
  49. package/v2/floating-ui/dom/utils/convertOffsetParentRelativeRectToViewportRelativeRect.js +0 -35
  50. package/v2/floating-ui/dom/utils/getBoundingClientRect.js +0 -27
  51. package/v2/floating-ui/dom/utils/getClippingClientRect.js +0 -76
  52. package/v2/floating-ui/dom/utils/getComputedStyle.js +0 -4
  53. package/v2/floating-ui/dom/utils/getDimensions.js +0 -6
  54. package/v2/floating-ui/dom/utils/getDocumentElement.js +0 -4
  55. package/v2/floating-ui/dom/utils/getDocumentRect.js +0 -21
  56. package/v2/floating-ui/dom/utils/getNodeName.js +0 -4
  57. package/v2/floating-ui/dom/utils/getNodeScroll.js +0 -13
  58. package/v2/floating-ui/dom/utils/getOffsetParent.js +0 -43
  59. package/v2/floating-ui/dom/utils/getParentNode.js +0 -16
  60. package/v2/floating-ui/dom/utils/getRectRelativeToOffsetParent.js +0 -40
  61. package/v2/floating-ui/dom/utils/getScrollParent.js +0 -13
  62. package/v2/floating-ui/dom/utils/getScrollParents.js +0 -18
  63. package/v2/floating-ui/dom/utils/getViewportRect.js +0 -25
  64. package/v2/floating-ui/dom/utils/getWindowScrollBarX.js +0 -9
  65. package/v2/floating-ui/dom/utils/is.js +0 -38
  66. package/v2/floating-ui/dom/utils/math.js +0 -3
  67. package/v2/floating-ui/dom/utils/window.js +0 -13
  68. package/v2/index.js +0 -75
  69. package/v2/util/assign-deep.js +0 -12
  70. package/v2/util/env.js +0 -18
  71. package/v2/util/events.js +0 -12
  72. package/v2/util/frame.js +0 -5
  73. package/v2/util/lang.js +0 -6
  74. package/v2/util/popper.js +0 -5
@@ -0,0 +1,74 @@
1
+ <template>
2
+ <li class="wzc_option" :style="styleVar" @click="currentSelect">
3
+ <div class="wzc_option_dropdown_item">{{ label }}</div>
4
+ </li>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: "wzc_select",
10
+ components: {},
11
+ props: {
12
+ width: {
13
+ type: Number,
14
+ default: -1,
15
+ },
16
+ height: {
17
+ type: Number,
18
+ default: 34,
19
+ },
20
+ label: {
21
+ type: String,
22
+ },
23
+ optionid: {
24
+ type: String,
25
+ },
26
+ },
27
+ data() {
28
+ return {};
29
+ },
30
+ created() {},
31
+ mounted() {},
32
+ watch: {},
33
+ computed: {
34
+ styleVar() {
35
+ return {
36
+ "--option-height": this.height + "px",
37
+ "--option-width": this.width == -1? "100%" : this.width + "px",
38
+ };
39
+ },
40
+ },
41
+ methods: {
42
+ currentSelect() {
43
+ this.$parent.label = this.label;
44
+ this.$parent.optionid = this.optionid;
45
+ this.$parent.isListShow = !this.$parent.isListShow;
46
+ // this.$emit('slot-content', {label: this.label, optionid: this.optionid} );
47
+ }
48
+ },
49
+ };
50
+ </script>
51
+ <style scoped>
52
+ .wzc_option {
53
+ list-style: none;
54
+ height: var(--option-height);
55
+ width: var(--option-width);
56
+
57
+ }
58
+ .wzc_option:hover {
59
+ color: #409eff;
60
+ font-weight: 700;
61
+ background-color: #f5f7fa;
62
+ }
63
+ .wzc_option_dropdown_item {
64
+ height: 100%;
65
+ width: calc(100% - 30px);
66
+ line-height: var(--option-height);
67
+ cursor: pointer;
68
+ margin: 0 auto;
69
+ overflow: hidden;
70
+ text-overflow: ellipsis;
71
+ white-space: nowrap;
72
+ }
73
+
74
+ </style>
@@ -0,0 +1,209 @@
1
+ <template>
2
+ <div class="wzc_select" :style="styleVar">
3
+ <div class="divSelect" :class="{ 'drop_down': isListShow }" ref="divSelect">
4
+ <div class="divSelectinput" @click="dropDownSelect">
5
+ <!-- 选中后的内容 -->
6
+ <div class="selectinfos" :title="label" :class="{ 'no_select': label == '请选择' }"> {{ label }} </div>
7
+ <!-- 三角形图标 -->
8
+ <i class="imgthree" :class="{ 'is-reverse': isListShow }">
9
+ <svg t="1707138975702" class="icon" viewBox="0 0 1024 1024" version="1.1"
10
+ xmlns="http://www.w3.org/2000/svg" p-id="1444" width="16" height="16">
11
+ <path d="M512 187.24L699.501 512 887 836.76H137L324.5 512z" p-id="1445"></path>
12
+ </svg>
13
+ </i>
14
+ </div>
15
+ </div>
16
+ <!-- 下拉框列表 -->
17
+ <transition name="drop-down">
18
+ <div class="Selectlist" v-show="isListShow" ref="dropDown">
19
+ <div class="select_triangle"></div>
20
+ <ul class="wzc_option_list">
21
+ <slot name="wzc_option"></slot>
22
+ </ul>
23
+ </div>
24
+ </transition>
25
+ </div>
26
+ </template>
27
+
28
+ <script>
29
+ export default {
30
+ name: 'wzc_select',
31
+ components: {},
32
+ props: {
33
+ placeholder: {
34
+ type: String,
35
+ default: '请选择'
36
+ },
37
+ width: {
38
+ type: Number,
39
+ default: 180
40
+ },
41
+ height: {
42
+ type: Number,
43
+ default: 40
44
+ },
45
+ },
46
+ data() {
47
+ return {
48
+ label: '',
49
+ isListShow: false,
50
+ optionid: ''
51
+ };
52
+ },
53
+ created() {
54
+ this.label = this.placeholder;
55
+ },
56
+ mounted() {
57
+ let _this = this;
58
+ document.addEventListener("click", function (e) {
59
+ if (_this.$refs.divSelect) {
60
+ if (!!_this.$refs.divSelect.contains(e.target) || !!_this.$refs.dropDown.contains(e.target))
61
+ return;
62
+ else
63
+ _this.isListShow = false;
64
+ }
65
+ })
66
+ },
67
+ computed: {
68
+ styleVar() {
69
+ return {
70
+ '--select-height': this.height + 'px',
71
+ '--select-width': this.width + 'px'
72
+ }
73
+ }
74
+ },
75
+ methods: {
76
+ dropDownSelect() {
77
+ this.isListShow = !this.isListShow;
78
+ },
79
+ },
80
+ };
81
+ </script>
82
+ <style scoped>
83
+ .wzc_select {
84
+ border: 1px solid #E6E6E6;
85
+ border-radius: 5px;
86
+ height: var(--select-height);
87
+ width: var(--select-width);
88
+ line-height: var(--select-height);
89
+ }
90
+
91
+ .divSelect {
92
+ width: 100%;
93
+ height: 100%;
94
+ border-radius: 5px;
95
+ }
96
+
97
+ .drop_down {
98
+ box-shadow: 0px 0px 6px #709DF7;
99
+ }
100
+
101
+ .divSelectinput {
102
+ width: calc(100% - 20px);
103
+ height: 100%;
104
+ margin: 0 5px 0 15px;
105
+ display: flex;
106
+ }
107
+
108
+ .selectinfos {
109
+ width: 87.5%;
110
+ cursor: pointer;
111
+ overflow: hidden;
112
+ text-overflow: ellipsis;
113
+ white-space: nowrap;
114
+ }
115
+
116
+ .no_select {
117
+ color: #D3DCE6;
118
+ }
119
+
120
+ .imgthree {
121
+ width: 12.5%;
122
+ line-height: var(--select-height);
123
+ text-align: center;
124
+ transform: rotate(180deg);
125
+ transition: all 0.3s;
126
+ }
127
+
128
+ .imgthree svg {
129
+ width: 1em;
130
+ height: 1em;
131
+ }
132
+
133
+ .imgthree:before {
134
+ cursor: pointer;
135
+ color: #D3DCE6;
136
+ }
137
+
138
+ .imgthree.is-reverse {
139
+ transform: rotate(0deg);
140
+ }
141
+
142
+ .Selectlist {
143
+ margin-top: 10px;
144
+ z-index: 800;
145
+ position: relative;
146
+ background-color: #fff;
147
+ }
148
+
149
+ .wzc_option_list {
150
+ border-radius: 5px;
151
+ border: 1px solid #E4E7ED;
152
+ width: 100%;
153
+ padding: 3px 0px;
154
+ box-shadow: 0px 0px 6px #709DF7;
155
+ background-color: #fff;
156
+ margin: 0;
157
+ }
158
+
159
+ .select_triangle {
160
+ width: 14px;
161
+ height: 7px;
162
+ position: relative;
163
+ left: 15px;
164
+ }
165
+
166
+ .select_triangle::before {
167
+ position: absolute;
168
+ content: "";
169
+ left: 0px;
170
+ width: 0;
171
+ height: 0;
172
+ border-top: 0px solid transparent;
173
+ border-left: 9px solid transparent;
174
+ border-right: 9px solid transparent;
175
+ border-bottom: 8px solid #EBEEF5;
176
+ }
177
+
178
+ .select_triangle::after {
179
+ position: absolute;
180
+ left: 2px;
181
+ top: 2px;
182
+ content: "";
183
+ width: 0;
184
+ height: 0;
185
+ border-top: 0px solid transparent;
186
+ border-left: 7px solid transparent;
187
+ border-right: 7px solid transparent;
188
+ border-bottom: 8px solid #fff;
189
+ }
190
+
191
+ .drop-down-enter {
192
+ opacity: 0;
193
+ transform: translate(0px, -80px) scaleY(0.2);
194
+ }
195
+
196
+ .drop-down-leave-to {
197
+ opacity: 0;
198
+ transform: translate(0px, -80px) scaleY(0.2);
199
+ }
200
+
201
+ .drop-down-enter-active {
202
+ transition: all 0.5s ease-in;
203
+ }
204
+
205
+ .drop-down-leave-active {
206
+ transition: all 0.5s ease;
207
+ }
208
+ </style>
209
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cbvirtua",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/v2/App.vue DELETED
@@ -1,56 +0,0 @@
1
- <template>
2
- <div id="app">
3
- <Dropdown :distance="6">
4
- <button>Click me</button>
5
- <template #popper>
6
- <button v-close-popper="myBooleanProp" @click="hide">Close</button>
7
- </template>
8
- </Dropdown>
9
-
10
- </div>
11
- </template>
12
-
13
- <script>
14
- import {
15
- // Directives
16
- vTooltip,
17
- VClosePopper,
18
- // Components
19
- Dropdown,
20
- Tooltip,
21
- Menu
22
- } from './components/v2'
23
- console.log(VClosePopper)
24
- export default {
25
- name: 'App',
26
- data() {
27
- return {
28
- myBooleanProp: true
29
- }
30
- },
31
- directives: {
32
- 'close-popper': VClosePopper
33
- },
34
- components: {
35
- Dropdown
36
- },
37
- methods: {
38
- hide() {
39
- console.log(123)
40
- this.myBooleanProp = true
41
- console.log(this.myBooleanProp)
42
- }
43
- }
44
- }
45
- </script>
46
-
47
- <style>
48
- #app {
49
- font-family: Avenir, Helvetica, Arial, sans-serif;
50
- -webkit-font-smoothing: antialiased;
51
- -moz-osx-font-smoothing: grayscale;
52
- text-align: center;
53
- color: #2c3e50;
54
- margin-top: 60px;
55
- }
56
- </style>
@@ -1,28 +0,0 @@
1
- <script lang="ts">
2
- import PopperWrapper from './PopperWrapper.vue'
3
-
4
- export default {
5
- ...PopperWrapper,
6
- name: 'VDropdown',
7
- vPopperTheme: 'dropdown',
8
- }
9
- </script>
10
-
11
- <style>
12
- .v-popper--theme-dropdown .v-popper__inner {
13
- background: #fff;
14
- color: black;
15
- border-radius: 6px;
16
- border: 1px solid #ddd;
17
- box-shadow: 0 6px 30px rgba(0, 0, 0, .1);
18
- }
19
-
20
- .v-popper--theme-dropdown .v-popper__arrow-inner {
21
- visibility: visible;
22
- border-color: #fff;
23
- }
24
-
25
- .v-popper--theme-dropdown .v-popper__arrow-outer {
26
- border-color: #ddd;
27
- }
28
- </style>
@@ -1,9 +0,0 @@
1
- <script lang="ts">
2
- import PopperWrapper from './PopperWrapper.vue'
3
-
4
- export default {
5
- ...PopperWrapper,
6
- name: 'VMenu',
7
- vPopperTheme: 'menu',
8
- }
9
- </script>