@elliemae/ds-mobile 3.60.0-next.10 → 3.60.0-next.12
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/cjs/GlobalHeader/MobileGlobalHeader.js +4 -4
- package/dist/cjs/GlobalHeader/MobileGlobalHeader.js.map +2 -2
- package/dist/cjs/MobileActionToolbar/MobileActionToolbarItem.js +2 -2
- package/dist/cjs/MobileActionToolbar/MobileActionToolbarItem.js.map +2 -2
- package/dist/cjs/MobileCard/ActionAddon.js +2 -2
- package/dist/cjs/MobileCard/ActionAddon.js.map +2 -2
- package/dist/cjs/MobileContextMenu/MobileContextMenuItem.js +2 -2
- package/dist/cjs/MobileContextMenu/MobileContextMenuItem.js.map +2 -2
- package/dist/cjs/MobileDatePicker/MobileDatePicker.js +4 -4
- package/dist/cjs/MobileDatePicker/MobileDatePicker.js.map +2 -2
- package/dist/cjs/MobileFooter/Footer.js +2 -2
- package/dist/cjs/MobileFooter/Footer.js.map +2 -2
- package/dist/cjs/MobilePageHeader/MobilePageHeader.js +2 -2
- package/dist/cjs/MobilePageHeader/MobilePageHeader.js.map +2 -2
- package/dist/cjs/MobileSelectList/MobileSelectList.js +2 -2
- package/dist/cjs/MobileSelectList/MobileSelectList.js.map +2 -2
- package/dist/cjs/MobileSelectList/styled.js +3 -3
- package/dist/cjs/MobileSelectList/styled.js.map +2 -2
- package/dist/cjs/MobileTimePicker/MobileTimePicker.js +4 -4
- package/dist/cjs/MobileTimePicker/MobileTimePicker.js.map +2 -2
- package/dist/cjs/Modal/Modal.js +3 -3
- package/dist/cjs/Modal/Modal.js.map +2 -2
- package/dist/esm/GlobalHeader/MobileGlobalHeader.js +2 -2
- package/dist/esm/GlobalHeader/MobileGlobalHeader.js.map +1 -1
- package/dist/esm/MobileActionToolbar/MobileActionToolbarItem.js +1 -1
- package/dist/esm/MobileActionToolbar/MobileActionToolbarItem.js.map +1 -1
- package/dist/esm/MobileCard/ActionAddon.js +1 -1
- package/dist/esm/MobileCard/ActionAddon.js.map +1 -1
- package/dist/esm/MobileContextMenu/MobileContextMenuItem.js +1 -1
- package/dist/esm/MobileContextMenu/MobileContextMenuItem.js.map +1 -1
- package/dist/esm/MobileDatePicker/MobileDatePicker.js +2 -2
- package/dist/esm/MobileDatePicker/MobileDatePicker.js.map +1 -1
- package/dist/esm/MobileFooter/Footer.js +1 -1
- package/dist/esm/MobileFooter/Footer.js.map +1 -1
- package/dist/esm/MobilePageHeader/MobilePageHeader.js +1 -1
- package/dist/esm/MobilePageHeader/MobilePageHeader.js.map +1 -1
- package/dist/esm/MobileSelectList/MobileSelectList.js +1 -1
- package/dist/esm/MobileSelectList/MobileSelectList.js.map +1 -1
- package/dist/esm/MobileSelectList/styled.js +1 -1
- package/dist/esm/MobileSelectList/styled.js.map +1 -1
- package/dist/esm/MobileTimePicker/MobileTimePicker.js +2 -2
- package/dist/esm/MobileTimePicker/MobileTimePicker.js.map +1 -1
- package/dist/esm/Modal/Modal.js +1 -1
- package/dist/esm/Modal/Modal.js.map +1 -1
- package/package.json +42 -44
|
@@ -36,9 +36,9 @@ var React = __toESM(require("react"));
|
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
var import_react = require("react");
|
|
38
38
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
39
|
-
var
|
|
39
|
+
var import_ds_legacy_form = require("@elliemae/ds-legacy-form");
|
|
40
40
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
41
|
-
var
|
|
41
|
+
var import_ds_legacy_button_v1 = require("@elliemae/ds-legacy-button-v1");
|
|
42
42
|
var import_ds_icon = require("@elliemae/ds-icon");
|
|
43
43
|
var import_lodash_es = require("lodash-es");
|
|
44
44
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
@@ -89,14 +89,14 @@ const DSGlobalHeader = ({
|
|
|
89
89
|
lastIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_grid.Grid, { children: lastIcon })
|
|
90
90
|
] }) })
|
|
91
91
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.SearchWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
|
-
|
|
92
|
+
import_ds_legacy_form.DSInput,
|
|
93
93
|
{
|
|
94
94
|
clearable: true,
|
|
95
95
|
className: "dsInput",
|
|
96
96
|
placeholder: "Search here",
|
|
97
97
|
onChange: searchValueChanged,
|
|
98
98
|
rightComponent: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
99
|
-
|
|
99
|
+
import_ds_legacy_button_v1.DSButton,
|
|
100
100
|
{
|
|
101
101
|
buttonType: "primary",
|
|
102
102
|
className: "dsButton",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/GlobalHeader/MobileGlobalHeader.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/jsx-no-bind */\n/* eslint-disable import/no-unresolved */\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-unsafe-argument, max-params */\n/* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */\n/* eslint-disable complexity, @typescript-eslint/no-unsafe-call */\n/* eslint-disable no-unused-vars, @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-assignment */\n/* tslint:disable */\n// @ts-nocheck\n// What's with all the above disables?\n// this is what a legacy 7 year old codebase looks like.\n\nimport React, { useState, useCallback } from 'react';\nimport { Search } from '@elliemae/ds-icons';\nimport { DSInput } from '@elliemae/ds-form';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { DSButton } from '@elliemae/ds-button';\nimport { DSIconSizes, DSIconColors } from '@elliemae/ds-icon';\nimport { debounce, noop } from 'lodash-es';\nimport { Grid } from '@elliemae/ds-grid';\nimport { SvgIcon as Logo } from '../Icons/EM_logo.js';\nimport { Container, Label, SearchWrapper, Icon, RightSection, MainSection } from './styles.js';\nimport { DSSideNav } from '../SideNav/index.js';\n\nconst DSGlobalHeader = ({\n containerProps = {},\n title,\n lastIcon,\n onSearchChange = noop,\n topMenuItems,\n bottomMenuItems,\n}) => {\n const [searchBarVisible, setSearchBarVisible] = useState(false);\n const [searchValue, setSearchValue] = useState();\n const [showMenu, setShowMenu] = useState(false);\n const searchClicked = () => {\n setSearchBarVisible(true);\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const onSearchChangeDebounced = useCallback(debounce(onSearchChange, 250), []);\n const searchValueChanged = (e) => {\n const val = e.target.value;\n onSearchChangeDebounced(val);\n setSearchValue(val);\n };\n\n const searchCloseClicked = () => {\n setSearchBarVisible(false);\n };\n\n const menuToggle = (flag) => {\n setShowMenu(flag);\n };\n\n return (\n <>\n <Container data-testid={containerProps['data-testid'] || 'global-header-wrapper'} {...containerProps}>\n {!searchBarVisible ? (\n <MainSection>\n <Icon onClick={menuToggle.bind(null, true)}>{Logo()}</Icon>\n <Label>{title}</Label>\n <span></span>\n <RightSection>\n <Grid cols={lastIcon ? [1 / 2, 1 / 2] : [1]} gutter=\"xs\">\n <Grid>\n <Search\n data-testid=\"mobile-global-header-search\"\n size={DSIconSizes.M}\n color={DSIconColors.WHITE}\n onClick={searchClicked}\n />\n </Grid>\n {lastIcon && <Grid>{lastIcon}</Grid>}\n </Grid>\n </RightSection>\n </MainSection>\n ) : (\n <SearchWrapper>\n <DSInput\n clearable\n className=\"dsInput\"\n placeholder=\"Search here\"\n onChange={searchValueChanged}\n rightComponent={\n <DSButton\n buttonType=\"primary\"\n className=\"dsButton\"\n icon={<Search size={DSIconSizes.M} color={DSIconColors.WHITE} onClick={searchCloseClicked} />}\n />\n }\n value={searchValue}\n variant=\"variant-active\"\n />\n </SearchWrapper>\n )}\n </Container>\n {showMenu ? (\n <DSSideNav\n title={title}\n menuItems={topMenuItems}\n bottomMenuItems={bottomMenuItems}\n onClose={menuToggle.bind(null, false)}\n ></DSSideNav>\n ) : null}\n </>\n );\n};\n\nconst menuProps = PropTypes.arrayOf(\n PropTypes.shape({\n icon: PropTypes.element,\n text: PropTypes.string,\n }),\n).description('menu item array');\n\nconst props = {\n /** props to inject to wrapper */\n containerProps: PropTypes.object.description('props to inject to wrapper'),\n /**\n * Heading Title\n */\n title: PropTypes.string.isRequired.description('Heading Title'),\n /**\n * Dimsum icon Element\n */\n lastIcon: PropTypes.element.description('Dimsum icon Element'),\n /**\n * Callback function for search change\n */\n onSearchChange: PropTypes.func.description('Callback function for search change'),\n /**\n * Top Menu items array\n */\n topMenuItems: menuProps,\n /**\n * Bottom Menu items array\n */\n bottomMenuItems: menuProps,\n};\n\nDSGlobalHeader.displayName = 'DSGlobalHeader';\nconst DSGlobalHeaderWithSchema = describe(DSGlobalHeader);\nDSGlobalHeaderWithSchema.propTypes = props;\n\nexport { DSGlobalHeader, DSGlobalHeaderWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADyDnB;AA5CJ,mBAA6C;AAC7C,sBAAuB;AACvB,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/jsx-no-bind */\n/* eslint-disable import/no-unresolved */\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-unsafe-argument, max-params */\n/* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */\n/* eslint-disable complexity, @typescript-eslint/no-unsafe-call */\n/* eslint-disable no-unused-vars, @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-assignment */\n/* tslint:disable */\n// @ts-nocheck\n// What's with all the above disables?\n// this is what a legacy 7 year old codebase looks like.\n\nimport React, { useState, useCallback } from 'react';\nimport { Search } from '@elliemae/ds-icons';\nimport { DSInput } from '@elliemae/ds-legacy-form';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { DSButton } from '@elliemae/ds-legacy-button-v1';\nimport { DSIconSizes, DSIconColors } from '@elliemae/ds-icon';\nimport { debounce, noop } from 'lodash-es';\nimport { Grid } from '@elliemae/ds-grid';\nimport { SvgIcon as Logo } from '../Icons/EM_logo.js';\nimport { Container, Label, SearchWrapper, Icon, RightSection, MainSection } from './styles.js';\nimport { DSSideNav } from '../SideNav/index.js';\n\nconst DSGlobalHeader = ({\n containerProps = {},\n title,\n lastIcon,\n onSearchChange = noop,\n topMenuItems,\n bottomMenuItems,\n}) => {\n const [searchBarVisible, setSearchBarVisible] = useState(false);\n const [searchValue, setSearchValue] = useState();\n const [showMenu, setShowMenu] = useState(false);\n const searchClicked = () => {\n setSearchBarVisible(true);\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const onSearchChangeDebounced = useCallback(debounce(onSearchChange, 250), []);\n const searchValueChanged = (e) => {\n const val = e.target.value;\n onSearchChangeDebounced(val);\n setSearchValue(val);\n };\n\n const searchCloseClicked = () => {\n setSearchBarVisible(false);\n };\n\n const menuToggle = (flag) => {\n setShowMenu(flag);\n };\n\n return (\n <>\n <Container data-testid={containerProps['data-testid'] || 'global-header-wrapper'} {...containerProps}>\n {!searchBarVisible ? (\n <MainSection>\n <Icon onClick={menuToggle.bind(null, true)}>{Logo()}</Icon>\n <Label>{title}</Label>\n <span></span>\n <RightSection>\n <Grid cols={lastIcon ? [1 / 2, 1 / 2] : [1]} gutter=\"xs\">\n <Grid>\n <Search\n data-testid=\"mobile-global-header-search\"\n size={DSIconSizes.M}\n color={DSIconColors.WHITE}\n onClick={searchClicked}\n />\n </Grid>\n {lastIcon && <Grid>{lastIcon}</Grid>}\n </Grid>\n </RightSection>\n </MainSection>\n ) : (\n <SearchWrapper>\n <DSInput\n clearable\n className=\"dsInput\"\n placeholder=\"Search here\"\n onChange={searchValueChanged}\n rightComponent={\n <DSButton\n buttonType=\"primary\"\n className=\"dsButton\"\n icon={<Search size={DSIconSizes.M} color={DSIconColors.WHITE} onClick={searchCloseClicked} />}\n />\n }\n value={searchValue}\n variant=\"variant-active\"\n />\n </SearchWrapper>\n )}\n </Container>\n {showMenu ? (\n <DSSideNav\n title={title}\n menuItems={topMenuItems}\n bottomMenuItems={bottomMenuItems}\n onClose={menuToggle.bind(null, false)}\n ></DSSideNav>\n ) : null}\n </>\n );\n};\n\nconst menuProps = PropTypes.arrayOf(\n PropTypes.shape({\n icon: PropTypes.element,\n text: PropTypes.string,\n }),\n).description('menu item array');\n\nconst props = {\n /** props to inject to wrapper */\n containerProps: PropTypes.object.description('props to inject to wrapper'),\n /**\n * Heading Title\n */\n title: PropTypes.string.isRequired.description('Heading Title'),\n /**\n * Dimsum icon Element\n */\n lastIcon: PropTypes.element.description('Dimsum icon Element'),\n /**\n * Callback function for search change\n */\n onSearchChange: PropTypes.func.description('Callback function for search change'),\n /**\n * Top Menu items array\n */\n topMenuItems: menuProps,\n /**\n * Bottom Menu items array\n */\n bottomMenuItems: menuProps,\n};\n\nDSGlobalHeader.displayName = 'DSGlobalHeader';\nconst DSGlobalHeaderWithSchema = describe(DSGlobalHeader);\nDSGlobalHeaderWithSchema.propTypes = props;\n\nexport { DSGlobalHeader, DSGlobalHeaderWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADyDnB;AA5CJ,mBAA6C;AAC7C,sBAAuB;AACvB,4BAAwB;AACxB,8BAAoC;AACpC,iCAAyB;AACzB,qBAA0C;AAC1C,uBAA+B;AAC/B,qBAAqB;AACrB,qBAAgC;AAChC,oBAAiF;AACjF,qBAA0B;AAE1B,MAAM,iBAAiB,CAAC;AAAA,EACtB,iBAAiB,CAAC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,WAAU;AAAA,QACV,aAAY;AAAA,QACZ,UAAU;AAAA,QACV,gBACE;AAAA,UAAC;AAAA;AAAA,YACC,YAAW;AAAA,YACX,WAAU;AAAA,YACV,MAAM,4CAAC,0BAAO,MAAM,2BAAY,GAAG,OAAO,4BAAa,OAAO,SAAS,oBAAoB;AAAA;AAAA,QAC7F;AAAA,QAEF,OAAO;AAAA,QACP,SAAQ;AAAA;AAAA,IACV,GACF,GAEJ;AAAA,IACC,WACC;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,QACX;AAAA,QACA,SAAS,WAAW,KAAK,MAAM,KAAK;AAAA;AAAA,IACrC,IACC;AAAA,KACN;AAEJ;AAEA,MAAM,YAAY,kCAAU;AAAA,EAC1B,kCAAU,MAAM;AAAA,IACd,MAAM,kCAAU;AAAA,IAChB,MAAM,kCAAU;AAAA,EAClB,CAAC;AACH,EAAE,YAAY,iBAAiB;AAE/B,MAAM,QAAQ;AAAA;AAAA,EAEZ,gBAAgB,kCAAU,OAAO,YAAY,4BAA4B;AAAA;AAAA;AAAA;AAAA,EAIzE,OAAO,kCAAU,OAAO,WAAW,YAAY,eAAe;AAAA;AAAA;AAAA;AAAA,EAI9D,UAAU,kCAAU,QAAQ,YAAY,qBAAqB;AAAA;AAAA;AAAA;AAAA,EAI7D,gBAAgB,kCAAU,KAAK,YAAY,qCAAqC;AAAA;AAAA;AAAA;AAAA,EAIhF,cAAc;AAAA;AAAA;AAAA;AAAA,EAId,iBAAiB;AACnB;AAEA,eAAe,cAAc;AAC7B,MAAM,+BAA2B,kCAAS,cAAc;AACxD,yBAAyB,YAAY;",
|
|
6
6
|
"names": ["Logo"]
|
|
7
7
|
}
|
|
@@ -36,10 +36,10 @@ var React = __toESM(require("react"));
|
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
var import_react = __toESM(require("react"));
|
|
38
38
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
|
-
var
|
|
39
|
+
var import_ds_legacy_button_v1 = require("@elliemae/ds-legacy-button-v1");
|
|
40
40
|
const ToolbarItem = ({ icon, ...otherProps }) => {
|
|
41
41
|
const displayIcon = import_react.default.cloneElement(icon, { size: "m" });
|
|
42
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_button_v1.DSButton, { ...otherProps, buttonType: "text", icon: displayIcon, size: "m" });
|
|
43
43
|
};
|
|
44
44
|
ToolbarItem.displayName = "ToolbarItem";
|
|
45
45
|
const props = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/MobileActionToolbar/MobileActionToolbarItem.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { DSButton } from '@elliemae/ds-button';\n\nconst ToolbarItem = ({ icon, ...otherProps }) => {\n const displayIcon = React.cloneElement(icon, { size: 'm' });\n return <DSButton {...otherProps} buttonType=\"text\" icon={displayIcon} size=\"m\" />;\n};\n\nToolbarItem.displayName = 'ToolbarItem';\n\nconst props = {\n /** toolbar item icon */\n icon: PropTypes.element.description('Toolbar item icon'),\n};\n\nToolbarItem.displayName = 'ToolbarItem';\nconst DSToolbarItemWithSchema = describe(ToolbarItem);\n\nDSToolbarItemWithSchema.propTypes = props;\n\n// export default ToolbarItem;\n\nexport { DSToolbarItemWithSchema, ToolbarItem };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADMd;AANT,mBAAkB;AAClB,8BAAoC;AACpC,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { DSButton } from '@elliemae/ds-legacy-button-v1';\n\nconst ToolbarItem = ({ icon, ...otherProps }) => {\n const displayIcon = React.cloneElement(icon, { size: 'm' });\n return <DSButton {...otherProps} buttonType=\"text\" icon={displayIcon} size=\"m\" />;\n};\n\nToolbarItem.displayName = 'ToolbarItem';\n\nconst props = {\n /** toolbar item icon */\n icon: PropTypes.element.description('Toolbar item icon'),\n};\n\nToolbarItem.displayName = 'ToolbarItem';\nconst DSToolbarItemWithSchema = describe(ToolbarItem);\n\nDSToolbarItemWithSchema.propTypes = props;\n\n// export default ToolbarItem;\n\nexport { DSToolbarItemWithSchema, ToolbarItem };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADMd;AANT,mBAAkB;AAClB,8BAAoC;AACpC,iCAAyB;AAEzB,MAAM,cAAc,CAAC,EAAE,MAAM,GAAG,WAAW,MAAM;AAC/C,QAAM,cAAc,aAAAA,QAAM,aAAa,MAAM,EAAE,MAAM,IAAI,CAAC;AAC1D,SAAO,4CAAC,uCAAU,GAAG,YAAY,YAAW,QAAO,MAAM,aAAa,MAAK,KAAI;AACjF;AAEA,YAAY,cAAc;AAE1B,MAAM,QAAQ;AAAA;AAAA,EAEZ,MAAM,kCAAU,QAAQ,YAAY,mBAAmB;AACzD;AAEA,YAAY,cAAc;AAC1B,MAAM,8BAA0B,kCAAS,WAAW;AAEpD,wBAAwB,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -33,10 +33,10 @@ __export(ActionAddon_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(ActionAddon_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var
|
|
36
|
+
var import_ds_legacy_button_v1 = require("@elliemae/ds-legacy-button-v1");
|
|
37
37
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
38
38
|
var import_ds_system = require("@elliemae/ds-system");
|
|
39
|
-
const Addon = (0, import_ds_system.styled)(
|
|
39
|
+
const Addon = (0, import_ds_system.styled)(import_ds_legacy_button_v1.DSButton)`
|
|
40
40
|
background-color: transparent;
|
|
41
41
|
padding-right: 4px;
|
|
42
42
|
height: 100%;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/MobileCard/ActionAddon.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */\n/* tslint:disable */\n// @ts-nocheck\n// What's with all the above disables?\n// this is what a legacy 7 year old codebase looks like.\nimport { DSButton } from '@elliemae/ds-button';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { styled } from '@elliemae/ds-system';\n\nconst Addon = styled(DSButton)`\n background-color: transparent;\n padding-right: 4px;\n height: 100%;\n border: none;\n font-size: 12px;\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n color: ${(props) => props.theme.colors.brand['700']};\n cursor: pointer;\n &:focus,\n &::after {\n background-color: transparent;\n box-shadow: none !important; /* needed */\n border: none !important; /* needed */\n }\n`;\n\nexport const ActionAddon = ({ label, onClick, icon }) => (\n <Addon onClick={onClick} labelText={label} icon={icon || <ChevronSmallDown color={['brand-primary', 700]} />} />\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8BoC;AAtB3D,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */\n/* tslint:disable */\n// @ts-nocheck\n// What's with all the above disables?\n// this is what a legacy 7 year old codebase looks like.\nimport { DSButton } from '@elliemae/ds-legacy-button-v1';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { styled } from '@elliemae/ds-system';\n\nconst Addon = styled(DSButton)`\n background-color: transparent;\n padding-right: 4px;\n height: 100%;\n border: none;\n font-size: 12px;\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n color: ${(props) => props.theme.colors.brand['700']};\n cursor: pointer;\n &:focus,\n &::after {\n background-color: transparent;\n box-shadow: none !important; /* needed */\n border: none !important; /* needed */\n }\n`;\n\nexport const ActionAddon = ({ label, onClick, icon }) => (\n <Addon onClick={onClick} labelText={label} icon={icon || <ChevronSmallDown color={['brand-primary', 700]} />} />\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8BoC;AAtB3D,iCAAyB;AACzB,sBAAiC;AACjC,uBAAuB;AAEvB,MAAM,YAAQ,yBAAO,mCAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAMZ,CAAC,UAAU,MAAM,MAAM,YAAY,QAAQ;AAAA,WACjD,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU9C,MAAM,cAAc,CAAC,EAAE,OAAO,SAAS,KAAK,MACjD,4CAAC,SAAM,SAAkB,WAAW,OAAO,MAAM,QAAQ,4CAAC,oCAAiB,OAAO,CAAC,iBAAiB,GAAG,GAAG,GAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -38,7 +38,7 @@ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
|
38
38
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
39
39
|
var import_ds_system = require("@elliemae/ds-system");
|
|
40
40
|
var import_ds_shared = require("@elliemae/ds-shared");
|
|
41
|
-
var
|
|
41
|
+
var import_ds_legacy_form = require("@elliemae/ds-legacy-form");
|
|
42
42
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
43
43
|
var import_MobileTouchable = require("../MobileTouchable/index.js");
|
|
44
44
|
const Wrap = (0, import_ds_system.styled)((props2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_MobileTouchable.DSMobileTouchable, { ...props2 }))`
|
|
@@ -98,7 +98,7 @@ const DSMobileContextMenuItem = ({
|
|
|
98
98
|
let showLeftAddon = isSelected;
|
|
99
99
|
if (isMulti || !singleSelect) showLeftAddon = true;
|
|
100
100
|
let leftAddon = leftProp || null;
|
|
101
|
-
if (isMulti) leftAddon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
101
|
+
if (isMulti) leftAddon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_form.DSCheckbox, { checked: isSelected, "data-testid": "leftAddon-checkbox" });
|
|
102
102
|
if (singleSelect) leftAddon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckMark, { "data-testid": "leftAddon-checkmark" });
|
|
103
103
|
console.log("SSS", innerRef);
|
|
104
104
|
const cols = singleSelect && someItemSelected || leftAddon && !singleSelect || isMulti ? ["40px", "auto"] : ["auto"];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/MobileContextMenu/MobileContextMenuItem.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable import/no-unresolved */\nimport React from 'react';\nimport type { RefCallback } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled, truncate } from '@elliemae/ds-system';\nimport { GroupItem } from '@elliemae/ds-shared';\nimport { DSCheckbox } from '@elliemae/ds-form';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport { DSMobileTouchable } from '../MobileTouchable/index.js';\n\nconst Wrap = styled((props) => <DSMobileTouchable {...props} />)`\n border-bottom: none;\n`;\n\nconst PropWrap = styled((props) => <Grid {...props} />)`\n ${(props) => {\n if (!props.isMulti) {\n return `\n & > span {\n height: 18px;\n width: 18px;\n }\n\n & > span > svg {\n height: 18px;\n width: 18px;\n }\n `;\n }\n return '';\n }}\n`;\n\nconst Title = styled.span`\n font-size: 16px;\n color: ${(props) => props.theme.colors.brand['600']};\n ${truncate()}\n`;\n\nconst Label = styled.span`\n font-size: 13px;\n color: ${(props) => props.theme.colors.neutral['600']};\n`;\n\nconst CheckMark = styled(Checkmark)`\n fill: ${(props) => props.theme.colors.brand['600']};\n`;\ninterface DSMobileContextMenuItemPropsT {\n label: string;\n title: string;\n leftProp: JSX.Element;\n isGroup: boolean;\n isMulti: boolean;\n isSelected: boolean;\n singleSelect: boolean;\n onClick: (e: any) => void;\n value: string;\n innerRef: React.MutableRefObject<HTMLButtonElement | null> | RefCallback<HTMLButtonElement>;\n}\nconst DSMobileContextMenuItem = ({\n label,\n title,\n leftProp,\n rightAddon,\n isGroup,\n isMulti,\n singleSelect,\n isSelected,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onClick = () => {},\n value,\n innerRef,\n}: DSMobileContextMenuItemPropsT): JSX.Element => (\n <GroupItem\n render={(context) => {\n const { activeValue } = context;\n let someItemSelected = activeValue >= 0 && !Array.isArray(activeValue);\n if (isGroup) someItemSelected = typeof activeValue === 'string';\n\n let showLeftAddon = isSelected;\n if (isMulti || !singleSelect) showLeftAddon = true;\n\n let leftAddon = leftProp || null;\n if (isMulti) leftAddon = <DSCheckbox checked={isSelected} data-testid=\"leftAddon-checkbox\" />;\n if (singleSelect) leftAddon = <CheckMark data-testid=\"leftAddon-checkmark\" />;\n\n console.log('SSS', innerRef);\n const cols =\n (singleSelect && someItemSelected) || (leftAddon && !singleSelect) || isMulti ? ['40px', 'auto'] : ['auto'];\n if (rightAddon) cols.push('40px');\n return (\n <Wrap\n data-testid=\"ds-contextmenu-item\"\n onClick={(e) => {\n if (singleSelect || isMulti) context.onChange(value, e, { value, label, title });\n onClick(e);\n }}\n cols={cols}\n innerRef={innerRef}\n >\n {((singleSelect && someItemSelected) || isMulti || leftAddon) && (\n <PropWrap data-testid=\"left-addon\" isMulti={isMulti} alignItems=\"center\" justifyContent=\"center\" pl=\"16px\">\n {showLeftAddon && leftAddon}\n </PropWrap>\n )}\n <Grid height=\"44px\" pr=\"xs\" pl={!leftAddon && isGroup ? '24px' : 'xs'}>\n {label && (\n <Grid alignItems=\"center\">\n <Label data-testid=\"contextMenuItem-label\">{label}</Label>\n </Grid>\n )}\n <Grid alignItems={!label ? 'center' : undefined}>\n <Title data-testid=\"contextMenuItem-title\">{title}</Title>\n </Grid>\n </Grid>\n {rightAddon ? (\n <PropWrap data-testid=\"right-addon\" alignItems=\"center\" justifyContent=\"center\">\n {rightAddon}\n </PropWrap>\n ) : null}\n </Wrap>\n );\n }}\n />\n);\n\nconst props = {\n /** label */\n label: PropTypes.string.description('label'),\n /** menu item title */\n title: PropTypes.string.isRequired.description('menu item title'),\n /** */\n leftProp: PropTypes.element.description(''),\n /** multi select */\n isMulti: PropTypes.bool.description('multi select'),\n /** */\n singleSelect: PropTypes.bool.description(''),\n /** */\n isGroup: PropTypes.bool.description(''),\n /** on click handler */\n onClick: PropTypes.func.description('on click handler'),\n /** value for select */\n value: PropTypes.number.description('value for select'),\n /** selected value */\n isSelected: PropTypes.bool.description('selected value'),\n /** */\n innerRef: PropTypes.any.description('Ref for the item'),\n};\n\nDSMobileContextMenuItem.displayName = 'DSMobileContextMenuItem';\nconst DSMobileContextMenuItemWithSchema = describe(DSMobileContextMenuItem);\n\nDSMobileContextMenuItemWithSchema.propTypes = props;\n\nexport { DSMobileContextMenuItem, DSMobileContextMenuItemWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADaQ;AAR/B,8BAAoC;AACpC,qBAAqB;AACrB,uBAAiC;AACjC,uBAA0B;AAC1B,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable import/no-unresolved */\nimport React from 'react';\nimport type { RefCallback } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled, truncate } from '@elliemae/ds-system';\nimport { GroupItem } from '@elliemae/ds-shared';\nimport { DSCheckbox } from '@elliemae/ds-legacy-form';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport { DSMobileTouchable } from '../MobileTouchable/index.js';\n\nconst Wrap = styled((props) => <DSMobileTouchable {...props} />)`\n border-bottom: none;\n`;\n\nconst PropWrap = styled((props) => <Grid {...props} />)`\n ${(props) => {\n if (!props.isMulti) {\n return `\n & > span {\n height: 18px;\n width: 18px;\n }\n\n & > span > svg {\n height: 18px;\n width: 18px;\n }\n `;\n }\n return '';\n }}\n`;\n\nconst Title = styled.span`\n font-size: 16px;\n color: ${(props) => props.theme.colors.brand['600']};\n ${truncate()}\n`;\n\nconst Label = styled.span`\n font-size: 13px;\n color: ${(props) => props.theme.colors.neutral['600']};\n`;\n\nconst CheckMark = styled(Checkmark)`\n fill: ${(props) => props.theme.colors.brand['600']};\n`;\ninterface DSMobileContextMenuItemPropsT {\n label: string;\n title: string;\n leftProp: JSX.Element;\n isGroup: boolean;\n isMulti: boolean;\n isSelected: boolean;\n singleSelect: boolean;\n onClick: (e: any) => void;\n value: string;\n innerRef: React.MutableRefObject<HTMLButtonElement | null> | RefCallback<HTMLButtonElement>;\n}\nconst DSMobileContextMenuItem = ({\n label,\n title,\n leftProp,\n rightAddon,\n isGroup,\n isMulti,\n singleSelect,\n isSelected,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onClick = () => {},\n value,\n innerRef,\n}: DSMobileContextMenuItemPropsT): JSX.Element => (\n <GroupItem\n render={(context) => {\n const { activeValue } = context;\n let someItemSelected = activeValue >= 0 && !Array.isArray(activeValue);\n if (isGroup) someItemSelected = typeof activeValue === 'string';\n\n let showLeftAddon = isSelected;\n if (isMulti || !singleSelect) showLeftAddon = true;\n\n let leftAddon = leftProp || null;\n if (isMulti) leftAddon = <DSCheckbox checked={isSelected} data-testid=\"leftAddon-checkbox\" />;\n if (singleSelect) leftAddon = <CheckMark data-testid=\"leftAddon-checkmark\" />;\n\n console.log('SSS', innerRef);\n const cols =\n (singleSelect && someItemSelected) || (leftAddon && !singleSelect) || isMulti ? ['40px', 'auto'] : ['auto'];\n if (rightAddon) cols.push('40px');\n return (\n <Wrap\n data-testid=\"ds-contextmenu-item\"\n onClick={(e) => {\n if (singleSelect || isMulti) context.onChange(value, e, { value, label, title });\n onClick(e);\n }}\n cols={cols}\n innerRef={innerRef}\n >\n {((singleSelect && someItemSelected) || isMulti || leftAddon) && (\n <PropWrap data-testid=\"left-addon\" isMulti={isMulti} alignItems=\"center\" justifyContent=\"center\" pl=\"16px\">\n {showLeftAddon && leftAddon}\n </PropWrap>\n )}\n <Grid height=\"44px\" pr=\"xs\" pl={!leftAddon && isGroup ? '24px' : 'xs'}>\n {label && (\n <Grid alignItems=\"center\">\n <Label data-testid=\"contextMenuItem-label\">{label}</Label>\n </Grid>\n )}\n <Grid alignItems={!label ? 'center' : undefined}>\n <Title data-testid=\"contextMenuItem-title\">{title}</Title>\n </Grid>\n </Grid>\n {rightAddon ? (\n <PropWrap data-testid=\"right-addon\" alignItems=\"center\" justifyContent=\"center\">\n {rightAddon}\n </PropWrap>\n ) : null}\n </Wrap>\n );\n }}\n />\n);\n\nconst props = {\n /** label */\n label: PropTypes.string.description('label'),\n /** menu item title */\n title: PropTypes.string.isRequired.description('menu item title'),\n /** */\n leftProp: PropTypes.element.description(''),\n /** multi select */\n isMulti: PropTypes.bool.description('multi select'),\n /** */\n singleSelect: PropTypes.bool.description(''),\n /** */\n isGroup: PropTypes.bool.description(''),\n /** on click handler */\n onClick: PropTypes.func.description('on click handler'),\n /** value for select */\n value: PropTypes.number.description('value for select'),\n /** selected value */\n isSelected: PropTypes.bool.description('selected value'),\n /** */\n innerRef: PropTypes.any.description('Ref for the item'),\n};\n\nDSMobileContextMenuItem.displayName = 'DSMobileContextMenuItem';\nconst DSMobileContextMenuItemWithSchema = describe(DSMobileContextMenuItem);\n\nDSMobileContextMenuItemWithSchema.propTypes = props;\n\nexport { DSMobileContextMenuItem, DSMobileContextMenuItemWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADaQ;AAR/B,8BAAoC;AACpC,qBAAqB;AACrB,uBAAiC;AACjC,uBAA0B;AAC1B,4BAA2B;AAC3B,sBAA0B;AAC1B,6BAAkC;AAElC,MAAM,WAAO,yBAAO,CAACA,WAAU,4CAAC,4CAAmB,GAAGA,QAAO,CAAE;AAAA;AAAA;AAI/D,MAAM,eAAW,yBAAO,CAACA,WAAU,4CAAC,uBAAM,GAAGA,QAAO,CAAE;AAAA,IAClD,CAACA,WAAU;AACX,MAAI,CAACA,OAAM,SAAS;AAClB,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWT;AACA,SAAO;AACT,CAAC;AAAA;AAGH,MAAM,QAAQ,wBAAO;AAAA;AAAA,WAEV,CAACA,WAAUA,OAAM,MAAM,OAAO,MAAM,KAAK,CAAC;AAAA,QACjD,2BAAS,C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var import_ds_icon = require("@elliemae/ds-icon");
|
|
40
40
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
41
|
-
var
|
|
42
|
-
var
|
|
41
|
+
var import_ds_legacy_button_v1 = require("@elliemae/ds-legacy-button-v1");
|
|
42
|
+
var import_ds_legacy_form = require("@elliemae/ds-legacy-form");
|
|
43
43
|
var import_Input = require("./Input.js");
|
|
44
44
|
const DSMobileDatePicker = ({ disabled, value, tabIndex, placeholder, onChange }) => {
|
|
45
45
|
const inputRef = (0, import_react.useRef)(null);
|
|
@@ -51,10 +51,10 @@ const DSMobileDatePicker = ({ disabled, value, tabIndex, placeholder, onChange }
|
|
|
51
51
|
const valueArr = value.split("-");
|
|
52
52
|
const displayValue = value && `${valueArr[1]} / ${valueArr[2]} / ${valueArr[0]}`;
|
|
53
53
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
-
|
|
54
|
+
import_ds_legacy_form.DSInputGroup,
|
|
55
55
|
{
|
|
56
56
|
rightAddon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
-
|
|
57
|
+
import_ds_legacy_button_v1.DSButton,
|
|
58
58
|
{
|
|
59
59
|
"aria-label": "Date Picker Button",
|
|
60
60
|
color: !disabled ? import_ds_icon.DSIconColors.PRIMARY : import_ds_icon.DSIconColors.NEUTRAL,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/MobileDatePicker/MobileDatePicker.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useRef, useEffect } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { DSIconColors } from '@elliemae/ds-icon';\nimport { DatePicker } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { DSInputGroup } from '@elliemae/ds-form';\nimport { Input } from './Input.js';\n\nconst DSMobileDatePicker = ({ disabled, value, tabIndex, placeholder, onChange }) => {\n const inputRef = useRef(null);\n useEffect(() => {\n /*\n necessary if value is being set in mount, \n otherwise the clear won't work on the first click\n [SEE input onChange comment]\n */\n if (inputRef.current) {\n inputRef.current.defaultValue = '';\n }\n }, [inputRef.current]);\n const valueArr = value.split('-');\n const displayValue = value && `${valueArr[1]} / ${valueArr[2]} / ${valueArr[0]}`;\n return (\n <DSInputGroup\n rightAddon={\n <DSButton\n aria-label=\"Date Picker Button\"\n color={!disabled ? DSIconColors.PRIMARY : DSIconColors.NEUTRAL}\n disabled={disabled}\n icon={<DatePicker />}\n type=\"button\"\n buttonType=\"secondary\"\n onClick={() => {\n inputRef.current.focus();\n inputRef.current.click();\n }}\n />\n }\n >\n <Input\n data-testid=\"ds-mobile-date-picker\"\n innerRef={inputRef}\n aria-label=\"Date Picker Input Mask\"\n disabled={disabled}\n onKeyDown={(e) => e.preventDefault()}\n type=\"date\"\n placeholder={placeholder}\n onChange={(e) => {\n // https://github.com/facebook/react/issues/8938#issuecomment-360573204\n const { target } = e.nativeEvent;\n function iosClearDefault() {\n target.defaultValue = '';\n }\n window.setTimeout(iosClearDefault, 0);\n onChange(e);\n }}\n tabIndex={tabIndex}\n value={value}\n data-displayvalue={displayValue}\n />\n </DSInputGroup>\n );\n};\n\nDSMobileDatePicker.defaultProps = {\n disabled: false,\n tabIndex: 0,\n placeholder: 'MM / DD / YYYY',\n};\n\nconst props = {\n /**\n * defaults to false\n */\n disabled: PropTypes.bool.description('defaults to false'),\n /**\n * 0 as default\n */\n tabIndex: PropTypes.number.description('0 as default'),\n /**\n * MM / DD / YYYY as default\n */\n placeholder: PropTypes.string.description('MM / DD / YYYY as default'),\n /**\n * onChange handler, receives change event as first argument\n */\n onChange: PropTypes.func.description('onChange handler, receives change event as first argument'),\n /**\n * ISO8601 string representing the date in format YYYY-MM-DD or empty string\n */\n value: PropTypes.string.description('ISO8601 string representing the date in format YYYY-MM-DD or empty string'),\n};\n\nDSMobileDatePicker.displayName = 'DSMobileDatePicker';\nconst DSMobileDatePickerWithSchema = describe(DSMobileDatePicker);\n\nDSMobileDatePickerWithSchema.propTypes = props;\n\nexport { DSMobileDatePicker, DSMobileDatePickerWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6BP;AA7BhB,mBAAyC;AACzC,8BAAoC;AACpC,qBAA6B;AAC7B,sBAA2B;AAC3B,
|
|
4
|
+
"sourcesContent": ["import React, { useRef, useEffect } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { DSIconColors } from '@elliemae/ds-icon';\nimport { DatePicker } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-legacy-button-v1';\nimport { DSInputGroup } from '@elliemae/ds-legacy-form';\nimport { Input } from './Input.js';\n\nconst DSMobileDatePicker = ({ disabled, value, tabIndex, placeholder, onChange }) => {\n const inputRef = useRef(null);\n useEffect(() => {\n /*\n necessary if value is being set in mount, \n otherwise the clear won't work on the first click\n [SEE input onChange comment]\n */\n if (inputRef.current) {\n inputRef.current.defaultValue = '';\n }\n }, [inputRef.current]);\n const valueArr = value.split('-');\n const displayValue = value && `${valueArr[1]} / ${valueArr[2]} / ${valueArr[0]}`;\n return (\n <DSInputGroup\n rightAddon={\n <DSButton\n aria-label=\"Date Picker Button\"\n color={!disabled ? DSIconColors.PRIMARY : DSIconColors.NEUTRAL}\n disabled={disabled}\n icon={<DatePicker />}\n type=\"button\"\n buttonType=\"secondary\"\n onClick={() => {\n inputRef.current.focus();\n inputRef.current.click();\n }}\n />\n }\n >\n <Input\n data-testid=\"ds-mobile-date-picker\"\n innerRef={inputRef}\n aria-label=\"Date Picker Input Mask\"\n disabled={disabled}\n onKeyDown={(e) => e.preventDefault()}\n type=\"date\"\n placeholder={placeholder}\n onChange={(e) => {\n // https://github.com/facebook/react/issues/8938#issuecomment-360573204\n const { target } = e.nativeEvent;\n function iosClearDefault() {\n target.defaultValue = '';\n }\n window.setTimeout(iosClearDefault, 0);\n onChange(e);\n }}\n tabIndex={tabIndex}\n value={value}\n data-displayvalue={displayValue}\n />\n </DSInputGroup>\n );\n};\n\nDSMobileDatePicker.defaultProps = {\n disabled: false,\n tabIndex: 0,\n placeholder: 'MM / DD / YYYY',\n};\n\nconst props = {\n /**\n * defaults to false\n */\n disabled: PropTypes.bool.description('defaults to false'),\n /**\n * 0 as default\n */\n tabIndex: PropTypes.number.description('0 as default'),\n /**\n * MM / DD / YYYY as default\n */\n placeholder: PropTypes.string.description('MM / DD / YYYY as default'),\n /**\n * onChange handler, receives change event as first argument\n */\n onChange: PropTypes.func.description('onChange handler, receives change event as first argument'),\n /**\n * ISO8601 string representing the date in format YYYY-MM-DD or empty string\n */\n value: PropTypes.string.description('ISO8601 string representing the date in format YYYY-MM-DD or empty string'),\n};\n\nDSMobileDatePicker.displayName = 'DSMobileDatePicker';\nconst DSMobileDatePickerWithSchema = describe(DSMobileDatePicker);\n\nDSMobileDatePickerWithSchema.propTypes = props;\n\nexport { DSMobileDatePicker, DSMobileDatePickerWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6BP;AA7BhB,mBAAyC;AACzC,8BAAoC;AACpC,qBAA6B;AAC7B,sBAA2B;AAC3B,iCAAyB;AACzB,4BAA6B;AAC7B,mBAAsB;AAEtB,MAAM,qBAAqB,CAAC,EAAE,UAAU,OAAO,UAAU,aAAa,SAAS,MAAM;AACnF,QAAM,eAAW,qBAAO,IAAI;AAC5B,8BAAU,MAAM;AAMd,QAAI,SAAS,SAAS;AACpB,eAAS,QAAQ,eAAe;AAAA,IAClC;AAAA,EACF,GAAG,CAAC,SAAS,OAAO,CAAC;AACrB,QAAM,WAAW,MAAM,MAAM,GAAG;AAChC,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O,YAAY,2EAA2E;AACjH;AAEA,mBAAmB,cAAc;AACjC,MAAM,mCAA+B,kCAAS,kBAAkB;AAEhE,6BAA6B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -40,7 +40,7 @@ var import_jsx_runtime = (
|
|
|
40
40
|
var import_react = __toESM(require("react"));
|
|
41
41
|
var import_ds_system = require("@elliemae/ds-system");
|
|
42
42
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
43
|
-
var
|
|
43
|
+
var import_ds_legacy_button_v1 = require("@elliemae/ds-legacy-button-v1");
|
|
44
44
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
45
45
|
var import_Text = require("./Text.js");
|
|
46
46
|
const FooterWrap = (0, import_ds_system.styled)(import_ds_grid.Grid)`
|
|
@@ -50,7 +50,7 @@ const FooterWrap = (0, import_ds_system.styled)(import_ds_grid.Grid)`
|
|
|
50
50
|
`;
|
|
51
51
|
const MobileFooter = ({ children }) => {
|
|
52
52
|
const childArr = import_react.default.Children.toArray(children);
|
|
53
|
-
const isButtonType = childArr[0].type === import_Text.DSMobileFooterText || childArr[0].type ===
|
|
53
|
+
const isButtonType = childArr[0].type === import_Text.DSMobileFooterText || childArr[0].type === import_ds_legacy_button_v1.DSButton;
|
|
54
54
|
const setCols = () => {
|
|
55
55
|
if (isButtonType) {
|
|
56
56
|
return childArr.length === 1 ? ["90%"] : ["45%", "45%"];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/MobileFooter/Footer.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable jest/valid-describe */\n/* eslint-disable jest/valid-title */\nimport React from 'react';\nimport { styled, border, __UNSAFE_SPACE_TO_DIMSUM } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButton } from '@elliemae/ds-button';\nimport { describe, PropTypes } from '@elliemae/ds-props-helpers';\nimport { DSMobileFooterText } from './Text.js';\n\nconst FooterWrap = styled(Grid)`\n background-color: ${(props) => props.theme.colors.neutral['000']};\n border-top: ${(props) => border(props.theme.colors.neutral[100])};\n height: ${(props) => `calc(${__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xs)} * 7)`};\n`;\n\nconst MobileFooter = ({ children }) => {\n const childArr = React.Children.toArray(children);\n const isButtonType = childArr[0].type === DSMobileFooterText || childArr[0].type === DSButton;\n const setCols = () => {\n if (isButtonType) {\n return childArr.length === 1 ? ['90%'] : ['45%', '45%'];\n }\n return childArr.map(() => `${100 / childArr.length}%`);\n };\n return (\n <FooterWrap>\n <Grid\n cols={setCols()}\n gutter={isButtonType ? 'xs' : undefined}\n justifyContent=\"center\"\n alignItems={isButtonType ? 'center' : undefined}\n >\n {childArr.map((c, i) => (\n // eslint-disable-next-line react/no-array-index-key\n <Grid key={i}>{c}</Grid>\n ))}\n </Grid>\n </FooterWrap>\n );\n};\n\nconst footerProps = {\n /**\n * Instance of DSButton, DSMobileFooterText or DSMobileFooterAction\n */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]).isRequired.description(\n 'Instance of DSButton, DSMobileFooterText or DSMobileFooterAction',\n ),\n};\n\nMobileFooter.displayName = 'MobileFooter';\nconst MobileFooterWithSchema = describe(MobileFooter);\nMobileFooterWithSchema.propTypes = footerProps;\n\nexport default MobileFooter;\n\nexport { MobileFooterWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkCb;AAAA;AAAA;AAAA;AAhCV,mBAAkB;AAClB,uBAAyD;AACzD,qBAAqB;AACrB,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable jest/valid-describe */\n/* eslint-disable jest/valid-title */\nimport React from 'react';\nimport { styled, border, __UNSAFE_SPACE_TO_DIMSUM } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButton } from '@elliemae/ds-legacy-button-v1';\nimport { describe, PropTypes } from '@elliemae/ds-props-helpers';\nimport { DSMobileFooterText } from './Text.js';\n\nconst FooterWrap = styled(Grid)`\n background-color: ${(props) => props.theme.colors.neutral['000']};\n border-top: ${(props) => border(props.theme.colors.neutral[100])};\n height: ${(props) => `calc(${__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xs)} * 7)`};\n`;\n\nconst MobileFooter = ({ children }) => {\n const childArr = React.Children.toArray(children);\n const isButtonType = childArr[0].type === DSMobileFooterText || childArr[0].type === DSButton;\n const setCols = () => {\n if (isButtonType) {\n return childArr.length === 1 ? ['90%'] : ['45%', '45%'];\n }\n return childArr.map(() => `${100 / childArr.length}%`);\n };\n return (\n <FooterWrap>\n <Grid\n cols={setCols()}\n gutter={isButtonType ? 'xs' : undefined}\n justifyContent=\"center\"\n alignItems={isButtonType ? 'center' : undefined}\n >\n {childArr.map((c, i) => (\n // eslint-disable-next-line react/no-array-index-key\n <Grid key={i}>{c}</Grid>\n ))}\n </Grid>\n </FooterWrap>\n );\n};\n\nconst footerProps = {\n /**\n * Instance of DSButton, DSMobileFooterText or DSMobileFooterAction\n */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]).isRequired.description(\n 'Instance of DSButton, DSMobileFooterText or DSMobileFooterAction',\n ),\n};\n\nMobileFooter.displayName = 'MobileFooter';\nconst MobileFooterWithSchema = describe(MobileFooter);\nMobileFooterWithSchema.propTypes = footerProps;\n\nexport default MobileFooter;\n\nexport { MobileFooterWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkCb;AAAA;AAAA;AAAA;AAhCV,mBAAkB;AAClB,uBAAyD;AACzD,qBAAqB;AAC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var import_ds_system = require("@elliemae/ds-system");
|
|
|
40
40
|
var import_ds_truncated_expandable_text = require("@elliemae/ds-truncated-expandable-text");
|
|
41
41
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
42
42
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
43
|
-
var
|
|
43
|
+
var import_ds_legacy_button_v1 = require("@elliemae/ds-legacy-button-v1");
|
|
44
44
|
var import_MobileSeparator = require("../MobileSeparator/index.js");
|
|
45
45
|
const StyledTitle = (0, import_ds_system.styled)(import_ds_grid.Grid)`
|
|
46
46
|
font-size: 22px;
|
|
@@ -134,7 +134,7 @@ const MobilePageHeader = ({
|
|
|
134
134
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_grid.Grid, { pt: breadCrumb ? 0 : theme.space.xxxs, alignItems: "flex-start", justifyItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_truncated_expandable_text.TruncatedExpandableText, { value: pageTitle }) }),
|
|
135
135
|
contextMenu ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_grid.Grid, { alignItems: "center", children: [
|
|
136
136
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
-
|
|
137
|
+
import_ds_legacy_button_v1.DSButton,
|
|
138
138
|
{
|
|
139
139
|
buttonType: "text",
|
|
140
140
|
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.ChevronSmallDown, {}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/MobilePageHeader/MobilePageHeader.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable import/no-unresolved */\n/* eslint-disable no-plusplus */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-props-helpers';\nimport { styled, border, truncate, withTheme, __UNSAFE_SPACE_TO_DIMSUM } from '@elliemae/ds-system';\nimport { TruncatedExpandableText } from '@elliemae/ds-truncated-expandable-text';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { DSMobileSeparator as MobileSeparator } from '../MobileSeparator/index.js';\n\nconst StyledTitle = styled(Grid)`\n font-size: 22px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['700']};\n min-height: ${(props) => (props.withBreadcrumb ? 'auto' : '44px')};\n padding-top: ${(props) => (props.withBreadcrumb ? '0' : '6px')};\n line-height: 1.15;\n`;\n\nconst StyledBreadCrumb = styled.div`\n font-size: 16px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['600']};\n ${truncate()}\n`;\n\nconst Label = styled.div`\n color: ${(props) => props.theme.colors.neutral['500']};\n ${truncate()}\n`;\n\nconst Value = styled.div`\n ${truncate()}\n color: ${(props) => props.theme.colors.neutral['600']};\n ${(props) => (props.withMarginRight ? `margin-right: 4px;` : '')}\n margin-top: ${(props) => (props.withBreadcrumb ? '12px' : '0')};\n`;\n\nconst Wrapper = styled(Grid)<{ withBlueBorder: boolean }>`\n border-bottom: ${({ theme, withBlueBorder }) =>\n border(withBlueBorder ? theme.colors.brand['700'] : theme.colors.neutral['300'])};\n`;\n\nconst MobilePageHeader = ({\n pageTitle = null,\n withBlueBorder = false,\n contextMenu = null,\n firstAction = null,\n secondAction = null,\n backArrow = null,\n breadCrumb = null,\n onOpenContextMenu = () => null,\n value,\n label,\n theme,\n}) => {\n const hasValue = value === 0 || value;\n\n const countActions = useMemo(() => {\n let count = 0;\n if (firstAction) count++;\n if (secondAction) count++;\n return count;\n }, [firstAction, secondAction]);\n const [open, setOpen] = useState();\n const handleContext = useCallback(() => {\n setOpen(!open);\n }, [open]);\n\n const separator = (\n <Grid height=\"32px\" alignItems=\"center\">\n <Grid height=\"24px\">\n <MobileSeparator direction=\"vertical\" margin=\"xxs\" color={['neutral', '300']} />\n </Grid>\n </Grid>\n );\n const cols = [1, 'auto'];\n const cols2 = ['auto'];\n if (countActions) cols.push('auto');\n if (hasValue) cols2.push('auto');\n if (label) cols2.push('auto');\n\n return (\n <Wrapper\n cols={cols}\n pl={theme.space.xs}\n pr={theme.space.xs}\n alignItems=\"flex-start\"\n width=\"100%\"\n data-testid=\"page-header-wrapper\"\n withBlueBorder={withBlueBorder}\n >\n <Grid alignItems=\"flex-start\" justifyContent=\"flex-start\" cols={cols2}>\n <Grid\n cols={backArrow ? ['auto', 1] : [1]}\n alignItems=\"flex-start\"\n pr={countActions === 0 && !hasValue && !label ? __UNSAFE_SPACE_TO_DIMSUM(theme.space.s) : 0}\n >\n {backArrow && (\n <Grid height={breadCrumb ? '56px' : '44px'} alignItems=\"center\" pr=\"16px\">\n {backArrow}\n </Grid>\n )}\n <Grid flexGrow={0} pt={!breadCrumb ? 0 : theme.space.xxs}>\n <Grid>\n <Grid>\n {breadCrumb && <StyledBreadCrumb data-testid=\"page-header-breadcrum\">{breadCrumb}</StyledBreadCrumb>}\n <StyledTitle\n cols={['auto', '1fr']}\n gutter=\"xxxs\"\n maxWidth=\"100%\"\n alignItems=\"flex-start\"\n withBreadcrumb={!!breadCrumb}\n data-testid=\"page-header-title\"\n >\n <Grid pt={breadCrumb ? 0 : theme.space.xxxs} alignItems=\"flex-start\" justifyItems=\"center\">\n <TruncatedExpandableText value={pageTitle} />\n </Grid>\n {contextMenu ? (\n <Grid alignItems=\"center\">\n <DSButton\n buttonType=\"text\"\n icon={<ChevronSmallDown />}\n size=\"s\"\n onClick={() => {\n handleContext();\n onOpenContextMenu();\n }}\n containerProps={{ 'data-testid': 'trigger-context-menu' }}\n />\n {React.cloneElement(contextMenu, {\n open: contextMenu.props.open !== undefined ? contextMenu.props.open : open,\n onChange: (event, item) => {\n if (contextMenu.props.onChange) contextMenu.props.onChange(event, item);\n handleContext();\n },\n })}\n </Grid>\n ) : null}\n </StyledTitle>\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n {hasValue && (\n <Grid height={breadCrumb ? '56px' : '44px'} alignItems=\"center\" cols={['auto', 'auto']}>\n {separator}\n <Value withMarginRight={!!label} data-testid=\"page-header-value\">\n {value}\n </Value>\n </Grid>\n )}\n {label && (\n <Grid height={breadCrumb ? '56px' : '44px'} alignItems=\"center\">\n <Label withBreadcrumb={!!breadCrumb} data-testid=\"page-header-label\">\n {label}\n </Label>\n </Grid>\n )}\n </Grid>\n {countActions > 0 && (\n <Grid\n height={breadCrumb ? '56px' : '44px'}\n alignItems=\"center\"\n cols={countActions === 1 ? ['auto'] : ['auto', 'auto', 'auto']}\n >\n {firstAction && <Grid>{firstAction}</Grid>}\n {countActions === 2 && separator}\n {secondAction && <Grid>{secondAction}</Grid>}\n </Grid>\n )}\n </Wrapper>\n );\n};\n\nconst pageHeaderProps = {\n pageTitle: PropTypes.string.description('Page title').isRequired,\n contextMenu: PropTypes.element.description('Context Menu to open'),\n onOpenContextMenu: PropTypes.func.description('function called when context menu opens'),\n firstAction: PropTypes.element.description('Action Button'),\n secondAction: PropTypes.element.description('Action Button'),\n backArrow: PropTypes.element.description('Back Arrow Button'),\n breadCrumb: PropTypes.string.description('BreadCrumbs title'),\n value: PropTypes.number.description('Page summary value'),\n label: PropTypes.string.description('Page summary label'),\n theme: PropTypes.object.description('dimsum theme'),\n};\n\nMobilePageHeader.displayName = 'MobilePageHeader';\nconst PageHeaderWithSchema = describe(MobilePageHeader);\nPageHeaderWithSchema.propTypes = pageHeaderProps;\n\nconst DSMobilePageHeader = withTheme(MobilePageHeader);\n\nexport { DSMobilePageHeader, PageHeaderWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2Ef;AAvER,mBAAsD;AACtD,8BAAoC;AACpC,uBAA8E;AAC9E,0CAAwC;AACxC,qBAAqB;AACrB,sBAAiC;AACjC,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable import/no-unresolved */\n/* eslint-disable no-plusplus */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-props-helpers';\nimport { styled, border, truncate, withTheme, __UNSAFE_SPACE_TO_DIMSUM } from '@elliemae/ds-system';\nimport { TruncatedExpandableText } from '@elliemae/ds-truncated-expandable-text';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-legacy-button-v1';\nimport { DSMobileSeparator as MobileSeparator } from '../MobileSeparator/index.js';\n\nconst StyledTitle = styled(Grid)`\n font-size: 22px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['700']};\n min-height: ${(props) => (props.withBreadcrumb ? 'auto' : '44px')};\n padding-top: ${(props) => (props.withBreadcrumb ? '0' : '6px')};\n line-height: 1.15;\n`;\n\nconst StyledBreadCrumb = styled.div`\n font-size: 16px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['600']};\n ${truncate()}\n`;\n\nconst Label = styled.div`\n color: ${(props) => props.theme.colors.neutral['500']};\n ${truncate()}\n`;\n\nconst Value = styled.div`\n ${truncate()}\n color: ${(props) => props.theme.colors.neutral['600']};\n ${(props) => (props.withMarginRight ? `margin-right: 4px;` : '')}\n margin-top: ${(props) => (props.withBreadcrumb ? '12px' : '0')};\n`;\n\nconst Wrapper = styled(Grid)<{ withBlueBorder: boolean }>`\n border-bottom: ${({ theme, withBlueBorder }) =>\n border(withBlueBorder ? theme.colors.brand['700'] : theme.colors.neutral['300'])};\n`;\n\nconst MobilePageHeader = ({\n pageTitle = null,\n withBlueBorder = false,\n contextMenu = null,\n firstAction = null,\n secondAction = null,\n backArrow = null,\n breadCrumb = null,\n onOpenContextMenu = () => null,\n value,\n label,\n theme,\n}) => {\n const hasValue = value === 0 || value;\n\n const countActions = useMemo(() => {\n let count = 0;\n if (firstAction) count++;\n if (secondAction) count++;\n return count;\n }, [firstAction, secondAction]);\n const [open, setOpen] = useState();\n const handleContext = useCallback(() => {\n setOpen(!open);\n }, [open]);\n\n const separator = (\n <Grid height=\"32px\" alignItems=\"center\">\n <Grid height=\"24px\">\n <MobileSeparator direction=\"vertical\" margin=\"xxs\" color={['neutral', '300']} />\n </Grid>\n </Grid>\n );\n const cols = [1, 'auto'];\n const cols2 = ['auto'];\n if (countActions) cols.push('auto');\n if (hasValue) cols2.push('auto');\n if (label) cols2.push('auto');\n\n return (\n <Wrapper\n cols={cols}\n pl={theme.space.xs}\n pr={theme.space.xs}\n alignItems=\"flex-start\"\n width=\"100%\"\n data-testid=\"page-header-wrapper\"\n withBlueBorder={withBlueBorder}\n >\n <Grid alignItems=\"flex-start\" justifyContent=\"flex-start\" cols={cols2}>\n <Grid\n cols={backArrow ? ['auto', 1] : [1]}\n alignItems=\"flex-start\"\n pr={countActions === 0 && !hasValue && !label ? __UNSAFE_SPACE_TO_DIMSUM(theme.space.s) : 0}\n >\n {backArrow && (\n <Grid height={breadCrumb ? '56px' : '44px'} alignItems=\"center\" pr=\"16px\">\n {backArrow}\n </Grid>\n )}\n <Grid flexGrow={0} pt={!breadCrumb ? 0 : theme.space.xxs}>\n <Grid>\n <Grid>\n {breadCrumb && <StyledBreadCrumb data-testid=\"page-header-breadcrum\">{breadCrumb}</StyledBreadCrumb>}\n <StyledTitle\n cols={['auto', '1fr']}\n gutter=\"xxxs\"\n maxWidth=\"100%\"\n alignItems=\"flex-start\"\n withBreadcrumb={!!breadCrumb}\n data-testid=\"page-header-title\"\n >\n <Grid pt={breadCrumb ? 0 : theme.space.xxxs} alignItems=\"flex-start\" justifyItems=\"center\">\n <TruncatedExpandableText value={pageTitle} />\n </Grid>\n {contextMenu ? (\n <Grid alignItems=\"center\">\n <DSButton\n buttonType=\"text\"\n icon={<ChevronSmallDown />}\n size=\"s\"\n onClick={() => {\n handleContext();\n onOpenContextMenu();\n }}\n containerProps={{ 'data-testid': 'trigger-context-menu' }}\n />\n {React.cloneElement(contextMenu, {\n open: contextMenu.props.open !== undefined ? contextMenu.props.open : open,\n onChange: (event, item) => {\n if (contextMenu.props.onChange) contextMenu.props.onChange(event, item);\n handleContext();\n },\n })}\n </Grid>\n ) : null}\n </StyledTitle>\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n {hasValue && (\n <Grid height={breadCrumb ? '56px' : '44px'} alignItems=\"center\" cols={['auto', 'auto']}>\n {separator}\n <Value withMarginRight={!!label} data-testid=\"page-header-value\">\n {value}\n </Value>\n </Grid>\n )}\n {label && (\n <Grid height={breadCrumb ? '56px' : '44px'} alignItems=\"center\">\n <Label withBreadcrumb={!!breadCrumb} data-testid=\"page-header-label\">\n {label}\n </Label>\n </Grid>\n )}\n </Grid>\n {countActions > 0 && (\n <Grid\n height={breadCrumb ? '56px' : '44px'}\n alignItems=\"center\"\n cols={countActions === 1 ? ['auto'] : ['auto', 'auto', 'auto']}\n >\n {firstAction && <Grid>{firstAction}</Grid>}\n {countActions === 2 && separator}\n {secondAction && <Grid>{secondAction}</Grid>}\n </Grid>\n )}\n </Wrapper>\n );\n};\n\nconst pageHeaderProps = {\n pageTitle: PropTypes.string.description('Page title').isRequired,\n contextMenu: PropTypes.element.description('Context Menu to open'),\n onOpenContextMenu: PropTypes.func.description('function called when context menu opens'),\n firstAction: PropTypes.element.description('Action Button'),\n secondAction: PropTypes.element.description('Action Button'),\n backArrow: PropTypes.element.description('Back Arrow Button'),\n breadCrumb: PropTypes.string.description('BreadCrumbs title'),\n value: PropTypes.number.description('Page summary value'),\n label: PropTypes.string.description('Page summary label'),\n theme: PropTypes.object.description('dimsum theme'),\n};\n\nMobilePageHeader.displayName = 'MobilePageHeader';\nconst PageHeaderWithSchema = describe(MobilePageHeader);\nPageHeaderWithSchema.propTypes = pageHeaderProps;\n\nconst DSMobilePageHeader = withTheme(MobilePageHeader);\n\nexport { DSMobilePageHeader, PageHeaderWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2Ef;AAvER,mBAAsD;AACtD,8BAAoC;AACpC,uBAA8E;AAC9E,0CAAwC;AACxC,qBAAqB;AACrB,sBAAiC;AACjC,iCAAyB;AACzB,6BAAqD;AAErD,MAAM,kBAAc,yBAAO,mBAAI;AAAA;AAAA,iBAEd,CAAC,UAAU,MAAM,MAAM,YAAY,OAAO;AAAA,WAChD,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,gBACvC,CAAC,UAAW,MAAM,iBAAiB,SAAS,MAAO;AAAA,iBAClD,CAAC,UAAW,MAAM,iBAAiB,MAAM,KAAM;AAAA;AAAA;AAIhE,MAAM,mBAAmB,wBAAO;AAAA;AAAA,iBAEf,CAAC,UAAU,MAAM,MAAM,YAAY,OAAO;AAAA,WAChD,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,QACnD,2BAAS,CAAC;AAAA;AAGd,MAAM,QAAQ,wBAAO;AAAA,WACV,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,QACnD,2BAAS,CAAC;AAAA;AAGd,MAAM,QAAQ,wBAAO;AAAA,QACjB,2BAAS,CAAC;AAAA,WACH,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,IACnD,CAAC,UAAW,MAAM,kBAAkB,uBAAuB,EAAG;AAAA,gBAClD,CAAC,UAAW,MAAM,iBAAiB,SAAS,GAAI;AAAA;AAGhE,MAAM,cAAU,yBAAO,mBAAI;AAAA,mBACR,CAAC,EAAE,OAAO,eAAe,UACxC,yBAAO,iBAAiB,MA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;AACpD;AAEA,iBAAiB,cAAc;AAC/B,MAAM,2BAAuB,kCAAS,gBAAgB;AACtD,qBAAqB,YAAY;AAEjC,MAAM,yBAAqB,4BAAU,gBAAgB;",
|
|
6
6
|
"names": ["MobileSeparator", "React"]
|
|
7
7
|
}
|
|
@@ -33,7 +33,7 @@ __export(MobileSelectList_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(MobileSelectList_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var
|
|
36
|
+
var import_ds_legacy_form = require("@elliemae/ds-legacy-form");
|
|
37
37
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
38
38
|
var import_ds_system = require("@elliemae/ds-system");
|
|
39
39
|
var import_lodash_es = require("lodash-es");
|
|
@@ -93,7 +93,7 @@ const MobileSelectList = ({
|
|
|
93
93
|
height: (0, import_ds_system.__UNSAFE_SPACE_TO_DIMSUM)(theme.space.xl),
|
|
94
94
|
pl: (0, import_ds_system.__UNSAFE_SPACE_TO_DIMSUM)(theme.space.s),
|
|
95
95
|
pr: (0, import_ds_system.__UNSAFE_SPACE_TO_DIMSUM)(theme.space.s),
|
|
96
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_form.DSTextBox, { onChange: handleOnSearch, placeholder: "Filter by name", value: filter })
|
|
97
97
|
}
|
|
98
98
|
)
|
|
99
99
|
] }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/MobileSelectList/MobileSelectList.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable func-names */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint react/jsx-no-bind:0 react/no-this-in-sfc:0 */\n/* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */\n/* tslint:disable */\n// @ts-nocheck\n// What's with all the above disables?\n// this is what a legacy 7 year old codebase looks like.\n\nimport { DSTextBox } from '@elliemae/ds-form';\nimport { Grid } from '@elliemae/ds-grid';\nimport { __UNSAFE_SPACE_TO_DIMSUM, op, withTheme } from '@elliemae/ds-system';\nimport { noop } from 'lodash-es';\nimport React, { useEffect, useState } from 'react';\nimport { DSMobileTouchable } from '../MobileTouchable/index.js';\nimport { Footer, HeaderContainer, ListContainer, StyledContainer, checkbox, checked, selectedMark } from './styled.js';\n\nconst MobileSelectList = ({\n open = false,\n header = null,\n multiple = false,\n onChange = noop,\n children,\n theme,\n zIndex = 1,\n useSearch,\n onSearch = noop,\n dataTestid = 'mobile-select-list',\n buttonFooter = null,\n ButtonFooter,\n onApply = noop,\n selecteds: initSelecteds = [],\n}) => {\n const rows = ['auto', 1];\n const [selecteds, setSelected] = useState(initSelecteds);\n const [filter, setFilter] = useState('');\n useEffect(() => {\n setSelected(initSelecteds);\n }, [initSelecteds]);\n\n const handleSelection = (value) => {\n if (multiple) {\n const index = selecteds.findIndex((s) => s === value);\n if (index > -1) setSelected(selecteds.filter((s) => s !== value));\n else setSelected([...selecteds, value]);\n } else setSelected([value]);\n };\n const handleChange = function (event) {\n onChange(event, this);\n handleSelection(this.value);\n };\n const handleOnSearch = (e) => {\n setFilter(e.target.value);\n onSearch(e);\n };\n\n const handleApply = function (e) {\n if (this.onClick) this.onClick(e);\n onApply(e, selecteds);\n };\n if (buttonFooter || ButtonFooter) rows.push(op('*', __UNSAFE_SPACE_TO_DIMSUM(theme.space.xl), 1.16666));\n if (!open) return null;\n return (\n <StyledContainer data-testid={dataTestid} rows={rows} zIndex={zIndex}>\n <HeaderContainer>\n {header}\n {useSearch && (\n <Grid\n alignItems=\"center\"\n height={__UNSAFE_SPACE_TO_DIMSUM(theme.space.xl)}\n pl={__UNSAFE_SPACE_TO_DIMSUM(theme.space.s)}\n pr={__UNSAFE_SPACE_TO_DIMSUM(theme.space.s)}\n >\n <DSTextBox onChange={handleOnSearch} placeholder=\"Filter by name\" value={filter} />\n </Grid>\n )}\n </HeaderContainer>\n <Grid style={{ overflow: 'hidden' }}>\n <Grid style={{ overflow: 'auto' }}>\n <ListContainer data-testid={`${dataTestid}--list-container`}>\n {React.Children.map(children, (child) => {\n let leftAddon = null;\n let rightAddon = null;\n const { value, title } = child.props;\n const found = selecteds.findIndex((s) => String(s) === String(value));\n if (\n filter &&\n !String(value).toLocaleLowerCase().includes(filter.toLocaleLowerCase()) &&\n !String(title).toLocaleLowerCase().includes(filter.toLocaleLowerCase())\n )\n return null;\n if (multiple) {\n if (found > -1) leftAddon = checked;\n else leftAddon = checkbox;\n } else if (found > -1) {\n rightAddon = selectedMark;\n }\n return (\n <DSMobileTouchable onClick={handleChange.bind(child.props)}>\n {React.cloneElement(child, { leftAddon, rightAddon })}\n </DSMobileTouchable>\n );\n })}\n </ListContainer>\n </Grid>\n </Grid>\n {ButtonFooter || Boolean(buttonFooter) ? (\n <Footer\n alignItems=\"center\"\n // eslint-disable-next-line max-lines\n pl={__UNSAFE_SPACE_TO_DIMSUM(theme.space.s)}\n pr={__UNSAFE_SPACE_TO_DIMSUM(theme.space.s)}\n >\n {!ButtonFooter ? (\n React.cloneElement(buttonFooter, {\n ...buttonFooter.props,\n containerProps: {\n 'data-testid': `${dataTestid}--btn`,\n },\n buttonType: 'primary',\n size: 'l',\n onClick: handleApply.bind(buttonFooter.props),\n })\n ) : (\n <ButtonFooter\n containerProps={{\n 'data-testid': `${dataTestid}--btn`,\n }}\n buttonType=\"primary\"\n size=\"l\"\n onClick={handleApply}\n />\n )}\n </Footer>\n ) : null}\n </StyledContainer>\n );\n};\n\nconst DSMobileSelectList = withTheme(MobileSelectList);\n\nexport { DSMobileSelectList };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmEjB;AAvDN,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable func-names */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint react/jsx-no-bind:0 react/no-this-in-sfc:0 */\n/* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */\n/* tslint:disable */\n// @ts-nocheck\n// What's with all the above disables?\n// this is what a legacy 7 year old codebase looks like.\n\nimport { DSTextBox } from '@elliemae/ds-legacy-form';\nimport { Grid } from '@elliemae/ds-grid';\nimport { __UNSAFE_SPACE_TO_DIMSUM, op, withTheme } from '@elliemae/ds-system';\nimport { noop } from 'lodash-es';\nimport React, { useEffect, useState } from 'react';\nimport { DSMobileTouchable } from '../MobileTouchable/index.js';\nimport { Footer, HeaderContainer, ListContainer, StyledContainer, checkbox, checked, selectedMark } from './styled.js';\n\nconst MobileSelectList = ({\n open = false,\n header = null,\n multiple = false,\n onChange = noop,\n children,\n theme,\n zIndex = 1,\n useSearch,\n onSearch = noop,\n dataTestid = 'mobile-select-list',\n buttonFooter = null,\n ButtonFooter,\n onApply = noop,\n selecteds: initSelecteds = [],\n}) => {\n const rows = ['auto', 1];\n const [selecteds, setSelected] = useState(initSelecteds);\n const [filter, setFilter] = useState('');\n useEffect(() => {\n setSelected(initSelecteds);\n }, [initSelecteds]);\n\n const handleSelection = (value) => {\n if (multiple) {\n const index = selecteds.findIndex((s) => s === value);\n if (index > -1) setSelected(selecteds.filter((s) => s !== value));\n else setSelected([...selecteds, value]);\n } else setSelected([value]);\n };\n const handleChange = function (event) {\n onChange(event, this);\n handleSelection(this.value);\n };\n const handleOnSearch = (e) => {\n setFilter(e.target.value);\n onSearch(e);\n };\n\n const handleApply = function (e) {\n if (this.onClick) this.onClick(e);\n onApply(e, selecteds);\n };\n if (buttonFooter || ButtonFooter) rows.push(op('*', __UNSAFE_SPACE_TO_DIMSUM(theme.space.xl), 1.16666));\n if (!open) return null;\n return (\n <StyledContainer data-testid={dataTestid} rows={rows} zIndex={zIndex}>\n <HeaderContainer>\n {header}\n {useSearch && (\n <Grid\n alignItems=\"center\"\n height={__UNSAFE_SPACE_TO_DIMSUM(theme.space.xl)}\n pl={__UNSAFE_SPACE_TO_DIMSUM(theme.space.s)}\n pr={__UNSAFE_SPACE_TO_DIMSUM(theme.space.s)}\n >\n <DSTextBox onChange={handleOnSearch} placeholder=\"Filter by name\" value={filter} />\n </Grid>\n )}\n </HeaderContainer>\n <Grid style={{ overflow: 'hidden' }}>\n <Grid style={{ overflow: 'auto' }}>\n <ListContainer data-testid={`${dataTestid}--list-container`}>\n {React.Children.map(children, (child) => {\n let leftAddon = null;\n let rightAddon = null;\n const { value, title } = child.props;\n const found = selecteds.findIndex((s) => String(s) === String(value));\n if (\n filter &&\n !String(value).toLocaleLowerCase().includes(filter.toLocaleLowerCase()) &&\n !String(title).toLocaleLowerCase().includes(filter.toLocaleLowerCase())\n )\n return null;\n if (multiple) {\n if (found > -1) leftAddon = checked;\n else leftAddon = checkbox;\n } else if (found > -1) {\n rightAddon = selectedMark;\n }\n return (\n <DSMobileTouchable onClick={handleChange.bind(child.props)}>\n {React.cloneElement(child, { leftAddon, rightAddon })}\n </DSMobileTouchable>\n );\n })}\n </ListContainer>\n </Grid>\n </Grid>\n {ButtonFooter || Boolean(buttonFooter) ? (\n <Footer\n alignItems=\"center\"\n // eslint-disable-next-line max-lines\n pl={__UNSAFE_SPACE_TO_DIMSUM(theme.space.s)}\n pr={__UNSAFE_SPACE_TO_DIMSUM(theme.space.s)}\n >\n {!ButtonFooter ? (\n React.cloneElement(buttonFooter, {\n ...buttonFooter.props,\n containerProps: {\n 'data-testid': `${dataTestid}--btn`,\n },\n buttonType: 'primary',\n size: 'l',\n onClick: handleApply.bind(buttonFooter.props),\n })\n ) : (\n <ButtonFooter\n containerProps={{\n 'data-testid': `${dataTestid}--btn`,\n }}\n buttonType=\"primary\"\n size=\"l\"\n onClick={handleApply}\n />\n )}\n </Footer>\n ) : null}\n </StyledContainer>\n );\n};\n\nconst DSMobileSelectList = withTheme(MobileSelectList);\n\nexport { DSMobileSelectList };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmEjB;AAvDN,4BAA0B;AAC1B,qBAAqB;AACrB,uBAAwD;AACxD,uBAAqB;AACrB,mBAA2C;AAC3C,6BAAkC;AAClC,oBAAyG;AAEzG,MAAM,mBAAmB,CAAC;AAAA,EACxB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,WAAW;AAAA,EACX,aAAa;AAAA,EACb,eAAe;AAAA,EACf;AAAA,EACA,UAAU;AAAA,EACV,WAAW,gBAAgB,CAAC;AAC9B,MAAM;AACJ,QAAM,OAAO,CAAC,QAAQ,CAAC;AACvB,QAAM,CAAC,WAAW,WAAW,QAAI,uBAAS,aAAa;AACvD,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,EAAE;AACvC,8BAAU,MAAM;AACd,gBAAY,aAAa;AAAA,EAC3B,GAAG,CAAC,aAAa,CAAC;AAElB,QAAM,kBAAkB,CAAC,UAAU;AACjC,QAAI,UAAU;AACZ,YAAM,QAAQ,UAAU,UAAU,CAAC,MAAM,MAAM,KAAK;AACpD,UAAI,QAAQ,GAAI,aAAY,UAAU,OAAO,CAAC,MAAM,MAAM,KAAK,CAAC;AAAA,UAC3D,aAAY,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AAC,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,OAAO,kBAAkB,CAAC,KACtE,CAAC,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,OAAO,kBAAkB,CAAC;AAEtE,eAAO;AACT,UAAI,UAAU;AACZ,YAAI,QAAQ,GAAI,aAAY;AAAA,YACvB,aAAY;AAAA,MACnB,WAAW,QAAQ,IAAI;AACrB,qBAAa;AAAA,MACf;AACA,aACE,4CAAC,4CAAkB,SAAS,aAAa,KAAK,MAAM,KAAK,GACtD,uBAAAA,QAAM,aAAa,OAAO,EAAE,WAAW,WAAW,CAAC,GACtD;AAAA,IAEJ,CAAC,GACH,GACF,GACF;AAAA,IACC,gBAAgB,QAAQ,YAAY,IACnC;AAAA,MAAC;AAAA;AAAA,QACC,YAAW;AAAA,QAEX,QAAI,2CAAyB,MAAM,MAAM,CAAC;AAAA,QAC1C,QAAI,2CAAyB,MAAM,MAAM,CAAC;AAAA,QAEzC,WAAC,eACA,aAAAA,QAAM,aAAa,cAAc;AAAA,UAC/B,GAAG,aAAa;AAAA,UAChB,gBAAgB;AAAA,YACd,eAAe,GAAG,UAAU;AAAA,UAC9B;AAAA,UACA,YAAY;AAAA,UACZ,MAAM;AAAA,UACN,SAAS,YAAY,KAAK,aAAa,KAAK;AAAA,QAC9C,CAAC,IAED;AAAA,UAAC;AAAA;AAAA,YACC,gBAAgB;AAAA,cACd,eAAe,GAAG,UAAU;AAAA,YAC9B;AAAA,YACA,YAAW;AAAA,YACX,MAAK;AAAA,YACL,SAAS;AAAA;AAAA,QACX;AAAA;AAAA,IAEJ,IACE;AAAA,KACN;AAEJ;AAEA,MAAM,yBAAqB,4BAAU,gBAAgB;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -42,7 +42,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
42
42
|
var import_lodash_es = require("lodash-es");
|
|
43
43
|
var import_ds_system = require("@elliemae/ds-system");
|
|
44
44
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
45
|
-
var
|
|
45
|
+
var import_ds_legacy_form = require("@elliemae/ds-legacy-form");
|
|
46
46
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
47
47
|
var import_MobileTouchable = require("../MobileTouchable/index.js");
|
|
48
48
|
var import_MobileListItem = require("../MobileListItem/index.js");
|
|
@@ -67,7 +67,7 @@ const ListContainer = import_ds_system.styled.div`
|
|
|
67
67
|
border: none;
|
|
68
68
|
}
|
|
69
69
|
`;
|
|
70
|
-
const checkbox = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
-
const checked = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
|
+
const checkbox = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_form.DSCheckbox, { checked: false, onChange: import_lodash_es.noop, style: { pointerEvents: "none" } });
|
|
71
|
+
const checked = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_form.DSCheckbox, { checked: true, onChange: import_lodash_es.noop, style: { pointerEvents: "none" } });
|
|
72
72
|
const selectedMark = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.Checkmark, { color: ["brand-primary", 600] });
|
|
73
73
|
//# sourceMappingURL=styled.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/MobileSelectList/styled.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { noop } from 'lodash-es';\nimport { styled, border } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSCheckbox } from '@elliemae/ds-form';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport { DSMobileTouchable } from '../MobileTouchable/index.js';\nimport { DSMobileListItem } from '../MobileListItem/index.js';\n\nexport const StyledContainer = styled(Grid)`\n background: ${(props) => props.theme.colors.neutral['000']};\n z-index: ${(props) => props.zIndex};\n position: fixed;\n width: 100%;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n`;\n\nexport const HeaderContainer = styled(Grid)`\n border-bottom: ${(props) => border(props.theme.colors.neutral['300'])};\n`;\n\nexport const Footer = styled(Grid)`\n border-top: ${(props) => border(props.theme.colors.neutral['300'])};\n`;\n\nexport const ListContainer = styled.div`\n & ${DSMobileTouchable}:last-child ${DSMobileListItem} {\n border: none;\n }\n`;\n\nexport const checkbox = <DSCheckbox checked={false} onChange={noop} style={{ pointerEvents: 'none' }} />;\nexport const checked = <DSCheckbox checked onChange={noop} style={{ pointerEvents: 'none' }} />;\nexport const selectedMark = <Checkmark color={['brand-primary', 600]} />;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkCC;AAjCxB,uBAAqB;AACrB,uBAA+B;AAC/B,qBAAqB;AACrB,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { noop } from 'lodash-es';\nimport { styled, border } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSCheckbox } from '@elliemae/ds-legacy-form';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport { DSMobileTouchable } from '../MobileTouchable/index.js';\nimport { DSMobileListItem } from '../MobileListItem/index.js';\n\nexport const StyledContainer = styled(Grid)`\n background: ${(props) => props.theme.colors.neutral['000']};\n z-index: ${(props) => props.zIndex};\n position: fixed;\n width: 100%;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n`;\n\nexport const HeaderContainer = styled(Grid)`\n border-bottom: ${(props) => border(props.theme.colors.neutral['300'])};\n`;\n\nexport const Footer = styled(Grid)`\n border-top: ${(props) => border(props.theme.colors.neutral['300'])};\n`;\n\nexport const ListContainer = styled.div`\n & ${DSMobileTouchable}:last-child ${DSMobileListItem} {\n border: none;\n }\n`;\n\nexport const checkbox = <DSCheckbox checked={false} onChange={noop} style={{ pointerEvents: 'none' }} />;\nexport const checked = <DSCheckbox checked onChange={noop} style={{ pointerEvents: 'none' }} />;\nexport const selectedMark = <Checkmark color={['brand-primary', 600]} />;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkCC;AAjCxB,uBAAqB;AACrB,uBAA+B;AAC/B,qBAAqB;AACrB,4BAA2B;AAC3B,sBAA0B;AAC1B,6BAAkC;AAClC,4BAAiC;AAE1B,MAAM,sBAAkB,yBAAO,mBAAI;AAAA,gBAC1B,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,aAC/C,CAAC,UAAU,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS7B,MAAM,sBAAkB,yBAAO,mBAAI;AAAA,mBACvB,CAAC,cAAU,yBAAO,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC,CAAC;AAAA;AAGhE,MAAM,aAAS,yBAAO,mBAAI;AAAA,gBACjB,CAAC,cAAU,yBAAO,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC,CAAC;AAAA;AAG7D,MAAM,gBAAgB,wBAAO;AAAA,MAC9B,wCAAiB,eAAe,sCAAgB;AAAA;AAAA;AAAA;AAK/C,MAAM,WAAW,4CAAC,oCAAW,SAAS,OAAO,UAAU,uBAAM,OAAO,EAAE,eAAe,OAAO,GAAG;AAC/F,MAAM,UAAU,4CAAC,oCAAW,SAAO,MAAC,UAAU,uBAAM,OAAO,EAAE,eAAe,OAAO,GAAG;AACtF,MAAM,eAAe,4CAAC,6BAAU,OAAO,CAAC,iBAAiB,GAAG,GAAG;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -38,8 +38,8 @@ var import_react = require("react");
|
|
|
38
38
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
39
|
var import_ds_icon = require("@elliemae/ds-icon");
|
|
40
40
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
41
|
-
var
|
|
42
|
-
var
|
|
41
|
+
var import_ds_legacy_button_v1 = require("@elliemae/ds-legacy-button-v1");
|
|
42
|
+
var import_ds_legacy_form = require("@elliemae/ds-legacy-form");
|
|
43
43
|
var import_Input = require("./Input.js");
|
|
44
44
|
const DSMobileTimePicker = ({ disabled, value, tabIndex, placeholder, onChange }) => {
|
|
45
45
|
const inputRef = (0, import_react.useRef)(null);
|
|
@@ -56,10 +56,10 @@ const DSMobileTimePicker = ({ disabled, value, tabIndex, placeholder, onChange }
|
|
|
56
56
|
return `${h} : ${valueArr[1]} ${ampm}`;
|
|
57
57
|
}, [value]);
|
|
58
58
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
-
|
|
59
|
+
import_ds_legacy_form.DSInputGroup,
|
|
60
60
|
{
|
|
61
61
|
rightAddon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
62
|
-
|
|
62
|
+
import_ds_legacy_button_v1.DSButton,
|
|
63
63
|
{
|
|
64
64
|
"aria-label": "Time Picker Button",
|
|
65
65
|
color: !disabled ? import_ds_icon.DSIconColors.PRIMARY : import_ds_icon.DSIconColors.NEUTRAL,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/MobileTimePicker/MobileTimePicker.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useRef, useMemo, useEffect } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { DSIconColors } from '@elliemae/ds-icon';\nimport { RecentDocuments } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { DSInputGroup } from '@elliemae/ds-form';\nimport { Input } from './Input.js';\n\nconst DSMobileTimePicker = ({ disabled, value, tabIndex, placeholder, onChange }) => {\n const inputRef = useRef(null);\n const valueArr = value.split(':');\n useEffect(() => {\n /*\n necessary if value is being set in mount, \n otherwise the clear won't work on the first click\n [SEE input onChange comment]\n */\n if (inputRef.current) {\n inputRef.current.defaultValue = '';\n }\n }, [inputRef.current]);\n const displayValue = useMemo(() => {\n if (!value || !valueArr[0] || !valueArr[1]) return '';\n const ampm = valueArr[0] >= 12 ? 'pm' : 'am';\n const h = valueArr[0] > 12 ? valueArr[0] - 12 : valueArr[0];\n\n return `${h} : ${valueArr[1]} ${ampm}`;\n }, [value]);\n\n return (\n <DSInputGroup\n rightAddon={\n <DSButton\n aria-label=\"Time Picker Button\"\n color={!disabled ? DSIconColors.PRIMARY : DSIconColors.NEUTRAL}\n disabled={disabled}\n icon={<RecentDocuments />}\n type=\"button\"\n buttonType=\"secondary\"\n onClick={() => {\n inputRef.current.focus();\n inputRef.current.click();\n }}\n />\n }\n >\n <Input\n innerRef={inputRef}\n type=\"time\"\n data-testid=\"ds-mobile-time-picker\"\n aria-label=\"Time Picker Input Mask\"\n disabled={disabled}\n placeholder={placeholder}\n tabIndex={tabIndex}\n value={value}\n data-displayvalue={displayValue}\n onChange={(e) => {\n // https://github.com/facebook/react/issues/8938#issuecomment-360573204\n const { target } = e.nativeEvent;\n function iosClearDefault() {\n target.defaultValue = '';\n }\n window.setTimeout(iosClearDefault, 0);\n onChange(e);\n }}\n />\n </DSInputGroup>\n );\n};\n\nDSMobileTimePicker.defaultProps = {\n disabled: false,\n tabIndex: 0,\n placeholder: 'HH : MM am',\n value: '',\n};\n\nconst pickerProps = {\n /**\n * defaults to false\n */\n disabled: PropTypes.bool.description('disabled prop, defaults to false'),\n /**\n * 0 as default\n */\n tabIndex: PropTypes.number.description('focus order HTML property, 0 as default'),\n /**\n * HH : MM am as default\n */\n placeholder: PropTypes.string.description('HH : MM am as default'),\n /**\n * onChange handler, receives change event as first argument\n */\n onChange: PropTypes.func.description('onChange handler, receives change event as first argument'),\n /**\n * HH:MM string representing the time or empty string\n */\n value: PropTypes.string.description('HH:MM string representing the time or empty string'),\n};\n\nDSMobileTimePicker.displayName = 'DSMobileTimePicker';\nconst DSMobileTimePickerWithSchema = describe(DSMobileTimePicker).description('Time picker for mobile & tablet');\n\nDSMobileTimePickerWithSchema.propTypes = pickerProps;\n\nexport { DSMobileTimePicker, DSMobileTimePickerWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoCP;AApChB,mBAAkD;AAClD,8BAAoC;AACpC,qBAA6B;AAC7B,sBAAgC;AAChC,
|
|
4
|
+
"sourcesContent": ["import React, { useRef, useMemo, useEffect } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { DSIconColors } from '@elliemae/ds-icon';\nimport { RecentDocuments } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-legacy-button-v1';\nimport { DSInputGroup } from '@elliemae/ds-legacy-form';\nimport { Input } from './Input.js';\n\nconst DSMobileTimePicker = ({ disabled, value, tabIndex, placeholder, onChange }) => {\n const inputRef = useRef(null);\n const valueArr = value.split(':');\n useEffect(() => {\n /*\n necessary if value is being set in mount, \n otherwise the clear won't work on the first click\n [SEE input onChange comment]\n */\n if (inputRef.current) {\n inputRef.current.defaultValue = '';\n }\n }, [inputRef.current]);\n const displayValue = useMemo(() => {\n if (!value || !valueArr[0] || !valueArr[1]) return '';\n const ampm = valueArr[0] >= 12 ? 'pm' : 'am';\n const h = valueArr[0] > 12 ? valueArr[0] - 12 : valueArr[0];\n\n return `${h} : ${valueArr[1]} ${ampm}`;\n }, [value]);\n\n return (\n <DSInputGroup\n rightAddon={\n <DSButton\n aria-label=\"Time Picker Button\"\n color={!disabled ? DSIconColors.PRIMARY : DSIconColors.NEUTRAL}\n disabled={disabled}\n icon={<RecentDocuments />}\n type=\"button\"\n buttonType=\"secondary\"\n onClick={() => {\n inputRef.current.focus();\n inputRef.current.click();\n }}\n />\n }\n >\n <Input\n innerRef={inputRef}\n type=\"time\"\n data-testid=\"ds-mobile-time-picker\"\n aria-label=\"Time Picker Input Mask\"\n disabled={disabled}\n placeholder={placeholder}\n tabIndex={tabIndex}\n value={value}\n data-displayvalue={displayValue}\n onChange={(e) => {\n // https://github.com/facebook/react/issues/8938#issuecomment-360573204\n const { target } = e.nativeEvent;\n function iosClearDefault() {\n target.defaultValue = '';\n }\n window.setTimeout(iosClearDefault, 0);\n onChange(e);\n }}\n />\n </DSInputGroup>\n );\n};\n\nDSMobileTimePicker.defaultProps = {\n disabled: false,\n tabIndex: 0,\n placeholder: 'HH : MM am',\n value: '',\n};\n\nconst pickerProps = {\n /**\n * defaults to false\n */\n disabled: PropTypes.bool.description('disabled prop, defaults to false'),\n /**\n * 0 as default\n */\n tabIndex: PropTypes.number.description('focus order HTML property, 0 as default'),\n /**\n * HH : MM am as default\n */\n placeholder: PropTypes.string.description('HH : MM am as default'),\n /**\n * onChange handler, receives change event as first argument\n */\n onChange: PropTypes.func.description('onChange handler, receives change event as first argument'),\n /**\n * HH:MM string representing the time or empty string\n */\n value: PropTypes.string.description('HH:MM string representing the time or empty string'),\n};\n\nDSMobileTimePicker.displayName = 'DSMobileTimePicker';\nconst DSMobileTimePickerWithSchema = describe(DSMobileTimePicker).description('Time picker for mobile & tablet');\n\nDSMobileTimePickerWithSchema.propTypes = pickerProps;\n\nexport { DSMobileTimePicker, DSMobileTimePickerWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoCP;AApChB,mBAAkD;AAClD,8BAAoC;AACpC,qBAA6B;AAC7B,sBAAgC;AAChC,iCAAyB;AACzB,4BAA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