flipper-ui 0.35.0 → 0.35.2
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/core/data-display/data-table/data-table-pagination-actions.js +5 -8
- package/core/data-display/password-visibility/index.js +3 -4
- package/core/feedback/snackbar/index.js +6 -10
- package/core/inputs/add-button/index.js +2 -2
- package/core/inputs/select/index.js +3 -3
- package/core/inputs/text-field/index.js +3 -4
- package/core/navigation/breadcrumbs/index.js +2 -2
- package/core/navigation/sidebar/index.js +2 -7
- package/core/surfaces/card/index.js +3 -5
- package/core/surfaces/expansion-panel/index.js +4 -6
- package/core/surfaces/panel/index.js +2 -2
- package/core/surfaces/step-card/step-card-details.js +3 -4
- package/core/surfaces/step-card/step-card-panel.js +3 -4
- package/icons/mui/index.d.ts +134 -0
- package/icons/mui/index.js +944 -0
- package/icons/specific/IconAET.d.ts +3 -0
- package/icons/specific/IconAET.js +28 -0
- package/icons/specific/IconASO.d.ts +3 -0
- package/icons/specific/IconASO.js +44 -0
- package/icons/specific/IconAccident.d.ts +3 -0
- package/icons/specific/IconAccident.js +43 -0
- package/icons/specific/IconActionPlans.d.ts +3 -0
- package/icons/specific/IconActionPlans.js +45 -0
- package/icons/specific/IconAddDocument.d.ts +3 -0
- package/icons/specific/IconAddDocument.js +31 -0
- package/icons/specific/IconAnwser.d.ts +3 -0
- package/icons/specific/IconAnwser.js +25 -0
- package/icons/specific/IconBillet.d.ts +3 -0
- package/icons/specific/IconBillet.js +61 -0
- package/icons/specific/IconBiometry.d.ts +3 -0
- package/icons/specific/IconBiometry.js +56 -0
- package/icons/specific/IconBranch.d.ts +3 -0
- package/icons/specific/IconBranch.js +37 -0
- package/icons/specific/IconBrigades.d.ts +3 -0
- package/icons/specific/IconBrigades.js +38 -0
- package/icons/specific/IconCalendarDay.d.ts +3 -0
- package/icons/specific/IconCalendarDay.js +47 -0
- package/icons/specific/IconCalendarMonth.d.ts +3 -0
- package/icons/specific/IconCalendarMonth.js +71 -0
- package/icons/specific/IconCalendarWeek.d.ts +3 -0
- package/icons/specific/IconCalendarWeek.js +47 -0
- package/icons/specific/IconCancelRounded.d.ts +3 -0
- package/icons/specific/IconCancelRounded.js +43 -0
- package/icons/specific/IconCards.d.ts +3 -0
- package/icons/specific/IconCards.js +26 -0
- package/icons/specific/IconChangeEquipment.d.ts +3 -0
- package/icons/specific/IconChangeEquipment.js +70 -0
- package/icons/specific/IconCircle.d.ts +3 -0
- package/icons/specific/IconCircle.js +36 -0
- package/icons/specific/IconCompany.d.ts +3 -0
- package/icons/specific/IconCompany.js +88 -0
- package/icons/specific/IconComponent.d.ts +3 -0
- package/icons/specific/IconComponent.js +27 -0
- package/icons/specific/IconConfirmRounded.d.ts +3 -0
- package/icons/specific/IconConfirmRounded.js +43 -0
- package/icons/specific/IconCostCenter.d.ts +3 -0
- package/icons/specific/IconCostCenter.js +29 -0
- package/icons/specific/IconDashboard.d.ts +3 -0
- package/icons/specific/IconDashboard.js +40 -0
- package/icons/specific/IconDistribution.d.ts +3 -0
- package/icons/specific/IconDistribution.js +37 -0
- package/icons/specific/IconDoctor.d.ts +3 -0
- package/icons/specific/IconDoctor.js +44 -0
- package/icons/specific/IconDoctorCalendar.d.ts +3 -0
- package/icons/specific/IconDoctorCalendar.js +36 -0
- package/icons/specific/IconDonator.d.ts +3 -0
- package/icons/specific/IconDonator.js +30 -0
- package/icons/specific/IconDoneChecked.d.ts +3 -0
- package/icons/specific/IconDoneChecked.js +25 -0
- package/icons/specific/IconDoneUnchecked.d.ts +3 -0
- package/icons/specific/IconDoneUnchecked.js +25 -0
- package/icons/specific/IconDownloadQRCode.d.ts +3 -0
- package/icons/specific/IconDownloadQRCode.js +48 -0
- package/icons/specific/IconESocial.d.ts +3 -0
- package/icons/specific/IconESocial.js +29 -0
- package/icons/specific/IconEmployee.d.ts +3 -0
- package/icons/specific/IconEmployee.js +39 -0
- package/icons/specific/IconEnvironmentalReports.d.ts +3 -0
- package/icons/specific/IconEnvironmentalReports.js +39 -0
- package/icons/specific/IconEquipment.d.ts +3 -0
- package/icons/specific/IconEquipment.js +26 -0
- package/icons/specific/IconErrorStroke.d.ts +3 -0
- package/icons/specific/IconErrorStroke.js +26 -0
- package/icons/specific/IconExtinguishingSystem.d.ts +3 -0
- package/icons/specific/IconExtinguishingSystem.js +26 -0
- package/icons/specific/IconFaceScan.d.ts +3 -0
- package/icons/specific/IconFaceScan.js +37 -0
- package/icons/specific/IconFemale.d.ts +3 -0
- package/icons/specific/IconFemale.js +27 -0
- package/icons/specific/IconFileInform.d.ts +3 -0
- package/icons/specific/IconFileInform.js +43 -0
- package/icons/specific/IconFluig.d.ts +3 -0
- package/icons/specific/IconFluig.js +25 -0
- package/icons/specific/IconFunil.d.ts +3 -0
- package/icons/specific/IconFunil.js +28 -0
- package/icons/specific/IconGeneral.d.ts +3 -0
- package/icons/specific/IconGeneral.js +31 -0
- package/icons/specific/IconGift.d.ts +3 -0
- package/icons/specific/IconGift.js +54 -0
- package/icons/specific/IconHealth.d.ts +3 -0
- package/icons/specific/IconHealth.js +61 -0
- package/icons/specific/IconHeight.d.ts +3 -0
- package/icons/specific/IconHeight.js +55 -0
- package/icons/specific/IconIMC.d.ts +3 -0
- package/icons/specific/IconIMC.js +37 -0
- package/icons/specific/IconIPE.d.ts +3 -0
- package/icons/specific/IconIPE.js +36 -0
- package/icons/specific/IconLTCAT.d.ts +3 -0
- package/icons/specific/IconLTCAT.js +28 -0
- package/icons/specific/IconLTP.d.ts +3 -0
- package/icons/specific/IconLTP.js +28 -0
- package/icons/specific/IconLocalization.d.ts +3 -0
- package/icons/specific/IconLocalization.js +44 -0
- package/icons/specific/IconMail.d.ts +3 -0
- package/icons/specific/IconMail.js +32 -0
- package/icons/specific/IconMale.d.ts +3 -0
- package/icons/specific/IconMale.js +24 -0
- package/icons/specific/IconMandates.d.ts +3 -0
- package/icons/specific/IconMandates.js +39 -0
- package/icons/specific/IconMap.d.ts +3 -0
- package/icons/specific/IconMap.js +40 -0
- package/icons/specific/IconMaterial.d.ts +3 -0
- package/icons/specific/IconMaterial.js +27 -0
- package/icons/specific/IconMedicalRecords.d.ts +3 -0
- package/icons/specific/IconMedicalRecords.js +38 -0
- package/icons/specific/IconMediumCompany.d.ts +3 -0
- package/icons/specific/IconMediumCompany.js +259 -0
- package/icons/specific/IconMegaCompany.d.ts +3 -0
- package/icons/specific/IconMegaCompany.js +139 -0
- package/icons/specific/IconMinimumCompany.d.ts +3 -0
- package/icons/specific/IconMinimumCompany.js +27 -0
- package/icons/specific/IconNickName.d.ts +3 -0
- package/icons/specific/IconNickName.js +51 -0
- package/icons/specific/IconOccupation.d.ts +3 -0
- package/icons/specific/IconOccupation.js +30 -0
- package/icons/specific/IconPAE.d.ts +3 -0
- package/icons/specific/IconPAE.js +28 -0
- package/icons/specific/IconPCMAT.d.ts +3 -0
- package/icons/specific/IconPCMAT.js +28 -0
- package/icons/specific/IconPCMSO.d.ts +3 -0
- package/icons/specific/IconPCMSO.js +28 -0
- package/icons/specific/IconPGR.d.ts +3 -0
- package/icons/specific/IconPGR.js +28 -0
- package/icons/specific/IconPGRTR.d.ts +3 -0
- package/icons/specific/IconPGRTR.js +28 -0
- package/icons/specific/IconPPR.d.ts +3 -0
- package/icons/specific/IconPPR.js +28 -0
- package/icons/specific/IconPPRA.d.ts +3 -0
- package/icons/specific/IconPPRA.js +28 -0
- package/icons/specific/IconQuestion.d.ts +3 -0
- package/icons/specific/IconQuestion.js +23 -0
- package/icons/specific/IconReturn.d.ts +3 -0
- package/icons/specific/IconReturn.js +36 -0
- package/icons/specific/IconRisks.d.ts +3 -0
- package/icons/specific/IconRisks.js +26 -0
- package/icons/specific/IconRotate.d.ts +3 -0
- package/icons/specific/IconRotate.js +39 -0
- package/icons/specific/IconScheduleDashboard.d.ts +3 -0
- package/icons/specific/IconScheduleDashboard.js +25 -0
- package/icons/specific/IconScheduleDashboardHour.d.ts +3 -0
- package/icons/specific/IconScheduleDashboardHour.js +46 -0
- package/icons/specific/IconScheduleHour.d.ts +3 -0
- package/icons/specific/IconScheduleHour.js +43 -0
- package/icons/specific/IconServiceOrder.d.ts +3 -0
- package/icons/specific/IconServiceOrder.js +29 -0
- package/icons/specific/IconServiceRequest.d.ts +3 -0
- package/icons/specific/IconServiceRequest.js +29 -0
- package/icons/specific/IconSmallCompany.d.ts +3 -0
- package/icons/specific/IconSmallCompany.js +27 -0
- package/icons/specific/IconSpeciality.d.ts +3 -0
- package/icons/specific/IconSpeciality.js +27 -0
- package/icons/specific/IconSuperCompany.d.ts +3 -0
- package/icons/specific/IconSuperCompany.js +91 -0
- package/icons/specific/IconSupplier.d.ts +3 -0
- package/icons/specific/IconSupplier.js +32 -0
- package/icons/specific/IconThirdParty.d.ts +3 -0
- package/icons/specific/IconThirdParty.js +44 -0
- package/icons/specific/IconTree.d.ts +3 -0
- package/icons/specific/IconTree.js +25 -0
- package/icons/specific/IconTriangleDown.d.ts +3 -0
- package/icons/specific/IconTriangleDown.js +26 -0
- package/icons/specific/IconTriangleUp.d.ts +3 -0
- package/icons/specific/IconTriangleUp.js +26 -0
- package/icons/specific/IconWarehouse.d.ts +3 -0
- package/icons/specific/IconWarehouse.js +195 -0
- package/icons/specific/IconWarningSpecific.d.ts +3 -0
- package/icons/specific/IconWarningSpecific.js +27 -0
- package/icons/specific/IconWeight.d.ts +3 -0
- package/icons/specific/IconWeight.js +24 -0
- package/icons/specific/IconWindows.d.ts +3 -0
- package/icons/specific/IconWindows.js +25 -0
- package/icons/specific/IconWorkPermission.d.ts +3 -0
- package/icons/specific/IconWorkPermission.js +28 -0
- package/icons/specific/IconYellowPending.d.ts +3 -0
- package/icons/specific/IconYellowPending.js +36 -0
- package/icons/specific/index.d.ts +90 -0
- package/icons/specific/index.js +635 -0
- package/icons/utils.d.ts +13 -0
- package/icons/utils.js +23 -0
- package/package.json +30 -29
- package/test/mocks/chip-field-mock.js +0 -26
- package/test/mocks/data-table-hidden-mock.js +0 -303
- package/test/mocks/data-table-mock.js +0 -324
- package/test/mocks/date-time-mock.js +0 -33
- package/test/mocks/mask-field.js +0 -33
- package/test/mocks/pin-input-mock.js +0 -61
- package/test/mocks/radio-group-mock.js +0 -32
- package/test/mocks/select-mock.js +0 -41
- package/test/mocks/snackbar-mock.js +0 -68
- package/test/mocks/step-card-mock.js +0 -39
- package/test/mocks/text-field-mock.js +0 -63
- package/test/mocks/text-field-options-mock.js +0 -37
- package/test/util.js +0 -113
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
13
|
-
var _textField = _interopRequireDefault(require("../../core/inputs/text-field"));
|
|
14
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
16
|
-
var LIST = [{
|
|
17
|
-
label: null,
|
|
18
|
-
value: ''
|
|
19
|
-
}, {
|
|
20
|
-
label: 'Elm',
|
|
21
|
-
value: 'elm'
|
|
22
|
-
}, {
|
|
23
|
-
label: 'ReasonML',
|
|
24
|
-
value: 'reasonml'
|
|
25
|
-
}, {
|
|
26
|
-
label: 'Purescript',
|
|
27
|
-
value: 'purescript'
|
|
28
|
-
}, {
|
|
29
|
-
label: 'Fable',
|
|
30
|
-
value: 'fable'
|
|
31
|
-
}];
|
|
32
|
-
var Default = function Default(_ref) {
|
|
33
|
-
var _inputProps$inputProp;
|
|
34
|
-
var inputProps = _ref.inputProps,
|
|
35
|
-
initialOption = _ref.initialOption,
|
|
36
|
-
characters = _ref.characters;
|
|
37
|
-
var _useState = (0, _react.useState)(initialOption ? initialOption : ''),
|
|
38
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
39
|
-
value = _useState2[0],
|
|
40
|
-
setValue = _useState2[1];
|
|
41
|
-
var handleChange = function handleChange(event) {
|
|
42
|
-
setValue(event.target.value);
|
|
43
|
-
};
|
|
44
|
-
var handleClear = function handleClear() {
|
|
45
|
-
setValue('');
|
|
46
|
-
};
|
|
47
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_textField["default"], (0, _extends2["default"])({
|
|
48
|
-
value: value,
|
|
49
|
-
characters: characters,
|
|
50
|
-
onChange: handleChange,
|
|
51
|
-
onClear: handleClear
|
|
52
|
-
}, inputProps), inputProps !== null && inputProps !== void 0 && inputProps.select ? LIST.map(function (_ref2) {
|
|
53
|
-
var label = _ref2.label,
|
|
54
|
-
value = _ref2.value;
|
|
55
|
-
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
56
|
-
key: value,
|
|
57
|
-
value: value
|
|
58
|
-
}, label);
|
|
59
|
-
}) : undefined), characters && /*#__PURE__*/_react["default"].createElement("span", {
|
|
60
|
-
"data-testid": "characters-counter"
|
|
61
|
-
}, value.toString().length, "/", inputProps === null || inputProps === void 0 || (_inputProps$inputProp = inputProps.inputProps) === null || _inputProps$inputProp === void 0 ? void 0 : _inputProps$inputProp.maxLength));
|
|
62
|
-
};
|
|
63
|
-
var _default = exports["default"] = Default;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _textField = _interopRequireDefault(require("../../core/inputs/text-field"));
|
|
13
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
15
|
-
var Default = function Default(_ref) {
|
|
16
|
-
var inputProps = _ref.inputProps,
|
|
17
|
-
initialOption = _ref.initialOption,
|
|
18
|
-
options = _ref.options;
|
|
19
|
-
var _useState = (0, _react.useState)(initialOption ? initialOption : ''),
|
|
20
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
21
|
-
value = _useState2[0],
|
|
22
|
-
setValue = _useState2[1];
|
|
23
|
-
var handleChange = function handleChange(event) {
|
|
24
|
-
setValue(event.target.value);
|
|
25
|
-
};
|
|
26
|
-
var handleClear = function handleClear() {
|
|
27
|
-
setValue('');
|
|
28
|
-
};
|
|
29
|
-
return /*#__PURE__*/_react["default"].createElement(_textField["default"], (0, _extends2["default"])({
|
|
30
|
-
value: value,
|
|
31
|
-
onChange: handleChange,
|
|
32
|
-
onClear: handleClear
|
|
33
|
-
}, inputProps, {
|
|
34
|
-
options: options
|
|
35
|
-
}));
|
|
36
|
-
};
|
|
37
|
-
var _default = exports["default"] = Default;
|
package/test/util.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = drag;
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
|
-
var _dom = require("@testing-library/dom");
|
|
12
|
-
function isElement(obj) {
|
|
13
|
-
if ((0, _typeof2["default"])(obj) !== 'object') {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
var prototypeStr, prototype;
|
|
17
|
-
do {
|
|
18
|
-
prototype = Object.getPrototypeOf(obj);
|
|
19
|
-
// to work in iframe
|
|
20
|
-
prototypeStr = Object.prototype.toString.call(prototype);
|
|
21
|
-
// '[object Document]' is used to detect document
|
|
22
|
-
if (prototypeStr === '[object Element]' || prototypeStr === '[object Document]') {
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
obj = prototype;
|
|
26
|
-
// null is the terminal of object
|
|
27
|
-
} while (prototype !== null);
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
function getElementClientCenter(element) {
|
|
31
|
-
var _element$getBoundingC = element.getBoundingClientRect(),
|
|
32
|
-
left = _element$getBoundingC.left,
|
|
33
|
-
top = _element$getBoundingC.top,
|
|
34
|
-
width = _element$getBoundingC.width,
|
|
35
|
-
height = _element$getBoundingC.height;
|
|
36
|
-
return {
|
|
37
|
-
x: left + width / 2,
|
|
38
|
-
y: top + height / 2
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
var getCoords = function getCoords(charlie) {
|
|
42
|
-
return isElement(charlie) ? getElementClientCenter(charlie) : charlie;
|
|
43
|
-
};
|
|
44
|
-
var sleep = function sleep(ms) {
|
|
45
|
-
return new Promise(function (resolve) {
|
|
46
|
-
setTimeout(resolve, ms);
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
function drag(_x) {
|
|
50
|
-
return _drag.apply(this, arguments);
|
|
51
|
-
}
|
|
52
|
-
function _drag() {
|
|
53
|
-
_drag = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(element) {
|
|
54
|
-
var _ref,
|
|
55
|
-
inTo,
|
|
56
|
-
delta,
|
|
57
|
-
_ref$steps,
|
|
58
|
-
steps,
|
|
59
|
-
_ref$duration,
|
|
60
|
-
duration,
|
|
61
|
-
from,
|
|
62
|
-
to,
|
|
63
|
-
step,
|
|
64
|
-
current,
|
|
65
|
-
i,
|
|
66
|
-
_args = arguments;
|
|
67
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
68
|
-
while (1) switch (_context.prev = _context.next) {
|
|
69
|
-
case 0:
|
|
70
|
-
_ref = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}, inTo = _ref.to, delta = _ref.delta, _ref$steps = _ref.steps, steps = _ref$steps === void 0 ? 20 : _ref$steps, _ref$duration = _ref.duration, duration = _ref$duration === void 0 ? 500 : _ref$duration;
|
|
71
|
-
from = getElementClientCenter(element);
|
|
72
|
-
to = delta ? {
|
|
73
|
-
x: from.x + delta.x,
|
|
74
|
-
y: from.y + delta.y
|
|
75
|
-
} : getCoords(inTo);
|
|
76
|
-
step = {
|
|
77
|
-
x: ((to === null || to === void 0 ? void 0 : to.x) || 0 - from.x) / steps,
|
|
78
|
-
y: ((to === null || to === void 0 ? void 0 : to.y) || 0 - from.y) / steps
|
|
79
|
-
};
|
|
80
|
-
current = {
|
|
81
|
-
clientX: from.x,
|
|
82
|
-
clientY: from.y
|
|
83
|
-
};
|
|
84
|
-
_dom.fireEvent.mouseEnter(element, current);
|
|
85
|
-
_dom.fireEvent.mouseOver(element, current);
|
|
86
|
-
_dom.fireEvent.mouseMove(element, current);
|
|
87
|
-
_dom.fireEvent.mouseDown(element, current);
|
|
88
|
-
i = 0;
|
|
89
|
-
case 10:
|
|
90
|
-
if (!(i < steps)) {
|
|
91
|
-
_context.next = 19;
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
current.clientX += step.x;
|
|
95
|
-
current.clientY += step.y;
|
|
96
|
-
_context.next = 15;
|
|
97
|
-
return sleep(duration / steps);
|
|
98
|
-
case 15:
|
|
99
|
-
_dom.fireEvent.mouseMove(element, current);
|
|
100
|
-
case 16:
|
|
101
|
-
i++;
|
|
102
|
-
_context.next = 10;
|
|
103
|
-
break;
|
|
104
|
-
case 19:
|
|
105
|
-
_dom.fireEvent.mouseUp(element, current);
|
|
106
|
-
case 20:
|
|
107
|
-
case "end":
|
|
108
|
-
return _context.stop();
|
|
109
|
-
}
|
|
110
|
-
}, _callee);
|
|
111
|
-
}));
|
|
112
|
-
return _drag.apply(this, arguments);
|
|
113
|
-
}
|