@elliemae/ds-text-wrapper 3.27.0-next.1 → 3.27.0-next.2

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/index.js CHANGED
@@ -29,10 +29,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
30
  var src_exports = {};
31
31
  __export(src_exports, {
32
- default: () => import_DSTextWrapper.default
32
+ default: () => import_ds_legacy_text_wrapper.default
33
33
  });
34
34
  module.exports = __toCommonJS(src_exports);
35
35
  var React = __toESM(require("react"));
36
- __reExport(src_exports, require("./DSTextWrapper.js"), module.exports);
37
- var import_DSTextWrapper = __toESM(require("./DSTextWrapper.js"));
36
+ __reExport(src_exports, require("@elliemae/ds-legacy-text-wrapper"), module.exports);
37
+ var import_ds_legacy_text_wrapper = __toESM(require("@elliemae/ds-legacy-text-wrapper"));
38
38
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export * from './DSTextWrapper.js';\nexport { default } from './DSTextWrapper.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,+BAAd;AACA,2BAAwB;",
4
+ "sourcesContent": ["export * from '@elliemae/ds-legacy-text-wrapper';\nexport { default } from '@elliemae/ds-legacy-text-wrapper';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,6CAAd;AACA,oCAAwB;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
- export * from "./DSTextWrapper.js";
3
- import { default as default2 } from "./DSTextWrapper.js";
2
+ export * from "@elliemae/ds-legacy-text-wrapper";
3
+ import { default as default2 } from "@elliemae/ds-legacy-text-wrapper";
4
4
  export {
5
5
  default2 as default
6
6
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSTextWrapper.js';\nexport { default } from './DSTextWrapper.js';\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from '@elliemae/ds-legacy-text-wrapper';\nexport { default } from '@elliemae/ds-legacy-text-wrapper';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,SAAS,WAAAA,gBAAe;",
6
6
  "names": ["default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- export * from './DSTextWrapper.js';
2
- export { default } from './DSTextWrapper.js';
1
+ export * from '@elliemae/ds-legacy-text-wrapper';
2
+ export { default } from '@elliemae/ds-legacy-text-wrapper';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-text-wrapper",
3
- "version": "3.27.0-next.1",
3
+ "version": "3.27.0-next.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Text Wrapper",
6
6
  "files": [
@@ -13,18 +13,6 @@
13
13
  ".": {
14
14
  "import": "./dist/esm/index.js",
15
15
  "require": "./dist/cjs/index.js"
16
- },
17
- "./props": {
18
- "import": "./dist/esm/props.js",
19
- "require": "./dist/cjs/props.js"
20
- },
21
- "./DSTextWrapper": {
22
- "import": "./dist/esm/DSTextWrapper.js",
23
- "require": "./dist/cjs/DSTextWrapper.js"
24
- },
25
- "./defaultProps": {
26
- "import": "./dist/esm/defaultProps.js",
27
- "require": "./dist/cjs/defaultProps.js"
28
16
  }
29
17
  },
30
18
  "sideEffects": [
@@ -47,13 +35,12 @@
47
35
  "indent": 4
48
36
  },
49
37
  "dependencies": {
50
- "@elliemae/ds-classnames": "3.27.0-next.1",
51
- "@elliemae/ds-props-helpers": "3.27.0-next.1"
38
+ "@elliemae/ds-legacy-text-wrapper": "1.0.1"
52
39
  },
53
40
  "devDependencies": {
54
41
  "@elliemae/pui-cli": "~9.0.0-next.31",
55
42
  "styled-components": "~5.3.9",
56
- "@elliemae/ds-monorepo-devops": "3.27.0-next.1"
43
+ "@elliemae/ds-monorepo-devops": "3.27.0-next.2"
57
44
  },
58
45
  "peerDependencies": {
59
46
  "lodash": "^4.17.21",
@@ -66,13 +53,13 @@
66
53
  },
67
54
  "scripts": {
68
55
  "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
69
- "test": "pui-cli test --passWithNoTests",
70
- "lint": "node ../../../scripts/lint.mjs",
71
- "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
72
- "dts": "node ../../../scripts/dts.mjs",
56
+ "test": "exit 0 | echo",
57
+ "lint": "exit 0 | echo",
58
+ "eslint:fix": "exit 0 | echo",
59
+ "dts": "exit 0 | echo",
73
60
  "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
74
61
  "dev:build": "pnpm --filter {.}... build",
75
62
  "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
76
- "checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
63
+ "checkDeps": "exit 0 | echo"
77
64
  }
78
65
  }
@@ -1,93 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var DSTextWrapper_exports = {};
30
- __export(DSTextWrapper_exports, {
31
- DSTextWrapper: () => DSTextWrapper,
32
- TextWrapperWithSchema: () => TextWrapperWithSchema,
33
- default: () => DSTextWrapper_default
34
- });
35
- module.exports = __toCommonJS(DSTextWrapper_exports);
36
- var React = __toESM(require("react"));
37
- var import_jsx_runtime = require("react/jsx-runtime");
38
- var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
39
- var import_ds_classnames = require("@elliemae/ds-classnames");
40
- var import_props = require("./props.js");
41
- var import_defaultProps = require("./defaultProps.js");
42
- const DSTextWrapper = ({
43
- containerProps,
44
- className,
45
- style,
46
- text,
47
- maxCharacters,
48
- maxWidth,
49
- textEllipsis,
50
- textAlignment,
51
- wordBreak
52
- }) => {
53
- const { cssClassName, classNameElement } = (0, import_ds_classnames.convertPropToCssClassName)("text-wrapperRef", className, {
54
- textEllipsis,
55
- textAlignment,
56
- wordBreak
57
- });
58
- const limitPerCharacter = () => text.split(" ").reduce(
59
- (result, word) => {
60
- let resultIndex = result.length - 1;
61
- if (result[resultIndex].length + word.length > maxCharacters)
62
- resultIndex += 1;
63
- result[resultIndex] = `${result[resultIndex] || ""} ${word}`;
64
- return result;
65
- },
66
- [""]
67
- );
68
- let displayText = text;
69
- if (textEllipsis)
70
- displayText = maxCharacters > 0 ? displayText.substring(0, maxCharacters) : displayText;
71
- else if (maxCharacters > 0) {
72
- displayText = limitPerCharacter().map((textpart, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: classNameElement("line"), children: textpart }, index));
73
- }
74
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
- "span",
76
- {
77
- ...containerProps,
78
- className: cssClassName,
79
- style: {
80
- maxWidth: maxCharacters < 1 ? maxWidth : null,
81
- ...style
82
- },
83
- children: textEllipsis ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: classNameElement("ellipsis-wrapperRef"), children: displayText }) : displayText
84
- }
85
- );
86
- };
87
- DSTextWrapper.propTypes = import_props.textProps;
88
- DSTextWrapper.defaultProps = import_defaultProps.defaultProps;
89
- DSTextWrapper.displayName = "DSTextWrapper";
90
- const TextWrapperWithSchema = (0, import_ds_props_helpers.describe)(DSTextWrapper);
91
- TextWrapperWithSchema.propTypes = import_props.textProps;
92
- var DSTextWrapper_default = DSTextWrapper;
93
- //# sourceMappingURL=DSTextWrapper.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/DSTextWrapper.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable react/no-array-index-key */\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { textProps } from './props.js';\nimport { defaultProps } from './defaultProps.js';\n\n/**\n * if we don't care about word break\n * const regx = new RegExp(`.{1,${maxCharacters}}`, 'g')\n * text.match(regx)\n * @param {*} param0\n */\nconst DSTextWrapper = ({\n containerProps,\n className,\n style,\n text,\n maxCharacters,\n maxWidth,\n textEllipsis,\n textAlignment,\n wordBreak,\n}) => {\n const { cssClassName, classNameElement } = convertPropToCssClassName('text-wrapperRef', className, {\n textEllipsis,\n textAlignment,\n wordBreak,\n });\n const limitPerCharacter = () =>\n text.split(' ').reduce(\n (result, word) => {\n let resultIndex = result.length - 1;\n if (result[resultIndex].length + word.length > maxCharacters) resultIndex += 1;\n result[resultIndex] = `${result[resultIndex] || ''} ${word}`;\n return result;\n },\n [''],\n );\n\n let displayText = text;\n\n if (textEllipsis) displayText = maxCharacters > 0 ? displayText.substring(0, maxCharacters) : displayText;\n else if (maxCharacters > 0) {\n displayText = limitPerCharacter().map((textpart, index) => (\n <span key={index} className={classNameElement('line')}>\n {textpart}\n </span>\n ));\n }\n\n return (\n <span\n {...containerProps}\n className={cssClassName}\n style={{\n maxWidth: maxCharacters < 1 ? maxWidth : null,\n ...style,\n }}\n >\n {textEllipsis ? <span className={classNameElement('ellipsis-wrapperRef')}>{displayText}</span> : displayText}\n </span>\n );\n};\n\nDSTextWrapper.propTypes = textProps;\nDSTextWrapper.defaultProps = defaultProps;\nDSTextWrapper.displayName = 'DSTextWrapper';\nconst TextWrapperWithSchema = describe(DSTextWrapper);\nTextWrapperWithSchema.propTypes = textProps;\n\nexport { DSTextWrapper, TextWrapperWithSchema };\nexport default DSTextWrapper;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6CjB;AA3CN,8BAAyB;AACzB,2BAA0C;AAC1C,mBAA0B;AAC1B,0BAA6B;AAQ7B,MAAM,gBAAgB,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,cAAc,iBAAiB,QAAI,gDAA0B,mBAAmB,WAAW;AAAA,IACjG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,oBAAoB,MACxB,KAAK,MAAM,GAAG,EAAE;AAAA,IACd,CAAC,QAAQ,SAAS;AAChB,UAAI,cAAc,OAAO,SAAS;AAClC,UAAI,OAAO,WAAW,EAAE,SAAS,KAAK,SAAS;AAAe,uBAAe;AAC7E,aAAO,WAAW,IAAI,GAAG,OAAO,WAAW,KAAK,MAAM;AACtD,aAAO;AAAA,IACT;AAAA,IACA,CAAC,EAAE;AAAA,EACL;AAEF,MAAI,cAAc;AAElB,MAAI;AAAc,kBAAc,gBAAgB,IAAI,YAAY,UAAU,GAAG,aAAa,IAAI;AAAA,WACrF,gBAAgB,GAAG;AAC1B,kBAAc,kBAAkB,EAAE,IAAI,CAAC,UAAU,UAC/C,4CAAC,UAAiB,WAAW,iBAAiB,MAAM,GACjD,sBADQ,KAEX,CACD;AAAA,EACH;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,MACX,OAAO;AAAA,QACL,UAAU,gBAAgB,IAAI,WAAW;AAAA,QACzC,GAAG;AAAA,MACL;AAAA,MAEC,yBAAe,4CAAC,UAAK,WAAW,iBAAiB,qBAAqB,GAAI,uBAAY,IAAU;AAAA;AAAA,EACnG;AAEJ;AAEA,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,MAAM,4BAAwB,kCAAS,aAAa;AACpD,sBAAsB,YAAY;AAGlC,IAAO,wBAAQ;",
6
- "names": []
7
- }
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var defaultProps_exports = {};
30
- __export(defaultProps_exports, {
31
- defaultProps: () => defaultProps
32
- });
33
- module.exports = __toCommonJS(defaultProps_exports);
34
- var React = __toESM(require("react"));
35
- const defaultProps = {
36
- containerProps: {},
37
- className: "",
38
- style: {},
39
- text: "",
40
- maxCharacters: 0,
41
- maxWidth: "100%",
42
- textEllipsis: false,
43
- textAlignment: "left",
44
- wordBreak: true
45
- };
46
- //# sourceMappingURL=defaultProps.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/defaultProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export const defaultProps = {\n containerProps: {},\n className: '',\n style: {},\n text: '',\n maxCharacters: 0,\n maxWidth: '100%',\n textEllipsis: false,\n textAlignment: 'left',\n wordBreak: true,\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,eAAe;AAAA,EAC1B,gBAAgB,CAAC;AAAA,EACjB,WAAW;AAAA,EACX,OAAO,CAAC;AAAA,EACR,MAAM;AAAA,EACN,eAAe;AAAA,EACf,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,WAAW;AACb;",
6
- "names": []
7
- }
package/dist/cjs/props.js DELETED
@@ -1,47 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var props_exports = {};
30
- __export(props_exports, {
31
- textProps: () => textProps
32
- });
33
- module.exports = __toCommonJS(props_exports);
34
- var React = __toESM(require("react"));
35
- var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
- const textProps = {
37
- containerProps: import_ds_props_helpers.PropTypes.object.description("Set of Properties attached to the main container"),
38
- className: import_ds_props_helpers.PropTypes.string.description("css class"),
39
- style: import_ds_props_helpers.PropTypes.object.description("css style"),
40
- text: import_ds_props_helpers.PropTypes.string.description("Text to display").isRequired,
41
- maxCharacters: import_ds_props_helpers.PropTypes.number.description("Maximum amount of charachters allowed"),
42
- maxWidth: import_ds_props_helpers.PropTypes.string.description("Maximum width allowed"),
43
- textEllipsis: import_ds_props_helpers.PropTypes.bool.description("Whether to show ellipsis or not"),
44
- textAlignment: import_ds_props_helpers.PropTypes.oneOf(["left", "center", "right"]).description("Text alignement"),
45
- wordBreak: import_ds_props_helpers.PropTypes.bool.description("Whether to break the line or not")
46
- };
47
- //# sourceMappingURL=props.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/props.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { PropTypes } from '@elliemae/ds-props-helpers';\n\nexport const textProps = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n className: PropTypes.string.description('css class'),\n style: PropTypes.object.description('css style'),\n text: PropTypes.string.description('Text to display').isRequired,\n maxCharacters: PropTypes.number.description('Maximum amount of charachters allowed'),\n maxWidth: PropTypes.string.description('Maximum width allowed'),\n textEllipsis: PropTypes.bool.description('Whether to show ellipsis or not'),\n textAlignment: PropTypes.oneOf(['left', 'center', 'right']).description('Text alignement'),\n wordBreak: PropTypes.bool.description('Whether to break the line or not'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA0B;AAEnB,MAAM,YAAY;AAAA,EACvB,gBAAgB,kCAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,WAAW,kCAAU,OAAO,YAAY,WAAW;AAAA,EACnD,OAAO,kCAAU,OAAO,YAAY,WAAW;AAAA,EAC/C,MAAM,kCAAU,OAAO,YAAY,iBAAiB,EAAE;AAAA,EACtD,eAAe,kCAAU,OAAO,YAAY,uCAAuC;AAAA,EACnF,UAAU,kCAAU,OAAO,YAAY,uBAAuB;AAAA,EAC9D,cAAc,kCAAU,KAAK,YAAY,iCAAiC;AAAA,EAC1E,eAAe,kCAAU,MAAM,CAAC,QAAQ,UAAU,OAAO,CAAC,EAAE,YAAY,iBAAiB;AAAA,EACzF,WAAW,kCAAU,KAAK,YAAY,kCAAkC;AAC1E;",
6
- "names": []
7
- }
@@ -1,63 +0,0 @@
1
- import * as React from "react";
2
- import { jsx } from "react/jsx-runtime";
3
- import { describe } from "@elliemae/ds-props-helpers";
4
- import { convertPropToCssClassName } from "@elliemae/ds-classnames";
5
- import { textProps } from "./props.js";
6
- import { defaultProps } from "./defaultProps.js";
7
- const DSTextWrapper = ({
8
- containerProps,
9
- className,
10
- style,
11
- text,
12
- maxCharacters,
13
- maxWidth,
14
- textEllipsis,
15
- textAlignment,
16
- wordBreak
17
- }) => {
18
- const { cssClassName, classNameElement } = convertPropToCssClassName("text-wrapperRef", className, {
19
- textEllipsis,
20
- textAlignment,
21
- wordBreak
22
- });
23
- const limitPerCharacter = () => text.split(" ").reduce(
24
- (result, word) => {
25
- let resultIndex = result.length - 1;
26
- if (result[resultIndex].length + word.length > maxCharacters)
27
- resultIndex += 1;
28
- result[resultIndex] = `${result[resultIndex] || ""} ${word}`;
29
- return result;
30
- },
31
- [""]
32
- );
33
- let displayText = text;
34
- if (textEllipsis)
35
- displayText = maxCharacters > 0 ? displayText.substring(0, maxCharacters) : displayText;
36
- else if (maxCharacters > 0) {
37
- displayText = limitPerCharacter().map((textpart, index) => /* @__PURE__ */ jsx("span", { className: classNameElement("line"), children: textpart }, index));
38
- }
39
- return /* @__PURE__ */ jsx(
40
- "span",
41
- {
42
- ...containerProps,
43
- className: cssClassName,
44
- style: {
45
- maxWidth: maxCharacters < 1 ? maxWidth : null,
46
- ...style
47
- },
48
- children: textEllipsis ? /* @__PURE__ */ jsx("span", { className: classNameElement("ellipsis-wrapperRef"), children: displayText }) : displayText
49
- }
50
- );
51
- };
52
- DSTextWrapper.propTypes = textProps;
53
- DSTextWrapper.defaultProps = defaultProps;
54
- DSTextWrapper.displayName = "DSTextWrapper";
55
- const TextWrapperWithSchema = describe(DSTextWrapper);
56
- TextWrapperWithSchema.propTypes = textProps;
57
- var DSTextWrapper_default = DSTextWrapper;
58
- export {
59
- DSTextWrapper,
60
- TextWrapperWithSchema,
61
- DSTextWrapper_default as default
62
- };
63
- //# sourceMappingURL=DSTextWrapper.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSTextWrapper.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/no-array-index-key */\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { textProps } from './props.js';\nimport { defaultProps } from './defaultProps.js';\n\n/**\n * if we don't care about word break\n * const regx = new RegExp(`.{1,${maxCharacters}}`, 'g')\n * text.match(regx)\n * @param {*} param0\n */\nconst DSTextWrapper = ({\n containerProps,\n className,\n style,\n text,\n maxCharacters,\n maxWidth,\n textEllipsis,\n textAlignment,\n wordBreak,\n}) => {\n const { cssClassName, classNameElement } = convertPropToCssClassName('text-wrapperRef', className, {\n textEllipsis,\n textAlignment,\n wordBreak,\n });\n const limitPerCharacter = () =>\n text.split(' ').reduce(\n (result, word) => {\n let resultIndex = result.length - 1;\n if (result[resultIndex].length + word.length > maxCharacters) resultIndex += 1;\n result[resultIndex] = `${result[resultIndex] || ''} ${word}`;\n return result;\n },\n [''],\n );\n\n let displayText = text;\n\n if (textEllipsis) displayText = maxCharacters > 0 ? displayText.substring(0, maxCharacters) : displayText;\n else if (maxCharacters > 0) {\n displayText = limitPerCharacter().map((textpart, index) => (\n <span key={index} className={classNameElement('line')}>\n {textpart}\n </span>\n ));\n }\n\n return (\n <span\n {...containerProps}\n className={cssClassName}\n style={{\n maxWidth: maxCharacters < 1 ? maxWidth : null,\n ...style,\n }}\n >\n {textEllipsis ? <span className={classNameElement('ellipsis-wrapperRef')}>{displayText}</span> : displayText}\n </span>\n );\n};\n\nDSTextWrapper.propTypes = textProps;\nDSTextWrapper.defaultProps = defaultProps;\nDSTextWrapper.displayName = 'DSTextWrapper';\nconst TextWrapperWithSchema = describe(DSTextWrapper);\nTextWrapperWithSchema.propTypes = textProps;\n\nexport { DSTextWrapper, TextWrapperWithSchema };\nexport default DSTextWrapper;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC6CjB;AA3CN,SAAS,gBAAgB;AACzB,SAAS,iCAAiC;AAC1C,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAQ7B,MAAM,gBAAgB,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,cAAc,iBAAiB,IAAI,0BAA0B,mBAAmB,WAAW;AAAA,IACjG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,oBAAoB,MACxB,KAAK,MAAM,GAAG,EAAE;AAAA,IACd,CAAC,QAAQ,SAAS;AAChB,UAAI,cAAc,OAAO,SAAS;AAClC,UAAI,OAAO,WAAW,EAAE,SAAS,KAAK,SAAS;AAAe,uBAAe;AAC7E,aAAO,WAAW,IAAI,GAAG,OAAO,WAAW,KAAK,MAAM;AACtD,aAAO;AAAA,IACT;AAAA,IACA,CAAC,EAAE;AAAA,EACL;AAEF,MAAI,cAAc;AAElB,MAAI;AAAc,kBAAc,gBAAgB,IAAI,YAAY,UAAU,GAAG,aAAa,IAAI;AAAA,WACrF,gBAAgB,GAAG;AAC1B,kBAAc,kBAAkB,EAAE,IAAI,CAAC,UAAU,UAC/C,oBAAC,UAAiB,WAAW,iBAAiB,MAAM,GACjD,sBADQ,KAEX,CACD;AAAA,EACH;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,MACX,OAAO;AAAA,QACL,UAAU,gBAAgB,IAAI,WAAW;AAAA,QACzC,GAAG;AAAA,MACL;AAAA,MAEC,yBAAe,oBAAC,UAAK,WAAW,iBAAiB,qBAAqB,GAAI,uBAAY,IAAU;AAAA;AAAA,EACnG;AAEJ;AAEA,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,MAAM,wBAAwB,SAAS,aAAa;AACpD,sBAAsB,YAAY;AAGlC,IAAO,wBAAQ;",
6
- "names": []
7
- }
@@ -1,16 +0,0 @@
1
- import * as React from "react";
2
- const defaultProps = {
3
- containerProps: {},
4
- className: "",
5
- style: {},
6
- text: "",
7
- maxCharacters: 0,
8
- maxWidth: "100%",
9
- textEllipsis: false,
10
- textAlignment: "left",
11
- wordBreak: true
12
- };
13
- export {
14
- defaultProps
15
- };
16
- //# sourceMappingURL=defaultProps.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/defaultProps.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const defaultProps = {\n containerProps: {},\n className: '',\n style: {},\n text: '',\n maxCharacters: 0,\n maxWidth: '100%',\n textEllipsis: false,\n textAlignment: 'left',\n wordBreak: true,\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,eAAe;AAAA,EAC1B,gBAAgB,CAAC;AAAA,EACjB,WAAW;AAAA,EACX,OAAO,CAAC;AAAA,EACR,MAAM;AAAA,EACN,eAAe;AAAA,EACf,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,WAAW;AACb;",
6
- "names": []
7
- }
package/dist/esm/props.js DELETED
@@ -1,17 +0,0 @@
1
- import * as React from "react";
2
- import { PropTypes } from "@elliemae/ds-props-helpers";
3
- const textProps = {
4
- containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
5
- className: PropTypes.string.description("css class"),
6
- style: PropTypes.object.description("css style"),
7
- text: PropTypes.string.description("Text to display").isRequired,
8
- maxCharacters: PropTypes.number.description("Maximum amount of charachters allowed"),
9
- maxWidth: PropTypes.string.description("Maximum width allowed"),
10
- textEllipsis: PropTypes.bool.description("Whether to show ellipsis or not"),
11
- textAlignment: PropTypes.oneOf(["left", "center", "right"]).description("Text alignement"),
12
- wordBreak: PropTypes.bool.description("Whether to break the line or not")
13
- };
14
- export {
15
- textProps
16
- };
17
- //# sourceMappingURL=props.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/props.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-props-helpers';\n\nexport const textProps = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n className: PropTypes.string.description('css class'),\n style: PropTypes.object.description('css style'),\n text: PropTypes.string.description('Text to display').isRequired,\n maxCharacters: PropTypes.number.description('Maximum amount of charachters allowed'),\n maxWidth: PropTypes.string.description('Maximum width allowed'),\n textEllipsis: PropTypes.bool.description('Whether to show ellipsis or not'),\n textAlignment: PropTypes.oneOf(['left', 'center', 'right']).description('Text alignement'),\n wordBreak: PropTypes.bool.description('Whether to break the line or not'),\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAEnB,MAAM,YAAY;AAAA,EACvB,gBAAgB,UAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,WAAW,UAAU,OAAO,YAAY,WAAW;AAAA,EACnD,OAAO,UAAU,OAAO,YAAY,WAAW;AAAA,EAC/C,MAAM,UAAU,OAAO,YAAY,iBAAiB,EAAE;AAAA,EACtD,eAAe,UAAU,OAAO,YAAY,uCAAuC;AAAA,EACnF,UAAU,UAAU,OAAO,YAAY,uBAAuB;AAAA,EAC9D,cAAc,UAAU,KAAK,YAAY,iCAAiC;AAAA,EAC1E,eAAe,UAAU,MAAM,CAAC,QAAQ,UAAU,OAAO,CAAC,EAAE,YAAY,iBAAiB;AAAA,EACzF,WAAW,UAAU,KAAK,YAAY,kCAAkC;AAC1E;",
6
- "names": []
7
- }
@@ -1,55 +0,0 @@
1
- /**
2
- * if we don't care about word break
3
- * const regx = new RegExp(`.{1,${maxCharacters}}`, 'g')
4
- * text.match(regx)
5
- * @param {*} param0
6
- */
7
- declare const DSTextWrapper: {
8
- ({ containerProps, className, style, text, maxCharacters, maxWidth, textEllipsis, textAlignment, wordBreak, }: {
9
- containerProps: any;
10
- className: any;
11
- style: any;
12
- text: any;
13
- maxCharacters: any;
14
- maxWidth: any;
15
- textEllipsis: any;
16
- textAlignment: any;
17
- wordBreak: any;
18
- }): import("react/jsx-runtime.js").JSX.Element;
19
- propTypes: {
20
- containerProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
21
- className: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
22
- style: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
23
- text: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
24
- maxCharacters: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
25
- maxWidth: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
26
- textEllipsis: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
27
- textAlignment: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
28
- wordBreak: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
29
- };
30
- defaultProps: {
31
- containerProps: {};
32
- className: string;
33
- style: {};
34
- text: string;
35
- maxCharacters: number;
36
- maxWidth: string;
37
- textEllipsis: boolean;
38
- textAlignment: string;
39
- wordBreak: boolean;
40
- };
41
- displayName: string;
42
- };
43
- declare const TextWrapperWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<{
44
- containerProps: any;
45
- className: any;
46
- style: any;
47
- text: any;
48
- maxCharacters: any;
49
- maxWidth: any;
50
- textEllipsis: any;
51
- textAlignment: any;
52
- wordBreak: any;
53
- }>;
54
- export { DSTextWrapper, TextWrapperWithSchema };
55
- export default DSTextWrapper;
@@ -1,11 +0,0 @@
1
- export declare const defaultProps: {
2
- containerProps: {};
3
- className: string;
4
- style: {};
5
- text: string;
6
- maxCharacters: number;
7
- maxWidth: string;
8
- textEllipsis: boolean;
9
- textAlignment: string;
10
- wordBreak: boolean;
11
- };
@@ -1,11 +0,0 @@
1
- export declare const textProps: {
2
- containerProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
3
- className: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
4
- style: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
5
- text: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
6
- maxCharacters: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
7
- maxWidth: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
8
- textEllipsis: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
9
- textAlignment: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
10
- wordBreak: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
11
- };