@app-studio/web 0.3.37 → 0.3.39
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/components/Button/Button/Button.props.d.ts +11 -2
- package/dist/web.cjs.development.js +15 -7
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +15 -7
- package/dist/web.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/web.esm.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect, useMemo, useCallback, Fragment } from 'react';
|
|
2
2
|
import { View as View$1, Element, Typography, useTheme, Input, Image } from 'app-studio';
|
|
3
3
|
import { Link as Link$1 } from 'react-router-dom';
|
|
4
|
+
import { Loader as Loader$1 } from 'src/components/Loader/Loader';
|
|
5
|
+
import { Horizontal as Horizontal$1 } from 'src/components/Layout/Horizontal/Horizontal';
|
|
4
6
|
import format from 'date-fns/format';
|
|
5
7
|
import { create } from 'zustand';
|
|
6
8
|
|
|
@@ -561,7 +563,7 @@ var IconSizes$1 = {
|
|
|
561
563
|
}
|
|
562
564
|
};
|
|
563
565
|
|
|
564
|
-
var _excluded$b = ["icon", "shadow", "children", "ariaLabel", "externalHref", "isAuto", "isFilled", "isIconRounded", "
|
|
566
|
+
var _excluded$b = ["icon", "shadow", "children", "ariaLabel", "externalHref", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "colorScheme", "shape", "onClick", "loaderProps", "loaderPosition"];
|
|
565
567
|
var ButtonView = function ButtonView(_ref) {
|
|
566
568
|
var _props$onClick;
|
|
567
569
|
var icon = _ref.icon,
|
|
@@ -575,8 +577,8 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
575
577
|
isFilled = _ref$isFilled === void 0 ? false : _ref$isFilled,
|
|
576
578
|
_ref$isIconRounded = _ref.isIconRounded,
|
|
577
579
|
isIconRounded = _ref$isIconRounded === void 0 ? false : _ref$isIconRounded,
|
|
578
|
-
_ref$
|
|
579
|
-
|
|
580
|
+
_ref$isLoading = _ref.isLoading,
|
|
581
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
580
582
|
_ref$isDisabled = _ref.isDisabled,
|
|
581
583
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
582
584
|
_ref$size = _ref.size,
|
|
@@ -591,8 +593,12 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
591
593
|
shape = _ref$shape === void 0 ? 'rounded' : _ref$shape,
|
|
592
594
|
_ref$onClick = _ref.onClick,
|
|
593
595
|
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
596
|
+
_ref$loaderProps = _ref.loaderProps,
|
|
597
|
+
loaderProps = _ref$loaderProps === void 0 ? {} : _ref$loaderProps,
|
|
598
|
+
_ref$loaderPosition = _ref.loaderPosition,
|
|
599
|
+
loaderPosition = _ref$loaderPosition === void 0 ? 'left' : _ref$loaderPosition,
|
|
594
600
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
595
|
-
var isActive = !(isDisabled ||
|
|
601
|
+
var isActive = !(isDisabled || isLoading);
|
|
596
602
|
var defaultNativeProps = {
|
|
597
603
|
disabled: !isActive
|
|
598
604
|
};
|
|
@@ -629,7 +635,9 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
629
635
|
var changePadding = {
|
|
630
636
|
padding: isIconRounded ? IconSizes$1[size].padding : ButtonSizes[size].padding
|
|
631
637
|
};
|
|
632
|
-
var content = React.createElement(
|
|
638
|
+
var content = React.createElement(Horizontal$1, {
|
|
639
|
+
gap: 4
|
|
640
|
+
}, isLoading && loaderPosition === 'left' && React.createElement(Loader$1, Object.assign({}, loaderProps)), icon && iconPosition === 'left' && !isLoading && icon, children, icon && iconPosition === 'right' && !isLoading && icon, isLoading && loaderPosition === 'right' && React.createElement(Loader$1, Object.assign({}, loaderProps)));
|
|
633
641
|
return React.createElement(Element, Object.assign({
|
|
634
642
|
gap: 8,
|
|
635
643
|
as: "button",
|
|
@@ -3359,7 +3367,7 @@ var PasswordComponent = function PasswordComponent(_ref) {
|
|
|
3359
3367
|
isVisible = _usePasswordState.isVisible,
|
|
3360
3368
|
setIsVisible = _usePasswordState.setIsVisible,
|
|
3361
3369
|
passwordState = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2);
|
|
3362
|
-
return React.createElement(TextFieldView, Object.assign({
|
|
3370
|
+
return React.createElement(TextFieldView, Object.assign({}, props, passwordState, {
|
|
3363
3371
|
type: isVisible ? 'text' : 'password',
|
|
3364
3372
|
isClearable: false,
|
|
3365
3373
|
rightChild: React.createElement(View$1, {
|
|
@@ -3369,7 +3377,7 @@ var PasswordComponent = function PasswordComponent(_ref) {
|
|
|
3369
3377
|
}
|
|
3370
3378
|
}
|
|
3371
3379
|
}, isVisible ? visibleIcon : hiddenIcon)
|
|
3372
|
-
}
|
|
3380
|
+
}));
|
|
3373
3381
|
};
|
|
3374
3382
|
/**
|
|
3375
3383
|
* To allow users to securely enter sensitive information
|