terrier-engine 4.0.9 → 4.0.11
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/dropdowns.ts +10 -0
- package/package.json +1 -1
- package/toasts.ts +5 -3
package/dropdowns.ts
CHANGED
|
@@ -19,6 +19,10 @@ export abstract class Dropdown<T, TT extends ThemeType> extends TerrierPart<T, T
|
|
|
19
19
|
|
|
20
20
|
parentPart?: StatelessPart
|
|
21
21
|
|
|
22
|
+
get parentClasses(): Array<string> {
|
|
23
|
+
return ['tt-dropdown', ...super.parentClasses]
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
// the computed absolute position of the
|
|
23
27
|
left = 0
|
|
24
28
|
top = 0
|
|
@@ -75,6 +79,12 @@ export abstract class Dropdown<T, TT extends ThemeType> extends TerrierPart<T, T
|
|
|
75
79
|
* A concrete dropdown part that shows a list of actions.
|
|
76
80
|
*/
|
|
77
81
|
export class ActionsDropdown<TT extends ThemeType> extends Dropdown<Array<Action<TT>>, TT> {
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
get parentClasses(): Array<string> {
|
|
85
|
+
return ['tt-actions-dropdown', ...super.parentClasses]
|
|
86
|
+
}
|
|
87
|
+
|
|
78
88
|
renderContent(parent: PartTag) {
|
|
79
89
|
// handle each key declared on the actions directly,
|
|
80
90
|
// then clear the dropdown and re-emit them on the parent part
|
package/package.json
CHANGED
package/toasts.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Logger } from "tuff-core/logging"
|
|
2
2
|
import { createElement } from "tuff-core/html"
|
|
3
|
-
import Theme, {ThemeType} from "./theme"
|
|
3
|
+
import Theme, {ThemeType} from "./theme"
|
|
4
4
|
|
|
5
5
|
const log = new Logger('Toasts')
|
|
6
6
|
|
|
@@ -19,16 +19,18 @@ function show<TT extends ThemeType>(message: string, options: ToastOptions<TT>,
|
|
|
19
19
|
log.info(`Show ${options.color }: ${message}`)
|
|
20
20
|
|
|
21
21
|
// ensure the container exists
|
|
22
|
-
let container = document.getElementById('toasts')
|
|
22
|
+
let container = document.getElementById('tt-toasts')
|
|
23
23
|
if (!container) {
|
|
24
|
+
log.debug(`Creating toasts container`)
|
|
24
25
|
container = createElement('div', (div) => {
|
|
25
|
-
div.sel('#toasts.flex.column.padded')
|
|
26
|
+
div.sel('#tt-toasts.flex.column.padded')
|
|
26
27
|
})
|
|
27
28
|
document.body.appendChild(container)
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
// create the toast element
|
|
31
32
|
const toast = createElement('div', (parent) => {
|
|
33
|
+
parent.class('tt-toast')
|
|
32
34
|
parent.class(options.color)
|
|
33
35
|
if (options?.icon) {
|
|
34
36
|
theme.renderIcon(parent, options.icon, 'white')
|