@antelopejs/interface-dms 0.4.0 → 0.4.2
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 +33 -0
- package/dist/base/banner.d.ts +15 -9
- package/dist/base/banner.js +8 -3
- package/dist/base/banner.js.map +1 -1
- package/dist/base/card.d.ts +2 -2
- package/dist/base/chart-card.d.ts +6 -2
- package/dist/base/chart-card.js.map +1 -1
- package/dist/base/chart.d.ts +4 -0
- package/dist/base/chart.js.map +1 -1
- package/dist/base/display.d.ts +30 -0
- package/dist/base/display.js +16 -1
- package/dist/base/display.js.map +1 -1
- package/dist/base/internal/composed-text.d.ts +14 -0
- package/dist/base/internal/composed-text.js +51 -0
- package/dist/base/internal/composed-text.js.map +1 -0
- package/dist/base/key-value-list.d.ts +31 -25
- package/dist/base/key-value-list.js +5 -3
- package/dist/base/key-value-list.js.map +1 -1
- package/dist/base/kpi-card.d.ts +6 -2
- package/dist/base/kpi-card.js.map +1 -1
- package/dist/base/meter.d.ts +2 -1
- package/dist/base/meter.js.map +1 -1
- package/dist/base/stat-group.d.ts +30 -21
- package/dist/base/stat-group.js +7 -3
- package/dist/base/stat-group.js.map +1 -1
- package/dist/base/tab.d.ts +7 -1
- package/dist/base/tab.js.map +1 -1
- package/dist/base/table-view/column-display.d.ts +80 -3
- package/dist/base/table-view/column-display.js +12 -1
- package/dist/base/table-view/column-display.js.map +1 -1
- package/dist/base/table-view/schema.d.ts +2 -2
- package/dist/base/top-list-card.d.ts +6 -2
- package/dist/base/top-list-card.js.map +1 -1
- package/dist/base/types/composed-text.d.ts +120 -0
- package/dist/base/types/composed-text.js +17 -0
- package/dist/base/types/composed-text.js.map +1 -0
- package/dist/base/types/index.d.ts +1 -0
- package/dist/base/types/index.js +1 -0
- package/dist/base/types/index.js.map +1 -1
- package/dist/layout-banners.d.ts +74 -11
- package/dist/layout-banners.js +3 -3
- package/dist/layout-banners.js.map +1 -1
- package/package.json +1 -1
package/dist/base/meter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meter.js","sourceRoot":"","sources":["../../src/base/meter.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"meter.js","sourceRoot":"","sources":["../../src/base/meter.ts"],"names":[],"mappings":";;;AAqGA,sBAOC;AA5GD,4CAAgD;AAChD,6BAAwB;AACxB,qDAA+E;AAC/E,uCAMmB;AACnB,gDAA8C;AAG9C,uCAAqC;AAErC;;;GAGG;AACU,QAAA,WAAW,GAAG,CAAC,GAAG,YAAK,EAAE,MAAM,CAAU,CAAC;AAGvD,mEAAmE;AACtD,QAAA,aAAa,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAG/E,gDAAgD;AACnC,QAAA,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAmDvD,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAC/C,MAAM,YAAY,GAAG,YAAY,CAAC;AAElC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,KAAK,CAAC,OAAoB;IACxC,OAAO,IAAI,4BAAgB,CAAa,oBAAoB,CAAC;SAC1D,OAAO,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;SACvB,IAAI,CAAC;QACJ,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,OAAO;QAC/B,IAAI,EAAE,YAAY;KACnB,CAAC,CAAC;AACP,CAAC;AAED,MAAM,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,KAAK,EAAE,IAAA,mBAAE,EAAC,OAAC,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC3D,IAAI,EAAE,IAAA,mBAAE,EAAC,IAAA,kBAAQ,EAAC,mBAAW,CAAC,CAAC,QAAQ,EAAE,EAAE;QACzC,KAAK,EAAE,MAAM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;QACb,KAAK,EAAE,YAAY;QACnB,MAAM,EAAE,WAAW;KACpB,CAAC;IACF,QAAQ,EAAE,IAAA,6BAAmB,EAAC,8BAA8B,CAAC;IAC7D,cAAc,EAAE,IAAA,mCAAyB,GAAE;IAC3C,IAAI,EAAE,IAAA,yBAAe,EAAC,KAAK,CAAC;IAC5B,OAAO,EAAE,IAAA,4BAAkB,EAAC,6BAA6B,CAAC;CAC3D,CAAuC,CAAC;AAEzC,IAAA,kCAAiB,EAAC;IAChB,IAAI,EAAE,OAAO;IACb,aAAa,EAAE,oBAAoB;IACnC,MAAM,EAAE,mBAAW;IACnB,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,+CAA+C;QAC5D,KAAK,EAAE,eAAe;KACvB;CACF,CAAC,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
import { type BlockItemsSource } from "./display";
|
|
4
4
|
import { type Tone, type IconTone } from "./types/tone";
|
|
5
5
|
import type { BaseComponentProps } from "./types";
|
|
6
|
+
import type { BlockText } from "./types/composed-text";
|
|
6
7
|
/** One cell of a stat group. */
|
|
7
8
|
export interface StatGroupItem {
|
|
8
9
|
/** Stable key; the position is used without one. */
|
|
@@ -14,12 +15,20 @@ export interface StatGroupItem {
|
|
|
14
15
|
* cards layout.
|
|
15
16
|
*/
|
|
16
17
|
tone?: IconTone;
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Mono label above the value; `$`-prefixed for an i18n key, or a
|
|
20
|
+
* `ComposedText`.
|
|
21
|
+
*/
|
|
22
|
+
eyebrow: BlockText;
|
|
23
|
+
/**
|
|
24
|
+
* The figure or the short state; a number is formatted for the locale, and
|
|
25
|
+
* a `ComposedText` composes an amount, a date or a count in the
|
|
26
|
+
* reader's language (`{ key: "saas.stats.mrr", params: { amount: { type:
|
|
27
|
+
* "money", value: 92200, currency: "EUR" } } }`).
|
|
28
|
+
*/
|
|
29
|
+
value: BlockText | number;
|
|
30
|
+
/** One line under the value: a string or a `ComposedText`. */
|
|
31
|
+
detail?: BlockText;
|
|
23
32
|
/** Tone of the detail line (`neutral` = muted). */
|
|
24
33
|
detailTone?: Tone;
|
|
25
34
|
/** Route, `#anchor` or URL the whole cell links to. */
|
|
@@ -80,27 +89,27 @@ export declare const StatGroupSchema: z.ZodObject<{
|
|
|
80
89
|
id: z.ZodOptional<z.ZodString>;
|
|
81
90
|
icon: z.ZodOptional<z.ZodString>;
|
|
82
91
|
tone: z.ZodOptional<z.ZodEnum<["primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | "muted", ...("primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | "muted")[]]>>;
|
|
83
|
-
eyebrow: z.
|
|
84
|
-
value: z.ZodUnion<[z.
|
|
85
|
-
detail: z.ZodOptional<z.
|
|
92
|
+
eyebrow: z.ZodType<BlockText, z.ZodTypeDef, BlockText>;
|
|
93
|
+
value: z.ZodUnion<[z.ZodType<BlockText, z.ZodTypeDef, BlockText>, z.ZodNumber]>;
|
|
94
|
+
detail: z.ZodOptional<z.ZodType<BlockText, z.ZodTypeDef, BlockText>>;
|
|
86
95
|
detailTone: z.ZodOptional<z.ZodEnum<["primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral", ...("primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral")[]]>>;
|
|
87
96
|
to: z.ZodOptional<z.ZodString>;
|
|
88
97
|
}, "strip", z.ZodTypeAny, {
|
|
89
|
-
value:
|
|
90
|
-
eyebrow:
|
|
98
|
+
value: number | BlockText;
|
|
99
|
+
eyebrow: BlockText;
|
|
91
100
|
id?: string | undefined;
|
|
92
101
|
icon?: string | undefined;
|
|
93
102
|
to?: string | undefined;
|
|
94
|
-
detail?:
|
|
103
|
+
detail?: BlockText | undefined;
|
|
95
104
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | "muted" | undefined;
|
|
96
105
|
detailTone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
97
106
|
}, {
|
|
98
|
-
value:
|
|
99
|
-
eyebrow:
|
|
107
|
+
value: number | BlockText;
|
|
108
|
+
eyebrow: BlockText;
|
|
100
109
|
id?: string | undefined;
|
|
101
110
|
icon?: string | undefined;
|
|
102
111
|
to?: string | undefined;
|
|
103
|
-
detail?:
|
|
112
|
+
detail?: BlockText | undefined;
|
|
104
113
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | "muted" | undefined;
|
|
105
114
|
detailTone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
106
115
|
}>, "many">>;
|
|
@@ -110,12 +119,12 @@ export declare const StatGroupSchema: z.ZodObject<{
|
|
|
110
119
|
}, "strip", z.ZodTypeAny, {
|
|
111
120
|
layout: "cards" | "joined";
|
|
112
121
|
items?: {
|
|
113
|
-
value:
|
|
114
|
-
eyebrow:
|
|
122
|
+
value: number | BlockText;
|
|
123
|
+
eyebrow: BlockText;
|
|
115
124
|
id?: string | undefined;
|
|
116
125
|
icon?: string | undefined;
|
|
117
126
|
to?: string | undefined;
|
|
118
|
-
detail?:
|
|
127
|
+
detail?: BlockText | undefined;
|
|
119
128
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | "muted" | undefined;
|
|
120
129
|
detailTone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
121
130
|
}[] | undefined;
|
|
@@ -130,12 +139,12 @@ export declare const StatGroupSchema: z.ZodObject<{
|
|
|
130
139
|
skeletonCount?: number | undefined;
|
|
131
140
|
}, {
|
|
132
141
|
items?: {
|
|
133
|
-
value:
|
|
134
|
-
eyebrow:
|
|
142
|
+
value: number | BlockText;
|
|
143
|
+
eyebrow: BlockText;
|
|
135
144
|
id?: string | undefined;
|
|
136
145
|
icon?: string | undefined;
|
|
137
146
|
to?: string | undefined;
|
|
138
|
-
detail?:
|
|
147
|
+
detail?: BlockText | undefined;
|
|
139
148
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | "muted" | undefined;
|
|
140
149
|
detailTone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
141
150
|
}[] | undefined;
|
package/dist/base/stat-group.js
CHANGED
|
@@ -8,6 +8,7 @@ const block_registry_1 = require("./block-registry");
|
|
|
8
8
|
const display_1 = require("./display");
|
|
9
9
|
const display_2 = require("./internal/display");
|
|
10
10
|
const tone_1 = require("./types/tone");
|
|
11
|
+
const composed_text_1 = require("./internal/composed-text");
|
|
11
12
|
/** How a stat group lays its cells out: see `StatGroupProps.layout`. */
|
|
12
13
|
exports.STAT_GROUP_LAYOUTS = ["joined", "cards"];
|
|
13
14
|
const STAT_GROUP_COMPONENT_NAME = "dms-stat-group-block";
|
|
@@ -44,11 +45,14 @@ const StatGroupItemSchema = zod_1.z.object({
|
|
|
44
45
|
label: "Tone",
|
|
45
46
|
widget: "select",
|
|
46
47
|
}),
|
|
47
|
-
eyebrow: (0, block_registry_1.ui)(
|
|
48
|
+
eyebrow: (0, block_registry_1.ui)((0, composed_text_1.blockTextSchema)().describe("Mono label above the value."), {
|
|
48
49
|
label: "Label",
|
|
50
|
+
widget: "text",
|
|
49
51
|
}),
|
|
50
|
-
value: (0, block_registry_1.ui)(zod_1.z
|
|
51
|
-
|
|
52
|
+
value: (0, block_registry_1.ui)(zod_1.z
|
|
53
|
+
.union([(0, composed_text_1.blockTextSchema)(), zod_1.z.number()])
|
|
54
|
+
.describe("The figure or the state."), { label: "Value", widget: "text" }),
|
|
55
|
+
detail: (0, block_registry_1.ui)((0, composed_text_1.blockTextSchema)().optional(), { label: "Detail", widget: "text" }),
|
|
52
56
|
detailTone: (0, block_registry_1.ui)((0, display_2.toneEnum)(tone_1.TONES).optional(), {
|
|
53
57
|
label: "Detail tone",
|
|
54
58
|
widget: "select",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-group.js","sourceRoot":"","sources":["../../src/base/stat-group.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"stat-group.js","sourceRoot":"","sources":["../../src/base/stat-group.ts"],"names":[],"mappings":";;;AAmFA,8BAMC;AAzFD,4CAAgD;AAChD,6BAAwB;AACxB,qDAA+E;AAC/E,uCAA2E;AAC3E,gDAA8C;AAC9C,uCAA2E;AAC3E,4DAA2D;AAmC3D,wEAAwE;AAC3D,QAAA,kBAAkB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU,CAAC;AAkB/D,MAAM,yBAAyB,GAAG,sBAAsB,CAAC;AACzD,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAC5C,MAAM,yBAAyB,GAAoB,QAAQ,CAAC;AAE5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,SAAS,CACvB,OAAwB;IAExB,OAAO,IAAI,4BAAgB,CAAiB,yBAAyB,CAAC;SACnE,OAAO,CAAC,EAAE,MAAM,EAAE,yBAAyB,EAAE,GAAG,OAAO,EAAE,CAAC;SAC1D,IAAI,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,IAAA,mBAAE,EAAC,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC/D,IAAI,EAAE,IAAA,mBAAE,EAAC,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAClE,IAAI,EAAE,IAAA,mBAAE,EAAC,IAAA,kBAAQ,EAAC,iBAAU,CA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AAE,IAAA,mBAAE,EACR,OAAC;SACE,IAAI,CAAC,0BAAkB,CAAC;SACxB,OAAO,CAAC,yBAAyB,CAAC;SAClC,QAAQ,CAAC,gDAAgD,CAAC,EAC7D;QACE,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,YAAY;QACnB,MAAM,EAAE,WAAW;QACnB,WAAW,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;KAClD,CACF;IACD,OAAO,EAAE,IAAA,mBAAE,EACT,OAAC;SACE,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,2DAA2D,CAAC,EACxE,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CACxE;IACD,KAAK,EAAE,IAAA,mBAAE,EAAC,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC,EAAE;QACzE,KAAK,EAAE,iBAAiB;QACxB,KAAK,EAAE,UAAU;KAClB,CAAC;IACF,GAAG,IAAA,iCAAuB,GAAE;CAC7B,CAA2C,CAAC;AAE7C,IAAA,kCAAiB,EAAC;IAChB,IAAI,EAAE,WAAW;IACjB,aAAa,EAAE,yBAAyB;IACxC,MAAM,EAAE,uBAAe;IACvB,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,wEAAwE;QAC1E,KAAK,EAAE,eAAe;KACvB;CACF,CAAC,CAAC"}
|
package/dist/base/tab.d.ts
CHANGED
|
@@ -44,7 +44,13 @@ export interface TabProps extends BaseComponentProps {
|
|
|
44
44
|
* A module route answering `{ [slot]: string | number }` in one request:
|
|
45
45
|
* the badge of each tab it names (a count of a record's related rows),
|
|
46
46
|
* replacing its static `badge`. Fetched again when one of the tab set's
|
|
47
|
-
* `watchActions` fires
|
|
47
|
+
* `watchActions` fires, or when the page asks its blocks to refresh (see
|
|
48
|
+
* `BlockFunctions.REFRESH_PAGE`). Shown like a table view's tab counts.
|
|
49
|
+
*
|
|
50
|
+
* It may name the record of the page: `{{params.X}}` is filled with the
|
|
51
|
+
* route parameter `X` of the page URL (`/api/customers/{{params.id}}/counts`
|
|
52
|
+
* on a detail page), `{{query.X}}` with its query parameter `X`. Nothing is
|
|
53
|
+
* requested while a token has no value: the static badges show.
|
|
48
54
|
*/
|
|
49
55
|
badgesUrl?: string;
|
|
50
56
|
}
|
package/dist/base/tab.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab.js","sourceRoot":"","sources":["../../src/base/tab.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,6BAAwB;AACxB,qDAA+E;AAG/E,yCAAsC;AACtC,qDAAqD;AACrD,uCAAoC;AAEpC,IAAiB,SAAS,CAEzB;AAFD,WAAiB,SAAS;IACX,oBAAU,GAAG,yBAAyB,CAAC;AACtD,CAAC,EAFgB,SAAS,yBAAT,SAAS,QAEzB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;AACf,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;
|
|
1
|
+
{"version":3,"file":"tab.js","sourceRoot":"","sources":["../../src/base/tab.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,6BAAwB;AACxB,qDAA+E;AAG/E,yCAAsC;AACtC,qDAAqD;AACrD,uCAAoC;AAEpC,IAAiB,SAAS,CAEzB;AAFD,WAAiB,SAAS;IACX,oBAAU,GAAG,yBAAyB,CAAC;AACtD,CAAC,EAFgB,SAAS,yBAAT,SAAS,QAEzB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAA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AC;AAEvC,IAAA,kCAAiB,EAAC;IAChB,IAAI,EAAE,KAAK;IACX,aAAa,EAAE,kBAAkB;IACjC,MAAM,EAAE,iBAAS;IACjB,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE;IACvE,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,kDAAkD;QAC/D,KAAK,EAAE,QAAQ;KAChB;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Class, type ClassDecorator } from "@antelopejs/interface-core/decorators";
|
|
2
|
+
import type { BlockText } from "../types/composed-text";
|
|
2
3
|
import type { Tone } from "../types/tone";
|
|
3
4
|
/**
|
|
4
5
|
* How table cells (and expanded-row fields) draw a column's value, in place of
|
|
@@ -36,6 +37,39 @@ export interface ColumnDisplaySerialized {
|
|
|
36
37
|
export declare const RegisterDisplay: (id: string) => ClassDecorator<Class<ColumnDisplay<object>>>;
|
|
37
38
|
/** The tones of a cell's text. */
|
|
38
39
|
export type CellTone = "default" | "muted" | "dimmed" | "highlighted" | "success" | "warning" | "error" | "info" | "primary";
|
|
40
|
+
/**
|
|
41
|
+
* A cell's secondary line as a row field holds it, with the tone that row
|
|
42
|
+
* gives it: "Payment failed · retry Oct 10" in `error`, "Due Oct 28" in
|
|
43
|
+
* `muted`. The server picks the text and the tone per row; the column only
|
|
44
|
+
* names the field.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* @Listable(["status", "attemptCount", "nextPaymentAttemptAt"])
|
|
49
|
+
* get statusDetail(): CellSubline | null {
|
|
50
|
+
* if (this.status !== "open" || !this.nextPaymentAttemptAt) return null;
|
|
51
|
+
* const date = this.nextPaymentAttemptAt.toISOString();
|
|
52
|
+
* return {
|
|
53
|
+
* text: {
|
|
54
|
+
* key: "$saas.invoice.sub_state.retry",
|
|
55
|
+
* params: { date: { type: "date", value: date, format: "day" } },
|
|
56
|
+
* },
|
|
57
|
+
* tone: "error",
|
|
58
|
+
* };
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export interface CellSubline {
|
|
63
|
+
/** The line: a string (`$`-prefixed for an i18n key) or a composed text. */
|
|
64
|
+
text: BlockText;
|
|
65
|
+
/** Tone of the line; the display's own tone when left out. */
|
|
66
|
+
tone?: CellTone;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* What a row field drawn as a cell's secondary line holds: a text, or a text
|
|
70
|
+
* and its tone. Nothing (`null`, `""`) draws no line.
|
|
71
|
+
*/
|
|
72
|
+
export type CellSublineValue = BlockText | CellSubline;
|
|
39
73
|
export declare namespace DefaultDisplays {
|
|
40
74
|
/** A badge an identity cell shows when a field of the row matches. */
|
|
41
75
|
interface IdentityBadge {
|
|
@@ -55,8 +89,14 @@ export declare namespace DefaultDisplays {
|
|
|
55
89
|
avatarField?: string;
|
|
56
90
|
/** Icon drawn in a tile instead of an avatar. */
|
|
57
91
|
icon?: string;
|
|
58
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* Row field drawn as the secondary line: a string, drawn as written (an
|
|
94
|
+
* address, an id), or a `ComposedText` or {@link CellSubline}
|
|
95
|
+
* composed in the reader's language.
|
|
96
|
+
*/
|
|
59
97
|
subtitleField?: string;
|
|
98
|
+
/** Tone of the secondary line when the row gives none. Defaults to `dimmed`. */
|
|
99
|
+
subtitleTone?: CellTone;
|
|
60
100
|
/** Row field holding the user id that marks the signed-in user's row. */
|
|
61
101
|
selfField?: string;
|
|
62
102
|
/** Tag of the signed-in user's row ("You"). `$`-prefixed: an i18n key. */
|
|
@@ -64,10 +104,18 @@ export declare namespace DefaultDisplays {
|
|
|
64
104
|
badges?: IdentityBadge[];
|
|
65
105
|
/** File storage the avatar is read from. */
|
|
66
106
|
storage?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Name drawn, muted, for a row without a value ("Automatic" for a credit
|
|
109
|
+
* note no operator issued). `$`-prefixed: an i18n key.
|
|
110
|
+
*/
|
|
111
|
+
emptyLabel?: string;
|
|
112
|
+
/** Icon drawn in a tile for a row without a value (`i-ph-robot`). */
|
|
113
|
+
emptyIcon?: string;
|
|
67
114
|
}
|
|
68
115
|
/**
|
|
69
116
|
* Avatar or icon tile, the value as the name, a "You" tag on the signed-in
|
|
70
|
-
* user's row, badges and a secondary line, all read off the row
|
|
117
|
+
* user's row, badges and a secondary line, all read off the row; an empty
|
|
118
|
+
* label and icon for a row without a value.
|
|
71
119
|
*/
|
|
72
120
|
class IdentityDisplay extends ColumnDisplay<IdentityDisplayOptions> {
|
|
73
121
|
}
|
|
@@ -142,14 +190,43 @@ export declare namespace DefaultDisplays {
|
|
|
142
190
|
* @example { healthy: "success", degraded: "warning", failing: "error" }
|
|
143
191
|
*/
|
|
144
192
|
tones: Record<string, Tone>;
|
|
145
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* Row field drawn under the pill (the failure's cause): a string
|
|
195
|
+
* (`$`-prefixed for an i18n key), a `ComposedText` or a
|
|
196
|
+
* {@link CellSubline} carrying its own tone.
|
|
197
|
+
*/
|
|
146
198
|
subField?: string;
|
|
199
|
+
/** Tone of the line under the pill when the row gives none; the pill's by default. */
|
|
200
|
+
subTone?: CellTone;
|
|
147
201
|
/** A pulsing dot for these values (a run in progress). */
|
|
148
202
|
liveValues?: string[];
|
|
149
203
|
}
|
|
150
204
|
/** A status as a tinted pill led by a dot, with an optional line under it. */
|
|
151
205
|
class StatusPillDisplay extends ColumnDisplay<StatusPillDisplayOptions> {
|
|
152
206
|
}
|
|
207
|
+
interface TwoLineDisplayOptions {
|
|
208
|
+
/**
|
|
209
|
+
* Row field holding the primary line, a string (`$`-prefixed for an i18n
|
|
210
|
+
* key) or a `ComposedText`, drawn in place of the column's value
|
|
211
|
+
* ("Renews in 3 days" over a `renewsAt` date column). Without it the
|
|
212
|
+
* primary line is the column's value, written by the column's own data
|
|
213
|
+
* type (an amount, a date, a select's label) or composed when the value
|
|
214
|
+
* is a `ComposedText`.
|
|
215
|
+
*/
|
|
216
|
+
primaryField?: string;
|
|
217
|
+
/** Row field holding the secondary line: a {@link CellSublineValue}. */
|
|
218
|
+
subField?: string;
|
|
219
|
+
/** Tone of the secondary line when the row gives none. Defaults to `muted`. */
|
|
220
|
+
subTone?: CellTone;
|
|
221
|
+
/** Text drawn for an empty primary line. `$`-prefixed: an i18n key. Defaults to "—". */
|
|
222
|
+
emptyLabel?: string;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* A primary line over a secondary one, without an avatar: a plan over its
|
|
226
|
+
* price per seat, an amount over what it means, a reason over its memo.
|
|
227
|
+
*/
|
|
228
|
+
class TwoLineDisplay extends ColumnDisplay<TwoLineDisplayOptions> {
|
|
229
|
+
}
|
|
153
230
|
interface ProgressDisplayOptions {
|
|
154
231
|
/** Row field holding the number of items done. */
|
|
155
232
|
doneField: string;
|
|
@@ -47,7 +47,8 @@ var DefaultDisplays;
|
|
|
47
47
|
(function (DefaultDisplays) {
|
|
48
48
|
/**
|
|
49
49
|
* Avatar or icon tile, the value as the name, a "You" tag on the signed-in
|
|
50
|
-
* user's row, badges and a secondary line, all read off the row
|
|
50
|
+
* user's row, badges and a secondary line, all read off the row; an empty
|
|
51
|
+
* label and icon for a row without a value.
|
|
51
52
|
*/
|
|
52
53
|
let IdentityDisplay = class IdentityDisplay extends ColumnDisplay {
|
|
53
54
|
};
|
|
@@ -89,6 +90,16 @@ var DefaultDisplays;
|
|
|
89
90
|
(0, exports.RegisterDisplay)("status_pill")
|
|
90
91
|
], StatusPillDisplay);
|
|
91
92
|
DefaultDisplays.StatusPillDisplay = StatusPillDisplay;
|
|
93
|
+
/**
|
|
94
|
+
* A primary line over a secondary one, without an avatar: a plan over its
|
|
95
|
+
* price per seat, an amount over what it means, a reason over its memo.
|
|
96
|
+
*/
|
|
97
|
+
let TwoLineDisplay = class TwoLineDisplay extends ColumnDisplay {
|
|
98
|
+
};
|
|
99
|
+
TwoLineDisplay = __decorate([
|
|
100
|
+
(0, exports.RegisterDisplay)("two_line")
|
|
101
|
+
], TwoLineDisplay);
|
|
102
|
+
DefaultDisplays.TwoLineDisplay = TwoLineDisplay;
|
|
92
103
|
/**
|
|
93
104
|
* A bar filled with the share of items done ("31 / 44"), failed items in
|
|
94
105
|
* red at its end; green once every item is done.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-display.js","sourceRoot":"","sources":["../../../src/base/table-view/column-display.ts"],"names":[],"mappings":";;;;;;;;;AAAA,sEAI+C;
|
|
1
|
+
{"version":3,"file":"column-display.js","sourceRoot":"","sources":["../../../src/base/table-view/column-display.ts"],"names":[],"mappings":";;;;;;;;;AAAA,sEAI+C;AAG/C,8DAAuD;AAEvD;;;;;;;;;;;;;;;GAeG;AACH,MAAsB,aAAa;IAML;IAH5B,qEAAqE;IAClD,eAAe,GAAG,IAAI,CAAC;IAE1C,YAA4B,OAAiB;QAAjB,YAAO,GAAP,OAAO,CAAU;IAAG,CAAC;CAClD;AAPD,sCAOC;AASD;;;;;GAKG;AACU,QAAA,eAAe,GAEwB,IAAA,+BAAkB,EACpE,CAAC,MAAM,EAAE,EAAU,EAAE,EAAE;IACrB,2BAAU,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC,CACF,CAAC;AAiDF,IAAiB,eAAe,CA+N/B;AA/ND,WAAiB,eAAe;IA4C9B;;;;OAIG;IAEH,IAAa,eAAe,GAA5B,MAAa,eAAgB,SAAQ,aAAqC;KAAG,CAAA;IAAhE,eAAe;QAD3B,IAAA,uBAAe,EAAC,UAAU,CAAC;OACf,eAAe,CAAiD;IAAhE,+BAAe,kBAAiD,CAAA;IAoB7E;;;OAGG;IAEH,IAAa,YAAY,GAAzB,MAAa,YAAa,SAAQ,aAAkC;KAAG,CAAA;IAA1D,Y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,IAAa,eAAe,GAA5B,MAAa,eAAgB,SAAQ,aAAqC;KAAG,CAAA;IAAhE,eAAe;QAD3B,IAAA,uBAAe,EAAC,UAAU,CAAC;OACf,eAAe,CAAiD;IAAhE,+BAAe,kBAAiD,CAAA;IAE7E,oEAAoE;IAEpE,IAAa,YAAY,GAAzB,MAAa,YAAa,SAAQ,aAAoC;KAAG,CAAA;IAA5D,YAAY;QADxB,IAAA,uBAAe,EAAC,OAAO,CAAC;OACZ,YAAY,CAAgD;IAA5D,4BAAY,eAAgD,CAAA;IAOzE,wDAAwD;IAExD,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,aAAiC;KAAG,CAAA;IAAxD,WAAW;QADvB,IAAA,uBAAe,EAAC,MAAM,CAAC;OACX,WAAW,CAA6C;IAAxD,2BAAW,cAA6C,CAAA;AACvE,CAAC,EA/NgB,eAAe,+BAAf,eAAe,QA+N/B"}
|
|
@@ -897,7 +897,7 @@ export declare const TableViewSchema: z.ZodObject<{
|
|
|
897
897
|
countLabel?: string | undefined;
|
|
898
898
|
} | undefined;
|
|
899
899
|
labelKey?: string | undefined;
|
|
900
|
-
layout?: "
|
|
900
|
+
layout?: "compact" | "full" | undefined;
|
|
901
901
|
card?: {
|
|
902
902
|
component?: import("../..").Component<unknown> | undefined;
|
|
903
903
|
fields?: string[] | undefined;
|
|
@@ -1093,7 +1093,7 @@ export declare const TableViewSchema: z.ZodObject<{
|
|
|
1093
1093
|
countLabel?: string | undefined;
|
|
1094
1094
|
} | undefined;
|
|
1095
1095
|
labelKey?: string | undefined;
|
|
1096
|
-
layout?: "
|
|
1096
|
+
layout?: "compact" | "full" | undefined;
|
|
1097
1097
|
card?: {
|
|
1098
1098
|
component?: import("../..").Component<unknown> | undefined;
|
|
1099
1099
|
fields?: string[] | undefined;
|
|
@@ -21,6 +21,10 @@ export interface TopListItem {
|
|
|
21
21
|
export interface TopListCardProps extends BaseComponentProps {
|
|
22
22
|
title: string;
|
|
23
23
|
description?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Where the data is read from. `{{params.X}}` and `{{query.X}}` name the
|
|
26
|
+
* page URL, as in `BlockItemsSource.fetchUrl`.
|
|
27
|
+
*/
|
|
24
28
|
fetchUrl?: string;
|
|
25
29
|
fetchUrlMethod?: EnumOption<HttpMethod>;
|
|
26
30
|
periodScope?: string;
|
|
@@ -131,7 +135,7 @@ export declare const TopListCardSchema: z.ZodObject<{
|
|
|
131
135
|
maxHeight?: string | undefined;
|
|
132
136
|
skeletonCount?: number | undefined;
|
|
133
137
|
periodScope?: string | undefined;
|
|
134
|
-
valueFormat?: "number" | "
|
|
138
|
+
valueFormat?: "number" | "percent" | "compact" | "currency" | undefined;
|
|
135
139
|
currencyCode?: string | undefined;
|
|
136
140
|
showDelta?: boolean | undefined;
|
|
137
141
|
showSparkline?: boolean | undefined;
|
|
@@ -165,7 +169,7 @@ export declare const TopListCardSchema: z.ZodObject<{
|
|
|
165
169
|
maxHeight?: string | undefined;
|
|
166
170
|
skeletonCount?: number | undefined;
|
|
167
171
|
periodScope?: string | undefined;
|
|
168
|
-
valueFormat?: "number" | "
|
|
172
|
+
valueFormat?: "number" | "percent" | "compact" | "currency" | undefined;
|
|
169
173
|
currencyCode?: string | undefined;
|
|
170
174
|
showDelta?: boolean | undefined;
|
|
171
175
|
showSparkline?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-list-card.js","sourceRoot":"","sources":["../../src/base/top-list-card.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"top-list-card.js","sourceRoot":"","sources":["../../src/base/top-list-card.ts"],"names":[],"mappings":";;;AA+EA,kCASC;AAxFD,4CAAgD;AAChD,6BAAwB;AACxB,qDAK0B;AAC1B,mCAKiB;AAEjB,uCAA0C;AAuD1C,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AACzD,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAEzC;;;;;GAKG;AACH,SAAgB,WAAW,CACzB,OA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4B;IAC3C,MAAM,EAAE,yBAAiB;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,+CAA+C;QAC5D,KAAK,EAAE,eAAe;KACvB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A text the dashboard composes in the reader's language: an i18n key and the
|
|
3
|
+
* raw values its message names, each formatted for the reader's locale, time
|
|
4
|
+
* zone and clock when the text is drawn. The server sends the values, never a
|
|
5
|
+
* finished sentence, so a route answers the same JSON whatever the language of
|
|
6
|
+
* the person reading it.
|
|
7
|
+
*
|
|
8
|
+
* The key is looked up like any `$`-prefixed text, with or without its `$`:
|
|
9
|
+
* `"saas.billing.retry"` and `"$saas.billing.retry"` are the same message.
|
|
10
|
+
* A key the active language lacks falls back to the fallback language, then to
|
|
11
|
+
* the bare key.
|
|
12
|
+
*
|
|
13
|
+
* Plurals follow vue-i18n: the message lists its forms split by `|`
|
|
14
|
+
* (`"no seat | {count} seat | {count} seats"`) and the number named by
|
|
15
|
+
* `plural` picks one — by default the first `count` parameter.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* // "saas.banner.past_due": "Invoice {invoice} of {amount} failed, retry {date}"
|
|
20
|
+
* const text: ComposedText = {
|
|
21
|
+
* key: "saas.banner.past_due",
|
|
22
|
+
* params: {
|
|
23
|
+
* invoice: "INV-0042",
|
|
24
|
+
* amount: { type: "money", value: 2900, currency: "EUR" },
|
|
25
|
+
* date: { type: "date", value: "2026-10-10", format: "day" },
|
|
26
|
+
* },
|
|
27
|
+
* };
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export interface ComposedText {
|
|
31
|
+
/** The i18n key of the message; the leading `$` is optional. */
|
|
32
|
+
key: string;
|
|
33
|
+
/** The values the message names, by the name it gives them. */
|
|
34
|
+
params?: Record<string, ComposedTextParam>;
|
|
35
|
+
/**
|
|
36
|
+
* The parameter whose number picks the plural form. Defaults to the first
|
|
37
|
+
* `count` parameter; without one the message is not pluralised.
|
|
38
|
+
*/
|
|
39
|
+
plural?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* An amount in the minor unit of its currency (cents for `EUR`, yen for
|
|
43
|
+
* `JPY`), written with the currency's symbol in the reader's locale:
|
|
44
|
+
* `{ type: "money", value: 92200, currency: "EUR" }` reads "€922.00" in
|
|
45
|
+
* English, "922,00 €" in French.
|
|
46
|
+
*/
|
|
47
|
+
export interface ComposedTextMoneyParam {
|
|
48
|
+
type: "money";
|
|
49
|
+
/** The amount in minor units: an integer, the way payment providers store it. */
|
|
50
|
+
value: number;
|
|
51
|
+
/** ISO 4217 code. An unknown code writes the amount as a plain number. */
|
|
52
|
+
currency: string;
|
|
53
|
+
}
|
|
54
|
+
/** How much of a date a `date` or `datetime` parameter writes. */
|
|
55
|
+
export declare const COMPOSED_TEXT_DATE_FORMATS: readonly ["day", "short", "medium", "long"];
|
|
56
|
+
/**
|
|
57
|
+
* `day`: day and month ("Oct 10"); `short`: numeric ("10/10/2026");
|
|
58
|
+
* `medium`: the month abbreviated ("Oct 10, 2026"); `long`: the month in
|
|
59
|
+
* full ("October 10, 2026").
|
|
60
|
+
*/
|
|
61
|
+
export type ComposedTextDateFormat = (typeof COMPOSED_TEXT_DATE_FORMATS)[number];
|
|
62
|
+
/**
|
|
63
|
+
* A date (`date`), or a date and its time (`datetime`), in the reader's
|
|
64
|
+
* language, time zone and date format preference.
|
|
65
|
+
*/
|
|
66
|
+
export interface ComposedTextDateParam {
|
|
67
|
+
type: "date" | "datetime";
|
|
68
|
+
/** An ISO 8601 string or a timestamp in milliseconds. */
|
|
69
|
+
value: string | number;
|
|
70
|
+
/** Defaults to `medium`. */
|
|
71
|
+
format?: ComposedTextDateFormat;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The distance from now, past or future, in the largest whole unit: "in 3
|
|
75
|
+
* days", "tomorrow", "2 hours ago". It is computed when the text is drawn.
|
|
76
|
+
*/
|
|
77
|
+
export interface ComposedTextRelativeDateParam {
|
|
78
|
+
type: "relative";
|
|
79
|
+
/** An ISO 8601 string or a timestamp in milliseconds. */
|
|
80
|
+
value: string | number;
|
|
81
|
+
}
|
|
82
|
+
/** How a `number` parameter is written. */
|
|
83
|
+
export declare const COMPOSED_TEXT_NUMBER_FORMATS: readonly ["decimal", "percent", "compact"];
|
|
84
|
+
/**
|
|
85
|
+
* `decimal`: grouped digits ("1,284.5"); `percent`: a ratio as a percentage
|
|
86
|
+
* (`0.25` → "25%"); `compact`: a short form ("1.3K").
|
|
87
|
+
*/
|
|
88
|
+
export type ComposedTextNumberFormat = (typeof COMPOSED_TEXT_NUMBER_FORMATS)[number];
|
|
89
|
+
/** A number written for the reader's locale. */
|
|
90
|
+
export interface ComposedTextNumberParam {
|
|
91
|
+
type: "number";
|
|
92
|
+
value: number;
|
|
93
|
+
/** Defaults to `decimal`. */
|
|
94
|
+
format?: ComposedTextNumberFormat;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* A count: written like a number, and the parameter that picks the plural
|
|
98
|
+
* form of the message unless `ComposedText.plural` names another one.
|
|
99
|
+
*/
|
|
100
|
+
export interface ComposedTextCountParam {
|
|
101
|
+
type: "count";
|
|
102
|
+
value: number;
|
|
103
|
+
}
|
|
104
|
+
/** A parameter that says how its value is written. */
|
|
105
|
+
export type ComposedTextTypedParam = ComposedTextMoneyParam | ComposedTextDateParam | ComposedTextRelativeDateParam | ComposedTextNumberParam | ComposedTextCountParam;
|
|
106
|
+
/** The `type` of a typed parameter. */
|
|
107
|
+
export type ComposedTextParamType = ComposedTextTypedParam["type"];
|
|
108
|
+
/**
|
|
109
|
+
* A value a composed text names. A string is inserted as written — it is
|
|
110
|
+
* data (an invoice number, a plan name), not a key; a bare number is written
|
|
111
|
+
* for the locale; a typed parameter is formatted by its `type`; a nested
|
|
112
|
+
* `ComposedText` is composed first ("Business · {seats}" inside a sentence).
|
|
113
|
+
*/
|
|
114
|
+
export type ComposedTextParam = string | number | ComposedTextTypedParam | ComposedText;
|
|
115
|
+
/**
|
|
116
|
+
* Any text a block draws: a plain string, `$`-prefixed for an i18n key, or a
|
|
117
|
+
* {@link ComposedText}. Every option and fetched field typed `BlockText`
|
|
118
|
+
* accepts both, so a route can answer either.
|
|
119
|
+
*/
|
|
120
|
+
export type BlockText = string | ComposedText;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COMPOSED_TEXT_NUMBER_FORMATS = exports.COMPOSED_TEXT_DATE_FORMATS = void 0;
|
|
4
|
+
/** How much of a date a `date` or `datetime` parameter writes. */
|
|
5
|
+
exports.COMPOSED_TEXT_DATE_FORMATS = [
|
|
6
|
+
"day",
|
|
7
|
+
"short",
|
|
8
|
+
"medium",
|
|
9
|
+
"long",
|
|
10
|
+
];
|
|
11
|
+
/** How a `number` parameter is written. */
|
|
12
|
+
exports.COMPOSED_TEXT_NUMBER_FORMATS = [
|
|
13
|
+
"decimal",
|
|
14
|
+
"percent",
|
|
15
|
+
"compact",
|
|
16
|
+
];
|
|
17
|
+
//# sourceMappingURL=composed-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composed-text.js","sourceRoot":"","sources":["../../../src/base/types/composed-text.ts"],"names":[],"mappings":";;;AAuDA,kEAAkE;AACrD,QAAA,0BAA0B,GAAG;IACxC,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;CACE,CAAC;AAgCX,2CAA2C;AAC9B,QAAA,4BAA4B,GAAG;IAC1C,SAAS;IACT,SAAS;IACT,SAAS;CACD,CAAC"}
|
package/dist/base/types/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./base-component-props"), exports);
|
|
18
18
|
__exportStar(require("./button"), exports);
|
|
19
19
|
__exportStar(require("./color"), exports);
|
|
20
|
+
__exportStar(require("./composed-text"), exports);
|
|
20
21
|
__exportStar(require("./component-input"), exports);
|
|
21
22
|
__exportStar(require("./confirm-dialog"), exports);
|
|
22
23
|
__exportStar(require("./custom-button"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/base/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,2CAAyB;AACzB,0CAAwB;AACxB,oDAAkC;AAClC,mDAAiC;AACjC,kDAAgC;AAChC,gDAA8B;AAC9B,0CAAwB;AACxB,kDAAgC;AAChC,iDAA+B;AAC/B,8CAA4B;AAC5B,gDAA8B;AAC9B,yCAAuB;AACvB,yCAAuB;AACvB,gDAA8B;AAC9B,sDAAoC;AACpC,yCAAuB;AACvB,yCAAuB;AACvB,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/base/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,2CAAyB;AACzB,0CAAwB;AACxB,kDAAgC;AAChC,oDAAkC;AAClC,mDAAiC;AACjC,kDAAgC;AAChC,gDAA8B;AAC9B,0CAAwB;AACxB,kDAAgC;AAChC,iDAA+B;AAC/B,8CAA4B;AAC5B,gDAA8B;AAC9B,yCAAuB;AACvB,yCAAuB;AACvB,gDAA8B;AAC9B,sDAAoC;AACpC,yCAAuB;AACvB,yCAAuB;AACvB,0CAAwB"}
|