@mirai/ui 1.0.129 → 1.0.131
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 +1 -0
- package/build/components/InputText/InputText.js +1 -1
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/Menu/__tests__/__snapshots__/Menu.test.jsx.snap +108 -100
- package/build/components/Table/Table.Row.js +9 -11
- package/build/components/Table/Table.Row.js.map +1 -1
- package/build/components/Table/Table.module.css +23 -5
- package/build/components/Table/Table.stories.js +32 -7
- package/build/components/Table/Table.stories.js.map +1 -1
- package/build/components/Table/Table.stories.module.css +8 -4
- package/build/components/Table/__tests__/__snapshots__/Table.test.js.snap +746 -1906
- package/build/primitives/Icon/Icon.constants.js +3 -1
- package/build/primitives/Icon/Icon.constants.js.map +1 -1
- package/build/primitives/Icon/__tests__/__snapshots__/Icon.test.js.snap +30 -0
- package/build/primitives/Layer/Layer.js +26 -6
- package/build/primitives/Layer/Layer.js.map +1 -1
- package/build/primitives/Layer/__tests__/__snapshots__/Layer.test.js.snap +6 -2
- package/build/primitives/Layer/helpers/getElementLayout.js +4 -1
- package/build/primitives/Layer/helpers/getElementLayout.js.map +1 -1
- package/build/primitives/Layer/helpers/getLayerPosition.js +5 -4
- package/build/primitives/Layer/helpers/getLayerPosition.js.map +1 -1
- package/build/theme/default.theme.css +1 -0
- package/package.json +1 -1
|
@@ -29,7 +29,9 @@ var ICON = {
|
|
|
29
29
|
ERROR: _md.MdErrorOutline,
|
|
30
30
|
INFO: _md.MdOutlineInfo,
|
|
31
31
|
SUCCESS: _md.MdOutlineCheckCircle,
|
|
32
|
-
WARNING: _md.MdOutlineWarningAmber
|
|
32
|
+
WARNING: _md.MdOutlineWarningAmber,
|
|
33
|
+
// <Table>
|
|
34
|
+
FILTER: _md.MdOutlineFilterAlt
|
|
33
35
|
};
|
|
34
36
|
exports.ICON = ICON;
|
|
35
37
|
//# sourceMappingURL=Icon.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.constants.js","names":["ICON","LEFT","RIGHT","UP","DOWN","CHECK","ADD","REMOVE","EXPAND_LESS","EXPAND_MORE","SEARCH","EYE_OPEN","EYE_CLOSE","CLOSE","ERROR","INFO","SUCCESS","WARNING"],"sources":["../../../src/primitives/Icon/Icon.constants.js"],"sourcesContent":["import {\n // <Calendar>\n MdOutlineArrowBack as LEFT,\n MdOutlineArrowForward as RIGHT,\n MdOutlineArrowUpward as UP,\n MdOutlineArrowDownward as DOWN,\n // <InputOption>\n MdOutlineCheck as CHECK,\n // <InputNumber>\n MdOutlineAdd as ADD,\n MdOutlineRemove as REMOVE,\n // <InputSelect>\n MdOutlineExpandLess as EXPAND_LESS,\n MdOutlineExpandMore as EXPAND_MORE,\n // <InputText>\n MdOutlineSearch as SEARCH,\n MdOutlineVisibility as EYE_OPEN,\n MdOutlineVisibilityOff as EYE_CLOSE,\n // <Modal>\n MdOutlineClose as CLOSE,\n // <Notification> & <InputText>\n MdErrorOutline as ERROR,\n MdOutlineInfo as INFO,\n MdOutlineCheckCircle as SUCCESS,\n MdOutlineWarningAmber as WARNING,\n} from 'react-icons/md';\n\nexport const ICON = {\n // <Calendar>\n LEFT,\n RIGHT,\n UP,\n DOWN,\n // <Check>\n CHECK,\n // <InputOption>\n ADD,\n REMOVE,\n // <InputSelect>\n EXPAND_LESS,\n EXPAND_MORE,\n // <InputText>\n SEARCH,\n EYE_OPEN,\n EYE_CLOSE,\n // <Modal>\n CLOSE,\n // <Notification> & <InputText>\n ERROR,\n INFO,\n SUCCESS,\n WARNING,\n};\n"],"mappings":";;;;;;AAAA;
|
|
1
|
+
{"version":3,"file":"Icon.constants.js","names":["ICON","LEFT","RIGHT","UP","DOWN","CHECK","ADD","REMOVE","EXPAND_LESS","EXPAND_MORE","SEARCH","EYE_OPEN","EYE_CLOSE","CLOSE","ERROR","INFO","SUCCESS","WARNING","FILTER"],"sources":["../../../src/primitives/Icon/Icon.constants.js"],"sourcesContent":["import {\n // <Calendar>\n MdOutlineArrowBack as LEFT,\n MdOutlineArrowForward as RIGHT,\n MdOutlineArrowUpward as UP,\n MdOutlineArrowDownward as DOWN,\n // <InputOption>\n MdOutlineCheck as CHECK,\n // <InputNumber>\n MdOutlineAdd as ADD,\n MdOutlineRemove as REMOVE,\n // <InputSelect>\n MdOutlineExpandLess as EXPAND_LESS,\n MdOutlineExpandMore as EXPAND_MORE,\n // <InputText>\n MdOutlineSearch as SEARCH,\n MdOutlineVisibility as EYE_OPEN,\n MdOutlineVisibilityOff as EYE_CLOSE,\n // <Modal>\n MdOutlineClose as CLOSE,\n // <Notification> & <InputText>\n MdErrorOutline as ERROR,\n MdOutlineInfo as INFO,\n MdOutlineCheckCircle as SUCCESS,\n MdOutlineWarningAmber as WARNING,\n // <Table>\n MdOutlineFilterAlt as FILTER,\n} from 'react-icons/md';\n\nexport const ICON = {\n // <Calendar>\n LEFT,\n RIGHT,\n UP,\n DOWN,\n // <Check>\n CHECK,\n // <InputOption>\n ADD,\n REMOVE,\n // <InputSelect>\n EXPAND_LESS,\n EXPAND_MORE,\n // <InputText>\n SEARCH,\n EYE_OPEN,\n EYE_CLOSE,\n // <Modal>\n CLOSE,\n // <Notification> & <InputText>\n ERROR,\n INFO,\n SUCCESS,\n WARNING,\n // <Table>\n FILTER,\n};\n"],"mappings":";;;;;;AAAA;AA6BO,IAAMA,IAAI,GAAG;EAClB;EACAC,IAAI,EAAJA,sBAAI;EACJC,KAAK,EAALA,yBAAK;EACLC,EAAE,EAAFA,wBAAE;EACFC,IAAI,EAAJA,0BAAI;EACJ;EACAC,KAAK,EAALA,kBAAK;EACL;EACAC,GAAG,EAAHA,gBAAG;EACHC,MAAM,EAANA,mBAAM;EACN;EACAC,WAAW,EAAXA,uBAAW;EACXC,WAAW,EAAXA,uBAAW;EACX;EACAC,MAAM,EAANA,mBAAM;EACNC,QAAQ,EAARA,uBAAQ;EACRC,SAAS,EAATA,0BAAS;EACT;EACAC,KAAK,EAALA,kBAAK;EACL;EACAC,KAAK,EAALA,kBAAK;EACLC,IAAI,EAAJA,iBAAI;EACJC,OAAO,EAAPA,wBAAO;EACPC,OAAO,EAAPA,yBAAO;EACP;EACAC,MAAM,EAANA;AACF,CAAC;AAAC"}
|
|
@@ -469,6 +469,36 @@ exports[`primitive:<Icon> prop:value prop:value (EYE_OPEN) 1`] = `
|
|
|
469
469
|
</DocumentFragment>
|
|
470
470
|
`;
|
|
471
471
|
|
|
472
|
+
exports[`primitive:<Icon> prop:value prop:value (FILTER) 1`] = `
|
|
473
|
+
<DocumentFragment>
|
|
474
|
+
<span
|
|
475
|
+
class="icon headline-3"
|
|
476
|
+
>
|
|
477
|
+
<svg
|
|
478
|
+
fill="currentColor"
|
|
479
|
+
height="1em"
|
|
480
|
+
stroke="currentColor"
|
|
481
|
+
stroke-width="0"
|
|
482
|
+
viewBox="0 0 24 24"
|
|
483
|
+
width="1em"
|
|
484
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
485
|
+
>
|
|
486
|
+
<path
|
|
487
|
+
d="M0 0h24m0 24H0"
|
|
488
|
+
fill="none"
|
|
489
|
+
/>
|
|
490
|
+
<path
|
|
491
|
+
d="M7 6h10l-5.01 6.3L7 6zm-2.75-.39C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39A.998.998 0 0018.95 4H5.04c-.83 0-1.3.95-.79 1.61z"
|
|
492
|
+
/>
|
|
493
|
+
<path
|
|
494
|
+
d="M0 0h24v24H0V0z"
|
|
495
|
+
fill="none"
|
|
496
|
+
/>
|
|
497
|
+
</svg>
|
|
498
|
+
</span>
|
|
499
|
+
</DocumentFragment>
|
|
500
|
+
`;
|
|
501
|
+
|
|
472
502
|
exports[`primitive:<Icon> prop:value prop:value (INFO) 1`] = `
|
|
473
503
|
<DocumentFragment>
|
|
474
504
|
<span
|
|
@@ -50,6 +50,21 @@ var Layer = function Layer(_ref) {
|
|
|
50
50
|
position = _useState2[0],
|
|
51
51
|
setPosition = _useState2[1];
|
|
52
52
|
(0, _react.useLayoutEffect)(function () {
|
|
53
|
+
var content = contentRef === null || contentRef === void 0 ? void 0 : contentRef.current;
|
|
54
|
+
if (!content || typeof ResizeObserver === 'undefined') return;
|
|
55
|
+
var observer = new ResizeObserver(calcPosition);
|
|
56
|
+
observer.observe(content);
|
|
57
|
+
return function () {
|
|
58
|
+
return observer.unobserve(content);
|
|
59
|
+
};
|
|
60
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
|
+
}, []);
|
|
62
|
+
(0, _react.useLayoutEffect)(function () {
|
|
63
|
+
return calcPosition();
|
|
64
|
+
},
|
|
65
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
|
+
[centered, device, forceBottom, forceLeft, forceRight, forceTop, timestamp, visible]);
|
|
67
|
+
var calcPosition = function calcPosition() {
|
|
53
68
|
var _getScrollParent;
|
|
54
69
|
var _componentRef$current = componentRef.current;
|
|
55
70
|
_componentRef$current = _componentRef$current === void 0 ? {} : _componentRef$current;
|
|
@@ -78,11 +93,13 @@ var Layer = function Layer(_ref) {
|
|
|
78
93
|
top: "".concat(top, "px")
|
|
79
94
|
});
|
|
80
95
|
onPosition(orientation);
|
|
81
|
-
|
|
82
|
-
}, [centered, device, forceBottom, forceLeft, forceRight, forceTop, timestamp, visible]);
|
|
96
|
+
};
|
|
83
97
|
var children = _react.default.Children.map(others.children || [], function (child) {
|
|
84
98
|
return child;
|
|
85
99
|
});
|
|
100
|
+
var className = others.className,
|
|
101
|
+
contentStyle = others.style;
|
|
102
|
+
var createWrapper = className || contentStyle;
|
|
86
103
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
87
104
|
"data-testid": others['data-testid'],
|
|
88
105
|
ref: componentRef
|
|
@@ -91,12 +108,15 @@ var Layer = function Layer(_ref) {
|
|
|
91
108
|
return name !== _LayerContent.LayerContent.name;
|
|
92
109
|
})), (forceRender || visible) && /*#__PURE__*/_react.default.createElement("div", {
|
|
93
110
|
ref: contentRef,
|
|
94
|
-
className: (0, _helpers.styles)(_LayerModule.default.layer, !visible && _LayerModule.default.hidden
|
|
95
|
-
style: _objectSpread(
|
|
96
|
-
},
|
|
111
|
+
className: (0, _helpers.styles)(_LayerModule.default.layer, !visible && _LayerModule.default.hidden),
|
|
112
|
+
style: _objectSpread({}, position)
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement(createWrapper ? 'div' : _react.default.Fragment, createWrapper ? {
|
|
114
|
+
className: className,
|
|
115
|
+
style: contentStyle
|
|
116
|
+
} : undefined, children === null || children === void 0 ? void 0 : children.find(function (_ref3) {
|
|
97
117
|
var name = _ref3.type.name;
|
|
98
118
|
return name === _LayerContent.LayerContent.name;
|
|
99
|
-
})));
|
|
119
|
+
}))));
|
|
100
120
|
};
|
|
101
121
|
exports.Layer = Layer;
|
|
102
122
|
Layer.propTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layer.js","names":["Layer","forceBottom","bottom","centered","forceRender","forceLeft","left","forceRight","right","forceTop","top","timestamp","visible","onPosition","others","device","useDevice","componentRef","useRef","contentRef","useState","position","setPosition","useLayoutEffect","current","componentEl","firstChild","contentEl","componentLayout","getElementLayout","scrollTop","getScrollParent","contentLayout","getLayerPosition","orientation","children","React","Children","map","child","find","name","type","LayerContent","styles","
|
|
1
|
+
{"version":3,"file":"Layer.js","names":["Layer","forceBottom","bottom","centered","forceRender","forceLeft","left","forceRight","right","forceTop","top","timestamp","visible","onPosition","others","device","useDevice","componentRef","useRef","contentRef","useState","position","setPosition","useLayoutEffect","content","current","ResizeObserver","observer","calcPosition","observe","unobserve","componentEl","firstChild","contentEl","componentLayout","getElementLayout","scrollTop","getScrollParent","contentLayout","getLayerPosition","orientation","children","React","Children","map","child","className","contentStyle","style","createWrapper","find","name","type","LayerContent","styles","layer","hidden","createElement","Fragment","undefined","propTypes","PropTypes","bool","node","number","func"],"sources":["../../../src/primitives/Layer/Layer.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { getElementLayout, getLayerPosition, getScrollParent } from './helpers';\nimport style from './Layer.module.css';\nimport { LayerContent } from './LayerContent';\n\nconst Layer = ({\n bottom: forceBottom,\n centered,\n forceRender = true,\n left: forceLeft,\n right: forceRight,\n top: forceTop,\n timestamp,\n visible,\n onPosition = () => {},\n ...others\n}) => {\n const device = useDevice();\n const componentRef = useRef();\n const contentRef = useRef();\n\n const [position, setPosition] = useState();\n\n useLayoutEffect(() => {\n const content = contentRef?.current;\n if (!content || typeof ResizeObserver === 'undefined') return;\n\n const observer = new ResizeObserver(calcPosition);\n observer.observe(content);\n\n return () => observer.unobserve(content);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useLayoutEffect(\n () => calcPosition(),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [centered, device, forceBottom, forceLeft, forceRight, forceTop, timestamp, visible],\n );\n\n const calcPosition = () => {\n const { current: { firstChild: componentEl } = {} } = componentRef;\n const { current: contentEl } = contentRef;\n\n if (!componentEl || !contentEl) return setPosition();\n\n const componentLayout = { ...getElementLayout(componentEl), scrollTop: getScrollParent(componentEl)?.scrollTop };\n const contentLayout = getElementLayout(contentEl);\n\n const {\n left = 0,\n top = 0,\n orientation = {},\n } = getLayerPosition(componentLayout, contentLayout, device, {\n centered,\n forceBottom,\n forceLeft,\n forceRight,\n forceTop,\n });\n\n setPosition({ left: `${left}px`, top: `${top}px` });\n onPosition(orientation);\n };\n\n const children = React.Children.map(others.children || [], (child) => child);\n const { className, style: contentStyle } = others;\n const createWrapper = className || contentStyle;\n\n return (\n <>\n <span data-testid={others['data-testid']} ref={componentRef}>\n {children.find(({ type: { name } }) => name !== LayerContent.name)}\n </span>\n\n {(forceRender || visible) && (\n <div ref={contentRef} className={styles(style.layer, !visible && style.hidden)} style={{ ...position }}>\n {React.createElement(\n createWrapper ? 'div' : React.Fragment,\n createWrapper ? { className, style: contentStyle } : undefined,\n children?.find(({ type: { name } }) => name === LayerContent.name),\n )}\n </div>\n )}\n </>\n );\n};\n\nLayer.propTypes = {\n bottom: PropTypes.bool,\n centered: PropTypes.bool,\n children: PropTypes.node,\n forceRender: PropTypes.bool,\n left: PropTypes.bool,\n right: PropTypes.bool,\n timestamp: PropTypes.number,\n top: PropTypes.bool,\n visible: PropTypes.bool,\n onPosition: PropTypes.func,\n};\n\nexport { Layer };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAE9C,IAAMA,KAAK,GAAG,SAARA,KAAK,OAWL;EAAA,IAVIC,WAAW,QAAnBC,MAAM;IACNC,QAAQ,QAARA,QAAQ;IAAA,wBACRC,WAAW;IAAXA,WAAW,iCAAG,IAAI;IACZC,SAAS,QAAfC,IAAI;IACGC,UAAU,QAAjBC,KAAK;IACAC,QAAQ,QAAbC,GAAG;IACHC,SAAS,QAATA,SAAS;IACTC,OAAO,QAAPA,OAAO;IAAA,uBACPC,UAAU;IAAVA,UAAU,gCAAG,YAAM,CAAC,CAAC;IAClBC,MAAM;EAET,IAAMC,MAAM,GAAG,IAAAC,gBAAS,GAAE;EAC1B,IAAMC,YAAY,GAAG,IAAAC,aAAM,GAAE;EAC7B,IAAMC,UAAU,GAAG,IAAAD,aAAM,GAAE;EAE3B,gBAAgC,IAAAE,eAAQ,GAAE;IAAA;IAAnCC,QAAQ;IAAEC,WAAW;EAE5B,IAAAC,sBAAe,EAAC,YAAM;IACpB,IAAMC,OAAO,GAAGL,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEM,OAAO;IACnC,IAAI,CAACD,OAAO,IAAI,OAAOE,cAAc,KAAK,WAAW,E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AC;AAAC;AAEFnD,KAAK,CAAC4D,SAAS,GAAG;EAChB1D,MAAM,EAAE2D,kBAAS,CAACC,IAAI;EACtB3D,QAAQ,EAAE0D,kBAAS,CAACC,IAAI;EACxBrB,QAAQ,EAAEoB,kBAAS,CAACE,IAAI;EACxB3D,WAAW,EAAEyD,kBAAS,CAACC,IAAI;EAC3BxD,IAAI,EAAEuD,kBAAS,CAACC,IAAI;EACpBtD,KAAK,EAAEqD,kBAAS,CAACC,IAAI;EACrBnD,SAAS,EAAEkD,kBAAS,CAACG,MAAM;EAC3BtD,GAAG,EAAEmD,kBAAS,CAACC,IAAI;EACnBlD,OAAO,EAAEiD,kBAAS,CAACC,IAAI;EACvBjD,UAAU,EAAEgD,kBAAS,CAACI;AACxB,CAAC"}
|
|
@@ -10,11 +10,14 @@ var getElementLayout = function getElementLayout() {
|
|
|
10
10
|
top = element.offsetTop,
|
|
11
11
|
height = element.offsetHeight,
|
|
12
12
|
width = element.offsetWidth;
|
|
13
|
+
var _ref = element.getBoundingClientRect && element.getBoundingClientRect() || {},
|
|
14
|
+
screenTop = _ref.top;
|
|
13
15
|
return {
|
|
14
16
|
left: left,
|
|
15
17
|
top: top,
|
|
16
18
|
height: height,
|
|
17
|
-
width: width
|
|
19
|
+
width: width,
|
|
20
|
+
screenTop: screenTop
|
|
18
21
|
};
|
|
19
22
|
};
|
|
20
23
|
exports.getElementLayout = getElementLayout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElementLayout.js","names":["getElementLayout","element","left","offsetLeft","top","offsetTop","height","offsetHeight","width","offsetWidth"],"sources":["../../../../src/primitives/Layer/helpers/getElementLayout.js"],"sourcesContent":["export const getElementLayout = (element = {}) => {\n const { offsetLeft: left, offsetTop: top, offsetHeight: height, offsetWidth: width } = element;\n\n return { left, top, height, width };\n};\n"],"mappings":";;;;;;AAAO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgB,GAAqB;EAAA,IAAjBC,OAAO,uEAAG,CAAC,CAAC;EAC3C,IAAoBC,IAAI,GAA+DD,OAAO,CAAtFE,UAAU;IAAmBC,GAAG,GAA+CH,OAAO,CAApEI,SAAS;IAAqBC,MAAM,GAAyBL,OAAO,CAApDM,YAAY;IAAuBC,KAAK,GAAKP,OAAO,CAA9BQ,WAAW;
|
|
1
|
+
{"version":3,"file":"getElementLayout.js","names":["getElementLayout","element","left","offsetLeft","top","offsetTop","height","offsetHeight","width","offsetWidth","getBoundingClientRect","screenTop"],"sources":["../../../../src/primitives/Layer/helpers/getElementLayout.js"],"sourcesContent":["export const getElementLayout = (element = {}) => {\n const { offsetLeft: left, offsetTop: top, offsetHeight: height, offsetWidth: width } = element;\n const { top: screenTop } = (element.getBoundingClientRect && element.getBoundingClientRect()) || {};\n\n return { left, top, height, width, screenTop };\n};\n"],"mappings":";;;;;;AAAO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgB,GAAqB;EAAA,IAAjBC,OAAO,uEAAG,CAAC,CAAC;EAC3C,IAAoBC,IAAI,GAA+DD,OAAO,CAAtFE,UAAU;IAAmBC,GAAG,GAA+CH,OAAO,CAApEI,SAAS;IAAqBC,MAAM,GAAyBL,OAAO,CAApDM,YAAY;IAAuBC,KAAK,GAAKP,OAAO,CAA9BQ,WAAW;EAC3E,WAA4BR,OAAO,CAACS,qBAAqB,IAAIT,OAAO,CAACS,qBAAqB,EAAE,IAAK,CAAC,CAAC;IAAtFC,SAAS,QAAdP,GAAG;EAEX,OAAO;IAAEF,IAAI,EAAJA,IAAI;IAAEE,GAAG,EAAHA,GAAG;IAAEE,MAAM,EAANA,MAAM;IAAEE,KAAK,EAALA,KAAK;IAAEG,SAAS,EAATA;EAAU,CAAC;AAChD,CAAC;AAAC"}
|
|
@@ -29,7 +29,9 @@ var getLayerPosition = function getLayerPosition() {
|
|
|
29
29
|
_componentLayout$widt = componentLayout.width,
|
|
30
30
|
componentWidth = _componentLayout$widt === void 0 ? 0 : _componentLayout$widt,
|
|
31
31
|
_componentLayout$heig = componentLayout.height,
|
|
32
|
-
componentHeight = _componentLayout$heig === void 0 ? 0 : _componentLayout$heig
|
|
32
|
+
componentHeight = _componentLayout$heig === void 0 ? 0 : _componentLayout$heig,
|
|
33
|
+
_componentLayout$scre = componentLayout.screenTop,
|
|
34
|
+
screenTop = _componentLayout$scre === void 0 ? componentTop || 0 : _componentLayout$scre;
|
|
33
35
|
var _contentLayout$width = contentLayout.width,
|
|
34
36
|
contentWidth = _contentLayout$width === void 0 ? 0 : _contentLayout$width,
|
|
35
37
|
_contentLayout$height = contentLayout.height,
|
|
@@ -43,9 +45,8 @@ var getLayerPosition = function getLayerPosition() {
|
|
|
43
45
|
left: true
|
|
44
46
|
};
|
|
45
47
|
var top = componentTop + componentHeight - scrollTop;
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
if (contentHeight > gapBottom && gapTop > gapBottom && !forceBottom || forceTop) {
|
|
48
|
+
var gapBottom = height - (screenTop + componentHeight);
|
|
49
|
+
if (contentHeight > gapBottom && screenTop > gapBottom && !forceBottom || forceTop) {
|
|
49
50
|
top = componentTop - contentHeight - scrollTop;
|
|
50
51
|
orientation = _objectSpread(_objectSpread({}, orientation), {}, {
|
|
51
52
|
top: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLayerPosition.js","names":["getLayerPosition","componentLayout","contentLayout","device","centered","forceBottom","forceLeft","forceRight","forceTop","left","componentLeft","scrollTop","top","componentTop","width","componentWidth","height","componentHeight","contentWidth","contentHeight","aline","orientation","
|
|
1
|
+
{"version":3,"file":"getLayerPosition.js","names":["getLayerPosition","componentLayout","contentLayout","device","centered","forceBottom","forceLeft","forceRight","forceTop","left","componentLeft","scrollTop","top","componentTop","width","componentWidth","height","componentHeight","screenTop","contentWidth","contentHeight","aline","orientation","gapBottom","gapLeft","gapRight","undefined","right","gapCenter","space","center"],"sources":["../../../../src/primitives/Layer/helpers/getLayerPosition.js"],"sourcesContent":["export const getLayerPosition = (\n componentLayout = {},\n contentLayout = {},\n device = {},\n { centered, forceBottom, forceLeft, forceRight, forceTop } = {},\n) => {\n const {\n left: componentLeft = 0,\n scrollTop = 0,\n top: componentTop = 0,\n width: componentWidth = 0,\n height: componentHeight = 0,\n screenTop = componentTop || 0,\n } = componentLayout;\n const { width: contentWidth = 0, height: contentHeight = 0 } = contentLayout;\n const { height = 0, width = 0 } = device;\n const aline = centered && (forceLeft || forceRight);\n let orientation = { left: true };\n\n let top = componentTop + componentHeight - scrollTop;\n const gapBottom = height - (screenTop + componentHeight);\n if ((contentHeight > gapBottom && screenTop > gapBottom && !forceBottom) || forceTop) {\n top = componentTop - contentHeight - scrollTop;\n orientation = { ...orientation, top: true };\n }\n\n let left = componentLeft;\n const gapLeft = componentLeft + componentWidth;\n const gapRight = width - componentLeft;\n if ((contentWidth > gapRight && gapLeft > gapRight && !forceLeft) || forceRight) {\n left = componentLeft - contentWidth + componentWidth;\n orientation = { ...orientation, left: undefined, right: true };\n }\n\n if (aline) {\n orientation = { ...orientation, left: forceLeft, right: forceRight, top: undefined };\n if (forceLeft && contentWidth > gapLeft && gapRight > gapLeft)\n orientation = { ...orientation, left: undefined, right: true };\n else if (forceRight && contentWidth > gapRight && gapLeft > gapRight)\n orientation = { ...orientation, left: true, right: undefined };\n\n left = orientation.left ? componentLeft - contentWidth : componentLeft + componentWidth;\n top = componentTop - (contentHeight - componentHeight) / 2 - scrollTop;\n } else if (centered) {\n const gapCenter = (componentWidth + contentWidth) / 2;\n const space = (contentWidth - componentWidth) / 2;\n orientation = { ...orientation, left: true, right: undefined };\n\n if (gapLeft > gapRight) {\n left = componentLeft - contentWidth + componentWidth;\n orientation = { ...orientation, left: undefined, right: true };\n }\n if (gapLeft > gapCenter && gapRight > gapCenter) {\n left += space * (gapLeft > gapRight ? 1 : -1);\n orientation = { ...orientation, left: undefined, right: undefined, center: true };\n }\n }\n\n return { left, top, orientation };\n};\n"],"mappings":";;;;;;;;;;;;AAAO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgB,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S,GAAG,CAACb,cAAc,GAAGI,YAAY,IAAI,CAAC;IACrD,IAAMU,KAAK,GAAG,CAACV,YAAY,GAAGJ,cAAc,IAAI,CAAC;IACjDO,WAAW,mCAAQA,WAAW;MAAEb,IAAI,EAAE,IAAI;MAAEkB,KAAK,EAAED;IAAS,EAAE;IAE9D,IAAIF,OAAO,GAAGC,QAAQ,EAAE;MACtBhB,IAAI,GAAGC,aAAa,GAAGS,YAAY,GAAGJ,cAAc;MACpDO,WAAW,mCAAQA,WAAW;QAAEb,IAAI,EAAEiB,SAAS;QAAEC,KAAK,EAAE;MAAI,EAAE;IAChE;IACA,IAAIH,OAAO,GAAGI,SAAS,IAAIH,QAAQ,GAAGG,SAAS,EAAE;MAC/CnB,IAAI,IAAIoB,KAAK,IAAIL,OAAO,GAAGC,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;MAC7CH,WAAW,mCAAQA,WAAW;QAAEb,IAAI,EAAEiB,SAAS;QAAEC,KAAK,EAAED,SAAS;QAAEI,MAAM,EAAE;MAAI,EAAE;IACnF;EACF;EAEA,OAAO;IAAErB,IAAI,EAAJA,IAAI;IAAEG,GAAG,EAAHA,GAAG;IAAEU,WAAW,EAAXA;EAAY,CAAC;AACnC,CAAC;AAAC"}
|
|
@@ -248,6 +248,7 @@
|
|
|
248
248
|
--mirai-ui-table-border-color: var(--mirai-ui-content-border);
|
|
249
249
|
--mirai-ui-table-border-radius: var(--mirai-ui-space-XS);
|
|
250
250
|
--mirai-ui-table-color: var(--mirai-ui-content);
|
|
251
|
+
--mirai-ui-table-color-disabled: var(--mirai-ui-content-border);
|
|
251
252
|
--mirai-ui-table-padding-x: var(--mirai-ui-space-M);
|
|
252
253
|
--mirai-ui-table-padding-y: var(--mirai-ui-space-M);
|
|
253
254
|
--mirai-ui-table-selected-background: var(--mirai-ui-accent-background);
|