@explorer-1/vue 0.2.101 → 0.2.103

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @explorer-1/vue
2
2
 
3
+ ## 0.2.103
4
+
5
+ ### Patch Changes
6
+
7
+ - dd8916f: Adds CSR Table Block component and stories.
8
+
9
+ ## 0.2.102
10
+
11
+ ### Patch Changes
12
+
13
+ - edd1d1e: Adding types for redirects query
14
+
3
15
  ## 0.2.101
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorer-1/vue",
3
- "version": "0.2.101",
3
+ "version": "0.2.103",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -15,6 +15,7 @@
15
15
  "dependencies": {
16
16
  "@fancyapps/ui": "^4.0.26",
17
17
  "@tailwindcss/forms": "^0.5.7",
18
+ "ag-grid-vue3": "^33.2.0",
18
19
  "animejs": "^3.2.2",
19
20
  "click-outside-vue3": "^4.0.1",
20
21
  "datebook": "^8.0.1",
@@ -4,7 +4,8 @@
4
4
  @click="bgCloseModal"
5
5
  >
6
6
  <div
7
- class="relative w-full max-w-xl p-8 m-auto bg-white"
7
+ class="relative w-full p-8 m-auto bg-white"
8
+ :class="widthClass"
8
9
  @click.stop
9
10
  >
10
11
  <BaseHeading
@@ -43,8 +44,13 @@ export default defineComponent({
43
44
  bgClose: {
44
45
  type: Boolean,
45
46
  default: false
47
+ },
48
+ widthClass: {
49
+ type: String,
50
+ default: 'max-w-xl'
46
51
  }
47
52
  },
53
+ emits: ['close'],
48
54
  methods: {
49
55
  closeModal() {
50
56
  this.$emit('close')
@@ -0,0 +1,202 @@
1
+ import BlockCsrTable from './BlockCsrTable.vue'
2
+
3
+ export default {
4
+ title: 'Components/FeatureFlags/BlockCsrTable',
5
+ component: BlockCsrTable,
6
+ excludeStories: /.*Data$/
7
+ }
8
+
9
+ export const BlockCsrTableData = [
10
+ {
11
+ Id: 1,
12
+ TestRecordId: 2765,
13
+ Attachment: 'attachment_filename.pdf',
14
+ Status: 1,
15
+ GenericPartNumber: 'OP467',
16
+ Description: 'QUAD OP AMP Linear Device',
17
+ PartTechnology: 'Bipolar',
18
+ PartLDC: '2416B',
19
+ Manufacturer: 'Analog Devices (Precision Monolithics, Inc.)',
20
+ Type: 'Single Event Effects',
21
+ TestSubTypes: 'Single Event Dielectric Rupture (SEDR)',
22
+ ActualCompletionDate: '2025-03-15',
23
+ ExportPackageRates: [
24
+ {
25
+ Id: 1,
26
+ ExportPackageId: 1,
27
+ TotalDose: '200',
28
+ DoseRate: null,
29
+ TotalFluence: null,
30
+ LETthOrEnergy: null,
31
+ Rates: null,
32
+ Fluence: null,
33
+ Energy: null,
34
+ TestSubType: null
35
+ }
36
+ ]
37
+ },
38
+ {
39
+ Id: 2,
40
+ TestRecordId: 2,
41
+ Attachment: 'attachment/1',
42
+ Status: 0,
43
+ GenericPartNumber: 'GPN123',
44
+ Description: 'A description for part 1',
45
+ PartTechnology: 'BiCMOS',
46
+ PartLDC: 'Lot 1',
47
+ Manufacturer: 'Texas Instruments',
48
+ Type: 'Single Event Effects',
49
+ TestSubTypes: 'SEEU',
50
+ ActualCompletionDate: '2021-10-07T21:01:10Z',
51
+ ExportPackageRates: [
52
+ {
53
+ Id: 1,
54
+ ExportPackageId: 1,
55
+ TotalDose: null,
56
+ DoseRate: null,
57
+ TotalFluence: null,
58
+ LETthOrEnergy: '1234',
59
+ Fluence: null,
60
+ Energy: null
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ Id: 3,
66
+ TestRecordId: 3,
67
+ Attachment: 'attachment/2',
68
+ Status: 1,
69
+ GenericPartNumber: 'GPN345',
70
+ Description: 'A description for part 2',
71
+ PartTechnology: 'Transistor',
72
+ PartLDC: 'Lot 2',
73
+ Manufacturer: 'NanoTech',
74
+ Type: 'TID',
75
+ TestSubTypes: '',
76
+ ActualCompletionDate: '2021-10-08T21:01:10Z',
77
+ ExportPackageRates: [
78
+ {
79
+ Id: 2,
80
+ ExportPackageId: 2,
81
+ TotalDose: '154',
82
+ DoseRate: '789',
83
+ TotalFluence: null,
84
+ LETthOrEnergy: null,
85
+ Fluence: null,
86
+ Energy: null
87
+ }
88
+ ]
89
+ },
90
+ {
91
+ Id: 4,
92
+ TestRecordId: 4,
93
+ Attachment: 'attachment/2',
94
+ Status: 1,
95
+ GenericPartNumber: 'TEST',
96
+ Description: 'A description for part. Lorem ipsum dolor sit amet consectatur.',
97
+ PartTechnology: 'Transistor',
98
+ PartLDC: 'Lot 2',
99
+ Manufacturer: 'Test',
100
+ Type: 'TID',
101
+ TestSubTypes: '',
102
+ ActualCompletionDate: '2021-10-08T21:01:10Z',
103
+ ExportPackageRates: [
104
+ {
105
+ Id: 2,
106
+ ExportPackageId: 2,
107
+ TotalDose: '154',
108
+ DoseRate: '789',
109
+ TotalFluence: null,
110
+ LETthOrEnergy: null,
111
+ Fluence: null,
112
+ Energy: null
113
+ }
114
+ ]
115
+ },
116
+ {
117
+ Id: 4,
118
+ TestRecordId: 4,
119
+ Attachment: 'attachment/2',
120
+ Status: 1,
121
+ GenericPartNumber: 'TEST',
122
+ Description: 'A description for part 2',
123
+ PartTechnology: 'Transistor',
124
+ PartLDC: 'Lot 2',
125
+ Manufacturer: 'Test',
126
+ Type: 'TID',
127
+ TestSubTypes: '',
128
+ ActualCompletionDate: '2021-10-08T21:01:10Z',
129
+ ExportPackageRates: [
130
+ {
131
+ Id: 2,
132
+ ExportPackageId: 2,
133
+ TotalDose: '154',
134
+ DoseRate: '789',
135
+ TotalFluence: null,
136
+ LETthOrEnergy: null,
137
+ Fluence: null,
138
+ Energy: null
139
+ }
140
+ ]
141
+ },
142
+ {
143
+ Id: 4,
144
+ TestRecordId: 4,
145
+ Attachment: 'attachment/2',
146
+ Status: 1,
147
+ GenericPartNumber: 'TEST',
148
+ Description: 'A description for part 2',
149
+ PartTechnology: 'Transistor',
150
+ PartLDC: 'Lot 2',
151
+ Manufacturer: 'Test',
152
+ Type: 'TID',
153
+ TestSubTypes: '',
154
+ ActualCompletionDate: '2021-10-08T21:01:10Z',
155
+ ExportPackageRates: [
156
+ {
157
+ Id: 2,
158
+ ExportPackageId: 2,
159
+ TotalDose: '154',
160
+ DoseRate: '789',
161
+ TotalFluence: null,
162
+ LETthOrEnergy: null,
163
+ Fluence: null,
164
+ Energy: null
165
+ }
166
+ ]
167
+ },
168
+ {
169
+ Id: 4,
170
+ TestRecordId: 4,
171
+ Attachment: 'attachment/2',
172
+ Status: 1,
173
+ GenericPartNumber: 'TEST',
174
+ Description: 'A description for part 2',
175
+ PartTechnology: 'Transistor',
176
+ PartLDC: 'Lot 2',
177
+ Manufacturer: 'Test',
178
+ Type: 'TID',
179
+ TestSubTypes: '',
180
+ ActualCompletionDate: '2021-10-08T21:01:10Z',
181
+ ExportPackageRates: [
182
+ {
183
+ Id: 2,
184
+ ExportPackageId: 2,
185
+ TotalDose: '154',
186
+ DoseRate: '>789',
187
+ TotalFluence: null,
188
+ LETthOrEnergy: null,
189
+ Fluence: null,
190
+ Energy: null
191
+ }
192
+ ]
193
+ }
194
+ ]
195
+
196
+ export const BaseStory = {
197
+ args: {
198
+ rowData: BlockCsrTableData,
199
+ attachmentPrefix: 'https://www.jpl.nasa.gov',
200
+ apiEndpoint: null
201
+ }
202
+ }
@@ -0,0 +1,298 @@
1
+ <script setup lang="ts">
2
+ import { computed, reactive, ref, onMounted } from 'vue'
3
+ import BaseLink from './../BaseLink/BaseLink.vue'
4
+ import BaseModalDialog from '../BaseModal/BaseModalDialog.vue'
5
+ import CsrAttachment from './CsrAttachment.vue'
6
+ import CsrTestLimits from './CsrTestLimits.vue'
7
+ import CsrTestLimitsTable from './CsrTestLimitsTable.vue'
8
+ import SearchInput from './../SearchInput/SearchInput.vue'
9
+
10
+ import {
11
+ ModuleRegistry,
12
+ AllCommunityModule,
13
+ ValidationModule,
14
+ themeMaterial
15
+ } from 'ag-grid-community'
16
+ import { AgGridVue } from 'ag-grid-vue3'
17
+
18
+ ModuleRegistry.registerModules([AllCommunityModule])
19
+ ModuleRegistry.registerModules([ValidationModule])
20
+
21
+ interface BlockCsrTableProps {
22
+ rowData?: BlockCsrTableRow[]
23
+ attachmentPrefix?: string
24
+ apiEndpoint?: string
25
+ }
26
+
27
+ export interface ExportPackageRate {
28
+ Id: number
29
+ ExportPackageId: number
30
+ TotalDose: string
31
+ DoseRate: string
32
+ TotalFluence: string
33
+ LETthOrEnergy: string
34
+ Fluence: string
35
+ Energy: string
36
+ }
37
+ interface BlockCsrTableRow {
38
+ Id: number
39
+ TestRecordId: number
40
+ Attachment: string
41
+ Status: number
42
+ GenericPartNumber: string
43
+ Description: string
44
+ PartTechnology: string
45
+ PartLDC: string
46
+ Manufacturer: string
47
+ Type: string
48
+ TestSubTypes: string
49
+ ActualCompletionDate: string
50
+ ExportPackageRates: ExportPackageRate[]
51
+ }
52
+ const props = withDefaults(defineProps<BlockCsrTableProps>(), {
53
+ rowData: undefined,
54
+ attachmentPrefix: '',
55
+ apiEndpoint: undefined
56
+ })
57
+ const { rowData, apiEndpoint, attachmentPrefix } = reactive(props)
58
+
59
+ const BlockCsrTableRef = ref()
60
+ const fetchedRowData = ref()
61
+ const filterText = ref()
62
+ const showModal = ref(false)
63
+ const modalData = ref()
64
+
65
+ const closeModal = () => {
66
+ showModal.value = false
67
+ modalData.value = undefined
68
+ }
69
+ const openModal = (data: any) => {
70
+ modalData.value = data
71
+ showModal.value = true
72
+ }
73
+
74
+ const theme = themeMaterial.withParams({
75
+ accentColor: 'rgb(25 156 227)' // jpl-blue-light,
76
+ })
77
+
78
+ const headerClass = [
79
+ 'min-w-[6rem] bg-jpl-blue-darker edu:bg-jpl-violet-darker text-subtitle text-white text-sm border-gray-light-mid lg:p-5 p-3 border-b text-left'
80
+ ]
81
+ const defaultcolDef = {
82
+ flex: 1,
83
+ filter: true,
84
+ suppressMovable: true,
85
+ headerClass
86
+ }
87
+ const colDefs = ref([
88
+ {
89
+ field: 'GenericPartNumber',
90
+ headerName: 'Part Number',
91
+ filterParams: {
92
+ buttons: ['reset', 'apply'],
93
+ closeOnApply: true
94
+ }
95
+ },
96
+ {
97
+ field: 'Manufacturer',
98
+ wrapText: true,
99
+ autoHeight: true,
100
+ filterParams: {
101
+ buttons: ['reset', 'apply'],
102
+ closeOnApply: true
103
+ }
104
+ },
105
+ {
106
+ field: 'Type',
107
+ headerName: 'Test Type',
108
+ wrapText: true,
109
+ autoHeight: true,
110
+ filterParams: {
111
+ buttons: ['reset', 'apply'],
112
+ closeOnApply: true
113
+ }
114
+ },
115
+ {
116
+ field: 'PartTechnology',
117
+ headerName: 'Part Technology',
118
+ filterParams: {
119
+ buttons: ['reset', 'apply'],
120
+ closeOnApply: true
121
+ }
122
+ },
123
+ {
124
+ field: 'Description',
125
+ headerName: 'Description',
126
+ wrapText: true,
127
+ autoHeight: true,
128
+ filterParams: {
129
+ buttons: ['reset', 'apply'],
130
+ closeOnApply: true
131
+ }
132
+ },
133
+ {
134
+ field: 'ExportPackageRates',
135
+ headerName: 'Test Limits',
136
+ cellDataType: 'object',
137
+ filter: false,
138
+ cellRenderer: CsrTestLimits,
139
+ cellRendererParams: {
140
+ openModal: openModal.bind(this)
141
+ }
142
+ },
143
+ {
144
+ field: 'Attachment',
145
+ filter: true,
146
+ filterParams: {
147
+ filterOptions: ['blank', 'notBlank'],
148
+ defaultOption: 'notBlank',
149
+ buttons: ['reset', 'apply'],
150
+ closeOnApply: true
151
+ },
152
+ cellRenderer: CsrAttachment,
153
+ cellRendererParams: {
154
+ attachmentPrefix
155
+ }
156
+ }
157
+ ])
158
+
159
+ async function getRowData() {
160
+ if (apiEndpoint) {
161
+ try {
162
+ let result = await fetch(apiEndpoint)
163
+ result = await result.json()
164
+ fetchedRowData.value = result
165
+ return result
166
+ } catch (e) {
167
+ console.log(e)
168
+ }
169
+ }
170
+ }
171
+
172
+ const computedRowData = computed(() => {
173
+ return fetchedRowData.value || rowData
174
+ })
175
+
176
+ onMounted(async () => {
177
+ await getRowData()
178
+ })
179
+
180
+ // methods
181
+ const onFilterTextBoxChanged = () => {
182
+ BlockCsrTableRef.value.api.setGridOption('quickFilterText', filterText.value)
183
+ }
184
+ </script>
185
+ <template>
186
+ <client-only>
187
+ <div
188
+ v-if="rowData || apiEndpoint"
189
+ class="BlockCsrTable"
190
+ >
191
+ <div class="MainCsrTable">
192
+ <SearchInput
193
+ v-model="filterText"
194
+ class="mb-3"
195
+ placeholder="Filter parts&hellip;"
196
+ @input="onFilterTextBoxChanged()"
197
+ />
198
+ <ag-grid-vue
199
+ ref="BlockCsrTableRef"
200
+ class="w-full"
201
+ :theme="theme"
202
+ :row-data="computedRowData"
203
+ :column-defs="colDefs"
204
+ :default-col-def="defaultcolDef"
205
+ :pagination-page-size="20"
206
+ :ensure-dom-order="true"
207
+ :suppress-server-side-full-width-loading-row="true"
208
+ dom-layout="autoHeight"
209
+ pagination
210
+ >
211
+ </ag-grid-vue>
212
+ </div>
213
+ <BaseModalDialog
214
+ v-show="showModal"
215
+ bg-close
216
+ width-class="max-w-5xl"
217
+ @close="closeModal()"
218
+ >
219
+ <div
220
+ v-if="modalData"
221
+ class="mb-8 text-sm"
222
+ >
223
+ <div class="mb-5">
224
+ <p v-if="modalData.GenericPartNumber">
225
+ <strong>Part Number:</strong> {{ modalData.GenericPartNumber }}
226
+ </p>
227
+ <p v-if="modalData.Manufacturer">
228
+ <strong>Manufacturer:</strong> {{ modalData.Manufacturer }}
229
+ </p>
230
+ <p v-if="modalData.Type"><strong>Test Type:</strong> {{ modalData.Type }}</p>
231
+ <p v-if="modalData.PartTechnology">
232
+ <strong>Part Technology:</strong> {{ modalData.PartTechnology }}
233
+ </p>
234
+ <p v-if="modalData.Description">
235
+ <strong>Description:</strong> {{ modalData.Description }}
236
+ </p>
237
+ <p v-if="modalData.Attachment">
238
+ <strong class="pr-1">Attachment:</strong>
239
+ <BaseLink
240
+ :href="modalData.Attachment"
241
+ class="inline"
242
+ variant="default"
243
+ target="_blank"
244
+ >Download</BaseLink
245
+ >
246
+ </p>
247
+ </div>
248
+ <h2 class="text-lg tracking-tight mb-3">Test Limits</h2>
249
+ <CsrTestLimitsTable :data="modalData.ExportPackageRates" />
250
+ </div>
251
+ </BaseModalDialog>
252
+ </div>
253
+ </client-only>
254
+ </template>
255
+ <style type="scss">
256
+ .BlockCsrTable {
257
+ .MainCsrTable .ag-root {
258
+ @apply overflow-x-auto;
259
+ min-height: 75rem;
260
+ .ag-body {
261
+ min-width: 40rem;
262
+ }
263
+ .ag-header,
264
+ .ag-header-viewport {
265
+ @apply overflow-visible;
266
+ }
267
+ }
268
+ .ag-cell {
269
+ padding-left: 0.6rem;
270
+ padding-right: 0.6rem;
271
+ @screen lg {
272
+ padding-left: 1.2rem;
273
+ padding-right: 1.2rem;
274
+ }
275
+ }
276
+ .ag-root-wrapper,
277
+ .ag-cell,
278
+ .ag-theme-params-1 {
279
+ @apply font-primary;
280
+ }
281
+ .ag-cell-wrap-text {
282
+ line-height: 1.25rem;
283
+ padding-top: 0.75rem;
284
+ padding-bottom: 0.75rem;
285
+ }
286
+ .ag-filter-filter {
287
+ .ag-wrapper::before {
288
+ @apply hidden;
289
+ }
290
+ .ag-input-field-input {
291
+ @apply text-xs;
292
+ }
293
+ }
294
+ .ag-paging-row-summary-panel {
295
+ @apply whitespace-nowrap;
296
+ }
297
+ }
298
+ </style>
@@ -0,0 +1,36 @@
1
+ <script setup lang="ts">
2
+ import { reactive, computed } from 'vue'
3
+ import BaseLink from './../BaseLink/BaseLink.vue'
4
+
5
+ interface CsrAttachmentProps {
6
+ params: {
7
+ data: {
8
+ Attachment: string
9
+ }
10
+ attachmentPrefix: string
11
+ }
12
+ }
13
+
14
+ const props = withDefaults(defineProps<CsrAttachmentProps>(), {
15
+ params: undefined
16
+ })
17
+ const { params } = reactive(props)
18
+
19
+ const prefix = computed(() => {
20
+ // make sure it ends with a slash
21
+ if (params.attachmentPrefix && params.attachmentPrefix.endsWith('/')) {
22
+ return params.attachmentPrefix
23
+ } else {
24
+ return params.attachmentPrefix + '/'
25
+ }
26
+ })
27
+ </script>
28
+ <template>
29
+ <BaseLink
30
+ v-if="params?.data?.Attachment"
31
+ :href="prefix + params.data.Attachment"
32
+ variant="default"
33
+ target="_blank"
34
+ >Download</BaseLink
35
+ >
36
+ </template>
@@ -0,0 +1,34 @@
1
+ <script setup lang="ts">
2
+ import { reactive } from 'vue'
3
+ import { type ExportPackageRate } from './BlockCsrTable.vue'
4
+
5
+ interface CsrTestLimitsProps {
6
+ params: {
7
+ data: {
8
+ ExportPackageRates: ExportPackageRate[]
9
+ }
10
+ }
11
+ }
12
+
13
+ const props = withDefaults(defineProps<CsrTestLimitsProps>(), {
14
+ params: undefined
15
+ })
16
+ const { params } = reactive(props)
17
+
18
+ const openModal = () => {
19
+ // @ts-ignore
20
+ params.openModal(params.data)
21
+ }
22
+ </script>
23
+ <template>
24
+ <div class="CsrTestLimits">
25
+ <p
26
+ v-if="params.data.ExportPackageRates?.length"
27
+ class="text-action hover:text-action-hover hover:cursor-pointer underline"
28
+ @click="openModal()"
29
+ >
30
+ <span class="hidden lg:inline">View Test Limits</span>
31
+ <span class="inline lg:hidden">View</span>
32
+ </p>
33
+ </div>
34
+ </template>
@@ -0,0 +1,90 @@
1
+ <script setup lang="ts">
2
+ import { ref } from 'vue'
3
+ import {
4
+ ModuleRegistry,
5
+ AllCommunityModule,
6
+ ValidationModule,
7
+ themeMaterial
8
+ } from 'ag-grid-community'
9
+ import { AgGridVue } from 'ag-grid-vue3'
10
+ import { type ExportPackageRate } from './BlockCsrTable.vue'
11
+
12
+ ModuleRegistry.registerModules([AllCommunityModule])
13
+ ModuleRegistry.registerModules([ValidationModule])
14
+
15
+ interface CsrTestLimitsTableProps {
16
+ data: ExportPackageRate[]
17
+ }
18
+
19
+ withDefaults(defineProps<CsrTestLimitsTableProps>(), {
20
+ data: undefined
21
+ })
22
+
23
+ const headerClass = [
24
+ 'bg-jpl-blue-darker edu:bg-jpl-violet-darker text-subtitle text-white text-xs border-gray-light-mid px-3 border-b text-left'
25
+ ]
26
+ const CsrTestLimitsTableRef = ref()
27
+ const theme = themeMaterial.withParams({
28
+ accentColor: 'rgb(25 156 227)', // jpl-blue-light
29
+ spacing: 5
30
+ })
31
+ const colDefs = ref([
32
+ {
33
+ field: 'ExportPackageId',
34
+ headerName: 'ID',
35
+ filter: false,
36
+ flex: 0,
37
+ width: 50
38
+ },
39
+ { field: 'TotalDose' },
40
+ { field: 'DoseRate' },
41
+ { field: 'TotalFluence' },
42
+ {
43
+ field: 'LETthOrEnergy',
44
+ headerName: 'LETth or Energy Range'
45
+ },
46
+ {
47
+ field: 'Fluence'
48
+ },
49
+ { field: 'Energy' }
50
+ ])
51
+ const defaultcolDef = {
52
+ flex: 1,
53
+ filter: true,
54
+ suppressMovable: true,
55
+ headerClass,
56
+ filterParams: {
57
+ buttons: ['reset', 'apply'],
58
+ closeOnApply: true
59
+ }
60
+ }
61
+ </script>
62
+ <template>
63
+ <ag-grid-vue
64
+ ref="CsrTestLimitsTableRef"
65
+ class="w-full CsrTestLimitsTable"
66
+ :theme="theme"
67
+ :row-data="data"
68
+ :column-defs="colDefs"
69
+ dom-layout="autoHeight"
70
+ :default-col-def="defaultcolDef"
71
+ >
72
+ </ag-grid-vue>
73
+ </template>
74
+ <style lang="scss">
75
+ .CsrTestLimitsTable {
76
+ .ag-root {
77
+ @apply min-h-12 overflow-x-auto;
78
+ .ag-body {
79
+ min-width: 40rem;
80
+ }
81
+ .ag-header,
82
+ .ag-header-viewport {
83
+ @apply overflow-visible;
84
+ }
85
+ }
86
+ .ag-root-wrapper {
87
+ @apply overflow-visible;
88
+ }
89
+ }
90
+ </style>
@@ -18,6 +18,7 @@ import { BlockVideoData } from './../BlockVideo/BlockVideo.stories'
18
18
  import { BlockVideoEmbedData } from './../BlockVideoEmbed/BlockVideoEmbed.stories'
19
19
  import { BlockNewsletterSignupData } from '../BlockNewsletterSignup/BlockNewsletterSignup.stories'
20
20
  import { MixedColumnWidths } from './../BlockRichTable/BlockRichTable.stories'
21
+ import { BlockCsrTableData } from './../BlockCsrTable/BlockCsrTable.stories'
21
22
  import BlockStreamfield, { variants } from './BlockStreamfield.vue'
22
23
 
23
24
  export default {
@@ -176,14 +177,24 @@ export const BlockStreamfieldData = {
176
177
  }
177
178
  ]
178
179
  }
180
+ const BlockStreamfieldFeatureFlagsData = [
181
+ {
182
+ blockType: 'CsrTableBlock',
183
+ rowData: BlockCsrTableData
184
+ }
185
+ ]
179
186
 
180
187
  export const BaseStory = {
181
- args: { data: BlockStreamfieldData.body, variant: 'default', size: 'large' }
188
+ args: {
189
+ data: [...BlockStreamfieldData.body, ...BlockStreamfieldFeatureFlagsData],
190
+ variant: 'default',
191
+ size: 'large'
192
+ }
182
193
  }
183
194
 
184
195
  export const MatchingWidths = {
185
196
  args: {
186
- data: BlockStreamfieldData.body,
197
+ data: [...BlockStreamfieldData.body, ...BlockStreamfieldFeatureFlagsData],
187
198
  variant: 'fluid',
188
199
  size: 'large'
189
200
  }
@@ -242,6 +242,19 @@
242
242
  <BlockAccordion :data="block as unknown as AccordionBlockObject" />
243
243
  </LayoutHelper>
244
244
 
245
+ <LayoutHelper
246
+ v-else-if="block.blockType == 'CsrTableBlock'"
247
+ :key="`csrTableBlock${index}`"
248
+ indent="col-1"
249
+ :class="marginBottom"
250
+ >
251
+ <BlockCsrTable
252
+ :row-data="block.rowData"
253
+ :attachment-prefix="block.attachmentPrefix"
254
+ :api-endpoint="block.apiEndpoint"
255
+ />
256
+ </LayoutHelper>
257
+
245
258
  <div
246
259
  v-else
247
260
  :key="index"
@@ -286,6 +299,7 @@ import BlockVideoEmbed, {
286
299
  type BlockData as VideoBlockEmbedData
287
300
  } from './../BlockVideoEmbed/BlockVideoEmbed.vue'
288
301
  import BlockNewsletterSignup from '../BlockNewsletterSignup/BlockNewsletterSignup.vue'
302
+ import BlockCsrTable from '../BlockCsrTable/BlockCsrTable.vue'
289
303
  import { mapStores } from 'pinia'
290
304
  import { useThemeStore } from '../../store/theme'
291
305
 
@@ -325,7 +339,8 @@ export default defineComponent({
325
339
  BlockGist,
326
340
  BlockVideo,
327
341
  BlockVideoEmbed,
328
- BlockNewsletterSignup
342
+ BlockNewsletterSignup,
343
+ BlockCsrTable
329
344
  },
330
345
  props: {
331
346
  variant: {
package/src/interfaces.ts CHANGED
@@ -39,6 +39,9 @@ export interface StreamfieldBlockData extends BlockData {
39
39
  credit?: string
40
40
  imageInline?: ImageObject
41
41
  heroSummary?: string
42
+ rowData?: any
43
+ apiEndpoint?: string
44
+ attachmentPrefix?: string
42
45
  }
43
46
 
44
47
  export interface ImageSrcObject {
@@ -171,6 +174,18 @@ export interface BlockRelatedLinksObject extends BlockData {
171
174
  links: RelatedLinkObject[]
172
175
  }
173
176
 
177
+ export interface InitResponse {
178
+ init: {
179
+ id: string
180
+ __typename: string
181
+ }
182
+ redirect: {
183
+ isPermanent: boolean
184
+ oldPath: string
185
+ newUrl: string
186
+ }
187
+ }
188
+
174
189
  export interface PageResponse {
175
190
  __typename: string
176
191
  page: PageObject