@elliemae/ds-page-header-v2 3.34.0-next.1 → 3.34.0-next.3
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/PageHeader.js +6 -6
- package/dist/cjs/PageHeader.js.map +2 -2
- package/dist/cjs/components/{PageHeaderEditableTitle.js → page-header-editable-title/PageHeaderEditableTitle.js} +8 -16
- package/dist/cjs/components/page-header-editable-title/PageHeaderEditableTitle.js.map +7 -0
- package/dist/cjs/components/page-header-editable-title/index.js +37 -0
- package/dist/cjs/components/page-header-editable-title/index.js.map +7 -0
- package/dist/cjs/components/page-header-editable-title/react-desc-prop-types.js +45 -0
- package/dist/cjs/components/page-header-editable-title/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/components/{PageHeaderSummary.js → page-header-summary/PageHeaderSummary.js} +6 -11
- package/dist/cjs/components/page-header-summary/PageHeaderSummary.js.map +7 -0
- package/dist/cjs/components/page-header-summary/index.js +37 -0
- package/dist/cjs/components/page-header-summary/index.js.map +7 -0
- package/dist/cjs/components/page-header-summary/react-desc-prop-types.js +42 -0
- package/dist/cjs/components/page-header-summary/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/components/{PageHeaderTitle.js → page-header-title/PageHeaderTitle.js} +6 -9
- package/dist/cjs/components/page-header-title/PageHeaderTitle.js.map +7 -0
- package/dist/cjs/components/page-header-title/index.js +37 -0
- package/dist/cjs/components/page-header-title/index.js.map +7 -0
- package/dist/cjs/components/page-header-title/react-desc-prop-types.js +47 -0
- package/dist/cjs/components/page-header-title/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/config/usePageHeader.js.map +2 -2
- package/dist/cjs/index.js +6 -6
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +5 -5
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/typescript-testing/typescript-page-header-editable-title-valid.js +76 -0
- package/dist/cjs/typescript-testing/typescript-page-header-editable-title-valid.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-page-header-summary-valid.js +72 -0
- package/dist/cjs/typescript-testing/typescript-page-header-summary-valid.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-page-header-title-valid.js +74 -0
- package/dist/cjs/typescript-testing/typescript-page-header-title-valid.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-page-header-v2-valid.js +148 -0
- package/dist/cjs/typescript-testing/typescript-page-header-v2-valid.js.map +7 -0
- package/dist/esm/PageHeader.js +3 -3
- package/dist/esm/PageHeader.js.map +1 -1
- package/dist/esm/components/{PageHeaderEditableTitle.js → page-header-editable-title/PageHeaderEditableTitle.js} +8 -16
- package/dist/esm/components/page-header-editable-title/PageHeaderEditableTitle.js.map +7 -0
- package/dist/esm/components/page-header-editable-title/index.js +7 -0
- package/dist/esm/components/page-header-editable-title/index.js.map +7 -0
- package/dist/esm/components/page-header-editable-title/react-desc-prop-types.js +15 -0
- package/dist/esm/components/page-header-editable-title/react-desc-prop-types.js.map +7 -0
- package/dist/esm/components/{PageHeaderSummary.js → page-header-summary/PageHeaderSummary.js} +7 -12
- package/dist/esm/components/page-header-summary/PageHeaderSummary.js.map +7 -0
- package/dist/esm/components/page-header-summary/index.js +7 -0
- package/dist/esm/components/page-header-summary/index.js.map +7 -0
- package/dist/esm/components/page-header-summary/react-desc-prop-types.js +12 -0
- package/dist/esm/components/page-header-summary/react-desc-prop-types.js.map +7 -0
- package/dist/esm/components/{PageHeaderTitle.js → page-header-title/PageHeaderTitle.js} +7 -10
- package/dist/esm/components/page-header-title/PageHeaderTitle.js.map +7 -0
- package/dist/esm/components/page-header-title/index.js +7 -0
- package/dist/esm/components/page-header-title/index.js.map +7 -0
- package/dist/esm/components/page-header-title/react-desc-prop-types.js +17 -0
- package/dist/esm/components/page-header-title/react-desc-prop-types.js.map +7 -0
- package/dist/esm/config/usePageHeader.js.map +2 -2
- package/dist/esm/index.js +5 -3
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +5 -5
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/typescript-page-header-editable-title-valid.js +53 -0
- package/dist/esm/typescript-testing/typescript-page-header-editable-title-valid.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-page-header-summary-valid.js +49 -0
- package/dist/esm/typescript-testing/typescript-page-header-summary-valid.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-page-header-title-valid.js +51 -0
- package/dist/esm/typescript-testing/typescript-page-header-title-valid.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-page-header-v2-valid.js +125 -0
- package/dist/esm/typescript-testing/typescript-page-header-v2-valid.js.map +7 -0
- package/dist/types/PageHeader.d.ts +3 -3
- package/dist/types/components/page-header-editable-title/PageHeaderEditableTitle.d.ts +10 -0
- package/dist/types/components/page-header-editable-title/index.d.ts +2 -0
- package/dist/types/components/page-header-editable-title/react-desc-prop-types.d.ts +395 -0
- package/dist/types/components/page-header-summary/PageHeaderSummary.d.ts +9 -0
- package/dist/types/components/page-header-summary/index.d.ts +2 -0
- package/dist/types/components/page-header-summary/react-desc-prop-types.d.ts +20 -0
- package/dist/types/components/page-header-title/PageHeaderTitle.d.ts +10 -0
- package/dist/types/components/page-header-title/index.d.ts +2 -0
- package/dist/types/components/page-header-title/react-desc-prop-types.d.ts +21 -0
- package/dist/types/config/usePageHeader.d.ts +524 -166
- package/dist/types/index.d.ts +4 -3
- package/dist/types/react-desc-prop-types.d.ts +7 -2
- package/dist/types/typescript-testing/typescript-page-header-editable-title-valid.d.ts +1 -0
- package/dist/types/typescript-testing/typescript-page-header-summary-valid.d.ts +1 -0
- package/dist/types/typescript-testing/typescript-page-header-title-valid.d.ts +1 -0
- package/dist/types/typescript-testing/typescript-page-header-v2-valid.d.ts +1 -0
- package/package.json +15 -15
- package/dist/cjs/components/PageHeaderEditableTitle.js.map +0 -7
- package/dist/cjs/components/PageHeaderSummary.js.map +0 -7
- package/dist/cjs/components/PageHeaderTitle.js.map +0 -7
- package/dist/esm/components/PageHeaderEditableTitle.js.map +0 -7
- package/dist/esm/components/PageHeaderSummary.js.map +0 -7
- package/dist/esm/components/PageHeaderTitle.js.map +0 -7
- package/dist/types/components/PageHeaderEditableTitle.d.ts +0 -15
- package/dist/types/components/PageHeaderSummary.d.ts +0 -14
- package/dist/types/components/PageHeaderTitle.d.ts +0 -16
package/dist/cjs/index.js.map
CHANGED
@@ -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 {\n DSPageHeaderV2,\n DSPageHeaderWithSchema,\n PageHeaderCustomRenderer,\n PageHeaderEditableTitle,\n PageHeaderMenu,\n PageHeaderSummary,\n PageHeaderTitle,\n} from './PageHeader.js';\nexport { DSPageHeaderSummaryWithSchema } from './components/
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAQO;
|
4
|
+
"sourcesContent": ["export {\n DSPageHeaderV2,\n DSPageHeaderWithSchema,\n PageHeaderCustomRenderer,\n PageHeaderEditableTitle,\n PageHeaderMenu,\n PageHeaderSummary,\n PageHeaderTitle,\n} from './PageHeader.js';\nexport type { DSPageHeaderT } from './react-desc-prop-types.js';\nexport { DSPageHeaderSummaryWithSchema, type PageHeaderSummaryT } from './components/page-header-summary/index.js';\nexport { DSPageHeaderTitleWithSchema, type PageHeaderTitleT } from './components/page-header-title/index.js';\nexport {\n DSPageHeaderEditableTitleWithSchema,\n type PageHeaderEditableTitleT,\n} from './components/page-header-editable-title/index.js';\nexport * from './exported-related/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAQO;AAEP,iCAAuE;AACvE,+BAAmE;AACnE,wCAGO;AACP,wBAAc,wCAhBd;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -34,6 +34,11 @@ __export(react_desc_prop_types_exports, {
|
|
34
34
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
35
35
|
var React = __toESM(require("react"));
|
36
36
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
37
|
+
const defaultProps = {
|
38
|
+
containerProps: {},
|
39
|
+
withBottomSeparator: true,
|
40
|
+
isSkeleton: false
|
41
|
+
};
|
37
42
|
const PageHeaderPropTypes = {
|
38
43
|
...import_ds_props_helpers.globalAttributesPropTypes,
|
39
44
|
/** props injected to wrapper of page header */
|
@@ -60,9 +65,4 @@ const PageHeaderPropTypes = {
|
|
60
65
|
withBottomSeparator: import_ds_props_helpers.PropTypes.bool.description("Border bottom below the page header"),
|
61
66
|
isSkeleton: import_ds_props_helpers.PropTypes.bool.description("Loading state of the page header").defaultValue(false)
|
62
67
|
};
|
63
|
-
const defaultProps = {
|
64
|
-
containerProps: {},
|
65
|
-
withBottomSeparator: true,
|
66
|
-
isSkeleton: false
|
67
|
-
};
|
68
68
|
//# sourceMappingURL=react-desc-prop-types.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
-
"sourcesContent": ["import { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSPageHeaderT {\n export interface DefaultProps {\n withBottomSeparator: boolean;\n containerProps: object;\n isSkeleton: boolean;\n }\n\n export interface OptionalProps {\n breadcrumbs?: JSX.Element;\n pageTitle?: JSX.Element;\n backarrow?: JSX.Element;\n summary?: JSX.Element;\n toolbar?: JSX.Element;\n menu?: JSX.Element;\n Breadcrumbs?: () => JSX.Element;\n PageTitle?: () => JSX.Element;\n Backarrow?: () => JSX.Element;\n Summary?: () => JSX.Element;\n Toolbar?: () => JSX.Element;\n Menu?: () => JSX.Element;\n }\n\n export interface Props
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,
|
4
|
+
"sourcesContent": ["import { globalAttributesPropTypes, type GlobalAttributesT, PropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSPageHeaderT {\n export interface DefaultProps {\n withBottomSeparator: boolean;\n containerProps: object;\n isSkeleton: boolean;\n }\n\n export interface OptionalProps {\n breadcrumbs?: JSX.Element;\n pageTitle?: JSX.Element;\n backarrow?: JSX.Element;\n summary?: JSX.Element;\n toolbar?: JSX.Element;\n menu?: JSX.Element;\n Breadcrumbs?: () => JSX.Element;\n PageTitle?: () => JSX.Element;\n Backarrow?: () => JSX.Element;\n Summary?: () => JSX.Element;\n Toolbar?: () => JSX.Element;\n Menu?: () => JSX.Element;\n }\n\n export interface RequiredProps {}\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps>,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps>,\n RequiredProps {}\n}\n\nexport const defaultProps: DSPageHeaderT.DefaultProps = {\n containerProps: {},\n withBottomSeparator: true,\n isSkeleton: false,\n};\n\nexport const PageHeaderPropTypes = {\n ...globalAttributesPropTypes,\n /** props injected to wrapper of page header */\n containerProps: PropTypes.shape({}).description('props injected to wrapper of page header'),\n /** breadcrumbs component */\n breadcrumbs: PropTypes.node\n .description('breadcrumbs component')\n .deprecated({ version: 'Prop will be removed on 05/01/2022' }),\n Breadcrumbs: PropTypes.func.description('breadcrumbs component'),\n /** PageHeaderTitle component */\n pageTitle: PropTypes.node\n .description('PageHeaderTitle component')\n .deprecated({ version: 'Prop will be removed on 05/01/2022' }),\n PageTitle: PropTypes.func.description('PageHeaderTitle component'),\n /** back arrow component */\n backarrow: PropTypes.node\n .description('back arrow component')\n .deprecated({ version: 'Prop will be removed on 05/01/2022' }),\n Backarrow: PropTypes.func.description('back arrow component'),\n\n /** PageHeaderSummary component */\n summary: PropTypes.node\n .description('PageHeaderSummary component')\n .deprecated({ version: 'Prop will be removed on 05/01/2022' }),\n Summary: PropTypes.func.description('PageHeaderSummary component'),\n /** toolbar component */\n toolbar: PropTypes.node\n .description('toolbar component')\n .deprecated({ version: 'Prop will be removed on 05/01/2022' }),\n Toolbar: PropTypes.func.description('toolbar component'),\n\n /** PageHeaderMenu component */\n menu: PropTypes.node\n .description('PageHeaderMenu component')\n .deprecated({ version: 'Prop will be removed on 05/01/2022' }),\n Menu: PropTypes.func.description('PageHeaderMenu component'),\n /** Border bottom below the page header */\n withBottomSeparator: PropTypes.bool.description('Border bottom below the page header'),\n isSkeleton: PropTypes.bool.description('Loading state of the page header').defaultValue(false),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA6E;AAuCtE,MAAM,eAA2C;AAAA,EACtD,gBAAgB,CAAC;AAAA,EACjB,qBAAqB;AAAA,EACrB,YAAY;AACd;AAEO,MAAM,sBAAsB;AAAA,EACjC,GAAG;AAAA;AAAA,EAEH,gBAAgB,kCAAU,MAAM,CAAC,CAAC,EAAE,YAAY,0CAA0C;AAAA;AAAA,EAE1F,aAAa,kCAAU,KACpB,YAAY,uBAAuB,EACnC,WAAW,EAAE,SAAS,qCAAqC,CAAC;AAAA,EAC/D,aAAa,kCAAU,KAAK,YAAY,uBAAuB;AAAA;AAAA,EAE/D,WAAW,kCAAU,KAClB,YAAY,2BAA2B,EACvC,WAAW,EAAE,SAAS,qCAAqC,CAAC;AAAA,EAC/D,WAAW,kCAAU,KAAK,YAAY,2BAA2B;AAAA;AAAA,EAEjE,WAAW,kCAAU,KAClB,YAAY,sBAAsB,EAClC,WAAW,EAAE,SAAS,qCAAqC,CAAC;AAAA,EAC/D,WAAW,kCAAU,KAAK,YAAY,sBAAsB;AAAA;AAAA,EAG5D,SAAS,kCAAU,KAChB,YAAY,6BAA6B,EACzC,WAAW,EAAE,SAAS,qCAAqC,CAAC;AAAA,EAC/D,SAAS,kCAAU,KAAK,YAAY,6BAA6B;AAAA;AAAA,EAEjE,SAAS,kCAAU,KAChB,YAAY,mBAAmB,EAC/B,WAAW,EAAE,SAAS,qCAAqC,CAAC;AAAA,EAC/D,SAAS,kCAAU,KAAK,YAAY,mBAAmB;AAAA;AAAA,EAGvD,MAAM,kCAAU,KACb,YAAY,0BAA0B,EACtC,WAAW,EAAE,SAAS,qCAAqC,CAAC;AAAA,EAC/D,MAAM,kCAAU,KAAK,YAAY,0BAA0B;AAAA;AAAA,EAE3D,qBAAqB,kCAAU,KAAK,YAAY,qCAAqC;AAAA,EACrF,YAAY,kCAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,KAAK;AAC/F;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -0,0 +1,76 @@
|
|
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 __copyProps = (to, from, except, desc) => {
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
10
|
+
for (let key of __getOwnPropNames(from))
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
|
+
}
|
14
|
+
return to;
|
15
|
+
};
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
22
|
+
mod
|
23
|
+
));
|
24
|
+
var React = __toESM(require("react"));
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
26
|
+
var import__ = require("../index.js");
|
27
|
+
const testRequiredProps = {};
|
28
|
+
const testOptionalProps = {
|
29
|
+
children: "",
|
30
|
+
editing: false,
|
31
|
+
showMarker: false
|
32
|
+
};
|
33
|
+
const testPartialDefaults = {};
|
34
|
+
const testProps = {
|
35
|
+
...testRequiredProps,
|
36
|
+
...testOptionalProps,
|
37
|
+
...testPartialDefaults
|
38
|
+
};
|
39
|
+
const testPropsAsSyntax = {
|
40
|
+
...testRequiredProps,
|
41
|
+
...testOptionalProps,
|
42
|
+
...testPartialDefaults
|
43
|
+
};
|
44
|
+
const testCompleteDefaults = {};
|
45
|
+
const testInternalProps = {
|
46
|
+
...testRequiredProps,
|
47
|
+
...testOptionalProps,
|
48
|
+
...testCompleteDefaults
|
49
|
+
};
|
50
|
+
const testInternalPropsAsSyntax = {
|
51
|
+
...testRequiredProps,
|
52
|
+
...testOptionalProps,
|
53
|
+
...testCompleteDefaults
|
54
|
+
};
|
55
|
+
const testExplicitDefinition = {
|
56
|
+
children: "",
|
57
|
+
editing: false,
|
58
|
+
showMarker: false
|
59
|
+
};
|
60
|
+
const testInferedTypeCompatibility = {
|
61
|
+
children: "",
|
62
|
+
editing: false,
|
63
|
+
showMarker: false
|
64
|
+
};
|
65
|
+
const testDefinitionAsConst = {
|
66
|
+
children: "",
|
67
|
+
editing: false,
|
68
|
+
showMarker: false
|
69
|
+
};
|
70
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.PageHeaderEditableTitle, { ...testExplicitDefinition }),
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.PageHeaderEditableTitle, { ...testInferedTypeCompatibility }),
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.PageHeaderEditableTitle, { ...testDefinitionAsConst }),
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.PageHeaderEditableTitle, { children: "", editing: false, showMarker: false })
|
75
|
+
] });
|
76
|
+
//# sourceMappingURL=typescript-page-header-editable-title-valid.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-page-header-editable-title-valid.tsx"],
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { PageHeaderEditableTitle } from '../index.js';\nimport type { PageHeaderEditableTitleT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = PageHeaderEditableTitleT.Props;\ntype ComponentPropsInternals = PageHeaderEditableTitleT.InternalProps;\ntype ComponentPropsDefaultProps = PageHeaderEditableTitleT.DefaultProps;\ntype ComponentPropsOptionalProps = PageHeaderEditableTitleT.OptionalProps;\ntype ComponentPropsRequiredProps = PageHeaderEditableTitleT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n children: '',\n editing: false,\n showMarker: false,\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n children: '',\n editing: false,\n showMarker: false,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n children: '',\n editing: false,\n showMarker: false,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n children: '',\n editing: false,\n showMarker: false,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <PageHeaderEditableTitle {...testExplicitDefinition} />\n <PageHeaderEditableTitle {...testInferedTypeCompatibility} />\n <PageHeaderEditableTitle {...testDefinitionAsConst} />\n {/* works with inline values */}\n <PageHeaderEditableTitle children=\"\" editing={false} showMarker={false} />\n </>\n);\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACuErB;AAtEF,eAAwC;AAUxC,MAAM,oBAAiD,CAAC;AAExD,MAAM,oBAAiD;AAAA,EACrD,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AACd;AAIA,MAAM,sBAA2D,CAAC;AAElE,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D,CAAC;AAEpE,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AACd;AAGA,MAAM,+BAA+B;AAAA,EACnC,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AACd;AAEA,MAAM,wBAAwB;AAAA,EAC5B,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AACd;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,oCAAyB,GAAG,wBAAwB;AAAA,EACrD,4CAAC,oCAAyB,GAAG,8BAA8B;AAAA,EAC3D,4CAAC,oCAAyB,GAAG,uBAAuB;AAAA,EAEpD,4CAAC,oCAAwB,UAAS,IAAG,SAAS,OAAO,YAAY,OAAO;AAAA,GAC1E;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,72 @@
|
|
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 __copyProps = (to, from, except, desc) => {
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
10
|
+
for (let key of __getOwnPropNames(from))
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
|
+
}
|
14
|
+
return to;
|
15
|
+
};
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
22
|
+
mod
|
23
|
+
));
|
24
|
+
var React = __toESM(require("react"));
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
26
|
+
var import__ = require("../index.js");
|
27
|
+
const testRequiredProps = {};
|
28
|
+
const testOptionalProps = {
|
29
|
+
value: 2,
|
30
|
+
label: ""
|
31
|
+
};
|
32
|
+
const testPartialDefaults = {};
|
33
|
+
const testProps = {
|
34
|
+
...testRequiredProps,
|
35
|
+
...testOptionalProps,
|
36
|
+
...testPartialDefaults
|
37
|
+
};
|
38
|
+
const testPropsAsSyntax = {
|
39
|
+
...testRequiredProps,
|
40
|
+
...testOptionalProps,
|
41
|
+
...testPartialDefaults
|
42
|
+
};
|
43
|
+
const testCompleteDefaults = {};
|
44
|
+
const testInternalProps = {
|
45
|
+
...testRequiredProps,
|
46
|
+
...testOptionalProps,
|
47
|
+
...testCompleteDefaults
|
48
|
+
};
|
49
|
+
const testInternalPropsAsSyntax = {
|
50
|
+
...testRequiredProps,
|
51
|
+
...testOptionalProps,
|
52
|
+
...testCompleteDefaults
|
53
|
+
};
|
54
|
+
const testExplicitDefinition = {
|
55
|
+
value: 2,
|
56
|
+
label: ""
|
57
|
+
};
|
58
|
+
const testInferedTypeCompatibility = {
|
59
|
+
value: 2,
|
60
|
+
label: ""
|
61
|
+
};
|
62
|
+
const testDefinitionAsConst = {
|
63
|
+
value: 2,
|
64
|
+
label: ""
|
65
|
+
};
|
66
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.PageHeaderSummary, { ...testExplicitDefinition }),
|
68
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.PageHeaderSummary, { ...testInferedTypeCompatibility }),
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.PageHeaderSummary, { ...testDefinitionAsConst }),
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.PageHeaderSummary, { value: 1, label: "" })
|
71
|
+
] });
|
72
|
+
//# sourceMappingURL=typescript-page-header-summary-valid.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-page-header-summary-valid.tsx"],
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { PageHeaderSummary } from '../index.js';\nimport type { PageHeaderSummaryT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = PageHeaderSummaryT.Props;\ntype ComponentPropsInternals = PageHeaderSummaryT.InternalProps;\ntype ComponentPropsDefaultProps = PageHeaderSummaryT.DefaultProps;\ntype ComponentPropsOptionalProps = PageHeaderSummaryT.OptionalProps;\ntype ComponentPropsRequiredProps = PageHeaderSummaryT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n value: 2,\n label: '',\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n value: 2,\n label: '',\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n value: 2,\n label: '',\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n value: 2,\n label: '',\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <PageHeaderSummary {...testExplicitDefinition} />\n <PageHeaderSummary {...testInferedTypeCompatibility} />\n <PageHeaderSummary {...testDefinitionAsConst} />\n {/* works with inline values */}\n <PageHeaderSummary value={1} label=\"\" />\n </>\n);\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACmErB;AAlEF,eAAkC;AAUlC,MAAM,oBAAiD,CAAC;AAExD,MAAM,oBAAiD;AAAA,EACrD,OAAO;AAAA,EACP,OAAO;AACT;AAIA,MAAM,sBAA2D,CAAC;AAElE,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D,CAAC;AAEpE,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,OAAO;AAAA,EACP,OAAO;AACT;AAGA,MAAM,+BAA+B;AAAA,EACnC,OAAO;AAAA,EACP,OAAO;AACT;AAEA,MAAM,wBAAwB;AAAA,EAC5B,OAAO;AAAA,EACP,OAAO;AACT;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,8BAAmB,GAAG,wBAAwB;AAAA,EAC/C,4CAAC,8BAAmB,GAAG,8BAA8B;AAAA,EACrD,4CAAC,8BAAmB,GAAG,uBAAuB;AAAA,EAE9C,4CAAC,8BAAkB,OAAO,GAAG,OAAM,IAAG;AAAA,GACxC;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,74 @@
|
|
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 __copyProps = (to, from, except, desc) => {
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
10
|
+
for (let key of __getOwnPropNames(from))
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
|
+
}
|
14
|
+
return to;
|
15
|
+
};
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
22
|
+
mod
|
23
|
+
));
|
24
|
+
var React = __toESM(require("react"));
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
26
|
+
var import__ = require("../index.js");
|
27
|
+
const testRequiredProps = {};
|
28
|
+
const testOptionalProps = {};
|
29
|
+
const testPartialDefaults = {
|
30
|
+
children: ""
|
31
|
+
};
|
32
|
+
const testProps = {
|
33
|
+
...testRequiredProps,
|
34
|
+
...testOptionalProps,
|
35
|
+
...testPartialDefaults
|
36
|
+
};
|
37
|
+
const testPropsAsSyntax = {
|
38
|
+
...testRequiredProps,
|
39
|
+
...testOptionalProps,
|
40
|
+
...testPartialDefaults
|
41
|
+
};
|
42
|
+
const testCompleteDefaults = {
|
43
|
+
children: "",
|
44
|
+
showMarker: true
|
45
|
+
};
|
46
|
+
const testInternalProps = {
|
47
|
+
...testRequiredProps,
|
48
|
+
...testOptionalProps,
|
49
|
+
...testCompleteDefaults
|
50
|
+
};
|
51
|
+
const testInternalPropsAsSyntax = {
|
52
|
+
...testRequiredProps,
|
53
|
+
...testOptionalProps,
|
54
|
+
...testCompleteDefaults
|
55
|
+
};
|
56
|
+
const testExplicitDefinition = {
|
57
|
+
children: "",
|
58
|
+
showMarker: true
|
59
|
+
};
|
60
|
+
const testInferedTypeCompatibility = {
|
61
|
+
children: "",
|
62
|
+
showMarker: true
|
63
|
+
};
|
64
|
+
const testDefinitionAsConst = {
|
65
|
+
children: "",
|
66
|
+
showMarker: true
|
67
|
+
};
|
68
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.PageHeaderTitle, { ...testExplicitDefinition }),
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.PageHeaderTitle, { ...testInferedTypeCompatibility }),
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.PageHeaderTitle, { ...testDefinitionAsConst }),
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.PageHeaderTitle, { children: "", showMarker: true })
|
73
|
+
] });
|
74
|
+
//# sourceMappingURL=typescript-page-header-title-valid.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-page-header-title-valid.tsx"],
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { PageHeaderTitle } from '../index.js';\nimport type { PageHeaderTitleT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = PageHeaderTitleT.Props;\ntype ComponentPropsInternals = PageHeaderTitleT.InternalProps;\ntype ComponentPropsDefaultProps = PageHeaderTitleT.DefaultProps;\ntype ComponentPropsOptionalProps = PageHeaderTitleT.OptionalProps;\ntype ComponentPropsRequiredProps = PageHeaderTitleT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n children: '',\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n children: '',\n showMarker: true,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n children: '',\n showMarker: true,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n children: '',\n showMarker: true,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n children: '',\n showMarker: true,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <PageHeaderTitle {...testExplicitDefinition} />\n <PageHeaderTitle {...testInferedTypeCompatibility} />\n <PageHeaderTitle {...testDefinitionAsConst} />\n {/* works with inline values */}\n <PageHeaderTitle children=\"\" showMarker={true} />\n </>\n);\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACqErB;AApEF,eAAgC;AAUhC,MAAM,oBAAiD,CAAC;AAExD,MAAM,oBAAiD,CAAC;AAIxD,MAAM,sBAA2D;AAAA,EAC/D,UAAU;AACZ;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,UAAU;AAAA,EACV,YAAY;AACd;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,UAAU;AAAA,EACV,YAAY;AACd;AAGA,MAAM,+BAA+B;AAAA,EACnC,UAAU;AAAA,EACV,YAAY;AACd;AAEA,MAAM,wBAAwB;AAAA,EAC5B,UAAU;AAAA,EACV,YAAY;AACd;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,4BAAiB,GAAG,wBAAwB;AAAA,EAC7C,4CAAC,4BAAiB,GAAG,8BAA8B;AAAA,EACnD,4CAAC,4BAAiB,GAAG,uBAAuB;AAAA,EAE5C,4CAAC,4BAAgB,UAAS,IAAG,YAAY,MAAM;AAAA,GACjD;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,148 @@
|
|
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 __copyProps = (to, from, except, desc) => {
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
10
|
+
for (let key of __getOwnPropNames(from))
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
|
+
}
|
14
|
+
return to;
|
15
|
+
};
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
22
|
+
mod
|
23
|
+
));
|
24
|
+
var React = __toESM(require("react"));
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
26
|
+
var import__ = require("../index.js");
|
27
|
+
const MockComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {});
|
28
|
+
const testRequiredProps = {};
|
29
|
+
const testOptionalProps = {
|
30
|
+
breadcrumbs: MockComponent(),
|
31
|
+
pageTitle: MockComponent(),
|
32
|
+
backarrow: MockComponent(),
|
33
|
+
summary: MockComponent(),
|
34
|
+
toolbar: MockComponent(),
|
35
|
+
menu: MockComponent(),
|
36
|
+
Breadcrumbs: MockComponent,
|
37
|
+
PageTitle: MockComponent,
|
38
|
+
Backarrow: MockComponent,
|
39
|
+
Summary: MockComponent,
|
40
|
+
Toolbar: MockComponent,
|
41
|
+
Menu: MockComponent
|
42
|
+
};
|
43
|
+
const testPartialDefaults = {
|
44
|
+
containerProps: {},
|
45
|
+
isSkeleton: true
|
46
|
+
};
|
47
|
+
const testProps = {
|
48
|
+
...testRequiredProps,
|
49
|
+
...testOptionalProps,
|
50
|
+
...testPartialDefaults
|
51
|
+
};
|
52
|
+
const testPropsAsSyntax = {
|
53
|
+
...testRequiredProps,
|
54
|
+
...testOptionalProps,
|
55
|
+
...testPartialDefaults
|
56
|
+
};
|
57
|
+
const testCompleteDefaults = {
|
58
|
+
containerProps: { "data-testid": "test-id" },
|
59
|
+
isSkeleton: false,
|
60
|
+
withBottomSeparator: false
|
61
|
+
};
|
62
|
+
const testInternalProps = {
|
63
|
+
...testRequiredProps,
|
64
|
+
...testOptionalProps,
|
65
|
+
...testCompleteDefaults
|
66
|
+
};
|
67
|
+
const testInternalPropsAsSyntax = {
|
68
|
+
...testRequiredProps,
|
69
|
+
...testOptionalProps,
|
70
|
+
...testCompleteDefaults
|
71
|
+
};
|
72
|
+
const testExplicitDefinition = {
|
73
|
+
containerProps: { "data-testid": "test-id" },
|
74
|
+
isSkeleton: false,
|
75
|
+
withBottomSeparator: false,
|
76
|
+
breadcrumbs: MockComponent(),
|
77
|
+
pageTitle: MockComponent(),
|
78
|
+
backarrow: MockComponent(),
|
79
|
+
summary: MockComponent(),
|
80
|
+
toolbar: MockComponent(),
|
81
|
+
menu: MockComponent(),
|
82
|
+
Breadcrumbs: MockComponent,
|
83
|
+
PageTitle: MockComponent,
|
84
|
+
Backarrow: MockComponent,
|
85
|
+
Summary: MockComponent,
|
86
|
+
Toolbar: MockComponent,
|
87
|
+
Menu: MockComponent
|
88
|
+
};
|
89
|
+
const testInferedTypeCompatibility = {
|
90
|
+
containerProps: { "data-testid": "test-id" },
|
91
|
+
isSkeleton: false,
|
92
|
+
withBottomSeparator: false,
|
93
|
+
breadcrumbs: MockComponent(),
|
94
|
+
pageTitle: MockComponent(),
|
95
|
+
backarrow: MockComponent(),
|
96
|
+
summary: MockComponent(),
|
97
|
+
toolbar: MockComponent(),
|
98
|
+
menu: MockComponent(),
|
99
|
+
Breadcrumbs: MockComponent,
|
100
|
+
PageTitle: MockComponent,
|
101
|
+
Backarrow: MockComponent,
|
102
|
+
Summary: MockComponent,
|
103
|
+
Toolbar: MockComponent,
|
104
|
+
Menu: MockComponent
|
105
|
+
};
|
106
|
+
const testDefinitionAsConst = {
|
107
|
+
containerProps: { "data-testid": "test-id" },
|
108
|
+
isSkeleton: false,
|
109
|
+
withBottomSeparator: false,
|
110
|
+
breadcrumbs: MockComponent(),
|
111
|
+
pageTitle: MockComponent(),
|
112
|
+
backarrow: MockComponent(),
|
113
|
+
summary: MockComponent(),
|
114
|
+
toolbar: MockComponent(),
|
115
|
+
menu: MockComponent(),
|
116
|
+
Breadcrumbs: MockComponent,
|
117
|
+
PageTitle: MockComponent,
|
118
|
+
Backarrow: MockComponent,
|
119
|
+
Summary: MockComponent,
|
120
|
+
Toolbar: MockComponent,
|
121
|
+
Menu: MockComponent
|
122
|
+
};
|
123
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSPageHeaderV2, { ...testExplicitDefinition }),
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSPageHeaderV2, { ...testInferedTypeCompatibility }),
|
126
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSPageHeaderV2, { ...testDefinitionAsConst }),
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
128
|
+
import__.DSPageHeaderV2,
|
129
|
+
{
|
130
|
+
containerProps: { "data-testid": "test-id" },
|
131
|
+
isSkeleton: false,
|
132
|
+
withBottomSeparator: false,
|
133
|
+
breadcrumbs: MockComponent(),
|
134
|
+
pageTitle: MockComponent(),
|
135
|
+
backarrow: MockComponent(),
|
136
|
+
summary: MockComponent(),
|
137
|
+
toolbar: MockComponent(),
|
138
|
+
menu: MockComponent(),
|
139
|
+
Breadcrumbs: MockComponent,
|
140
|
+
PageTitle: MockComponent,
|
141
|
+
Backarrow: MockComponent,
|
142
|
+
Summary: MockComponent,
|
143
|
+
Toolbar: MockComponent,
|
144
|
+
Menu: MockComponent
|
145
|
+
}
|
146
|
+
)
|
147
|
+
] });
|
148
|
+
//# sourceMappingURL=typescript-page-header-v2-valid.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-page-header-v2-valid.tsx"],
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSPageHeaderV2 } from '../index.js';\nimport type { DSPageHeaderT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSPageHeaderT.Props;\ntype ComponentPropsInternals = DSPageHeaderT.InternalProps;\ntype ComponentPropsDefaultProps = DSPageHeaderT.DefaultProps;\ntype ComponentPropsOptionalProps = DSPageHeaderT.OptionalProps;\ntype ComponentPropsRequiredProps = DSPageHeaderT.RequiredProps;\n\nconst MockComponent = () => <div></div>;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n breadcrumbs: MockComponent(),\n pageTitle: MockComponent(),\n backarrow: MockComponent(),\n summary: MockComponent(),\n toolbar: MockComponent(),\n menu: MockComponent(),\n Breadcrumbs: MockComponent,\n PageTitle: MockComponent,\n Backarrow: MockComponent,\n Summary: MockComponent,\n Toolbar: MockComponent,\n Menu: MockComponent,\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n containerProps: {},\n isSkeleton: true,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n containerProps: { 'data-testid': 'test-id' },\n isSkeleton: false,\n withBottomSeparator: false,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n containerProps: { 'data-testid': 'test-id' },\n isSkeleton: false,\n withBottomSeparator: false,\n breadcrumbs: MockComponent(),\n pageTitle: MockComponent(),\n backarrow: MockComponent(),\n summary: MockComponent(),\n toolbar: MockComponent(),\n menu: MockComponent(),\n Breadcrumbs: MockComponent,\n PageTitle: MockComponent,\n Backarrow: MockComponent,\n Summary: MockComponent,\n Toolbar: MockComponent,\n Menu: MockComponent,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n containerProps: { 'data-testid': 'test-id' },\n isSkeleton: false,\n withBottomSeparator: false,\n breadcrumbs: MockComponent(),\n pageTitle: MockComponent(),\n backarrow: MockComponent(),\n summary: MockComponent(),\n toolbar: MockComponent(),\n menu: MockComponent(),\n Breadcrumbs: MockComponent,\n PageTitle: MockComponent,\n Backarrow: MockComponent,\n Summary: MockComponent,\n Toolbar: MockComponent,\n Menu: MockComponent,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n containerProps: { 'data-testid': 'test-id' },\n isSkeleton: false,\n withBottomSeparator: false,\n breadcrumbs: MockComponent(),\n pageTitle: MockComponent(),\n backarrow: MockComponent(),\n summary: MockComponent(),\n toolbar: MockComponent(),\n menu: MockComponent(),\n Breadcrumbs: MockComponent,\n PageTitle: MockComponent,\n Backarrow: MockComponent,\n Summary: MockComponent,\n Toolbar: MockComponent,\n Menu: MockComponent,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSPageHeaderV2 {...testExplicitDefinition} />\n <DSPageHeaderV2 {...testInferedTypeCompatibility} />\n <DSPageHeaderV2 {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSPageHeaderV2\n containerProps={{ 'data-testid': 'test-id' }}\n isSkeleton={false}\n withBottomSeparator={false}\n breadcrumbs={MockComponent()}\n pageTitle={MockComponent()}\n backarrow={MockComponent()}\n summary={MockComponent()}\n toolbar={MockComponent()}\n menu={MockComponent()}\n Breadcrumbs={MockComponent}\n PageTitle={MockComponent}\n Backarrow={MockComponent}\n Summary={MockComponent}\n Toolbar={MockComponent}\n Menu={MockComponent}\n />\n </>\n);\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACWK;AAV5B,eAA+B;AAU/B,MAAM,gBAAgB,MAAM,4CAAC,SAAI;AAEjC,MAAM,oBAAiD,CAAC;AAExD,MAAM,oBAAiD;AAAA,EACrD,aAAa,cAAc;AAAA,EAC3B,WAAW,cAAc;AAAA,EACzB,WAAW,cAAc;AAAA,EACzB,SAAS,cAAc;AAAA,EACvB,SAAS,cAAc;AAAA,EACvB,MAAM,cAAc;AAAA,EACpB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;AAIA,MAAM,sBAA2D;AAAA,EAC/D,gBAAgB,CAAC;AAAA,EACjB,YAAY;AACd;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,gBAAgB,EAAE,eAAe,UAAU;AAAA,EAC3C,YAAY;AAAA,EACZ,qBAAqB;AACvB;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,gBAAgB,EAAE,eAAe,UAAU;AAAA,EAC3C,YAAY;AAAA,EACZ,qBAAqB;AAAA,EACrB,aAAa,cAAc;AAAA,EAC3B,WAAW,cAAc;AAAA,EACzB,WAAW,cAAc;AAAA,EACzB,SAAS,cAAc;AAAA,EACvB,SAAS,cAAc;AAAA,EACvB,MAAM,cAAc;AAAA,EACpB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;AAGA,MAAM,+BAA+B;AAAA,EACnC,gBAAgB,EAAE,eAAe,UAAU;AAAA,EAC3C,YAAY;AAAA,EACZ,qBAAqB;AAAA,EACrB,aAAa,cAAc;AAAA,EAC3B,WAAW,cAAc;AAAA,EACzB,WAAW,cAAc;AAAA,EACzB,SAAS,cAAc;AAAA,EACvB,SAAS,cAAc;AAAA,EACvB,MAAM,cAAc;AAAA,EACpB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;AAEA,MAAM,wBAAwB;AAAA,EAC5B,gBAAgB,EAAE,eAAe,UAAU;AAAA,EAC3C,YAAY;AAAA,EACZ,qBAAqB;AAAA,EACrB,aAAa,cAAc;AAAA,EAC3B,WAAW,cAAc;AAAA,EACzB,WAAW,cAAc;AAAA,EACzB,SAAS,cAAc;AAAA,EACvB,SAAS,cAAc;AAAA,EACvB,MAAM,cAAc;AAAA,EACpB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,2BAAgB,GAAG,wBAAwB;AAAA,EAC5C,4CAAC,2BAAgB,GAAG,8BAA8B;AAAA,EAClD,4CAAC,2BAAgB,GAAG,uBAAuB;AAAA,EAE3C;AAAA,IAAC;AAAA;AAAA,MACC,gBAAgB,EAAE,eAAe,UAAU;AAAA,MAC3C,YAAY;AAAA,MACZ,qBAAqB;AAAA,MACrB,aAAa,cAAc;AAAA,MAC3B,WAAW,cAAc;AAAA,MACzB,WAAW,cAAc;AAAA,MACzB,SAAS,cAAc;AAAA,MACvB,SAAS,cAAc;AAAA,MACvB,MAAM,cAAc;AAAA,MACpB,aAAa;AAAA,MACb,WAAW;AAAA,MACX,WAAW;AAAA,MACX,SAAS;AAAA,MACT,SAAS;AAAA,MACT,MAAM;AAAA;AAAA,EACR;AAAA,GACF;",
|
6
|
+
"names": []
|
7
|
+
}
|
package/dist/esm/PageHeader.js
CHANGED
@@ -11,9 +11,9 @@ import {
|
|
11
11
|
PageHeaderBack
|
12
12
|
} from "./styled.js";
|
13
13
|
import { usePageHeader } from "./config/usePageHeader.js";
|
14
|
-
import { PageHeaderTitle } from "./components/
|
15
|
-
import { PageHeaderEditableTitle } from "./components/
|
16
|
-
import { PageHeaderSummary } from "./components/
|
14
|
+
import { PageHeaderTitle } from "./components/page-header-title/index.js";
|
15
|
+
import { PageHeaderEditableTitle } from "./components/page-header-editable-title/index.js";
|
16
|
+
import { PageHeaderSummary } from "./components/page-header-summary/index.js";
|
17
17
|
import { PageHeaderPropTypes, defaultProps } from "./react-desc-prop-types.js";
|
18
18
|
import { DSPageHeaderDataTestIds, DSPageHeaderName } from "./exported-related/index.js";
|
19
19
|
const DSPageHeaderV2 = (props) => {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/PageHeader.tsx"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { Grid } from '@elliemae/ds-grid';\nimport {\n Container,\n ContainerWBorder,\n PageHeaderCustomRenderer,\n PageHeaderToolbarWrapper,\n PageHeaderMenu,\n PageHeaderBack,\n} from './styled.js';\nimport { usePageHeader } from './config/usePageHeader.js';\nimport { PageHeaderTitle } from './components/
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { Grid } from '@elliemae/ds-grid';\nimport {\n Container,\n ContainerWBorder,\n PageHeaderCustomRenderer,\n PageHeaderToolbarWrapper,\n PageHeaderMenu,\n PageHeaderBack,\n} from './styled.js';\nimport { usePageHeader } from './config/usePageHeader.js';\nimport { PageHeaderTitle } from './components/page-header-title/index.js';\nimport { PageHeaderEditableTitle } from './components/page-header-editable-title/index.js';\nimport { PageHeaderSummary } from './components/page-header-summary/index.js';\nimport type { DSPageHeaderT } from './react-desc-prop-types.js';\nimport { PageHeaderPropTypes, defaultProps } from './react-desc-prop-types.js';\nimport { DSPageHeaderDataTestIds, DSPageHeaderName } from './exported-related/index.js';\n\nconst DSPageHeaderV2: React.ComponentType<DSPageHeaderT.Props> = (props) => {\n const {\n currentBackArrow,\n currentMenu,\n currentBreadcrumbs,\n currentSummary,\n currentToolbar,\n currentPageTitle,\n containerProps,\n withBottomSeparator,\n globalAttributes,\n xStyledProps,\n } = usePageHeader(props);\n\n const { isSkeleton } = props;\n const wrapperRow = ['auto', '1fr'];\n const mainRow = ['1fr', 'auto'];\n const pageTitleRow = [\n isSkeleton ? '2fr' : 'auto',\n currentMenu !== undefined && '30px',\n currentSummary !== undefined && 'auto',\n '1fr',\n ].filter((col) => typeof col === 'string') as string[];\n return (\n <Container\n {...containerProps}\n {...globalAttributes}\n {...xStyledProps}\n data-testid={DSPageHeaderDataTestIds.CONTAINER}\n >\n <ContainerWBorder withBottomSeparator={withBottomSeparator}>\n <Grid cols={wrapperRow}>\n <Grid>\n <PageHeaderBack>{currentBackArrow}</PageHeaderBack>\n </Grid>\n <Grid rows={['auto', 'auto']}>\n <Grid className=\"em-ds-page-header-v2-breadcrumb\">{currentBreadcrumbs}</Grid>\n <Grid cols={mainRow} alignItems=\"center\">\n <Grid cols={pageTitleRow} alignItems=\"center\">\n {currentPageTitle}\n {currentMenu && <PageHeaderMenu>{currentMenu}</PageHeaderMenu>}\n {currentSummary}\n <div />\n </Grid>\n <Grid>\n <PageHeaderToolbarWrapper>{currentToolbar}</PageHeaderToolbarWrapper>\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n </ContainerWBorder>\n </Container>\n );\n};\n\nDSPageHeaderV2.propTypes = PageHeaderPropTypes as WeakValidationMap<unknown>;\nDSPageHeaderV2.defaultProps = defaultProps;\nDSPageHeaderV2.displayName = DSPageHeaderName;\nconst DSPageHeaderWithSchema = describe(DSPageHeaderV2);\n\nDSPageHeaderWithSchema.propTypes = PageHeaderPropTypes as WeakValidationMap<unknown>;\n\nexport {\n DSPageHeaderV2,\n PageHeaderTitle,\n PageHeaderEditableTitle,\n PageHeaderSummary,\n PageHeaderMenu,\n PageHeaderCustomRenderer,\n DSPageHeaderWithSchema,\n};\n\nexport default DSPageHeaderV2;\n"],
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACuDX,cAKE,YALF;AAnDZ,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,+BAA+B;AACxC,SAAS,yBAAyB;AAElC,SAAS,qBAAqB,oBAAoB;AAClD,SAAS,yBAAyB,wBAAwB;AAE1D,MAAM,iBAA2D,CAAC,UAAU;AAC1E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,cAAc,KAAK;AAEvB,QAAM,EAAE,WAAW,IAAI;AACvB,QAAM,aAAa,CAAC,QAAQ,KAAK;AACjC,QAAM,UAAU,CAAC,OAAO,MAAM;AAC9B,QAAM,eAAe;AAAA,IACnB,aAAa,QAAQ;AAAA,IACrB,gBAAgB,UAAa;AAAA,IAC7B,mBAAmB,UAAa;AAAA,IAChC;AAAA,EACF,EAAE,OAAO,CAAC,QAAQ,OAAO,QAAQ,QAAQ;AACzC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,eAAa,wBAAwB;AAAA,MAErC,8BAAC,oBAAiB,qBAChB,+BAAC,QAAK,MAAM,YACV;AAAA,4BAAC,QACC,8BAAC,kBAAgB,4BAAiB,GACpC;AAAA,QACA,qBAAC,QAAK,MAAM,CAAC,QAAQ,MAAM,GACzB;AAAA,8BAAC,QAAK,WAAU,mCAAmC,8BAAmB;AAAA,UACtE,qBAAC,QAAK,MAAM,SAAS,YAAW,UAC9B;AAAA,iCAAC,QAAK,MAAM,cAAc,YAAW,UAClC;AAAA;AAAA,cACA,eAAe,oBAAC,kBAAgB,uBAAY;AAAA,cAC5C;AAAA,cACD,oBAAC,SAAI;AAAA,eACP;AAAA,YACA,oBAAC,QACC,8BAAC,4BAA0B,0BAAe,GAC5C;AAAA,aACF;AAAA,WACF;AAAA,SACF,GACF;AAAA;AAAA,EACF;AAEJ;AAEA,eAAe,YAAY;AAC3B,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B,MAAM,yBAAyB,SAAS,cAAc;AAEtD,uBAAuB,YAAY;AAYnC,IAAO,qBAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -3,10 +3,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useRef, useState, useCallback } from "react";
|
4
4
|
import { DSInputText, DSInputTextName, DSInputTextSlots } from "@elliemae/ds-form-input-text";
|
5
5
|
import { styled } from "@elliemae/ds-system";
|
6
|
-
import {
|
6
|
+
import { describe, useGetGlobalAttributes } from "@elliemae/ds-props-helpers";
|
7
7
|
import { useDerivedStateFromProps, useMeasure } from "@elliemae/ds-utilities";
|
8
|
-
import { PageHeaderTitle } from "
|
9
|
-
import { DSPageHeaderDataTestIds } from "
|
8
|
+
import { PageHeaderTitle } from "../page-header-title/index.js";
|
9
|
+
import { DSPageHeaderDataTestIds } from "../../exported-related/index.js";
|
10
|
+
import { PageHeaderEditableTitlePropTypes } from "./react-desc-prop-types.js";
|
10
11
|
const EditableContainer = styled("div")`
|
11
12
|
height: 32px;
|
12
13
|
position: relative;
|
@@ -29,8 +30,8 @@ const EditableContainer = styled("div")`
|
|
29
30
|
}
|
30
31
|
}
|
31
32
|
`;
|
32
|
-
const PageHeaderEditableTitle = (
|
33
|
-
const { children: value, editing: editingProp, showMarker, ...rest } =
|
33
|
+
const PageHeaderEditableTitle = (props) => {
|
34
|
+
const { children: value, editing: editingProp, showMarker, ...rest } = props;
|
34
35
|
const [titleValue, setTitleValue] = useState(value);
|
35
36
|
const [hovered, setHovered] = useState(false);
|
36
37
|
const [editing, setEditing] = useDerivedStateFromProps(editingProp || false);
|
@@ -78,19 +79,10 @@ const PageHeaderEditableTitle = (props2) => {
|
|
78
79
|
}
|
79
80
|
);
|
80
81
|
};
|
81
|
-
|
82
|
-
...globalAttributesPropTypes,
|
83
|
-
/** The title text */
|
84
|
-
children: PropTypes.string.description("The title text"),
|
85
|
-
/** Whether the title is editing or not */
|
86
|
-
editing: PropTypes.bool.description("Whether the title is editing or not"),
|
87
|
-
/** Show error marker */
|
88
|
-
showMarker: PropTypes.bool.description("Show error marker")
|
89
|
-
};
|
90
|
-
PageHeaderEditableTitle.propTypes = props;
|
82
|
+
PageHeaderEditableTitle.propTypes = PageHeaderEditableTitlePropTypes;
|
91
83
|
PageHeaderEditableTitle.displayName = "PageHeaderEditableTitle";
|
92
84
|
const DSPageHeaderEditableTitleWithSchema = describe(PageHeaderEditableTitle);
|
93
|
-
DSPageHeaderEditableTitleWithSchema.propTypes =
|
85
|
+
DSPageHeaderEditableTitleWithSchema.propTypes = PageHeaderEditableTitlePropTypes;
|
94
86
|
var PageHeaderEditableTitle_default = PageHeaderEditableTitle;
|
95
87
|
export {
|
96
88
|
DSPageHeaderEditableTitleWithSchema,
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/page-header-editable-title/PageHeaderEditableTitle.tsx"],
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef, useState, useCallback } from 'react';\nimport { DSInputText, DSInputTextName, DSInputTextSlots } from '@elliemae/ds-form-input-text';\nimport { styled } from '@elliemae/ds-system';\nimport { describe, useGetGlobalAttributes, type ValidationMap } from '@elliemae/ds-props-helpers';\nimport { useDerivedStateFromProps, useMeasure } from '@elliemae/ds-utilities';\nimport { PageHeaderTitle } from '../page-header-title/index.js';\nimport { DSPageHeaderDataTestIds } from '../../exported-related/index.js';\nimport { PageHeaderEditableTitlePropTypes, type PageHeaderEditableTitleT } from './react-desc-prop-types.js';\n\nconst EditableContainer = styled('div')`\n height: 32px;\n position: relative;\n overflow: hidden;\n &.editable-title-component {\n position: relative;\n left: -7px;\n top: -1px;\n margin-left: -2px;\n margin-right: -9px;\n & .${DSInputTextName}-${DSInputTextSlots.INPUT_WRAPPER} {\n height: 32px;\n }\n & .${DSInputTextName}-${DSInputTextSlots.INPUT} {\n font-size: ${({ theme }) => theme.fontSizes.title[800]};\n line-height: normal;\n color: ${({ theme }) => theme.colors.neutral['700']};\n padding-top: 0px;\n padding-bottom: 0px;\n }\n }\n`;\n\nexport const PageHeaderEditableTitle = (props: PageHeaderEditableTitleT.Props) => {\n const { children: value, editing: editingProp, showMarker, ...rest } = props;\n const [titleValue, setTitleValue] = useState(value);\n const [hovered, setHovered] = useState(false);\n const [editing, setEditing] = useDerivedStateFromProps(editingProp || false);\n const titleRef = useRef(null);\n const { width } = useMeasure(titleRef);\n\n const handleOnChange: React.ChangeEventHandler<HTMLInputElement> = useCallback((e) => {\n setTitleValue(e.target.value);\n }, []);\n\n const handleOnFocus: React.FocusEventHandler = useCallback(() => {\n setEditing(true);\n }, [setEditing]);\n\n const handleOnBlur: React.FocusEventHandler = useCallback(() => {\n setEditing(false);\n }, [setEditing]);\n\n const handleOnMouseOut: React.MouseEventHandler = useCallback(() => {\n setHovered(false);\n }, []);\n\n const globals = useGetGlobalAttributes(rest, {\n onFocus: handleOnFocus,\n onMouseOut: handleOnMouseOut,\n onChange: handleOnChange,\n onBlur: handleOnBlur,\n });\n\n return (\n <EditableContainer\n className={hovered || editing ? 'editable-title-component' : ''}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n data-testid={DSPageHeaderDataTestIds.EDITABLE_HEADER_TITLE}\n >\n {(hovered || editing) && (\n <DSInputText\n onChange={handleOnChange}\n {...rest}\n {...globals}\n placeholder=\"\"\n style={{ width: width + 10, minWidth: '260px', maxWidth: '100%' }}\n value={titleValue}\n />\n )}\n <div ref={titleRef} style={{ width: 'fit-content' }}>\n <PageHeaderTitle showMarker={showMarker && !hovered && !editing}>{titleValue}</PageHeaderTitle>\n </div>\n </EditableContainer>\n );\n};\n\nPageHeaderEditableTitle.propTypes = PageHeaderEditableTitlePropTypes as ValidationMap<unknown>;\nPageHeaderEditableTitle.displayName = 'PageHeaderEditableTitle';\nconst DSPageHeaderEditableTitleWithSchema = describe(PageHeaderEditableTitle);\n\nDSPageHeaderEditableTitleWithSchema.propTypes = PageHeaderEditableTitlePropTypes as ValidationMap<unknown>;\n\nexport default PageHeaderEditableTitle;\n\nexport { DSPageHeaderEditableTitleWithSchema };\n"],
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACgEnB,SAOI,KAPJ;AAhEJ,SAAgB,QAAQ,UAAU,mBAAmB;AACrD,SAAS,aAAa,iBAAiB,wBAAwB;AAC/D,SAAS,cAAc;AACvB,SAAS,UAAU,8BAAkD;AACrE,SAAS,0BAA0B,kBAAkB;AACrD,SAAS,uBAAuB;AAChC,SAAS,+BAA+B;AACxC,SAAS,wCAAuE;AAEhF,MAAM,oBAAoB,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAU7B,mBAAmB,iBAAiB;AAAA;AAAA;AAAA,SAGpC,mBAAmB,iBAAiB;AAAA,mBAC1B,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,MAAM,GAAG;AAAA;AAAA,eAE5C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAOjD,MAAM,0BAA0B,CAAC,UAA0C;AAChF,QAAM,EAAE,UAAU,OAAO,SAAS,aAAa,YAAY,GAAG,KAAK,IAAI;AACvE,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAClD,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,CAAC,SAAS,UAAU,IAAI,yBAAyB,eAAe,KAAK;AAC3E,QAAM,WAAW,OAAO,IAAI;AAC5B,QAAM,EAAE,MAAM,IAAI,WAAW,QAAQ;AAErC,QAAM,iBAA6D,YAAY,CAAC,MAAM;AACpF,kBAAc,EAAE,OAAO,KAAK;AAAA,EAC9B,GAAG,CAAC,CAAC;AAEL,QAAM,gBAAyC,YAAY,MAAM;AAC/D,eAAW,IAAI;AAAA,EACjB,GAAG,CAAC,UAAU,CAAC;AAEf,QAAM,eAAwC,YAAY,MAAM;AAC9D,eAAW,KAAK;AAAA,EAClB,GAAG,CAAC,UAAU,CAAC;AAEf,QAAM,mBAA4C,YAAY,MAAM;AAClE,eAAW,KAAK;AAAA,EAClB,GAAG,CAAC,CAAC;AAEL,QAAM,UAAU,uBAAuB,MAAM;AAAA,IAC3C,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,QAAQ;AAAA,EACV,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,WAAW,UAAU,6BAA6B;AAAA,MAC7D,cAAc,MAAM,WAAW,IAAI;AAAA,MACnC,cAAc,MAAM,WAAW,KAAK;AAAA,MACpC,eAAa,wBAAwB;AAAA,MAEnC;AAAA,oBAAW,YACX;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACT,GAAG;AAAA,YACH,GAAG;AAAA,YACJ,aAAY;AAAA,YACZ,OAAO,EAAE,OAAO,QAAQ,IAAI,UAAU,SAAS,UAAU,OAAO;AAAA,YAChE,OAAO;AAAA;AAAA,QACT;AAAA,QAEF,oBAAC,SAAI,KAAK,UAAU,OAAO,EAAE,OAAO,cAAc,GAChD,8BAAC,mBAAgB,YAAY,cAAc,CAAC,WAAW,CAAC,SAAU,sBAAW,GAC/E;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,wBAAwB,YAAY;AACpC,wBAAwB,cAAc;AACtC,MAAM,sCAAsC,SAAS,uBAAuB;AAE5E,oCAAoC,YAAY;AAEhD,IAAO,kCAAQ;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/page-header-editable-title/index.ts"],
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { PageHeaderEditableTitle, DSPageHeaderEditableTitleWithSchema } from './PageHeaderEditableTitle.js';\nexport type { PageHeaderEditableTitleT } from './react-desc-prop-types.js';\n"],
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,yBAAyB,2CAA2C;",
|
6
|
+
"names": []
|
7
|
+
}
|