@progressive-development/pd-content 0.5.9 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/generated/locale-codes.d.ts +14 -0
  2. package/dist/generated/locale-codes.d.ts.map +1 -0
  3. package/dist/generated/locales/be.d.ts +5 -0
  4. package/dist/generated/locales/be.d.ts.map +1 -0
  5. package/dist/generated/locales/de.d.ts +5 -0
  6. package/dist/generated/locales/de.d.ts.map +1 -0
  7. package/dist/generated/locales/en.d.ts +5 -0
  8. package/dist/generated/locales/en.d.ts.map +1 -0
  9. package/dist/index.d.ts +10 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +5 -5
  12. package/dist/locales/be.d.ts +2 -0
  13. package/dist/locales/de.d.ts +2 -0
  14. package/dist/locales/en.d.ts +2 -0
  15. package/dist/pd-box-view.d.ts +6 -0
  16. package/dist/pd-box-view.d.ts.map +1 -0
  17. package/dist/pd-box-view.js +33 -4
  18. package/dist/pd-collapse.d.ts +31 -0
  19. package/dist/pd-collapse.d.ts.map +1 -0
  20. package/dist/pd-collapse.js +151 -4
  21. package/dist/pd-edit-content.d.ts +29 -0
  22. package/dist/pd-edit-content.d.ts.map +1 -0
  23. package/dist/pd-edit-content.js +224 -4
  24. package/dist/pd-more-info.d.ts +23 -0
  25. package/dist/pd-more-info.d.ts.map +1 -0
  26. package/dist/pd-more-info.js +83 -4
  27. package/dist/pd-panel-viewer.d.ts +17 -0
  28. package/dist/pd-panel-viewer.d.ts.map +1 -0
  29. package/dist/pd-panel-viewer.js +207 -0
  30. package/dist/pd-panel.d.ts +6 -0
  31. package/dist/pd-panel.d.ts.map +1 -0
  32. package/dist/pd-panel.js +48 -0
  33. package/dist/pd-resize-content.d.ts +25 -0
  34. package/dist/pd-resize-content.d.ts.map +1 -0
  35. package/dist/pd-resize-content.js +64 -4
  36. package/dist/pd-tab.d.ts +19 -0
  37. package/dist/pd-tab.d.ts.map +1 -0
  38. package/dist/pd-tab.js +182 -0
  39. package/dist/stories/pd-box-view.stories.d.ts +10 -0
  40. package/dist/stories/pd-box-view.stories.d.ts.map +1 -0
  41. package/dist/stories/pd-collapse.stories.d.ts +21 -0
  42. package/dist/stories/pd-collapse.stories.d.ts.map +1 -0
  43. package/dist/stories/pd-edit-content.stories.d.ts +11 -0
  44. package/dist/stories/pd-edit-content.stories.d.ts.map +1 -0
  45. package/dist/stories/pd-more-info.stories.d.ts +6 -0
  46. package/dist/stories/pd-more-info.stories.d.ts.map +1 -0
  47. package/dist/stories/pd-resize-content.stories.d.ts +5 -0
  48. package/dist/stories/pd-resize-content.stories.d.ts.map +1 -0
  49. package/dist/stories/pd-tab.stories.d.ts +23 -0
  50. package/dist/stories/pd-tab.stories.d.ts.map +1 -0
  51. package/dist/types.d.ts +21 -0
  52. package/dist/types.d.ts.map +1 -0
  53. package/package.json +34 -45
  54. package/dist/src/PdBoxView.js +0 -24
  55. package/dist/src/PdCollapse.js +0 -135
  56. package/dist/src/PdEditContent.js +0 -223
  57. package/dist/src/PdMoreInfo.js +0 -77
  58. package/dist/src/PdResizeContent.js +0 -67
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-box-view.stories.d.ts","sourceRoot":"","sources":["../../src/stories/pd-box-view.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,mBAAmB,CAAC;AAE3B,QAAA,MAAM,IAAI;;;;CA6CM,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { StoryObj } from '@storybook/web-components';
2
+ declare const meta: {
3
+ title: string;
4
+ render: ({ active, header, content, }: import('@storybook/web-components').Args) => import('lit-html').TemplateResult<1>;
5
+ argTypes: {
6
+ active: {
7
+ control: "boolean";
8
+ };
9
+ header: {
10
+ control: "text";
11
+ };
12
+ content: {
13
+ control: "text";
14
+ };
15
+ };
16
+ };
17
+ export default meta;
18
+ type Story = StoryObj;
19
+ export declare const Closed: Story;
20
+ export declare const Open: Story;
21
+ //# sourceMappingURL=pd-collapse.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-collapse.stories.d.ts","sourceRoot":"","sources":["../../src/stories/pd-collapse.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,mBAAmB,CAAC;AAE3B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;CAiBM,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAMlB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Meta, StoryFn } from '@storybook/web-components';
2
+ declare const _default: Meta;
3
+ export default _default;
4
+ export declare const Default: StoryFn<any>;
5
+ export declare const WithEditLinks: StoryFn<any>;
6
+ export declare const EditDisabled: StoryFn<any>;
7
+ export declare const WithoutStepNumber: StoryFn<any>;
8
+ export declare const CustomSlotContent: StoryFn<any>;
9
+ export declare const EditContent: () => import('lit-html').TemplateResult<1>;
10
+ export declare const NumberEditContent: () => import('lit-html').TemplateResult<1>;
11
+ //# sourceMappingURL=pd-edit-content.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-edit-content.stories.d.ts","sourceRoot":"","sources":["../../src/stories/pd-edit-content.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAI/D,OAAO,uBAAuB,CAAC;wBAS1B,IAAI;AAPT,wBAOU;AA+FV,eAAO,MAAM,OAAO,cAAoB,CAAC;AASzC,eAAO,MAAM,aAAa,cAAoB,CAAC;AAS/C,eAAO,MAAM,YAAY,cAAoB,CAAC;AAS9C,eAAO,MAAM,iBAAiB,cAAoB,CAAC;AAQnD,eAAO,MAAM,iBAAiB,cAAoB,CAAC;AAenD,eAAO,MAAM,WAAW,4CAsDvB,CAAC;AAGF,eAAO,MAAM,iBAAiB,4CA0B7B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryFn } from '@storybook/web-components';
2
+ declare const _default: Meta;
3
+ export default _default;
4
+ export declare const Default: StoryFn;
5
+ export declare const WithLongContent: StoryFn;
6
+ //# sourceMappingURL=pd-more-info.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-more-info.stories.d.ts","sourceRoot":"","sources":["../../src/stories/pd-more-info.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,oBAAoB,CAAC;wBAQvB,IAAI;AANT,wBAMU;AAyCV,eAAO,MAAM,OAAO,SAAoB,CAAC;AAGzC,eAAO,MAAM,eAAe,SAA+B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Meta, StoryFn } from '@storybook/web-components';
2
+ declare const _default: Meta;
3
+ export default _default;
4
+ export declare const Default: StoryFn;
5
+ //# sourceMappingURL=pd-resize-content.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-resize-content.stories.d.ts","sourceRoot":"","sources":["../../src/stories/pd-resize-content.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,sBAAsB,CAAC;wBAWzB,IAAI;AATT,wBASU;AAqBV,eAAO,MAAM,OAAO,SAAoB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { StoryObj } from '@storybook/web-components';
2
+ declare const meta: {
3
+ title: string;
4
+ render: (args: import('@storybook/web-components').Args) => import('lit-html').TemplateResult<1>;
5
+ argTypes: {
6
+ backgroundColor: {
7
+ control: "color";
8
+ };
9
+ onClick: {
10
+ action: string;
11
+ };
12
+ size: {
13
+ control: {
14
+ type: "select";
15
+ };
16
+ options: string[];
17
+ };
18
+ };
19
+ };
20
+ export default meta;
21
+ type Story = StoryObj;
22
+ export declare const TabDefault: Story;
23
+ //# sourceMappingURL=pd-tab.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-tab.stories.d.ts","sourceRoot":"","sources":["../../src/stories/pd-tab.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,cAAc,CAAC;AAGtB,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;CAqBM,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,UAAU,EAAE,KAiBxB,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Typdefinitionen für die PdCollapse Komponente
3
+ */
4
+ export interface PdCollapseToggleEventDetail {
5
+ /**
6
+ * Gibt den neuen aktiven Zustand an.
7
+ * `true` wenn geöffnet, `false` wenn geschlossen.
8
+ */
9
+ detail: boolean;
10
+ }
11
+ export interface PdEditLink {
12
+ key: string;
13
+ txt: string;
14
+ icon?: unknown;
15
+ defaultIcon?: boolean;
16
+ }
17
+ export interface PdEditContentDataEntry {
18
+ name: string;
19
+ val: string;
20
+ }
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb"}
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@progressive-development/pd-content",
3
+ "version": "0.6.1",
3
4
  "description": "Progressive Development content components. ",
4
5
  "author": "PD Progressive Development",
5
6
  "license": "SEE LICENSE IN LICENSE",
6
- "version": "0.5.9",
7
7
  "main": "./dist/index.js",
8
8
  "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
9
10
  "exports": {
10
11
  ".": "./dist/index.js",
11
12
  "./pd-box-view": "./dist/pd-box-view.js",
@@ -13,6 +14,9 @@
13
14
  "./pd-edit-content": "./dist/pd-edit-content.js",
14
15
  "./pd-more-info": "./dist/pd-more-info.js",
15
16
  "./pd-resize-content": "./dist/pd-resize-content.js",
17
+ "./pd-tab": "./dist/pd-tab.js",
18
+ "./pd-panel-viewer": "./dist/pd-panel-viewer.js",
19
+ "./pd-panel": "./dist/pd-panel.js",
16
20
  "./locales/be": "./dist/locales/be.js",
17
21
  "./locales/de": "./dist/locales/de.js",
18
22
  "./locales/en": "./dist/locales/en.js"
@@ -24,71 +28,56 @@
24
28
  "LICENSE"
25
29
  ],
26
30
  "scripts": {
27
- "analyze": "cem analyze --litelement",
31
+ "analyze": "cem analyze --litelement --exclude dist,demo",
28
32
  "start": "vite",
29
33
  "build": "vite build",
30
34
  "preview": "vite preview",
31
- "lint": "eslint --ext .js,.html . --ignore-path .gitignore && prettier \"**/*.{js,html}\" --check --ignore-path .gitignore",
32
- "format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.{js,html}\" --write --ignore-path .gitignore",
35
+ "clean": "rm -rf dist",
36
+ "lint": "eslint --ext .ts,.html src --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
37
+ "format": "eslint --ext .ts,.html src --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
33
38
  "test": "vitest run --coverage",
34
39
  "test:watch": "vitest --watch",
40
+ "check": "npm run lint && npm run build",
41
+ "prepublishOnly": "npm run clean && npm run check",
35
42
  "localizeExtract": "lit-localize extract",
36
43
  "localizeBuild": "lit-localize build",
37
44
  "storybook": "storybook dev -p 6006",
38
45
  "build-storybook": "storybook build"
39
46
  },
40
47
  "dependencies": {
41
- "@lit/localize": "^0.11.4",
42
- "@progressive-development/pd-dialog": "^0.5.8",
43
- "@progressive-development/pd-icon": "^0.5.0",
44
- "@progressive-development/pd-shared-styles": "^0.1.1",
45
- "lit": "^2.8.0",
48
+ "@lit/localize": "^0.12.2",
49
+ "@progressive-development/pd-dialog": "^0.6.0",
50
+ "@progressive-development/pd-icon": "^0.6.1",
51
+ "@progressive-development/pd-shared-styles": "^0.2.1",
52
+ "hammerjs": "^2.0.8",
53
+ "lit": "^3.3.0",
46
54
  "pwa-helpers": "^0.9.1"
47
55
  },
48
56
  "devDependencies": {
49
- "@chromatic-com/storybook": "^1.3.4",
57
+ "@types/hammerjs": "^2.0.46",
58
+ "@chromatic-com/storybook": "^1.9.0",
50
59
  "@custom-elements-manifest/analyzer": "^0.4.17",
51
60
  "@lit/localize-tools": "^0.6.10",
52
- "@storybook/addon-essentials": "^8.0.10",
53
- "@storybook/addon-links": "^8.0.10",
61
+ "@storybook/addon-essentials": "^8.6.14",
62
+ "@storybook/addon-links": "^8.6.14",
54
63
  "@storybook/blocks": "^8.0.10",
55
- "@storybook/test": "^8.0.10",
64
+ "@storybook/test": "^8.6.14",
56
65
  "@storybook/web-components": "^8.0.10",
57
- "@storybook/web-components-vite": "^8.0.10",
58
- "eslint": "^7.32.0",
59
- "eslint-config-prettier": "^8.10.0",
66
+ "@storybook/web-components-vite": "^8.6.14",
67
+ "@typescript-eslint/eslint-plugin": "^8.32.1",
68
+ "@typescript-eslint/parser": "^8.32.1",
69
+ "eslint": "^8.57.1",
70
+ "eslint-config-prettier": "^9.1.0",
60
71
  "eslint-plugin-storybook": "^0.8.0",
61
- "husky": "^4.3.8",
62
- "lint-staged": "^10.5.4",
63
- "prettier": "^2.8.8",
64
- "rollup-plugin-visualizer": "^5.13.1",
65
- "storybook": "^8.0.10",
66
- "vite": "^5.4.11",
67
- "vitest": "^2.1.8"
72
+ "prettier": "^3.5.3",
73
+ "rollup-plugin-visualizer": "^5.14.0",
74
+ "storybook": "^8.6.14",
75
+ "typescript": "^5.8.3",
76
+ "vite": "^5.4.19",
77
+ "vite-plugin-dts": "^4.5.4",
78
+ "vitest": "^2.1.9"
68
79
  },
69
80
  "customElements": "custom-elements.json",
70
- "eslintConfig": {
71
- "extends": [
72
- "@open-wc",
73
- "prettier",
74
- "plugin:storybook/recommended"
75
- ]
76
- },
77
- "prettier": {
78
- "singleQuote": true,
79
- "arrowParens": "avoid"
80
- },
81
- "husky": {
82
- "hooks": {
83
- "pre-commit": "lint-staged"
84
- }
85
- },
86
- "lint-staged": {
87
- "*.js": [
88
- "eslint --fix",
89
- "prettier --write"
90
- ]
91
- },
92
81
  "keywords": [
93
82
  "pd",
94
83
  "progressive",
@@ -1,24 +0,0 @@
1
- import { LitElement, css, html } from "lit";
2
- class PdBoxView extends LitElement {
3
- static get styles() {
4
- return [
5
- css`
6
- :host {
7
- display: grid;
8
- grid-template-columns: repeat(
9
- var(--pd-box-columns, 4),
10
- minmax(var(--pd-box-min-width, 100px), 1fr)
11
- );
12
- /*grid-auto-rows: minmax(var(--squi-box-min-height, 100px), 1fr); Für mobile 1 cloum auskommentiert, ging auch für große Ansicht, also eher hinderlich?*/
13
- gap: var(--pd-box-gap, 25px);
14
- }
15
- `
16
- ];
17
- }
18
- render() {
19
- return html` <slot></slot> `;
20
- }
21
- }
22
- export {
23
- PdBoxView
24
- };
@@ -1,135 +0,0 @@
1
- import { LitElement, css, html } from "lit";
2
- import { ICON_TOGGLE_COLLAPSE } from "@progressive-development/pd-icon";
3
- import "@progressive-development/pd-icon/pd-icon";
4
- import { PDColorStyles, PDFontStyles } from "@progressive-development/pd-shared-styles";
5
- /**
6
- * @license
7
- * Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
8
- */
9
- class PdCollapse extends LitElement {
10
- static get properties() {
11
- return {
12
- active: { type: Boolean },
13
- icon: { type: String }
14
- };
15
- }
16
- constructor() {
17
- super();
18
- this.active = false;
19
- }
20
- static get styles() {
21
- return [
22
- PDColorStyles,
23
- PDFontStyles,
24
- css`
25
- :host {
26
- display: block;
27
- width: 100%;
28
- position: relative;
29
- overflow: visible;
30
- }
31
-
32
- :host .content.open {
33
- border: 2px solid var(--pd-default-light-col);
34
- background: var(--pd-collapse-content-bg-col, var(--pd-default-bg-col));
35
- margin-bottom: 1rem;
36
- position: relative;
37
- overflow: visible;
38
- }
39
-
40
- pd-icon {
41
- --pd-icon-stroke-col-active: var(--pd-default-bg-col);
42
- --pd-icon-col-active: var(--pd-default-dark-col);
43
- --pd-icon-col-hover: var(--pd-default-dark-col);
44
- --pd-icon-stroke-col-hover: var(--pd-default-hover-col);
45
- --pd-icon-col-active-hover: var(--pd-default-dark-col);
46
- --pd-icon-stroke-col-active-hover: var(--pd-default-hover-col);
47
- }
48
-
49
- .trigger {
50
- background: var(--pd-collapse-bg-col, var(--pd-default-col));
51
- font-family: var(--pd-default-font-title-family);
52
- font-weight: bold;
53
- color: var(--pd-collapse-font-col, var(--pd-default-bg-col));
54
- transition-property: box-shadow, background;
55
- transition: 0.2s ease-in;
56
- cursor: pointer;
57
- font-size: var(--pd-collapse-header-font-size, 1rem);
58
- padding: 0.5rem;
59
- display: flex;
60
- justify-content: space-between;
61
- box-sizing: border-box;
62
- position: relative;
63
- }
64
-
65
- ::slotted(.header) {
66
- display: flex;
67
- align-items: center;
68
- }
69
-
70
- .trigger:hover {
71
- background: var(--pd-collapse-hover-col, var(--pd-default-dark-col));
72
- }
73
-
74
- .trigger.closed {
75
- margin-bottom: 1rem;
76
- }
77
-
78
- .content {
79
- will-change: transform;
80
- height: 0;
81
- overflow: hidden;
82
- transition-property: visibility, transform;
83
- transition-duration: 0.2s;
84
- visibility: hidden;
85
- transform: translate3d(0, -100%, 0);
86
- box-sizing: border-box;
87
-
88
- padding: 0.5em;
89
- }
90
-
91
- .content.open {
92
- visibility: visible;
93
- height: auto;
94
- transform: translate3d(0, 0, 0);
95
- overflow-y: auto;
96
- }
97
- `
98
- ];
99
- }
100
- open() {
101
- this.active = true;
102
- }
103
- close() {
104
- this.active = false;
105
- }
106
- onClick() {
107
- this.active = !this.active;
108
- this.dispatchEvent(
109
- new CustomEvent("toggle-accordion", {
110
- bubbles: true,
111
- composed: true,
112
- detail: this.active
113
- })
114
- );
115
- }
116
- render() {
117
- return html`<div
118
- class="trigger ${this.active ? "open" : "closed"}"
119
- @click="${this.onClick}"
120
- >
121
- <slot name="header"></slot>
122
- <pd-icon
123
- icon="${ICON_TOGGLE_COLLAPSE}"
124
- ?activeIcon="${this.active}"
125
- class="small primary"
126
- ></pd-icon>
127
- </div>
128
- <div class="content ${this.active ? "open" : "closed"}">
129
- <slot name="content"></slot>
130
- </div> `;
131
- }
132
- }
133
- export {
134
- PdCollapse
135
- };
@@ -1,223 +0,0 @@
1
- import { html, LitElement, css } from "lit";
2
- import { PDColorStyles, PDFontStyles } from "@progressive-development/pd-shared-styles";
3
- /**
4
- * @license
5
- * Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
6
- */
7
- const editIcon = html`<svg
8
- class="edit"
9
- id="Layer_1"
10
- version="1.1"
11
- viewBox="0 0 19 19"
12
- xml:space="preserve"
13
- xmlns="http://www.w3.org/2000/svg"
14
- xmlns:xlink="http://www.w3.org/1999/xlink"
15
- >
16
- <g>
17
- <path
18
- d="M8.44,7.25C8.348,7.342,8.277,7.447,8.215,7.557L8.174,7.516L8.149,7.69 C8.049,7.925,8.014,8.183,8.042,8.442l-0.399,2.796l2.797-0.399c0.259,0.028,0.517-0.007,0.752-0.107l0.174-0.024l-0.041-0.041 c0.109-0.062,0.215-0.133,0.307-0.225l5.053-5.053l-3.191-3.191L8.44,7.25z"
19
- fill="var(--edit-fill-color)"
20
- />
21
- <path
22
- d="M18.183,1.568l-0.87-0.87c-0.641-0.641-1.637-0.684-2.225-0.097l-0.797,0.797l3.191,3.191l0.797-0.798 C18.867,3.205,18.824,2.209,18.183,1.568z"
23
- fill="var(--edit-fill-color)"
24
- />
25
- <path
26
- d="M15,9.696V17H2V2h8.953l1.523-1.42c0.162-0.161,0.353-0.221,0.555-0.293 c0.043-0.119,0.104-0.18,0.176-0.287H0v19h17V7.928L15,9.696z"
27
- fill="var(--edit-fill-color)"
28
- />
29
- </g>
30
- </svg>`;
31
- class PdEditContent extends LitElement {
32
- /**
33
- * @event edit-content
34
- */
35
- static get styles() {
36
- return [
37
- PDColorStyles,
38
- PDFontStyles,
39
- css`
40
- :host {
41
- display: block;
42
- }
43
-
44
- h4 {
45
- font-family: var(--pd-default-font-title-family);
46
- font-size: var(--pd-ec-font-title-size, 1.2em);
47
- margin-top: 0px;
48
- margin-bottom: 2px;
49
- line-height: 40px;
50
- color: var(--pd-ec-font-title-col, var(--pd-default-bg-col));
51
- padding-left: 5px;
52
- }
53
-
54
- .header {
55
- display: flex;
56
- gap: 5px;
57
- background-color: var(--pd-ec-bg-col, var(--pd-default-col));
58
- align-items: center;
59
- }
60
-
61
- .circle {
62
- margin-left: 5px;
63
- display: flex;
64
- align-items: center;
65
- justify-content: center;
66
- width: 27px;
67
- height: 27px;
68
- border-radius: 50%;
69
- background-color: var(--pd-ec-font-title-col, var(--pd-default-bg-col));
70
- }
71
-
72
- .step-number {
73
- font-family: var(--pd-default-font-title-family);
74
- font-size: var(--pd-ec-font-title-size, 1.2em);
75
- font-weight: var(--pd-ec-nr-font-weight, bold); ;
76
- color: var(--pd-ec-bg-col, var(--pd-default-col));
77
- }
78
-
79
- /* Temporär? Hier noch sehr aufwendig mit div/span? */
80
-
81
- .label {
82
- display: inline-block;
83
- font-weight: bold;
84
- width: 200px;
85
- padding-top: 10px;
86
- }
87
-
88
- /* Temporär */
89
- a {
90
- cursor: pointer;
91
- font-family: var(--pd-default-font-link-family);
92
- font-size: var(--pd-default-font-link-size);
93
- color: var(--pd-default-font-link-col);
94
- --edit-fill-color: var(--pd-default-font-link-col);
95
- }
96
- a:hover {
97
- color: var(--pd-default-font-link-col-hover);
98
- --edit-fill-color: var(--pd-default-font-link-col-hover);
99
- }
100
-
101
- .edit {
102
- width: 1.1em;
103
- }
104
- /*
105
- could used as class for given svg icons, workaround class
106
- hard coded for specific icon => maybe use custom properties here, but not for that hack...
107
- */
108
- .own-edit-icon {
109
- width: 2em;
110
- margin-top: -10px;
111
- }
112
-
113
- .link-row {
114
- padding-top: 5px;
115
- padding-bottom: 5px;
116
- display: flex;
117
- flex-wrap: wrap;
118
- gap: 15px;
119
- }
120
-
121
- .link-item {
122
- display: flex;
123
- gap: 2px;
124
- white-space: nowrap;
125
- align-items: center;
126
- pointer-events: none;
127
- }
128
-
129
- .param-data {
130
- padding-bottom: 10px;
131
- }
132
-
133
- @media (max-width: 360px) {
134
- .label {
135
- width: 130px;
136
- }
137
- }
138
- `
139
- ];
140
- }
141
- static get properties() {
142
- return {
143
- stepNumber: { type: Number },
144
- contentTitle: { type: String },
145
- data: { type: Array },
146
- editLinks: { type: Array },
147
- // TODO: [TIM-37] Put together with edit icon/editDisabled
148
- editDisabled: { type: Boolean }
149
- };
150
- }
151
- constructor() {
152
- super();
153
- this.stepNumber = void 0;
154
- this.contentTitle = "";
155
- this.data = [];
156
- this.editLinks = [];
157
- this.editDisabled = false;
158
- }
159
- render() {
160
- return html`
161
- <div class="header">
162
- ${this.stepNumber ? html`
163
- <div class="circle">
164
- <span class="step-number">${this.stepNumber}</span>
165
- </div>
166
- ` : ""}
167
- <h4>${this.contentTitle}</h4>
168
- </div>
169
- <div>
170
- ${this.data ? html`
171
- <div class="param-data">
172
- ${this.data.map(
173
- (dataEntry) => html`
174
- <div>
175
- <span class="label">${dataEntry.name}</span>
176
- <span class="value">${dataEntry.val}</span>
177
- </div>
178
- `
179
- )}
180
- </div>` : ""}
181
- <slot></slot>
182
- <div class="link-row">
183
- ${this.editDisabled ? "" : html`
184
- <a @click="${this._editContent}">
185
- <div class="link-item">${editIcon} Bewerk ${this.contentTitle}</div>
186
- </a>
187
- `}
188
- ${this.editLinks.map(
189
- (link) => html`
190
- <a data-link="${link.key}" @click="${this._editContent}">
191
- <div class="link-item">${PdEditContent._getLinkLogo(link)} ${link.txt}</div>
192
- </a>`
193
- )}
194
- </div>
195
- </div>
196
- `;
197
- }
198
- static _getLinkLogo(link) {
199
- if (link.icon) {
200
- return link.icon;
201
- }
202
- if (link.defaultIcon) {
203
- return editIcon;
204
- }
205
- return "";
206
- }
207
- _editContent(e) {
208
- const { link } = e.target.dataset;
209
- this.dispatchEvent(
210
- new CustomEvent("edit-content", {
211
- detail: {
212
- step: this.stepNumber,
213
- link
214
- },
215
- bubbles: true,
216
- composed: true
217
- })
218
- );
219
- }
220
- }
221
- export {
222
- PdEditContent
223
- };