@elliemae/ds-zoom 3.3.1-rc.0 → 3.3.1
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/esm/DSZoom.js +0 -1
- package/dist/esm/DSZoom.js.map +1 -1
- package/dist/esm/components/utils.js +0 -1
- package/dist/esm/components/utils.js.map +1 -1
- package/dist/esm/components/zoomOptions.js +0 -1
- package/dist/esm/components/zoomOptions.js.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -4
package/dist/esm/DSZoom.js
CHANGED
package/dist/esm/DSZoom.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSZoom.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport React, { useState } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSComboBox } from '@elliemae/ds-form';\nimport zoomDefaultOptions from './components/zoomOptions';\nimport { clean } from './components/utils';\n\nconst DSZoom = ({\n className = '',\n disabled = false,\n value = undefined,\n onChange = () => null,\n containerProps = {},\n zoomOptions = zoomDefaultOptions,\n ...otherProps\n}) => {\n const { cssClassName } = convertPropToCssClassName('zoom-resize', className, {\n disabled,\n });\n const defaultOption = zoomOptions.find((option) => option.default);\n const [menuIsOpen, setMenuIsOpen] = useState(false);\n const [selectedOption, setSelectedOption] = useState(defaultOption);\n const [custom, setCustom] = useState(\n !value\n ? defaultOption\n : {\n label: `${clean(value)}%`,\n value: clean(value),\n id: 'custom',\n },\n );\n const options = [custom, ...zoomOptions.filter((option) => !option.default)];\n\n const currentValue = value || selectedOption?.value || custom?.value || defaultOption?.value;\n\n return (\n <div className={`${cssClassName}`} {...containerProps} {...otherProps}>\n <DSComboBox\n searchable\n disabled={disabled}\n menuIsOpen={menuIsOpen}\n onChange={(valueChange, { action }) => {\n const op = options.find((option) => option.value === valueChange);\n setSelectedOption(op);\n onChange(op);\n setMenuIsOpen(false);\n if (action === 'select-option') {\n document.activeElement.blur();\n }\n }}\n onClickDropdownIndicator={() => setMenuIsOpen(!menuIsOpen)}\n onInputChange={(valueInput, action) => {\n if (valueInput || action.action === 'input-change') {\n if (!valueInput) {\n setCustom(defaultOption);\n onChange(defaultOption);\n } else if (!Number.isNaN(parseInt(valueInput, 10))) {\n const cleanValue = parseInt(valueInput, 10);\n const newOption = {\n label: `${cleanValue}%`,\n value: `${cleanValue}%`,\n id: 'custom',\n };\n setCustom(newOption);\n onChange(newOption);\n }\n }\n setMenuIsOpen(false);\n }}\n options={options}\n value={currentValue}\n />\n </div>\n );\n};\n\nconst zoomProps = {\n className: PropTypes.string.description('html class attribute'),\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n disabled: PropTypes.bool.description('disable component').defaultValue(false),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).description('current value'),\n onChange: PropTypes.func.description('function called when a new value is selected'),\n zoomOptions: PropTypes.shape({\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n default: PropTypes.bool,\n }).description('list of options to display in the select menu'),\n};\n\nDSZoom.propTypes = zoomProps;\nDSZoom.displayName = 'DSZoom';\nconst ZoomWithSchema = describe(DSZoom);\nZoomWithSchema.propTypes = zoomProps;\n\nexport { DSZoom, ZoomWithSchema };\nexport default DSZoom;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,SAAS,CAAC;AAAA,EACd,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,WAAW,MAAM;AAAA,EACjB,iBAAiB,CAAC;AAAA,EAClB,cAAc;AAAA,KACX;AAAA,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A,YACV,OAAO,GAAG;AAAA,YACV,IAAI;AAAA,UACN;AACA,oBAAU,SAAS;AACnB,mBAAS,SAAS;AAAA,QACpB;AAAA,MACF;AACA,oBAAc,KAAK;AAAA,IACrB;AAAA,IACA;AAAA,IACA,OAAO;AAAA,GACT,CACF;AAEJ;AAEA,MAAM,YAAY;AAAA,EAChB,WAAW,UAAU,OAAO,YAAY,sBAAsB;AAAA,EAC9D,gBAAgB,UAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,UAAU,UAAU,KAAK,YAAY,mBAAmB,EAAE,aAAa,KAAK;AAAA,EAC5E,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,eAAe;AAAA,EAC9G,UAAU,UAAU,KAAK,YAAY,8CAA8C;AAAA,EACnF,aAAa,UAAU,MAAM;AAAA,IAC3B,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,IAC/D,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,IAC/D,SAAS,UAAU;AAAA,EACrB,CAAC,EAAE,YAAY,+CAA+C;AAChE;AAEA,OAAO,YAAY;AACnB,OAAO,cAAc;AACrB,MAAM,iBAAiB,SAAS,MAAM;AACtC,eAAe,YAAY;AAG3B,IAAO,iBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
const getCurrentFont = () => Number(window.getComputedStyle(document.querySelector(":root")).getPropertyValue("font-size").match(/\d+/)[0]);
|
|
4
3
|
const setSize = (size) => document.querySelector(":root").setAttribute("style", `font-size: ${size}px`);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/utils.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const getCurrentFont = () =>\n Number(\n window\n .getComputedStyle(document.querySelector(':root'))\n .getPropertyValue('font-size')\n .match(/\\d+/)[0],\n );\nexport const setSize = (size) =>\n document.querySelector(':root').setAttribute('style', `font-size: ${size}px`);\n\nexport const getFactor = (value) => value / 100;\n\nexport const clean = (value) => value.replace(/\\D/g, '').substring(0, 3);\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,iBAAiB,MAC5B,OACE,OACG,iBAAiB,SAAS,cAAc,OAAO,CAAC,EAChD,iBAAiB,WAAW,EAC5B,MAAM,KAAK,EAAE,EAClB;AACK,MAAM,UAAU,CAAC,SACtB,SAAS,cAAc,OAAO,EAAE,aAAa,SAAS,cAAc,QAAQ;AAEvE,MAAM,YAAY,CAAC,UAAU,QAAQ;AAErC,MAAM,QAAQ,CAAC,UAAU,MAAM,QAAQ,OAAO,EAAE,EAAE,UAAU,GAAG,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/zoomOptions.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export default [\n {\n label: '25%',\n value: '25',\n },\n {\n label: '50%',\n value: '50',\n },\n {\n label: '75%',\n value: '75',\n },\n {\n label: '100%',\n value: '100',\n default: true,\n },\n {\n label: '125%',\n value: '125',\n },\n {\n label: '150%',\n value: '150',\n },\n {\n label: '175%',\n value: '175',\n },\n {\n label: '200%',\n value: '200',\n },\n];\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA,IAAO,sBAAQ;AAAA,EACb;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSZoom';\nexport { default } from './DSZoom';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-zoom",
|
|
3
|
-
"version": "3.3.1
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Zoom",
|
|
6
6
|
"files": [
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"indent": 4
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@elliemae/ds-classnames": "3.3.1
|
|
51
|
-
"@elliemae/ds-form": "3.3.1
|
|
52
|
-
"@elliemae/ds-utilities": "3.3.1
|
|
50
|
+
"@elliemae/ds-classnames": "3.3.1",
|
|
51
|
+
"@elliemae/ds-form": "3.3.1",
|
|
52
|
+
"@elliemae/ds-utilities": "3.3.1"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@testing-library/jest-dom": "~5.16.4",
|