@progress/kendo-vue-popup 3.5.0 → 3.5.1-dev.202208100944
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-vue-popup.js +1 -1
- package/dist/es/Popup.js +1 -1
- package/dist/es/models/Align.js +1 -0
- package/dist/es/models/AlignElementSettings.js +1 -0
- package/dist/es/models/Collision.js +1 -0
- package/dist/es/models/CollisionType.js +1 -0
- package/dist/es/models/Events.js +1 -0
- package/dist/es/models/Offset.js +1 -0
- package/dist/es/models/PopupAnimation.js +1 -0
- package/dist/es/models/PopupProps.js +1 -0
- package/dist/es/models/PopupSettings.js +1 -0
- package/dist/es/models/Position.js +1 -0
- package/dist/es/models/positionElementSettings.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/util.js +2 -2
- package/dist/esm/Popup.d.ts +72 -0
- package/dist/esm/Popup.js +424 -0
- package/dist/esm/additionalTypes.ts +21 -0
- package/dist/esm/main.d.ts +9 -0
- package/dist/esm/main.js +2 -0
- package/dist/esm/models/Align.d.ts +23 -0
- package/dist/esm/models/Align.js +1 -0
- package/dist/esm/models/AlignElementSettings.d.ts +11 -0
- package/dist/esm/models/AlignElementSettings.js +1 -0
- package/dist/esm/models/Collision.d.ts +14 -0
- package/dist/esm/models/Collision.js +1 -0
- package/dist/esm/models/CollisionType.d.ts +8 -0
- package/dist/esm/models/CollisionType.js +1 -0
- package/dist/esm/models/Events.d.ts +18 -0
- package/dist/esm/models/Events.js +1 -0
- package/dist/esm/models/Offset.d.ts +13 -0
- package/dist/esm/models/Offset.js +1 -0
- package/dist/esm/models/PopupAnimation.d.ts +13 -0
- package/dist/esm/models/PopupAnimation.js +1 -0
- package/dist/esm/models/PopupProps.d.ts +10 -0
- package/dist/esm/models/PopupProps.js +1 -0
- package/dist/esm/models/PopupSettings.d.ts +68 -0
- package/dist/esm/models/PopupSettings.js +2 -0
- package/dist/esm/models/Position.d.ts +8 -0
- package/dist/esm/models/Position.js +1 -0
- package/dist/esm/models/positionElementSettings.d.ts +13 -0
- package/dist/esm/models/positionElementSettings.js +1 -0
- package/dist/esm/package-metadata.d.ts +5 -0
- package/dist/esm/package-metadata.js +11 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/services/alignService.d.ts +14 -0
- package/dist/esm/services/alignService.js +43 -0
- package/dist/esm/services/domService.d.ts +34 -0
- package/dist/esm/services/domService.js +139 -0
- package/dist/esm/services/positionService.d.ts +12 -0
- package/dist/esm/services/positionService.js +34 -0
- package/dist/esm/util.d.ts +74 -0
- package/dist/esm/util.js +254 -0
- package/dist/npm/Popup.js +7 -7
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/services/alignService.js +3 -3
- package/dist/npm/services/domService.js +18 -18
- package/dist/npm/services/positionService.js +2 -2
- package/dist/npm/util.js +42 -30
- package/package.json +3 -3
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as Vue from 'vue';
|
|
3
|
+
var allVue = Vue;
|
|
4
|
+
var gh = allVue.h;
|
|
5
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
|
+
import { Slide } from '@progress/kendo-vue-animation';
|
|
7
|
+
import { CollisionType, AlignPoint, throttle, FRAME_DURATION, isWindowAvailable } from './util.js';
|
|
8
|
+
import { AlignService } from './services/alignService.js';
|
|
9
|
+
import { DOMService } from './services/domService.js';
|
|
10
|
+
import { PositionService } from './services/positionService.js';
|
|
11
|
+
import { canUseDOM, getDefaultSlots, validatePackage } from '@progress/kendo-vue-common';
|
|
12
|
+
import { packageMetadata } from './package-metadata.js';
|
|
13
|
+
var DEFAULT_POPUP_ZINDEX = 100;
|
|
14
|
+
var ZINDEX_POPUP_STEP = 1;
|
|
15
|
+
var DEFAULT_OFFSET = {
|
|
16
|
+
left: -1000,
|
|
17
|
+
top: 0
|
|
18
|
+
};
|
|
19
|
+
var ANIMATION_CONTAINER = 'k-animation-container';
|
|
20
|
+
var ANIMATION_CONTAINER_SHOWN = 'k-animation-container-shown';
|
|
21
|
+
var K_POPUP = 'k-popup';
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
var PopupVue2 = {
|
|
27
|
+
name: 'Popup',
|
|
28
|
+
props: {
|
|
29
|
+
appendTo: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ''
|
|
32
|
+
},
|
|
33
|
+
anchor: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: ''
|
|
36
|
+
},
|
|
37
|
+
className: String,
|
|
38
|
+
id: String,
|
|
39
|
+
popupClass: String,
|
|
40
|
+
collision: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: function _default() {
|
|
43
|
+
return {
|
|
44
|
+
horizontal: CollisionType.fit,
|
|
45
|
+
vertical: CollisionType.flip
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
anchorAlign: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: function _default() {
|
|
52
|
+
return {
|
|
53
|
+
horizontal: AlignPoint.left,
|
|
54
|
+
vertical: AlignPoint.bottom
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
popupAlign: {
|
|
59
|
+
type: Object,
|
|
60
|
+
default: function _default() {
|
|
61
|
+
return {
|
|
62
|
+
horizontal: AlignPoint.left,
|
|
63
|
+
vertical: AlignPoint.top
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
offset: {
|
|
68
|
+
type: Object,
|
|
69
|
+
default: function _default() {
|
|
70
|
+
return DEFAULT_OFFSET;
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
show: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false
|
|
76
|
+
},
|
|
77
|
+
animate: {
|
|
78
|
+
type: [Boolean, Object],
|
|
79
|
+
default: function _default() {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
direction: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: 'down'
|
|
86
|
+
},
|
|
87
|
+
transition: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: 'expand'
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
inject: {
|
|
93
|
+
kCurrentZIndex: {
|
|
94
|
+
default: null
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
data: function data() {
|
|
98
|
+
return {
|
|
99
|
+
hasMounted: false
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
created: function created() {
|
|
103
|
+
validatePackage(packageMetadata);
|
|
104
|
+
this.mountedAppendTo = undefined;
|
|
105
|
+
this.mountedAnchor = undefined;
|
|
106
|
+
this._initiallyMountedContent = undefined;
|
|
107
|
+
this._flipped = false;
|
|
108
|
+
this._offsetTop = 0;
|
|
109
|
+
this._offsetLeft = -1000;
|
|
110
|
+
this._exitingAnimation = false;
|
|
111
|
+
this._prevShow = false;
|
|
112
|
+
this._prevShow = this.$props.show;
|
|
113
|
+
this._domService = new DOMService();
|
|
114
|
+
this._alignService = new AlignService(this._domService);
|
|
115
|
+
this._positionService = new PositionService(this._domService);
|
|
116
|
+
this.reposition = throttle(this.reposition.bind(this), FRAME_DURATION);
|
|
117
|
+
},
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
setup: !isV3 ? undefined : function () {
|
|
120
|
+
var v3 = !!isV3;
|
|
121
|
+
return {
|
|
122
|
+
v3: v3
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
mounted: function mounted() {
|
|
126
|
+
if (canUseDOM) {
|
|
127
|
+
this.mountedAppendTo = this.$props.appendTo ? this.getParentRef(this.$props.appendTo) : document.body;
|
|
128
|
+
this.mountedAnchor = this.$props.anchor ? this.getParentRef(this.$props.anchor) : document.body;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
this._parentElement = this.$el.parentElement;
|
|
132
|
+
this._initiallyMountedContent = this.$el.cloneNode(true);
|
|
133
|
+
this.hasMounted = true;
|
|
134
|
+
this.mountedAppendTo.appendChild(this.$el);
|
|
135
|
+
},
|
|
136
|
+
updated: function updated() {
|
|
137
|
+
this._prevShow = this.$props.show;
|
|
138
|
+
},
|
|
139
|
+
destroyed: !!isV3 ? undefined : function () {
|
|
140
|
+
this.detachRepositionHandlers();
|
|
141
|
+
},
|
|
142
|
+
beforeDestroy: !!isV3 ? undefined : function () {
|
|
143
|
+
if (this._parentElement) {
|
|
144
|
+
this._parentElement.appendChild(this.$el);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
// @ts-ignore
|
|
148
|
+
unmounted: function unmounted() {
|
|
149
|
+
this.detachRepositionHandlers();
|
|
150
|
+
},
|
|
151
|
+
// @ts-ignore
|
|
152
|
+
beforeUnmount: function beforeUnmount() {
|
|
153
|
+
if (this._parentElement) {
|
|
154
|
+
this._parentElement.appendChild(this.$el);
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
methods: {
|
|
158
|
+
onOpened: function onOpened() {
|
|
159
|
+
var element = this.$el;
|
|
160
|
+
|
|
161
|
+
if (this.$props.show) {
|
|
162
|
+
element.classList.add(ANIMATION_CONTAINER_SHOWN);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
this.attachRepositionHandlers(element);
|
|
166
|
+
this.$emit('open', {
|
|
167
|
+
target: this
|
|
168
|
+
});
|
|
169
|
+
},
|
|
170
|
+
onClosing: function onClosing() {
|
|
171
|
+
if (!this.$props.show) {
|
|
172
|
+
var element = this.$el;
|
|
173
|
+
element.classList.remove(ANIMATION_CONTAINER_SHOWN);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
this.detachRepositionHandlers();
|
|
177
|
+
},
|
|
178
|
+
onClosed: function onClosed() {
|
|
179
|
+
if (this._exitingAnimation) {
|
|
180
|
+
this._exitingAnimation = false;
|
|
181
|
+
this.$forceUpdate();
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
this.$emit('close', {
|
|
185
|
+
target: this
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
transitionDuration: function transitionDuration() {
|
|
189
|
+
var animate = this.$props.animate;
|
|
190
|
+
var transitionEnterDuration = 0;
|
|
191
|
+
var transitionExitDuration = 0;
|
|
192
|
+
|
|
193
|
+
if (animate) {
|
|
194
|
+
if (animate === true) {
|
|
195
|
+
// Inherit the default duration of the Animation component.
|
|
196
|
+
transitionEnterDuration = transitionExitDuration = undefined;
|
|
197
|
+
} else {
|
|
198
|
+
transitionEnterDuration = animate.openDuration;
|
|
199
|
+
transitionExitDuration = animate.closeDuration;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return {
|
|
204
|
+
transitionEnterDuration: transitionEnterDuration,
|
|
205
|
+
transitionExitDuration: transitionExitDuration
|
|
206
|
+
};
|
|
207
|
+
},
|
|
208
|
+
getParentRef: function getParentRef(anchor) {
|
|
209
|
+
// @ts-ignore
|
|
210
|
+
var parent = this.$parent;
|
|
211
|
+
|
|
212
|
+
while (!parent.$refs[anchor]) {
|
|
213
|
+
// @ts-ignore
|
|
214
|
+
if (parent && parent.kendoAnchorRef) {
|
|
215
|
+
// @ts-ignore
|
|
216
|
+
return parent.kendoAnchorRef;
|
|
217
|
+
} // @ts-ignore
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
parent = parent.$parent;
|
|
221
|
+
|
|
222
|
+
if (!parent && canUseDOM) {
|
|
223
|
+
return document.body;
|
|
224
|
+
}
|
|
225
|
+
} // @ts-ignore
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
return parent.$refs[anchor].$el || parent.$refs[anchor];
|
|
229
|
+
},
|
|
230
|
+
position: function position(settings, element, anchor) {
|
|
231
|
+
var anchorAlign = settings.anchorAlign,
|
|
232
|
+
popupAlign = settings.popupAlign,
|
|
233
|
+
collision = settings.collision,
|
|
234
|
+
offset = settings.offset;
|
|
235
|
+
var anchorElement = anchor ? this.v3 ? this.mountedAnchor : this.getParentRef(anchor) : document.body;
|
|
236
|
+
|
|
237
|
+
var alignedOffset = this._alignService.alignElement({
|
|
238
|
+
anchor: anchor ? anchorElement : undefined,
|
|
239
|
+
element: element,
|
|
240
|
+
elementAlign: popupAlign,
|
|
241
|
+
anchorAlign: anchorAlign,
|
|
242
|
+
offset: offset
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
var result = this._positionService.positionElement({
|
|
246
|
+
anchor: anchorElement,
|
|
247
|
+
anchorAlign: anchorAlign,
|
|
248
|
+
collisions: collision,
|
|
249
|
+
element: element,
|
|
250
|
+
currentLocation: alignedOffset,
|
|
251
|
+
elementAlign: popupAlign
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
return result;
|
|
255
|
+
},
|
|
256
|
+
calculatePosition: function calculatePosition($props, appendToElement) {
|
|
257
|
+
if (!appendToElement || !isWindowAvailable() || !canUseDOM) {
|
|
258
|
+
return {
|
|
259
|
+
flipped: false,
|
|
260
|
+
offset: $props.offset
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
var defaultSlot = getDefaultSlots(this);
|
|
265
|
+
var root = document.createElement('div');
|
|
266
|
+
var contentElement = this.$el && this.$el.firstChild ? this.$el.firstChild.firstChild ? this.$el.firstChild.firstChild.cloneNode(true) : null : null;
|
|
267
|
+
var divWrapper = contentElement && contentElement.getBoundingClientRect ? contentElement : this._initiallyMountedContent;
|
|
268
|
+
|
|
269
|
+
if (divWrapper) {
|
|
270
|
+
root.appendChild(divWrapper);
|
|
271
|
+
} else {
|
|
272
|
+
// @ts-ignore
|
|
273
|
+
var internalClass = this.v3 ? defaultSlot && defaultSlot[0].props ? defaultSlot[0].props.class : '' : defaultSlot && defaultSlot[0].data ? defaultSlot[0].data.staticClass : ''; // @ts-ignore
|
|
274
|
+
|
|
275
|
+
var domClass = this.v3 ? this.$props.popupClass ? this.$props.popupClass : '' : defaultSlot && defaultSlot[0].data ? defaultSlot[0].data.class : '';
|
|
276
|
+
root.innerHTML = "<div class=\"k-animation-container k-animation-container-relative\">\t\n <div class=\"k-popup k-animation-container k-animation-container-relative\">\n <div class=\"".concat(internalClass, " ").concat(domClass, "\" >\n </div>\t\n </div>\t\n </div>");
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
appendToElement.appendChild(root);
|
|
280
|
+
|
|
281
|
+
if (root && root.firstChild) {
|
|
282
|
+
var firstChild = root.firstChild;
|
|
283
|
+
firstChild.style.position = 'absolute';
|
|
284
|
+
firstChild.style.visibility = 'hidden';
|
|
285
|
+
firstChild.style.display = 'block';
|
|
286
|
+
firstChild.style.left = '-1000';
|
|
287
|
+
firstChild.style.top = '0';
|
|
288
|
+
var inlineStyles = this.v3 ? defaultSlot && defaultSlot[0].props ? defaultSlot[0].props.style : {} : defaultSlot[0].data ? defaultSlot[0].data.style : {};
|
|
289
|
+
|
|
290
|
+
if (inlineStyles) {
|
|
291
|
+
for (var _i = 0, _a = Object.entries(inlineStyles); _i < _a.length; _i++) {
|
|
292
|
+
var _b = _a[_i],
|
|
293
|
+
key = _b[0],
|
|
294
|
+
value = _b[1];
|
|
295
|
+
firstChild.style[key] = value;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
var newPosition = this.position($props, root.firstChild, this.$props.anchor);
|
|
301
|
+
root.parentNode.removeChild(root);
|
|
302
|
+
return newPosition;
|
|
303
|
+
},
|
|
304
|
+
attachRepositionHandlers: function attachRepositionHandlers(element) {
|
|
305
|
+
var _this = this;
|
|
306
|
+
|
|
307
|
+
this.detachRepositionHandlers();
|
|
308
|
+
this._scrollableParents = this._domService.scrollableParents(this.$props.anchor ? this.mountedAnchor : element);
|
|
309
|
+
|
|
310
|
+
this._scrollableParents.map(function (p) {
|
|
311
|
+
return p.addEventListener('scroll', _this.reposition);
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
window.addEventListener('resize', this.reposition);
|
|
315
|
+
},
|
|
316
|
+
detachRepositionHandlers: function detachRepositionHandlers() {
|
|
317
|
+
var _this = this;
|
|
318
|
+
|
|
319
|
+
if (this._scrollableParents) {
|
|
320
|
+
this._scrollableParents.map(function (p) {
|
|
321
|
+
return p.removeEventListener('scroll', _this.reposition);
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
this._scrollableParents = undefined;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
window.removeEventListener('resize', this.reposition);
|
|
328
|
+
},
|
|
329
|
+
reposition: function reposition() {
|
|
330
|
+
this.$forceUpdate();
|
|
331
|
+
},
|
|
332
|
+
getCurrentZIndex: function getCurrentZIndex() {
|
|
333
|
+
return this.kCurrentZIndex ? this.kCurrentZIndex + ZINDEX_POPUP_STEP : DEFAULT_POPUP_ZINDEX;
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
// @ts-ignore
|
|
337
|
+
render: function render(createElement) {
|
|
338
|
+
var h = gh || createElement;
|
|
339
|
+
var _a = this.$props,
|
|
340
|
+
className = _a.className,
|
|
341
|
+
popupClass = _a.popupClass,
|
|
342
|
+
show = _a.show,
|
|
343
|
+
id = _a.id;
|
|
344
|
+
var defaultSlots = getDefaultSlots(this);
|
|
345
|
+
var defaultSlot = this.v3 ? defaultSlots : show ? defaultSlots : null;
|
|
346
|
+
var defaultAppentTo = isWindowAvailable() ? this.$props.appendTo ? this.mountedAppendTo || this.getParentRef(this.$props.appendTo) : document.body : undefined;
|
|
347
|
+
|
|
348
|
+
if (this.$props.show) {
|
|
349
|
+
var newPosition = this.calculatePosition(this.$props, defaultAppentTo);
|
|
350
|
+
this._offsetLeft = newPosition.offset.left;
|
|
351
|
+
this._offsetTop = newPosition.offset.top;
|
|
352
|
+
this._flipped = !!newPosition.flipped;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
var direction = this._flipped ? 'up' : 'down';
|
|
356
|
+
|
|
357
|
+
var _b = this.transitionDuration(),
|
|
358
|
+
transitionEnterDuration = _b.transitionEnterDuration,
|
|
359
|
+
transitionExitDuration = _b.transitionExitDuration;
|
|
360
|
+
|
|
361
|
+
var currentZIndex = this.getCurrentZIndex();
|
|
362
|
+
this._exitingAnimation = this._exitingAnimation || this._prevShow && !show;
|
|
363
|
+
|
|
364
|
+
if (!this.hasMounted) {
|
|
365
|
+
return h("div", {
|
|
366
|
+
style: {
|
|
367
|
+
display: 'none'
|
|
368
|
+
},
|
|
369
|
+
"class": className
|
|
370
|
+
}, [h("div", {
|
|
371
|
+
"class": [popupClass, K_POPUP]
|
|
372
|
+
}, [defaultSlots])]);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
if (show || this._exitingAnimation && defaultAppentTo) {
|
|
376
|
+
var popup = // @ts-ignore function children
|
|
377
|
+
h(Slide, {
|
|
378
|
+
id: id,
|
|
379
|
+
attrs: this.v3 ? undefined : {
|
|
380
|
+
id: id,
|
|
381
|
+
role: this.appendTo ? '' : 'region',
|
|
382
|
+
componentChildClassName: [popupClass, K_POPUP],
|
|
383
|
+
className: className,
|
|
384
|
+
direction: direction,
|
|
385
|
+
transitionEnterDuration: transitionEnterDuration,
|
|
386
|
+
transitionExitDuration: transitionExitDuration,
|
|
387
|
+
appear: show
|
|
388
|
+
},
|
|
389
|
+
role: this.appendTo ? '' : 'region',
|
|
390
|
+
componentChildClassName: [popupClass, K_POPUP],
|
|
391
|
+
className: className,
|
|
392
|
+
onEntered: this.onOpened,
|
|
393
|
+
on: this.v3 ? undefined : {
|
|
394
|
+
"entered": this.onOpened,
|
|
395
|
+
"exiting": this.onClosing,
|
|
396
|
+
"exited": this.onClosed
|
|
397
|
+
},
|
|
398
|
+
onExiting: this.onClosing,
|
|
399
|
+
onExited: this.onClosed,
|
|
400
|
+
direction: direction,
|
|
401
|
+
style: {
|
|
402
|
+
zIndex: currentZIndex,
|
|
403
|
+
position: 'absolute',
|
|
404
|
+
top: this._offsetTop + 'px',
|
|
405
|
+
left: this._offsetLeft + 'px'
|
|
406
|
+
},
|
|
407
|
+
transitionEnterDuration: transitionEnterDuration,
|
|
408
|
+
transitionExitDuration: transitionExitDuration,
|
|
409
|
+
appear: show
|
|
410
|
+
}, this.v3 ? function () {
|
|
411
|
+
return [defaultSlot];
|
|
412
|
+
} : [defaultSlot]);
|
|
413
|
+
return popup;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return null;
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
/**
|
|
420
|
+
* @hidden
|
|
421
|
+
*/
|
|
422
|
+
|
|
423
|
+
var Popup = PopupVue2;
|
|
424
|
+
export { Popup, PopupVue2 };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import { DefineComponent } from 'vue';
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import * as Vue from 'vue';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
type Vue2type = Vue.default;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
export { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Popup, PopupVue2 } from './Popup';
|
|
2
|
+
import { PopupProps } from './models/PopupProps';
|
|
3
|
+
import { PopupSettings } from './models/PopupSettings';
|
|
4
|
+
import { Align } from './models/Align';
|
|
5
|
+
import { Collision } from './models/Collision';
|
|
6
|
+
import { Offset } from './models/Offset';
|
|
7
|
+
import { PopupAnimation } from './models/PopupAnimation';
|
|
8
|
+
import { OpenEvent as PopupOpenEvent, CloseEvent as PopupCloseEvent } from './models/Events';
|
|
9
|
+
export { Popup, PopupVue2, PopupProps, PopupSettings, Align, Collision, Offset, PopupAnimation, PopupOpenEvent, PopupCloseEvent };
|
package/dist/esm/main.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines the horizontal and vertical aligning point of the Popup.
|
|
3
|
+
*/
|
|
4
|
+
export interface Align {
|
|
5
|
+
/**
|
|
6
|
+
* Defines the possible horizontal point values that are relative to the anchor or the Popup.
|
|
7
|
+
*
|
|
8
|
+
* The available options are:
|
|
9
|
+
* - `left`—Uses the leftmost point of the anchor element.
|
|
10
|
+
* - `center`—Uses the center point of the anchor element.
|
|
11
|
+
* - `right`—Uses the rightmost point of the anchor element.
|
|
12
|
+
*/
|
|
13
|
+
horizontal: 'left' | 'center' | 'right';
|
|
14
|
+
/**
|
|
15
|
+
* Defines the possible vertical point values that are relative to the anchor or the Popup.
|
|
16
|
+
*
|
|
17
|
+
* The available options are:
|
|
18
|
+
* - `top`—Uses the top point of the anchor element.
|
|
19
|
+
* - `center`—Uses the center point of the anchor element.
|
|
20
|
+
* - `bottom`—Uses the bottom point of the anchor element.
|
|
21
|
+
*/
|
|
22
|
+
vertical: 'top' | 'center' | 'bottom';
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AlignStrategy, OffsetPosition } from '@progress/kendo-popup-common';
|
|
2
|
+
/**
|
|
3
|
+
* @hidden
|
|
4
|
+
*/
|
|
5
|
+
export interface AlignElementSettings {
|
|
6
|
+
anchor?: HTMLElement;
|
|
7
|
+
anchorAlign: AlignStrategy;
|
|
8
|
+
element: HTMLElement;
|
|
9
|
+
elementAlign: AlignStrategy;
|
|
10
|
+
offset?: OffsetPosition;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CollisionType } from './CollisionType';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the horizontal and vertical collision behavior of the Popup.
|
|
4
|
+
*/
|
|
5
|
+
export interface Collision {
|
|
6
|
+
/**
|
|
7
|
+
* Defines the horizontal collision behavior of the Popup.
|
|
8
|
+
*/
|
|
9
|
+
horizontal: CollisionType;
|
|
10
|
+
/**
|
|
11
|
+
* Defines the vertical collision behavior of the Popup.
|
|
12
|
+
*/
|
|
13
|
+
vertical: CollisionType;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines the possible collision behavior when the Popup is not fully visible.
|
|
3
|
+
*
|
|
4
|
+
* The available options are:
|
|
5
|
+
* - `fit`—Moves the Popup horizontally until it is fully displayed in the viewport.
|
|
6
|
+
* - `flip`—Flips the Popup position based on the origin and the position properties.
|
|
7
|
+
*/
|
|
8
|
+
export declare type CollisionType = 'fit' | 'flip';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the object of the `Open` Popup event.
|
|
3
|
+
*/
|
|
4
|
+
export interface OpenEvent {
|
|
5
|
+
/**
|
|
6
|
+
* An event target.
|
|
7
|
+
*/
|
|
8
|
+
target: any;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Represents the object of the `Close` Popup event.
|
|
12
|
+
*/
|
|
13
|
+
export interface CloseEvent {
|
|
14
|
+
/**
|
|
15
|
+
* An event target.
|
|
16
|
+
*/
|
|
17
|
+
target: any;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The animation settings for the Popup component.
|
|
3
|
+
*/
|
|
4
|
+
export interface PopupAnimation {
|
|
5
|
+
/**
|
|
6
|
+
* The duration of the opening animation in milliseconds. Defaults to `300ms`.
|
|
7
|
+
*/
|
|
8
|
+
openDuration?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The duration of the closing animation in milliseconds. Defaults to `300ms`.
|
|
11
|
+
*/
|
|
12
|
+
closeDuration?: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PopupSettings } from './PopupSettings';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the props of the [KendoVue Popup component]({% slug overview_popup %}).
|
|
4
|
+
*/
|
|
5
|
+
export interface PopupProps extends PopupSettings {
|
|
6
|
+
/**
|
|
7
|
+
* Controls the Popup visibility ([see example]({% slug hidden_popup %})). Defaults to `false`.
|
|
8
|
+
*/
|
|
9
|
+
show?: boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { OpenEvent, CloseEvent } from './Events';
|
|
2
|
+
import { Offset } from './Offset';
|
|
3
|
+
import { PopupAnimation } from './PopupAnimation';
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
export interface PopupSettings {
|
|
8
|
+
/**
|
|
9
|
+
* Controls the Popup animation ([see example]({% slug animations_popup %})). By default, the opening and closing animations are enabled.
|
|
10
|
+
*/
|
|
11
|
+
animate?: boolean | PopupAnimation;
|
|
12
|
+
/**
|
|
13
|
+
* Specifies the element which will be used as an anchor ([see example]({% slug alignmentpositioning_popup %})). The Popup opens next to that element.
|
|
14
|
+
*/
|
|
15
|
+
anchor: string;
|
|
16
|
+
/**
|
|
17
|
+
* Specifies the pivot point of the anchor ([see example]({% slug alignmentpositioning_popup %})).
|
|
18
|
+
*/
|
|
19
|
+
anchorAlign?: object;
|
|
20
|
+
/**
|
|
21
|
+
* Defines the container to which the Popup will be appended. Defaults to [`body`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body).
|
|
22
|
+
*/
|
|
23
|
+
appendTo?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Configures the collision behavior of the Popup ([see example]({% slug viewportboundarydetection_popup %})).
|
|
26
|
+
*/
|
|
27
|
+
collision?: object;
|
|
28
|
+
/**
|
|
29
|
+
* Specifies the pivot point of the Popup ([see example]({% slug alignmentpositioning_popup %})).
|
|
30
|
+
*/
|
|
31
|
+
popupAlign?: object;
|
|
32
|
+
/**
|
|
33
|
+
* Specifies a list of CSS classes that will be added to the Popup element.
|
|
34
|
+
*/
|
|
35
|
+
className?: string | Array<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Specifies the id that will be added to the Popup element.
|
|
38
|
+
*/
|
|
39
|
+
id?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Specifies the direction of the Expand Animation. Defaults to `down`.
|
|
42
|
+
*/
|
|
43
|
+
direction?: String;
|
|
44
|
+
/**
|
|
45
|
+
* Specifies the direction of the Expand Animation. Defaults to `expand`.
|
|
46
|
+
*/
|
|
47
|
+
transition?: String;
|
|
48
|
+
/**
|
|
49
|
+
* Specifies a list of CSS classes that will be added to the internal animated element ([see example]({% slug appearance_popup %})).
|
|
50
|
+
*/
|
|
51
|
+
popupClass?: string | Array<string>;
|
|
52
|
+
/**
|
|
53
|
+
* Represents the styles that are applied to the Popup.
|
|
54
|
+
*/
|
|
55
|
+
style?: any;
|
|
56
|
+
/**
|
|
57
|
+
* Specifies the absolute position of the element ([see example]({% slug alignmentpositioning_popup %})). The Popup opens next to that point. The pivot point of the Popup is defined by the `popupAlign` configuration option. The boundary detection is applied by using the window viewport.
|
|
58
|
+
*/
|
|
59
|
+
offset?: Offset;
|
|
60
|
+
/**
|
|
61
|
+
* Fires after the Popup is opened and the opening animation ends.
|
|
62
|
+
*/
|
|
63
|
+
onOpen?: (event: OpenEvent) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Fires after the Popup is closed.
|
|
66
|
+
*/
|
|
67
|
+
onClose?: (event: CloseEvent) => void;
|
|
68
|
+
}
|