@stonecrop/atable 0.6.2 → 0.7.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/README.md +10 -10
- package/dist/atable.d.ts +10 -13
- package/dist/atable.js +775 -779
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +2 -2
- package/dist/atable.umd.cjs.map +1 -1
- package/dist/icons/stonecrop-ui-icon-delete.svg +5 -0
- package/dist/icons/stonecrop-ui-icon-duplicate.svg +5 -0
- package/dist/icons/stonecrop-ui-icon-insert-above.svg +15 -0
- package/dist/icons/stonecrop-ui-icon-insert-below.svg +15 -0
- package/dist/icons/stonecrop-ui-icon-move.svg +4 -0
- package/dist/src/stores/table.d.ts +6 -6
- package/dist/src/tsdoc-metadata.json +1 -1
- package/dist/src/types/index.d.ts +4 -7
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/themes/default.css +1 -0
- package/package.json +21 -21
- package/src/types/index.ts +4 -7
package/README.md
CHANGED
|
@@ -67,9 +67,9 @@ const config = {
|
|
|
67
67
|
|
|
68
68
|
The primary API for ATable is the column object.
|
|
69
69
|
|
|
70
|
-
- `
|
|
70
|
+
- `label`: String; optional (the display label for the column header)
|
|
71
71
|
- `name`: String; required (a reference to the column that must follow rules for valid JS variable naming)
|
|
72
|
-
- `
|
|
72
|
+
- `fieldtype`: String; optional (a valid field type, full list [below](#column-data-types))
|
|
73
73
|
- `align`: String; optional (one of `left`, `right` or `center`; defaults to `center`)
|
|
74
74
|
- `edit`: Boolean; optional (indicates if the field is editable; defaults to `false`)
|
|
75
75
|
- `width`: String; optional (used to indicate the width of the cell; defaults to `40ch`)
|
|
@@ -78,16 +78,16 @@ The primary API for ATable is the column object.
|
|
|
78
78
|
|
|
79
79
|
```js
|
|
80
80
|
{
|
|
81
|
-
|
|
81
|
+
label: 'Batch Name',
|
|
82
82
|
name: 'name',
|
|
83
|
-
|
|
83
|
+
fieldtype: 'Data',
|
|
84
84
|
align: 'right',
|
|
85
85
|
edit: false,
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
|
-
|
|
88
|
+
label: 'Species',
|
|
89
89
|
name: 'species',
|
|
90
|
-
|
|
90
|
+
fieldtype: 'Select',
|
|
91
91
|
align: 'left',
|
|
92
92
|
edit: true,
|
|
93
93
|
width: '30ch',
|
|
@@ -95,9 +95,9 @@ The primary API for ATable is the column object.
|
|
|
95
95
|
options: () => ['Rainbow Trout', 'Steelhead', 'Golden Trout', 'Pacific Salmon']
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
|
-
|
|
98
|
+
label: 'Date',
|
|
99
99
|
name: 'set_date',
|
|
100
|
-
|
|
100
|
+
fieldtype: 'Date',
|
|
101
101
|
align: 'center',
|
|
102
102
|
edit: true,
|
|
103
103
|
width: '30ch',
|
|
@@ -124,8 +124,8 @@ import { ref } from 'vue'
|
|
|
124
124
|
|
|
125
125
|
const tableData = ref([...])
|
|
126
126
|
const tableColumns = ref([
|
|
127
|
-
{ name: 'id', label: 'ID', width: '80px',
|
|
128
|
-
{ name: 'name', label: 'Name', width: '150px',
|
|
127
|
+
{ name: 'id', label: 'ID', width: '80px', fieldtype: 'Int' },
|
|
128
|
+
{ name: 'name', label: 'Name', width: '150px', fieldtype: 'Data' },
|
|
129
129
|
])
|
|
130
130
|
|
|
131
131
|
const onColumnsChange = (columns) => {
|
package/dist/atable.d.ts
CHANGED
|
@@ -180,7 +180,7 @@ name: string;
|
|
|
180
180
|
align?: CanvasTextAlign | undefined;
|
|
181
181
|
edit?: boolean | undefined;
|
|
182
182
|
label?: string | undefined;
|
|
183
|
-
|
|
183
|
+
fieldtype?: string | undefined;
|
|
184
184
|
width?: string | undefined;
|
|
185
185
|
pinned?: boolean | undefined;
|
|
186
186
|
resizable?: boolean | undefined;
|
|
@@ -204,7 +204,7 @@ name: string;
|
|
|
204
204
|
align?: CanvasTextAlign | undefined;
|
|
205
205
|
edit?: boolean | undefined;
|
|
206
206
|
label?: string | undefined;
|
|
207
|
-
|
|
207
|
+
fieldtype?: string | undefined;
|
|
208
208
|
width?: string | undefined;
|
|
209
209
|
pinned?: boolean | undefined;
|
|
210
210
|
resizable?: boolean | undefined;
|
|
@@ -474,7 +474,7 @@ name: string;
|
|
|
474
474
|
align?: CanvasTextAlign | undefined;
|
|
475
475
|
edit?: boolean | undefined;
|
|
476
476
|
label?: string | undefined;
|
|
477
|
-
|
|
477
|
+
fieldtype?: string | undefined;
|
|
478
478
|
width?: string | undefined;
|
|
479
479
|
pinned?: boolean | undefined;
|
|
480
480
|
resizable?: boolean | undefined;
|
|
@@ -498,7 +498,7 @@ name: string;
|
|
|
498
498
|
align?: CanvasTextAlign | undefined;
|
|
499
499
|
edit?: boolean | undefined;
|
|
500
500
|
label?: string | undefined;
|
|
501
|
-
|
|
501
|
+
fieldtype?: string | undefined;
|
|
502
502
|
width?: string | undefined;
|
|
503
503
|
pinned?: boolean | undefined;
|
|
504
504
|
resizable?: boolean | undefined;
|
|
@@ -768,7 +768,7 @@ name: string;
|
|
|
768
768
|
align?: CanvasTextAlign | undefined;
|
|
769
769
|
edit?: boolean | undefined;
|
|
770
770
|
label?: string | undefined;
|
|
771
|
-
|
|
771
|
+
fieldtype?: string | undefined;
|
|
772
772
|
width?: string | undefined;
|
|
773
773
|
pinned?: boolean | undefined;
|
|
774
774
|
resizable?: boolean | undefined;
|
|
@@ -792,7 +792,7 @@ name: string;
|
|
|
792
792
|
align?: CanvasTextAlign | undefined;
|
|
793
793
|
edit?: boolean | undefined;
|
|
794
794
|
label?: string | undefined;
|
|
795
|
-
|
|
795
|
+
fieldtype?: string | undefined;
|
|
796
796
|
width?: string | undefined;
|
|
797
797
|
pinned?: boolean | undefined;
|
|
798
798
|
resizable?: boolean | undefined;
|
|
@@ -1240,15 +1240,12 @@ export declare interface TableColumn {
|
|
|
1240
1240
|
*/
|
|
1241
1241
|
label?: string;
|
|
1242
1242
|
/**
|
|
1243
|
-
* The
|
|
1244
|
-
*
|
|
1245
|
-
* - `Select` - the column contains a select input
|
|
1246
|
-
* - `Date` - the column contains a date input
|
|
1247
|
-
* - `component` - the column contains a custom component
|
|
1243
|
+
* The semantic field type of the column. Uses the same StonecropFieldType enum as forms.
|
|
1244
|
+
* Common values: 'Data', 'Text', 'Int', 'Float', 'Date', 'Select', 'Link', 'Check', etc.
|
|
1248
1245
|
*
|
|
1249
|
-
* @
|
|
1246
|
+
* @public
|
|
1250
1247
|
*/
|
|
1251
|
-
|
|
1248
|
+
fieldtype?: string;
|
|
1252
1249
|
/**
|
|
1253
1250
|
* The width of the column. This can be a number (in pixels) or a string (in CSS units).
|
|
1254
1251
|
*
|