@helpdice/ui 1.4.9 → 1.5.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/CircularProgress/index.js +6 -6
- package/dist/Placeholder/index.js +41 -41
- package/dist/auto-complete/index.js +60 -60
- package/dist/avatar/index.js +28 -28
- package/dist/badge/index.js +27 -27
- package/dist/breadcrumbs/index.js +34 -34
- package/dist/button/button.compact.d.ts +2 -2
- package/dist/button/index.js +46 -45
- package/dist/button-dropdown/index.js +34 -34
- package/dist/button-group/index.js +25 -25
- package/dist/capacity/index.js +26 -26
- package/dist/card/index.js +44 -44
- package/dist/checkbox/index.js +30 -30
- package/dist/code/index.js +27 -27
- package/dist/col/index.js +8 -8
- package/dist/collapse/index.js +30 -30
- package/dist/css-baseline/index.js +6 -6
- package/dist/description/index.js +26 -26
- package/dist/display/index.js +26 -26
- package/dist/divider/index.js +26 -26
- package/dist/dot/index.js +25 -25
- package/dist/drawer/index.js +53 -53
- package/dist/fieldset/index.js +33 -33
- package/dist/form/FormWrapper.d.ts +7 -7
- package/dist/form/connect.d.ts +1 -0
- package/dist/grid/index.js +33 -33
- package/dist/html-renderer/index.d.ts +6 -0
- package/dist/image/index.js +37 -37
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1899 -547
- package/dist/input/index.js +40 -40
- package/dist/keyboard/index.js +28 -28
- package/dist/link/index.js +29 -29
- package/dist/loading/index.js +26 -26
- package/dist/modal/index.js +75 -75
- package/dist/note/index.js +27 -27
- package/dist/page/index.js +30 -30
- package/dist/pagination/index.js +27 -27
- package/dist/popover/index.js +57 -57
- package/dist/progress/index.js +29 -29
- package/dist/radio/index.js +30 -30
- package/dist/rating/index.js +29 -29
- package/dist/row/index.js +11 -11
- package/dist/search-bar/index.js +1826 -61
- package/dist/select/index.js +60 -60
- package/dist/slider/index.js +35 -35
- package/dist/snippet/index.js +30 -30
- package/dist/spacer/index.js +25 -25
- package/dist/spinner/index.js +24 -24
- package/dist/table/index.js +224 -211
- package/dist/tabs/index.js +39 -39
- package/dist/tag/index.js +26 -26
- package/dist/text/index.js +40 -40
- package/dist/textarea/index.js +29 -29
- package/dist/themes/index.js +2 -2
- package/dist/toggle/index.js +27 -27
- package/dist/tooltip/index.js +42 -42
- package/dist/tree/index.js +23 -23
- package/dist/ui-provider/index.js +48 -48
- package/dist/use-all-themes/index.js +2 -2
- package/dist/use-body-scroll/index.js +5 -5
- package/dist/use-clipboard/index.js +1 -1
- package/dist/use-current-state/index.js +1 -1
- package/dist/use-input/index.js +1 -1
- package/dist/use-keyboard/index.js +5 -5
- package/dist/use-media-query/index.js +5 -5
- package/dist/use-modal/index.js +1 -1
- package/dist/use-scale/index.js +19 -19
- package/dist/use-tabs/index.js +1 -1
- package/dist/use-theme/index.js +2 -2
- package/dist/use-toasts/index.js +3 -3
- package/dist/user/index.js +36 -36
- package/esm/button/button.compact.d.ts +2 -2
- package/esm/button/button.compact.js +4 -2
- package/esm/form/FastField.js +1 -1
- package/esm/form/FormWrapper.d.ts +7 -7
- package/esm/form/FormWrapper.js +2 -2
- package/esm/form/connect.d.ts +1 -0
- package/esm/form/connect.js +2 -1
- package/esm/html-renderer/index.d.ts +6 -0
- package/esm/html-renderer/index.js +12 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/link/link.js +2 -0
- package/esm/login-with/LoginSocialAmazon/index.js +162 -134
- package/esm/login-with/index.js +2 -0
- package/esm/search-bar/components/index.js +4 -7
- package/esm/table/data-table.js +6 -4
- package/esm/table/table.js +12 -1
- package/package.json +5 -3
- package/esm/formik-native/src/index.js +0 -12
- package/esm/formik-native/test/blah.test.js +0 -5
package/dist/drawer/index.js
CHANGED
|
@@ -155,8 +155,8 @@ function _slicedToArray(r, e) {
|
|
|
155
155
|
function _toPrimitive(t, r) {
|
|
156
156
|
if ("object" != typeof t || !t) return t;
|
|
157
157
|
var e = t[Symbol.toPrimitive];
|
|
158
|
-
if (
|
|
159
|
-
var i = e.call(t, r
|
|
158
|
+
if (void 0 !== e) {
|
|
159
|
+
var i = e.call(t, r);
|
|
160
160
|
if ("object" != typeof i) return i;
|
|
161
161
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
162
162
|
}
|
|
@@ -179,7 +179,7 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
179
179
|
if (r) {
|
|
180
180
|
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
181
181
|
var t = {}.toString.call(r).slice(8, -1);
|
|
182
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) :
|
|
182
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
|
|
@@ -256,12 +256,12 @@ var defaultOptions = {
|
|
|
256
256
|
};
|
|
257
257
|
var elementStack = new Map();
|
|
258
258
|
var getOwnerPaddingRight = function getOwnerPaddingRight(element) {
|
|
259
|
-
var owner = (element === null || element ===
|
|
259
|
+
var owner = (element === null || element === void 0 ? void 0 : element.ownerDocument) || document;
|
|
260
260
|
var view = owner.defaultView || window;
|
|
261
261
|
return Number.parseInt(view.getComputedStyle(element).paddingRight, 10) || 0;
|
|
262
262
|
};
|
|
263
263
|
var getOwnerScrollbarWidth = function getOwnerScrollbarWidth(element) {
|
|
264
|
-
var doc = (element === null || element ===
|
|
264
|
+
var doc = (element === null || element === void 0 ? void 0 : element.ownerDocument) || document;
|
|
265
265
|
return Math.abs(window.innerWidth - doc.documentElement.clientWidth);
|
|
266
266
|
};
|
|
267
267
|
var useBodyScroll = function useBodyScroll(elementRef, options) {
|
|
@@ -274,7 +274,7 @@ var useBodyScroll = function useBodyScroll(elementRef, options) {
|
|
|
274
274
|
_useState2 = _slicedToArray(_useState, 2),
|
|
275
275
|
hidden = _useState2[0],
|
|
276
276
|
setHidden = _useState2[1];
|
|
277
|
-
var safeOptions = _objectSpread2(_objectSpread2({}, defaultOptions), options);
|
|
277
|
+
var safeOptions = _objectSpread2(_objectSpread2({}, defaultOptions), options || {});
|
|
278
278
|
React.useEffect(function () {
|
|
279
279
|
if (!elRef || !elRef.current) return;
|
|
280
280
|
var lastOverflow = elRef.current.style.overflow;
|
|
@@ -434,15 +434,15 @@ var useKeyboard = function useKeyboard(handler, keyBindings) {
|
|
|
434
434
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
435
435
|
var bindings = Array.isArray(keyBindings) ? keyBindings : [keyBindings];
|
|
436
436
|
var _options$disableGloba = options.disableGlobalEvent,
|
|
437
|
-
disableGlobalEvent = _options$disableGloba ===
|
|
437
|
+
disableGlobalEvent = _options$disableGloba === void 0 ? false : _options$disableGloba,
|
|
438
438
|
_options$capture = options.capture,
|
|
439
|
-
capture = _options$capture ===
|
|
439
|
+
capture = _options$capture === void 0 ? false : _options$capture,
|
|
440
440
|
_options$stopPropagat = options.stopPropagation,
|
|
441
|
-
stopPropagation = _options$stopPropagat ===
|
|
441
|
+
stopPropagation = _options$stopPropagat === void 0 ? false : _options$stopPropagat,
|
|
442
442
|
_options$preventDefau = options.preventDefault,
|
|
443
|
-
preventDefault = _options$preventDefau ===
|
|
443
|
+
preventDefault = _options$preventDefau === void 0 ? true : _options$preventDefau,
|
|
444
444
|
_options$event = options.event,
|
|
445
|
-
event = _options$event ===
|
|
445
|
+
event = _options$event === void 0 ? 'keydown' : _options$event;
|
|
446
446
|
var activeModMap = getActiveModMap(bindings);
|
|
447
447
|
var keyCode = bindings.filter(function (item) {
|
|
448
448
|
return !KeyMod[item];
|
|
@@ -465,7 +465,7 @@ var useKeyboard = function useKeyboard(handler, keyBindings) {
|
|
|
465
465
|
if (preventDefault) {
|
|
466
466
|
event.preventDefault();
|
|
467
467
|
}
|
|
468
|
-
handler(event);
|
|
468
|
+
handler && handler(event);
|
|
469
469
|
};
|
|
470
470
|
React.useEffect(function () {
|
|
471
471
|
if (!disableGlobalEvent) {
|
|
@@ -525,7 +525,7 @@ function requireIndex () {
|
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
528
|
-
_defineProperties(Constructor.prototype, protoProps);
|
|
528
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
529
529
|
return Constructor;
|
|
530
530
|
}
|
|
531
531
|
var isProd = typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production";
|
|
@@ -534,7 +534,7 @@ function requireIndex () {
|
|
|
534
534
|
};
|
|
535
535
|
var StyleSheet = /*#__PURE__*/ function() {
|
|
536
536
|
function StyleSheet(param) {
|
|
537
|
-
var ref = param ===
|
|
537
|
+
var ref = param === void 0 ? {} : param, _name = ref.name, name = _name === void 0 ? "stylesheet" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? isProd : _optimizeForSpeed;
|
|
538
538
|
invariant$1(isString(name), "`name` must be a string");
|
|
539
539
|
this._name = name;
|
|
540
540
|
this._deletedRulePlaceholder = "#" + name + "-deleted-rule____{}";
|
|
@@ -792,7 +792,7 @@ function requireIndex () {
|
|
|
792
792
|
}
|
|
793
793
|
|
|
794
794
|
function mapRulesToStyle(cssRules, options) {
|
|
795
|
-
if (options ===
|
|
795
|
+
if (options === void 0) options = {};
|
|
796
796
|
return cssRules.map(function(args) {
|
|
797
797
|
var id = args[0];
|
|
798
798
|
var css = args[1];
|
|
@@ -809,7 +809,7 @@ function requireIndex () {
|
|
|
809
809
|
}
|
|
810
810
|
var StyleSheetRegistry = /*#__PURE__*/ function() {
|
|
811
811
|
function StyleSheetRegistry(param) {
|
|
812
|
-
var ref = param ===
|
|
812
|
+
var ref = param === void 0 ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === void 0 ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? false : _optimizeForSpeed;
|
|
813
813
|
this._sheet = styleSheet || new StyleSheet({
|
|
814
814
|
name: "styled-jsx",
|
|
815
815
|
optimizeForSpeed: optimizeForSpeed
|
|
@@ -1272,17 +1272,17 @@ var _excluded$7 = ["children", "className", "visible", "enterTime", "leaveTime",
|
|
|
1272
1272
|
var CssTransition = function CssTransition(_ref) {
|
|
1273
1273
|
var children = _ref.children,
|
|
1274
1274
|
_ref$className = _ref.className,
|
|
1275
|
-
className = _ref$className ===
|
|
1275
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1276
1276
|
_ref$visible = _ref.visible,
|
|
1277
|
-
visible = _ref$visible ===
|
|
1277
|
+
visible = _ref$visible === void 0 ? false : _ref$visible,
|
|
1278
1278
|
_ref$enterTime = _ref.enterTime,
|
|
1279
|
-
enterTime = _ref$enterTime ===
|
|
1279
|
+
enterTime = _ref$enterTime === void 0 ? 60 : _ref$enterTime,
|
|
1280
1280
|
_ref$leaveTime = _ref.leaveTime,
|
|
1281
|
-
leaveTime = _ref$leaveTime ===
|
|
1281
|
+
leaveTime = _ref$leaveTime === void 0 ? 60 : _ref$leaveTime,
|
|
1282
1282
|
_ref$clearTime = _ref.clearTime,
|
|
1283
|
-
clearTime = _ref$clearTime ===
|
|
1283
|
+
clearTime = _ref$clearTime === void 0 ? 60 : _ref$clearTime,
|
|
1284
1284
|
_ref$name = _ref.name,
|
|
1285
|
-
name = _ref$name ===
|
|
1285
|
+
name = _ref$name === void 0 ? 'transition' : _ref$name,
|
|
1286
1286
|
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
1287
1287
|
var _useState = React.useState(''),
|
|
1288
1288
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1383,18 +1383,18 @@ var _excluded$6 = ["children", "onClick", "visible", "width", "onContentClick",
|
|
|
1383
1383
|
var Backdrop = /*#__PURE__*/React.memo(function (_ref) {
|
|
1384
1384
|
var children = _ref.children,
|
|
1385
1385
|
_ref$onClick = _ref.onClick,
|
|
1386
|
-
onClick = _ref$onClick ===
|
|
1386
|
+
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
1387
1387
|
_ref$visible = _ref.visible,
|
|
1388
|
-
visible = _ref$visible ===
|
|
1388
|
+
visible = _ref$visible === void 0 ? false : _ref$visible,
|
|
1389
1389
|
width = _ref.width,
|
|
1390
1390
|
_ref$onContentClick = _ref.onContentClick,
|
|
1391
|
-
onContentClick = _ref$onContentClick ===
|
|
1391
|
+
onContentClick = _ref$onContentClick === void 0 ? function () {} : _ref$onContentClick,
|
|
1392
1392
|
_ref$backdropClassNam = _ref.backdropClassName,
|
|
1393
|
-
backdropClassName = _ref$backdropClassNam ===
|
|
1393
|
+
backdropClassName = _ref$backdropClassNam === void 0 ? '' : _ref$backdropClassNam,
|
|
1394
1394
|
_ref$positionClassNam = _ref.positionClassName,
|
|
1395
|
-
positionClassName = _ref$positionClassNam ===
|
|
1395
|
+
positionClassName = _ref$positionClassNam === void 0 ? '' : _ref$positionClassNam,
|
|
1396
1396
|
_ref$layerClassName = _ref.layerClassName,
|
|
1397
|
-
layerClassName = _ref$layerClassName ===
|
|
1397
|
+
layerClassName = _ref$layerClassName === void 0 ? '' : _ref$layerClassName,
|
|
1398
1398
|
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
1399
1399
|
var theme = useTheme();
|
|
1400
1400
|
var _useCurrentState = useCurrentState(false),
|
|
@@ -1560,9 +1560,9 @@ var withScale = function withScale(Render) {
|
|
|
1560
1560
|
margin = props.margin,
|
|
1561
1561
|
padding = props.padding,
|
|
1562
1562
|
_props$unit = props.unit,
|
|
1563
|
-
unit = _props$unit ===
|
|
1563
|
+
unit = _props$unit === void 0 ? layout.unit : _props$unit,
|
|
1564
1564
|
_props$scale = props.scale,
|
|
1565
|
-
scale = _props$scale ===
|
|
1565
|
+
scale = _props$scale === void 0 ? 1 : _props$scale;
|
|
1566
1566
|
var makeScaleHandler = function makeScaleHandler(attrValue) {
|
|
1567
1567
|
return function (scale1x, defaultValue) {
|
|
1568
1568
|
// 0 means disable scale and the default value is 0
|
|
@@ -1583,20 +1583,20 @@ var withScale = function withScale(Render) {
|
|
|
1583
1583
|
var value = {
|
|
1584
1584
|
unit: unit,
|
|
1585
1585
|
SCALES: {
|
|
1586
|
-
pt: makeScaleHandler((_ref2 = (_ref3 = paddingTop !== null && paddingTop !==
|
|
1587
|
-
pr: makeScaleHandler((_ref4 = (_ref5 = paddingRight !== null && paddingRight !==
|
|
1588
|
-
pb: makeScaleHandler((_ref6 = (_ref7 = paddingBottom !== null && paddingBottom !==
|
|
1589
|
-
pl: makeScaleHandler((_ref8 = (_ref9 = paddingLeft !== null && paddingLeft !==
|
|
1590
|
-
px: makeScaleHandler((_ref10 = (_ref11 = (_ref12 = (_ref13 = px !== null && px !==
|
|
1591
|
-
py: makeScaleHandler((_ref14 = (_ref15 = (_ref16 = (_ref17 = py !== null && py !==
|
|
1592
|
-
mt: makeScaleHandler((_ref18 = (_ref19 = marginTop !== null && marginTop !==
|
|
1593
|
-
mr: makeScaleHandler((_ref20 = (_ref21 = marginRight !== null && marginRight !==
|
|
1594
|
-
mb: makeScaleHandler((_ref22 = (_ref23 = marginBottom !== null && marginBottom !==
|
|
1595
|
-
ml: makeScaleHandler((_ref24 = (_ref25 = marginLeft !== null && marginLeft !==
|
|
1596
|
-
mx: makeScaleHandler((_ref26 = (_ref27 = (_ref28 = (_ref29 = mx !== null && mx !==
|
|
1597
|
-
my: makeScaleHandler((_ref30 = (_ref31 = (_ref32 = (_ref33 = my !== null && my !==
|
|
1598
|
-
width: makeScaleHandler(width !== null && width !==
|
|
1599
|
-
height: makeScaleHandler(height !== null && height !==
|
|
1586
|
+
pt: makeScaleHandler((_ref2 = (_ref3 = paddingTop !== null && paddingTop !== void 0 ? paddingTop : pt) !== null && _ref3 !== void 0 ? _ref3 : py) !== null && _ref2 !== void 0 ? _ref2 : padding),
|
|
1587
|
+
pr: makeScaleHandler((_ref4 = (_ref5 = paddingRight !== null && paddingRight !== void 0 ? paddingRight : pr) !== null && _ref5 !== void 0 ? _ref5 : px) !== null && _ref4 !== void 0 ? _ref4 : padding),
|
|
1588
|
+
pb: makeScaleHandler((_ref6 = (_ref7 = paddingBottom !== null && paddingBottom !== void 0 ? paddingBottom : pb) !== null && _ref7 !== void 0 ? _ref7 : py) !== null && _ref6 !== void 0 ? _ref6 : padding),
|
|
1589
|
+
pl: makeScaleHandler((_ref8 = (_ref9 = paddingLeft !== null && paddingLeft !== void 0 ? paddingLeft : pl) !== null && _ref9 !== void 0 ? _ref9 : px) !== null && _ref8 !== void 0 ? _ref8 : padding),
|
|
1590
|
+
px: makeScaleHandler((_ref10 = (_ref11 = (_ref12 = (_ref13 = px !== null && px !== void 0 ? px : paddingLeft) !== null && _ref13 !== void 0 ? _ref13 : paddingRight) !== null && _ref12 !== void 0 ? _ref12 : pl) !== null && _ref11 !== void 0 ? _ref11 : pr) !== null && _ref10 !== void 0 ? _ref10 : padding),
|
|
1591
|
+
py: makeScaleHandler((_ref14 = (_ref15 = (_ref16 = (_ref17 = py !== null && py !== void 0 ? py : paddingTop) !== null && _ref17 !== void 0 ? _ref17 : paddingBottom) !== null && _ref16 !== void 0 ? _ref16 : pt) !== null && _ref15 !== void 0 ? _ref15 : pb) !== null && _ref14 !== void 0 ? _ref14 : padding),
|
|
1592
|
+
mt: makeScaleHandler((_ref18 = (_ref19 = marginTop !== null && marginTop !== void 0 ? marginTop : mt) !== null && _ref19 !== void 0 ? _ref19 : my) !== null && _ref18 !== void 0 ? _ref18 : margin),
|
|
1593
|
+
mr: makeScaleHandler((_ref20 = (_ref21 = marginRight !== null && marginRight !== void 0 ? marginRight : mr) !== null && _ref21 !== void 0 ? _ref21 : mx) !== null && _ref20 !== void 0 ? _ref20 : margin),
|
|
1594
|
+
mb: makeScaleHandler((_ref22 = (_ref23 = marginBottom !== null && marginBottom !== void 0 ? marginBottom : mb) !== null && _ref23 !== void 0 ? _ref23 : my) !== null && _ref22 !== void 0 ? _ref22 : margin),
|
|
1595
|
+
ml: makeScaleHandler((_ref24 = (_ref25 = marginLeft !== null && marginLeft !== void 0 ? marginLeft : ml) !== null && _ref25 !== void 0 ? _ref25 : mx) !== null && _ref24 !== void 0 ? _ref24 : margin),
|
|
1596
|
+
mx: makeScaleHandler((_ref26 = (_ref27 = (_ref28 = (_ref29 = mx !== null && mx !== void 0 ? mx : marginLeft) !== null && _ref29 !== void 0 ? _ref29 : marginRight) !== null && _ref28 !== void 0 ? _ref28 : ml) !== null && _ref27 !== void 0 ? _ref27 : mr) !== null && _ref26 !== void 0 ? _ref26 : margin),
|
|
1597
|
+
my: makeScaleHandler((_ref30 = (_ref31 = (_ref32 = (_ref33 = my !== null && my !== void 0 ? my : marginTop) !== null && _ref33 !== void 0 ? _ref33 : marginBottom) !== null && _ref32 !== void 0 ? _ref32 : mt) !== null && _ref31 !== void 0 ? _ref31 : mb) !== null && _ref30 !== void 0 ? _ref30 : margin),
|
|
1598
|
+
width: makeScaleHandler(width !== null && width !== void 0 ? width : w),
|
|
1599
|
+
height: makeScaleHandler(height !== null && height !== void 0 ? height : h),
|
|
1600
1600
|
font: makeScaleHandler(font)
|
|
1601
1601
|
},
|
|
1602
1602
|
getScaleProps: generateGetScaleProps(props),
|
|
@@ -1657,10 +1657,10 @@ var getDrawerTransform = function getDrawerTransform(placement) {
|
|
|
1657
1657
|
var _excluded$4 = ["className", "children", "visible", "placement"];
|
|
1658
1658
|
var DrawerWrapper = function DrawerWrapper(_ref) {
|
|
1659
1659
|
var _ref$className = _ref.className,
|
|
1660
|
-
className = _ref$className ===
|
|
1660
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1661
1661
|
children = _ref.children,
|
|
1662
1662
|
_ref$visible = _ref.visible,
|
|
1663
|
-
visible = _ref$visible ===
|
|
1663
|
+
visible = _ref$visible === void 0 ? false : _ref$visible,
|
|
1664
1664
|
placement = _ref.placement,
|
|
1665
1665
|
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
1666
1666
|
var theme = useTheme();
|
|
@@ -1726,16 +1726,16 @@ var _excluded$3 = ["visible", "keyboard", "disableBackdropClick", "onClose", "on
|
|
|
1726
1726
|
var DrawerComponent = function DrawerComponent(_ref) {
|
|
1727
1727
|
var customVisible = _ref.visible,
|
|
1728
1728
|
_ref$keyboard = _ref.keyboard,
|
|
1729
|
-
keyboard = _ref$keyboard ===
|
|
1729
|
+
keyboard = _ref$keyboard === void 0 ? true : _ref$keyboard,
|
|
1730
1730
|
_ref$disableBackdropC = _ref.disableBackdropClick,
|
|
1731
|
-
disableBackdropClick = _ref$disableBackdropC ===
|
|
1731
|
+
disableBackdropClick = _ref$disableBackdropC === void 0 ? false : _ref$disableBackdropC,
|
|
1732
1732
|
onClose = _ref.onClose,
|
|
1733
1733
|
onContentClick = _ref.onContentClick,
|
|
1734
1734
|
_ref$wrapClassName = _ref.wrapClassName,
|
|
1735
|
-
wrapClassName = _ref$wrapClassName ===
|
|
1735
|
+
wrapClassName = _ref$wrapClassName === void 0 ? '' : _ref$wrapClassName,
|
|
1736
1736
|
children = _ref.children,
|
|
1737
1737
|
_ref$placement = _ref.placement,
|
|
1738
|
-
placement = _ref$placement ===
|
|
1738
|
+
placement = _ref$placement === void 0 ? 'right' : _ref$placement,
|
|
1739
1739
|
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
1740
1740
|
var portal = usePortal('drawer');
|
|
1741
1741
|
var _useState = React.useState(false),
|
|
@@ -1784,7 +1784,7 @@ DrawerComponent.displayName = 'Drawer';
|
|
|
1784
1784
|
var _excluded$2 = ["className", "children"];
|
|
1785
1785
|
var ModalTitleComponent = function ModalTitleComponent(_ref) {
|
|
1786
1786
|
var _ref$className = _ref.className,
|
|
1787
|
-
className = _ref$className ===
|
|
1787
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1788
1788
|
children = _ref.children,
|
|
1789
1789
|
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
1790
1790
|
var theme = useTheme();
|
|
@@ -1803,7 +1803,7 @@ var ModalTitle = withScale(ModalTitleComponent);
|
|
|
1803
1803
|
var _excluded$1 = ["className", "children"];
|
|
1804
1804
|
var ModalSubtitleComponent = function ModalSubtitleComponent(_ref) {
|
|
1805
1805
|
var _ref$className = _ref.className,
|
|
1806
|
-
className = _ref$className ===
|
|
1806
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1807
1807
|
children = _ref.children,
|
|
1808
1808
|
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
1809
1809
|
var theme = useTheme();
|
|
@@ -1822,7 +1822,7 @@ var ModalSubtitle = withScale(ModalSubtitleComponent);
|
|
|
1822
1822
|
var _excluded = ["className", "children"];
|
|
1823
1823
|
var ModalContentComponent = function ModalContentComponent(_ref) {
|
|
1824
1824
|
var _ref$className = _ref.className,
|
|
1825
|
-
className = _ref$className ===
|
|
1825
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1826
1826
|
children = _ref.children,
|
|
1827
1827
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
1828
1828
|
var _useScale = useScale(),
|
package/dist/fieldset/index.js
CHANGED
|
@@ -166,8 +166,8 @@ function _toConsumableArray(r) {
|
|
|
166
166
|
function _toPrimitive(t, r) {
|
|
167
167
|
if ("object" != typeof t || !t) return t;
|
|
168
168
|
var e = t[Symbol.toPrimitive];
|
|
169
|
-
if (
|
|
170
|
-
var i = e.call(t, r
|
|
169
|
+
if (void 0 !== e) {
|
|
170
|
+
var i = e.call(t, r);
|
|
171
171
|
if ("object" != typeof i) return i;
|
|
172
172
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
173
173
|
}
|
|
@@ -190,7 +190,7 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
190
190
|
if (r) {
|
|
191
191
|
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
192
192
|
var t = {}.toString.call(r).slice(8, -1);
|
|
193
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) :
|
|
193
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
|
|
@@ -224,7 +224,7 @@ function requireIndex () {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
227
|
-
_defineProperties(Constructor.prototype, protoProps);
|
|
227
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
228
228
|
return Constructor;
|
|
229
229
|
}
|
|
230
230
|
var isProd = typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production";
|
|
@@ -233,7 +233,7 @@ function requireIndex () {
|
|
|
233
233
|
};
|
|
234
234
|
var StyleSheet = /*#__PURE__*/ function() {
|
|
235
235
|
function StyleSheet(param) {
|
|
236
|
-
var ref = param ===
|
|
236
|
+
var ref = param === void 0 ? {} : param, _name = ref.name, name = _name === void 0 ? "stylesheet" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? isProd : _optimizeForSpeed;
|
|
237
237
|
invariant$1(isString(name), "`name` must be a string");
|
|
238
238
|
this._name = name;
|
|
239
239
|
this._deletedRulePlaceholder = "#" + name + "-deleted-rule____{}";
|
|
@@ -491,7 +491,7 @@ function requireIndex () {
|
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
function mapRulesToStyle(cssRules, options) {
|
|
494
|
-
if (options ===
|
|
494
|
+
if (options === void 0) options = {};
|
|
495
495
|
return cssRules.map(function(args) {
|
|
496
496
|
var id = args[0];
|
|
497
497
|
var css = args[1];
|
|
@@ -508,7 +508,7 @@ function requireIndex () {
|
|
|
508
508
|
}
|
|
509
509
|
var StyleSheetRegistry = /*#__PURE__*/ function() {
|
|
510
510
|
function StyleSheetRegistry(param) {
|
|
511
|
-
var ref = param ===
|
|
511
|
+
var ref = param === void 0 ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === void 0 ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? false : _optimizeForSpeed;
|
|
512
512
|
this._sheet = styleSheet || new StyleSheet({
|
|
513
513
|
name: "styled-jsx",
|
|
514
514
|
optimizeForSpeed: optimizeForSpeed
|
|
@@ -1003,7 +1003,7 @@ var useClasses = function useClasses() {
|
|
|
1003
1003
|
var _excluded$6 = ["className", "children"];
|
|
1004
1004
|
var FieldsetTitle = function FieldsetTitle(_ref) {
|
|
1005
1005
|
var _ref$className = _ref.className,
|
|
1006
|
-
className = _ref$className ===
|
|
1006
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1007
1007
|
children = _ref.children,
|
|
1008
1008
|
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
1009
1009
|
var classes = useClasses('title', className);
|
|
@@ -1018,7 +1018,7 @@ FieldsetTitle.displayName = 'FieldsetTitle';
|
|
|
1018
1018
|
var _excluded$5 = ["className", "children"];
|
|
1019
1019
|
var FieldsetSubtitle = function FieldsetSubtitle(_ref) {
|
|
1020
1020
|
var _ref$className = _ref.className,
|
|
1021
|
-
className = _ref$className ===
|
|
1021
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1022
1022
|
children = _ref.children,
|
|
1023
1023
|
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
1024
1024
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
@@ -1179,9 +1179,9 @@ var withScale = function withScale(Render) {
|
|
|
1179
1179
|
margin = props.margin,
|
|
1180
1180
|
padding = props.padding,
|
|
1181
1181
|
_props$unit = props.unit,
|
|
1182
|
-
unit = _props$unit ===
|
|
1182
|
+
unit = _props$unit === void 0 ? layout.unit : _props$unit,
|
|
1183
1183
|
_props$scale = props.scale,
|
|
1184
|
-
scale = _props$scale ===
|
|
1184
|
+
scale = _props$scale === void 0 ? 1 : _props$scale;
|
|
1185
1185
|
var makeScaleHandler = function makeScaleHandler(attrValue) {
|
|
1186
1186
|
return function (scale1x, defaultValue) {
|
|
1187
1187
|
// 0 means disable scale and the default value is 0
|
|
@@ -1202,20 +1202,20 @@ var withScale = function withScale(Render) {
|
|
|
1202
1202
|
var value = {
|
|
1203
1203
|
unit: unit,
|
|
1204
1204
|
SCALES: {
|
|
1205
|
-
pt: makeScaleHandler((_ref2 = (_ref3 = paddingTop !== null && paddingTop !==
|
|
1206
|
-
pr: makeScaleHandler((_ref4 = (_ref5 = paddingRight !== null && paddingRight !==
|
|
1207
|
-
pb: makeScaleHandler((_ref6 = (_ref7 = paddingBottom !== null && paddingBottom !==
|
|
1208
|
-
pl: makeScaleHandler((_ref8 = (_ref9 = paddingLeft !== null && paddingLeft !==
|
|
1209
|
-
px: makeScaleHandler((_ref10 = (_ref11 = (_ref12 = (_ref13 = px !== null && px !==
|
|
1210
|
-
py: makeScaleHandler((_ref14 = (_ref15 = (_ref16 = (_ref17 = py !== null && py !==
|
|
1211
|
-
mt: makeScaleHandler((_ref18 = (_ref19 = marginTop !== null && marginTop !==
|
|
1212
|
-
mr: makeScaleHandler((_ref20 = (_ref21 = marginRight !== null && marginRight !==
|
|
1213
|
-
mb: makeScaleHandler((_ref22 = (_ref23 = marginBottom !== null && marginBottom !==
|
|
1214
|
-
ml: makeScaleHandler((_ref24 = (_ref25 = marginLeft !== null && marginLeft !==
|
|
1215
|
-
mx: makeScaleHandler((_ref26 = (_ref27 = (_ref28 = (_ref29 = mx !== null && mx !==
|
|
1216
|
-
my: makeScaleHandler((_ref30 = (_ref31 = (_ref32 = (_ref33 = my !== null && my !==
|
|
1217
|
-
width: makeScaleHandler(width !== null && width !==
|
|
1218
|
-
height: makeScaleHandler(height !== null && height !==
|
|
1205
|
+
pt: makeScaleHandler((_ref2 = (_ref3 = paddingTop !== null && paddingTop !== void 0 ? paddingTop : pt) !== null && _ref3 !== void 0 ? _ref3 : py) !== null && _ref2 !== void 0 ? _ref2 : padding),
|
|
1206
|
+
pr: makeScaleHandler((_ref4 = (_ref5 = paddingRight !== null && paddingRight !== void 0 ? paddingRight : pr) !== null && _ref5 !== void 0 ? _ref5 : px) !== null && _ref4 !== void 0 ? _ref4 : padding),
|
|
1207
|
+
pb: makeScaleHandler((_ref6 = (_ref7 = paddingBottom !== null && paddingBottom !== void 0 ? paddingBottom : pb) !== null && _ref7 !== void 0 ? _ref7 : py) !== null && _ref6 !== void 0 ? _ref6 : padding),
|
|
1208
|
+
pl: makeScaleHandler((_ref8 = (_ref9 = paddingLeft !== null && paddingLeft !== void 0 ? paddingLeft : pl) !== null && _ref9 !== void 0 ? _ref9 : px) !== null && _ref8 !== void 0 ? _ref8 : padding),
|
|
1209
|
+
px: makeScaleHandler((_ref10 = (_ref11 = (_ref12 = (_ref13 = px !== null && px !== void 0 ? px : paddingLeft) !== null && _ref13 !== void 0 ? _ref13 : paddingRight) !== null && _ref12 !== void 0 ? _ref12 : pl) !== null && _ref11 !== void 0 ? _ref11 : pr) !== null && _ref10 !== void 0 ? _ref10 : padding),
|
|
1210
|
+
py: makeScaleHandler((_ref14 = (_ref15 = (_ref16 = (_ref17 = py !== null && py !== void 0 ? py : paddingTop) !== null && _ref17 !== void 0 ? _ref17 : paddingBottom) !== null && _ref16 !== void 0 ? _ref16 : pt) !== null && _ref15 !== void 0 ? _ref15 : pb) !== null && _ref14 !== void 0 ? _ref14 : padding),
|
|
1211
|
+
mt: makeScaleHandler((_ref18 = (_ref19 = marginTop !== null && marginTop !== void 0 ? marginTop : mt) !== null && _ref19 !== void 0 ? _ref19 : my) !== null && _ref18 !== void 0 ? _ref18 : margin),
|
|
1212
|
+
mr: makeScaleHandler((_ref20 = (_ref21 = marginRight !== null && marginRight !== void 0 ? marginRight : mr) !== null && _ref21 !== void 0 ? _ref21 : mx) !== null && _ref20 !== void 0 ? _ref20 : margin),
|
|
1213
|
+
mb: makeScaleHandler((_ref22 = (_ref23 = marginBottom !== null && marginBottom !== void 0 ? marginBottom : mb) !== null && _ref23 !== void 0 ? _ref23 : my) !== null && _ref22 !== void 0 ? _ref22 : margin),
|
|
1214
|
+
ml: makeScaleHandler((_ref24 = (_ref25 = marginLeft !== null && marginLeft !== void 0 ? marginLeft : ml) !== null && _ref25 !== void 0 ? _ref25 : mx) !== null && _ref24 !== void 0 ? _ref24 : margin),
|
|
1215
|
+
mx: makeScaleHandler((_ref26 = (_ref27 = (_ref28 = (_ref29 = mx !== null && mx !== void 0 ? mx : marginLeft) !== null && _ref29 !== void 0 ? _ref29 : marginRight) !== null && _ref28 !== void 0 ? _ref28 : ml) !== null && _ref27 !== void 0 ? _ref27 : mr) !== null && _ref26 !== void 0 ? _ref26 : margin),
|
|
1216
|
+
my: makeScaleHandler((_ref30 = (_ref31 = (_ref32 = (_ref33 = my !== null && my !== void 0 ? my : marginTop) !== null && _ref33 !== void 0 ? _ref33 : marginBottom) !== null && _ref32 !== void 0 ? _ref32 : mt) !== null && _ref31 !== void 0 ? _ref31 : mb) !== null && _ref30 !== void 0 ? _ref30 : margin),
|
|
1217
|
+
width: makeScaleHandler(width !== null && width !== void 0 ? width : w),
|
|
1218
|
+
height: makeScaleHandler(height !== null && height !== void 0 ? height : h),
|
|
1219
1219
|
font: makeScaleHandler(font)
|
|
1220
1220
|
},
|
|
1221
1221
|
getScaleProps: generateGetScaleProps(props),
|
|
@@ -1234,7 +1234,7 @@ var withScale = function withScale(Render) {
|
|
|
1234
1234
|
var _excluded$3 = ["className", "children"];
|
|
1235
1235
|
var FieldsetFooterComponent = function FieldsetFooterComponent(_ref) {
|
|
1236
1236
|
var _ref$className = _ref.className,
|
|
1237
|
-
className = _ref$className ===
|
|
1237
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1238
1238
|
children = _ref.children,
|
|
1239
1239
|
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
1240
1240
|
var theme = useTheme();
|
|
@@ -1253,7 +1253,7 @@ var FieldsetFooter = withScale(FieldsetFooterComponent);
|
|
|
1253
1253
|
var _excluded$2 = ["className", "children"];
|
|
1254
1254
|
var FieldsetContentComponent = function FieldsetContentComponent(_ref) {
|
|
1255
1255
|
var _ref$className = _ref.className,
|
|
1256
|
-
className = _ref$className ===
|
|
1256
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1257
1257
|
children = _ref.children,
|
|
1258
1258
|
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
1259
1259
|
var _useScale = useScale(),
|
|
@@ -1296,16 +1296,16 @@ var useWarning = function useWarning(message, component) {
|
|
|
1296
1296
|
var _excluded$1 = ["className", "title", "subtitle", "children", "value", "label"];
|
|
1297
1297
|
var FieldsetComponent = function FieldsetComponent(_ref) {
|
|
1298
1298
|
var _ref$className = _ref.className,
|
|
1299
|
-
className = _ref$className ===
|
|
1299
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1300
1300
|
_ref$title = _ref.title,
|
|
1301
|
-
title = _ref$title ===
|
|
1301
|
+
title = _ref$title === void 0 ? '' : _ref$title,
|
|
1302
1302
|
_ref$subtitle = _ref.subtitle,
|
|
1303
|
-
subtitle = _ref$subtitle ===
|
|
1303
|
+
subtitle = _ref$subtitle === void 0 ? '' : _ref$subtitle,
|
|
1304
1304
|
children = _ref.children,
|
|
1305
1305
|
_ref$value = _ref.value,
|
|
1306
|
-
value = _ref$value ===
|
|
1306
|
+
value = _ref$value === void 0 ? '' : _ref$value,
|
|
1307
1307
|
_ref$label = _ref.label,
|
|
1308
|
-
label = _ref$label ===
|
|
1308
|
+
label = _ref$label === void 0 ? '' : _ref$label,
|
|
1309
1309
|
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
1310
1310
|
var theme = useTheme();
|
|
1311
1311
|
var _useScale = useScale(),
|
|
@@ -1382,7 +1382,7 @@ var useCurrentState = function useCurrentState(initialState) {
|
|
|
1382
1382
|
var _excluded = ["className", "children", "value", "onChange"];
|
|
1383
1383
|
var FieldsetGroupComponent = function FieldsetGroupComponent(_ref) {
|
|
1384
1384
|
var _ref$className = _ref.className,
|
|
1385
|
-
className = _ref$className ===
|
|
1385
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1386
1386
|
children = _ref.children,
|
|
1387
1387
|
value = _ref.value,
|
|
1388
1388
|
onChange = _ref.onChange,
|
|
@@ -3,8 +3,8 @@ import { FieldConfig } from './Field';
|
|
|
3
3
|
import { FieldHelperProps, FieldInputProps, FieldMetaProps, FormikConfig, FormikErrors, FormikState, FormikTouched, FormikValues } from './types';
|
|
4
4
|
export declare function useFormik<Values extends FormikValues = FormikValues>({ validateOnChange, validateOnBlur, validateOnMount, isInitialValid, enableReinitialize, onSubmit, ...rest }: FormikConfig<Values>): {
|
|
5
5
|
initialValues: Values;
|
|
6
|
-
initialErrors: FormikErrors<
|
|
7
|
-
initialTouched: FormikTouched<
|
|
6
|
+
initialErrors: FormikErrors<any>;
|
|
7
|
+
initialTouched: FormikTouched<any>;
|
|
8
8
|
initialStatus: any;
|
|
9
9
|
handleBlur: {
|
|
10
10
|
(e: React.FocusEvent<any>): void;
|
|
@@ -19,15 +19,15 @@ export declare function useFormik<Values extends FormikValues = FormikValues>({
|
|
|
19
19
|
resetForm: (nextState?: Partial<FormikState<Values>>) => void;
|
|
20
20
|
setErrors: (errors: FormikErrors<Values>) => void;
|
|
21
21
|
setFormikState: (stateOrCb: FormikState<Values> | ((state: FormikState<Values>) => FormikState<Values>)) => void;
|
|
22
|
-
setFieldTouched: (field: string, touched?: boolean, shouldValidate?: boolean) => Promise<void> | Promise<
|
|
23
|
-
setFieldValue: (field: string, value: any, shouldValidate?: boolean) => Promise<void> | Promise<
|
|
22
|
+
setFieldTouched: (field: string, touched?: boolean, shouldValidate?: boolean) => Promise<void> | Promise<FormikErrors<Values>>;
|
|
23
|
+
setFieldValue: (field: string, value: any, shouldValidate?: boolean) => Promise<void> | Promise<FormikErrors<Values>>;
|
|
24
24
|
setFieldError: (field: string, value: string | undefined) => void;
|
|
25
25
|
setStatus: (status: any) => void;
|
|
26
26
|
setSubmitting: (isSubmitting: boolean) => void;
|
|
27
|
-
setTouched: (touched: FormikTouched<Values>, shouldValidate?: boolean) => Promise<void> | Promise<
|
|
28
|
-
setValues: (values: React.SetStateAction<Values>, shouldValidate?: boolean) => Promise<void> | Promise<
|
|
27
|
+
setTouched: (touched: FormikTouched<Values>, shouldValidate?: boolean) => Promise<void> | Promise<FormikErrors<Values>>;
|
|
28
|
+
setValues: (values: React.SetStateAction<Values>, shouldValidate?: boolean) => Promise<void> | Promise<FormikErrors<Values>>;
|
|
29
29
|
submitForm: () => Promise<any>;
|
|
30
|
-
validateForm: (values?: Values) => Promise<
|
|
30
|
+
validateForm: (values?: Values) => Promise<FormikErrors<Values>>;
|
|
31
31
|
validateField: (name: string) => Promise<void> | Promise<string | undefined>;
|
|
32
32
|
isValid: boolean;
|
|
33
33
|
dirty: boolean;
|
package/dist/form/connect.d.ts
CHANGED