@tylertech/forge 3.5.0 → 3.6.0-dev.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.
Files changed (66) hide show
  1. package/custom-elements.json +1171 -1128
  2. package/dist/checkbox/forge-checkbox.css +1 -0
  3. package/dist/lib.js +27 -19
  4. package/dist/lib.js.map +4 -4
  5. package/dist/list/forge-list.css +1 -0
  6. package/dist/radio/forge-radio.css +2 -0
  7. package/dist/switch/forge-switch.css +2 -0
  8. package/dist/vscode.css-custom-data.json +15 -0
  9. package/dist/vscode.html-custom-data.json +81 -106
  10. package/esm/app-bar/profile-button/app-bar-profile-button.js +5 -2
  11. package/esm/avatar/avatar-constants.d.ts +0 -7
  12. package/esm/avatar/avatar-constants.js +1 -10
  13. package/esm/avatar/avatar.d.ts +24 -21
  14. package/esm/avatar/avatar.js +68 -45
  15. package/esm/avatar/index.d.ts +1 -3
  16. package/esm/avatar/index.js +4 -6
  17. package/esm/button/base/base-button-adapter.js +1 -1
  18. package/esm/button-area/button-area.js +1 -1
  19. package/esm/checkbox/checkbox.d.ts +1 -0
  20. package/esm/checkbox/checkbox.js +2 -1
  21. package/esm/dialog/dialog-adapter.d.ts +7 -0
  22. package/esm/dialog/dialog-adapter.js +43 -19
  23. package/esm/dialog/dialog-constants.d.ts +6 -0
  24. package/esm/dialog/dialog-constants.js +6 -2
  25. package/esm/dialog/dialog-core.d.ts +8 -0
  26. package/esm/dialog/dialog-core.js +20 -0
  27. package/esm/dialog/dialog.d.ts +14 -0
  28. package/esm/dialog/dialog.js +13 -1
  29. package/esm/icon-button/icon-button-constants.d.ts +4 -0
  30. package/esm/icon-button/icon-button-constants.js +2 -0
  31. package/esm/icon-button/icon-button-core.d.ts +4 -4
  32. package/esm/icon-button/icon-button-core.js +16 -14
  33. package/esm/icon-button/icon-button.d.ts +32 -29
  34. package/esm/icon-button/icon-button.js +5 -30
  35. package/esm/index.d.ts +3 -0
  36. package/esm/index.js +152 -156
  37. package/esm/list/list-item/list-item.js +1 -1
  38. package/esm/profile-card/profile-card.js +5 -2
  39. package/esm/radio/radio/radio.d.ts +1 -0
  40. package/esm/radio/radio/radio.js +2 -1
  41. package/esm/split-view/split-view/split-view-adapter.js +1 -0
  42. package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
  43. package/esm/switch/switch.d.ts +1 -0
  44. package/esm/switch/switch.js +2 -1
  45. package/esm/table/table-utils.js +6 -6
  46. package/esm/tabs/tab-bar/tab-bar-adapter.d.ts +0 -5
  47. package/esm/tabs/tab-bar/tab-bar-adapter.js +3 -11
  48. package/esm/tabs/tab-bar/tab-bar-constants.d.ts +0 -3
  49. package/esm/tabs/tab-bar/tab-bar-constants.js +0 -4
  50. package/esm/tabs/tab-bar/tab-bar-core.js +7 -7
  51. package/esm/tabs/tab-bar/tab-bar.d.ts +6 -3
  52. package/esm/tabs/tab-bar/tab-bar.js +6 -3
  53. package/package.json +2 -2
  54. package/sass/button-area/_core.scss +3 -0
  55. package/sass/checkbox/_core.scss +2 -2
  56. package/sass/core/styles/tokens/checkbox/_tokens.scss +1 -0
  57. package/sass/core/styles/tokens/radio/_tokens.scss +1 -0
  58. package/sass/core/styles/tokens/switch/_tokens.scss +1 -0
  59. package/sass/dialog/dialog.scss +5 -0
  60. package/sass/list/list-item/_core.scss +3 -0
  61. package/sass/radio/radio/_core.scss +2 -2
  62. package/sass/switch/_core.scss +2 -2
  63. package/esm/avatar/avatar-adapter.d.ts +0 -36
  64. package/esm/avatar/avatar-adapter.js +0 -55
  65. package/esm/avatar/avatar-core.d.ts +0 -38
  66. package/esm/avatar/avatar-core.js +0 -101
@@ -1,36 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Tyler Technologies, Inc.
4
- * License: Apache-2.0
5
- */
6
- import { BaseAdapter, IBaseAdapter } from '../core/base/base-adapter';
7
- import { IAvatarComponent } from './avatar';
8
- export interface IAvatarAdapter extends IBaseAdapter {
9
- setBackgroundImageUrl(url: string): Promise<boolean>;
10
- removeBackgroundImage(): void;
11
- setText(value: string): void;
12
- clearText(): void;
13
- }
14
- /**
15
- * The DOM adapter behind the `<forge-avatar>` element.
16
- */
17
- export declare class AvatarAdapter extends BaseAdapter<IAvatarComponent> implements IAvatarAdapter {
18
- private _root;
19
- private _defaultSlot;
20
- constructor(component: IAvatarComponent);
21
- /**
22
- * Sets the background image URL.
23
- * @param url The URL.
24
- */
25
- setBackgroundImageUrl(url: string): Promise<boolean>;
26
- /**
27
- * Removes the background image URL.
28
- */
29
- removeBackgroundImage(): void;
30
- /**
31
- * Sets the avatar text content.
32
- * @param value The text value.
33
- */
34
- setText(value: string): void;
35
- clearText(): void;
36
- }
@@ -1,55 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Tyler Technologies, Inc.
4
- * License: Apache-2.0
5
- */
6
- import { getShadowElement, removeAllChildren } from '@tylertech/forge-core';
7
- import { BaseAdapter } from '../core/base/base-adapter';
8
- import { AVATAR_CONSTANTS } from './avatar-constants';
9
- /**
10
- * The DOM adapter behind the `<forge-avatar>` element.
11
- */
12
- export class AvatarAdapter extends BaseAdapter {
13
- constructor(component) {
14
- super(component);
15
- this._root = getShadowElement(this._component, AVATAR_CONSTANTS.selectors.ROOT);
16
- this._defaultSlot = getShadowElement(this._component, AVATAR_CONSTANTS.selectors.DEFAULT_SLOT);
17
- }
18
- /**
19
- * Sets the background image URL.
20
- * @param url The URL.
21
- */
22
- async setBackgroundImageUrl(url) {
23
- // Set before loading image to prevent a flash of background color
24
- this._root.classList.add('forge-avatar--image');
25
- return new Promise(resolve => {
26
- const image = new Image();
27
- image.onload = () => {
28
- this._root.style.backgroundImage = `url(${image.src})`;
29
- resolve(true);
30
- };
31
- image.onerror = () => {
32
- this._root.classList.remove('forge-avatar--image');
33
- resolve(false);
34
- };
35
- image.src = url;
36
- });
37
- }
38
- /**
39
- * Removes the background image URL.
40
- */
41
- removeBackgroundImage() {
42
- this._root.style.removeProperty('background-image');
43
- this._root.classList.remove('forge-avatar--image');
44
- }
45
- /**
46
- * Sets the avatar text content.
47
- * @param value The text value.
48
- */
49
- setText(value) {
50
- this._defaultSlot.textContent = value;
51
- }
52
- clearText() {
53
- removeAllChildren(this._defaultSlot);
54
- }
55
- }
@@ -1,38 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Tyler Technologies, Inc.
4
- * License: Apache-2.0
5
- */
6
- import { IAvatarAdapter } from './avatar-adapter';
7
- export interface IAvatarCore {
8
- imageUrl: string;
9
- text: string;
10
- letterCount: number;
11
- }
12
- export declare class AvatarCore implements IAvatarCore {
13
- private _adapter;
14
- private _imageUrl;
15
- private _text;
16
- private _letterCount;
17
- private _initialized;
18
- constructor(_adapter: IAvatarAdapter);
19
- initialize(): void;
20
- destroy(): void;
21
- private _render;
22
- private _setBackgroundImageUrl;
23
- private _setText;
24
- /**
25
- * Gets the text content to display in the avatar.
26
- * @param {string} value The text to parse.
27
- */
28
- private _getTextContent;
29
- /** Gets/sets the text to display. */
30
- get text(): string;
31
- set text(value: string);
32
- /** Controls the number of letters to display from the text. By default the text is split on spaces and the first character of each word is used. */
33
- get letterCount(): number;
34
- set letterCount(value: number);
35
- /** Sets the background image URL to use. */
36
- get imageUrl(): string;
37
- set imageUrl(value: string);
38
- }
@@ -1,101 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Tyler Technologies, Inc.
4
- * License: Apache-2.0
5
- */
6
- import { isDefined, isString } from '@tylertech/forge-core';
7
- import { AVATAR_CONSTANTS } from './avatar-constants';
8
- export class AvatarCore {
9
- constructor(_adapter) {
10
- this._adapter = _adapter;
11
- this._text = '';
12
- this._letterCount = AVATAR_CONSTANTS.numbers.DEFAULT_LETTER_COUNT;
13
- this._initialized = false;
14
- }
15
- initialize() {
16
- this._render();
17
- this._initialized = true;
18
- }
19
- destroy() {
20
- this._initialized = false;
21
- }
22
- _render() {
23
- this._setText();
24
- this._setBackgroundImageUrl();
25
- }
26
- async _setBackgroundImageUrl() {
27
- if (this._imageUrl) {
28
- if (await this._adapter.setBackgroundImageUrl(this._imageUrl)) {
29
- this._adapter.clearText();
30
- }
31
- }
32
- else {
33
- this._adapter.removeBackgroundImage();
34
- }
35
- }
36
- _setText() {
37
- const data = this._getTextContent(this._text, this._letterCount);
38
- if (data) {
39
- this._adapter.setText(data);
40
- }
41
- else {
42
- this._adapter.clearText();
43
- }
44
- }
45
- /**
46
- * Gets the text content to display in the avatar.
47
- * @param {string} value The text to parse.
48
- */
49
- _getTextContent(value, count) {
50
- if (!value || !isString(value) || count <= 0) {
51
- return '';
52
- }
53
- let text;
54
- if (count === 1) {
55
- text = value[0].toUpperCase();
56
- }
57
- else {
58
- const words = value.match(/\S+/g) || [];
59
- text = words.slice(0, count).reduce((prev, curr) => (prev += curr[0].toUpperCase()), '');
60
- }
61
- return text;
62
- }
63
- /** Gets/sets the text to display. */
64
- get text() {
65
- return this._text;
66
- }
67
- set text(value) {
68
- if (this._text !== value) {
69
- this._text = value || '';
70
- this._adapter.setHostAttribute(AVATAR_CONSTANTS.attributes.TEXT, this._text);
71
- if (this._initialized) {
72
- this._render();
73
- }
74
- }
75
- }
76
- /** Controls the number of letters to display from the text. By default the text is split on spaces and the first character of each word is used. */
77
- get letterCount() {
78
- return this._letterCount;
79
- }
80
- set letterCount(value) {
81
- if (this._letterCount !== value) {
82
- this._letterCount = value;
83
- this._adapter.setHostAttribute(AVATAR_CONSTANTS.attributes.LETTER_COUNT, isDefined(this._letterCount) ? this._letterCount.toString() : '');
84
- if (this._initialized) {
85
- this._render();
86
- }
87
- }
88
- }
89
- /** Sets the background image URL to use. */
90
- get imageUrl() {
91
- return this._imageUrl;
92
- }
93
- set imageUrl(value) {
94
- if (this._imageUrl !== value) {
95
- this._imageUrl = value;
96
- if (this._initialized) {
97
- this._render();
98
- }
99
- }
100
- }
101
- }