esewa-ui-library 1.0.4 → 1.0.5
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 +56 -1
- package/dist/components/Radio/eSewaRadio.d.ts +5 -3
- package/dist/index.js +20 -12
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +20 -12
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -7094,18 +7094,22 @@ var EsewaFullPageLoadingScreen = function EsewaFullPageLoadingScreen(_ref) {
|
|
|
7094
7094
|
};
|
|
7095
7095
|
|
|
7096
7096
|
var _templateObject$l;
|
|
7097
|
-
var StyledRadio = styled.div(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose(["\n .container{\n display:flex;\n align-items: center;\n gap: 8px;\n }\n\n .container input[type=\"radio\" i] {\n margin: 0;\n appearance: none;\n width: 16px;\n height: 16px;\n border: 2px solid var(--secondary);\n border-radius: 50%;\n position: relative;\n cursor: pointer;\n transition: border-color 0.3s ease;\n }\n\n .container input[type=\"radio\"]:checked {\n border-color: var(--primary);\n }\n\n .container input[type=\"radio\"]::before {\n content: '';\n width: 10px;\n height: 10px;\n background-color: transparent;\n border-radius: 50%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n transition: background-color 0.3s ease;\n }\n\n .container input[type=\"radio\"]:checked::before {\n background-color: var(--primary);\n }\n"])));
|
|
7097
|
+
var StyledRadio = styled.div(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose(["\n .container{\n display:flex;\n align-items: center;\n gap: 8px;\n }\n\n .container input[type=\"radio\" i] {\n margin: 0;\n appearance: none;\n width: 16px;\n height: 16px;\n border: 2px solid var(--secondary);\n border-radius: 50%;\n position: relative;\n cursor: pointer;\n transition: border-color 0.3s ease;\n }\n\n .container input[type=\"radio\"]:checked {\n border-color: var(--primary);\n }\n\n .container input[type=\"radio\"]::before {\n content: '';\n width: 10px;\n height: 10px;\n background-color: transparent;\n border-radius: 50%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n transition: background-color 0.3s ease;\n }\n\n .container input[type=\"radio\"]:checked::before {\n background-color: var(--primary);\n }\n\n .container input[type=\"radio\"]:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n"])));
|
|
7098
7098
|
var ESewaRadio = function ESewaRadio(_ref) {
|
|
7099
7099
|
var label = _ref.label,
|
|
7100
|
+
value = _ref.value,
|
|
7100
7101
|
name = _ref.name,
|
|
7101
7102
|
className = _ref.className,
|
|
7102
7103
|
_ref$labelClass = _ref.labelClass,
|
|
7103
7104
|
labelClass = _ref$labelClass === void 0 ? '' : _ref$labelClass,
|
|
7104
7105
|
onChange = _ref.onChange,
|
|
7105
|
-
checked = _ref.checked
|
|
7106
|
+
_ref$checked = _ref.checked,
|
|
7107
|
+
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
7108
|
+
_ref$disabled = _ref.disabled,
|
|
7109
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
7106
7110
|
var handleRadioChange = function handleRadioChange(e) {
|
|
7107
|
-
if (onChange) {
|
|
7108
|
-
onChange(e.target.checked);
|
|
7111
|
+
if (onChange && !disabled) {
|
|
7112
|
+
onChange(value, e.target.checked);
|
|
7109
7113
|
}
|
|
7110
7114
|
};
|
|
7111
7115
|
return React__default.createElement(StyledRadio, null, React__default.createElement("div", {
|
|
@@ -7115,8 +7119,10 @@ var ESewaRadio = function ESewaRadio(_ref) {
|
|
|
7115
7119
|
}, React__default.createElement("input", {
|
|
7116
7120
|
type: 'radio',
|
|
7117
7121
|
name: name,
|
|
7122
|
+
value: value,
|
|
7118
7123
|
checked: checked,
|
|
7119
|
-
onChange: handleRadioChange
|
|
7124
|
+
onChange: handleRadioChange,
|
|
7125
|
+
disabled: disabled
|
|
7120
7126
|
}), React__default.createElement("span", {
|
|
7121
7127
|
className: "" + labelClass
|
|
7122
7128
|
}, label))));
|
|
@@ -7702,9 +7708,9 @@ var CONNECT_APP = function CONNECT_APP(data) {
|
|
|
7702
7708
|
};
|
|
7703
7709
|
var requestFromMiniApp = function requestFromMiniApp(data, callbackKey, callback) {
|
|
7704
7710
|
var _window$webkit2, _window$webkit2$messa;
|
|
7705
|
-
if (window.Android
|
|
7711
|
+
if (window.Android) {
|
|
7706
7712
|
window.Android[callbackKey] = callback;
|
|
7707
|
-
} else if ((_window$webkit2 = window.webkit) !== null && _window$webkit2 !== void 0 && (_window$webkit2$messa = _window$webkit2.messageHandlers) !== null && _window$webkit2$messa !== void 0 && _window$webkit2$messa.iOSNative
|
|
7713
|
+
} else if ((_window$webkit2 = window.webkit) !== null && _window$webkit2 !== void 0 && (_window$webkit2$messa = _window$webkit2.messageHandlers) !== null && _window$webkit2$messa !== void 0 && _window$webkit2$messa.iOSNative) {
|
|
7708
7714
|
window.webkit.messageHandlers.iOSNative[callbackKey] = callback;
|
|
7709
7715
|
}
|
|
7710
7716
|
CONNECT_APP(JSON.stringify(data));
|
|
@@ -7877,11 +7883,13 @@ var useDebounce = function useDebounce(value, delay) {
|
|
|
7877
7883
|
};
|
|
7878
7884
|
|
|
7879
7885
|
var loadGoogleFont = function loadGoogleFont() {
|
|
7880
|
-
if (
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7886
|
+
if (typeof window !== 'undefined' && document) {
|
|
7887
|
+
if (!document.querySelector("link[href*='Source+Sans+Pro']")) {
|
|
7888
|
+
var link = document.createElement('link');
|
|
7889
|
+
link.href = 'https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700&display=swap';
|
|
7890
|
+
link.rel = 'stylesheet';
|
|
7891
|
+
document.head.appendChild(link);
|
|
7892
|
+
}
|
|
7885
7893
|
}
|
|
7886
7894
|
};
|
|
7887
7895
|
loadGoogleFont();
|