@carbon/charts-angular 1.8.0 → 1.9.0-rc.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/.eslintrc.json +51 -0
- package/.storybook/carbon-charts-theme.ts +8 -0
- package/.storybook/main.ts +39 -0
- package/.storybook/manager-head.html +22 -0
- package/.storybook/manager.ts +6 -0
- package/.storybook/preview-head.html +6 -0
- package/.storybook/preview.ts +42 -0
- package/.storybook/tsconfig.json +21 -0
- package/.storybook/typings.d.ts +4 -0
- package/README.md +0 -2
- package/angular.json +91 -0
- package/carbon.yml +277 -0
- package/ng-package.json +14 -0
- package/package.json +89 -63
- package/src/index.ts +53 -0
- package/src/lib/charts/alluvial-chart.component.ts +30 -0
- package/src/lib/charts/area-chart-stacked.component.ts +30 -0
- package/src/lib/charts/area-chart.component.ts +30 -0
- package/src/lib/charts/bar-chart-grouped.component.ts +30 -0
- package/src/lib/charts/bar-chart-simple.component.ts +30 -0
- package/src/lib/charts/bar-chart-stacked.component.ts +30 -0
- package/src/lib/charts/base-chart.component.ts +91 -0
- package/src/lib/charts/boxplot-chart.component.ts +30 -0
- package/src/lib/charts/bubble-chart.component.ts +30 -0
- package/src/lib/charts/bullet-chart.component.ts +30 -0
- package/src/lib/charts/charts.module.ts +92 -0
- package/src/lib/charts/choropleth.component.ts +33 -0
- package/src/lib/charts/circle-pack-chart.component.ts +30 -0
- package/src/lib/charts/combo-chart.component.ts +30 -0
- package/src/lib/charts/donut-chart.component.ts +30 -0
- package/src/lib/charts/gauge-chart.component.ts +30 -0
- package/src/lib/charts/heatmap-chart.component.ts +30 -0
- package/src/lib/charts/histogram-chart.component.ts +30 -0
- package/src/lib/charts/index.ts +28 -0
- package/src/lib/charts/line-chart.component.ts +30 -0
- package/src/lib/charts/lollipop-chart.component.ts +30 -0
- package/src/lib/charts/meter-chart.component.ts +30 -0
- package/src/lib/charts/pie-chart.component.ts +30 -0
- package/src/lib/charts/radar-chart.component.ts +30 -0
- package/src/lib/charts/scatter-chart.component.ts +30 -0
- package/src/lib/charts/tree-chart.component.ts +30 -0
- package/src/lib/charts/treemap-chart.component.ts +30 -0
- package/src/lib/charts/wordcloud-chart.component.ts +30 -0
- package/src/lib/diagrams/config.ts +1 -0
- package/src/lib/diagrams/edges/edge.component.ts +41 -0
- package/src/lib/diagrams/edges/edge.module.ts +11 -0
- package/src/lib/diagrams/edges/marker/marker.component.ts +112 -0
- package/src/lib/diagrams/edges/marker/marker.module.ts +43 -0
- package/src/lib/diagrams/index.ts +23 -0
- package/src/lib/diagrams/nodes/cards/card-node-column.component.ts +22 -0
- package/src/lib/diagrams/nodes/cards/card-node-label.component.ts +14 -0
- package/src/lib/diagrams/nodes/cards/card-node-subtitle.component.ts +14 -0
- package/src/lib/diagrams/nodes/cards/card-node-title.component.ts +14 -0
- package/src/lib/diagrams/nodes/cards/card-node.component.ts +98 -0
- package/src/lib/diagrams/nodes/cards/card-node.module.ts +32 -0
- package/src/lib/diagrams/nodes/shape/shape-node.component.ts +120 -0
- package/src/lib/diagrams/nodes/shape/shape-node.module.ts +11 -0
- package/src/lib/index.ts +50 -0
- package/src/stories/0-api.stories.mdx +69 -0
- package/src/stories/1-color-palette.stories.mdx +73 -0
- package/src/stories/2-combo-charts.stories.mdx +107 -0
- package/src/stories/3-dual-axes-charts.stories.mdx +51 -0
- package/src/stories/4-event-listeners.stories.mdx +26 -0
- package/src/stories/5-tabular-data-format.stories.mdx +132 -0
- package/src/stories/6-themes.stories.mdx +50 -0
- package/src/stories/all.stories.ts +104 -0
- package/src/stories/angular.stories.mdx +136 -0
- package/src/stories/diagrams/0-diagrams-start-here.stories.ts +219 -0
- package/src/stories/diagrams/diagrams-edges-marker.stories.ts +189 -0
- package/src/stories/diagrams/diagrams-edges.stories.ts +177 -0
- package/src/stories/diagrams/diagrams-nodes-card.stories.ts +245 -0
- package/src/stories/diagrams/diagrams-nodes-shape.stories.ts +141 -0
- package/src/stories/diagrams/utils.ts +5 -0
- package/src/test.ts +28 -0
- package/tsconfig.json +43 -0
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +17 -0
- package/tsconfig.vite.json +13 -0
- package/vite.config.ts +22 -0
- package/LICENSE.md +0 -201
- package/alluvial-chart.component.d.ts +0 -13
- package/area-chart-stacked.component.d.ts +0 -13
- package/area-chart.component.d.ts +0 -13
- package/bar-chart-grouped.component.d.ts +0 -13
- package/bar-chart-simple.component.d.ts +0 -13
- package/bar-chart-stacked.component.d.ts +0 -13
- package/base-chart.component.d.ts +0 -44
- package/boxplot-chart.component.d.ts +0 -13
- package/bubble-chart.component.d.ts +0 -13
- package/bullet-chart.component.d.ts +0 -13
- package/bundles/carbon-charts-angular.umd.js +0 -2156
- package/bundles/carbon-charts-angular.umd.js.map +0 -1
- package/bundles/carbon-charts-angular.umd.min.js +0 -16
- package/bundles/carbon-charts-angular.umd.min.js.map +0 -1
- package/carbon-charts-angular.d.ts +0 -5
- package/carbon-charts-angular.metadata.json +0 -1
- package/charts.module.d.ts +0 -2
- package/choropleth.component.d.ts +0 -13
- package/circle-pack-chart.component.d.ts +0 -13
- package/combo-chart.component.d.ts +0 -13
- package/diagrams/card-node/card-node-column.component.d.ts +0 -4
- package/diagrams/card-node/card-node-label.component.d.ts +0 -3
- package/diagrams/card-node/card-node-subtitle.component.d.ts +0 -3
- package/diagrams/card-node/card-node-title.component.d.ts +0 -3
- package/diagrams/card-node/card-node.component.d.ts +0 -17
- package/diagrams/card-node/card-node.module.d.ts +0 -8
- package/diagrams/configs.d.ts +0 -1
- package/diagrams/edge/edge.component.d.ts +0 -17
- package/diagrams/edge/edge.module.d.ts +0 -3
- package/diagrams/marker/marker.component.d.ts +0 -37
- package/diagrams/marker/marker.module.d.ts +0 -4
- package/diagrams/shape-node/shape-node.component.d.ts +0 -22
- package/diagrams/shape-node/shape-node.module.d.ts +0 -3
- package/donut-chart.component.d.ts +0 -13
- package/esm2015/alluvial-chart.component.js +0 -33
- package/esm2015/area-chart-stacked.component.js +0 -33
- package/esm2015/area-chart.component.js +0 -36
- package/esm2015/bar-chart-grouped.component.js +0 -33
- package/esm2015/bar-chart-simple.component.js +0 -33
- package/esm2015/bar-chart-stacked.component.js +0 -33
- package/esm2015/base-chart.component.js +0 -137
- package/esm2015/boxplot-chart.component.js +0 -33
- package/esm2015/bubble-chart.component.js +0 -33
- package/esm2015/bullet-chart.component.js +0 -33
- package/esm2015/carbon-charts-angular.js +0 -11
- package/esm2015/charts.module.js +0 -97
- package/esm2015/choropleth.component.js +0 -33
- package/esm2015/circle-pack-chart.component.js +0 -33
- package/esm2015/combo-chart.component.js +0 -33
- package/esm2015/diagrams/card-node/card-node-column.component.js +0 -41
- package/esm2015/diagrams/card-node/card-node-label.component.js +0 -27
- package/esm2015/diagrams/card-node/card-node-subtitle.component.js +0 -27
- package/esm2015/diagrams/card-node/card-node-title.component.js +0 -27
- package/esm2015/diagrams/card-node/card-node.component.js +0 -148
- package/esm2015/diagrams/card-node/card-node.module.js +0 -23
- package/esm2015/diagrams/configs.js +0 -8
- package/esm2015/diagrams/edge/edge.component.js +0 -80
- package/esm2015/diagrams/edge/edge.module.js +0 -19
- package/esm2015/diagrams/marker/marker.component.js +0 -141
- package/esm2015/diagrams/marker/marker.module.js +0 -35
- package/esm2015/diagrams/shape-node/shape-node.component.js +0 -187
- package/esm2015/diagrams/shape-node/shape-node.module.js +0 -19
- package/esm2015/donut-chart.component.js +0 -33
- package/esm2015/gauge-chart.component.js +0 -33
- package/esm2015/heatmap-chart.component.js +0 -33
- package/esm2015/histogram-chart.component.js +0 -33
- package/esm2015/index.js +0 -45
- package/esm2015/line-chart.component.js +0 -33
- package/esm2015/lollipop-chart.component.js +0 -33
- package/esm2015/meter-chart.component.js +0 -33
- package/esm2015/pie-chart.component.js +0 -33
- package/esm2015/radar-chart.component.js +0 -33
- package/esm2015/scatter-chart.component.js +0 -33
- package/esm2015/tree-chart.component.js +0 -33
- package/esm2015/treemap-chart.component.js +0 -33
- package/esm2015/wordcloud-chart.component.js +0 -33
- package/esm5/alluvial-chart.component.js +0 -47
- package/esm5/area-chart-stacked.component.js +0 -47
- package/esm5/area-chart.component.js +0 -47
- package/esm5/bar-chart-grouped.component.js +0 -47
- package/esm5/bar-chart-simple.component.js +0 -47
- package/esm5/bar-chart-stacked.component.js +0 -47
- package/esm5/base-chart.component.js +0 -160
- package/esm5/boxplot-chart.component.js +0 -47
- package/esm5/bubble-chart.component.js +0 -47
- package/esm5/bullet-chart.component.js +0 -47
- package/esm5/carbon-charts-angular.js +0 -11
- package/esm5/charts.module.js +0 -101
- package/esm5/choropleth.component.js +0 -47
- package/esm5/circle-pack-chart.component.js +0 -47
- package/esm5/combo-chart.component.js +0 -47
- package/esm5/diagrams/card-node/card-node-column.component.js +0 -43
- package/esm5/diagrams/card-node/card-node-label.component.js +0 -25
- package/esm5/diagrams/card-node/card-node-subtitle.component.js +0 -25
- package/esm5/diagrams/card-node/card-node-title.component.js +0 -25
- package/esm5/diagrams/card-node/card-node.component.js +0 -86
- package/esm5/diagrams/card-node/card-node.module.js +0 -27
- package/esm5/diagrams/configs.js +0 -8
- package/esm5/diagrams/edge/edge.component.js +0 -64
- package/esm5/diagrams/edge/edge.module.js +0 -23
- package/esm5/diagrams/marker/marker.component.js +0 -188
- package/esm5/diagrams/marker/marker.module.js +0 -39
- package/esm5/diagrams/shape-node/shape-node.component.js +0 -104
- package/esm5/diagrams/shape-node/shape-node.module.js +0 -23
- package/esm5/donut-chart.component.js +0 -47
- package/esm5/gauge-chart.component.js +0 -47
- package/esm5/heatmap-chart.component.js +0 -47
- package/esm5/histogram-chart.component.js +0 -47
- package/esm5/index.js +0 -45
- package/esm5/line-chart.component.js +0 -47
- package/esm5/lollipop-chart.component.js +0 -47
- package/esm5/meter-chart.component.js +0 -47
- package/esm5/pie-chart.component.js +0 -47
- package/esm5/radar-chart.component.js +0 -47
- package/esm5/scatter-chart.component.js +0 -47
- package/esm5/tree-chart.component.js +0 -47
- package/esm5/treemap-chart.component.js +0 -47
- package/esm5/wordcloud-chart.component.js +0 -47
- package/fesm2015/carbon-charts-angular.js +0 -1722
- package/fesm2015/carbon-charts-angular.js.map +0 -1
- package/fesm5/carbon-charts-angular.js +0 -1924
- package/fesm5/carbon-charts-angular.js.map +0 -1
- package/gauge-chart.component.d.ts +0 -13
- package/heatmap-chart.component.d.ts +0 -13
- package/histogram-chart.component.d.ts +0 -13
- package/index.d.ts +0 -38
- package/line-chart.component.d.ts +0 -13
- package/lollipop-chart.component.d.ts +0 -13
- package/meter-chart.component.d.ts +0 -13
- package/pie-chart.component.d.ts +0 -13
- package/radar-chart.component.d.ts +0 -13
- package/scatter-chart.component.d.ts +0 -13
- package/tree-chart.component.d.ts +0 -13
- package/treemap-chart.component.d.ts +0 -13
- package/wordcloud-chart.component.d.ts +0 -13
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { storiesOf, moduleMetadata } from '@storybook/angular'
|
|
2
|
+
import { CardNodeModule } from '../../'
|
|
3
|
+
import { ScreenModule, ChevronDownModule } from '@carbon/icons-angular'
|
|
4
|
+
|
|
5
|
+
const getTemplate = (content: string) => `
|
|
6
|
+
<div class="container theme--white" style="max-width: 400px;">
|
|
7
|
+
${content}
|
|
8
|
+
</div>
|
|
9
|
+
`
|
|
10
|
+
|
|
11
|
+
storiesOf('Diagrams/Nodes/Card', module)
|
|
12
|
+
.addDecorator(
|
|
13
|
+
moduleMetadata({
|
|
14
|
+
imports: [CardNodeModule, ScreenModule, ChevronDownModule]
|
|
15
|
+
})
|
|
16
|
+
)
|
|
17
|
+
.add(
|
|
18
|
+
'Default',
|
|
19
|
+
() => ({
|
|
20
|
+
template: getTemplate(`
|
|
21
|
+
<ibm-diagram-card-node>
|
|
22
|
+
<ibm-diagram-card-node-column>
|
|
23
|
+
<ibm-diagram-card-node-title>
|
|
24
|
+
{{ title }}
|
|
25
|
+
</ibm-diagram-card-node-title>
|
|
26
|
+
<ibm-diagram-card-node-subtitle>
|
|
27
|
+
{{ description }}
|
|
28
|
+
</ibm-diagram-card-node-subtitle>
|
|
29
|
+
</ibm-diagram-card-node-column>
|
|
30
|
+
</ibm-diagram-card-node>
|
|
31
|
+
`),
|
|
32
|
+
props: {
|
|
33
|
+
title: 'Title',
|
|
34
|
+
description: 'Description'
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
{
|
|
38
|
+
controls: {
|
|
39
|
+
hideNoControlsWarning: true
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
.add(
|
|
44
|
+
'Stacked',
|
|
45
|
+
() => ({
|
|
46
|
+
template: getTemplate(`
|
|
47
|
+
<ibm-diagram-card-node [stacked]="stacked">
|
|
48
|
+
<ibm-diagram-card-node-column>
|
|
49
|
+
<ibm-diagram-card-node-title>
|
|
50
|
+
{{ title }}
|
|
51
|
+
</ibm-diagram-card-node-title>
|
|
52
|
+
<ibm-diagram-card-node-subtitle>
|
|
53
|
+
{{ description }}
|
|
54
|
+
</ibm-diagram-card-node-subtitle>
|
|
55
|
+
</ibm-diagram-card-node-column>
|
|
56
|
+
</ibm-diagram-card-node>
|
|
57
|
+
`),
|
|
58
|
+
props: {
|
|
59
|
+
title: 'Title',
|
|
60
|
+
description: 'Description',
|
|
61
|
+
stacked: true
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
{
|
|
65
|
+
controls: {
|
|
66
|
+
hideNoControlsWarning: true
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
.add(
|
|
71
|
+
'Color',
|
|
72
|
+
() => ({
|
|
73
|
+
template: getTemplate(`
|
|
74
|
+
<ibm-diagram-card-node [color]="color">
|
|
75
|
+
<ibm-diagram-card-node-column>
|
|
76
|
+
<ibm-diagram-card-node-title>
|
|
77
|
+
{{ title }}
|
|
78
|
+
</ibm-diagram-card-node-title>
|
|
79
|
+
<ibm-diagram-card-node-subtitle>
|
|
80
|
+
{{ description }}
|
|
81
|
+
</ibm-diagram-card-node-subtitle>
|
|
82
|
+
</ibm-diagram-card-node-column>
|
|
83
|
+
</ibm-diagram-card-node>
|
|
84
|
+
`),
|
|
85
|
+
props: {
|
|
86
|
+
title: 'Title',
|
|
87
|
+
description: 'Description',
|
|
88
|
+
color: '#8a3ffc'
|
|
89
|
+
}
|
|
90
|
+
}),
|
|
91
|
+
{
|
|
92
|
+
controls: {
|
|
93
|
+
hideNoControlsWarning: true
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
.add(
|
|
98
|
+
'With icon',
|
|
99
|
+
() => ({
|
|
100
|
+
template: getTemplate(`
|
|
101
|
+
<ibm-diagram-card-node [color]="color">
|
|
102
|
+
<ibm-diagram-card-node-column>
|
|
103
|
+
<svg ibmIconScreen size="16"></svg>
|
|
104
|
+
</ibm-diagram-card-node-column>
|
|
105
|
+
<ibm-diagram-card-node-column>
|
|
106
|
+
<ibm-diagram-card-node-title>
|
|
107
|
+
{{ title }}
|
|
108
|
+
</ibm-diagram-card-node-title>
|
|
109
|
+
<ibm-diagram-card-node-subtitle>
|
|
110
|
+
{{ description }}
|
|
111
|
+
</ibm-diagram-card-node-subtitle>
|
|
112
|
+
</ibm-diagram-card-node-column>
|
|
113
|
+
</ibm-diagram-card-node>
|
|
114
|
+
`),
|
|
115
|
+
props: {
|
|
116
|
+
title: 'Title',
|
|
117
|
+
description: 'Description'
|
|
118
|
+
}
|
|
119
|
+
}),
|
|
120
|
+
{
|
|
121
|
+
controls: {
|
|
122
|
+
hideNoControlsWarning: true
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
.add(
|
|
127
|
+
'As button',
|
|
128
|
+
() => ({
|
|
129
|
+
template: getTemplate(`
|
|
130
|
+
<ibm-diagram-card-node [as]="component">
|
|
131
|
+
<ibm-diagram-card-node-column>
|
|
132
|
+
<ibm-diagram-card-node-title>
|
|
133
|
+
{{ title }}
|
|
134
|
+
</ibm-diagram-card-node-title>
|
|
135
|
+
<ibm-diagram-card-node-subtitle>
|
|
136
|
+
{{ description }}
|
|
137
|
+
</ibm-diagram-card-node-subtitle>
|
|
138
|
+
</ibm-diagram-card-node-column>
|
|
139
|
+
</ibm-diagram-card-node>
|
|
140
|
+
`),
|
|
141
|
+
props: {
|
|
142
|
+
title: 'Title',
|
|
143
|
+
description: 'Description',
|
|
144
|
+
component: 'button'
|
|
145
|
+
}
|
|
146
|
+
}),
|
|
147
|
+
{
|
|
148
|
+
controls: {
|
|
149
|
+
hideNoControlsWarning: true
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
.add(
|
|
154
|
+
'As link',
|
|
155
|
+
() => ({
|
|
156
|
+
template: getTemplate(`
|
|
157
|
+
<ibm-diagram-card-node [href]="href">
|
|
158
|
+
<ibm-diagram-card-node-column>
|
|
159
|
+
<ibm-diagram-card-node-title>
|
|
160
|
+
{{ title }}
|
|
161
|
+
</ibm-diagram-card-node-title>
|
|
162
|
+
<ibm-diagram-card-node-subtitle>
|
|
163
|
+
{{ description }}
|
|
164
|
+
</ibm-diagram-card-node-subtitle>
|
|
165
|
+
</ibm-diagram-card-node-column>
|
|
166
|
+
</ibm-diagram-card-node>
|
|
167
|
+
`),
|
|
168
|
+
props: {
|
|
169
|
+
title: 'Title',
|
|
170
|
+
description: 'Description',
|
|
171
|
+
href: '#'
|
|
172
|
+
}
|
|
173
|
+
}),
|
|
174
|
+
{
|
|
175
|
+
controls: {
|
|
176
|
+
hideNoControlsWarning: true
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
.add(
|
|
181
|
+
'With label',
|
|
182
|
+
() => ({
|
|
183
|
+
template: getTemplate(`
|
|
184
|
+
<ibm-diagram-card-node [color]="color">
|
|
185
|
+
<ibm-diagram-card-node-column>
|
|
186
|
+
<svg ibmIconScreen size="16"></svg>
|
|
187
|
+
</ibm-diagram-card-node-column>
|
|
188
|
+
<ibm-diagram-card-node-column>
|
|
189
|
+
<ibm-diagram-card-node-title>
|
|
190
|
+
{{ title }}
|
|
191
|
+
</ibm-diagram-card-node-title>
|
|
192
|
+
<ibm-diagram-card-node-subtitle>
|
|
193
|
+
{{ description }}
|
|
194
|
+
</ibm-diagram-card-node-subtitle>
|
|
195
|
+
<ibm-diagram-card-node-label>
|
|
196
|
+
{{ label }}
|
|
197
|
+
</ibm-diagram-card-node-label>
|
|
198
|
+
</ibm-diagram-card-node-column>
|
|
199
|
+
</ibm-diagram-card-node>
|
|
200
|
+
`),
|
|
201
|
+
props: {
|
|
202
|
+
title: 'Title',
|
|
203
|
+
description: 'Description',
|
|
204
|
+
label: 'Label'
|
|
205
|
+
}
|
|
206
|
+
}),
|
|
207
|
+
{
|
|
208
|
+
controls: {
|
|
209
|
+
hideNoControlsWarning: true
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
.add(
|
|
214
|
+
'With action',
|
|
215
|
+
() => ({
|
|
216
|
+
template: getTemplate(`
|
|
217
|
+
<ibm-diagram-card-node [color]="color">
|
|
218
|
+
<ibm-diagram-card-node-column>
|
|
219
|
+
<svg ibmIconScreen size="16"></svg>
|
|
220
|
+
</ibm-diagram-card-node-column>
|
|
221
|
+
<ibm-diagram-card-node-column>
|
|
222
|
+
<ibm-diagram-card-node-title>
|
|
223
|
+
{{ title }}
|
|
224
|
+
</ibm-diagram-card-node-title>
|
|
225
|
+
<ibm-diagram-card-node-subtitle>
|
|
226
|
+
{{ description }}
|
|
227
|
+
</ibm-diagram-card-node-subtitle>
|
|
228
|
+
</ibm-diagram-card-node-column>
|
|
229
|
+
<ibm-diagram-card-node-column [farsideColumn]="farsideColumn">
|
|
230
|
+
<svg ibmIconChevronDown size="16"></svg>
|
|
231
|
+
</ibm-diagram-card-node-column>
|
|
232
|
+
</ibm-diagram-card-node>
|
|
233
|
+
`),
|
|
234
|
+
props: {
|
|
235
|
+
title: 'Title',
|
|
236
|
+
description: 'Description',
|
|
237
|
+
farsideColumn: true
|
|
238
|
+
}
|
|
239
|
+
}),
|
|
240
|
+
{
|
|
241
|
+
controls: {
|
|
242
|
+
hideNoControlsWarning: true
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
)
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { storiesOf, moduleMetadata } from '@storybook/angular'
|
|
2
|
+
import { ScreenModule } from '@carbon/icons-angular'
|
|
3
|
+
import { ShapeNodeModule } from '../../'
|
|
4
|
+
import { getTemplate } from './utils'
|
|
5
|
+
|
|
6
|
+
storiesOf('Diagrams/Nodes/Shape', module)
|
|
7
|
+
.addDecorator(
|
|
8
|
+
moduleMetadata({
|
|
9
|
+
imports: [ShapeNodeModule, ScreenModule]
|
|
10
|
+
})
|
|
11
|
+
)
|
|
12
|
+
.add(
|
|
13
|
+
'Default',
|
|
14
|
+
() => ({
|
|
15
|
+
template: getTemplate(`
|
|
16
|
+
<div>
|
|
17
|
+
<ibm-diagram-shape-node [title]="title" [renderIcon]="iconTemplate"></ibm-diagram-shape-node>
|
|
18
|
+
<ng-template #iconTemplate>
|
|
19
|
+
<svg ibmIconScreen size="16"></svg>
|
|
20
|
+
</ng-template>
|
|
21
|
+
</div>
|
|
22
|
+
`),
|
|
23
|
+
props: {
|
|
24
|
+
title: 'Title'
|
|
25
|
+
}
|
|
26
|
+
}),
|
|
27
|
+
{
|
|
28
|
+
controls: {
|
|
29
|
+
hideNoControlsWarning: true
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
.add(
|
|
34
|
+
'Square',
|
|
35
|
+
() => ({
|
|
36
|
+
template: getTemplate(`
|
|
37
|
+
<div>
|
|
38
|
+
<ibm-diagram-shape-node [title]="title" [renderIcon]="iconTemplate" [shape]="shape"></ibm-diagram-shape-node>
|
|
39
|
+
<ng-template #iconTemplate>
|
|
40
|
+
<svg ibmIconScreen size="16"></svg>
|
|
41
|
+
</ng-template>
|
|
42
|
+
</div>
|
|
43
|
+
`),
|
|
44
|
+
props: {
|
|
45
|
+
title: 'Title',
|
|
46
|
+
shape: 'square'
|
|
47
|
+
}
|
|
48
|
+
}),
|
|
49
|
+
{
|
|
50
|
+
controls: {
|
|
51
|
+
hideNoControlsWarning: true
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
.add(
|
|
56
|
+
'Rounded square',
|
|
57
|
+
() => ({
|
|
58
|
+
template: getTemplate(`
|
|
59
|
+
<div>
|
|
60
|
+
<ibm-diagram-shape-node [title]="title" [renderIcon]="iconTemplate" [shape]="shape"></ibm-diagram-shape-node>
|
|
61
|
+
<ng-template #iconTemplate>
|
|
62
|
+
<svg ibmIconScreen size="16"></svg>
|
|
63
|
+
</ng-template>
|
|
64
|
+
</div>
|
|
65
|
+
`),
|
|
66
|
+
props: {
|
|
67
|
+
title: 'Title',
|
|
68
|
+
shape: 'rounded-square'
|
|
69
|
+
}
|
|
70
|
+
}),
|
|
71
|
+
{
|
|
72
|
+
controls: {
|
|
73
|
+
hideNoControlsWarning: true
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
.add(
|
|
78
|
+
'As button',
|
|
79
|
+
() => ({
|
|
80
|
+
template: getTemplate(`
|
|
81
|
+
<div>
|
|
82
|
+
<ibm-diagram-shape-node [title]="title" [renderIcon]="iconTemplate" [as]="component"></ibm-diagram-shape-node>
|
|
83
|
+
<ng-template #iconTemplate>
|
|
84
|
+
<svg ibmIconScreen size="16"></svg>
|
|
85
|
+
</ng-template>
|
|
86
|
+
</div>
|
|
87
|
+
`),
|
|
88
|
+
props: {
|
|
89
|
+
title: 'Title',
|
|
90
|
+
component: 'button'
|
|
91
|
+
}
|
|
92
|
+
}),
|
|
93
|
+
{
|
|
94
|
+
controls: {
|
|
95
|
+
hideNoControlsWarning: true
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
.add(
|
|
100
|
+
'As link',
|
|
101
|
+
() => ({
|
|
102
|
+
template: getTemplate(`
|
|
103
|
+
<div>
|
|
104
|
+
<ibm-diagram-shape-node [title]="title" [renderIcon]="iconTemplate" [href]="href"></ibm-diagram-shape-node>
|
|
105
|
+
<ng-template #iconTemplate>
|
|
106
|
+
<svg ibmIconScreen size="16"></svg>
|
|
107
|
+
</ng-template>
|
|
108
|
+
</div>
|
|
109
|
+
`),
|
|
110
|
+
props: {
|
|
111
|
+
title: 'Title',
|
|
112
|
+
href: '#'
|
|
113
|
+
}
|
|
114
|
+
}),
|
|
115
|
+
{
|
|
116
|
+
controls: {
|
|
117
|
+
hideNoControlsWarning: true
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
.add(
|
|
122
|
+
'Inherited dimensions',
|
|
123
|
+
() => ({
|
|
124
|
+
template: getTemplate(`
|
|
125
|
+
<div style="height: 64px; width: 64px; position: relative;">
|
|
126
|
+
<ibm-diagram-shape-node [title]="title" [renderIcon]="iconTemplate" [size]="'100%'" position="static"></ibm-diagram-shape-node>
|
|
127
|
+
<ng-template #iconTemplate>
|
|
128
|
+
<svg ibmIconScreen size="16"></svg>
|
|
129
|
+
</ng-template>
|
|
130
|
+
</div>
|
|
131
|
+
`),
|
|
132
|
+
props: {
|
|
133
|
+
title: 'Title'
|
|
134
|
+
}
|
|
135
|
+
}),
|
|
136
|
+
{
|
|
137
|
+
controls: {
|
|
138
|
+
hideNoControlsWarning: true
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
)
|
package/src/test.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
+
|
|
3
|
+
import 'zone.js'
|
|
4
|
+
import 'zone.js/testing'
|
|
5
|
+
import { getTestBed } from '@angular/core/testing'
|
|
6
|
+
import {
|
|
7
|
+
BrowserDynamicTestingModule,
|
|
8
|
+
platformBrowserDynamicTesting
|
|
9
|
+
} from '@angular/platform-browser-dynamic/testing'
|
|
10
|
+
|
|
11
|
+
declare const require: {
|
|
12
|
+
context(
|
|
13
|
+
path: string,
|
|
14
|
+
deep?: boolean,
|
|
15
|
+
filter?: RegExp
|
|
16
|
+
): {
|
|
17
|
+
<T>(id: string): T
|
|
18
|
+
keys(): string[]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// First, initialize the Angular testing environment.
|
|
23
|
+
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting())
|
|
24
|
+
|
|
25
|
+
// Then we find all the tests.
|
|
26
|
+
const context = require.context('./', true, /\.spec\.ts$/)
|
|
27
|
+
// And load the modules.
|
|
28
|
+
context.keys().forEach(context)
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
// Package-specific
|
|
6
|
+
"baseUrl": "./",
|
|
7
|
+
"declaration": false,
|
|
8
|
+
"downlevelIteration": true,
|
|
9
|
+
"experimentalDecorators": true,
|
|
10
|
+
"importHelpers": true,
|
|
11
|
+
"noImplicitOverride": true,
|
|
12
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
13
|
+
"noImplicitReturns": true,
|
|
14
|
+
"outDir": "./dist/out-tsc",
|
|
15
|
+
// "paths": {
|
|
16
|
+
// "charts-angular": [
|
|
17
|
+
// "dist"
|
|
18
|
+
// ]
|
|
19
|
+
// },
|
|
20
|
+
"types": [
|
|
21
|
+
"vite/client" // for experimental builds `yarn build:package:vite` only
|
|
22
|
+
],
|
|
23
|
+
"useDefineForClassFields": false
|
|
24
|
+
},
|
|
25
|
+
"include": [
|
|
26
|
+
"src",
|
|
27
|
+
"./package.json"
|
|
28
|
+
],
|
|
29
|
+
"exclude": [
|
|
30
|
+
"src/test.ts"
|
|
31
|
+
],
|
|
32
|
+
"references": [
|
|
33
|
+
{
|
|
34
|
+
"path": "./tsconfig.vite.json"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"angularCompilerOptions": {
|
|
38
|
+
"enableI18nLegacyMessageIdFormat": false,
|
|
39
|
+
"strictInjectionParameters": true,
|
|
40
|
+
"strictInputAccessModifiers": true,
|
|
41
|
+
"strictTemplates": true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "./tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"declarationMap": true,
|
|
7
|
+
"inlineSources": true,
|
|
8
|
+
"types": []
|
|
9
|
+
},
|
|
10
|
+
"exclude": [
|
|
11
|
+
"src/test.ts",
|
|
12
|
+
"**/*.spec.ts"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "./tsconfig.lib.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"declarationMap": false,
|
|
6
|
+
"sourceMap": true
|
|
7
|
+
},
|
|
8
|
+
"angularCompilerOptions": {
|
|
9
|
+
"compilationMode": "partial"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "./tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "./dist/out-tsc/spec",
|
|
6
|
+
"types": [
|
|
7
|
+
"jasmine"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"src/test.ts"
|
|
12
|
+
],
|
|
13
|
+
"include": [
|
|
14
|
+
"**/*.spec.ts",
|
|
15
|
+
"**/*.d.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
|
|
3
|
+
import dts from 'vite-plugin-dts'
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
build: {
|
|
7
|
+
sourcemap: true,
|
|
8
|
+
chunkSizeWarningLimit: 600,
|
|
9
|
+
lib: {
|
|
10
|
+
entry: 'src/index.ts',
|
|
11
|
+
formats: ['es']
|
|
12
|
+
},
|
|
13
|
+
rollupOptions: {
|
|
14
|
+
external: ['@angular/common', '@angular/core']
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
optimizeDeps: {
|
|
18
|
+
include: ['@carbon/charts'],
|
|
19
|
+
exclude: ['@carbon/telemetry']
|
|
20
|
+
},
|
|
21
|
+
plugins: [dts()]
|
|
22
|
+
})
|