@ainias42/react-bootstrap-mobile 0.1.30 → 0.1.31
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/bootstrapReactMobile.js +42 -6
- package/dist/bootstrapReactMobile.js.map +1 -1
- package/dist/src/Components/Layout/Block.d.ts +1 -1
- package/dist/src/Components/Layout/Flex.d.ts +1 -1
- package/dist/src/Components/Layout/Inline.d.ts +1 -1
- package/dist/src/Components/Layout/InlineBlock.d.ts +1 -1
- package/package.json +1 -1
- package/src/Components/FormElements/Input/Input.tsx +48 -9
- package/src/Components/Toast/Toast.tsx +3 -1
- package/src/Components/Toast/toast.scss +2 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* @ainias42/react-bootstrap-mobile v0.1.
|
|
3
|
+
* @ainias42/react-bootstrap-mobile v0.1.30
|
|
4
4
|
* git+https://github.com/Ainias/Bootstrap-React-Mobile.git
|
|
5
5
|
* Copyright (c) Silas Günther and project contributors.
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
@@ -2301,7 +2301,7 @@ var ___CSS_LOADER_API_SOURCEMAP_IMPORT___ = __webpack_require__(7537);
|
|
|
2301
2301
|
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(3645);
|
|
2302
2302
|
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
|
|
2303
2303
|
// Module
|
|
2304
|
-
___CSS_LOADER_EXPORT___.push([module.id, `.toastContainer__Cr4Pc{position:fixed;left:0;right:0;bottom:3rem;margin:auto;max-width:576px;z-index:1001;display:flex;align-items:center;flex-direction:column}.toast__sXrim{background-color:rgba(0,0,0,.8);min-height:48px;line-height:1.5;--text-primary-default-color: white;color:#fff;font-size:.77rem;letter-spacing:normal;transition-duration:.25s;margin:8px}.toast__sXrim.hiding__VMWIu{opacity:0}.material-design .toast__sXrim{padding:16px 24px}.flat-design .toast__sXrim{border-radius:.5rem;padding:16px}.toast__sXrim .action__WbNF_{text-transform:uppercase;margin-left:24px}.material-design .toast__sXrim .action__WbNF_{color:#bbdefb}.flat-design .toast__sXrim .action__WbNF_{color:#fff}`, "",{"version":3,"sources":["webpack://./src/Components/Toast/toast.scss","webpack://./src/scss/_designMixin.scss"],"names":[],"mappings":"AAGA,uBACE,cAAA,CACA,MAAA,CACA,OAAA,CACA,WAAA,CACA,WAAA,CACA,eAAA,CACA,YAAA,CACA,YAAA,CACA,kBAAA,CACA,qBAAA,CAGF,cACE,+BAAA,CACA,eAAA,CACA,eAAA,CACA,mCAAA,CACA,UAAA,CACA,gBAAA,CACA,qBAAA,CACA,wBAAA,CACA,UAAA,CAEA,4BACE,SAAA,
|
|
2304
|
+
___CSS_LOADER_EXPORT___.push([module.id, `.toastContainer__Cr4Pc{pointer-events:none;position:fixed;left:0;right:0;bottom:3rem;margin:auto;max-width:576px;z-index:1001;display:flex;align-items:center;flex-direction:column}.toast__sXrim{pointer-events:auto;background-color:rgba(0,0,0,.8);min-height:48px;line-height:1.5;--text-primary-default-color: white;color:#fff;font-size:.77rem;letter-spacing:normal;transition-duration:.25s;margin:8px}.toast__sXrim.hiding__VMWIu{opacity:0}.material-design .toast__sXrim{padding:16px 24px}.flat-design .toast__sXrim{border-radius:.5rem;padding:16px}.toast__sXrim .action__WbNF_{text-transform:uppercase;margin-left:24px}.material-design .toast__sXrim .action__WbNF_{color:#bbdefb}.flat-design .toast__sXrim .action__WbNF_{color:#fff}`, "",{"version":3,"sources":["webpack://./src/Components/Toast/toast.scss","webpack://./src/scss/_designMixin.scss"],"names":[],"mappings":"AAGA,uBACE,mBAAA,CACA,cAAA,CACA,MAAA,CACA,OAAA,CACA,WAAA,CACA,WAAA,CACA,eAAA,CACA,YAAA,CACA,YAAA,CACA,kBAAA,CACA,qBAAA,CAGF,cACE,mBAAA,CACA,+BAAA,CACA,eAAA,CACA,eAAA,CACA,mCAAA,CACA,UAAA,CACA,gBAAA,CACA,qBAAA,CACA,wBAAA,CACA,UAAA,CAEA,4BACE,SAAA,CC1BS,+BD8BT,iBAAA,CC9BS,2BDkCT,mBAAA,CACA,YAAA,CAGF,6BACE,wBAAA,CACA,gBAAA,CCxCS,8CD2CP,aAAA,CC3CO,0CD8CP,UAAA","sourcesContent":["@import \"../../scss/variables\";\n@import \"../../scss/designMixin\";\n\n.toastContainer {\n pointer-events: none;\n position: fixed;\n left: 0;\n right: 0;\n bottom: 3rem;\n margin: auto;\n max-width: map-get($grid-breakpoints, \"sm\");\n z-index: 1001;\n display: flex;\n align-items: center;\n flex-direction: column;\n}\n\n.toast {\n pointer-events: auto;\n background-color: rgba(0, 0, 0, 0.8);\n min-height: 48px;\n line-height: 1.5;\n --text-primary-default-color: white;\n color: white;\n font-size: 0.77rem;\n letter-spacing: normal;\n transition-duration: 0.25s;\n margin: 8px;\n\n &.hiding {\n opacity: 0;\n }\n\n @include design($material) {\n padding: 16px 24px;\n }\n\n @include design($flat) {\n border-radius: 0.5rem;\n padding: 16px;\n }\n\n .action {\n text-transform: uppercase;\n margin-left: 24px;\n\n @include design($material) {\n color: #bbdefb\n }\n @include design($flat) {\n color: #ffffff;\n }\n }\n\n}\n","@use 'sass:selector';\n\n@mixin design($designName) {\n @if & {\n @at-root #{selector.nest(':global(.'+$designName+\")\", &)} {\n @content\n }\n } @else {\n :global(.#{$designName}) {\n @content\n }\n }\n}\n"],"sourceRoot":""}]);
|
|
2305
2305
|
// Exports
|
|
2306
2306
|
___CSS_LOADER_EXPORT___.locals = {
|
|
2307
2307
|
"toastContainer": `toastContainer__Cr4Pc`,
|
|
@@ -23111,11 +23111,23 @@ const Input = withForwardRef(function Input(_a, ref) {
|
|
|
23111
23111
|
return value;
|
|
23112
23112
|
}
|
|
23113
23113
|
if (typeof value === "string") {
|
|
23114
|
+
if (value === "-") {
|
|
23115
|
+
return value;
|
|
23116
|
+
}
|
|
23117
|
+
const numberValue = parseFloat(value);
|
|
23118
|
+
if (!Number.isNaN(numberValue) && Number.isFinite(numberValue)) {
|
|
23119
|
+
if (otherProps.max !== undefined && numberValue > Number(otherProps.max)) {
|
|
23120
|
+
return otherProps.max;
|
|
23121
|
+
}
|
|
23122
|
+
if (otherProps.min !== undefined && numberValue < Number(otherProps.min)) {
|
|
23123
|
+
return otherProps.min;
|
|
23124
|
+
}
|
|
23125
|
+
}
|
|
23114
23126
|
if (!Number.isNaN(Number(value))) {
|
|
23115
23127
|
// Do not parse to allow ., and so on
|
|
23116
23128
|
return value;
|
|
23117
23129
|
}
|
|
23118
|
-
if (!Number.isNaN(
|
|
23130
|
+
if (!Number.isNaN(numberValue)) {
|
|
23119
23131
|
return parseFloat(value);
|
|
23120
23132
|
}
|
|
23121
23133
|
}
|
|
@@ -23128,10 +23140,14 @@ const Input = withForwardRef(function Input(_a, ref) {
|
|
|
23128
23140
|
const onChange = (0,external_react_.useCallback)(e => {
|
|
23129
23141
|
if (otherProps.onChangeText) {
|
|
23130
23142
|
if (otherProps.type === "number") {
|
|
23131
|
-
|
|
23143
|
+
if (e.currentTarget.value === "-") {
|
|
23144
|
+
otherProps.onChangeText(e.currentTarget.value);
|
|
23145
|
+
return;
|
|
23146
|
+
}
|
|
23147
|
+
const val = !Number.isNaN(Number(e.currentTarget.value)) ? e.currentTarget.value : !Number.isNaN(parseFloat(e.currentTarget.value)) ? String(parseFloat(e.currentTarget.value)) : "";
|
|
23132
23148
|
otherProps.onChangeText(val);
|
|
23133
23149
|
} else {
|
|
23134
|
-
otherProps.onChangeText(e.
|
|
23150
|
+
otherProps.onChangeText(e.currentTarget.value);
|
|
23135
23151
|
}
|
|
23136
23152
|
}
|
|
23137
23153
|
onChangeWithData(e);
|
|
@@ -23149,6 +23165,24 @@ const Input = withForwardRef(function Input(_a, ref) {
|
|
|
23149
23165
|
otherProps.onEnter(e.target.value);
|
|
23150
23166
|
}
|
|
23151
23167
|
}
|
|
23168
|
+
if (otherProps.type === "number") {
|
|
23169
|
+
const step = otherProps.step ? Number(otherProps.step) : 1;
|
|
23170
|
+
if (e.key === "ArrowUp") {
|
|
23171
|
+
let newValue = (parseFloat(e.currentTarget.value) || 0) + step;
|
|
23172
|
+
if (otherProps.max !== undefined && newValue > Number(otherProps.max)) {
|
|
23173
|
+
newValue = Number(otherProps.max);
|
|
23174
|
+
}
|
|
23175
|
+
e.currentTarget.value = newValue.toString();
|
|
23176
|
+
onChange(e);
|
|
23177
|
+
} else if (e.key === "ArrowDown") {
|
|
23178
|
+
let newValue = (parseFloat(e.currentTarget.value) || 0) - step;
|
|
23179
|
+
if (otherProps.min !== undefined && newValue < Number(otherProps.min)) {
|
|
23180
|
+
newValue = Number(otherProps.min);
|
|
23181
|
+
}
|
|
23182
|
+
e.currentTarget.value = newValue.toString();
|
|
23183
|
+
onChange(e);
|
|
23184
|
+
}
|
|
23185
|
+
}
|
|
23152
23186
|
}, [otherProps.onEnter, onKeyDown, otherProps.type]);
|
|
23153
23187
|
// Effects
|
|
23154
23188
|
useOnChangeDone(onChangeDone, innerRef);
|
|
@@ -27588,11 +27622,12 @@ function Toast(_a) {
|
|
|
27588
27622
|
// States
|
|
27589
27623
|
const [hidingStart, setHidingStart] = (0,external_react_.useState)(0);
|
|
27590
27624
|
const [startShow] = (0,external_react_.useState)(new Date().getTime());
|
|
27591
|
-
const isHidden =
|
|
27625
|
+
const [isHidden, setIsHidden] = (0,external_react_.useState)(false);
|
|
27592
27626
|
// Refs
|
|
27593
27627
|
// Callbacks
|
|
27594
27628
|
const updateHidingStart = (0,external_react_.useCallback)(() => {
|
|
27595
27629
|
setHidingStart(oldHidingStart => oldHidingStart > 0 ? oldHidingStart : new Date().getTime());
|
|
27630
|
+
setTimeout(() => setIsHidden(true), ANIMATION_DURATION);
|
|
27596
27631
|
}, [setHidingStart]);
|
|
27597
27632
|
const onDismissed = useListener('onDismissed', otherProps);
|
|
27598
27633
|
// Effects
|
|
@@ -27625,6 +27660,7 @@ function Toast(_a) {
|
|
|
27625
27660
|
// Other
|
|
27626
27661
|
// Render Functions
|
|
27627
27662
|
if (isHidden) {
|
|
27663
|
+
console.log("LOG-d isHidden");
|
|
27628
27664
|
return null;
|
|
27629
27665
|
}
|
|
27630
27666
|
let actionElement = null;
|