@zohodesk/components 1.0.0-alpha-263 → 1.0.0-alpha-264
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/README.md +5 -0
- package/css_error.log +1 -0
- package/es/DropBox/DropBox.js +69 -243
- package/es/DropBox/DropBoxElement/DropBoxElement.js +118 -0
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +432 -0
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +89 -0
- package/es/DropBox/DropBoxElement/props/defaultProps.js +18 -0
- package/es/DropBox/DropBoxElement/props/propTypes.js +45 -0
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +51 -0
- package/es/DropBox/css/DropBox.module.css +59 -0
- package/es/DropBox/css/cssJSLogic.js +14 -0
- package/es/DropBox/props/defaultProps.js +9 -17
- package/es/DropBox/props/propTypes.js +9 -43
- package/es/css.js +2 -1
- package/es/utils/css/mergeStyle.js +2 -1
- package/lib/DropBox/DropBox.js +67 -276
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +117 -0
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +432 -0
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +72 -0
- package/lib/DropBox/DropBoxElement/props/defaultProps.js +25 -0
- package/lib/DropBox/DropBoxElement/props/propTypes.js +53 -0
- package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +55 -0
- package/lib/DropBox/css/DropBox.module.css +59 -0
- package/lib/DropBox/css/cssJSLogic.js +18 -0
- package/lib/DropBox/props/defaultProps.js +15 -19
- package/lib/DropBox/props/propTypes.js +15 -45
- package/lib/css.js +2 -1
- package/lib/utils/css/mergeStyle.js +2 -1
- package/package.json +1 -1
- package/docs/external/active-line.js +0 -72
- package/docs/external/autorefresh.js +0 -47
- package/docs/external/codemirror.js +0 -9681
- package/docs/external/css/hopscotch.css +0 -576
- package/docs/external/css/styleGuide.css +0 -1100
- package/docs/external/css.js +0 -466
- package/docs/external/designTokens.js +0 -1
- package/docs/external/foldcode.js +0 -152
- package/docs/external/format.js +0 -129
- package/docs/external/htmlmixed.js +0 -84
- package/docs/external/images/bottom.png +0 -0
- package/docs/external/images/bottombg.jpg +0 -0
- package/docs/external/images/desk.png +0 -0
- package/docs/external/images/desklogo.png +0 -0
- package/docs/external/images/menu.png +0 -0
- package/docs/external/index.html +0 -127
- package/docs/external/javascript.js +0 -422
- package/docs/external/jsx.js +0 -148
- package/docs/external/matchbrackets.js +0 -145
- package/docs/external/xml.js +0 -322
- package/docs/package.json +0 -41
- package/docs/src/index.js +0 -1311
- package/es/DropBox/DropBox.module.css +0 -405
- package/lib/DropBox/DropBox.module.css +0 -405
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = cssJSLogic;
|
|
7
|
+
var _ZindexProvider = require("../../Provider/ZindexProvider");
|
|
8
|
+
function cssJSLogic(props) {
|
|
9
|
+
var isActive = props.isActive,
|
|
10
|
+
needAutoZindex = props.needAutoZindex;
|
|
11
|
+
var zIndex = (0, _ZindexProvider.useZIndex)();
|
|
12
|
+
var zIndexStyle = isActive && needAutoZindex ? {
|
|
13
|
+
zIndex: zIndex()
|
|
14
|
+
} : {};
|
|
15
|
+
return {
|
|
16
|
+
zIndexStyle: zIndexStyle
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -3,27 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.defaultProps = void 0;
|
|
6
|
+
exports.defaultProps = exports.DropBoxDefaultProps = void 0;
|
|
7
|
+
var _defaultProps = require("../DropBoxElement/props/defaultProps");
|
|
8
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
9
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
14
|
var defaultProps = {
|
|
8
|
-
animationStyle: 'default',
|
|
9
|
-
boxPosition: 'bottomLeft',
|
|
10
|
-
dataId: 'dropBox',
|
|
11
|
-
dataSelectorId: 'dropBox',
|
|
12
|
-
isActive: false,
|
|
13
|
-
isAnimate: false,
|
|
14
|
-
isArrow: true,
|
|
15
|
-
isRadius: true,
|
|
16
|
-
size: 'default',
|
|
17
15
|
needResponsive: true,
|
|
18
|
-
isAbsolutePositioningNeeded: true,
|
|
19
|
-
isBoxPaddingNeed: false,
|
|
20
|
-
isPadding: true,
|
|
21
|
-
customClass: {},
|
|
22
|
-
a11y: {},
|
|
23
|
-
palette: 'default',
|
|
24
|
-
needAutoZindex: true,
|
|
25
16
|
portalId: 'portal1',
|
|
17
|
+
isActive: false,
|
|
18
|
+
isAbsolutePositioningNeeded: true,
|
|
26
19
|
isRestrictScroll: false,
|
|
27
|
-
needFocusScope: false
|
|
20
|
+
needFocusScope: false,
|
|
21
|
+
needAutoZindex: true
|
|
28
22
|
};
|
|
29
|
-
exports.defaultProps = defaultProps;
|
|
23
|
+
exports.defaultProps = defaultProps;
|
|
24
|
+
var DropBoxDefaultProps = _objectSpread(_objectSpread({}, _defaultProps.DropBoxElementDefaultProps), defaultProps);
|
|
25
|
+
exports.DropBoxDefaultProps = DropBoxDefaultProps;
|
|
@@ -3,55 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.propTypes = void 0;
|
|
6
|
+
exports.propTypes = exports.DropBoxPropTypes = void 0;
|
|
7
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _propTypes2 = require("../DropBoxElement/props/propTypes");
|
|
8
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
16
|
var propTypes = {
|
|
10
|
-
animationStyle: _propTypes["default"].oneOf(['default', 'bounce']),
|
|
11
|
-
arrowBottom: _propTypes["default"].number,
|
|
12
|
-
arrowLeft: _propTypes["default"].number,
|
|
13
|
-
arrowPosition: _propTypes["default"].oneOf(['start', 'mid', 'end']),
|
|
14
|
-
arrowRight: _propTypes["default"].number,
|
|
15
|
-
arrowTop: _propTypes["default"].number,
|
|
16
|
-
bottom: _propTypes["default"].number,
|
|
17
|
-
boxPosition: _propTypes["default"].oneOf(['bottomRight', 'bottomLeft', 'bottomCenter', 'topRight', 'topLeft', 'topCenter', 'rightTop', 'rightBottom', 'rightCenter', 'leftTop', 'leftBottom', 'leftCenter']),
|
|
18
|
-
children: _propTypes["default"].element,
|
|
19
|
-
dataId: _propTypes["default"].string,
|
|
20
|
-
dataSelectorId: _propTypes["default"].string,
|
|
21
|
-
forwardRef: _propTypes["default"].object,
|
|
22
|
-
getRef: _propTypes["default"].func,
|
|
23
|
-
isAbsolutePositioningNeeded: _propTypes["default"].bool,
|
|
24
|
-
isActive: _propTypes["default"].bool,
|
|
25
|
-
isAnimate: _propTypes["default"].bool,
|
|
26
|
-
isArrow: _propTypes["default"].bool,
|
|
27
|
-
isBoxPaddingNeed: _propTypes["default"].bool,
|
|
28
|
-
isPadding: _propTypes["default"].bool,
|
|
29
|
-
isRadius: _propTypes["default"].bool,
|
|
30
|
-
left: _propTypes["default"].number,
|
|
31
17
|
needResponsive: _propTypes["default"].bool,
|
|
32
|
-
onClick: _propTypes["default"].func,
|
|
33
|
-
needFocusScope: _propTypes["default"].bool,
|
|
34
|
-
right: _propTypes["default"].number,
|
|
35
|
-
size: _propTypes["default"].oneOf(['mini', 'xmini', 'xsmall', 'small', 'medium', 'large', 'mlarge', 'xlarge', 'xxlarge', 'default']),
|
|
36
|
-
top: _propTypes["default"].number,
|
|
37
|
-
tourId: _propTypes["default"].string,
|
|
38
|
-
htmlId: _propTypes["default"].string,
|
|
39
|
-
tabIndex: _propTypes["default"].number,
|
|
40
|
-
customClass: _propTypes["default"].shape({
|
|
41
|
-
customDropBox: _propTypes["default"].string,
|
|
42
|
-
customMobileDropBox: _propTypes["default"].string,
|
|
43
|
-
customDropBoxWrap: _propTypes["default"].string,
|
|
44
|
-
customMobileDropBoxWrap: _propTypes["default"].string
|
|
45
|
-
}),
|
|
46
|
-
a11y: _propTypes["default"].shape({
|
|
47
|
-
role: _propTypes["default"].string,
|
|
48
|
-
ariaMultiselectable: _propTypes["default"].bool,
|
|
49
|
-
ariaLabelledby: _propTypes["default"].string
|
|
50
|
-
}),
|
|
51
|
-
palette: _propTypes["default"].oneOf(['default', 'dark']),
|
|
52
|
-
needAutoZindex: _propTypes["default"].bool,
|
|
53
18
|
portalId: _propTypes["default"].string,
|
|
19
|
+
isActive: _propTypes["default"].bool,
|
|
20
|
+
isAbsolutePositioningNeeded: _propTypes["default"].bool,
|
|
54
21
|
isRestrictScroll: _propTypes["default"].bool,
|
|
55
|
-
|
|
22
|
+
needFocusScope: _propTypes["default"].bool,
|
|
23
|
+
needAutoZindex: _propTypes["default"].bool
|
|
56
24
|
};
|
|
57
|
-
exports.propTypes = propTypes;
|
|
25
|
+
exports.propTypes = propTypes;
|
|
26
|
+
var DropBoxPropTypes = _objectSpread(_objectSpread({}, _propTypes2.DropBoxElementPropTypes), propTypes);
|
|
27
|
+
exports.DropBoxPropTypes = DropBoxPropTypes;
|
package/lib/css.js
CHANGED
|
@@ -33,7 +33,8 @@ require("./Tag/Tag.module.css");
|
|
|
33
33
|
require("./Stencils/Stencils.module.css");
|
|
34
34
|
require("./PopOver/PopOver.module.css");
|
|
35
35
|
require("./DropDown/DropDown.module.css");
|
|
36
|
-
require("./DropBox/DropBox.module.css");
|
|
36
|
+
require("./DropBox/css/DropBox.module.css");
|
|
37
|
+
require("./DropBox/DropBoxElement/css/DropBoxElement.module.css");
|
|
37
38
|
require("./DateTime/DateTime.module.css");
|
|
38
39
|
require("./DateTime/DateWidget.module.css");
|
|
39
40
|
require("./Card/Card.module.css");
|
|
@@ -15,7 +15,8 @@ var REPLACER_SYMBOL = '$';
|
|
|
15
15
|
// $ startWith is used for replace the existing style.
|
|
16
16
|
// all other will be append
|
|
17
17
|
|
|
18
|
-
function mergeStyle(defaultStyle
|
|
18
|
+
function mergeStyle(defaultStyle) {
|
|
19
|
+
var customStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
19
20
|
var additionalStyle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
20
21
|
// if(!Object.keys(defaultStyle).includes('base')) {
|
|
21
22
|
// throw new Error(`STYLE CUSTOMIZATION RULE - Your style sheet should have "base" class name for customization`);
|
package/package.json
CHANGED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
3
|
-
|
|
4
|
-
(function(mod) {
|
|
5
|
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
6
|
-
mod(require("../../lib/codemirror"));
|
|
7
|
-
else if (typeof define == "function" && define.amd) // AMD
|
|
8
|
-
define(["../../lib/codemirror"], mod);
|
|
9
|
-
else // Plain browser env
|
|
10
|
-
mod(CodeMirror);
|
|
11
|
-
})(function(CodeMirror) {
|
|
12
|
-
"use strict";
|
|
13
|
-
var WRAP_CLASS = "CodeMirror-activeline";
|
|
14
|
-
var BACK_CLASS = "CodeMirror-activeline-background";
|
|
15
|
-
var GUTT_CLASS = "CodeMirror-activeline-gutter";
|
|
16
|
-
|
|
17
|
-
CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) {
|
|
18
|
-
var prev = old == CodeMirror.Init ? false : old;
|
|
19
|
-
if (val == prev) return
|
|
20
|
-
if (prev) {
|
|
21
|
-
cm.off("beforeSelectionChange", selectionChange);
|
|
22
|
-
clearActiveLines(cm);
|
|
23
|
-
delete cm.state.activeLines;
|
|
24
|
-
}
|
|
25
|
-
if (val) {
|
|
26
|
-
cm.state.activeLines = [];
|
|
27
|
-
updateActiveLines(cm, cm.listSelections());
|
|
28
|
-
cm.on("beforeSelectionChange", selectionChange);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
function clearActiveLines(cm) {
|
|
33
|
-
for (var i = 0; i < cm.state.activeLines.length; i++) {
|
|
34
|
-
cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS);
|
|
35
|
-
cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS);
|
|
36
|
-
cm.removeLineClass(cm.state.activeLines[i], "gutter", GUTT_CLASS);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function sameArray(a, b) {
|
|
41
|
-
if (a.length != b.length) return false;
|
|
42
|
-
for (var i = 0; i < a.length; i++)
|
|
43
|
-
if (a[i] != b[i]) return false;
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function updateActiveLines(cm, ranges) {
|
|
48
|
-
var active = [];
|
|
49
|
-
for (var i = 0; i < ranges.length; i++) {
|
|
50
|
-
var range = ranges[i];
|
|
51
|
-
var option = cm.getOption("styleActiveLine");
|
|
52
|
-
if (typeof option == "object" && option.nonEmpty ? range.anchor.line != range.head.line : !range.empty())
|
|
53
|
-
continue
|
|
54
|
-
var line = cm.getLineHandleVisualStart(range.head.line);
|
|
55
|
-
if (active[active.length - 1] != line) active.push(line);
|
|
56
|
-
}
|
|
57
|
-
if (sameArray(cm.state.activeLines, active)) return;
|
|
58
|
-
cm.operation(function() {
|
|
59
|
-
clearActiveLines(cm);
|
|
60
|
-
for (var i = 0; i < active.length; i++) {
|
|
61
|
-
cm.addLineClass(active[i], "wrap", WRAP_CLASS);
|
|
62
|
-
cm.addLineClass(active[i], "background", BACK_CLASS);
|
|
63
|
-
cm.addLineClass(active[i], "gutter", GUTT_CLASS);
|
|
64
|
-
}
|
|
65
|
-
cm.state.activeLines = active;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function selectionChange(cm, sel) {
|
|
70
|
-
updateActiveLines(cm, sel.ranges);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
-
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
3
|
-
|
|
4
|
-
(function(mod) {
|
|
5
|
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
6
|
-
mod(require("../../lib/codemirror"))
|
|
7
|
-
else if (typeof define == "function" && define.amd) // AMD
|
|
8
|
-
define(["../../lib/codemirror"], mod)
|
|
9
|
-
else // Plain browser env
|
|
10
|
-
mod(CodeMirror)
|
|
11
|
-
})(function(CodeMirror) {
|
|
12
|
-
"use strict"
|
|
13
|
-
|
|
14
|
-
CodeMirror.defineOption("autoRefresh", false, function(cm, val) {
|
|
15
|
-
if (cm.state.autoRefresh) {
|
|
16
|
-
stopListening(cm, cm.state.autoRefresh)
|
|
17
|
-
cm.state.autoRefresh = null
|
|
18
|
-
}
|
|
19
|
-
if (val && cm.display.wrapper.offsetHeight == 0)
|
|
20
|
-
startListening(cm, cm.state.autoRefresh = {delay: val.delay || 250})
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
function startListening(cm, state) {
|
|
24
|
-
function check() {
|
|
25
|
-
if (cm.display.wrapper.offsetHeight) {
|
|
26
|
-
stopListening(cm, state)
|
|
27
|
-
if (cm.display.lastWrapHeight != cm.display.wrapper.clientHeight)
|
|
28
|
-
cm.refresh()
|
|
29
|
-
} else {
|
|
30
|
-
state.timeout = setTimeout(check, state.delay)
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
state.timeout = setTimeout(check, state.delay)
|
|
34
|
-
state.hurry = function() {
|
|
35
|
-
clearTimeout(state.timeout)
|
|
36
|
-
state.timeout = setTimeout(check, 50)
|
|
37
|
-
}
|
|
38
|
-
CodeMirror.on(window, "mouseup", state.hurry)
|
|
39
|
-
CodeMirror.on(window, "keyup", state.hurry)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function stopListening(_cm, state) {
|
|
43
|
-
clearTimeout(state.timeout)
|
|
44
|
-
CodeMirror.off(window, "mouseup", state.hurry)
|
|
45
|
-
CodeMirror.off(window, "keyup", state.hurry)
|
|
46
|
-
}
|
|
47
|
-
});
|