@zohodesk/components 1.0.0-alpha-260 → 1.0.0-alpha-261
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 +6 -0
- package/es/DateTime/DateTimePopupHeader.js +1 -1
- package/es/DateTime/DateWidget.js +1 -1
- package/es/DateTime/YearView.js +1 -1
- package/es/DateTime/index.js +1 -1
- package/es/DropDown/index.js +7 -0
- package/es/Layout/index.js +9 -9
- package/es/ListItem/ListItem.js +1 -1
- package/es/ListItem/ListItemWithAvatar.js +1 -1
- package/es/ListItem/ListItemWithIcon.js +1 -1
- package/es/ListItem/index.js +6 -0
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +1 -1
- package/es/MultiSelect/AdvancedMultiSelect.js +1 -1
- package/es/MultiSelect/MultiSelect.js +1 -1
- package/es/MultiSelect/MultiSelectWithAvatar.js +1 -1
- package/es/MultiSelect/index.js +4 -0
- package/es/PopOver/index.js +3 -0
- package/es/Provider/IdProvider.js +8 -7
- package/es/Provider/index.js +4 -0
- package/es/Responsive/index.js +11 -8
- package/es/Select/GroupSelect.js +1 -1
- package/es/Select/Select.js +1 -1
- package/es/Select/SelectWithIcon.js +1 -1
- package/es/Select/index.js +4 -0
- package/es/Tab/Tab.module.css +0 -1
- package/es/Tab/Tabs.js +1 -1
- package/es/Tab/Tabs.module.css +0 -1
- package/es/Tag/Tag.js +1 -1
- package/es/TextBoxIcon/TextBoxIcon.js +1 -1
- package/es/VelocityAnimation/index.js +2 -0
- package/es/index.js +30 -146
- package/es/semantic/index.js +1 -0
- package/es/utils/css/compileClassNames.js +23 -0
- package/es/utils/css/mergeStyle.js +42 -0
- package/es/utils/css/utils.js +23 -0
- package/es/utils/index.js +3 -0
- package/lib/DateTime/DateTimePopupHeader.js +4 -4
- package/lib/DateTime/DateWidget.js +2 -2
- package/lib/DateTime/YearView.js +2 -2
- package/lib/DateTime/index.js +1 -1
- package/lib/DropDown/index.js +56 -0
- package/lib/Layout/index.js +1 -11
- package/lib/ListItem/ListItem.js +2 -2
- package/lib/ListItem/ListItemWithAvatar.js +2 -2
- package/lib/ListItem/ListItemWithIcon.js +3 -3
- package/lib/ListItem/index.js +48 -0
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +2 -2
- package/lib/MultiSelect/AdvancedMultiSelect.js +2 -2
- package/lib/MultiSelect/MultiSelect.js +2 -2
- package/lib/MultiSelect/MultiSelectWithAvatar.js +2 -2
- package/lib/MultiSelect/index.js +34 -0
- package/lib/PopOver/index.js +27 -0
- package/lib/Provider/IdProvider.js +8 -8
- package/lib/Provider/index.js +76 -0
- package/lib/Responsive/index.js +45 -22
- package/lib/Select/GroupSelect.js +2 -2
- package/lib/Select/Select.js +2 -2
- package/lib/Select/SelectWithIcon.js +3 -3
- package/lib/Select/index.js +34 -0
- package/lib/Tab/Tab.module.css +0 -1
- package/lib/Tab/Tabs.js +2 -2
- package/lib/Tab/Tabs.module.css +0 -1
- package/lib/Tag/Tag.js +3 -3
- package/lib/TextBoxIcon/TextBoxIcon.js +2 -2
- package/lib/VelocityAnimation/index.js +20 -0
- package/lib/index.js +157 -210
- package/lib/semantic/index.js +13 -0
- package/lib/utils/css/compileClassNames.js +31 -0
- package/lib/utils/css/mergeStyle.js +52 -0
- package/lib/utils/css/utils.js +33 -0
- package/lib/utils/index.js +117 -0
- package/package.json +3 -3
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = compileClassNames;
|
|
7
|
+
var _utils = require("./utils");
|
|
8
|
+
var collectClassNames = function collectClassNames(processedClassNameList) {
|
|
9
|
+
for (var index = 0; index < (arguments.length <= 1 ? 0 : arguments.length - 1); index++) {
|
|
10
|
+
var classInfo = index + 1 < 1 || arguments.length <= index + 1 ? undefined : arguments[index + 1];
|
|
11
|
+
if (!classInfo) {
|
|
12
|
+
continue;
|
|
13
|
+
} else if ((0, _utils.isDataTypeOf)(classInfo, _utils.dataTypes.object)) {
|
|
14
|
+
for (var property in classInfo) {
|
|
15
|
+
if (Object.hasOwnProperty.call(classInfo, property) && property !== 'undefined' && property !== 'null' && classInfo[property] && !processedClassNameList.includes(property)) {
|
|
16
|
+
processedClassNameList.push(property);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
function compileClassNames() {
|
|
23
|
+
var resultClassNameList = [];
|
|
24
|
+
for (var _len = arguments.length, classinfoList = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25
|
+
classinfoList[_key] = arguments[_key];
|
|
26
|
+
}
|
|
27
|
+
collectClassNames.apply(void 0, [resultClassNameList].concat(classinfoList));
|
|
28
|
+
return resultClassNameList.filter(function (a) {
|
|
29
|
+
return a !== '';
|
|
30
|
+
}).join(' ');
|
|
31
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = mergeStyle;
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
+
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); }
|
|
13
|
+
var REPLACER_SYMBOL = '$';
|
|
14
|
+
|
|
15
|
+
// $ startWith is used for replace the existing style.
|
|
16
|
+
// all other will be append
|
|
17
|
+
|
|
18
|
+
function mergeStyle(defaultStyle, customStyle) {
|
|
19
|
+
var additionalStyle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
20
|
+
// if(!Object.keys(defaultStyle).includes('base')) {
|
|
21
|
+
// throw new Error(`STYLE CUSTOMIZATION RULE - Your style sheet should have "base" class name for customization`);
|
|
22
|
+
// }
|
|
23
|
+
|
|
24
|
+
return Object.keys(customStyle).reduce(function (res, next) {
|
|
25
|
+
if (next.startsWith(REPLACER_SYMBOL)) {
|
|
26
|
+
var styleValue = customStyle[next];
|
|
27
|
+
var styleName = next.replace(REPLACER_SYMBOL, '');
|
|
28
|
+
if (!defaultStyle[styleName] && !additionalStyle.includes(styleName)) {
|
|
29
|
+
// return res;
|
|
30
|
+
throw new Error("UNKNOWN CLASSNAME DETECTED - Given customStyle's key \"".concat(styleName, "\" is not available in that component style"));
|
|
31
|
+
}
|
|
32
|
+
var val = defaultStyle[styleName];
|
|
33
|
+
Object.keys(res).map(function (keyName) {
|
|
34
|
+
var styleKey = res[keyName];
|
|
35
|
+
if (styleKey.includes(val)) {
|
|
36
|
+
res[keyName] = styleKey.replace(val, styleValue);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
} else if (defaultStyle[next] || additionalStyle.includes(next)) {
|
|
40
|
+
var _val = defaultStyle[next];
|
|
41
|
+
Object.keys(res).map(function (keyName) {
|
|
42
|
+
if (res[keyName].includes(_val)) {
|
|
43
|
+
res[keyName] = res[keyName] + ' ' + customStyle[next];
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
} else if (!defaultStyle[next] && !additionalStyle.includes(next)) {
|
|
47
|
+
// res[next] = customStyle[next];
|
|
48
|
+
"UNKNOWN CLASSNAME DETECTED - Given customStyle's key \"".concat(next, "\" is not available in that component style");
|
|
49
|
+
}
|
|
50
|
+
return res;
|
|
51
|
+
}, _objectSpread({}, defaultStyle));
|
|
52
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isDataTypeOf = exports.getDataType = exports.dataTypes = void 0;
|
|
7
|
+
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); }
|
|
8
|
+
var dataTypes = {
|
|
9
|
+
number: 'number',
|
|
10
|
+
array: 'array',
|
|
11
|
+
string: 'string',
|
|
12
|
+
object: 'object',
|
|
13
|
+
bigint: 'bigint',
|
|
14
|
+
symbol: 'symbol',
|
|
15
|
+
undefined: 'undefined',
|
|
16
|
+
"function": 'function',
|
|
17
|
+
"boolean": 'boolean'
|
|
18
|
+
};
|
|
19
|
+
exports.dataTypes = dataTypes;
|
|
20
|
+
var getDataType = function getDataType(data) {
|
|
21
|
+
var typeofData = _typeof(data);
|
|
22
|
+
var isArrayDataType = Array.isArray(data);
|
|
23
|
+
if (isArrayDataType) {
|
|
24
|
+
return dataTypes.array;
|
|
25
|
+
} else {
|
|
26
|
+
return dataTypes[typeofData];
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.getDataType = getDataType;
|
|
30
|
+
var isDataTypeOf = function isDataTypeOf(data, type) {
|
|
31
|
+
return getDataType(data) === type;
|
|
32
|
+
};
|
|
33
|
+
exports.isDataTypeOf = isDataTypeOf;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "bytesToSize", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _Common.bytesToSize;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "capitalize", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _Common.capitalize;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "checkIsImageFile", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _Common.checkIsImageFile;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "compileClassNames", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _compileClassNames["default"];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "debounce", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _Common.debounce;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "doAfterScrollEnd", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _Common.doAfterScrollEnd;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "findScrollEnd", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _Common.findScrollEnd;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "format12Hour", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _Common.format12Hour;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "getDateOnly", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _Common.getDateOnly;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "getElementSpace", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _Common.getElementSpace;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "getFullDateString", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function get() {
|
|
69
|
+
return _Common.getFullDateString;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "getFullName", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function get() {
|
|
75
|
+
return _Common.getFullName;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "getMemSize", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function get() {
|
|
81
|
+
return _Common.getMemSize;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "getSearchString", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function get() {
|
|
87
|
+
return _Common.getSearchString;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "isTextSelected", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function get() {
|
|
93
|
+
return _Common.isTextSelected;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "mergeStyle", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function get() {
|
|
99
|
+
return _mergeStyle["default"];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "stopAllEventPropagation", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function get() {
|
|
105
|
+
return _Common.stopAllEventPropagation;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "throttle", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function get() {
|
|
111
|
+
return _Common.throttle;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
var _compileClassNames = _interopRequireDefault(require("./css/compileClassNames"));
|
|
115
|
+
var _mergeStyle = _interopRequireDefault(require("./css/mergeStyle"));
|
|
116
|
+
var _Common = require("./Common");
|
|
117
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/components",
|
|
3
|
-
"version": "1.0.0-alpha-
|
|
3
|
+
"version": "1.0.0-alpha-261",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@zohodesk/docstool": "1.0.0-alpha-2",
|
|
50
50
|
"@zohodesk/variables": "1.0.0-beta.29",
|
|
51
|
-
"@zohodesk/icons": "1.0.0-beta.
|
|
51
|
+
"@zohodesk/icons": "1.0.0-beta.119",
|
|
52
52
|
"@zohodesk/virtualizer": "1.0.3",
|
|
53
53
|
"velocity-react": "1.4.3",
|
|
54
54
|
"react-sortable-hoc": "^0.8.3",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"selectn": "1.1.2"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@zohodesk/icons": "1.0.0-beta.
|
|
65
|
+
"@zohodesk/icons": "1.0.0-beta.119",
|
|
66
66
|
"@zohodesk/variables": "1.0.0-beta.29",
|
|
67
67
|
"@zohodesk/svg": "1.0.0-beta.49",
|
|
68
68
|
"@zohodesk/virtualizer": "1.0.3",
|