@htmlbricks/hb-table 0.20.17 → 0.50.0-alpha.0

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/extra/docs.ts DELETED
@@ -1,561 +0,0 @@
1
- import type { CssPart, CssVar, HtmlSlot, i18nLang, StyleSetup, ComponentSetup } from "wc-js-utils/main";
2
- import type { Component, IActionButton } from "../app/types/webcomponent.type";
3
-
4
- export const storybookArgs = {
5
- size: { control: { type: "range", min: 1, max: 100 } },
6
- page: { control: { type: "number" } },
7
-
8
- enableselect: { control: { type: "boolean" } },
9
- selectrow: { control: { type: "boolean" } },
10
- disablepagination: { control: { type: "boolean" } },
11
- add_item: { control: { type: "boolean" } },
12
- rows: { control: { type: "array" } },
13
- headers: { control: { type: "array" } },
14
- actions: { control: { type: "array" } },
15
- selectactions: { control: { type: "array" } },
16
- pageChange: { action: "pagechangeEvent" },
17
- tableaction: { action: "tableactionEvent" },
18
- tableCustomActionClick: { action: "tableCustomActionClickEvent" },
19
- cellclick: { action: "cellclickEvent" },
20
- actiononselected: { action: "actiononselectedEvent" },
21
- clickonrow: { action: "clickonrowEvent" },
22
- confirmActionModal: { action: "confirmActionModalEvent" },
23
- confirmActionModalForm: { action: "confirmActionModalFormEvent" },
24
- showConfirmModal: { action: "showConfirmModal" },
25
- showConfirmModalForm: { action: "showConfirmModalForm" },
26
- externalfilter: { control: { type: "boolean" } },
27
- pages: { control: { type: "number" } },
28
- clipboardCopyText: { action: "pagechangeEvent" },
29
- addItem: { action: "addItemEvent" },
30
- };
31
-
32
- const cssVars: CssVar[] = [
33
- { name: "--bs-primary", valueType: "color", theme: "bootstrap", defaultValue: "#07689f" },
34
- { name: "--bs-secondary", valueType: "color", theme: "bootstrap", defaultValue: "#c9d6df" },
35
- { name: "--bs-success", valueType: "color", theme: "bootstrap", defaultValue: "#11d3bc" },
36
- { name: "--bs-info", valueType: "color", theme: "bootstrap", defaultValue: "#a2d5f2" },
37
- { name: "--bs-warning", valueType: "color", theme: "bootstrap", defaultValue: "#ffc107" },
38
- { name: "--bs-danger", valueType: "color", theme: "bootstrap", defaultValue: "#f67280" },
39
- ];
40
- export const cssParts: CssPart[] = [];
41
- export const htmlSlots: HtmlSlot[] = [{ name: "add-button-content" }, { name: "buttons-container" }];
42
- export const i18nLanguages: i18nLang[] = [];
43
-
44
- export const styleSetup: StyleSetup = {
45
- vars: cssVars,
46
- parts: cssParts,
47
- };
48
- const rows: Component["rows"] = [
49
- {
50
- title: "bau",
51
- videoSrc: "https://comapi.be-on.tv/v1/public/records/61043eedb50af916a6429fdc/video",
52
- time: "2021-08-06T22:46:30.565Z",
53
- _id: "bau",
54
- status: "closed",
55
- },
56
- {
57
- title: "bb1",
58
- videoSrc: "https://comapi.be-on.tv/v1/public/records/61043eedb50af916a6429fdc/video",
59
- time: "2021-08-06T22:46:31.565Z",
60
- description: "ffff2",
61
- _id: "bb1",
62
- status: "closed",
63
- },
64
- {
65
- title: "bb2",
66
- time: "2021-08-02T22:46:32.565Z",
67
- _id: "bb2",
68
- status: "active",
69
- },
70
- {
71
- title: "ss",
72
- time: "2021-08-06T22:46:34.565Z",
73
- description: "fffffff",
74
- testnested: { nested: "dddd" },
75
- _id: "ss",
76
- status: "active",
77
- },
78
- {
79
- title: "bb4",
80
- time: "2021-08-06T22:46:34.565Z",
81
- _id: "bb4",
82
- status: "active",
83
- },
84
- {
85
- title: "aa5",
86
- time: "2021-08-06T22:46:34.565Z",
87
- _id: "aa5",
88
- status: "active",
89
- },
90
- {
91
- title: "bb6",
92
- time: "2021-08-06T22:46:34.565Z",
93
- _id: "bb6",
94
- status: "active",
95
- },
96
- {
97
- title: "bb7",
98
- time: "2021-08-06T22:46:34.565Z",
99
- _id: "bb7",
100
- status: "active",
101
- },
102
- {
103
- title: "bb8",
104
- time: "2021-08-06T22:46:34.565Z",
105
- _id: "bb8",
106
- status: "active",
107
- },
108
- {
109
- title: "bb9",
110
- time: "2021-08-06T22:46:33.565Z",
111
- _id: "bb9",
112
- status: "active",
113
- },
114
-
115
- {
116
- title: "bb10",
117
- time: "2021-08-06T22:46:34.565Z",
118
- _id: "bb10",
119
- status: "active",
120
- },
121
- {
122
- title: "bb11",
123
- time: "2021-08-06T22:46:34.565Z",
124
- _id: "bb11",
125
- status: "active",
126
- },
127
- {
128
- title: "bb12",
129
- time: "2021-08-06T22:46:34.565Z",
130
- videoSrc: "https://comapi.be-on.tv/v1/public/records/61043eedb50af916a6429fdc/video",
131
- _id: "bb12",
132
- status: "active",
133
- },
134
- {
135
- title: "bb13",
136
- time: "2021-08-07T22:46:39.565Z",
137
- _id: "bb13",
138
- status: "active",
139
- },
140
- ];
141
- const preferences = [
142
- {
143
- type: "text",
144
- placeholder: "Inserisci titolo di default",
145
- id: "defaultTitle",
146
- required: true,
147
-
148
- label: "Titolo di default",
149
- value: "titolotest",
150
- params: {
151
- minLength: 8,
152
- maxLength: 120,
153
- },
154
- },
155
- {
156
- type: "number",
157
- id: "age",
158
- required: true,
159
- label: "Age",
160
- value: 9,
161
- params: {
162
- min: 8,
163
- max: 120,
164
- },
165
- validationTip: "Min 8, Max 120",
166
- },
167
- ];
168
- const rowsWithActions: Component["rows"] = [
169
- {
170
- title: "bau",
171
- _actions: [
172
- {
173
- name: "activate",
174
- type: "icon",
175
- iconOrText: "ticket-fill",
176
- confirm: {
177
- confirmLabel: "conferma",
178
- title: "confermi?",
179
- content: "contenuto dialog1",
180
- },
181
- },
182
- {
183
- name: "activate2",
184
- type: "icon",
185
- iconOrText: "ticket-fill",
186
- confirm: {
187
- confirmLabel: "conferma",
188
- title: "confermi?",
189
- content: "contenuto dialog2",
190
- },
191
- },
192
- {
193
- name: "activate3",
194
- type: "icon",
195
- iconOrText: "ticket-fill",
196
- edit: {
197
- confirmLabel: "conferma",
198
- title: "confermi?",
199
- schema: preferences,
200
- },
201
- },
202
- ],
203
- videoSrc: "https://comapi.be-on.tv/v1/public/records/61043eedb50af916a6429fdc/video",
204
- time: "2021-08-06T22:46:30.565Z",
205
- _id: "bau",
206
- status: "closed",
207
- },
208
- {
209
- title: "bb1",
210
- videoSrc: "https://comapi.be-on.tv/v1/public/records/61043eedb50af916a6429fdc/video",
211
- time: "2021-08-06T22:46:31.565Z",
212
- description: "ffff2",
213
- _id: "bb1",
214
- status: "closed",
215
- _actions: [
216
- {
217
- name: "activate",
218
- type: "icon",
219
- iconOrText: "ticket-fill",
220
- confirm: {
221
- confirmLabel: "conferma",
222
- title: "confermi?",
223
- content: "content3",
224
- },
225
- },
226
- {
227
- name: "activate2",
228
- type: "icon",
229
- iconOrText: "ticket-fill",
230
- confirm: {
231
- confirmLabel: "conferma",
232
- title: "confermi?",
233
- content: "content4",
234
- },
235
- },
236
- ],
237
- },
238
- {
239
- title: "bb2",
240
- time: "2021-08-02T22:46:32.565Z",
241
- _id: "bb2",
242
- status: "active",
243
- _actions: [
244
- {
245
- name: "activate",
246
- type: "icon",
247
- iconOrText: "ticket-fill",
248
- confirm: {
249
- confirmLabel: "conferma",
250
- title: "confermi?",
251
- content: "",
252
- },
253
- },
254
- {
255
- name: "activate2",
256
- type: "icon",
257
- iconOrText: "ticket-fill",
258
- confirm: {
259
- confirmLabel: "conferma",
260
- title: "confermi?",
261
- content: "",
262
- },
263
- },
264
- ],
265
- },
266
- ];
267
-
268
- const basicHeaders: Component["headers"] = [
269
- {
270
- label: "title",
271
- key: "title",
272
- search: true,
273
- },
274
- {
275
- label: "description",
276
- key: "description",
277
- },
278
- {
279
- label: "nested",
280
- key: "testnested.nested",
281
- },
282
- {
283
- label: "data",
284
- key: "time",
285
- type: "datetime",
286
- format: "DD MMMM YYYY",
287
- },
288
- ];
289
- const basicHeadersWithTruncateAndCopy: Component["headers"] = [
290
- {
291
- label: "title",
292
- key: "title",
293
- search: true,
294
- },
295
- {
296
- label: "description",
297
- key: "description",
298
- truncateAt: 3,
299
- copyTxt: true,
300
- },
301
- {
302
- label: "nested",
303
- key: "testnested.nested",
304
- },
305
- {
306
- label: "data",
307
- key: "time",
308
- type: "datetime",
309
- format: "DD MMMM YYYY",
310
- },
311
- ];
312
- const basicHeadersWithActions: Component["headers"] = [
313
- {
314
- label: "title",
315
- key: "title",
316
- search: true,
317
- },
318
- {
319
- label: "description",
320
- key: "description",
321
- },
322
- {
323
- label: "nested",
324
- key: "testnested.nested",
325
- },
326
- {
327
- label: "data",
328
- key: "time",
329
- type: "datetime",
330
- format: "DD MMMM YYYY",
331
- },
332
-
333
- {
334
- label: "modifiche",
335
- key: "mod",
336
- type: "actions",
337
- nosort: true,
338
- },
339
- ];
340
- const headersWithMoreSearch: Component["headers"] = [
341
- {
342
- label: "title",
343
- key: "title",
344
- search: true,
345
- },
346
-
347
- {
348
- label: "clickable",
349
- key: "description",
350
- search: true,
351
- click: true,
352
- },
353
- {
354
- label: "nested",
355
- key: "testnested.nested",
356
- },
357
- {
358
- label: "data",
359
- key: "time",
360
- type: "datetime",
361
- format: "DD MMMM YYYY",
362
- },
363
- {
364
- label: "stato",
365
- key: "status",
366
- type: "enum",
367
- select: ["active", "closed"],
368
- search: true,
369
- },
370
- ];
371
- const headersWithNestedLabel: Component["headers"] = [
372
- {
373
- label: "title",
374
- key: "title",
375
- search: true,
376
- },
377
- {
378
- label: "description",
379
- key: "description",
380
- search: true,
381
- },
382
- {
383
- label: "nested",
384
- key: "testnested.nested",
385
- search: true,
386
- },
387
- {
388
- label: "data",
389
- key: "time",
390
- type: "datetime",
391
- format: "DD MMMM YYYY",
392
- },
393
- ];
394
- const headersWithAllSearches: Component["headers"] = [
395
- {
396
- label: "title",
397
- key: "title",
398
- search: true,
399
- },
400
- {
401
- label: "description",
402
- key: "description",
403
- search: true,
404
- },
405
- {
406
- label: "nested",
407
- key: "testnested.nested",
408
- search: true,
409
- },
410
- {
411
- label: "data",
412
- key: "time",
413
- type: "datetime",
414
- format: "DD MMMM YYYY",
415
- search: true,
416
- },
417
- ];
418
- const headersWithDateOnly: Component["headers"] = [
419
- {
420
- label: "title",
421
- key: "title",
422
- },
423
- {
424
- label: "description",
425
- key: "description",
426
- click: true,
427
- },
428
- {
429
- label: "nested",
430
- key: "testnested.nested",
431
- },
432
- {
433
- label: "data",
434
- key: "time",
435
- type: "datetime",
436
- format: "DD MMMM YYYY",
437
- search: true,
438
- },
439
- ];
440
-
441
- const actions: Component["actions"] = [
442
- {
443
- name: "testaction",
444
- type: "text",
445
- iconOrText: "string",
446
- },
447
- {
448
- name: "testaction2",
449
- type: "icon",
450
- iconOrText: "github",
451
- },
452
- ];
453
-
454
- const selections = [
455
- {
456
- name: "testaction",
457
- type: "text",
458
- iconOrText: "string",
459
- },
460
- {
461
- name: "testaction2",
462
- type: "icon",
463
- iconOrText: "github",
464
- },
465
- ];
466
- const examples: { name: string; description?: string; data: Component }[] = [
467
- {
468
- name: "BasicTableWithClick",
469
- data: {
470
- headers: basicHeaders,
471
- rows,
472
- selectrow: "yes",
473
- },
474
- },
475
- {
476
- name: "BasicTableWithMoreSearchAndSelect",
477
- data: {
478
- headers: headersWithMoreSearch,
479
- selectactions: selections,
480
- rows,
481
- enableselect: "yes",
482
- },
483
- },
484
- {
485
- name: "BasicTableWithSearchOnNestedField",
486
- data: {
487
- headers: headersWithNestedLabel,
488
- rows,
489
- },
490
- },
491
- {
492
- name: "BasicTableWithSearchOnAllFields",
493
- data: {
494
- headers: headersWithAllSearches,
495
- rows,
496
- selectrow: "yes",
497
- },
498
- },
499
- {
500
- name: "BasicTableWithDate",
501
- data: {
502
- headers: headersWithDateOnly,
503
- rows,
504
- },
505
- },
506
- {
507
- name: "BasicTableWithActions",
508
- data: {
509
- headers: headersWithAllSearches,
510
- rows,
511
- actions,
512
- },
513
- },
514
- {
515
- name: "BasicTableWithActionsAndSelect",
516
- data: {
517
- headers: headersWithAllSearches,
518
- rows,
519
- actions,
520
- selectactions: selections,
521
- },
522
- },
523
-
524
- {
525
- name: "BasicTableWithActionsConfirmAndForm",
526
- data: {
527
- headers: basicHeadersWithActions,
528
- rows: rowsWithActions,
529
- actions,
530
- },
531
- },
532
- {
533
- name: "BasicTableWithTruncateAndCopy",
534
- data: {
535
- headers: basicHeadersWithTruncateAndCopy,
536
- rows,
537
- selectrow: "yes",
538
- },
539
- },
540
- ];
541
- export const componentSetup: ComponentSetup & { examples: { name: string; description?: string; data: Component }[] } = {
542
- definitions: null as any,
543
- storybookArgs,
544
- styleSetup,
545
- author: null as any,
546
- contributors: [],
547
- owner: null as any,
548
- htmlSlots,
549
- i18n: i18nLanguages,
550
- examples,
551
- screenshots: [],
552
- licenses: [{ type: "Apache-2.0", path: "LICENSE.md", cost: 0, currency: "EUR" }],
553
- readmePath: "README.md",
554
- name: "hb-table",
555
- category: "table",
556
- tags: ["table"],
557
- size: {},
558
- iifePath: "release/release.js",
559
- repoName: "@htmlbricks/hb-table",
560
- version: null as any,
561
- };