@driveflux/ui 3.0.3-next.0 → 3.0.4
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/bottom-sheet/BottomSheetProvider.js +8 -8
- package/dist/bottom-sheet/context.js +2 -2
- package/dist/bottom-sheet/use-bottom-sheet.js +1 -1
- package/dist/bottom-sheet/utils.js +1 -1
- package/dist/modal/ModalProvider.js +3 -3
- package/dist/modal/components/EnhancedModalCustomWrapper.js +20 -11
- package/dist/modal/components/EnhancedModalFooter.js +20 -11
- package/dist/modal/components/MinimalModalContent.js +19 -10
- package/dist/modal/components/StandardModalContent.js +30 -13
- package/dist/modal/context.js +4 -4
- package/dist/modal/use-enhanced-modal.js +1 -1
- package/dist/toast/use-toast-result.js +21 -12
- package/dist/translations.js +2 -2
- package/dist/utils/accessors.js +7 -7
- package/dist/utils/react.js +1 -0
- package/package.json +20 -20
|
@@ -51,7 +51,7 @@ import { Box, Button, Divider, HStack, Slide, Text, useDisclosure, VStack } from
|
|
|
51
51
|
import { colors } from '../theme/index.js';
|
|
52
52
|
import { BottomSheetContext } from './context.js';
|
|
53
53
|
import { isMobile } from './utils.js';
|
|
54
|
-
var BottomSheetProvider = function(param) {
|
|
54
|
+
var BottomSheetProvider = function BottomSheetProvider(param) {
|
|
55
55
|
var children = param.children;
|
|
56
56
|
var _useDisclosure = useDisclosure(), isOpen = _useDisclosure.isOpen, onClose = _useDisclosure.onClose, onOpen = _useDisclosure.onOpen;
|
|
57
57
|
var _useState = _sliced_to_array(useState(null), 2), options = _useState[0], setOptions = _useState[1];
|
|
@@ -66,12 +66,12 @@ var BottomSheetProvider = function(param) {
|
|
|
66
66
|
onOpen();
|
|
67
67
|
document.body.style.overflow = 'hidden';
|
|
68
68
|
}, []);
|
|
69
|
-
var close = function() {
|
|
69
|
+
var close = function close() {
|
|
70
70
|
onClose();
|
|
71
71
|
setOptions(null);
|
|
72
72
|
document.body.style.overflow = 'auto';
|
|
73
73
|
};
|
|
74
|
-
var dismissWithAnimation = function(element) {
|
|
74
|
+
var dismissWithAnimation = function dismissWithAnimation(element) {
|
|
75
75
|
element.style.transition = 'transform 200ms ease-in';
|
|
76
76
|
element.style.transform = 'translateY(100%)';
|
|
77
77
|
setTimeout(function() {
|
|
@@ -105,7 +105,7 @@ var BottomSheetProvider = function(param) {
|
|
|
105
105
|
bottom: 0,
|
|
106
106
|
background: 'blackAlpha.600',
|
|
107
107
|
zIndex: 'modal',
|
|
108
|
-
onClick: function() {
|
|
108
|
+
onClick: function onClick() {
|
|
109
109
|
var _options_onClose;
|
|
110
110
|
options === null || options === void 0 ? void 0 : (_options_onClose = options.onClose) === null || _options_onClose === void 0 ? void 0 : _options_onClose.call(options, 'overlay');
|
|
111
111
|
close();
|
|
@@ -127,11 +127,11 @@ var BottomSheetProvider = function(param) {
|
|
|
127
127
|
padding: '8px 24px 16px',
|
|
128
128
|
cursor: 'pointer',
|
|
129
129
|
// mobile touch
|
|
130
|
-
onTouchStart: function(e) {
|
|
130
|
+
onTouchStart: function onTouchStart(e) {
|
|
131
131
|
var touch = e.touches[0];
|
|
132
132
|
anchorY.current = touch.clientY;
|
|
133
133
|
},
|
|
134
|
-
onTouchMove: function(e) {
|
|
134
|
+
onTouchMove: function onTouchMove(e) {
|
|
135
135
|
var _e_currentTarget_parentElement;
|
|
136
136
|
var parent = (_e_currentTarget_parentElement = e.currentTarget.parentElement) === null || _e_currentTarget_parentElement === void 0 ? void 0 : _e_currentTarget_parentElement.parentElement;
|
|
137
137
|
if (!parent) {
|
|
@@ -145,7 +145,7 @@ var BottomSheetProvider = function(param) {
|
|
|
145
145
|
dismissWithAnimation(parent);
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
|
-
onTouchEnd: function(e) {
|
|
148
|
+
onTouchEnd: function onTouchEnd(e) {
|
|
149
149
|
var _e_currentTarget_parentElement;
|
|
150
150
|
anchorY.current = 0;
|
|
151
151
|
var parent = (_e_currentTarget_parentElement = e.currentTarget.parentElement) === null || _e_currentTarget_parentElement === void 0 ? void 0 : _e_currentTarget_parentElement.parentElement;
|
|
@@ -174,7 +174,7 @@ var BottomSheetProvider = function(param) {
|
|
|
174
174
|
}),
|
|
175
175
|
/*#__PURE__*/ _jsx(Button, {
|
|
176
176
|
variant: 'invisible',
|
|
177
|
-
onClick: function() {
|
|
177
|
+
onClick: function onClick() {
|
|
178
178
|
var _options_onClose;
|
|
179
179
|
options === null || options === void 0 ? void 0 : (_options_onClose = options.onClose) === null || _options_onClose === void 0 ? void 0 : _options_onClose.call(options, 'close_button');
|
|
180
180
|
close();
|
|
@@ -104,7 +104,7 @@ import { isReactNode } from '../utils/react.js';
|
|
|
104
104
|
import MinimalModalContent from './components/MinimalModalContent.js';
|
|
105
105
|
import StandardModalContent from './components/StandardModalContent.js';
|
|
106
106
|
import { ModalContext } from './context.js';
|
|
107
|
-
var getModalComponent = function(modalContentConfig, controls) {
|
|
107
|
+
var getModalComponent = function getModalComponent(modalContentConfig, controls) {
|
|
108
108
|
var otherProps = modalContentConfig.contentProps || {};
|
|
109
109
|
switch(modalContentConfig.type){
|
|
110
110
|
case 'standard':
|
|
@@ -133,10 +133,10 @@ var getModalComponent = function(modalContentConfig, controls) {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
|
-
var isModalOpenOptions = function(options) {
|
|
136
|
+
var isModalOpenOptions = function isModalOpenOptions(options) {
|
|
137
137
|
return (options === null || options === void 0 ? void 0 : options.modalContentConfig) !== undefined;
|
|
138
138
|
};
|
|
139
|
-
var ModalProvider = function(param) {
|
|
139
|
+
var ModalProvider = function ModalProvider(param) {
|
|
140
140
|
var children = param.children;
|
|
141
141
|
var _useDisclosure = useDisclosure(), isOpen = _useDisclosure.isOpen, onCloseRaw = _useDisclosure.onClose, onOpenRaw = _useDisclosure.onOpen;
|
|
142
142
|
var _useState = _sliced_to_array(useState(), 2), modalContentConfig = _useState[0], setModalContentConfig = _useState[1];
|
|
@@ -52,12 +52,22 @@ function _object_spread_props(target, source) {
|
|
|
52
52
|
}
|
|
53
53
|
function _object_without_properties(source, excluded) {
|
|
54
54
|
if (source == null) return {};
|
|
55
|
-
var target =
|
|
56
|
-
|
|
55
|
+
var target = {}, sourceKeys, key, i;
|
|
56
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
57
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
58
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
59
|
+
key = sourceKeys[i];
|
|
60
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
61
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
62
|
+
target[key] = source[key];
|
|
63
|
+
}
|
|
64
|
+
return target;
|
|
65
|
+
}
|
|
66
|
+
target = _object_without_properties_loose(source, excluded);
|
|
57
67
|
if (Object.getOwnPropertySymbols) {
|
|
58
|
-
|
|
59
|
-
for(i = 0; i <
|
|
60
|
-
key =
|
|
68
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
69
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
70
|
+
key = sourceKeys[i];
|
|
61
71
|
if (excluded.indexOf(key) >= 0) continue;
|
|
62
72
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
63
73
|
target[key] = source[key];
|
|
@@ -67,12 +77,11 @@ function _object_without_properties(source, excluded) {
|
|
|
67
77
|
}
|
|
68
78
|
function _object_without_properties_loose(source, excluded) {
|
|
69
79
|
if (source == null) return {};
|
|
70
|
-
var target = {};
|
|
71
|
-
var sourceKeys = Object.keys(source);
|
|
72
|
-
var key, i;
|
|
80
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
73
81
|
for(i = 0; i < sourceKeys.length; i++){
|
|
74
82
|
key = sourceKeys[i];
|
|
75
83
|
if (excluded.indexOf(key) >= 0) continue;
|
|
84
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
76
85
|
target[key] = source[key];
|
|
77
86
|
}
|
|
78
87
|
return target;
|
|
@@ -81,8 +90,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
81
90
|
import IconClose from '@driveflux/icons/icons/IconClose';
|
|
82
91
|
import { Button, Heading, HStack, Stack } from '../../chakra.js';
|
|
83
92
|
import { useEnhancedModal } from '../use-enhanced-modal.js';
|
|
84
|
-
var EnhancedModalCustomWrapper = function(
|
|
85
|
-
var title =
|
|
93
|
+
var EnhancedModalCustomWrapper = function EnhancedModalCustomWrapper(_0) {
|
|
94
|
+
var title = _0.title, children = _0.children, isCloseHidden = _0.isCloseHidden, props = _object_without_properties(_0, [
|
|
86
95
|
"title",
|
|
87
96
|
"children",
|
|
88
97
|
"isCloseHidden"
|
|
@@ -108,7 +117,7 @@ var EnhancedModalCustomWrapper = function(_param) {
|
|
|
108
117
|
variant: 'unstyled',
|
|
109
118
|
border: 0,
|
|
110
119
|
w: 'fit-content',
|
|
111
|
-
onClick: function() {
|
|
120
|
+
onClick: function onClick() {
|
|
112
121
|
close();
|
|
113
122
|
},
|
|
114
123
|
children: /*#__PURE__*/ _jsx(IconClose, {
|
|
@@ -52,12 +52,22 @@ function _object_spread_props(target, source) {
|
|
|
52
52
|
}
|
|
53
53
|
function _object_without_properties(source, excluded) {
|
|
54
54
|
if (source == null) return {};
|
|
55
|
-
var target =
|
|
56
|
-
|
|
55
|
+
var target = {}, sourceKeys, key, i;
|
|
56
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
57
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
58
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
59
|
+
key = sourceKeys[i];
|
|
60
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
61
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
62
|
+
target[key] = source[key];
|
|
63
|
+
}
|
|
64
|
+
return target;
|
|
65
|
+
}
|
|
66
|
+
target = _object_without_properties_loose(source, excluded);
|
|
57
67
|
if (Object.getOwnPropertySymbols) {
|
|
58
|
-
|
|
59
|
-
for(i = 0; i <
|
|
60
|
-
key =
|
|
68
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
69
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
70
|
+
key = sourceKeys[i];
|
|
61
71
|
if (excluded.indexOf(key) >= 0) continue;
|
|
62
72
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
63
73
|
target[key] = source[key];
|
|
@@ -67,12 +77,11 @@ function _object_without_properties(source, excluded) {
|
|
|
67
77
|
}
|
|
68
78
|
function _object_without_properties_loose(source, excluded) {
|
|
69
79
|
if (source == null) return {};
|
|
70
|
-
var target = {};
|
|
71
|
-
var sourceKeys = Object.keys(source);
|
|
72
|
-
var key, i;
|
|
80
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
73
81
|
for(i = 0; i < sourceKeys.length; i++){
|
|
74
82
|
key = sourceKeys[i];
|
|
75
83
|
if (excluded.indexOf(key) >= 0) continue;
|
|
84
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
76
85
|
target[key] = source[key];
|
|
77
86
|
}
|
|
78
87
|
return target;
|
|
@@ -82,8 +91,8 @@ import { Button, Stack } from '../../chakra.js';
|
|
|
82
91
|
import { colors } from '../../theme/colors.js';
|
|
83
92
|
import { translations } from '../../translations.js';
|
|
84
93
|
import { useEnhancedModal } from '../use-enhanced-modal.js';
|
|
85
|
-
var EnhancedModalFooter = function(
|
|
86
|
-
var sticky =
|
|
94
|
+
var EnhancedModalFooter = function EnhancedModalFooter(_0) {
|
|
95
|
+
var sticky = _0.sticky, cancelProps = _0.cancelProps, okProps = _0.okProps, children = _0.children, suffix = _0.suffix, props = _object_without_properties(_0, [
|
|
87
96
|
"sticky",
|
|
88
97
|
"cancelProps",
|
|
89
98
|
"okProps",
|
|
@@ -127,7 +136,7 @@ var EnhancedModalFooter = function(_param) {
|
|
|
127
136
|
/*#__PURE__*/ _jsx(Button, _object_spread_props(_object_spread({
|
|
128
137
|
w: 'full',
|
|
129
138
|
variant: 'outline',
|
|
130
|
-
onClick: function() {
|
|
139
|
+
onClick: function onClick() {
|
|
131
140
|
return close();
|
|
132
141
|
}
|
|
133
142
|
}, cancelProps), {
|
|
@@ -28,12 +28,22 @@ function _object_spread(target) {
|
|
|
28
28
|
}
|
|
29
29
|
function _object_without_properties(source, excluded) {
|
|
30
30
|
if (source == null) return {};
|
|
31
|
-
var target =
|
|
32
|
-
|
|
31
|
+
var target = {}, sourceKeys, key, i;
|
|
32
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
33
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
34
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
35
|
+
key = sourceKeys[i];
|
|
36
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
37
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
38
|
+
target[key] = source[key];
|
|
39
|
+
}
|
|
40
|
+
return target;
|
|
41
|
+
}
|
|
42
|
+
target = _object_without_properties_loose(source, excluded);
|
|
33
43
|
if (Object.getOwnPropertySymbols) {
|
|
34
|
-
|
|
35
|
-
for(i = 0; i <
|
|
36
|
-
key =
|
|
44
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
45
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
46
|
+
key = sourceKeys[i];
|
|
37
47
|
if (excluded.indexOf(key) >= 0) continue;
|
|
38
48
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
39
49
|
target[key] = source[key];
|
|
@@ -43,12 +53,11 @@ function _object_without_properties(source, excluded) {
|
|
|
43
53
|
}
|
|
44
54
|
function _object_without_properties_loose(source, excluded) {
|
|
45
55
|
if (source == null) return {};
|
|
46
|
-
var target = {};
|
|
47
|
-
var sourceKeys = Object.keys(source);
|
|
48
|
-
var key, i;
|
|
56
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
49
57
|
for(i = 0; i < sourceKeys.length; i++){
|
|
50
58
|
key = sourceKeys[i];
|
|
51
59
|
if (excluded.indexOf(key) >= 0) continue;
|
|
60
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
52
61
|
target[key] = source[key];
|
|
53
62
|
}
|
|
54
63
|
return target;
|
|
@@ -57,8 +66,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
57
66
|
import { Fragment } from 'react';
|
|
58
67
|
import { Box, ModalBody, ModalCloseButton, ModalHeader } from '../../chakra.js';
|
|
59
68
|
import { isReactNode } from '../../utils/react.js';
|
|
60
|
-
var MinimalModalContent = function(
|
|
61
|
-
var
|
|
69
|
+
var MinimalModalContent = function MinimalModalContent(_0) {
|
|
70
|
+
var _0_controls = _0.controls, open = _0_controls.open, close = _0_controls.close, modalContentConfig = _0.modalContentConfig, props = _object_without_properties(_0, [
|
|
62
71
|
"controls",
|
|
63
72
|
"modalContentConfig"
|
|
64
73
|
]);
|
|
@@ -92,12 +92,22 @@ function _object_spread(target) {
|
|
|
92
92
|
}
|
|
93
93
|
function _object_without_properties(source, excluded) {
|
|
94
94
|
if (source == null) return {};
|
|
95
|
-
var target =
|
|
96
|
-
|
|
95
|
+
var target = {}, sourceKeys, key, i;
|
|
96
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
97
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
98
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
99
|
+
key = sourceKeys[i];
|
|
100
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
101
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
102
|
+
target[key] = source[key];
|
|
103
|
+
}
|
|
104
|
+
return target;
|
|
105
|
+
}
|
|
106
|
+
target = _object_without_properties_loose(source, excluded);
|
|
97
107
|
if (Object.getOwnPropertySymbols) {
|
|
98
|
-
|
|
99
|
-
for(i = 0; i <
|
|
100
|
-
key =
|
|
108
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
109
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
110
|
+
key = sourceKeys[i];
|
|
101
111
|
if (excluded.indexOf(key) >= 0) continue;
|
|
102
112
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
103
113
|
target[key] = source[key];
|
|
@@ -107,12 +117,11 @@ function _object_without_properties(source, excluded) {
|
|
|
107
117
|
}
|
|
108
118
|
function _object_without_properties_loose(source, excluded) {
|
|
109
119
|
if (source == null) return {};
|
|
110
|
-
var target = {};
|
|
111
|
-
var sourceKeys = Object.keys(source);
|
|
112
|
-
var key, i;
|
|
120
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
113
121
|
for(i = 0; i < sourceKeys.length; i++){
|
|
114
122
|
key = sourceKeys[i];
|
|
115
123
|
if (excluded.indexOf(key) >= 0) continue;
|
|
124
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
116
125
|
target[key] = source[key];
|
|
117
126
|
}
|
|
118
127
|
return target;
|
|
@@ -137,9 +146,17 @@ function _ts_generator(thisArg, body) {
|
|
|
137
146
|
},
|
|
138
147
|
trys: [],
|
|
139
148
|
ops: []
|
|
140
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
141
|
-
return
|
|
142
|
-
|
|
149
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
150
|
+
return d(g, "next", {
|
|
151
|
+
value: verb(0)
|
|
152
|
+
}), d(g, "throw", {
|
|
153
|
+
value: verb(1)
|
|
154
|
+
}), d(g, "return", {
|
|
155
|
+
value: verb(2)
|
|
156
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
157
|
+
value: function() {
|
|
158
|
+
return this;
|
|
159
|
+
}
|
|
143
160
|
}), g;
|
|
144
161
|
function verb(n) {
|
|
145
162
|
return function(v) {
|
|
@@ -225,8 +242,8 @@ import { Button, HStack, ModalBody, ModalCloseButton, ModalFooter, ModalHeader }
|
|
|
225
242
|
import { translations } from '../../translations.js';
|
|
226
243
|
import { isReactNode } from '../../utils/react.js';
|
|
227
244
|
import { useEnhancedModal } from '../use-enhanced-modal.js';
|
|
228
|
-
var StandardModalContent = function(
|
|
229
|
-
var
|
|
245
|
+
var StandardModalContent = function StandardModalContent(_0) {
|
|
246
|
+
var _0_controls = _0.controls, open = _0_controls.open, close = _0_controls.close, modalContentConfig = _0.modalContentConfig, props = _object_without_properties(_0, [
|
|
230
247
|
"controls",
|
|
231
248
|
"modalContentConfig"
|
|
232
249
|
]);
|
package/dist/modal/context.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
2
|
var initialState = {
|
|
3
3
|
isOpen: true,
|
|
4
|
-
open: function() {},
|
|
5
|
-
close: function() {},
|
|
6
|
-
update: function() {},
|
|
4
|
+
open: function open() {},
|
|
5
|
+
close: function close() {},
|
|
6
|
+
update: function update() {},
|
|
7
7
|
modalState: undefined,
|
|
8
|
-
setModalState: function() {}
|
|
8
|
+
setModalState: function setModalState() {}
|
|
9
9
|
};
|
|
10
10
|
export var ModalContext = /*#__PURE__*/ createContext(initialState);
|
|
@@ -52,12 +52,22 @@ function _object_spread_props(target, source) {
|
|
|
52
52
|
}
|
|
53
53
|
function _object_without_properties(source, excluded) {
|
|
54
54
|
if (source == null) return {};
|
|
55
|
-
var target =
|
|
56
|
-
|
|
55
|
+
var target = {}, sourceKeys, key, i;
|
|
56
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
57
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
58
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
59
|
+
key = sourceKeys[i];
|
|
60
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
61
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
62
|
+
target[key] = source[key];
|
|
63
|
+
}
|
|
64
|
+
return target;
|
|
65
|
+
}
|
|
66
|
+
target = _object_without_properties_loose(source, excluded);
|
|
57
67
|
if (Object.getOwnPropertySymbols) {
|
|
58
|
-
|
|
59
|
-
for(i = 0; i <
|
|
60
|
-
key =
|
|
68
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
69
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
70
|
+
key = sourceKeys[i];
|
|
61
71
|
if (excluded.indexOf(key) >= 0) continue;
|
|
62
72
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
63
73
|
target[key] = source[key];
|
|
@@ -67,12 +77,11 @@ function _object_without_properties(source, excluded) {
|
|
|
67
77
|
}
|
|
68
78
|
function _object_without_properties_loose(source, excluded) {
|
|
69
79
|
if (source == null) return {};
|
|
70
|
-
var target = {};
|
|
71
|
-
var sourceKeys = Object.keys(source);
|
|
72
|
-
var key, i;
|
|
80
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
73
81
|
for(i = 0; i < sourceKeys.length; i++){
|
|
74
82
|
key = sourceKeys[i];
|
|
75
83
|
if (excluded.indexOf(key) >= 0) continue;
|
|
84
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
76
85
|
target[key] = source[key];
|
|
77
86
|
}
|
|
78
87
|
return target;
|
|
@@ -83,7 +92,7 @@ import { useCallback } from 'react';
|
|
|
83
92
|
import { Box, ListItem, Text, UnorderedList, useToast } from '../chakra.js';
|
|
84
93
|
import { translations } from '../translations.js';
|
|
85
94
|
import { accessReactNode } from '../utils/accessors.js';
|
|
86
|
-
var accessStatus = function(s, data) {
|
|
95
|
+
var accessStatus = function accessStatus(s, data) {
|
|
87
96
|
return typeof s === 'function' ? s(data) : s;
|
|
88
97
|
};
|
|
89
98
|
var defaultUseToastResultOptions = {
|
|
@@ -101,14 +110,14 @@ var defaultUseToastResultOptions = {
|
|
|
101
110
|
isClosable: true
|
|
102
111
|
}
|
|
103
112
|
};
|
|
104
|
-
export var getValidationErrorsList = function(validation) {
|
|
113
|
+
export var getValidationErrorsList = function getValidationErrorsList(validation) {
|
|
105
114
|
return Object.values(validation.fieldErrors).flatMap(function(v) {
|
|
106
115
|
return v.map(function(vd) {
|
|
107
116
|
return vd.message;
|
|
108
117
|
});
|
|
109
118
|
});
|
|
110
119
|
};
|
|
111
|
-
var accessOptions = function(options, data) {
|
|
120
|
+
var accessOptions = function accessOptions(options, data) {
|
|
112
121
|
if (!options) {
|
|
113
122
|
return options;
|
|
114
123
|
}
|
|
@@ -118,7 +127,7 @@ var accessOptions = function(options, data) {
|
|
|
118
127
|
description: accessReactNode(options.description, data)
|
|
119
128
|
});
|
|
120
129
|
};
|
|
121
|
-
export var useToastResult = function(options) {
|
|
130
|
+
export var useToastResult = function useToastResult(options) {
|
|
122
131
|
var originalToast = useToast(accessOptions(options === null || options === void 0 ? void 0 : options.defaultOptions));
|
|
123
132
|
var toastProblem = useCallback(function(problem, providedOptions) {
|
|
124
133
|
var _merge = merge({}, defaultUseToastResultOptions.error, providedOptions), description = _merge.description, defaultDescription = _merge.defaultDescription, showValidationErrors = _merge.showValidationErrors, rest = _object_without_properties(_merge, [
|
package/dist/translations.js
CHANGED
|
@@ -9,13 +9,13 @@ export var translations = singleton('uiTranslations', {
|
|
|
9
9
|
close: 'Close',
|
|
10
10
|
ok: 'Ok'
|
|
11
11
|
});
|
|
12
|
-
export var setTranslations = function(ts) {
|
|
12
|
+
export var setTranslations = function setTranslations(ts) {
|
|
13
13
|
for(var key in ts){
|
|
14
14
|
// TODO
|
|
15
15
|
// @ts-expect-error
|
|
16
16
|
translations[key] = ts[key];
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
export var setTranslation = function(key, value) {
|
|
19
|
+
export var setTranslation = function setTranslation(key, value) {
|
|
20
20
|
translations[key] = value;
|
|
21
21
|
};
|
package/dist/utils/accessors.js
CHANGED
|
@@ -2,29 +2,29 @@ function _type_of(obj) {
|
|
|
2
2
|
"@swc/helpers - typeof";
|
|
3
3
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
4
4
|
}
|
|
5
|
-
export var accessSelf = function(s, data, defaultValue) {
|
|
5
|
+
export var accessSelf = function accessSelf(s, data, defaultValue) {
|
|
6
6
|
if (!s) {
|
|
7
7
|
return defaultValue;
|
|
8
8
|
}
|
|
9
9
|
return typeof s === 'function' ? s(data) : s;
|
|
10
10
|
};
|
|
11
|
-
export var accessBoolean = function(s, data, defaultBoolean) {
|
|
11
|
+
export var accessBoolean = function accessBoolean(s, data, defaultBoolean) {
|
|
12
12
|
return accessSelf(s, data, defaultBoolean);
|
|
13
13
|
};
|
|
14
|
-
export var accessString = function(s, data, defaultText) {
|
|
14
|
+
export var accessString = function accessString(s, data, defaultText) {
|
|
15
15
|
return accessSelf(s, data, defaultText);
|
|
16
16
|
};
|
|
17
|
-
export var accessStringOrNull = function(s, data) {
|
|
17
|
+
export var accessStringOrNull = function accessStringOrNull(s, data) {
|
|
18
18
|
var defaultText = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
|
|
19
19
|
return accessSelf(s, data, defaultText);
|
|
20
20
|
};
|
|
21
|
-
export var accessQuery = function(s, data, defaultQuery) {
|
|
21
|
+
export var accessQuery = function accessQuery(s, data, defaultQuery) {
|
|
22
22
|
return accessSelf(s, data, defaultQuery);
|
|
23
23
|
};
|
|
24
|
-
export var accessReactNode = function(s, data, defaultNode) {
|
|
24
|
+
export var accessReactNode = function accessReactNode(s, data, defaultNode) {
|
|
25
25
|
return accessSelf(s, data, defaultNode);
|
|
26
26
|
};
|
|
27
|
-
export var accessFunction = function(f, data, defaultFunction) {
|
|
27
|
+
export var accessFunction = function accessFunction(f, data, defaultFunction) {
|
|
28
28
|
if (!f) {
|
|
29
29
|
return defaultFunction;
|
|
30
30
|
}
|
package/dist/utils/react.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@driveflux/ui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -36,30 +36,30 @@
|
|
|
36
36
|
"dist"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@chakra-ui/react": "2.10.
|
|
40
|
-
"@driveflux/icons": "3.0.
|
|
41
|
-
"@driveflux/singleton": "3.0.
|
|
39
|
+
"@chakra-ui/react": "^2.10.9",
|
|
40
|
+
"@driveflux/icons": "3.0.1",
|
|
41
|
+
"@driveflux/singleton": "3.0.1",
|
|
42
42
|
"@emotion/react": "^11.14.0",
|
|
43
43
|
"@emotion/styled": "^11.14.1",
|
|
44
|
-
"framer-motion": "^12.
|
|
45
|
-
"lodash": "^4.
|
|
44
|
+
"framer-motion": "^12.38.0",
|
|
45
|
+
"lodash": "^4.18.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@driveflux/fab": "4.0.
|
|
49
|
-
"@driveflux/problem": "6.0.
|
|
50
|
-
"@driveflux/result": "6.0.
|
|
51
|
-
"@driveflux/tsconfig": "3.0.
|
|
52
|
-
"@swc/cli": "^0.
|
|
53
|
-
"@swc/core": "^1.
|
|
54
|
-
"@types/lodash": "^4.17.
|
|
55
|
-
"@types/node": "^
|
|
56
|
-
"@types/react": "19.2.
|
|
48
|
+
"@driveflux/fab": "4.0.1",
|
|
49
|
+
"@driveflux/problem": "6.0.2",
|
|
50
|
+
"@driveflux/result": "6.0.2",
|
|
51
|
+
"@driveflux/tsconfig": "3.0.1",
|
|
52
|
+
"@swc/cli": "^0.8.1",
|
|
53
|
+
"@swc/core": "^1.15.33",
|
|
54
|
+
"@types/lodash": "^4.17.24",
|
|
55
|
+
"@types/node": "^25.7.0",
|
|
56
|
+
"@types/react": "19.2.14",
|
|
57
57
|
"del-cli": "^7.0.0",
|
|
58
|
-
"next": "16.
|
|
59
|
-
"react": "19.2.
|
|
60
|
-
"swr": "^2.
|
|
61
|
-
"type-fest": "^5.
|
|
62
|
-
"typescript": "^
|
|
58
|
+
"next": "16.2.6",
|
|
59
|
+
"react": "19.2.6",
|
|
60
|
+
"swr": "^2.4.1",
|
|
61
|
+
"type-fest": "^5.6.0",
|
|
62
|
+
"typescript": "^6.0.3"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "fab",
|