react-asc 21.3.0 → 23.0.0
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/components/CssTransition/CssTransition.d.ts +8 -0
- package/components/CssTransition/index.d.ts +1 -0
- package/components/FloatingActionButton/FloatingActionButton.d.ts +1 -0
- package/components/index.d.ts +1 -0
- package/hooks/index.d.ts +4 -3
- package/hooks/useMobileDetect.d.ts +3 -0
- package/index.es.js +129 -48
- package/index.js +129 -46
- package/package.json +1 -1
- package/readme.md +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CssTransition';
|
|
@@ -7,6 +7,7 @@ export interface IFloatingActionButtonProps extends React.DetailedHTMLProps<Reac
|
|
|
7
7
|
fixed?: boolean;
|
|
8
8
|
isActive?: boolean;
|
|
9
9
|
disabled?: boolean;
|
|
10
|
+
position?: 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
10
11
|
onClick?: (e: React.MouseEvent) => void;
|
|
11
12
|
}
|
|
12
13
|
export declare const FloatingActionButton: (props: IFloatingActionButtonProps) => JSX.Element;
|
package/components/index.d.ts
CHANGED
package/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export * from './useWindowSize';
|
|
2
|
-
export * from './useHover';
|
|
3
|
-
export * from './useConstructor';
|
|
4
1
|
export * from './useDebounce';
|
|
2
|
+
export * from './useConstructor';
|
|
5
3
|
export * from './useCssClasses';
|
|
4
|
+
export * from './useHover';
|
|
5
|
+
export * from './useMobileDetect';
|
|
6
|
+
export * from './useWindowSize';
|
package/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useRef, useEffect, useState, Fragment, Component, createRef, cloneElement, createContext, useContext } from 'react';
|
|
2
2
|
import { createPortal, render, unmountComponentAtNode } from 'react-dom';
|
|
3
3
|
import { createPopper } from '@popperjs/core';
|
|
4
4
|
|
|
@@ -224,23 +224,26 @@ const CircleSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true
|
|
|
224
224
|
const ChevronLeftSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512" },
|
|
225
225
|
React.createElement("path", { fill: "currentColor", d: "M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z" })));
|
|
226
226
|
|
|
227
|
-
function
|
|
228
|
-
const
|
|
229
|
-
width: 0,
|
|
230
|
-
height: 0,
|
|
231
|
-
});
|
|
227
|
+
function useDebounce(callback, timeout, deps) {
|
|
228
|
+
const timeoutId = useRef();
|
|
232
229
|
useEffect(() => {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
230
|
+
clearTimeout(timeoutId.current);
|
|
231
|
+
timeoutId.current = setTimeout(callback, timeout);
|
|
232
|
+
return () => clearTimeout(timeoutId.current);
|
|
233
|
+
}, deps);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const useConstructor = (callBack) => {
|
|
237
|
+
const [hasBeenCalled, setHasBeenCalled] = useState(false);
|
|
238
|
+
if (hasBeenCalled)
|
|
239
|
+
return;
|
|
240
|
+
callBack();
|
|
241
|
+
setHasBeenCalled(true);
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
function useCssClasses(cssClasses) {
|
|
245
|
+
const cssClassName = (cssClasses === null || cssClasses === void 0 ? void 0 : cssClasses.filter(css => css).join(' ')) || '';
|
|
246
|
+
return [cssClassName];
|
|
244
247
|
}
|
|
245
248
|
|
|
246
249
|
function useHover() {
|
|
@@ -265,26 +268,37 @@ function useHover() {
|
|
|
265
268
|
return [ref, value];
|
|
266
269
|
}
|
|
267
270
|
|
|
268
|
-
|
|
269
|
-
const [
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
setHasBeenCalled(true);
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
function useDebounce(callback, timeout, deps) {
|
|
277
|
-
const timeoutId = useRef();
|
|
271
|
+
function useWindowSize() {
|
|
272
|
+
const [windowSize, setWindowSize] = useState({
|
|
273
|
+
width: 0,
|
|
274
|
+
height: 0,
|
|
275
|
+
});
|
|
278
276
|
useEffect(() => {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
277
|
+
function handleResize() {
|
|
278
|
+
setWindowSize({
|
|
279
|
+
width: window.innerWidth,
|
|
280
|
+
height: window.innerHeight,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
window.addEventListener("resize", handleResize);
|
|
284
|
+
handleResize();
|
|
285
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
286
|
+
}, []);
|
|
287
|
+
return windowSize;
|
|
283
288
|
}
|
|
284
289
|
|
|
285
|
-
function
|
|
286
|
-
const
|
|
287
|
-
|
|
290
|
+
function useMobileDetect() {
|
|
291
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
292
|
+
const windowSize = useWindowSize();
|
|
293
|
+
const checkIsMobile = (height, width) => {
|
|
294
|
+
if (height > 0 && width > 0) {
|
|
295
|
+
setIsMobile(!(width >= 1024));
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
useEffect(() => {
|
|
299
|
+
windowSize && checkIsMobile(windowSize.height, windowSize.width);
|
|
300
|
+
}, [windowSize]);
|
|
301
|
+
return { isMobile };
|
|
288
302
|
}
|
|
289
303
|
|
|
290
304
|
var css_248z$X = ".Backdrop-module_backdrop__IRMoL {\n height: 100%;\n width: 100%;\n position: absolute;\n opacity: 0.5;\n z-index: 1040;\n top: 0;\n left: 0;\n background-color: #000; }\n .Backdrop-module_backdrop__IRMoL.Backdrop-module_isTransparent__F5nA5 {\n opacity: 0; }\n";
|
|
@@ -752,7 +766,7 @@ const Checkbox = (props) => {
|
|
|
752
766
|
React.createElement("input", Object.assign({ type: "checkbox", ref: checkboxElement, id: id, name: name, checked: isChecked, disabled: disabled, readOnly: readOnly, hidden: true, value: value }, rest))));
|
|
753
767
|
};
|
|
754
768
|
|
|
755
|
-
var css_248z$C = ".Chip-module_chip__dZ5qz {\n display: inline-flex;\n align-items: center;\n padding: 0.5rem;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out
|
|
769
|
+
var css_248z$C = ".Chip-module_chip__dZ5qz {\n display: inline-flex;\n align-items: center;\n padding: 0.5rem;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,\r box-shadow 0.15s ease-in-out;\n font-size: 75%;\n font-weight: 700;\n border-radius: 10rem;\n line-height: 1; }\n .Chip-module_chip__dZ5qz span {\n margin-bottom: 2px; }\n .Chip-module_chip__dZ5qz svg {\n width: 18px;\n height: 18px; }\n .Chip-module_chip__dZ5qz .Chip-module_deleteIcon__--rUx {\n margin-left: 5px; }\n .Chip-module_chip__dZ5qz .Chip-module_deleteIcon__--rUx:hover {\n cursor: pointer; }\n .Chip-module_chip__dZ5qz.Chip-module_primary__YVDi9 {\n background: var(--primary);\n color: var(--primary-contrast-text); }\n .Chip-module_chip__dZ5qz.Chip-module_secondary__-e4xP {\n background: var(--secondary);\n color: var(--secondary-contrast-text); }\n .Chip-module_chip__dZ5qz.Chip-module_accent__ZCTwu {\n background: var(--accent);\n color: var(--accent-contrast-text); }\n .Chip-module_chip__dZ5qz.Chip-module_light__vKs7O {\n color: var(--light-contrast-text);\n background-color: var(--light); }\n .Chip-module_chip__dZ5qz.Chip-module_dark__G-FLQ {\n color: var(--dark-contrast-text);\n background-color: var(--dark); }\n .Chip-module_chip__dZ5qz.Chip-module_clickable__qAqVH:hover {\n cursor: pointer; }\n .Chip-module_chip__dZ5qz.Chip-module_clickable__qAqVH:hover.Chip-module_primary__YVDi9 {\n background: var(--primary-dark); }\n .Chip-module_chip__dZ5qz.Chip-module_clickable__qAqVH:hover.Chip-module_secondary__-e4xP {\n background: var(--secondary-dark); }\n .Chip-module_chip__dZ5qz.Chip-module_clickable__qAqVH:hover.Chip-module_accent__ZCTwu {\n background: var(--accent-dark); }\n .Chip-module_chip__dZ5qz.Chip-module_shadow__v11NF {\n box-shadow: var(--shadow); }\n";
|
|
756
770
|
var styles$C = {"chip":"Chip-module_chip__dZ5qz","deleteIcon":"Chip-module_deleteIcon__--rUx","primary":"Chip-module_primary__YVDi9","secondary":"Chip-module_secondary__-e4xP","accent":"Chip-module_accent__ZCTwu","light":"Chip-module_light__vKs7O","dark":"Chip-module_dark__G-FLQ","clickable":"Chip-module_clickable__qAqVH","shadow":"Chip-module_shadow__v11NF"};
|
|
757
771
|
styleInject(css_248z$C);
|
|
758
772
|
|
|
@@ -772,11 +786,76 @@ const Chip = (props) => {
|
|
|
772
786
|
onDelete && onDelete(e);
|
|
773
787
|
};
|
|
774
788
|
return (React.createElement("div", Object.assign({ className: getCssClass() }, rest, { style: style }),
|
|
775
|
-
React.createElement("
|
|
789
|
+
React.createElement("span", null, children),
|
|
776
790
|
isDeletable && (React.createElement("div", { className: styles$C.deleteIcon, onClick: e => handleClickOnDelete(e) }, deleteIcon))));
|
|
777
791
|
};
|
|
778
792
|
|
|
779
|
-
|
|
793
|
+
const CssTransition = (props) => {
|
|
794
|
+
const { className, children, show } = props;
|
|
795
|
+
const [isShow, setIsShow] = useState(undefined);
|
|
796
|
+
const [cssState, setCssState] = useState({
|
|
797
|
+
hidden: true
|
|
798
|
+
});
|
|
799
|
+
const transitionConainter = useRef(null);
|
|
800
|
+
useEffect(() => {
|
|
801
|
+
if (show !== undefined) {
|
|
802
|
+
setIsShow(show);
|
|
803
|
+
}
|
|
804
|
+
}, [show]);
|
|
805
|
+
const nextFrame = () => {
|
|
806
|
+
return new Promise((resolve) => {
|
|
807
|
+
requestAnimationFrame(() => {
|
|
808
|
+
requestAnimationFrame(resolve);
|
|
809
|
+
});
|
|
810
|
+
});
|
|
811
|
+
};
|
|
812
|
+
const afterTransition = (element) => {
|
|
813
|
+
return new Promise((resolve) => {
|
|
814
|
+
if (element) {
|
|
815
|
+
const duration = Number(getComputedStyle(element).transitionDuration.replace("s", "")) * 1000;
|
|
816
|
+
setTimeout(() => { resolve(); }, duration);
|
|
817
|
+
}
|
|
818
|
+
else {
|
|
819
|
+
resolve();
|
|
820
|
+
}
|
|
821
|
+
});
|
|
822
|
+
};
|
|
823
|
+
const renderAnimation = async (show) => {
|
|
824
|
+
if (show === true) {
|
|
825
|
+
setCssState({ enter: true, enterStart: true });
|
|
826
|
+
await nextFrame();
|
|
827
|
+
setCssState({ enter: true, enterEnd: true });
|
|
828
|
+
await afterTransition(transitionConainter.current);
|
|
829
|
+
setCssState(undefined);
|
|
830
|
+
}
|
|
831
|
+
if (show === false) {
|
|
832
|
+
setCssState({ leave: true, leaveStart: true });
|
|
833
|
+
await nextFrame();
|
|
834
|
+
setCssState({ leave: true, leaveEnd: true });
|
|
835
|
+
await afterTransition(transitionConainter.current);
|
|
836
|
+
setCssState({ hidden: true });
|
|
837
|
+
}
|
|
838
|
+
};
|
|
839
|
+
useEffect(() => {
|
|
840
|
+
if (isShow !== undefined && (isShow === true || isShow === false)) {
|
|
841
|
+
renderAnimation(isShow);
|
|
842
|
+
}
|
|
843
|
+
}, [isShow]);
|
|
844
|
+
const getCssClasses = () => {
|
|
845
|
+
const cssClasses = [];
|
|
846
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.hidden) && cssClasses.push(`hidden`);
|
|
847
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.enter) && cssClasses.push(`${className}-enter`);
|
|
848
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.enterStart) && cssClasses.push(`${className}-enter-start`);
|
|
849
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.enterEnd) && cssClasses.push(`${className}-enter-end`);
|
|
850
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.leave) && cssClasses.push(`${className}-leave`);
|
|
851
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.leaveStart) && cssClasses.push(`${className}-leave-start`);
|
|
852
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.leaveEnd) && cssClasses.push(`${className}-leave-end`);
|
|
853
|
+
return cssClasses.filter((css) => css).join(" ");
|
|
854
|
+
};
|
|
855
|
+
return (React.createElement("div", { ref: transitionConainter, className: getCssClasses() }, children));
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
var css_248z$B = ".Column-module_column__fcTgl {\n flex: 1 0 0%; }\n\n@media (max-width: 575.98px) {\n .Column-module_column__fcTgl {\n flex: 1; } }\n";
|
|
780
859
|
var styles$B = {"column":"Column-module_column__fcTgl"};
|
|
781
860
|
styleInject(css_248z$B);
|
|
782
861
|
|
|
@@ -864,8 +943,8 @@ const FileInput = (props) => {
|
|
|
864
943
|
React.createElement("input", Object.assign({ type: "file", ref: inputFileElement, className: getCssClasses(), id: id, name: name, multiple: multiple, accept: accept, disabled: disabled, readOnly: readOnly, hidden: true, onChange: handleOnChange, value: model }, rest))));
|
|
865
944
|
};
|
|
866
945
|
|
|
867
|
-
var css_248z$y = ".Select-module_selectContainer__DHFDZ {\n position: relative; }\n\n.Select-module_select__Fbn38 {\n width: 100%;\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid #ced4da;\n appearance: none;\n border-radius: 0.25rem;\n box-shadow: inset 0 1px 2px #00000013;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n align-items: center;\n min-height: calc(1.5em + 0.75rem + 2px);\n height: auto;\n display: flex; }\n .Select-module_select__Fbn38:hover {\n cursor: pointer; }\n .Select-module_select__Fbn38:focus:not(.Select-module_select__Fbn38.Select-module_disabled__2XXut) {\n color: #212529;\n background-color: #fff;\n border-color: #86b7fe;\n outline: 0;\n box-shadow: inset 0 1px 2px #00000013, 0 0 0 0.25rem #0d6efd40; }\n .Select-module_select__Fbn38.Select-module_disabled__2XXut, .Select-module_select__Fbn38.Select-module_readOnly__VoTER {\n background-color: #e9ecef; }\n .Select-module_select__Fbn38.Select-module_disabled__2XXut:hover {\n cursor: not-allowed; }\n .Select-module_select__Fbn38.Select-module_readOnly__VoTER:hover {\n cursor: inherit; }\n\n.Select-module_selectMenu__8y4kQ {\n background-color: var(--light);\n position: absolute;\n box-shadow: var(--shadow);\n border-radius: var(--borderRadius);\n width: 100%;\n top: 2px;\n z-index: 1112;\n max-height: 280px;\n overflow: auto; }\n";
|
|
868
|
-
var styles$y = {"selectContainer":"Select-module_selectContainer__DHFDZ","select":"Select-module_select__Fbn38","disabled":"Select-module_disabled__2XXut","readOnly":"Select-module_readOnly__VoTER","selectMenu":"Select-module_selectMenu__8y4kQ"};
|
|
946
|
+
var css_248z$y = ".Select-module_selectContainer__DHFDZ {\n position: relative; }\n\n.Select-module_select__Fbn38 {\n width: 100%;\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid #ced4da;\n appearance: none;\n border-radius: 0.25rem;\n box-shadow: inset 0 1px 2px #00000013;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n align-items: center;\n min-height: calc(1.5em + 0.75rem + 2px);\n height: auto;\n display: flex;\n flex-wrap: wrap; }\n .Select-module_select__Fbn38 > span {\n flex: 1; }\n .Select-module_select__Fbn38:hover {\n cursor: pointer; }\n .Select-module_select__Fbn38:focus:not(.Select-module_select__Fbn38.Select-module_disabled__2XXut) {\n color: #212529;\n background-color: #fff;\n border-color: #86b7fe;\n outline: 0;\n box-shadow: inset 0 1px 2px #00000013, 0 0 0 0.25rem #0d6efd40; }\n .Select-module_select__Fbn38.Select-module_disabled__2XXut, .Select-module_select__Fbn38.Select-module_readOnly__VoTER {\n background-color: #e9ecef; }\n .Select-module_select__Fbn38.Select-module_disabled__2XXut:hover {\n cursor: not-allowed; }\n .Select-module_select__Fbn38.Select-module_readOnly__VoTER:hover {\n cursor: inherit; }\n\n.Select-module_chipContainer__1poFF {\n gap: 10px;\n flex: 1;\n display: inline-flex;\n flex-wrap: wrap; }\n\n.Select-module_selectMenu__8y4kQ {\n background-color: var(--light);\n position: absolute;\n box-shadow: var(--shadow);\n border-radius: var(--borderRadius);\n width: 100%;\n top: 2px;\n z-index: 1112;\n max-height: 280px;\n overflow: auto; }\n";
|
|
947
|
+
var styles$y = {"selectContainer":"Select-module_selectContainer__DHFDZ","select":"Select-module_select__Fbn38","disabled":"Select-module_disabled__2XXut","readOnly":"Select-module_readOnly__VoTER","chipContainer":"Select-module_chipContainer__1poFF","selectMenu":"Select-module_selectMenu__8y4kQ"};
|
|
869
948
|
styleInject(css_248z$y);
|
|
870
949
|
|
|
871
950
|
const Select = (props) => {
|
|
@@ -961,7 +1040,7 @@ const Select = (props) => {
|
|
|
961
1040
|
let result = null;
|
|
962
1041
|
if (selectedOptions.length <= multipleMaxCountItems && selectedOptions.length > 0) {
|
|
963
1042
|
result = selectedOptions
|
|
964
|
-
.map(option => React.createElement(Chip, { key: option.value,
|
|
1043
|
+
.map(option => React.createElement(Chip, { key: option.value, color: COLOR.primary, isDeletable: true, onDelete: (e) => handleOnDelete(e, option) }, option.label));
|
|
965
1044
|
}
|
|
966
1045
|
else {
|
|
967
1046
|
result = React.createElement("span", null,
|
|
@@ -1006,8 +1085,9 @@ const Select = (props) => {
|
|
|
1006
1085
|
return (React.createElement("div", { ref: selectConainter, className: styles$y.selectContainer },
|
|
1007
1086
|
React.createElement("div", { id: id, className: getCssClass(), onClick: () => show(), tabIndex: 0, onKeyDown: e => handleOnKeyDown(e) },
|
|
1008
1087
|
!multiple && renderSingleViewModel(),
|
|
1009
|
-
multiple &&
|
|
1010
|
-
|
|
1088
|
+
multiple &&
|
|
1089
|
+
React.createElement("div", { className: styles$y.chipContainer }, renderMultipleViewModel()),
|
|
1090
|
+
React.createElement(Icon, { className: "ml-2" },
|
|
1011
1091
|
React.createElement(ChevronDownSolidIcon, null))),
|
|
1012
1092
|
isShow &&
|
|
1013
1093
|
createPortal(React.createElement(React.Fragment, null,
|
|
@@ -1415,7 +1495,7 @@ const DateSelect = (props) => {
|
|
|
1415
1495
|
// return Math.ceil((((d - yearStart) / 86400000) + 1) / 7)
|
|
1416
1496
|
// };
|
|
1417
1497
|
|
|
1418
|
-
var css_248z$u = ".Drawer-module_drawer__kdQCk {\n height: 100%;\n z-index: 1101;\n bottom: 0;\n position: fixed;\n background: white;\n min-width:
|
|
1498
|
+
var css_248z$u = ".Drawer-module_drawer__kdQCk {\n height: 100%;\n z-index: 1101;\n bottom: 0;\n position: fixed;\n background: white;\n min-width: 320px;\n overflow-y: auto; }\n .Drawer-module_drawer__kdQCk.Drawer-module_permanent__c-y8y {\n position: inherit;\n z-index: 0; }\n .Drawer-module_drawer__kdQCk.Drawer-module_left__loQVO {\n order: 0; }\n .Drawer-module_drawer__kdQCk.Drawer-module_right__sJ3mZ {\n order: 2; }\n .Drawer-module_drawer__kdQCk.Drawer-module_shadow__Myo3n {\n box-shadow: var(--shadow); }\n\n.Drawer-module_drawerOpen__07ptP {\n overflow: hidden; }\n";
|
|
1419
1499
|
var styles$u = {"drawer":"Drawer-module_drawer__kdQCk","permanent":"Drawer-module_permanent__c-y8y","left":"Drawer-module_left__loQVO","right":"Drawer-module_right__sJ3mZ","shadow":"Drawer-module_shadow__Myo3n","drawerOpen":"Drawer-module_drawerOpen__07ptP"};
|
|
1420
1500
|
styleInject(css_248z$u);
|
|
1421
1501
|
|
|
@@ -1608,16 +1688,17 @@ const ExpansionPanel = (props) => {
|
|
|
1608
1688
|
React.createElement(ExpansionPanelContent, null, children)));
|
|
1609
1689
|
};
|
|
1610
1690
|
|
|
1611
|
-
var css_248z$m = ".FloatingActionButton-module_fab__Rw3kd {\n box-shadow: var(--shadow); }\n .FloatingActionButton-
|
|
1612
|
-
var styles$m = {"fab":"FloatingActionButton-module_fab__Rw3kd","fixed":"FloatingActionButton-module_fixed__XQOkG"};
|
|
1691
|
+
var css_248z$m = ".FloatingActionButton-module_fab__Rw3kd {\n box-shadow: var(--shadow); }\n\n.FloatingActionButton-module_fixed__XQOkG {\n position: fixed;\n z-index: 1000; }\n .FloatingActionButton-module_fixed__XQOkG.FloatingActionButton-module_leftTop__ZiHQN {\n top: 16px;\n left: 16px; }\n .FloatingActionButton-module_fixed__XQOkG.FloatingActionButton-module_leftBottom__210sl {\n bottom: 16px;\n left: 16px; }\n .FloatingActionButton-module_fixed__XQOkG.FloatingActionButton-module_rightTop__VUsvT {\n top: 64px;\n right: 16px; }\n .FloatingActionButton-module_fixed__XQOkG.FloatingActionButton-module_rightBottom__FaUFl {\n bottom: 16px;\n right: 16px; }\n";
|
|
1692
|
+
var styles$m = {"fab":"FloatingActionButton-module_fab__Rw3kd","fixed":"FloatingActionButton-module_fixed__XQOkG","leftTop":"FloatingActionButton-module_leftTop__ZiHQN","leftBottom":"FloatingActionButton-module_leftBottom__210sl","rightTop":"FloatingActionButton-module_rightTop__VUsvT","rightBottom":"FloatingActionButton-module_rightBottom__FaUFl"};
|
|
1613
1693
|
styleInject(css_248z$m);
|
|
1614
1694
|
|
|
1615
1695
|
const FloatingActionButton = (props) => {
|
|
1616
|
-
const { className, icon, color = COLOR.primary, fixed, size = SIZE.lg, isActive, disabled, onClick } = props;
|
|
1696
|
+
const { className, icon, color = COLOR.primary, fixed, position = 'rightBottom', size = SIZE.lg, isActive, disabled, onClick } = props;
|
|
1617
1697
|
const getCssClasses = () => {
|
|
1618
1698
|
const cssClasses = [];
|
|
1619
1699
|
cssClasses.push(styles$m.fab);
|
|
1620
|
-
fixed && cssClasses.push(styles$m
|
|
1700
|
+
fixed && cssClasses.push(styles$m.fixed);
|
|
1701
|
+
position && fixed && cssClasses.push(styles$m[position]);
|
|
1621
1702
|
className && cssClasses.push(className);
|
|
1622
1703
|
return cssClasses.filter(css => css).join(' ');
|
|
1623
1704
|
};
|
|
@@ -2650,4 +2731,4 @@ const TreeItem = (props) => {
|
|
|
2650
2731
|
children && _isExpanded ? React.createElement("ul", null, children) : null));
|
|
2651
2732
|
};
|
|
2652
2733
|
|
|
2653
|
-
export { Alert, AppBar, AppBarTitle, AutoComplete, Backdrop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, COLOR, Card, CardBody, CardFooter, CardImage, CardSubtitle, CardText, CardTitle, CaretDownSolidIcon, CheckSolidIcon, CheckSquareRegularIcon, Checkbox, ChevronDownSolidIcon, ChevronLeftSolidIcon, ChevronRightSolidIcon, ChevronUpSolidIcon, Chip, CircleSolidIcon, Column, ConditionalWrapper, DATEMODE, DateSelect, DaySelect, Drawer, EmailValidator, ExpansionPanel, ExpansionPanelContent, ExpansionPanelHeader, FileInput, FloatingActionButton, Form, FormControl, FormError, FormGroup, FormHint, FormInput, FormLabel, GlobalModal, HomeSolidIcon, HourSelect, Icon, IconButton, IsEmptyValidator, IsEqualValidator, Link, List, ListItem, ListItemAction, ListItemAvatar, ListItemIcon, ListItemText, LoadingIndicator, LoadingIndicatorContainer, MODALBUTTONTYPE, MODALTYPE, Menu, MenuBody, MenuDivider, MenuItem, MenuToggle, MilliSecondSelect, MinuteSelect, Modal, ModalBody, ModalFooter, ModalHeader, MonthSelect, NumberSelect, POSITION, PlusSolidIcon, Row, SIZE, STATUS, SecondSelect, Select, Sidebar, Snackbar, SpeedDial, SpeedDialAction, SpeedDialIcon, SpinnerSolidIcon, SquareRegularIcon, Step, Stepper, StepperActions, TIMEMODE, Tab, TabPanel, Table, TableBody, TableCell, TableHead, TableRow, Tabs, Textarea, TimeSelect, TimesCircleSolidIcon, TimesSolidIcon, Tooltip, TreeItem, TreeView, Typography, VARIANT, YearSelect, loadingIndicatorService, modalService, snackbarService, useConstructor, useCssClasses, useDebounce, useHover, useWindowSize };
|
|
2734
|
+
export { Alert, AppBar, AppBarTitle, AutoComplete, Backdrop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, COLOR, Card, CardBody, CardFooter, CardImage, CardSubtitle, CardText, CardTitle, CaretDownSolidIcon, CheckSolidIcon, CheckSquareRegularIcon, Checkbox, ChevronDownSolidIcon, ChevronLeftSolidIcon, ChevronRightSolidIcon, ChevronUpSolidIcon, Chip, CircleSolidIcon, Column, ConditionalWrapper, CssTransition, DATEMODE, DateSelect, DaySelect, Drawer, EmailValidator, ExpansionPanel, ExpansionPanelContent, ExpansionPanelHeader, FileInput, FloatingActionButton, Form, FormControl, FormError, FormGroup, FormHint, FormInput, FormLabel, GlobalModal, HomeSolidIcon, HourSelect, Icon, IconButton, IsEmptyValidator, IsEqualValidator, Link, List, ListItem, ListItemAction, ListItemAvatar, ListItemIcon, ListItemText, LoadingIndicator, LoadingIndicatorContainer, MODALBUTTONTYPE, MODALTYPE, Menu, MenuBody, MenuDivider, MenuItem, MenuToggle, MilliSecondSelect, MinuteSelect, Modal, ModalBody, ModalFooter, ModalHeader, MonthSelect, NumberSelect, POSITION, PlusSolidIcon, Row, SIZE, STATUS, SecondSelect, Select, Sidebar, Snackbar, SpeedDial, SpeedDialAction, SpeedDialIcon, SpinnerSolidIcon, SquareRegularIcon, Step, Stepper, StepperActions, TIMEMODE, Tab, TabPanel, Table, TableBody, TableCell, TableHead, TableRow, Tabs, Textarea, TimeSelect, TimesCircleSolidIcon, TimesSolidIcon, Tooltip, TreeItem, TreeView, Typography, VARIANT, YearSelect, loadingIndicatorService, modalService, snackbarService, useConstructor, useCssClasses, useDebounce, useHover, useMobileDetect, useWindowSize };
|
package/index.js
CHANGED
|
@@ -232,23 +232,26 @@ const CircleSolidIcon = () => (React__default["default"].createElement("svg", {
|
|
|
232
232
|
const ChevronLeftSolidIcon = () => (React__default["default"].createElement("svg", { "aria-hidden": "true", focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512" },
|
|
233
233
|
React__default["default"].createElement("path", { fill: "currentColor", d: "M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z" })));
|
|
234
234
|
|
|
235
|
-
function
|
|
236
|
-
const
|
|
237
|
-
width: 0,
|
|
238
|
-
height: 0,
|
|
239
|
-
});
|
|
235
|
+
function useDebounce(callback, timeout, deps) {
|
|
236
|
+
const timeoutId = React.useRef();
|
|
240
237
|
React.useEffect(() => {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
238
|
+
clearTimeout(timeoutId.current);
|
|
239
|
+
timeoutId.current = setTimeout(callback, timeout);
|
|
240
|
+
return () => clearTimeout(timeoutId.current);
|
|
241
|
+
}, deps);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const useConstructor = (callBack) => {
|
|
245
|
+
const [hasBeenCalled, setHasBeenCalled] = React.useState(false);
|
|
246
|
+
if (hasBeenCalled)
|
|
247
|
+
return;
|
|
248
|
+
callBack();
|
|
249
|
+
setHasBeenCalled(true);
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
function useCssClasses(cssClasses) {
|
|
253
|
+
const cssClassName = (cssClasses === null || cssClasses === void 0 ? void 0 : cssClasses.filter(css => css).join(' ')) || '';
|
|
254
|
+
return [cssClassName];
|
|
252
255
|
}
|
|
253
256
|
|
|
254
257
|
function useHover() {
|
|
@@ -273,26 +276,37 @@ function useHover() {
|
|
|
273
276
|
return [ref, value];
|
|
274
277
|
}
|
|
275
278
|
|
|
276
|
-
|
|
277
|
-
const [
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
setHasBeenCalled(true);
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
function useDebounce(callback, timeout, deps) {
|
|
285
|
-
const timeoutId = React.useRef();
|
|
279
|
+
function useWindowSize() {
|
|
280
|
+
const [windowSize, setWindowSize] = React.useState({
|
|
281
|
+
width: 0,
|
|
282
|
+
height: 0,
|
|
283
|
+
});
|
|
286
284
|
React.useEffect(() => {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
285
|
+
function handleResize() {
|
|
286
|
+
setWindowSize({
|
|
287
|
+
width: window.innerWidth,
|
|
288
|
+
height: window.innerHeight,
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
window.addEventListener("resize", handleResize);
|
|
292
|
+
handleResize();
|
|
293
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
294
|
+
}, []);
|
|
295
|
+
return windowSize;
|
|
291
296
|
}
|
|
292
297
|
|
|
293
|
-
function
|
|
294
|
-
const
|
|
295
|
-
|
|
298
|
+
function useMobileDetect() {
|
|
299
|
+
const [isMobile, setIsMobile] = React.useState(false);
|
|
300
|
+
const windowSize = useWindowSize();
|
|
301
|
+
const checkIsMobile = (height, width) => {
|
|
302
|
+
if (height > 0 && width > 0) {
|
|
303
|
+
setIsMobile(!(width >= 1024));
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
React.useEffect(() => {
|
|
307
|
+
windowSize && checkIsMobile(windowSize.height, windowSize.width);
|
|
308
|
+
}, [windowSize]);
|
|
309
|
+
return { isMobile };
|
|
296
310
|
}
|
|
297
311
|
|
|
298
312
|
var css_248z$X = ".Backdrop-module_backdrop__IRMoL {\n height: 100%;\n width: 100%;\n position: absolute;\n opacity: 0.5;\n z-index: 1040;\n top: 0;\n left: 0;\n background-color: #000; }\n .Backdrop-module_backdrop__IRMoL.Backdrop-module_isTransparent__F5nA5 {\n opacity: 0; }\n";
|
|
@@ -760,7 +774,7 @@ const Checkbox = (props) => {
|
|
|
760
774
|
React__default["default"].createElement("input", Object.assign({ type: "checkbox", ref: checkboxElement, id: id, name: name, checked: isChecked, disabled: disabled, readOnly: readOnly, hidden: true, value: value }, rest))));
|
|
761
775
|
};
|
|
762
776
|
|
|
763
|
-
var css_248z$C = ".Chip-module_chip__dZ5qz {\n display: inline-flex;\n align-items: center;\n padding: 0.5rem;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out
|
|
777
|
+
var css_248z$C = ".Chip-module_chip__dZ5qz {\n display: inline-flex;\n align-items: center;\n padding: 0.5rem;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,\r box-shadow 0.15s ease-in-out;\n font-size: 75%;\n font-weight: 700;\n border-radius: 10rem;\n line-height: 1; }\n .Chip-module_chip__dZ5qz span {\n margin-bottom: 2px; }\n .Chip-module_chip__dZ5qz svg {\n width: 18px;\n height: 18px; }\n .Chip-module_chip__dZ5qz .Chip-module_deleteIcon__--rUx {\n margin-left: 5px; }\n .Chip-module_chip__dZ5qz .Chip-module_deleteIcon__--rUx:hover {\n cursor: pointer; }\n .Chip-module_chip__dZ5qz.Chip-module_primary__YVDi9 {\n background: var(--primary);\n color: var(--primary-contrast-text); }\n .Chip-module_chip__dZ5qz.Chip-module_secondary__-e4xP {\n background: var(--secondary);\n color: var(--secondary-contrast-text); }\n .Chip-module_chip__dZ5qz.Chip-module_accent__ZCTwu {\n background: var(--accent);\n color: var(--accent-contrast-text); }\n .Chip-module_chip__dZ5qz.Chip-module_light__vKs7O {\n color: var(--light-contrast-text);\n background-color: var(--light); }\n .Chip-module_chip__dZ5qz.Chip-module_dark__G-FLQ {\n color: var(--dark-contrast-text);\n background-color: var(--dark); }\n .Chip-module_chip__dZ5qz.Chip-module_clickable__qAqVH:hover {\n cursor: pointer; }\n .Chip-module_chip__dZ5qz.Chip-module_clickable__qAqVH:hover.Chip-module_primary__YVDi9 {\n background: var(--primary-dark); }\n .Chip-module_chip__dZ5qz.Chip-module_clickable__qAqVH:hover.Chip-module_secondary__-e4xP {\n background: var(--secondary-dark); }\n .Chip-module_chip__dZ5qz.Chip-module_clickable__qAqVH:hover.Chip-module_accent__ZCTwu {\n background: var(--accent-dark); }\n .Chip-module_chip__dZ5qz.Chip-module_shadow__v11NF {\n box-shadow: var(--shadow); }\n";
|
|
764
778
|
var styles$C = {"chip":"Chip-module_chip__dZ5qz","deleteIcon":"Chip-module_deleteIcon__--rUx","primary":"Chip-module_primary__YVDi9","secondary":"Chip-module_secondary__-e4xP","accent":"Chip-module_accent__ZCTwu","light":"Chip-module_light__vKs7O","dark":"Chip-module_dark__G-FLQ","clickable":"Chip-module_clickable__qAqVH","shadow":"Chip-module_shadow__v11NF"};
|
|
765
779
|
styleInject(css_248z$C);
|
|
766
780
|
|
|
@@ -780,11 +794,76 @@ const Chip = (props) => {
|
|
|
780
794
|
onDelete && onDelete(e);
|
|
781
795
|
};
|
|
782
796
|
return (React__default["default"].createElement("div", Object.assign({ className: getCssClass() }, rest, { style: style }),
|
|
783
|
-
React__default["default"].createElement("
|
|
797
|
+
React__default["default"].createElement("span", null, children),
|
|
784
798
|
isDeletable && (React__default["default"].createElement("div", { className: styles$C.deleteIcon, onClick: e => handleClickOnDelete(e) }, deleteIcon))));
|
|
785
799
|
};
|
|
786
800
|
|
|
787
|
-
|
|
801
|
+
const CssTransition = (props) => {
|
|
802
|
+
const { className, children, show } = props;
|
|
803
|
+
const [isShow, setIsShow] = React.useState(undefined);
|
|
804
|
+
const [cssState, setCssState] = React.useState({
|
|
805
|
+
hidden: true
|
|
806
|
+
});
|
|
807
|
+
const transitionConainter = React.useRef(null);
|
|
808
|
+
React.useEffect(() => {
|
|
809
|
+
if (show !== undefined) {
|
|
810
|
+
setIsShow(show);
|
|
811
|
+
}
|
|
812
|
+
}, [show]);
|
|
813
|
+
const nextFrame = () => {
|
|
814
|
+
return new Promise((resolve) => {
|
|
815
|
+
requestAnimationFrame(() => {
|
|
816
|
+
requestAnimationFrame(resolve);
|
|
817
|
+
});
|
|
818
|
+
});
|
|
819
|
+
};
|
|
820
|
+
const afterTransition = (element) => {
|
|
821
|
+
return new Promise((resolve) => {
|
|
822
|
+
if (element) {
|
|
823
|
+
const duration = Number(getComputedStyle(element).transitionDuration.replace("s", "")) * 1000;
|
|
824
|
+
setTimeout(() => { resolve(); }, duration);
|
|
825
|
+
}
|
|
826
|
+
else {
|
|
827
|
+
resolve();
|
|
828
|
+
}
|
|
829
|
+
});
|
|
830
|
+
};
|
|
831
|
+
const renderAnimation = async (show) => {
|
|
832
|
+
if (show === true) {
|
|
833
|
+
setCssState({ enter: true, enterStart: true });
|
|
834
|
+
await nextFrame();
|
|
835
|
+
setCssState({ enter: true, enterEnd: true });
|
|
836
|
+
await afterTransition(transitionConainter.current);
|
|
837
|
+
setCssState(undefined);
|
|
838
|
+
}
|
|
839
|
+
if (show === false) {
|
|
840
|
+
setCssState({ leave: true, leaveStart: true });
|
|
841
|
+
await nextFrame();
|
|
842
|
+
setCssState({ leave: true, leaveEnd: true });
|
|
843
|
+
await afterTransition(transitionConainter.current);
|
|
844
|
+
setCssState({ hidden: true });
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
React.useEffect(() => {
|
|
848
|
+
if (isShow !== undefined && (isShow === true || isShow === false)) {
|
|
849
|
+
renderAnimation(isShow);
|
|
850
|
+
}
|
|
851
|
+
}, [isShow]);
|
|
852
|
+
const getCssClasses = () => {
|
|
853
|
+
const cssClasses = [];
|
|
854
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.hidden) && cssClasses.push(`hidden`);
|
|
855
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.enter) && cssClasses.push(`${className}-enter`);
|
|
856
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.enterStart) && cssClasses.push(`${className}-enter-start`);
|
|
857
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.enterEnd) && cssClasses.push(`${className}-enter-end`);
|
|
858
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.leave) && cssClasses.push(`${className}-leave`);
|
|
859
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.leaveStart) && cssClasses.push(`${className}-leave-start`);
|
|
860
|
+
(cssState === null || cssState === void 0 ? void 0 : cssState.leaveEnd) && cssClasses.push(`${className}-leave-end`);
|
|
861
|
+
return cssClasses.filter((css) => css).join(" ");
|
|
862
|
+
};
|
|
863
|
+
return (React__default["default"].createElement("div", { ref: transitionConainter, className: getCssClasses() }, children));
|
|
864
|
+
};
|
|
865
|
+
|
|
866
|
+
var css_248z$B = ".Column-module_column__fcTgl {\n flex: 1 0 0%; }\n\n@media (max-width: 575.98px) {\n .Column-module_column__fcTgl {\n flex: 1; } }\n";
|
|
788
867
|
var styles$B = {"column":"Column-module_column__fcTgl"};
|
|
789
868
|
styleInject(css_248z$B);
|
|
790
869
|
|
|
@@ -872,8 +951,8 @@ const FileInput = (props) => {
|
|
|
872
951
|
React__default["default"].createElement("input", Object.assign({ type: "file", ref: inputFileElement, className: getCssClasses(), id: id, name: name, multiple: multiple, accept: accept, disabled: disabled, readOnly: readOnly, hidden: true, onChange: handleOnChange, value: model }, rest))));
|
|
873
952
|
};
|
|
874
953
|
|
|
875
|
-
var css_248z$y = ".Select-module_selectContainer__DHFDZ {\n position: relative; }\n\n.Select-module_select__Fbn38 {\n width: 100%;\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid #ced4da;\n appearance: none;\n border-radius: 0.25rem;\n box-shadow: inset 0 1px 2px #00000013;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n align-items: center;\n min-height: calc(1.5em + 0.75rem + 2px);\n height: auto;\n display: flex; }\n .Select-module_select__Fbn38:hover {\n cursor: pointer; }\n .Select-module_select__Fbn38:focus:not(.Select-module_select__Fbn38.Select-module_disabled__2XXut) {\n color: #212529;\n background-color: #fff;\n border-color: #86b7fe;\n outline: 0;\n box-shadow: inset 0 1px 2px #00000013, 0 0 0 0.25rem #0d6efd40; }\n .Select-module_select__Fbn38.Select-module_disabled__2XXut, .Select-module_select__Fbn38.Select-module_readOnly__VoTER {\n background-color: #e9ecef; }\n .Select-module_select__Fbn38.Select-module_disabled__2XXut:hover {\n cursor: not-allowed; }\n .Select-module_select__Fbn38.Select-module_readOnly__VoTER:hover {\n cursor: inherit; }\n\n.Select-module_selectMenu__8y4kQ {\n background-color: var(--light);\n position: absolute;\n box-shadow: var(--shadow);\n border-radius: var(--borderRadius);\n width: 100%;\n top: 2px;\n z-index: 1112;\n max-height: 280px;\n overflow: auto; }\n";
|
|
876
|
-
var styles$y = {"selectContainer":"Select-module_selectContainer__DHFDZ","select":"Select-module_select__Fbn38","disabled":"Select-module_disabled__2XXut","readOnly":"Select-module_readOnly__VoTER","selectMenu":"Select-module_selectMenu__8y4kQ"};
|
|
954
|
+
var css_248z$y = ".Select-module_selectContainer__DHFDZ {\n position: relative; }\n\n.Select-module_select__Fbn38 {\n width: 100%;\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid #ced4da;\n appearance: none;\n border-radius: 0.25rem;\n box-shadow: inset 0 1px 2px #00000013;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n align-items: center;\n min-height: calc(1.5em + 0.75rem + 2px);\n height: auto;\n display: flex;\n flex-wrap: wrap; }\n .Select-module_select__Fbn38 > span {\n flex: 1; }\n .Select-module_select__Fbn38:hover {\n cursor: pointer; }\n .Select-module_select__Fbn38:focus:not(.Select-module_select__Fbn38.Select-module_disabled__2XXut) {\n color: #212529;\n background-color: #fff;\n border-color: #86b7fe;\n outline: 0;\n box-shadow: inset 0 1px 2px #00000013, 0 0 0 0.25rem #0d6efd40; }\n .Select-module_select__Fbn38.Select-module_disabled__2XXut, .Select-module_select__Fbn38.Select-module_readOnly__VoTER {\n background-color: #e9ecef; }\n .Select-module_select__Fbn38.Select-module_disabled__2XXut:hover {\n cursor: not-allowed; }\n .Select-module_select__Fbn38.Select-module_readOnly__VoTER:hover {\n cursor: inherit; }\n\n.Select-module_chipContainer__1poFF {\n gap: 10px;\n flex: 1;\n display: inline-flex;\n flex-wrap: wrap; }\n\n.Select-module_selectMenu__8y4kQ {\n background-color: var(--light);\n position: absolute;\n box-shadow: var(--shadow);\n border-radius: var(--borderRadius);\n width: 100%;\n top: 2px;\n z-index: 1112;\n max-height: 280px;\n overflow: auto; }\n";
|
|
955
|
+
var styles$y = {"selectContainer":"Select-module_selectContainer__DHFDZ","select":"Select-module_select__Fbn38","disabled":"Select-module_disabled__2XXut","readOnly":"Select-module_readOnly__VoTER","chipContainer":"Select-module_chipContainer__1poFF","selectMenu":"Select-module_selectMenu__8y4kQ"};
|
|
877
956
|
styleInject(css_248z$y);
|
|
878
957
|
|
|
879
958
|
const Select = (props) => {
|
|
@@ -969,7 +1048,7 @@ const Select = (props) => {
|
|
|
969
1048
|
let result = null;
|
|
970
1049
|
if (selectedOptions.length <= multipleMaxCountItems && selectedOptions.length > 0) {
|
|
971
1050
|
result = selectedOptions
|
|
972
|
-
.map(option => React__default["default"].createElement(Chip, { key: option.value,
|
|
1051
|
+
.map(option => React__default["default"].createElement(Chip, { key: option.value, color: exports.COLOR.primary, isDeletable: true, onDelete: (e) => handleOnDelete(e, option) }, option.label));
|
|
973
1052
|
}
|
|
974
1053
|
else {
|
|
975
1054
|
result = React__default["default"].createElement("span", null,
|
|
@@ -1014,8 +1093,9 @@ const Select = (props) => {
|
|
|
1014
1093
|
return (React__default["default"].createElement("div", { ref: selectConainter, className: styles$y.selectContainer },
|
|
1015
1094
|
React__default["default"].createElement("div", { id: id, className: getCssClass(), onClick: () => show(), tabIndex: 0, onKeyDown: e => handleOnKeyDown(e) },
|
|
1016
1095
|
!multiple && renderSingleViewModel(),
|
|
1017
|
-
multiple &&
|
|
1018
|
-
|
|
1096
|
+
multiple &&
|
|
1097
|
+
React__default["default"].createElement("div", { className: styles$y.chipContainer }, renderMultipleViewModel()),
|
|
1098
|
+
React__default["default"].createElement(Icon, { className: "ml-2" },
|
|
1019
1099
|
React__default["default"].createElement(ChevronDownSolidIcon, null))),
|
|
1020
1100
|
isShow &&
|
|
1021
1101
|
reactDom.createPortal(React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
@@ -1423,7 +1503,7 @@ const DateSelect = (props) => {
|
|
|
1423
1503
|
// return Math.ceil((((d - yearStart) / 86400000) + 1) / 7)
|
|
1424
1504
|
// };
|
|
1425
1505
|
|
|
1426
|
-
var css_248z$u = ".Drawer-module_drawer__kdQCk {\n height: 100%;\n z-index: 1101;\n bottom: 0;\n position: fixed;\n background: white;\n min-width:
|
|
1506
|
+
var css_248z$u = ".Drawer-module_drawer__kdQCk {\n height: 100%;\n z-index: 1101;\n bottom: 0;\n position: fixed;\n background: white;\n min-width: 320px;\n overflow-y: auto; }\n .Drawer-module_drawer__kdQCk.Drawer-module_permanent__c-y8y {\n position: inherit;\n z-index: 0; }\n .Drawer-module_drawer__kdQCk.Drawer-module_left__loQVO {\n order: 0; }\n .Drawer-module_drawer__kdQCk.Drawer-module_right__sJ3mZ {\n order: 2; }\n .Drawer-module_drawer__kdQCk.Drawer-module_shadow__Myo3n {\n box-shadow: var(--shadow); }\n\n.Drawer-module_drawerOpen__07ptP {\n overflow: hidden; }\n";
|
|
1427
1507
|
var styles$u = {"drawer":"Drawer-module_drawer__kdQCk","permanent":"Drawer-module_permanent__c-y8y","left":"Drawer-module_left__loQVO","right":"Drawer-module_right__sJ3mZ","shadow":"Drawer-module_shadow__Myo3n","drawerOpen":"Drawer-module_drawerOpen__07ptP"};
|
|
1428
1508
|
styleInject(css_248z$u);
|
|
1429
1509
|
|
|
@@ -1616,16 +1696,17 @@ const ExpansionPanel = (props) => {
|
|
|
1616
1696
|
React__default["default"].createElement(ExpansionPanelContent, null, children)));
|
|
1617
1697
|
};
|
|
1618
1698
|
|
|
1619
|
-
var css_248z$m = ".FloatingActionButton-module_fab__Rw3kd {\n box-shadow: var(--shadow); }\n .FloatingActionButton-
|
|
1620
|
-
var styles$m = {"fab":"FloatingActionButton-module_fab__Rw3kd","fixed":"FloatingActionButton-module_fixed__XQOkG"};
|
|
1699
|
+
var css_248z$m = ".FloatingActionButton-module_fab__Rw3kd {\n box-shadow: var(--shadow); }\n\n.FloatingActionButton-module_fixed__XQOkG {\n position: fixed;\n z-index: 1000; }\n .FloatingActionButton-module_fixed__XQOkG.FloatingActionButton-module_leftTop__ZiHQN {\n top: 16px;\n left: 16px; }\n .FloatingActionButton-module_fixed__XQOkG.FloatingActionButton-module_leftBottom__210sl {\n bottom: 16px;\n left: 16px; }\n .FloatingActionButton-module_fixed__XQOkG.FloatingActionButton-module_rightTop__VUsvT {\n top: 64px;\n right: 16px; }\n .FloatingActionButton-module_fixed__XQOkG.FloatingActionButton-module_rightBottom__FaUFl {\n bottom: 16px;\n right: 16px; }\n";
|
|
1700
|
+
var styles$m = {"fab":"FloatingActionButton-module_fab__Rw3kd","fixed":"FloatingActionButton-module_fixed__XQOkG","leftTop":"FloatingActionButton-module_leftTop__ZiHQN","leftBottom":"FloatingActionButton-module_leftBottom__210sl","rightTop":"FloatingActionButton-module_rightTop__VUsvT","rightBottom":"FloatingActionButton-module_rightBottom__FaUFl"};
|
|
1621
1701
|
styleInject(css_248z$m);
|
|
1622
1702
|
|
|
1623
1703
|
const FloatingActionButton = (props) => {
|
|
1624
|
-
const { className, icon, color = exports.COLOR.primary, fixed, size = exports.SIZE.lg, isActive, disabled, onClick } = props;
|
|
1704
|
+
const { className, icon, color = exports.COLOR.primary, fixed, position = 'rightBottom', size = exports.SIZE.lg, isActive, disabled, onClick } = props;
|
|
1625
1705
|
const getCssClasses = () => {
|
|
1626
1706
|
const cssClasses = [];
|
|
1627
1707
|
cssClasses.push(styles$m.fab);
|
|
1628
|
-
fixed && cssClasses.push(styles$m
|
|
1708
|
+
fixed && cssClasses.push(styles$m.fixed);
|
|
1709
|
+
position && fixed && cssClasses.push(styles$m[position]);
|
|
1629
1710
|
className && cssClasses.push(className);
|
|
1630
1711
|
return cssClasses.filter(css => css).join(' ');
|
|
1631
1712
|
};
|
|
@@ -2687,6 +2768,7 @@ exports.Chip = Chip;
|
|
|
2687
2768
|
exports.CircleSolidIcon = CircleSolidIcon;
|
|
2688
2769
|
exports.Column = Column;
|
|
2689
2770
|
exports.ConditionalWrapper = ConditionalWrapper;
|
|
2771
|
+
exports.CssTransition = CssTransition;
|
|
2690
2772
|
exports.DateSelect = DateSelect;
|
|
2691
2773
|
exports.DaySelect = DaySelect;
|
|
2692
2774
|
exports.Drawer = Drawer;
|
|
@@ -2771,4 +2853,5 @@ exports.useConstructor = useConstructor;
|
|
|
2771
2853
|
exports.useCssClasses = useCssClasses;
|
|
2772
2854
|
exports.useDebounce = useDebounce;
|
|
2773
2855
|
exports.useHover = useHover;
|
|
2856
|
+
exports.useMobileDetect = useMobileDetect;
|
|
2774
2857
|
exports.useWindowSize = useWindowSize;
|
package/package.json
CHANGED