@elliemae/ds-classnames 1.57.1 → 2.0.0-alpha.11
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/cjs/aggregatedClasses.js +53 -64
- package/cjs/classNameManager.js +77 -12
- package/cjs/converPropsToFormModifiers.js +23 -31
- package/cjs/convertPropToFeedBackModifiers.js +24 -32
- package/cjs/convertPropsToColorModifiers.js +21 -27
- package/cjs/convertPropsToLayoutModifiers.js +24 -32
- package/cjs/convertPropsToSizeModifiers.js +29 -42
- package/cjs/convertPropsToTextModifiers.js +23 -28
- package/cjs/index.js +3 -18
- package/cjs/validateNativeProps.js +11 -20
- package/esm/aggregatedClasses.js +47 -59
- package/esm/classNameManager.js +75 -10
- package/esm/converPropsToFormModifiers.js +23 -27
- package/esm/convertPropToFeedBackModifiers.js +25 -29
- package/esm/convertPropsToColorModifiers.js +21 -23
- package/esm/convertPropsToLayoutModifiers.js +25 -29
- package/esm/convertPropsToSizeModifiers.js +29 -38
- package/esm/convertPropsToTextModifiers.js +22 -23
- package/esm/index.js +1 -15
- package/esm/validateNativeProps.js +10 -19
- package/package.json +62 -9
- package/types/aggregatedClasses.d.ts +4 -0
- package/types/classNameManager.d.ts +24 -0
- package/types/converPropsToFormModifiers.d.ts +14 -0
- package/types/convertPropToFeedBackModifiers.d.ts +16 -0
- package/types/convertPropsToColorModifiers.d.ts +10 -0
- package/types/convertPropsToLayoutModifiers.d.ts +16 -0
- package/types/convertPropsToSizeModifiers.d.ts +24 -0
- package/types/convertPropsToTextModifiers.d.ts +14 -0
- package/types/index.d.ts +2 -0
- package/types/validateNativeProps.d.ts +265 -0
- package/aggregatedClasses/package.json +0 -10
- package/cjs/aggregatedClasses.js.map +0 -1
- package/cjs/classNameManager-a0bcf533.js +0 -87
- package/cjs/classNameManager-a0bcf533.js.map +0 -1
- package/cjs/classNameManager.js.map +0 -1
- package/cjs/converPropsToFormModifiers.js.map +0 -1
- package/cjs/convertPropToFeedBackModifiers.js.map +0 -1
- package/cjs/convertPropsToColorModifiers.js.map +0 -1
- package/cjs/convertPropsToLayoutModifiers.js.map +0 -1
- package/cjs/convertPropsToSizeModifiers.js.map +0 -1
- package/cjs/convertPropsToTextModifiers.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/validateNativeProps.js.map +0 -1
- package/classNameManager/package.json +0 -10
- package/converPropsToFormModifiers/package.json +0 -10
- package/convertPropToFeedBackModifiers/package.json +0 -10
- package/convertPropsToColorModifiers/package.json +0 -10
- package/convertPropsToLayoutModifiers/package.json +0 -10
- package/convertPropsToSizeModifiers/package.json +0 -10
- package/convertPropsToTextModifiers/package.json +0 -10
- package/esm/aggregatedClasses.js.map +0 -1
- package/esm/classNameManager-177ee1bb.js +0 -79
- package/esm/classNameManager-177ee1bb.js.map +0 -1
- package/esm/classNameManager.js.map +0 -1
- package/esm/converPropsToFormModifiers.js.map +0 -1
- package/esm/convertPropToFeedBackModifiers.js.map +0 -1
- package/esm/convertPropsToColorModifiers.js.map +0 -1
- package/esm/convertPropsToLayoutModifiers.js.map +0 -1
- package/esm/convertPropsToSizeModifiers.js.map +0 -1
- package/esm/convertPropsToTextModifiers.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/validateNativeProps.js.map +0 -1
- package/validateNativeProps/package.json +0 -10
package/cjs/index.js
CHANGED
|
@@ -2,25 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var classNameManager = require('./classNameManager
|
|
5
|
+
var classNameManager = require('./classNameManager.js');
|
|
6
6
|
var aggregatedClasses = require('./aggregatedClasses.js');
|
|
7
|
-
require('@babel/runtime/helpers/toConsumableArray');
|
|
8
|
-
require('@elliemae/ds-utilities');
|
|
9
|
-
require('./converPropsToFormModifiers.js');
|
|
10
|
-
require('./convertPropsToLayoutModifiers.js');
|
|
11
|
-
require('./convertPropToFeedBackModifiers.js');
|
|
12
|
-
require('./convertPropsToSizeModifiers.js');
|
|
13
|
-
require('./convertPropsToTextModifiers.js');
|
|
14
|
-
require('./convertPropsToColorModifiers.js');
|
|
15
|
-
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
16
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
17
|
-
require('react');
|
|
18
|
-
require('obj-str');
|
|
19
|
-
require('./validateNativeProps.js');
|
|
20
7
|
|
|
21
8
|
|
|
22
9
|
|
|
23
|
-
exports.convertPropToCssClassName = classNameManager
|
|
24
|
-
exports.
|
|
25
|
-
exports.aggregatedClasses = aggregatedClasses['default'];
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
|
10
|
+
exports.convertPropToCssClassName = classNameManager["default"];
|
|
11
|
+
exports.aggregatedClasses = aggregatedClasses["default"];
|
|
@@ -10,10 +10,10 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
10
10
|
|
|
11
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
12
12
|
|
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
13
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
14
14
|
|
|
15
15
|
/* eslint-disable max-lines */
|
|
16
|
-
|
|
16
|
+
const attributeWhiteList = {
|
|
17
17
|
accept: true,
|
|
18
18
|
acceptCharset: true,
|
|
19
19
|
accessKey: true,
|
|
@@ -129,7 +129,7 @@ var attributeWhiteList = {
|
|
|
129
129
|
wmode: true,
|
|
130
130
|
wrap: true
|
|
131
131
|
};
|
|
132
|
-
|
|
132
|
+
const svgAttributesWhiteList = {
|
|
133
133
|
clipPath: true,
|
|
134
134
|
cx: true,
|
|
135
135
|
cy: true,
|
|
@@ -185,7 +185,7 @@ var svgAttributesWhiteList = {
|
|
|
185
185
|
y2: true,
|
|
186
186
|
y: true
|
|
187
187
|
};
|
|
188
|
-
|
|
188
|
+
const otherWhiteList = {
|
|
189
189
|
autoCapitalize: true,
|
|
190
190
|
autoCorrect: true,
|
|
191
191
|
property: true,
|
|
@@ -198,7 +198,7 @@ var otherWhiteList = {
|
|
|
198
198
|
results: true,
|
|
199
199
|
autoSave: true
|
|
200
200
|
};
|
|
201
|
-
|
|
201
|
+
const eventsWhiteList = {
|
|
202
202
|
onCopy: true,
|
|
203
203
|
onCut: true,
|
|
204
204
|
onPaste: true,
|
|
@@ -280,17 +280,11 @@ var eventsWhiteList = {
|
|
|
280
280
|
onTransitionEnd: true,
|
|
281
281
|
onToggle: true
|
|
282
282
|
};
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
return attribute.substring(0, 6) === 'aria-';
|
|
289
|
-
};
|
|
290
|
-
var isValidNativeAttribute = function isValidNativeAttribute(attribute) {
|
|
291
|
-
return whiteList[attribute] === true || isDataAttribute(attribute) || isAriaAttribute(attribute) || attribute.toLowerCase() === attribute;
|
|
292
|
-
};
|
|
293
|
-
var nativeHTMLElements = {
|
|
283
|
+
const whiteList = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, attributeWhiteList), svgAttributesWhiteList), otherWhiteList), eventsWhiteList);
|
|
284
|
+
const isDataAttribute = attribute => attribute.substring(0, 5) === 'data-';
|
|
285
|
+
const isAriaAttribute = attribute => attribute.substring(0, 6) === 'aria-';
|
|
286
|
+
const isValidNativeAttribute = attribute => whiteList[attribute] === true || isDataAttribute(attribute) || isAriaAttribute(attribute) || attribute.toLowerCase() === attribute;
|
|
287
|
+
const nativeHTMLElements = {
|
|
294
288
|
a: true,
|
|
295
289
|
abbr: true,
|
|
296
290
|
address: true,
|
|
@@ -404,13 +398,10 @@ var nativeHTMLElements = {
|
|
|
404
398
|
video: true,
|
|
405
399
|
wbr: true
|
|
406
400
|
};
|
|
407
|
-
|
|
408
|
-
return nativeHTMLElements[type] === true;
|
|
409
|
-
};
|
|
401
|
+
const isNativeHTMLElement = type => nativeHTMLElements[type] === true;
|
|
410
402
|
|
|
411
403
|
exports.isAriaAttribute = isAriaAttribute;
|
|
412
404
|
exports.isDataAttribute = isDataAttribute;
|
|
413
405
|
exports.isNativeHTMLElement = isNativeHTMLElement;
|
|
414
406
|
exports.isValidNativeAttribute = isValidNativeAttribute;
|
|
415
407
|
exports.whiteList = whiteList;
|
|
416
|
-
//# sourceMappingURL=validateNativeProps.js.map
|
package/esm/aggregatedClasses.js
CHANGED
|
@@ -2,82 +2,70 @@ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import cx from 'obj-str';
|
|
5
|
-
import
|
|
5
|
+
import cssPipeline from './classNameManager.js';
|
|
6
|
+
import DimsumConfig from '@elliemae/ds-shared/dimsum.config';
|
|
6
7
|
import { isNativeHTMLElement, isValidNativeAttribute } from './validateNativeProps.js';
|
|
7
|
-
import '@babel/runtime/helpers/esm/toConsumableArray';
|
|
8
|
-
import '@elliemae/ds-utilities';
|
|
9
|
-
import './converPropsToFormModifiers.js';
|
|
10
|
-
import './convertPropsToLayoutModifiers.js';
|
|
11
|
-
import './convertPropToFeedBackModifiers.js';
|
|
12
|
-
import './convertPropsToSizeModifiers.js';
|
|
13
|
-
import './convertPropsToTextModifiers.js';
|
|
14
|
-
import './convertPropsToColorModifiers.js';
|
|
15
8
|
|
|
16
|
-
|
|
9
|
+
const _excluded = ["innerRef", "children", "classProps", "useComponent", "className", "as"];
|
|
17
10
|
|
|
18
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
12
|
|
|
20
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
|
-
|
|
14
|
+
const cssPrefix = DimsumConfig.classNamePrefix;
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
return "".concat(cssPrefix, "-").concat(block).concat(element ? "__".concat(element) : '', "--").concat(modifier);
|
|
25
|
-
};
|
|
16
|
+
const generateClassNameWithModifier = (block, element, modifier) => "".concat(cssPrefix, "-").concat(block).concat(element ? "__".concat(element) : '', "--").concat(modifier);
|
|
26
17
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}, {}) : [];
|
|
31
|
-
};
|
|
18
|
+
const appendBlockAndPrefixToObj = (obj, block, element) => obj ? Object.keys(obj).reduce((acc, key) => _objectSpread(_objectSpread({}, acc), {}, {
|
|
19
|
+
["".concat(generateClassNameWithModifier(block, element, key))]: obj[key]
|
|
20
|
+
}), {}) : [];
|
|
32
21
|
|
|
33
22
|
function aggregatedClasses(type, props) {
|
|
34
23
|
// aggregatedClasses options parameters
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
24
|
+
return (block, element, additionalModifiers, options = {}) => /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
25
|
+
let {
|
|
26
|
+
innerRef,
|
|
27
|
+
children,
|
|
28
|
+
classProps,
|
|
29
|
+
useComponent,
|
|
30
|
+
className,
|
|
31
|
+
as
|
|
32
|
+
} = _ref,
|
|
33
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
45
34
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
// get the additional classNames either from a function or an object
|
|
36
|
+
let otherModifiers = appendBlockAndPrefixToObj(additionalModifiers, block, element);
|
|
37
|
+
if (typeof additionalModifiers === 'function') otherModifiers = appendBlockAndPrefixToObj(additionalModifiers(_objectSpread(_objectSpread(_objectSpread({}, rest), classProps), {}, {
|
|
38
|
+
className
|
|
39
|
+
})), block, element);
|
|
40
|
+
const otherModifiersStr = cx(otherModifiers);
|
|
41
|
+
const {
|
|
42
|
+
prefix,
|
|
43
|
+
propsToRemoveFromFinalElement = []
|
|
44
|
+
} = options;
|
|
45
|
+
const {
|
|
46
|
+
cssClassName: classNames
|
|
47
|
+
} = cssPipeline(block, null, _objectSpread({}, classProps), {
|
|
48
|
+
prefix,
|
|
49
|
+
element
|
|
50
|
+
});
|
|
55
51
|
|
|
56
|
-
|
|
57
|
-
prefix: prefix,
|
|
58
|
-
element: element
|
|
59
|
-
}),
|
|
60
|
-
classNames = _convertPropToCssClas.cssClassName;
|
|
52
|
+
const cleanedPropsPassedDown = _objectSpread(_objectSpread({}, props), rest);
|
|
61
53
|
|
|
62
|
-
|
|
54
|
+
propsToRemoveFromFinalElement.forEach(propKey => {
|
|
55
|
+
delete cleanedPropsPassedDown[propKey];
|
|
56
|
+
});
|
|
63
57
|
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
if (isNativeHTMLElement(block)) {
|
|
59
|
+
Object.keys(cleanedPropsPassedDown).forEach(key => {
|
|
60
|
+
if (!isValidNativeAttribute(key)) delete cleanedPropsPassedDown[key];
|
|
66
61
|
});
|
|
62
|
+
}
|
|
67
63
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return /*#__PURE__*/React.createElement(as || type, _objectSpread({
|
|
75
|
-
ref: innerRef || ref,
|
|
76
|
-
className: [classNames, otherModifiersStr, className].join(' ')
|
|
77
|
-
}, cleanedPropsPassedDown), children);
|
|
78
|
-
});
|
|
79
|
-
};
|
|
64
|
+
return /*#__PURE__*/React.createElement(as || type, _objectSpread({
|
|
65
|
+
ref: innerRef || ref,
|
|
66
|
+
className: [classNames, otherModifiersStr, className].join(' ')
|
|
67
|
+
}, cleanedPropsPassedDown), children);
|
|
68
|
+
});
|
|
80
69
|
}
|
|
81
70
|
|
|
82
71
|
export { cssPrefix, aggregatedClasses as default };
|
|
83
|
-
//# sourceMappingURL=aggregatedClasses.js.map
|
package/esm/classNameManager.js
CHANGED
|
@@ -1,10 +1,75 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '@elliemae/ds-utilities';
|
|
3
|
-
|
|
4
|
-
import './converPropsToFormModifiers.js';
|
|
5
|
-
import './convertPropsToLayoutModifiers.js';
|
|
6
|
-
import './convertPropToFeedBackModifiers.js';
|
|
7
|
-
import './convertPropsToSizeModifiers.js';
|
|
8
|
-
import './convertPropsToTextModifiers.js';
|
|
9
|
-
import './convertPropsToColorModifiers.js';
|
|
10
|
-
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
|
+
import { isEmpty } from '@elliemae/ds-utilities/utils';
|
|
3
|
+
import DimsumConfig from '@elliemae/ds-shared/dimsum.config';
|
|
4
|
+
import pipe from './converPropsToFormModifiers.js';
|
|
5
|
+
import pipe$1 from './convertPropsToLayoutModifiers.js';
|
|
6
|
+
import pipe$2 from './convertPropToFeedBackModifiers.js';
|
|
7
|
+
import pipe$3 from './convertPropsToSizeModifiers.js';
|
|
8
|
+
import pipe$4 from './convertPropsToTextModifiers.js';
|
|
9
|
+
import pipe$5 from './convertPropsToColorModifiers.js';
|
|
10
|
+
|
|
11
|
+
const cssPrefix = "".concat(DimsumConfig.classNamePrefix, "-");
|
|
12
|
+
|
|
13
|
+
const executePipelines = props => {
|
|
14
|
+
const form = pipe().execute(props);
|
|
15
|
+
const layout = pipe$1().execute(props);
|
|
16
|
+
const feedback = pipe$2().execute(props);
|
|
17
|
+
const size = pipe$3().execute(props);
|
|
18
|
+
const text = pipe$4().execute(props);
|
|
19
|
+
const color = pipe$5().execute(props);
|
|
20
|
+
return [...form, ...layout, ...feedback, ...size, ...text, ...color];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Docs: http://getbem.com/naming/
|
|
24
|
+
* blockName
|
|
25
|
+
* cssClassNameModifier: Main modifier
|
|
26
|
+
* props { hasError, hasWarning, hasSuccess, readOnly, disabled}
|
|
27
|
+
*
|
|
28
|
+
* @param blockName
|
|
29
|
+
* @param cssClassNameModifier
|
|
30
|
+
* @param props
|
|
31
|
+
* @param options
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
const cssPipeline = (blockName = 'block', cssClassNameModifier = '', props = {}, options = {}) => {
|
|
36
|
+
const {
|
|
37
|
+
prefix,
|
|
38
|
+
element
|
|
39
|
+
} = options;
|
|
40
|
+
const prefixBlockName = "".concat(prefix || cssPrefix).concat(blockName).concat(element ? "__".concat(element) : ''); // PipeLine
|
|
41
|
+
|
|
42
|
+
const pipes = !isEmpty(props) ? executePipelines(props) : [];
|
|
43
|
+
const basePipeline = [prefixBlockName, ...pipes]; // specific classname
|
|
44
|
+
|
|
45
|
+
const className = cssClassNameModifier ? [...basePipeline].join(" ".concat(prefixBlockName, "--")).concat(" ".concat(cssClassNameModifier)) : [...basePipeline].join(" ".concat(prefixBlockName, "--"));
|
|
46
|
+
return {
|
|
47
|
+
blockName,
|
|
48
|
+
cssPrefix,
|
|
49
|
+
prefixBlockName,
|
|
50
|
+
cssClassName: className,
|
|
51
|
+
|
|
52
|
+
mainModifier(modifier) {
|
|
53
|
+
return "".concat(className, "--").concat(modifier);
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
classNameBlock(elementName, usePrefix = true) {
|
|
57
|
+
return "".concat(!usePrefix ? blockName : prefixBlockName, "-").concat(elementName);
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
classNameBlockModifier(modifierName, elementBlockName = '') {
|
|
61
|
+
return "".concat(prefixBlockName, "-").concat(elementBlockName, "--").concat(modifierName);
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
classNameElement(elementName, elementBlockName = '') {
|
|
65
|
+
return "".concat(prefixBlockName).concat(elementBlockName ? "-".concat(elementBlockName) : '', "__").concat(elementName);
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
classNameModifier(modifierName, elementName = '') {
|
|
69
|
+
return "".concat(prefixBlockName).concat(elementName ? "__".concat(elementName) : '', "--").concat(modifierName);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export { cssPrefix, cssPipeline as default };
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
checked = _ref$checked === void 0 ? false : _ref$checked;
|
|
10
|
-
var cssModifier = []; // input state modifiers
|
|
3
|
+
const basicAction = ({
|
|
4
|
+
readOnly = false,
|
|
5
|
+
disabled = false,
|
|
6
|
+
checked = false
|
|
7
|
+
}) => {
|
|
8
|
+
const cssModifier = []; // input state modifiers
|
|
11
9
|
|
|
12
10
|
if (checked) cssModifier.push('checked');
|
|
13
11
|
if (readOnly) cssModifier.push('readonly');
|
|
@@ -15,23 +13,21 @@ var basicAction = function basicAction(_ref) {
|
|
|
15
13
|
return cssModifier;
|
|
16
14
|
};
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
16
|
+
const instance = [basicAction];
|
|
17
|
+
|
|
18
|
+
const pipe = () => ({
|
|
19
|
+
getInstance() {
|
|
20
|
+
return instance;
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
add(customModifier) {
|
|
24
|
+
instance.push(customModifier);
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
execute(props) {
|
|
28
|
+
return instance.reduce((temp, action) => [...temp, ...action(props)], []);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
});
|
|
35
32
|
|
|
36
33
|
export { pipe as default };
|
|
37
|
-
//# sourceMappingURL=converPropsToFormModifiers.js.map
|
|
@@ -1,37 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
modalType = _ref.modalType;
|
|
11
|
-
var cssModifier = []; // valid state modifier
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
|
+
|
|
3
|
+
const basicAction = ({
|
|
4
|
+
hasError = false,
|
|
5
|
+
hasWarning = false,
|
|
6
|
+
hasSuccess = false,
|
|
7
|
+
modalType
|
|
8
|
+
}) => {
|
|
9
|
+
const cssModifier = []; // valid state modifier
|
|
12
10
|
|
|
13
11
|
if (hasError) cssModifier.push('error');else if (hasWarning) cssModifier.push('warning');else if (hasSuccess) cssModifier.push('success');
|
|
14
12
|
if (modalType) cssModifier.push("modal-type-".concat(modalType));
|
|
15
13
|
return cssModifier;
|
|
16
14
|
};
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
16
|
+
const instance = [basicAction];
|
|
17
|
+
|
|
18
|
+
const pipe = () => ({
|
|
19
|
+
getInstance() {
|
|
20
|
+
return instance;
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
add(customModifier) {
|
|
24
|
+
instance.push(customModifier);
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
execute(props) {
|
|
28
|
+
return instance.reduce((temp, action) => [...temp, ...action(props)], []);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
});
|
|
35
32
|
|
|
36
33
|
export { pipe as default };
|
|
37
|
-
//# sourceMappingURL=convertPropToFeedBackModifiers.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const basicAction = ({
|
|
4
|
+
color = null
|
|
5
|
+
}) => {
|
|
6
|
+
const cssModifier = [];
|
|
7
7
|
|
|
8
8
|
if (color && color[0]) {
|
|
9
9
|
if (color[1] !== null) cssModifier.push("color-".concat(color[0], "-").concat(color[1]));else cssModifier.push("color-".concat(color[0]));
|
|
@@ -12,23 +12,21 @@ var basicAction = function basicAction(_ref) {
|
|
|
12
12
|
return cssModifier;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
15
|
+
const instance = [basicAction];
|
|
16
|
+
|
|
17
|
+
const pipe = () => ({
|
|
18
|
+
getInstance() {
|
|
19
|
+
return instance;
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
add(customModifier) {
|
|
23
|
+
instance.push(customModifier);
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
execute(props) {
|
|
27
|
+
return instance.reduce((temp, action) => [...temp, ...action(props)], []);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
});
|
|
32
31
|
|
|
33
32
|
export { pipe as default };
|
|
34
|
-
//# sourceMappingURL=convertPropsToColorModifiers.js.map
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
fluidHeight = _ref$fluidHeight === void 0 ? false : _ref$fluidHeight;
|
|
11
|
-
var cssModifier = []; // buttons types
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
|
+
|
|
3
|
+
const basicAction = ({
|
|
4
|
+
id,
|
|
5
|
+
buttonType = 'default',
|
|
6
|
+
fluidWidth = false,
|
|
7
|
+
fluidHeight = false
|
|
8
|
+
}) => {
|
|
9
|
+
const cssModifier = []; // buttons types
|
|
12
10
|
|
|
13
11
|
if (id) cssModifier.push("id-".concat(id));
|
|
14
12
|
if (buttonType) cssModifier.push(buttonType);
|
|
@@ -17,23 +15,21 @@ var basicAction = function basicAction(_ref) {
|
|
|
17
15
|
return cssModifier;
|
|
18
16
|
};
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
18
|
+
const instance = [basicAction];
|
|
19
|
+
|
|
20
|
+
const pipe = () => ({
|
|
21
|
+
getInstance() {
|
|
22
|
+
return instance;
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
add(customModifier) {
|
|
26
|
+
instance.push(customModifier);
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
execute(props) {
|
|
30
|
+
return instance.reduce((temp, action) => [...temp, ...action(props)], []);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
});
|
|
37
34
|
|
|
38
35
|
export { pipe as default };
|
|
39
|
-
//# sourceMappingURL=convertPropsToLayoutModifiers.js.map
|
|
@@ -1,46 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
_ref$loose = _ref.loose,
|
|
15
|
-
loose = _ref$loose === void 0 ? false : _ref$loose,
|
|
16
|
-
_ref$extraLoose = _ref.extraLoose,
|
|
17
|
-
extraLoose = _ref$extraLoose === void 0 ? false : _ref$extraLoose,
|
|
18
|
-
_ref$superLoose = _ref.superLoose,
|
|
19
|
-
superLoose = _ref$superLoose === void 0 ? false : _ref$superLoose;
|
|
20
|
-
var cssModifier = [];
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
|
+
|
|
3
|
+
const basicAction = ({
|
|
4
|
+
size = null,
|
|
5
|
+
extraTight = false,
|
|
6
|
+
tight = false,
|
|
7
|
+
base = false,
|
|
8
|
+
bitLoose = false,
|
|
9
|
+
loose = false,
|
|
10
|
+
extraLoose = false,
|
|
11
|
+
superLoose = false
|
|
12
|
+
}) => {
|
|
13
|
+
const cssModifier = [];
|
|
21
14
|
if (size) cssModifier.push("".concat(size)); // Size as Flag
|
|
22
15
|
|
|
23
16
|
if (extraTight) cssModifier.push('size-extra-tight');else if (tight) cssModifier.push('size-tight');else if (base) cssModifier.push('size-base');else if (bitLoose) cssModifier.push('size-bit-loose');else if (loose) cssModifier.push('size-loose');else if (extraLoose) cssModifier.push('size-extra-loose');else if (superLoose) cssModifier.push('size-super-loose');
|
|
24
17
|
return cssModifier;
|
|
25
18
|
};
|
|
26
19
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
20
|
+
const instance = [basicAction];
|
|
21
|
+
|
|
22
|
+
const pipe = () => ({
|
|
23
|
+
getInstance() {
|
|
24
|
+
return instance;
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
add(customModifier) {
|
|
28
|
+
instance.push(customModifier);
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
execute(props) {
|
|
32
|
+
return instance.reduce((temp, action) => [...temp, ...action(props)], []);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
});
|
|
44
36
|
|
|
45
37
|
export { pipe as default };
|
|
46
|
-
//# sourceMappingURL=convertPropsToSizeModifiers.js.map
|