@progress/kendo-react-common 2.7.0-dev.201902260733 → 2.7.1
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-react-common.js +1 -1
- package/dist/es/Draggable.d.ts +52 -0
- package/dist/es/Draggable.js +75 -0
- package/dist/es/Draggable.js.map +1 -0
- package/dist/es/main.d.ts +2 -1
- package/dist/es/main.js +2 -1
- package/dist/es/main.js.map +1 -1
- package/dist/npm/Draggable.d.ts +52 -0
- package/dist/npm/Draggable.js +77 -0
- package/dist/npm/Draggable.js.map +1 -0
- package/dist/npm/main.d.ts +2 -1
- package/dist/npm/main.js +2 -0
- package/dist/npm/main.js.map +1 -1
- package/dist/systemjs/kendo-react-common.js +1 -1
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],t):"object"==typeof exports?exports.KendoReactCommon=t(require("react"),require("prop-types")):e.KendoReactCommon=t(e.React,e.PropTypes)}(window,function(e,t){return function(e){var t={};function n(
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],t):"object"==typeof exports?exports.KendoReactCommon=t(require("react"),require("prop-types")):e.KendoReactCommon=t(e.React,e.PropTypes)}(window,function(e,t){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.classNames=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.filter(function(e){return!0!==e&&!!e}).map(function(e){return Array.isArray(e)?t.classNames.apply(void 0,e):"object"==typeof e?Object.keys(e).map(function(t,n){return e[n]||e[t]&&t||null}).filter(function(e){return null!==e}).join(" "):e}).filter(function(e){return!!e}).join(" ")}},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.classNames=o.classNames;var r=n(4);t.guid=r.guid;var i=n(5);t.Keys=i.Keys;var u=n(6);t.noop=u.noop;var s=n(7);t.FormComponent=s.FormComponent;var c=n(8);t.FloatingLabel=c.default;var a=n(9);t.dispatchEvent=a.default;var l=n(10);t.isServerRendering=l.isServerRendering;var p=n(11);t.Draggable=p.Draggable},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.guid=function(){var e,t,n="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(n+="-"),n+=(12===e?4:16===e?3&t|8:t).toString(16);return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Keys={backspace:8,tab:9,enter:13,shift:16,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,delete:46}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.noop=function(){}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){return function(){}}();t.FormComponent=o},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),u=n(2),s=n(0),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={focused:!1},t.handleFocus=function(e){t.setState({focused:!0})},t.handleBlur=function(e){t.setState({focused:!1})},t}return r(t,e),t.prototype.render=function(){var e=this.props,t=e.label,n=e.id,o=e.className,r=e.value,u=e.placeholder,c=e.valid,a=e.style,l=s.classNames({"k-textbox-container":!0,"k-state-focused":this.state.focused,"k-state-empty":!(r||u),"k-state-invalid":!c&&void 0!==c},o);return i.createElement("span",{className:l,onFocus:this.handleFocus,onBlur:this.handleBlur,style:a},this.props.children,t?n?i.createElement("label",{htmlFor:n,className:"k-label"},t):i.createElement("span",{className:"k-label"},t):null)},t.propTypes={label:u.string,id:u.string,value:u.string,placeholder:u.string,valid:u.bool},t}(i.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,o){if(e){var r={syntheticEvent:t,nativeEvent:t.nativeEvent,target:n};e.call(void 0,Object.assign(r,o))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.isServerRendering=function(){return"undefined"==typeof window}},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),u=n(2),s=n(12),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=null,t.draggable=new s.default({press:function(e){t.element&&t.props.onPress&&t.props.onPress.call(void 0,{target:t,event:e,element:t.element})},drag:function(e){t.element&&t.props.onDrag&&t.props.onDrag.call(void 0,{target:t,event:e,element:t.element})},release:function(e){t.element&&t.props.onRelease&&t.props.onRelease.call(void 0,{target:t,event:e})}}),t}return r(t,e),t.prototype.componentDidMount=function(){this.element&&this.draggable.bindTo(this.element)},t.prototype.componentWillUnmount=function(){this.draggable.destroy()},t.prototype.render=function(){var e=this;return i.cloneElement(i.Children.only(this.props.children),{ref:function(t){return e.element=t}})},t.propTypes={children:u.element.isRequired},t}(i.PureComponent);t.Draggable=c},function(e,t,n){"use strict";n.r(t),n.d(t,"Draggable",function(){return l});var o=function(e,t){return function(n){return t(e(n))}},r=function(e,t,n){return e.addEventListener&&e.addEventListener(t,n)},i=function(e,t,n){return e.removeEventListener&&e.removeEventListener(t,n)},u=function(){},s=function(e){return e.preventDefault()},c=/touch/;function a(e){return e.type.match(c)?{pageX:e.changedTouches[0].pageX,pageY:e.changedTouches[0].pageY,clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY,type:e.type,originalEvent:e,isTouch:!0}:{pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY,offsetX:e.offsetX,offsetY:e.offsetY,type:e.type,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,originalEvent:e}}var l=function(e){var t=this,n=e.press;void 0===n&&(n=u);var c=e.drag;void 0===c&&(c=u);var l=e.release;void 0===l&&(l=u);var p=e.mouseOnly;void 0===p&&(p=!1),this._pressHandler=o(a,n),this._dragHandler=o(a,c),this._releaseHandler=o(a,l),this._ignoreMouse=!1,this._mouseOnly=p,this._touchAction,this._touchstart=function(e){1===e.touches.length&&t._pressHandler(e)},this._touchmove=function(e){1===e.touches.length&&t._dragHandler(e)},this._touchend=function(e){0===e.touches.length&&1===e.changedTouches.length&&(t._releaseHandler(e),t._ignoreMouse=!0,setTimeout(t._restoreMouse,2e3))},this._restoreMouse=function(){t._ignoreMouse=!1},this._mousedown=function(e){var n=e.which;n&&n>1||t._ignoreMouse||(r(document,"mousemove",t._mousemove),r(document,"mouseup",t._mouseup),t._pressHandler(e))},this._mousemove=function(e){t._dragHandler(e)},this._mouseup=function(e){i(document,"mousemove",t._mousemove),i(document,"mouseup",t._mouseup),t._releaseHandler(e)},this._pointerdown=function(e){e.isPrimary&&0===e.button&&(r(t._element,"pointermove",t._pointermove),r(t._element,"pointerup",t._pointerup),r(t._element,"contextmenu",s),t._touchAction=e.target.style.touchAction,e.target.style.touchAction="none",e.target.setPointerCapture(e.pointerId),t._pressHandler(e))},this._pointermove=function(e){e.isPrimary&&t._dragHandler(e)},this._pointerup=function(e){e.isPrimary&&(i(t._element,"pointermove",t._pointermove),i(t._element,"pointerup",t._pointerup),i(t._element,"contextmenu",s),e.target.style.touchAction=t._touchAction,e.target.releasePointerCapture(e.pointerId),t._releaseHandler(e))}};l.supportPointerEvent=function(){return"undefined"!=typeof window&&window.PointerEvent},l.prototype.bindTo=function(e){e!==this._element&&(this._element&&this._unbindFromCurrent(),this._element=e,this._bindToCurrent())},l.prototype._bindToCurrent=function(){var e=this._element;this._usePointers()?r(e,"pointerdown",this._pointerdown):(r(e,"mousedown",this._mousedown),this._mouseOnly||(r(e,"touchstart",this._touchstart),r(e,"touchmove",this._touchmove),r(e,"touchend",this._touchend)))},l.prototype._unbindFromCurrent=function(){var e=this._element;if(this._usePointers())return i(e,"pointerdown",this._pointerdown),i(e,"pointermove",this._pointermove),void i(e,"pointerup",this._pointerup);i(e,"mousedown",this._mousedown),this._mouseOnly||(i(e,"touchstart",this._touchstart),i(e,"touchmove",this._touchmove),i(e,"touchend",this._touchend))},l.prototype._usePointers=function(){return!this._mouseOnly&&l.supportPointerEvent()},l.prototype.destroy=function(){this._unbindFromCurrent(),this._element=null},l.default=l,t.default=l}])});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PropTypes from 'prop-types';
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
export interface BaseDraggableEvent<T extends React.Component> {
|
|
7
|
+
target: T;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export interface DraggablePressEvent extends BaseDraggableEvent<Draggable> {
|
|
13
|
+
event: any;
|
|
14
|
+
element: HTMLElement;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export interface DraggableDragEvent extends BaseDraggableEvent<Draggable> {
|
|
20
|
+
event: any;
|
|
21
|
+
element: HTMLElement;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
export interface DraggableReleaseEvent extends BaseDraggableEvent<Draggable> {
|
|
27
|
+
event: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export interface DraggableProps {
|
|
33
|
+
onPress?: (event: DraggablePressEvent) => void;
|
|
34
|
+
onDrag?: (event: DraggableDragEvent) => void;
|
|
35
|
+
onRelease?: (event: DraggableReleaseEvent) => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
export declare class Draggable extends React.PureComponent<DraggableProps, {}> {
|
|
41
|
+
static propTypes: {
|
|
42
|
+
children: PropTypes.Validator<any>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @hidden
|
|
46
|
+
*/
|
|
47
|
+
element: HTMLElement | null;
|
|
48
|
+
private draggable;
|
|
49
|
+
componentDidMount(): void;
|
|
50
|
+
componentWillUnmount(): void;
|
|
51
|
+
render(): React.ReactElement<any>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = Object.setPrototypeOf ||
|
|
3
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
4
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
5
|
+
return function (d, b) {
|
|
6
|
+
extendStatics(d, b);
|
|
7
|
+
function __() { this.constructor = d; }
|
|
8
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
import * as PropTypes from 'prop-types';
|
|
13
|
+
import KendoDraggable from '@telerik/kendo-draggable';
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
var Draggable = /** @class */ (function (_super) {
|
|
18
|
+
__extends(Draggable, _super);
|
|
19
|
+
function Draggable() {
|
|
20
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
_this.element = null;
|
|
25
|
+
_this.draggable = new KendoDraggable({
|
|
26
|
+
press: function (event) {
|
|
27
|
+
if (_this.element && _this.props.onPress) {
|
|
28
|
+
_this.props.onPress.call(undefined, {
|
|
29
|
+
target: _this,
|
|
30
|
+
event: event,
|
|
31
|
+
element: _this.element
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
drag: function (event) {
|
|
36
|
+
if (_this.element && _this.props.onDrag) {
|
|
37
|
+
_this.props.onDrag.call(undefined, {
|
|
38
|
+
target: _this,
|
|
39
|
+
event: event,
|
|
40
|
+
element: _this.element
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
release: function (event) {
|
|
45
|
+
if (_this.element && _this.props.onRelease) {
|
|
46
|
+
_this.props.onRelease.call(undefined, {
|
|
47
|
+
target: _this,
|
|
48
|
+
event: event
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return _this;
|
|
54
|
+
}
|
|
55
|
+
Draggable.prototype.componentDidMount = function () {
|
|
56
|
+
if (this.element) {
|
|
57
|
+
this.draggable.bindTo(this.element);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
Draggable.prototype.componentWillUnmount = function () {
|
|
61
|
+
this.draggable.destroy();
|
|
62
|
+
};
|
|
63
|
+
Draggable.prototype.render = function () {
|
|
64
|
+
var _this = this;
|
|
65
|
+
return (React.cloneElement(React.Children.only(this.props.children), {
|
|
66
|
+
ref: function (element) { return _this.element = element; }
|
|
67
|
+
}));
|
|
68
|
+
};
|
|
69
|
+
Draggable.propTypes = {
|
|
70
|
+
children: PropTypes.element.isRequired
|
|
71
|
+
};
|
|
72
|
+
return Draggable;
|
|
73
|
+
}(React.PureComponent));
|
|
74
|
+
export { Draggable };
|
|
75
|
+
//# sourceMappingURL=Draggable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Draggable.js","sourceRoot":"","sources":["../../src/Draggable.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAExC,OAAO,cAAc,MAAM,0BAA0B,CAAC;AAyCtD;;GAEG;AACH;IAA+B,6BAAuC;IAAtE;QAAA,qEAsDC;QAjDG;;WAEG;QACI,aAAO,GAAuB,IAAI,CAAC;QAClC,eAAS,GAAG,IAAI,cAAc,CAAC;YACnC,KAAK,EAAE,UAAC,KAAK;gBACT,IAAI,KAAI,CAAC,OAAO,IAAI,KAAI,CAAC,KAAK,CAAC,OAAO,EAAE;oBACpC,KAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE;wBAC/B,MAAM,EAAE,KAAI;wBACZ,KAAK,OAAA;wBACL,OAAO,EAAE,KAAI,CAAC,OAAO;qBACxB,CAAC,CAAC;iBACN;YACL,CAAC;YACD,IAAI,EAAE,UAAC,KAAK;gBACR,IAAI,KAAI,CAAC,OAAO,IAAI,KAAI,CAAC,KAAK,CAAC,MAAM,EAAE;oBACnC,KAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE;wBAC9B,MAAM,EAAE,KAAI;wBACZ,KAAK,OAAA;wBACL,OAAO,EAAE,KAAI,CAAC,OAAO;qBACxB,CAAC,CAAC;iBACN;YACL,CAAC;YACD,OAAO,EAAE,UAAC,KAAK;gBACX,IAAI,KAAI,CAAC,OAAO,IAAI,KAAI,CAAC,KAAK,CAAC,SAAS,EAAE;oBACtC,KAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE;wBACjC,MAAM,EAAE,KAAI;wBACZ,KAAK,OAAA;qBACR,CAAC,CAAC;iBACN;YACL,CAAC;SACJ,CAAC,CAAC;;IAkBP,CAAC;IAhBG,qCAAiB,GAAjB;QACI,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACvC;IACL,CAAC;IAED,wCAAoB,GAApB;QACI,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,0BAAM,GAAN;QAAA,iBAIC;QAHG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;YACjE,GAAG,EAAE,UAAA,OAAO,IAAI,OAAA,KAAI,CAAC,OAAO,GAAG,OAAO,EAAtB,CAAsB;SACzC,CAAC,CAAC,CAAC;IACR,CAAC;IAnDM,mBAAS,GAAG;QACf,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,UAAU;KACzC,CAAC;IAmDN,gBAAC;CAAA,AAtDD,CAA+B,KAAK,CAAC,aAAa,GAsDjD;SAtDY,SAAS"}
|
package/dist/es/main.d.ts
CHANGED
|
@@ -7,4 +7,5 @@ import FloatingLabel from './FloatingLabel';
|
|
|
7
7
|
import { BaseEvent } from './events/BaseEvent';
|
|
8
8
|
import dispatchEvent from './events/dispatchEvent';
|
|
9
9
|
import { isServerRendering } from './serverRendering';
|
|
10
|
-
|
|
10
|
+
import { Draggable, DraggablePressEvent, DraggableDragEvent, DraggableReleaseEvent } from './Draggable';
|
|
11
|
+
export { classNames, guid, Keys, noop, FloatingLabel, FormComponent, FormComponentProps, FormComponentValidity, BaseEvent, dispatchEvent, isServerRendering, Draggable, DraggablePressEvent, DraggableDragEvent, DraggableReleaseEvent };
|
package/dist/es/main.js
CHANGED
|
@@ -6,5 +6,6 @@ import { FormComponent } from './FormComponent';
|
|
|
6
6
|
import FloatingLabel from './FloatingLabel';
|
|
7
7
|
import dispatchEvent from './events/dispatchEvent';
|
|
8
8
|
import { isServerRendering } from './serverRendering';
|
|
9
|
-
|
|
9
|
+
import { Draggable } from './Draggable';
|
|
10
|
+
export { classNames, guid, Keys, noop, FloatingLabel, FormComponent, dispatchEvent, isServerRendering, Draggable };
|
|
10
11
|
//# sourceMappingURL=main.js.map
|
package/dist/es/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,aAAa,EAA6C,MAAM,iBAAiB,CAAC;AAC3F,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,aAAa,EAA6C,MAAM,iBAAiB,CAAC;AAC3F,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAkE,MAAM,aAAa,CAAC;AAExG,OAAO,EACH,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,aAAa,EAIb,aAAa,EACb,iBAAiB,EACjB,SAAS,EAIZ,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PropTypes from 'prop-types';
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
export interface BaseDraggableEvent<T extends React.Component> {
|
|
7
|
+
target: T;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export interface DraggablePressEvent extends BaseDraggableEvent<Draggable> {
|
|
13
|
+
event: any;
|
|
14
|
+
element: HTMLElement;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export interface DraggableDragEvent extends BaseDraggableEvent<Draggable> {
|
|
20
|
+
event: any;
|
|
21
|
+
element: HTMLElement;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
export interface DraggableReleaseEvent extends BaseDraggableEvent<Draggable> {
|
|
27
|
+
event: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export interface DraggableProps {
|
|
33
|
+
onPress?: (event: DraggablePressEvent) => void;
|
|
34
|
+
onDrag?: (event: DraggableDragEvent) => void;
|
|
35
|
+
onRelease?: (event: DraggableReleaseEvent) => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
export declare class Draggable extends React.PureComponent<DraggableProps, {}> {
|
|
41
|
+
static propTypes: {
|
|
42
|
+
children: PropTypes.Validator<any>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @hidden
|
|
46
|
+
*/
|
|
47
|
+
element: HTMLElement | null;
|
|
48
|
+
private draggable;
|
|
49
|
+
componentDidMount(): void;
|
|
50
|
+
componentWillUnmount(): void;
|
|
51
|
+
render(): React.ReactElement<any>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return function (d, b) {
|
|
7
|
+
extendStatics(d, b);
|
|
8
|
+
function __() { this.constructor = d; }
|
|
9
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
var React = require("react");
|
|
14
|
+
var PropTypes = require("prop-types");
|
|
15
|
+
var kendo_draggable_1 = require("@telerik/kendo-draggable");
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
var Draggable = /** @class */ (function (_super) {
|
|
20
|
+
__extends(Draggable, _super);
|
|
21
|
+
function Draggable() {
|
|
22
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
+
/**
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
_this.element = null;
|
|
27
|
+
_this.draggable = new kendo_draggable_1.default({
|
|
28
|
+
press: function (event) {
|
|
29
|
+
if (_this.element && _this.props.onPress) {
|
|
30
|
+
_this.props.onPress.call(undefined, {
|
|
31
|
+
target: _this,
|
|
32
|
+
event: event,
|
|
33
|
+
element: _this.element
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
drag: function (event) {
|
|
38
|
+
if (_this.element && _this.props.onDrag) {
|
|
39
|
+
_this.props.onDrag.call(undefined, {
|
|
40
|
+
target: _this,
|
|
41
|
+
event: event,
|
|
42
|
+
element: _this.element
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
release: function (event) {
|
|
47
|
+
if (_this.element && _this.props.onRelease) {
|
|
48
|
+
_this.props.onRelease.call(undefined, {
|
|
49
|
+
target: _this,
|
|
50
|
+
event: event
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return _this;
|
|
56
|
+
}
|
|
57
|
+
Draggable.prototype.componentDidMount = function () {
|
|
58
|
+
if (this.element) {
|
|
59
|
+
this.draggable.bindTo(this.element);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
Draggable.prototype.componentWillUnmount = function () {
|
|
63
|
+
this.draggable.destroy();
|
|
64
|
+
};
|
|
65
|
+
Draggable.prototype.render = function () {
|
|
66
|
+
var _this = this;
|
|
67
|
+
return (React.cloneElement(React.Children.only(this.props.children), {
|
|
68
|
+
ref: function (element) { return _this.element = element; }
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
71
|
+
Draggable.propTypes = {
|
|
72
|
+
children: PropTypes.element.isRequired
|
|
73
|
+
};
|
|
74
|
+
return Draggable;
|
|
75
|
+
}(React.PureComponent));
|
|
76
|
+
exports.Draggable = Draggable;
|
|
77
|
+
//# sourceMappingURL=Draggable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Draggable.js","sourceRoot":"","sources":["../../src/Draggable.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAA+B;AAC/B,sCAAwC;AAExC,4DAAsD;AAyCtD;;GAEG;AACH;IAA+B,6BAAuC;IAAtE;QAAA,qEAsDC;QAjDG;;WAEG;QACI,aAAO,GAAuB,IAAI,CAAC;QAClC,eAAS,GAAG,IAAI,yBAAc,CAAC;YACnC,KAAK,EAAE,UAAC,KAAK;gBACT,IAAI,KAAI,CAAC,OAAO,IAAI,KAAI,CAAC,KAAK,CAAC,OAAO,EAAE;oBACpC,KAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE;wBAC/B,MAAM,EAAE,KAAI;wBACZ,KAAK,OAAA;wBACL,OAAO,EAAE,KAAI,CAAC,OAAO;qBACxB,CAAC,CAAC;iBACN;YACL,CAAC;YACD,IAAI,EAAE,UAAC,KAAK;gBACR,IAAI,KAAI,CAAC,OAAO,IAAI,KAAI,CAAC,KAAK,CAAC,MAAM,EAAE;oBACnC,KAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE;wBAC9B,MAAM,EAAE,KAAI;wBACZ,KAAK,OAAA;wBACL,OAAO,EAAE,KAAI,CAAC,OAAO;qBACxB,CAAC,CAAC;iBACN;YACL,CAAC;YACD,OAAO,EAAE,UAAC,KAAK;gBACX,IAAI,KAAI,CAAC,OAAO,IAAI,KAAI,CAAC,KAAK,CAAC,SAAS,EAAE;oBACtC,KAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE;wBACjC,MAAM,EAAE,KAAI;wBACZ,KAAK,OAAA;qBACR,CAAC,CAAC;iBACN;YACL,CAAC;SACJ,CAAC,CAAC;;IAkBP,CAAC;IAhBG,qCAAiB,GAAjB;QACI,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACvC;IACL,CAAC;IAED,wCAAoB,GAApB;QACI,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,0BAAM,GAAN;QAAA,iBAIC;QAHG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;YACjE,GAAG,EAAE,UAAA,OAAO,IAAI,OAAA,KAAI,CAAC,OAAO,GAAG,OAAO,EAAtB,CAAsB;SACzC,CAAC,CAAC,CAAC;IACR,CAAC;IAnDM,mBAAS,GAAG;QACf,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,UAAU;KACzC,CAAC;IAmDN,gBAAC;CAAA,AAtDD,CAA+B,KAAK,CAAC,aAAa,GAsDjD;AAtDY,8BAAS"}
|
package/dist/npm/main.d.ts
CHANGED
|
@@ -7,4 +7,5 @@ import FloatingLabel from './FloatingLabel';
|
|
|
7
7
|
import { BaseEvent } from './events/BaseEvent';
|
|
8
8
|
import dispatchEvent from './events/dispatchEvent';
|
|
9
9
|
import { isServerRendering } from './serverRendering';
|
|
10
|
-
|
|
10
|
+
import { Draggable, DraggablePressEvent, DraggableDragEvent, DraggableReleaseEvent } from './Draggable';
|
|
11
|
+
export { classNames, guid, Keys, noop, FloatingLabel, FormComponent, FormComponentProps, FormComponentValidity, BaseEvent, dispatchEvent, isServerRendering, Draggable, DraggablePressEvent, DraggableDragEvent, DraggableReleaseEvent };
|
package/dist/npm/main.js
CHANGED
|
@@ -16,4 +16,6 @@ var dispatchEvent_1 = require("./events/dispatchEvent");
|
|
|
16
16
|
exports.dispatchEvent = dispatchEvent_1.default;
|
|
17
17
|
var serverRendering_1 = require("./serverRendering");
|
|
18
18
|
exports.isServerRendering = serverRendering_1.isServerRendering;
|
|
19
|
+
var Draggable_1 = require("./Draggable");
|
|
20
|
+
exports.Draggable = Draggable_1.Draggable;
|
|
19
21
|
//# sourceMappingURL=main.js.map
|
package/dist/npm/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;AAAA,2CAA0C;
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;AAAA,2CAA0C;AAYtC,qBAZK,uBAAU,CAYL;AAXd,+BAA8B;AAY1B,eAZK,WAAI,CAYL;AAXR,+BAA8B;AAY1B,eAZK,WAAI,CAYL;AAXR,+BAA8B;AAY1B,eAZK,WAAI,CAYL;AAXR,iDAA2F;AAavF,wBAbK,6BAAa,CAaL;AAZjB,iDAA4C;AAWxC,wBAXG,uBAAa,CAWH;AATjB,wDAAmD;AAc/C,wBAdG,uBAAa,CAcH;AAbjB,qDAAsD;AAclD,4BAdK,mCAAiB,CAcL;AAbrB,yCAAwG;AAcpG,oBAdK,qBAAS,CAcL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register("@progress/kendo-react-common",["react","prop-types"],function(
|
|
1
|
+
System.register("@progress/kendo-react-common",["@telerik/kendo-draggable","react","prop-types"],function(p){var n,r,o;function t(e){return e.__useDefault?e.default:e}return{setters:[function(e){n=t(e)},function(e){r=t(e)},function(e){o=t(e)}],execute:function(){!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=3)}([function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.classNames=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return!0!==e&&!!e}).map(function(n){return Array.isArray(n)?r.classNames.apply(void 0,n):"object"==typeof n?Object.keys(n).map(function(e,t){return n[t]||n[e]&&e||null}).filter(function(e){return null!==e}).join(" "):n}).filter(function(e){return!!e}).join(" ")}},function(e,t){e.exports=r},function(e,t){e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.classNames=r.classNames;var o=n(4);t.guid=o.guid;var i=n(5);t.Keys=i.Keys;var u=n(6);t.noop=u.noop;var a=n(7);t.FormComponent=a.FormComponent;var s=n(8);t.FloatingLabel=s.default;var l=n(9);t.dispatchEvent=l.default;var c=n(10);t.isServerRendering=c.isServerRendering;var f=n(11);t.Draggable=f.Draggable,function(e){for(var t in e)p(t,e[t])}(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.guid=function(){var e,t,n="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(n+="-"),n+=(12===e?4:16===e?3&t|8:t).toString(16);return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Keys={backspace:8,tab:9,enter:13,shift:16,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,delete:46}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=function(){}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){};t.FormComponent=r},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var l=n(1),i=n(2),c=n(0),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={focused:!1},t.handleFocus=function(e){t.setState({focused:!0})},t.handleBlur=function(e){t.setState({focused:!1})},t}return o(t,e),t.prototype.render=function(){var e=this.props,t=e.label,n=e.id,r=e.className,o=e.value,i=e.placeholder,u=e.valid,a=e.style,s=c.classNames({"k-textbox-container":!0,"k-state-focused":this.state.focused,"k-state-empty":!(o||i),"k-state-invalid":!u&&void 0!==u},r);return l.createElement("span",{className:s,onFocus:this.handleFocus,onBlur:this.handleBlur,style:a},this.props.children,t?n?l.createElement("label",{htmlFor:n,className:"k-label"},t):l.createElement("span",{className:"k-label"},t):null)},t.propTypes={label:i.string,id:i.string,value:i.string,placeholder:i.string,valid:i.bool},t}(l.Component);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r){if(e){var o={syntheticEvent:t,nativeEvent:t.nativeEvent,target:n};e.call(void 0,Object.assign(o,r))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isServerRendering=function(){return"undefined"==typeof window}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),u=n(2),a=n(12),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=null,t.draggable=new a.default({press:function(e){t.element&&t.props.onPress&&t.props.onPress.call(void 0,{target:t,event:e,element:t.element})},drag:function(e){t.element&&t.props.onDrag&&t.props.onDrag.call(void 0,{target:t,event:e,element:t.element})},release:function(e){t.element&&t.props.onRelease&&t.props.onRelease.call(void 0,{target:t,event:e})}}),t}return o(t,e),t.prototype.componentDidMount=function(){this.element&&this.draggable.bindTo(this.element)},t.prototype.componentWillUnmount=function(){this.draggable.destroy()},t.prototype.render=function(){var t=this;return i.cloneElement(i.Children.only(this.props.children),{ref:function(e){return t.element=e}})},t.propTypes={children:u.element.isRequired},t}(i.PureComponent);t.Draggable=s},function(e,t){e.exports=n}])}}});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-common",
|
|
3
3
|
"description": "KendoReact Common Utilities package",
|
|
4
|
-
"version": "2.7.
|
|
4
|
+
"version": "2.7.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/telerik/kendo-react.git"
|
|
@@ -27,10 +27,11 @@
|
|
|
27
27
|
"framework": "KendoReact"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"react": "^16.
|
|
31
|
-
"react-dom": "^16.
|
|
30
|
+
"react": "^16.8.2",
|
|
31
|
+
"react-dom": "^16.8.2"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
+
"@telerik/kendo-draggable": "1.9.0",
|
|
34
35
|
"prop-types": "^15.6.0"
|
|
35
36
|
},
|
|
36
37
|
"author": "Progress",
|