@dosgato/templating 1.0.4 → 1.0.5
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/dist/uitemplate.d.ts +36 -30
- package/package.json +1 -1
package/dist/uitemplate.d.ts
CHANGED
|
@@ -109,6 +109,36 @@ export interface UITemplate extends UITemplateBase {
|
|
|
109
109
|
shouldAppear?: (data: PageData, path: string) => boolean;
|
|
110
110
|
}[];
|
|
111
111
|
}
|
|
112
|
+
export interface ExtraDataColumn {
|
|
113
|
+
/**
|
|
114
|
+
* A title for the column in header row.
|
|
115
|
+
*/
|
|
116
|
+
title: string;
|
|
117
|
+
/**
|
|
118
|
+
* If given a string, will be treated as a dot-separated path within DataData and
|
|
119
|
+
* the content at that path will be html-encoded and placed inside the field.
|
|
120
|
+
*
|
|
121
|
+
* If given a function, the result of the function will be placed inside the field
|
|
122
|
+
* without html-encoding, so that you can write your own HTML. Do the encoding yourself.
|
|
123
|
+
*/
|
|
124
|
+
get: string | ((data: DataData) => string);
|
|
125
|
+
/**
|
|
126
|
+
* An icon for the cell in all regular rows (not the header).
|
|
127
|
+
*/
|
|
128
|
+
icon?: (data: DataData) => IconOrSVG | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* Set a fixed width for this column
|
|
131
|
+
*
|
|
132
|
+
* For example, "50px", "12em", or "10vw"
|
|
133
|
+
*/
|
|
134
|
+
fixed?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Set a dynamic width for this column as a ratio of the name column
|
|
137
|
+
*
|
|
138
|
+
* For example, 0.5 = half the name column, 2 = double the name column
|
|
139
|
+
*/
|
|
140
|
+
grow?: number;
|
|
141
|
+
}
|
|
112
142
|
export interface UITemplateData extends UITemplateBase {
|
|
113
143
|
/**
|
|
114
144
|
* Add extra columns between name and published status.
|
|
@@ -116,36 +146,7 @@ export interface UITemplateData extends UITemplateBase {
|
|
|
116
146
|
* Without configuration, only data entry name, published status, and modified info
|
|
117
147
|
* is shown in the list view.
|
|
118
148
|
*/
|
|
119
|
-
columns?:
|
|
120
|
-
/**
|
|
121
|
-
* A title for the column in header row.
|
|
122
|
-
*/
|
|
123
|
-
title: string;
|
|
124
|
-
/**
|
|
125
|
-
* If given a string, will be treated as a dot-separated path within DataData and
|
|
126
|
-
* the content at that path will be html-encoded and placed inside the field.
|
|
127
|
-
*
|
|
128
|
-
* If given a function, the result of the function will be placed inside the field
|
|
129
|
-
* without html-encoding, so that you can write your own HTML. Do the encoding yourself.
|
|
130
|
-
*/
|
|
131
|
-
get: string | ((data: DataData) => string);
|
|
132
|
-
/**
|
|
133
|
-
* An icon for the cell in all regular rows (not the header).
|
|
134
|
-
*/
|
|
135
|
-
icon?: (data: DataData) => IconOrSVG | undefined;
|
|
136
|
-
/**
|
|
137
|
-
* Set a fixed width for this column
|
|
138
|
-
*
|
|
139
|
-
* For example, "50px", "12em", or "10vw"
|
|
140
|
-
*/
|
|
141
|
-
fixed?: string;
|
|
142
|
-
/**
|
|
143
|
-
* Set a dynamic width for this column as a ratio of the name column
|
|
144
|
-
*
|
|
145
|
-
* For example, 0.5 = half the name column, 2 = double the name column
|
|
146
|
-
*/
|
|
147
|
-
grow?: number;
|
|
148
|
-
}[];
|
|
149
|
+
columns?: ExtraDataColumn[];
|
|
149
150
|
/**
|
|
150
151
|
* It may be preferred to show the computeName source (e.g. title) instead of
|
|
151
152
|
* showing the computed name itself in the leftmost column of the data tree.
|
|
@@ -158,6 +159,11 @@ export interface UITemplateData extends UITemplateBase {
|
|
|
158
159
|
icon?: (data: DataData) => IconOrSVG | undefined;
|
|
159
160
|
get?: string | ((data: DataData) => string);
|
|
160
161
|
};
|
|
162
|
+
/**
|
|
163
|
+
* Defines the responsive behavior of the list view, given a tree width. Should return an array with the titles of the extra columns that
|
|
164
|
+
* should be shown at the given tree width, or an empty array if none should be shown. The behavior of the default columns is handled by the admin interface.
|
|
165
|
+
*/
|
|
166
|
+
responsiveDataColumns?: ((treeWidth: number) => string[]);
|
|
161
167
|
}
|
|
162
168
|
/**
|
|
163
169
|
* This is a type for the data that will be passed to dialog Svelte components as
|